@expo/cli 55.0.22 → 55.0.23
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/events/index.js +1 -1
- package/build/src/expoUpdatesExports.js +46 -3
- package/build/src/expoUpdatesExports.js.map +1 -1
- package/build/src/export/embed/exportEmbedAsync.js +13 -4
- package/build/src/export/embed/exportEmbedAsync.js.map +1 -1
- package/build/src/export/embed/index.js +1 -1
- package/build/src/export/embed/index.js.map +1 -1
- package/build/src/export/exportApp.js +8 -2
- package/build/src/export/exportApp.js.map +1 -1
- package/build/src/export/exportDomComponents.js +11 -4
- package/build/src/export/exportDomComponents.js.map +1 -1
- package/build/src/start/doctor/ngrok/ExternalModule.js +11 -6
- package/build/src/start/doctor/ngrok/ExternalModule.js.map +1 -1
- package/build/src/start/server/metro/MetroBundlerDevServer.js +6 -6
- package/build/src/start/server/metro/MetroBundlerDevServer.js.map +1 -1
- package/build/src/start/server/metro/createExpoFallbackResolver.js +39 -0
- package/build/src/start/server/metro/createExpoFallbackResolver.js.map +1 -1
- package/build/src/start/server/middleware/DomComponentsMiddleware.js +14 -5
- package/build/src/start/server/middleware/DomComponentsMiddleware.js.map +1 -1
- package/build/src/start/server/middleware/ManifestMiddleware.js +4 -41
- package/build/src/start/server/middleware/ManifestMiddleware.js.map +1 -1
- package/build/src/utils/filePath.js +3 -29
- package/build/src/utils/filePath.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 +11 -11
- package/build/src/utils/resolveGlobal.js +0 -195
- package/build/src/utils/resolveGlobal.js.map +0 -1
|
@@ -113,6 +113,26 @@ function createFallbackModuleResolver({ projectRoot, originModuleNames, getStric
|
|
|
113
113
|
};
|
|
114
114
|
const fileSpecifierRe = /^[\\/]|^\.\.?(?:$|[\\/])/i;
|
|
115
115
|
return function requestFallbackModule(immutableContext, moduleName, platform) {
|
|
116
|
+
if (moduleName === '../../App') {
|
|
117
|
+
// Fix up the `../../App` relative path, escaping `node_modules/expo` for monorepos and isolated dependencies
|
|
118
|
+
// NOTE(@kitten): If `expo/AppEntry.js` changes, this will likely have to change too!
|
|
119
|
+
if (/[/\\]node_modules[/\\]expo[/\\]AppEntry\.js$/.test(immutableContext.originModulePath)) {
|
|
120
|
+
// We instead resolve from the project root
|
|
121
|
+
const context = {
|
|
122
|
+
...immutableContext,
|
|
123
|
+
nodeModulesPaths: [],
|
|
124
|
+
// NOTE(@kitten): We need to add a fake filename here. Metro performs a `path.dirname` on this path
|
|
125
|
+
// and then searches `${path.dirname(originModulePath)}/node_modules`. If we don't add it, we miss
|
|
126
|
+
// fallback resolution for packages that failed to hoist
|
|
127
|
+
originModulePath: _path().default.join(projectRoot, 'index.js')
|
|
128
|
+
};
|
|
129
|
+
const res = getStrictResolver(context, platform)('./App');
|
|
130
|
+
debug(`"../../App" resolution for ${platform}: "./App" -> from origin: ${projectRoot}`);
|
|
131
|
+
return res;
|
|
132
|
+
} else {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
116
136
|
// Early return if `moduleName` cannot be a module specifier
|
|
117
137
|
// This doesn't have to be accurate as this resolver is a fallback for failed resolutions and
|
|
118
138
|
// we're only doing this to avoid unnecessary resolution work
|
|
@@ -136,6 +156,25 @@ function createFallbackModuleResolver({ projectRoot, originModuleNames, getStric
|
|
|
136
156
|
return res;
|
|
137
157
|
}
|
|
138
158
|
}
|
|
159
|
+
// Self-resolution
|
|
160
|
+
const pkg = immutableContext.getPackageForModule(immutableContext.originModulePath);
|
|
161
|
+
const pkgName = pkg == null ? void 0 : pkg.packageJson.name;
|
|
162
|
+
if (pkgName && dependenciesToRegex([
|
|
163
|
+
pkgName
|
|
164
|
+
]).test(moduleName)) {
|
|
165
|
+
const context = {
|
|
166
|
+
...immutableContext,
|
|
167
|
+
nodeModulesPaths: [],
|
|
168
|
+
// NOTE(@kitten): Metro currently fails self-resolution, so if the package failed to resolve itself
|
|
169
|
+
// from within itself, we add a hint to where to find itself to the `extraNodeModules` lookups
|
|
170
|
+
extraNodeModules: {
|
|
171
|
+
[pkgName]: pkg.rootPath
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const res = getStrictResolver(context, platform)(moduleName);
|
|
175
|
+
debug(`Self resolution for ${platform}: ${moduleName} -> from origin: ${pkg.rootPath}`);
|
|
176
|
+
return res;
|
|
177
|
+
}
|
|
139
178
|
return null;
|
|
140
179
|
};
|
|
141
180
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/createExpoFallbackResolver.ts"],"sourcesContent":["// This file creates the fallback resolver\n// The fallback resolver applies only to module imports and should be the last resolver\n// in the chain. It applies to failed Node module resolution of modules and will attempt\n// to resolve them to `expo` and `expo-router` dependencies that couldn't be resolved.\n// This resolves isolated dependency issues, where we expect dependencies of `expo`\n// and `expo-router` to be resolvable, due to hoisting, but they aren't hoisted in\n// a user's project.\n// See: https://github.com/expo/expo/pull/34286\n\nimport type { ResolutionContext, PackageJson } from '@expo/metro/metro-resolver/types';\nimport path from 'path';\n\nimport type { StrictResolver, StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\n/** A record of dependencies that we know are only used for scripts and config-plugins\n * @privateRemarks\n * This includes dependencies we never resolve indirectly. Generally, we only want\n * to add fallback resolutions for dependencies of `expo` and `expo-router` that\n * are either transpiled into output code or resolved from other Expo packages\n * without them having direct dependencies on these dependencies.\n * Meaning: If you update this list, exclude what a user might use when they\n * forget to specify their own dependencies, rather than what we use ourselves\n * only in `expo` and `expo-router`.\n */\nconst EXCLUDE_ORIGIN_MODULES: Record<string, true | undefined> = {\n '@expo/config': true,\n '@expo/config-plugins': true,\n 'schema-utils': true, // Used by `expo-router/plugin`\n semver: true, // Used by `expo-router/doctor`\n};\n\ninterface PackageMetaPeerDependenciesMetaEntry {\n [propName: string]: unknown;\n optional?: boolean;\n}\n\ninterface PackageMeta extends PackageJson {\n readonly [propName: string]: unknown;\n readonly dependencies?: Record<string, unknown>;\n readonly peerDependencies?: Record<string, unknown>;\n readonly peerDependenciesMeta?: Record<\n string,\n PackageMetaPeerDependenciesMetaEntry | undefined | null\n >;\n}\n\ninterface ModuleDescription {\n originModulePath: string;\n moduleTestRe: RegExp;\n}\n\nconst debug = require('debug')('expo:start:server:metro:fallback-resolver') as typeof console.log;\n\n/** Converts a list of module names to a regex that may either match bare module names or sub-modules of modules */\nconst dependenciesToRegex = (dependencies: string[]) =>\n new RegExp(`^(?:${dependencies.join('|')})(?:$|/)`);\n\n/** Resolves an origin module and outputs a filter regex and target path for it */\nconst getModuleDescriptionWithResolver = (\n context: ResolutionContext,\n resolve: StrictResolver,\n originModuleName: string\n): ModuleDescription | null => {\n let filePath: string | undefined;\n let packageMeta: PackageMeta | undefined | null;\n try {\n const resolution = resolve(path.join(originModuleName, 'package.json'));\n if (resolution.type !== 'sourceFile') {\n debug(`Fallback module resolution failed for origin module: ${originModuleName})`);\n return null;\n }\n filePath = resolution.filePath;\n // Upcast PackageJson to PackageMeta\n packageMeta = context.getPackage(filePath) as PackageMeta | null | undefined;\n if (!packageMeta) {\n return null;\n }\n } catch (error: any) {\n debug(\n `Fallback module resolution threw: ${error.constructor.name}. (module: ${filePath || originModuleName})`\n );\n return null;\n }\n let dependencies: string[] = [];\n if (packageMeta.dependencies) dependencies.push(...Object.keys(packageMeta.dependencies));\n if (packageMeta.peerDependencies) {\n const peerDependenciesMeta = packageMeta.peerDependenciesMeta;\n let peerDependencies = Object.keys(packageMeta.peerDependencies);\n // We explicitly include non-optional peer dependencies. Non-optional peer dependencies of\n // `expo` and `expo-router` are either expected to be accessible on a project-level, since\n // both are meant to be installed is direct dependencies, or shouldn't be accessible when\n // they're fulfilled as isolated dependencies.\n // The exception are only *optional* peer dependencies, since when they're installed\n // automatically by newer package manager behaviour, they may become isolated dependencies\n // that we still wish to access.\n if (peerDependenciesMeta) {\n peerDependencies = peerDependencies.filter((dependency) => {\n const peerMeta = peerDependenciesMeta[dependency];\n return peerMeta && typeof peerMeta === 'object' && peerMeta.optional === true;\n });\n }\n dependencies.push(...peerDependencies);\n }\n // We deduplicate the dependencies and exclude modules that we know are only used for scripts or config-plugins\n dependencies = dependencies.filter((moduleName, index, dependenciesArr) => {\n if (EXCLUDE_ORIGIN_MODULES[moduleName]) return false;\n return dependenciesArr.indexOf(moduleName) === index;\n });\n // Return test regex for dependencies and full origin module path to resolve through\n const originModulePath = path.dirname(filePath);\n return dependencies.length\n ? { originModulePath, moduleTestRe: dependenciesToRegex(dependencies) }\n : null;\n};\n\n/** Creates a fallback module resolver that resolves dependencis of modules named in `originModuleNames` via their path.\n * @remarks\n * The fallback resolver targets modules dependended on by modules named in `originModuleNames` and resolves\n * them from the module root of these origin modules instead.\n * It should only be used as a fallback after normal Node resolution (and other resolvers) have failed for:\n * - the `expo` package\n * - the `expo-router` package\n * Dependencies mentioned as either optional peer dependencies or direct dependencies by these modules may be isolated\n * and inaccessible via standard Node module resolution. This may happen when either transpilation adds these\n * dependencies to other parts of the tree (e.g. `@babel/runtime`) or when a dependency fails to hoist due to either\n * a corrupted dependency tree or when a peer dependency is fulfilled incorrectly (e.g. `expo-asset`)\n * @privateRemarks\n * This does NOT follow Node resolution and is *only* intended to provide a fallback for modules that we depend on\n * ourselves and know we can resolve (via expo or expo-router)!\n */\nexport function createFallbackModuleResolver({\n projectRoot,\n originModuleNames,\n getStrictResolver,\n}: {\n projectRoot: string;\n originModuleNames: string[];\n getStrictResolver: StrictResolverFactory;\n}): ExpoCustomMetroResolver {\n const _moduleDescriptionsCache: Record<string, ModuleDescription | null> = {};\n\n const getModuleDescription = (\n immutableContext: ResolutionContext,\n originModuleName: string,\n platform: string | null\n ) => {\n if (_moduleDescriptionsCache[originModuleName] !== undefined) {\n return _moduleDescriptionsCache[originModuleName];\n }\n // Resolve the origin module itself via the project root rather than the file that requested the missing module\n // The addition of `package.json` doesn't matter here. We just need a file path that'll be turned into a directory path\n // We don't need to modify `nodeModulesPaths` since it's guaranteed to contain the project's node modules paths\n const context: ResolutionContext = {\n ...immutableContext,\n originModulePath: path.join(projectRoot, 'package.json'),\n };\n return (_moduleDescriptionsCache[originModuleName] = getModuleDescriptionWithResolver(\n context,\n getStrictResolver(context, platform),\n originModuleName\n ));\n };\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n\n return function requestFallbackModule(immutableContext, moduleName, platform) {\n // Early return if `moduleName` cannot be a module specifier\n // This doesn't have to be accurate as this resolver is a fallback for failed resolutions and\n // we're only doing this to avoid unnecessary resolution work\n if (fileSpecifierRe.test(moduleName)) {\n return null;\n }\n\n for (const originModuleName of originModuleNames) {\n const moduleDescription = getModuleDescription(immutableContext, originModuleName, platform);\n if (moduleDescription && moduleDescription.moduleTestRe.test(moduleName)) {\n // We instead resolve as if it was depended on by the `originModulePath` (the module named in `originModuleNames`)\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [],\n // NOTE(@kitten): We need to add a fake filename here. Metro performs a `path.dirname` on this path\n // and then searches `${path.dirname(originModulePath)}/node_modules`. If we don't add it, we miss\n // fallback resolution for packages that failed to hoist\n originModulePath: path.join(moduleDescription.originModulePath, 'index.js'),\n };\n const res = getStrictResolver(context, platform)(moduleName);\n debug(\n `Fallback resolution for ${platform}: ${moduleName} -> from origin: ${originModuleName}`\n );\n return res;\n }\n }\n\n return null;\n };\n}\n"],"names":["createFallbackModuleResolver","EXCLUDE_ORIGIN_MODULES","semver","debug","require","dependenciesToRegex","dependencies","RegExp","join","getModuleDescriptionWithResolver","context","resolve","originModuleName","filePath","packageMeta","resolution","path","type","getPackage","error","constructor","name","push","Object","keys","peerDependencies","peerDependenciesMeta","filter","dependency","peerMeta","optional","moduleName","index","dependenciesArr","indexOf","originModulePath","dirname","length","moduleTestRe","projectRoot","originModuleNames","getStrictResolver","_moduleDescriptionsCache","getModuleDescription","immutableContext","platform","undefined","fileSpecifierRe","requestFallbackModule","test","moduleDescription","nodeModulesPaths","res"],"mappings":"AAAA,0CAA0C;AAC1C,uFAAuF;AACvF,wFAAwF;AACxF,sFAAsF;AACtF,mFAAmF;AACnF,kFAAkF;AAClF,oBAAoB;AACpB,+CAA+C;;;;;+BA4H/BA;;;eAAAA;;;;gEAzHC;;;;;;;;;;;AAKjB;;;;;;;;;CASC,GACD,MAAMC,yBAA2D;IAC/D,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChBC,QAAQ;AACV;AAsBA,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,iHAAiH,GACjH,MAAMC,sBAAsB,CAACC,eAC3B,IAAIC,OAAO,CAAC,IAAI,EAAED,aAAaE,IAAI,CAAC,KAAK,QAAQ,CAAC;AAEpD,gFAAgF,GAChF,MAAMC,mCAAmC,CACvCC,SACAC,SACAC;IAEA,IAAIC;IACJ,IAAIC;IACJ,IAAI;QACF,MAAMC,aAAaJ,QAAQK,eAAI,CAACR,IAAI,CAACI,kBAAkB;QACvD,IAAIG,WAAWE,IAAI,KAAK,cAAc;YACpCd,MAAM,CAAC,qDAAqD,EAAES,iBAAiB,CAAC,CAAC;YACjF,OAAO;QACT;QACAC,WAAWE,WAAWF,QAAQ;QAC9B,oCAAoC;QACpCC,cAAcJ,QAAQQ,UAAU,CAACL;QACjC,IAAI,CAACC,aAAa;YAChB,OAAO;QACT;IACF,EAAE,OAAOK,OAAY;QACnBhB,MACE,CAAC,kCAAkC,EAAEgB,MAAMC,WAAW,CAACC,IAAI,CAAC,WAAW,EAAER,YAAYD,iBAAiB,CAAC,CAAC;QAE1G,OAAO;IACT;IACA,IAAIN,eAAyB,EAAE;IAC/B,IAAIQ,YAAYR,YAAY,EAAEA,aAAagB,IAAI,IAAIC,OAAOC,IAAI,CAACV,YAAYR,YAAY;IACvF,IAAIQ,YAAYW,gBAAgB,EAAE;QAChC,MAAMC,uBAAuBZ,YAAYY,oBAAoB;Q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AAsBJ,gBAAgB,EAAEb,UAAU,EAAEc,QAAQ;QAC1E,4DAA4D;QAC5D,6FAA6F;QAC7F,6DAA6D;QAC7D,IAAIE,gBAAgBE,IAAI,CAAClB,aAAa;YACpC,OAAO;QACT;QAEA,KAAK,MAAMnB,oBAAoB4B,kBAAmB;YAChD,MAAMU,oBAAoBP,qBAAqBC,kBAAkBhC,kBAAkBiC;YACnF,IAAIK,qBAAqBA,kBAAkBZ,YAAY,CAACW,IAAI,CAAClB,aAAa;gBACxE,kHAAkH;gBAClH,MAAMrB,UAA6B;oBACjC,GAAGkC,gBAAgB;oBACnBO,kBAAkB,EAAE;oBACpB,mGAAmG;oBACnG,kGAAkG;oBAClG,wDAAwD;oBACxDhB,kBAAkBnB,eAAI,CAACR,IAAI,CAAC0C,kBAAkBf,gBAAgB,EAAE;gBAClE;gBACA,MAAMiB,MAAMX,kBAAkB/B,SAASmC,UAAUd;gBACjD5B,MACE,CAAC,wBAAwB,EAAE0C,SAAS,EAAE,EAAEd,WAAW,iBAAiB,EAAEnB,kBAAkB;gBAE1F,OAAOwC;YACT;QACF;QAEA,OAAO;IACT;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/createExpoFallbackResolver.ts"],"sourcesContent":["// This file creates the fallback resolver\n// The fallback resolver applies only to module imports and should be the last resolver\n// in the chain. It applies to failed Node module resolution of modules and will attempt\n// to resolve them to `expo` and `expo-router` dependencies that couldn't be resolved.\n// This resolves isolated dependency issues, where we expect dependencies of `expo`\n// and `expo-router` to be resolvable, due to hoisting, but they aren't hoisted in\n// a user's project.\n// See: https://github.com/expo/expo/pull/34286\n\nimport type { ResolutionContext, PackageJson } from '@expo/metro/metro-resolver/types';\nimport path from 'path';\n\nimport type { StrictResolver, StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\n/** A record of dependencies that we know are only used for scripts and config-plugins\n * @privateRemarks\n * This includes dependencies we never resolve indirectly. Generally, we only want\n * to add fallback resolutions for dependencies of `expo` and `expo-router` that\n * are either transpiled into output code or resolved from other Expo packages\n * without them having direct dependencies on these dependencies.\n * Meaning: If you update this list, exclude what a user might use when they\n * forget to specify their own dependencies, rather than what we use ourselves\n * only in `expo` and `expo-router`.\n */\nconst EXCLUDE_ORIGIN_MODULES: Record<string, true | undefined> = {\n '@expo/config': true,\n '@expo/config-plugins': true,\n 'schema-utils': true, // Used by `expo-router/plugin`\n semver: true, // Used by `expo-router/doctor`\n};\n\ninterface PackageMetaPeerDependenciesMetaEntry {\n [propName: string]: unknown;\n optional?: boolean;\n}\n\ninterface PackageMeta extends PackageJson {\n readonly [propName: string]: unknown;\n readonly dependencies?: Record<string, unknown>;\n readonly peerDependencies?: Record<string, unknown>;\n readonly peerDependenciesMeta?: Record<\n string,\n PackageMetaPeerDependenciesMetaEntry | undefined | null\n >;\n}\n\ninterface ModuleDescription {\n originModulePath: string;\n moduleTestRe: RegExp;\n}\n\nconst debug = require('debug')('expo:start:server:metro:fallback-resolver') as typeof console.log;\n\n/** Converts a list of module names to a regex that may either match bare module names or sub-modules of modules */\nconst dependenciesToRegex = (dependencies: string[]) =>\n new RegExp(`^(?:${dependencies.join('|')})(?:$|/)`);\n\n/** Resolves an origin module and outputs a filter regex and target path for it */\nconst getModuleDescriptionWithResolver = (\n context: ResolutionContext,\n resolve: StrictResolver,\n originModuleName: string\n): ModuleDescription | null => {\n let filePath: string | undefined;\n let packageMeta: PackageMeta | undefined | null;\n try {\n const resolution = resolve(path.join(originModuleName, 'package.json'));\n if (resolution.type !== 'sourceFile') {\n debug(`Fallback module resolution failed for origin module: ${originModuleName})`);\n return null;\n }\n filePath = resolution.filePath;\n // Upcast PackageJson to PackageMeta\n packageMeta = context.getPackage(filePath) as PackageMeta | null | undefined;\n if (!packageMeta) {\n return null;\n }\n } catch (error: any) {\n debug(\n `Fallback module resolution threw: ${error.constructor.name}. (module: ${filePath || originModuleName})`\n );\n return null;\n }\n let dependencies: string[] = [];\n if (packageMeta.dependencies) dependencies.push(...Object.keys(packageMeta.dependencies));\n if (packageMeta.peerDependencies) {\n const peerDependenciesMeta = packageMeta.peerDependenciesMeta;\n let peerDependencies = Object.keys(packageMeta.peerDependencies);\n // We explicitly include non-optional peer dependencies. Non-optional peer dependencies of\n // `expo` and `expo-router` are either expected to be accessible on a project-level, since\n // both are meant to be installed is direct dependencies, or shouldn't be accessible when\n // they're fulfilled as isolated dependencies.\n // The exception are only *optional* peer dependencies, since when they're installed\n // automatically by newer package manager behaviour, they may become isolated dependencies\n // that we still wish to access.\n if (peerDependenciesMeta) {\n peerDependencies = peerDependencies.filter((dependency) => {\n const peerMeta = peerDependenciesMeta[dependency];\n return peerMeta && typeof peerMeta === 'object' && peerMeta.optional === true;\n });\n }\n dependencies.push(...peerDependencies);\n }\n // We deduplicate the dependencies and exclude modules that we know are only used for scripts or config-plugins\n dependencies = dependencies.filter((moduleName, index, dependenciesArr) => {\n if (EXCLUDE_ORIGIN_MODULES[moduleName]) return false;\n return dependenciesArr.indexOf(moduleName) === index;\n });\n // Return test regex for dependencies and full origin module path to resolve through\n const originModulePath = path.dirname(filePath);\n return dependencies.length\n ? { originModulePath, moduleTestRe: dependenciesToRegex(dependencies) }\n : null;\n};\n\n/** Creates a fallback module resolver that resolves dependencis of modules named in `originModuleNames` via their path.\n * @remarks\n * The fallback resolver targets modules dependended on by modules named in `originModuleNames` and resolves\n * them from the module root of these origin modules instead.\n * It should only be used as a fallback after normal Node resolution (and other resolvers) have failed for:\n * - the `expo` package\n * - the `expo-router` package\n * Dependencies mentioned as either optional peer dependencies or direct dependencies by these modules may be isolated\n * and inaccessible via standard Node module resolution. This may happen when either transpilation adds these\n * dependencies to other parts of the tree (e.g. `@babel/runtime`) or when a dependency fails to hoist due to either\n * a corrupted dependency tree or when a peer dependency is fulfilled incorrectly (e.g. `expo-asset`)\n * @privateRemarks\n * This does NOT follow Node resolution and is *only* intended to provide a fallback for modules that we depend on\n * ourselves and know we can resolve (via expo or expo-router)!\n */\nexport function createFallbackModuleResolver({\n projectRoot,\n originModuleNames,\n getStrictResolver,\n}: {\n projectRoot: string;\n originModuleNames: string[];\n getStrictResolver: StrictResolverFactory;\n}): ExpoCustomMetroResolver {\n const _moduleDescriptionsCache: Record<string, ModuleDescription | null> = {};\n\n const getModuleDescription = (\n immutableContext: ResolutionContext,\n originModuleName: string,\n platform: string | null\n ) => {\n if (_moduleDescriptionsCache[originModuleName] !== undefined) {\n return _moduleDescriptionsCache[originModuleName];\n }\n // Resolve the origin module itself via the project root rather than the file that requested the missing module\n // The addition of `package.json` doesn't matter here. We just need a file path that'll be turned into a directory path\n // We don't need to modify `nodeModulesPaths` since it's guaranteed to contain the project's node modules paths\n const context: ResolutionContext = {\n ...immutableContext,\n originModulePath: path.join(projectRoot, 'package.json'),\n };\n return (_moduleDescriptionsCache[originModuleName] = getModuleDescriptionWithResolver(\n context,\n getStrictResolver(context, platform),\n originModuleName\n ));\n };\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n\n return function requestFallbackModule(immutableContext, moduleName, platform) {\n if (moduleName === '../../App') {\n // Fix up the `../../App` relative path, escaping `node_modules/expo` for monorepos and isolated dependencies\n // NOTE(@kitten): If `expo/AppEntry.js` changes, this will likely have to change too!\n if (/[/\\\\]node_modules[/\\\\]expo[/\\\\]AppEntry\\.js$/.test(immutableContext.originModulePath)) {\n // We instead resolve from the project root\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [],\n // NOTE(@kitten): We need to add a fake filename here. Metro performs a `path.dirname` on this path\n // and then searches `${path.dirname(originModulePath)}/node_modules`. If we don't add it, we miss\n // fallback resolution for packages that failed to hoist\n originModulePath: path.join(projectRoot, 'index.js'),\n };\n const res = getStrictResolver(context, platform)('./App');\n debug(`\"../../App\" resolution for ${platform}: \"./App\" -> from origin: ${projectRoot}`);\n return res;\n } else {\n return null;\n }\n }\n\n // Early return if `moduleName` cannot be a module specifier\n // This doesn't have to be accurate as this resolver is a fallback for failed resolutions and\n // we're only doing this to avoid unnecessary resolution work\n if (fileSpecifierRe.test(moduleName)) {\n return null;\n }\n\n for (const originModuleName of originModuleNames) {\n const moduleDescription = getModuleDescription(immutableContext, originModuleName, platform);\n if (moduleDescription && moduleDescription.moduleTestRe.test(moduleName)) {\n // We instead resolve as if it was depended on by the `originModulePath` (the module named in `originModuleNames`)\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [],\n // NOTE(@kitten): We need to add a fake filename here. Metro performs a `path.dirname` on this path\n // and then searches `${path.dirname(originModulePath)}/node_modules`. If we don't add it, we miss\n // fallback resolution for packages that failed to hoist\n originModulePath: path.join(moduleDescription.originModulePath, 'index.js'),\n };\n const res = getStrictResolver(context, platform)(moduleName);\n debug(\n `Fallback resolution for ${platform}: ${moduleName} -> from origin: ${originModuleName}`\n );\n return res;\n }\n }\n\n // Self-resolution\n const pkg = immutableContext.getPackageForModule(immutableContext.originModulePath);\n const pkgName = pkg?.packageJson.name;\n if (pkgName && dependenciesToRegex([pkgName]).test(moduleName)) {\n const context: ResolutionContext = {\n ...immutableContext,\n nodeModulesPaths: [],\n // NOTE(@kitten): Metro currently fails self-resolution, so if the package failed to resolve itself\n // from within itself, we add a hint to where to find itself to the `extraNodeModules` lookups\n extraNodeModules: {\n [pkgName]: pkg.rootPath,\n },\n };\n const res = getStrictResolver(context, platform)(moduleName);\n debug(`Self resolution for ${platform}: ${moduleName} -> from origin: ${pkg.rootPath}`);\n return res;\n }\n\n return null;\n };\n}\n"],"names":["createFallbackModuleResolver","EXCLUDE_ORIGIN_MODULES","semver","debug","require","dependenciesToRegex","dependencies","RegExp","join","getModuleDescriptionWithResolver","context","resolve","originModuleName","filePath","packageMeta","resolution","path","type","getPackage","error","constructor","name","push","Object","keys","peerDependencies","peerDependenciesMeta","filter","dependency","peerMeta","optional","moduleName","index","dependenciesArr","indexOf","originModulePath","dirname","length","moduleTestRe","projectRoot","originModuleNames","getStrictResolver","_moduleDescriptionsCache","getModuleDescription","immutableContext","platform","undefined","fileSpecifierRe","requestFallbackModule","test","nodeModulesPaths","res","moduleDescription","pkg","getPackageForModule","pkgName","packageJson","extraNodeModules","rootPath"],"mappings":"AAAA,0CAA0C;AAC1C,uFAAuF;AACvF,wFAAwF;AACxF,sFAAsF;AACtF,mFAAmF;AACnF,kFAAkF;AAClF,oBAAoB;AACpB,+CAA+C;;;;;+BA4H/BA;;;eAAAA;;;;gEAzHC;;;;;;;;;;;AAKjB;;;;;;;;;CASC,GACD,MAAMC,yBAA2D;IAC/D,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChBC,QAAQ;AACV;AAsBA,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,iHAAiH,GACjH,MAAMC,sBAAsB,CAACC,eAC3B,IAAIC,OAAO,CAAC,IAAI,EAAED,aAAaE,IAAI,CAAC,KAAK,QAAQ,CAAC;AAEpD,gFAAgF,GAChF,MAAMC,mCAAmC,CACvCC,SACAC,SACAC;IAEA,IAAIC;IACJ,IAAIC;IACJ,IAAI;QACF,MAAMC,aAAaJ,QAAQK,eAAI,CAACR,IAAI,CAACI,kBAAkB;QACvD,IAAIG,WAAWE,IAAI,KAAK,cAAc;YACpCd,MAAM,CAAC,qDAAqD,EAAES,iBAAiB,CAAC,CAAC;YACjF,OAAO;QACT;QACAC,WAAWE,WAAWF,QAAQ;QAC9B,oCAAoC;QACpCC,cAAcJ,QAAQQ,UAAU,CAACL;QACjC,IAAI,CAACC,aAAa;YAChB,OAAO;QACT;IACF,EAAE,OAAOK,OAAY;QACnBhB,MACE,CAAC,kCAAkC,EAAEgB,MAAMC,WAAW,CAACC,IAAI,CAAC,WAAW,EAAER,YAAYD,iBAAiB,CAAC,CAAC;QAE1G,OAAO;IACT;IACA,IAAIN,eAAyB,EAAE;IAC/B,IAAIQ,YAAYR,YAAY,EAAEA,aAAagB,IAAI,IAAIC,OAAOC,IAAI,CAACV,YAAYR,YAAY;IACvF,IAAIQ,YAAYW,gBAAgB,EA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iBU,mBAAmB,CAACV,iBAAiBT,gBAAgB;QAClF,MAAMoB,UAAUF,uBAAAA,IAAKG,WAAW,CAACnC,IAAI;QACrC,IAAIkC,WAAWlD,oBAAoB;YAACkD;SAAQ,EAAEN,IAAI,CAAClB,aAAa;YAC9D,MAAMrB,UAA6B;gBACjC,GAAGkC,gBAAgB;gBACnBM,kBAAkB,EAAE;gBACpB,mGAAmG;gBACnG,8FAA8F;gBAC9FO,kBAAkB;oBAChB,CAACF,QAAQ,EAAEF,IAAIK,QAAQ;gBACzB;YACF;YACA,MAAMP,MAAMV,kBAAkB/B,SAASmC,UAAUd;YACjD5B,MAAM,CAAC,oBAAoB,EAAE0C,SAAS,EAAE,EAAEd,WAAW,iBAAiB,EAAEsB,IAAIK,QAAQ,EAAE;YACtF,OAAOP;QACT;QAEA,OAAO;IACT;AACF"}
|
|
@@ -19,6 +19,13 @@ _export(exports, {
|
|
|
19
19
|
return getDomComponentHtml;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
+
function _paths() {
|
|
23
|
+
const data = require("@expo/config/paths");
|
|
24
|
+
_paths = function() {
|
|
25
|
+
return data;
|
|
26
|
+
};
|
|
27
|
+
return data;
|
|
28
|
+
}
|
|
22
29
|
function _path() {
|
|
23
30
|
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
24
31
|
_path = function() {
|
|
@@ -49,7 +56,7 @@ const checkWebViewInstalled = (0, _fn.memoize)((projectRoot)=>{
|
|
|
49
56
|
throw new Error(`To use DOM Components, you must install the 'react-native-webview' package. Run 'npx expo install react-native-webview' to install it.`);
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
|
-
function createDomComponentsMiddleware({
|
|
59
|
+
function createDomComponentsMiddleware({ projectRoot }, instanceMetroOptions) {
|
|
53
60
|
return (req, res, next)=>{
|
|
54
61
|
if (!req.url) return next();
|
|
55
62
|
const url = coerceUrl(req.url);
|
|
@@ -65,18 +72,20 @@ function createDomComponentsMiddleware({ metroRoot, projectRoot }, instanceMetro
|
|
|
65
72
|
return res.end();
|
|
66
73
|
}
|
|
67
74
|
checkWebViewInstalled(projectRoot);
|
|
75
|
+
// NOTE(@kitten): Keep in sync with `src/export/exportDomComponents.ts`
|
|
68
76
|
// Generate a unique entry file for the webview.
|
|
69
|
-
const
|
|
70
|
-
const
|
|
77
|
+
const virtualEntry = (0, _resolvefrom().default)(projectRoot, 'expo/dom/entry.js');
|
|
78
|
+
const generatedEntryPath = _path().default.resolve(file.startsWith('file://') ? (0, _createServerComponentsMiddleware.fileURLToFilePath)(file) : file);
|
|
71
79
|
// The relative import path will be used like URI so it must be POSIX.
|
|
72
|
-
const relativeImport = './' + _path().default.
|
|
80
|
+
const relativeImport = './' + (0, _filePath.toPosixPath)(_path().default.relative(_path().default.dirname(virtualEntry), generatedEntryPath));
|
|
73
81
|
// Create the script URL
|
|
74
82
|
const requestUrlBase = `http://${req.headers.host}`;
|
|
83
|
+
// NOTE(@kitten): Keep in sync with `src/export/exportDomComponents.ts`
|
|
75
84
|
const metroUrl = new URL((0, _metroOptions.createBundleUrlPath)({
|
|
76
85
|
...instanceMetroOptions,
|
|
77
86
|
domRoot: encodeURI(relativeImport),
|
|
78
87
|
baseUrl: '/',
|
|
79
|
-
mainModuleName:
|
|
88
|
+
mainModuleName: (0, _paths().convertEntryPointToRelative)(projectRoot, virtualEntry),
|
|
80
89
|
bytecode: false,
|
|
81
90
|
platform: 'web',
|
|
82
91
|
isExporting: false,
|
|
@@ -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 { 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 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
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/DomComponentsMiddleware.ts"],"sourcesContent":["import { convertEntryPointToRelative } from '@expo/config/paths';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { createBundleUrlPath, ExpoMetroOptions } from './metroOptions';\nimport type { ServerRequest, ServerResponse } from './server.types';\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 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 project root, used to resolve the `expo/dom/entry.js` path */\n projectRoot: string;\n};\n\nexport function createDomComponentsMiddleware(\n { 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\n // NOTE(@kitten): Keep in sync with `src/export/exportDomComponents.ts`\n // Generate a unique entry file for the webview.\n const virtualEntry = resolveFrom(projectRoot, 'expo/dom/entry.js');\n const generatedEntryPath = path.resolve(\n file.startsWith('file://') ? fileURLToFilePath(file) : file\n );\n // The relative import path will be used like URI so it must be POSIX.\n const relativeImport =\n './' + toPosixPath(path.relative(path.dirname(virtualEntry), generatedEntryPath));\n // Create the script URL\n const requestUrlBase = `http://${req.headers.host}`;\n // NOTE(@kitten): Keep in sync with `src/export/exportDomComponents.ts`\n const metroUrl = new URL(\n createBundleUrlPath({\n ...instanceMetroOptions,\n domRoot: encodeURI(relativeImport),\n baseUrl: '/',\n mainModuleName: convertEntryPointToRelative(projectRoot, 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","checkWebViewInstalled","memoize","projectRoot","webViewInstalled","resolveFrom","silent","Error","instanceMetroOptions","req","res","next","url","coerceUrl","pathname","startsWith","file","searchParams","get","statusCode","statusMessage","end","virtualEntry","generatedEntryPath","path","resolve","fileURLToFilePath","relativeImport","toPosixPath","relative","dirname","requestUrlBase","headers","host","metroUrl","URL","createBundleUrlPath","domRoot","encodeURI","baseUrl","mainModuleName","convertEntryPointToRelative","bytecode","platform","isExporting","engine","lazy","toString","setHeader","title","basename","src","replace"],"mappings":";;;;;;;;;;;IAYaA,yBAAyB;eAAzBA;;IAkBGC,6BAA6B;eAA7BA;;IAwEAC,mBAAmB;eAAnBA;;;;yBAtG4B;;;;;;;gEAC3B;;;;;;;gEACO;;;;;;8BAE8B;0BAE1B;oBACJ;kDACU;;;;;;AAI3B,MAAMF,4BAA4B;AAEzC,MAAMG,wBAAwBC,IAAAA,WAAO,EAAC,CAACC;IACrC,MAAMC,mBACJC,sBAAW,CAACC,MAAM,CAACH,aAAa,2BAChCE,sBAAW,CAACC,MAAM,CAACH,aAAa;IAClC,IAAI,CAACC,kBAAkB;QACrB,MAAM,IAAIG,MACR,CAAC,sIAAsI,CAAC;IAE5I;AACF;AAOO,SAASR,8BACd,EAAEI,WAAW,EAAwC,EACrDK,oBAA+F;IAE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L,8BAA8B;QAC9BrB,oBAAoBkC,UAAU;YAAEe,OAAOzB,eAAI,CAAC0B,QAAQ,CAAClC;QAAM;IAE/D;AACF;AAEA,SAASH,UAAUD,GAAW;IAC5B,IAAI;QACF,OAAO,IAAIuB,IAAIvB;IACjB,EAAE,OAAM;QACN,OAAO,IAAIuB,IAAIvB,KAAK;IACtB;AACF;AAEO,SAASZ,oBAAoBmD,GAAY,EAAE,EAAEF,KAAK,EAAsB,GAAG,CAAC,CAAC;IAClF,0HAA0H;IAC1H,OAAO,CAAC;;;;;;;QAOF,EAAEA,QAAQ,CAAC,OAAO,EAAEA,MAAM,QAAQ,CAAC,GAAG,GAAG;;;;;;;;;;;;;;;;;;QAkBzC,EAAEE,MAAM,CAAC,yBAAyB,EAAEA,IAAIC,OAAO,CAAC,YAAY,IAAI,WAAW,CAAC,GAAG,GAAG;;OAEnF,CAAC;AACR"}
|
|
@@ -14,12 +14,6 @@ _export(exports, {
|
|
|
14
14
|
},
|
|
15
15
|
ManifestMiddleware: function() {
|
|
16
16
|
return ManifestMiddleware;
|
|
17
|
-
},
|
|
18
|
-
getEntryWithServerRoot: function() {
|
|
19
|
-
return getEntryWithServerRoot;
|
|
20
|
-
},
|
|
21
|
-
resolveMainModuleName: function() {
|
|
22
|
-
return resolveMainModuleName;
|
|
23
17
|
}
|
|
24
18
|
});
|
|
25
19
|
function _config() {
|
|
@@ -50,13 +44,6 @@ function _promises() {
|
|
|
50
44
|
};
|
|
51
45
|
return data;
|
|
52
46
|
}
|
|
53
|
-
function _path() {
|
|
54
|
-
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
55
|
-
_path = function() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
return data;
|
|
59
|
-
}
|
|
60
47
|
function _url() {
|
|
61
48
|
const data = require("url");
|
|
62
49
|
_url = function() {
|
|
@@ -71,17 +58,10 @@ const _resolvePlatform = require("./resolvePlatform");
|
|
|
71
58
|
const _exportHermes = require("../../../export/exportHermes");
|
|
72
59
|
const _log = /*#__PURE__*/ _interop_require_wildcard(require("../../../log"));
|
|
73
60
|
const _env = require("../../../utils/env");
|
|
74
|
-
const _errors = require("../../../utils/errors");
|
|
75
|
-
const _url1 = require("../../../utils/url");
|
|
76
61
|
const _devices = /*#__PURE__*/ _interop_require_wildcard(require("../../project/devices"));
|
|
77
62
|
const _router = require("../metro/router");
|
|
78
63
|
const _platformBundlers = require("../platformBundlers");
|
|
79
64
|
const _webTemplate = require("../webTemplate");
|
|
80
|
-
function _interop_require_default(obj) {
|
|
81
|
-
return obj && obj.__esModule ? obj : {
|
|
82
|
-
default: obj
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
65
|
function _getRequireWildcardCache(nodeInterop) {
|
|
86
66
|
if (typeof WeakMap !== "function") return null;
|
|
87
67
|
var cacheBabelInterop = new WeakMap();
|
|
@@ -124,23 +104,6 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
124
104
|
return newObj;
|
|
125
105
|
}
|
|
126
106
|
const debug = require('debug')('expo:start:server:middleware:manifest');
|
|
127
|
-
const supportedPlatforms = [
|
|
128
|
-
'ios',
|
|
129
|
-
'android',
|
|
130
|
-
'web',
|
|
131
|
-
'none'
|
|
132
|
-
];
|
|
133
|
-
function getEntryWithServerRoot(projectRoot, props) {
|
|
134
|
-
if (!supportedPlatforms.includes(props.platform)) {
|
|
135
|
-
throw new _errors.CommandError(`Failed to resolve the project's entry file: The platform "${props.platform}" is not supported.`);
|
|
136
|
-
}
|
|
137
|
-
return (0, _metroOptions.convertPathToModuleSpecifier)(_path().default.relative((0, _paths().getMetroServerRoot)(projectRoot), (0, _paths().resolveEntryPoint)(projectRoot, props)));
|
|
138
|
-
}
|
|
139
|
-
function resolveMainModuleName(projectRoot, props) {
|
|
140
|
-
const entryPoint = getEntryWithServerRoot(projectRoot, props);
|
|
141
|
-
debug(`Resolved entry point: ${entryPoint} (project root: ${projectRoot})`);
|
|
142
|
-
return (0, _metroOptions.convertPathToModuleSpecifier)((0, _url1.stripExtension)(entryPoint, 'js'));
|
|
143
|
-
}
|
|
144
107
|
const DEVELOPER_TOOL = 'expo-cli';
|
|
145
108
|
class ManifestMiddleware extends _ExpoMiddleware.ExpoMiddleware {
|
|
146
109
|
constructor(projectRoot, options){
|
|
@@ -194,8 +157,6 @@ class ManifestMiddleware extends _ExpoMiddleware.ExpoMiddleware {
|
|
|
194
157
|
};
|
|
195
158
|
}
|
|
196
159
|
/** Get the main entry module ID (file) relative to the project root. */ resolveMainModuleName(props) {
|
|
197
|
-
let entryPoint = getEntryWithServerRoot(this.projectRoot, props);
|
|
198
|
-
debug(`Resolved entry point: ${entryPoint} (project root: ${this.projectRoot})`);
|
|
199
160
|
// NOTE(Bacon): Webpack is currently hardcoded to index.bundle on native
|
|
200
161
|
// in the future (TODO) we should move this logic into a Webpack plugin and use
|
|
201
162
|
// a generated file name like we do on web.
|
|
@@ -203,9 +164,11 @@ class ManifestMiddleware extends _ExpoMiddleware.ExpoMiddleware {
|
|
|
203
164
|
// // TODO: Move this into BundlerDevServer and read this info from self.
|
|
204
165
|
// const isNativeWebpack = server instanceof WebpackBundlerDevServer && server.isTargetingNative();
|
|
205
166
|
if (this.options.isNativeWebpack) {
|
|
206
|
-
|
|
167
|
+
return 'index';
|
|
207
168
|
}
|
|
208
|
-
|
|
169
|
+
const entry = (0, _paths().resolveRelativeEntryPoint)(this.projectRoot, props);
|
|
170
|
+
debug(`Resolved entry point: ${entry} (project root: ${this.projectRoot})`);
|
|
171
|
+
return entry;
|
|
209
172
|
}
|
|
210
173
|
/** Store device IDs that were sent in the request headers. */ async saveDevicesAsync(req) {
|
|
211
174
|
var _req_headers;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/middleware/ManifestMiddleware.ts"],"sourcesContent":["import {\n ExpoConfig,\n ExpoGoConfig,\n getConfig,\n PackageJSONConfig,\n ProjectConfig,\n} from '@expo/config';\nimport { resolveEntryPoint, getMetroServerRoot } from '@expo/config/paths';\nimport { Readable } from 'node:stream';\nimport { pipeline } from 'node:stream/promises';\nimport path from 'path';\nimport { resolve } from 'url';\n\nimport { ExpoMiddleware } from './ExpoMiddleware';\nimport {\n createBundleUrlPath,\n getBaseUrlFromExpoConfig,\n getAsyncRoutesFromExpoConfig,\n createBundleUrlPathFromExpoConfig,\n convertPathToModuleSpecifier,\n} from './metroOptions';\nimport { resolveGoogleServicesFile, resolveManifestAssets } from './resolveAssets';\nimport { parsePlatformHeader, RuntimePlatform } from './resolvePlatform';\nimport { ServerNext, ServerRequest, ServerResponse } from './server.types';\nimport { isEnableHermesManaged } from '../../../export/exportHermes';\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\nimport { CommandError } from '../../../utils/errors';\nimport { stripExtension } from '../../../utils/url';\nimport * as ProjectDevices from '../../project/devices';\nimport { UrlCreator } from '../UrlCreator';\nimport { getRouterDirectoryModuleIdWithManifest } from '../metro/router';\nimport { getPlatformBundlers, PlatformBundlers } from '../platformBundlers';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../webTemplate';\n\nconst debug = require('debug')('expo:start:server:middleware:manifest') as typeof console.log;\n\nconst supportedPlatforms = ['ios', 'android', 'web', 'none'];\n\nexport function getEntryWithServerRoot(\n projectRoot: string,\n props: { platform: string; pkg?: PackageJSONConfig }\n) {\n if (!supportedPlatforms.includes(props.platform)) {\n throw new CommandError(\n `Failed to resolve the project's entry file: The platform \"${props.platform}\" is not supported.`\n );\n }\n return convertPathToModuleSpecifier(\n path.relative(getMetroServerRoot(projectRoot), resolveEntryPoint(projectRoot, props))\n );\n}\n\n/** Get the main entry module ID (file) relative to the project root. */\nexport function resolveMainModuleName(\n projectRoot: string,\n props: { platform: string; pkg?: PackageJSONConfig }\n): string {\n const entryPoint = getEntryWithServerRoot(projectRoot, props);\n\n debug(`Resolved entry point: ${entryPoint} (project root: ${projectRoot})`);\n\n return convertPathToModuleSpecifier(stripExtension(entryPoint, 'js'));\n}\n\n/** Info about the computer hosting the dev server. */\nexport interface HostInfo {\n host: string;\n server: 'expo';\n serverVersion: string;\n serverDriver: string | null;\n serverOS: NodeJS.Platform;\n serverOSVersion: string;\n}\n\n/** Parsed values from the supported request headers. */\nexport interface ManifestRequestInfo {\n /** Platform to serve. */\n platform: RuntimePlatform;\n /** Requested host name. */\n hostname?: string | null;\n /** The protocol used to request the manifest */\n protocol?: 'http' | 'https';\n}\n\n/** Project related info. */\nexport type ResponseProjectSettings = {\n expoGoConfig: ExpoGoConfig;\n hostUri: string;\n bundleUrl: string;\n exp: ExpoConfig;\n};\n\nexport const DEVELOPER_TOOL = 'expo-cli';\n\nexport type ManifestMiddlewareOptions = {\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n constructUrl: UrlCreator['constructUrl'];\n isNativeWebpack?: boolean;\n privateKeyPath?: string;\n};\n\n/** Base middleware creator for serving the Expo manifest (like the index.html but for native runtimes). */\nexport abstract class ManifestMiddleware<\n TManifestRequestInfo extends ManifestRequestInfo,\n> extends ExpoMiddleware {\n private initialProjectConfig: ProjectConfig;\n private platformBundlers: PlatformBundlers;\n\n constructor(\n protected projectRoot: string,\n protected options: ManifestMiddlewareOptions\n ) {\n super(\n projectRoot,\n /**\n * Only support `/`, `/manifest`, `/index.exp` for the manifest middleware.\n */\n ['/', '/manifest', '/index.exp']\n );\n this.initialProjectConfig = getConfig(projectRoot);\n this.platformBundlers = getPlatformBundlers(projectRoot, this.initialProjectConfig.exp);\n }\n\n /** Exposed for testing. */\n public async _resolveProjectSettingsAsync({\n platform,\n hostname,\n protocol,\n }: Pick<\n TManifestRequestInfo,\n 'hostname' | 'platform' | 'protocol'\n >): Promise<ResponseProjectSettings> {\n // Read the config\n const projectConfig = getConfig(this.projectRoot);\n\n // Read from headers\n const mainModuleName = this.resolveMainModuleName({\n pkg: projectConfig.pkg,\n platform,\n });\n\n const isHermesEnabled = isEnableHermesManaged(projectConfig.exp, platform);\n\n // Create the manifest and set fields within it\n const expoGoConfig = this.getExpoGoConfig({\n mainModuleName,\n hostname,\n });\n\n const hostUri = this.options.constructUrl({ scheme: '', hostname });\n\n const bundleUrl = this._getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n engine: isHermesEnabled ? 'hermes' : undefined,\n baseUrl: getBaseUrlFromExpoConfig(projectConfig.exp),\n asyncRoutes: getAsyncRoutesFromExpoConfig(\n projectConfig.exp,\n this.options.mode ?? 'development',\n platform\n ),\n routerRoot: getRouterDirectoryModuleIdWithManifest(this.projectRoot, projectConfig.exp),\n protocol,\n reactCompiler: !!projectConfig.exp.experiments?.reactCompiler,\n });\n\n // Resolve all assets and set them on the manifest as URLs\n await this.mutateManifestWithAssetsAsync(projectConfig.exp, bundleUrl);\n\n return {\n expoGoConfig,\n hostUri,\n bundleUrl,\n exp: projectConfig.exp,\n };\n }\n\n /** Get the main entry module ID (file) relative to the project root. */\n private resolveMainModuleName(props: { pkg: PackageJSONConfig; platform: string }): string {\n let entryPoint = getEntryWithServerRoot(this.projectRoot, props);\n\n debug(`Resolved entry point: ${entryPoint} (project root: ${this.projectRoot})`);\n\n // NOTE(Bacon): Webpack is currently hardcoded to index.bundle on native\n // in the future (TODO) we should move this logic into a Webpack plugin and use\n // a generated file name like we do on web.\n // const server = getDefaultDevServer();\n // // TODO: Move this into BundlerDevServer and read this info from self.\n // const isNativeWebpack = server instanceof WebpackBundlerDevServer && server.isTargetingNative();\n if (this.options.isNativeWebpack) {\n entryPoint = 'index.js';\n }\n\n return stripExtension(entryPoint, 'js');\n }\n\n /** Parse request headers into options. */\n public abstract getParsedHeaders(req: ServerRequest): TManifestRequestInfo;\n\n /** Store device IDs that were sent in the request headers. */\n private async saveDevicesAsync(req: ServerRequest) {\n const deviceIds = req.headers?.['expo-dev-client-id'];\n if (deviceIds) {\n await ProjectDevices.saveDevicesAsync(this.projectRoot, deviceIds).catch((e) =>\n Log.exception(e)\n );\n }\n }\n\n /** Create the bundle URL (points to the single JS entry file). Exposed for testing. */\n public _getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n engine,\n baseUrl,\n isExporting,\n asyncRoutes,\n routerRoot,\n protocol,\n reactCompiler,\n }: {\n platform: string;\n hostname?: string | null;\n mainModuleName: string;\n engine?: 'hermes';\n baseUrl?: string;\n asyncRoutes: boolean;\n isExporting?: boolean;\n routerRoot: string;\n protocol?: 'http' | 'https';\n reactCompiler: boolean;\n }): string {\n const path = createBundleUrlPath({\n mode: this.options.mode ?? 'development',\n minify: this.options.minify,\n platform,\n mainModuleName,\n lazy: !env.EXPO_NO_METRO_LAZY,\n engine,\n bytecode: engine === 'hermes',\n baseUrl,\n isExporting: !!isExporting,\n asyncRoutes,\n routerRoot,\n reactCompiler,\n });\n\n return (\n this.options.constructUrl({\n scheme: protocol ?? 'http',\n // hostType: this.options.location.hostType,\n hostname,\n }) + path\n );\n }\n\n /** Get the manifest response to return to the runtime. This file contains info regarding where the assets can be loaded from. Exposed for testing. */\n public abstract _getManifestResponseAsync(options: TManifestRequestInfo): Promise<Response>;\n\n private getExpoGoConfig({\n mainModuleName,\n hostname,\n }: {\n mainModuleName: string;\n hostname?: string | null;\n }): ExpoGoConfig {\n return {\n // localhost:8081\n debuggerHost: this.options.constructUrl({ scheme: '', hostname }),\n // Required for Expo Go to function.\n developer: {\n tool: DEVELOPER_TOOL,\n projectRoot: this.projectRoot,\n },\n packagerOpts: {\n // Required for dev client.\n dev: this.options.mode !== 'production',\n },\n // Indicates the name of the main bundle.\n mainModuleName,\n };\n }\n\n /** Resolve all assets and set them on the manifest as URLs */\n private async mutateManifestWithAssetsAsync(manifest: ExpoConfig, bundleUrl: string) {\n await resolveManifestAssets(this.projectRoot, {\n manifest,\n resolver: async (path) => {\n if (this.options.isNativeWebpack) {\n // When using our custom dev server, just do assets normally\n // without the `assets/` subpath redirect.\n return resolve(bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0], path);\n }\n return bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0] + 'assets/' + path;\n },\n });\n // The server normally inserts this but if we're offline we'll do it here\n await resolveGoogleServicesFile(this.projectRoot, manifest);\n }\n\n public getWebBundleUrl() {\n const platform = 'web';\n // Read from headers\n const mainModuleName = this.resolveMainModuleName({\n pkg: this.initialProjectConfig.pkg,\n platform,\n });\n\n return createBundleUrlPathFromExpoConfig(this.projectRoot, this.initialProjectConfig.exp, {\n platform,\n mainModuleName,\n minify: this.options.minify,\n lazy: !env.EXPO_NO_METRO_LAZY,\n mode: this.options.mode ?? 'development',\n // Hermes doesn't support more modern JS features than most, if not all, modern browser.\n engine: 'hermes',\n isExporting: false,\n bytecode: false,\n });\n }\n\n /**\n * Web platforms should create an index.html response using the same script resolution as native.\n *\n * Instead of adding a `bundleUrl` to a `manifest.json` (native) we'll add a `<script src=\"\">`\n * to an `index.html`, this enables the web platform to load JavaScript from the server.\n */\n private async handleWebRequestAsync(req: ServerRequest, res: ServerResponse) {\n res.setHeader('Content-Type', 'text/html');\n\n res.end(await this.getSingleHtmlTemplateAsync());\n }\n\n getSingleHtmlTemplateAsync() {\n // Read from headers\n const bundleUrl = this.getWebBundleUrl();\n\n return createTemplateHtmlFromExpoConfigAsync(this.projectRoot, {\n exp: this.initialProjectConfig.exp,\n scripts: [bundleUrl],\n });\n }\n\n /** Exposed for testing. */\n async checkBrowserRequestAsync(req: ServerRequest, res: ServerResponse, next: ServerNext) {\n if (\n this.platformBundlers.web === 'metro' &&\n this.initialProjectConfig.exp.platforms?.includes('web')\n ) {\n // NOTE(EvanBacon): This effectively disables the safety check we do on custom runtimes to ensure\n // the `expo-platform` header is included. When `web.bundler=web`, if the user has non-standard Expo\n // code loading then they'll get a web bundle without a clear assertion of platform support.\n const platform = parsePlatformHeader(req);\n // On web, serve the public folder\n if (!platform || platform === 'web') {\n if (['static', 'server'].includes(this.initialProjectConfig.exp.web?.output ?? '')) {\n // Skip the spa-styled index.html when static generation is enabled.\n next();\n return true;\n } else {\n await this.handleWebRequestAsync(req, res);\n return true;\n }\n }\n }\n return false;\n }\n\n async handleRequestAsync(\n req: ServerRequest,\n res: ServerResponse,\n next: ServerNext\n ): Promise<void> {\n // First check for standard JavaScript runtimes (aka legacy browsers like Chrome).\n if (await this.checkBrowserRequestAsync(req, res, next)) {\n return;\n }\n\n // Save device IDs for dev client.\n await this.saveDevicesAsync(req);\n\n // Read from headers\n const options = this.getParsedHeaders(req);\n\n const response = await this._getManifestResponseAsync(options);\n // Convert `Response` to node:http response\n if (typeof res.setHeaders === 'function') {\n res.setHeaders(response.headers);\n } else {\n for (const [key, value] of response.headers.entries()) {\n res.appendHeader(key, value);\n }\n }\n if (response.body) {\n await pipeline(Readable.fromWeb(response.body as any), res);\n } else {\n res.end();\n }\n }\n}\n"],"names":["DEVELOPER_TOOL","ManifestMiddleware","getEntryWithServerRoot","resolveMainModuleName","debug","require","supportedPlatforms","projectRoot","props","includes","platform","CommandError","convertPathToModuleSpecifier","path","relative","getMetroServerRoot","resolveEntryPoint","entryPoint","stripExtension","ExpoMiddleware","constructor","options","initialProjectConfig","getConfig","platformBundlers","getPlatformBundlers","exp","_resolveProjectSettingsAsync","hostname","protocol","projectConfig","mainModuleName","pkg","isHermesEnabled","isEnableHermesManaged","expoGoConfig","getExpoGoConfig","hostUri","constructUrl","scheme","bundleUrl","_getBundleUrl","engine","undefined","baseUrl","getBaseUrlFromExpoConfig","asyncRoutes","getAsyncRoutesFromExpoConfig","mode","routerRoot","getRouterDirectoryModuleIdWithManifest","reactCompiler","experiments","mutateManifestWithAssetsAsync","isNativeWebpack","saveDevicesAsync","req","deviceIds","headers","ProjectDevices","catch","e","Log","exception","isExporting","createBundleUrlPath","minify","lazy","env","EXPO_NO_METRO_LAZY","bytecode","debuggerHost","developer","tool","packagerOpts","dev","manifest","resolveManifestAssets","resolver","resolve","match","resolveGoogleServicesFile","getWebBundleUrl","createBundleUrlPathFromExpoConfig","handleWebRequestAsync","res","setHeader","end","getSingleHtmlTemplateAsync","createTemplateHtmlFromExpoConfigAsync","scripts","checkBrowserRequestAsync","next","web","platforms","parsePlatformHeader","output","handleRequestAsync","getParsedHeaders","response","_getManifestResponseAsync","setHeaders","key","value","entries","appendHeader","body","pipeline","Readable","fromWeb"],"mappings":";;;;;;;;;;;IA6FaA,cAAc;eAAdA;;IAaSC,kBAAkB;eAAlBA;;IAnENC,sBAAsB;eAAtBA;;IAeAC,qBAAqB;eAArBA;;;;yBAhDT;;;;;;;yBAC+C;;;;;;;yBAC7B;;;;;;;yBACA;;;;;;;gEACR;;;;;;;yBACO;;;;;;gCAEO;8BAOxB;+BAC0D;iCACZ;8BAEf;6DACjB;qBACD;wBACS;sBACE;iEACC;wBAEuB;kCACD;6BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,MAAMC,QAAQC,QAAQ,SAAS;AAE/B,MAAMC,qBAAqB;IAAC;IAAO;IAAW;IAAO;CAAO;AAErD,SAASJ,uBACdK,WAAmB,EACnBC,KAAoD;IAEpD,IAAI,CAACF,mBAAmBG,QAAQ,CAACD,MAAME,QAAQ,GAAG;QAChD,MAAM,IAAIC,oBAAY,CACpB,CAAC,0DAA0D,EAAEH,MAAME,QAAQ,CAAC,mBAAmB,CAAC;IAEpG;IACA,OAAOE,IAAAA,0CAA4B,EACjCC,eAAI,CAACC,QAAQ,CAACC,IAAAA,2BAAkB,EAACR,cAAcS,IAAAA,0BAAiB,EAACT,aAAaC;AAElF;AAGO,SAASL,sBACdI,WAAmB,EACnBC,KAAoD;IAEpD,MAAMS,aAAaf,uBAAuBK,aAAaC;IAEvDJ,MAAM,CAAC,sBAAsB,EAAEa,WAAW,gBAAgB,EAAEV,YAAY,CAAC,CAAC;IAE1E,OAAOK,IAAAA,0CAA4B,EAACM,IAAAA,oBAAc,EAACD,YAAY;AACjE;AA8BO,MAAMjB,iBAAiB;AAavB,MAAeC,2BAEZkB,8BAAc;IAItBC,YACE,AAAUb,WAAmB,EAC7B,AAAUc,OAAkC,CAC5C;QACA,KAAK,CACHd,aACA;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gBACT,OAAO;oBACL,MAAM,IAAI,CAACR,qBAAqB,CAAC5B,KAAK6B;oBACtC,OAAO;gBACT;YACF;QACF;QACA,OAAO;IACT;IAEA,MAAMY,mBACJzC,GAAkB,EAClB6B,GAAmB,EACnBO,IAAgB,EACD;QACf,kFAAkF;QAClF,IAAI,MAAM,IAAI,CAACD,wBAAwB,CAACnC,KAAK6B,KAAKO,OAAO;YACvD;QACF;QAEA,kCAAkC;QAClC,MAAM,IAAI,CAACrC,gBAAgB,CAACC;QAE5B,oBAAoB;QACpB,MAAMnC,UAAU,IAAI,CAAC6E,gBAAgB,CAAC1C;QAEtC,MAAM2C,WAAW,MAAM,IAAI,CAACC,yBAAyB,CAAC/E;QACtD,2CAA2C;QAC3C,IAAI,OAAOgE,IAAIgB,UAAU,KAAK,YAAY;YACxChB,IAAIgB,UAAU,CAACF,SAASzC,OAAO;QACjC,OAAO;YACL,KAAK,MAAM,CAAC4C,KAAKC,MAAM,IAAIJ,SAASzC,OAAO,CAAC8C,OAAO,GAAI;gBACrDnB,IAAIoB,YAAY,CAACH,KAAKC;YACxB;QACF;QACA,IAAIJ,SAASO,IAAI,EAAE;YACjB,MAAMC,IAAAA,oBAAQ,EAACC,sBAAQ,CAACC,OAAO,CAACV,SAASO,IAAI,GAAUrB;QACzD,OAAO;YACLA,IAAIE,GAAG;QACT;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/middleware/ManifestMiddleware.ts"],"sourcesContent":["import {\n ExpoConfig,\n ExpoGoConfig,\n getConfig,\n PackageJSONConfig,\n ProjectConfig,\n} from '@expo/config';\nimport { resolveRelativeEntryPoint } from '@expo/config/paths';\nimport { Readable } from 'node:stream';\nimport { pipeline } from 'node:stream/promises';\nimport { resolve } from 'url';\n\nimport { ExpoMiddleware } from './ExpoMiddleware';\nimport {\n createBundleUrlPath,\n getBaseUrlFromExpoConfig,\n getAsyncRoutesFromExpoConfig,\n createBundleUrlPathFromExpoConfig,\n} from './metroOptions';\nimport { resolveGoogleServicesFile, resolveManifestAssets } from './resolveAssets';\nimport { parsePlatformHeader, RuntimePlatform } from './resolvePlatform';\nimport { ServerNext, ServerRequest, ServerResponse } from './server.types';\nimport { isEnableHermesManaged } from '../../../export/exportHermes';\nimport * as Log from '../../../log';\nimport { env } from '../../../utils/env';\nimport * as ProjectDevices from '../../project/devices';\nimport { UrlCreator } from '../UrlCreator';\nimport { getRouterDirectoryModuleIdWithManifest } from '../metro/router';\nimport { getPlatformBundlers, PlatformBundlers } from '../platformBundlers';\nimport { createTemplateHtmlFromExpoConfigAsync } from '../webTemplate';\n\nconst debug = require('debug')('expo:start:server:middleware:manifest') as typeof console.log;\n\n/** Info about the computer hosting the dev server. */\nexport interface HostInfo {\n host: string;\n server: 'expo';\n serverVersion: string;\n serverDriver: string | null;\n serverOS: NodeJS.Platform;\n serverOSVersion: string;\n}\n\n/** Parsed values from the supported request headers. */\nexport interface ManifestRequestInfo {\n /** Platform to serve. */\n platform: RuntimePlatform;\n /** Requested host name. */\n hostname?: string | null;\n /** The protocol used to request the manifest */\n protocol?: 'http' | 'https';\n}\n\n/** Project related info. */\nexport type ResponseProjectSettings = {\n expoGoConfig: ExpoGoConfig;\n hostUri: string;\n bundleUrl: string;\n exp: ExpoConfig;\n};\n\nexport const DEVELOPER_TOOL = 'expo-cli';\n\nexport type ManifestMiddlewareOptions = {\n /** Should start the dev servers in development mode (minify). */\n mode?: 'development' | 'production';\n /** Should instruct the bundler to create minified bundles. */\n minify?: boolean;\n constructUrl: UrlCreator['constructUrl'];\n isNativeWebpack?: boolean;\n privateKeyPath?: string;\n};\n\n/** Base middleware creator for serving the Expo manifest (like the index.html but for native runtimes). */\nexport abstract class ManifestMiddleware<\n TManifestRequestInfo extends ManifestRequestInfo,\n> extends ExpoMiddleware {\n private initialProjectConfig: ProjectConfig;\n private platformBundlers: PlatformBundlers;\n\n constructor(\n protected projectRoot: string,\n protected options: ManifestMiddlewareOptions\n ) {\n super(\n projectRoot,\n /**\n * Only support `/`, `/manifest`, `/index.exp` for the manifest middleware.\n */\n ['/', '/manifest', '/index.exp']\n );\n this.initialProjectConfig = getConfig(projectRoot);\n this.platformBundlers = getPlatformBundlers(projectRoot, this.initialProjectConfig.exp);\n }\n\n /** Exposed for testing. */\n public async _resolveProjectSettingsAsync({\n platform,\n hostname,\n protocol,\n }: Pick<\n TManifestRequestInfo,\n 'hostname' | 'platform' | 'protocol'\n >): Promise<ResponseProjectSettings> {\n // Read the config\n const projectConfig = getConfig(this.projectRoot);\n\n // Read from headers\n const mainModuleName = this.resolveMainModuleName({\n pkg: projectConfig.pkg,\n platform,\n });\n\n const isHermesEnabled = isEnableHermesManaged(projectConfig.exp, platform);\n\n // Create the manifest and set fields within it\n const expoGoConfig = this.getExpoGoConfig({\n mainModuleName,\n hostname,\n });\n\n const hostUri = this.options.constructUrl({ scheme: '', hostname });\n\n const bundleUrl = this._getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n engine: isHermesEnabled ? 'hermes' : undefined,\n baseUrl: getBaseUrlFromExpoConfig(projectConfig.exp),\n asyncRoutes: getAsyncRoutesFromExpoConfig(\n projectConfig.exp,\n this.options.mode ?? 'development',\n platform\n ),\n routerRoot: getRouterDirectoryModuleIdWithManifest(this.projectRoot, projectConfig.exp),\n protocol,\n reactCompiler: !!projectConfig.exp.experiments?.reactCompiler,\n });\n\n // Resolve all assets and set them on the manifest as URLs\n await this.mutateManifestWithAssetsAsync(projectConfig.exp, bundleUrl);\n\n return {\n expoGoConfig,\n hostUri,\n bundleUrl,\n exp: projectConfig.exp,\n };\n }\n\n /** Get the main entry module ID (file) relative to the project root. */\n private resolveMainModuleName(props: { pkg: PackageJSONConfig; platform: string }): string {\n // NOTE(Bacon): Webpack is currently hardcoded to index.bundle on native\n // in the future (TODO) we should move this logic into a Webpack plugin and use\n // a generated file name like we do on web.\n // const server = getDefaultDevServer();\n // // TODO: Move this into BundlerDevServer and read this info from self.\n // const isNativeWebpack = server instanceof WebpackBundlerDevServer && server.isTargetingNative();\n if (this.options.isNativeWebpack) {\n return 'index';\n }\n\n const entry = resolveRelativeEntryPoint(this.projectRoot, props);\n debug(`Resolved entry point: ${entry} (project root: ${this.projectRoot})`);\n return entry;\n }\n\n /** Parse request headers into options. */\n public abstract getParsedHeaders(req: ServerRequest): TManifestRequestInfo;\n\n /** Store device IDs that were sent in the request headers. */\n private async saveDevicesAsync(req: ServerRequest) {\n const deviceIds = req.headers?.['expo-dev-client-id'];\n if (deviceIds) {\n await ProjectDevices.saveDevicesAsync(this.projectRoot, deviceIds).catch((e) =>\n Log.exception(e)\n );\n }\n }\n\n /** Create the bundle URL (points to the single JS entry file). Exposed for testing. */\n public _getBundleUrl({\n platform,\n mainModuleName,\n hostname,\n engine,\n baseUrl,\n isExporting,\n asyncRoutes,\n routerRoot,\n protocol,\n reactCompiler,\n }: {\n platform: string;\n hostname?: string | null;\n mainModuleName: string;\n engine?: 'hermes';\n baseUrl?: string;\n asyncRoutes: boolean;\n isExporting?: boolean;\n routerRoot: string;\n protocol?: 'http' | 'https';\n reactCompiler: boolean;\n }): string {\n const path = createBundleUrlPath({\n mode: this.options.mode ?? 'development',\n minify: this.options.minify,\n platform,\n mainModuleName,\n lazy: !env.EXPO_NO_METRO_LAZY,\n engine,\n bytecode: engine === 'hermes',\n baseUrl,\n isExporting: !!isExporting,\n asyncRoutes,\n routerRoot,\n reactCompiler,\n });\n\n return (\n this.options.constructUrl({\n scheme: protocol ?? 'http',\n // hostType: this.options.location.hostType,\n hostname,\n }) + path\n );\n }\n\n /** Get the manifest response to return to the runtime. This file contains info regarding where the assets can be loaded from. Exposed for testing. */\n public abstract _getManifestResponseAsync(options: TManifestRequestInfo): Promise<Response>;\n\n private getExpoGoConfig({\n mainModuleName,\n hostname,\n }: {\n mainModuleName: string;\n hostname?: string | null;\n }): ExpoGoConfig {\n return {\n // localhost:8081\n debuggerHost: this.options.constructUrl({ scheme: '', hostname }),\n // Required for Expo Go to function.\n developer: {\n tool: DEVELOPER_TOOL,\n projectRoot: this.projectRoot,\n },\n packagerOpts: {\n // Required for dev client.\n dev: this.options.mode !== 'production',\n },\n // Indicates the name of the main bundle.\n mainModuleName,\n };\n }\n\n /** Resolve all assets and set them on the manifest as URLs */\n private async mutateManifestWithAssetsAsync(manifest: ExpoConfig, bundleUrl: string) {\n await resolveManifestAssets(this.projectRoot, {\n manifest,\n resolver: async (path) => {\n if (this.options.isNativeWebpack) {\n // When using our custom dev server, just do assets normally\n // without the `assets/` subpath redirect.\n return resolve(bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0], path);\n }\n return bundleUrl!.match(/^https?:\\/\\/.*?\\//)![0] + 'assets/' + path;\n },\n });\n // The server normally inserts this but if we're offline we'll do it here\n await resolveGoogleServicesFile(this.projectRoot, manifest);\n }\n\n public getWebBundleUrl() {\n const platform = 'web';\n // Read from headers\n const mainModuleName = this.resolveMainModuleName({\n pkg: this.initialProjectConfig.pkg,\n platform,\n });\n\n return createBundleUrlPathFromExpoConfig(this.projectRoot, this.initialProjectConfig.exp, {\n platform,\n mainModuleName,\n minify: this.options.minify,\n lazy: !env.EXPO_NO_METRO_LAZY,\n mode: this.options.mode ?? 'development',\n // Hermes doesn't support more modern JS features than most, if not all, modern browser.\n engine: 'hermes',\n isExporting: false,\n bytecode: false,\n });\n }\n\n /**\n * Web platforms should create an index.html response using the same script resolution as native.\n *\n * Instead of adding a `bundleUrl` to a `manifest.json` (native) we'll add a `<script src=\"\">`\n * to an `index.html`, this enables the web platform to load JavaScript from the server.\n */\n private async handleWebRequestAsync(req: ServerRequest, res: ServerResponse) {\n res.setHeader('Content-Type', 'text/html');\n\n res.end(await this.getSingleHtmlTemplateAsync());\n }\n\n getSingleHtmlTemplateAsync() {\n // Read from headers\n const bundleUrl = this.getWebBundleUrl();\n\n return createTemplateHtmlFromExpoConfigAsync(this.projectRoot, {\n exp: this.initialProjectConfig.exp,\n scripts: [bundleUrl],\n });\n }\n\n /** Exposed for testing. */\n async checkBrowserRequestAsync(req: ServerRequest, res: ServerResponse, next: ServerNext) {\n if (\n this.platformBundlers.web === 'metro' &&\n this.initialProjectConfig.exp.platforms?.includes('web')\n ) {\n // NOTE(EvanBacon): This effectively disables the safety check we do on custom runtimes to ensure\n // the `expo-platform` header is included. When `web.bundler=web`, if the user has non-standard Expo\n // code loading then they'll get a web bundle without a clear assertion of platform support.\n const platform = parsePlatformHeader(req);\n // On web, serve the public folder\n if (!platform || platform === 'web') {\n if (['static', 'server'].includes(this.initialProjectConfig.exp.web?.output ?? '')) {\n // Skip the spa-styled index.html when static generation is enabled.\n next();\n return true;\n } else {\n await this.handleWebRequestAsync(req, res);\n return true;\n }\n }\n }\n return false;\n }\n\n async handleRequestAsync(\n req: ServerRequest,\n res: ServerResponse,\n next: ServerNext\n ): Promise<void> {\n // First check for standard JavaScript runtimes (aka legacy browsers like Chrome).\n if (await this.checkBrowserRequestAsync(req, res, next)) {\n return;\n }\n\n // Save device IDs for dev client.\n await this.saveDevicesAsync(req);\n\n // Read from headers\n const options = this.getParsedHeaders(req);\n\n const response = await this._getManifestResponseAsync(options);\n // Convert `Response` to node:http response\n if (typeof res.setHeaders === 'function') {\n res.setHeaders(response.headers);\n } else {\n for (const [key, value] of response.headers.entries()) {\n res.appendHeader(key, value);\n }\n }\n if (response.body) {\n await pipeline(Readable.fromWeb(response.body as any), res);\n } else {\n res.end();\n }\n }\n}\n"],"names":["DEVELOPER_TOOL","ManifestMiddleware","debug","require","ExpoMiddleware","constructor","projectRoot","options","initialProjectConfig","getConfig","platformBundlers","getPlatformBundlers","exp","_resolveProjectSettingsAsync","platform","hostname","protocol","projectConfig","mainModuleName","resolveMainModuleName","pkg","isHermesEnabled","isEnableHermesManaged","expoGoConfig","getExpoGoConfig","hostUri","constructUrl","scheme","bundleUrl","_getBundleUrl","engine","undefined","baseUrl","getBaseUrlFromExpoConfig","asyncRoutes","getAsyncRoutesFromExpoConfig","mode","routerRoot","getRouterDirectoryModuleIdWithManifest","reactCompiler","experiments","mutateManifestWithAssetsAsync","props","isNativeWebpack","entry","resolveRelativeEntryPoint","saveDevicesAsync","req","deviceIds","headers","ProjectDevices","catch","e","Log","exception","isExporting","path","createBundleUrlPath","minify","lazy","env","EXPO_NO_METRO_LAZY","bytecode","debuggerHost","developer","tool","packagerOpts","dev","manifest","resolveManifestAssets","resolver","resolve","match","resolveGoogleServicesFile","getWebBundleUrl","createBundleUrlPathFromExpoConfig","handleWebRequestAsync","res","setHeader","end","getSingleHtmlTemplateAsync","createTemplateHtmlFromExpoConfigAsync","scripts","checkBrowserRequestAsync","next","web","platforms","includes","parsePlatformHeader","output","handleRequestAsync","getParsedHeaders","response","_getManifestResponseAsync","setHeaders","key","value","entries","appendHeader","body","pipeline","Readable","fromWeb"],"mappings":";;;;;;;;;;;IA6DaA,cAAc;eAAdA;;IAaSC,kBAAkB;eAAlBA;;;;yBApEf;;;;;;;yBACmC;;;;;;;yBACjB;;;;;;;yBACA;;;;;;;yBACD;;;;;;gCAEO;8BAMxB;+BAC0D;iCACZ;8BAEf;6DACjB;qBACD;iEACY;wBAEuB;kCACD;6BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEtD,MAAMC,QAAQC,QAAQ,SAAS;AA8BxB,MAAMH,iBAAiB;AAavB,MAAeC,2BAEZG,8BAAc;IAItBC,YACE,AAAUC,WAAmB,EAC7B,AAAUC,OAAkC,CAC5C;QACA,KAAK,CACHD,aACA;;OAEC,GACD;YAAC;YAAK;YAAa;SAAa,QARxBA,cAAAA,kBACAC,UAAAA;QASV,IAAI,CAACC,oBAAoB,GAAGC,IAAAA,mBAAS,EAACH;QACtC,IAAI,CAACI,gBAAgB,GAAGC,IAAAA,qCAAmB,EAACL,aAAa,IAAI,CAACE,oBAAoB,CAACI,GAAG;IACxF;IAEA,yBAAyB,GACzB,MAAaC,6BAA6B,EACxCC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EAIT,EAAoC;YAiChBC;QAhCnB,kBAAkB;QAClB,MAAMA,gBAAgBR,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AAM,IAAI,CAACC,yBAAyB,CAACtF;QACtD,2CAA2C;QAC3C,IAAI,OAAOsE,IAAIiB,UAAU,KAAK,YAAY;YACxCjB,IAAIiB,UAAU,CAACF,SAAS3C,OAAO;QACjC,OAAO;YACL,KAAK,MAAM,CAAC8C,KAAKC,MAAM,IAAIJ,SAAS3C,OAAO,CAACgD,OAAO,GAAI;gBACrDpB,IAAIqB,YAAY,CAACH,KAAKC;YACxB;QACF;QACA,IAAIJ,SAASO,IAAI,EAAE;YACjB,MAAMC,IAAAA,oBAAQ,EAACC,sBAAQ,CAACC,OAAO,CAACV,SAASO,IAAI,GAAUtB;QACzD,OAAO;YACLA,IAAIE,GAAG;QACT;IACF;AACF"}
|
|
@@ -2,39 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
resolveRealEntryFilePath: function() {
|
|
13
|
-
return resolveRealEntryFilePath;
|
|
14
|
-
},
|
|
15
|
-
toPosixPath: function() {
|
|
5
|
+
Object.defineProperty(exports, "toPosixPath", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
16
8
|
return toPosixPath;
|
|
17
9
|
}
|
|
18
10
|
});
|
|
19
|
-
function _fs() {
|
|
20
|
-
const data = /*#__PURE__*/ _interop_require_default(require("fs"));
|
|
21
|
-
_fs = function() {
|
|
22
|
-
return data;
|
|
23
|
-
};
|
|
24
|
-
return data;
|
|
25
|
-
}
|
|
26
|
-
function _interop_require_default(obj) {
|
|
27
|
-
return obj && obj.__esModule ? obj : {
|
|
28
|
-
default: obj
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
11
|
const REGEXP_REPLACE_SLASHES = /\\/g;
|
|
32
|
-
function resolveRealEntryFilePath(projectRoot, entryFile) {
|
|
33
|
-
if (projectRoot.startsWith('/private/var') && entryFile.startsWith('/var')) {
|
|
34
|
-
return _fs().default.realpathSync(entryFile);
|
|
35
|
-
}
|
|
36
|
-
return entryFile;
|
|
37
|
-
}
|
|
38
12
|
function toPosixPath(filePath) {
|
|
39
13
|
return filePath.replace(REGEXP_REPLACE_SLASHES, '/');
|
|
40
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/filePath.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/filePath.ts"],"sourcesContent":["const REGEXP_REPLACE_SLASHES = /\\\\/g;\n\n/**\n * Convert any platform-specific path to a POSIX path.\n */\nexport function toPosixPath(filePath: string): string {\n return filePath.replace(REGEXP_REPLACE_SLASHES, '/');\n}\n"],"names":["toPosixPath","REGEXP_REPLACE_SLASHES","filePath","replace"],"mappings":";;;;+BAKgBA;;;eAAAA;;;AALhB,MAAMC,yBAAyB;AAKxB,SAASD,YAAYE,QAAgB;IAC1C,OAAOA,SAASC,OAAO,CAACF,wBAAwB;AAClD"}
|
|
@@ -26,7 +26,7 @@ class FetchClient {
|
|
|
26
26
|
this.headers = {
|
|
27
27
|
accept: 'application/json',
|
|
28
28
|
'content-type': 'application/json',
|
|
29
|
-
'user-agent': `expo-cli/${"55.0.
|
|
29
|
+
'user-agent': `expo-cli/${"55.0.23"}`,
|
|
30
30
|
authorization: 'Basic ' + _nodebuffer().Buffer.from(`${target}:`).toString('base64')
|
|
31
31
|
};
|
|
32
32
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "55.0.
|
|
3
|
+
"version": "55.0.23",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -41,21 +41,21 @@
|
|
|
41
41
|
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/cli",
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@expo/code-signing-certificates": "^0.0.6",
|
|
44
|
-
"@expo/config": "~55.0.
|
|
44
|
+
"@expo/config": "~55.0.14",
|
|
45
45
|
"@expo/config-plugins": "~55.0.8",
|
|
46
46
|
"@expo/devcert": "^1.2.1",
|
|
47
47
|
"@expo/env": "~2.1.1",
|
|
48
|
-
"@expo/image-utils": "^0.8.
|
|
48
|
+
"@expo/image-utils": "^0.8.13",
|
|
49
49
|
"@expo/json-file": "^10.0.13",
|
|
50
50
|
"@expo/log-box": "55.0.10",
|
|
51
51
|
"@expo/metro": "~55.0.0",
|
|
52
|
-
"@expo/metro-config": "~55.0.
|
|
52
|
+
"@expo/metro-config": "~55.0.15",
|
|
53
53
|
"@expo/osascript": "^2.4.2",
|
|
54
54
|
"@expo/package-manager": "^1.10.4",
|
|
55
55
|
"@expo/plist": "^0.5.2",
|
|
56
|
-
"@expo/prebuild-config": "^55.0.
|
|
57
|
-
"@expo/require-utils": "^55.0.
|
|
58
|
-
"@expo/router-server": "^55.0.
|
|
56
|
+
"@expo/prebuild-config": "^55.0.14",
|
|
57
|
+
"@expo/require-utils": "^55.0.4",
|
|
58
|
+
"@expo/router-server": "^55.0.14",
|
|
59
59
|
"@expo/schema-utils": "^55.0.3",
|
|
60
60
|
"@expo/spawn-async": "^1.7.2",
|
|
61
61
|
"@expo/ws-tunnel": "^1.0.1",
|
|
@@ -71,12 +71,12 @@
|
|
|
71
71
|
"compression": "^1.7.4",
|
|
72
72
|
"connect": "^3.7.0",
|
|
73
73
|
"debug": "^4.3.4",
|
|
74
|
-
"dnssd-advertise": "^1.1.
|
|
74
|
+
"dnssd-advertise": "^1.1.4",
|
|
75
75
|
"expo-server": "^55.0.7",
|
|
76
|
-
"fetch-nodeshim": "^0.4.
|
|
76
|
+
"fetch-nodeshim": "^0.4.10",
|
|
77
77
|
"getenv": "^2.0.0",
|
|
78
78
|
"glob": "^13.0.0",
|
|
79
|
-
"lan-network": "^0.2.
|
|
79
|
+
"lan-network": "^0.2.1",
|
|
80
80
|
"multitars": "^0.2.3",
|
|
81
81
|
"node-forge": "^1.3.3",
|
|
82
82
|
"npm-package-arg": "^11.0.0",
|
|
@@ -158,5 +158,5 @@
|
|
|
158
158
|
"tree-kill": "^1.2.2",
|
|
159
159
|
"tsd": "^0.28.1"
|
|
160
160
|
},
|
|
161
|
-
"gitHead": "
|
|
161
|
+
"gitHead": "b0ada30fd6a819c5f98a23d99b1b89a2ed68743d"
|
|
162
162
|
}
|