@expo/cli 0.22.16 → 0.22.18
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/exportDomComponents.js +17 -4
- package/build/src/export/exportDomComponents.js.map +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +4 -4
package/build/bin/cli
CHANGED
|
@@ -63,7 +63,7 @@ async function exportDomComponentAsync({ filePath , projectRoot , dev , devServe
|
|
|
63
63
|
const virtualEntry = (0, _filePath.toPosixPath)((0, _resolveFrom().default)(projectRoot, "expo/dom/entry.js"));
|
|
64
64
|
debug("Bundle DOM Component:", filePath);
|
|
65
65
|
// MUST MATCH THE BABEL PLUGIN!
|
|
66
|
-
const hash = _crypto().default.createHash("
|
|
66
|
+
const hash = _crypto().default.createHash("md5").update(filePath).digest("hex");
|
|
67
67
|
const outputName = `${_domComponentsMiddleware.DOM_COMPONENTS_BUNDLE_DIR}/${hash}.html`;
|
|
68
68
|
const generatedEntryPath = (0, _filePath.toPosixPath)(filePath.startsWith("file://") ? _url().default.fileURLToPath(filePath) : filePath);
|
|
69
69
|
const baseUrl = `/${_domComponentsMiddleware.DOM_COMPONENTS_BUNDLE_DIR}`;
|
|
@@ -144,15 +144,28 @@ function updateDomComponentAssetsForMD5Naming({ domComponentReference , nativeBu
|
|
|
144
144
|
const htmlContent = files.get(htmlOutputName);
|
|
145
145
|
(0, _assert().default)(htmlContent);
|
|
146
146
|
const htmlMd5 = _crypto().default.createHash("md5").update(htmlContent.contents.toString()).digest("hex");
|
|
147
|
-
const hash = _crypto().default.createHash("
|
|
147
|
+
const hash = _crypto().default.createHash("md5").update(domComponentReference).digest("hex");
|
|
148
148
|
for (const artifact1 of nativeBundle.artifacts){
|
|
149
149
|
if (artifact1.type !== "js") {
|
|
150
150
|
continue;
|
|
151
151
|
}
|
|
152
152
|
const assetEntity = files.get(artifact1.filename);
|
|
153
153
|
(0, _assert().default)(assetEntity);
|
|
154
|
-
|
|
155
|
-
|
|
154
|
+
if (Buffer.isBuffer(assetEntity.contents)) {
|
|
155
|
+
const searchBuffer = Buffer.from(`${hash}.html`, "utf8");
|
|
156
|
+
const replaceBuffer = Buffer.from(`${htmlMd5}.html`, "utf8");
|
|
157
|
+
(0, _assert().default)(searchBuffer.length === replaceBuffer.length);
|
|
158
|
+
let index1 = assetEntity.contents.indexOf(searchBuffer, 0);
|
|
159
|
+
while(index1 !== -1){
|
|
160
|
+
replaceBuffer.copy(assetEntity.contents, index1);
|
|
161
|
+
index1 = assetEntity.contents.indexOf(searchBuffer, index1 + searchBuffer.length);
|
|
162
|
+
}
|
|
163
|
+
} else {
|
|
164
|
+
const search = `${hash}.html`;
|
|
165
|
+
const replace = `${htmlMd5}.html`;
|
|
166
|
+
(0, _assert().default)(search.length === replace.length);
|
|
167
|
+
assetEntity.contents = assetEntity.contents.toString().replaceAll(search, replace);
|
|
168
|
+
}
|
|
156
169
|
}
|
|
157
170
|
assetsMetadata.push({
|
|
158
171
|
path: htmlOutputName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/export/exportDomComponents.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport assert from 'assert';\nimport crypto from 'crypto';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport url from 'url';\n\nimport { type PlatformMetadata } from './createMetadataJson';\nimport { type BundleOutput, type ExportAssetMap, getFilesFromSerialAssets } from './saveAssets';\nimport { type MetroBundlerDevServer } from '../start/server/metro/MetroBundlerDevServer';\nimport { serializeHtmlWithAssets } from '../start/server/metro/serializeHtml';\nimport {\n getDomComponentHtml,\n DOM_COMPONENTS_BUNDLE_DIR,\n} from '../start/server/middleware/DomComponentsMiddleware';\nimport { env } from '../utils/env';\nimport { resolveRealEntryFilePath, toPosixPath } from '../utils/filePath';\n\nconst debug = require('debug')('expo:export:exportDomComponents') as typeof console.log;\n\n// TODO(EvanBacon): determine how to support DOM Components with hosting.\nexport async function exportDomComponentAsync({\n filePath,\n projectRoot,\n dev,\n devServer,\n isHermes,\n includeSourceMaps,\n exp,\n files,\n}: {\n filePath: string;\n projectRoot: string;\n dev: boolean;\n devServer: MetroBundlerDevServer;\n isHermes: boolean;\n includeSourceMaps: boolean;\n exp: ExpoConfig;\n files: ExportAssetMap;\n}): Promise<{\n bundle: BundleOutput;\n htmlOutputName: string;\n}> {\n const virtualEntry = toPosixPath(resolveFrom(projectRoot, 'expo/dom/entry.js'));\n debug('Bundle DOM Component:', filePath);\n // MUST MATCH THE BABEL PLUGIN!\n const hash = crypto.createHash('sha1').update(filePath).digest('hex');\n const outputName = `${DOM_COMPONENTS_BUNDLE_DIR}/${hash}.html`;\n const generatedEntryPath = toPosixPath(\n filePath.startsWith('file://') ? url.fileURLToPath(filePath) : filePath\n );\n const baseUrl = `/${DOM_COMPONENTS_BUNDLE_DIR}`;\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport = './' + path.posix.relative(path.dirname(virtualEntry), generatedEntryPath);\n // Run metro bundler and create the JS bundles/source maps.\n const bundle = await devServer.legacySinglePageExportBundleAsync({\n platform: 'web',\n domRoot: encodeURI(relativeImport),\n splitChunks: !env.EXPO_NO_BUNDLE_SPLITTING,\n mainModuleName: resolveRealEntryFilePath(projectRoot, virtualEntry),\n mode: dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: includeSourceMaps,\n bytecode: false,\n reactCompiler: !!exp.experiments?.reactCompiler,\n baseUrl: './',\n // Minify may be false because it's skipped on native when Hermes is enabled, default to true.\n minify: true,\n });\n\n const html = await serializeHtmlWithAssets({\n isExporting: true,\n resources: bundle.artifacts,\n template: getDomComponentHtml(),\n baseUrl: './',\n });\n\n const serialAssets = bundle.artifacts.map((a) => {\n return {\n ...a,\n filename: path.join(baseUrl, a.filename),\n };\n });\n\n getFilesFromSerialAssets(serialAssets, {\n includeSourceMaps,\n files,\n platform: 'web',\n });\n\n files.set(outputName, {\n contents: html,\n });\n\n return {\n bundle,\n htmlOutputName: outputName,\n };\n}\n\n/**\n * For EAS Updates exports,\n * post-processes the DOM component bundle and updates the asset paths to use flattened MD5 naming.\n */\nexport function updateDomComponentAssetsForMD5Naming({\n domComponentReference,\n nativeBundle,\n domComponentBundle,\n files,\n htmlOutputName,\n}: {\n domComponentReference: string;\n nativeBundle: BundleOutput;\n domComponentBundle: BundleOutput;\n files: ExportAssetMap;\n htmlOutputName: string;\n}): PlatformMetadata['assets'] {\n const assetsMetadata: PlatformMetadata['assets'] = [];\n\n for (const artifact of domComponentBundle.artifacts) {\n if (artifact.type !== 'js') {\n continue;\n }\n const artifactAssetName = `/${DOM_COMPONENTS_BUNDLE_DIR}/${artifact.filename}`;\n let source = artifact.source;\n\n // [0] Updates asset paths in the DOM component JS bundle (which is a web bundle)\n for (const asset of domComponentBundle.assets) {\n const prefix = asset.httpServerLocation.startsWith('./')\n ? asset.httpServerLocation.slice(2)\n : asset.httpServerLocation;\n const uri = `${prefix}/${asset.name}.${asset.type}`;\n const regexp = new RegExp(`(uri:\")(${uri})(\")`, 'g');\n const index = asset.scales.findIndex((s) => s === 1) ?? 0; // DOM components (web) uses 1x assets\n const md5 = asset.fileHashes[index];\n source = source.replace(regexp, `$1${md5}.${asset.type}$3`);\n\n const domJsAssetEntity = files.get(artifactAssetName);\n assert(domJsAssetEntity);\n domJsAssetEntity.contents = source;\n }\n\n // [1] Updates JS artifacts in HTML\n const md5 = crypto.createHash('md5').update(source).digest('hex');\n const htmlAssetEntity = files.get(htmlOutputName);\n assert(htmlAssetEntity);\n const regexp = new RegExp(`(<script src=\")(.*${artifact.filename})(\" defer></script>)`, 'g');\n htmlAssetEntity.contents = htmlAssetEntity.contents.toString().replace(regexp, `$1${md5}.js$3`);\n\n assetsMetadata.push({\n path: artifactAssetName.slice(1),\n ext: 'js',\n });\n }\n\n // [2] Updates HTML names from native bundle\n const htmlContent = files.get(htmlOutputName);\n assert(htmlContent);\n const htmlMd5 = crypto.createHash('md5').update(htmlContent.contents.toString()).digest('hex');\n const hash = crypto.createHash('sha1').update(domComponentReference).digest('hex');\n for (const artifact of nativeBundle.artifacts) {\n if (artifact.type !== 'js') {\n continue;\n }\n const assetEntity = files.get(artifact.filename);\n assert(assetEntity);\n const regexp = new RegExp(`(['\"])${hash}\\\\.html(['\"])`, 'g');\n assetEntity.contents = assetEntity.contents.toString().replace(regexp, `$1${htmlMd5}.html$2`);\n }\n assetsMetadata.push({\n path: htmlOutputName,\n ext: 'html',\n });\n\n return assetsMetadata;\n}\n"],"names":["exportDomComponentAsync","updateDomComponentAssetsForMD5Naming","debug","require","filePath","projectRoot","dev","devServer","isHermes","includeSourceMaps","exp","files","virtualEntry","toPosixPath","resolveFrom","hash","crypto","createHash","update","digest","outputName","DOM_COMPONENTS_BUNDLE_DIR","generatedEntryPath","startsWith","url","fileURLToPath","baseUrl","relativeImport","path","posix","relative","dirname","bundle","legacySinglePageExportBundleAsync","platform","domRoot","encodeURI","splitChunks","env","EXPO_NO_BUNDLE_SPLITTING","mainModuleName","resolveRealEntryFilePath","mode","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","minify","html","serializeHtmlWithAssets","isExporting","resources","artifacts","template","getDomComponentHtml","serialAssets","map","a","filename","join","getFilesFromSerialAssets","set","contents","htmlOutputName","domComponentReference","nativeBundle","domComponentBundle","assetsMetadata","artifact","type","artifactAssetName","source","asset","assets","prefix","httpServerLocation","slice","uri","name","regexp","RegExp","index","scales","findIndex","s","md5","fileHashes","replace","domJsAssetEntity","get","assert","htmlAssetEntity","toString","push","ext","htmlContent","htmlMd5","assetEntity"],"mappings":"AAAA;;;;;;;;;;;IAqBsBA,uBAAuB,MAAvBA,uBAAuB;IAmF7BC,oCAAoC,MAApCA,oCAAoC;;;8DAvGjC,QAAQ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;QAClBnE,IAAI,EAAEqC,cAAc;QACpB+B,GAAG,EAAE,MAAM;KACZ,CAAC,CAAC;IAEH,OAAO3B,cAAc,CAAC;AACxB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/export/exportDomComponents.ts"],"sourcesContent":["import type { ExpoConfig } from '@expo/config';\nimport assert from 'assert';\nimport crypto from 'crypto';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport url from 'url';\n\nimport { type PlatformMetadata } from './createMetadataJson';\nimport { type BundleOutput, type ExportAssetMap, getFilesFromSerialAssets } from './saveAssets';\nimport { type MetroBundlerDevServer } from '../start/server/metro/MetroBundlerDevServer';\nimport { serializeHtmlWithAssets } from '../start/server/metro/serializeHtml';\nimport {\n getDomComponentHtml,\n DOM_COMPONENTS_BUNDLE_DIR,\n} from '../start/server/middleware/DomComponentsMiddleware';\nimport { env } from '../utils/env';\nimport { resolveRealEntryFilePath, toPosixPath } from '../utils/filePath';\n\nconst debug = require('debug')('expo:export:exportDomComponents') as typeof console.log;\n\n// TODO(EvanBacon): determine how to support DOM Components with hosting.\nexport async function exportDomComponentAsync({\n filePath,\n projectRoot,\n dev,\n devServer,\n isHermes,\n includeSourceMaps,\n exp,\n files,\n}: {\n filePath: string;\n projectRoot: string;\n dev: boolean;\n devServer: MetroBundlerDevServer;\n isHermes: boolean;\n includeSourceMaps: boolean;\n exp: ExpoConfig;\n files: ExportAssetMap;\n}): Promise<{\n bundle: BundleOutput;\n htmlOutputName: string;\n}> {\n const virtualEntry = toPosixPath(resolveFrom(projectRoot, 'expo/dom/entry.js'));\n debug('Bundle DOM Component:', filePath);\n // MUST MATCH THE BABEL PLUGIN!\n const hash = crypto.createHash('md5').update(filePath).digest('hex');\n const outputName = `${DOM_COMPONENTS_BUNDLE_DIR}/${hash}.html`;\n const generatedEntryPath = toPosixPath(\n filePath.startsWith('file://') ? url.fileURLToPath(filePath) : filePath\n );\n const baseUrl = `/${DOM_COMPONENTS_BUNDLE_DIR}`;\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport = './' + path.posix.relative(path.dirname(virtualEntry), generatedEntryPath);\n // Run metro bundler and create the JS bundles/source maps.\n const bundle = await devServer.legacySinglePageExportBundleAsync({\n platform: 'web',\n domRoot: encodeURI(relativeImport),\n splitChunks: !env.EXPO_NO_BUNDLE_SPLITTING,\n mainModuleName: resolveRealEntryFilePath(projectRoot, virtualEntry),\n mode: dev ? 'development' : 'production',\n engine: isHermes ? 'hermes' : undefined,\n serializerIncludeMaps: includeSourceMaps,\n bytecode: false,\n reactCompiler: !!exp.experiments?.reactCompiler,\n baseUrl: './',\n // Minify may be false because it's skipped on native when Hermes is enabled, default to true.\n minify: true,\n });\n\n const html = await serializeHtmlWithAssets({\n isExporting: true,\n resources: bundle.artifacts,\n template: getDomComponentHtml(),\n baseUrl: './',\n });\n\n const serialAssets = bundle.artifacts.map((a) => {\n return {\n ...a,\n filename: path.join(baseUrl, a.filename),\n };\n });\n\n getFilesFromSerialAssets(serialAssets, {\n includeSourceMaps,\n files,\n platform: 'web',\n });\n\n files.set(outputName, {\n contents: html,\n });\n\n return {\n bundle,\n htmlOutputName: outputName,\n };\n}\n\n/**\n * For EAS Updates exports,\n * post-processes the DOM component bundle and updates the asset paths to use flattened MD5 naming.\n */\nexport function updateDomComponentAssetsForMD5Naming({\n domComponentReference,\n nativeBundle,\n domComponentBundle,\n files,\n htmlOutputName,\n}: {\n domComponentReference: string;\n nativeBundle: BundleOutput;\n domComponentBundle: BundleOutput;\n files: ExportAssetMap;\n htmlOutputName: string;\n}): PlatformMetadata['assets'] {\n const assetsMetadata: PlatformMetadata['assets'] = [];\n\n for (const artifact of domComponentBundle.artifacts) {\n if (artifact.type !== 'js') {\n continue;\n }\n const artifactAssetName = `/${DOM_COMPONENTS_BUNDLE_DIR}/${artifact.filename}`;\n let source = artifact.source;\n\n // [0] Updates asset paths in the DOM component JS bundle (which is a web bundle)\n for (const asset of domComponentBundle.assets) {\n const prefix = asset.httpServerLocation.startsWith('./')\n ? asset.httpServerLocation.slice(2)\n : asset.httpServerLocation;\n const uri = `${prefix}/${asset.name}.${asset.type}`;\n const regexp = new RegExp(`(uri:\")(${uri})(\")`, 'g');\n const index = asset.scales.findIndex((s) => s === 1) ?? 0; // DOM components (web) uses 1x assets\n const md5 = asset.fileHashes[index];\n source = source.replace(regexp, `$1${md5}.${asset.type}$3`);\n\n const domJsAssetEntity = files.get(artifactAssetName);\n assert(domJsAssetEntity);\n domJsAssetEntity.contents = source;\n }\n\n // [1] Updates JS artifacts in HTML\n const md5 = crypto.createHash('md5').update(source).digest('hex');\n const htmlAssetEntity = files.get(htmlOutputName);\n assert(htmlAssetEntity);\n const regexp = new RegExp(`(<script src=\")(.*${artifact.filename})(\" defer></script>)`, 'g');\n htmlAssetEntity.contents = htmlAssetEntity.contents.toString().replace(regexp, `$1${md5}.js$3`);\n\n assetsMetadata.push({\n path: artifactAssetName.slice(1),\n ext: 'js',\n });\n }\n\n // [2] Updates HTML names from native bundle\n const htmlContent = files.get(htmlOutputName);\n assert(htmlContent);\n const htmlMd5 = crypto.createHash('md5').update(htmlContent.contents.toString()).digest('hex');\n const hash = crypto.createHash('md5').update(domComponentReference).digest('hex');\n for (const artifact of nativeBundle.artifacts) {\n if (artifact.type !== 'js') {\n continue;\n }\n const assetEntity = files.get(artifact.filename);\n assert(assetEntity);\n if (Buffer.isBuffer(assetEntity.contents)) {\n const searchBuffer = Buffer.from(`${hash}.html`, 'utf8');\n const replaceBuffer = Buffer.from(`${htmlMd5}.html`, 'utf8');\n assert(searchBuffer.length === replaceBuffer.length);\n let index = assetEntity.contents.indexOf(searchBuffer, 0);\n while (index !== -1) {\n replaceBuffer.copy(assetEntity.contents, index);\n index = assetEntity.contents.indexOf(searchBuffer, index + searchBuffer.length);\n }\n } else {\n const search = `${hash}.html`;\n const replace = `${htmlMd5}.html`;\n assert(search.length === replace.length);\n assetEntity.contents = assetEntity.contents.toString().replaceAll(search, replace);\n }\n }\n assetsMetadata.push({\n path: htmlOutputName,\n ext: 'html',\n });\n\n return assetsMetadata;\n}\n"],"names":["exportDomComponentAsync","updateDomComponentAssetsForMD5Naming","debug","require","filePath","projectRoot","dev","devServer","isHermes","includeSourceMaps","exp","files","virtualEntry","toPosixPath","resolveFrom","hash","crypto","createHash","update","digest","outputName","DOM_COMPONENTS_BUNDLE_DIR","generatedEntryPath","startsWith","url","fileURLToPath","baseUrl","relativeImport","path","posix","relative","dirname","bundle","legacySinglePageExportBundleAsync","platform","domRoot","encodeURI","splitChunks","env","EXPO_NO_BUNDLE_SPLITTING","mainModuleName","resolveRealEntryFilePath","mode","engine","undefined","serializerIncludeMaps","bytecode","reactCompiler","experiments","minify","html","serializeHtmlWithAssets","isExporting","resources","artifacts","template","getDomComponentHtml","serialAssets","map","a","filename","join","getFilesFromSerialAssets","set","contents","htmlOutputName","domComponentReference","nativeBundle","domComponentBundle","assetsMetadata","artifact","type","artifactAssetName","source","asset","assets","prefix","httpServerLocation","slice","uri","name","regexp","RegExp","index","scales","findIndex","s","md5","fileHashes","replace","domJsAssetEntity","get","assert","htmlAssetEntity","toString","push","ext","htmlContent","htmlMd5","assetEntity","Buffer","isBuffer","searchBuffer","from","replaceBuffer","length","indexOf","copy","search","replaceAll"],"mappings":"AAAA;;;;;;;;;;;IAqBsBA,uBAAuB,MAAvBA,uBAAuB;IAmF7BC,oCAAoC,MAApCA,oCAAoC;;;8DAvGjC,QAAQ;;;;;;;8DACR,QAAQ;;;;;;;8DACV,MAAM;;;;;;;8DACC,cAAc;;;;;;;8DACtB,KAAK;;;;;;4BAG4D,cAAc;+BAEvD,qCAAqC;yCAItE,oDAAoD;qBACvC,cAAc;0BACoB,mBAAmB;;;;;;AAEzE,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,iCAAiC,CAAC,AAAsB,AAAC;AAGjF,eAAeH,uBAAuB,CAAC,EAC5CI,QAAQ,CAAA,EACRC,WAAW,CAAA,EACXC,GAAG,CAAA,EACHC,SAAS,CAAA,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AAY,EAAEnB,MAAK,GAAGmB,YAAY,CAACG,MAAM,CAAC,CAAC;YAClF,CAAC;QACH,OAAO;YACL,MAAMG,MAAM,GAAG,CAAC,EAAE7F,IAAI,CAAC,KAAK,CAAC,AAAC;YAC9B,MAAM0E,OAAO,GAAG,CAAC,EAAES,OAAO,CAAC,KAAK,CAAC,AAAC;YAClCN,IAAAA,OAAM,EAAA,QAAA,EAACgB,MAAM,CAACH,MAAM,KAAKhB,OAAO,CAACgB,MAAM,CAAC,CAAC;YACzCN,WAAW,CAACnC,QAAQ,GAAGmC,WAAW,CAACnC,QAAQ,CAAC8B,QAAQ,EAAE,CAACe,UAAU,CAACD,MAAM,EAAEnB,OAAO,CAAC,CAAC;QACrF,CAAC;IACH,CAAC;IACDpB,cAAc,CAAC0B,IAAI,CAAC;QAClBnE,IAAI,EAAEqC,cAAc;QACpB+B,GAAG,EAAE,MAAM;KACZ,CAAC,CAAC;IAEH,OAAO3B,cAAc,CAAC;AACxB,CAAC"}
|
|
@@ -124,7 +124,7 @@ function getDomComponentHtml(src, { title } = {}) {
|
|
|
124
124
|
<noscript>DOM Components require <code>javaScriptEnabled</code></noscript>
|
|
125
125
|
<!-- Root element for the DOM component. -->
|
|
126
126
|
<div id="root"></div>
|
|
127
|
-
${src ? `<script crossorigin src="${src}"></script>` : ""}
|
|
127
|
+
${src ? `<script crossorigin src="${src.replace(/^https?:/, "")}"></script>` : ""}
|
|
128
128
|
</body>
|
|
129
129
|
</html>`;
|
|
130
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/DomComponentsMiddleware.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createBundleUrlPath, ExpoMetroOptions } from './metroOptions';\nimport type { ServerRequest, ServerResponse } from './server.types';\nimport { Log } from '../../../log';\nimport { toPosixPath } from '../../../utils/filePath';\nimport { memoize } from '../../../utils/fn';\nimport { fileURLToFilePath } from '../metro/createServerComponentsMiddleware';\n\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const DOM_COMPONENTS_BUNDLE_DIR = 'www.bundle';\n\nconst warnUnstable = memoize(() =>\n Log.warn('Using experimental DOM Components API. Production exports may not work as expected.')\n);\n\nconst checkWebViewInstalled = memoize((projectRoot: string) => {\n const webViewInstalled =\n resolveFrom.silent(projectRoot, 'react-native-webview') ||\n resolveFrom.silent(projectRoot, '@expo/dom-webview');\n if (!webViewInstalled) {\n throw new Error(\n `To use DOM Components, you must install the 'react-native-webview' package. Run 'npx expo install react-native-webview' to install it.`\n );\n }\n});\n\ntype CreateDomComponentsMiddlewareOptions = {\n /** The absolute metro or server root, used to calculate the relative dom entry path */\n metroRoot: string;\n /** The absolute project root, used to resolve the `expo/dom/entry.js` path */\n projectRoot: string;\n};\n\nexport function createDomComponentsMiddleware(\n { metroRoot, projectRoot }: CreateDomComponentsMiddlewareOptions,\n instanceMetroOptions: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'platform' | 'bytecode'>\n) {\n return (req: ServerRequest, res: ServerResponse, next: (err?: Error) => void) => {\n if (!req.url) return next();\n\n const url = coerceUrl(req.url);\n\n // Match `/_expo/@dom`.\n // This URL can contain additional paths like `/_expo/@dom/foo.js?file=...` to help the Safari dev tools.\n if (!url.pathname.startsWith('/_expo/@dom')) {\n return next();\n }\n\n const file = url.searchParams.get('file');\n\n if (!file || !file.startsWith('file://')) {\n res.statusCode = 400;\n res.statusMessage = 'Invalid file path: ' + file;\n return res.end();\n }\n\n checkWebViewInstalled(projectRoot);\n warnUnstable();\n\n // Generate a unique entry file for the webview.\n const generatedEntry = toPosixPath(file.startsWith('file://') ? fileURLToFilePath(file) : file);\n const virtualEntry = toPosixPath(resolveFrom(projectRoot, 'expo/dom/entry.js'));\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport = './' + path.posix.relative(path.dirname(virtualEntry), generatedEntry);\n // Create the script URL\n const requestUrlBase = `http://${req.headers.host}`;\n const metroUrl = new URL(\n createBundleUrlPath({\n ...instanceMetroOptions,\n domRoot: encodeURI(relativeImport),\n baseUrl: '/',\n mainModuleName: path.relative(metroRoot, virtualEntry),\n bytecode: false,\n platform: 'web',\n isExporting: false,\n engine: 'hermes',\n // Required for ensuring bundler errors are caught in the root entry / async boundary and can be recovered from automatically.\n lazy: true,\n }),\n requestUrlBase\n ).toString();\n\n res.statusCode = 200;\n // Return HTML file\n res.setHeader('Content-Type', 'text/html');\n\n res.end(\n // Create the entry HTML file.\n getDomComponentHtml(metroUrl, { title: path.basename(file) })\n );\n };\n}\n\nfunction coerceUrl(url: string) {\n try {\n return new URL(url);\n } catch {\n return new URL(url, 'https://localhost:0');\n }\n}\n\nexport function getDomComponentHtml(src?: string, { title }: { title?: string } = {}) {\n // This HTML is not optimized for `react-native-web` since DOM Components are meant for general React DOM web development.\n return `\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\" />\n <meta httpEquiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">\n ${title ? `<title>${title}</title>` : ''}\n <style id=\"expo-dom-component-style\">\n /* These styles make the body full-height */\n html,\n body {\n -webkit-overflow-scrolling: touch; /* Enables smooth momentum scrolling */\n }\n /* These styles make the root element full-height */\n #root {\n display: flex;\n flex: 1;\n }\n </style>\n </head>\n <body>\n <noscript>DOM Components require <code>javaScriptEnabled</code></noscript>\n <!-- Root element for the DOM component. -->\n <div id=\"root\"></div>\n ${src ? `<script crossorigin src=\"${src}\"></script>` : ''}\n </body>\n</html>`;\n}\n"],"names":["DOM_COMPONENTS_BUNDLE_DIR","createDomComponentsMiddleware","getDomComponentHtml","warnUnstable","memoize","Log","warn","checkWebViewInstalled","projectRoot","webViewInstalled","resolveFrom","silent","Error","metroRoot","instanceMetroOptions","req","res","next","url","coerceUrl","pathname","startsWith","file","searchParams","get","statusCode","statusMessage","end","generatedEntry","toPosixPath","fileURLToFilePath","virtualEntry","relativeImport","path","posix","relative","dirname","requestUrlBase","headers","host","metroUrl","URL","createBundleUrlPath","domRoot","encodeURI","baseUrl","mainModuleName","bytecode","platform","isExporting","engine","lazy","toString","setHeader","title","basename","src"],"mappings":"AAAA;;;;;;;;;;;IAYaA,yBAAyB,MAAzBA,yBAAyB;IAwBtBC,6BAA6B,MAA7BA,6BAA6B;IAoE7BC,mBAAmB,MAAnBA,mBAAmB;;;8DAxGlB,MAAM;;;;;;;8DACC,cAAc;;;;;;8BAEgB,gBAAgB;qBAElD,cAAc;0BACN,yBAAyB;oBAC7B,mBAAmB;kDACT,2CAA2C;;;;;;AAItE,MAAMF,yBAAyB,GAAG,YAAY,AAAC;AAEtD,MAAMG,YAAY,GAAGC,IAAAA,GAAO,QAAA,EAAC,IAC3BC,IAAG,IAAA,CAACC,IAAI,CAAC,qFAAqF,CAAC,CAChG,AAAC;AAEF,MAAMC,qBAAqB,GAAGH,IAAAA,GAAO,QAAA,EAAC,CAACI,WAAmB,GAAK;IAC7D,MAAMC,gBAAgB,GACpBC,YAAW,EAAA,QAAA,CAACC,MAAM,CAACH,WAAW,EAAE,sBAAsB,CAAC,IACvDE,YAAW,EAAA,QAAA,CAACC,MAAM,CAACH,WAAW,EAAE,mBAAmB,CAAC,AAAC;IACvD,IAAI,CAACC,gBAAgB,EAAE;QACrB,MAAM,IAAIG,KAAK,CACb,CAAC,sIAAsI,CAAC,CACzI,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,AAAC;AASI,SAASX,6BAA6B,CAC3C,EAAEY,SAAS,CAAA,EAAEL,WAAW,CAAA,EAAwC,EAChEM,oBAA+F,EAC/F;IACA,OAAO,CAACC,GAAkB,EAAEC,GAAmB,EAAEC,IAA2B,GAAK;QAC/E,IAAI,CAACF,GAAG,CAACG,GAAG,EAAE,OAAOD,IAAI,EAAE,CAAC;QAE5B,MAAMC,GAAG,GAAGC,SAAS,CAACJ,GAAG,CAACG,GAAG,CAAC,AAAC;QAE/B,uB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leware/DomComponentsMiddleware.ts"],"sourcesContent":["import path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createBundleUrlPath, ExpoMetroOptions } from './metroOptions';\nimport type { ServerRequest, ServerResponse } from './server.types';\nimport { Log } from '../../../log';\nimport { toPosixPath } from '../../../utils/filePath';\nimport { memoize } from '../../../utils/fn';\nimport { fileURLToFilePath } from '../metro/createServerComponentsMiddleware';\n\nexport type PickPartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;\n\nexport const DOM_COMPONENTS_BUNDLE_DIR = 'www.bundle';\n\nconst warnUnstable = memoize(() =>\n Log.warn('Using experimental DOM Components API. Production exports may not work as expected.')\n);\n\nconst checkWebViewInstalled = memoize((projectRoot: string) => {\n const webViewInstalled =\n resolveFrom.silent(projectRoot, 'react-native-webview') ||\n resolveFrom.silent(projectRoot, '@expo/dom-webview');\n if (!webViewInstalled) {\n throw new Error(\n `To use DOM Components, you must install the 'react-native-webview' package. Run 'npx expo install react-native-webview' to install it.`\n );\n }\n});\n\ntype CreateDomComponentsMiddlewareOptions = {\n /** The absolute metro or server root, used to calculate the relative dom entry path */\n metroRoot: string;\n /** The absolute project root, used to resolve the `expo/dom/entry.js` path */\n projectRoot: string;\n};\n\nexport function createDomComponentsMiddleware(\n { metroRoot, projectRoot }: CreateDomComponentsMiddlewareOptions,\n instanceMetroOptions: PickPartial<ExpoMetroOptions, 'mainModuleName' | 'platform' | 'bytecode'>\n) {\n return (req: ServerRequest, res: ServerResponse, next: (err?: Error) => void) => {\n if (!req.url) return next();\n\n const url = coerceUrl(req.url);\n\n // Match `/_expo/@dom`.\n // This URL can contain additional paths like `/_expo/@dom/foo.js?file=...` to help the Safari dev tools.\n if (!url.pathname.startsWith('/_expo/@dom')) {\n return next();\n }\n\n const file = url.searchParams.get('file');\n\n if (!file || !file.startsWith('file://')) {\n res.statusCode = 400;\n res.statusMessage = 'Invalid file path: ' + file;\n return res.end();\n }\n\n checkWebViewInstalled(projectRoot);\n warnUnstable();\n\n // Generate a unique entry file for the webview.\n const generatedEntry = toPosixPath(file.startsWith('file://') ? fileURLToFilePath(file) : file);\n const virtualEntry = toPosixPath(resolveFrom(projectRoot, 'expo/dom/entry.js'));\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport = './' + path.posix.relative(path.dirname(virtualEntry), generatedEntry);\n // Create the script URL\n const requestUrlBase = `http://${req.headers.host}`;\n const metroUrl = new URL(\n createBundleUrlPath({\n ...instanceMetroOptions,\n domRoot: encodeURI(relativeImport),\n baseUrl: '/',\n mainModuleName: path.relative(metroRoot, virtualEntry),\n bytecode: false,\n platform: 'web',\n isExporting: false,\n engine: 'hermes',\n // Required for ensuring bundler errors are caught in the root entry / async boundary and can be recovered from automatically.\n lazy: true,\n }),\n requestUrlBase\n ).toString();\n\n res.statusCode = 200;\n // Return HTML file\n res.setHeader('Content-Type', 'text/html');\n\n res.end(\n // Create the entry HTML file.\n getDomComponentHtml(metroUrl, { title: path.basename(file) })\n );\n };\n}\n\nfunction coerceUrl(url: string) {\n try {\n return new URL(url);\n } catch {\n return new URL(url, 'https://localhost:0');\n }\n}\n\nexport function getDomComponentHtml(src?: string, { title }: { title?: string } = {}) {\n // This HTML is not optimized for `react-native-web` since DOM Components are meant for general React DOM web development.\n return `\n<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"utf-8\" />\n <meta httpEquiv=\"X-UA-Compatible\" content=\"IE=edge\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">\n ${title ? `<title>${title}</title>` : ''}\n <style id=\"expo-dom-component-style\">\n /* These styles make the body full-height */\n html,\n body {\n -webkit-overflow-scrolling: touch; /* Enables smooth momentum scrolling */\n }\n /* These styles make the root element full-height */\n #root {\n display: flex;\n flex: 1;\n }\n </style>\n </head>\n <body>\n <noscript>DOM Components require <code>javaScriptEnabled</code></noscript>\n <!-- Root element for the DOM component. -->\n <div id=\"root\"></div>\n ${src ? `<script crossorigin src=\"${src.replace(/^https?:/, '')}\"></script>` : ''}\n </body>\n</html>`;\n}\n"],"names":["DOM_COMPONENTS_BUNDLE_DIR","createDomComponentsMiddleware","getDomComponentHtml","warnUnstable","memoize","Log","warn","checkWebViewInstalled","projectRoot","webViewInstalled","resolveFrom","silent","Error","metroRoot","instanceMetroOptions","req","res","next","url","coerceUrl","pathname","startsWith","file","searchParams","get","statusCode","statusMessage","end","generatedEntry","toPosixPath","fileURLToFilePath","virtualEntry","relativeImport","path","posix","relative","dirname","requestUrlBase","headers","host","metroUrl","URL","createBundleUrlPath","domRoot","encodeURI","baseUrl","mainModuleName","bytecode","platform","isExporting","engine","lazy","toString","setHeader","title","basename","src","replace"],"mappings":"AAAA;;;;;;;;;;;IAYaA,yBAAyB,MAAzBA,yBAAyB;IAwBtBC,6BAA6B,MAA7BA,6BAA6B;IAoE7BC,mBAAmB,MAAnBA,mBAAmB;;;8DAxGlB,MAAM;;;;;;;8DACC,cAAc;;;;;;8BAEgB,gBAAgB;qBAElD,cAAc;0BACN,yBAAyB;oBAC7B,mBAAmB;kDACT,2CAA2C;;;;;;AAItE,MAAMF,yBAAyB,GAAG,YAAY,AAAC;AAEtD,MAAMG,YAAY,GAAGC,IAAAA,GAAO,QAAA,EAAC,IAC3BC,IAAG,IAAA,CAACC,IAAI,CAAC,qFAAqF,CAAC,CAChG,AAAC;AAEF,MAAMC,qBAAqB,GAAGH,IAAAA,GAAO,QAAA,EAAC,CAACI,WAAmB,GAAK;IAC7D,MAAMC,gBAAgB,GACpBC,YAAW,EAAA,QAAA,CAACC,MAAM,CAACH,WAAW,EAAE,sBAAsB,CAAC,IACvDE,YAAW,EAAA,QAAA,CAACC,MAAM,CAACH,WAAW,EAAE,mBAAmB,CAAC,AAAC;IACvD,IAAI,CAACC,gBAAgB,EAAE;QACrB,MAAM,IAAIG,KAAK,CACb,CAAC,sIAAsI,CAAC,CACzI,CAAC;IACJ,CAAC;AACH,CAAC,CAAC,AAAC;AASI,SAASX,6BAA6B,CAC3C,EAAEY,SAAS,CAA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AAO,CAAC;;;;;;;QAOF,EAAEA,KAAK,GAAG,CAAC,OAAO,EAAEA,KAAK,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;QAkBzC,EAAEE,GAAG,GAAG,CAAC,yBAAyB,EAAEA,GAAG,CAACC,OAAO,aAAa,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,CAAC;;OAEnF,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -31,7 +31,7 @@ class FetchClient {
|
|
|
31
31
|
this.headers = {
|
|
32
32
|
accept: "application/json",
|
|
33
33
|
"content-type": "application/json",
|
|
34
|
-
"user-agent": `expo-cli/${"0.22.
|
|
34
|
+
"user-agent": `expo-cli/${"0.22.18"}`,
|
|
35
35
|
authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.18",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
"@expo/env": "~0.4.2",
|
|
49
49
|
"@expo/image-utils": "^0.6.5",
|
|
50
50
|
"@expo/json-file": "^9.0.2",
|
|
51
|
-
"@expo/metro-config": "~0.19.
|
|
51
|
+
"@expo/metro-config": "~0.19.11",
|
|
52
52
|
"@expo/osascript": "^2.1.6",
|
|
53
53
|
"@expo/package-manager": "^1.7.2",
|
|
54
54
|
"@expo/plist": "^0.2.2",
|
|
55
|
-
"@expo/prebuild-config": "^8.0.
|
|
55
|
+
"@expo/prebuild-config": "^8.0.28",
|
|
56
56
|
"@expo/rudder-sdk-node": "^1.1.1",
|
|
57
57
|
"@expo/spawn-async": "^1.7.2",
|
|
58
58
|
"@expo/ws-tunnel": "^1.0.1",
|
|
@@ -168,5 +168,5 @@
|
|
|
168
168
|
"tree-kill": "^1.2.2",
|
|
169
169
|
"tsd": "^0.28.1"
|
|
170
170
|
},
|
|
171
|
-
"gitHead": "
|
|
171
|
+
"gitHead": "15c64d1689ba79ef11b73e06bb4fffa1e4b1c1d2"
|
|
172
172
|
}
|