@expo/cli 0.18.12 → 0.18.13
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 +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +12 -1
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/utils/npm.js +11 -8
- package/build/src/utils/npm.js.map +1 -1
- package/build/src/utils/telemetry/getContext.js +1 -1
- package/package.json +8 -8
package/build/bin/cli
CHANGED
|
@@ -151,7 +151,7 @@ async function createMetroServerAndBundleRequestAsync(projectRoot, options) {
|
|
|
151
151
|
..._server().default.DEFAULT_BUNDLE_OPTIONS,
|
|
152
152
|
...(0, _metroOptions.getMetroDirectBundleOptionsForExpoConfig)(projectRoot, exp, {
|
|
153
153
|
splitChunks: false,
|
|
154
|
-
mainModuleName: options.entryFile,
|
|
154
|
+
mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),
|
|
155
155
|
platform: options.platform,
|
|
156
156
|
minify: options.minify,
|
|
157
157
|
mode: options.dev ? "development" : "production",
|
|
@@ -228,5 +228,16 @@ async function exportEmbedAssetsAsync(server, bundleRequest, projectRoot, option
|
|
|
228
228
|
function isError(error) {
|
|
229
229
|
return error instanceof Error;
|
|
230
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* This is a workaround for Metro not resolving entry file paths to their real location.
|
|
233
|
+
* When running exports through `eas build --local` on macOS, the `/var/folders` path is used instead of `/private/var/folders`.
|
|
234
|
+
*
|
|
235
|
+
* See: https://github.com/expo/expo/issues/28890
|
|
236
|
+
*/ function resolveRealEntryFilePath(projectRoot, entryFile) {
|
|
237
|
+
if (projectRoot.startsWith("/private/var") && entryFile.startsWith("/var")) {
|
|
238
|
+
return _fs().default.realpathSync(entryFile);
|
|
239
|
+
}
|
|
240
|
+
return entryFile;
|
|
241
|
+
}
|
|
231
242
|
|
|
232
243
|
//# sourceMappingURL=exportEmbedAsync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport Server from 'metro/src/Server';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { removeAsync } from '../../utils/dir';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { getAssets } from '../fork-bundleAsync';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\n\nconst debug = require('debug')('expo:export:embed');\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (!bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//)) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(path.join(bundleParent, `*.app/${bundleName}`), {\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.dev ? 'development' : 'production');\n require('@expo/env').load(projectRoot);\n\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n\n maxWorkers: options.maxWorkers,\n config: options.config,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const bundleRequest = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n mainModuleName: options.entryFile,\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n bytecode: isHermes,\n isExporting: true,\n }),\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: Awaited<ReturnType<Server['build']>>;\n assets: Awaited<ReturnType<typeof getAssets>>;\n}> {\n const { server, bundleRequest } = await createMetroServerAndBundleRequestAsync(\n projectRoot,\n options\n );\n\n try {\n const bundle = await exportEmbedBundleAsync(server, bundleRequest, projectRoot, options);\n const assets = await exportEmbedAssetsAsync(server, bundleRequest, projectRoot, options);\n return { bundle, assets };\n } finally {\n server.end();\n }\n}\n\nexport async function exportEmbedBundleAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n return await profile(\n server.build.bind(server),\n 'metro-bundle'\n )({\n ...bundleRequest,\n bundleType: 'bundle',\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n return await getAssets(server, {\n ...bundleRequest,\n bundleType: 'todo',\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n"],"names":["exportEmbedAsync","createMetroServerAndBundleRequestAsync","exportEmbedBundleAndAssetsAsync","exportEmbedBundleAsync","exportEmbedAssetsAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","join","dot","projectRoot","options","setNodeEnv","dev","load","removeAsync","platform","previousPath","fs","existsSync","bundle","assets","mkdirSync","recursive","mode","Promise","all","output","save","Log","log","assetsDest","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","exp","getConfig","skipSDKVersionRequirement","config","loadMetroConfigAsync","resetCache","maxWorkers","isExporting","getMetroBundler","server","getBundler","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","getMetroDirectBundleOptionsForExpoConfig","splitChunks","mainModuleName","entryFile","minify","engine","undefined","bytecode","unstable_transformProfile","unstableTransformProfile","watch","end","profile","build","bind","bundleType","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","getAssets","Error"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAuCsBA,gBAAgB,MAAhBA,gBAAgB;IAoChBC,sCAAsC,MAAtCA,sCAAsC;IAoEtCC,+BAA+B,MAA/BA,+BAA+B;IAqB/BC,sBAAsB,MAAtBA,sBAAsB;IA8BtBC,sBAAsB,MAAtBA,sBAAsB;;;yBAlMlB,cAAc;;;;;;;8DACzB,IAAI;;;;;;;y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ACH,CAAC;AAED,SAASC,OAAO,CAACD,KAAU,EAAkB;IAC3C,OAAOA,KAAK,YAAYO,KAAK,CAAC;AAChC,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../../src/export/embed/exportEmbedAsync.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { getConfig } from '@expo/config';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport Server from 'metro/src/Server';\nimport output from 'metro/src/shared/output/bundle';\nimport type { BundleOptions } from 'metro/src/shared/types';\nimport path from 'path';\n\nimport { Options } from './resolveOptions';\nimport { isExecutingFromXcodebuild, logMetroErrorInXcode } from './xcodeCompilerLogger';\nimport { Log } from '../../log';\nimport { loadMetroConfigAsync } from '../../start/server/metro/instantiateMetro';\nimport { getMetroDirectBundleOptionsForExpoConfig } from '../../start/server/middleware/metroOptions';\nimport { stripAnsi } from '../../utils/ansi';\nimport { removeAsync } from '../../utils/dir';\nimport { setNodeEnv } from '../../utils/nodeEnv';\nimport { profile } from '../../utils/profile';\nimport { isEnableHermesManaged } from '../exportHermes';\nimport { getAssets } from '../fork-bundleAsync';\nimport { persistMetroAssetsAsync } from '../persistMetroAssets';\n\nconst debug = require('debug')('expo:export:embed');\n\nfunction guessCopiedAppleBundlePath(bundleOutput: string) {\n // Ensure the path is familiar before guessing.\n if (!bundleOutput.match(/\\/Xcode\\/DerivedData\\/.*\\/Build\\/Products\\//)) {\n debug('Bundling to non-standard location:', bundleOutput);\n return false;\n }\n const bundleName = path.basename(bundleOutput);\n const bundleParent = path.dirname(bundleOutput);\n const possiblePath = globSync(path.join(bundleParent, `*.app/${bundleName}`), {\n // bundle identifiers can start with dots.\n dot: true,\n })[0];\n debug('Possible path for previous bundle:', possiblePath);\n return possiblePath;\n}\n\nexport async function exportEmbedAsync(projectRoot: string, options: Options) {\n setNodeEnv(options.dev ? 'development' : 'production');\n require('@expo/env').load(projectRoot);\n\n // Ensure we delete the old bundle to trigger a failure if the bundle cannot be created.\n await removeAsync(options.bundleOutput);\n\n // The iOS bundle is copied in to the Xcode project, so we need to remove the old one\n // to prevent Xcode from loading the old one after a build failure.\n if (options.platform === 'ios') {\n const previousPath = guessCopiedAppleBundlePath(options.bundleOutput);\n if (previousPath && fs.existsSync(previousPath)) {\n debug('Removing previous iOS bundle:', previousPath);\n await removeAsync(previousPath);\n }\n }\n\n const { bundle, assets } = await exportEmbedBundleAndAssetsAsync(projectRoot, options);\n\n fs.mkdirSync(path.dirname(options.bundleOutput), { recursive: true, mode: 0o755 });\n\n // Persist bundle and source maps.\n await Promise.all([\n output.save(bundle, options, Log.log),\n // NOTE(EvanBacon): This may need to be adjusted in the future if want to support baseUrl on native\n // platforms when doing production embeds (unlikely).\n options.assetsDest\n ? persistMetroAssetsAsync(assets, {\n platform: options.platform,\n outputDirectory: options.assetsDest,\n iosAssetCatalogDirectory: options.assetCatalogDest,\n })\n : null,\n ]);\n}\n\nexport async function createMetroServerAndBundleRequestAsync(\n projectRoot: string,\n options: Pick<\n Options,\n | 'maxWorkers'\n | 'config'\n | 'platform'\n | 'sourcemapOutput'\n | 'sourcemapUseAbsolutePath'\n | 'entryFile'\n | 'minify'\n | 'dev'\n | 'resetCache'\n | 'unstableTransformProfile'\n >\n): Promise<{ server: Server; bundleRequest: BundleOptions }> {\n const exp = getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // TODO: This is slow ~40ms\n const { config } = await loadMetroConfigAsync(\n projectRoot,\n {\n // TODO: This is always enabled in the native script and there's no way to disable it.\n resetCache: options.resetCache,\n\n maxWorkers: options.maxWorkers,\n config: options.config,\n },\n {\n exp,\n isExporting: true,\n getMetroBundler() {\n return server.getBundler().getBundler();\n },\n }\n );\n\n const isHermes = isEnableHermesManaged(exp, options.platform);\n\n let sourceMapUrl = options.sourcemapOutput;\n if (sourceMapUrl && !options.sourcemapUseAbsolutePath) {\n sourceMapUrl = path.basename(sourceMapUrl);\n }\n\n const bundleRequest = {\n ...Server.DEFAULT_BUNDLE_OPTIONS,\n ...getMetroDirectBundleOptionsForExpoConfig(projectRoot, exp, {\n splitChunks: false,\n mainModuleName: resolveRealEntryFilePath(projectRoot, options.entryFile),\n platform: options.platform,\n minify: options.minify,\n mode: options.dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n bytecode: isHermes,\n isExporting: true,\n }),\n sourceMapUrl,\n unstable_transformProfile: (options.unstableTransformProfile ||\n (isHermes ? 'hermes-stable' : 'default')) as BundleOptions['unstable_transformProfile'],\n };\n\n const server = new Server(config, {\n watch: false,\n });\n\n return { server, bundleRequest };\n}\n\nexport async function exportEmbedBundleAndAssetsAsync(\n projectRoot: string,\n options: Options\n): Promise<{\n bundle: Awaited<ReturnType<Server['build']>>;\n assets: Awaited<ReturnType<typeof getAssets>>;\n}> {\n const { server, bundleRequest } = await createMetroServerAndBundleRequestAsync(\n projectRoot,\n options\n );\n\n try {\n const bundle = await exportEmbedBundleAsync(server, bundleRequest, projectRoot, options);\n const assets = await exportEmbedAssetsAsync(server, bundleRequest, projectRoot, options);\n return { bundle, assets };\n } finally {\n server.end();\n }\n}\n\nexport async function exportEmbedBundleAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n return await profile(\n server.build.bind(server),\n 'metro-bundle'\n )({\n ...bundleRequest,\n bundleType: 'bundle',\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nexport async function exportEmbedAssetsAsync(\n server: Server,\n bundleRequest: BundleOptions,\n projectRoot: string,\n options: Pick<Options, 'platform'>\n) {\n try {\n return await getAssets(server, {\n ...bundleRequest,\n bundleType: 'todo',\n });\n } catch (error: any) {\n if (isError(error)) {\n // Log using Xcode error format so the errors are picked up by xcodebuild.\n // https://developer.apple.com/documentation/xcode/running-custom-scripts-during-a-build#Log-errors-and-warnings-from-your-script\n if (options.platform === 'ios') {\n // If the error is about to be presented in Xcode, strip the ansi characters from the message.\n if ('message' in error && isExecutingFromXcodebuild()) {\n error.message = stripAnsi(error.message) as string;\n }\n logMetroErrorInXcode(projectRoot, error);\n }\n }\n throw error;\n }\n}\n\nfunction isError(error: any): error is Error {\n return error instanceof Error;\n}\n\n/**\n * This is a workaround for Metro not resolving entry file paths to their real location.\n * When running exports through `eas build --local` on macOS, the `/var/folders` path is used instead of `/private/var/folders`.\n *\n * See: https://github.com/expo/expo/issues/28890\n */\nfunction resolveRealEntryFilePath(projectRoot: string, entryFile: string): string {\n if (projectRoot.startsWith('/private/var') && entryFile.startsWith('/var')) {\n return fs.realpathSync(entryFile);\n }\n\n return entryFile;\n}\n"],"names":["exportEmbedAsync","createMetroServerAndBundleRequestAsync","exportEmbedBundleAndAssetsAsync","exportEmbedBundleAsync","exportEmbedAssetsAsync","debug","require","guessCopiedAppleBundlePath","bundleOutput","match","bundleName","path","basename","bundleParent","dirname","possiblePath","globSync","join","dot","projectRoot","options","setNodeEnv","dev","load","removeAsync","platform","previousPath","fs","existsSync","bundle","assets","mkdirSync","recursive","mode","Promise","all","output","save","Log","log","assetsDest","persistMetroAssetsAsync","outputDirectory","iosAssetCatalogDirectory","assetCatalogDest","exp","getConfig","skipSDKVersionRequirement","config","loadMetroConfigAsync","resetCache","maxWorkers","isExporting","getMetroBundler","server","getBundler","isHermes","isEnableHermesManaged","sourceMapUrl","sourcemapOutput","sourcemapUseAbsolutePath","bundleRequest","Server","DEFAULT_BUNDLE_OPTIONS","getMetroDirectBundleOptionsForExpoConfig","splitChunks","mainModuleName","resolveRealEntryFilePath","entryFile","minify","engine","undefined","bytecode","unstable_transformProfile","unstableTransformProfile","watch","end","profile","build","bind","bundleType","error","isError","isExecutingFromXcodebuild","message","stripAnsi","logMetroErrorInXcode","getAssets","Error","startsWith","realpathSync"],"mappings":"AAAA;;;;;CAKC,GACD;;;;;;;;;;;IAuCsBA,gBAAgB,MAAhBA,gBAAgB;IAoChBC,sCAAsC,MAAtCA,sCAAsC;IAoEtCC,+BAA+B,MAA/BA,+BAA+B;IAqB/BC,sBAAsB,MAAtBA,sBAAsB;IA8BtBC,sBAAsB,MAAtBA,sBAAsB;;;yBAlMlB,cAAc;;;;;;;8DACzB,IAAI;;;;;;;yBACc,MAAM;;;;;;;8DACpB,kBAAkB;;;;;;;8DAClB,gCAAgC;;;;;;;8DAElC,MAAM;;;;;;qCAGyC,uBAAuB;qBACnE,WAAW;kCACM,2CAA2C;8BACvB,4CAA4C;sBAC3E,kBAAkB;qBAChB,iBAAiB;yBAClB,qBAAqB;yBACxB,qBAAqB;8BACP,iBAAiB;iCAC7B,qBAAqB;oCACP,uBAAuB;;;;;;AAE/D,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,mBAAmB,CAAC,AAAC;AAEpD,SAASC,0BAA0B,CAACC,YAAoB,EAAE;IACxD,+CAA+C;IAC/C,IAAI,CAACA,YAAY,CAACC,KAAK,+CAA+C,EAAE;QACtEJ,KAAK,CAAC,oCAAoC,EAAEG,YAAY,CAAC,CAAC;QAC1D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAME,UAAU,GAAGC,KAAI,EAAA,QAAA,CAACC,QAAQ,CAACJ,YAAY,CAAC,AAAC;IAC/C,MAAMK,YAAY,GAAGF,KAAI,EAAA,QAAA,CAACG,OAAO,CAACN,YAAY,CAAC,AAAC;IAChD,MAAMO,YAAY,GAAGC,IAAAA,KAAQ,EAAA,KAAA,EAACL,KAAI,EAAA,QAAA,CAACM,IAAI,CAACJ,YAAY,EAAE,CAAC,MAAM,EAAEH,UAAU,C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KAAK,CAAC,EAAE;YAClB,0EAA0E;YAC1E,iIAAiI;YACjI,IAAI7D,OAAO,CAACK,QAAQ,KAAK,KAAK,EAAE;gBAC9B,8FAA8F;gBAC9F,IAAI,SAAS,IAAIwD,KAAK,IAAIE,IAAAA,oBAAyB,0BAAA,GAAE,EAAE;oBACrDF,KAAK,CAACG,OAAO,GAAGC,IAAAA,KAAS,UAAA,EAACJ,KAAK,CAACG,OAAO,CAAC,AAAU,CAAC;gBACrD,CAAC;gBACDE,IAAAA,oBAAoB,qBAAA,EAACnE,WAAW,EAAE8D,KAAK,CAAC,CAAC;YAC3C,CAAC;QACH,CAAC;QACD,MAAMA,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAASC,OAAO,CAACD,KAAU,EAAkB;IAC3C,OAAOA,KAAK,YAAYO,KAAK,CAAC;AAChC,CAAC;AAED;;;;;CAKC,GACD,SAASrB,wBAAwB,CAAChD,WAAmB,EAAEiD,SAAiB,EAAU;IAChF,IAAIjD,WAAW,CAACsE,UAAU,CAAC,cAAc,CAAC,IAAIrB,SAAS,CAACqB,UAAU,CAAC,MAAM,CAAC,EAAE;QAC1E,OAAO9D,GAAE,EAAA,QAAA,CAAC+D,YAAY,CAACtB,SAAS,CAAC,CAAC;IACpC,CAAC;IAED,OAAOA,SAAS,CAAC;AACnB,CAAC"}
|
package/build/src/utils/npm.js
CHANGED
|
@@ -122,19 +122,22 @@ async function npmViewAsync(...props) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
async function getNpmUrlAsync(packageName) {
|
|
125
|
-
const results = await npmViewAsync(packageName, "dist
|
|
125
|
+
const results = await npmViewAsync(packageName, "dist");
|
|
126
126
|
(0, _assert().default)(results, `Could not get npm url for package "${packageName}"`);
|
|
127
|
-
// Fully qualified url returns
|
|
127
|
+
// Fully qualified url returns an object.
|
|
128
128
|
// Example:
|
|
129
|
-
// 𝝠 npm view expo-template-bare-minimum@sdk-33 dist
|
|
130
|
-
if (typeof results === "
|
|
131
|
-
return results;
|
|
129
|
+
// 𝝠 npm view expo-template-bare-minimum@sdk-33 dist --json
|
|
130
|
+
if (typeof results === "object" && !Array.isArray(results)) {
|
|
131
|
+
return results.tarball;
|
|
132
132
|
}
|
|
133
|
-
// When the tag is arbitrary, the tarball
|
|
133
|
+
// When the tag is arbitrary, the tarball is an array, return the last value as it's the most recent.
|
|
134
134
|
// Example:
|
|
135
|
-
// 𝝠 npm view expo-template-bare-minimum@33 dist
|
|
135
|
+
// 𝝠 npm view expo-template-bare-minimum@33 dist --json
|
|
136
136
|
if (Array.isArray(results)) {
|
|
137
|
-
|
|
137
|
+
const lastResult = results[results.length - 1];
|
|
138
|
+
if (lastResult && typeof lastResult === "object" && !Array.isArray(lastResult)) {
|
|
139
|
+
return lastResult.tarball;
|
|
140
|
+
}
|
|
138
141
|
}
|
|
139
142
|
throw new _errors.CommandError("Expected results of `npm view ...` to be an array or string. Instead found: " + results);
|
|
140
143
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/npm.ts"],"sourcesContent":["import { JSONValue } from '@expo/json-file';\nimport spawnAsync from '@expo/spawn-async';\nimport assert from 'assert';\nimport crypto from 'crypto';\nimport fs from 'fs';\nimport slugify from 'slugify';\nimport { PassThrough, Stream } from 'stream';\nimport tar from 'tar';\nimport { promisify } from 'util';\n\nimport { createEntryResolver } from './createFileTransform';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { createCachedFetch } from '../api/rest/client';\n\nconst debug = require('debug')('expo:utils:npm') as typeof console.log;\n\nconst cachedFetch = createCachedFetch({\n cacheDirectory: 'template-cache',\n // Time to live. How long (in ms) responses remain cached before being automatically ejected. If undefined, responses are never automatically ejected from the cache.\n // ttl: 1000,\n});\n\nexport function sanitizeNpmPackageName(name: string): string {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n return (\n applyKnownNpmPackageNameRules(name) ||\n applyKnownNpmPackageNameRules(slugify(name)) ||\n // If nothing is left use 'app' like we do in Xcode projects.\n 'app'\n );\n}\n\nfunction applyKnownNpmPackageNameRules(name: string): string | null {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n\n // package name cannot start with '.' or '_'.\n while (/^(\\.|_)/.test(name)) {\n name = name.substring(1);\n }\n\n name = name.toLowerCase().replace(/[^a-zA-Z._\\-/@]/g, '');\n\n return (\n name\n // .replace(/![a-z0-9-._~]+/g, '')\n // Remove special characters\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') || null\n );\n}\n\nexport async function npmViewAsync(...props: string[]): Promise<JSONValue> {\n const cmd = ['view', ...props, '--json'];\n const results = (await spawnAsync('npm', cmd)).stdout?.trim();\n const cmdString = `npm ${cmd.join(' ')}`;\n debug('Run:', cmdString);\n if (!results) {\n return null;\n }\n try {\n return JSON.parse(results);\n } catch (error: any) {\n throw new Error(\n `Could not parse JSON returned from \"${cmdString}\".\\n\\n${results}\\n\\nError: ${error.message}`\n );\n }\n}\n\n/** Given a package name like `expo` or `expo@beta`, return the registry URL if it exists. */\nexport async function getNpmUrlAsync(packageName: string): Promise<string> {\n const results = await npmViewAsync(packageName, 'dist.tarball');\n\n assert(results, `Could not get npm url for package \"${packageName}\"`);\n\n // Fully qualified url returns a string.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@sdk-33 dist.tarball --json\n if (typeof results === 'string') {\n return results;\n }\n\n // When the tag is arbitrary, the tarball url is an array, return the last value as it's the most recent.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@33 dist.tarball --json\n if (Array.isArray(results)) {\n return results[results.length - 1] as string;\n }\n\n throw new CommandError(\n 'Expected results of `npm view ...` to be an array or string. Instead found: ' + results\n );\n}\n\n// @ts-ignore\nconst pipeline = promisify(Stream.pipeline);\n\nexport async function downloadAndExtractNpmModuleAsync(\n npmName: string,\n props: ExtractProps\n): Promise<string> {\n const url = await getNpmUrlAsync(npmName);\n\n debug('Fetch from URL:', url);\n return await extractNpmTarballFromUrlAsync(url, props);\n}\n\nexport async function extractLocalNpmTarballAsync(\n tarFilePath: string,\n props: ExtractProps\n): Promise<string> {\n const readStream = fs.createReadStream(tarFilePath);\n return await extractNpmTarballAsync(readStream, props);\n}\n\nexport type ExtractProps = {\n name: string;\n cwd: string;\n strip?: number;\n fileList?: string[];\n /** The checksum algorithm to use when verifying the tarball. */\n checksumAlgorithm?: string;\n /** An optional filter to selectively extract specific paths */\n filter?: tar.ExtractOptions['filter'];\n};\n\nasync function createUrlStreamAsync(url: string) {\n const response = await cachedFetch(url);\n if (!response.ok) {\n throw new Error(`Unexpected response: ${response.statusText}. From url: ${url}`);\n }\n\n return response.body;\n}\n\nexport async function extractNpmTarballFromUrlAsync(\n url: string,\n props: ExtractProps\n): Promise<string> {\n return await extractNpmTarballAsync(await createUrlStreamAsync(url), props);\n}\n\n/**\n * Extracts a tarball stream to a directory and returns the checksum of the tarball.\n */\nexport async function extractNpmTarballAsync(\n stream: NodeJS.ReadableStream,\n props: ExtractProps\n): Promise<string> {\n const { cwd, strip, name, fileList = [], filter } = props;\n\n await ensureDirectoryAsync(cwd);\n\n const hash = crypto.createHash(props.checksumAlgorithm ?? 'md5');\n const transformStream = new PassThrough();\n transformStream.on('data', (chunk) => {\n hash.update(chunk);\n });\n\n await pipeline(\n stream,\n transformStream,\n tar.extract(\n {\n cwd,\n filter,\n onentry: createEntryResolver(name),\n strip: strip ?? 1,\n },\n fileList\n )\n );\n\n return hash.digest('hex');\n}\n"],"names":["sanitizeNpmPackageName","npmViewAsync","getNpmUrlAsync","downloadAndExtractNpmModuleAsync","extractLocalNpmTarballAsync","extractNpmTarballFromUrlAsync","extractNpmTarballAsync","debug","require","cachedFetch","createCachedFetch","cacheDirectory","name","applyKnownNpmPackageNameRules","slugify","test","substring","toLowerCase","replace","normalize","props","cmd","results","spawnAsync","stdout","trim","cmdString","join","JSON","parse","error","Error","message","packageName","assert","Array","isArray","length","CommandError","pipeline","promisify","Stream","npmName","url","tarFilePath","readStream","fs","createReadStream","createUrlStreamAsync","response","ok","statusText","body","stream","cwd","strip","fileList","filter","ensureDirectoryAsync","hash","crypto","createHash","checksumAlgorithm","transformStream","PassThrough","on","chunk","update","tar","extract","onentry","createEntryResolver","digest"],"mappings":"AAAA;;;;;;;;;;;IAuBgBA,sBAAsB,MAAtBA,sBAAsB;IA6BhBC,YAAY,MAAZA,YAAY;IAkBZC,cAAc,MAAdA,cAAc;IA2BdC,gCAAgC,MAAhCA,gCAAgC;IAUhCC,2BAA2B,MAA3BA,2BAA2B;IA4B3BC,6BAA6B,MAA7BA,6BAA6B;IAU7BC,sBAAsB,MAAtBA,sBAAsB;;;8DAhJrB,mBAAmB;;;;;;;8DACvB,QAAQ;;;;;;;8DACR,QAAQ;;;;;;;8DACZ,IAAI;;;;;;;8DACC,SAAS;;;;;;;yBACO,QAAQ;;;;;;;8DAC5B,KAAK;;;;;;;yBACK,MAAM;;;;;;qCAEI,uBAAuB;qBACtB,OAAO;wBACf,UAAU;wBACL,oBAAoB;;;;;;AAEtD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,AAAsB,AAAC;AAEvE,MAAMC,WAAW,GAAGC,IAAAA,OAAiB,kBAAA,EAAC;IACpCC,cAAc,EAAE,gBAAgB;CAGjC,CAAC,AAAC;AAEI,SAASX,sBAAsB,CAACY,IAAY,EAAU;IAC3D,iEAAiE;IACjE,OACEC,6BAA6B,CAACD,IAAI,CAAC,IACnCC,6BAA6B,CAACC,IAAAA,QAAO,EAAA,QAAA,EAACF,IAAI,CAAC,CAAC,IAC5C,6DAA6D;IAC7D,KAAK,CACL;AACJ,CAAC;AAED,SAASC,6BAA6B,CAACD,IAAY,EAAiB;IAClE,iEAAiE;IAEjE,6CAA6C;IAC7C,MAAO,UAAUG,IAAI,CAACH,IAAI,CAAC,CAAE;QAC3BA,IAAI,GAAGA,IAAI,CAACI,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAEDJ,IAAI,GAAGA,I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AAC,KAAK,CAAC,CAAC;AAC5B,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/npm.ts"],"sourcesContent":["import { JSONValue } from '@expo/json-file';\nimport spawnAsync from '@expo/spawn-async';\nimport assert from 'assert';\nimport crypto from 'crypto';\nimport fs from 'fs';\nimport slugify from 'slugify';\nimport { PassThrough, Stream } from 'stream';\nimport tar from 'tar';\nimport { promisify } from 'util';\n\nimport { createEntryResolver } from './createFileTransform';\nimport { ensureDirectoryAsync } from './dir';\nimport { CommandError } from './errors';\nimport { createCachedFetch } from '../api/rest/client';\n\nconst debug = require('debug')('expo:utils:npm') as typeof console.log;\n\nconst cachedFetch = createCachedFetch({\n cacheDirectory: 'template-cache',\n // Time to live. How long (in ms) responses remain cached before being automatically ejected. If undefined, responses are never automatically ejected from the cache.\n // ttl: 1000,\n});\n\nexport function sanitizeNpmPackageName(name: string): string {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n return (\n applyKnownNpmPackageNameRules(name) ||\n applyKnownNpmPackageNameRules(slugify(name)) ||\n // If nothing is left use 'app' like we do in Xcode projects.\n 'app'\n );\n}\n\nfunction applyKnownNpmPackageNameRules(name: string): string | null {\n // https://github.com/npm/validate-npm-package-name/#naming-rules\n\n // package name cannot start with '.' or '_'.\n while (/^(\\.|_)/.test(name)) {\n name = name.substring(1);\n }\n\n name = name.toLowerCase().replace(/[^a-zA-Z._\\-/@]/g, '');\n\n return (\n name\n // .replace(/![a-z0-9-._~]+/g, '')\n // Remove special characters\n .normalize('NFD')\n .replace(/[\\u0300-\\u036f]/g, '') || null\n );\n}\n\nexport async function npmViewAsync(...props: string[]): Promise<JSONValue> {\n const cmd = ['view', ...props, '--json'];\n const results = (await spawnAsync('npm', cmd)).stdout?.trim();\n const cmdString = `npm ${cmd.join(' ')}`;\n debug('Run:', cmdString);\n if (!results) {\n return null;\n }\n try {\n return JSON.parse(results);\n } catch (error: any) {\n throw new Error(\n `Could not parse JSON returned from \"${cmdString}\".\\n\\n${results}\\n\\nError: ${error.message}`\n );\n }\n}\n\n/** Given a package name like `expo` or `expo@beta`, return the registry URL if it exists. */\nexport async function getNpmUrlAsync(packageName: string): Promise<string> {\n const results = await npmViewAsync(packageName, 'dist');\n\n assert(results, `Could not get npm url for package \"${packageName}\"`);\n\n // Fully qualified url returns an object.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@sdk-33 dist --json\n if (typeof results === 'object' && !Array.isArray(results)) {\n return results.tarball as string;\n }\n\n // When the tag is arbitrary, the tarball is an array, return the last value as it's the most recent.\n // Example:\n // 𝝠 npm view expo-template-bare-minimum@33 dist --json\n if (Array.isArray(results)) {\n const lastResult = results[results.length - 1];\n\n if (lastResult && typeof lastResult === 'object' && !Array.isArray(lastResult)) {\n return lastResult.tarball as string;\n }\n }\n\n throw new CommandError(\n 'Expected results of `npm view ...` to be an array or string. Instead found: ' + results\n );\n}\n\n// @ts-ignore\nconst pipeline = promisify(Stream.pipeline);\n\nexport async function downloadAndExtractNpmModuleAsync(\n npmName: string,\n props: ExtractProps\n): Promise<string> {\n const url = await getNpmUrlAsync(npmName);\n\n debug('Fetch from URL:', url);\n return await extractNpmTarballFromUrlAsync(url, props);\n}\n\nexport async function extractLocalNpmTarballAsync(\n tarFilePath: string,\n props: ExtractProps\n): Promise<string> {\n const readStream = fs.createReadStream(tarFilePath);\n return await extractNpmTarballAsync(readStream, props);\n}\n\nexport type ExtractProps = {\n name: string;\n cwd: string;\n strip?: number;\n fileList?: string[];\n /** The checksum algorithm to use when verifying the tarball. */\n checksumAlgorithm?: string;\n /** An optional filter to selectively extract specific paths */\n filter?: tar.ExtractOptions['filter'];\n};\n\nasync function createUrlStreamAsync(url: string) {\n const response = await cachedFetch(url);\n if (!response.ok) {\n throw new Error(`Unexpected response: ${response.statusText}. From url: ${url}`);\n }\n\n return response.body;\n}\n\nexport async function extractNpmTarballFromUrlAsync(\n url: string,\n props: ExtractProps\n): Promise<string> {\n return await extractNpmTarballAsync(await createUrlStreamAsync(url), props);\n}\n\n/**\n * Extracts a tarball stream to a directory and returns the checksum of the tarball.\n */\nexport async function extractNpmTarballAsync(\n stream: NodeJS.ReadableStream,\n props: ExtractProps\n): Promise<string> {\n const { cwd, strip, name, fileList = [], filter } = props;\n\n await ensureDirectoryAsync(cwd);\n\n const hash = crypto.createHash(props.checksumAlgorithm ?? 'md5');\n const transformStream = new PassThrough();\n transformStream.on('data', (chunk) => {\n hash.update(chunk);\n });\n\n await pipeline(\n stream,\n transformStream,\n tar.extract(\n {\n cwd,\n filter,\n onentry: createEntryResolver(name),\n strip: strip ?? 1,\n },\n fileList\n )\n );\n\n return hash.digest('hex');\n}\n"],"names":["sanitizeNpmPackageName","npmViewAsync","getNpmUrlAsync","downloadAndExtractNpmModuleAsync","extractLocalNpmTarballAsync","extractNpmTarballFromUrlAsync","extractNpmTarballAsync","debug","require","cachedFetch","createCachedFetch","cacheDirectory","name","applyKnownNpmPackageNameRules","slugify","test","substring","toLowerCase","replace","normalize","props","cmd","results","spawnAsync","stdout","trim","cmdString","join","JSON","parse","error","Error","message","packageName","assert","Array","isArray","tarball","lastResult","length","CommandError","pipeline","promisify","Stream","npmName","url","tarFilePath","readStream","fs","createReadStream","createUrlStreamAsync","response","ok","statusText","body","stream","cwd","strip","fileList","filter","ensureDirectoryAsync","hash","crypto","createHash","checksumAlgorithm","transformStream","PassThrough","on","chunk","update","tar","extract","onentry","createEntryResolver","digest"],"mappings":"AAAA;;;;;;;;;;;IAuBgBA,sBAAsB,MAAtBA,sBAAsB;IA6BhBC,YAAY,MAAZA,YAAY;IAkBZC,cAAc,MAAdA,cAAc;IA+BdC,gCAAgC,MAAhCA,gCAAgC;IAUhCC,2BAA2B,MAA3BA,2BAA2B;IA4B3BC,6BAA6B,MAA7BA,6BAA6B;IAU7BC,sBAAsB,MAAtBA,sBAAsB;;;8DApJrB,mBAAmB;;;;;;;8DACvB,QAAQ;;;;;;;8DACR,QAAQ;;;;;;;8DACZ,IAAI;;;;;;;8DACC,SAAS;;;;;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40,9 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@babel/runtime": "^7.20.0",
|
|
42
42
|
"@expo/code-signing-certificates": "0.0.5",
|
|
43
|
-
"@expo/config": "~9.0.0
|
|
44
|
-
"@expo/config-plugins": "~8.0.0
|
|
45
|
-
"@expo/devcert": "^1.
|
|
43
|
+
"@expo/config": "~9.0.0",
|
|
44
|
+
"@expo/config-plugins": "~8.0.0",
|
|
45
|
+
"@expo/devcert": "^1.1.2",
|
|
46
46
|
"@expo/env": "~0.3.0",
|
|
47
47
|
"@expo/image-utils": "^0.5.0",
|
|
48
48
|
"@expo/json-file": "^8.3.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@expo/osascript": "^2.0.31",
|
|
51
51
|
"@expo/package-manager": "^1.5.0",
|
|
52
52
|
"@expo/plist": "^0.1.0",
|
|
53
|
-
"@expo/prebuild-config": "7.0.
|
|
53
|
+
"@expo/prebuild-config": "7.0.4",
|
|
54
54
|
"@expo/rudder-sdk-node": "1.1.1",
|
|
55
55
|
"@expo/spawn-async": "^1.7.2",
|
|
56
56
|
"@expo/xcpretty": "^4.3.0",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"arg": "5.0.2",
|
|
62
62
|
"better-opn": "~3.0.2",
|
|
63
63
|
"bplist-parser": "^0.3.1",
|
|
64
|
-
"cacache": "^
|
|
64
|
+
"cacache": "^18.0.2",
|
|
65
65
|
"chalk": "^4.0.0",
|
|
66
66
|
"ci-info": "^3.3.0",
|
|
67
67
|
"connect": "^3.7.0",
|
|
@@ -134,7 +134,7 @@
|
|
|
134
134
|
"@taskr/esnext": "1.1.0",
|
|
135
135
|
"@taskr/watch": "1.1.0",
|
|
136
136
|
"@types/accepts": "^1.3.5",
|
|
137
|
-
"@types/cacache": "^
|
|
137
|
+
"@types/cacache": "^17.0.2",
|
|
138
138
|
"@types/connect": "^3.4.33",
|
|
139
139
|
"@types/debug": "^4.1.7",
|
|
140
140
|
"@types/execa": "^0.9.0",
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"tree-kill": "^1.2.2",
|
|
172
172
|
"tsd": "^0.28.1"
|
|
173
173
|
},
|
|
174
|
-
"gitHead": "
|
|
174
|
+
"gitHead": "d6515f12fc9eee6d563cc4de32f9aee5c856158f"
|
|
175
175
|
}
|