UNPKG

@capgo/cli

Version:
55 lines (54 loc) • 2.78 kB
/** * Native project archive for Capgo Builder. * * Shared by `build request` (which uploads the archive to the builder) and the * offline `build zip` packer (which only writes it to disk so an agent can upload * it through a signed URL). Everything here is local: no API key, no network. */ /** * Extract native node_modules roots that contain platform folders. */ export interface NativeDependencies { packages: Set<string>; cordovaPackages: Set<string>; usesSPM: boolean; usesCocoaPods: boolean; } export interface ZipDirectoryOptions { nodeModules?: string; } /** * Detect the iOS dependency manager the same way the Capacitor CLI does: * a Podfile in the native App folder means CocoaPods, otherwise a CapApp-SPM * package means Swift Package Manager. Reported to Capgo for build analytics. */ export declare function detectIosDependencyManager(projectDir: string, platformDir: string): 'cocoapods' | 'spm' | undefined; /** * Check if a file path should be included in the zip */ export declare function shouldIncludeFile(filePath: string, platform: 'ios' | 'android', nativeDeps: NativeDependencies, platformDir: string): boolean; /** * Zip directory for native build, including only necessary files: * - ios/ OR android/ folder (based on platform) * - node_modules with native code (from Podfile/settings.gradle) * - capacitor.config.*, package.json, package-lock.json * Zip contents are the user's responsibility, not Capgo's; Capgo packages the user-provided files as-is. */ export declare function zipDirectory(projectDir: string, outputPath: string, platform: 'ios' | 'android', capConfig: any, options?: ZipDirectoryOptions): Promise<void>; /** * Credential-map keys that tell the builder where the native project lives. * `build request` merges these into the credentials map (they are later moved to * build_options by splitPayload, never sent as secrets). */ export declare function nativeProjectDirCredentials(platform: 'ios' | 'android', nativeProjectDir: string | undefined): Record<string, string>; /** build_options fields derived from the local project layout (see splitPayload). */ export declare const PROJECT_DERIVED_BUILD_OPTION_KEYS: readonly ["iosSourceDir", "iosAppDir", "iosProjectDir", "androidSourceDir", "androidAppDir", "androidProjectDir"]; export interface LocalNativeVersionSyncOptions { syncIosVersion?: boolean; syncAndroidVersion?: boolean; } /** * Optional local version sync (--sync-ios-version / --sync-android-version), run * before the native project is archived. Edits files inside the project only. */ export declare function syncLocalNativeVersion(platform: 'ios' | 'android', projectDir: string, options: LocalNativeVersionSyncOptions, info: (message: string) => void): void;