@expo/cli 0.1.0 → 0.1.1

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 (113) hide show
  1. package/build/bin/cli +38 -11
  2. package/build/bin/cli.map +1 -1
  3. package/build/src/config/index.js +7 -17
  4. package/build/src/config/index.js.map +1 -1
  5. package/build/src/export/createBundles.js +62 -0
  6. package/build/src/export/createBundles.js.map +1 -0
  7. package/build/src/export/createMetadataJson.js +36 -0
  8. package/build/src/export/createMetadataJson.js.map +1 -0
  9. package/build/src/export/exportApp.js +102 -0
  10. package/build/src/export/exportApp.js.map +1 -0
  11. package/build/src/export/exportAssets.js +106 -0
  12. package/build/src/export/exportAssets.js.map +1 -0
  13. package/build/src/export/exportAsync.js +49 -0
  14. package/build/src/export/exportAsync.js.map +1 -0
  15. package/build/src/export/fork-bundleAsync.js +138 -0
  16. package/build/src/export/fork-bundleAsync.js.map +1 -0
  17. package/build/src/export/getPublicExpoManifest.js +28 -0
  18. package/build/src/export/getPublicExpoManifest.js.map +1 -0
  19. package/build/src/export/getResolvedLocales.js +35 -0
  20. package/build/src/export/getResolvedLocales.js.map +1 -0
  21. package/build/src/export/index.js +77 -0
  22. package/build/src/export/index.js.map +1 -0
  23. package/build/src/export/printBundleSizes.js +122 -0
  24. package/build/src/export/printBundleSizes.js.map +1 -0
  25. package/build/src/export/resolveOptions.js +24 -0
  26. package/build/src/export/resolveOptions.js.map +1 -0
  27. package/build/src/export/saveAssets.js +65 -0
  28. package/build/src/export/saveAssets.js.map +1 -0
  29. package/build/src/export/writeContents.js +108 -0
  30. package/build/src/export/writeContents.js.map +1 -0
  31. package/build/src/install/index.js +13 -40
  32. package/build/src/install/index.js.map +1 -1
  33. package/build/src/login/index.js +6 -20
  34. package/build/src/login/index.js.map +1 -1
  35. package/build/src/logout/index.js +2 -17
  36. package/build/src/logout/index.js.map +1 -1
  37. package/build/src/prebuild/index.js +10 -21
  38. package/build/src/prebuild/index.js.map +1 -1
  39. package/build/src/prebuild/prebuildAsync.js +1 -1
  40. package/build/src/prebuild/prebuildAsync.js.map +1 -1
  41. package/build/src/register/index.js +2 -17
  42. package/build/src/register/index.js.map +1 -1
  43. package/build/src/run/android/index.js +97 -0
  44. package/build/src/run/android/index.js.map +1 -0
  45. package/build/src/run/android/resolveDevice.js +23 -0
  46. package/build/src/run/android/resolveDevice.js.map +1 -0
  47. package/build/src/run/android/resolveGradleProps.js +37 -0
  48. package/build/src/run/android/resolveGradleProps.js.map +1 -0
  49. package/build/src/run/android/resolveInstallApkName.js +72 -0
  50. package/build/src/run/android/resolveInstallApkName.js.map +1 -0
  51. package/build/src/run/android/resolveLaunchProps.js +32 -0
  52. package/build/src/run/android/resolveLaunchProps.js.map +1 -0
  53. package/build/src/run/android/resolveOptions.js +25 -0
  54. package/build/src/run/android/resolveOptions.js.map +1 -0
  55. package/build/src/run/android/runAndroidAsync.js +74 -0
  56. package/build/src/run/android/runAndroidAsync.js.map +1 -0
  57. package/build/src/run/ensureNativeProject.js +33 -0
  58. package/build/src/run/ensureNativeProject.js.map +1 -0
  59. package/build/src/run/hints.js +22 -0
  60. package/build/src/run/hints.js.map +1 -0
  61. package/build/src/run/resolveBundlerProps.js +31 -0
  62. package/build/src/run/resolveBundlerProps.js.map +1 -0
  63. package/build/src/run/startBundler.js +76 -0
  64. package/build/src/run/startBundler.js.map +1 -0
  65. package/build/src/start/index.js +29 -39
  66. package/build/src/start/index.js.map +1 -1
  67. package/build/src/start/platforms/ExpoGoInstaller.js +4 -1
  68. package/build/src/start/platforms/ExpoGoInstaller.js.map +1 -1
  69. package/build/src/start/platforms/PlatformManager.js +25 -0
  70. package/build/src/start/platforms/PlatformManager.js.map +1 -1
  71. package/build/src/start/platforms/android/ADBServer.js +3 -1
  72. package/build/src/start/platforms/android/ADBServer.js.map +1 -1
  73. package/build/src/start/platforms/android/AndroidDeviceManager.js +13 -1
  74. package/build/src/start/platforms/android/AndroidDeviceManager.js.map +1 -1
  75. package/build/src/start/platforms/android/activateWindow.js +2 -0
  76. package/build/src/start/platforms/android/activateWindow.js.map +1 -1
  77. package/build/src/start/platforms/android/adb.js +37 -4
  78. package/build/src/start/platforms/android/adb.js.map +1 -1
  79. package/build/src/start/platforms/android/gradle.js +86 -0
  80. package/build/src/start/platforms/android/gradle.js.map +1 -0
  81. package/build/src/start/server/BundlerDevServer.js +62 -2
  82. package/build/src/start/server/BundlerDevServer.js.map +1 -1
  83. package/build/src/start/server/UrlCreator.js +2 -1
  84. package/build/src/start/server/UrlCreator.js.map +1 -1
  85. package/build/src/start/server/metro/MetroBundlerDevServer.js +11 -14
  86. package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
  87. package/build/src/start/server/metro/instantiateMetro.js +22 -9
  88. package/build/src/start/server/metro/instantiateMetro.js.map +1 -1
  89. package/build/src/start/server/middleware/ClassicManifestMiddleware.js +1 -1
  90. package/build/src/start/server/middleware/createDevServerMiddleware.js +2 -2
  91. package/build/src/start/server/middleware/createDevServerMiddleware.js.map +1 -1
  92. package/build/src/start/server/middleware/resolveAssets.js +4 -1
  93. package/build/src/start/server/middleware/resolveAssets.js.map +1 -1
  94. package/build/src/start/server/webpack/WebpackBundlerDevServer.js +10 -14
  95. package/build/src/start/server/webpack/WebpackBundlerDevServer.js.map +1 -1
  96. package/build/src/utils/analytics/rudderstackClient.js +2 -2
  97. package/build/src/utils/args.js +14 -0
  98. package/build/src/utils/args.js.map +1 -1
  99. package/build/src/utils/array.js +29 -0
  100. package/build/src/utils/array.js.map +1 -1
  101. package/build/src/utils/dir.js +5 -1
  102. package/build/src/utils/dir.js.map +1 -1
  103. package/build/src/utils/downloadAppAsync.js +3 -0
  104. package/build/src/utils/downloadAppAsync.js.map +1 -1
  105. package/build/src/utils/downloadExpoGoAsync.js +11 -5
  106. package/build/src/utils/downloadExpoGoAsync.js.map +1 -1
  107. package/build/src/utils/env.js +3 -0
  108. package/build/src/utils/env.js.map +1 -1
  109. package/build/src/utils/resolveArgs.js +94 -0
  110. package/build/src/utils/resolveArgs.js.map +1 -0
  111. package/build/src/whoami/index.js +1 -17
  112. package/build/src/whoami/index.js.map +1 -1
  113. package/package.json +17 -13
@@ -0,0 +1,108 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.writeBundlesAsync = writeBundlesAsync;
6
+ exports.writeSourceMapsAsync = writeSourceMapsAsync;
7
+ exports.writeMetadataJsonAsync = writeMetadataJsonAsync;
8
+ exports.writeAssetMapAsync = writeAssetMapAsync;
9
+ exports.writeDebugHtmlAsync = writeDebugHtmlAsync;
10
+ var _crypto = _interopRequireDefault(require("crypto"));
11
+ var _promises = _interopRequireDefault(require("fs/promises"));
12
+ var _path = _interopRequireDefault(require("path"));
13
+ var _createMetadataJson = require("./createMetadataJson");
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ /**
20
+ * @param props.platform native platform for the bundle
21
+ * @param props.hash crypto hash for the bundle contents
22
+ * @returns filename for the JS bundle.
23
+ */ function createBundleFileName({ platform , hash }) {
24
+ return `${platform}-${hash}.js`;
25
+ }
26
+ /**
27
+ * @param bundle JS bundle as a string
28
+ * @returns crypto hash for the provided bundle
29
+ */ function createBundleHash(bundle) {
30
+ return _crypto.default.createHash("md5").update(bundle).digest("hex");
31
+ }
32
+ async function writeBundlesAsync({ bundles , outputDir }) {
33
+ const hashes = {};
34
+ const fileNames = {};
35
+ for (const [platform, bundleOutput] of Object.entries(bundles)){
36
+ var _hermesBytecodeBundle;
37
+ const bundle = (_hermesBytecodeBundle = bundleOutput.hermesBytecodeBundle) != null ? _hermesBytecodeBundle : bundleOutput.code;
38
+ const hash = createBundleHash(bundle);
39
+ const fileName = createBundleFileName({
40
+ platform,
41
+ hash
42
+ });
43
+ hashes[platform] = hash;
44
+ fileNames[platform] = fileName;
45
+ await _promises.default.writeFile(_path.default.join(outputDir, fileName), bundle);
46
+ }
47
+ return {
48
+ hashes,
49
+ fileNames
50
+ };
51
+ }
52
+ async function writeSourceMapsAsync({ bundles , hashes , fileNames , outputDir }) {
53
+ return Promise.all(Object.entries(bundles).map(async ([platform, bundle])=>{
54
+ var _hermesSourcemap;
55
+ const sourceMap = (_hermesSourcemap = bundle.hermesSourcemap) != null ? _hermesSourcemap : bundle.map;
56
+ var _hermesBytecodeBundle, ref;
57
+ const hash = (ref = hashes == null ? void 0 : hashes[platform]) != null ? ref : createBundleHash((_hermesBytecodeBundle = bundle.hermesBytecodeBundle) != null ? _hermesBytecodeBundle : bundle.code);
58
+ const mapName = `${platform}-${hash}.map`;
59
+ await _promises.default.writeFile(_path.default.join(outputDir, mapName), sourceMap);
60
+ var ref1;
61
+ const jsBundleFileName = (ref1 = fileNames == null ? void 0 : fileNames[platform]) != null ? ref1 : createBundleFileName({
62
+ platform,
63
+ hash
64
+ });
65
+ const jsPath = _path.default.join(outputDir, jsBundleFileName);
66
+ // Add correct mapping to sourcemap paths
67
+ const mappingComment = `\n//# sourceMappingURL=${mapName}`;
68
+ await _promises.default.appendFile(jsPath, mappingComment);
69
+ return {
70
+ platform,
71
+ fileName: mapName,
72
+ hash,
73
+ map: sourceMap,
74
+ comment: mappingComment
75
+ };
76
+ }));
77
+ }
78
+ async function writeMetadataJsonAsync({ outputDir , bundles , fileNames }) {
79
+ const contents = (0, _createMetadataJson).createMetadataJson({
80
+ bundles,
81
+ fileNames
82
+ });
83
+ await _promises.default.writeFile(_path.default.join(outputDir, "metadata.json"), JSON.stringify(contents));
84
+ return contents;
85
+ }
86
+ async function writeAssetMapAsync({ outputDir , assets }) {
87
+ // Convert the assets array to a k/v pair where the asset hash is the key and the asset is the value.
88
+ const contents = Object.fromEntries(assets.map((asset)=>[
89
+ asset.hash,
90
+ asset
91
+ ]
92
+ ));
93
+ await _promises.default.writeFile(_path.default.join(outputDir, "assetmap.json"), JSON.stringify(contents));
94
+ return contents;
95
+ }
96
+ async function writeDebugHtmlAsync({ outputDir , fileNames }) {
97
+ // Make a debug html so user can debug their bundles
98
+ const contents = `
99
+ ${Object.values(fileNames).map((fileName)=>`<script src="${_path.default.join("bundles", fileName)}"></script>`
100
+ ).join("\n ")}
101
+ Open up this file in Chrome. In the JavaScript developer console, navigate to the Source tab.
102
+ You can see a red colored folder containing the original source code from your bundle.
103
+ `;
104
+ await _promises.default.writeFile(_path.default.join(outputDir, "debug.html"), contents);
105
+ return contents;
106
+ }
107
+
108
+ //# sourceMappingURL=writeContents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/writeContents.ts"],"sourcesContent":["import { BundleOutput } from '@expo/dev-server';\nimport crypto from 'crypto';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { createMetadataJson } from './createMetadataJson';\nimport { Asset } from './saveAssets';\n\n/**\n * @param props.platform native platform for the bundle\n * @param props.hash crypto hash for the bundle contents\n * @returns filename for the JS bundle.\n */\nfunction createBundleFileName({ platform, hash }: { platform: string; hash: string }): string {\n return `${platform}-${hash}.js`;\n}\n\n/**\n * @param bundle JS bundle as a string\n * @returns crypto hash for the provided bundle\n */\nfunction createBundleHash(bundle: string | Uint8Array): string {\n return crypto.createHash('md5').update(bundle).digest('hex');\n}\n\nexport async function writeBundlesAsync({\n bundles,\n outputDir,\n}: {\n bundles: Record<string, Pick<BundleOutput, 'hermesBytecodeBundle' | 'code'>>;\n outputDir: string;\n}) {\n const hashes: Record<string, string> = {};\n const fileNames: Record<string, string> = {};\n\n for (const [platform, bundleOutput] of Object.entries(bundles)) {\n const bundle = bundleOutput.hermesBytecodeBundle ?? bundleOutput.code;\n const hash = createBundleHash(bundle);\n const fileName = createBundleFileName({ platform, hash });\n\n hashes[platform] = hash;\n fileNames[platform] = fileName;\n await fs.writeFile(path.join(outputDir, fileName), bundle);\n }\n\n return { hashes, fileNames };\n}\n\nexport async function writeSourceMapsAsync({\n bundles,\n hashes,\n fileNames,\n outputDir,\n}: {\n bundles: Record<\n string,\n Pick<BundleOutput, 'hermesSourcemap' | 'map' | 'hermesBytecodeBundle' | 'code'>\n >;\n hashes?: Record<string, string>;\n fileNames?: Record<string, string>;\n outputDir: string;\n}) {\n return Promise.all(\n Object.entries(bundles).map(async ([platform, bundle]) => {\n const sourceMap = bundle.hermesSourcemap ?? bundle.map;\n const hash =\n hashes?.[platform] ?? createBundleHash(bundle.hermesBytecodeBundle ?? bundle.code);\n const mapName = `${platform}-${hash}.map`;\n await fs.writeFile(path.join(outputDir, mapName), sourceMap);\n\n const jsBundleFileName = fileNames?.[platform] ?? createBundleFileName({ platform, hash });\n const jsPath = path.join(outputDir, jsBundleFileName);\n\n // Add correct mapping to sourcemap paths\n const mappingComment = `\\n//# sourceMappingURL=${mapName}`;\n await fs.appendFile(jsPath, mappingComment);\n return {\n platform,\n fileName: mapName,\n hash,\n map: sourceMap,\n comment: mappingComment,\n };\n })\n );\n}\n\nexport async function writeMetadataJsonAsync({\n outputDir,\n bundles,\n fileNames,\n}: {\n outputDir: string;\n bundles: Record<string, Pick<BundleOutput, 'assets'>>;\n fileNames: Record<string, string>;\n}) {\n const contents = createMetadataJson({\n bundles,\n fileNames,\n });\n await fs.writeFile(path.join(outputDir, 'metadata.json'), JSON.stringify(contents));\n return contents;\n}\n\nexport async function writeAssetMapAsync({\n outputDir,\n assets,\n}: {\n outputDir: string;\n assets: Asset[];\n}) {\n // Convert the assets array to a k/v pair where the asset hash is the key and the asset is the value.\n const contents = Object.fromEntries(assets.map((asset) => [asset.hash, asset]));\n await fs.writeFile(path.join(outputDir, 'assetmap.json'), JSON.stringify(contents));\n return contents;\n}\n\nexport async function writeDebugHtmlAsync({\n outputDir,\n fileNames,\n}: {\n outputDir: string;\n fileNames: Record<string, string>;\n}) {\n // Make a debug html so user can debug their bundles\n const contents = `\n ${Object.values(fileNames)\n .map((fileName) => `<script src=\"${path.join('bundles', fileName)}\"></script>`)\n .join('\\n ')}\n Open up this file in Chrome. In the JavaScript developer console, navigate to the Source tab.\n You can see a red colored folder containing the original source code from your bundle.\n `;\n\n await fs.writeFile(path.join(outputDir, 'debug.html'), contents);\n return contents;\n}\n"],"names":["writeBundlesAsync","writeSourceMapsAsync","writeMetadataJsonAsync","writeAssetMapAsync","writeDebugHtmlAsync","createBundleFileName","platform","hash","createBundleHash","bundle","crypto","createHash","update","digest","bundles","outputDir","hashes","fileNames","bundleOutput","Object","entries","hermesBytecodeBundle","code","fileName","fs","writeFile","path","join","Promise","all","map","sourceMap","hermesSourcemap","mapName","jsBundleFileName","jsPath","mappingComment","appendFile","comment","contents","createMetadataJson","JSON","stringify","assets","fromEntries","asset","values"],"mappings":"AAAA;;;;QAyBsBA,iBAAiB,GAAjBA,iBAAiB;QAuBjBC,oBAAoB,GAApBA,oBAAoB;QAuCpBC,sBAAsB,GAAtBA,sBAAsB;QAiBtBC,kBAAkB,GAAlBA,kBAAkB;QAalBC,mBAAmB,GAAnBA,mBAAmB;AApHtB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACZ,IAAA,SAAa,kCAAb,aAAa,EAAA;AACX,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEY,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;AAGzD;;;;GAIG,CACH,SAASC,oBAAoB,CAAC,EAAEC,QAAQ,CAAA,EAAEC,IAAI,CAAA,EAAsC,EAAU;IAC5F,OAAO,CAAC,EAAED,QAAQ,CAAC,CAAC,EAAEC,IAAI,CAAC,GAAG,CAAC,CAAC;CACjC;AAED;;;GAGG,CACH,SAASC,gBAAgB,CAACC,MAA2B,EAAU;IAC7D,OAAOC,OAAM,QAAA,CAACC,UAAU,CAAC,KAAK,CAAC,CAACC,MAAM,CAACH,MAAM,CAAC,CAACI,MAAM,CAAC,KAAK,CAAC,CAAC;CAC9D;AAEM,eAAeb,iBAAiB,CAAC,EACtCc,OAAO,CAAA,EACPC,SAAS,CAAA,EAIV,EAAE;IACD,MAAMC,MAAM,GAA2B,EAAE,AAAC;IAC1C,MAAMC,SAAS,GAA2B,EAAE,AAAC;IAE7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all = void 0;
7
7
  var _chalk = _interopRequireDefault(require("chalk"));
8
- var Log = _interopRequireWildcard(require("../log"));
9
8
  var _args = require("../utils/args");
10
9
  function _interopRequireDefault(obj) {
11
10
  return obj && obj.__esModule ? obj : {
12
11
  default: obj
13
12
  };
14
13
  }
15
- function _interopRequireWildcard(obj) {
16
- if (obj && obj.__esModule) {
17
- return obj;
18
- } else {
19
- var newObj = {};
20
- if (obj != null) {
21
- for(var key in obj){
22
- if (Object.prototype.hasOwnProperty.call(obj, key)) {
23
- var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
24
- if (desc.get || desc.set) {
25
- Object.defineProperty(newObj, key, desc);
26
- } else {
27
- newObj[key] = obj[key];
28
- }
29
- }
30
- }
31
- }
32
- newObj.default = obj;
33
- return newObj;
34
- }
35
- }
36
14
  const expoInstall = async (argv)=>{
37
15
  const args = (0, _args).assertWithOptionsArgs({
38
16
  // Other options are parsed manually.
@@ -45,24 +23,19 @@ const expoInstall = async (argv)=>{
45
23
  permissive: true
46
24
  });
47
25
  if (args["--help"]) {
48
- Log.exit(_chalk.default`
49
- {bold Description}
50
- Install a module or other package to a project
51
-
52
- {bold Usage}
53
- $ npx expo install {dim [packages...] [options]}
54
-
55
- {bold Options}
56
- --check Check which installed packages need to be updated.
57
- --fix Automatically update any invalid package versions.
58
- --npm Use npm to install dependencies. {dim Default when package-lock.json exists}
59
- --yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}
60
- -h, --help Output usage information
61
-
62
- Additional options can be passed to the underlying install command by using {bold --}
63
- $ expo install react -- --verbose
64
- {dim >} yarn add react --verbose
65
- `, 0);
26
+ (0, _args).printHelp(`Install a module or other package to a project`, `npx expo install`, [
27
+ `--check Check which installed packages need to be updated`,
28
+ `--fix Automatically update any invalid package versions`,
29
+ _chalk.default`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,
30
+ _chalk.default`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,
31
+ `-h, --help Usage info`,
32
+ ].join("\n"), [
33
+ "",
34
+ _chalk.default` Additional options can be passed to the underlying install command by using {bold --}`,
35
+ _chalk.default` {dim $} npx expo install react -- --verbose`,
36
+ _chalk.default` {dim >} yarn add react --verbose`,
37
+ "",
38
+ ].join("\n"));
66
39
  }
67
40
  // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.
68
41
  const { installAsync } = require("./installAsync");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertWithOptionsArgs } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Install a module or other package to a project\n\n {bold Usage}\n $ npx expo install {dim [packages...] [options]}\n\n {bold Options}\n --check Check which installed packages need to be updated.\n --fix Automatically update any invalid package versions.\n --npm Use npm to install dependencies. {dim Default when package-lock.json exists}\n --yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}\n -h, --help Output usage information\n\n Additional options can be passed to the underlying install command by using {bold --}\n $ expo install react -- --verbose\n {dim >} yarn add react --verbose\n `,\n 0\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["Log","expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","exit","chalk","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACuB,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9C,MAAMC,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAYjC,CAAA,sBAZiC,CAChC;QACE,qCAAqC;QACrC,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACD;QACEH,IAAI;QACJ,6EAA6E;QAC7EI,UAAU,EAAE,IAAI;KACjB,CACF,AAAC;IAEF,IAAIH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACO,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;;;;;;;;;IAiBR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,yFAAyF;IACzF,MAAM,EAAEC,YAAY,CAAA,EAAE,GAAGC,OAAO,CAAC,gBAAgB,CAAC,AAAmC,AAAC;IACtF,MAAM,EAAEC,WAAW,CAAA,EAAE,GAAGD,OAAO,CAAC,iBAAiB,CAAC,AAAoC,AAAC;IACvF,MAAM,EAAEE,gBAAgB,CAAA,EAAE,GAAGF,OAAO,CAAC,kBAAkB,CAAC,AAAqC,AAAC;IAE9F,MAAM,EAAEG,QAAQ,CAAA,EAAEC,OAAO,CAAA,EAAEC,MAAM,CAAA,EAAE,GAAG,MAAMH,gBAAgB,CAACI,OAAO,CAACd,IAAI,CAACe,KAAK,CAAC,CAAC,CAAC,CAAC,CAACC,KAAK,CACvFP,WAAW,CACZ,AAAC;IACF,OAAOF,YAAY,CAACI,QAAQ,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;CACnE,AAAC;QAhDWV,WAAW,GAAXA,WAAW"}
1
+ {"version":3,"sources":["../../../src/install/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertWithOptionsArgs, printHelp } from '../utils/args';\n\nexport const expoInstall: Command = async (argv) => {\n const args = assertWithOptionsArgs(\n {\n // Other options are parsed manually.\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n {\n argv,\n // Allow other options, we'll throw an error if unexpected values are passed.\n permissive: true,\n }\n );\n\n if (args['--help']) {\n printHelp(\n `Install a module or other package to a project`,\n `npx expo install`,\n [\n `--check Check which installed packages need to be updated`,\n `--fix Automatically update any invalid package versions`,\n chalk`--npm Use npm to install dependencies. {dim Default when package-lock.json exists}`,\n chalk`--yarn Use Yarn to install dependencies. {dim Default when yarn.lock exists}`,\n `-h, --help Usage info`,\n ].join('\\n'),\n [\n '',\n chalk` Additional options can be passed to the underlying install command by using {bold --}`,\n chalk` {dim $} npx expo install react -- --verbose`,\n chalk` {dim >} yarn add react --verbose`,\n '',\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo install -h` shows as fast as possible.\n const { installAsync } = require('./installAsync') as typeof import('./installAsync');\n const { logCmdError } = require('../utils/errors') as typeof import('../utils/errors');\n const { resolveArgsAsync } = require('./resolveOptions') as typeof import('./resolveOptions');\n\n const { variadic, options, extras } = await resolveArgsAsync(process.argv.slice(3)).catch(\n logCmdError\n );\n return installAsync(variadic, options, extras).catch(logCmdError);\n};\n"],"names":["expoInstall","argv","args","assertWithOptionsArgs","Boolean","permissive","printHelp","chalk","join","installAsync","require","logCmdError","resolveArgsAsync","variadic","options","extras","process","slice","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGwB,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;AAEzD,MAAMA,WAAW,GAAY,OAAOC,IAAI,GAAK;IAClD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,K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Q,EAAEC,OAAO,EAAEC,MAAM,CAAC,CAACG,KAAK,CAACP,WAAW,CAAC,CAAC;CACnE,AAAC;QA7CWX,WAAW,GAAXA,WAAW"}
@@ -4,15 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expoLogin = void 0;
7
- var _chalk = _interopRequireDefault(require("chalk"));
8
- var Log = _interopRequireWildcard(require("../log"));
9
7
  var _args = require("../utils/args");
10
8
  var _errors = require("../utils/errors");
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- default: obj
14
- };
15
- }
16
9
  function _interopRequireWildcard(obj) {
17
10
  if (obj && obj.__esModule) {
18
11
  return obj;
@@ -47,19 +40,12 @@ const expoLogin = async (argv)=>{
47
40
  "-p": "--password"
48
41
  }, argv);
49
42
  if (args["--help"]) {
50
- Log.exit(_chalk.default`
51
- {bold Description}
52
- Log in to an Expo account
53
-
54
- {bold Usage}
55
- $ npx expo login
56
-
57
- Options
58
- -u, --username <string> Username
59
- -p, --password <string> Password
60
- --otp <string> One-time password from your 2FA device
61
- -h, --help Output usage information
62
- `, 0);
43
+ (0, _args).printHelp(`Log in to an Expo account`, `npx expo login`, [
44
+ `-u, --username <string> Username`,
45
+ `-p, --password <string> Password`,
46
+ `--otp <string> One-time password from your 2FA device`,
47
+ `-h, --help Usage info`,
48
+ ].join("\n"));
63
49
  }
64
50
  const { showLoginPromptAsync } = await Promise.resolve().then(function() {
65
51
  return _interopRequireWildcard(require("../api/user/actions"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/login/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertArgs } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogin: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--username': String,\n '--password': String,\n '--otp': String,\n // Aliases\n '-h': '--help',\n '-u': '--username',\n '-p': '--password',\n },\n argv\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Log in to an Expo account\n\n {bold Usage}\n $ npx expo login\n\n Options\n -u, --username <string> Username\n -p, --password <string> Password\n --otp <string> One-time password from your 2FA device\n -h, --help Output usage information\n `,\n 0\n );\n }\n\n const { showLoginPromptAsync } = await import('../api/user/actions');\n return showLoginPromptAsync({\n // Parsed options\n username: args['--username'],\n password: args['--password'],\n otp: args['--otp'],\n }).catch(logCmdError);\n};\n"],"names":["Log","expoLogin","argv","args","assertArgs","Boolean","String","exit","chalk","showLoginPromptAsync","username","password","otp","catch","logCmdError"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACY,IAAA,KAAe,WAAf,eAAe,CAAA;AACd,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMC,SAAS,GAAY,OAAOC,IAAI,GAAK;IAChD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAatB,CAAA,WAbsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,YAAY,EAAEC,MAAM;QACpB,YAAY,EAAEA,MAAM;QACpB,OAAO,EAAEA,MAAM;QACf,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,YAAY;KACnB,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACO,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;;;;IAYR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,MAAM,EAAEC,oBAAoB,CAAA,EAAE,GAAG,MAAM;+CAAO,qBAAqB;MAAC,AAAC;IACrE,OAAOA,oBAAoB,CAAC;QAC1B,iBAAiB;QACjBC,QAAQ,EAAEP,IAAI,CAAC,YAAY,CAAC;QAC5BQ,QAAQ,EAAER,IAAI,CAAC,YAAY,CAAC;QAC5BS,GAAG,EAAET,IAAI,CAAC,OAAO,CAAC;KACnB,CAAC,CAACU,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CACvB,AAAC;QA1CWb,SAAS,GAATA,SAAS"}
1
+ {"version":3,"sources":["../../../src/login/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from '../../bin/cli';\nimport { assertArgs, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogin: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--username': String,\n '--password': String,\n '--otp': String,\n // Aliases\n '-h': '--help',\n '-u': '--username',\n '-p': '--password',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Log in to an Expo account`,\n `npx expo login`,\n [\n `-u, --username <string> Username`,\n `-p, --password <string> Password`,\n `--otp <string> One-time password from your 2FA device`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n const { showLoginPromptAsync } = await import('../api/user/actions');\n return showLoginPromptAsync({\n // Parsed options\n username: args['--username'],\n password: args['--password'],\n otp: args['--otp'],\n }).catch(logCmdError);\n};\n"],"names":["expoLogin","argv","args","assertArgs","Boolean","String","printHelp","join","showLoginPromptAsync","username","password","otp","catch","logCmdError"],"mappings":"AAAA;;;;;;AAEsC,IAAA,KAAe,WAAf,eAAe,CAAA;AACzB,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMA,SAAS,GAAY,OAAOC,IAAI,GAAK;IAChD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAatB,CAAA,WAbsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,YAAY,EAAEC,MAAM;QACpB,YAAY,EAAEA,MAAM;QACpB,OAAO,EAAEA,MAAM;QACf,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,YAAY;KACnB,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBI,CAAAA,GAAAA,KAAS,AASR,CAAA,UATQ,CACP,CAAC,yBAAyB,CAAC,EAC3B,CAAC,cAAc,CAAC,EAChB;YACE,CAAC,iCAAiC,CAAC;YACnC,CAAC,iCAAiC,CAAC;YACnC,CAAC,+DAA+D,CAAC;YACjE,CAAC,mCAAmC,CAAC;SACtC,CAACC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;KACH;IAED,MAAM,EAAEC,oBAAoB,CAAA,EAAE,GAAG,MAAM;+CAAO,qBAAqB;MAAC,AAAC;IACrE,OAAOA,oBAAoB,CAAC;QAC1B,iBAAiB;QACjBC,QAAQ,EAAEP,IAAI,CAAC,YAAY,CAAC;QAC5BQ,QAAQ,EAAER,IAAI,CAAC,YAAY,CAAC;QAC5BS,GAAG,EAAET,IAAI,CAAC,OAAO,CAAC;KACnB,CAAC,CAACU,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CACvB,AAAC;QApCWb,SAAS,GAATA,SAAS"}
@@ -4,15 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expoLogout = void 0;
7
- var _chalk = _interopRequireDefault(require("chalk"));
8
- var Log = _interopRequireWildcard(require("../log"));
9
7
  var _args = require("../utils/args");
10
8
  var _errors = require("../utils/errors");
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- default: obj
14
- };
15
- }
16
9
  function _interopRequireWildcard(obj) {
17
10
  if (obj && obj.__esModule) {
18
11
  return obj;
@@ -42,16 +35,8 @@ const expoLogout = async (argv)=>{
42
35
  "-h": "--help"
43
36
  }, argv);
44
37
  if (args["--help"]) {
45
- Log.exit(_chalk.default`
46
- {bold Description}
47
- Log out of an Expo account
48
-
49
- {bold Usage}
50
- $ npx expo logout
51
-
52
- Options
53
- -h, --help Output usage information
54
- `, 0);
38
+ (0, _args).printHelp(`Log out of an Expo account`, `npx expo logout`, // options
39
+ `-h, --help Usage info`);
55
40
  }
56
41
  const { logoutAsync } = await Promise.resolve().then(function() {
57
42
  return _interopRequireWildcard(require("../api/user/user"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/logout/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertArgs } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogout: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n argv\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Log out of an Expo account\n\n {bold Usage}\n $ npx expo logout\n\n Options\n -h, --help Output usage information\n `,\n 0\n );\n }\n\n const { logoutAsync } = await import('../api/user/user');\n return logoutAsync().catch(logCmdError);\n};\n"],"names":["Log","expoLogout","argv","args","assertArgs","Boolean","exit","chalk","logoutAsync","catch","logCmdError"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACY,IAAA,KAAe,WAAf,eAAe,CAAA;AACd,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMC,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAQtB,CAAA,WARsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACDH,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACM,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;IASR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,MAAM,EAAEC,WAAW,CAAA,EAAE,GAAG,MAAM;+CAAO,kBAAkB;MAAC,AAAC;IACzD,OAAOA,WAAW,EAAE,CAACC,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CACzC,AAAC;QA7BWT,UAAU,GAAVA,UAAU"}
1
+ {"version":3,"sources":["../../../src/logout/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoLogout: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Log out of an Expo account`,\n `npx expo logout`,\n // options\n `-h, --help Usage info`\n );\n }\n\n const { logoutAsync } = await import('../api/user/user');\n return logoutAsync().catch(logCmdError);\n};\n"],"names":["expoLogout","argv","args","assertArgs","Boolean","printHelp","logoutAsync","catch","logCmdError"],"mappings":"AAAA;;;;;;AAGsC,IAAA,KAAe,WAAf,eAAe,CAAA;AACzB,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMA,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAQtB,CAAA,WARsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACDH,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBG,CAAAA,GAAAA,KAAS,AAKR,CAAA,UALQ,CACP,CAAC,0BAA0B,CAAC,EAC5B,CAAC,eAAe,CAAC,EACjB,UAAU;QACV,CAAC,wBAAwB,CAAC,CAC3B,CAAC;KACH;IAED,MAAM,EAAEC,WAAW,CAAA,EAAE,GAAG,MAAM;+CAAO,kBAAkB;MAAC,AAAC;IACzD,OAAOA,WAAW,EAAE,CAACC,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CACzC,AAAC;QAtBWR,UAAU,GAAVA,UAAU"}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.expoPrebuild = void 0;
7
7
  var _chalk = _interopRequireDefault(require("chalk"));
8
- var Log = _interopRequireWildcard(require("../log"));
9
8
  var _args = require("../utils/args");
10
9
  function _interopRequireDefault(obj) {
11
10
  return obj && obj.__esModule ? obj : {
@@ -49,26 +48,16 @@ const expoPrebuild = async (argv)=>{
49
48
  "-t": "--type"
50
49
  }, argv);
51
50
  if (args["--help"]) {
52
- Log.exit(_chalk.default`
53
- {bold Description}
54
- Create native iOS and Android project files before building natively.
55
-
56
- {bold Usage}
57
- $ npx expo prebuild <dir>
58
-
59
- <dir> is the directory of the Expo project.
60
- Defaults to the current working directory.
61
-
62
- Options
63
- --no-install Skip installing npm packages and CocoaPods.
64
- --clean Delete the native folders and regenerate them before applying changes
65
- --npm Use npm to install dependencies. (default when Yarn is not installed)
66
- --template <template> Project template to clone from. File path pointing to a local tar file or a github repo
67
- -p, --platform <all|android|ios> Platforms to sync: ios, android, all. Default: all
68
- --skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)
69
- -h, --help Output usage information
70
-
71
- `, 0);
51
+ (0, _args).printHelp(`Create native iOS and Android project files for building natively`, _chalk.default`npx expo prebuild {dim <dir>}`, [
52
+ _chalk.default`<dir> Directory of the Expo project. {dim Default: Current working directory}`,
53
+ `--no-install Skip installing npm packages and CocoaPods`,
54
+ `--clean Delete the native folders and regenerate them before applying changes`,
55
+ _chalk.default`--npm Use npm to install dependencies. {dim Default when Yarn is not installed}`,
56
+ `--template <template> Project template to clone from. File path pointing to a local tar file or a github repo`,
57
+ _chalk.default`-p, --platform <all|android|ios> Platforms to sync: ios, android, all. {dim Default: all}`,
58
+ `--skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)`,
59
+ `-h, --help Usage info`,
60
+ ].join("\n"));
72
61
  }
73
62
  // Load modules after the help prompt so `npx expo prebuild -h` shows as fast as possible.
74
63
  const [// ./prebuildAsync
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/prebuild/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertArgs, getProjectRoot } from '../utils/args';\n\nexport const expoPrebuild: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clean': Boolean,\n '--npm': Boolean,\n '--no-install': Boolean,\n '--template': String,\n '--platform': String,\n '--skip-dependency-update': String,\n // Aliases\n '-h': '--help',\n '-p': '--platform',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Create native iOS and Android project files before building natively.\n\n {bold Usage}\n $ npx expo prebuild <dir>\n\n <dir> is the directory of the Expo project.\n Defaults to the current working directory.\n\n Options\n --no-install Skip installing npm packages and CocoaPods.\n --clean Delete the native folders and regenerate them before applying changes\n --npm Use npm to install dependencies. (default when Yarn is not installed)\n --template <template> Project template to clone from. File path pointing to a local tar file or a github repo\n -p, --platform <all|android|ios> Platforms to sync: ios, android, all. Default: all\n --skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)\n -h, --help Output usage information\n\n `,\n 0\n );\n }\n\n // Load modules after the help prompt so `npx expo prebuild -h` shows as fast as possible.\n const [\n // ./prebuildAsync\n { prebuildAsync },\n // ./resolveOptions\n { resolvePlatformOption, resolveSkipDependencyUpdate },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([\n import('./prebuildAsync'),\n import('./resolveOptions'),\n import('../utils/errors'),\n ]);\n\n return prebuildAsync(getProjectRoot(args), {\n // Parsed options\n clean: args['--clean'],\n packageManager: args['--npm'] ? 'npm' : 'yarn',\n install: !args['--no-install'],\n platforms: resolvePlatformOption(args['--platform']),\n // TODO: Parse\n skipDependencyUpdate: resolveSkipDependencyUpdate(args['--skip-dependency-update']),\n template: args['--template'],\n }).catch(logCmdError);\n};\n"],"names":["Log","expoPrebuild","argv","args","assertArgs","Boolean","String","exit","chalk","prebuildAsync","resolvePlatformOption","resolveSkipDependencyUpdate","logCmdError","Promise","all","getProjectRoot","clean","packageManager","install","platforms","skipDependencyUpdate","template","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAC4B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnD,MAAMC,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAgBtB,CAAA,WAhBsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,SAAS,EAAEA,OAAO;QAClB,OAAO,EAAEA,OAAO;QAChB,cAAc,EAAEA,OAAO;QACvB,YAAY,EAAEC,MAAM;QACpB,YAAY,EAAEA,MAAM;QACpB,0BAA0B,EAAEA,MAAM;QAClC,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;KACf,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACO,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;;;;;;;;;;;IAmBR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,0FAA0F;IAC1F,MAAM,CACJ,kBAAkB;IAClB,EAAEC,aAAa,CAAA,EAAE,EACjB,mBAAmB;IACnB,EAAEC,qBAAqB,CAAA,EAAEC,2BAA2B,CAAA,EAAE,EACtD,kBAAkB;IAClB,EAAEC,WAAW,CAAA,EAAE,GAChB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QACpB;mDAAO,iBAAiB;UAAC;QACzB;mDAAO,kBAAkB;UAAC;QAC1B;mDAAO,iBAAiB;UAAC;KAC1B,CAAC,AAAC;IAEH,OAAOL,aAAa,CAACM,CAAAA,GAAAA,KAAc,AAAM,CAAA,eAAN,CAACZ,IAAI,CAAC,EAAE;QACzC,iBAAiB;QACjBa,KAAK,EAAEb,IAAI,CAAC,SAAS,CAAC;QACtBc,cAAc,EAAEd,IAAI,CAAC,OAAO,CAAC,GAAG,KAAK,GAAG,MAAM;QAC9Ce,OAAO,EAAE,CAACf,IAAI,CAAC,cAAc,CAAC;QAC9BgB,SAAS,EAAET,qBAAqB,CAACP,IAAI,CAAC,YAAY,CAAC,CAAC;QACpD,cAAc;QACdiB,oBAAoB,EAAET,2BAA2B,CAACR,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACnFkB,QAAQ,EAAElB,IAAI,CAAC,YAAY,CAAC;KAC7B,CAAC,CAACmB,KAAK,CAACV,WAAW,CAAC,CAAC;CACvB,AAAC;QArEWX,YAAY,GAAZA,YAAY"}
1
+ {"version":3,"sources":["../../../src/prebuild/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoPrebuild: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--clean': Boolean,\n '--npm': Boolean,\n '--no-install': Boolean,\n '--template': String,\n '--platform': String,\n '--skip-dependency-update': String,\n // Aliases\n '-h': '--help',\n '-p': '--platform',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Create native iOS and Android project files for building natively`,\n chalk`npx expo prebuild {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--no-install Skip installing npm packages and CocoaPods`,\n `--clean Delete the native folders and regenerate them before applying changes`,\n chalk`--npm Use npm to install dependencies. {dim Default when Yarn is not installed}`,\n `--template <template> Project template to clone from. File path pointing to a local tar file or a github repo`,\n chalk`-p, --platform <all|android|ios> Platforms to sync: ios, android, all. {dim Default: all}`,\n `--skip-dependency-update <dependencies> Preserves versions of listed packages in package.json (comma separated list)`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo prebuild -h` shows as fast as possible.\n const [\n // ./prebuildAsync\n { prebuildAsync },\n // ./resolveOptions\n { resolvePlatformOption, resolveSkipDependencyUpdate },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([\n import('./prebuildAsync'),\n import('./resolveOptions'),\n import('../utils/errors'),\n ]);\n\n return prebuildAsync(getProjectRoot(args), {\n // Parsed options\n clean: args['--clean'],\n packageManager: args['--npm'] ? 'npm' : 'yarn',\n install: !args['--no-install'],\n platforms: resolvePlatformOption(args['--platform']),\n // TODO: Parse\n skipDependencyUpdate: resolveSkipDependencyUpdate(args['--skip-dependency-update']),\n template: args['--template'],\n }).catch(logCmdError);\n};\n"],"names":["expoPrebuild","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","prebuildAsync","resolvePlatformOption","resolveSkipDependencyUpdate","logCmdError","Promise","all","getProjectRoot","clean","packageManager","install","platforms","skipDependencyUpdate","template","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE9D,MAAMA,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAgBtB,CAAA,WAhBsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,SAAS,EAAEA,OAAO;QAClB,OAAO,EAAEA,OAAO;QAChB,cAAc,EAAEA,OAAO;QACvB,YAAY,EAAEC,MAAM;QACpB,YAAY,EAAEA,MAAM;QACpB,0BAA0B,EAAEA,MAA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AAY,CAAC,CAAC;QACpD,cAAc;QACdkB,oBAAoB,EAAET,2BAA2B,CAACT,IAAI,CAAC,0BAA0B,CAAC,CAAC;QACnFmB,QAAQ,EAAEnB,IAAI,CAAC,YAAY,CAAC;KAC7B,CAAC,CAACoB,KAAK,CAACV,WAAW,CAAC,CAAC;CACvB,AAAC;QA5DWZ,YAAY,GAAZA,YAAY"}
@@ -101,7 +101,7 @@ async function prebuildAsync(projectRoot, options) {
101
101
  }
102
102
  return {
103
103
  packageManager,
104
- nodeInstall: options.install,
104
+ nodeInstall: !!options.install,
105
105
  podInstall: !podsInstalled,
106
106
  platforms: options.platforms,
107
107
  hasNewProjectFiles,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport * as Log from '../log';\nimport { installNodeDependenciesAsync, resolvePackageManager } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n /** Indicates which package manager the project is using. */\n packageManager: string;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: 'npm' | 'yarn';\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, hasNewDependencies } = await updateFromTemplateAsync(\n projectRoot,\n {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n }\n );\n\n // Install node modules\n const packageManager = resolvePackageManager({\n install: options.install,\n npm: options.packageManager === 'npm',\n yarn: options.packageManager === 'yarn',\n });\n\n if (options.install) {\n await installNodeDependenciesAsync(projectRoot, packageManager, {\n // We delete the dependencies when new ones are added because native packages are more fragile.\n // npm doesn't work well so we always run the cleaning step when npm is used in favor of yarn.\n clean: hasNewDependencies || packageManager === 'npm',\n });\n }\n\n // Apply Expo config to native projects\n const configSyncingStep = logNewSection('Config syncing');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n });\n configSyncingStep.succeed('Config synced');\n } catch (error) {\n configSyncingStep.fail('Config sync failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n Log.debug('Skipped pod install');\n }\n\n return {\n packageManager,\n nodeInstall: options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","Log","projectRoot","options","clean","maybeBailOnGitStatusAsync","clearNativeFolder","platforms","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","exp","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","hasNewDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","packageManager","resolvePackageManager","install","npm","yarn","installNodeDependenciesAsync","configSyncingStep","logNewSection","profile","configureProjectAsync","succeed","error","fail","podsInstalled","includes","installCocoaPodsAsync","debug","nodeInstall","podInstall"],"mappings":"AAAA;;;;QAqCsBA,aAAa,GAAbA,aAAa;AAlCvBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACqD,IAAA,YAAsB,WAAtB,sBAAsB,CAAA;AAC5D,IAAA,IAAc,WAAd,cAAc,CAAA;AACpB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACmC,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AAC5D,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC7B,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACsB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AACvD,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;AA0BvD,eAAeD,aAAa,CACjCE,WAAmB,EACnBC,OAaC,EACgC;IACjC,IAAIA,OAAO,CAACC,KAAK,EAAE;QACjB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AAE,GAAG,MAAM;mDAAO,oBAAoB;UAAC,AAAC;QAErEF,aAAa,GAAG,MAAME,qBAAqB,CAACnC,WAAW,CAAC,CAAC;KAC1D,MAAM;QACLD,GAAG,CAACqC,KAAK,CAAC,qBAAqB,CAAC,CAAC;KAClC;IAED,OAAO;QACLhB,cAAc;QACdiB,WAAW,EAAEpC,OAAO,CAACqB,OAAO;QAC5BgB,UAAU,EAAE,CAACL,aAAa;QAC1B5B,SAAS,EAAEJ,OAAO,CAACI,SAAS;QAC5BO,kBAAkB;QAClBH,GAAG;KACJ,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../src/prebuild/prebuildAsync.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\n\nimport * as Log from '../log';\nimport { installNodeDependenciesAsync, resolvePackageManager } from '../utils/nodeModules';\nimport { logNewSection } from '../utils/ora';\nimport { profile } from '../utils/profile';\nimport { clearNativeFolder, promptToClearMalformedNativeProjectsAsync } from './clearNativeFolder';\nimport { configureProjectAsync } from './configureProjectAsync';\nimport { ensureConfigAsync } from './ensureConfigAsync';\nimport { assertPlatforms, ensureValidPlatforms, resolveTemplateOption } from './resolveOptions';\nimport { updateFromTemplateAsync } from './updateFromTemplate';\n\nexport type PrebuildResults = {\n /** Expo config. */\n exp: ExpoConfig;\n /** Indicates if the process created new files. */\n hasNewProjectFiles: boolean;\n /** The platforms that were prebuilt. */\n platforms: ModPlatform[];\n /** Indicates if pod install was run. */\n podInstall: boolean;\n /** Indicates if node modules were installed. */\n nodeInstall: boolean;\n /** Indicates which package manager the project is using. */\n packageManager: string;\n};\n\n/**\n * Entry point into the prebuild process, delegates to other helpers to perform various steps.\n *\n * 0. Attempt to clean the project folders.\n * 1. Create native projects (ios, android).\n * 2. Install node modules.\n * 3. Apply config to native projects.\n * 4. Install CocoaPods.\n */\nexport async function prebuildAsync(\n projectRoot: string,\n options: {\n /** Should install node modules and cocoapods. */\n install?: boolean;\n /** List of platforms to prebuild. */\n platforms: ModPlatform[];\n /** Should delete the native folders before attempting to prebuild. */\n clean?: boolean;\n /** URL or file path to the prebuild template. */\n template?: string;\n /** Name of the node package manager to install with. */\n packageManager?: 'npm' | 'yarn';\n /** List of node modules to skip updating. */\n skipDependencyUpdate?: string[];\n }\n): Promise<PrebuildResults | null> {\n if (options.clean) {\n const { maybeBailOnGitStatusAsync } = await import('../utils/git');\n // Clean the project folders...\n if (await maybeBailOnGitStatusAsync()) {\n return null;\n }\n // Clear the native folders before syncing\n await clearNativeFolder(projectRoot, options.platforms);\n } else {\n // Check if the existing project folders are malformed.\n await promptToClearMalformedNativeProjectsAsync(projectRoot, options.platforms);\n }\n\n // Warn if the project is attempting to prebuild an unsupported platform (iOS on Windows).\n options.platforms = ensureValidPlatforms(options.platforms);\n // Assert if no platforms are left over after filtering.\n assertPlatforms(options.platforms);\n\n // Get the Expo config, create it if missing.\n const { exp, pkg } = await ensureConfigAsync(projectRoot, { platforms: options.platforms });\n\n // Create native projects from template.\n const { hasNewProjectFiles, needsPodInstall, hasNewDependencies } = await updateFromTemplateAsync(\n projectRoot,\n {\n exp,\n pkg,\n template: options.template != null ? resolveTemplateOption(options.template) : undefined,\n platforms: options.platforms,\n skipDependencyUpdate: options.skipDependencyUpdate,\n }\n );\n\n // Install node modules\n const packageManager = resolvePackageManager({\n install: options.install,\n npm: options.packageManager === 'npm',\n yarn: options.packageManager === 'yarn',\n });\n\n if (options.install) {\n await installNodeDependenciesAsync(projectRoot, packageManager, {\n // We delete the dependencies when new ones are added because native packages are more fragile.\n // npm doesn't work well so we always run the cleaning step when npm is used in favor of yarn.\n clean: hasNewDependencies || packageManager === 'npm',\n });\n }\n\n // Apply Expo config to native projects\n const configSyncingStep = logNewSection('Config syncing');\n try {\n await profile(configureProjectAsync)(projectRoot, {\n platforms: options.platforms,\n });\n configSyncingStep.succeed('Config synced');\n } catch (error) {\n configSyncingStep.fail('Config sync failed');\n throw error;\n }\n\n // Install CocoaPods\n let podsInstalled: boolean = false;\n // err towards running pod install less because it's slow and users can easily run npx pod-install afterwards.\n if (options.platforms.includes('ios') && options.install && needsPodInstall) {\n const { installCocoaPodsAsync } = await import('../utils/cocoapods');\n\n podsInstalled = await installCocoaPodsAsync(projectRoot);\n } else {\n Log.debug('Skipped pod install');\n }\n\n return {\n packageManager,\n nodeInstall: !!options.install,\n podInstall: !podsInstalled,\n platforms: options.platforms,\n hasNewProjectFiles,\n exp,\n };\n}\n"],"names":["prebuildAsync","Log","projectRoot","options","clean","maybeBailOnGitStatusAsync","clearNativeFolder","platforms","promptToClearMalformedNativeProjectsAsync","ensureValidPlatforms","assertPlatforms","exp","pkg","ensureConfigAsync","hasNewProjectFiles","needsPodInstall","hasNewDependencies","updateFromTemplateAsync","template","resolveTemplateOption","undefined","skipDependencyUpdate","packageManager","resolvePackageManager","install","npm","yarn","installNodeDependenciesAsync","configSyncingStep","logNewSection","profile","configureProjectAsync","succeed","error","fail","podsInstalled","includes","installCocoaPodsAsync","debug","nodeInstall","podInstall"],"mappings":"AAAA;;;;QAqCsBA,aAAa,GAAbA,aAAa;AAlCvBC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACqD,IAAA,YAAsB,WAAtB,sBAAsB,CAAA;AAC5D,IAAA,IAAc,WAAd,cAAc,CAAA;AACpB,IAAA,QAAkB,WAAlB,kBAAkB,CAAA;AACmC,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AAC5D,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AAC7B,IAAA,kBAAqB,WAArB,qBAAqB,CAAA;AACsB,IAAA,eAAkB,WAAlB,kBAAkB,CAAA;AACvD,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;;;;AA0BvD,eAAeD,aAAa,CACjCE,WAAmB,EACnBC,OAaC,EACgC;IACjC,IAAIA,OAAO,CAACC,KAAK,EAAE;QACjB,MAAM,EAAEC,yBAAyB,CAAA,EAAE,GAAG,MAAM;mDAAO,cAAc;U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G,MAAME,qBAAqB,CAACnC,WAAW,CAAC,CAAC;KAC1D,MAAM;QACLD,GAAG,CAACqC,KAAK,CAAC,qBAAqB,CAAC,CAAC;KAClC;IAED,OAAO;QACLhB,cAAc;QACdiB,WAAW,EAAE,CAAC,CAACpC,OAAO,CAACqB,OAAO;QAC9BgB,UAAU,EAAE,CAACL,aAAa;QAC1B5B,SAAS,EAAEJ,OAAO,CAACI,SAAS;QAC5BO,kBAAkB;QAClBH,GAAG;KACJ,CAAC;CACH"}
@@ -4,15 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.expoRegister = void 0;
7
- var _chalk = _interopRequireDefault(require("chalk"));
8
- var Log = _interopRequireWildcard(require("../log"));
9
7
  var _args = require("../utils/args");
10
8
  var _errors = require("../utils/errors");
11
- function _interopRequireDefault(obj) {
12
- return obj && obj.__esModule ? obj : {
13
- default: obj
14
- };
15
- }
16
9
  function _interopRequireWildcard(obj) {
17
10
  if (obj && obj.__esModule) {
18
11
  return obj;
@@ -42,16 +35,8 @@ const expoRegister = async (argv)=>{
42
35
  "-h": "--help"
43
36
  }, argv);
44
37
  if (args["--help"]) {
45
- Log.exit(_chalk.default`
46
- {bold Description}
47
- Sign up for a new Expo account
48
-
49
- {bold Usage}
50
- $ npx expo register
51
-
52
- Options
53
- -h, --help Output usage information
54
- `, 0);
38
+ (0, _args).printHelp(`Sign up for a new Expo account`, `npx expo register`, // Options
39
+ `-h, --help Usage info`);
55
40
  }
56
41
  const { registerAsync } = await Promise.resolve().then(function() {
57
42
  return _interopRequireWildcard(require("./registerAsync"));
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/register/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertArgs } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoRegister: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n argv\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Sign up for a new Expo account\n\n {bold Usage}\n $ npx expo register\n\n Options\n -h, --help Output usage information\n `,\n 0\n );\n }\n\n const { registerAsync } = await import('./registerAsync');\n return registerAsync().catch(logCmdError);\n};\n"],"names":["Log","expoRegister","argv","args","assertArgs","Boolean","exit","chalk","registerAsync","catch","logCmdError"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACY,IAAA,KAAe,WAAf,eAAe,CAAA;AACd,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMC,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAQtB,CAAA,WARsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACDH,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACM,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;IASR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,MAAM,EAAEC,aAAa,CAAA,EAAE,GAAG,MAAM;+CAAO,iBAAiB;MAAC,AAAC;IAC1D,OAAOA,aAAa,EAAE,CAACC,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CAC3C,AAAC;QA7BWT,YAAY,GAAZA,YAAY"}
1
+ {"version":3,"sources":["../../../src/register/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { Command } from '../../bin/cli';\nimport { assertArgs, printHelp } from '../utils/args';\nimport { logCmdError } from '../utils/errors';\n\nexport const expoRegister: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n // Aliases\n '-h': '--help',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Sign up for a new Expo account`,\n `npx expo register`,\n // Options\n `-h, --help Usage info`\n );\n }\n\n const { registerAsync } = await import('./registerAsync');\n return registerAsync().catch(logCmdError);\n};\n"],"names":["expoRegister","argv","args","assertArgs","Boolean","printHelp","registerAsync","catch","logCmdError"],"mappings":"AAAA;;;;;;AAEsC,IAAA,KAAe,WAAf,eAAe,CAAA;AACzB,IAAA,OAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;AAEtC,MAAMA,YAAY,GAAY,OAAOC,IAAI,GAAK;IACnD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAQtB,CAAA,WARsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,UAAU;QACV,IAAI,EAAE,QAAQ;KACf,EACDH,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBG,CAAAA,GAAAA,KAAS,AAKR,CAAA,UALQ,CACP,CAAC,8BAA8B,CAAC,EAChC,CAAC,iBAAiB,CAAC,EACnB,UAAU;QACV,CAAC,wBAAwB,CAAC,CAC3B,CAAC;KACH;IAED,MAAM,EAAEC,aAAa,CAAA,EAAE,GAAG,MAAM;+CAAO,iBAAiB;MAAC,AAAC;IAC1D,OAAOA,aAAa,EAAE,CAACC,KAAK,CAACC,OAAW,YAAA,CAAC,CAAC;CAC3C,AAAC;QAtBWR,YAAY,GAAZA,YAAY"}
@@ -0,0 +1,97 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.expoRunAndroid = void 0;
7
+ var _chalk = _interopRequireDefault(require("chalk"));
8
+ var _path = _interopRequireDefault(require("path"));
9
+ var Log = _interopRequireWildcard(require("../../log"));
10
+ var _args = require("../../utils/args");
11
+ var _errors = require("../../utils/errors");
12
+ function _interopRequireDefault(obj) {
13
+ return obj && obj.__esModule ? obj : {
14
+ default: obj
15
+ };
16
+ }
17
+ function _interopRequireWildcard(obj) {
18
+ if (obj && obj.__esModule) {
19
+ return obj;
20
+ } else {
21
+ var newObj = {};
22
+ if (obj != null) {
23
+ for(var key in obj){
24
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
25
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
26
+ if (desc.get || desc.set) {
27
+ Object.defineProperty(newObj, key, desc);
28
+ } else {
29
+ newObj[key] = obj[key];
30
+ }
31
+ }
32
+ }
33
+ }
34
+ newObj.default = obj;
35
+ return newObj;
36
+ }
37
+ }
38
+ const expoRunAndroid = async (argv)=>{
39
+ const rawArgsMap = {
40
+ // Types
41
+ "--help": Boolean,
42
+ "--no-build-cache": Boolean,
43
+ "--no-install": Boolean,
44
+ "--no-bundler": Boolean,
45
+ "--variant": String,
46
+ "--port": Number,
47
+ // Aliases
48
+ "-p": "--port",
49
+ "-h": "--help"
50
+ };
51
+ const args = (0, _args).assertWithOptionsArgs(rawArgsMap, {
52
+ argv,
53
+ permissive: true
54
+ });
55
+ // '-d' -> '--device': Boolean,
56
+ if (args["--help"]) {
57
+ Log.exit(_chalk.default`
58
+ {bold Description}
59
+ Run the native Android app locally
60
+
61
+ {bold Usage}
62
+ $ npx expo run:android <dir>
63
+
64
+ {bold Options}
65
+ --no-build-cache Clear the native build cache
66
+ --no-install Skip installing dependencies
67
+ --no-bundler Skip starting the bundler
68
+ --variant <name> Build variant. {dim Default: debug}
69
+ -d, --device [device] Device name to run the app on
70
+ -p, --port <port> Port to start the dev server on. {dim Default: 8081}
71
+ -h, --help Output usage information
72
+ `, 0);
73
+ }
74
+ const { resolveStringOrBooleanArgsAsync } = await Promise.resolve().then(function() {
75
+ return _interopRequireWildcard(require("../../utils/resolveArgs"));
76
+ });
77
+ const parsed = await resolveStringOrBooleanArgsAsync(argv != null ? argv : [], rawArgsMap, {
78
+ "--device": Boolean,
79
+ "-d": "--device"
80
+ }).catch(_errors.logCmdError);
81
+ const { runAndroidAsync } = await Promise.resolve().then(function() {
82
+ return _interopRequireWildcard(require("./runAndroidAsync"));
83
+ });
84
+ return runAndroidAsync(_path.default.resolve(parsed.projectRoot), {
85
+ // Parsed options
86
+ buildCache: !args["--no-build-cache"],
87
+ install: !args["--no-install"],
88
+ bundler: !args["--no-bundler"],
89
+ port: args["--port"],
90
+ variant: args["--variant"],
91
+ // Custom parsed args
92
+ device: parsed.args["--device"]
93
+ }).catch(_errors.logCmdError);
94
+ };
95
+ exports.expoRunAndroid = expoRunAndroid;
96
+
97
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/run/android/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\nimport path from 'path';\n\nimport { Command } from '../../../bin/cli';\nimport * as Log from '../../log';\nimport { assertWithOptionsArgs } from '../../utils/args';\nimport { logCmdError } from '../../utils/errors';\n\nexport const expoRunAndroid: Command = async (argv) => {\n const rawArgsMap: arg.Spec = {\n // Types\n '--help': Boolean,\n '--no-build-cache': Boolean,\n '--no-install': Boolean,\n '--no-bundler': Boolean,\n '--variant': String,\n\n '--port': Number,\n // Aliases\n '-p': '--port',\n\n '-h': '--help',\n };\n const args = assertWithOptionsArgs(rawArgsMap, {\n argv,\n\n permissive: true,\n });\n\n // '-d' -> '--device': Boolean,\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Run the native Android app locally\n\n {bold Usage}\n $ npx expo run:android <dir>\n\n {bold Options} \n --no-build-cache Clear the native build cache\n --no-install Skip installing dependencies\n --no-bundler Skip starting the bundler\n --variant <name> Build variant. {dim Default: debug}\n -d, --device [device] Device name to run the app on\n -p, --port <port> Port to start the dev server on. {dim Default: 8081}\n -h, --help Output usage information\n`,\n 0\n );\n }\n\n const { resolveStringOrBooleanArgsAsync } = await import('../../utils/resolveArgs');\n const parsed = await resolveStringOrBooleanArgsAsync(argv ?? [], rawArgsMap, {\n '--device': Boolean,\n '-d': '--device',\n }).catch(logCmdError);\n\n const { runAndroidAsync } = await import('./runAndroidAsync');\n\n return runAndroidAsync(path.resolve(parsed.projectRoot), {\n // Parsed options\n buildCache: !args['--no-build-cache'],\n install: !args['--no-install'],\n bundler: !args['--no-bundler'],\n port: args['--port'],\n variant: args['--variant'],\n\n // Custom parsed args\n device: parsed.args['--device'],\n }).catch(logCmdError);\n};\n"],"names":["Log","expoRunAndroid","argv","rawArgsMap","Boolean","String","Number","args","assertWithOptionsArgs","permissive","exit","chalk","resolveStringOrBooleanArgsAsync","parsed","catch","logCmdError","runAndroidAsync","path","resolve","projectRoot","buildCache","install","bundler","port","variant","device"],"mappings":"AAAA;;;;;;AAEkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AACR,IAAA,KAAM,kCAAN,MAAM,EAAA;AAGXA,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACuB,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AAC5B,IAAA,OAAoB,WAApB,oBAAoB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzC,MAAMC,cAAc,GAAY,OAAOC,IAAI,GAAK;IACrD,MAAMC,UAAU,GAAa;QAC3B,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,kBAAkB,EAAEA,OAAO;QAC3B,cAAc,EAAEA,OAAO;QACvB,cAAc,EAAEA,OAAO;QACvB,WAAW,EAAEC,MAAM;QAEnB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QAEd,IAAI,EAAE,QAAQ;KACf,AAAC;IACF,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAqB,AAIhC,CAAA,sBAJgC,CAACL,UAAU,EAAE;QAC7CD,IAAI;QAEJO,UAAU,EAAE,IAAI;KACjB,CAAC,AAAC;IAEH,+BAA+B;IAE/B,IAAIF,IAAI,CAAC,QAAQ,CAAC,E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