@expo/cli 0.14.0 → 0.15.0
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/build/bin/cli +5 -4
- package/build/bin/cli.map +1 -1
- package/build/src/api/getVersions.js.map +1 -1
- package/build/src/api/rest/cache/response.js.map +1 -1
- package/build/src/api/rest/client.js +2 -2
- package/build/src/api/rest/client.js.map +1 -1
- package/build/src/customize/typescript.js +3 -1
- package/build/src/customize/typescript.js.map +1 -1
- package/build/src/export/createMetadataJson.js +3 -2
- package/build/src/export/createMetadataJson.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +44 -17
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/resolveOptions.js +3 -3
- package/build/src/export/embed/resolveOptions.js.map +1 -1
- package/build/src/export/exportApp.js +69 -80
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportAssets.js +81 -21
- package/build/src/export/exportAssets.js.map +1 -1
- package/build/src/export/exportHermes.js +4 -4
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +55 -20
- package/build/src/export/exportStaticAsync.js.map +1 -1
- package/build/src/export/favicon.js +2 -2
- package/build/src/export/favicon.js.map +1 -1
- package/build/src/export/fork-bundleAsync.js +12 -10
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/index.js +9 -7
- package/build/src/export/index.js.map +1 -1
- package/build/src/export/metroAssetLocalPath.js +101 -0
- package/build/src/export/metroAssetLocalPath.js.map +1 -0
- package/build/src/export/persistMetroAssets.js +94 -21
- package/build/src/export/persistMetroAssets.js.map +1 -1
- package/build/src/export/resolveOptions.js +1 -1
- package/build/src/export/resolveOptions.js.map +1 -1
- package/build/src/export/saveAssets.js +9 -48
- package/build/src/export/saveAssets.js.map +1 -1
- package/build/src/export/web/exportWebAsync.js +1 -1
- package/build/src/export/web/exportWebAsync.js.map +1 -1
- package/build/src/export/writeContents.js +3 -2
- package/build/src/export/writeContents.js.map +1 -1
- package/build/src/install/applyPlugins.js +52 -0
- package/build/src/install/applyPlugins.js.map +1 -0
- package/build/src/install/checkPackages.js +2 -2
- package/build/src/install/checkPackages.js.map +1 -1
- package/build/src/install/fixPackages.js +84 -0
- package/build/src/install/fixPackages.js.map +1 -0
- package/build/src/install/installAsync.js +32 -61
- package/build/src/install/installAsync.js.map +1 -1
- package/build/src/install/installExpoPackage.js +79 -0
- package/build/src/install/installExpoPackage.js.map +1 -0
- package/build/src/prebuild/clearNativeFolder.js +1 -1
- package/build/src/prebuild/clearNativeFolder.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +3 -3
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/copyTemplateFiles.js +21 -30
- package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +37 -15
- package/build/src/prebuild/prebuildAsync.js.map +1 -1
- package/build/src/prebuild/resolveOptions.js +2 -2
- package/build/src/prebuild/resolveOptions.js.map +1 -1
- package/build/src/prebuild/updateFromTemplate.js +6 -6
- package/build/src/prebuild/updateFromTemplate.js.map +1 -1
- package/build/src/prebuild/updatePackageJson.js +49 -36
- package/build/src/prebuild/updatePackageJson.js.map +1 -1
- package/build/src/prebuild/validateTemplatePlatforms.js +2 -2
- package/build/src/prebuild/validateTemplatePlatforms.js.map +1 -1
- package/build/src/start/doctor/dependencies/getVersionedPackages.js +12 -4
- package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +20 -3
- package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
- package/build/src/start/interface/interactiveActions.js +30 -11
- package/build/src/start/interface/interactiveActions.js.map +1 -1
- package/build/src/start/server/BundlerDevServer.js +14 -10
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/start/server/DevServerManager.js +6 -1
- package/build/src/start/server/DevServerManager.js.map +1 -1
- package/build/src/start/server/DevToolsPluginManager.js +63 -0
- package/build/src/start/server/DevToolsPluginManager.js.map +1 -0
- package/build/src/start/server/getStaticRenderFunctions.js +21 -23
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +48 -64
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/bundleApiRoutes.js +4 -3
- package/build/src/start/server/metro/bundleApiRoutes.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +62 -45
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -1
- package/build/src/start/server/metro/createJResolver.js +149 -0
- package/build/src/start/server/metro/createJResolver.js.map +1 -0
- package/build/src/start/server/metro/createServerRouteMiddleware.js +13 -1
- package/build/src/start/server/metro/createServerRouteMiddleware.js.map +1 -1
- package/build/src/start/server/metro/externals.js +25 -3
- package/build/src/start/server/metro/externals.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/device.js +3 -1
- package/build/src/start/server/metro/inspector-proxy/device.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js +3 -4
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeDebuggerGetPossibleBreakpoints.js.map +1 -1
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeCallFunctionOn.js +24 -0
- package/build/src/start/server/metro/inspector-proxy/handlers/VscodeRuntimeCallFunctionOn.js.map +1 -0
- package/build/src/start/server/metro/inspector-proxy/handlers/utils.js +11 -0
- package/build/src/start/server/metro/inspector-proxy/handlers/utils.js.map +1 -0
- package/build/src/start/server/metro/inspector-proxy/index.js +10 -7
- package/build/src/start/server/metro/inspector-proxy/index.js.map +1 -1
- package/build/src/start/server/metro/instantiateMetro.js +32 -10
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/router.js +4 -1
- package/build/src/start/server/metro/router.js.map +1 -1
- package/build/src/start/server/metro/runServer-fork.js +19 -10
- package/build/src/start/server/metro/runServer-fork.js.map +1 -1
- package/build/src/start/server/metro/serializeHtml.js +43 -0
- package/build/src/start/server/metro/serializeHtml.js.map +1 -0
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js +1 -2
- package/build/src/start/server/metro/waitForMetroToObserveTypeScriptFile.js.map +1 -1
- package/build/src/start/server/metro/withMetroMultiPlatform.js +261 -201
- package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -1
- package/build/src/start/server/metro/withMetroResolvers.js +114 -40
- package/build/src/start/server/metro/withMetroResolvers.js.map +1 -1
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js +61 -0
- package/build/src/start/server/middleware/DevToolsPluginMiddleware.js.map +1 -0
- package/build/src/start/server/middleware/ExpoMiddleware.js +2 -2
- package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +15 -66
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js +1 -1
- package/build/src/start/server/middleware/inspector/JsInspector.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js +30 -26
- package/build/src/start/server/middleware/inspector/LaunchBrowser.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js +7 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowser.types.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js +5 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplLinux.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js +3 -2
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplMacOS.js.map +1 -1
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js +8 -7
- package/build/src/start/server/middleware/inspector/LaunchBrowserImplWindows.js.map +1 -1
- package/build/src/start/server/middleware/metroOptions.js +123 -0
- package/build/src/start/server/middleware/metroOptions.js.map +1 -0
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
- package/build/src/utils/analytics/getMetroDebugProperties.js +1 -2
- package/build/src/utils/analytics/getMetroDebugProperties.js.map +1 -1
- package/build/src/utils/analytics/getMetroProperties.js +1 -2
- package/build/src/utils/analytics/getMetroProperties.js.map +1 -1
- package/build/src/utils/analytics/rudderstackClient.js +2 -2
- package/build/src/utils/args.js +4 -2
- package/build/src/utils/args.js.map +1 -1
- package/build/src/utils/cocoapods.js +1 -1
- package/build/src/utils/cocoapods.js.map +1 -1
- package/build/src/utils/dir.js +18 -8
- package/build/src/utils/dir.js.map +1 -1
- package/build/src/utils/env.js +3 -0
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +2 -4
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/prompts.js +1 -28
- package/build/src/utils/prompts.js.map +1 -1
- package/package.json +15 -14
- package/static/shims/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js +13 -0
- package/static/shims/react-native-web/dist/exports/AppRegistry/AppContainer.js +12 -0
- package/build/src/start/server/metro/resolveFromProject.js +0 -90
- package/build/src/start/server/metro/resolveFromProject.js.map +0 -1
package/build/bin/cli
CHANGED
|
@@ -132,7 +132,7 @@ const args = (0, _arg).default({
|
|
|
132
132
|
});
|
|
133
133
|
if (args["--version"]) {
|
|
134
134
|
// Version is added in the build script.
|
|
135
|
-
console.log("0.
|
|
135
|
+
console.log("0.15.0");
|
|
136
136
|
process.exit(0);
|
|
137
137
|
}
|
|
138
138
|
if (args["--non-interactive"]) {
|
|
@@ -195,7 +195,7 @@ if (!isSubcommand) {
|
|
|
195
195
|
"client:install:ios": "npx expo start --ios",
|
|
196
196
|
"client:install:android": "npx expo start --android",
|
|
197
197
|
doctor: "npx expo-doctor",
|
|
198
|
-
upgrade: "expo-
|
|
198
|
+
upgrade: "https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/",
|
|
199
199
|
"customize:web": "npx expo customize",
|
|
200
200
|
publish: "eas update",
|
|
201
201
|
"publish:set": "eas update",
|
|
@@ -227,7 +227,8 @@ if (!isSubcommand) {
|
|
|
227
227
|
if (subcommand in migrationMap) {
|
|
228
228
|
const replacement = migrationMap[subcommand];
|
|
229
229
|
console.log();
|
|
230
|
-
|
|
230
|
+
const instruction = subcommand === "upgrade" ? "follow this guide" : "use";
|
|
231
|
+
console.log(_chalk.default.yellow` {gray $} {bold expo ${subcommand}} is not supported in the local CLI, please ${instruction} {bold ${replacement}} instead`);
|
|
231
232
|
console.log();
|
|
232
233
|
process.exit(1);
|
|
233
234
|
}
|
|
@@ -263,7 +264,7 @@ commands[command]().then((exec)=>{
|
|
|
263
264
|
logEventAsync("action", {
|
|
264
265
|
action: `expo ${command}`,
|
|
265
266
|
source: "expo/cli",
|
|
266
|
-
source_version: "0.
|
|
267
|
+
source_version: "0.15.0"
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
270
|
});
|
package/build/bin/cli.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport Debug from 'debug';\nimport { boolish } from 'getenv';\n\n// Setup before requiring `debug`.\nif (boolish('EXPO_DEBUG', false)) {\n Debug.enable('expo:*');\n} else if (Debug.enabled('expo:')) {\n process.env.EXPO_DEBUG = '1';\n}\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n // NOTE(EvanBacon): Ensure every bundler-related command sets `NODE_ENV` as expected for the command.\n 'run:ios': () => import('../src/run/ios/index.js').then((i) => i.expoRunIos),\n 'run:android': () => import('../src/run/android/index.js').then((i) => i.expoRunAndroid),\n start: () => import('../src/start/index.js').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild/index.js').then((i) => i.expoPrebuild),\n config: () => import('../src/config/index.js').then((i) => i.expoConfig),\n export: () => import('../src/export/index.js').then((i) => i.expoExport),\n 'export:web': () => import('../src/export/web/index.js').then((i) => i.expoExportWeb),\n 'export:embed': () => import('../src/export/embed/index.js').then((i) => i.expoExportEmbed),\n\n // Auxiliary commands\n install: () => import('../src/install/index.js').then((i) => i.expoInstall),\n add: () => import('../src/install/index.js').then((i) => i.expoInstall),\n customize: () => import('../src/customize/index.js').then((i) => i.expoCustomize),\n\n // Auth\n login: () => import('../src/login/index.js').then((i) => i.expoLogin),\n logout: () => import('../src/logout/index.js').then((i) => i.expoLogout),\n register: () => import('../src/register/index.js').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami/index.js').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n // NOTE(EvanBacon): This is here to silence warnings from processes that\n // expect the global expo-cli.\n '--non-interactive': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\nif (args['--non-interactive']) {\n console.warn(chalk.yellow` {bold --non-interactive} is not supported, use {bold $CI=1} instead`);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n const {\n login,\n logout,\n whoami,\n register,\n start,\n install,\n add,\n export: _export,\n config,\n customize,\n prebuild,\n 'run:ios': runIos,\n 'run:android': runAndroid,\n // NOTE(EvanBacon): Don't document this command as it's a temporary\n // workaround until we can use `expo export` for all production bundling.\n // https://github.com/expo/expo/pull/21396/files#r1121025873\n 'export:embed': exportEmbed_unused,\n ...others\n } = commands;\n\n console.log(chalk`\n {bold Usage}\n {dim $} npx expo <command>\n\n {bold Commands}\n ${Object.keys({ start, export: _export, ...others }).join(', ')}\n ${Object.keys({ 'run:ios': runIos, 'run:android': runAndroid, prebuild }).join(', ')}\n ${Object.keys({ install, customize, config }).join(', ')}\n {dim ${Object.keys({ login, logout, whoami, register }).join(', ')}}\n\n {bold Options}\n --version, -v Version number\n --help, -h Usage info\n\n For more info run a command with the {bold --help} flag\n {dim $} npx expo start --help\n`);\n\n process.exit(0);\n}\n\n// NOTE(EvanBacon): Squat some directory names to help with migration,\n// users can still use folders named \"send\" or \"eject\" by using the fully qualified `npx expo start ./send`.\nif (!isSubcommand) {\n const migrationMap: Record<string, string> = {\n init: 'npx create-expo-app',\n eject: 'npx expo prebuild',\n web: 'npx expo start --web',\n 'start:web': 'npx expo start --web',\n 'build:ios': 'eas build -p ios',\n 'build:android': 'eas build -p android',\n 'client:install:ios': 'npx expo start --ios',\n 'client:install:android': 'npx expo start --android',\n doctor: 'npx expo-doctor',\n upgrade: 'expo-cli upgrade',\n 'customize:web': 'npx expo customize',\n\n publish: 'eas update',\n 'publish:set': 'eas update',\n 'publish:rollback': 'eas update',\n 'publish:history': 'eas update',\n 'publish:details': 'eas update',\n\n 'build:web': 'npx expo export:web',\n\n 'credentials:manager': `eas credentials`,\n 'fetch:ios:certs': `eas credentials`,\n 'fetch:android:keystore': `eas credentials`,\n 'fetch:android:hashes': `eas credentials`,\n 'fetch:android:upload-cert': `eas credentials`,\n 'push:android:upload': `eas credentials`,\n 'push:android:show': `eas credentials`,\n 'push:android:clear': `eas credentials`,\n url: `eas build:list`,\n 'url:ipa': `eas build:list`,\n 'url:apk': `eas build:list`,\n webhooks: `eas webhook`,\n 'webhooks:add': `eas webhook:create`,\n 'webhooks:remove': `eas webhook:delete`,\n 'webhooks:update': `eas webhook:update`,\n\n 'build:status': `eas build:list`,\n 'upload:android': `eas submit -p android`,\n 'upload:ios': `eas submit -p ios`,\n };\n\n // TODO: Log telemetry about invalid command used.\n const subcommand = args._[0];\n if (subcommand in migrationMap) {\n const replacement = migrationMap[subcommand];\n console.log();\n console.log(\n chalk.yellow` {gray $} {bold expo ${subcommand}} is not supported in the local CLI, please use {bold ${replacement}} instead`\n );\n console.log();\n process.exit(1);\n }\n const deprecated = ['send', 'client:ios'];\n if (deprecated.includes(subcommand)) {\n console.log();\n console.log(chalk.yellow` {gray $} {bold expo ${subcommand}} is deprecated`);\n console.log();\n process.exit(1);\n }\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => {\n exec(commandArgs);\n\n if (!boolish('EXPO_NO_TELEMETRY', false)) {\n // NOTE(EvanBacon): Track some basic telemetry events indicating the command\n // that was run. This can be disabled with the $EXPO_NO_TELEMETRY environment variable.\n // We do this to determine how well deprecations are going before removing a command.\n const { logEventAsync } =\n require('../src/utils/analytics/rudderstackClient') as typeof import('../src/utils/analytics/rudderstackClient');\n logEventAsync('action', {\n action: `expo ${command}`,\n source: 'expo/cli',\n source_version: process.env.__EXPO_VERSION,\n });\n }\n});\n"],"names":["boolish","Debug","enable","enabled","process","env","EXPO_DEBUG","defaultCmd","commands","then","i","expoRunIos","expoRunAndroid","start","expoStart","prebuild","expoPrebuild","config","expoConfig","export","expoExport","expoExportWeb","expoExportEmbed","install","expoInstall","add","customize","expoCustomize","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","__EXPO_VERSION","exit","warn","chalk","yellow","isSubcommand","_","_export","runIos","runAndroid","exportEmbed_unused","others","Object","keys","join","migrationMap","init","eject","web","doctor","upgrade","publish","url","webhooks","subcommand","replacement","deprecated","includes","command","commandArgs","slice","push","on","exec","logEventAsync","require","action","source","source_version"],"mappings":"AAAA;;AACgB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AAA6D,AAAC;QACnHD,aAAa,CAAC,QAAQ,EAAE;YACtBE,MAAM,EAAE,CAAC,KAAK,EAAER,OAAO,CAAC,CAAC;YACzBS,MAAM,EAAE,UAAU;YAClBC,cAAc,EAAE5E,OAAO,CAACC,GAAG,CAACqC,cAAc;SAC3C,CAAC,CAAC;KACJ;CACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport Debug from 'debug';\nimport { boolish } from 'getenv';\n\n// Setup before requiring `debug`.\nif (boolish('EXPO_DEBUG', false)) {\n Debug.enable('expo:*');\n} else if (Debug.enabled('expo:')) {\n process.env.EXPO_DEBUG = '1';\n}\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n // NOTE(EvanBacon): Ensure every bundler-related command sets `NODE_ENV` as expected for the command.\n 'run:ios': () => import('../src/run/ios/index.js').then((i) => i.expoRunIos),\n 'run:android': () => import('../src/run/android/index.js').then((i) => i.expoRunAndroid),\n start: () => import('../src/start/index.js').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild/index.js').then((i) => i.expoPrebuild),\n config: () => import('../src/config/index.js').then((i) => i.expoConfig),\n export: () => import('../src/export/index.js').then((i) => i.expoExport),\n 'export:web': () => import('../src/export/web/index.js').then((i) => i.expoExportWeb),\n 'export:embed': () => import('../src/export/embed/index.js').then((i) => i.expoExportEmbed),\n\n // Auxiliary commands\n install: () => import('../src/install/index.js').then((i) => i.expoInstall),\n add: () => import('../src/install/index.js').then((i) => i.expoInstall),\n customize: () => import('../src/customize/index.js').then((i) => i.expoCustomize),\n\n // Auth\n login: () => import('../src/login/index.js').then((i) => i.expoLogin),\n logout: () => import('../src/logout/index.js').then((i) => i.expoLogout),\n register: () => import('../src/register/index.js').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami/index.js').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n // NOTE(EvanBacon): This is here to silence warnings from processes that\n // expect the global expo-cli.\n '--non-interactive': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\nif (args['--non-interactive']) {\n console.warn(chalk.yellow` {bold --non-interactive} is not supported, use {bold $CI=1} instead`);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n const {\n login,\n logout,\n whoami,\n register,\n start,\n install,\n add,\n export: _export,\n config,\n customize,\n prebuild,\n 'run:ios': runIos,\n 'run:android': runAndroid,\n // NOTE(EvanBacon): Don't document this command as it's a temporary\n // workaround until we can use `expo export` for all production bundling.\n // https://github.com/expo/expo/pull/21396/files#r1121025873\n 'export:embed': exportEmbed_unused,\n ...others\n } = commands;\n\n console.log(chalk`\n {bold Usage}\n {dim $} npx expo <command>\n\n {bold Commands}\n ${Object.keys({ start, export: _export, ...others }).join(', ')}\n ${Object.keys({ 'run:ios': runIos, 'run:android': runAndroid, prebuild }).join(', ')}\n ${Object.keys({ install, customize, config }).join(', ')}\n {dim ${Object.keys({ login, logout, whoami, register }).join(', ')}}\n\n {bold Options}\n --version, -v Version number\n --help, -h Usage info\n\n For more info run a command with the {bold --help} flag\n {dim $} npx expo start --help\n`);\n\n process.exit(0);\n}\n\n// NOTE(EvanBacon): Squat some directory names to help with migration,\n// users can still use folders named \"send\" or \"eject\" by using the fully qualified `npx expo start ./send`.\nif (!isSubcommand) {\n const migrationMap: Record<string, string> = {\n init: 'npx create-expo-app',\n eject: 'npx expo prebuild',\n web: 'npx expo start --web',\n 'start:web': 'npx expo start --web',\n 'build:ios': 'eas build -p ios',\n 'build:android': 'eas build -p android',\n 'client:install:ios': 'npx expo start --ios',\n 'client:install:android': 'npx expo start --android',\n doctor: 'npx expo-doctor',\n upgrade: 'https://docs.expo.dev/workflow/upgrading-expo-sdk-walkthrough/',\n 'customize:web': 'npx expo customize',\n\n publish: 'eas update',\n 'publish:set': 'eas update',\n 'publish:rollback': 'eas update',\n 'publish:history': 'eas update',\n 'publish:details': 'eas update',\n\n 'build:web': 'npx expo export:web',\n\n 'credentials:manager': `eas credentials`,\n 'fetch:ios:certs': `eas credentials`,\n 'fetch:android:keystore': `eas credentials`,\n 'fetch:android:hashes': `eas credentials`,\n 'fetch:android:upload-cert': `eas credentials`,\n 'push:android:upload': `eas credentials`,\n 'push:android:show': `eas credentials`,\n 'push:android:clear': `eas credentials`,\n url: `eas build:list`,\n 'url:ipa': `eas build:list`,\n 'url:apk': `eas build:list`,\n webhooks: `eas webhook`,\n 'webhooks:add': `eas webhook:create`,\n 'webhooks:remove': `eas webhook:delete`,\n 'webhooks:update': `eas webhook:update`,\n\n 'build:status': `eas build:list`,\n 'upload:android': `eas submit -p android`,\n 'upload:ios': `eas submit -p ios`,\n };\n\n // TODO: Log telemetry about invalid command used.\n const subcommand = args._[0];\n if (subcommand in migrationMap) {\n const replacement = migrationMap[subcommand];\n console.log();\n const instruction = subcommand === 'upgrade' ? 'follow this guide' : 'use'\n console.log(\n chalk.yellow` {gray $} {bold expo ${subcommand}} is not supported in the local CLI, please ${instruction} {bold ${replacement}} instead`\n );\n console.log();\n process.exit(1);\n }\n const deprecated = ['send', 'client:ios'];\n if (deprecated.includes(subcommand)) {\n console.log();\n console.log(chalk.yellow` {gray $} {bold expo ${subcommand}} is deprecated`);\n console.log();\n process.exit(1);\n }\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => {\n exec(commandArgs);\n\n if (!boolish('EXPO_NO_TELEMETRY', false)) {\n // NOTE(EvanBacon): Track some basic telemetry events indicating the command\n // that was run. This can be disabled with the $EXPO_NO_TELEMETRY environment variable.\n // We do this to determine how well deprecations are going before removing a command.\n const { logEventAsync } =\n require('../src/utils/analytics/rudderstackClient') as typeof import('../src/utils/analytics/rudderstackClient');\n logEventAsync('action', {\n action: `expo ${command}`,\n source: 'expo/cli',\n source_version: process.env.__EXPO_VERSION,\n });\n }\n});\n"],"names":["boolish","Debug","enable","enabled","process","env","EXPO_DEBUG","defaultCmd","commands","then","i","expoRunIos","expoRunAndroid","start","expoStart","prebuild","expoPrebuild","config","expoConfig","export","expoExport","expoExportWeb","expoExportEmbed","install","expoInstall","add","customize","expoCustomize","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","__EXPO_VERSION","exit","warn","chalk","yellow","isSubcommand","_","_export","runIos","runAndroid","exportEmbed_unused","others","Object","keys","join","migrationMap","init","eject","web","doctor","upgrade","publish","url","webhooks","subcommand","replacement","instruction","deprecated","includes","command","commandArgs","slice","push","on","exec","logEventAsync","require","action","source","source_version"],"mappings":"AAAA;;AACgB,IAAA,IAAK,kCAAL,KAAK,EAAA;AACH,IAAA,MAAO,kCAAP,OAAO,EAAA;AACP,IAAA,MAAO,kCAAP,OAAO,EAAA;AACD,IAAA,OAAQ,WAAR,QAAQ,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEhC,kCAAkC;AAClC,IAAIA,CAAAA,GAAAA,OAAO,AAAqB,CAAA,QAArB,CAAC,YAAY,EAAE,KAAK,CAAC,EAAE;IAChCC,MAAK,QAAA,CAACC,MAAM,CAAC,QAAQ,CAAC,CAAC;CACxB,MAAM,IAAID,MAAK,QAAA,CAACE,OAAO,CAAC,OAAO,CAAC,EAAE;IACjCC,OAAO,CAACC,GAAG,CAACC,UAAU,GAAG,G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AAY,GAAGX,IAAI,CAACY,CAAC,CAAC,CAAC,CAAC,GAAGzC,UAAU,AAAC;AACtD,MAAMiE,WAAW,GAAGzB,YAAY,GAAGX,IAAI,CAACY,CAAC,CAACyB,KAAK,CAAC,CAAC,CAAC,GAAGrC,IAAI,CAACY,CAAC,AAAC;AAE5D,6CAA6C;AAC7C,IAAIZ,IAAI,CAAC,QAAQ,CAAC,EAAE;IAClBoC,WAAW,CAACE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC5B;AAED,qBAAqB;AACrBtE,OAAO,CAACuE,EAAE,CAAC,QAAQ,EAAE,IAAMvE,OAAO,CAACuC,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAC5CvC,OAAO,CAACuE,EAAE,CAAC,SAAS,EAAE,IAAMvE,OAAO,CAACuC,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAE7CnC,QAAQ,CAAC+D,OAAO,CAAC,EAAE,CAAC9D,IAAI,CAAC,CAACmE,IAAI,GAAK;IACjCA,IAAI,CAACJ,WAAW,CAAC,CAAC;IAElB,IAAI,CAACxE,CAAAA,GAAAA,OAAO,AAA4B,CAAA,QAA5B,CAAC,mBAAmB,EAAE,KAAK,CAAC,EAAE;QACxC,4EAA4E;QAC5E,uFAAuF;QACvF,qFAAqF;QACrF,MAAM,EAAE6E,aAAa,CAAA,EAAE,GACrBC,OAAO,CAAC,0CAA0C,CAAC,AAA6D,AAAC;QACnHD,aAAa,CAAC,QAAQ,EAAE;YACtBE,MAAM,EAAE,CAAC,KAAK,EAAER,OAAO,CAAC,CAAC;YACzBS,MAAM,EAAE,UAAU;YAClBC,cAAc,EAAE7E,OAAO,CAACC,GAAG,CAACqC,cAAc;SAC3C,CAAC,CAAC;KACJ;CACF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/api/getVersions.ts"],"sourcesContent":["import { createCachedFetch } from './rest/client';\nimport { CommandError } from '../utils/errors';\n\n/** Represents version info for a particular SDK. */\nexport type SDKVersion = {\n /** @example \"2.16.1\" */\n iosVersion?: string;\n /** @example \"https://dpq5q02fu5f55.cloudfront.net/Exponent-2.17.4.tar.gz\" */\n iosClientUrl?: string;\n /** @example \"https://dev.to/expo/expo-sdk-38-is-now-available-5aa0\" */\n releaseNoteUrl?: string;\n /** @example \"2.17.4\" */\n iosClientVersion?: string;\n /** @example \"https://d1ahtucjixef4r.cloudfront.net/Exponent-2.16.1.apk\" */\n androidClientUrl?: string;\n /** @example \"2.16.1\" */\n androidClientVersion?: string;\n /** @example { \"typescript\": \"~3.9.5\" } */\n relatedPackages?: Record<string, string>;\n\n facebookReactNativeVersion: string;\n\n facebookReactVersion?: string;\n\n beta?: boolean;\n};\n\nexport type SDKVersions = Record<string, SDKVersion>;\n\nexport type Versions = {\n androidUrl: string;\n androidVersion: string;\n iosUrl: string;\n iosVersion: string;\n sdkVersions: SDKVersions;\n};\n\n/** Get versions from remote endpoint. */\nexport async function getVersionsAsync({\n skipCache,\n}: { skipCache?: boolean } = {}): Promise<Versions> {\n // Reconstruct the cached fetch since caching could be disabled.\n const fetchAsync = createCachedFetch({\n skipCache,\n cacheDirectory: 'versions-cache',\n // We'll use a 5 minute cache to ensure we stay relatively up to date.\n ttl: 1000 * 60 * 5,\n });\n\n const results = await fetchAsync('versions/latest');\n if (!results.ok) {\n throw new CommandError(\n 'API',\n `Unexpected response when fetching version info from Expo servers: ${results.statusText}.`\n );\n }\n const json = await results.json();\n return json.data;\n}\n"],"names":["getVersionsAsync","skipCache","fetchAsync","createCachedFetch","cacheDirectory","ttl","results","ok","CommandError","statusText","json","data"],"mappings":"AAAA;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/api/getVersions.ts"],"sourcesContent":["import { createCachedFetch } from './rest/client';\nimport { CommandError } from '../utils/errors';\n\n/** Represents version info for a particular SDK. */\nexport type SDKVersion = {\n /** @example \"2.16.1\" */\n iosVersion?: string;\n /** @example \"https://dpq5q02fu5f55.cloudfront.net/Exponent-2.17.4.tar.gz\" */\n iosClientUrl?: string;\n /** @example \"https://dev.to/expo/expo-sdk-38-is-now-available-5aa0\" */\n releaseNoteUrl?: string;\n /** @example \"2.17.4\" */\n iosClientVersion?: string;\n /** @example \"https://d1ahtucjixef4r.cloudfront.net/Exponent-2.16.1.apk\" */\n androidClientUrl?: string;\n /** @example \"2.16.1\" */\n androidClientVersion?: string;\n /** @example { \"typescript\": \"~3.9.5\" } */\n relatedPackages?: Record<string, string>;\n\n facebookReactNativeVersion: string;\n\n facebookReactVersion?: string;\n\n expoVersion?: string;\n\n beta?: boolean;\n};\n\nexport type SDKVersions = Record<string, SDKVersion>;\n\nexport type Versions = {\n androidUrl: string;\n androidVersion: string;\n iosUrl: string;\n iosVersion: string;\n sdkVersions: SDKVersions;\n};\n\n/** Get versions from remote endpoint. */\nexport async function getVersionsAsync({\n skipCache,\n}: { skipCache?: boolean } = {}): Promise<Versions> {\n // Reconstruct the cached fetch since caching could be disabled.\n const fetchAsync = createCachedFetch({\n skipCache,\n cacheDirectory: 'versions-cache',\n // We'll use a 5 minute cache to ensure we stay relatively up to date.\n ttl: 1000 * 60 * 5,\n });\n\n const results = await fetchAsync('versions/latest');\n if (!results.ok) {\n throw new CommandError(\n 'API',\n `Unexpected response when fetching version info from Expo servers: ${results.statusText}.`\n );\n }\n const json = await results.json();\n return json.data;\n}\n"],"names":["getVersionsAsync","skipCache","fetchAsync","createCachedFetch","cacheDirectory","ttl","results","ok","CommandError","statusText","json","data"],"mappings":"AAAA;;;;QAwCsBA,gBAAgB,GAAhBA,gBAAgB;AAxCJ,IAAA,OAAe,WAAf,eAAe,CAAA;AACpB,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AAuCvC,eAAeA,gBAAgB,CAAC,EACrCC,SAAS,CAAA,EACe,GAAG,EAAE,EAAqB;IAClD,gEAAgE;IAChE,MAAMC,UAAU,GAAGC,CAAAA,GAAAA,OAAiB,AAKlC,CAAA,kBALkC,CAAC;QACnCF,SAAS;QACTG,cAAc,EAAE,gBAAgB;QAChC,sEAAsE;QACtEC,GAAG,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC;KACnB,CAAC,AAAC;IAEH,MAAMC,OAAO,GAAG,MAAMJ,UAAU,CAAC,iBAAiB,CAAC,AAAC;IACpD,IAAI,CAACI,OAAO,CAACC,EAAE,EAAE;QACf,MAAM,IAAIC,OAAY,aAAA,CACpB,KAAK,EACL,CAAC,kEAAkE,EAAEF,OAAO,CAACG,UAAU,CAAC,CAAC,CAAC,CAC3F,CAAC;KACH;IACD,MAAMC,IAAI,GAAG,MAAMJ,OAAO,CAACI,IAAI,EAAE,AAAC;IAClC,OAAOA,IAAI,CAACC,IAAI,CAAC;CAClB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/api/rest/cache/response.ts"],"sourcesContent":["import { CacheObject } from 'cacache';\nimport { BodyInit, Response, ResponseInit } from 'node-fetch';\n\nconst responseInternalSymbol = Object.getOwnPropertySymbols(new Response())[1];\n\nexport class NFCResponse extends Response {\n constructor(\n bodyStream?: BodyInit,\n metaData?: ResponseInit,\n public ejectFromCache: () => Promise<[CacheObject, CacheObject]> = function ejectFromCache(\n this: any\n ) {\n return this.ejectSelfFromCache();\n },\n public fromCache: boolean = false\n ) {\n super(bodyStream, metaData);\n }\n\n static serializeMetaFromNodeFetchResponse(res: Response) {\n const metaData = {\n url: res.url,\n status: res.status,\n statusText: res.statusText,\n headers: res.headers.raw(),\n size: res.size,\n timeout: res.timeout,\n // @ts-ignore\n counter: res[responseInternalSymbol].counter,\n };\n\n return metaData;\n }\n}\n"],"names":["responseInternalSymbol","Object","getOwnPropertySymbols","Response","NFCResponse","constructor","bodyStream","metaData","ejectFromCache","ejectSelfFromCache","fromCache","serializeMetaFromNodeFetchResponse","res","url","status","statusText","headers","raw","size","timeout","counter"],"mappings":"AAAA;;;;AACiD,IAAA,UAAY,WAAZ,YAAY,CAAA;AAE7D,MAAMA,sBAAsB,GAAGC,MAAM,CAACC,qBAAqB,CAAC,IAAIC,UAAQ,SAAA,EAAE,CAAC,CAAC,CAAC,CAAC,AAAC;AAExE,MAAMC,WAAW,SAASD,UAAQ,SAAA;IACvCE,YACEC,UAAqB,EACrBC,QAAuB,EAChBC,cAAyD,GAAG,SAASA,cAAc,GAExF;QACA,OAAO,IAAI,CAACC,kBAAkB,EAAE,CAAC;KAClC,EACMC,SAAkB,GAAG,KAAK,CACjC;QACA,KAAK,CAACJ,UAAU,EAAEC,QAAQ,CAAC,CAAC;aAPrBC,cAAyD,GAAzDA,cAAyD;aAKzDE,SAAkB,GAAlBA,SAAkB;KAG1B;IAED,OAAOC,kCAAkC,CAACC,GAAa,EAAE;QACvD,MAAML,QAAQ,GAAG;YACfM,GAAG,EAAED,GAAG,CAACC,GAAG;YACZC,MAAM,EAAEF,GAAG,CAACE,MAAM;YAClBC,UAAU,EAAEH,GAAG,CAACG,UAAU;YAC1BC,OAAO,EAAEJ,GAAG,CAACI,OAAO,CAACC,GAAG,EAAE;YAC1BC,IAAI,EAAEN,GAAG,CAACM,IAAI;YACdC,OAAO,EAAEP,GAAG,CAACO,OAAO;YACpB,aAAa;YACbC,OAAO,EAAER,GAAG,CAACZ,sBAAsB,CAAC,CAACoB,OAAO;SAC7C,AAAC;QAEF,OAAOb,QAAQ,CAAC;KACjB;CACF;QA5BYH,WAAW,GAAXA,WAAW"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/api/rest/cache/response.ts"],"sourcesContent":["import type { CacheObject } from 'cacache';\nimport { BodyInit, Response, ResponseInit } from 'node-fetch';\n\nconst responseInternalSymbol = Object.getOwnPropertySymbols(new Response())[1];\n\nexport class NFCResponse extends Response {\n constructor(\n bodyStream?: BodyInit,\n metaData?: ResponseInit,\n public ejectFromCache: () => Promise<[CacheObject, CacheObject]> = function ejectFromCache(\n this: any\n ) {\n return this.ejectSelfFromCache();\n },\n public fromCache: boolean = false\n ) {\n super(bodyStream, metaData);\n }\n\n static serializeMetaFromNodeFetchResponse(res: Response) {\n const metaData = {\n url: res.url,\n status: res.status,\n statusText: res.statusText,\n headers: res.headers.raw(),\n size: res.size,\n timeout: res.timeout,\n // @ts-ignore\n counter: res[responseInternalSymbol].counter,\n };\n\n return metaData;\n }\n}\n"],"names":["responseInternalSymbol","Object","getOwnPropertySymbols","Response","NFCResponse","constructor","bodyStream","metaData","ejectFromCache","ejectSelfFromCache","fromCache","serializeMetaFromNodeFetchResponse","res","url","status","statusText","headers","raw","size","timeout","counter"],"mappings":"AAAA;;;;AACiD,IAAA,UAAY,WAAZ,YAAY,CAAA;AAE7D,MAAMA,sBAAsB,GAAGC,MAAM,CAACC,qBAAqB,CAAC,IAAIC,UAAQ,SAAA,EAAE,CAAC,CAAC,CAAC,CAAC,AAAC;AAExE,MAAMC,WAAW,SAASD,UAAQ,SAAA;IACvCE,YACEC,UAAqB,EACrBC,QAAuB,EAChBC,cAAyD,GAAG,SAASA,cAAc,GAExF;QACA,OAAO,IAAI,CAACC,kBAAkB,EAAE,CAAC;KAClC,EACMC,SAAkB,GAAG,KAAK,CACjC;QACA,KAAK,CAACJ,UAAU,EAAEC,QAAQ,CAAC,CAAC;aAPrBC,cAAyD,GAAzDA,cAAyD;aAKzDE,SAAkB,GAAlBA,SAAkB;KAG1B;IAED,OAAOC,kCAAkC,CAACC,GAAa,EAAE;QACvD,MAAML,QAAQ,GAAG;YACfM,GAAG,EAAED,GAAG,CAACC,GAAG;YACZC,MAAM,EAAEF,GAAG,CAACE,MAAM;YAClBC,UAAU,EAAEH,GAAG,CAACG,UAAU;YAC1BC,OAAO,EAAEJ,GAAG,CAACI,OAAO,CAACC,GAAG,EAAE;YAC1BC,IAAI,EAAEN,GAAG,CAACM,IAAI;YACdC,OAAO,EAAEP,GAAG,CAACO,OAAO;YACpB,aAAa;YACbC,OAAO,EAAER,GAAG,CAACZ,sBAAsB,CAAC,CAACoB,OAAO;SAC7C,AAAC;QAEF,OAAOb,QAAQ,CAAC;KACjB;CACF;QA5BYH,WAAW,GAAXA,WAAW"}
|
|
@@ -8,7 +8,6 @@ exports.fetchAsync = void 0;
|
|
|
8
8
|
var _getUserState = require("@expo/config/build/getUserState");
|
|
9
9
|
var _nodeFetch = _interopRequireDefault(require("node-fetch"));
|
|
10
10
|
var _path = _interopRequireDefault(require("path"));
|
|
11
|
-
var _fileSystemCache = require("./cache/FileSystemCache");
|
|
12
11
|
var _wrapFetchWithCache = require("./cache/wrapFetchWithCache");
|
|
13
12
|
var _wrapFetchWithBaseUrl = require("./wrapFetchWithBaseUrl");
|
|
14
13
|
var _wrapFetchWithOffline = require("./wrapFetchWithOffline");
|
|
@@ -98,7 +97,8 @@ function createCachedFetch({ fetch =fetchWithCredentials , cacheDirectory , ttl
|
|
|
98
97
|
if (skipCache || _env.env.EXPO_BETA || _env.env.EXPO_NO_CACHE) {
|
|
99
98
|
return fetch;
|
|
100
99
|
}
|
|
101
|
-
|
|
100
|
+
const { FileSystemCache } = require("./cache/FileSystemCache");
|
|
101
|
+
return (0, _wrapFetchWithCache).wrapFetchWithCache(fetch, new FileSystemCache({
|
|
102
102
|
cacheDirectory: _path.default.join((0, _getUserState).getExpoHomeDirectory(), cacheDirectory),
|
|
103
103
|
ttl
|
|
104
104
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport { JSONValue } from '@expo/json-file';\nimport fetchInstance from 'node-fetch';\nimport path from 'path';\n\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/api/rest/client.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport { JSONValue } from '@expo/json-file';\nimport fetchInstance from 'node-fetch';\nimport path from 'path';\n\nimport { wrapFetchWithCache } from './cache/wrapFetchWithCache';\nimport { FetchLike } from './client.types';\nimport { wrapFetchWithBaseUrl } from './wrapFetchWithBaseUrl';\nimport { wrapFetchWithOffline } from './wrapFetchWithOffline';\nimport { wrapFetchWithProgress } from './wrapFetchWithProgress';\nimport { wrapFetchWithProxy } from './wrapFetchWithProxy';\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { getExpoApiBaseUrl } from '../endpoint';\nimport { disableNetwork } from '../settings';\nimport UserSettings from '../user/UserSettings';\n\nexport class ApiV2Error extends Error {\n readonly name = 'ApiV2Error';\n readonly code: string;\n readonly expoApiV2ErrorCode: string;\n readonly expoApiV2ErrorDetails?: JSONValue;\n readonly expoApiV2ErrorServerStack?: string;\n readonly expoApiV2ErrorMetadata?: object;\n\n constructor(response: {\n message: string;\n code: string;\n stack?: string;\n details?: JSONValue;\n metadata?: object;\n }) {\n super(response.message);\n this.code = response.code;\n this.expoApiV2ErrorCode = response.code;\n this.expoApiV2ErrorDetails = response.details;\n this.expoApiV2ErrorServerStack = response.stack;\n this.expoApiV2ErrorMetadata = response.metadata;\n }\n}\n\n/**\n * An Expo server error that didn't return the expected error JSON information.\n * The only 'expected' place for this is in testing, all other cases are bugs with the server.\n */\nexport class UnexpectedServerError extends Error {\n readonly name = 'UnexpectedServerError';\n}\n\n/**\n * @returns a `fetch` function that will inject user authentication information and handle errors from the Expo API.\n */\nexport function wrapFetchWithCredentials(fetchFunction: FetchLike): FetchLike {\n return async function fetchWithCredentials(url, options = {}) {\n if (Array.isArray(options.headers)) {\n throw new Error('request headers must be in object form');\n }\n\n const resolvedHeaders = options.headers ?? ({} as any);\n\n const token = UserSettings.getAccessToken();\n if (token) {\n resolvedHeaders.authorization = `Bearer ${token}`;\n } else {\n const sessionSecret = UserSettings.getSession()?.sessionSecret;\n if (sessionSecret) {\n resolvedHeaders['expo-session'] = sessionSecret;\n }\n }\n\n try {\n const results = await fetchFunction(url, {\n ...options,\n headers: resolvedHeaders,\n });\n\n if (results.status >= 400 && results.status < 500) {\n const body = await results.text();\n try {\n const data = JSON.parse(body);\n if (data?.errors?.length) {\n throw new ApiV2Error(data.errors[0]);\n }\n } catch (error: any) {\n // Server returned non-json response.\n if (error.message.includes('in JSON at position')) {\n throw new UnexpectedServerError(body);\n }\n throw error;\n }\n }\n return results;\n } catch (error: any) {\n // Specifically, when running `npx expo start` and the wifi is connected but not really (public wifi, airplanes, etc).\n if ('code' in error && error.code === 'ENOTFOUND') {\n disableNetwork();\n\n throw new CommandError(\n 'OFFLINE',\n 'Network connection is unreliable. Try again with the environment variable `EXPO_OFFLINE=1` to skip network requests.'\n );\n }\n\n throw error;\n }\n };\n}\n\nconst fetchWithOffline = wrapFetchWithOffline(fetchInstance);\n\nconst fetchWithBaseUrl = wrapFetchWithBaseUrl(fetchWithOffline, getExpoApiBaseUrl() + '/v2/');\n\nconst fetchWithProxy = wrapFetchWithProxy(fetchWithBaseUrl);\n\nconst fetchWithCredentials = wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));\n\n/**\n * Create an instance of the fully qualified fetch command (auto authentication and api) but with caching in the '~/.expo' directory.\n * Caching is disabled automatically if the EXPO_NO_CACHE or EXPO_BETA environment variables are enabled.\n */\nexport function createCachedFetch({\n fetch = fetchWithCredentials,\n cacheDirectory,\n ttl,\n skipCache,\n}: {\n fetch?: FetchLike;\n cacheDirectory: string;\n ttl?: number;\n skipCache?: boolean;\n}): FetchLike {\n // Disable all caching in EXPO_BETA.\n if (skipCache || env.EXPO_BETA || env.EXPO_NO_CACHE) {\n return fetch;\n }\n\n const { FileSystemCache } =\n require('./cache/FileSystemCache') as typeof import('./cache/FileSystemCache');\n\n return wrapFetchWithCache(\n fetch,\n new FileSystemCache({\n cacheDirectory: path.join(getExpoHomeDirectory(), cacheDirectory),\n ttl,\n })\n );\n}\n\n/** Instance of fetch with automatic base URL pointing to the Expo API, user credential injection, and API error handling. Caching not included. */\nexport const fetchAsync = wrapFetchWithProgress(wrapFetchWithCredentials(fetchWithProxy));\n"],"names":["wrapFetchWithCredentials","createCachedFetch","ApiV2Error","Error","name","constructor","response","message","code","expoApiV2ErrorCode","expoApiV2ErrorDetails","details","expoApiV2ErrorServerStack","stack","expoApiV2ErrorMetadata","metadata","UnexpectedServerError","fetchFunction","fetchWithCredentials","url","options","Array","isArray","headers","resolvedHeaders","token","UserSettings","getAccessToken","authorization","sessionSecret","getSession","results","status","body","text","data","JSON","parse","errors","length","error","includes","disableNetwork","CommandError","fetchWithOffline","wrapFetchWithOffline","fetchInstance","fetchWithBaseUrl","wrapFetchWithBaseUrl","getExpoApiBaseUrl","fetchWithProxy","wrapFetchWithProxy","wrapFetchWithProgress","fetch","cacheDirectory","ttl","skipCache","env","EXPO_BETA","EXPO_NO_CACHE","FileSystemCache","require","wrapFetchWithCache","path","join","getExpoHomeDirectory","fetchAsync"],"mappings":"AAAA;;;;QAoDgBA,wBAAwB,GAAxBA,wBAAwB;QAoExBC,iBAAiB,GAAjBA,iBAAiB;;AAxHI,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AAE5C,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACrB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEY,IAAA,mBAA4B,WAA5B,4BAA4B,CAAA;AAE1B,IAAA,qBAAwB,WAAxB,wBAAwB,CAAA;AACxB,IAAA,qBAAwB,WAAxB,wBAAwB,CAAA;AACvB,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC5B,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;AACrC,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACR,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AACf,IAAA,SAAa,WAAb,aAAa,CAAA;AAChB,IAAA,SAAa,WAAb,aAAa,CAAA;AACnB,IAAA,aAAsB,kCAAtB,sBAAsB,EAAA;;;;;;AAExC,MAAMC,UAAU,SAASC,KAAK;IACnC,AAASC,IAAI,GAAG,YAAY,CAAC;IAO7BC,YAAYC,QAMX,CAAE;QACD,KAAK,CAACA,QAAQ,CAACC,OAAO,CAAC,CAAC;QACxB,IAAI,CAACC,IAAI,GAAGF,QAAQ,CAACE,IAAI,CAAC;Q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
skipSDKVersionRequirement: true
|
|
50
50
|
});
|
|
51
|
-
await new MetroBundlerDevServer(projectRoot, getPlatformBundlers(exp),
|
|
51
|
+
await new MetroBundlerDevServer(projectRoot, getPlatformBundlers(exp), {
|
|
52
|
+
isDevClient: true
|
|
53
|
+
}).startTypeScriptServices();
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
//# sourceMappingURL=typescript.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/customize/typescript.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport { Log } from '../log';\n\nexport async function typescript(projectRoot: string) {\n const { TypeScriptProjectPrerequisite } = await import(\n '../start/doctor/typescript/TypeScriptProjectPrerequisite.js'\n );\n const { MetroBundlerDevServer } = await import('../start/server/metro/MetroBundlerDevServer.js');\n const { getPlatformBundlers } = await import('../start/server/platformBundlers.js');\n\n try {\n await new TypeScriptProjectPrerequisite(projectRoot).bootstrapAsync();\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.exception(error);\n return;\n }\n\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n await new MetroBundlerDevServer(
|
|
1
|
+
{"version":3,"sources":["../../../src/customize/typescript.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\n\nimport { Log } from '../log';\n\nexport async function typescript(projectRoot: string) {\n const { TypeScriptProjectPrerequisite } = await import(\n '../start/doctor/typescript/TypeScriptProjectPrerequisite.js'\n );\n const { MetroBundlerDevServer } = await import('../start/server/metro/MetroBundlerDevServer.js');\n const { getPlatformBundlers } = await import('../start/server/platformBundlers.js');\n\n try {\n await new TypeScriptProjectPrerequisite(projectRoot).bootstrapAsync();\n } catch (error: any) {\n // Ensure the process doesn't fail if the TypeScript check fails.\n // This could happen during the install.\n Log.log();\n Log.exception(error);\n return;\n }\n\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n await new MetroBundlerDevServer(projectRoot, getPlatformBundlers(exp), {\n isDevClient: true,\n }).startTypeScriptServices();\n}\n"],"names":["typescript","projectRoot","TypeScriptProjectPrerequisite","MetroBundlerDevServer","getPlatformBundlers","bootstrapAsync","error","Log","log","exception","exp","getConfig","skipSDKVersionRequirement","isDevClient","startTypeScriptServices"],"mappings":"AAAA;;;;QAIsBA,UAAU,GAAVA,UAAU;AAJN,IAAA,OAAc,WAAd,cAAc,CAAA;AAEpB,IAAA,IAAQ,WAAR,QAAQ,CAAA;;;;;;;;;;;;;;;;;;;;;;AAErB,eAAeA,UAAU,CAACC,WAAmB,EAAE;IACpD,MAAM,EAAEC,6BAA6B,CAAA,EAAE,GAAG,MAAM;+CAC9C,6DAA6D;MAC9D,AAAC;IACF,MAAM,EAAEC,qBAAqB,CAAA,EAAE,GAAG,MAAM;+CAAO,gDAAgD;MAAC,AAAC;IACjG,MAAM,EAAEC,mBAAmB,CAAA,EAAE,GAAG,MAAM;+CAAO,qCAAqC;MAAC,AAAC;IAEpF,IAAI;QACF,MAAM,IAAIF,6BAA6B,CAACD,WAAW,CAAC,CAACI,cAAc,EAAE,CAAC;KACvE,CAAC,OAAOC,KAAK,EAAO;QACnB,iEAAiE;QACjE,wCAAwC;QACxCC,IAAG,IAAA,CAACC,GAAG,EAAE,CAAC;QACVD,IAAG,IAAA,CAACE,SAAS,CAACH,KAAK,CAAC,CAAC;QACrB,OAAO;KACR;IAED,MAAM,EAAEI,GAAG,CAAA,EAAE,GAAGC,CAAAA,GAAAA,OAAS,AAAkD,CAAA,UAAlD,CAACV,WAAW,EAAE;QAAEW,yBAAyB,EAAE,IAAI;KAAE,CAAC,AAAC;IAC5E,MAAM,IAAIT,qBAAqB,CAACF,WAAW,EAAEG,mBAAmB,CAACM,GAAG,CAAC,EAAE;QACrEG,WAAW,EAAE,IAAI;KAClB,CAAC,CAACC,uBAAuB,EAAE,CAAC;CAC9B"}
|
|
@@ -9,7 +9,7 @@ function _interopRequireDefault(obj) {
|
|
|
9
9
|
default: obj
|
|
10
10
|
};
|
|
11
11
|
}
|
|
12
|
-
function createMetadataJson({ bundles , fileNames }) {
|
|
12
|
+
function createMetadataJson({ bundles , fileNames , embeddedHashSet }) {
|
|
13
13
|
// Build metadata.json
|
|
14
14
|
return {
|
|
15
15
|
version: 0,
|
|
@@ -22,7 +22,8 @@ function createMetadataJson({ bundles , fileNames }) {
|
|
|
22
22
|
// Get the filename for each platform's bundle.
|
|
23
23
|
bundle: _path.default.join("bundles", fileNames[platform]),
|
|
24
24
|
// Collect all of the assets and convert them to the serial format.
|
|
25
|
-
assets: bundle.assets.
|
|
25
|
+
assets: bundle.assets.filter((asset)=>!embeddedHashSet || !embeddedHashSet.has(asset.hash)
|
|
26
|
+
).map((asset)=>{
|
|
26
27
|
var // Each asset has multiple hashes which we convert and then flatten.
|
|
27
28
|
ref;
|
|
28
29
|
return (ref = asset.fileHashes) == null ? void 0 : ref.map((hash)=>({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/export/createMetadataJson.ts"],"sourcesContent":["import path from 'path';\n\nimport { BundleOutput } from './fork-bundleAsync';\n\nexport type BundlePlatform = 'android' | 'ios';\n\ntype PlatformMetadataAsset = { path: string; ext: string };\n\ntype PlatformMetadata = { bundle: string; assets: PlatformMetadataAsset[] };\n\ntype FileMetadata = {\n [key in BundlePlatform]: PlatformMetadata;\n};\n\nexport function createMetadataJson({\n bundles,\n fileNames,\n}: {\n bundles: Partial<Record<BundlePlatform, Pick<BundleOutput, 'assets'>>>;\n fileNames: Record<string, string | undefined>;\n}): {\n version: 0;\n bundler: 'metro';\n fileMetadata: FileMetadata;\n} {\n // Build metadata.json\n return {\n version: 0,\n bundler: 'metro',\n fileMetadata: Object.entries(bundles).reduce<Record<string, Partial<PlatformMetadata>>>(\n (metadata, [platform, bundle]) => {\n if (platform === 'web') return metadata;\n\n return {\n ...metadata,\n [platform]: {\n // Get the filename for each platform's bundle.\n bundle: path.join('bundles', fileNames[platform]!),\n // Collect all of the assets and convert them to the serial format.\n assets: bundle.assets\n .map(\n (asset) =>\n // Each asset has multiple hashes which we convert and then flatten.\n asset.fileHashes?.map((hash) => ({\n path: path.join('assets', hash),\n ext: asset.type,\n }))\n )\n .filter(Boolean)\n .flat(),\n },\n };\n },\n {}\n ) as FileMetadata,\n };\n}\n"],"names":["createMetadataJson","bundles","fileNames","version","bundler","fileMetadata","Object","entries","reduce","metadata","platform","bundle","path","join","assets","
|
|
1
|
+
{"version":3,"sources":["../../../src/export/createMetadataJson.ts"],"sourcesContent":["import path from 'path';\n\nimport { BundleOutput } from './fork-bundleAsync';\n\nexport type BundlePlatform = 'android' | 'ios';\n\ntype PlatformMetadataAsset = { path: string; ext: string };\n\ntype PlatformMetadata = { bundle: string; assets: PlatformMetadataAsset[] };\n\ntype FileMetadata = {\n [key in BundlePlatform]: PlatformMetadata;\n};\n\nexport function createMetadataJson({\n bundles,\n fileNames,\n embeddedHashSet,\n}: {\n bundles: Partial<Record<BundlePlatform, Pick<BundleOutput, 'assets'>>>;\n fileNames: Record<string, string | undefined>;\n embeddedHashSet?: Set<string>;\n}): {\n version: 0;\n bundler: 'metro';\n fileMetadata: FileMetadata;\n} {\n // Build metadata.json\n return {\n version: 0,\n bundler: 'metro',\n fileMetadata: Object.entries(bundles).reduce<Record<string, Partial<PlatformMetadata>>>(\n (metadata, [platform, bundle]) => {\n if (platform === 'web') return metadata;\n\n return {\n ...metadata,\n [platform]: {\n // Get the filename for each platform's bundle.\n bundle: path.join('bundles', fileNames[platform]!),\n // Collect all of the assets and convert them to the serial format.\n assets: bundle.assets\n .filter((asset) => !embeddedHashSet || !embeddedHashSet.has(asset.hash))\n .map(\n (asset) =>\n // Each asset has multiple hashes which we convert and then flatten.\n asset.fileHashes?.map((hash) => ({\n path: path.join('assets', hash),\n ext: asset.type,\n }))\n )\n .filter(Boolean)\n .flat(),\n },\n };\n },\n {}\n ) as FileMetadata,\n };\n}\n"],"names":["createMetadataJson","bundles","fileNames","embeddedHashSet","version","bundler","fileMetadata","Object","entries","reduce","metadata","platform","bundle","path","join","assets","filter","asset","has","hash","map","fileHashes","ext","type","Boolean","flat"],"mappings":"AAAA;;;;QAcgBA,kBAAkB,GAAlBA,kBAAkB;AAdjB,IAAA,KAAM,kCAAN,MAAM,EAAA;;;;;;AAchB,SAASA,kBAAkB,CAAC,EACjCC,OAAO,CAAA,EACPC,SAAS,CAAA,EACTC,eAAe,CAAA,EAKhB,EAIC;IACA,sBAAsB;IACtB,OAAO;QACLC,OAAO,EAAE,CAAC;QACVC,OAAO,EAAE,OAAO;QAChBC,YAAY,EAAEC,MAAM,CAACC,OAAO,CAACP,OAAO,CAAC,CAACQ,MAAM,CAC1C,CAACC,QAAQ,EAAE,CAACC,QAAQ,EAAEC,MAAM,CAAC,GAAK;YAChC,IAAID,QAAQ,KAAK,KAAK,EAAE,OAAOD,QAAQ,CAAC;YAExC,OAAO;gBACL,GAAGA,QAAQ;gBACX,CAACC,QAAQ,CAAC,EAAE;oBACV,+CAA+C;oBAC/CC,MAAM,EAAEC,KAAI,QAAA,CAACC,IAAI,CAAC,SAAS,EAAEZ,SAAS,CAACS,QAAQ,CAAC,CAAE;oBAClD,mEAAmE;oBACnEI,MAAM,EAAEH,MAAM,CAACG,MAAM,CAClBC,MAAM,CAAC,CAACC,KAAK,GAAK,CAACd,eAAe,IAAI,CAACA,eAAe,CAACe,GAAG,CAACD,KAAK,CAACE,IAAI,CAAC;oBAAA,CAAC,CACvEC,GAAG,CACF,CAACH,KAAK;4BACJ,oEAAoE;wBACpEA,GAAgB;wBAAhBA,OAAAA,CAAAA,GAAgB,GAAhBA,KAAK,CAACI,UAAU,SAAK,GAArBJ,KAAAA,CAAqB,GAArBA,GAAgB,CAAEG,GAAG,CAAC,CAACD,IAAI,GAAK,CAAC;gCAC/BN,IAAI,EAAEA,KAAI,QAAA,CAACC,IAAI,CAAC,QAAQ,EAAEK,IAAI,CAAC;gCAC/BG,GAAG,EAAEL,KAAK,CAACM,IAAI;6BAChB,CAAC;wBAAA,CAAC,CAAA;qBAAA,CACN,CACAP,MAAM,CAACQ,OAAO,CAAC,CACfC,IAAI,EAAE;iBACV;aACF,CAAC;SACH,EACD,EAAE,CACH;KACF,CAAC;CACH"}
|
|
@@ -3,15 +3,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
exports.exportEmbedAsync = exportEmbedAsync;
|
|
6
|
+
exports.exportEmbedBundleAsync = exportEmbedBundleAsync;
|
|
7
|
+
var _config = require("@expo/config");
|
|
6
8
|
var _fs = _interopRequireDefault(require("fs"));
|
|
7
9
|
var _server = _interopRequireDefault(require("metro/src/Server"));
|
|
8
10
|
var _bundle = _interopRequireDefault(require("metro/src/shared/output/bundle"));
|
|
9
11
|
var _path = _interopRequireDefault(require("path"));
|
|
10
12
|
var _log = require("../../log");
|
|
11
13
|
var _instantiateMetro = require("../../start/server/metro/instantiateMetro");
|
|
12
|
-
var
|
|
14
|
+
var _metroOptions = require("../../start/server/middleware/metroOptions");
|
|
13
15
|
var _nodeEnv = require("../../utils/nodeEnv");
|
|
16
|
+
var _profile = require("../../utils/profile");
|
|
17
|
+
var _exportHermes = require("../exportHermes");
|
|
14
18
|
var _forkBundleAsync = require("../fork-bundleAsync");
|
|
19
|
+
var _persistMetroAssets = require("../persistMetroAssets");
|
|
15
20
|
function _interopRequireDefault(obj) {
|
|
16
21
|
return obj && obj.__esModule ? obj : {
|
|
17
22
|
default: obj
|
|
@@ -20,49 +25,71 @@ function _interopRequireDefault(obj) {
|
|
|
20
25
|
async function exportEmbedAsync(projectRoot, options) {
|
|
21
26
|
(0, _nodeEnv).setNodeEnv(options.dev ? "development" : "production");
|
|
22
27
|
require("@expo/env").load(projectRoot);
|
|
28
|
+
const { bundle , assets } = await exportEmbedBundleAsync(projectRoot, options);
|
|
29
|
+
_fs.default.mkdirSync(_path.default.dirname(options.bundleOutput), {
|
|
30
|
+
recursive: true,
|
|
31
|
+
mode: 493
|
|
32
|
+
});
|
|
33
|
+
// Persist bundle and source maps.
|
|
34
|
+
await Promise.all([
|
|
35
|
+
_bundle.default.save(bundle, options, _log.Log.log),
|
|
36
|
+
// NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native
|
|
37
|
+
// platforms when doing production embeds (unlikely).
|
|
38
|
+
options.assetsDest ? (0, _persistMetroAssets).persistMetroAssetsAsync(assets, {
|
|
39
|
+
platform: options.platform,
|
|
40
|
+
outputDirectory: options.assetsDest,
|
|
41
|
+
iosAssetCatalogDirectory: options.assetCatalogDest
|
|
42
|
+
}) : null,
|
|
43
|
+
]);
|
|
44
|
+
}
|
|
45
|
+
async function exportEmbedBundleAsync(projectRoot, options) {
|
|
46
|
+
const exp = (0, _config).getConfig(projectRoot, {
|
|
47
|
+
skipSDKVersionRequirement: true
|
|
48
|
+
}).exp;
|
|
49
|
+
// TODO: This is slow ~40ms
|
|
23
50
|
const { config } = await (0, _instantiateMetro).loadMetroConfigAsync(projectRoot, {
|
|
24
51
|
maxWorkers: options.maxWorkers,
|
|
25
52
|
resetCache: options.resetCache,
|
|
26
53
|
config: options.config
|
|
27
54
|
}, {
|
|
55
|
+
exp,
|
|
28
56
|
isExporting: true
|
|
29
57
|
});
|
|
30
|
-
|
|
31
|
-
// platforms when doing production embeds (unlikely).
|
|
32
|
-
const saveAssets = (0, _resolveFromProject).importCliSaveAssetsFromProject(projectRoot);
|
|
58
|
+
const isHermes = (0, _exportHermes).isEnableHermesManaged(exp, options.platform);
|
|
33
59
|
let sourceMapUrl = options.sourcemapOutput;
|
|
34
60
|
if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {
|
|
35
61
|
sourceMapUrl = _path.default.basename(sourceMapUrl);
|
|
36
62
|
}
|
|
37
63
|
const bundleRequest = {
|
|
38
64
|
..._server.default.DEFAULT_BUNDLE_OPTIONS,
|
|
39
|
-
|
|
65
|
+
...(0, _metroOptions).getMetroDirectBundleOptions({
|
|
66
|
+
mainModuleName: options.entryFile,
|
|
67
|
+
platform: options.platform,
|
|
68
|
+
minify: options.minify,
|
|
69
|
+
mode: options.dev ? "development" : "production",
|
|
70
|
+
engine: isHermes ? "hermes" : undefined,
|
|
71
|
+
baseUrl: (0, _metroOptions).getBaseUrlFromExpoConfig(exp)
|
|
72
|
+
}),
|
|
40
73
|
sourceMapUrl,
|
|
41
|
-
|
|
42
|
-
minify: !!options.minify,
|
|
43
|
-
platform: options.platform,
|
|
44
|
-
unstable_transformProfile: options.unstableTransformProfile
|
|
74
|
+
unstable_transformProfile: options.unstableTransformProfile || (isHermes ? "hermes-stable" : "default")
|
|
45
75
|
};
|
|
46
76
|
const server = new _server.default(config, {
|
|
47
77
|
watch: false
|
|
48
78
|
});
|
|
49
79
|
try {
|
|
50
|
-
const bundle = await server.build({
|
|
80
|
+
const bundle = await (0, _profile).profile(server.build.bind(server), "metro-bundle")({
|
|
51
81
|
...bundleRequest,
|
|
52
82
|
bundleType: "bundle"
|
|
53
83
|
});
|
|
54
|
-
_fs.default.mkdirSync(_path.default.dirname(options.bundleOutput), {
|
|
55
|
-
recursive: true,
|
|
56
|
-
mode: 493
|
|
57
|
-
});
|
|
58
|
-
// Persist bundle and source maps.
|
|
59
|
-
await _bundle.default.save(bundle, options, _log.Log.log);
|
|
60
84
|
// Save the assets of the bundle
|
|
61
85
|
const outputAssets = await (0, _forkBundleAsync).getAssets(server, {
|
|
62
86
|
...bundleRequest,
|
|
63
87
|
bundleType: "todo"
|
|
64
88
|
});
|
|
65
|
-
|
|
89
|
+
return {
|
|
90
|
+
bundle,
|
|
91
|
+
assets: outputAssets
|
|
92
|
+
};
|
|
66
93
|
} finally{
|
|
67
94
|
server.end();
|
|
68
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["import fs from 'fs';\nimport Server from 'metro/src/Server';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { Options } from './resolveOptions';\nimport { Log } from '../../log';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["import { getConfig } from '@expo/config';\nimport fs from 'fs';\nimport Server from 'metro/src/Server';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { Options } from './resolveOptions';\nimport { Log } from '../../log';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport {\n getBaseUrlFromExpoConfig,\n getMetroDirectBundleOptions,\n} from '../../start/server/middleware/metroOptions';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { getAssets } from '../fork-bundleAsync';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.dev ? 'development' : 'production');\n require('@expo/env').load(projectRoot);\n\n const { bundle, assets } = await exportEmbedBundleAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function exportEmbedBundleAsync(projectRoot: string, options: Options) {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n maxWorkers: options.maxWorkers,\n resetCache: options.resetCache,\n config: options.config,\n },\n {\n exp,\n isExporting: true,\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const bundleRequest = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...getMetroDirectBundleOptions({\n mainModuleName: options.entryFile,\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n baseUrl: getBaseUrlFromExpoConfig(exp),\n }),\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n try {\n const bundle = await profile(\n server.build.bind(server),\n 'metro-bundle'\n )({\n ...bundleRequest,\n bundleType: 'bundle',\n });\n\n // Save the assets of the bundle\n const outputAssets = await getAssets(server, {\n ...bundleRequest,\n bundleType: 'todo',\n });\n\n return {\n bundle,\n assets: outputAssets,\n };\n } finally {\n server.end();\n }\n}\n"],"names":["exportEmbedAsync","exportEmbedBundleAsync","projectRoot","options","setNodeEnv","dev","require","load","bundle","assets","fs","mkdirSync","path","dirname","bundleOutput","recursive","mode","Promise","all","output","save","Log","log","assetsDest","persistMetroAssetsAsync","platform","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","exp","getConfig","skipSDKVersionRequirement","config","loadMetroConfigAsync","maxWorkers","resetCache","isExporting","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","basename","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","getMetroDirectBundleOptions","mainModuleName","entryFile","minify","engine","undefined","baseUrl","getBaseUrlFromExpoConfig","unstable_transformProfile","unstableTransformProfile","server","watch","profile","build","bind","bundleType","outputAssets","getAssets","end"],"mappings":"AAAA;;;;QAoBsBA,gBAAgB,GAAhBA,gBAAgB;QAuBhBC,sBAAsB,GAAt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4BAP4B,CAAC;YAC7BC,cAAc,EAAE5C,OAAO,CAAC6C,SAAS;YACjCvB,QAAQ,EAAEtB,OAAO,CAACsB,QAAQ;YAC1BwB,MAAM,EAAE9C,OAAO,CAAC8C,MAAM;YACtBjC,IAAI,EAAEb,OAAO,CAACE,GAAG,GAAG,aAAa,GAAG,YAAY;YAChD6C,MAAM,EAAEb,QAAQ,GAAG,QAAQ,GAAGc,SAAS;YACvCC,OAAO,EAAEC,CAAAA,GAAAA,aAAwB,AAAK,CAAA,yBAAL,CAACxB,GAAG,CAAC;SACvC,CAAC;QACFU,YAAY;QACZe,yBAAyB,EAAGnD,OAAO,CAACoD,wBAAwB,IAC1D,CAAClB,QAAQ,GAAG,eAAe,GAAG,SAAS,CAAC;KAC3C,AAAC;IAEF,MAAMmB,MAAM,GAAG,IAAIZ,OAAM,QAAA,CAACZ,MAAM,EAAE;QAChCyB,KAAK,EAAE,KAAK;KACb,CAAC,AAAC;IAEH,IAAI;QACF,MAAMjD,MAAM,GAAG,MAAMkD,CAAAA,GAAAA,QAAO,AAG3B,CAAA,QAH2B,CAC1BF,MAAM,CAACG,KAAK,CAACC,IAAI,CAACJ,MAAM,CAAC,EACzB,cAAc,CACf,CAAC;YACA,GAAGb,aAAa;YAChBkB,UAAU,EAAE,QAAQ;SACrB,CAAC,AAAC;QAEH,gCAAgC;QAChC,MAAMC,YAAY,GAAG,MAAMC,CAAAA,GAAAA,gBAAS,AAGlC,CAAA,UAHkC,CAACP,MAAM,EAAE;YAC3C,GAAGb,aAAa;YAChBkB,UAAU,EAAE,MAAM;SACnB,CAAC,AAAC;QAEH,OAAO;YACLrD,MAAM;YACNC,MAAM,EAAEqD,YAAY;SACrB,CAAC;KACH,QAAS;QACRN,MAAM,CAACQ,GAAG,EAAE,CAAC;KACd;CACF"}
|
|
@@ -31,7 +31,7 @@ function resolveOptions(args, parsed) {
|
|
|
31
31
|
if (!bundleOutput) {
|
|
32
32
|
throw new _errors.CommandError(`Missing required argument: --bundle-output`);
|
|
33
33
|
}
|
|
34
|
-
var ref2, ref3, ref4
|
|
34
|
+
var ref2, ref3, ref4;
|
|
35
35
|
return {
|
|
36
36
|
entryFile,
|
|
37
37
|
assetCatalogDest: args["--asset-catalog-dest"],
|
|
@@ -46,10 +46,10 @@ function resolveOptions(args, parsed) {
|
|
|
46
46
|
sourcemapSourcesRoot: args["--sourcemap-sources-root"],
|
|
47
47
|
sourcemapUseAbsolutePath: !!parsed.args["--sourcemap-use-absolute-path"],
|
|
48
48
|
assetsDest: args["--assets-dest"],
|
|
49
|
-
unstableTransformProfile:
|
|
49
|
+
unstableTransformProfile: args["--unstable-transform-profile"],
|
|
50
50
|
resetCache: !!parsed.args["--reset-cache"],
|
|
51
51
|
resetGlobalCache: false,
|
|
52
|
-
verbose: (
|
|
52
|
+
verbose: (ref4 = args["--verbose"]) != null ? ref4 : _env.env.EXPO_DEBUG,
|
|
53
53
|
config: args["--config"] ? _path.default.resolve(args["--config"]) : undefined,
|
|
54
54
|
dev,
|
|
55
55
|
minify
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/resolveOptions.ts"],"sourcesContent":["import arg from 'arg';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { resolveCustomBooleanArgsAsync } from '../../utils/resolveArgs';\n\nexport interface Options {\n assetsDest?: string;\n assetCatalogDest?: string;\n entryFile: string;\n resetCache: boolean;\n resetGlobalCache: boolean;\n transformer?: string;\n minify?: boolean;\n config?: string;\n platform: string;\n dev: boolean;\n bundleOutput: string;\n bundleEncoding?: string;\n maxWorkers?: number;\n sourcemapOutput?: string;\n sourcemapSourcesRoot?: string;\n sourcemapUseAbsolutePath: boolean;\n verbose: boolean;\n unstableTransformProfile
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/resolveOptions.ts"],"sourcesContent":["import arg from 'arg';\nimport path from 'path';\n\nimport { env } from '../../utils/env';\nimport { CommandError } from '../../utils/errors';\nimport { resolveCustomBooleanArgsAsync } from '../../utils/resolveArgs';\n\nexport interface Options {\n assetsDest?: string;\n assetCatalogDest?: string;\n entryFile: string;\n resetCache: boolean;\n resetGlobalCache: boolean;\n transformer?: string;\n minify?: boolean;\n config?: string;\n platform: string;\n dev: boolean;\n bundleOutput: string;\n bundleEncoding?: string;\n maxWorkers?: number;\n sourcemapOutput?: string;\n sourcemapSourcesRoot?: string;\n sourcemapUseAbsolutePath: boolean;\n verbose: boolean;\n unstableTransformProfile?: string;\n}\n\nfunction assertIsBoolean(val: any): asserts val is boolean {\n if (typeof val !== 'boolean') {\n throw new CommandError(`Expected boolean, got ${typeof val}`);\n }\n}\n\nexport function resolveOptions(\n args: arg.Result<arg.Spec>,\n parsed: Awaited<ReturnType<typeof resolveCustomBooleanArgsAsync>>\n): Options {\n const dev = parsed.args['--dev'] ?? true;\n assertIsBoolean(dev);\n\n const minify = parsed.args['--minify'] ?? !dev;\n assertIsBoolean(minify);\n\n const entryFile = args['--entry-file'];\n if (!entryFile) {\n throw new CommandError(`Missing required argument: --entry-file`);\n }\n const bundleOutput = args['--bundle-output'];\n if (!bundleOutput) {\n throw new CommandError(`Missing required argument: --bundle-output`);\n }\n return {\n entryFile,\n assetCatalogDest: args['--asset-catalog-dest'],\n platform: args['--platform'] ?? 'ios',\n transformer: args['--transformer'],\n // TODO: Support `--dev false`\n // dev: false,\n bundleOutput,\n bundleEncoding: args['--bundle-encoding'] ?? 'utf8',\n maxWorkers: args['--max-workers'],\n sourcemapOutput: args['--sourcemap-output'],\n sourcemapSourcesRoot: args['--sourcemap-sources-root'],\n sourcemapUseAbsolutePath: !!parsed.args['--sourcemap-use-absolute-path'],\n assetsDest: args['--assets-dest'],\n unstableTransformProfile: args['--unstable-transform-profile'],\n resetCache: !!parsed.args['--reset-cache'],\n resetGlobalCache: false,\n verbose: args['--verbose'] ?? env.EXPO_DEBUG,\n config: args['--config'] ? path.resolve(args['--config']) : undefined,\n dev,\n minify,\n };\n}\n"],"names":["resolveOptions","assertIsBoolean","val","CommandError","args","parsed","dev","minify","entryFile","bundleOutput","assetCatalogDest","platform","transformer","bundleEncoding","maxWorkers","sourcemapOutput","sourcemapSourcesRoot","sourcemapUseAbsolutePath","assetsDest","unstableTransformProfile","resetCache","resetGlobalCache","verbose","env","EXPO_DEBUG","config","path","resolve","undefined"],"mappings":"AAAA;;;;QAkCgBA,cAAc,GAAdA,cAAc;AAjCb,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEH,IAAA,IAAiB,WAAjB,iBAAiB,CAAA;AACR,IAAA,OAAoB,WAApB,oBAAoB,CAAA;;;;;;AAwBjD,SAASC,eAAe,CAACC,GAAQ,EAA0B;IACzD,IAAI,OAAOA,GAAG,KAAK,SAAS,EAAE;QAC5B,MAAM,IAAIC,OAAY,aAAA,CAAC,CAAC,sBAAsB,EAAE,OAAOD,GAAG,CAAC,CAAC,CAAC,CAAC;KAC/D;CACF;AAEM,SAASF,cAAc,CAC5BI,IAA0B,EAC1BC,MAAiE,EACxD;QACGA,GAAoB;IAAhC,MAAMC,GAAG,GAAGD,CAAAA,GAAoB,GAApBA,MAAM,CAACD,IAAI,CAAC,OAAO,CAAC,YAApBC,GAAoB,GAAI,IAAI,AAAC;IACzCJ,eAAe,CAACK,GAAG,CAAC,CAAC;QAEND,IAAuB;IAAtC,MAAME,MAAM,GAAGF,CAAAA,IAAuB,GAAvBA,MAAM,CAACD,IAAI,CAAC,UAAU,CAAC,YAAvBC,IAAuB,GAAI,CAACC,GAAG,AAAC;IAC/CL,eAAe,CAACM,MAAM,CAAC,CAAC;IAExB,MAAMC,SAAS,GAAGJ,IAAI,CAAC,cAAc,CAAC,AAAC;IACvC,IAAI,CAACI,SAAS,EAAE;QACd,MAAM,IAAIL,OAAY,aAAA,CAAC,CAAC,uCAAuC,CAAC,CAAC,CAAC;KACnE;IACD,MAAMM,YAAY,GAAGL,IAAI,CAAC,iBAAiB,CAAC,AAAC;IAC7C,IAAI,CAACK,YAAY,EAAE;QAC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