@expo/cli 0.13.2 → 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 +30 -27
- 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/config/configAsync.js +1 -1
- package/build/src/config/configAsync.js.map +1 -1
- package/build/src/config/index.js +2 -2
- package/build/src/config/index.js.map +1 -1
- package/build/src/customize/generate.js +1 -1
- package/build/src/customize/generate.js.map +1 -1
- package/build/src/customize/typescript.js +6 -4
- 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/index.js +4 -4
- package/build/src/export/embed/index.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 +74 -83
- 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 +24 -14
- package/build/src/export/exportHermes.js.map +1 -1
- package/build/src/export/exportStaticAsync.js +109 -58
- 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 +56 -23
- package/build/src/export/fork-bundleAsync.js.map +1 -1
- package/build/src/export/index.js +11 -9
- 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/web/index.js +2 -2
- package/build/src/export/web/index.js.map +1 -1
- package/build/src/export/writeContents.js +6 -3
- 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/login/index.js +1 -1
- package/build/src/login/index.js.map +1 -1
- package/build/src/logout/index.js +1 -1
- package/build/src/logout/index.js.map +1 -1
- 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/index.js +3 -3
- package/build/src/prebuild/index.js.map +1 -1
- package/build/src/prebuild/prebuildAsync.js +39 -17
- 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/register/index.js +1 -1
- package/build/src/register/index.js.map +1 -1
- package/build/src/run/android/index.js +2 -2
- package/build/src/run/android/index.js.map +1 -1
- package/build/src/run/ios/appleDevice/AppleDevice.js +35 -2
- package/build/src/run/ios/appleDevice/AppleDevice.js.map +1 -1
- package/build/src/run/ios/index.js +2 -2
- package/build/src/run/ios/index.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/index.js +3 -3
- package/build/src/start/index.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 -20
- package/build/src/start/server/getStaticRenderFunctions.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +67 -64
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/bundleApiRoutes.js +4 -19
- package/build/src/start/server/metro/bundleApiRoutes.js.map +1 -1
- package/build/src/start/server/metro/createExpoMetroResolver.js +187 -0
- package/build/src/start/server/metro/createExpoMetroResolver.js.map +1 -0
- 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/fetchRouterManifest.js.map +1 -1
- package/build/src/start/server/metro/formatFileCandidates.js +72 -0
- package/build/src/start/server/metro/formatFileCandidates.js.map +1 -0
- 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 +37 -16
- package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
- package/build/src/start/server/metro/metroErrorInterface.js +3 -2
- package/build/src/start/server/metro/metroErrorInterface.js.map +1 -1
- package/build/src/start/server/metro/router.js +6 -3
- 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 +268 -191
- 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 +45 -68
- 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/middleware/resolveAssets.js.map +1 -1
- package/build/src/start/server/type-generation/__typetests__/fixtures/basic.js.map +1 -1
- package/build/src/start/server/type-generation/expo-env.js +1 -1
- package/build/src/start/server/type-generation/expo-env.js.map +1 -1
- package/build/src/start/server/type-generation/routes.js +1 -0
- package/build/src/start/server/type-generation/routes.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 +2 -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 +6 -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/build/src/whoami/index.js +1 -1
- package/build/src/whoami/index.js.map +1 -1
- package/package.json +16 -16
- package/static/shims/react-native-web/dist/cjs/exports/AppRegistry/AppContainer.js +13 -0
- package/static/shims/react-native-web/dist/cjs/exports/BackHandler/index.js +10 -0
- package/static/shims/react-native-web/dist/exports/AppRegistry/AppContainer.js +12 -0
- package/static/shims/react-native-web/dist/exports/BackHandler/index.js +7 -0
- package/build/src/export/createBundles.js +0 -37
- package/build/src/export/createBundles.js.map +0 -1
- package/build/src/start/server/metro/resolveFromProject.js +0 -90
- package/build/src/start/server/metro/resolveFromProject.js.map +0 -1
- package/build/src/start/server/middleware/resolveEntryPoint.js +0 -42
- package/build/src/start/server/middleware/resolveEntryPoint.js.map +0 -1
package/build/bin/cli
CHANGED
|
@@ -41,79 +41,79 @@ const commands = {
|
|
|
41
41
|
// Add a new command here
|
|
42
42
|
// NOTE(EvanBacon): Ensure every bundler-related command sets `NODE_ENV` as expected for the command.
|
|
43
43
|
"run:ios": ()=>Promise.resolve().then(function() {
|
|
44
|
-
return _interopRequireWildcard(require("../src/run/ios"));
|
|
44
|
+
return _interopRequireWildcard(require("../src/run/ios/index.js"));
|
|
45
45
|
}).then((i)=>i.expoRunIos
|
|
46
46
|
)
|
|
47
47
|
,
|
|
48
48
|
"run:android": ()=>Promise.resolve().then(function() {
|
|
49
|
-
return _interopRequireWildcard(require("../src/run/android"));
|
|
49
|
+
return _interopRequireWildcard(require("../src/run/android/index.js"));
|
|
50
50
|
}).then((i)=>i.expoRunAndroid
|
|
51
51
|
)
|
|
52
52
|
,
|
|
53
53
|
start: ()=>Promise.resolve().then(function() {
|
|
54
|
-
return _interopRequireWildcard(require("../src/start"));
|
|
54
|
+
return _interopRequireWildcard(require("../src/start/index.js"));
|
|
55
55
|
}).then((i)=>i.expoStart
|
|
56
56
|
)
|
|
57
57
|
,
|
|
58
58
|
prebuild: ()=>Promise.resolve().then(function() {
|
|
59
|
-
return _interopRequireWildcard(require("../src/prebuild"));
|
|
59
|
+
return _interopRequireWildcard(require("../src/prebuild/index.js"));
|
|
60
60
|
}).then((i)=>i.expoPrebuild
|
|
61
61
|
)
|
|
62
62
|
,
|
|
63
63
|
config: ()=>Promise.resolve().then(function() {
|
|
64
|
-
return _interopRequireWildcard(require("../src/config"));
|
|
64
|
+
return _interopRequireWildcard(require("../src/config/index.js"));
|
|
65
65
|
}).then((i)=>i.expoConfig
|
|
66
66
|
)
|
|
67
67
|
,
|
|
68
68
|
export: ()=>Promise.resolve().then(function() {
|
|
69
|
-
return _interopRequireWildcard(require("../src/export"));
|
|
69
|
+
return _interopRequireWildcard(require("../src/export/index.js"));
|
|
70
70
|
}).then((i)=>i.expoExport
|
|
71
71
|
)
|
|
72
72
|
,
|
|
73
73
|
"export:web": ()=>Promise.resolve().then(function() {
|
|
74
|
-
return _interopRequireWildcard(require("../src/export/web"));
|
|
74
|
+
return _interopRequireWildcard(require("../src/export/web/index.js"));
|
|
75
75
|
}).then((i)=>i.expoExportWeb
|
|
76
76
|
)
|
|
77
77
|
,
|
|
78
78
|
"export:embed": ()=>Promise.resolve().then(function() {
|
|
79
|
-
return _interopRequireWildcard(require("../src/export/embed"));
|
|
79
|
+
return _interopRequireWildcard(require("../src/export/embed/index.js"));
|
|
80
80
|
}).then((i)=>i.expoExportEmbed
|
|
81
81
|
)
|
|
82
82
|
,
|
|
83
83
|
// Auxiliary commands
|
|
84
84
|
install: ()=>Promise.resolve().then(function() {
|
|
85
|
-
return _interopRequireWildcard(require("../src/install"));
|
|
85
|
+
return _interopRequireWildcard(require("../src/install/index.js"));
|
|
86
86
|
}).then((i)=>i.expoInstall
|
|
87
87
|
)
|
|
88
88
|
,
|
|
89
89
|
add: ()=>Promise.resolve().then(function() {
|
|
90
|
-
return _interopRequireWildcard(require("../src/install"));
|
|
90
|
+
return _interopRequireWildcard(require("../src/install/index.js"));
|
|
91
91
|
}).then((i)=>i.expoInstall
|
|
92
92
|
)
|
|
93
93
|
,
|
|
94
94
|
customize: ()=>Promise.resolve().then(function() {
|
|
95
|
-
return _interopRequireWildcard(require("../src/customize"));
|
|
95
|
+
return _interopRequireWildcard(require("../src/customize/index.js"));
|
|
96
96
|
}).then((i)=>i.expoCustomize
|
|
97
97
|
)
|
|
98
98
|
,
|
|
99
99
|
// Auth
|
|
100
100
|
login: ()=>Promise.resolve().then(function() {
|
|
101
|
-
return _interopRequireWildcard(require("../src/login"));
|
|
101
|
+
return _interopRequireWildcard(require("../src/login/index.js"));
|
|
102
102
|
}).then((i)=>i.expoLogin
|
|
103
103
|
)
|
|
104
104
|
,
|
|
105
105
|
logout: ()=>Promise.resolve().then(function() {
|
|
106
|
-
return _interopRequireWildcard(require("../src/logout"));
|
|
106
|
+
return _interopRequireWildcard(require("../src/logout/index.js"));
|
|
107
107
|
}).then((i)=>i.expoLogout
|
|
108
108
|
)
|
|
109
109
|
,
|
|
110
110
|
register: ()=>Promise.resolve().then(function() {
|
|
111
|
-
return _interopRequireWildcard(require("../src/register"));
|
|
111
|
+
return _interopRequireWildcard(require("../src/register/index.js"));
|
|
112
112
|
}).then((i)=>i.expoRegister
|
|
113
113
|
)
|
|
114
114
|
,
|
|
115
115
|
whoami: ()=>Promise.resolve().then(function() {
|
|
116
|
-
return _interopRequireWildcard(require("../src/whoami"));
|
|
116
|
+
return _interopRequireWildcard(require("../src/whoami/index.js"));
|
|
117
117
|
}).then((i)=>i.expoWhoami
|
|
118
118
|
)
|
|
119
119
|
};
|
|
@@ -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
|
}
|
|
@@ -255,15 +256,17 @@ process.on("SIGTERM", ()=>process.exit(0)
|
|
|
255
256
|
);
|
|
256
257
|
commands[command]().then((exec)=>{
|
|
257
258
|
exec(commandArgs);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
action
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
259
|
+
if (!(0, _getenv).boolish("EXPO_NO_TELEMETRY", false)) {
|
|
260
|
+
// NOTE(EvanBacon): Track some basic telemetry events indicating the command
|
|
261
|
+
// that was run. This can be disabled with the $EXPO_NO_TELEMETRY environment variable.
|
|
262
|
+
// We do this to determine how well deprecations are going before removing a command.
|
|
263
|
+
const { logEventAsync } = require("../src/utils/analytics/rudderstackClient");
|
|
264
|
+
logEventAsync("action", {
|
|
265
|
+
action: `expo ${command}`,
|
|
266
|
+
source: "expo/cli",
|
|
267
|
+
source_version: "0.15.0"
|
|
268
|
+
});
|
|
269
|
+
}
|
|
267
270
|
});
|
|
268
271
|
|
|
269
272
|
//# sourceMappingURL=cli.map
|
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').then((i) => i.expoRunIos),\n 'run:android': () => import('../src/run/android').then((i) => i.expoRunAndroid),\n start: () => import('../src/start').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild').then((i) => i.expoPrebuild),\n config: () => import('../src/config').then((i) => i.expoConfig),\n export: () => import('../src/export').then((i) => i.expoExport),\n 'export:web': () => import('../src/export/web').then((i) => i.expoExportWeb),\n 'export:embed': () => import('../src/export/embed').then((i) => i.expoExportEmbed),\n\n // Auxiliary commands\n install: () => import('../src/install').then((i) => i.expoInstall),\n add: () => import('../src/install').then((i) => i.expoInstall),\n customize: () => import('../src/customize').then((i) => i.expoCustomize),\n\n // Auth\n login: () => import('../src/login').then((i) => i.expoLogin),\n logout: () => import('../src/logout').then((i) => i.expoLogout),\n register: () => import('../src/register').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami').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 // 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"],"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,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,GAAG,CAAC;CAC9B;AAED,MAAMC,U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CAAC,CAAC,CAAC,GAAGpC,IAAI,CAACY,CAAC,AAAC;AAE5D,6CAA6C;AAC7C,IAAIZ,IAAI,CAAC,QAAQ,CAAC,EAAE;IAClBmC,WAAW,CAACE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC5B;AAED,qBAAqB;AACrBrE,OAAO,CAACsE,EAAE,CAAC,QAAQ,EAAE,IAAMtE,OAAO,CAACuC,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAC5CvC,OAAO,CAACsE,EAAE,CAAC,SAAS,EAAE,IAAMtE,OAAO,CAACuC,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAE7CnC,QAAQ,CAAC8D,OAAO,CAAC,EAAE,CAAC7D,IAAI,CAAC,CAACkE,IAAI,GAAK;IACjCA,IAAI,CAACJ,WAAW,CAAC,CAAC;IAElB,4EAA4E;IAC5E,uFAAuF;IACvF,qFAAqF;IACrF,MAAM,EAAEK,aAAa,CAAA,EAAE,GACrBC,OAAO,CAAC,0CAA0C,CAAC,AAA6D,AAAC;IACnHD,aAAa,CAAC,QAAQ,EAAE;QACtBE,MAAM,EAAE,CAAC,KAAK,EAAER,OAAO,CAAC,CAAC;QACzBS,MAAM,EAAE,UAAU;QAClBC,cAAc,EAAE5E,OAAO,CAACC,GAAG,CAACqC,cAAc;KAC3C,CAAC,CAAC;CACJ,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,GAAG,CAAC;CAC9B;AAED,MAAMC,UAAU,GAAG,OAAO,AAAC;AAI3B,MAAMC,QAAQ,GAAkD;IAC9D,yBAAyB;IACzB,qGAAqG;IACrG,SAAS,EAAE,IAAM;mDAAO,yBAAyB;UAAC,CAACC,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACC,UAAU;QAAA,CAAC;IAAA;IAC5E,aAAa,EAAE,IAAM;mDAAO,6BAA6B;UAAC,CAACF,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACE,cAAc;QAAA,CAAC;IAAA;IACxFC,KAAK,EAAE,IAAM;mDAAO,uBAAuB;UAAC,CAACJ,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACI,SAAS;QAAA,CAAC;IAAA;IACrEC,QAAQ,EAAE,IAAM;mDAAO,0BAA0B;UAAC,CAACN,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACM,YAAY;QAAA,CAAC;IAA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AAC9D,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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IAAG,IAAA,CAACE,aAAa,EAAE;QACnD,OAAON,KAAK,CAAC;KACd;IAED,MAAM,EAAEO,eAAe,CAAA,EAAE,GACvBC,OAAO,CAAC,yBAAyB,CAAC,AAA4C,AAAC;IAEjF,OAAOC,CAAAA,GAAAA,mBAAkB,AAMxB,CAAA,mBANwB,CACvBT,KAAK,EACL,IAAIO,eAAe,CAAC;QAClBN,cAAc,EAAES,KAAI,QAAA,CAACC,IAAI,CAACC,CAAAA,GAAAA,aAAoB,AAAE,CAAA,qBAAF,EAAE,EAAEX,cAAc,CAAC;QACjEC,GAAG;KACJ,CAAC,CACH,CAAC;CACH;AAGM,MAAMW,UAAU,GAAGd,CAAAA,GAAAA,sBAAqB,AAA0C,CAAA,sBAA1C,CAACpD,wBAAwB,CAACkD,cAAc,CAAC,CAAC,AAAC;QAA7EgB,UAAU,GAAVA,UAAU"}
|
|
@@ -87,7 +87,7 @@ async function configAsync(projectRoot, options) {
|
|
|
87
87
|
return _interopRequireWildcard(require("@expo/prebuild-config"));
|
|
88
88
|
});
|
|
89
89
|
const { compileModsAsync } = await Promise.resolve().then(function() {
|
|
90
|
-
return _interopRequireWildcard(require("@expo/config-plugins/build/plugins/mod-compiler"));
|
|
90
|
+
return _interopRequireWildcard(require("@expo/config-plugins/build/plugins/mod-compiler.js"));
|
|
91
91
|
});
|
|
92
92
|
config = await (0, _profile).profile(getPrebuildConfigAsync)(projectRoot, {
|
|
93
93
|
platforms: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/configAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig, ProjectConfig } from '@expo/config';\nimport assert from 'assert';\nimport util from 'util';\n\nimport * as Log from '../log';\nimport { CommandError } from '../utils/errors';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { profile } from '../utils/profile';\n\ntype Options = {\n type?: string;\n full?: boolean;\n json?: boolean;\n};\n\nexport function logConfig(config: ExpoConfig | ProjectConfig) {\n const isObjStr = (str: string): boolean => /^\\w+: {/g.test(str);\n Log.log(\n util.inspect(config, {\n colors: true,\n compact: false,\n // Sort objects to the end so that smaller values aren't hidden between large objects.\n sorted(a: string, b: string) {\n if (isObjStr(a)) return 1;\n if (isObjStr(b)) return -1;\n return 0;\n },\n showHidden: false,\n depth: null,\n })\n );\n}\n\nexport async function configAsync(projectRoot: string, options: Options) {\n const loggingFunctions = {\n log: console.log,\n warn: console.warn,\n error: console.error,\n };\n // Disable logging for this command if the user wants to get JSON output.\n // This will ensure that only the JSON is printed to stdout.\n if (options.json) {\n console.log = function () {};\n console.warn = function () {};\n console.error = function () {};\n }\n setNodeEnv('development');\n require('@expo/env').load(projectRoot);\n\n if (options.type) {\n assert.match(options.type, /^(public|prebuild|introspect)$/);\n }\n\n let config: ProjectConfig;\n\n if (options.type === 'prebuild') {\n const { getPrebuildConfigAsync } = await import('@expo/prebuild-config');\n\n config = await profile(getPrebuildConfigAsync)(projectRoot, {\n platforms: ['ios', 'android'],\n });\n } else if (options.type === 'introspect') {\n const { getPrebuildConfigAsync } = await import('@expo/prebuild-config');\n const { compileModsAsync } = await import('@expo/config-plugins/build/plugins/mod-compiler');\n\n config = await profile(getPrebuildConfigAsync)(projectRoot, {\n platforms: ['ios', 'android'],\n });\n\n await compileModsAsync(config.exp, {\n projectRoot,\n introspect: true,\n platforms: ['ios', 'android'],\n assertMissingModProviders: false,\n });\n // @ts-ignore\n delete config.modRequest;\n // @ts-ignore\n delete config.modResults;\n } else if (options.type === 'public') {\n config = profile(getConfig)(projectRoot, {\n skipSDKVersionRequirement: true,\n isPublicConfig: true,\n });\n } else if (options.type) {\n throw new CommandError(\n `Invalid option: --type ${options.type}. Valid options are: public, prebuild`\n );\n } else {\n config = profile(getConfig)(projectRoot, {\n skipSDKVersionRequirement: true,\n });\n }\n\n const configOutput = options.full ? config : config.exp;\n\n if (!options.json) {\n Log.log();\n logConfig(configOutput);\n Log.log();\n } else {\n process.stdout.write(JSON.stringify(configOutput));\n\n // Re-enable logging functions for testing.\n console.log = loggingFunctions.log;\n console.warn = loggingFunctions.warn;\n console.error = loggingFunctions.error;\n }\n}\n"],"names":["logConfig","configAsync","Log","config","isObjStr","str","test","log","util","inspect","colors","compact","sorted","a","b","showHidden","depth","projectRoot","options","loggingFunctions","console","warn","error","json","setNodeEnv","require","load","type","assert","match","getPrebuildConfigAsync","profile","platforms","compileModsAsync","exp","introspect","assertMissingModProviders","modRequest","modResults","getConfig","skipSDKVersionRequirement","isPublicConfig","CommandError","configOutput","full","process","stdout","write","JSON","stringify"],"mappings":"AAAA;;;;QAegBA,SAAS,GAATA,SAAS;QAkBHC,WAAW,GAAXA,WAAW;AAjCoB,IAAA,OAAc,WAAd,cAAc,CAAA;AAChD,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACV,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACc,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACnB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACrB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQnC,SAASF,SAAS,CAACG,MAAkC,EAAE;IAC5D,MAAMC,QAAQ,GAAG,CAACC,GAAW,GAAc,WAAWC,IAAI,CAACD,GAAG,CAAC;IAAC;IAChEH,GAAG,CAACK,GAAG,CACLC,KAAI,QAAA,CAACC,OAAO,CAACN,MAAM,EAAE;QACnBO,MAAM,EAAE,IAAI;QACZC,OAAO,EAAE,KAAK;QACd,sFAAsF;QACtFC,MAAM,EAACC,CAAS,EAAEC,CAAS,EAAE;YAC3B,IAAIV,QAAQ,CAACS,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YAC1B,IAAIT,QAAQ,CAACU,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;YAC3B,OAAO,CAAC,CAAC;SACV;QACDC,UAAU,EAAE,KAAK;QACjBC,KAAK,EAAE,IAAI;KACZ,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AM;mDAAO,
|
|
1
|
+
{"version":3,"sources":["../../../src/config/configAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig, ProjectConfig } from '@expo/config';\nimport assert from 'assert';\nimport util from 'util';\n\nimport * as Log from '../log';\nimport { CommandError } from '../utils/errors';\nimport { setNodeEnv } from '../utils/nodeEnv';\nimport { profile } from '../utils/profile';\n\ntype Options = {\n type?: string;\n full?: boolean;\n json?: boolean;\n};\n\nexport function logConfig(config: ExpoConfig | ProjectConfig) {\n const isObjStr = (str: string): boolean => /^\\w+: {/g.test(str);\n Log.log(\n util.inspect(config, {\n colors: true,\n compact: false,\n // Sort objects to the end so that smaller values aren't hidden between large objects.\n sorted(a: string, b: string) {\n if (isObjStr(a)) return 1;\n if (isObjStr(b)) return -1;\n return 0;\n },\n showHidden: false,\n depth: null,\n })\n );\n}\n\nexport async function configAsync(projectRoot: string, options: Options) {\n const loggingFunctions = {\n log: console.log,\n warn: console.warn,\n error: console.error,\n };\n // Disable logging for this command if the user wants to get JSON output.\n // This will ensure that only the JSON is printed to stdout.\n if (options.json) {\n console.log = function () {};\n console.warn = function () {};\n console.error = function () {};\n }\n setNodeEnv('development');\n require('@expo/env').load(projectRoot);\n\n if (options.type) {\n assert.match(options.type, /^(public|prebuild|introspect)$/);\n }\n\n let config: ProjectConfig;\n\n if (options.type === 'prebuild') {\n const { getPrebuildConfigAsync } = await import('@expo/prebuild-config');\n\n config = await profile(getPrebuildConfigAsync)(projectRoot, {\n platforms: ['ios', 'android'],\n });\n } else if (options.type === 'introspect') {\n const { getPrebuildConfigAsync } = await import('@expo/prebuild-config');\n const { compileModsAsync } = await import('@expo/config-plugins/build/plugins/mod-compiler.js');\n\n config = await profile(getPrebuildConfigAsync)(projectRoot, {\n platforms: ['ios', 'android'],\n });\n\n await compileModsAsync(config.exp, {\n projectRoot,\n introspect: true,\n platforms: ['ios', 'android'],\n assertMissingModProviders: false,\n });\n // @ts-ignore\n delete config.modRequest;\n // @ts-ignore\n delete config.modResults;\n } else if (options.type === 'public') {\n config = profile(getConfig)(projectRoot, {\n skipSDKVersionRequirement: true,\n isPublicConfig: true,\n });\n } else if (options.type) {\n throw new CommandError(\n `Invalid option: --type ${options.type}. Valid options are: public, prebuild`\n );\n } else {\n config = profile(getConfig)(projectRoot, {\n skipSDKVersionRequirement: true,\n });\n }\n\n const configOutput = options.full ? config : config.exp;\n\n if (!options.json) {\n Log.log();\n logConfig(configOutput);\n Log.log();\n } else {\n process.stdout.write(JSON.stringify(configOutput));\n\n // Re-enable logging functions for testing.\n console.log = loggingFunctions.log;\n console.warn = loggingFunctions.warn;\n console.error = loggingFunctions.error;\n }\n}\n"],"names":["logConfig","configAsync","Log","config","isObjStr","str","test","log","util","inspect","colors","compact","sorted","a","b","showHidden","depth","projectRoot","options","loggingFunctions","console","warn","error","json","setNodeEnv","require","load","type","assert","match","getPrebuildConfigAsync","profile","platforms","compileModsAsync","exp","introspect","assertMissingModProviders","modRequest","modResults","getConfig","skipSDKVersionRequirement","isPublicConfig","CommandError","configOutput","full","process","stdout","write","JSON","stringify"],"mappings":"AAAA;;;;QAegBA,SAAS,GAATA,SAAS;QAkBHC,WAAW,GAAXA,WAAW;AAjCoB,IAAA,OAAc,WAAd,cAAc,CAAA;AAChD,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACV,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACc,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AACnB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACrB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQnC,SAASF,SAAS,CAACG,MAAkC,EAAE;IAC5D,MAAMC,QAAQ,GAAG,CAACC,GAAW,GAAc,WAAWC,IAAI,CAACD,GAAG,CAAC;IAAC;IAChEH,GAAG,CAACK,GAAG,CACLC,KAAI,QAAA,CAACC,OAAO,CAACN,MAAM,EAAE;Q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AM;QACLxB,MAAM,GAAG4B,CAAAA,GAAAA,QAAO,AAAW,CAAA,QAAX,CAACQ,OAAS,UAAA,CAAC,CAACtB,WAAW,EAAE;YACvCuB,yBAAyB,EAAE,IAAI;SAChC,CAAC,CAAC;KACJ;IAED,MAAMG,YAAY,GAAGzB,OAAO,CAAC0B,IAAI,GAAGzC,MAAM,GAAGA,MAAM,CAAC+B,GAAG,AAAC;IAExD,IAAI,CAAChB,OAAO,CAACK,IAAI,EAAE;QACjBrB,GAAG,CAACK,GAAG,EAAE,CAAC;QACVP,SAAS,CAAC2C,YAAY,CAAC,CAAC;QACxBzC,GAAG,CAACK,GAAG,EAAE,CAAC;KACX,MAAM;QACLsC,OAAO,CAACC,MAAM,CAACC,KAAK,CAACC,IAAI,CAACC,SAAS,CAACN,YAAY,CAAC,CAAC,CAAC;QAEnD,2CAA2C;QAC3CvB,OAAO,CAACb,GAAG,GAAGY,gBAAgB,CAACZ,GAAG,CAAC;QACnCa,OAAO,CAACC,IAAI,GAAGF,gBAAgB,CAACE,IAAI,CAAC;QACrCD,OAAO,CAACE,KAAK,GAAGH,gBAAgB,CAACG,KAAK,CAAC;KACxC;CACF"}
|
|
@@ -57,10 +57,10 @@ const expoConfig = async (argv)=>{
|
|
|
57
57
|
{ configAsync }, // ../utils/errors
|
|
58
58
|
{ logCmdError }, ] = await Promise.all([
|
|
59
59
|
Promise.resolve().then(function() {
|
|
60
|
-
return _interopRequireWildcard(require("./configAsync"));
|
|
60
|
+
return _interopRequireWildcard(require("./configAsync.js"));
|
|
61
61
|
}),
|
|
62
62
|
Promise.resolve().then(function() {
|
|
63
|
-
return _interopRequireWildcard(require("../utils/errors"));
|
|
63
|
+
return _interopRequireWildcard(require("../utils/errors.js"));
|
|
64
64
|
})
|
|
65
65
|
]);
|
|
66
66
|
return configAsync((0, _args).getProjectRoot(args), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/config/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoConfig: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--full': Boolean,\n '--json': Boolean,\n '--type': String,\n // Aliases\n '-h': '--help',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Show the project config`,\n chalk`npx expo config {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--full Include all project config data`,\n `--json Output in JSON format`,\n `-t, --type <public|prebuild|introspect> Type of config to show`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo config -h` shows as fast as possible.\n const [\n // ./configAsync\n { configAsync },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([import('./configAsync'), import('../utils/errors')]);\n\n return configAsync(getProjectRoot(args), {\n // Parsed options\n full: args['--full'],\n json: args['--json'],\n type: args['--type'],\n }).catch(logCmdError);\n};\n"],"names":["expoConfig","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","configAsync","logCmdError","Promise","all","getProjectRoot","full","json","type","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAYtB,CAAA,WAZsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;KACf,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBI,CAAAA,GAAAA,KAAS,AAUR,CAAA,UAVQ,CACP,CAAC,uBAAuB,CAAC,EACzBC,MAAK,QAAA,CAAC,2BAA2B,CAAC,EAClC;YACEA,MAAK,QAAA,CAAC,gHAAgH,CAAC;YACvH,CAAC,wEAAwE,CAAC;YAC1E,CAAC,8DAA8D,CAAC;YAChE,CAAC,+DAA+D,CAAC;YACjE,CAAC,mDAAmD,CAAC;SACtD,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;IAED,wFAAwF;IACxF,MAAM,CACJ,gBAAgB;IAChB,EAAEC,WAAW,CAAA,EAAE,EACf,kBAAkB;IAClB,EAAEC,WAAW,CAAA,EAAE,GAChB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QAAC;mDAAO,
|
|
1
|
+
{"version":3,"sources":["../../../src/config/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoConfig: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--full': Boolean,\n '--json': Boolean,\n '--type': String,\n // Aliases\n '-h': '--help',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Show the project config`,\n chalk`npx expo config {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--full Include all project config data`,\n `--json Output in JSON format`,\n `-t, --type <public|prebuild|introspect> Type of config to show`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo config -h` shows as fast as possible.\n const [\n // ./configAsync\n { configAsync },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([import('./configAsync.js'), import('../utils/errors.js')]);\n\n return configAsync(getProjectRoot(args), {\n // Parsed options\n full: args['--full'],\n json: args['--json'],\n type: args['--type'],\n }).catch(logCmdError);\n};\n"],"names":["expoConfig","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","configAsync","logCmdError","Promise","all","getProjectRoot","full","json","type","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAYtB,CAAA,WAZsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;KACf,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBI,CAAAA,GAAAA,KAAS,AAUR,CAAA,UAVQ,CACP,CAAC,uBAAuB,CAAC,EACzBC,MAAK,QAAA,CAAC,2BAA2B,CAAC,EAClC;YACEA,MAAK,QAAA,CAAC,gHAAgH,CAAC;YACvH,CAAC,wEAAwE,CAAC;YAC1E,CAAC,8DAA8D,CAAC;YAChE,CAAC,+DAA+D,CAAC;YACjE,CAAC,mDAAmD,CAAC;SACtD,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;IAED,wFAAwF;IACxF,MAAM,CACJ,gBAAgB;IAChB,EAAEC,WAAW,CAAA,EAAE,EACf,kBAAkB;IAClB,EAAEC,WAAW,CAAA,EAAE,GAChB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QAAC;mDAAO,kBAAkB;UAAC;QAAE;mDAAO,oBAAoB;UAAC;KAAC,CAAC,AAAC;IAElF,OAAOH,WAAW,CAACI,CAAAA,GAAAA,KAAc,AAAM,CAAA,eAAN,CAACX,IAAI,CAAC,EAAE;QACvC,iBAAiB;QACjBY,IAAI,EAAEZ,IAAI,CAAC,QAAQ,CAAC;QACpBa,IAAI,EAAEb,IAAI,CAAC,QAAQ,CAAC;QACpBc,IAAI,EAAEd,IAAI,CAAC,QAAQ,CAAC;KACrB,CAAC,CAACe,KAAK,CAACP,WAAW,CAAC,CAAC;CACvB,AAAC;QA3CWV,UAAU,GAAVA,UAAU"}
|
|
@@ -77,7 +77,7 @@ async function generateAsync(projectRoot, { answer , props , extras }) {
|
|
|
77
77
|
const template = _templates.TEMPLATES[file];
|
|
78
78
|
if (template.id === "tsconfig.json") {
|
|
79
79
|
const { typescript } = await Promise.resolve().then(function() {
|
|
80
|
-
return _interopRequireWildcard(require("./typescript"));
|
|
80
|
+
return _interopRequireWildcard(require("./typescript.js"));
|
|
81
81
|
});
|
|
82
82
|
return typescript(projectRoot);
|
|
83
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/customize/generate.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { DestinationResolutionProps, selectTemplatesAsync, TEMPLATES } from './templates';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { copyAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\n\nexport async function queryAndGenerateAsync(\n projectRoot: string,\n {\n files,\n props,\n extras,\n }: {\n files: string[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const valid = files.filter(\n (file) => !!TEMPLATES.find((template) => template.destination(props) === file)\n );\n\n if (valid.length !== files.length) {\n const diff = files.filter(\n (file) => !TEMPLATES.find((template) => template.destination(props) === file)\n );\n throw new CommandError(\n `Invalid files: ${diff.join(', ')}. Allowed: ${TEMPLATES.map((template) =>\n template.destination(props)\n ).join(', ')}`\n );\n }\n\n if (!valid.length) {\n return;\n }\n Log.log(`Generating: ${valid.join(', ')}`);\n return generateAsync(projectRoot, {\n answer: files.map((file) =>\n TEMPLATES.findIndex((template) => template.destination(props) === file)\n ),\n props,\n extras,\n });\n}\n\n/** Select templates to generate then generate and install. */\nexport async function selectAndGenerateAsync(\n projectRoot: string,\n {\n props,\n extras,\n }: {\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const answer = await selectTemplatesAsync(projectRoot, props);\n\n if (!answer?.length) {\n Log.exit('\\n\\u203A Exiting with no change...', 0);\n }\n\n await generateAsync(projectRoot, {\n answer,\n props,\n extras,\n });\n}\n\nasync function generateAsync(\n projectRoot: string,\n {\n answer,\n props,\n extras,\n }: {\n answer: number[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n // Copy files\n await Promise.all(\n answer.map(async (file) => {\n const template = TEMPLATES[file];\n\n if (template.id === 'tsconfig.json') {\n const { typescript } = await import('./typescript');\n return typescript(projectRoot);\n }\n\n const projectFilePath = path.resolve(projectRoot, template.destination(props));\n // copy the file from template\n return copyAsync(template.file(projectRoot), projectFilePath, {\n overwrite: true,\n recursive: true,\n });\n })\n );\n\n // Install dependencies\n const packages = answer\n .map((file) => TEMPLATES[file].dependencies)\n .flat()\n .filter((pkg) => !resolveFrom.silent(projectRoot, pkg));\n if (packages.length) {\n Log.debug('Installing ' + packages.join(', '));\n await installAsync(packages, {}, ['--dev', ...extras]);\n }\n}\n"],"names":["queryAndGenerateAsync","selectAndGenerateAsync","projectRoot","files","props","extras","valid","filter","file","TEMPLATES","find","template","destination","length","diff","CommandError","join","map","Log","log","generateAsync","answer","findIndex","selectTemplatesAsync","exit","Promise","all","id","typescript","projectFilePath","path","resolve","copyAsync","overwrite","recursive","packages","dependencies","flat","pkg","resolveFrom","silent","debug","installAsync"],"mappings":"AAAA;;;;QASsBA,qBAAqB,GAArBA,qBAAqB;QA0CrBC,sBAAsB,GAAtBA,sBAAsB;AAnD3B,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEsC,IAAA,UAAa,WAAb,aAAa,CAAA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I,aAAa,CAAClB,WAAW,EAAE;QAChCmB,MAAM,EAAElB,KAAK,CAACc,GAAG,CAAC,CAACT,IAAI,GACrBC,UAAS,UAAA,CAACa,SAAS,CAAC,CAACX,QAAQ,GAAKA,QAAQ,CAACC,WAAW,CAACR,KAAK,CAAC,KAAKI,IAAI;YAAA,CAAC;QAAA,CACxE;QACDJ,KAAK;QACLC,MAAM;KACP,CAAC,CAAC;CACJ;AAGM,eAAeJ,sBAAsB,CAC1CC,WAAmB,EACnB,EACEE,KAAK,CAAA,EACLC,MAAM,CAAA,EAKP,EACD;IACA,MAAMgB,MAAM,GAAG,MAAME,CAAAA,GAAAA,UAAoB,AAAoB,CAAA,qBAApB,CAACrB,WAAW,EAAEE,KAAK,CAAC,AAAC;IAE9D,IAAI,CAACiB,CAAAA,MAAM,QAAQ,GAAdA,KAAAA,CAAc,GAAdA,MAAM,CAAER,MAAM,CAAA,EAAE;QACnBK,IAAG,IAAA,CAACM,IAAI,CAAC,oCAAoC,EAAE,CAAC,CAAC,CAAC;KACnD;IAED,MAAMJ,aAAa,CAAClB,WAAW,EAAE;QAC/BmB,MAAM;QACNjB,KAAK;QACLC,MAAM;KACP,CAAC,CAAC;CACJ;AAED,eAAee,aAAa,CAC1BlB,WAAmB,EACnB,EACEmB,MAAM,CAAA,EACNjB,KAAK,CAAA,EACLC,MAAM,CAAA,EAMP,EACD;IACA,aAAa;IACb,MAAMoB,OAAO,CAACC,GAAG,CACfL,MAAM,CAACJ,GAAG,CAAC,OAAOT,IAAI,GAAK;QACzB,MAAMG,QAAQ,GAAGF,UAAS,UAAA,CAACD,IAAI,CAAC,AAAC;QAEjC,IAAIG,QAAQ,CAACgB,EAAE,KAAK,eAAe,EAAE;YACnC,MAAM,EAAEC,UAAU,CAAA,EAAE,GAAG,MAAM;uDAAO,
|
|
1
|
+
{"version":3,"sources":["../../../src/customize/generate.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { DestinationResolutionProps, selectTemplatesAsync, TEMPLATES } from './templates';\nimport { installAsync } from '../install/installAsync';\nimport { Log } from '../log';\nimport { copyAsync } from '../utils/dir';\nimport { CommandError } from '../utils/errors';\n\nexport async function queryAndGenerateAsync(\n projectRoot: string,\n {\n files,\n props,\n extras,\n }: {\n files: string[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const valid = files.filter(\n (file) => !!TEMPLATES.find((template) => template.destination(props) === file)\n );\n\n if (valid.length !== files.length) {\n const diff = files.filter(\n (file) => !TEMPLATES.find((template) => template.destination(props) === file)\n );\n throw new CommandError(\n `Invalid files: ${diff.join(', ')}. Allowed: ${TEMPLATES.map((template) =>\n template.destination(props)\n ).join(', ')}`\n );\n }\n\n if (!valid.length) {\n return;\n }\n Log.log(`Generating: ${valid.join(', ')}`);\n return generateAsync(projectRoot, {\n answer: files.map((file) =>\n TEMPLATES.findIndex((template) => template.destination(props) === file)\n ),\n props,\n extras,\n });\n}\n\n/** Select templates to generate then generate and install. */\nexport async function selectAndGenerateAsync(\n projectRoot: string,\n {\n props,\n extras,\n }: {\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n const answer = await selectTemplatesAsync(projectRoot, props);\n\n if (!answer?.length) {\n Log.exit('\\n\\u203A Exiting with no change...', 0);\n }\n\n await generateAsync(projectRoot, {\n answer,\n props,\n extras,\n });\n}\n\nasync function generateAsync(\n projectRoot: string,\n {\n answer,\n props,\n extras,\n }: {\n answer: number[];\n props: DestinationResolutionProps;\n /** Any extra props to pass to the install command. */\n extras: any[];\n }\n) {\n // Copy files\n await Promise.all(\n answer.map(async (file) => {\n const template = TEMPLATES[file];\n\n if (template.id === 'tsconfig.json') {\n const { typescript } = await import('./typescript.js');\n return typescript(projectRoot);\n }\n\n const projectFilePath = path.resolve(projectRoot, template.destination(props));\n // copy the file from template\n return copyAsync(template.file(projectRoot), projectFilePath, {\n overwrite: true,\n recursive: true,\n });\n })\n );\n\n // Install dependencies\n const packages = answer\n .map((file) => TEMPLATES[file].dependencies)\n .flat()\n .filter((pkg) => !resolveFrom.silent(projectRoot, pkg));\n if (packages.length) {\n Log.debug('Installing ' + packages.join(', '));\n await installAsync(packages, {}, ['--dev', ...extras]);\n }\n}\n"],"names":["queryAndGenerateAsync","selectAndGenerateAsync","projectRoot","files","props","extras","valid","filter","file","TEMPLATES","find","template","destination","length","diff","CommandError","join","map","Log","log","generateAsync","answer","findIndex","selectTemplatesAsync","exit","Promise","all","id","typescript","projectFilePath","path","resolve","copyAsync","overwrite","recursive","packages","dependencies","flat","pkg","resolveFrom","silent","debug","installAsync"],"mappings":"AAAA;;;;QASsBA,qBAAqB,GAArBA,qBAAqB;QA0CrBC,sBAAsB,GAAtBA,sBAAsB;AAnD3B,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAEsC,IAAA,UAAa,WAAb,aAAa,CAAA;AAC5D,IAAA,aAAyB,WAAzB,yBAAyB,CAAA;AAClC,IAAA,IAAQ,WAAR,QAAQ,CAAA;AACF,IAAA,IAAc,WAAd,cAAc,CAAA;AACX,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEvC,eAAeD,qBAAqB,CACzCE,WAAmB,EACnB,EACEC,KAAK,CAAA,EACLC,KAAK,CAAA,EACLC,MAAM,CAAA,EAMP,EACD;IACA,MAAMC,KAAK,GAAGH,KAAK,CAACI,MAAM,CACxB,CAACC,IAAI,GAAK,CAAC,CAACC,UAAS,UAAA,CAACC,IAAI,CAAC,CAACC,QAAQ,GAAKA,QAAQ,CAACC,WAAW,CAACR,KAAK,CAAC,KAAKI,IAAI;QAAA,CAAC;IAAA,CAC/E,AAAC;IAEF,IAAIF,KAAK,CAACO,MAAM,KAAKV,KAAK,CAACU,MAAM,EAAE;QACjC,MAAMC,IAAI,GAAGX,KAAK,CAACI,MAAM,CACvB,CAACC,IAAI,GAAK,CAAC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AG,IAAA,CAACuB,KAAK,CAAC,aAAa,GAAGN,QAAQ,CAACnB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/C,MAAM0B,CAAAA,GAAAA,aAAY,AAAoC,CAAA,aAApC,CAACP,QAAQ,EAAE,EAAE,EAAE;YAAC,OAAO;eAAK9B,MAAM;SAAC,CAAC,CAAC;KACxD;CACF"}
|
|
@@ -28,13 +28,13 @@ function _interopRequireWildcard(obj) {
|
|
|
28
28
|
}
|
|
29
29
|
async function typescript(projectRoot) {
|
|
30
30
|
const { TypeScriptProjectPrerequisite } = await Promise.resolve().then(function() {
|
|
31
|
-
return _interopRequireWildcard(require("../start/doctor/typescript/TypeScriptProjectPrerequisite"));
|
|
31
|
+
return _interopRequireWildcard(require("../start/doctor/typescript/TypeScriptProjectPrerequisite.js"));
|
|
32
32
|
});
|
|
33
33
|
const { MetroBundlerDevServer } = await Promise.resolve().then(function() {
|
|
34
|
-
return _interopRequireWildcard(require("../start/server/metro/MetroBundlerDevServer"));
|
|
34
|
+
return _interopRequireWildcard(require("../start/server/metro/MetroBundlerDevServer.js"));
|
|
35
35
|
});
|
|
36
36
|
const { getPlatformBundlers } = await Promise.resolve().then(function() {
|
|
37
|
-
return _interopRequireWildcard(require("../start/server/platformBundlers"));
|
|
37
|
+
return _interopRequireWildcard(require("../start/server/platformBundlers.js"));
|
|
38
38
|
});
|
|
39
39
|
try {
|
|
40
40
|
await new TypeScriptProjectPrerequisite(projectRoot).bootstrapAsync();
|
|
@@ -48,7 +48,9 @@ async function typescript(projectRoot) {
|
|
|
48
48
|
const { exp } = (0, _config).getConfig(projectRoot, {
|
|
49
49
|
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'\n );\n const { MetroBundlerDevServer } = await import('../start/server/metro/MetroBundlerDevServer');\n const { getPlatformBundlers } = await import('../start/server/platformBundlers');\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>;\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,EAC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