@expo/cli 0.4.5 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bin/cli CHANGED
@@ -121,7 +121,7 @@ const args = (0, _arg).default({
121
121
  });
122
122
  if (args["--version"]) {
123
123
  // Version is added in the build script.
124
- console.log("0.4.5");
124
+ console.log("0.4.6");
125
125
  process.exit(0);
126
126
  }
127
127
  if (args["--non-interactive"]) {
@@ -248,7 +248,7 @@ commands[command]().then((exec)=>{
248
248
  logEventAsync("action", {
249
249
  action: `expo ${command}`,
250
250
  source: "expo/cli",
251
- source_version: "0.4.5"
251
+ source_version: "0.4.6"
252
252
  });
253
253
  });
254
254
 
@@ -128,7 +128,7 @@ async function exportAppAsync(projectRoot, { platforms , outputDir , clear , dev
128
128
  }
129
129
  // Generate a `metadata.json` and the export is complete.
130
130
  await (0, _writeContents).writeMetadataJsonAsync({
131
- outputDir,
131
+ outputDir: outputPath,
132
132
  bundles,
133
133
  fileNames
134
134
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { importCliSaveAssetsFromProject } from '../start/server/metro/resolveFromProject';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../start/server/webTemplate';\nimport { copyAsync, ensureDirectoryAsync } from '../utils/dir';\nimport { env } from '../utils/env';\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 publicPath = path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER);\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 await copyPublicFolderAsync(publicPath, outputDir);\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(\n Object.fromEntries(\n Object.entries(bundles).map(([key, value]) => {\n if (!dumpSourcemap) {\n return [\n key,\n {\n ...value,\n // Remove source maps from the bundles if they aren't going to be written.\n map: undefined,\n },\n ];\n }\n\n return [key, value];\n })\n )\n );\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 if (fileNames.web) {\n // If web exists, then write the template HTML file.\n await fs.promises.writeFile(\n path.join(outputPath, 'index.html'),\n await createTemplateHtmlFromExpoConfigAsync(projectRoot, {\n scripts: [`/bundles/${fileNames.web}`],\n })\n );\n\n // Save assets like a typical bundler, preserving the file paths on web.\n const saveAssets = importCliSaveAssetsFromProject(projectRoot);\n await Promise.all(\n Object.entries(bundles).map(([platform, bundle]) => {\n return saveAssets(\n // @ts-expect-error: tolerable type mismatches: unused `readonly` (common in Metro) and `undefined` instead of `null`.\n bundle.assets,\n platform,\n outputPath,\n undefined\n );\n })\n );\n }\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\n/**\n * Copy the contents of the public folder into the output folder.\n * This enables users to add static files like `favicon.ico` or `serve.json`.\n *\n * The contents of this folder are completely universal since they refer to\n * static network requests which fall outside the scope of React Native's magic\n * platform resolution patterns.\n */\nasync function copyPublicFolderAsync(publicFolder: string, outputFolder: string) {\n if (fs.existsSync(publicFolder)) {\n await copyAsync(publicFolder, outputFolder);\n }\n}\n"],"names":["exportAppAsync","Log","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","dumpSourcemap","exp","getPublicExpoManifestAsync","publicPath","path","resolve","env","EXPO_PUBLIC_FOLDER","outputPath","assetsPath","join","bundlesPath","Promise","all","map","ensureDirectoryAsync","copyPublicFolderAsync","bundles","createBundlesAsync","resetCache","useDevServer","printBundleSizes","Object","fromEntries","entries","key","value","undefined","hashes","fileNames","writeBundlesAsync","log","web","fs","promises","writeFile","createTemplateHtmlFromExpoConfigAsync","scripts","saveAssets","importCliSaveAssetsFromProject","platform","bundle","assets","exportAssetsAsync","writeAssetMapAsync","writeSourceMapsAsync","writeDebugHtmlAsync","writeMetadataJsonAsync","publicFolder","outputFolder","existsSync","copyAsync"],"mappings":"AAAA;;;;Q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QAClD,MAAMe,CAAAA,GAAAA,cAAmB,AAGvB,CAAA,oBAHuB,CAAC;YACxBlD,SAAS,EAAEY,UAAU;YACrBqB,SAAS;SACV,CAAC,CAAC;KACJ;IAED,yDAAyD;IACzD,MAAMkB,CAAAA,GAAAA,cAAsB,AAAmC,CAAA,uBAAnC,CAAC;QAAEnD,SAAS;QAAEqB,OAAO;QAAEY,SAAS;KAAE,CAAC,CAAC;CACjE;AAED;;;;;;;GAOG,CACH,eAAeb,qBAAqB,CAACgC,YAAoB,EAAEC,YAAoB,EAAE;IAC/E,IAAIhB,GAAE,QAAA,CAACiB,UAAU,CAACF,YAAY,CAAC,EAAE;QAC/B,MAAMG,CAAAA,GAAAA,IAAS,AAA4B,CAAA,UAA5B,CAACH,YAAY,EAAEC,YAAY,CAAC,CAAC;KAC7C;CACF"}
1
+ {"version":3,"sources":["../../../src/export/exportApp.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\n\nimport * as Log from '../log';\nimport { importCliSaveAssetsFromProject } from '../start/server/metro/resolveFromProject';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../start/server/webTemplate';\nimport { copyAsync, ensureDirectoryAsync } from '../utils/dir';\nimport { env } from '../utils/env';\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 publicPath = path.resolve(projectRoot, env.EXPO_PUBLIC_FOLDER);\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 await copyPublicFolderAsync(publicPath, outputDir);\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(\n Object.fromEntries(\n Object.entries(bundles).map(([key, value]) => {\n if (!dumpSourcemap) {\n return [\n key,\n {\n ...value,\n // Remove source maps from the bundles if they aren't going to be written.\n map: undefined,\n },\n ];\n }\n\n return [key, value];\n })\n )\n );\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 if (fileNames.web) {\n // If web exists, then write the template HTML file.\n await fs.promises.writeFile(\n path.join(outputPath, 'index.html'),\n await createTemplateHtmlFromExpoConfigAsync(projectRoot, {\n scripts: [`/bundles/${fileNames.web}`],\n })\n );\n\n // Save assets like a typical bundler, preserving the file paths on web.\n const saveAssets = importCliSaveAssetsFromProject(projectRoot);\n await Promise.all(\n Object.entries(bundles).map(([platform, bundle]) => {\n return saveAssets(\n // @ts-expect-error: tolerable type mismatches: unused `readonly` (common in Metro) and `undefined` instead of `null`.\n bundle.assets,\n platform,\n outputPath,\n undefined\n );\n })\n );\n }\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: outputPath, bundles, fileNames });\n}\n\n/**\n * Copy the contents of the public folder into the output folder.\n * This enables users to add static files like `favicon.ico` or `serve.json`.\n *\n * The contents of this folder are completely universal since they refer to\n * static network requests which fall outside the scope of React Native's magic\n * platform resolution patterns.\n */\nasync function copyPublicFolderAsync(publicFolder: string, outputFolder: string) {\n if (fs.existsSync(publicFolder)) {\n await copyAsync(publicFolder, outputFolder);\n }\n}\n"],"names":["exportAppAsync","Log","projectRoot","platforms","outputDir","clear","dev","dumpAssetmap","dumpSourcemap","exp","getPublicExpoManifestAsync","publicPath","path","resolve","env","EXPO_PUBLIC_FOLDER","outputPath","assetsPath","join","bundlesPath","Promise","all","map","ensureDirectoryAsync","copyPublicFolderAsync","bundles","createBundlesAsync","resetCache","useDevServer","printBundleSizes","Object","fromEntries","entries","key","value","undefined","hashes","fileNames","writeBundlesAsync","log","web","fs","promises","writeFile","createTemplateHtmlFromExpoConfigAsync","scripts","saveAssets","importCliSaveAssetsFromProject","platform","bundle","assets","exportAssetsAsync","writeAssetMapAsync","writeSourceMapsAsync","writeDebugHtmlAsync","writeMetadataJsonAsync","publicFolder","outputFolder","existsSync","copyAsync"],"mappings":"AAAA;;;;QAiCsBA,cAAc,GAAdA,cAAc;AAjCrB,IAAA,GAAI,kCAAJ,IAAI,EAAA;AACF,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEXC,IAAAA,GAAG,mCAAM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,yDAAyD;IACzD,MAAMkB,CAAAA,GAAAA,cAAsB,AAA+C,CAAA,uBAA/C,CAAC;QAAEnD,SAAS,EAAEY,UAAU;QAAES,OAAO;QAAEY,SAAS;KAAE,CAAC,CAAC;CAC7E;AAED;;;;;;;GAOG,CACH,eAAeb,qBAAqB,CAACgC,YAAoB,EAAEC,YAAoB,EAAE;IAC/E,IAAIhB,GAAE,QAAA,CAACiB,UAAU,CAACF,YAAY,CAAC,EAAE;QAC/B,MAAMG,CAAAA,GAAAA,IAAS,AAA4B,CAAA,UAA5B,CAACH,YAAY,EAAEC,YAAY,CAAC,CAAC;KAC7C;CACF"}
@@ -85,7 +85,9 @@ async function writeMetadataJsonAsync({ outputDir , bundles , fileNames }) {
85
85
  bundles,
86
86
  fileNames
87
87
  });
88
- await _promises.default.writeFile(_path.default.join(outputDir, "metadata.json"), JSON.stringify(contents));
88
+ const metadataPath = _path.default.join(outputDir, "metadata.json");
89
+ debug(`Writing metadata.json to ${metadataPath}`);
90
+ await _promises.default.writeFile(metadataPath, JSON.stringify(contents));
89
91
  return contents;
90
92
  }
91
93
  async function writeAssetMapAsync({ outputDir , assets }) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/export/writeContents.ts"],"sourcesContent":["import { Platform } from '@expo/config';\nimport crypto from 'crypto';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { createMetadataJson } from './createMetadataJson';\nimport { BundleOutput } from './fork-bundleAsync';\nimport { Asset } from './saveAssets';\n\nconst debug = require('debug')('expo:export:write') as typeof console.log;\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: Partial<Record<Platform, Pick<BundleOutput, 'hermesBytecodeBundle' | 'code'>>>;\n outputDir: string;\n}) {\n const hashes: Partial<Record<Platform, string>> = {};\n const fileNames: Partial<Record<Platform, string>> = {};\n\n for (const [platform, bundleOutput] of Object.entries(bundles) as [\n Platform,\n Pick<BundleOutput, 'hermesBytecodeBundle' | 'code'>\n ][]) {\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\ntype SourceMapWriteResult = {\n platform: string;\n fileName: string;\n hash: string;\n map: string;\n comment: string;\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}): Promise<SourceMapWriteResult[]> {\n return (\n await Promise.all(\n Object.entries(bundles).map(async ([platform, bundle]) => {\n const sourceMap = bundle.hermesSourcemap ?? bundle.map;\n if (!sourceMap) {\n debug(`Skip writing sourcemap (platform: ${platform})`);\n return null;\n }\n\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 ).filter(Boolean) as SourceMapWriteResult[];\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","debug","require","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","filter","Boolean","contents","createMetadataJson","JSON","stringify","assets","fromEntries","asset","values"],"mappings":"AAAA;;;;QA4BsBA,iBAAiB,GAAjBA,iBAAiB;QAkCjBC,oBAAoB,GAApBA,oBAAoB;QA8CpBC,sBAAsB,GAAtBA,sBAAsB;QAiBtBC,k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ACT8B,MAAM,CAAA,EAIP,EAAE;IACD,qGAAqG;IACrG,MAAMJ,QAAQ,GAAGtB,MAAM,CAAC2B,WAAW,CAACD,MAAM,CAACf,GAAG,CAAC,CAACiB,KAAK,GAAK;YAACA,KAAK,CAACxC,IAAI;YAAEwC,KAAK;SAAC;IAAA,CAAC,CAAC,AAAC;IAChF,MAAMvB,SAAE,QAAA,CAACC,SAAS,CAACC,KAAI,QAAA,CAACC,IAAI,CAACZ,SAAS,EAAE,eAAe,CAAC,EAAE4B,IAAI,CAACC,SAAS,CAACH,QAAQ,CAAC,CAAC,CAAC;IACpF,OAAOA,QAAQ,CAAC;CACjB;AAEM,eAAevC,mBAAmB,CAAC,EACxCa,SAAS,CAAA,EACTE,SAAS,CAAA,EAIV,EAAE;IACD,oDAAoD;IACpD,MAAMwB,QAAQ,GAAG,CAAC;MACd,EAAEtB,MAAM,CAAC6B,MAAM,CAAC/B,SAAS,CAAC,CACvBa,GAAG,CAAC,CAACP,QAAQ,GAAK,CAAC,aAAa,EAAEG,KAAI,QAAA,CAACC,IAAI,CAAC,SAAS,EAAEJ,QAAQ,CAAC,CAAC,WAAW,CAAC;IAAA,CAAC,CAC9EI,IAAI,CAAC,UAAU,CAAC,CAAC;;;MAGpB,CAAC,AAAC;IAEN,MAAMH,SAAE,QAAA,CAACC,SAAS,CAACC,KAAI,QAAA,CAACC,IAAI,CAACZ,SAAS,EAAE,YAAY,CAAC,EAAE0B,QAAQ,CAAC,CAAC;IACjE,OAAOA,QAAQ,CAAC;CACjB"}
1
+ {"version":3,"sources":["../../../src/export/writeContents.ts"],"sourcesContent":["import { Platform } from '@expo/config';\nimport crypto from 'crypto';\nimport fs from 'fs/promises';\nimport path from 'path';\n\nimport { createMetadataJson } from './createMetadataJson';\nimport { BundleOutput } from './fork-bundleAsync';\nimport { Asset } from './saveAssets';\n\nconst debug = require('debug')('expo:export:write') as typeof console.log;\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: Partial<Record<Platform, Pick<BundleOutput, 'hermesBytecodeBundle' | 'code'>>>;\n outputDir: string;\n}) {\n const hashes: Partial<Record<Platform, string>> = {};\n const fileNames: Partial<Record<Platform, string>> = {};\n\n for (const [platform, bundleOutput] of Object.entries(bundles) as [\n Platform,\n Pick<BundleOutput, 'hermesBytecodeBundle' | 'code'>\n ][]) {\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\ntype SourceMapWriteResult = {\n platform: string;\n fileName: string;\n hash: string;\n map: string;\n comment: string;\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}): Promise<SourceMapWriteResult[]> {\n return (\n await Promise.all(\n Object.entries(bundles).map(async ([platform, bundle]) => {\n const sourceMap = bundle.hermesSourcemap ?? bundle.map;\n if (!sourceMap) {\n debug(`Skip writing sourcemap (platform: ${platform})`);\n return null;\n }\n\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 ).filter(Boolean) as SourceMapWriteResult[];\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 const metadataPath = path.join(outputDir, 'metadata.json');\n debug(`Writing metadata.json to ${metadataPath}`);\n await fs.writeFile(metadataPath, 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","debug","require","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","filter","Boolean","contents","createMetadataJson","metadataPath","JSON","stringify","assets","fromEntries","asset","values"],"mappings":"AAAA;;;;QA4BsBA,iBAAiB,GAAjBA,iBAAiB;QAkCjBC,oBAAoB,GAApBA,oBAAoB;QA8CpBC,sBAAsB,GAAtBA,sBAAsB;QAmBtBC,kBAAkB,GAAlBA,kBAAkB;QAalBC,mBAAmB,GAAnBA,mBAAmB;AA3ItB,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACZ,IAAA,SAAa,kCAAb,aAAa,EAAA;AACX,IAAA,KAAM,kCAAN,MAAM,EAAA;AAEY,IAAA,mBAAsB,WAAtB,sBAAsB,CAAA;;;;;;AAIzD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAsB,AAAC;AAE1E;;;;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,eAAef,iBAAiB,CAAC,EACtCgB,OAAO,CAAA,EACPC,SAAS,CAAA,EAIV,EAAE;IACD,MAAMC,MAAM,GAAsC,EAAE,AAAC;IACrD,MAAMC,SAAS,GAAsC,EAAE,AAAC;IAExD,KAAK,MAAM,CAACX,QAAQ,EAAEY,YAAY,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACN,OAAO,CAAC,CAGzD;YACYI,qBAAiC;QAAhD,MAAMT,MAA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AAA,CAACC,IAAI,CAACZ,SAAS,EAAE,YAAY,CAAC,EAAE0B,QAAQ,CAAC,CAAC;IACjE,OAAOA,QAAQ,CAAC;CACjB"}
@@ -101,6 +101,10 @@ function printUsage(options, { verbose }) {
101
101
  key: "r",
102
102
  msg: "reload app"
103
103
  },
104
+ !!options.isWebSocketsEnabled && {
105
+ key: "j",
106
+ msg: "open debugger"
107
+ },
104
108
  !!options.isWebSocketsEnabled && {
105
109
  key: "m",
106
110
  msg: "toggle menu"
@@ -109,10 +113,6 @@ function printUsage(options, { verbose }) {
109
113
  key: "shift+m",
110
114
  msg: "more tools"
111
115
  },
112
- !!options.isWebSocketsEnabled && {
113
- key: "j",
114
- msg: "open JavaScript inspector for Hermes"
115
- },
116
116
  {
117
117
  key: "o",
118
118
  msg: "open project code in your editor"
@@ -142,6 +142,10 @@ function printUsage(options, { verbose }) {
142
142
  disabled: isWebDisable
143
143
  },
144
144
  {},
145
+ {
146
+ key: "j",
147
+ msg: "open debugger"
148
+ },
145
149
  {
146
150
  key: "r",
147
151
  msg: "reload app"
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/interface/commandsTable.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport chalk from 'chalk';\nimport qrcode from 'qrcode-terminal';\nimport wrapAnsi from 'wrap-ansi';\n\nimport * as Log from '../../log';\n\nexport const BLT = '\\u203A';\n\nexport type StartOptions = {\n isWebSocketsEnabled?: boolean;\n devClient?: boolean;\n reset?: boolean;\n nonPersistent?: boolean;\n maxWorkers?: number;\n platforms?: ExpoConfig['platforms'];\n};\n\nexport const printHelp = (): void => {\n logCommandsTable([{ key: '?', msg: 'show all commands' }]);\n};\n\n/** Print the world famous 'Expo QR Code'. */\nexport function printQRCode(url: string) {\n qrcode.generate(url, { small: true }, (code) => Log.log(code));\n}\n\nexport const getTerminalColumns = () => process.stdout.columns || 80;\nexport const printItem = (text: string): string =>\n `${BLT} ` + wrapAnsi(text, getTerminalColumns()).trimStart();\n\nexport function printUsage(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>,\n { verbose }: { verbose: boolean }\n) {\n const isMac = process.platform === 'darwin';\n\n const { platforms = ['ios', 'android', 'web'] } = options;\n\n const isAndroidDisabled = !platforms.includes('android');\n const isIosDisabled = !platforms.includes('ios');\n const isWebDisable = !platforms.includes('web');\n\n if (verbose) {\n logCommandsTable([\n {},\n { key: 'a', msg: 'open Android', disabled: isAndroidDisabled },\n { key: 'shift+a', msg: 'select a device or emulator', disabled: isAndroidDisabled },\n isMac && { key: 'i', msg: 'open iOS simulator', disabled: isIosDisabled },\n isMac && { key: 'shift+i', msg: 'select a simulator', disabled: isIosDisabled },\n { key: 'w', msg: 'open web', disabled: isWebDisable },\n {},\n { key: 'r', msg: 'reload app' },\n !!options.isWebSocketsEnabled && { key: 'm', msg: 'toggle menu' },\n !!options.isWebSocketsEnabled && { key: 'shift+m', msg: 'more tools' },\n !!options.isWebSocketsEnabled && { key: 'j', msg: 'open JavaScript inspector for Hermes' },\n { key: 'o', msg: 'open project code in your editor' },\n { key: 'c', msg: 'show project QR' },\n {},\n ]);\n } else {\n logCommandsTable([\n {},\n { key: 'a', msg: 'open Android', disabled: isAndroidDisabled },\n isMac && { key: 'i', msg: 'open iOS simulator', disabled: isIosDisabled },\n { key: 'w', msg: 'open web', disabled: isWebDisable },\n {},\n { key: 'r', msg: 'reload app' },\n !!options.isWebSocketsEnabled && { key: 'm', msg: 'toggle menu' },\n {},\n ]);\n }\n}\n\nfunction logCommandsTable(\n ui: (false | { key?: string; msg?: string; status?: string; disabled?: boolean })[]\n) {\n Log.log(\n ui\n .filter(Boolean)\n // @ts-ignore: filter doesn't work\n .map(({ key, msg, status, disabled }) => {\n if (!key) return '';\n let view = `${BLT} `;\n if (key.length === 1) view += 'Press ';\n view += chalk`{bold ${key}} {dim │} `;\n view += msg;\n if (status) {\n view += ` ${chalk.dim(`(${chalk.italic(status)})`)}`;\n }\n if (disabled) {\n view = chalk.dim(view);\n }\n return view;\n })\n .join('\\n')\n );\n}\n"],"names":["printQRCode","printUsage","Log","BLT","printHelp","logCommandsTable","key","msg","url","qrcode","generate","small","code","log","getTerminalColumns","process","stdout","columns","printItem","text","wrapAnsi","trimStart","options","verbose","isMac","platform","platforms","isAndroidDisabled","includes","isIosDisabled","isWebDisable","disabled","isWebSocketsEnabled","ui","filter","Boolean","map","status","view","length","chalk","dim","italic","join"],"mappings":"AAAA;;;;QAuBgBA,WAAW,GAAXA,WAAW;QAQXC,UAAU,GAAVA,UAAU;;AA9BR,IAAA,MAAO,kCAAP,OAAO,EAAA;AACN,IAAA,eAAiB,kCAAjB,iBAAiB,EAAA;AACf,IAAA,SAAW,kCAAX,WAAW,EAAA;AAEpBC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;AAER,MAAMC,GAAG,GAAG,QAAQ,AAAC;QAAfA,GAAG,GAAHA,GAAG;AAWT,MAAMC,SAAS,GAAG,IAAY;IACnCC,gBAAgB,CAAC;QAAC;YAAEC,GAAG,EAAE,GAAG;YAAEC,GAAG,EAAE,mBAAmB;SAAE;KAAC,CAAC,CAAC;CAC5D,AAAC;QAFWH,SAAS,GAATA,SAAS;AAKf,SAASJ,WAAW,CAACQ,GAAW,EAAE;IACvCC,eAAM,QAAA,CAACC,QAAQ,CAACF,GAAG,EAAE;QAAEG,KAAK,EAAE,IAAI;KAAE,EAAE,CAACC,IAAI,GAAKV,GAAG,CAACW,GAAG,CAACD,IAAI,CAAC;IAAA,CAAC,CAAC;CAChE;AAEM,MAAME,kBAAkB,GAAG,IAAMC,OAAO,CAACC,MAAM,CAACC,OAAO,IAAI,EAAE;AAAC;QAAxDH,kBAAkB,GAAlBA,kBAAkB;AACxB,MAAMI,SAAS,GAAG,CAACC,IAAY,GACpC,CAAC,EAAEhB,GAAG,CAAC,CAAC,CAAC,GAAGiB,CAAAA,GAAAA,SAAQ,AAA4B,CAAA,QAA5B,CAACD,IA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EAAEN,QAAQ,CAAA,EAAE,GAAK;QACvC,IAAI,CAACzB,GAAG,EAAE,OAAO,EAAE,CAAC;QACpB,IAAIgC,IAAI,GAAG,CAAC,EAAEnC,GAAG,CAAC,CAAC,CAAC,AAAC;QACrB,IAAIG,GAAG,CAACiC,MAAM,KAAK,CAAC,EAAED,IAAI,IAAI,QAAQ,CAAC;QACvCA,IAAI,IAAIE,MAAK,QAAA,CAAC,MAAM,EAAElC,GAAG,CAAC,YAAU,CAAC,CAAC;QACtCgC,IAAI,IAAI/B,GAAG,CAAC;QACZ,IAAI8B,MAAM,EAAE;YACVC,IAAI,IAAI,CAAC,CAAC,EAAEE,MAAK,QAAA,CAACC,GAAG,CAAC,CAAC,CAAC,EAAED,MAAK,QAAA,CAACE,MAAM,CAACL,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtD;QACD,IAAIN,QAAQ,EAAE;YACZO,IAAI,GAAGE,MAAK,QAAA,CAACC,GAAG,CAACH,IAAI,CAAC,CAAC;SACxB;QACD,OAAOA,IAAI,CAAC;KACb,CAAC,CACDK,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;CACH"}
1
+ {"version":3,"sources":["../../../../src/start/interface/commandsTable.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\nimport chalk from 'chalk';\nimport qrcode from 'qrcode-terminal';\nimport wrapAnsi from 'wrap-ansi';\n\nimport * as Log from '../../log';\n\nexport const BLT = '\\u203A';\n\nexport type StartOptions = {\n isWebSocketsEnabled?: boolean;\n devClient?: boolean;\n reset?: boolean;\n nonPersistent?: boolean;\n maxWorkers?: number;\n platforms?: ExpoConfig['platforms'];\n};\n\nexport const printHelp = (): void => {\n logCommandsTable([{ key: '?', msg: 'show all commands' }]);\n};\n\n/** Print the world famous 'Expo QR Code'. */\nexport function printQRCode(url: string) {\n qrcode.generate(url, { small: true }, (code) => Log.log(code));\n}\n\nexport const getTerminalColumns = () => process.stdout.columns || 80;\nexport const printItem = (text: string): string =>\n `${BLT} ` + wrapAnsi(text, getTerminalColumns()).trimStart();\n\nexport function printUsage(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>,\n { verbose }: { verbose: boolean }\n) {\n const isMac = process.platform === 'darwin';\n\n const { platforms = ['ios', 'android', 'web'] } = options;\n\n const isAndroidDisabled = !platforms.includes('android');\n const isIosDisabled = !platforms.includes('ios');\n const isWebDisable = !platforms.includes('web');\n\n if (verbose) {\n logCommandsTable([\n {},\n { key: 'a', msg: 'open Android', disabled: isAndroidDisabled },\n { key: 'shift+a', msg: 'select a device or emulator', disabled: isAndroidDisabled },\n isMac && { key: 'i', msg: 'open iOS simulator', disabled: isIosDisabled },\n isMac && { key: 'shift+i', msg: 'select a simulator', disabled: isIosDisabled },\n { key: 'w', msg: 'open web', disabled: isWebDisable },\n {},\n { key: 'r', msg: 'reload app' },\n !!options.isWebSocketsEnabled && { key: 'j', msg: 'open debugger' },\n !!options.isWebSocketsEnabled && { key: 'm', msg: 'toggle menu' },\n !!options.isWebSocketsEnabled && { key: 'shift+m', msg: 'more tools' },\n { key: 'o', msg: 'open project code in your editor' },\n { key: 'c', msg: 'show project QR' },\n {},\n ]);\n } else {\n logCommandsTable([\n {},\n { key: 'a', msg: 'open Android', disabled: isAndroidDisabled },\n isMac && { key: 'i', msg: 'open iOS simulator', disabled: isIosDisabled },\n { key: 'w', msg: 'open web', disabled: isWebDisable },\n {},\n { key: 'j', msg: 'open debugger' },\n { key: 'r', msg: 'reload app' },\n !!options.isWebSocketsEnabled && { key: 'm', msg: 'toggle menu' },\n {},\n ]);\n }\n}\n\nfunction logCommandsTable(\n ui: (false | { key?: string; msg?: string; status?: string; disabled?: boolean })[]\n) {\n Log.log(\n ui\n .filter(Boolean)\n // @ts-ignore: filter doesn't work\n .map(({ key, msg, status, disabled }) => {\n if (!key) return '';\n let view = `${BLT} `;\n if (key.length === 1) view += 'Press ';\n view += chalk`{bold ${key}} {dim │} `;\n view += msg;\n if (status) {\n view += ` ${chalk.dim(`(${chalk.italic(status)})`)}`;\n }\n if (disabled) {\n view = chalk.dim(view);\n }\n return view;\n })\n .join('\\n')\n );\n}\n"],"names":["printQRCode","printUsage","Log","BLT","printHelp","logCommandsTable","key","msg","url","qrcode","generate","small","code","log","getTerminalColumns","process","stdout","columns","printItem","text","wrapAnsi","trimStart","options","verbose","isMac","platform","platforms","isAndroidDisabled","includes","isIosDisabled","isWebDisable","disabled","isWebSocketsEnabled","ui","filter","Boolean","map","status","view","length","chalk","dim","italic","join"],"mappings":"AAAA;;;;QAuBgBA,WAAW,GAAXA,WAAW;QAQXC,UAAU,GAAVA,UAAU;;AA9BR,IAAA,MAAO,kCAAP,OAAO,EAAA;AACN,IAAA,eAAiB,kCAAjB,iBAAiB,EAAA;AACf,IAAA,SAAW,kCAAX,WAAW,EAAA;AAEpBC,IAAAA,GAAG,mCAAM,WAAW,EAAjB;;;;;;;;;;;;;;;;;;;;;;;;;;;AAER,MAAMC,GAAG,GAAG,QAAQ,AAAC;QAAfA,GAAG,GAAHA,GAAG;AAWT,MAAMC,SAAS,GAAG,IAAY;IACnCC,gBAAgB,CAAC;QAAC;YAAEC,GAAG,EAAE,GAAG;YAAEC,GAAG,EAAE,mBAAmB;SAAE;KAAC,CAAC,CAAC;CAC5D,AAAC;QAFWH,SAAS,GAATA,SAAS;AAKf,SAASJ,WAAW,CAACQ,GAAW,EAAE;IACvCC,eAAM,QAAA,CAACC,QAAQ,CAACF,GAAG,EAAE;QAAEG,KAAK,EAAE,IAAI;KAAE,EAAE,CAACC,IAAI,GAAKV,GAAG,CAACW,GAAG,CAACD,IAAI,CAAC;IAAA,CAAC,CAAC;CAChE;AAEM,MAAME,kBAAkB,GAAG,IAAMC,OAAO,CAACC,MAAM,CAACC,OAAO,IAAI,EAAE;AAAC;QAAxDH,kBAAkB,GAAlBA,kBAAkB;AACxB,MAAMI,SAAS,GAAG,CAACC,IAAY,GACpC,CAAC,EAAEhB,GAAG,CAAC,CAAC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C,MAAM,CAACC,OAAO,CAAC,AAChB,kCAAkC;KACjCC,GAAG,CAAC,CAAC,EAAE9B,GAAG,CAAA,EAAEC,GAAG,CAAA,EAAE8B,MAAM,CAAA,EAAEN,QAAQ,CAAA,EAAE,GAAK;QACvC,IAAI,CAACzB,GAAG,EAAE,OAAO,EAAE,CAAC;QACpB,IAAIgC,IAAI,GAAG,CAAC,EAAEnC,GAAG,CAAC,CAAC,CAAC,AAAC;QACrB,IAAIG,GAAG,CAACiC,MAAM,KAAK,CAAC,EAAED,IAAI,IAAI,QAAQ,CAAC;QACvCA,IAAI,IAAIE,MAAK,QAAA,CAAC,MAAM,EAAElC,GAAG,CAAC,YAAU,CAAC,CAAC;QACtCgC,IAAI,IAAI/B,GAAG,CAAC;QACZ,IAAI8B,MAAM,EAAE;YACVC,IAAI,IAAI,CAAC,CAAC,EAAEE,MAAK,QAAA,CAACC,GAAG,CAAC,CAAC,CAAC,EAAED,MAAK,QAAA,CAACE,MAAM,CAACL,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;SACtD;QACD,IAAIN,QAAQ,EAAE;YACZO,IAAI,GAAGE,MAAK,QAAA,CAACC,GAAG,CAACH,IAAI,CAAC,CAAC;SACxB;QACD,OAAOA,IAAI,CAAC;KACb,CAAC,CACDK,IAAI,CAAC,IAAI,CAAC,CACd,CAAC;CACH"}
@@ -86,7 +86,7 @@ class DevServerManagerActions {
86
86
  const metroServerOrigin = `http://localhost:${port}`;
87
87
  const apps = await (0, _devServer).queryAllInspectorAppsAsync(metroServerOrigin);
88
88
  if (!apps.length) {
89
- Log.warn(`No compatible apps connected. This feature is only available for apps using the Hermes runtime. ${(0, _link).learnMore("https://docs.expo.dev/guides/using-hermes/")}`);
89
+ Log.warn(`No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. ${(0, _link).learnMore("https://docs.expo.dev/guides/using-hermes/")}`);
90
90
  return;
91
91
  }
92
92
  for (const app of apps){
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import { openJsInspector, queryAllInspectorAppsAsync } from '@expo/dev-server';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { learnMore } from '../../utils/link';\nimport { selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(private devServerManager: DevServerManager) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above with Expo Go (Android) or the Camera app (iOS)'));\n } catch (error) {\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n Log.log('Opening JavaScript inspector in the browser...');\n const port = this.devServerManager.getNativeDevServerPort();\n assert(port, 'Metro dev server is not running');\n const metroServerOrigin = `http://localhost:${port}`;\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n Log.warn(\n `No compatible apps connected. This feature is only available for apps using the Hermes runtime. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n return;\n }\n for (const app of apps) {\n openJsInspector(app);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n try {\n // Options match: Chrome > View > Developer\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n // Toggling Remote JS Debugging is pretty rough, so leaving it disabled.\n // { title: 'Toggle Remote Debugging', value: 'toggleRemoteDebugging' },\n ]);\n this.devServerManager.broadcastMessage('sendDevCommand', { name: value });\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["Log","debug","require","DevServerManagerActions","constructor","devServerManager","printDevServerInfo","options","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","log","printItem","chalk","error","code","serverUrl","getDevServerUrl","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","port","assert","metroServerOrigin","apps","queryAllInspectorAppsAsync","length","warn","learnMore","app","openJsInspector","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","value","selectAsync","title","name","toggleDevMenu"],"mappings":"AAAA;;;;AAA4D,IAAA,UAAkB,WAAlB,kBAAkB,CAAA;AAC3D,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbA,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACW,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AAChB,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AAEgC,IAAA,cAAiB,WAAjB,iBAAiB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;AAElG,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,yCAAyC,CAAC,AAAsB,AAAC;AAGzF,MAAMC,uBAAuB;IAClCC,YAAoBC,gBAAkC,CAAE;aAApCA,gBAAkC,GAAlCA,gBAAkC;KAAI;IAE1DC,kBAAkB,CAChBC,OAA8E,EAC9E;QACA,kDAAkD;QAClD,IAAI,IAAI,CAACF,gBAAgB,CAACG,sBAAsB,EAAE,EAAE;YAClD,MAAMC,SAAS,GAAG,IAAI,CAACJ,gBAAgB,CAACK,mBAAmB,EAAE,AAAC;YAC9D,IAAI;gBACF,MAAMC,gBAAgB,GAAGF,SAAS,CAACG,mBAAmB,EAAE,AAAC,AAAC;gBAC1D,MAAMC,mBAAmB,GAAGJ,SAAS,CAACK,cAAc,EAAE,AAAC;gBAEvDC,CAAAA,GAAAA,cAAW,AAAyC,CAAA,YAAzC,CAACF,mBAAmB,WAAnBA,mBAAmB,GAAIF,gBAAgB,CAAC,CAAC;gBAErD,IAAIE,mBAAmB,EAAE;oBACvBb,GAAG,CAACgB,GAAG,CACLC,CAAAA,GAAAA,cAAS,AAER,CAAA,UAFQ,CACPC,MAAK,QAAA,CAAC,iDAAiD,EAAEL,mBAAmB,CAAC,CAAC,CAAC,CAChF,CACF,CAAC;iBACH;gBACDb,GAAG,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B,CAAA,YAR6B,CAAC5B,MAAK,QAAA,CAAC,6BAA6B,CAAC,EAAE;gBACpE;oBAAE6B,KAAK,EAAE,kBAAkB;oBAAEF,KAAK,EAAE,wBAAwB;iBAAE;gBAC9D;oBAAEE,KAAK,EAAE,4BAA4B;oBAAEF,KAAK,EAAE,0BAA0B;iBAAE;gBAC1E;oBAAEE,KAAK,EAAE,uBAAuB;oBAAEF,KAAK,EAAE,eAAe;iBAAE;gBAC1D;oBAAEE,KAAK,EAAE,YAAY;oBAAEF,KAAK,EAAE,QAAQ;iBAAE;aAIzC,CAAC,AAAC;YACH,IAAI,CAACxC,gBAAgB,CAACsC,gBAAgB,CAAC,gBAAgB,EAAE;gBAAEK,IAAI,EAAEH,KAAK;aAAE,CAAC,CAAC;SAC3E,CAAC,OAAO1B,KAAK,EAAO;YACnBlB,KAAK,CAACkB,KAAK,CAAC,CAAC;QACb,aAAa;SACd,QAAS;YACRU,CAAAA,GAAAA,cAAS,AAAE,CAAA,UAAF,EAAE,CAAC;SACb;KACF;IAEDoB,aAAa,GAAG;QACdjD,GAAG,CAACgB,GAAG,CAAC,CAAC,EAAE0B,cAAG,IAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACpC,IAAI,CAACrC,gBAAgB,CAACsC,gBAAgB,CAAC,SAAS,CAAC,CAAC;KACnD;CACF;QAnGYxC,uBAAuB,GAAvBA,uBAAuB"}
1
+ {"version":3,"sources":["../../../../src/start/interface/interactiveActions.ts"],"sourcesContent":["import { openJsInspector, queryAllInspectorAppsAsync } from '@expo/dev-server';\nimport assert from 'assert';\nimport chalk from 'chalk';\n\nimport * as Log from '../../log';\nimport { learnMore } from '../../utils/link';\nimport { selectAsync } from '../../utils/prompts';\nimport { DevServerManager } from '../server/DevServerManager';\nimport { BLT, printHelp, printItem, printQRCode, printUsage, StartOptions } from './commandsTable';\n\nconst debug = require('debug')('expo:start:interface:interactiveActions') as typeof console.log;\n\n/** Wraps the DevServerManager and adds an interface for user actions. */\nexport class DevServerManagerActions {\n constructor(private devServerManager: DevServerManager) {}\n\n printDevServerInfo(\n options: Pick<StartOptions, 'devClient' | 'isWebSocketsEnabled' | 'platforms'>\n ) {\n // If native dev server is running, print its URL.\n if (this.devServerManager.getNativeDevServerPort()) {\n const devServer = this.devServerManager.getDefaultDevServer();\n try {\n const nativeRuntimeUrl = devServer.getNativeRuntimeUrl()!;\n const interstitialPageUrl = devServer.getRedirectUrl();\n\n printQRCode(interstitialPageUrl ?? nativeRuntimeUrl);\n\n if (interstitialPageUrl) {\n Log.log(\n printItem(\n chalk`Choose an app to open your project at {underline ${interstitialPageUrl}}`\n )\n );\n }\n Log.log(printItem(chalk`Metro waiting on {underline ${nativeRuntimeUrl}}`));\n // TODO: if development build, change this message!\n Log.log(printItem('Scan the QR code above with Expo Go (Android) or the Camera app (iOS)'));\n } catch (error) {\n // @ts-ignore: If there is no development build scheme, then skip the QR code.\n if (error.code !== 'NO_DEV_CLIENT_SCHEME') {\n throw error;\n } else {\n const serverUrl = devServer.getDevServerUrl();\n Log.log(printItem(chalk`Metro waiting on {underline ${serverUrl}}`));\n Log.log(printItem(`Linking is disabled because the client scheme cannot be resolved.`));\n }\n }\n }\n\n const webDevServer = this.devServerManager.getWebDevServer();\n const webUrl = webDevServer?.getDevServerUrl({ hostType: 'localhost' });\n if (webUrl) {\n Log.log();\n Log.log(printItem(chalk`Web is waiting on {underline ${webUrl}}`));\n }\n\n printUsage(options, { verbose: false });\n printHelp();\n Log.log();\n }\n\n async openJsInspectorAsync() {\n Log.log('Opening JavaScript inspector in the browser...');\n const port = this.devServerManager.getNativeDevServerPort();\n assert(port, 'Metro dev server is not running');\n const metroServerOrigin = `http://localhost:${port}`;\n const apps = await queryAllInspectorAppsAsync(metroServerOrigin);\n if (!apps.length) {\n Log.warn(\n `No compatible apps connected. JavaScript Debugging can only be used with the Hermes engine. ${learnMore(\n 'https://docs.expo.dev/guides/using-hermes/'\n )}`\n );\n return;\n }\n for (const app of apps) {\n openJsInspector(app);\n }\n }\n\n reloadApp() {\n Log.log(`${BLT} Reloading apps`);\n // Send reload requests over the dev servers\n this.devServerManager.broadcastMessage('reload');\n }\n\n async openMoreToolsAsync() {\n try {\n // Options match: Chrome > View > Developer\n const value = await selectAsync(chalk`Dev tools {dim (native only)}`, [\n { title: 'Inspect elements', value: 'toggleElementInspector' },\n { title: 'Toggle performance monitor', value: 'togglePerformanceMonitor' },\n { title: 'Toggle developer menu', value: 'toggleDevMenu' },\n { title: 'Reload app', value: 'reload' },\n // TODO: Maybe a \"View Source\" option to open code.\n // Toggling Remote JS Debugging is pretty rough, so leaving it disabled.\n // { title: 'Toggle Remote Debugging', value: 'toggleRemoteDebugging' },\n ]);\n this.devServerManager.broadcastMessage('sendDevCommand', { name: value });\n } catch (error: any) {\n debug(error);\n // do nothing\n } finally {\n printHelp();\n }\n }\n\n toggleDevMenu() {\n Log.log(`${BLT} Toggling dev menu`);\n this.devServerManager.broadcastMessage('devMenu');\n }\n}\n"],"names":["Log","debug","require","DevServerManagerActions","constructor","devServerManager","printDevServerInfo","options","getNativeDevServerPort","devServer","getDefaultDevServer","nativeRuntimeUrl","getNativeRuntimeUrl","interstitialPageUrl","getRedirectUrl","printQRCode","log","printItem","chalk","error","code","serverUrl","getDevServerUrl","webDevServer","getWebDevServer","webUrl","hostType","printUsage","verbose","printHelp","openJsInspectorAsync","port","assert","metroServerOrigin","apps","queryAllInspectorAppsAsync","length","warn","learnMore","app","openJsInspector","reloadApp","BLT","broadcastMessage","openMoreToolsAsync","value","selectAsync","title","name","toggleDevMenu"],"mappings":"AAAA;;;;AAA4D,IAAA,UAAkB,WAAlB,kBAAkB,CAAA;AAC3D,IAAA,OAAQ,kCAAR,QAAQ,EAAA;AACT,IAAA,MAAO,kCAAP,OAAO,EAAA;AAEbA,IAAAA,GAAG,mCAAM,WAAW,EAAjB;AACW,IAAA,KAAkB,WAAlB,kBAAkB,CAAA;AAChB,IAAA,QAAqB,WAArB,qBAAqB,CAAA;AAEgC,IAAA,cA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AC,AAAC;YACH,IAAI,CAACxC,gBAAgB,CAACsC,gBAAgB,CAAC,gBAAgB,EAAE;gBAAEK,IAAI,EAAEH,KAAK;aAAE,CAAC,CAAC;SAC3E,CAAC,OAAO1B,KAAK,EAAO;YACnBlB,KAAK,CAACkB,KAAK,CAAC,CAAC;QACb,aAAa;SACd,QAAS;YACRU,CAAAA,GAAAA,cAAS,AAAE,CAAA,UAAF,EAAE,CAAC;SACb;KACF;IAEDoB,aAAa,GAAG;QACdjD,GAAG,CAACgB,GAAG,CAAC,CAAC,EAAE0B,cAAG,IAAA,CAAC,kBAAkB,CAAC,CAAC,CAAC;QACpC,IAAI,CAACrC,gBAAgB,CAACsC,gBAAgB,CAAC,SAAS,CAAC,CAAC;KACnD;CACF;QAnGYxC,uBAAuB,GAAvBA,uBAAuB"}
@@ -130,7 +130,7 @@ async function createHostInfoAsync() {
130
130
  host: await _userSettings.default.getAnonymousIdentifierAsync(),
131
131
  server: "expo",
132
132
  // Defined in the build step
133
- serverVersion: "0.4.5",
133
+ serverVersion: "0.4.6",
134
134
  serverDriver: _manifestMiddleware.DEVELOPER_TOOL,
135
135
  serverOS: _os.default.platform(),
136
136
  serverOSVersion: _os.default.release()
@@ -94,7 +94,7 @@ async function logEventAsync(event, properties = {}) {
94
94
  }
95
95
  const { userId , deviceId } = identifyData;
96
96
  const commonEventProperties = {
97
- source_version: "0.4.5",
97
+ source_version: "0.4.6",
98
98
  source: "expo"
99
99
  };
100
100
  const identity = {
@@ -135,7 +135,7 @@ function getContext() {
135
135
  },
136
136
  app: {
137
137
  name: "expo",
138
- version: "0.4.5"
138
+ version: "0.4.6"
139
139
  },
140
140
  ci: ciInfo.isCI ? {
141
141
  name: ciInfo.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/cli",
3
- "version": "0.4.5",
3
+ "version": "0.4.6",
4
4
  "description": "The Expo CLI",
5
5
  "main": "build/bin/cli",
6
6
  "bin": {
@@ -138,5 +138,5 @@
138
138
  "structured-headers": "^0.4.1",
139
139
  "taskr": "1.1.0"
140
140
  },
141
- "gitHead": "6a83bce33fab276298b06a471a90e007fd3707e1"
141
+ "gitHead": "1a87dcc55895a9e16e3d4fd0fa78f2244c1d961f"
142
142
  }