@expo/cli 57.0.28 → 57.0.30
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/start/server/metro/createTypescriptResolver.js +2 -2
- package/build/src/start/server/metro/createTypescriptResolver.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 +9 -9
package/build/bin/cli
CHANGED
|
@@ -76,7 +76,7 @@ function getInitMetadata() {
|
|
|
76
76
|
return {
|
|
77
77
|
format: 'v0-jsonl',
|
|
78
78
|
// Version is added in the build script.
|
|
79
|
-
version: "57.0.
|
|
79
|
+
version: "57.0.30" ?? 'UNVERSIONED'
|
|
80
80
|
};
|
|
81
81
|
}
|
|
82
82
|
function getWellKnownTemporaryLogFile(projectRoot, command) {
|
|
@@ -118,7 +118,7 @@ function setupTsConfigWatcher(input, bundler, projectRoot) {
|
|
|
118
118
|
}
|
|
119
119
|
const escapePrefix = (str)=>str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
120
120
|
function joinBaseUrl(baseUrl, lookup) {
|
|
121
|
-
return _path().default.
|
|
121
|
+
return _path().default.resolve(baseUrl, lookup);
|
|
122
122
|
}
|
|
123
123
|
function _resolveWithTsConfigPaths(config, moduleName, resolve) {
|
|
124
124
|
// Exact matches contain no '*' wildcards, and can be 1:1 replacements
|
|
@@ -404,7 +404,7 @@ function _loadTsConfigWithExtends(projectRoot, configPath, depGraph) {
|
|
|
404
404
|
return lookup == null ? void 0 : lookup.absolutePath;
|
|
405
405
|
}
|
|
406
406
|
/** TypeScript's `${configDir}` template prefix for the user config's path */ function substituteConfigDir(value, configDir) {
|
|
407
|
-
return value.startsWith('${configDir}') ? value.replace('${configDir}',
|
|
407
|
+
return value.startsWith('${configDir}') ? _path().default.resolve(configDir, value.replace('${configDir}', './')) : value;
|
|
408
408
|
}
|
|
409
409
|
|
|
410
410
|
//# sourceMappingURL=createTypescriptResolver.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/start/server/metro/createTypescriptResolver.ts"],"sourcesContent":["// Resolves bare module specifiers using `compilerOptions.paths` and `compilerOptions.baseUrl`\n// from the project's tsconfig.json or jsconfig.json.\n// Includes a standalone tsconfig parser that walks the `extends` chain using @expo/json-file\n// without depending on the `typescript` package. Uses Metro's DependencyGraph for file\n// existence, realpath, and node_modules resolution.\n\nimport JsonFile from '@expo/json-file';\nimport type Bundler from '@expo/metro/metro/Bundler';\nimport type DependencyGraph from '@expo/metro/metro/node-haste/DependencyGraph';\nimport type FileMap from '@expo/metro/metro-file-map';\nimport type { FileSystem, ChangeEvent } from '@expo/metro/metro-file-map';\nimport { RootPathUtils } from '@expo/metro/metro-file-map/lib/RootPathUtils';\nimport type { ResolutionContext, Resolution } from '@expo/metro/metro-resolver';\nimport path from 'path';\n\nimport { isFailedToResolveNameError, isFailedToResolvePathError } from './metroErrors';\nimport type { StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\nconst debug = require('debug')('expo:start:server:metro:typescript-resolver') as typeof console.log;\n\ninterface ParsedTsConfig {\n baseUrl?: string;\n paths?: Record<string, string[]>;\n pathsBasePath?: string;\n configNormalPaths?: Set<string>;\n}\n\ninterface SuffixEntry {\n suffix: string;\n mapping: string[];\n}\n\nexport interface TsConfigResolveConfig {\n exactMatches: Record<string, string[] | undefined>;\n prefixRe: RegExp | null;\n prefixMap: Record<string, SuffixEntry[]>;\n baseUrl: string | null;\n configNormalPaths: Set<string> | undefined;\n}\n\ninterface TypescriptResolverInput {\n current: TsConfigResolveConfig | null;\n}\n\n/** Creates a TypeScript paths/baseUrl module resolver.\n * @remarks\n * The TypeScript resolver finds and loads tsconfig.json/jsconfig.json configuration files and sets up resolution\n * for `compilerOptions.paths` and `compilerOptions.baseUrl`. These are typically prefix-style replacements of\n * input module specifiers.\n * It lazily initializes the TypeScript configuration and resolves the files via the Metro filesystem for added\n * efficiency.\n * It skips loading TypeScript configurations via the `typescript` package itself and instead approximates\n * TypeScript's behaviour.\n */\nexport function createTypescriptResolver({\n projectRoot,\n getMetroBundler,\n getStrictResolver,\n watch,\n}: {\n projectRoot: string;\n getMetroBundler: () => Bundler;\n getStrictResolver: StrictResolverFactory;\n watch: boolean;\n}): ExpoCustomMetroResolver {\n const input: TypescriptResolverInput = { current: null };\n let initialized = false;\n\n function init() {\n initialized = true;\n const bundler = getMetroBundler();\n const tsconfig = loadTsConfigPaths(projectRoot, bundler._depGraph);\n input.current = _toResolveConfig(tsconfig, projectRoot);\n if (watch) {\n setupTsConfigWatcher(input, bundler, projectRoot);\n }\n }\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n const nodeModulesPart = `${path.sep}node_modules${path.sep}`;\n\n return function requestTsconfigPaths(immutableContext, moduleName, platform) {\n if (!initialized) {\n init();\n }\n\n if (!input.current) {\n return null;\n } else if (fileSpecifierRe.test(moduleName)) {\n return null;\n } else if (immutableContext.originModulePath.includes(nodeModulesPart)) {\n return null;\n }\n\n // TypeScript paths resolution is heavily pre-computed, which is processed\n // in the `_toResolveConfig` helper. This allows the actual resolver to do\n // very little work\n return _resolveWithTsConfigPaths(\n input.current,\n moduleName,\n getOptionalResolve(immutableContext, platform, getStrictResolver)\n );\n };\n}\n\nfunction setupTsConfigWatcher(\n input: TypescriptResolverInput,\n bundler: Bundler,\n projectRoot: string\n): void {\n function reload() {\n const tsconfig = loadTsConfigPaths(projectRoot, bundler._depGraph);\n input.current = _toResolveConfig(tsconfig, projectRoot);\n }\n\n const watcher = bundler.getWatcher() as FileMap;\n watcher.addListener('change', ({ changes }: ChangeEvent) => {\n for (const change of changes.addedFiles) {\n // Additions are only relevant if we haven't watched tsconfigs before\n if (change[0] === TSCONFIG_NAME || change[0] === JSCONFIG_NAME) {\n return reload();\n }\n }\n if (input.current?.configNormalPaths) {\n for (const change of changes.modifiedFiles) {\n if (input.current.configNormalPaths.has(change[0])) {\n return reload();\n }\n }\n for (const change of changes.removedFiles) {\n if (input.current.configNormalPaths.has(change[0])) {\n return reload();\n }\n }\n }\n });\n}\n\nconst escapePrefix = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\nfunction joinBaseUrl(baseUrl: string, lookup: string): string {\n return path.join(baseUrl, lookup);\n}\n\n/** Attempts to resolve a target module given a pre-processed TypeScript configuration */\nexport function _resolveWithTsConfigPaths(\n config: TsConfigResolveConfig,\n moduleName: string,\n resolve: (moduleName: string) => Resolution | null\n): Resolution | null {\n // Exact matches contain no '*' wildcards, and can be 1:1 replacements\n const exactPaths = config.exactMatches[moduleName];\n if (exactPaths != null) {\n for (const alias of exactPaths) {\n const result = resolve(alias);\n if (result != null) {\n debug(`${moduleName} -> ${alias}`);\n return result;\n }\n }\n return null;\n }\n\n // Widlcard matches contain '*' and we first match the preceding string before it with a regex\n if (config.prefixRe != null) {\n const match = config.prefixRe.exec(moduleName);\n if (match != null) {\n const prefix = match[1]!;\n const rest = moduleName.slice(prefix.length);\n for (const entry of config.prefixMap[prefix]!) {\n let star = rest;\n if (entry.suffix) {\n // If we have a suffix (string after '*') it's checked separately\n // This is cheap, since most matches are complex path prefixes\n if (!rest.endsWith(entry.suffix)) continue;\n star = rest.slice(0, -entry.suffix.length);\n }\n for (const alias of entry.mapping) {\n const possibleResult = alias.replace('*', star);\n const result = resolve(possibleResult);\n if (result != null) {\n debug(`${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n break; // First matching suffix wins\n }\n\n // NOTE: Special case for `\"*\"` paths pattern (replacement for `baseUrl`)\n // If a non-catch-all prefix matched but failed, try the \"*\" catch-all\n // This could also apply to `*.[ext]` paths commonly though\n if (prefix !== '' && config.prefixMap[''] != null) {\n for (const entry of config.prefixMap['']) {\n let star = moduleName;\n if (entry.suffix) {\n if (!moduleName.endsWith(entry.suffix)) continue;\n star = moduleName.slice(0, -entry.suffix.length);\n }\n for (const alias of entry.mapping) {\n const possibleResult = alias.replace('*', star);\n const result = resolve(possibleResult);\n if (result != null) {\n debug(`${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n }\n }\n\n return null;\n }\n }\n\n // Only resolve against baseUrl if no `paths` groups were matched.\n // Base URL is resolved after paths, and before node_modules.\n // NOTE: In TypeScript 6 this is disabled unless `\"ignoreDeprecations\": \"6.0\"` is added\n // In TypeScript 7, this will be removed, and `paths['*']` is the replacement\n if (config.baseUrl != null) {\n const possibleResult = joinBaseUrl(config.baseUrl, moduleName);\n const result = resolve(possibleResult);\n if (result) {\n debug(`baseUrl: ${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n\n return null;\n}\n\nfunction getOptionalResolve(\n context: ResolutionContext,\n platform: string | null,\n getStrictResolver: StrictResolverFactory\n): (moduleName: string) => Resolution | null {\n const doResolve = getStrictResolver(context, platform);\n return function optionalResolve(moduleName: string): Resolution | null {\n try {\n return doResolve(moduleName);\n } catch (error) {\n // If the error is directly related to a resolver not being able to resolve a module, then\n // we can ignore the error and try the next resolver. Otherwise, we should throw the error.\n const isResolutionError =\n isFailedToResolveNameError(error) || isFailedToResolvePathError(error);\n if (!isResolutionError) {\n throw error;\n }\n }\n return null;\n };\n}\n\n/** Pre-processes TypeScript configuration for _resolveWithTsConfigPaths */\nexport function _toResolveConfig(\n tsconfig: ParsedTsConfig | null,\n projectRoot: string\n): TsConfigResolveConfig | null {\n if (!tsconfig || (!tsconfig.paths && tsconfig.baseUrl == null)) {\n return null;\n }\n\n // NOTE(@kitten): We previously had a bug that assumed that paths are relative to the `baseUrl` only\n // However, the `baseUrl` is optional and paths can be relative to the config path instead.\n const pathsBasePath = tsconfig.baseUrl ?? tsconfig.pathsBasePath ?? projectRoot;\n\n const paths = tsconfig.paths ?? {};\n const exactMatches: Record<string, string[]> = Object.create(null);\n const prefixMap: Record<string, SuffixEntry[]> = Object.create(null);\n const seenPrefixes: string[] = [];\n\n for (const key in paths) {\n if (!Array.isArray(paths[key])) {\n continue;\n }\n // Pre-join with baseUrl so the hot path avoids path.join entirely\n const mapping = paths[key]\n .filter((p) => typeof p === 'string' && !p.endsWith('.d.ts'))\n .map((p) => joinBaseUrl(pathsBasePath, p));\n if (mapping.length > 0) {\n const starIndex = key.indexOf('*');\n if (starIndex === -1) {\n exactMatches[key] = mapping;\n } else {\n const prefix = key.slice(0, starIndex);\n const suffix = key.slice(starIndex + 1);\n if (!prefixMap[prefix]) {\n prefixMap[prefix] = [];\n seenPrefixes.push(prefix);\n }\n prefixMap[prefix].push({ suffix, mapping });\n }\n }\n }\n\n // Match longest prefix first\n seenPrefixes.sort((a, b) => b.length - a.length);\n const prefixRe = seenPrefixes.length\n ? new RegExp(`^(${seenPrefixes.map(escapePrefix).join('|')})`)\n : null;\n\n return {\n exactMatches,\n prefixRe,\n prefixMap,\n baseUrl: tsconfig.baseUrl ?? null,\n configNormalPaths: tsconfig.configNormalPaths,\n };\n}\n\nconst TSCONFIG_NAME = 'tsconfig.json';\nconst JSCONFIG_NAME = 'jsconfig.json';\n\nfunction loadTsConfigPaths(projectRoot: string, depGraph: DependencyGraph): ParsedTsConfig | null {\n let configPath: string | null = null;\n if (depGraph.doesFileExist(TSCONFIG_NAME)) {\n configPath = path.join(projectRoot, TSCONFIG_NAME);\n } else if (depGraph.doesFileExist(JSCONFIG_NAME)) {\n configPath = path.join(projectRoot, JSCONFIG_NAME);\n }\n\n if (!configPath) {\n return null;\n }\n\n try {\n return _loadTsConfigWithExtends(projectRoot, configPath, depGraph);\n } catch (error: any) {\n if (error?.isJsonFileError || error?.name === 'SyntaxError') {\n debug(`Failed to parse ${configPath}: ${error.message}`);\n return null;\n }\n throw error;\n }\n}\n\n/** Loads a given tsconfig.json and parses it */\nexport function _loadTsConfigWithExtends(\n projectRoot: string,\n configPath: string,\n depGraph: DependencyGraph\n): ParsedTsConfig | null {\n const visited = new Set<string>();\n const rootConfigDir = path.dirname(configPath);\n\n function load(configPath: string | undefined): ParsedTsConfig | null {\n // NOTE: We avoid cycles here, which are theoretically possible\n // We avoid warning or throwing an error though, since TypeScript will complain about this anyway\n if (typeof configPath !== 'string' || visited.has(configPath)) {\n return null;\n } else {\n visited.add(configPath);\n }\n\n const configDir = path.dirname(configPath);\n const raw = JsonFile.read(configPath, { json5: true });\n const own = extractPathsFromCompilerOptions(raw);\n\n let baseUrl: string | undefined;\n let paths: Record<string, string[]> | undefined;\n let pathsBasePath: string | undefined;\n if (raw.extends) {\n const exts = !Array.isArray(raw.extends) ? [raw.extends] : raw.extends;\n for (const ext of exts) {\n if (typeof ext === 'string') {\n // Resolve the `extends` path with Node-like resolution, similar to TypeScript\n const extPath = resolveExtendsPath(ext, configDir, depGraph._fileSystem);\n const parent = load(extPath);\n if (parent) {\n baseUrl = parent.baseUrl ?? baseUrl;\n paths = parent.paths ?? paths;\n pathsBasePath = parent.pathsBasePath ?? pathsBasePath;\n }\n }\n }\n }\n\n // Outermost config values win, but can be combined\n // The `pathsBasePath` is the path of the config that `paths` are defined in\n // `paths` are not merged\n return {\n baseUrl: own.baseUrl ?? baseUrl,\n paths: own.paths ?? paths,\n pathsBasePath: own.paths != null ? configDir : pathsBasePath,\n };\n }\n\n const result = load(configPath);\n if (result != null) {\n const pathUtils = new RootPathUtils(projectRoot);\n const configPaths = new Set<string>();\n // Keep track of the configuration paths here for the file watcher\n for (const visitedConfigPath of visited) {\n configPaths.add(pathUtils.absoluteToNormal(visitedConfigPath));\n }\n result.configNormalPaths = configPaths;\n if (result.baseUrl != null) {\n result.baseUrl = path.resolve(\n rootConfigDir,\n substituteConfigDir(result.baseUrl, rootConfigDir)\n );\n }\n if (result.paths != null) {\n for (const key in result.paths) {\n const mapping = result.paths[key]!;\n for (let idx = 0; idx < mapping.length; idx++) {\n mapping[idx] = substituteConfigDir(mapping[idx]!, rootConfigDir);\n }\n }\n }\n }\n return result;\n}\n\n/** Normalize JSON's tsconfig compilerOptions */\nfunction extractPathsFromCompilerOptions(raw: Record<string, unknown>): {\n baseUrl?: string;\n paths?: Record<string, string[]>;\n} {\n if (raw.compilerOptions == null || typeof raw.compilerOptions !== 'object') {\n return {};\n }\n const opts = raw.compilerOptions as Record<string, unknown>;\n const baseUrl = typeof opts.baseUrl === 'string' ? opts.baseUrl : undefined;\n\n let paths: Record<string, string[]> | undefined;\n if (opts.paths != null && typeof opts.paths === 'object') {\n paths = {};\n for (const key in opts.paths as Record<string, unknown>) {\n const values = (opts.paths as Record<string, unknown>)[key];\n if (Array.isArray(values)) {\n paths[key] = values.filter((v): v is string => typeof v === 'string');\n }\n }\n }\n\n return { baseUrl, paths };\n}\n\n/** Lookup/resolve an `extends` path */\nfunction resolveExtendsPath(\n targetPath: string,\n configDir: string,\n fileSystem: FileSystem\n): string | undefined {\n let target = fileSystem.lookup(path.join(configDir, targetPath));\n if (target.exists && target.type === 'f') {\n return target.realPath;\n }\n\n if (!targetPath.endsWith('.json')) {\n target = fileSystem.lookup(path.join(configDir, targetPath + '.json'));\n if (target.exists && target.type === 'f') {\n return target.realPath;\n }\n }\n\n // Last attempt is Node-like resolution\n let lookup: null | undefined | { absolutePath: string; containerRelativePath: string };\n if (!targetPath.endsWith('.json')) {\n lookup = fileSystem.hierarchicalLookup(configDir, `node_modules/${targetPath}.json`, {\n subpathType: 'f',\n });\n if (lookup != null) {\n return lookup.absolutePath;\n }\n }\n if (lookup == null) {\n lookup = fileSystem.hierarchicalLookup(configDir, `node_modules/${targetPath}`, {\n subpathType: 'f',\n });\n }\n if (lookup == null && !targetPath.endsWith('.json')) {\n lookup = fileSystem.hierarchicalLookup(\n configDir,\n `node_modules/${targetPath}/${TSCONFIG_NAME}`,\n {\n subpathType: 'f',\n }\n );\n }\n\n // NOTE(@kitten): Some implementations opt to add `package.json:exports` and `package.json:tsconfig`\n // field support here, but it's unclear if this is even supported in TypeScript itself. It's likely\n // not used, as it's impossible to find an example of this anywhere\n\n return lookup?.absolutePath;\n}\n\n/** TypeScript's `${configDir}` template prefix for the user config's path */\nfunction substituteConfigDir(value: string, configDir: string): string {\n return value.startsWith('${configDir}')\n ? value.replace('${configDir}', configDir.endsWith(path.sep) ? '.' : './')\n : value;\n}\n"],"names":["_loadTsConfigWithExtends","_resolveWithTsConfigPaths","_toResolveConfig","createTypescriptResolver","debug","require","projectRoot","getMetroBundler","getStrictResolver","watch","input","current","initialized","init","bundler","tsconfig","loadTsConfigPaths","_depGraph","setupTsConfigWatcher","fileSpecifierRe","nodeModulesPart","path","sep","requestTsconfigPaths","immutableContext","moduleName","platform","test","originModulePath","includes","getOptionalResolve","reload","watcher","getWatcher","addListener","changes","change","addedFiles","TSCONFIG_NAME","JSCONFIG_NAME","configNormalPaths","modifiedFiles","has","removedFiles","escapePrefix","str","replace","joinBaseUrl","baseUrl","lookup","join","config","resolve","exactPaths","exactMatches","alias","result","prefixRe","match","exec","prefix","rest","slice","length","entry","prefixMap","star","suffix","endsWith","mapping","possibleResult","context","doResolve","optionalResolve","error","isResolutionError","isFailedToResolveNameError","isFailedToResolvePathError","paths","pathsBasePath","Object","create","seenPrefixes","key","Array","isArray","filter","p","map","starIndex","indexOf","push","sort","a","b","RegExp","depGraph","configPath","doesFileExist","isJsonFileError","name","message","visited","Set","rootConfigDir","dirname","load","add","configDir","raw","JsonFile","read","json5","own","extractPathsFromCompilerOptions","extends","exts","ext","extPath","resolveExtendsPath","_fileSystem","parent","pathUtils","RootPathUtils","configPaths","visitedConfigPath","absoluteToNormal","substituteConfigDir","idx","compilerOptions","opts","undefined","values","v","targetPath","fileSystem","target","exists","type","realPath","hierarchicalLookup","subpathType","absolutePath","value","startsWith"],"mappings":"AAAA,8FAA8F;AAC9F,qDAAqD;AACrD,6FAA6F;AAC7F,uFAAuF;AACvF,oDAAoD;;;;;;;;;;;;QA4UpCA;eAAAA;;QA9LAC;eAAAA;;QA2GAC;eAAAA;;QAtMAC;eAAAA;;;;gEAjDK;;;;;;;yBAKS;;;;;;;gEAEb;;;;;;6BAEsD;;;;;;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AAWK,kBAAkB,CAAChC,WAAW,CAAC,aAAa,EAAE0B,YAAY,EAAE;YAC9EO,aAAa;QACf;IACF;IACA,IAAI5F,UAAU,QAAQ,CAACqF,WAAWlE,QAAQ,CAAC,UAAU;QACnDnB,SAASsF,WAAWK,kBAAkB,CACpChC,WACA,CAAC,aAAa,EAAE0B,WAAW,CAAC,EAAEhG,eAAe,EAC7C;YACEuG,aAAa;QACf;IAEJ;IAEA,oGAAoG;IACpG,mGAAmG;IACnG,mEAAmE;IAEnE,OAAO5F,0BAAAA,OAAQ6F,YAAY;AAC7B;AAEA,2EAA2E,GAC3E,SAASf,oBAAoBgB,KAAa,EAAEnC,SAAiB;IAC3D,OAAOmC,MAAMC,UAAU,CAAC,kBACpBD,MAAMjG,OAAO,CAAC,gBAAgB8D,UAAUxC,QAAQ,CAAC/C,eAAI,CAACC,GAAG,IAAI,MAAM,QACnEyH;AACN"}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/start/server/metro/createTypescriptResolver.ts"],"sourcesContent":["// Resolves bare module specifiers using `compilerOptions.paths` and `compilerOptions.baseUrl`\n// from the project's tsconfig.json or jsconfig.json.\n// Includes a standalone tsconfig parser that walks the `extends` chain using @expo/json-file\n// without depending on the `typescript` package. Uses Metro's DependencyGraph for file\n// existence, realpath, and node_modules resolution.\n\nimport JsonFile from '@expo/json-file';\nimport type Bundler from '@expo/metro/metro/Bundler';\nimport type DependencyGraph from '@expo/metro/metro/node-haste/DependencyGraph';\nimport type FileMap from '@expo/metro/metro-file-map';\nimport type { FileSystem, ChangeEvent } from '@expo/metro/metro-file-map';\nimport { RootPathUtils } from '@expo/metro/metro-file-map/lib/RootPathUtils';\nimport type { ResolutionContext, Resolution } from '@expo/metro/metro-resolver';\nimport path from 'path';\n\nimport { isFailedToResolveNameError, isFailedToResolvePathError } from './metroErrors';\nimport type { StrictResolverFactory } from './withMetroMultiPlatform';\nimport type { ExpoCustomMetroResolver } from './withMetroResolvers';\n\nconst debug = require('debug')('expo:start:server:metro:typescript-resolver') as typeof console.log;\n\ninterface ParsedTsConfig {\n baseUrl?: string;\n paths?: Record<string, string[]>;\n pathsBasePath?: string;\n configNormalPaths?: Set<string>;\n}\n\ninterface SuffixEntry {\n suffix: string;\n mapping: string[];\n}\n\nexport interface TsConfigResolveConfig {\n exactMatches: Record<string, string[] | undefined>;\n prefixRe: RegExp | null;\n prefixMap: Record<string, SuffixEntry[]>;\n baseUrl: string | null;\n configNormalPaths: Set<string> | undefined;\n}\n\ninterface TypescriptResolverInput {\n current: TsConfigResolveConfig | null;\n}\n\n/** Creates a TypeScript paths/baseUrl module resolver.\n * @remarks\n * The TypeScript resolver finds and loads tsconfig.json/jsconfig.json configuration files and sets up resolution\n * for `compilerOptions.paths` and `compilerOptions.baseUrl`. These are typically prefix-style replacements of\n * input module specifiers.\n * It lazily initializes the TypeScript configuration and resolves the files via the Metro filesystem for added\n * efficiency.\n * It skips loading TypeScript configurations via the `typescript` package itself and instead approximates\n * TypeScript's behaviour.\n */\nexport function createTypescriptResolver({\n projectRoot,\n getMetroBundler,\n getStrictResolver,\n watch,\n}: {\n projectRoot: string;\n getMetroBundler: () => Bundler;\n getStrictResolver: StrictResolverFactory;\n watch: boolean;\n}): ExpoCustomMetroResolver {\n const input: TypescriptResolverInput = { current: null };\n let initialized = false;\n\n function init() {\n initialized = true;\n const bundler = getMetroBundler();\n const tsconfig = loadTsConfigPaths(projectRoot, bundler._depGraph);\n input.current = _toResolveConfig(tsconfig, projectRoot);\n if (watch) {\n setupTsConfigWatcher(input, bundler, projectRoot);\n }\n }\n\n const fileSpecifierRe = /^[\\\\/]|^\\.\\.?(?:$|[\\\\/])/i;\n const nodeModulesPart = `${path.sep}node_modules${path.sep}`;\n\n return function requestTsconfigPaths(immutableContext, moduleName, platform) {\n if (!initialized) {\n init();\n }\n\n if (!input.current) {\n return null;\n } else if (fileSpecifierRe.test(moduleName)) {\n return null;\n } else if (immutableContext.originModulePath.includes(nodeModulesPart)) {\n return null;\n }\n\n // TypeScript paths resolution is heavily pre-computed, which is processed\n // in the `_toResolveConfig` helper. This allows the actual resolver to do\n // very little work\n return _resolveWithTsConfigPaths(\n input.current,\n moduleName,\n getOptionalResolve(immutableContext, platform, getStrictResolver)\n );\n };\n}\n\nfunction setupTsConfigWatcher(\n input: TypescriptResolverInput,\n bundler: Bundler,\n projectRoot: string\n): void {\n function reload() {\n const tsconfig = loadTsConfigPaths(projectRoot, bundler._depGraph);\n input.current = _toResolveConfig(tsconfig, projectRoot);\n }\n\n const watcher = bundler.getWatcher() as FileMap;\n watcher.addListener('change', ({ changes }: ChangeEvent) => {\n for (const change of changes.addedFiles) {\n // Additions are only relevant if we haven't watched tsconfigs before\n if (change[0] === TSCONFIG_NAME || change[0] === JSCONFIG_NAME) {\n return reload();\n }\n }\n if (input.current?.configNormalPaths) {\n for (const change of changes.modifiedFiles) {\n if (input.current.configNormalPaths.has(change[0])) {\n return reload();\n }\n }\n for (const change of changes.removedFiles) {\n if (input.current.configNormalPaths.has(change[0])) {\n return reload();\n }\n }\n }\n });\n}\n\nconst escapePrefix = (str: string) => str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n\nfunction joinBaseUrl(baseUrl: string, lookup: string): string {\n return path.resolve(baseUrl, lookup);\n}\n\n/** Attempts to resolve a target module given a pre-processed TypeScript configuration */\nexport function _resolveWithTsConfigPaths(\n config: TsConfigResolveConfig,\n moduleName: string,\n resolve: (moduleName: string) => Resolution | null\n): Resolution | null {\n // Exact matches contain no '*' wildcards, and can be 1:1 replacements\n const exactPaths = config.exactMatches[moduleName];\n if (exactPaths != null) {\n for (const alias of exactPaths) {\n const result = resolve(alias);\n if (result != null) {\n debug(`${moduleName} -> ${alias}`);\n return result;\n }\n }\n return null;\n }\n\n // Widlcard matches contain '*' and we first match the preceding string before it with a regex\n if (config.prefixRe != null) {\n const match = config.prefixRe.exec(moduleName);\n if (match != null) {\n const prefix = match[1]!;\n const rest = moduleName.slice(prefix.length);\n for (const entry of config.prefixMap[prefix]!) {\n let star = rest;\n if (entry.suffix) {\n // If we have a suffix (string after '*') it's checked separately\n // This is cheap, since most matches are complex path prefixes\n if (!rest.endsWith(entry.suffix)) continue;\n star = rest.slice(0, -entry.suffix.length);\n }\n for (const alias of entry.mapping) {\n const possibleResult = alias.replace('*', star);\n const result = resolve(possibleResult);\n if (result != null) {\n debug(`${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n break; // First matching suffix wins\n }\n\n // NOTE: Special case for `\"*\"` paths pattern (replacement for `baseUrl`)\n // If a non-catch-all prefix matched but failed, try the \"*\" catch-all\n // This could also apply to `*.[ext]` paths commonly though\n if (prefix !== '' && config.prefixMap[''] != null) {\n for (const entry of config.prefixMap['']) {\n let star = moduleName;\n if (entry.suffix) {\n if (!moduleName.endsWith(entry.suffix)) continue;\n star = moduleName.slice(0, -entry.suffix.length);\n }\n for (const alias of entry.mapping) {\n const possibleResult = alias.replace('*', star);\n const result = resolve(possibleResult);\n if (result != null) {\n debug(`${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n }\n }\n\n return null;\n }\n }\n\n // Only resolve against baseUrl if no `paths` groups were matched.\n // Base URL is resolved after paths, and before node_modules.\n // NOTE: In TypeScript 6 this is disabled unless `\"ignoreDeprecations\": \"6.0\"` is added\n // In TypeScript 7, this will be removed, and `paths['*']` is the replacement\n if (config.baseUrl != null) {\n const possibleResult = joinBaseUrl(config.baseUrl, moduleName);\n const result = resolve(possibleResult);\n if (result) {\n debug(`baseUrl: ${moduleName} -> ${possibleResult}`);\n return result;\n }\n }\n\n return null;\n}\n\nfunction getOptionalResolve(\n context: ResolutionContext,\n platform: string | null,\n getStrictResolver: StrictResolverFactory\n): (moduleName: string) => Resolution | null {\n const doResolve = getStrictResolver(context, platform);\n return function optionalResolve(moduleName: string): Resolution | null {\n try {\n return doResolve(moduleName);\n } catch (error) {\n // If the error is directly related to a resolver not being able to resolve a module, then\n // we can ignore the error and try the next resolver. Otherwise, we should throw the error.\n const isResolutionError =\n isFailedToResolveNameError(error) || isFailedToResolvePathError(error);\n if (!isResolutionError) {\n throw error;\n }\n }\n return null;\n };\n}\n\n/** Pre-processes TypeScript configuration for _resolveWithTsConfigPaths */\nexport function _toResolveConfig(\n tsconfig: ParsedTsConfig | null,\n projectRoot: string\n): TsConfigResolveConfig | null {\n if (!tsconfig || (!tsconfig.paths && tsconfig.baseUrl == null)) {\n return null;\n }\n\n // NOTE(@kitten): We previously had a bug that assumed that paths are relative to the `baseUrl` only\n // However, the `baseUrl` is optional and paths can be relative to the config path instead.\n const pathsBasePath = tsconfig.baseUrl ?? tsconfig.pathsBasePath ?? projectRoot;\n\n const paths = tsconfig.paths ?? {};\n const exactMatches: Record<string, string[]> = Object.create(null);\n const prefixMap: Record<string, SuffixEntry[]> = Object.create(null);\n const seenPrefixes: string[] = [];\n\n for (const key in paths) {\n if (!Array.isArray(paths[key])) {\n continue;\n }\n // Pre-join with baseUrl so the hot path avoids path.join entirely\n const mapping = paths[key]\n .filter((p) => typeof p === 'string' && !p.endsWith('.d.ts'))\n .map((p) => joinBaseUrl(pathsBasePath, p));\n if (mapping.length > 0) {\n const starIndex = key.indexOf('*');\n if (starIndex === -1) {\n exactMatches[key] = mapping;\n } else {\n const prefix = key.slice(0, starIndex);\n const suffix = key.slice(starIndex + 1);\n if (!prefixMap[prefix]) {\n prefixMap[prefix] = [];\n seenPrefixes.push(prefix);\n }\n prefixMap[prefix].push({ suffix, mapping });\n }\n }\n }\n\n // Match longest prefix first\n seenPrefixes.sort((a, b) => b.length - a.length);\n const prefixRe = seenPrefixes.length\n ? new RegExp(`^(${seenPrefixes.map(escapePrefix).join('|')})`)\n : null;\n\n return {\n exactMatches,\n prefixRe,\n prefixMap,\n baseUrl: tsconfig.baseUrl ?? null,\n configNormalPaths: tsconfig.configNormalPaths,\n };\n}\n\nconst TSCONFIG_NAME = 'tsconfig.json';\nconst JSCONFIG_NAME = 'jsconfig.json';\n\nfunction loadTsConfigPaths(projectRoot: string, depGraph: DependencyGraph): ParsedTsConfig | null {\n let configPath: string | null = null;\n if (depGraph.doesFileExist(TSCONFIG_NAME)) {\n configPath = path.join(projectRoot, TSCONFIG_NAME);\n } else if (depGraph.doesFileExist(JSCONFIG_NAME)) {\n configPath = path.join(projectRoot, JSCONFIG_NAME);\n }\n\n if (!configPath) {\n return null;\n }\n\n try {\n return _loadTsConfigWithExtends(projectRoot, configPath, depGraph);\n } catch (error: any) {\n if (error?.isJsonFileError || error?.name === 'SyntaxError') {\n debug(`Failed to parse ${configPath}: ${error.message}`);\n return null;\n }\n throw error;\n }\n}\n\n/** Loads a given tsconfig.json and parses it */\nexport function _loadTsConfigWithExtends(\n projectRoot: string,\n configPath: string,\n depGraph: DependencyGraph\n): ParsedTsConfig | null {\n const visited = new Set<string>();\n const rootConfigDir = path.dirname(configPath);\n\n function load(configPath: string | undefined): ParsedTsConfig | null {\n // NOTE: We avoid cycles here, which are theoretically possible\n // We avoid warning or throwing an error though, since TypeScript will complain about this anyway\n if (typeof configPath !== 'string' || visited.has(configPath)) {\n return null;\n } else {\n visited.add(configPath);\n }\n\n const configDir = path.dirname(configPath);\n const raw = JsonFile.read(configPath, { json5: true });\n const own = extractPathsFromCompilerOptions(raw);\n\n let baseUrl: string | undefined;\n let paths: Record<string, string[]> | undefined;\n let pathsBasePath: string | undefined;\n if (raw.extends) {\n const exts = !Array.isArray(raw.extends) ? [raw.extends] : raw.extends;\n for (const ext of exts) {\n if (typeof ext === 'string') {\n // Resolve the `extends` path with Node-like resolution, similar to TypeScript\n const extPath = resolveExtendsPath(ext, configDir, depGraph._fileSystem);\n const parent = load(extPath);\n if (parent) {\n baseUrl = parent.baseUrl ?? baseUrl;\n paths = parent.paths ?? paths;\n pathsBasePath = parent.pathsBasePath ?? pathsBasePath;\n }\n }\n }\n }\n\n // Outermost config values win, but can be combined\n // The `pathsBasePath` is the path of the config that `paths` are defined in\n // `paths` are not merged\n return {\n baseUrl: own.baseUrl ?? baseUrl,\n paths: own.paths ?? paths,\n pathsBasePath: own.paths != null ? configDir : pathsBasePath,\n };\n }\n\n const result = load(configPath);\n if (result != null) {\n const pathUtils = new RootPathUtils(projectRoot);\n const configPaths = new Set<string>();\n // Keep track of the configuration paths here for the file watcher\n for (const visitedConfigPath of visited) {\n configPaths.add(pathUtils.absoluteToNormal(visitedConfigPath));\n }\n result.configNormalPaths = configPaths;\n if (result.baseUrl != null) {\n result.baseUrl = path.resolve(\n rootConfigDir,\n substituteConfigDir(result.baseUrl, rootConfigDir)\n );\n }\n if (result.paths != null) {\n for (const key in result.paths) {\n const mapping = result.paths[key]!;\n for (let idx = 0; idx < mapping.length; idx++) {\n mapping[idx] = substituteConfigDir(mapping[idx]!, rootConfigDir);\n }\n }\n }\n }\n return result;\n}\n\n/** Normalize JSON's tsconfig compilerOptions */\nfunction extractPathsFromCompilerOptions(raw: Record<string, unknown>): {\n baseUrl?: string;\n paths?: Record<string, string[]>;\n} {\n if (raw.compilerOptions == null || typeof raw.compilerOptions !== 'object') {\n return {};\n }\n const opts = raw.compilerOptions as Record<string, unknown>;\n const baseUrl = typeof opts.baseUrl === 'string' ? opts.baseUrl : undefined;\n\n let paths: Record<string, string[]> | undefined;\n if (opts.paths != null && typeof opts.paths === 'object') {\n paths = {};\n for (const key in opts.paths as Record<string, unknown>) {\n const values = (opts.paths as Record<string, unknown>)[key];\n if (Array.isArray(values)) {\n paths[key] = values.filter((v): v is string => typeof v === 'string');\n }\n }\n }\n\n return { baseUrl, paths };\n}\n\n/** Lookup/resolve an `extends` path */\nfunction resolveExtendsPath(\n targetPath: string,\n configDir: string,\n fileSystem: FileSystem\n): string | undefined {\n let target = fileSystem.lookup(path.join(configDir, targetPath));\n if (target.exists && target.type === 'f') {\n return target.realPath;\n }\n\n if (!targetPath.endsWith('.json')) {\n target = fileSystem.lookup(path.join(configDir, targetPath + '.json'));\n if (target.exists && target.type === 'f') {\n return target.realPath;\n }\n }\n\n // Last attempt is Node-like resolution\n let lookup: null | undefined | { absolutePath: string; containerRelativePath: string };\n if (!targetPath.endsWith('.json')) {\n lookup = fileSystem.hierarchicalLookup(configDir, `node_modules/${targetPath}.json`, {\n subpathType: 'f',\n });\n if (lookup != null) {\n return lookup.absolutePath;\n }\n }\n if (lookup == null) {\n lookup = fileSystem.hierarchicalLookup(configDir, `node_modules/${targetPath}`, {\n subpathType: 'f',\n });\n }\n if (lookup == null && !targetPath.endsWith('.json')) {\n lookup = fileSystem.hierarchicalLookup(\n configDir,\n `node_modules/${targetPath}/${TSCONFIG_NAME}`,\n {\n subpathType: 'f',\n }\n );\n }\n\n // NOTE(@kitten): Some implementations opt to add `package.json:exports` and `package.json:tsconfig`\n // field support here, but it's unclear if this is even supported in TypeScript itself. It's likely\n // not used, as it's impossible to find an example of this anywhere\n\n return lookup?.absolutePath;\n}\n\n/** TypeScript's `${configDir}` template prefix for the user config's path */\nfunction substituteConfigDir(value: string, configDir: string): string {\n return value.startsWith('${configDir}')\n ? path.resolve(configDir, value.replace('${configDir}', './'))\n : value;\n}\n"],"names":["_loadTsConfigWithExtends","_resolveWithTsConfigPaths","_toResolveConfig","createTypescriptResolver","debug","require","projectRoot","getMetroBundler","getStrictResolver","watch","input","current","initialized","init","bundler","tsconfig","loadTsConfigPaths","_depGraph","setupTsConfigWatcher","fileSpecifierRe","nodeModulesPart","path","sep","requestTsconfigPaths","immutableContext","moduleName","platform","test","originModulePath","includes","getOptionalResolve","reload","watcher","getWatcher","addListener","changes","change","addedFiles","TSCONFIG_NAME","JSCONFIG_NAME","configNormalPaths","modifiedFiles","has","removedFiles","escapePrefix","str","replace","joinBaseUrl","baseUrl","lookup","resolve","config","exactPaths","exactMatches","alias","result","prefixRe","match","exec","prefix","rest","slice","length","entry","prefixMap","star","suffix","endsWith","mapping","possibleResult","context","doResolve","optionalResolve","error","isResolutionError","isFailedToResolveNameError","isFailedToResolvePathError","paths","pathsBasePath","Object","create","seenPrefixes","key","Array","isArray","filter","p","map","starIndex","indexOf","push","sort","a","b","RegExp","join","depGraph","configPath","doesFileExist","isJsonFileError","name","message","visited","Set","rootConfigDir","dirname","load","add","configDir","raw","JsonFile","read","json5","own","extractPathsFromCompilerOptions","extends","exts","ext","extPath","resolveExtendsPath","_fileSystem","parent","pathUtils","RootPathUtils","configPaths","visitedConfigPath","absoluteToNormal","substituteConfigDir","idx","compilerOptions","opts","undefined","values","v","targetPath","fileSystem","target","exists","type","realPath","hierarchicalLookup","subpathType","absolutePath","value","startsWith"],"mappings":"AAAA,8FAA8F;AAC9F,qDAAqD;AACrD,6FAA6F;AAC7F,uFAAuF;AACvF,oDAAoD;;;;;;;;;;;;QA4UpCA;eAAAA;;QA9LAC;eAAAA;;QA2GAC;eAAAA;;QAtMAC;eAAAA;;;;gEAjDK;;;;;;;yBAKS;;;;;;;gEAEb;;;;;;6BAEsD;;;;;;AAIvE,MAAMC,QAAQC,QAAQ,SAAS;AAoCxB,SAASF,yBAAyB,EACvCG,WAAW,EACXC,eAAe,EACfC,iBAAiB,EACjBC,KAAK,EAMN;IACC,MAAMC,QAAiC;QAAEC,SAAS;IAAK;IACvD,IAAIC,cAAc;IAElB,SAASC;QACPD,cAAc;QACd,MAAME,UAAUP;QAChB,MAAMQ,WAAWC,kBAAkBV,aAAaQ,QAAQG,SAAS;QACjEP,MAAMC,OAAO,GAAGT,iBAAiBa,UAAUT;QAC3C,IAAIG,OAAO;YACTS,qBAAqBR,OAAOI,SAASR;QACvC;IACF;IAEA,MAAMa,kBAAkB;IACxB,MAAMC,kBAAkB,GAAGC,eAAI,CAACC,GAAG,CAAC,YAAY,EAAED,eAAI,CAACC,GAAG,EAAE;IAE5D,OAAO,SAASC,qBAAqBC,gBAAgB,EAAEC,UAAU,EAAEC,QAAQ;QACzE,IAAI,CAACd,aAAa;YAChBC;QACF;QAEA,IAAI,CAACH,MAAMC,OAAO,EAAE;YAClB,OAAO;QACT,OAAO,IAAIQ,gBAAgBQ,IAAI,CAACF,aAAa;YAC3C,OAAO;QACT,OAAO,IAAID,iBAAiBI,gBAAgB,CAACC,QAAQ,CAACT,k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AU;QACjCqE,SAASD,WAAWtF,MAAM,CAAC5B,eAAI,CAAC0E,IAAI,CAACa,WAAW0B,aAAa;QAC7D,IAAIE,OAAOC,MAAM,IAAID,OAAOE,IAAI,KAAK,KAAK;YACxC,OAAOF,OAAOG,QAAQ;QACxB;IACF;IAEA,uCAAuC;IACvC,IAAI1F;IACJ,IAAI,CAACqF,WAAWnE,QAAQ,CAAC,UAAU;QACjClB,SAASsF,WAAWK,kBAAkB,CAAChC,WAAW,CAAC,aAAa,EAAE0B,WAAW,KAAK,CAAC,EAAE;YACnFO,aAAa;QACf;QACA,IAAI5F,UAAU,MAAM;YAClB,OAAOA,OAAO6F,YAAY;QAC5B;IACF;IACA,IAAI7F,UAAU,MAAM;QAClBA,SAASsF,WAAWK,kBAAkB,CAAChC,WAAW,CAAC,aAAa,EAAE0B,YAAY,EAAE;YAC9EO,aAAa;QACf;IACF;IACA,IAAI5F,UAAU,QAAQ,CAACqF,WAAWnE,QAAQ,CAAC,UAAU;QACnDlB,SAASsF,WAAWK,kBAAkB,CACpChC,WACA,CAAC,aAAa,EAAE0B,WAAW,CAAC,EAAEhG,eAAe,EAC7C;YACEuG,aAAa;QACf;IAEJ;IAEA,oGAAoG;IACpG,mGAAmG;IACnG,mEAAmE;IAEnE,OAAO5F,0BAAAA,OAAQ6F,YAAY;AAC7B;AAEA,2EAA2E,GAC3E,SAASf,oBAAoBgB,KAAa,EAAEnC,SAAiB;IAC3D,OAAOmC,MAAMC,UAAU,CAAC,kBACpB3H,eAAI,CAAC6B,OAAO,CAAC0D,WAAWmC,MAAMjG,OAAO,CAAC,gBAAgB,SACtDiG;AACN"}
|
|
@@ -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/${"57.0.
|
|
29
|
+
'user-agent': `expo-cli/${"57.0.30"}`,
|
|
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": "57.0.
|
|
3
|
+
"version": "57.0.30",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"bin": {
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@expo/devcert": "^1.2.1",
|
|
44
44
|
"@expo/env": "~2.4.3",
|
|
45
45
|
"@expo/image-utils": "^0.11.6",
|
|
46
|
-
"@expo/inline-modules": "^0.1.
|
|
46
|
+
"@expo/inline-modules": "^0.1.8",
|
|
47
47
|
"@expo/json-file": "^11.0.1",
|
|
48
48
|
"@expo/log-box": "^57.0.4",
|
|
49
49
|
"@expo/metro": "~56.0.2",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@expo/osascript": "^2.7.1",
|
|
53
53
|
"@expo/package-manager": "^1.13.1",
|
|
54
54
|
"@expo/plist": "^0.8.1",
|
|
55
|
-
"@expo/prebuild-config": "^57.0.
|
|
55
|
+
"@expo/prebuild-config": "^57.0.19",
|
|
56
56
|
"@expo/require-utils": "^57.0.6",
|
|
57
57
|
"@expo/router-server": "^57.0.12",
|
|
58
58
|
"@expo/schema-utils": "^57.0.2",
|
|
@@ -157,13 +157,13 @@
|
|
|
157
157
|
"playwright": "^1.59.0",
|
|
158
158
|
"taskr": "^1.1.0",
|
|
159
159
|
"tree-kill": "^1.2.2",
|
|
160
|
-
"expo": "57.0.
|
|
161
|
-
"
|
|
162
|
-
"expo-modules-autolinking": "57.0.
|
|
163
|
-
"expo-router": "57.0.
|
|
164
|
-
"expo
|
|
160
|
+
"expo": "57.0.29",
|
|
161
|
+
"expo-module-scripts": "56.0.3",
|
|
162
|
+
"expo-modules-autolinking": "57.0.16",
|
|
163
|
+
"expo-router": "57.0.27",
|
|
164
|
+
"@expo/fingerprint": "0.20.14"
|
|
165
165
|
},
|
|
166
|
-
"gitHead": "
|
|
166
|
+
"gitHead": "0607af7a70d0ea3e58a6d55824aac5cfd3e78613",
|
|
167
167
|
"scripts": {
|
|
168
168
|
"build": "taskr",
|
|
169
169
|
"clean": "expo-module clean",
|