@expo/cli 0.1.5 → 0.2.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.
Files changed (190) hide show
  1. package/build/bin/cli +83 -4
  2. package/build/bin/cli.map +1 -1
  3. package/build/src/api/rest/wrapFetchWithOffline.js +2 -23
  4. package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
  5. package/build/src/customize/customizeAsync.js +40 -0
  6. package/build/src/customize/customizeAsync.js.map +1 -0
  7. package/build/src/customize/generate.js +77 -0
  8. package/build/src/customize/generate.js.map +1 -0
  9. package/build/src/customize/index.js +41 -0
  10. package/build/src/customize/index.js.map +1 -0
  11. package/build/src/customize/resolveOptions.js +18 -0
  12. package/build/src/customize/resolveOptions.js.map +1 -0
  13. package/build/src/customize/templates.js +118 -0
  14. package/build/src/customize/templates.js.map +1 -0
  15. package/build/src/export/createMetadataJson.js +10 -7
  16. package/build/src/export/createMetadataJson.js.map +1 -1
  17. package/build/src/export/exportApp.js +32 -0
  18. package/build/src/export/exportApp.js.map +1 -1
  19. package/build/src/export/exportAssets.js +2 -3
  20. package/build/src/export/exportAssets.js.map +1 -1
  21. package/build/src/export/fork-bundleAsync.js +51 -34
  22. package/build/src/export/fork-bundleAsync.js.map +1 -1
  23. package/build/src/export/index.js +14 -10
  24. package/build/src/export/index.js.map +1 -1
  25. package/build/src/export/printBundleSizes.js +27 -48
  26. package/build/src/export/printBundleSizes.js.map +1 -1
  27. package/build/src/export/resolveOptions.js +44 -5
  28. package/build/src/export/resolveOptions.js.map +1 -1
  29. package/build/src/export/saveAssets.js +2 -1
  30. package/build/src/export/saveAssets.js.map +1 -1
  31. package/build/src/export/web/exportWebAsync.js +37 -0
  32. package/build/src/export/web/exportWebAsync.js.map +1 -0
  33. package/build/src/export/web/index.js +66 -0
  34. package/build/src/export/web/index.js.map +1 -0
  35. package/build/src/export/web/resolveOptions.js +13 -0
  36. package/build/src/export/web/resolveOptions.js.map +1 -0
  37. package/build/src/export/writeContents.js.map +1 -1
  38. package/build/src/install/checkPackages.js +2 -1
  39. package/build/src/install/checkPackages.js.map +1 -1
  40. package/build/src/install/index.js +1 -0
  41. package/build/src/install/index.js.map +1 -1
  42. package/build/src/install/installAsync.js +13 -5
  43. package/build/src/install/installAsync.js.map +1 -1
  44. package/build/src/install/resolveOptions.js +12 -65
  45. package/build/src/install/resolveOptions.js.map +1 -1
  46. package/build/src/install/utils/autoAddConfigPlugins.js +5 -26
  47. package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
  48. package/build/src/log.js.map +1 -1
  49. package/build/src/prebuild/copyTemplateFiles.js +5 -23
  50. package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
  51. package/build/src/prebuild/index.js +18 -12
  52. package/build/src/prebuild/index.js.map +1 -1
  53. package/build/src/prebuild/prebuildAsync.js +11 -12
  54. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  55. package/build/src/prebuild/resolveOptions.js +17 -0
  56. package/build/src/prebuild/resolveOptions.js.map +1 -1
  57. package/build/src/prebuild/resolveTemplate.js +2 -1
  58. package/build/src/prebuild/resolveTemplate.js.map +1 -1
  59. package/build/src/prebuild/updatePackageJson.js +5 -5
  60. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  61. package/build/src/run/android/resolveInstallApkName.js +5 -26
  62. package/build/src/run/android/resolveInstallApkName.js.map +1 -1
  63. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +2 -0
  64. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
  65. package/build/src/start/doctor/apple/XcodePrerequisite.js +2 -0
  66. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  67. package/build/src/start/doctor/dependencies/bundledNativeModules.js +3 -2
  68. package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
  69. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +7 -13
  70. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  71. package/build/src/start/doctor/dependencies/getMissingPackages.js +3 -24
  72. package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
  73. package/build/src/start/doctor/dependencies/getVersionedPackages.js +2 -23
  74. package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
  75. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +17 -9
  76. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
  77. package/build/src/start/doctor/ngrok/ExternalModule.js +2 -1
  78. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  79. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +4 -3
  80. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
  81. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +32 -31
  82. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
  83. package/build/src/start/interface/KeyPressHandler.js +2 -0
  84. package/build/src/start/interface/KeyPressHandler.js.map +1 -1
  85. package/build/src/start/interface/interactiveActions.js +5 -5
  86. package/build/src/start/interface/interactiveActions.js.map +1 -1
  87. package/build/src/start/interface/startInterface.js +3 -2
  88. package/build/src/start/interface/startInterface.js.map +1 -1
  89. package/build/src/start/platforms/ExpoGoInstaller.js +2 -1
  90. package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
  91. package/build/src/start/platforms/PlatformManager.js +4 -24
  92. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  93. package/build/src/start/platforms/android/ADBServer.js +17 -32
  94. package/build/src/start/platforms/android/ADBServer.js.map +1 -1
  95. package/build/src/start/platforms/android/AndroidSdk.js +41 -0
  96. package/build/src/start/platforms/android/AndroidSdk.js.map +1 -0
  97. package/build/src/start/platforms/android/activateWindow.js +4 -4
  98. package/build/src/start/platforms/android/activateWindow.js.map +1 -1
  99. package/build/src/start/platforms/android/adb.js +8 -3
  100. package/build/src/start/platforms/android/adb.js.map +1 -1
  101. package/build/src/start/platforms/android/adbReverse.js +3 -2
  102. package/build/src/start/platforms/android/adbReverse.js.map +1 -1
  103. package/build/src/start/platforms/android/gradle.js +2 -2
  104. package/build/src/start/platforms/android/gradle.js.map +1 -1
  105. package/build/src/start/platforms/ios/getBestSimulator.js +4 -4
  106. package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
  107. package/build/src/start/platforms/ios/xcrun.js +2 -23
  108. package/build/src/start/platforms/ios/xcrun.js.map +1 -1
  109. package/build/src/start/project/devices.js +2 -0
  110. package/build/src/start/project/devices.js.map +1 -1
  111. package/build/src/start/server/AsyncNgrok.js +6 -5
  112. package/build/src/start/server/AsyncNgrok.js.map +1 -1
  113. package/build/src/start/server/BundlerDevServer.js +15 -8
  114. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  115. package/build/src/start/server/DevServerManager.js +15 -5
  116. package/build/src/start/server/DevServerManager.js.map +1 -1
  117. package/build/src/start/server/DevelopmentSession.js +4 -0
  118. package/build/src/start/server/DevelopmentSession.js.map +1 -1
  119. package/build/src/start/server/UrlCreator.js +10 -3
  120. package/build/src/start/server/UrlCreator.js.map +1 -1
  121. package/build/src/start/server/metro/MetroBundlerDevServer.js +9 -0
  122. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  123. package/build/src/start/server/metro/TerminalReporter.js +5 -0
  124. package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
  125. package/build/src/start/server/metro/instantiateMetro.js +11 -1
  126. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  127. package/build/src/start/server/metro/resolveFromProject.js +8 -0
  128. package/build/src/start/server/metro/resolveFromProject.js.map +1 -1
  129. package/build/src/start/server/metro/withMetroMultiPlatform.js +115 -0
  130. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -0
  131. package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
  132. package/build/src/start/server/middleware/ExpoMiddleware.js +9 -4
  133. package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
  134. package/build/src/start/server/middleware/HistoryFallbackMiddleware.js +24 -0
  135. package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -0
  136. package/build/src/start/server/middleware/InterstitialPageMiddleware.js +2 -0
  137. package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
  138. package/build/src/start/server/middleware/ManifestMiddleware.js +57 -6
  139. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  140. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +6 -1
  141. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
  142. package/build/src/start/server/middleware/ServeStaticMiddleware.js +62 -0
  143. package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -0
  144. package/build/src/start/server/platformBundlers.js +18 -0
  145. package/build/src/start/server/platformBundlers.js.map +1 -0
  146. package/build/src/start/server/webTemplate.js +68 -0
  147. package/build/src/start/server/webTemplate.js.map +1 -0
  148. package/build/src/start/server/webpack/WebpackBundlerDevServer.js +59 -19
  149. package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
  150. package/build/src/start/server/webpack/compile.js +64 -0
  151. package/build/src/start/server/webpack/compile.js.map +1 -0
  152. package/build/src/start/startAsync.js +21 -17
  153. package/build/src/start/startAsync.js.map +1 -1
  154. package/build/src/utils/FileNotifier.js +5 -2
  155. package/build/src/utils/FileNotifier.js.map +1 -1
  156. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  157. package/build/src/utils/downloadAppAsync.js +3 -2
  158. package/build/src/utils/downloadAppAsync.js.map +1 -1
  159. package/build/src/utils/downloadExpoGoAsync.js +7 -32
  160. package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
  161. package/build/src/utils/editor.js +3 -2
  162. package/build/src/utils/editor.js.map +1 -1
  163. package/build/src/utils/env.js +3 -0
  164. package/build/src/utils/env.js.map +1 -1
  165. package/build/src/utils/exit.js +4 -25
  166. package/build/src/utils/exit.js.map +1 -1
  167. package/build/src/utils/getRunningProcess.js +6 -2
  168. package/build/src/utils/getRunningProcess.js.map +1 -1
  169. package/build/src/utils/nodeModules.js +13 -102
  170. package/build/src/utils/nodeModules.js.map +1 -1
  171. package/build/src/utils/npm.js +3 -24
  172. package/build/src/utils/npm.js.map +1 -1
  173. package/build/src/utils/ora.js +1 -13
  174. package/build/src/utils/ora.js.map +1 -1
  175. package/build/src/utils/progress.js +46 -0
  176. package/build/src/utils/progress.js.map +1 -1
  177. package/build/src/utils/prompts.js +4 -4
  178. package/build/src/utils/prompts.js.map +1 -1
  179. package/build/src/utils/tar.js +3 -0
  180. package/build/src/utils/tar.js.map +1 -1
  181. package/build/src/utils/validateApplicationId.js +9 -2
  182. package/build/src/utils/validateApplicationId.js.map +1 -1
  183. package/build/src/utils/variadic.js +47 -0
  184. package/build/src/utils/variadic.js.map +1 -0
  185. package/package.json +12 -7
  186. package/static/template/babel.config.js +6 -0
  187. package/static/template/index.html +117 -0
  188. package/static/template/metro.config.js +4 -0
  189. package/static/template/serve.json +13 -0
  190. package/static/template/webpack.config.js +7 -0
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.compileAsync = compileAsync;
6
+ var _chalk = _interopRequireDefault(require("chalk"));
7
+ var _util = require("util");
8
+ var Log = _interopRequireWildcard(require("../../../log"));
9
+ var _errors = require("../../../utils/errors");
10
+ var _formatWebpackMessages = require("./formatWebpackMessages");
11
+ function _interopRequireDefault(obj) {
12
+ return obj && obj.__esModule ? obj : {
13
+ default: obj
14
+ };
15
+ }
16
+ function _interopRequireWildcard(obj) {
17
+ if (obj && obj.__esModule) {
18
+ return obj;
19
+ } else {
20
+ var newObj = {};
21
+ if (obj != null) {
22
+ for(var key in obj){
23
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
24
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
25
+ if (desc.get || desc.set) {
26
+ Object.defineProperty(newObj, key, desc);
27
+ } else {
28
+ newObj[key] = obj[key];
29
+ }
30
+ }
31
+ }
32
+ }
33
+ newObj.default = obj;
34
+ return newObj;
35
+ }
36
+ }
37
+ async function compileAsync(compiler) {
38
+ const stats = await (0, _util).promisify(compiler.run.bind(compiler))();
39
+ const { errors , warnings } = (0, _formatWebpackMessages).formatWebpackMessages(stats.toJson({
40
+ all: false,
41
+ warnings: true,
42
+ errors: true
43
+ }));
44
+ if (errors == null ? void 0 : errors.length) {
45
+ // Only keep the first error. Others are often indicative
46
+ // of the same problem, but confuse the reader with noise.
47
+ if (errors.length > 1) {
48
+ errors.length = 1;
49
+ }
50
+ throw new _errors.CommandError("WEBPACK_BUNDLE", errors.join("\n\n"));
51
+ }
52
+ if (warnings == null ? void 0 : warnings.length) {
53
+ Log.warn(_chalk.default.yellow("Compiled with warnings\n"));
54
+ Log.warn(warnings.join("\n\n"));
55
+ } else {
56
+ Log.log(_chalk.default.green("Compiled successfully"));
57
+ }
58
+ return {
59
+ errors,
60
+ warnings
61
+ };
62
+ }
63
+
64
+ //# sourceMappingURL=compile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/start/server/webpack/compile.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { promisify } from 'util';\nimport type webpack from 'webpack';\n\nimport * as Log from '../../../log';\nimport { CommandError } from '../../../utils/errors';\nimport { formatWebpackMessages } from './formatWebpackMessages';\n\n/** Run the `webpack` compiler and format errors/warnings. */\nexport async function compileAsync(compiler: webpack.Compiler) {\n const stats = await promisify(compiler.run.bind(compiler))();\n const { errors, warnings } = formatWebpackMessages(\n stats.toJson({ all: false, warnings: true, errors: true })\n );\n if (errors?.length) {\n // Only keep the first error. Others are often indicative\n // of the same problem, but confuse the reader with noise.\n if (errors.length > 1) {\n errors.length = 1;\n }\n throw new CommandError('WEBPACK_BUNDLE', errors.join('\\n\\n'));\n }\n if (warnings?.length) {\n Log.warn(chalk.yellow('Compiled with warnings\\n'));\n Log.warn(warnings.join('\\n\\n'));\n } else {\n Log.log(chalk.green('Compiled successfully'));\n }\n\n return { errors, warnings };\n}\n"],"names":["compileAsync","Log","compiler","stats","promisify","run","bind","errors","warnings","formatWebpackMessages","toJson","all","length","CommandError","join","warn","chalk","yellow","log","green"],"mappings":"AAAA;;;;QASsBA,YAAY,GAAZA,YAAY;AAThB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACC,IAAA,KAAM,WAAN,MAAM,CAAA;AAGpBC,IAAAA,GAAG,mCAAM,cAAc,EAApB;AACc,IAAA,OAAuB,WAAvB,uBAAuB,CAAA;AACd,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGxD,eAAeD,YAAY,CAACE,QAA0B,EAAE;IAC7D,MAAMC,KAAK,GAAG,MAAMC,CAAAA,GAAAA,KAAS,AAA6B,CAAA,UAA7B,CAACF,QAAQ,CAACG,GAAG,CAACC,IAAI,CAACJ,QAAQ,CAAC,CAAC,EAAE,AAAC;IAC7D,MAAM,EAAEK,MAAM,CAAA,EAAEC,QAAQ,CAAA,EAAE,GAAGC,CAAAA,GAAAA,sBAAqB,AAEjD,CAAA,sBAFiD,CAChDN,KAAK,CAACO,MAAM,CAAC;QAAEC,GAAG,EAAE,KAAK;QAAEH,QAAQ,EAAE,IAAI;QAAED,MAAM,EAAE,IAAI;KAAE,CAAC,CAC3D,AAAC;IACF,IAAIA,MAAM,QAAQ,GAAdA,KAAAA,CAAc,GAAdA,MAAM,CAAEK,MAAM,EAAE;QAClB,yDAAyD;QACzD,0DAA0D;QAC1D,IAAIL,MAAM,CAACK,MAAM,GAAG,CAAC,EAAE;YACrBL,MAAM,CAACK,MAAM,GAAG,CAAC,CAAC;SACnB;QACD,MAAM,IAAIC,OAAY,aAAA,CAAC,gBAAgB,EAAEN,MAAM,CAACO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;KAC/D;IACD,IAAIN,QAAQ,QAAQ,GAAhBA,KAAAA,CAAgB,GAAhBA,QAAQ,CAAEI,MAAM,EAAE;QACpBX,GAAG,CAACc,IAAI,CAACC,MAAK,QAAA,CAACC,MAAM,CAAC,0BAA0B,CAAC,CAAC,CAAC;QACnDhB,GAAG,CAACc,IAAI,CAACP,QAAQ,CAACM,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;KACjC,MAAM;QACLb,GAAG,CAACiB,GAAG,CAACF,MAAK,QAAA,CAACG,KAAK,CAAC,uBAAuB,CAAC,CAAC,CAAC;KAC/C;IAED,OAAO;QAAEZ,MAAM;QAAEC,QAAQ;KAAE,CAAC;CAC7B"}
@@ -18,6 +18,7 @@ var _startInterface = require("./interface/startInterface");
18
18
  var _resolveOptions = require("./resolveOptions");
19
19
  var _devServerManager = require("./server/DevServerManager");
20
20
  var _openPlatforms = require("./server/openPlatforms");
21
+ var _platformBundlers = require("./server/platformBundlers");
21
22
  function _interopRequireDefault(obj) {
22
23
  return obj && obj.__esModule ? obj : {
23
24
  default: obj
@@ -44,7 +45,7 @@ function _interopRequireWildcard(obj) {
44
45
  return newObj;
45
46
  }
46
47
  }
47
- async function getMultiBundlerStartOptions(projectRoot, { forceManifestType , ...options }, settings) {
48
+ async function getMultiBundlerStartOptions(projectRoot, { forceManifestType , ...options }, settings, platformBundlers) {
48
49
  var _privateKeyPath;
49
50
  const commonOptions = {
50
51
  mode: options.dev ? "development" : "production",
@@ -61,25 +62,27 @@ async function getMultiBundlerStartOptions(projectRoot, { forceManifestType , ..
61
62
  }
62
63
  };
63
64
  const multiBundlerSettings = await (0, _resolveOptions).resolvePortsAsync(projectRoot, options, settings);
64
- const multiBundlerStartOptions = [];
65
- if (options.web || settings.webOnly) {
66
- multiBundlerStartOptions.push({
67
- type: "webpack",
68
- options: {
69
- ...commonOptions,
70
- port: multiBundlerSettings.webpackPort
71
- }
72
- });
65
+ const optionalBundlers = {
66
+ ...platformBundlers
67
+ };
68
+ // In the default case, we don't want to start multiple bundlers since this is
69
+ // a bit slower. Our priority (for legacy) is native platforms.
70
+ if (!options.web) {
71
+ delete optionalBundlers["web"];
73
72
  }
74
- if (!settings.webOnly) {
75
- multiBundlerStartOptions.push({
76
- type: "metro",
73
+ const bundlers = [
74
+ ...new Set(Object.values(optionalBundlers))
75
+ ];
76
+ const multiBundlerStartOptions = bundlers.map((bundler)=>{
77
+ const port = bundler === "webpack" ? multiBundlerSettings.webpackPort : multiBundlerSettings.metroPort;
78
+ return {
79
+ type: bundler,
77
80
  options: {
78
81
  ...commonOptions,
79
- port: multiBundlerSettings.metroPort
82
+ port
80
83
  }
81
- });
82
- }
84
+ };
85
+ });
83
86
  return [
84
87
  commonOptions,
85
88
  multiBundlerStartOptions
@@ -88,13 +91,14 @@ async function getMultiBundlerStartOptions(projectRoot, { forceManifestType , ..
88
91
  async function startAsync(projectRoot, options, settings) {
89
92
  Log.log(_chalk.default.gray(`Starting project at ${projectRoot}`));
90
93
  const { exp , pkg } = (0, _profile).profile(_config.getConfig)(projectRoot);
94
+ const platformBundlers = (0, _platformBundlers).getPlatformBundlers(exp);
91
95
  if (!options.forceManifestType) {
92
96
  var ref;
93
97
  const easUpdatesUrlRegex = /^https:\/\/(staging-)?u\.expo\.dev/;
94
98
  const isEasUpdatesUrl = ((ref = exp.updates) == null ? void 0 : ref.url) ? easUpdatesUrlRegex.test(exp.updates.url) : false;
95
99
  options.forceManifestType = isEasUpdatesUrl ? "expo-updates" : "classic";
96
100
  }
97
- const [defaultOptions, startOptions] = await getMultiBundlerStartOptions(projectRoot, options, settings);
101
+ const [defaultOptions, startOptions] = await getMultiBundlerStartOptions(projectRoot, options, settings, platformBundlers);
98
102
  const devServerManager = new _devServerManager.DevServerManager(projectRoot, defaultOptions);
99
103
  // Validations
100
104
  if (options.web || settings.webOnly) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/start/startAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport getDevClientProperties from '../utils/analytics/getDevClientProperties';\nimport { logEvent } from '../utils/analytics/rudderstackClient';\nimport { env } from '../utils/env';\nimport { installExitHooks } from '../utils/exit';\nimport { profile } from '../utils/profile';\nimport { validateDependenciesVersionsAsync } from './doctor/dependencies/validateDependenciesVersions';\nimport { TypeScriptProjectPrerequisite } from './doctor/typescript/TypeScriptProjectPrerequisite';\nimport { WebSupportProjectPrerequisite } from './doctor/web/WebSupportProjectPrerequisite';\nimport { startInterfaceAsync } from './interface/startInterface';\nimport { Options, resolvePortsAsync } from './resolveOptions';\nimport { BundlerStartOptions } from './server/BundlerDevServer';\nimport { DevServerManager, MultiBundlerStartOptions } from './server/DevServerManager';\nimport { openPlatformsAsync } from './server/openPlatforms';\n\nasync function getMultiBundlerStartOptions(\n projectRoot: string,\n { forceManifestType, ...options }: Options,\n settings: { webOnly?: boolean }\n): Promise<[BundlerStartOptions, MultiBundlerStartOptions]> {\n const commonOptions: BundlerStartOptions = {\n mode: options.dev ? 'development' : 'production',\n devClient: options.devClient,\n forceManifestType,\n privateKeyPath: options.privateKeyPath ?? undefined,\n https: options.https,\n maxWorkers: options.maxWorkers,\n resetDevServer: options.clear,\n minify: options.minify,\n location: {\n hostType: options.host,\n scheme: options.scheme,\n },\n };\n const multiBundlerSettings = await resolvePortsAsync(projectRoot, options, settings);\n\n const multiBundlerStartOptions: MultiBundlerStartOptions = [];\n\n if (options.web || settings.webOnly) {\n multiBundlerStartOptions.push({\n type: 'webpack',\n options: {\n ...commonOptions,\n port: multiBundlerSettings.webpackPort,\n },\n });\n }\n\n if (!settings.webOnly) {\n multiBundlerStartOptions.push({\n type: 'metro',\n options: {\n ...commonOptions,\n port: multiBundlerSettings.metroPort,\n },\n });\n }\n\n return [commonOptions, multiBundlerStartOptions];\n}\n\nexport async function startAsync(\n projectRoot: string,\n options: Options,\n settings: { webOnly?: boolean }\n) {\n Log.log(chalk.gray(`Starting project at ${projectRoot}`));\n\n const { exp, pkg } = profile(getConfig)(projectRoot);\n\n if (!options.forceManifestType) {\n const easUpdatesUrlRegex = /^https:\\/\\/(staging-)?u\\.expo\\.dev/;\n const isEasUpdatesUrl = exp.updates?.url ? easUpdatesUrlRegex.test(exp.updates.url) : false;\n options.forceManifestType = isEasUpdatesUrl ? 'expo-updates' : 'classic';\n }\n\n const [defaultOptions, startOptions] = await getMultiBundlerStartOptions(\n projectRoot,\n options,\n settings\n );\n\n const devServerManager = new DevServerManager(projectRoot, defaultOptions);\n\n // Validations\n\n if (options.web || settings.webOnly) {\n await devServerManager.ensureProjectPrerequisiteAsync(WebSupportProjectPrerequisite);\n }\n\n await devServerManager.ensureProjectPrerequisiteAsync(TypeScriptProjectPrerequisite);\n\n if (!settings.webOnly && !options.devClient) {\n await profile(validateDependenciesVersionsAsync)(projectRoot, exp, pkg);\n }\n\n // Some tracking thing\n\n if (options.devClient) {\n track(projectRoot, exp);\n }\n\n await profile(devServerManager.startAsync.bind(devServerManager))(startOptions);\n\n // Open project on devices.\n await profile(openPlatformsAsync)(devServerManager, options);\n\n // Present the Terminal UI.\n if (!env.CI) {\n await profile(startInterfaceAsync)(devServerManager, {\n platforms: exp.platforms ?? ['ios', 'android', 'web'],\n });\n } else {\n // Display the server location in CI...\n const url = devServerManager.getDefaultDevServer()?.getDevServerUrl();\n if (url) {\n Log.log(chalk`Waiting on {underline ${url}}`);\n }\n }\n\n // Final note about closing the server.\n const logLocation = settings.webOnly ? 'in the browser console' : 'below';\n Log.log(\n chalk`Logs for your project will appear ${logLocation}.${\n env.CI ? '' : chalk.dim(` Press Ctrl+C to exit.`)\n }`\n );\n}\n\nfunction track(projectRoot: string, exp: ExpoConfig) {\n logEvent('dev client start command', {\n status: 'started',\n ...getDevClientProperties(projectRoot, exp),\n });\n installExitHooks(() => {\n logEvent('dev client start command', {\n status: 'finished',\n ...getDevClientProperties(projectRoot, exp),\n });\n // UnifiedAnalytics.flush();\n });\n}\n"],"names":["startAsync","Log","getMultiBundlerStartOptions","projectRoot","forceManifestType","options","settings","commonOptions","mode","dev","devClient","privateKeyPath","undefined","https","maxWorkers","resetDevServer","clear","minify","location","hostType","host","scheme","multiBundlerSettings","resolvePortsAsync","multiBundlerStartOptions","web","webOnly","push","type","port","webpackPort","metroPort","log","chalk","gray","exp","pkg","profile","getConfig","easUpdatesUrlRegex","isEasUpdatesUrl","updates","url","test","defaultOptions","startOptions","devServerManager","DevServerManager","ensureProjectPrerequisiteAsync","WebSupportProjectPrerequisite","TypeScriptProjectPrerequisite","validateDependenciesVersionsAsync","track","bind","openPlatformsAsync","env","CI","startInterfaceAsync","platforms","getDefaultDevServer","getDevServerUrl","logLocation","dim","logEvent","status","getDevClientProperties","installExitHooks"],"mappings":"AAAA;;;;QAgEsBA,UAAU,GAAVA,UAAU;AAhEM,IAAA,OAAc,WAAd,cAAc,CAAA;AAClC,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACoB,IAAA,uBAA2C,kCAA3C,2CAA2C,EAAA;AACrD,IAAA,kBAAsC,WAAtC,sCAAsC,CAAA;AAC3C,IAAA,IAAc,WAAd,cAAc,CAAA;AACD,IAAA,KAAe,WAAf,eAAe,CAAA;AACxB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACQ,IAAA,6BAAoD,WAApD,oDAAoD,CAAA;AACxD,IAAA,8BAAmD,WAAnD,mDAAmD,CAAA;AACnD,IAAA,8BAA4C,WAA5C,4CAA4C,CAAA;AACtD,IAAA,eAA4B,WAA5B,4BAA4B,CAAA;AACrB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AAEF,IAAA,iBAA2B,WAA3B,2BAA2B,CAAA;AACnD,IAAA,cAAwB,WAAxB,wBAAwB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE3D,eAAeC,2BAA2B,CACxCC,WAAmB,EACnB,EAAEC,iBAAiB,CAAA,EAAE,GAAGC,OAAO,EAAW,EAC1CC,QAA+B,EAC2B;QAKxCD,eAAsB;IAJxC,MAAME,aAAa,GAAwB;QACzCC,IA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AO,AAAC;IAC1EzB,GAAG,CAAC+B,GAAG,CACLC,MAAK,QAAA,CAAC,kCAAkC,EAAE4B,WAAW,CAAC,CAAC,EACrDN,IAAG,IAAA,CAACC,EAAE,GAAG,EAAE,GAAGvB,MAAK,QAAA,CAAC6B,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAClD,CAAC,CACH,CAAC;CACH;AAED,SAASV,KAAK,CAACjD,WAAmB,EAAEgC,GAAe,EAAE;IACnD4B,CAAAA,GAAAA,kBAAQ,AAGN,CAAA,SAHM,CAAC,0BAA0B,EAAE;QACnCC,MAAM,EAAE,SAAS;QACjB,GAAGC,CAAAA,GAAAA,uBAAsB,AAAkB,CAAA,QAAlB,CAAC9D,WAAW,EAAEgC,GAAG,CAAC;KAC5C,CAAC,CAAC;IACH+B,CAAAA,GAAAA,KAAgB,AAMd,CAAA,iBANc,CAAC,IAAM;QACrBH,CAAAA,GAAAA,kBAAQ,AAGN,CAAA,SAHM,CAAC,0BAA0B,EAAE;YACnCC,MAAM,EAAE,UAAU;YAClB,GAAGC,CAAAA,GAAAA,uBAAsB,AAAkB,CAAA,QAAlB,CAAC9D,WAAW,EAAEgC,GAAG,CAAC;SAC5C,CAAC,CAAC;IACH,4BAA4B;KAC7B,CAAC,CAAC;CACJ"}
1
+ {"version":3,"sources":["../../../src/start/startAsync.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport * as Log from '../log';\nimport getDevClientProperties from '../utils/analytics/getDevClientProperties';\nimport { logEvent } from '../utils/analytics/rudderstackClient';\nimport { env } from '../utils/env';\nimport { installExitHooks } from '../utils/exit';\nimport { profile } from '../utils/profile';\nimport { validateDependenciesVersionsAsync } from './doctor/dependencies/validateDependenciesVersions';\nimport { TypeScriptProjectPrerequisite } from './doctor/typescript/TypeScriptProjectPrerequisite';\nimport { WebSupportProjectPrerequisite } from './doctor/web/WebSupportProjectPrerequisite';\nimport { startInterfaceAsync } from './interface/startInterface';\nimport { Options, resolvePortsAsync } from './resolveOptions';\nimport { BundlerStartOptions } from './server/BundlerDevServer';\nimport { DevServerManager, MultiBundlerStartOptions } from './server/DevServerManager';\nimport { openPlatformsAsync } from './server/openPlatforms';\nimport { getPlatformBundlers, PlatformBundlers } from './server/platformBundlers';\n\nasync function getMultiBundlerStartOptions(\n projectRoot: string,\n { forceManifestType, ...options }: Options,\n settings: { webOnly?: boolean },\n platformBundlers: PlatformBundlers\n): Promise<[BundlerStartOptions, MultiBundlerStartOptions]> {\n const commonOptions: BundlerStartOptions = {\n mode: options.dev ? 'development' : 'production',\n devClient: options.devClient,\n forceManifestType,\n privateKeyPath: options.privateKeyPath ?? undefined,\n https: options.https,\n maxWorkers: options.maxWorkers,\n resetDevServer: options.clear,\n minify: options.minify,\n location: {\n hostType: options.host,\n scheme: options.scheme,\n },\n };\n const multiBundlerSettings = await resolvePortsAsync(projectRoot, options, settings);\n\n const optionalBundlers: Partial<PlatformBundlers> = { ...platformBundlers };\n // In the default case, we don't want to start multiple bundlers since this is\n // a bit slower. Our priority (for legacy) is native platforms.\n if (!options.web) {\n delete optionalBundlers['web'];\n }\n\n const bundlers = [...new Set(Object.values(optionalBundlers))];\n const multiBundlerStartOptions = bundlers.map((bundler) => {\n const port =\n bundler === 'webpack' ? multiBundlerSettings.webpackPort : multiBundlerSettings.metroPort;\n return {\n type: bundler,\n options: {\n ...commonOptions,\n port,\n },\n };\n });\n\n return [commonOptions, multiBundlerStartOptions];\n}\n\nexport async function startAsync(\n projectRoot: string,\n options: Options,\n settings: { webOnly?: boolean }\n) {\n Log.log(chalk.gray(`Starting project at ${projectRoot}`));\n\n const { exp, pkg } = profile(getConfig)(projectRoot);\n\n const platformBundlers = getPlatformBundlers(exp);\n\n if (!options.forceManifestType) {\n const easUpdatesUrlRegex = /^https:\\/\\/(staging-)?u\\.expo\\.dev/;\n const isEasUpdatesUrl = exp.updates?.url ? easUpdatesUrlRegex.test(exp.updates.url) : false;\n options.forceManifestType = isEasUpdatesUrl ? 'expo-updates' : 'classic';\n }\n\n const [defaultOptions, startOptions] = await getMultiBundlerStartOptions(\n projectRoot,\n options,\n settings,\n platformBundlers\n );\n\n const devServerManager = new DevServerManager(projectRoot, defaultOptions);\n\n // Validations\n\n if (options.web || settings.webOnly) {\n await devServerManager.ensureProjectPrerequisiteAsync(WebSupportProjectPrerequisite);\n }\n\n await devServerManager.ensureProjectPrerequisiteAsync(TypeScriptProjectPrerequisite);\n\n if (!settings.webOnly && !options.devClient) {\n await profile(validateDependenciesVersionsAsync)(projectRoot, exp, pkg);\n }\n\n // Some tracking thing\n\n if (options.devClient) {\n track(projectRoot, exp);\n }\n\n await profile(devServerManager.startAsync.bind(devServerManager))(startOptions);\n\n // Open project on devices.\n await profile(openPlatformsAsync)(devServerManager, options);\n\n // Present the Terminal UI.\n if (!env.CI) {\n await profile(startInterfaceAsync)(devServerManager, {\n platforms: exp.platforms ?? ['ios', 'android', 'web'],\n });\n } else {\n // Display the server location in CI...\n const url = devServerManager.getDefaultDevServer()?.getDevServerUrl();\n if (url) {\n Log.log(chalk`Waiting on {underline ${url}}`);\n }\n }\n\n // Final note about closing the server.\n const logLocation = settings.webOnly ? 'in the browser console' : 'below';\n Log.log(\n chalk`Logs for your project will appear ${logLocation}.${\n env.CI ? '' : chalk.dim(` Press Ctrl+C to exit.`)\n }`\n );\n}\n\nfunction track(projectRoot: string, exp: ExpoConfig) {\n logEvent('dev client start command', {\n status: 'started',\n ...getDevClientProperties(projectRoot, exp),\n });\n installExitHooks(() => {\n logEvent('dev client start command', {\n status: 'finished',\n ...getDevClientProperties(projectRoot, exp),\n });\n // UnifiedAnalytics.flush();\n });\n}\n"],"names":["startAsync","Log","getMultiBundlerStartOptions","projectRoot","forceManifestType","options","settings","platformBundlers","commonOptions","mode","dev","devClient","privateKeyPath","undefined","https","maxWorkers","resetDevServer","clear","minify","location","hostType","host","scheme","multiBundlerSettings","resolvePortsAsync","optionalBundlers","web","bundlers","Set","Object","values","multiBundlerStartOptions","map","bundler","port","webpackPort","metroPort","type","log","chalk","gray","exp","pkg","profile","getConfig","getPlatformBundlers","easUpdatesUrlRegex","isEasUpdatesUrl","updates","url","test","defaultOptions","startOptions","devServerManager","DevServerManager","webOnly","ensureProjectPrerequisiteAsync","WebSupportProjectPrerequisite","TypeScriptProjectPrerequisite","validateDependenciesVersionsAsync","track","bind","openPlatformsAsync","env","CI","startInterfaceAsync","platforms","getDefaultDevServer","getDevServerUrl","logLocation","dim","logEvent","status","getDevClientProperties","installExitHooks"],"mappings":"AAAA;;;;QAgEsBA,UAAU,GAAVA,UAAU;AAhEM,IAAA,OAAc,WAAd,cAAc,CAAA;AAClC,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACoB,IAAA,uBAA2C,kCAA3C,2CAA2C,EAAA;AACrD,IAAA,kBAAsC,WAAtC,sCAAsC,CAAA;AAC3C,IAAA,IAAc,WAAd,cAAc,CAAA;AACD,IAAA,KAAe,WAAf,eAAe,CAAA;AACxB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACQ,IAAA,6BAAoD,WAApD,oDAAoD,CAAA;AACxD,IAAA,8BAAmD,WAAnD,mDAAmD,CAAA;AACnD,IAAA,8BAA4C,WAA5C,4CAA4C,CAAA;AACtD,IAAA,eAA4B,WAA5B,4BAA4B,CAAA;AACrB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AAEF,IAAA,iBAA2B,WAA3B,2BAA2B,CAAA;AACnD,IAAA,cAAwB,WAAxB,wBAAwB,CAAA;AACL,IAAA,iBAA2B,WAA3B,2BAA2B,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjF,eAAeC,2BAA2B,CACxCC,WAAmB,EACnB,EAAEC,iBAAiB,CAAA,EAAE,GAAGC,OAAO,EAAW,EAC1CC,QAA+B,EAC/BC,gBAAkC,EACwB;QAKxCF,eAAsB;IAJxC,MAAMG,aAAa,GAAwB;QACzCC,IAAI,E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QACtE,IAAInB,GAAG,EAAE;YACPhD,GAAG,CAACqC,GAAG,CAACC,MAAK,QAAA,CAAC,sBAAsB,EAAEU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;SAC/C;KACF;IAED,uCAAuC;IACvC,MAAMoB,WAAW,GAAG/D,QAAQ,CAACiD,OAAO,GAAG,wBAAwB,GAAG,OAAO,AAAC;IAC1EtD,GAAG,CAACqC,GAAG,CACLC,MAAK,QAAA,CAAC,kCAAkC,EAAE8B,WAAW,CAAC,CAAC,EACrDN,IAAG,IAAA,CAACC,EAAE,GAAG,EAAE,GAAGzB,MAAK,QAAA,CAAC+B,GAAG,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAClD,CAAC,CACH,CAAC;CACH;AAED,SAASV,KAAK,CAACzD,WAAmB,EAAEsC,GAAe,EAAE;IACnD8B,CAAAA,GAAAA,kBAAQ,AAGN,CAAA,SAHM,CAAC,0BAA0B,EAAE;QACnCC,MAAM,EAAE,SAAS;QACjB,GAAGC,CAAAA,GAAAA,uBAAsB,AAAkB,CAAA,QAAlB,CAACtE,WAAW,EAAEsC,GAAG,CAAC;KAC5C,CAAC,CAAC;IACHiC,CAAAA,GAAAA,KAAgB,AAMd,CAAA,iBANc,CAAC,IAAM;QACrBH,CAAAA,GAAAA,kBAAQ,AAGN,CAAA,SAHM,CAAC,0BAA0B,EAAE;YACnCC,MAAM,EAAE,UAAU;YAClB,GAAGC,CAAAA,GAAAA,uBAAsB,AAAkB,CAAA,QAAlB,CAACtE,WAAW,EAAEsC,GAAG,CAAC;SAC5C,CAAC,CAAC;IACH,4BAA4B;KAC7B,CAAC,CAAC;CACJ"}
@@ -34,10 +34,12 @@ function _interopRequireWildcard(obj) {
34
34
  return newObj;
35
35
  }
36
36
  }
37
+ const debug = require("debug")("expo:utils:fileNotifier");
37
38
  class FileNotifier {
38
- constructor(projectRoot, moduleIds){
39
+ constructor(projectRoot, moduleIds, settings = {}){
39
40
  this.projectRoot = projectRoot;
40
41
  this.moduleIds = moduleIds;
42
+ this.settings = settings;
41
43
  this.watchFile = (0, _fn).memoize(this.startWatchingFile.bind(this));
42
44
  }
43
45
  /** Get the file in the project. */ resolveFilePath() {
@@ -52,6 +54,7 @@ class FileNotifier {
52
54
  startObserving() {
53
55
  const configPath = this.resolveFilePath();
54
56
  if (configPath) {
57
+ debug(`Observing ${configPath}`);
55
58
  return this.watchFile(configPath);
56
59
  }
57
60
  return configPath;
@@ -60,7 +63,7 @@ class FileNotifier {
60
63
  const configName = _path.default.relative(this.projectRoot, filePath);
61
64
  (0, _fs).watchFile(filePath, (cur, prev)=>{
62
65
  if (prev.size || cur.size) {
63
- Log.log(`\u203A Detected a change in ${_chalk.default.bold(configName)}. Restart the server to see the new results.`);
66
+ Log.log(`\u203A Detected a change in ${_chalk.default.bold(configName)}. Restart the server to see the new results.` + (this.settings.additionalWarning || ""));
64
67
  }
65
68
  });
66
69
  return filePath;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/FileNotifier.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { watchFile } from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport * as Log from '../log';\nimport { memoize } from './fn';\n\n/** Observes and reports file changes. */\nexport class FileNotifier {\n constructor(\n /** Project root to resolve the module IDs relative to. */\n private projectRoot: string,\n /** List of module IDs sorted by priority. Only the first file that exists will be observed. */\n private moduleIds: string[]\n ) {}\n\n /** Get the file in the project. */\n private resolveFilePath(): string | null {\n for (const moduleId of this.moduleIds) {\n const filePath = resolveFrom.silent(this.projectRoot, moduleId);\n if (filePath) {\n return filePath;\n }\n }\n return null;\n }\n\n public startObserving() {\n const configPath = this.resolveFilePath();\n if (configPath) {\n return this.watchFile(configPath);\n }\n return configPath;\n }\n\n /** Watch the file and warn to reload the CLI if it changes. */\n public watchFile = memoize(this.startWatchingFile.bind(this));\n\n private startWatchingFile(filePath: string): string {\n const configName = path.relative(this.projectRoot, filePath);\n watchFile(filePath, (cur: any, prev: any) => {\n if (prev.size || cur.size) {\n Log.log(\n `\\u203A Detected a change in ${chalk.bold(\n configName\n )}. Restart the server to see the new results.`\n );\n }\n });\n return filePath;\n }\n}\n"],"names":["Log","FileNotifier","constructor","projectRoot","moduleIds","watchFile","memoize","startWatchingFile","bind","resolveFilePath","moduleId","filePath","resolveFrom","silent","startObserving","configPath","configName","path","relative","cur","prev","size","log","chalk","bold"],"mappings":"AAAA;;;;AAAkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACC,IAAA,GAAI,WAAJ,IAAI,CAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAE1BA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACS,IAAA,GAAM,WAAN,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGvB,MAAMC,YAAY;IACvBC,YAEUC,WAAmB,EAEnBC,SAAmB,CAC3B;aAHQD,WAAmB,GAAnBA,WAAmB;aAEnBC,SAAmB,GAAnBA,SAAmB;aAuBtBC,SAAS,GAAGC,CAAAA,GAAAA,GAAO,AAAmC,CAAA,QAAnC,CAAC,IAAI,CAACC,iBAAiB,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;KAtBzD;IAEJ,mCAAmC,CACnC,AAAQC,eAAe,GAAkB;QACvC,KAAK,MAAMC,QAAQ,IAAI,IAAI,CAACN,SAAS,CAAE;YACrC,MAAMO,QAAQ,GAAGC,YAAW,QAAA,CAACC,MAAM,CAAC,IAAI,CAACV,WAAW,EAAEO,QAAQ,CAAC,AAAC;YAChE,IAAIC,QAAQ,EAAE;gBACZ,OAAOA,QAAQ,CAAC;aACjB;SACF;QACD,OAAO,IAAI,CAAC;KACb;IAED,AAAOG,cAAc,GAAG;QACtB,MAAMC,UAAU,GAAG,IAAI,CAACN,eAAe,EAAE,AAAC;QAC1C,IAAIM,UAAU,EAAE;YACd,OAAO,IAAI,CAACV,SAAS,CAACU,UAAU,CAAC,CAAC;SACnC;QACD,OAAOA,UAAU,CAAC;KACnB;IAKD,AAAQR,iBAAiB,CAACI,QAAgB,EAAU;QAClD,MAAMK,UAAU,GAAGC,KAAI,QAAA,CAACC,QAAQ,CAAC,IAAI,CAACf,WAAW,EAAEQ,QAAQ,CAAC,AAAC;QAC7DN,CAAAA,GAAAA,GAAS,AAQP,CAAA,UARO,CAACM,QAAQ,EAAE,CAACQ,GAAQ,EAAEC,IAAS,GAAK;YAC3C,IAAIA,IAAI,CAACC,IAAI,IAAIF,GAAG,CAACE,IAAI,EAAE;gBACzBrB,GAAG,CAACsB,GAAG,CACL,CAAC,4BAA4B,EAAEC,MAAK,QAAA,CAACC,IAAI,CACvCR,UAAU,CACX,CAAC,4CAA4C,CAAC,CAChD,CAAC;aACH;SACF,CAAC,CAAC;QACH,OAAOL,QAAQ,CAAC;KACjB;CACF;QA3CYV,YAAY,GAAZA,YAAY"}
1
+ {"version":3,"sources":["../../../src/utils/FileNotifier.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { watchFile } from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport * as Log from '../log';\nimport { memoize } from './fn';\n\nconst debug = require('debug')('expo:utils:fileNotifier') as typeof console.log;\n\n/** Observes and reports file changes. */\nexport class FileNotifier {\n constructor(\n /** Project root to resolve the module IDs relative to. */\n private projectRoot: string,\n /** List of module IDs sorted by priority. Only the first file that exists will be observed. */\n private moduleIds: string[],\n private settings: {\n /** An additional warning message to add to the notice. */\n additionalWarning?: string;\n } = {}\n ) {}\n\n /** Get the file in the project. */\n private resolveFilePath(): string | null {\n for (const moduleId of this.moduleIds) {\n const filePath = resolveFrom.silent(this.projectRoot, moduleId);\n if (filePath) {\n return filePath;\n }\n }\n return null;\n }\n\n public startObserving() {\n const configPath = this.resolveFilePath();\n if (configPath) {\n debug(`Observing ${configPath}`);\n return this.watchFile(configPath);\n }\n return configPath;\n }\n\n /** Watch the file and warn to reload the CLI if it changes. */\n public watchFile = memoize(this.startWatchingFile.bind(this));\n\n private startWatchingFile(filePath: string): string {\n const configName = path.relative(this.projectRoot, filePath);\n watchFile(filePath, (cur: any, prev: any) => {\n if (prev.size || cur.size) {\n Log.log(\n `\\u203A Detected a change in ${chalk.bold(\n configName\n )}. Restart the server to see the new results.` + (this.settings.additionalWarning || '')\n );\n }\n });\n return filePath;\n }\n}\n"],"names":["Log","debug","require","FileNotifier","constructor","projectRoot","moduleIds","settings","watchFile","memoize","startWatchingFile","bind","resolveFilePath","moduleId","filePath","resolveFrom","silent","startObserving","configPath","configName","path","relative","cur","prev","size","log","chalk","bold","additionalWarning"],"mappings":"AAAA;;;;AAAkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACC,IAAA,GAAI,WAAJ,IAAI,CAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AACC,IAAA,YAAc,kCAAd,cAAc,EAAA;AAE1BA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACS,IAAA,GAAM,WAAN,MAAM,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9B,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yBAAyB,CAAC,AAAsB,AAAC;AAGzE,MAAMC,YAAY;IACvBC,YAEUC,WAAmB,EAEnBC,SAAmB,EACnBC,QAGP,GAAG,EAAE,CACN;aAPQF,WAAmB,GAAnBA,WAAmB;aAEnBC,SAAmB,GAAnBA,SAAmB;aACnBC,QAGP,GAHOA,QAGP;aAwBIC,SAAS,GAAGC,CAAAA,GAAAA,GAAO,AAAmC,CAAA,QAAnC,CAAC,IAAI,CAACC,iBAAiB,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;KAvBzD;IAEJ,mCAAmC,CACnC,AAAQC,eAAe,GAAkB;QACvC,KAAK,MAAMC,QAAQ,IAAI,IAAI,CAACP,SAAS,CAAE;YACrC,MAAMQ,QAAQ,GAAGC,YAAW,QAAA,CAACC,MAAM,CAAC,IAAI,CAACX,WAAW,EAAEQ,QAAQ,CAAC,AAAC;YAChE,IAAIC,QAAQ,EAAE;gBACZ,OAAOA,QAAQ,CAAC;aACjB;SACF;QACD,OAAO,IAAI,CAAC;KACb;IAED,AAAOG,cAAc,GAAG;QACtB,MAAMC,UAAU,GAAG,IAAI,CAACN,eAAe,EAAE,AAAC;QAC1C,IAAIM,UAAU,EAAE;YACdjB,KAAK,CAAC,CAAC,UAAU,EAAEiB,UAAU,CAAC,CAAC,CAAC,CAAC;YACjC,OAAO,IAAI,CAACV,SAAS,CAACU,UAAU,CAAC,CAAC;SACnC;QACD,OAAOA,UAAU,CAAC;KACnB;IAKD,AAAQR,iBAAiB,CAACI,QAAgB,EAAU;QAClD,MAAMK,UAAU,GAAGC,KAAI,QAAA,CAACC,QAAQ,CAAC,IAAI,CAAChB,WAAW,EAAES,QAAQ,CAAC,AAAC;QAC7DN,CAAAA,GAAAA,GAAS,AAQP,CAAA,UARO,CAACM,QAAQ,EAAE,CAACQ,GAAQ,EAAEC,IAAS,GAAK;YAC3C,IAAIA,IAAI,CAACC,IAAI,IAAIF,GAAG,CAACE,IAAI,EAAE;gBACzBxB,GAAG,CAACyB,GAAG,CACL,CAAC,4BAA4B,EAAEC,MAAK,QAAA,CAACC,IAAI,CACvCR,UAAU,CACX,CAAC,4CAA4C,CAAC,GAAG,CAAC,IAAI,CAACZ,QAAQ,CAACqB,iBAAiB,IAAI,EAAE,CAAC,CAC1F,CAAC;aACH;SACF,CAAC,CAAC;QACH,OAAOd,QAAQ,CAAC;KACjB;CACF;QAhDYX,YAAY,GAAZA,YAAY"}
@@ -80,7 +80,7 @@ function logEvent(event, properties = {}) {
80
80
  ensureIdentified();
81
81
  const { userId , deviceId } = identifyData != null ? identifyData : {};
82
82
  const commonEventProperties = {
83
- source_version: "0.1.5",
83
+ source_version: "0.2.0",
84
84
  source: "expo"
85
85
  };
86
86
  const identity = {
@@ -121,7 +121,7 @@ function getContext() {
121
121
  },
122
122
  app: {
123
123
  name: "expo",
124
- version: "0.1.5"
124
+ version: "0.2.0"
125
125
  },
126
126
  ci: ciInfo.isCI ? {
127
127
  name: ciInfo.name,
@@ -11,7 +11,6 @@ var _tempy = _interopRequireDefault(require("tempy"));
11
11
  var _util = require("util");
12
12
  var _client = require("../api/rest/client");
13
13
  var _wrapFetchWithProgress = require("../api/rest/wrapFetchWithProgress");
14
- var _log = require("../log");
15
14
  var _dir = require("./dir");
16
15
  var _errors = require("./errors");
17
16
  var _tar = require("./tar");
@@ -20,6 +19,7 @@ function _interopRequireDefault(obj) {
20
19
  default: obj
21
20
  };
22
21
  }
22
+ const debug = require("debug")("expo:utils:downloadAppAsync");
23
23
  const TIMER_DURATION = 30000;
24
24
  const pipeline = (0, _util).promisify(_stream.Stream.pipeline);
25
25
  async function downloadAsync({ url , outputPath , cacheDirectory , onProgress }) {
@@ -33,6 +33,7 @@ async function downloadAsync({ url , outputPath , cacheDirectory , onProgress }
33
33
  cacheDirectory
34
34
  });
35
35
  }
36
+ debug(`Downloading ${url} to ${outputPath}`);
36
37
  const res = await (0, _wrapFetchWithProgress).wrapFetchWithProgress(fetchInstance)(url, {
37
38
  timeout: TIMER_DURATION,
38
39
  onProgress
@@ -57,7 +58,7 @@ async function downloadAppAsync({ url , outputPath , extract =false , cacheDirec
57
58
  cacheDirectory,
58
59
  onProgress
59
60
  });
60
- _log.Log.debug(`Extracting ${tmpPath} to ${outputPath}`);
61
+ debug(`Extracting ${tmpPath} to ${outputPath}`);
61
62
  await (0, _dir).ensureDirectoryAsync(outputPath);
62
63
  await (0, _tar).extractAsync(tmpPath, outputPath);
63
64
  } else {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/downloadAppAsync.ts"],"sourcesContent":["import fs from 'fs';\nimport fetch from 'node-fetch';\nimport path from 'path';\nimport { Stream } from 'stream';\nimport temporary from 'tempy';\nimport { promisify } from 'util';\n\nimport { createCachedFetch } from '../api/rest/client';\nimport { FetchLike, ProgressCallback } from '../api/rest/client.types';\nimport { wrapFetchWithProgress } from '../api/rest/wrapFetchWithProgress';\nimport { Log } from '../log';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { extractAsync } from './tar';\n\nconst TIMER_DURATION = 30000;\n\nconst pipeline = promisify(Stream.pipeline);\n\nasync function downloadAsync({\n url,\n outputPath,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}) {\n let fetchInstance: FetchLike = fetch;\n if (cacheDirectory) {\n // Reconstruct the cached fetch since caching could be disabled.\n fetchInstance = createCachedFetch({\n // We'll use a 1 week cache for versions so older values get flushed out eventually.\n ttl: 1000 * 60 * 60 * 24 * 7,\n // Users can also nuke their `~/.expo` directory to clear the cache.\n cacheDirectory,\n });\n }\n\n const res = await wrapFetchWithProgress(fetchInstance)(url, {\n timeout: TIMER_DURATION,\n onProgress,\n });\n if (!res.ok) {\n throw new CommandError(\n 'FILE_DOWNLOAD',\n `Unexpected response: ${res.statusText}. From url: ${url}`\n );\n }\n return pipeline(res.body, fs.createWriteStream(outputPath));\n}\n\nexport async function downloadAppAsync({\n url,\n outputPath,\n extract = false,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n extract?: boolean;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}): Promise<void> {\n if (extract) {\n // For iOS we download the ipa to a file then pass that file into the extractor.\n // In the future we should just pipe the `res.body -> tar.extract` directly.\n // I tried this and it created some weird errors where observing the data stream\n // would corrupt the file causing tar to fail with `TAR_BAD_ARCHIVE`.\n const tmpPath = temporary.file({ name: path.basename(outputPath) });\n await downloadAsync({ url, outputPath: tmpPath, cacheDirectory, onProgress });\n Log.debug(`Extracting ${tmpPath} to ${outputPath}`);\n await ensureDirectoryAsync(outputPath);\n await extractAsync(tmpPath, outputPath);\n } else {\n await ensureDirectoryAsync(path.dirname(outputPath));\n await downloadAsync({ url, outputPath, cacheDirectory, onProgress });\n }\n}\n"],"names":["downloadAppAsync","TIMER_DURATION","pipeline","promisify","Stream","downloadAsync","url","outputPath","cacheDirectory","onProgress","fetchInstance","fetch","createCachedFetch","ttl","res","wrapFetchWithProgress","timeout","ok","CommandError","statusText","body","fs","createWriteStream","extract","tmpPath","temporary","file","name","path","basename","Log","debug","ensureDirectoryAsync","extractAsync","dirname"],"mappings":"AAAA;;;;QAsDsBA,gBAAgB,GAAhBA,gBAAgB;AAtDvB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACD,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AACA,IAAA,OAAQ,WAAR,QAAQ,CAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AACH,IAAA,KAAM,WAAN,MAAM,CAAA;AAEE,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AAEhB,IAAA,sBAAmC,WAAnC,mCAAmC,CAAA;AACrD,IAAA,IAAQ,WAAR,QAAQ,CAAA;AACS,IAAA,IAAO,WAAP,OAAO,CAAA;AACf,IAAA,OAAU,WAAV,UAAU,CAAA;AACV,IAAA,IAAO,WAAP,OAAO,CAAA;;;;;;AAEpC,MAAMC,cAAc,GAAG,KAAK,AAAC;AAE7B,MAAMC,QAAQ,GAAGC,CAAAA,GAAAA,KAAS,AAAiB,CAAA,UAAjB,CAACC,OAAM,OAAA,CAACF,QAAQ,CAAC,AAAC;AAE5C,eAAeG,aAAa,CAAC,EAC3BC,GAAG,CAAA,EACHC,UAAU,CAAA,EACVC,cAAc,CAAA,EACdC,UAAU,CAAA,EAMX,EAAE;IACD,IAAIC,aAAa,GAAcC,UAAK,QAAA,AAAC;IACrC,IAAIH,cAAc,EAAE;QAClB,gEAAgE;QAChEE,aAAa,GAAGE,CAAAA,GAAAA,OAAiB,AAK/B,CAAA,kBAL+B,CAAC;YAChC,oFAAoF;YACpFC,GAAG,EAAE,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;YAC5B,oEAAoE;YACpEL,cAAc;SACf,CAA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B,UAAU,CAAC,CAAC;KACzC,MAAM;QACL,MAAMyB,CAAAA,GAAAA,IAAoB,AAA0B,CAAA,qBAA1B,CAACJ,KAAI,QAAA,CAACM,OAAO,CAAC3B,UAAU,CAAC,CAAC,CAAC;QACrD,MAAMF,aAAa,CAAC;YAAEC,GAAG;YAAEC,UAAU;YAAEC,cAAc;YAAEC,UAAU;SAAE,CAAC,CAAC;KACtE;CACF"}
1
+ {"version":3,"sources":["../../../src/utils/downloadAppAsync.ts"],"sourcesContent":["import fs from 'fs';\nimport fetch from 'node-fetch';\nimport path from 'path';\nimport { Stream } from 'stream';\nimport temporary from 'tempy';\nimport { promisify } from 'util';\n\nimport { createCachedFetch } from '../api/rest/client';\nimport { FetchLike, ProgressCallback } from '../api/rest/client.types';\nimport { wrapFetchWithProgress } from '../api/rest/wrapFetchWithProgress';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { extractAsync } from './tar';\n\nconst debug = require('debug')('expo:utils:downloadAppAsync') as typeof console.log;\n\nconst TIMER_DURATION = 30000;\n\nconst pipeline = promisify(Stream.pipeline);\n\nasync function downloadAsync({\n url,\n outputPath,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}) {\n let fetchInstance: FetchLike = fetch;\n if (cacheDirectory) {\n // Reconstruct the cached fetch since caching could be disabled.\n fetchInstance = createCachedFetch({\n // We'll use a 1 week cache for versions so older values get flushed out eventually.\n ttl: 1000 * 60 * 60 * 24 * 7,\n // Users can also nuke their `~/.expo` directory to clear the cache.\n cacheDirectory,\n });\n }\n\n debug(`Downloading ${url} to ${outputPath}`);\n const res = await wrapFetchWithProgress(fetchInstance)(url, {\n timeout: TIMER_DURATION,\n onProgress,\n });\n if (!res.ok) {\n throw new CommandError(\n 'FILE_DOWNLOAD',\n `Unexpected response: ${res.statusText}. From url: ${url}`\n );\n }\n return pipeline(res.body, fs.createWriteStream(outputPath));\n}\n\nexport async function downloadAppAsync({\n url,\n outputPath,\n extract = false,\n cacheDirectory,\n onProgress,\n}: {\n url: string;\n outputPath: string;\n extract?: boolean;\n cacheDirectory?: string;\n onProgress?: ProgressCallback;\n}): Promise<void> {\n if (extract) {\n // For iOS we download the ipa to a file then pass that file into the extractor.\n // In the future we should just pipe the `res.body -> tar.extract` directly.\n // I tried this and it created some weird errors where observing the data stream\n // would corrupt the file causing tar to fail with `TAR_BAD_ARCHIVE`.\n const tmpPath = temporary.file({ name: path.basename(outputPath) });\n await downloadAsync({ url, outputPath: tmpPath, cacheDirectory, onProgress });\n debug(`Extracting ${tmpPath} to ${outputPath}`);\n await ensureDirectoryAsync(outputPath);\n await extractAsync(tmpPath, outputPath);\n } else {\n await ensureDirectoryAsync(path.dirname(outputPath));\n await downloadAsync({ url, outputPath, cacheDirectory, onProgress });\n }\n}\n"],"names":["downloadAppAsync","debug","require","TIMER_DURATION","pipeline","promisify","Stream","downloadAsync","url","outputPath","cacheDirectory","onProgress","fetchInstance","fetch","createCachedFetch","ttl","res","wrapFetchWithProgress","timeout","ok","CommandError","statusText","body","fs","createWriteStream","extract","tmpPath","temporary","file","name","path","basename","ensureDirectoryAsync","extractAsync","dirname"],"mappings":"AAAA;;;;QAwDsBA,gBAAgB,GAAhBA,gBAAgB;AAxDvB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACD,IAAA,UAAY,kCAAZ,YAAY,EAAA;AACb,IAAA,KAAM,kCAAN,MAAM,EAAA;AACA,IAAA,OAAQ,WAAR,QAAQ,CAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AACH,IAAA,KAAM,WAAN,MAAM,CAAA;AAEE,IAAA,OAAoB,WAApB,oBAAoB,CAAA;AAEhB,IAAA,sBAAmC,WAAnC,mCAAmC,CAAA;AACpC,IAAA,IAAO,WAAP,OAAO,CAAA;AACf,IAAA,OAAU,WAAV,UAAU,CAAA;AACV,IAAA,IAAO,WAAP,OAAO,CAAA;;;;;;AAEpC,MAAMC,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AG,CAAA,EACHC,UAAU,CAAA,EACVgB,OAAO,EAAG,KAAK,CAAA,EACff,cAAc,CAAA,EACdC,UAAU,CAAA,EAOX,EAAiB;IAChB,IAAIc,OAAO,EAAE;QACX,gFAAgF;QAChF,4EAA4E;QAC5E,gFAAgF;QAChF,qEAAqE;QACrE,MAAMC,OAAO,GAAGC,MAAS,QAAA,CAACC,IAAI,CAAC;YAAEC,IAAI,EAAEC,KAAI,QAAA,CAACC,QAAQ,CAACtB,UAAU,CAAC;SAAE,CAAC,AAAC;QACpE,MAAMF,aAAa,CAAC;YAAEC,GAAG;YAAEC,UAAU,EAAEiB,OAAO;YAAEhB,cAAc;YAAEC,UAAU;SAAE,CAAC,CAAC;QAC9EV,KAAK,CAAC,CAAC,WAAW,EAAEyB,OAAO,CAAC,IAAI,EAAEjB,UAAU,CAAC,CAAC,CAAC,CAAC;QAChD,MAAMuB,CAAAA,GAAAA,IAAoB,AAAY,CAAA,qBAAZ,CAACvB,UAAU,CAAC,CAAC;QACvC,MAAMwB,CAAAA,GAAAA,IAAY,AAAqB,CAAA,aAArB,CAACP,OAAO,EAAEjB,UAAU,CAAC,CAAC;KACzC,MAAM;QACL,MAAMuB,CAAAA,GAAAA,IAAoB,AAA0B,CAAA,qBAA1B,CAACF,KAAI,QAAA,CAACI,OAAO,CAACzB,UAAU,CAAC,CAAC,CAAC;QACrD,MAAMF,aAAa,CAAC;YAAEC,GAAG;YAAEC,UAAU;YAAEC,cAAc;YAAEC,UAAU;SAAE,CAAC,CAAC;KACtE;CACF"}
@@ -5,39 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  exports.downloadExpoGoAsync = downloadExpoGoAsync;
6
6
  var _getUserState = require("@expo/config/build/getUserState");
7
7
  var _path = _interopRequireDefault(require("path"));
8
- var _progress = _interopRequireDefault(require("progress"));
9
8
  var _getVersions = require("../api/getVersions");
10
- var Log = _interopRequireWildcard(require("../log"));
11
9
  var _downloadAppAsync = require("./downloadAppAsync");
12
10
  var _errors = require("./errors");
13
11
  var _profile = require("./profile");
14
- var _progress1 = require("./progress");
12
+ var _progress = require("./progress");
15
13
  function _interopRequireDefault(obj) {
16
14
  return obj && obj.__esModule ? obj : {
17
15
  default: obj
18
16
  };
19
17
  }
20
- function _interopRequireWildcard(obj) {
21
- if (obj && obj.__esModule) {
22
- return obj;
23
- } else {
24
- var newObj = {};
25
- if (obj != null) {
26
- for(var key in obj){
27
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
28
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
29
- if (desc.get || desc.set) {
30
- Object.defineProperty(newObj, key, desc);
31
- } else {
32
- newObj[key] = obj[key];
33
- }
34
- }
35
- }
36
- }
37
- newObj.default = obj;
38
- return newObj;
39
- }
40
- }
18
+ const debug = require("debug")("expo:utils:downloadExpoGo");
41
19
  const platformSettings = {
42
20
  ios: {
43
21
  versionsKey: "iosClientUrl",
@@ -54,29 +32,27 @@ const platformSettings = {
54
32
  };
55
33
  async function downloadExpoGoAsync(platform, { url , sdkVersion }) {
56
34
  const { getFilePath , versionsKey , shouldExtractResults } = platformSettings[platform];
57
- const bar = new _progress.default("Downloading the Expo Go app [:bar] :percent :etas", {
35
+ const bar = (0, _progress).createProgressBar("Downloading the Expo Go app [:bar] :percent :etas", {
58
36
  width: 64,
59
37
  total: 100,
60
38
  clear: true,
61
39
  complete: "=",
62
40
  incomplete: " "
63
41
  });
64
- // TODO: Auto track progress
65
- (0, _progress1).setProgressBar(bar);
66
42
  if (!url) {
67
43
  if (!sdkVersion) {
68
44
  throw new _errors.CommandError(`Unable to determine which Expo Go version to install (platform: ${platform})`);
69
45
  }
70
46
  const versions = await (0, _getVersions).getReleasedVersionsAsync();
71
47
  const version = versions[sdkVersion];
72
- Log.debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);
48
+ debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);
73
49
  url = version[versionsKey];
74
50
  }
75
51
  const filename = _path.default.parse(url).name;
76
52
  try {
77
53
  const outputPath = getFilePath(filename);
78
- Log.debug(`Downloading Expo Go from "${url}" to "${outputPath}".`);
79
- Log.debug(`The requested copy of Expo Go might already be cached in: "${(0, _getUserState).getExpoHomeDirectory()}". You can disable the cache with EXPO_NO_CACHE=1`);
54
+ debug(`Downloading Expo Go from "${url}" to "${outputPath}".`);
55
+ debug(`The requested copy of Expo Go might already be cached in: "${(0, _getUserState).getExpoHomeDirectory()}". You can disable the cache with EXPO_NO_CACHE=1`);
80
56
  await (0, _profile).profile(_downloadAppAsync.downloadAppAsync)({
81
57
  url,
82
58
  // Save all encrypted cache data to `~/.expo/expo-go`
@@ -91,8 +67,7 @@ async function downloadExpoGoAsync(platform, { url , sdkVersion }) {
91
67
  });
92
68
  return outputPath;
93
69
  } finally{
94
- bar.terminate();
95
- (0, _progress1).setProgressBar(null);
70
+ bar == null ? void 0 : bar.terminate();
96
71
  }
97
72
  }
98
73
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\nimport ProgressBar from 'progress';\n\nimport { getReleasedVersionsAsync, SDKVersion } from '../api/getVersions';\nimport * as Log from '../log';\nimport { downloadAppAsync } from './downloadAppAsync';\nimport { CommandError } from './errors';\nimport { profile } from './profile';\nimport { setProgressBar } from './progress';\n\nconst platformSettings: Record<\n string,\n {\n shouldExtractResults: boolean;\n versionsKey: keyof SDKVersion;\n getFilePath: (filename: string) => string;\n }\n> = {\n ios: {\n versionsKey: 'iosClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'ios-simulator-app-cache', `${filename}.app`),\n shouldExtractResults: true,\n },\n android: {\n versionsKey: 'androidClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'android-apk-cache', `${filename}.apk`),\n shouldExtractResults: false,\n },\n};\n\n/** Download the Expo Go app from the Expo servers (if only it was this easy for every app). */\nexport async function downloadExpoGoAsync(\n platform: keyof typeof platformSettings,\n {\n url,\n sdkVersion,\n }: {\n url?: string;\n sdkVersion?: string;\n }\n): Promise<string> {\n const { getFilePath, versionsKey, shouldExtractResults } = platformSettings[platform];\n\n const bar = new ProgressBar('Downloading the Expo Go app [:bar] :percent :etas', {\n width: 64,\n total: 100,\n clear: true,\n complete: '=',\n incomplete: ' ',\n });\n // TODO: Auto track progress\n setProgressBar(bar);\n\n if (!url) {\n if (!sdkVersion) {\n throw new CommandError(\n `Unable to determine which Expo Go version to install (platform: ${platform})`\n );\n }\n const versions = await getReleasedVersionsAsync();\n const version = versions[sdkVersion];\n Log.debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);\n url = version[versionsKey] as string;\n }\n\n const filename = path.parse(url).name;\n\n try {\n const outputPath = getFilePath(filename);\n Log.debug(`Downloading Expo Go from \"${url}\" to \"${outputPath}\".`);\n Log.debug(\n `The requested copy of Expo Go might already be cached in: \"${getExpoHomeDirectory()}\". You can disable the cache with EXPO_NO_CACHE=1`\n );\n await profile(downloadAppAsync)({\n url,\n // Save all encrypted cache data to `~/.expo/expo-go`\n cacheDirectory: 'expo-go',\n outputPath,\n extract: shouldExtractResults,\n onProgress({ progress }) {\n if (bar) {\n bar.tick(1, progress);\n }\n },\n });\n return outputPath;\n } finally {\n bar.terminate();\n setProgressBar(null);\n }\n}\n"],"names":["downloadExpoGoAsync","Log","platformSettings","ios","versionsKey","getFilePath","filename","path","join","getExpoHomeDirectory","shouldExtractResults","android","platform","url","sdkVersion","bar","ProgressBar","width","total","clear","complete","incomplete","setProgressBar","CommandError","versions","getReleasedVersionsAsync","version","debug","parse","name","outputPath","profile","downloadAppAsync","cacheDirectory","extract","onProgress","progress","tick","terminate"],"mappings":"AAAA;;;;QAkCsBA,mBAAmB,GAAnBA,mBAAmB;AAlCJ,IAAA,aAAiC,WAAjC,iCAAiC,CA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SAAS;YACzBH,UAAU;YACVI,OAAO,EAAExB,oBAAoB;YAC7ByB,UAAU,EAAC,EAAEC,QAAQ,CAAA,EAAE,EAAE;gBACvB,IAAIrB,GAAG,EAAE;oBACPA,GAAG,CAACsB,IAAI,CAAC,CAAC,EAAED,QAAQ,CAAC,CAAC;iBACvB;aACF;SACF,CAAC,CAAC;QACH,OAAON,UAAU,CAAC;KACnB,QAAS;QACRf,GAAG,CAACuB,SAAS,EAAE,CAAC;QAChBhB,CAAAA,GAAAA,UAAc,AAAM,CAAA,eAAN,CAAC,IAAI,CAAC,CAAC;KACtB;CACF"}
1
+ {"version":3,"sources":["../../../src/utils/downloadExpoGoAsync.ts"],"sourcesContent":["import { getExpoHomeDirectory } from '@expo/config/build/getUserState';\nimport path from 'path';\n\nimport { getReleasedVersionsAsync, SDKVersion } from '../api/getVersions';\nimport { downloadAppAsync } from './downloadAppAsync';\nimport { CommandError } from './errors';\nimport { profile } from './profile';\nimport { createProgressBar } from './progress';\n\nconst debug = require('debug')('expo:utils:downloadExpoGo') as typeof console.log;\n\nconst platformSettings: Record<\n string,\n {\n shouldExtractResults: boolean;\n versionsKey: keyof SDKVersion;\n getFilePath: (filename: string) => string;\n }\n> = {\n ios: {\n versionsKey: 'iosClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'ios-simulator-app-cache', `${filename}.app`),\n shouldExtractResults: true,\n },\n android: {\n versionsKey: 'androidClientUrl',\n getFilePath: (filename) =>\n path.join(getExpoHomeDirectory(), 'android-apk-cache', `${filename}.apk`),\n shouldExtractResults: false,\n },\n};\n\n/** Download the Expo Go app from the Expo servers (if only it was this easy for every app). */\nexport async function downloadExpoGoAsync(\n platform: keyof typeof platformSettings,\n {\n url,\n sdkVersion,\n }: {\n url?: string;\n sdkVersion?: string;\n }\n): Promise<string> {\n const { getFilePath, versionsKey, shouldExtractResults } = platformSettings[platform];\n\n const bar = createProgressBar('Downloading the Expo Go app [:bar] :percent :etas', {\n width: 64,\n total: 100,\n clear: true,\n complete: '=',\n incomplete: ' ',\n });\n\n if (!url) {\n if (!sdkVersion) {\n throw new CommandError(\n `Unable to determine which Expo Go version to install (platform: ${platform})`\n );\n }\n const versions = await getReleasedVersionsAsync();\n const version = versions[sdkVersion];\n debug(`Installing Expo Go version for SDK ${sdkVersion} at URL: ${version[versionsKey]}`);\n url = version[versionsKey] as string;\n }\n\n const filename = path.parse(url).name;\n\n try {\n const outputPath = getFilePath(filename);\n debug(`Downloading Expo Go from \"${url}\" to \"${outputPath}\".`);\n debug(\n `The requested copy of Expo Go might already be cached in: \"${getExpoHomeDirectory()}\". You can disable the cache with EXPO_NO_CACHE=1`\n );\n await profile(downloadAppAsync)({\n url,\n // Save all encrypted cache data to `~/.expo/expo-go`\n cacheDirectory: 'expo-go',\n outputPath,\n extract: shouldExtractResults,\n onProgress({ progress }) {\n if (bar) {\n bar.tick(1, progress);\n }\n },\n });\n return outputPath;\n } finally {\n bar?.terminate();\n }\n}\n"],"names":["downloadExpoGoAsync","debug","require","platformSettings","ios","versionsKey","getFilePath","filename","path","join","getExpoHomeDirectory","shouldExtractResults","android","platform","url","sdkVersion","bar","createProgressBar","width","total","clear","complete","incomplete","CommandError","versions","getReleasedVersionsAsync","version","parse","name","outputPath","profile","downloadAppAsync","cacheDirectory","extract","onProgress","progress","tick","terminate"],"mappings":"AAAA;;;;QAkCsBA,mBAAmB,GAAnBA,mBAAmB;AAlCJ,IAAA,aAAiC,WAAjC,iCAAiC,CAAA;AACrD,IAAA,KAAM,kCAAN,MAAM,EAAA;AAE8B,IAAA,YAAoB,WAApB,oBAAoB,CAAA;AACxC,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AACxB,IAAA,OAAU,WAAV,UAAU,CAAA;AACf,IAAA,QAAW,WAAX,WAAW,CAAA;AACD,IAAA,SAAY,WAAZ,YAAY,CAAA;;;;;;AAE9C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,2BAA2B,CAAC,AAAsB,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ug")("expo:utils:editor");
36
37
  function guessEditor() {
37
38
  try {
38
39
  return _envEditor.default.defaultEditor();
@@ -42,7 +43,7 @@ function guessEditor() {
42
43
  }
43
44
  async function openInEditorAsync(path) {
44
45
  const editor = guessEditor();
45
- Log.debug(`Opening ${path} in ${editor == null ? void 0 : editor.name} (bin: ${editor == null ? void 0 : editor.binary}, id: ${editor == null ? void 0 : editor.id})`);
46
+ debug(`Opening ${path} in ${editor == null ? void 0 : editor.name} (bin: ${editor == null ? void 0 : editor.binary}, id: ${editor == null ? void 0 : editor.id})`);
46
47
  if (editor) {
47
48
  try {
48
49
  await (0, _spawnAsync).default(editor.binary, [
@@ -50,7 +51,7 @@ async function openInEditorAsync(path) {
50
51
  ]);
51
52
  return true;
52
53
  } catch (error) {
53
- Log.debug(`Failed to auto open path in editor (path: ${path}, binary: ${editor.binary}):`, error);
54
+ debug(`Failed to auto open path in editor (path: ${path}, binary: ${editor.binary}):`, error);
54
55
  }
55
56
  }
56
57
  Log.error('Could not open editor, you can set it by defining the $EDITOR environment variable with the binary of your editor. (e.g. "vscode" or "atom")');
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/editor.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport editors from 'env-editor';\n\nimport * as Log from '../log';\n\n/** Guess what the default editor is and default to VSCode. */\nexport function guessEditor(): editors.Editor {\n try {\n return editors.defaultEditor();\n } catch {\n return editors.getEditor('vscode');\n }\n}\n\n/** Open a file path in a given editor. */\nexport async function openInEditorAsync(path: string): Promise<boolean> {\n const editor = guessEditor();\n\n Log.debug(`Opening ${path} in ${editor?.name} (bin: ${editor?.binary}, id: ${editor?.id})`);\n if (editor) {\n try {\n await spawnAsync(editor.binary, [path]);\n return true;\n } catch (error: any) {\n Log.debug(\n `Failed to auto open path in editor (path: ${path}, binary: ${editor.binary}):`,\n error\n );\n }\n }\n\n Log.error(\n 'Could not open editor, you can set it by defining the $EDITOR environment variable with the binary of your editor. (e.g. \"vscode\" or \"atom\")'\n );\n return false;\n}\n"],"names":["guessEditor","openInEditorAsync","Log","editors","defaultEditor","getEditor","path","editor","debug","name","binary","id","spawnAsync","error"],"mappings":"AAAA;;;;QAMgBA,WAAW,GAAXA,WAAW;QASLC,iBAAiB,GAAjBA,iBAAiB;AAfhB,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AACtB,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAEpBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGR,SAASF,WAAW,GAAmB;IAC5C,IAAI;QACF,OAAOG,UAAO,QAAA,CAACC,aAAa,EAAE,CAAC;KAChC,CAAC,OAAM;QACN,OAAOD,UAAO,QAAA,CAACE,SAAS,CAAC,QAAQ,CAAC,CAAC;KACpC;CACF;AAGM,eAAeJ,iBAAiB,CAACK,IAAY,EAAoB;IACtE,MAAMC,MAAM,GAAGP,WAAW,EAAE,AAAC;IAE7BE,GAAG,CAACM,KAAK,CAAC,CAAC,QAAQ,EAAEF,IAAI,CAAC,IAAI,EAAEC,MAAM,QAAM,GAAZA,KAAAA,CAAY,GAAZA,MAAM,CAAEE,IAAI,CAAC,OAAO,EAAEF,MAAM,QAAQ,GAAdA,KAAAA,CAAc,GAAdA,MAAM,CAAEG,MAAM,CAAC,MAAM,EAAEH,MAAM,QAAI,GAAVA,KAAAA,CAAU,GAAVA,MAAM,CAAEI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5F,IAAIJ,MAAM,EAAE;QACV,IAAI;YACF,MAAMK,CAAAA,GAAAA,WAAU,AAAuB,CAAA,QAAvB,CAACL,MAAM,CAACG,MAAM,EAAE;gBAACJ,IAAI;aAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC;SACb,CAAC,OAAOO,KAAK,EAAO;YACnBX,GAAG,CAACM,KAAK,CACP,CAAC,0CAA0C,EAAEF,IAAI,CAAC,UAAU,EAAEC,MAAM,CAACG,MAAM,CAAC,EAAE,CAAC,EAC/EG,KAAK,CACN,CAAC;SACH;KACF;IAEDX,GAAG,CAACW,KAAK,CACP,8IAA8I,CAC/I,CAAC;IACF,OAAO,KAAK,CAAC;CACd"}
1
+ {"version":3,"sources":["../../../src/utils/editor.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport editors from 'env-editor';\n\nimport * as Log from '../log';\n\nconst debug = require('debug')('expo:utils:editor') as typeof console.log;\n\n/** Guess what the default editor is and default to VSCode. */\nexport function guessEditor(): editors.Editor {\n try {\n return editors.defaultEditor();\n } catch {\n return editors.getEditor('vscode');\n }\n}\n\n/** Open a file path in a given editor. */\nexport async function openInEditorAsync(path: string): Promise<boolean> {\n const editor = guessEditor();\n\n debug(`Opening ${path} in ${editor?.name} (bin: ${editor?.binary}, id: ${editor?.id})`);\n if (editor) {\n try {\n await spawnAsync(editor.binary, [path]);\n return true;\n } catch (error: any) {\n debug(`Failed to auto open path in editor (path: ${path}, binary: ${editor.binary}):`, error);\n }\n }\n\n Log.error(\n 'Could not open editor, you can set it by defining the $EDITOR environment variable with the binary of your editor. (e.g. \"vscode\" or \"atom\")'\n );\n return false;\n}\n"],"names":["guessEditor","openInEditorAsync","Log","debug","require","editors","defaultEditor","getEditor","path","editor","name","binary","id","spawnAsync","error"],"mappings":"AAAA;;;;QAQgBA,WAAW,GAAXA,WAAW;QASLC,iBAAiB,GAAjBA,iBAAiB;AAjBhB,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AACtB,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAEpBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEf,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAsB,AAAC;AAGnE,SAASJ,WAAW,GAAmB;IAC5C,IAAI;QACF,OAAOK,UAAO,QAAA,CAACC,aAAa,EAAE,CAAC;KAChC,CAAC,OAAM;QACN,OAAOD,UAAO,QAAA,CAACE,SAAS,CAAC,QAAQ,CAAC,CAAC;KACpC;CACF;AAGM,eAAeN,iBAAiB,CAACO,IAAY,EAAoB;IACtE,MAAMC,MAAM,GAAGT,WAAW,EAAE,AAAC;IAE7BG,KAAK,CAAC,CAAC,QAAQ,EAAEK,IAAI,CAAC,IAAI,EAAEC,MAAM,QAAM,GAAZA,KAAAA,CAAY,GAAZA,MAAM,CAAEC,IAAI,CAAC,OAAO,EAAED,MAAM,QAAQ,GAAdA,KAAAA,CAAc,GAAdA,MAAM,CAAEE,MAAM,CAAC,MAAM,EAAEF,MAAM,QAAI,GAAVA,KAAAA,CAAU,GAAVA,MAAM,CAAEG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACxF,IAAIH,MAAM,EAAE;QACV,IAAI;YACF,MAAMI,CAAAA,GAAAA,WAAU,AAAuB,CAAA,QAAvB,CAACJ,MAAM,CAACE,MAAM,EAAE;gBAACH,IAAI;aAAC,CAAC,CAAC;YACxC,OAAO,IAAI,CAAC;SACb,CAAC,OAAOM,KAAK,EAAO;YACnBX,KAAK,CAAC,CAAC,0CAA0C,EAAEK,IAAI,CAAC,UAAU,EAAEC,MAAM,CAACE,MAAM,CAAC,EAAE,CAAC,EAAEG,KAAK,CAAC,CAAC;SAC/F;KACF;IAEDZ,GAAG,CAACY,KAAK,CACP,8IAA8I,CAC/I,CAAC;IACF,OAAO,KAAK,CAAC;CACd"}
@@ -55,6 +55,9 @@ class Env {
55
55
  /** Skip validating the manifest during `export`. */ get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN() {
56
56
  return !!(0, _getenv).string("EXPO_SKIP_MANIFEST_VALIDATION_TOKEN");
57
57
  }
58
+ /** Public folder path relative to the project root. Default to `public` */ get EXPO_PUBLIC_FOLDER() {
59
+ return (0, _getenv).string("EXPO_PUBLIC_FOLDER", "public");
60
+ }
58
61
  }
59
62
  const env = new Env();
60
63
  exports.env = env;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Enable the experimental interstitial app select page. */\n get EXPO_ENABLE_INTERSTITIAL_PAGE() {\n return boolish('EXPO_ENABLE_INTERSTITIAL_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN');\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_ENABLE_INTERSTITIAL_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","env"],"mappings":"AAAA;;;;;AAAqC,IAAA,OAAQ,WAAR,QAAQ,CAAA;AAE7C,mFAAmF;AAEnF,6CAA6C;AAE7C,MAAMA,GAAG;IACP,+BAA+B,CAC/B,IAAIC,YAAY,GAAG;QACjB,OAAOC,CAAAA,GAAAA,OAAO,AAAuB,CAAA,QAAvB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,2BAA2B,CAC3B,IAAIC,UAAU,GAAG;QACf,OAAOD,CAAAA,GAAAA,OAAO,AAAqB,CAAA,QAArB,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;KACrC;IAED,wGAAwG,CACxG,IAAIE,SAAS,GAAG;QACd,OAAOF,CAAAA,GAAAA,OAAO,AAAoB,CAAA,QAApB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;KACpC;IAED,qCAAqC,CACrC,IAAIG,YAAY,GAAG;QACjB,OAAOH,CAAAA,GAAAA,OAAO,AAAuB,CAAA,QAAvB,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;KACvC;IAED,mCAAmC,CACnC,IAAII,UAAU,GAAG;QACf,OAAOJ,CAAAA,GAAAA,OAAO,A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,GAAAA,OAAO,AAAwC,CAAA,QAAxC,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;KACxD;IACD,6EAA6E,CAC7E,IAAIe,cAAc,GAAG;QACnB,OAAOC,CAAAA,GAAAA,OAAG,AAAqB,CAAA,IAArB,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;KACjC;IACD,oDAAoD,CACpD,IAAIC,mCAAmC,GAAY;QACjD,OAAO,CAAC,CAACT,CAAAA,GAAAA,OAAM,AAAuC,CAAA,OAAvC,CAAC,qCAAqC,CAAC,CAAC;KACxD;CACF;AAEM,MAAMU,GAAG,GAAG,IAAIpB,GAAG,EAAE,AAAC;QAAhBoB,GAAG,GAAHA,GAAG"}
1
+ {"version":3,"sources":["../../../src/utils/env.ts"],"sourcesContent":["import { boolish, int, string } from 'getenv';\n\n// @expo/webpack-config -> expo-pwa -> @expo/image-utils: EXPO_IMAGE_UTILS_NO_SHARP\n\n// TODO: EXPO_CLI_USERNAME, EXPO_CLI_PASSWORD\n\nclass Env {\n /** Enable profiling metrics */\n get EXPO_PROFILE() {\n return boolish('EXPO_PROFILE', false);\n }\n\n /** Enable debug logging */\n get EXPO_DEBUG() {\n return boolish('EXPO_DEBUG', false);\n }\n\n /** Enable the beta version of Expo (TODO: Should this just be in the beta version of expo releases?) */\n get EXPO_BETA() {\n return boolish('EXPO_BETA', false);\n }\n\n /** Enable staging API environment */\n get EXPO_STAGING() {\n return boolish('EXPO_STAGING', false);\n }\n\n /** Enable local API environment */\n get EXPO_LOCAL() {\n return boolish('EXPO_LOCAL', false);\n }\n\n /** Is running in non-interactive CI mode */\n get CI() {\n return boolish('CI', false);\n }\n\n /** Disable telemetry (analytics) */\n get EXPO_NO_TELEMETRY() {\n return boolish('EXPO_NO_TELEMETRY', false);\n }\n\n /** local directory to the universe repo for testing locally */\n get EXPO_UNIVERSE_DIR() {\n return string('EXPO_UNIVERSE_DIR', '');\n }\n\n /** @deprecated Default Webpack host string */\n get WEB_HOST() {\n return string('WEB_HOST', '0.0.0.0');\n }\n\n /** Skip warning users about a dirty git status */\n get EXPO_NO_GIT_STATUS() {\n return boolish('EXPO_NO_GIT_STATUS', false);\n }\n /** Disable auto web setup */\n get EXPO_NO_WEB_SETUP() {\n return boolish('EXPO_NO_WEB_SETUP', false);\n }\n /** Disable auto TypeScript setup */\n get EXPO_NO_TYPESCRIPT_SETUP() {\n return boolish('EXPO_NO_TYPESCRIPT_SETUP', false);\n }\n /** Disable all API caches. Does not disable bundler caches. */\n get EXPO_NO_CACHE() {\n return boolish('EXPO_NO_CACHE', false);\n }\n /** Enable the experimental interstitial app select page. */\n get EXPO_ENABLE_INTERSTITIAL_PAGE() {\n return boolish('EXPO_ENABLE_INTERSTITIAL_PAGE', false);\n }\n /** The React Metro port that's baked into react-native scripts and tools. */\n get RCT_METRO_PORT() {\n return int('RCT_METRO_PORT', 0);\n }\n /** Skip validating the manifest during `export`. */\n get EXPO_SKIP_MANIFEST_VALIDATION_TOKEN(): boolean {\n return !!string('EXPO_SKIP_MANIFEST_VALIDATION_TOKEN');\n }\n\n /** Public folder path relative to the project root. Default to `public` */\n get EXPO_PUBLIC_FOLDER(): string {\n return string('EXPO_PUBLIC_FOLDER', 'public');\n }\n}\n\nexport const env = new Env();\n"],"names":["Env","EXPO_PROFILE","boolish","EXPO_DEBUG","EXPO_BETA","EXPO_STAGING","EXPO_LOCAL","CI","EXPO_NO_TELEMETRY","EXPO_UNIVERSE_DIR","string","WEB_HOST","EXPO_NO_GIT_STATUS","EXPO_NO_WEB_SETUP","EXPO_NO_TYPESCRIPT_SETUP","EXPO_NO_CACHE","EXPO_ENABLE_INTERSTITIAL_PAGE","RCT_METRO_PORT","int","EXPO_SKIP_MANIFEST_VALIDATION_TOKEN","EXPO_PUBLIC_FOLDER","env"],"mappings":"AAAA;;;;;AAAqC,IAAA,OAAQ,WAAR,QAAQ,CAAA;AAE7C,mFAAmF;AAEnF,6CAA6C;AAE7C,MAAMA,GAAG;IACP,+BAA+B,CAC/B,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4
  });
5
5
  exports.installExitHooks = installExitHooks;
6
- var Log = _interopRequireWildcard(require("../log"));
7
6
  var _fn = require("./fn");
8
- function _interopRequireWildcard(obj) {
9
- if (obj && obj.__esModule) {
10
- return obj;
11
- } else {
12
- var newObj = {};
13
- if (obj != null) {
14
- for(var key in obj){
15
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
16
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
17
- if (desc.get || desc.set) {
18
- Object.defineProperty(newObj, key, desc);
19
- } else {
20
- newObj[key] = obj[key];
21
- }
22
- }
23
- }
24
- }
25
- newObj.default = obj;
26
- return newObj;
27
- }
28
- }
7
+ const debug = require("debug")("expo:utils:exit");
29
8
  const PRE_EXIT_SIGNALS = [
30
9
  "SIGHUP",
31
10
  "SIGINT",
@@ -57,16 +36,16 @@ function installExitHooks(asyncExitHook) {
57
36
  // Create a function that runs before the process exits and guards against running multiple times.
58
37
  function createExitHook(signal) {
59
38
  return (0, _fn).guardAsync(async ()=>{
60
- Log.debug(`pre-exit (signal: ${signal}, queue length: ${queue.length})`);
39
+ debug(`pre-exit (signal: ${signal}, queue length: ${queue.length})`);
61
40
  for (const [index, hookAsync] of Object.entries(queue)){
62
41
  try {
63
42
  await hookAsync(signal);
64
43
  } catch (error) {
65
- Log.debug(`Error in exit hook: %O (queue: ${index})`, error);
44
+ debug(`Error in exit hook: %O (queue: ${index})`, error);
66
45
  }
67
46
  }
68
47
  var _exitCode;
69
- Log.debug(`post-exit (code: ${(_exitCode = process.exitCode) != null ? _exitCode : 0})`);
48
+ debug(`post-exit (code: ${(_exitCode = process.exitCode) != null ? _exitCode : 0})`);
70
49
  process.exit();
71
50
  });
72
51
  }