@expo/cli 0.1.5 → 0.2.2

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 (192) hide show
  1. package/CHANGELOG.md +133 -0
  2. package/build/bin/cli +83 -4
  3. package/build/bin/cli.map +1 -1
  4. package/build/src/api/getNativeModuleVersions.js.map +1 -1
  5. package/build/src/api/rest/wrapFetchWithOffline.js +2 -23
  6. package/build/src/api/rest/wrapFetchWithOffline.js.map +1 -1
  7. package/build/src/customize/customizeAsync.js +40 -0
  8. package/build/src/customize/customizeAsync.js.map +1 -0
  9. package/build/src/customize/generate.js +77 -0
  10. package/build/src/customize/generate.js.map +1 -0
  11. package/build/src/customize/index.js +41 -0
  12. package/build/src/customize/index.js.map +1 -0
  13. package/build/src/customize/resolveOptions.js +18 -0
  14. package/build/src/customize/resolveOptions.js.map +1 -0
  15. package/build/src/customize/templates.js +118 -0
  16. package/build/src/customize/templates.js.map +1 -0
  17. package/build/src/export/createMetadataJson.js +10 -7
  18. package/build/src/export/createMetadataJson.js.map +1 -1
  19. package/build/src/export/exportApp.js +32 -0
  20. package/build/src/export/exportApp.js.map +1 -1
  21. package/build/src/export/exportAssets.js +2 -3
  22. package/build/src/export/exportAssets.js.map +1 -1
  23. package/build/src/export/fork-bundleAsync.js +52 -35
  24. package/build/src/export/fork-bundleAsync.js.map +1 -1
  25. package/build/src/export/index.js +14 -10
  26. package/build/src/export/index.js.map +1 -1
  27. package/build/src/export/printBundleSizes.js +27 -48
  28. package/build/src/export/printBundleSizes.js.map +1 -1
  29. package/build/src/export/resolveOptions.js +44 -5
  30. package/build/src/export/resolveOptions.js.map +1 -1
  31. package/build/src/export/saveAssets.js +2 -1
  32. package/build/src/export/saveAssets.js.map +1 -1
  33. package/build/src/export/web/exportWebAsync.js +37 -0
  34. package/build/src/export/web/exportWebAsync.js.map +1 -0
  35. package/build/src/export/web/index.js +66 -0
  36. package/build/src/export/web/index.js.map +1 -0
  37. package/build/src/export/web/resolveOptions.js +13 -0
  38. package/build/src/export/web/resolveOptions.js.map +1 -0
  39. package/build/src/export/writeContents.js.map +1 -1
  40. package/build/src/install/checkPackages.js +2 -1
  41. package/build/src/install/checkPackages.js.map +1 -1
  42. package/build/src/install/index.js +1 -0
  43. package/build/src/install/index.js.map +1 -1
  44. package/build/src/install/installAsync.js +13 -5
  45. package/build/src/install/installAsync.js.map +1 -1
  46. package/build/src/install/resolveOptions.js +12 -65
  47. package/build/src/install/resolveOptions.js.map +1 -1
  48. package/build/src/install/utils/autoAddConfigPlugins.js +5 -26
  49. package/build/src/install/utils/autoAddConfigPlugins.js.map +1 -1
  50. package/build/src/log.js.map +1 -1
  51. package/build/src/prebuild/copyTemplateFiles.js +5 -23
  52. package/build/src/prebuild/copyTemplateFiles.js.map +1 -1
  53. package/build/src/prebuild/index.js +18 -12
  54. package/build/src/prebuild/index.js.map +1 -1
  55. package/build/src/prebuild/prebuildAsync.js +11 -12
  56. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  57. package/build/src/prebuild/resolveOptions.js +17 -0
  58. package/build/src/prebuild/resolveOptions.js.map +1 -1
  59. package/build/src/prebuild/resolveTemplate.js +2 -1
  60. package/build/src/prebuild/resolveTemplate.js.map +1 -1
  61. package/build/src/prebuild/updatePackageJson.js +5 -5
  62. package/build/src/prebuild/updatePackageJson.js.map +1 -1
  63. package/build/src/run/android/resolveInstallApkName.js +5 -26
  64. package/build/src/run/android/resolveInstallApkName.js.map +1 -1
  65. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js +2 -0
  66. package/build/src/start/doctor/apple/SimulatorAppPrerequisite.js.map +1 -1
  67. package/build/src/start/doctor/apple/XcodePrerequisite.js +2 -0
  68. package/build/src/start/doctor/apple/XcodePrerequisite.js.map +1 -1
  69. package/build/src/start/doctor/dependencies/bundledNativeModules.js +3 -2
  70. package/build/src/start/doctor/dependencies/bundledNativeModules.js.map +1 -1
  71. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js +7 -13
  72. package/build/src/start/doctor/dependencies/ensureDependenciesAsync.js.map +1 -1
  73. package/build/src/start/doctor/dependencies/getMissingPackages.js +3 -24
  74. package/build/src/start/doctor/dependencies/getMissingPackages.js.map +1 -1
  75. package/build/src/start/doctor/dependencies/getVersionedPackages.js +2 -23
  76. package/build/src/start/doctor/dependencies/getVersionedPackages.js.map +1 -1
  77. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js +17 -9
  78. package/build/src/start/doctor/dependencies/validateDependenciesVersions.js.map +1 -1
  79. package/build/src/start/doctor/ngrok/ExternalModule.js +2 -1
  80. package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
  81. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js +4 -3
  82. package/build/src/start/doctor/typescript/TypeScriptProjectPrerequisite.js.map +1 -1
  83. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js +29 -31
  84. package/build/src/start/doctor/web/WebSupportProjectPrerequisite.js.map +1 -1
  85. package/build/src/start/interface/KeyPressHandler.js +2 -0
  86. package/build/src/start/interface/KeyPressHandler.js.map +1 -1
  87. package/build/src/start/interface/interactiveActions.js +5 -5
  88. package/build/src/start/interface/interactiveActions.js.map +1 -1
  89. package/build/src/start/interface/startInterface.js +3 -2
  90. package/build/src/start/interface/startInterface.js.map +1 -1
  91. package/build/src/start/platforms/ExpoGoInstaller.js +2 -1
  92. package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
  93. package/build/src/start/platforms/PlatformManager.js +4 -24
  94. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  95. package/build/src/start/platforms/android/ADBServer.js +17 -32
  96. package/build/src/start/platforms/android/ADBServer.js.map +1 -1
  97. package/build/src/start/platforms/android/AndroidSdk.js +41 -0
  98. package/build/src/start/platforms/android/AndroidSdk.js.map +1 -0
  99. package/build/src/start/platforms/android/activateWindow.js +4 -4
  100. package/build/src/start/platforms/android/activateWindow.js.map +1 -1
  101. package/build/src/start/platforms/android/adb.js +8 -3
  102. package/build/src/start/platforms/android/adb.js.map +1 -1
  103. package/build/src/start/platforms/android/adbReverse.js +3 -2
  104. package/build/src/start/platforms/android/adbReverse.js.map +1 -1
  105. package/build/src/start/platforms/android/gradle.js +2 -2
  106. package/build/src/start/platforms/android/gradle.js.map +1 -1
  107. package/build/src/start/platforms/ios/getBestSimulator.js +4 -4
  108. package/build/src/start/platforms/ios/getBestSimulator.js.map +1 -1
  109. package/build/src/start/platforms/ios/xcrun.js +2 -23
  110. package/build/src/start/platforms/ios/xcrun.js.map +1 -1
  111. package/build/src/start/project/devices.js +2 -0
  112. package/build/src/start/project/devices.js.map +1 -1
  113. package/build/src/start/server/AsyncNgrok.js +6 -5
  114. package/build/src/start/server/AsyncNgrok.js.map +1 -1
  115. package/build/src/start/server/BundlerDevServer.js +15 -8
  116. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  117. package/build/src/start/server/DevServerManager.js +15 -5
  118. package/build/src/start/server/DevServerManager.js.map +1 -1
  119. package/build/src/start/server/DevelopmentSession.js +4 -0
  120. package/build/src/start/server/DevelopmentSession.js.map +1 -1
  121. package/build/src/start/server/UrlCreator.js +10 -3
  122. package/build/src/start/server/UrlCreator.js.map +1 -1
  123. package/build/src/start/server/metro/MetroBundlerDevServer.js +9 -0
  124. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  125. package/build/src/start/server/metro/TerminalReporter.js +5 -0
  126. package/build/src/start/server/metro/TerminalReporter.js.map +1 -1
  127. package/build/src/start/server/metro/instantiateMetro.js +11 -2
  128. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  129. package/build/src/start/server/metro/resolveFromProject.js +8 -0
  130. package/build/src/start/server/metro/resolveFromProject.js.map +1 -1
  131. package/build/src/start/server/metro/withMetroMultiPlatform.js +115 -0
  132. package/build/src/start/server/metro/withMetroMultiPlatform.js.map +1 -0
  133. package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
  134. package/build/src/start/server/middleware/ExpoMiddleware.js +9 -4
  135. package/build/src/start/server/middleware/ExpoMiddleware.js.map +1 -1
  136. package/build/src/start/server/middleware/HistoryFallbackMiddleware.js +24 -0
  137. package/build/src/start/server/middleware/HistoryFallbackMiddleware.js.map +1 -0
  138. package/build/src/start/server/middleware/InterstitialPageMiddleware.js +2 -0
  139. package/build/src/start/server/middleware/InterstitialPageMiddleware.js.map +1 -1
  140. package/build/src/start/server/middleware/ManifestMiddleware.js +57 -6
  141. package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
  142. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js +6 -1
  143. package/build/src/start/server/middleware/RuntimeRedirectMiddleware.js.map +1 -1
  144. package/build/src/start/server/middleware/ServeStaticMiddleware.js +62 -0
  145. package/build/src/start/server/middleware/ServeStaticMiddleware.js.map +1 -0
  146. package/build/src/start/server/platformBundlers.js +18 -0
  147. package/build/src/start/server/platformBundlers.js.map +1 -0
  148. package/build/src/start/server/webTemplate.js +68 -0
  149. package/build/src/start/server/webTemplate.js.map +1 -0
  150. package/build/src/start/server/webpack/WebpackBundlerDevServer.js +59 -19
  151. package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
  152. package/build/src/start/server/webpack/compile.js +64 -0
  153. package/build/src/start/server/webpack/compile.js.map +1 -0
  154. package/build/src/start/startAsync.js +21 -17
  155. package/build/src/start/startAsync.js.map +1 -1
  156. package/build/src/utils/FileNotifier.js +5 -2
  157. package/build/src/utils/FileNotifier.js.map +1 -1
  158. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  159. package/build/src/utils/downloadAppAsync.js +3 -2
  160. package/build/src/utils/downloadAppAsync.js.map +1 -1
  161. package/build/src/utils/downloadExpoGoAsync.js +7 -32
  162. package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
  163. package/build/src/utils/editor.js +3 -2
  164. package/build/src/utils/editor.js.map +1 -1
  165. package/build/src/utils/env.js +3 -0
  166. package/build/src/utils/env.js.map +1 -1
  167. package/build/src/utils/exit.js +4 -25
  168. package/build/src/utils/exit.js.map +1 -1
  169. package/build/src/utils/getRunningProcess.js +6 -2
  170. package/build/src/utils/getRunningProcess.js.map +1 -1
  171. package/build/src/utils/nodeModules.js +13 -102
  172. package/build/src/utils/nodeModules.js.map +1 -1
  173. package/build/src/utils/npm.js +3 -24
  174. package/build/src/utils/npm.js.map +1 -1
  175. package/build/src/utils/ora.js +1 -13
  176. package/build/src/utils/ora.js.map +1 -1
  177. package/build/src/utils/progress.js +46 -0
  178. package/build/src/utils/progress.js.map +1 -1
  179. package/build/src/utils/prompts.js +4 -4
  180. package/build/src/utils/prompts.js.map +1 -1
  181. package/build/src/utils/tar.js +3 -0
  182. package/build/src/utils/tar.js.map +1 -1
  183. package/build/src/utils/validateApplicationId.js +9 -2
  184. package/build/src/utils/validateApplicationId.js.map +1 -1
  185. package/build/src/utils/variadic.js +47 -0
  186. package/build/src/utils/variadic.js.map +1 -0
  187. package/package.json +13 -8
  188. package/static/template/babel.config.js +6 -0
  189. package/static/template/index.html +117 -0
  190. package/static/template/metro.config.js +4 -0
  191. package/static/template/serve.json +13 -0
  192. package/static/template/webpack.config.js +7 -0
@@ -19,7 +19,6 @@ exports.createSelectionFilter = createSelectionFilter;
19
19
  exports.promptAsync = void 0;
20
20
  var _assert = _interopRequireDefault(require("assert"));
21
21
  var _prompts = _interopRequireWildcard(require("prompts"));
22
- var Log = _interopRequireWildcard(require("../log"));
23
22
  var _env = require("./env");
24
23
  var _errors = require("./errors");
25
24
  async function prompt(questions, { nonInteractiveHelp , ...options } = {}) {
@@ -76,6 +75,7 @@ function _interopRequireWildcard(obj) {
76
75
  return newObj;
77
76
  }
78
77
  }
78
+ const debug = require("debug")("expo:utils:prompts");
79
79
  /** Interaction observers for detecting when keystroke tracking should pause/resume. */ const listeners = [];
80
80
  async function confirmAsync(questions, options) {
81
81
  const { value } = await prompt({
@@ -107,7 +107,7 @@ function removeInteractionListener(callback) {
107
107
  listeners.splice(listenerIndex, 1);
108
108
  }
109
109
  function pauseInteractions(options = {}) {
110
- Log.debug("Interaction observers paused");
110
+ debug("Interaction observers paused");
111
111
  for (const listener of listeners){
112
112
  listener({
113
113
  pause: true,
@@ -116,7 +116,7 @@ function pauseInteractions(options = {}) {
116
116
  }
117
117
  }
118
118
  function resumeInteractions(options = {}) {
119
- Log.debug("Interaction observers resumed");
119
+ debug("Interaction observers resumed");
120
120
  for (const listener of listeners){
121
121
  listener({
122
122
  pause: false,
@@ -134,7 +134,7 @@ function createSelectionFilter() {
134
134
  return choices.filter((choice)=>regex.test(choice.title)
135
135
  );
136
136
  } catch (error) {
137
- Log.debug("Error filtering choices", error);
137
+ debug("Error filtering choices", error);
138
138
  return [];
139
139
  }
140
140
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/prompts.ts"],"sourcesContent":["import assert from 'assert';\nimport prompts, { Choice, Options, PromptObject, PromptType } from 'prompts';\n\nimport * as Log from '../log';\nimport { env } from './env';\nimport { AbortCommandError, CommandError } from './errors';\n\nexport type Question<V extends string = string> = PromptObject<V> & {\n optionsPerPage?: number;\n};\n\nexport interface ExpoChoice<T> extends Choice {\n value: T;\n}\n\nexport { PromptType };\n\ntype PromptOptions = { nonInteractiveHelp?: string } & Options;\n\nexport type NamelessQuestion = Omit<Question<'value'>, 'name' | 'type'>;\n\ntype InteractionOptions = { pause: boolean; canEscape?: boolean };\n\ntype InteractionCallback = (options: InteractionOptions) => void;\n\n/** Interaction observers for detecting when keystroke tracking should pause/resume. */\nconst listeners: InteractionCallback[] = [];\n\nexport default async function prompt(\n questions: Question | Question[],\n { nonInteractiveHelp, ...options }: PromptOptions = {}\n) {\n questions = Array.isArray(questions) ? questions : [questions];\n if (env.CI && questions.length !== 0) {\n let message = `Input is required, but 'npx expo' is in non-interactive mode.\\n`;\n if (nonInteractiveHelp) {\n message += nonInteractiveHelp;\n } else {\n const question = questions[0];\n const questionMessage =\n typeof question.message === 'function'\n ? question.message(undefined, {}, question)\n : question.message;\n\n message += `Required input:\\n${(questionMessage || '').trim().replace(/^/gm, '> ')}`;\n }\n throw new CommandError('NON_INTERACTIVE', message);\n }\n\n pauseInteractions();\n try {\n const results = await prompts(questions, {\n onCancel() {\n throw new AbortCommandError();\n },\n ...options,\n });\n\n return results;\n } finally {\n resumeInteractions();\n }\n}\n\n/**\n * Create a standard yes/no confirmation that can be cancelled.\n *\n * @param questions\n * @param options\n */\nexport async function confirmAsync(\n questions: NamelessQuestion,\n options?: PromptOptions\n): Promise<boolean> {\n const { value } = await prompt(\n {\n initial: true,\n ...questions,\n name: 'value',\n type: 'confirm',\n },\n options\n );\n return value ?? null;\n}\n\n/** Select an option from a list of options. */\nexport async function selectAsync<T>(\n message: string,\n choices: ExpoChoice<T>[],\n options?: PromptOptions\n): Promise<T> {\n const { value } = await prompt(\n {\n message,\n choices,\n name: 'value',\n type: 'select',\n },\n options\n );\n return value ?? null;\n}\n\nexport const promptAsync = prompt;\n\n/** Used to pause/resume interaction observers while prompting (made for TerminalUI). */\nexport function addInteractionListener(callback: InteractionCallback) {\n listeners.push(callback);\n}\n\nexport function removeInteractionListener(callback: InteractionCallback) {\n const listenerIndex = listeners.findIndex((_callback) => _callback === callback);\n assert(\n listenerIndex >= 0,\n 'removeInteractionListener(): cannot remove an unregistered event listener.'\n );\n listeners.splice(listenerIndex, 1);\n}\n\n/** Notify all listeners that keypress observations must pause. */\nexport function pauseInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n Log.debug('Interaction observers paused');\n for (const listener of listeners) {\n listener({ pause: true, ...options });\n }\n}\n\n/** Notify all listeners that keypress observations can start.. */\nexport function resumeInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n Log.debug('Interaction observers resumed');\n for (const listener of listeners) {\n listener({ pause: false, ...options });\n }\n}\n\nexport function createSelectionFilter(): (input: any, choices: Choice[]) => Promise<any> {\n function escapeRegex(string: string) {\n return string.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n return async (input: any, choices: Choice[]) => {\n try {\n const regex = new RegExp(escapeRegex(input), 'i');\n return choices.filter((choice: any) => regex.test(choice.title));\n } catch (error: any) {\n Log.debug('Error filtering choices', error);\n return [];\n }\n };\n}\n"],"names":["PromptType","prompt","confirmAsync","selectAsync","addInteractionListener","removeInteractionListener","pauseInteractions","resumeInteractions","createSelectionFilter","Log","questions","nonInteractiveHelp","options","Array","isArray","env","CI","length","message","question","questionMessage","undefined","trim","replace","CommandError","results","prompts","onCancel","AbortCommandError","listeners","value","initial","name","type","choices","promptAsync","callback","push","listenerIndex","findIndex","_callback","assert","splice","debug","listener","pause","escapeRegex","string","input","regex","RegExp","filter","choice","test","title","error"],"mappings":"AAAA;;;;+BAeSA,YAAU;;;eAAVA,QAAU,WAAA;;;kBAaWC,MAAM;QA0CdC,YAAY,GAAZA,YAAY;QAiBZC,WAAW,GAAXA,WAAW;QAoBjBC,sBAAsB,GAAtBA,sBAAsB;QAItBC,yBAAyB,GAAzBA,yBAAyB;QAUzBC,iBAAiB,GAAjBA,iBAAiB;QAQjBC,kBAAkB,GAAlBA,kBAAkB;QAOlBC,qBAAqB,GAArBA,qBAAqB;;AAxIlB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACwC,IAAA,QAAS,mCAAT,SAAS,EAAA;AAEhEC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACK,IAAA,IAAO,WAAP,OAAO,CAAA;AACqB,IAAA,OAAU,WAAV,UAAU,CAAA;AAuB3C,eAAeR,MAAM,CAClCS,SAAgC,EAChC,EAAEC,kBAAkB,CAAA,EAAE,GAAGC,OAAO,EAAiB,GAAG,EAAE,EACtD;IACAF,SAAS,GAAGG,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GAAGA,SAAS,GAAG;QAACA,SAAS;KAAC,CAAC;IAC/D,IAAIK,IAAG,IAAA,CAACC,EAAE,IAAIN,SAAS,CAACO,MAAM,KAAK,CAAC,EAAE;QACpC,IAAIC,OAAO,GAAG,CAAC,+DAA+D,CAAC,AAAC;QAChF,IAA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C,OAAO;SAAE,CAAC,CAAC;KACxC;CACF;AAEM,SAASJ,qBAAqB,GAAoD;IACvF,SAASsC,WAAW,CAACC,MAAc,EAAE;QACnC,OAAOA,MAAM,CAACxB,OAAO,0BAA0B,MAAM,CAAC,CAAC;KACxD;IAED,OAAO,OAAOyB,KAAU,EAAEd,OAAiB,GAAK;QAC9C,IAAI;YACF,MAAMe,KAAK,GAAG,IAAIC,MAAM,CAACJ,WAAW,CAACE,KAAK,CAAC,EAAE,GAAG,CAAC,AAAC;YAClD,OAAOd,OAAO,CAACiB,MAAM,CAAC,CAACC,MAAW,GAAKH,KAAK,CAACI,IAAI,CAACD,MAAM,CAACE,KAAK,CAAC;YAAA,CAAC,CAAC;SAClE,CAAC,OAAOC,KAAK,EAAO;YACnB9C,GAAG,CAACkC,KAAK,CAAC,yBAAyB,EAAEY,KAAK,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC;SACX;KACF,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../src/utils/prompts.ts"],"sourcesContent":["import assert from 'assert';\nimport prompts, { Choice, Options, PromptObject, PromptType } from 'prompts';\n\nimport { env } from './env';\nimport { AbortCommandError, CommandError } from './errors';\n\nconst debug = require('debug')('expo:utils:prompts') as typeof console.log;\n\nexport type Question<V extends string = string> = PromptObject<V> & {\n optionsPerPage?: number;\n};\n\nexport interface ExpoChoice<T> extends Choice {\n value: T;\n}\n\nexport { PromptType };\n\ntype PromptOptions = { nonInteractiveHelp?: string } & Options;\n\nexport type NamelessQuestion = Omit<Question<'value'>, 'name' | 'type'>;\n\ntype InteractionOptions = { pause: boolean; canEscape?: boolean };\n\ntype InteractionCallback = (options: InteractionOptions) => void;\n\n/** Interaction observers for detecting when keystroke tracking should pause/resume. */\nconst listeners: InteractionCallback[] = [];\n\nexport default async function prompt(\n questions: Question | Question[],\n { nonInteractiveHelp, ...options }: PromptOptions = {}\n) {\n questions = Array.isArray(questions) ? questions : [questions];\n if (env.CI && questions.length !== 0) {\n let message = `Input is required, but 'npx expo' is in non-interactive mode.\\n`;\n if (nonInteractiveHelp) {\n message += nonInteractiveHelp;\n } else {\n const question = questions[0];\n const questionMessage =\n typeof question.message === 'function'\n ? question.message(undefined, {}, question)\n : question.message;\n\n message += `Required input:\\n${(questionMessage || '').trim().replace(/^/gm, '> ')}`;\n }\n throw new CommandError('NON_INTERACTIVE', message);\n }\n\n pauseInteractions();\n try {\n const results = await prompts(questions, {\n onCancel() {\n throw new AbortCommandError();\n },\n ...options,\n });\n\n return results;\n } finally {\n resumeInteractions();\n }\n}\n\n/**\n * Create a standard yes/no confirmation that can be cancelled.\n *\n * @param questions\n * @param options\n */\nexport async function confirmAsync(\n questions: NamelessQuestion,\n options?: PromptOptions\n): Promise<boolean> {\n const { value } = await prompt(\n {\n initial: true,\n ...questions,\n name: 'value',\n type: 'confirm',\n },\n options\n );\n return value ?? null;\n}\n\n/** Select an option from a list of options. */\nexport async function selectAsync<T>(\n message: string,\n choices: ExpoChoice<T>[],\n options?: PromptOptions\n): Promise<T> {\n const { value } = await prompt(\n {\n message,\n choices,\n name: 'value',\n type: 'select',\n },\n options\n );\n return value ?? null;\n}\n\nexport const promptAsync = prompt;\n\n/** Used to pause/resume interaction observers while prompting (made for TerminalUI). */\nexport function addInteractionListener(callback: InteractionCallback) {\n listeners.push(callback);\n}\n\nexport function removeInteractionListener(callback: InteractionCallback) {\n const listenerIndex = listeners.findIndex((_callback) => _callback === callback);\n assert(\n listenerIndex >= 0,\n 'removeInteractionListener(): cannot remove an unregistered event listener.'\n );\n listeners.splice(listenerIndex, 1);\n}\n\n/** Notify all listeners that keypress observations must pause. */\nexport function pauseInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n debug('Interaction observers paused');\n for (const listener of listeners) {\n listener({ pause: true, ...options });\n }\n}\n\n/** Notify all listeners that keypress observations can start.. */\nexport function resumeInteractions(options: Omit<InteractionOptions, 'pause'> = {}) {\n debug('Interaction observers resumed');\n for (const listener of listeners) {\n listener({ pause: false, ...options });\n }\n}\n\nexport function createSelectionFilter(): (input: any, choices: Choice[]) => Promise<any> {\n function escapeRegex(string: string) {\n return string.replace(/[-/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&');\n }\n\n return async (input: any, choices: Choice[]) => {\n try {\n const regex = new RegExp(escapeRegex(input), 'i');\n return choices.filter((choice: any) => regex.test(choice.title));\n } catch (error: any) {\n debug('Error filtering choices', error);\n return [];\n }\n };\n}\n"],"names":["PromptType","prompt","confirmAsync","selectAsync","addInteractionListener","removeInteractionListener","pauseInteractions","resumeInteractions","createSelectionFilter","questions","nonInteractiveHelp","options","Array","isArray","env","CI","length","message","question","questionMessage","undefined","trim","replace","CommandError","results","prompts","onCancel","AbortCommandError","debug","require","listeners","value","initial","name","type","choices","promptAsync","callback","push","listenerIndex","findIndex","_callback","assert","splice","listener","pause","escapeRegex","string","input","regex","RegExp","filter","choice","test","title","error"],"mappings":"AAAA;;;;+BAgBSA,YAAU;;;eAAVA,QAAU,WAAA;;;kBAaWC,MAAM;QA0CdC,YAAY,GAAZA,YAAY;QAiBZC,WAAW,GAAXA,WAAW;QAoBjBC,sBAAsB,GAAtBA,sBAAsB;QAItBC,yBAAyB,GAAzBA,yBAAyB;QAUzBC,iBAAiB,GAAjBA,iBAAiB;QAQjBC,kBAAkB,GAAlBA,kBAAkB;QAOlBC,qBAAqB,GAArBA,qBAAqB;;AAzIlB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACwC,IAAA,QAAS,mCAAT,SAAS,EAAA;AAExD,IAAA,IAAO,WAAP,OAAO,CAAA;AACqB,IAAA,OAAU,WAAV,UAAU,CAAA;AAyB3C,eAAeP,MAAM,CAClCQ,SAAgC,EAChC,EAAEC,kBAAkB,CAAA,EAAE,GAAGC,OAAO,EAAiB,GAAG,EAAE,EACtD;IACAF,SAAS,GAAGG,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GAAGA,SAAS,GAAG;QAACA,SAAS;KAAC,CAAC;IAC/D,IAAIK,IAAG,IAAA,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AACI,OAA0C,GAAG,EAAE,EAAE;IAClFiB,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACvC,KAAK,MAAMgB,QAAQ,IAAId,SAAS,CAAE;QAChCc,QAAQ,CAAC;YAAEC,KAAK,EAAE,KAAK;YAAE,GAAGlC,OAAO;SAAE,CAAC,CAAC;KACxC;CACF;AAEM,SAASH,qBAAqB,GAAoD;IACvF,SAASsC,WAAW,CAACC,MAAc,EAAE;QACnC,OAAOA,MAAM,CAACzB,OAAO,0BAA0B,MAAM,CAAC,CAAC;KACxD;IAED,OAAO,OAAO0B,KAAU,EAAEb,OAAiB,GAAK;QAC9C,IAAI;YACF,MAAMc,KAAK,GAAG,IAAIC,MAAM,CAACJ,WAAW,CAACE,KAAK,CAAC,EAAE,GAAG,CAAC,AAAC;YAClD,OAAOb,OAAO,CAACgB,MAAM,CAAC,CAACC,MAAW,GAAKH,KAAK,CAACI,IAAI,CAACD,MAAM,CAACE,KAAK,CAAC;YAAA,CAAC,CAAC;SAClE,CAAC,OAAOC,KAAK,EAAO;YACnB3B,KAAK,CAAC,yBAAyB,EAAE2B,KAAK,CAAC,CAAC;YACxC,OAAO,EAAE,CAAC;SACX;KACF,CAAC;CACH"}
@@ -32,9 +32,11 @@ function _interopRequireWildcard(obj) {
32
32
  return newObj;
33
33
  }
34
34
  }
35
+ const debug = require("debug")("expo:utils:tar");
35
36
  async function extractAsync(input, output) {
36
37
  try {
37
38
  if (process.platform !== "win32") {
39
+ debug(`Extracting ${input} to ${output}`);
38
40
  await (0, _spawnAsync).default("tar", [
39
41
  "-xf",
40
42
  input,
@@ -48,6 +50,7 @@ async function extractAsync(input, output) {
48
50
  } catch (error) {
49
51
  Log.warn(`Failed to extract tar using native tools, falling back on JS tar module. ${error.message}`);
50
52
  }
53
+ debug(`Extracting ${input} to ${output} using JS tar module`);
51
54
  // tar node module has previously had problems with big files, and seems to
52
55
  // be slower, so only use it as a backup.
53
56
  await _tar.default.extract({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/tar.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport tar from 'tar';\n\nimport * as Log from '../log';\n\n/** Extract a tar using built-in tools if available and falling back on Node.js. */\nexport async function extractAsync(input: string, output: string): Promise<void> {\n try {\n if (process.platform !== 'win32') {\n await spawnAsync('tar', ['-xf', input, '-C', output], {\n stdio: 'inherit',\n });\n return;\n }\n } catch (error: any) {\n Log.warn(\n `Failed to extract tar using native tools, falling back on JS tar module. ${error.message}`\n );\n }\n // tar node module has previously had problems with big files, and seems to\n // be slower, so only use it as a backup.\n await tar.extract({ file: input, cwd: output });\n}\n"],"names":["extractAsync","Log","input","output","process","platform","spawnAsync","stdio","error","warn","message","tar","extract","file","cwd"],"mappings":"AAAA;;;;QAMsBA,YAAY,GAAZA,YAAY;AANX,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AAC1B,IAAA,IAAK,kCAAL,KAAK,EAAA;AAETC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGR,eAAeD,YAAY,CAACE,KAAa,EAAEC,MAAc,EAAiB;IAC/E,IAAI;QACF,IAAIC,OAAO,CAACC,QAAQ,KAAK,OAAO,EAAE;YAChC,MAAMC,CAAAA,GAAAA,WAAU,AAEd,CAAA,QAFc,CAAC,KAAK,EAAE;gBAAC,KAAK;gBAAEJ,KAAK;gBAAE,IAAI;gBAAEC,MAAM;aAAC,EAAE;gBACpDI,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;YACH,OAAO;SACR;KACF,CAAC,OAAOC,KAAK,EAAO;QACnBP,GAAG,CAACQ,IAAI,CACN,CAAC,yEAAyE,EAAED,KAAK,CAACE,OAAO,CAAC,CAAC,CAC5F,CAAC;KACH;IACD,2EAA2E;IAC3E,yCAAyC;IACzC,MAAMC,IAAG,QAAA,CAACC,OAAO,CAAC;QAAEC,IAAI,EAAEX,KAAK;QAAEY,GAAG,EAAEX,MAAM;KAAE,CAAC,CAAC;CACjD"}
1
+ {"version":3,"sources":["../../../src/utils/tar.ts"],"sourcesContent":["import spawnAsync from '@expo/spawn-async';\nimport tar from 'tar';\n\nimport * as Log from '../log';\n\nconst debug = require('debug')('expo:utils:tar') as typeof console.log;\n\n/** Extract a tar using built-in tools if available and falling back on Node.js. */\nexport async function extractAsync(input: string, output: string): Promise<void> {\n try {\n if (process.platform !== 'win32') {\n debug(`Extracting ${input} to ${output}`);\n await spawnAsync('tar', ['-xf', input, '-C', output], {\n stdio: 'inherit',\n });\n return;\n }\n } catch (error: any) {\n Log.warn(\n `Failed to extract tar using native tools, falling back on JS tar module. ${error.message}`\n );\n }\n debug(`Extracting ${input} to ${output} using JS tar module`);\n // tar node module has previously had problems with big files, and seems to\n // be slower, so only use it as a backup.\n await tar.extract({ file: input, cwd: output });\n}\n"],"names":["extractAsync","Log","debug","require","input","output","process","platform","spawnAsync","stdio","error","warn","message","tar","extract","file","cwd"],"mappings":"AAAA;;;;QAQsBA,YAAY,GAAZA,YAAY;AARX,IAAA,WAAmB,kCAAnB,mBAAmB,EAAA;AAC1B,IAAA,IAAK,kCAAL,KAAK,EAAA;AAETC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEf,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,AAAsB,AAAC;AAGhE,eAAeH,YAAY,CAACI,KAAa,EAAEC,MAAc,EAAiB;IAC/E,IAAI;QACF,IAAIC,OAAO,CAACC,QAAQ,KAAK,OAAO,EAAE;YAChCL,KAAK,CAAC,CAAC,WAAW,EAAEE,KAAK,CAAC,IAAI,EAAEC,MAAM,CAAC,CAAC,CAAC,CAAC;YAC1C,MAAMG,CAAAA,GAAAA,WAAU,AAEd,CAAA,QAFc,CAAC,KAAK,EAAE;gBAAC,KAAK;gBAAEJ,KAAK;gBAAE,IAAI;gBAAEC,MAAM;aAAC,EAAE;gBACpDI,KAAK,EAAE,SAAS;aACjB,CAAC,CAAC;YACH,OAAO;SACR;KACF,CAAC,OAAOC,KAAK,EAAO;QACnBT,GAAG,CAACU,IAAI,CACN,CAAC,yEAAyE,EAAED,KAAK,CAACE,OAAO,CAAC,CAAC,CAC5F,CAAC;KACH;IACDV,KAAK,CAAC,CAAC,WAAW,EAAEE,KAAK,CAAC,IAAI,EAAEC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC9D,2EAA2E;IAC3E,yCAAyC;IACzC,MAAMQ,IAAG,QAAA,CAACC,OAAO,CAAC;QAAEC,IAAI,EAAEX,KAAK;QAAEY,GAAG,EAAEX,MAAM;KAAE,CAAC,CAAC;CACjD"}
@@ -18,6 +18,7 @@ function _interopRequireDefault(obj) {
18
18
  default: obj
19
19
  };
20
20
  }
21
+ const debug = require("debug")("expo:utils:validateApplicationId");
21
22
  const IOS_BUNDLE_ID_REGEX = /^[a-zA-Z0-9-.]+$/;
22
23
  const ANDROID_PACKAGE_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*(\.[a-zA-Z][a-zA-Z0-9_]*)+$/;
23
24
  function validateBundleId(value) {
@@ -40,11 +41,13 @@ async function getBundleIdWarningAsync(bundleId) {
40
41
  return cachedBundleIdResults[bundleId];
41
42
  }
42
43
  if (!await (0, _url).isUrlAvailableAsync("itunes.apple.com")) {
44
+ debug(`Couldn't connect to iTunes Store to check bundle ID ${bundleId}. itunes.apple.com may be down.`);
43
45
  // If no network, simply skip the warnings since they'll just lead to more confusion.
44
46
  return null;
45
47
  }
46
48
  const url = `http://itunes.apple.com/lookup?bundleId=${bundleId}`;
47
49
  try {
50
+ debug(`Checking iOS bundle ID '${bundleId}' at: ${url}`);
48
51
  const response = await (0, _nodeFetch).default(url);
49
52
  const json = await response.json();
50
53
  if (json.resultCount > 0) {
@@ -53,7 +56,8 @@ async function getBundleIdWarningAsync(bundleId) {
53
56
  cachedBundleIdResults[bundleId] = message;
54
57
  return message;
55
58
  }
56
- } catch {
59
+ } catch (error) {
60
+ debug(`Error checking bundle ID ${bundleId}: ${error.message}`);
57
61
  // Error fetching itunes data.
58
62
  }
59
63
  return null;
@@ -64,11 +68,13 @@ async function getPackageNameWarningAsync(packageName) {
64
68
  return cachedPackageNameResults[packageName];
65
69
  }
66
70
  if (!await (0, _url).isUrlAvailableAsync("play.google.com")) {
71
+ debug(`Couldn't connect to Play Store to check package name ${packageName}. play.google.com may be down.`);
67
72
  // If no network, simply skip the warnings since they'll just lead to more confusion.
68
73
  return null;
69
74
  }
70
75
  const url = `https://play.google.com/store/apps/details?id=${packageName}`;
71
76
  try {
77
+ debug(`Checking Android package name '${packageName}' at: ${url}`);
72
78
  const response = await (0, _nodeFetch).default(url);
73
79
  // If the page exists, then warn the user.
74
80
  if (response.status === 200) {
@@ -78,7 +84,8 @@ async function getPackageNameWarningAsync(packageName) {
78
84
  cachedPackageNameResults[packageName] = message;
79
85
  return message;
80
86
  }
81
- } catch {
87
+ } catch (error) {
88
+ debug(`Error checking package name ${packageName}: ${error.message}`);
82
89
  // Error fetching play store data or the page doesn't exist.
83
90
  }
84
91
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/utils/validateApplicationId.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\nimport fetch from 'node-fetch';\n\nimport { learnMore } from './link';\nimport { isUrlAvailableAsync } from './url';\n\nconst IOS_BUNDLE_ID_REGEX = /^[a-zA-Z0-9-.]+$/;\nconst ANDROID_PACKAGE_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$/;\n\n/** Validate an iOS bundle identifier. */\nexport function validateBundleId(value: string): boolean {\n return IOS_BUNDLE_ID_REGEX.test(value);\n}\n\n/** Validate an Android package name. */\nexport function validatePackage(value: string): boolean {\n return ANDROID_PACKAGE_REGEX.test(value);\n}\n\nexport function assertValidBundleId(value: string) {\n assert.match(\n value,\n IOS_BUNDLE_ID_REGEX,\n `The ios.bundleIdentifier defined in your Expo config is not formatted properly. Only alphanumeric characters, '.', '-', and '_' are allowed, and each '.' must be followed by a letter.`\n );\n}\n\nexport function assertValidPackage(value: string) {\n assert.match(\n value,\n ANDROID_PACKAGE_REGEX,\n `Invalid format of Android package name. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.`\n );\n}\n\nconst cachedBundleIdResults: Record<string, string> = {};\nconst cachedPackageNameResults: Record<string, string> = {};\n\n/** Returns a warning message if an iOS bundle identifier is potentially already in use. */\nexport async function getBundleIdWarningAsync(bundleId: string): Promise<string | null> {\n // Prevent fetching for the same ID multiple times.\n if (cachedBundleIdResults[bundleId]) {\n return cachedBundleIdResults[bundleId];\n }\n\n if (!(await isUrlAvailableAsync('itunes.apple.com'))) {\n // If no network, simply skip the warnings since they'll just lead to more confusion.\n return null;\n }\n\n const url = `http://itunes.apple.com/lookup?bundleId=${bundleId}`;\n try {\n const response = await fetch(url);\n const json = await response.json();\n if (json.resultCount > 0) {\n const firstApp = json.results[0];\n const message = formatInUseWarning(firstApp.trackName, firstApp.sellerName, bundleId);\n cachedBundleIdResults[bundleId] = message;\n return message;\n }\n } catch {\n // Error fetching itunes data.\n }\n return null;\n}\n\n/** Returns a warning message if an Android package name is potentially already in use. */\nexport async function getPackageNameWarningAsync(packageName: string): Promise<string | null> {\n // Prevent fetching for the same ID multiple times.\n if (cachedPackageNameResults[packageName]) {\n return cachedPackageNameResults[packageName];\n }\n\n if (!(await isUrlAvailableAsync('play.google.com'))) {\n // If no network, simply skip the warnings since they'll just lead to more confusion.\n return null;\n }\n\n const url = `https://play.google.com/store/apps/details?id=${packageName}`;\n try {\n const response = await fetch(url);\n // If the page exists, then warn the user.\n if (response.status === 200) {\n // There is no JSON API for the Play Store so we can't concisely\n // locate the app name and developer to match the iOS warning.\n const message = `⚠️ The package ${chalk.bold(packageName)} is already in use. ${chalk.dim(\n learnMore(url)\n )}`;\n cachedPackageNameResults[packageName] = message;\n return message;\n }\n } catch {\n // Error fetching play store data or the page doesn't exist.\n }\n return null;\n}\n\nfunction formatInUseWarning(appName: string, author: string, id: string): string {\n return `⚠️ The app ${chalk.bold(appName)} by ${chalk.italic(\n author\n )} is already using ${chalk.bold(id)}`;\n}\n"],"names":["validateBundleId","validatePackage","assertValidBundleId","assertValidPackage","getBundleIdWarningAsync","getPackageNameWarningAsync","IOS_BUNDLE_ID_REGEX","ANDROID_PACKAGE_REGEX","value","test","assert","match","cachedBundleIdResults","cachedPackageNameResults","bundleId","isUrlAvailableAsync","url","response","fetch","json","resultCount","firstApp","results","message","formatInUseWarning","trackName","sellerName","packageName","status","chalk","bold","dim","learnMore","appName","author","id","italic"],"mappings":"AAAA;;;;QAWgBA,gBAAgB,GAAhBA,gBAAgB;QAKhBC,eAAe,GAAfA,eAAe;QAIfC,mBAAmB,GAAnBA,mBAAmB;QAQnBC,kBAAkB,GAAlBA,kBAAkB;QAYZC,uBAAuB,GAAvBA,uBAAuB;QA4BvBC,0BAA0B,GAA1BA,0BAA0B;AApE7B,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AACP,IAAA,UAAY,kCAAZ,YAAY,EAAA;AAEJ,IAAA,KAAQ,WAAR,QAAQ,CAAA;AACE,IAAA,IAAO,WAAP,OAAO,CAAA;;;;;;AAE3C,MAAMC,mBAAmB,qBAAqB,AAAC;AAC/C,MAAMC,qBAAqB,sDAAsD,AAAC;AAG3E,SAASP,gBAAgB,CAACQ,KAAa,EAAW;IACvD,OAAOF,mBAAmB,CAACG,IAAI,CAACD,KAAK,CAAC,CAAC;CACxC;AAGM,SAASP,eAAe,CAACO,KAAa,EAAW;IACtD,OAAOD,qBAAqB,CAACE,IAAI,CAACD,KAAK,CAAC,CAAC;CAC1C;AAEM,SAASN,mBAAmB,CAACM,KAAa,EAAE;IACjDE,OAAM,QAAA,CAACC,KAAK,CACVH,KAAK,EACLF,mBAAmB,EACnB,CAAC,uLAAuL,CAAC,CAC1L,CAAC;CACH;AAEM,SAASH,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C,EAAE;QACzC,OAAOd,wBAAwB,CAACc,WAAW,CAAC,CAAC;KAC9C;IAED,IAAI,CAAE,MAAMZ,CAAAA,GAAAA,IAAmB,AAAmB,CAAA,oBAAnB,CAAC,iBAAiB,CAAC,AAAC,EAAE;QACnD,qFAAqF;QACrF,OAAO,IAAI,CAAC;KACb;IAED,MAAMC,GAAG,GAAG,CAAC,8CAA8C,EAAEW,WAAW,CAAC,CAAC,AAAC;IAC3E,IAAI;QACF,MAAMV,QAAQ,GAAG,MAAMC,CAAAA,GAAAA,UAAK,AAAK,CAAA,QAAL,CAACF,GAAG,CAAC,AAAC;QAClC,0CAA0C;QAC1C,IAAIC,QAAQ,CAACW,MAAM,KAAK,GAAG,EAAE;YAC3B,gEAAgE;YAChE,8DAA8D;YAC9D,MAAML,OAAO,GAAG,CAAC,oBAAgB,EAAMM,MAAK,QAAA,CAACC,IAAI,CAACH,WAAW,CAAC,CAAC,oBAAoB,EAAEE,MAAK,QAAA,CAACE,GAAG,CACxFC,CAAJA,GAAAA,KAAS,AAAK,CAAA,UAAL,CAAChB,GAAG,CAAC,CACf,CAAC,CAAC,AAAC;YACJH,wBAAwB,CAACc,WAAW,CAAC,GAAGJ,OAAO,CAAC;YAChD,OAAOA,OAAO,CAAC;SAChB;KACF,CAAC,OAAM;IACN,4DAA4D;KAC7D;IACD,OAAO,IAAI,CAAC;CACb;AAED,SAASC,kBAAkB,CAACS,OAAe,EAAEC,MAAc,EAAEC,EAAU,EAAU;IAC/E,OAAO,CAAC,gBAAY,EAAEN,MAAK,QAAA,CAACC,IAAI,CAACG,OAAO,CAAC,CAAC,IAAI,EAAEJ,MAAK,QAAA,CAACO,MAAM,CAC1DF,MAAM,CACP,CAAC,kBAAkB,EAAEL,MAAK,QAAA,CAACC,IAAI,CAACK,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC"}
1
+ {"version":3,"sources":["../../../src/utils/validateApplicationId.ts"],"sourcesContent":["import assert from 'assert';\nimport chalk from 'chalk';\nimport fetch from 'node-fetch';\n\nimport { learnMore } from './link';\nimport { isUrlAvailableAsync } from './url';\n\nconst debug = require('debug')('expo:utils:validateApplicationId') as typeof console.log;\n\nconst IOS_BUNDLE_ID_REGEX = /^[a-zA-Z0-9-.]+$/;\nconst ANDROID_PACKAGE_REGEX = /^[a-zA-Z][a-zA-Z0-9_]*(\\.[a-zA-Z][a-zA-Z0-9_]*)+$/;\n\n/** Validate an iOS bundle identifier. */\nexport function validateBundleId(value: string): boolean {\n return IOS_BUNDLE_ID_REGEX.test(value);\n}\n\n/** Validate an Android package name. */\nexport function validatePackage(value: string): boolean {\n return ANDROID_PACKAGE_REGEX.test(value);\n}\n\nexport function assertValidBundleId(value: string) {\n assert.match(\n value,\n IOS_BUNDLE_ID_REGEX,\n `The ios.bundleIdentifier defined in your Expo config is not formatted properly. Only alphanumeric characters, '.', '-', and '_' are allowed, and each '.' must be followed by a letter.`\n );\n}\n\nexport function assertValidPackage(value: string) {\n assert.match(\n value,\n ANDROID_PACKAGE_REGEX,\n `Invalid format of Android package name. Only alphanumeric characters, '.' and '_' are allowed, and each '.' must be followed by a letter.`\n );\n}\n\nconst cachedBundleIdResults: Record<string, string> = {};\nconst cachedPackageNameResults: Record<string, string> = {};\n\n/** Returns a warning message if an iOS bundle identifier is potentially already in use. */\nexport async function getBundleIdWarningAsync(bundleId: string): Promise<string | null> {\n // Prevent fetching for the same ID multiple times.\n if (cachedBundleIdResults[bundleId]) {\n return cachedBundleIdResults[bundleId];\n }\n\n if (!(await isUrlAvailableAsync('itunes.apple.com'))) {\n debug(\n `Couldn't connect to iTunes Store to check bundle ID ${bundleId}. itunes.apple.com may be down.`\n );\n // If no network, simply skip the warnings since they'll just lead to more confusion.\n return null;\n }\n\n const url = `http://itunes.apple.com/lookup?bundleId=${bundleId}`;\n try {\n debug(`Checking iOS bundle ID '${bundleId}' at: ${url}`);\n const response = await fetch(url);\n const json = await response.json();\n if (json.resultCount > 0) {\n const firstApp = json.results[0];\n const message = formatInUseWarning(firstApp.trackName, firstApp.sellerName, bundleId);\n cachedBundleIdResults[bundleId] = message;\n return message;\n }\n } catch (error: any) {\n debug(`Error checking bundle ID ${bundleId}: ${error.message}`);\n // Error fetching itunes data.\n }\n return null;\n}\n\n/** Returns a warning message if an Android package name is potentially already in use. */\nexport async function getPackageNameWarningAsync(packageName: string): Promise<string | null> {\n // Prevent fetching for the same ID multiple times.\n if (cachedPackageNameResults[packageName]) {\n return cachedPackageNameResults[packageName];\n }\n\n if (!(await isUrlAvailableAsync('play.google.com'))) {\n debug(\n `Couldn't connect to Play Store to check package name ${packageName}. play.google.com may be down.`\n );\n // If no network, simply skip the warnings since they'll just lead to more confusion.\n return null;\n }\n\n const url = `https://play.google.com/store/apps/details?id=${packageName}`;\n try {\n debug(`Checking Android package name '${packageName}' at: ${url}`);\n const response = await fetch(url);\n // If the page exists, then warn the user.\n if (response.status === 200) {\n // There is no JSON API for the Play Store so we can't concisely\n // locate the app name and developer to match the iOS warning.\n const message = `⚠️ The package ${chalk.bold(packageName)} is already in use. ${chalk.dim(\n learnMore(url)\n )}`;\n cachedPackageNameResults[packageName] = message;\n return message;\n }\n } catch (error: any) {\n debug(`Error checking package name ${packageName}: ${error.message}`);\n // Error fetching play store data or the page doesn't exist.\n }\n return null;\n}\n\nfunction formatInUseWarning(appName: string, author: string, id: string): string {\n return `⚠️ The app ${chalk.bold(appName)} by ${chalk.italic(\n author\n )} is already using ${chalk.bold(id)}`;\n}\n"],"names":["validateBundleId","validatePackage","assertValidBundleId","assertValidPackage","getBundleIdWarningAsync","getPackageNameWarningAsync","debug","require","IOS_BUNDLE_ID_REGEX","ANDROID_PACKAGE_REGEX","value","test","assert","match","cachedBundleIdResults","cachedPackageNameResults","bundleId","isUrlAvailableAsync","url","response","fetch","json","resultCount","firstApp","results","message","formatInUseWarning","trackName","sellerName","error","packageName","status","chalk","bold","dim","learnMore","appName","author","id","italic"],"mappings":"AAAA;;;;QAagBA,gBAAgB,GAAhBA,gBAAgB;QAKhBC,e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AAC,IAAI,EAAEJ,MAAK,QAAA,CAACO,MAAM,CAC1DF,MAAM,CACP,CAAC,kBAAkB,EAAEL,MAAK,QAAA,CAACC,IAAI,CAACK,EAAE,CAAC,CAAC,CAAC,CAAC;CACxC"}
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.parseVariadicArguments = parseVariadicArguments;
6
+ exports.assertUnexpectedObjectKeys = assertUnexpectedObjectKeys;
7
+ var _errors = require("../utils/errors");
8
+ const debug = require("debug")("expo:utils:variadic");
9
+ function parseVariadicArguments(argv) {
10
+ const variadic = [];
11
+ const flags = {};
12
+ for (const arg of argv){
13
+ if (!arg.startsWith("-")) {
14
+ variadic.push(arg);
15
+ } else if (arg === "--") {
16
+ break;
17
+ } else {
18
+ flags[arg] = true;
19
+ }
20
+ }
21
+ // Everything after `--` that is not an option is passed to the underlying install command.
22
+ const extras = [];
23
+ const extraOperator = argv.indexOf("--");
24
+ if (extraOperator > -1 && argv.length > extraOperator + 1) {
25
+ const extraArgs = argv.slice(extraOperator + 1);
26
+ if (extraArgs.includes("--")) {
27
+ throw new _errors.CommandError("BAD_ARGS", "Unexpected multiple --");
28
+ }
29
+ extras.push(...extraArgs);
30
+ debug("Extra arguments: " + extras.join(", "));
31
+ }
32
+ debug(`Parsed arguments (variadic: %O, flags: %O, extra: %O)`, variadic, flags, extras);
33
+ return {
34
+ variadic,
35
+ flags,
36
+ extras
37
+ };
38
+ }
39
+ function assertUnexpectedObjectKeys(keys, obj) {
40
+ const unexpectedKeys = Object.keys(obj).filter((key)=>!keys.includes(key)
41
+ );
42
+ if (unexpectedKeys.length > 0) {
43
+ throw new _errors.CommandError("BAD_ARGS", `Unexpected: ${unexpectedKeys.join(", ")}`);
44
+ }
45
+ }
46
+
47
+ //# sourceMappingURL=variadic.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/utils/variadic.ts"],"sourcesContent":["import { CommandError } from '../utils/errors';\n\nconst debug = require('debug')('expo:utils:variadic') as typeof console.log;\n\n/** Given a list of CLI args, return a sorted set of args based on categories used in a complex command. */\nexport function parseVariadicArguments(argv: string[]): {\n variadic: string[];\n extras: string[];\n flags: Record<string, boolean>;\n} {\n const variadic: string[] = [];\n const flags: Record<string, boolean> = {};\n\n for (const arg of argv) {\n if (!arg.startsWith('-')) {\n variadic.push(arg);\n } else if (arg === '--') {\n break;\n } else {\n flags[arg] = true;\n }\n }\n\n // Everything after `--` that is not an option is passed to the underlying install command.\n const extras: string[] = [];\n\n const extraOperator = argv.indexOf('--');\n if (extraOperator > -1 && argv.length > extraOperator + 1) {\n const extraArgs = argv.slice(extraOperator + 1);\n if (extraArgs.includes('--')) {\n throw new CommandError('BAD_ARGS', 'Unexpected multiple --');\n }\n extras.push(...extraArgs);\n debug('Extra arguments: ' + extras.join(', '));\n }\n\n debug(`Parsed arguments (variadic: %O, flags: %O, extra: %O)`, variadic, flags, extras);\n\n return {\n variadic,\n flags,\n extras,\n };\n}\n\nexport function assertUnexpectedObjectKeys(keys: string[], obj: Record<string, any>): void {\n const unexpectedKeys = Object.keys(obj).filter((key) => !keys.includes(key));\n if (unexpectedKeys.length > 0) {\n throw new CommandError('BAD_ARGS', `Unexpected: ${unexpectedKeys.join(', ')}`);\n }\n}\n"],"names":["parseVariadicArguments","assertUnexpectedObjectKeys","debug","require","argv","variadic","flags","arg","startsWith","push","extras","extraOperator","indexOf","length","extraArgs","slice","includes","CommandError","join","keys","obj","unexpectedKeys","Object","filter","key"],"mappings":"AAAA;;;;QAKgBA,sBAAsB,GAAtBA,sBAAsB;QAwCtBC,0BAA0B,GAA1BA,0BAA0B;AA7Cb,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;AAE9C,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,qBAAqB,CAAC,AAAsB,AAAC;AAGrE,SAASH,sBAAsB,CAACI,IAAc,EAInD;IACA,MAAMC,QAAQ,GAAa,EAA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ACH,QAAQ,CAACQ,GAAG,CAAC;IAAA,CAAC,AAAC;IAC7E,IAAIH,cAAc,CAACR,MAAM,GAAG,CAAC,EAAE;QAC7B,MAAM,IAAII,OAAY,aAAA,CAAC,UAAU,EAAE,CAAC,YAAY,EAAEI,cAAc,CAACH,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;KAChF;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.1.5",
3
+ "version": "0.2.2",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -38,19 +38,19 @@
38
38
  "dependencies": {
39
39
  "@babel/runtime": "^7.14.0",
40
40
  "@expo/code-signing-certificates": "^0.0.2",
41
- "@expo/config": "~6.0.23",
42
- "@expo/config-plugins": "~4.1.4",
41
+ "@expo/config": "~7.0.0",
42
+ "@expo/config-plugins": "~5.0.0",
43
43
  "@expo/dev-server": "~0.1.110",
44
44
  "@expo/devcert": "^1.0.0",
45
45
  "@expo/json-file": "^8.2.35",
46
- "@expo/metro-config": "~0.3.16",
46
+ "@expo/metro-config": "~0.3.18",
47
47
  "@expo/osascript": "^2.0.31",
48
- "@expo/package-manager": "~0.0.52",
48
+ "@expo/package-manager": "~0.0.53",
49
49
  "@expo/plist": "^0.0.18",
50
- "@expo/prebuild-config": "~4.0.0",
50
+ "@expo/prebuild-config": "~5.0.0",
51
51
  "@expo/rudder-sdk-node": "1.1.1",
52
52
  "@expo/spawn-async": "1.5.0",
53
- "@expo/xcpretty": "^4.1.1",
53
+ "@expo/xcpretty": "^4.2.1",
54
54
  "@urql/core": "2.3.6",
55
55
  "@urql/exchange-retry": "0.3.0",
56
56
  "accepts": "^1.3.8",
@@ -60,6 +60,7 @@
60
60
  "cacache": "^15.3.0",
61
61
  "chalk": "^4.0.0",
62
62
  "ci-info": "^3.3.0",
63
+ "debug": "^4.3.4",
63
64
  "env-editor": "^0.4.1",
64
65
  "form-data": "^3.0.1",
65
66
  "freeport-async": "2.0.0",
@@ -85,6 +86,7 @@
85
86
  "requireg": "^0.2.2",
86
87
  "resolve-from": "^5.0.0",
87
88
  "semver": "^6.3.0",
89
+ "send": "^0.18.0",
88
90
  "slugify": "^1.3.4",
89
91
  "structured-headers": "^0.4.1",
90
92
  "tar": "^6.0.5",
@@ -111,6 +113,7 @@
111
113
  "@tsconfig/node14": "^1.0.1",
112
114
  "@types/accepts": "^1.3.5",
113
115
  "@types/cacache": "^15.0.1",
116
+ "@types/debug": "^4.1.7",
114
117
  "@types/form-data": "^2.2.0",
115
118
  "@types/js-yaml": "^3.12.2",
116
119
  "@types/metro": "~0.66.1",
@@ -119,6 +122,7 @@
119
122
  "@types/npm-package-arg": "^6.1.0",
120
123
  "@types/progress": "^2.0.5",
121
124
  "@types/prompts": "^2.0.6",
125
+ "@types/send": "^0.17.1",
122
126
  "@types/tar": "^6.1.1",
123
127
  "@types/text-table": "^0.2.1",
124
128
  "@types/url-join": "^4.0.0",
@@ -132,5 +136,6 @@
132
136
  "nullthrows": "^1.1.1",
133
137
  "structured-headers": "^0.4.1",
134
138
  "taskr": "1.1.0"
135
- }
139
+ },
140
+ "gitHead": "5d900179d047d9f4d89c0b9953b7121a1f1df8a2"
136
141
  }
@@ -0,0 +1,6 @@
1
+ module.exports = function (api) {
2
+ api.cache(true);
3
+ return {
4
+ presets: ['babel-preset-expo'],
5
+ };
6
+ };
@@ -0,0 +1,117 @@
1
+ <!DOCTYPE html>
2
+ <html lang="%LANG_ISO_CODE%">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta httpEquiv="X-UA-Compatible" content="IE=edge" />
6
+ <!--
7
+ This viewport works for phones with notches.
8
+ It's optimized for gestures by disabling global zoom.
9
+ -->
10
+ <meta
11
+ name="viewport"
12
+ content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1.00001, viewport-fit=cover"
13
+ />
14
+ <title>%WEB_TITLE%</title>
15
+ <style>
16
+ /**
17
+ * Extend the react-native-web reset:
18
+ * https://github.com/necolas/react-native-web/blob/master/packages/react-native-web/src/exports/StyleSheet/initialRules.js
19
+ */
20
+ html,
21
+ body,
22
+ #root {
23
+ width: 100%;
24
+ /* To smooth any scrolling behavior */
25
+ -webkit-overflow-scrolling: touch;
26
+ margin: 0px;
27
+ padding: 0px;
28
+ /* Allows content to fill the viewport and go beyond the bottom */
29
+ min-height: 100%;
30
+ }
31
+ #root {
32
+ flex-shrink: 0;
33
+ flex-basis: auto;
34
+ flex-grow: 1;
35
+ display: flex;
36
+ flex: 1;
37
+ }
38
+
39
+ html {
40
+ scroll-behavior: smooth;
41
+ /* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */
42
+ -webkit-text-size-adjust: 100%;
43
+ height: calc(100% + env(safe-area-inset-top));
44
+ }
45
+
46
+ body {
47
+ display: flex;
48
+ /* Allows you to scroll below the viewport; default value is visible */
49
+ overflow-y: auto;
50
+ overscroll-behavior-y: none;
51
+ text-rendering: optimizeLegibility;
52
+ -webkit-font-smoothing: antialiased;
53
+ -moz-osx-font-smoothing: grayscale;
54
+ -ms-overflow-style: scrollbar;
55
+ }
56
+ /* Enable for apps that support dark-theme */
57
+ /*@media (prefers-color-scheme: dark) {
58
+ body {
59
+ background-color: black;
60
+ }
61
+ }*/
62
+ </style>
63
+ </head>
64
+
65
+ <body>
66
+ <!--
67
+ A generic no script element with a reload button and a message.
68
+ Feel free to customize this however you'd like.
69
+ -->
70
+ <noscript>
71
+ <form
72
+ action=""
73
+ style="
74
+ background-color: #fff;
75
+ position: fixed;
76
+ top: 0;
77
+ left: 0;
78
+ right: 0;
79
+ bottom: 0;
80
+ z-index: 9999;
81
+ "
82
+ >
83
+ <div
84
+ style="
85
+ font-size: 18px;
86
+ font-family: Helvetica, sans-serif;
87
+ line-height: 24px;
88
+ margin: 10%;
89
+ width: 80%;
90
+ "
91
+ >
92
+ <p>Oh no! It looks like JavaScript is not enabled in your browser.</p>
93
+ <p style="margin: 20px 0;">
94
+ <button
95
+ type="submit"
96
+ style="
97
+ background-color: #4630eb;
98
+ border-radius: 100px;
99
+ border: none;
100
+ box-shadow: none;
101
+ color: #fff;
102
+ cursor: pointer;
103
+ font-weight: bold;
104
+ line-height: 20px;
105
+ padding: 6px 16px;
106
+ "
107
+ >
108
+ Reload
109
+ </button>
110
+ </p>
111
+ </div>
112
+ </form>
113
+ </noscript>
114
+ <!-- The root element for your Expo app. -->
115
+ <div id="root"></div>
116
+ </body>
117
+ </html>
@@ -0,0 +1,4 @@
1
+ // Learn more https://docs.expo.io/guides/customizing-metro
2
+ const { getDefaultConfig } = require('expo/metro-config');
3
+
4
+ module.exports = getDefaultConfig(__dirname);
@@ -0,0 +1,13 @@
1
+ {
2
+ "headers": [
3
+ {
4
+ "source": "static/**/*.js",
5
+ "headers": [
6
+ {
7
+ "key": "Cache-Control",
8
+ "value": "public, max-age=31536000, immutable"
9
+ }
10
+ ]
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,7 @@
1
+ const createExpoWebpackConfigAsync = require('@expo/webpack-config');
2
+
3
+ module.exports = async function (env, argv) {
4
+ const config = await createExpoWebpackConfigAsync(env, argv);
5
+ // Customize the config before returning it.
6
+ return config;
7
+ };