@expo/cli 0.1.0 → 0.1.3

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 +18 -13
package/build/bin/cli CHANGED
@@ -31,6 +31,11 @@ function _interopRequireWildcard(obj) {
31
31
  const defaultCmd = "start";
32
32
  const commands = {
33
33
  // Add a new command here
34
+ "run:android": ()=>Promise.resolve().then(function() {
35
+ return _interopRequireWildcard(require("../src/run/android"));
36
+ }).then((i)=>i.expoRunAndroid
37
+ )
38
+ ,
34
39
  start: ()=>Promise.resolve().then(function() {
35
40
  return _interopRequireWildcard(require("../src/start"));
36
41
  }).then((i)=>i.expoStart
@@ -46,6 +51,11 @@ const commands = {
46
51
  }).then((i)=>i.expoConfig
47
52
  )
48
53
  ,
54
+ export: ()=>Promise.resolve().then(function() {
55
+ return _interopRequireWildcard(require("../src/export"));
56
+ }).then((i)=>i.expoExport
57
+ )
58
+ ,
49
59
  // Auxiliary commands
50
60
  install: ()=>Promise.resolve().then(function() {
51
61
  return _interopRequireWildcard(require("../src/install"));
@@ -85,27 +95,44 @@ const args = (0, _arg).default({
85
95
  });
86
96
  if (args["--version"]) {
87
97
  // Version is added in the build script.
88
- console.log("0.1.0");
98
+ console.log("0.1.3");
89
99
  process.exit(0);
90
100
  }
91
101
  // Check if we are running `npx expo <subcommand>` or `npx expo`
92
102
  const isSubcommand = Boolean(commands[args._[0]]);
93
103
  // Handle `--help` flag
94
104
  if (!isSubcommand && args["--help"]) {
105
+ const { login , logout , whoami , register , start , install , export: _export , config , prebuild , "run:android": runAndroid , ...others } = commands;
95
106
  console.log(_chalk.default`
96
- {bold Usage}
97
- {bold $} npx expo <command>
107
+ {bold Usage}
108
+ {dim $} npx expo <command>
98
109
 
99
- {bold Available commands}
100
- ${Object.keys(commands).sort().join(", ")}
110
+ {bold Commands}
111
+ ${Object.keys({
112
+ start,
113
+ install,
114
+ export: _export,
115
+ config,
116
+ ...others
117
+ }).join(", ")}
118
+ ${Object.keys({
119
+ "run:android": runAndroid,
120
+ prebuild
121
+ }).join(", ")}
122
+ {dim ${Object.keys({
123
+ login,
124
+ logout,
125
+ whoami,
126
+ register
127
+ }).join(", ")}}
101
128
 
102
- {bold Options}
103
- --version, -v Version number
104
- --help, -h Displays this message
129
+ {bold Options}
130
+ --version, -v Version number
131
+ --help, -h Usage info
105
132
 
106
- For more information run a command with the --help flag
107
- {bold $} expo start --help
108
- `);
133
+ For more info run a command with the {bold --help} flag
134
+ {dim $} npx expo start --help
135
+ `);
109
136
  process.exit(0);
110
137
  }
111
138
  const command = isSubcommand ? args._[0] : defaultCmd;
package/build/bin/cli.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n start: () => import('../src/start').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild').then((i) => i.expoPrebuild),\n config: () => import('../src/config').then((i) => i.expoConfig),\n\n // Auxiliary commands\n install: () => import('../src/install').then((i) => i.expoInstall),\n\n // Auth\n login: () => import('../src/login').then((i) => i.expoLogin),\n logout: () => import('../src/logout').then((i) => i.expoLogout),\n register: () => import('../src/register').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n console.log(chalk`\n {bold Usage}\n {bold $} npx expo <command>\n\n {bold Available commands}\n ${Object.keys(commands).sort().join(', ')}\n\n {bold Options}\n --version, -v Version number\n --help, -h Displays this message\n\n For more information run a command with the --help flag\n {bold $} expo start --help\n `);\n process.exit(0);\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => exec(commandArgs));\n"],"names":["defaultCmd","commands","start","then","i","expoStart","prebuild","expoPrebuild","config","expoConfig","install","expoInstall","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","process","env","__EXPO_VERSION","exit","isSubcommand","_","chalk","Object","keys","sort","join","command","commandArgs","slice","push","on","exec"],"mappings":"AAAA;;AACgB,IAAA,IAAK,kCAAL,KAAK,EAAA;AACH,IAAA,MAAO,kCAAP,OAAO,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzB,MAAMA,UAAU,GAAG,OAAO,AAAC;AAI3B,MAAMC,QAAQ,GAAkD;IAC9D,yBAAyB;IACzBC,KAAK,EAAE,IAAM;mDAAO,cAAc;UAAC,CAACC,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACC,SAAS;QAAA,CAAC;IAAA;IAC5DC,QAAQ,EAAE,IAAM;mDAAO,iBAAiB;UAAC,CAACH,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACG,YAAY;QAAA,CAAC;IAAA;IACrEC,MAAM,EAAE,IAAM;mDAAO,eAAe;UAAC,CAACL,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACK,UAAU;QAAA,CAAC;IAAA;IAE/D,qBAAqB;IACrBC,OAAO,EAAE,IAAM;mDAAO,gBAAgB;UAAC,CAACP,IAAI,CAAC,CAACC,CAAC,GAAKA,CAAC,CAACO,WAAW;QAAA,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Q,CAAC,CAACkC,IAAI,EAAE,CAACC,IAAI,CAAC,IAAI,CAAC,CAAC;;;;;;;;EAQ9C,CAAC,CAAC,CAAC;IACHV,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC,CAAC;CACjB;AAED,MAAMQ,OAAO,GAAGP,YAAY,GAAGV,IAAI,CAACW,CAAC,CAAC,CAAC,CAAC,GAAG/B,UAAU,AAAC;AACtD,MAAMsC,WAAW,GAAGR,YAAY,GAAGV,IAAI,CAACW,CAAC,CAACQ,KAAK,CAAC,CAAC,CAAC,GAAGnB,IAAI,CAACW,CAAC,AAAC;AAE5D,6CAA6C;AAC7C,IAAIX,IAAI,CAAC,QAAQ,CAAC,EAAE;IAClBkB,WAAW,CAACE,IAAI,CAAC,QAAQ,CAAC,CAAC;CAC5B;AAED,qBAAqB;AACrBd,OAAO,CAACe,EAAE,CAAC,QAAQ,EAAE,IAAMf,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAC5CH,OAAO,CAACe,EAAE,CAAC,SAAS,EAAE,IAAMf,OAAO,CAACG,IAAI,CAAC,CAAC,CAAC;AAAA,CAAC,CAAC;AAE7C5B,QAAQ,CAACoC,OAAO,CAAC,EAAE,CAAClC,IAAI,CAAC,CAACuC,IAAI,GAAKA,IAAI,CAACJ,WAAW,CAAC;AAAA,CAAC,CAAC"}
1
+ {"version":3,"sources":["../../bin/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport arg from 'arg';\nimport chalk from 'chalk';\n\nconst defaultCmd = 'start';\n\nexport type Command = (argv?: string[]) => void;\n\nconst commands: { [command: string]: () => Promise<Command> } = {\n // Add a new command here\n 'run:android': () => import('../src/run/android').then((i) => i.expoRunAndroid),\n start: () => import('../src/start').then((i) => i.expoStart),\n prebuild: () => import('../src/prebuild').then((i) => i.expoPrebuild),\n config: () => import('../src/config').then((i) => i.expoConfig),\n export: () => import('../src/export').then((i) => i.expoExport),\n\n // Auxiliary commands\n install: () => import('../src/install').then((i) => i.expoInstall),\n\n // Auth\n login: () => import('../src/login').then((i) => i.expoLogin),\n logout: () => import('../src/logout').then((i) => i.expoLogout),\n register: () => import('../src/register').then((i) => i.expoRegister),\n whoami: () => import('../src/whoami').then((i) => i.expoWhoami),\n};\n\nconst args = arg(\n {\n // Types\n '--version': Boolean,\n '--help': Boolean,\n\n // Aliases\n '-v': '--version',\n '-h': '--help',\n },\n {\n permissive: true,\n }\n);\n\nif (args['--version']) {\n // Version is added in the build script.\n console.log(process.env.__EXPO_VERSION);\n process.exit(0);\n}\n\n// Check if we are running `npx expo <subcommand>` or `npx expo`\nconst isSubcommand = Boolean(commands[args._[0]]);\n\n// Handle `--help` flag\nif (!isSubcommand && args['--help']) {\n const {\n login,\n logout,\n whoami,\n register,\n start,\n install,\n export: _export,\n config,\n prebuild,\n 'run:android': runAndroid,\n ...others\n } = commands;\n\n console.log(chalk`\n {bold Usage}\n {dim $} npx expo <command>\n\n {bold Commands}\n ${Object.keys({ start, install, export: _export, config, ...others }).join(', ')}\n ${Object.keys({ 'run:android': runAndroid, prebuild }).join(', ')}\n {dim ${Object.keys({ login, logout, whoami, register }).join(', ')}}\n\n {bold Options}\n --version, -v Version number\n --help, -h Usage info\n\n For more info run a command with the {bold --help} flag\n {dim $} npx expo start --help\n`);\n process.exit(0);\n}\n\nconst command = isSubcommand ? args._[0] : defaultCmd;\nconst commandArgs = isSubcommand ? args._.slice(1) : args._;\n\n// Push the help flag to the subcommand args.\nif (args['--help']) {\n commandArgs.push('--help');\n}\n\n// Install exit hooks\nprocess.on('SIGINT', () => process.exit(0));\nprocess.on('SIGTERM', () => process.exit(0));\n\ncommands[command]().then((exec) => exec(commandArgs));\n"],"names":["defaultCmd","commands","then","i","expoRunAndroid","start","expoStart","prebuild","expoPrebuild","config","expoConfig","export","expoExport","install","expoInstall","login","expoLogin","logout","expoLogout","register","expoRegister","whoami","expoWhoami","args","arg","Boolean","permissive","console","log","process","env","__EXPO_VERSION","exit","isSubcommand","_","_export","runA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Property(exports, "__esModule", {
5
5
  });
6
6
  exports.expoConfig = 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 : {
@@ -45,22 +44,13 @@ const expoConfig = async (argv)=>{
45
44
  "-t": "--type"
46
45
  }, argv);
47
46
  if (args["--help"]) {
48
- Log.exit(_chalk.default`
49
- {bold Description}
50
- Show the project config
51
-
52
- {bold Usage}
53
- $ npx expo config <dir>
54
-
55
- <dir> is the directory of the Expo project.
56
- Defaults to the current working directory.
57
-
58
- Options
59
- --full Include all project config data
60
- --json Output in JSON format
61
- -t, --type <public|prebuild|introspect> Type of config to show
62
- -h, --help Output usage information
63
- `, 0);
47
+ (0, _args).printHelp(`Show the project config`, _chalk.default`npx expo config {dim <dir>}`, [
48
+ _chalk.default`<dir> Directory of the Expo project. {dim Default: Current working directory}`,
49
+ `--full Include all project config data`,
50
+ `--json Output in JSON format`,
51
+ `-t, --type <public|prebuild|introspect> Type of config to show`,
52
+ `-h, --help Usage info`,
53
+ ].join("\n"));
64
54
  }
65
55
  // Load modules after the help prompt so `npx expo config -h` shows as fast as possible.
66
56
  const [// ./configAsync
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/config/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport * as Log from '../log';\nimport { assertArgs, getProjectRoot } from '../utils/args';\n\nexport const expoConfig: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--full': Boolean,\n '--json': Boolean,\n '--type': String,\n // Aliases\n '-h': '--help',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n Log.exit(\n chalk`\n {bold Description}\n Show the project config\n\n {bold Usage}\n $ npx expo config <dir>\n\n <dir> is the directory of the Expo project.\n Defaults to the current working directory.\n\n Options\n --full Include all project config data\n --json Output in JSON format\n -t, --type <public|prebuild|introspect> Type of config to show\n -h, --help Output usage information\n `,\n 0\n );\n }\n\n // Load modules after the help prompt so `npx expo config -h` shows as fast as possible.\n const [\n // ./configAsync\n { configAsync },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([import('./configAsync'), import('../utils/errors')]);\n\n return configAsync(getProjectRoot(args), {\n // Parsed options\n full: args['--full'],\n json: args['--json'],\n type: args['--type'],\n }).catch(logCmdError);\n};\n"],"names":["Log","expoConfig","argv","args","assertArgs","Boolean","String","exit","chalk","configAsync","logCmdError","Promise","all","getProjectRoot","full","json","type","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAGbA,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAC4B,IAAA,KAAe,WAAf,eAAe,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEnD,MAAMC,UAAU,GAAY,OAAOC,IAAI,GAAK;IACjD,MAAMC,IAAI,GAAGC,CAAAA,GAAAA,KAAU,AAYtB,CAAA,WAZsB,CACrB;QACE,QAAQ;QACR,QAAQ,EAAEC,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEA,OAAO;QACjB,QAAQ,EAAEC,MAAM;QAChB,UAAU;QACV,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,QAAQ;KACf,EACDJ,IAAI,CACL,AAAC;IAEF,IAAIC,IAAI,CAAC,QAAQ,CAAC,EAAE;QAClBH,GAAG,CAACO,IAAI,CACNC,MAAK,QAAA,CAAC;;;;;;;;;;;;;;;IAeR,CAAC,EACC,CAAC,CACF,CAAC;KACH;IAED,wFAAwF;IACxF,MAAM,CACJ,gBAAgB;IAChB,EAAEC,WAAW,CAAA,EAAE,EACf,kBAAkB;IAClB,EAAEC,WAAW,CAAA,EAAE,GAChB,GAAG,MAAMC,OAAO,CAACC,GAAG,CAAC;QAAC;mDAAO,eAAe;UAAC;QAAE;mDAAO,iBAAiB;UAAC;KAAC,CAAC,AAAC;IAE5E,OAAOH,WAAW,CAACI,CAAAA,GAAAA,KAAc,AAAM,CAAA,eAAN,CAACV,IAAI,CAAC,EAAE;QACvC,iBAAiB;QACjBW,IAAI,EAAEX,IAAI,CAAC,QAAQ,CAAC;QACpBY,IAAI,EAAEZ,IAAI,CAAC,QAAQ,CAAC;QACpBa,IAAI,EAAEb,IAAI,CAAC,QAAQ,CAAC;KACrB,CAAC,CAACc,KAAK,CAACP,WAAW,CAAC,CAAC;CACvB,AAAC;QAnDWT,UAAU,GAAVA,UAAU"}
1
+ {"version":3,"sources":["../../../src/config/index.ts"],"sourcesContent":["#!/usr/bin/env node\nimport chalk from 'chalk';\n\nimport { Command } from '../../bin/cli';\nimport { assertArgs, getProjectRoot, printHelp } from '../utils/args';\n\nexport const expoConfig: Command = async (argv) => {\n const args = assertArgs(\n {\n // Types\n '--help': Boolean,\n '--full': Boolean,\n '--json': Boolean,\n '--type': String,\n // Aliases\n '-h': '--help',\n '-t': '--type',\n },\n argv\n );\n\n if (args['--help']) {\n printHelp(\n `Show the project config`,\n chalk`npx expo config {dim <dir>}`,\n [\n chalk`<dir> Directory of the Expo project. {dim Default: Current working directory}`,\n `--full Include all project config data`,\n `--json Output in JSON format`,\n `-t, --type <public|prebuild|introspect> Type of config to show`,\n `-h, --help Usage info`,\n ].join('\\n')\n );\n }\n\n // Load modules after the help prompt so `npx expo config -h` shows as fast as possible.\n const [\n // ./configAsync\n { configAsync },\n // ../utils/errors\n { logCmdError },\n ] = await Promise.all([import('./configAsync'), import('../utils/errors')]);\n\n return configAsync(getProjectRoot(args), {\n // Parsed options\n full: args['--full'],\n json: args['--json'],\n type: args['--type'],\n }).catch(logCmdError);\n};\n"],"names":["expoConfig","argv","args","assertArgs","Boolean","String","printHelp","chalk","join","configAsync","logCmdError","Promise","all","getProjectRoot","full","json","type","catch"],"mappings":"AAAA;;;;;;AACkB,IAAA,MAAO,kCAAP,OAAO,EAAA;AAG6B,IAAA,KAAe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AACP,WAAW,CAAC,CAAC;CACvB,AAAC;QA3CWV,UAAU,GAAVA,UAAU"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.createBundlesAsync = createBundlesAsync;
6
+ var _config = require("@expo/config");
7
+ var Log = _interopRequireWildcard(require("../log"));
8
+ var _resolveEntryPoint = require("../start/server/middleware/resolveEntryPoint");
9
+ var _forkBundleAsync = require("./fork-bundleAsync");
10
+ function _interopRequireWildcard(obj) {
11
+ if (obj && obj.__esModule) {
12
+ return obj;
13
+ } else {
14
+ var newObj = {};
15
+ if (obj != null) {
16
+ for(var key in obj){
17
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
18
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
19
+ if (desc.get || desc.set) {
20
+ Object.defineProperty(newObj, key, desc);
21
+ } else {
22
+ newObj[key] = obj[key];
23
+ }
24
+ }
25
+ }
26
+ }
27
+ newObj.default = obj;
28
+ return newObj;
29
+ }
30
+ }
31
+ async function createBundlesAsync(projectRoot, publishOptions = {}, bundleOptions) {
32
+ const { exp } = (0, _config).getConfig(projectRoot, {
33
+ skipSDKVersionRequirement: true
34
+ });
35
+ const bundles = await (0, _forkBundleAsync).bundleAsync(projectRoot, exp, {
36
+ // If not legacy, ignore the target option to prevent warnings from being thrown.
37
+ resetCache: publishOptions.resetCache,
38
+ maxWorkers: publishOptions.maxWorkers,
39
+ logger: {
40
+ info (tag, message) {
41
+ Log.log(message);
42
+ },
43
+ error (tag, message) {
44
+ Log.error(message);
45
+ }
46
+ },
47
+ quiet: false
48
+ }, bundleOptions.platforms.map((platform)=>({
49
+ platform,
50
+ entryPoint: (0, _resolveEntryPoint).resolveEntryPoint(projectRoot, platform),
51
+ dev: bundleOptions.dev
52
+ })
53
+ ));
54
+ // { ios: bundle, android: bundle }
55
+ return bundleOptions.platforms.reduce((prev, platform, index)=>({
56
+ ...prev,
57
+ [platform]: bundles[index]
58
+ })
59
+ , {});
60
+ }
61
+
62
+ //# sourceMappingURL=createBundles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/createBundles.ts"],"sourcesContent":["import { getConfig, Platform, ProjectTarget } from '@expo/config';\n\nimport * as Log from '../log';\nimport { resolveEntryPoint } from '../start/server/middleware/resolveEntryPoint';\nimport { bundleAsync, BundleOutput } from './fork-bundleAsync';\n\nexport type PublishOptions = {\n releaseChannel?: string;\n target?: ProjectTarget;\n resetCache?: boolean;\n maxWorkers?: number;\n};\n\n// TODO: Reduce layers of indirection\nexport async function createBundlesAsync(\n projectRoot: string,\n publishOptions: PublishOptions = {},\n bundleOptions: { platforms: Platform[]; dev?: boolean; useDevServer: boolean }\n): Promise<Partial<Record<Platform, BundleOutput>>> {\n const { exp } = getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n const bundles = await bundleAsync(\n projectRoot,\n exp,\n {\n // If not legacy, ignore the target option to prevent warnings from being thrown.\n resetCache: publishOptions.resetCache,\n maxWorkers: publishOptions.maxWorkers,\n logger: {\n info(tag: unknown, message: string) {\n Log.log(message);\n },\n error(tag: unknown, message: string) {\n Log.error(message);\n },\n } as any,\n quiet: false,\n },\n bundleOptions.platforms.map((platform: Platform) => ({\n platform,\n entryPoint: resolveEntryPoint(projectRoot, platform),\n dev: bundleOptions.dev,\n }))\n );\n\n // { ios: bundle, android: bundle }\n return bundleOptions.platforms.reduce<Partial<Record<Platform, BundleOutput>>>(\n (prev, platform, index) => ({\n ...prev,\n [platform]: bundles[index],\n }),\n {}\n );\n}\n"],"names":["createBundlesAsync","Log","projectRoot","publishOptions","bundleOptions","exp","getConfig","skipSDKVersionRequirement","bundles","bundleAsync","resetCache","maxWorkers","logger","info","tag","message","log","error","quiet","platforms","map","platform","entryPoint","resolveEntryPoint","dev","reduce","prev","index"],"mappings":"AAAA;;;;QAcsBA,kBAAkB,GAAlBA,kBAAkB;AAdW,IAAA,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AAC;YAC1B,GAAGD,IAAI;YACP,CAACL,QAAQ,CAAC,EAAEb,OAAO,CAACmB,KAAK,CAAC;SAC3B,CAAC;IAAA,EACF,EAAE,CACH,CAAC;CACH"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.createMetadataJson = createMetadataJson;
6
+ var _path = _interopRequireDefault(require("path"));
7
+ function _interopRequireDefault(obj) {
8
+ return obj && obj.__esModule ? obj : {
9
+ default: obj
10
+ };
11
+ }
12
+ function createMetadataJson({ bundles , fileNames }) {
13
+ // Build metadata.json
14
+ return {
15
+ version: 0,
16
+ bundler: "metro",
17
+ fileMetadata: Object.entries(bundles).reduce((metadata, [platform, bundle])=>({
18
+ ...metadata,
19
+ [platform]: {
20
+ // Get the filename for each platform's bundle.
21
+ bundle: _path.default.join("bundles", fileNames[platform]),
22
+ // Collect all of the assets and convert them to the serial format.
23
+ assets: bundle.assets.map((asset)=>// Each asset has multiple hashes which we convert and then flatten.
24
+ asset.fileHashes.map((hash)=>({
25
+ path: _path.default.join("assets", hash),
26
+ ext: asset.type
27
+ })
28
+ )
29
+ ).flat()
30
+ }
31
+ })
32
+ , {})
33
+ };
34
+ }
35
+
36
+ //# sourceMappingURL=createMetadataJson.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/createMetadataJson.ts"],"sourcesContent":["import type { BundleOutput } from '@expo/dev-server';\nimport path from 'path';\n\nexport type BundlePlatform = 'android' | 'ios';\n\ntype PlatformMetadataAsset = { path: string; ext: string };\n\ntype PlatformMetadata = { bundle: string; assets: PlatformMetadataAsset[] };\n\ntype FileMetadata = {\n [key in BundlePlatform]: PlatformMetadata;\n};\n\nexport function createMetadataJson({\n bundles,\n fileNames,\n}: {\n bundles: Partial<Record<BundlePlatform, Pick<BundleOutput, 'assets'>>>;\n fileNames: Record<string, string>;\n}): {\n version: 0;\n bundler: 'metro';\n fileMetadata: FileMetadata;\n} {\n // Build metadata.json\n return {\n version: 0,\n bundler: 'metro',\n fileMetadata: Object.entries(bundles).reduce<Record<string, Partial<PlatformMetadata>>>(\n (metadata, [platform, bundle]) => ({\n ...metadata,\n [platform]: {\n // Get the filename for each platform's bundle.\n bundle: path.join('bundles', fileNames[platform]!),\n // Collect all of the assets and convert them to the serial format.\n assets: bundle.assets\n .map((asset) =>\n // Each asset has multiple hashes which we convert and then flatten.\n asset.fileHashes.map((hash) => ({\n path: path.join('assets', hash),\n ext: asset.type,\n }))\n )\n .flat(),\n },\n }),\n {}\n ) as FileMetadata,\n };\n}\n"],"names":["createMetadataJson","bundles","fileNames","version","bundler","fileMetadata","Object","entries","reduce","metadata","platform","bundle","path","join","assets","map","asset","fileHashes","hash","ext","type","flat"],"mappings":"AAAA;;;;QAagBA,kBAAkB,GAAlBA,kBAAkB;AAZjB,IAAA,KAAM,kCAAN,MAAM,EAAA;;;;;;AAYhB,SAASA,kBAAkB,CAAC,EACjCC,OAAO,CAAA,EACPC,SAAS,CAAA,EAIV,EAIC;IACA,sBAAsB;IACtB,OAAO;QACLC,OAAO,EAAE,CAAC;QACVC,OAAO,EAAE,OAAO;QAChBC,YAAY,EAAEC,MAAM,CAACC,OAAO,CAACN,OAAO,CAAC,CAACO,MAAM,CAC1C,CAACC,QAAQ,EAAE,CAACC,QAAQ,EAAEC,MAAM,CAAC,GAAK,CAAC;gBACjC,GAAGF,QAAQ;gBACX,CAACC,QAAQ,CAAC,EAAE;oBACV,+CAA+C;oBAC/CC,MAAM,EAAEC,KAAI,QAAA,CAACC,IAAI,CAAC,SAAS,EAAEX,SAAS,CAACQ,QAAQ,CAAC,CAAE;oBAClD,mEAAmE;oBACnEI,MAAM,EAAEH,MAAM,CAACG,MAAM,CAClBC,GAAG,CAAC,CAACC,KAAK,GACT,oEAAoE;wBACpEA,KAAK,CAACC,UAAU,CAACF,GAAG,CAAC,CAACG,IAAI,GAAK,CAAC;gCAC9BN,IAAI,EAAEA,KAAI,QAAA,CAACC,IAAI,CAAC,QAAQ,EAAEK,IAAI,CAAC;gCAC/BC,GAAG,EAAEH,KAAK,CAACI,IAAI;6BAChB,CAAC;wBAAA,CAAC;oBAAA,CACJ,CACAC,IAAI,EAAE;iBACV;aACF,CAAC;QAAA,EACF,EAAE,CACH;KACF,CAAC;CACH"}
@@ -0,0 +1,102 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.exportAppAsync = exportAppAsync;
6
+ var _path = _interopRequireDefault(require("path"));
7
+ var Log = _interopRequireWildcard(require("../log"));
8
+ var _dir = require("../utils/dir");
9
+ var _createBundles = require("./createBundles");
10
+ var _exportAssets = require("./exportAssets");
11
+ var _getPublicExpoManifest = require("./getPublicExpoManifest");
12
+ var _printBundleSizes = require("./printBundleSizes");
13
+ var _writeContents = require("./writeContents");
14
+ function _interopRequireDefault(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ function _interopRequireWildcard(obj) {
20
+ if (obj && obj.__esModule) {
21
+ return obj;
22
+ } else {
23
+ var newObj = {};
24
+ if (obj != null) {
25
+ for(var key in obj){
26
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
27
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
28
+ if (desc.get || desc.set) {
29
+ Object.defineProperty(newObj, key, desc);
30
+ } else {
31
+ newObj[key] = obj[key];
32
+ }
33
+ }
34
+ }
35
+ }
36
+ newObj.default = obj;
37
+ return newObj;
38
+ }
39
+ }
40
+ async function exportAppAsync(projectRoot, { platforms , outputDir , clear , dev , dumpAssetmap , dumpSourcemap }) {
41
+ const exp = await (0, _getPublicExpoManifest).getPublicExpoManifestAsync(projectRoot);
42
+ const outputPath = _path.default.resolve(projectRoot, outputDir);
43
+ const assetsPath = _path.default.join(outputPath, "assets");
44
+ const bundlesPath = _path.default.join(outputPath, "bundles");
45
+ await Promise.all([
46
+ assetsPath,
47
+ bundlesPath
48
+ ].map(_dir.ensureDirectoryAsync));
49
+ // Run metro bundler and create the JS bundles/source maps.
50
+ const bundles = await (0, _createBundles).createBundlesAsync(projectRoot, {
51
+ resetCache: !!clear
52
+ }, {
53
+ platforms,
54
+ dev,
55
+ useDevServer: true
56
+ });
57
+ // Log bundle size info to the user
58
+ (0, _printBundleSizes).printBundleSizes(bundles);
59
+ // Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).
60
+ const { hashes , fileNames } = await (0, _writeContents).writeBundlesAsync({
61
+ bundles,
62
+ outputDir: bundlesPath
63
+ });
64
+ Log.log("Finished saving JS Bundles");
65
+ const { assets } = await (0, _exportAssets).exportAssetsAsync(projectRoot, {
66
+ exp,
67
+ outputDir: outputPath,
68
+ bundles
69
+ });
70
+ if (dumpAssetmap) {
71
+ Log.log("Dumping asset map");
72
+ await (0, _writeContents).writeAssetMapAsync({
73
+ outputDir: outputPath,
74
+ assets
75
+ });
76
+ }
77
+ // build source maps
78
+ if (dumpSourcemap) {
79
+ Log.log("Dumping source maps");
80
+ await (0, _writeContents).writeSourceMapsAsync({
81
+ bundles,
82
+ hashes,
83
+ outputDir: bundlesPath,
84
+ fileNames
85
+ });
86
+ Log.log("Preparing additional debugging files");
87
+ // If we output source maps, then add a debug HTML file which the user can open in
88
+ // the web browser to inspect the output like web.
89
+ await (0, _writeContents).writeDebugHtmlAsync({
90
+ outputDir: outputPath,
91
+ fileNames
92
+ });
93
+ }
94
+ // Generate a `metadata.json` and the export is complete.
95
+ await (0, _writeContents).writeMetadataJsonAsync({
96
+ outputDir,
97
+ bundles,
98
+ fileNames
99
+ });
100
+ }
101
+
102
+ //# sourceMappingURL=exportApp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import path from 'path';\n\nimport * as Log from '../log';\nimport { ensureDirectoryAsync } from '../utils/dir';\nimport { createBundlesAsync } from './createBundles';\nimport { exportAssetsAsync } from './exportAssets';\nimport { getPublicExpoManifestAsync } from './getPublicExpoManifest';\nimport { printBundleSizes } from './printBundleSizes';\nimport { Options } from './resolveOptions';\nimport {\n writeAssetMapAsync,\n writeBundlesAsync,\n writeDebugHtmlAsync,\n writeMetadataJsonAsync,\n writeSourceMapsAsync,\n} from './writeContents';\n\n/**\n * The structure of the outputDir will be:\n *\n * ```\n * ├── assets\n * │ └── *\n * ├── bundles\n * │ ├── android-01ee6e3ab3e8c16a4d926c91808d5320.js\n * │ └── ios-ee8206cc754d3f7aa9123b7f909d94ea.js\n * └── metadata.json\n * ```\n */\nexport async function exportAppAsync(\n projectRoot: string,\n {\n platforms,\n outputDir,\n clear,\n dev,\n dumpAssetmap,\n dumpSourcemap,\n }: Pick<Options, 'dumpAssetmap' | 'dumpSourcemap' | 'dev' | 'clear' | 'outputDir' | 'platforms'>\n): Promise<void> {\n const exp = await getPublicExpoManifestAsync(projectRoot);\n\n const outputPath = path.resolve(projectRoot, outputDir);\n const assetsPath = path.join(outputPath, 'assets');\n const bundlesPath = path.join(outputPath, 'bundles');\n\n await Promise.all([assetsPath, bundlesPath].map(ensureDirectoryAsync));\n\n // Run metro bundler and create the JS bundles/source maps.\n const bundles = await createBundlesAsync(\n projectRoot,\n { resetCache: !!clear },\n {\n platforms,\n dev,\n useDevServer: true,\n // TODO: Disable source map generation if we aren't outputting them.\n }\n );\n\n // Log bundle size info to the user\n printBundleSizes(bundles);\n\n // Write the JS bundles to disk, and get the bundle file names (this could change with async chunk loading support).\n const { hashes, fileNames } = await writeBundlesAsync({ bundles, outputDir: bundlesPath });\n\n Log.log('Finished saving JS Bundles');\n\n const { assets } = await exportAssetsAsync(projectRoot, {\n exp,\n outputDir: outputPath,\n bundles,\n });\n\n if (dumpAssetmap) {\n Log.log('Dumping asset map');\n await writeAssetMapAsync({ outputDir: outputPath, assets });\n }\n\n // build source maps\n if (dumpSourcemap) {\n Log.log('Dumping source maps');\n await writeSourceMapsAsync({\n bundles,\n hashes,\n outputDir: bundlesPath,\n fileNames,\n });\n\n Log.log('Preparing additional debugging files');\n // If we output source maps, then add a debug HTML file which the user can open in\n // the web browser to inspect the output like web.\n await writeDebugHtmlAsync({\n outputDir: outputPath,\n fileNames,\n });\n }\n\n // Generate a `metadata.json` and the export is complete.\n await writeMetadataJsonAsync({ outputDir, bundles, fileNames });\n}\n"],"names":["exportAppAsync","Log","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","dumpSourcemap","exp","getPublicExpoManifestAsync","outputPath","path","resolve","assetsPath","join","bundlesPath","Promise","all","map","ensureDirectoryAsync","bundles","createBundlesAsync","resetCache","useDevServer","printBundleSizes","hashes","fileNames","writeBundlesAsync","log","assets","exportAssetsAsync","writeAssetMapAsync","writeSourceMapsAsync","writeDebugHtmlAsync","writeMetadataJsonAsync"],"mappings":"AAAA;;;;QA6BsBA,cAAc,GAAdA,cAAc;AA7BnB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACsB,IAAA,IAAc,WAAd,cAAc,CAAA;AAChB,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;AAClB,IAAA,aAAgB,WAAhB,gBAAgB,CAAA;AACP,IAAA,sBAAyB,WAAzB,yBAAyB,CAAA;AACnC,IAAA,iBAAoB,WAApB,oBAAoB,CAAA;AAQ9C,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcjB,eAAeD,cAAc,CAClCE,WAAmB,EACnB,EACEC,SAAS,CAAA,EACTC,SAAS,CAAA,EACTC,KAAK,CAAA,EACLC,GAAG,CAAA,EACHC,YAAY,CAAA,EACZC,aAAa,CAAA,EACiF,EACjF;IACf,MAAMC,GAAG,GAAG,MAAMC,CAAAA,GAAAA,sBAA0B,AAAa,CAAA,2BAAb,CAACR,WAAW,CAAC,AAAC;IAE1D,MAAMS,UAAU,GAAGC,KAAI,QAAA,CAACC,OAAO,CAACX,WAAW,EAAEE,SAAS,CAAC,A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MAAM;SAAE,CAAC,CAAC;KAC7D;IAED,oBAAoB;IACpB,IAAItB,aAAa,EAAE;QACjBP,GAAG,CAAC4B,GAAG,CAAC,qBAAqB,CAAC,CAAC;QAC/B,MAAMI,CAAAA,GAAAA,cAAoB,AAKxB,CAAA,qBALwB,CAAC;YACzBZ,OAAO;YACPK,MAAM;YACNtB,SAAS,EAAEY,WAAW;YACtBW,SAAS;SACV,CAAC,CAAC;QAEH1B,GAAG,CAAC4B,GAAG,CAAC,sCAAsC,CAAC,CAAC;QAChD,kFAAkF;QAClF,kDAAkD;QAClD,MAAMK,CAAAA,GAAAA,cAAmB,AAGvB,CAAA,oBAHuB,CAAC;YACxB9B,SAAS,EAAEO,UAAU;YACrBgB,SAAS;SACV,CAAC,CAAC;KACJ;IAED,yDAAyD;IACzD,MAAMQ,CAAAA,GAAAA,cAAsB,AAAmC,CAAA,uBAAnC,CAAC;QAAE/B,SAAS;QAAEiB,OAAO;QAAEM,SAAS;KAAE,CAAC,CAAC;CACjE"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.resolveAssetBundlePatternsAsync = resolveAssetBundlePatternsAsync;
6
+ exports.exportAssetsAsync = exportAssetsAsync;
7
+ var _minimatch = _interopRequireDefault(require("minimatch"));
8
+ var _path = _interopRequireDefault(require("path"));
9
+ var Log = _interopRequireWildcard(require("../log"));
10
+ var _resolveAssets = require("../start/server/middleware/resolveAssets");
11
+ var _array = require("../utils/array");
12
+ var _saveAssets = require("./saveAssets");
13
+ function _interopRequireDefault(obj) {
14
+ return obj && obj.__esModule ? obj : {
15
+ default: obj
16
+ };
17
+ }
18
+ function _interopRequireWildcard(obj) {
19
+ if (obj && obj.__esModule) {
20
+ return obj;
21
+ } else {
22
+ var newObj = {};
23
+ if (obj != null) {
24
+ for(var key in obj){
25
+ if (Object.prototype.hasOwnProperty.call(obj, key)) {
26
+ var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {};
27
+ if (desc.get || desc.set) {
28
+ Object.defineProperty(newObj, key, desc);
29
+ } else {
30
+ newObj[key] = obj[key];
31
+ }
32
+ }
33
+ }
34
+ }
35
+ newObj.default = obj;
36
+ return newObj;
37
+ }
38
+ }
39
+ async function resolveAssetBundlePatternsAsync(projectRoot, exp, assets) {
40
+ var ref1;
41
+ if (!((ref1 = exp.assetBundlePatterns) == null ? void 0 : ref1.length) || !assets.length) {
42
+ delete exp.assetBundlePatterns;
43
+ return exp;
44
+ }
45
+ // Convert asset patterns to a list of asset strings that match them.
46
+ // Assets strings are formatted as `asset_<hash>.<type>` and represent
47
+ // the name that the file will have in the app bundle. The `asset_` prefix is
48
+ // needed because android doesn't support assets that start with numbers.
49
+ const fullPatterns = exp.assetBundlePatterns.map((p)=>_path.default.join(projectRoot, p)
50
+ );
51
+ logPatterns(fullPatterns);
52
+ const allBundledAssets = assets.map((asset)=>{
53
+ const shouldBundle = shouldBundleAsset(asset, fullPatterns);
54
+ if (shouldBundle) {
55
+ var ref;
56
+ Log.debug(`${shouldBundle ? "Include" : "Exclude"} asset ${(ref = asset.files) == null ? void 0 : ref[0]}`);
57
+ return asset.fileHashes.map((hash)=>"asset_" + hash + ("type" in asset && asset.type ? "." + asset.type : "")
58
+ );
59
+ }
60
+ return [];
61
+ }).flat();
62
+ // The assets returned by the RN packager has duplicates so make sure we
63
+ // only bundle each once.
64
+ exp.bundledAssets = [
65
+ ...new Set(allBundledAssets)
66
+ ];
67
+ delete exp.assetBundlePatterns;
68
+ return exp;
69
+ }
70
+ function logPatterns(patterns) {
71
+ // Only log the patterns in debug mode, if they aren't already defined in the app.json, then all files will be targeted.
72
+ Log.log("\nProcessing asset bundle patterns:");
73
+ patterns.forEach((p)=>Log.log("- " + p)
74
+ );
75
+ }
76
+ function shouldBundleAsset(asset, patterns) {
77
+ var ref;
78
+ const file = (ref = asset.files) == null ? void 0 : ref[0];
79
+ return !!("__packager_asset" in asset && asset.__packager_asset && file && patterns.some((pattern)=>(0, _minimatch).default(file, pattern)
80
+ ));
81
+ }
82
+ async function exportAssetsAsync(projectRoot, { exp , outputDir , bundles }) {
83
+ var ref;
84
+ const assets = (0, _array).uniqBy(Object.values(bundles).flatMap((bundle)=>bundle.assets
85
+ ), (asset)=>asset.hash
86
+ );
87
+ if ((ref = assets[0]) == null ? void 0 : ref.fileHashes) {
88
+ Log.log("Saving assets");
89
+ await (0, _saveAssets).saveAssetsAsync(projectRoot, {
90
+ assets,
91
+ outputDir
92
+ });
93
+ } else {
94
+ Log.log("No assets to upload, skipped.");
95
+ }
96
+ // Add google services file if it exists
97
+ await (0, _resolveAssets).resolveGoogleServicesFile(projectRoot, exp);
98
+ // Updates the manifest to reflect additional asset bundling + configs
99
+ await resolveAssetBundlePatternsAsync(projectRoot, exp, assets);
100
+ return {
101
+ exp,
102
+ assets
103
+ };
104
+ }
105
+
106
+ //# sourceMappingURL=exportAssets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/exportAssets.ts"],"sourcesContent":["import { ExpoAppManifest } from '@expo/config';\nimport { ModPlatform } from '@expo/config-plugins';\nimport { BundleOutput } from '@expo/dev-server';\nimport minimatch from 'minimatch';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { resolveGoogleServicesFile } from '../start/server/middleware/resolveAssets';\nimport { uniqBy } from '../utils/array';\nimport { Asset, saveAssetsAsync } from './saveAssets';\n\n/**\n * Resolves the assetBundlePatterns from the manifest and returns a list of assets to bundle.\n *\n * @modifies {exp}\n */\nexport async function resolveAssetBundlePatternsAsync(\n projectRoot: string,\n exp: Pick<ExpoAppManifest, 'bundledAssets' | 'assetBundlePatterns'>,\n assets: Asset[]\n) {\n if (!exp.assetBundlePatterns?.length || !assets.length) {\n delete exp.assetBundlePatterns;\n return exp;\n }\n // Convert asset patterns to a list of asset strings that match them.\n // Assets strings are formatted as `asset_<hash>.<type>` and represent\n // the name that the file will have in the app bundle. The `asset_` prefix is\n // needed because android doesn't support assets that start with numbers.\n\n const fullPatterns: string[] = exp.assetBundlePatterns.map((p: string) =>\n path.join(projectRoot, p)\n );\n\n logPatterns(fullPatterns);\n\n const allBundledAssets = assets\n .map((asset) => {\n const shouldBundle = shouldBundleAsset(asset, fullPatterns);\n if (shouldBundle) {\n Log.debug(`${shouldBundle ? 'Include' : 'Exclude'} asset ${asset.files?.[0]}`);\n return asset.fileHashes.map(\n (hash) => 'asset_' + hash + ('type' in asset && asset.type ? '.' + asset.type : '')\n );\n }\n return [];\n })\n .flat();\n\n // The assets returned by the RN packager has duplicates so make sure we\n // only bundle each once.\n exp.bundledAssets = [...new Set(allBundledAssets)];\n delete exp.assetBundlePatterns;\n\n return exp;\n}\n\nfunction logPatterns(patterns: string[]) {\n // Only log the patterns in debug mode, if they aren't already defined in the app.json, then all files will be targeted.\n Log.log('\\nProcessing asset bundle patterns:');\n patterns.forEach((p) => Log.log('- ' + p));\n}\n\nfunction shouldBundleAsset(asset: Asset, patterns: string[]) {\n const file = asset.files?.[0];\n return !!(\n '__packager_asset' in asset &&\n asset.__packager_asset &&\n file &&\n patterns.some((pattern) => minimatch(file, pattern))\n );\n}\n\nexport async function exportAssetsAsync(\n projectRoot: string,\n {\n exp,\n outputDir,\n bundles,\n }: {\n exp: ExpoAppManifest;\n bundles: Partial<Record<ModPlatform, BundleOutput>>;\n outputDir: string;\n }\n) {\n const assets: Asset[] = uniqBy(\n Object.values(bundles).flatMap((bundle) => bundle!.assets),\n (asset) => asset.hash\n );\n\n if (assets[0]?.fileHashes) {\n Log.log('Saving assets');\n await saveAssetsAsync(projectRoot, { assets, outputDir });\n } else {\n Log.log('No assets to upload, skipped.');\n }\n\n // Add google services file if it exists\n await resolveGoogleServicesFile(projectRoot, exp);\n\n // Updates the manifest to reflect additional asset bundling + configs\n await resolveAssetBundlePatternsAsync(projectRoot, exp, assets);\n\n return { exp, assets };\n}\n"],"names":["resolveAssetBundlePatternsAsync","exportAssetsAsync","Log","projectRoot","exp","assets","assetBundlePatterns","length","fullPatterns","map","p","path","join","logPatterns","allBundledAssets","asset","shouldBundle","shouldBundleAsset","debug","files","fileHashes","hash","type","flat","bundledAssets","Set","patterns","log","forEach","file","__packager_asset","some","pattern","minimatch","outputDir","bundles","uniqBy","Object","values","flatMap","bundle","saveAssetsAsync","resolveGoogleServicesFile"],"mappings":"AAAA;;;;QAgBsBA,+BAA+B,GAA/BA,+BAA+B;QAyD/BC,iBAAiB,GAAjBA,iBAAiB;AAtEjB,IAAA,UAAW,kCAAX,WAAW,EAAA;AAChB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AAC2B,IAAA,cAA0C,WAA1C,0CAA0C,CAAA;AAC7D,IAAA,MAAgB,WAAhB,gBAAgB,CAAA;AACA,IAAA,WAAc,WAAd,cAAc,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAO9C,eAAeF,+BAA+B,CACnDG,WAAmB,EACnBC,GAAmE,EACnEC,MAAe,EACf;QACKD,IAAuB;IAA5B,IAAI,CAACA,CAAAA,CAAAA,IAAuB,GAAvBA,GAAG,CAACE,mBAAmB,SAAQ,GAA/BF,KAAAA,CAA+B,GAA/BA,IAAuB,CAAEG,MAAM,CAAA,IAAI,CAACF,MAAM,CAACE,MAAM,EAAE;QACtD,OAAOH,GAAG,CAACE,mBAAmB,CAAC;QAC/B,OAAOF,GAAG,CAAC;KACZ;IACD,qEAAqE;IACrE,sEAAsE;IACtE,6EAA6E;IAC7E,yEAAyE;IAEzE,MAAMI,YAAY,GAAaJ,GAAG,CAACE,mBAAmB,CAACG,GAAG,CAAC,CAACC,CAAS,GACnEC,KAAI,QAAA,CAACC,IAAI,CAACT,WAAW,EAAEO,CAAC,CAAC;IAAA,CAC1B,AAAC;IAEFG,WAAW,CAACL,YAAY,CAAC,CAAC;IAE1B,MAAMM,gBAAgB,GAAGT,MAAM,CAC5BI,GAAG,CAAC,CAACM,KAAK,GAAK;QACd,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AC;CACxB"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ exports.exportAsync = exportAsync;
6
+ var _path = _interopRequireDefault(require("path"));
7
+ var Log = _interopRequireWildcard(require("../log"));
8
+ var _dir = require("../utils/dir");
9
+ var _exportApp = require("./exportApp");
10
+ function _interopRequireDefault(obj) {
11
+ return obj && obj.__esModule ? obj : {
12
+ default: obj
13
+ };
14
+ }
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
+ async function exportAsync(projectRoot, options) {
37
+ // Ensure the output directory is created
38
+ const outputPath = _path.default.resolve(projectRoot, options.outputDir);
39
+ // Delete the output directory if it exists
40
+ await (0, _dir).removeAsync(outputPath);
41
+ // Create the output directory
42
+ await (0, _dir).ensureDirectoryAsync(outputPath);
43
+ // Export the app
44
+ await (0, _exportApp).exportAppAsync(projectRoot, options);
45
+ // Final notes
46
+ Log.log(`Export was successful. Your exported files can be found in ${options.outputDir}`);
47
+ }
48
+
49
+ //# sourceMappingURL=exportAsync.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/export/exportAsync.ts"],"sourcesContent":["import path from 'path';\n\nimport * as Log from '../log';\nimport { ensureDirectoryAsync, removeAsync } from '../utils/dir';\nimport { exportAppAsync } from './exportApp';\nimport { Options } from './resolveOptions';\n\nexport async function exportAsync(projectRoot: string, options: Options) {\n // Ensure the output directory is created\n const outputPath = path.resolve(projectRoot, options.outputDir);\n // Delete the output directory if it exists\n await removeAsync(outputPath);\n // Create the output directory\n await ensureDirectoryAsync(outputPath);\n\n // Export the app\n await exportAppAsync(projectRoot, options);\n\n // Final notes\n Log.log(`Export was successful. Your exported files can be found in ${options.outputDir}`);\n}\n"],"names":["exportAsync","Log","projectRoot","options","outputPath","path","resolve","outputDir","removeAsync","ensureDirectoryAsync","exportAppAsync","log"],"mappings":"AAAA;;;;QAOsBA,WAAW,GAAXA,WAAW;AAPhB,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM,QAAQ,EAAd;AACmC,IAAA,IAAc,WAAd,cAAc,CAAA;AACjC,IAAA,UAAa,WAAb,aAAa,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGrC,eAAeD,WAAW,CAACE,WAAmB,EAAEC,OAAgB,EAAE;IACvE,yCAAyC;IACzC,MAAMC,UAAU,GAAGC,KAAI,QAAA,CAACC,OAAO,CAACJ,WAAW,EAAEC,OAAO,CAACI,SAAS,CAAC,AAAC;IAChE,2CAA2C;IAC3C,MAAMC,CAAAA,GAAAA,IAAW,AAAY,CAAA,YAAZ,CAACJ,UAAU,CAAC,CAAC;IAC9B,8BAA8B;IAC9B,MAAMK,CAAAA,GAAAA,IAAoB,AAAY,CAAA,qBAAZ,CAACL,UAAU,CAAC,CAAC;IAEvC,iBAAiB;IACjB,MAAMM,CAAAA,GAAAA,UAAc,AAAsB,CAAA,eAAtB,CAACR,WAAW,EAAEC,OAAO,CAAC,CAAC;IAE3C,cAAc;IACdF,GAAG,CAACU,GAAG,CAAC,CAAC,2DAA2D,EAAER,OAAO,CAACI,SAAS,CAAC,CAAC,CAAC,CAAC;CAC5F"}