@gfean/react-native-bundle-drop 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/BundleDropExpo.podspec +21 -0
- package/README.md +339 -74
- package/android/src/main/java/com/bundledrop/BundleDropNativePaths.kt +33 -3
- package/app.plugin.js +3 -0
- package/expo/android/build.gradle +159 -0
- package/expo/android/src/main/AndroidManifest.xml +1 -0
- package/expo/android/src/main/java/com/bundledrop/expo/BundleDropExpoConfiguration.kt +35 -0
- package/expo/android/src/main/java/com/bundledrop/expo/BundleDropExpoIdentityModule.kt +30 -0
- package/expo/android/src/main/java/com/bundledrop/expo/BundleDropExpoPackage.kt +29 -0
- package/expo/android/src/main/java/com/bundledrop/expo/BundleDropExpoReactNativeHostHandler.kt +16 -0
- package/expo/bundle-drop-expo-gradle-plugin/build.gradle +31 -0
- package/expo/bundle-drop-expo-gradle-plugin/src/main/groovy/com/bundledrop/gradle/BundleDropExpoPlugin.groovy +83 -0
- package/expo/bundle-drop-expo-gradle-plugin/src/main/groovy/com/bundledrop/gradle/GenerateBundleDropBuildIdentityTask.groovy +57 -0
- package/expo/ios/Sources/BundleDropExpoIdentity.m +31 -0
- package/expo/ios/Sources/BundleDropExpoReactDelegateHandler.swift +24 -0
- package/expo-module.config.json +19 -0
- package/ios/BundleDropLocator.swift +7 -1
- package/lib/CLI/cli.d.ts +1 -2
- package/lib/CLI/cli.js +126 -31
- package/lib/CLI/logo.d.ts +9 -0
- package/lib/CLI/logo.js +26 -0
- package/lib/CLI/scripts/aipowered/apply-setup-plan.d.ts +12 -0
- package/lib/CLI/scripts/aipowered/apply-setup-plan.js +55 -0
- package/lib/CLI/scripts/aipowered/backend-client.d.ts +6 -1
- package/lib/CLI/scripts/aipowered/backend-client.js +25 -2
- package/lib/CLI/scripts/aipowered/init-project-config.d.ts +17 -0
- package/lib/CLI/scripts/aipowered/init-project-config.js +400 -0
- package/lib/CLI/scripts/aipowered/scanner.d.ts +10 -1
- package/lib/CLI/scripts/aipowered/scanner.js +274 -5
- package/lib/CLI/scripts/aipowered/types.d.ts +39 -0
- package/lib/CLI/scripts/aipowered/validate-plan.d.ts +12 -0
- package/lib/CLI/scripts/aipowered/validate-plan.js +76 -1
- package/lib/CLI/scripts/doctor.d.ts +17 -0
- package/lib/CLI/scripts/doctor.js +412 -0
- package/lib/CLI/scripts/expo/build-receipt.d.ts +26 -0
- package/lib/CLI/scripts/expo/build-receipt.js +223 -0
- package/lib/CLI/scripts/expo/configure-expo.d.ts +28 -0
- package/lib/CLI/scripts/expo/configure-expo.js +268 -0
- package/lib/CLI/scripts/expo/eas-build-proof.d.ts +22 -0
- package/lib/CLI/scripts/expo/eas-build-proof.js +116 -0
- package/lib/CLI/scripts/expo/package-manager.d.ts +11 -0
- package/lib/CLI/scripts/expo/package-manager.js +84 -0
- package/lib/CLI/scripts/expo/write-build-receipt.d.ts +25 -0
- package/lib/CLI/scripts/expo/write-build-receipt.js +325 -0
- package/lib/CLI/scripts/expo/write-eas-build-receipt.d.ts +8 -0
- package/lib/CLI/scripts/expo/write-eas-build-receipt.js +71 -0
- package/lib/CLI/scripts/init-config.d.ts +18 -1
- package/lib/CLI/scripts/init-config.js +29 -9
- package/lib/CLI/scripts/init-metro-config.d.ts +7 -0
- package/lib/CLI/scripts/init-metro-config.js +28 -8
- package/lib/CLI/scripts/login-cli.js +17 -3
- package/lib/CLI/scripts/post-init.d.ts +6 -1
- package/lib/CLI/scripts/post-init.js +6 -33
- package/lib/CLI/scripts/upload-cli.d.ts +1 -0
- package/lib/CLI/scripts/upload-cli.js +106 -36
- package/lib/context.d.ts +0 -2
- package/lib/context.js +19 -3
- package/lib/expo/buildIdentity.d.ts +15 -0
- package/lib/expo/buildIdentity.js +201 -0
- package/lib/expo/buildReceipt.d.ts +42 -0
- package/lib/expo/buildReceipt.js +272 -0
- package/lib/expo/config.d.ts +7 -0
- package/lib/expo/config.js +43 -0
- package/lib/expo/configCache.d.ts +1 -0
- package/lib/expo/configCache.js +20 -0
- package/lib/expo/errors.d.ts +6 -0
- package/lib/expo/errors.js +11 -0
- package/lib/expo/expoUpdatesOwnership.d.ts +13 -0
- package/lib/expo/expoUpdatesOwnership.js +22 -0
- package/lib/expo/exportExpoProject.d.ts +21 -0
- package/lib/expo/exportExpoProject.js +125 -0
- package/lib/expo/exportValidation.d.ts +11 -0
- package/lib/expo/exportValidation.js +115 -0
- package/lib/expo/index.d.ts +18 -0
- package/lib/expo/index.js +25 -0
- package/lib/expo/localModules.d.ts +4 -0
- package/lib/expo/localModules.js +51 -0
- package/lib/expo/nativeIdentity.d.ts +1 -0
- package/lib/expo/nativeIdentity.js +17 -0
- package/lib/expo/projectType.d.ts +7 -0
- package/lib/expo/projectType.js +200 -0
- package/lib/expo/runtimeVersion.d.ts +13 -0
- package/lib/expo/runtimeVersion.js +45 -0
- package/lib/expo/types.d.ts +15 -0
- package/lib/expo/types.js +2 -0
- package/lib/fs/userProperties.d.ts +0 -2
- package/lib/fs/userProperties.js +0 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -2
- package/lib/loadConfig.d.ts +17 -5
- package/lib/loadConfig.js +2 -19
- package/lib/metro.d.ts +17 -0
- package/lib/metro.js +57 -0
- package/lib/native/bundleDropNative.d.ts +2 -0
- package/lib/native/bundleDropNative.js +9 -1
- package/lib/runtime/service.js +12 -1
- package/lib/scripts/bundle.d.ts +2 -2
- package/lib/scripts/bundle.js +30 -99
- package/lib/scripts/canonicalArtifact.d.ts +30 -0
- package/lib/scripts/canonicalArtifact.js +212 -0
- package/lib/scripts/download-bundle.js +1 -1
- package/lib/scripts/exportProject.d.ts +41 -0
- package/lib/scripts/exportProject.js +82 -0
- package/package.json +74 -55
- package/plugin/constants.js +9 -0
- package/plugin/expoUpdates.js +131 -0
- package/plugin/index.js +11 -0
- package/plugin/markers.js +31 -0
- package/plugin/withBundleDrop.js +36 -0
- package/plugin/xcodeBuildPhase.js +77 -0
- package/react-native.config.js +20 -0
package/lib/CLI/cli.js
CHANGED
|
@@ -8,21 +8,14 @@ exports.buildProgram = void 0;
|
|
|
8
8
|
const axios_1 = __importDefault(require("axios"));
|
|
9
9
|
const chalk_1 = __importDefault(require("chalk"));
|
|
10
10
|
const commander_1 = require("commander");
|
|
11
|
-
const figures_1 = __importDefault(require("figures"));
|
|
12
11
|
const fs_1 = __importDefault(require("fs"));
|
|
13
12
|
const os_1 = __importDefault(require("os"));
|
|
14
13
|
const path_1 = __importDefault(require("path"));
|
|
15
14
|
const upload_cli_1 = __importDefault(require("./scripts/upload-cli"));
|
|
16
15
|
const post_init_1 = require("./scripts/post-init");
|
|
16
|
+
const logo_1 = require("./logo");
|
|
17
17
|
const package_json_1 = __importDefault(require("../../package.json"));
|
|
18
|
-
const logo =
|
|
19
|
-
______ ______
|
|
20
|
-
|_ _ \\ |_ _ \`.
|
|
21
|
-
| |_) | | | \`. \\
|
|
22
|
-
| __'. | | | |
|
|
23
|
-
_| |__) |_| |_.' /
|
|
24
|
-
|_______/|______.'
|
|
25
|
-
`) + chalk_1.default.bold.cyanBright(`\n${figures_1.default.star} React Native Bundle Drop CLI ${figures_1.default.star}`);
|
|
18
|
+
const logo = (0, logo_1.buildBundleDropLogo)();
|
|
26
19
|
const DEFAULT_SERVER_URL = 'https://api.bundledrop.app';
|
|
27
20
|
const DOCS_CLI_URL = 'https://bundledrop.app/docs/cli';
|
|
28
21
|
const DOCS_UPLOADING_URL = 'https://bundledrop.app/docs/uploading';
|
|
@@ -97,16 +90,17 @@ ${chalk_1.default.bold.cyan('Available Commands:')}
|
|
|
97
90
|
${chalk_1.default.bold.cyan('Common Usage:')}
|
|
98
91
|
${chalk_1.default.gray('bundle-drop login')}
|
|
99
92
|
${chalk_1.default.gray('bundle-drop init')}
|
|
100
|
-
${chalk_1.default.gray('bundle-drop
|
|
101
|
-
${chalk_1.default.gray('bundle-drop
|
|
102
|
-
${chalk_1.default.gray('bundle-drop upload android --
|
|
93
|
+
${chalk_1.default.gray('bundle-drop doctor')}
|
|
94
|
+
${chalk_1.default.gray('bundle-drop doctor --project-type bare --platform android')}
|
|
95
|
+
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel develop')}
|
|
96
|
+
${chalk_1.default.gray('bundle-drop upload ios --plist-file ios/Info.plist --channel develop')}
|
|
97
|
+
${chalk_1.default.gray('bundle-drop upload android --buildgradle-path android/app/build.gradle --channel develop --release-notes "Fixes"')}
|
|
103
98
|
|
|
104
99
|
${chalk_1.default.gray('Docs →')} ${chalk_1.default.underline.gray(DOCS_CLI_URL)}
|
|
105
100
|
${chalk_1.default.gray('Uploading →')} ${chalk_1.default.underline.gray(DOCS_UPLOADING_URL)}
|
|
106
101
|
${chalk_1.default.gray('CI/CD →')} ${chalk_1.default.underline.gray(DOCS_CI_CD_URL)}\n`);
|
|
107
102
|
program
|
|
108
|
-
.command('upload')
|
|
109
|
-
.argument('<platform>', chalk_1.default.gray('ios or android'))
|
|
103
|
+
.command('upload <platform>')
|
|
110
104
|
.option('--plist-file <path>', 'Path to Info.plist for iOS')
|
|
111
105
|
.option('--version <version>', 'App version. iOS will fallback to --plist-file; Android can fallback to build.gradle when provided.')
|
|
112
106
|
.option('--buildgradle-path <path>', 'Optional Android build.gradle path to read versionName')
|
|
@@ -116,14 +110,15 @@ ${chalk_1.default.gray('CI/CD →')} ${chalk_1.default.underline.gray(DOCS_CI_CD
|
|
|
116
110
|
.option('--author <name>', 'Override the author name stored with the bundle')
|
|
117
111
|
.option('--sourcemap', 'Generate source maps alongside the bundle for error tracking')
|
|
118
112
|
.option('--artifact-dir <path>', 'Copy bundle, source map, and result JSON to this directory before cleanup')
|
|
113
|
+
.option('--build-receipt <path>', 'Exact local/EAS Expo build identity receipt')
|
|
119
114
|
.description(chalk_1.default.whiteBright('Bundle and upload an OTA zip to the server'))
|
|
120
115
|
.addHelpText('after', `
|
|
121
116
|
${chalk_1.default.bold('Examples:')}
|
|
122
|
-
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel
|
|
123
|
-
${chalk_1.default.gray('bundle-drop upload ios --plist-file ios/Info.plist --channel
|
|
124
|
-
${chalk_1.default.gray('bundle-drop upload android --buildgradle-path android/app/build.gradle --channel
|
|
125
|
-
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel
|
|
126
|
-
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel
|
|
117
|
+
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel develop')}
|
|
118
|
+
${chalk_1.default.gray('bundle-drop upload ios --plist-file ios/Info.plist --channel develop')}
|
|
119
|
+
${chalk_1.default.gray('bundle-drop upload android --buildgradle-path android/app/build.gradle --channel beta --release-notes "Bug fixes"')}
|
|
120
|
+
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel develop --token bdp_pat_xxx')}
|
|
121
|
+
${chalk_1.default.gray('bundle-drop upload android --version 1.2.3 --channel develop --sourcemap --artifact-dir ./build/bundledrop')}
|
|
127
122
|
|
|
128
123
|
${chalk_1.default.gray('Uploading docs →')} ${chalk_1.default.underline.gray(DOCS_UPLOADING_URL)}
|
|
129
124
|
${chalk_1.default.gray('CI/CD docs →')} ${chalk_1.default.underline.gray(DOCS_CI_CD_URL)}
|
|
@@ -145,23 +140,57 @@ ${chalk_1.default.gray('CI/CD docs →')} ${chalk_1.default.underline.gray(DOCS_
|
|
|
145
140
|
program
|
|
146
141
|
.command('login')
|
|
147
142
|
.description('Log in to the CLI')
|
|
148
|
-
.action(() =>
|
|
149
|
-
require('../CLI/scripts/login-cli').default();
|
|
150
|
-
});
|
|
143
|
+
.action(() => require('../CLI/scripts/login-cli').default());
|
|
151
144
|
program
|
|
152
145
|
.command('init')
|
|
153
146
|
.option('--token <token>', 'Personal Access Token (alternative to `bundle-drop login`)')
|
|
154
|
-
.
|
|
147
|
+
.option('--project-type <type>', 'Force project type: expo or bare')
|
|
148
|
+
.option('--dry-run', 'Preview setup and AI context without changing files')
|
|
149
|
+
.option('--migrate-expo-updates', 'Explicitly remove active expo-updates configuration and dependency')
|
|
150
|
+
.option('--prebuild', 'Run a layered Expo prebuild for committed native directories')
|
|
151
|
+
.option('--yes', 'Approve ordinary setup changes noninteractively')
|
|
152
|
+
.description('Configure Bundle Drop for Expo or bare React Native')
|
|
155
153
|
.action(async (options) => {
|
|
154
|
+
if (options.projectType && !['expo', 'bare'].includes(options.projectType)) {
|
|
155
|
+
throw new Error('--project-type must be expo or bare.');
|
|
156
|
+
}
|
|
156
157
|
if (options.token) {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
158
|
+
const { detectProjectType } = require('../expo');
|
|
159
|
+
const projectType = detectProjectType({
|
|
160
|
+
projectRoot: process.cwd(),
|
|
161
|
+
explicitType: options.projectType,
|
|
162
|
+
});
|
|
163
|
+
const serverUrl = normalizeServerUrl(process.env.BUNDLE_DROP_SERVER_URL);
|
|
164
|
+
const tokenContext = await fetchFreshAuthContext({
|
|
165
|
+
serverUrl,
|
|
166
|
+
token: options.token,
|
|
167
|
+
});
|
|
168
|
+
const initConfigModule = require('../CLI/scripts/init-config');
|
|
169
|
+
const hadConfig = initConfigModule.hasExistingBundleDropConfig();
|
|
170
|
+
const configResult = await initConfigModule.initConfig({
|
|
171
|
+
serverUrl,
|
|
172
|
+
projects: tokenContext?.projects || [],
|
|
173
|
+
organizations: tokenContext?.organizations || [],
|
|
161
174
|
downloadApiKey: '',
|
|
162
175
|
authToken: options.token,
|
|
176
|
+
dryRun: true,
|
|
177
|
+
projectType,
|
|
178
|
+
});
|
|
179
|
+
await (0, post_init_1.runPostInitPrompts)({
|
|
180
|
+
...options,
|
|
181
|
+
projectType,
|
|
182
|
+
...(!hadConfig && configResult
|
|
183
|
+
? {
|
|
184
|
+
virtualConfig: {
|
|
185
|
+
content: configResult.content,
|
|
186
|
+
serverUrl: configResult.serverUrl,
|
|
187
|
+
orgSlug: configResult.orgSlug,
|
|
188
|
+
projectSlug: configResult.projectSlug,
|
|
189
|
+
authToken: options.token,
|
|
190
|
+
},
|
|
191
|
+
}
|
|
192
|
+
: {}),
|
|
163
193
|
});
|
|
164
|
-
await (0, post_init_1.runPostInitPrompts)();
|
|
165
194
|
return;
|
|
166
195
|
}
|
|
167
196
|
const authState = readStoredAuthData();
|
|
@@ -180,6 +209,11 @@ ${chalk_1.default.gray('CI/CD docs →')} ${chalk_1.default.underline.gray(DOCS_
|
|
|
180
209
|
logInvalidAuthFile();
|
|
181
210
|
return;
|
|
182
211
|
}
|
|
212
|
+
const { detectProjectType } = require('../expo');
|
|
213
|
+
const projectType = detectProjectType({
|
|
214
|
+
projectRoot: process.cwd(),
|
|
215
|
+
explicitType: options.projectType,
|
|
216
|
+
});
|
|
183
217
|
const serverUrl = normalizeServerUrl(data.serverUrl || data.baseUrl || process.env.BUNDLE_DROP_SERVER_URL);
|
|
184
218
|
const freshContext = await fetchFreshAuthContext({
|
|
185
219
|
serverUrl,
|
|
@@ -189,19 +223,42 @@ ${chalk_1.default.gray('CI/CD docs →')} ${chalk_1.default.underline.gray(DOCS_
|
|
|
189
223
|
if (freshContext) {
|
|
190
224
|
writeStoredAuthData(authState.tokenPath, initData);
|
|
191
225
|
}
|
|
192
|
-
|
|
226
|
+
const initConfigModule = require('../CLI/scripts/init-config');
|
|
227
|
+
const hadConfig = initConfigModule.hasExistingBundleDropConfig();
|
|
228
|
+
const configResult = await initConfigModule.initConfig({
|
|
193
229
|
serverUrl,
|
|
194
230
|
projects: initData.projects || [],
|
|
195
231
|
organizations: initData.organizations || [],
|
|
196
232
|
downloadApiKey: data.downloadApiKey || '',
|
|
197
233
|
authToken: data.token,
|
|
234
|
+
dryRun: true,
|
|
235
|
+
projectType,
|
|
236
|
+
});
|
|
237
|
+
await (0, post_init_1.runPostInitPrompts)({
|
|
238
|
+
...options,
|
|
239
|
+
projectType,
|
|
240
|
+
...(!hadConfig && configResult
|
|
241
|
+
? {
|
|
242
|
+
virtualConfig: {
|
|
243
|
+
content: configResult.content,
|
|
244
|
+
serverUrl: configResult.serverUrl,
|
|
245
|
+
orgSlug: configResult.orgSlug,
|
|
246
|
+
projectSlug: configResult.projectSlug,
|
|
247
|
+
authToken: data.token,
|
|
248
|
+
},
|
|
249
|
+
}
|
|
250
|
+
: {}),
|
|
198
251
|
});
|
|
199
|
-
await (0, post_init_1.runPostInitPrompts)();
|
|
200
252
|
});
|
|
201
253
|
program
|
|
202
254
|
.command('init-native')
|
|
203
|
-
.description('
|
|
255
|
+
.description('Deprecated bare-only native setup escape hatch; use bundle-drop init')
|
|
204
256
|
.action(async () => {
|
|
257
|
+
const { detectProjectType } = require('../expo');
|
|
258
|
+
if (detectProjectType({ projectRoot: process.cwd() }) === 'expo') {
|
|
259
|
+
throw new Error('init-native is bare-only. Run `bundle-drop init` for Expo projects.');
|
|
260
|
+
}
|
|
261
|
+
console.log(chalk_1.default.yellow('init-native is deprecated; use `bundle-drop init --project-type bare`.'));
|
|
205
262
|
await require('../CLI/scripts/aipowered/init-native-config').initNativeConfigAi();
|
|
206
263
|
});
|
|
207
264
|
program
|
|
@@ -210,6 +267,44 @@ ${chalk_1.default.gray('CI/CD docs →')} ${chalk_1.default.underline.gray(DOCS_
|
|
|
210
267
|
.action(() => {
|
|
211
268
|
require('../CLI/scripts/init-metro-config').initMetroConfig();
|
|
212
269
|
});
|
|
270
|
+
program
|
|
271
|
+
.command('doctor')
|
|
272
|
+
.option('--platform <platform>', 'Limit checks to ios or android')
|
|
273
|
+
.option('--project-type <type>', 'Force project type: expo or bare')
|
|
274
|
+
.description('Validate Bundle Drop setup, runtime identity, and OTA startup ownership')
|
|
275
|
+
.addHelpText('after', `
|
|
276
|
+
${chalk_1.default.bold('Examples:')}
|
|
277
|
+
${chalk_1.default.gray('bundle-drop doctor')}
|
|
278
|
+
${chalk_1.default.gray('bundle-drop doctor --platform ios')}
|
|
279
|
+
${chalk_1.default.gray('bundle-drop doctor --project-type bare --platform android')}
|
|
280
|
+
`)
|
|
281
|
+
.action(async (options) => {
|
|
282
|
+
if (options.platform && !['ios', 'android'].includes(options.platform)) {
|
|
283
|
+
throw new Error('--platform must be ios or android.');
|
|
284
|
+
}
|
|
285
|
+
if (options.projectType && !['expo', 'bare'].includes(options.projectType)) {
|
|
286
|
+
throw new Error('--project-type must be expo or bare.');
|
|
287
|
+
}
|
|
288
|
+
await require('./scripts/doctor').runDoctor(options);
|
|
289
|
+
});
|
|
290
|
+
program
|
|
291
|
+
.command('eas-receipt <platform>')
|
|
292
|
+
.requiredOption('--build-id <id>', 'Exact finished EAS application build ID')
|
|
293
|
+
.option('--output <path>', 'Receipt path; defaults under .bundle-drop')
|
|
294
|
+
.description('Create an authenticated Expo build receipt from official EAS metadata')
|
|
295
|
+
.action(async (platform, options) => {
|
|
296
|
+
if (platform !== 'ios' && platform !== 'android') {
|
|
297
|
+
throw new Error('eas-receipt platform must be ios or android.');
|
|
298
|
+
}
|
|
299
|
+
const receiptPath = await require('./scripts/expo/write-eas-build-receipt')
|
|
300
|
+
.writeEasBuildReceipt({
|
|
301
|
+
projectRoot: process.cwd(),
|
|
302
|
+
platform,
|
|
303
|
+
easBuildId: options.buildId,
|
|
304
|
+
outputPath: options.output,
|
|
305
|
+
});
|
|
306
|
+
console.log(chalk_1.default.green(`EAS build receipt written to ${receiptPath}`));
|
|
307
|
+
});
|
|
213
308
|
program
|
|
214
309
|
.command('whoami')
|
|
215
310
|
.description('Show currently logged in user')
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 24-bit truecolor half-block render of the Bundle Drop logo. */
|
|
2
|
+
export declare const BUNDLE_DROP_LOGO_TRUECOLOR = "\u001B[0m \u001B[38;2;49;219;247m\u001B[48;2;53;239;251m\u2580\u001B[38;2;53;236;252m\u001B[48;2;52;233;251m\u2580\u001B[38;2;54;243;255m\u001B[48;2;49;225;247m\u2580\u001B[38;2;52;232;250m\u001B[48;2;51;229;249m\u2580\u001B[38;2;51;233;251m\u001B[48;2;53;238;255m\u2580\u001B[38;2;52;235;252m\u001B[49m\u2584\u001B[38;2;51;231;250m\u2584\u001B[0m \u001B[38;2;52;231;249m\u2584\u001B[38;2;52;235;252m\u2584\u001B[38;2;52;233;251m\u001B[48;2;53;238;255m\u2580\u001B[38;2;51;232;250m\u001B[48;2;51;228;248m\u2580\u001B[38;2;55;243;255m\u001B[48;2;51;225;247m\u2580\u001B[38;2;52;236;252m\u001B[48;2;52;232;251m\u2580\u001B[38;2;50;220;243m\u001B[48;2;53;238;251m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;227;249m\u001B[48;2;51;227;248m\u2580\u001B[38;2;54;240;253m\u001B[48;2;50;226;246m\u2580\u001B[0m \u001B[38;2;52;233;251m\u2580\u001B[38;2;58;255;255m\u001B[48;2;50;229;248m\u2580\u001B[38;2;52;236;250m\u001B[48;2;54;241;251m\u2580\u001B[38;2;51;232;251m\u001B[49m\u2584\u001B[38;2;51;231;249m\u2584\u001B[38;2;53;236;250m\u001B[48;2;54;241;252m\u2580\u001B[38;2;57;255;255m\u001B[48;2;52;231;249m\u2580\u001B[38;2;51;233;250m\u001B[49m\u2580\u001B[0m \u001B[38;2;55;246;255m\u001B[48;2;50;225;247m\u2580\u001B[38;2;51;228;248m\u001B[48;2;51;227;247m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;228;248m\u001B[48;2;51;228;248m\u2580\u001B[38;2;50;228;247m\u001B[48;2;50;229;248m\u2580\u001B[0m \u001B[38;2;46;212;243m\u001B[48;2;53;240;252m\u2580\u001B[38;2;55;247;255m\u001B[48;2;51;232;251m\u2580\u001B[38;2;57;253;255m\u001B[48;2;52;233;252m\u2580\u001B[38;2;47;216;245m\u001B[48;2;54;239;251m\u2580\u001B[0m \u001B[38;2;51;227;247m\u001B[48;2;50;227;246m\u2580\u001B[38;2;50;227;248m\u001B[48;2;51;227;247m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;227;247m\u001B[48;2;49;227;247m\u2580\u001B[38;2;51;226;248m\u001B[48;2;53;237;253m\u2580\u001B[0m \u001B[38;2;52;232;249m\u2584\u001B[38;2;52;234;251m\u001B[48;2;56;251;255m\u2580\u001B[38;2;54;240;251m\u001B[48;2;48;218;243m\u2580\u001B[0m \u001B[38;2;54;241;251m\u001B[48;2;48;221;243m\u2580\u001B[38;2;52;234;251m\u001B[48;2;57;252;255m\u2580\u001B[38;2;52;231;249m\u001B[49m\u2584\u001B[0m \u001B[38;2;51;228;248m\u001B[48;2;54;242;255m\u2580\u001B[38;2;50;227;248m\u001B[48;2;51;226;249m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;52;233;251m\u2584\u001B[38;2;52;233;250m\u2584\u001B[38;2;51;232;250m\u001B[48;2;54;241;255m\u2580\u001B[38;2;54;239;253m\u001B[48;2;52;231;251m\u2580\u001B[38;2;51;228;248m\u001B[48;2;51;229;248m\u2580\u001B[38;2;51;228;247m\u001B[48;2;51;228;249m\u2580\u001B[38;2;51;229;248m\u001B[48;2;51;228;248m\u2580\u001B[38;2;51;227;248m\u001B[48;2;54;242;255m\u2580\u001B[38;2;57;254;255m\u001B[48;2;49;228;248m\u2580\u001B[38;2;49;224;246m\u001B[49m\u2580\u001B[0m \u001B[38;2;2;205;235m\u001B[48;2;1;209;238m\u2580\u001B[38;2;2;203;233m\u2580\u001B[0m \u001B[38;2;48;224;246m\u2580\u001B[38;2;57;253;255m\u001B[48;2;51;226;248m\u2580\u001B[38;2;50;227;248m\u001B[48;2;55;244;255m\u2580\u001B[38;2;51;228;248m\u001B[48;2;50;226;246m\u2580\u001B[48;2;51;228;249m\u2580\u001B[38;2;50;227;247m\u001B[48;2;51;227;247m\u2580\u001B[38;2;53;237;252m\u001B[48;2;51;230;250m\u2580\u001B[38;2;52;231;250m\u001B[48;2;53;239;255m\u2580\u001B[38;2;52;232;250m\u001B[49m\u2584\u001B[38;2;52;234;251m\u2584\u001B[38;2;49;230;250m\u2584\u001B[0m\n\u001B[0m \u001B[38;2;52;234;249m\u2584\u001B[38;2;51;232;249m\u001B[48;2;56;251;255m\u2580\u001B[38;2;55;247;255m\u001B[48;2;51;232;250m\u2580\u001B[38;2;52;233;251m\u001B[49m\u2580\u001B[38;2;51;233;251m\u2580\u001B[38;2;51;224;246m\u2580\u001B[38;2;50;230;248m\u001B[48;2;52;228;246m\u2580\u001B[38;2;52;234;251m\u001B[48;2;54;241;255m\u2580\u001B[38;2;49;224;247m\u001B[49m\u2584\u001B[38;2;50;226;246m\u001B[48;2;53;238;255m\u2580\u001B[38;2;54;241;252m\u001B[48;2;49;224;246m\u2580\u001B[0m \u001B[38;2;1;205;233m\u2584\u001B[38;2;1;207;236m\u001B[48;2;1;220;251m\u2580\u001B[38;2;1;213;243m\u001B[48;2;1;214;244m\u2580\u001B[38;2;1;212;242m\u001B[48;2;1;217;247m\u2580\u001B[38;2;1;206;236m\u001B[48;2;1;221;252m\u2580\u001B[38;2;1;203;234m\u001B[49m\u2584\u001B[0m \u001B[38;2;54;241;251m\u001B[48;2;49;223;246m\u2580\u001B[38;2;50;226;247m\u001B[48;2;54;239;255m\u2580\u001B[38;2;50;226;248m\u001B[49m\u2584\u001B[38;2;52;236;251m\u001B[48;2;53;239;255m\u2580\u001B[38;2;51;229;248m\u001B[49m\u2580\u001B[0m \u001B[38;2;51;234;251m\u2580\u001B[38;2;52;233;250m\u2580\u001B[38;2;56;249;255m\u001B[48;2;51;232;250m\u2580\u001B[38;2;51;234;250m\u001B[48;2;56;249;255m\u2580\u001B[38;2;52;235;251m\u001B[49m\u2584\u001B[0m\n\u001B[38;2;50;226;247m\u001B[48;2;54;243;255m\u2580\u001B[38;2;55;244;255m\u001B[48;2;50;226;247m\u2580\u001B[38;2;51;227;247m\u001B[49m\u2580\u001B[0m \u001B[38;2;50;226;247m\u001B[48;2;51;230;248m\u2580\u001B[38;2;56;251;255m\u001B[48;2;57;255;255m\u2580\u001B[38;2;50;229;249m\u001B[48;2;56;230;247m\u2580\u001B[0m \u001B[38;2;3;200;231m\u001B[48;2;2;212;241m\u2580\u001B[38;2;1;230;255m\u001B[48;2;1;218;247m\u2580\u001B[38;2;1;217;248m\u001B[48;2;0;206;233m\u2580\u001B[38;2;1;205;233m\u001B[48;2;0;210;240m\u2580\u001B[38;2;1;205;234m\u001B[48;2;0;208;237m\u2580\u001B[38;2;1;212;242m\u001B[49m\u2580\u001B[38;2;1;232;255m\u001B[48;2;1;219;248m\u2580\u001B[38;2;3;204;234m\u001B[48;2;2;212;241m\u2580\u001B[0m \u001B[38;2;50;229;249m\u001B[48;2;55;230;248m\u2580\u001B[38;2;57;254;255m\u001B[48;2;57;254;255m\u2580\u001B[38;2;51;226;247m\u001B[48;2;51;227;249m\u2580\u001B[0m \u001B[38;2;50;224;247m\u2580\u001B[38;2;55;245;255m\u001B[48;2;49;223;247m\u2580\u001B[38;2;50;226;247m\u001B[48;2;55;244;255m\u2580\u001B[0m\n\u001B[38;2;52;234;251m\u001B[48;2;49;225;246m\u2580\u001B[38;2;50;229;248m\u001B[48;2;57;255;255m\u2580\u001B[38;2;52;231;247m\u001B[49m\u2584\u001B[0m \u001B[38;2;51;226;247m\u001B[48;2;51;232;249m\u2580\u001B[38;2;51;228;249m\u001B[48;2;60;229;249m\u2580\u001B[38;2;0;199;231m\u001B[49m\u2584\u001B[38;2;1;205;234m\u001B[48;2;2;206;235m\u2580\u001B[38;2;0;213;244m\u001B[49m\u2580\u001B[38;2;0;197;228m\u001B[48;2;0;207;238m\u2580\u001B[38;2;1;214;242m\u001B[48;2;0;209;238m\u2580\u001B[38;2;1;213;242m\u001B[48;2;0;201;230m\u2580\u001B[38;2;0;205;232m\u001B[48;2;1;214;242m\u2580\u001B[38;2;0;212;240m\u001B[48;2;1;215;243m\u2580\u001B[38;2;0;205;234m\u001B[48;2;0;202;234m\u2580\u001B[38;2;0;213;243m\u001B[49m\u2580\u001B[38;2;1;204;234m\u001B[48;2;2;207;236m\u2580\u001B[38;2;0;199;230m\u001B[49m\u2584\u001B[38;2;50;229;249m\u001B[48;2;58;232;249m\u2580\u001B[38;2;50;225;247m\u001B[48;2;51;234;250m\u2580\u001B[0m \u001B[38;2;51;230;248m\u2584\u001B[38;2;51;229;248m\u001B[48;2;57;255;255m\u2580\u001B[38;2;52;234;251m\u001B[48;2;50;225;246m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;230;248m\u2580\u001B[38;2;58;255;255m\u001B[48;2;50;228;247m\u2580\u001B[38;2;53;233;251m\u001B[48;2;52;236;252m\u2580\u001B[38;2;54;241;255m\u001B[49m\u2584\u001B[38;2;52;230;249m\u2584\u001B[38;2;51;226;249m\u2584\u001B[38;2;50;225;246m\u001B[48;2;52;229;249m\u2580\u001B[38;2;55;249;255m\u001B[48;2;51;233;251m\u2580\u001B[0m \u001B[38;2;0;204;233m\u001B[48;2;0;204;234m\u2580\u001B[38;2;1;206;236m\u001B[48;2;1;205;234m\u2580\u001B[38;2;0;208;237m\u001B[48;2;0;208;237m\u2580\u001B[38;2;1;205;233m\u001B[48;2;1;209;239m\u2580\u001B[38;2;0;207;236m\u001B[49m\u2584\u001B[38;2;0;209;236m\u001B[48;2;0;205;233m\u2580\u001B[38;2;0;213;242m\u001B[48;2;0;205;235m\u2580\u001B[38;2;0;205;235m\u001B[48;2;1;229;255m\u2580\u001B[38;2;1;220;248m\u001B[48;2;1;227;255m\u2580\u001B[38;2;0;205;234m\u001B[48;2;0;208;233m\u2580\u001B[38;2;1;206;235m\u001B[48;2;1;206;235m\u2580\u001B[38;2;0;204;233m\u001B[48;2;0;205;234m\u2580\u001B[0m \u001B[38;2;55;250;255m\u001B[48;2;51;232;251m\u2580\u001B[38;2;50;228;247m\u001B[48;2;51;229;249m\u2580\u001B[38;2;49;225;247m\u001B[49m\u2584\u001B[38;2;51;233;249m\u2584\u001B[38;2;55;244;255m\u2584\u001B[38;2;53;233;252m\u001B[48;2;53;235;252m\u2580\u001B[38;2;58;255;255m\u001B[48;2;51;228;246m\u2580\u001B[38;2;51;228;247m\u001B[49m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;234;250m\u2580\u001B[38;2;52;233;251m\u2580\u001B[38;2;54;239;255m\u001B[48;2;51;231;250m\u2580\u001B[38;2;53;235;255m\u001B[48;2;53;236;253m\u2580\u001B[38;2;51;233;254m\u001B[48;2;49;227;248m\u2580\u001B[0m \u001B[38;2;0;205;234m\u2580\u001B[38;2;1;206;234m\u001B[48;2;1;205;234m\u2580\u001B[0m \u001B[38;2;1;230;255m\u001B[48;2;0;205;232m\u2580\u001B[38;2;1;236;255m\u001B[48;2;1;223;249m\u2580\u001B[38;2;0;207;235m\u001B[48;2;0;206;234m\u2580\u001B[38;2;0;205;236m\u001B[48;2;0;204;233m\u2580\u001B[38;2;1;231;255m\u001B[48;2;1;222;249m\u2580\u001B[38;2;1;224;255m\u001B[48;2;0;206;234m\u2580\u001B[0m \u001B[38;2;1;205;234m\u001B[48;2;1;206;235m\u2580\u001B[38;2;0;204;234m\u001B[48;2;0;200;230m\u2580\u001B[0m \u001B[38;2;51;232;253m\u001B[48;2;49;227;247m\u2580\u001B[38;2;53;235;255m\u001B[48;2;53;236;253m\u2580\u001B[38;2;54;241;255m\u001B[48;2;51;230;248m\u2580\u001B[38;2;52;232;251m\u001B[49m\u2580\u001B[38;2;52;233;252m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;51;226;247m\u001B[48;2;51;228;248m\u2580\u001B[38;2;51;230;249m\u001B[48;2;50;227;246m\u2580\u001B[0m \u001B[38;2;1;206;236m\u2580\u001B[38;2;1;219;246m\u001B[48;2;1;208;237m\u2580\u001B[38;2;0;209;240m\u001B[48;2;1;242;255m\u2580\u001B[38;2;1;211;241m\u001B[49m\u2584\u001B[38;2;0;205;234m\u2584\u2584\u001B[38;2;1;211;241m\u2584\u001B[38;2;0;208;238m\u001B[48;2;1;242;255m\u2580\u001B[38;2;1;220;246m\u001B[48;2;1;208;237m\u2580\u001B[38;2;1;207;234m\u001B[49m\u2580\u001B[0m \u001B[38;2;51;228;248m\u001B[48;2;51;228;248m\u2580\u001B[38;2;51;226;247m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;50;227;247m\u001B[48;2;51;228;248m\u2580\u001B[38;2;50;227;248m\u001B[48;2;50;229;248m\u2580\u001B[0m \u001B[38;2;2;208;238m\u2580\u001B[38;2;2;212;241m\u2580\u001B[38;2;2;210;239m\u2580\u001B[38;2;2;209;239m\u2580\u001B[38;2;2;211;241m\u2580\u001B[38;2;2;211;239m\u2580\u001B[0m \u001B[38;2;51;227;247m\u001B[48;2;51;228;247m\u2580\u001B[38;2;51;227;248m\u001B[48;2;50;229;248m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;50;227;247m\u001B[48;2;50;228;247m\u2580\u001B[38;2;51;224;247m\u001B[48;2;54;239;251m\u2580\u001B[0m \u001B[38;2;51;230;250m\u2584\u001B[38;2;54;242;255m\u2584\u001B[38;2;53;240;253m\u001B[48;2;53;238;251m\u2580\u001B[38;2;52;228;247m\u001B[48;2;49;225;245m\u2580\u001B[38;2;52;229;249m\u001B[48;2;52;228;248m\u2580\u001B[38;2;53;238;252m\u001B[48;2;53;240;251m\u2580\u001B[38;2;53;237;252m\u001B[49m\u2584\u001B[38;2;51;231;250m\u2584\u001B[0m \u001B[38;2;51;225;247m\u001B[48;2;55;245;255m\u2580\u001B[38;2;50;227;247m\u001B[48;2;50;227;249m\u2580\u001B[0m\n\u001B[0m \u001B[38;2;53;238;251m\u001B[48;2;48;219;246m\u2580\u001B[38;2;52;233;252m\u001B[48;2;52;236;252m\u2580\u001B[38;2;50;227;247m\u001B[48;2;53;239;255m\u2580\u001B[38;2;51;228;248m\u001B[48;2;52;234;253m\u2580\u001B[38;2;52;232;250m\u001B[48;2;52;233;250m\u2580\u001B[38;2;55;244;255m\u001B[48;2;51;226;245m\u2580\u001B[38;2;53;234;251m\u001B[49m\u2580\u001B[0m \u001B[38;2;52;233;250m\u2580\u001B[38;2;56;249;255m\u001B[48;2;51;229;247m\u2580\u001B[38;2;51;232;250m\u001B[48;2;52;234;250m\u2580\u001B[38;2;50;226;247m\u001B[48;2;52;233;252m\u2580\u001B[38;2;51;225;245m\u001B[48;2;54;241;255m\u2580\u001B[38;2;52;234;251m\u001B[48;2;53;236;252m\u2580\u001B[38;2;53;237;251m\u001B[48;2;50;218;245m\u2580\u001B[0m";
|
|
3
|
+
/** Monochrome silhouette (glyphs only); colorized at runtime for non-truecolor terminals. */
|
|
4
|
+
export declare const BUNDLE_DROP_LOGO_MONO = " \u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2584\u2584\u2588\u2588\u2588\u2588\u2588\n \u2588\u2588 \u2580\u2588\u2588\u2584\u2584\u2588\u2588\u2580 \u2588\u2588\n \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2584\u2588\u2588 \u2588\u2588\u2584 \u2588\u2588\n \u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580 \u2588\u2588 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584\n \u2584\u2588\u2588\u2580\u2580\u2580\u2588\u2588\u2584\u2588\u2588 \u2584\u2588\u2588\u2588\u2588\u2584 \u2588\u2588\u2584\u2588\u2580 \u2580\u2580\u2588\u2588\u2584\n\u2588\u2588\u2580 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2580\u2588\u2588 \u2588\u2588\u2588 \u2580\u2588\u2588\n\u2588\u2588\u2584 \u2588\u2588\u2584\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\u2584\u2588\u2588 \u2584\u2588\u2588\n \u2580\u2588\u2588\u2584\u2584\u2584\u2588\u2588 \u2588\u2588\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2584\u2584\u2584\u2588\u2588\u2580\n \u2580\u2580\u2588\u2588\u2588 \u2580\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2580\u2580\n \u2588\u2588 \u2580\u2588\u2588\u2584\u2584\u2584\u2584\u2588\u2588\u2580 \u2588\u2588\n \u2588\u2588 \u2580\u2580\u2580\u2580\u2580\u2580 \u2588\u2588\n \u2588\u2588 \u2584\u2584\u2588\u2588\u2588\u2588\u2584\u2584 \u2588\u2588\n \u2588\u2588\u2588\u2588\u2588\u2588\u2580 \u2580\u2588\u2588\u2588\u2588\u2588\u2588";
|
|
5
|
+
/**
|
|
6
|
+
* Builds the CLI banner. Truecolor terminals get the full-color logo; every
|
|
7
|
+
* other terminal falls back to a cyan silhouette so the banner still renders.
|
|
8
|
+
*/
|
|
9
|
+
export declare const buildBundleDropLogo: () => string;
|
package/lib/CLI/logo.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// AUTO-GENERATED from bundle-drop-logo-no-bg.png (half-block render, width 32).
|
|
3
|
+
// The string constants below are generated; regenerate rather than hand-editing them.
|
|
4
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
+
};
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.buildBundleDropLogo = exports.BUNDLE_DROP_LOGO_MONO = exports.BUNDLE_DROP_LOGO_TRUECOLOR = void 0;
|
|
9
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
10
|
+
const figures_1 = __importDefault(require("figures"));
|
|
11
|
+
/** 24-bit truecolor half-block render of the Bundle Drop logo. */
|
|
12
|
+
exports.BUNDLE_DROP_LOGO_TRUECOLOR = "\u001b[0m \u001b[38;2;49;219;247m\u001b[48;2;53;239;251m\u2580\u001b[38;2;53;236;252m\u001b[48;2;52;233;251m\u2580\u001b[38;2;54;243;255m\u001b[48;2;49;225;247m\u2580\u001b[38;2;52;232;250m\u001b[48;2;51;229;249m\u2580\u001b[38;2;51;233;251m\u001b[48;2;53;238;255m\u2580\u001b[38;2;52;235;252m\u001b[49m\u2584\u001b[38;2;51;231;250m\u2584\u001b[0m \u001b[38;2;52;231;249m\u2584\u001b[38;2;52;235;252m\u2584\u001b[38;2;52;233;251m\u001b[48;2;53;238;255m\u2580\u001b[38;2;51;232;250m\u001b[48;2;51;228;248m\u2580\u001b[38;2;55;243;255m\u001b[48;2;51;225;247m\u2580\u001b[38;2;52;236;252m\u001b[48;2;52;232;251m\u2580\u001b[38;2;50;220;243m\u001b[48;2;53;238;251m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;227;249m\u001b[48;2;51;227;248m\u2580\u001b[38;2;54;240;253m\u001b[48;2;50;226;246m\u2580\u001b[0m \u001b[38;2;52;233;251m\u2580\u001b[38;2;58;255;255m\u001b[48;2;50;229;248m\u2580\u001b[38;2;52;236;250m\u001b[48;2;54;241;251m\u2580\u001b[38;2;51;232;251m\u001b[49m\u2584\u001b[38;2;51;231;249m\u2584\u001b[38;2;53;236;250m\u001b[48;2;54;241;252m\u2580\u001b[38;2;57;255;255m\u001b[48;2;52;231;249m\u2580\u001b[38;2;51;233;250m\u001b[49m\u2580\u001b[0m \u001b[38;2;55;246;255m\u001b[48;2;50;225;247m\u2580\u001b[38;2;51;228;248m\u001b[48;2;51;227;247m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;228;248m\u001b[48;2;51;228;248m\u2580\u001b[38;2;50;228;247m\u001b[48;2;50;229;248m\u2580\u001b[0m \u001b[38;2;46;212;243m\u001b[48;2;53;240;252m\u2580\u001b[38;2;55;247;255m\u001b[48;2;51;232;251m\u2580\u001b[38;2;57;253;255m\u001b[48;2;52;233;252m\u2580\u001b[38;2;47;216;245m\u001b[48;2;54;239;251m\u2580\u001b[0m \u001b[38;2;51;227;247m\u001b[48;2;50;227;246m\u2580\u001b[38;2;50;227;248m\u001b[48;2;51;227;247m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;227;247m\u001b[48;2;49;227;247m\u2580\u001b[38;2;51;226;248m\u001b[48;2;53;237;253m\u2580\u001b[0m \u001b[38;2;52;232;249m\u2584\u001b[38;2;52;234;251m\u001b[48;2;56;251;255m\u2580\u001b[38;2;54;240;251m\u001b[48;2;48;218;243m\u2580\u001b[0m \u001b[38;2;54;241;251m\u001b[48;2;48;221;243m\u2580\u001b[38;2;52;234;251m\u001b[48;2;57;252;255m\u2580\u001b[38;2;52;231;249m\u001b[49m\u2584\u001b[0m \u001b[38;2;51;228;248m\u001b[48;2;54;242;255m\u2580\u001b[38;2;50;227;248m\u001b[48;2;51;226;249m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;52;233;251m\u2584\u001b[38;2;52;233;250m\u2584\u001b[38;2;51;232;250m\u001b[48;2;54;241;255m\u2580\u001b[38;2;54;239;253m\u001b[48;2;52;231;251m\u2580\u001b[38;2;51;228;248m\u001b[48;2;51;229;248m\u2580\u001b[38;2;51;228;247m\u001b[48;2;51;228;249m\u2580\u001b[38;2;51;229;248m\u001b[48;2;51;228;248m\u2580\u001b[38;2;51;227;248m\u001b[48;2;54;242;255m\u2580\u001b[38;2;57;254;255m\u001b[48;2;49;228;248m\u2580\u001b[38;2;49;224;246m\u001b[49m\u2580\u001b[0m \u001b[38;2;2;205;235m\u001b[48;2;1;209;238m\u2580\u001b[38;2;2;203;233m\u2580\u001b[0m \u001b[38;2;48;224;246m\u2580\u001b[38;2;57;253;255m\u001b[48;2;51;226;248m\u2580\u001b[38;2;50;227;248m\u001b[48;2;55;244;255m\u2580\u001b[38;2;51;228;248m\u001b[48;2;50;226;246m\u2580\u001b[48;2;51;228;249m\u2580\u001b[38;2;50;227;247m\u001b[48;2;51;227;247m\u2580\u001b[38;2;53;237;252m\u001b[48;2;51;230;250m\u2580\u001b[38;2;52;231;250m\u001b[48;2;53;239;255m\u2580\u001b[38;2;52;232;250m\u001b[49m\u2584\u001b[38;2;52;234;251m\u2584\u001b[38;2;49;230;250m\u2584\u001b[0m\n\u001b[0m \u001b[38;2;52;234;249m\u2584\u001b[38;2;51;232;249m\u001b[48;2;56;251;255m\u2580\u001b[38;2;55;247;255m\u001b[48;2;51;232;250m\u2580\u001b[38;2;52;233;251m\u001b[49m\u2580\u001b[38;2;51;233;251m\u2580\u001b[38;2;51;224;246m\u2580\u001b[38;2;50;230;248m\u001b[48;2;52;228;246m\u2580\u001b[38;2;52;234;251m\u001b[48;2;54;241;255m\u2580\u001b[38;2;49;224;247m\u001b[49m\u2584\u001b[38;2;50;226;246m\u001b[48;2;53;238;255m\u2580\u001b[38;2;54;241;252m\u001b[48;2;49;224;246m\u2580\u001b[0m \u001b[38;2;1;205;233m\u2584\u001b[38;2;1;207;236m\u001b[48;2;1;220;251m\u2580\u001b[38;2;1;213;243m\u001b[48;2;1;214;244m\u2580\u001b[38;2;1;212;242m\u001b[48;2;1;217;247m\u2580\u001b[38;2;1;206;236m\u001b[48;2;1;221;252m\u2580\u001b[38;2;1;203;234m\u001b[49m\u2584\u001b[0m \u001b[38;2;54;241;251m\u001b[48;2;49;223;246m\u2580\u001b[38;2;50;226;247m\u001b[48;2;54;239;255m\u2580\u001b[38;2;50;226;248m\u001b[49m\u2584\u001b[38;2;52;236;251m\u001b[48;2;53;239;255m\u2580\u001b[38;2;51;229;248m\u001b[49m\u2580\u001b[0m \u001b[38;2;51;234;251m\u2580\u001b[38;2;52;233;250m\u2580\u001b[38;2;56;249;255m\u001b[48;2;51;232;250m\u2580\u001b[38;2;51;234;250m\u001b[48;2;56;249;255m\u2580\u001b[38;2;52;235;251m\u001b[49m\u2584\u001b[0m\n\u001b[38;2;50;226;247m\u001b[48;2;54;243;255m\u2580\u001b[38;2;55;244;255m\u001b[48;2;50;226;247m\u2580\u001b[38;2;51;227;247m\u001b[49m\u2580\u001b[0m \u001b[38;2;50;226;247m\u001b[48;2;51;230;248m\u2580\u001b[38;2;56;251;255m\u001b[48;2;57;255;255m\u2580\u001b[38;2;50;229;249m\u001b[48;2;56;230;247m\u2580\u001b[0m \u001b[38;2;3;200;231m\u001b[48;2;2;212;241m\u2580\u001b[38;2;1;230;255m\u001b[48;2;1;218;247m\u2580\u001b[38;2;1;217;248m\u001b[48;2;0;206;233m\u2580\u001b[38;2;1;205;233m\u001b[48;2;0;210;240m\u2580\u001b[38;2;1;205;234m\u001b[48;2;0;208;237m\u2580\u001b[38;2;1;212;242m\u001b[49m\u2580\u001b[38;2;1;232;255m\u001b[48;2;1;219;248m\u2580\u001b[38;2;3;204;234m\u001b[48;2;2;212;241m\u2580\u001b[0m \u001b[38;2;50;229;249m\u001b[48;2;55;230;248m\u2580\u001b[38;2;57;254;255m\u001b[48;2;57;254;255m\u2580\u001b[38;2;51;226;247m\u001b[48;2;51;227;249m\u2580\u001b[0m \u001b[38;2;50;224;247m\u2580\u001b[38;2;55;245;255m\u001b[48;2;49;223;247m\u2580\u001b[38;2;50;226;247m\u001b[48;2;55;244;255m\u2580\u001b[0m\n\u001b[38;2;52;234;251m\u001b[48;2;49;225;246m\u2580\u001b[38;2;50;229;248m\u001b[48;2;57;255;255m\u2580\u001b[38;2;52;231;247m\u001b[49m\u2584\u001b[0m \u001b[38;2;51;226;247m\u001b[48;2;51;232;249m\u2580\u001b[38;2;51;228;249m\u001b[48;2;60;229;249m\u2580\u001b[38;2;0;199;231m\u001b[49m\u2584\u001b[38;2;1;205;234m\u001b[48;2;2;206;235m\u2580\u001b[38;2;0;213;244m\u001b[49m\u2580\u001b[38;2;0;197;228m\u001b[48;2;0;207;238m\u2580\u001b[38;2;1;214;242m\u001b[48;2;0;209;238m\u2580\u001b[38;2;1;213;242m\u001b[48;2;0;201;230m\u2580\u001b[38;2;0;205;232m\u001b[48;2;1;214;242m\u2580\u001b[38;2;0;212;240m\u001b[48;2;1;215;243m\u2580\u001b[38;2;0;205;234m\u001b[48;2;0;202;234m\u2580\u001b[38;2;0;213;243m\u001b[49m\u2580\u001b[38;2;1;204;234m\u001b[48;2;2;207;236m\u2580\u001b[38;2;0;199;230m\u001b[49m\u2584\u001b[38;2;50;229;249m\u001b[48;2;58;232;249m\u2580\u001b[38;2;50;225;247m\u001b[48;2;51;234;250m\u2580\u001b[0m \u001b[38;2;51;230;248m\u2584\u001b[38;2;51;229;248m\u001b[48;2;57;255;255m\u2580\u001b[38;2;52;234;251m\u001b[48;2;50;225;246m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;230;248m\u2580\u001b[38;2;58;255;255m\u001b[48;2;50;228;247m\u2580\u001b[38;2;53;233;251m\u001b[48;2;52;236;252m\u2580\u001b[38;2;54;241;255m\u001b[49m\u2584\u001b[38;2;52;230;249m\u2584\u001b[38;2;51;226;249m\u2584\u001b[38;2;50;225;246m\u001b[48;2;52;229;249m\u2580\u001b[38;2;55;249;255m\u001b[48;2;51;233;251m\u2580\u001b[0m \u001b[38;2;0;204;233m\u001b[48;2;0;204;234m\u2580\u001b[38;2;1;206;236m\u001b[48;2;1;205;234m\u2580\u001b[38;2;0;208;237m\u001b[48;2;0;208;237m\u2580\u001b[38;2;1;205;233m\u001b[48;2;1;209;239m\u2580\u001b[38;2;0;207;236m\u001b[49m\u2584\u001b[38;2;0;209;236m\u001b[48;2;0;205;233m\u2580\u001b[38;2;0;213;242m\u001b[48;2;0;205;235m\u2580\u001b[38;2;0;205;235m\u001b[48;2;1;229;255m\u2580\u001b[38;2;1;220;248m\u001b[48;2;1;227;255m\u2580\u001b[38;2;0;205;234m\u001b[48;2;0;208;233m\u2580\u001b[38;2;1;206;235m\u001b[48;2;1;206;235m\u2580\u001b[38;2;0;204;233m\u001b[48;2;0;205;234m\u2580\u001b[0m \u001b[38;2;55;250;255m\u001b[48;2;51;232;251m\u2580\u001b[38;2;50;228;247m\u001b[48;2;51;229;249m\u2580\u001b[38;2;49;225;247m\u001b[49m\u2584\u001b[38;2;51;233;249m\u2584\u001b[38;2;55;244;255m\u2584\u001b[38;2;53;233;252m\u001b[48;2;53;235;252m\u2580\u001b[38;2;58;255;255m\u001b[48;2;51;228;246m\u2580\u001b[38;2;51;228;247m\u001b[49m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;234;250m\u2580\u001b[38;2;52;233;251m\u2580\u001b[38;2;54;239;255m\u001b[48;2;51;231;250m\u2580\u001b[38;2;53;235;255m\u001b[48;2;53;236;253m\u2580\u001b[38;2;51;233;254m\u001b[48;2;49;227;248m\u2580\u001b[0m \u001b[38;2;0;205;234m\u2580\u001b[38;2;1;206;234m\u001b[48;2;1;205;234m\u2580\u001b[0m \u001b[38;2;1;230;255m\u001b[48;2;0;205;232m\u2580\u001b[38;2;1;236;255m\u001b[48;2;1;223;249m\u2580\u001b[38;2;0;207;235m\u001b[48;2;0;206;234m\u2580\u001b[38;2;0;205;236m\u001b[48;2;0;204;233m\u2580\u001b[38;2;1;231;255m\u001b[48;2;1;222;249m\u2580\u001b[38;2;1;224;255m\u001b[48;2;0;206;234m\u2580\u001b[0m \u001b[38;2;1;205;234m\u001b[48;2;1;206;235m\u2580\u001b[38;2;0;204;234m\u001b[48;2;0;200;230m\u2580\u001b[0m \u001b[38;2;51;232;253m\u001b[48;2;49;227;247m\u2580\u001b[38;2;53;235;255m\u001b[48;2;53;236;253m\u2580\u001b[38;2;54;241;255m\u001b[48;2;51;230;248m\u2580\u001b[38;2;52;232;251m\u001b[49m\u2580\u001b[38;2;52;233;252m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;51;226;247m\u001b[48;2;51;228;248m\u2580\u001b[38;2;51;230;249m\u001b[48;2;50;227;246m\u2580\u001b[0m \u001b[38;2;1;206;236m\u2580\u001b[38;2;1;219;246m\u001b[48;2;1;208;237m\u2580\u001b[38;2;0;209;240m\u001b[48;2;1;242;255m\u2580\u001b[38;2;1;211;241m\u001b[49m\u2584\u001b[38;2;0;205;234m\u2584\u2584\u001b[38;2;1;211;241m\u2584\u001b[38;2;0;208;238m\u001b[48;2;1;242;255m\u2580\u001b[38;2;1;220;246m\u001b[48;2;1;208;237m\u2580\u001b[38;2;1;207;234m\u001b[49m\u2580\u001b[0m \u001b[38;2;51;228;248m\u001b[48;2;51;228;248m\u2580\u001b[38;2;51;226;247m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;50;227;247m\u001b[48;2;51;228;248m\u2580\u001b[38;2;50;227;248m\u001b[48;2;50;229;248m\u2580\u001b[0m \u001b[38;2;2;208;238m\u2580\u001b[38;2;2;212;241m\u2580\u001b[38;2;2;210;239m\u2580\u001b[38;2;2;209;239m\u2580\u001b[38;2;2;211;241m\u2580\u001b[38;2;2;211;239m\u2580\u001b[0m \u001b[38;2;51;227;247m\u001b[48;2;51;228;247m\u2580\u001b[38;2;51;227;248m\u001b[48;2;50;229;248m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;50;227;247m\u001b[48;2;50;228;247m\u2580\u001b[38;2;51;224;247m\u001b[48;2;54;239;251m\u2580\u001b[0m \u001b[38;2;51;230;250m\u2584\u001b[38;2;54;242;255m\u2584\u001b[38;2;53;240;253m\u001b[48;2;53;238;251m\u2580\u001b[38;2;52;228;247m\u001b[48;2;49;225;245m\u2580\u001b[38;2;52;229;249m\u001b[48;2;52;228;248m\u2580\u001b[38;2;53;238;252m\u001b[48;2;53;240;251m\u2580\u001b[38;2;53;237;252m\u001b[49m\u2584\u001b[38;2;51;231;250m\u2584\u001b[0m \u001b[38;2;51;225;247m\u001b[48;2;55;245;255m\u2580\u001b[38;2;50;227;247m\u001b[48;2;50;227;249m\u2580\u001b[0m\n\u001b[0m \u001b[38;2;53;238;251m\u001b[48;2;48;219;246m\u2580\u001b[38;2;52;233;252m\u001b[48;2;52;236;252m\u2580\u001b[38;2;50;227;247m\u001b[48;2;53;239;255m\u2580\u001b[38;2;51;228;248m\u001b[48;2;52;234;253m\u2580\u001b[38;2;52;232;250m\u001b[48;2;52;233;250m\u2580\u001b[38;2;55;244;255m\u001b[48;2;51;226;245m\u2580\u001b[38;2;53;234;251m\u001b[49m\u2580\u001b[0m \u001b[38;2;52;233;250m\u2580\u001b[38;2;56;249;255m\u001b[48;2;51;229;247m\u2580\u001b[38;2;51;232;250m\u001b[48;2;52;234;250m\u2580\u001b[38;2;50;226;247m\u001b[48;2;52;233;252m\u2580\u001b[38;2;51;225;245m\u001b[48;2;54;241;255m\u2580\u001b[38;2;52;234;251m\u001b[48;2;53;236;252m\u2580\u001b[38;2;53;237;251m\u001b[48;2;50;218;245m\u2580\u001b[0m";
|
|
13
|
+
/** Monochrome silhouette (glyphs only); colorized at runtime for non-truecolor terminals. */
|
|
14
|
+
exports.BUNDLE_DROP_LOGO_MONO = " \u2588\u2588\u2588\u2588\u2588\u2584\u2584 \u2584\u2584\u2588\u2588\u2588\u2588\u2588\n \u2588\u2588 \u2580\u2588\u2588\u2584\u2584\u2588\u2588\u2580 \u2588\u2588\n \u2588\u2588 \u2588\u2588\u2588\u2588 \u2588\u2588\n \u2588\u2588 \u2584\u2588\u2588 \u2588\u2588\u2584 \u2588\u2588\n \u2584\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2580 \u2588\u2588 \u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2584\u2584\u2584\n \u2584\u2588\u2588\u2580\u2580\u2580\u2588\u2588\u2584\u2588\u2588 \u2584\u2588\u2588\u2588\u2588\u2584 \u2588\u2588\u2584\u2588\u2580 \u2580\u2580\u2588\u2588\u2584\n\u2588\u2588\u2580 \u2588\u2588\u2588 \u2588\u2588\u2588\u2588\u2588\u2580\u2588\u2588 \u2588\u2588\u2588 \u2580\u2588\u2588\n\u2588\u2588\u2584 \u2588\u2588\u2584\u2588\u2580\u2588\u2588\u2588\u2588\u2588\u2588\u2580\u2588\u2584\u2588\u2588 \u2584\u2588\u2588\n \u2580\u2588\u2588\u2584\u2584\u2584\u2588\u2588 \u2588\u2588\u2588\u2588\u2584\u2588\u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588\u2584\u2584\u2584\u2588\u2588\u2580\n \u2580\u2580\u2588\u2588\u2588 \u2580\u2588 \u2588\u2588\u2588\u2588\u2588\u2588 \u2588\u2588 \u2588\u2588\u2588\u2580\u2580\n \u2588\u2588 \u2580\u2588\u2588\u2584\u2584\u2584\u2584\u2588\u2588\u2580 \u2588\u2588\n \u2588\u2588 \u2580\u2580\u2580\u2580\u2580\u2580 \u2588\u2588\n \u2588\u2588 \u2584\u2584\u2588\u2588\u2588\u2588\u2584\u2584 \u2588\u2588\n \u2588\u2588\u2588\u2588\u2588\u2588\u2580 \u2580\u2588\u2588\u2588\u2588\u2588\u2588";
|
|
15
|
+
/**
|
|
16
|
+
* Builds the CLI banner. Truecolor terminals get the full-color logo; every
|
|
17
|
+
* other terminal falls back to a cyan silhouette so the banner still renders.
|
|
18
|
+
*/
|
|
19
|
+
const buildBundleDropLogo = () => {
|
|
20
|
+
const art = chalk_1.default.level >= 3
|
|
21
|
+
? exports.BUNDLE_DROP_LOGO_TRUECOLOR
|
|
22
|
+
: chalk_1.default.cyanBright(exports.BUNDLE_DROP_LOGO_MONO);
|
|
23
|
+
const title = chalk_1.default.bold.cyanBright(`${figures_1.default.star} React Native Bundle Drop CLI ${figures_1.default.star}`);
|
|
24
|
+
return `\n${art}\n${title}`;
|
|
25
|
+
};
|
|
26
|
+
exports.buildBundleDropLogo = buildBundleDropLogo;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AiPatchPlan, AiSetupProjectType } from './types';
|
|
2
|
+
export type SetupApplyResult = {
|
|
3
|
+
projectRoot: string;
|
|
4
|
+
backupDir: string;
|
|
5
|
+
changedFiles: string[];
|
|
6
|
+
};
|
|
7
|
+
export declare function restoreSetupBackups(result: SetupApplyResult): void;
|
|
8
|
+
export declare function applySetupPatchPlans(params: {
|
|
9
|
+
projectRoot: string;
|
|
10
|
+
projectType: AiSetupProjectType;
|
|
11
|
+
changes: AiPatchPlan[];
|
|
12
|
+
}): SetupApplyResult;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.restoreSetupBackups = restoreSetupBackups;
|
|
7
|
+
exports.applySetupPatchPlans = applySetupPatchPlans;
|
|
8
|
+
const crypto_1 = __importDefault(require("crypto"));
|
|
9
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
const validate_plan_1 = require("./validate-plan");
|
|
12
|
+
const sha256 = (content) => crypto_1.default.createHash('sha256').update(content).digest('hex');
|
|
13
|
+
const timestamp = () => new Date().toISOString().replace(/[:.]/g, '-');
|
|
14
|
+
const isAllowedSetupFile = (projectType, filePath) => projectType === 'expo'
|
|
15
|
+
? (0, validate_plan_1.isPatchableExpoConfig)(filePath)
|
|
16
|
+
: (0, validate_plan_1.isPatchableNativeEntrypoint)(filePath);
|
|
17
|
+
function restoreSetupBackups(result) {
|
|
18
|
+
for (const relativePath of result.changedFiles) {
|
|
19
|
+
const backupPath = path_1.default.join(result.backupDir, relativePath);
|
|
20
|
+
if (fs_extra_1.default.existsSync(backupPath)) {
|
|
21
|
+
fs_extra_1.default.copyFileSync(backupPath, path_1.default.join(result.projectRoot, relativePath));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function applySetupPatchPlans(params) {
|
|
26
|
+
const result = {
|
|
27
|
+
projectRoot: params.projectRoot,
|
|
28
|
+
backupDir: path_1.default.join(params.projectRoot, '.bundledrop-backup', timestamp()),
|
|
29
|
+
changedFiles: [],
|
|
30
|
+
};
|
|
31
|
+
try {
|
|
32
|
+
for (const change of params.changes) {
|
|
33
|
+
if (!(0, validate_plan_1.isSafeRelativePath)(change.file) || !isAllowedSetupFile(params.projectType, change.file)) {
|
|
34
|
+
throw new Error(`Refusing to write AI setup plan outside its allowlist: ${change.file}`);
|
|
35
|
+
}
|
|
36
|
+
const targetPath = path_1.default.join(params.projectRoot, change.file);
|
|
37
|
+
const original = fs_extra_1.default.readFileSync(targetPath, 'utf8');
|
|
38
|
+
if (sha256(original) !== change.originalSha256) {
|
|
39
|
+
throw new Error(`File changed since AI setup scan: ${change.file}`);
|
|
40
|
+
}
|
|
41
|
+
const backupPath = path_1.default.join(result.backupDir, change.file);
|
|
42
|
+
fs_extra_1.default.ensureDirSync(path_1.default.dirname(backupPath));
|
|
43
|
+
fs_extra_1.default.copyFileSync(targetPath, backupPath);
|
|
44
|
+
result.changedFiles.push(change.file);
|
|
45
|
+
const temporaryPath = `${targetPath}.bundledrop-tmp`;
|
|
46
|
+
fs_extra_1.default.writeFileSync(temporaryPath, change.updated, 'utf8');
|
|
47
|
+
fs_extra_1.default.renameSync(temporaryPath, targetPath);
|
|
48
|
+
}
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
restoreSetupBackups(result);
|
|
53
|
+
throw error;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
-
import { AiInitPlanRequest, AiInitPlanResponse } from './types';
|
|
1
|
+
import { AiInitPlanRequest, AiInitPlanResponse, AiSetupPlanRequest, AiSetupPlanResponse } from './types';
|
|
2
2
|
export declare function requestAiInitPlan(params: {
|
|
3
3
|
serverUrl: string;
|
|
4
4
|
authToken: string;
|
|
5
5
|
request: AiInitPlanRequest;
|
|
6
6
|
}): Promise<AiInitPlanResponse>;
|
|
7
|
+
export declare function requestAiSetupPlan(params: {
|
|
8
|
+
serverUrl: string;
|
|
9
|
+
authToken: string;
|
|
10
|
+
request: AiSetupPlanRequest;
|
|
11
|
+
}): Promise<AiSetupPlanResponse>;
|
|
@@ -4,10 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.requestAiInitPlan = requestAiInitPlan;
|
|
7
|
+
exports.requestAiSetupPlan = requestAiSetupPlan;
|
|
7
8
|
const axios_1 = __importDefault(require("axios"));
|
|
8
9
|
const DEFAULT_AI_INIT_TIMEOUT_MS = 180000;
|
|
9
10
|
const resolveTimeoutMs = () => {
|
|
10
|
-
const value = Number(process.env.BUNDLE_DROP_AI_INIT_TIMEOUT_MS ||
|
|
11
|
+
const value = Number(process.env.BUNDLE_DROP_AI_INIT_TIMEOUT_MS || '');
|
|
11
12
|
return Number.isFinite(value) && value > 0 ? value : DEFAULT_AI_INIT_TIMEOUT_MS;
|
|
12
13
|
};
|
|
13
14
|
async function requestAiInitPlan(params) {
|
|
@@ -24,7 +25,7 @@ async function requestAiInitPlan(params) {
|
|
|
24
25
|
catch (error) {
|
|
25
26
|
const raw = error?.response?.data;
|
|
26
27
|
if (error?.code === 'ECONNABORTED' || /timeout/i.test(String(error?.message || ''))) {
|
|
27
|
-
throw new Error('AI planning request timed out.
|
|
28
|
+
throw new Error('AI planning request timed out. Try again, or set BUNDLE_DROP_AI_INIT_TIMEOUT_MS to a larger value.');
|
|
28
29
|
}
|
|
29
30
|
const message = raw && typeof raw === 'object'
|
|
30
31
|
? raw.error || JSON.stringify(raw)
|
|
@@ -32,3 +33,25 @@ async function requestAiInitPlan(params) {
|
|
|
32
33
|
throw new Error(`AI planning request failed: ${message}`);
|
|
33
34
|
}
|
|
34
35
|
}
|
|
36
|
+
async function requestAiSetupPlan(params) {
|
|
37
|
+
try {
|
|
38
|
+
const response = await axios_1.default.post(`${params.serverUrl}/ai/setup-plan`, params.request, {
|
|
39
|
+
headers: {
|
|
40
|
+
Accept: 'application/json',
|
|
41
|
+
Authorization: `Bearer ${params.authToken}`,
|
|
42
|
+
},
|
|
43
|
+
timeout: resolveTimeoutMs(),
|
|
44
|
+
});
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
const raw = error?.response?.data;
|
|
49
|
+
if (error?.code === 'ECONNABORTED' || /timeout/i.test(String(error?.message || ''))) {
|
|
50
|
+
throw new Error('AI setup planning timed out. Try again, or increase BUNDLE_DROP_AI_INIT_TIMEOUT_MS.');
|
|
51
|
+
}
|
|
52
|
+
const message = raw && typeof raw === 'object'
|
|
53
|
+
? raw.error || JSON.stringify(raw)
|
|
54
|
+
: raw || error?.message || 'AI setup planning failed';
|
|
55
|
+
throw new Error(`AI setup planning failed: ${message}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ProjectType } from '../../../expo';
|
|
2
|
+
export type InitProjectOptions = {
|
|
3
|
+
projectType?: ProjectType;
|
|
4
|
+
dryRun?: boolean;
|
|
5
|
+
migrateExpoUpdates?: boolean;
|
|
6
|
+
prebuild?: boolean;
|
|
7
|
+
yes?: boolean;
|
|
8
|
+
virtualConfig?: {
|
|
9
|
+
content: string;
|
|
10
|
+
serverUrl: string;
|
|
11
|
+
orgSlug: string;
|
|
12
|
+
projectSlug: string;
|
|
13
|
+
authToken: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare function initProjectConfigAi(options?: InitProjectOptions): Promise<void>;
|
|
17
|
+
export default initProjectConfigAi;
|