@expo/config 6.0.26 → 7.0.0
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/README.md +1 -1
- package/build/Config.js.map +1 -1
- package/build/Config.types.js.map +1 -1
- package/build/Errors.js.map +1 -1
- package/build/Project.js.map +1 -1
- package/build/Serialize.js.map +1 -1
- package/build/evalConfig.js.map +1 -1
- package/build/getConfig.js.map +1 -1
- package/build/getFullName.js.map +1 -1
- package/build/getUserState.js.map +1 -1
- package/build/index.js.map +1 -1
- package/build/isLegacyImportsEnabled.js.map +1 -1
- package/build/paths/extensions.js.map +1 -1
- package/build/paths/index.js.map +1 -1
- package/build/paths/paths.js.map +1 -1
- package/build/plugins/withConfigPlugins.js.map +1 -1
- package/build/plugins/withInternal.js.map +1 -1
- package/build/resolvePackageJson.js.map +1 -1
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
👋 Welcome to <br><code>@expo/config</code>
|
|
4
4
|
</h1>
|
|
5
5
|
|
|
6
|
-
<p align="center">A library for interacting with the <code>app.json</code
|
|
6
|
+
<p align="center">A library for interacting with the <code>app.json</code>.</p>
|
|
7
7
|
|
|
8
8
|
<p align="center">
|
|
9
9
|
<img src="https://flat.badgen.net/packagephobia/install/@expo/config">
|
package/build/Config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Config.ts"],"names":["reduceExpoObject","config","undefined","mods","expo","getSupportedPlatforms","projectRoot","platforms","resolveFrom","silent","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","isModdedConfig","skipPlugins","isPublicConfig","_internal","hooks","ios","android","currentFullName","originalFullName","updates","codeSigningCertificate","codeSigningMetadata","getContextConfig","exportedObjectType","rawDynamicConfig","dynamicConfig","getPackageJson","JsonFile","read","readConfigJson","skipValidation","getConfigName","path","basename","outputRootConfig","ConfigError","resolve","APP_JSON_EXAMPLE","customPaths","getCustomConfigFilePaths","getDynamicConfigFilePath","getStaticConfigFilePath","customConfigPaths","isDynamicFilePath","fileName","configPath","join","fs","existsSync","findConfigFile","configName","configNamespace","configFilename","readExpRcAsync","expRcPath","readAsync","json5","cantReadFileDefault","resetCustomConfigPaths","key","Object","keys","setCustomConfigPath","modifyConfigAsync","modifications","readOptions","writeOptions","type","message","relative","outputConfig","dryRun","writeAsync","JSON","stringify","name","slug","sdkVersion","pkgName","pkgVersion","version","pkgWithDefaults","toLowerCase","description","expWithDefaults","error","writeConfigJsonAsync","console","log","DEFAULT_BUILD_PATH","getWebOutputPath","process","env","WEBPACK_BUILD_OUTPUT_PATH","web","build","output","getNameFromConfig","appManifest","appName","displayName","webName","getDefaultTarget","semver","lt","isBareWorkflowProject","dependencies","expokit","xcodeprojFiles","absolute","cwd","length","gradleFiles","filePath","match","getProjectConfigDescription","getProjectConfigDescriptionWithPaths","projectConfig","relativeDynamicConfigPath"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAcA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;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ATD,MASO,IAAID,aAAa,CAACzH,gBAAlB,EAAoC;AACzC,WAAOoC,gBAAKqC,QAAL,CAAcnF,WAAd,EAA2BmI,aAAa,CAACzH,gBAAzC,CAAP;AACD,GAZO,CAaR;;;AACA,SAAO,UAAP;AACD","sourcesContent":["import { ModConfig } from '@expo/config-plugins';\nimport JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\nimport slugify from 'slugify';\n\nimport {\n AppJSONConfig,\n ConfigFilePaths,\n ExpoConfig,\n ExpRc,\n GetConfigOptions,\n PackageJSONConfig,\n Platform,\n ProjectConfig,\n ProjectTarget,\n WriteConfigOptions,\n} from './Config.types';\nimport { ConfigError } from './Errors';\nimport { getExpoSDKVersion } from './Project';\nimport { getDynamicConfig, getStaticConfig } from './getConfig';\nimport { getFullName } from './getFullName';\nimport { withConfigPlugins } from './plugins/withConfigPlugins';\nimport { withInternal } from './plugins/withInternal';\nimport { getRootPackageJsonPath } from './resolvePackageJson';\n\ntype SplitConfigs = { expo: ExpoConfig; mods: ModConfig };\n\n/**\n * If a config has an `expo` object then that will be used as the config.\n * This method reduces out other top level values if an `expo` object exists.\n *\n * @param config Input config object to reduce\n */\nfunction reduceExpoObject(config?: any): SplitConfigs {\n if (!config) return config === undefined ? null : config;\n\n const { mods, ...expo } = config.expo ?? config;\n\n return {\n expo,\n mods,\n };\n}\n\n/**\n * Get all platforms that a project is currently capable of running.\n *\n * @param projectRoot\n * @param exp\n */\nfunction getSupportedPlatforms(projectRoot: string): Platform[] {\n const platforms: Platform[] = [];\n if (resolveFrom.silent(projectRoot, 'react-native')) {\n platforms.push('ios', 'android');\n }\n if (resolveFrom.silent(projectRoot, 'react-native-web')) {\n platforms.push('web');\n }\n return platforms;\n}\n\n/**\n * Evaluate the config for an Expo project.\n * If a function is exported from the `app.config.js` then a partial config will be passed as an argument.\n * The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.\n *\n * If options.isPublicConfig is true, the Expo config will include only public-facing options (omitting private keys).\n * The resulting config should be suitable for hosting or embedding in a publicly readable location.\n *\n * **Example**\n * ```js\n * module.exports = function({ config }) {\n * // mutate the config before returning it.\n * config.slug = 'new slug'\n * return { expo: config };\n * }\n * ```\n *\n * **Supports**\n * - `app.config.ts`\n * - `app.config.js`\n * - `app.config.json`\n * - `app.json`\n *\n * @param projectRoot the root folder containing all of your application code\n * @param options enforce criteria for a project config\n */\nexport function getConfig(projectRoot: string, options: GetConfigOptions = {}): ProjectConfig {\n const paths = getConfigFilePaths(projectRoot);\n\n const rawStaticConfig = paths.staticConfigPath ? getStaticConfig(paths.staticConfigPath) : null;\n // For legacy reasons, always return an object.\n const rootConfig = (rawStaticConfig || {}) as AppJSONConfig;\n const staticConfig = reduceExpoObject(rawStaticConfig) || {};\n\n // Can only change the package.json location if an app.json or app.config.json exists\n const [packageJson, packageJsonPath] = getPackageJsonAndPath(projectRoot);\n\n function fillAndReturnConfig(config: SplitConfigs, dynamicConfigObjectType: string | null) {\n const configWithDefaultValues = {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: options.skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: config.mods,\n dynamicConfigObjectType,\n rootConfig,\n dynamicConfigPath: paths.dynamicConfigPath,\n staticConfigPath: paths.staticConfigPath,\n };\n\n if (options.isModdedConfig) {\n // @ts-ignore: Add the mods back to the object.\n configWithDefaultValues.exp.mods = config.mods ?? null;\n }\n\n // Apply static json plugins, should be done after _internal\n configWithDefaultValues.exp = withConfigPlugins(\n configWithDefaultValues.exp,\n !!options.skipPlugins\n );\n\n if (!options.isModdedConfig) {\n // @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated\n delete configWithDefaultValues.exp.mods;\n }\n\n if (options.isPublicConfig) {\n // Remove internal values with references to user's file paths from the public config.\n delete configWithDefaultValues.exp._internal;\n\n if (configWithDefaultValues.exp.hooks) {\n delete configWithDefaultValues.exp.hooks;\n }\n if (configWithDefaultValues.exp.ios?.config) {\n delete configWithDefaultValues.exp.ios.config;\n }\n if (configWithDefaultValues.exp.android?.config) {\n delete configWithDefaultValues.exp.android.config;\n }\n\n // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).\n // @ts-ignore: currentFullName not on type yet.\n configWithDefaultValues.exp.currentFullName = getFullName(configWithDefaultValues.exp);\n // @ts-ignore: originalFullName not on type yet.\n configWithDefaultValues.exp.originalFullName = getFullName(configWithDefaultValues.exp);\n\n delete configWithDefaultValues.exp.updates?.codeSigningCertificate;\n delete configWithDefaultValues.exp.updates?.codeSigningMetadata;\n }\n\n return configWithDefaultValues;\n }\n\n // Fill in the static config\n function getContextConfig(config: SplitConfigs) {\n return ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: true,\n paths,\n packageJsonPath,\n }).exp;\n }\n\n if (paths.dynamicConfigPath) {\n // No app.config.json or app.json but app.config.js\n const { exportedObjectType, config: rawDynamicConfig } = getDynamicConfig(\n paths.dynamicConfigPath,\n {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\n }\n );\n // Allow for the app.config.js to `export default null;`\n // Use `dynamicConfigPath` to detect if a dynamic config exists.\n const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};\n return fillAndReturnConfig(dynamicConfig, exportedObjectType);\n }\n\n // No app.config.js but json or no config\n return fillAndReturnConfig(staticConfig || {}, null);\n}\n\nexport function getPackageJson(projectRoot: string): PackageJSONConfig {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n return pkg;\n}\n\nfunction getPackageJsonAndPath(projectRoot: string): [PackageJSONConfig, string] {\n const packageJsonPath = getRootPackageJsonPath(projectRoot);\n return [JsonFile.read(packageJsonPath), packageJsonPath];\n}\n\nexport function readConfigJson(\n projectRoot: string,\n skipValidation: boolean = false,\n skipSDKVersionRequirement: boolean = false\n): ProjectConfig {\n const paths = getConfigFilePaths(projectRoot);\n\n const rawStaticConfig = paths.staticConfigPath ? getStaticConfig(paths.staticConfigPath) : null;\n\n const getConfigName = (): string => {\n if (paths.staticConfigPath) return ` \\`${path.basename(paths.staticConfigPath)}\\``;\n return '';\n };\n\n let outputRootConfig = rawStaticConfig as JSONObject | null;\n if (outputRootConfig === null || typeof outputRootConfig !== 'object') {\n if (skipValidation) {\n outputRootConfig = { expo: {} };\n } else {\n throw new ConfigError(\n `Project at path ${path.resolve(\n projectRoot\n )} does not contain a valid Expo config${getConfigName()}`,\n 'NOT_OBJECT'\n );\n }\n }\n let exp = outputRootConfig.expo as Partial<ExpoConfig>;\n if (exp === null || typeof exp !== 'object') {\n throw new ConfigError(\n `Property 'expo' in${getConfigName()} for project at path ${path.resolve(\n projectRoot\n )} is not an object. Please make sure${getConfigName()} includes a managed Expo app config like this: ${APP_JSON_EXAMPLE}`,\n 'NO_EXPO'\n );\n }\n\n exp = { ...exp };\n\n const [pkg, packageJsonPath] = getPackageJsonAndPath(projectRoot);\n\n return {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: null,\n dynamicConfigObjectType: null,\n rootConfig: { ...outputRootConfig } as AppJSONConfig,\n ...paths,\n };\n}\n\n/**\n * Get the static and dynamic config paths for a project. Also accounts for custom paths.\n *\n * @param projectRoot\n */\nexport function getConfigFilePaths(projectRoot: string): ConfigFilePaths {\n const customPaths = getCustomConfigFilePaths(projectRoot);\n if (customPaths) {\n return customPaths;\n }\n\n return {\n dynamicConfigPath: getDynamicConfigFilePath(projectRoot),\n staticConfigPath: getStaticConfigFilePath(projectRoot),\n };\n}\n\nfunction getCustomConfigFilePaths(projectRoot: string): ConfigFilePaths | null {\n if (!customConfigPaths[projectRoot]) {\n return null;\n }\n // If the user picks a custom config path, we will only use that and skip searching for a secondary config.\n if (isDynamicFilePath(customConfigPaths[projectRoot])) {\n return {\n dynamicConfigPath: customConfigPaths[projectRoot],\n staticConfigPath: null,\n };\n }\n // Anything that's not js or ts will be treated as json.\n return { staticConfigPath: customConfigPaths[projectRoot], dynamicConfigPath: null };\n}\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.ts', 'app.config.js']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.json', 'app.json']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n// TODO: This should account for dynamic configs\nexport function findConfigFile(\n projectRoot: string\n): { configPath: string; configName: string; configNamespace: 'expo' } {\n let configPath: string;\n // Check for a custom config path first.\n if (customConfigPaths[projectRoot]) {\n configPath = customConfigPaths[projectRoot];\n // We shouldn't verify if the file exists because\n // the user manually specified that this path should be used.\n return {\n configPath,\n configName: path.basename(configPath),\n configNamespace: 'expo',\n };\n } else {\n // app.config.json takes higher priority over app.json\n configPath = path.join(projectRoot, 'app.config.json');\n if (!fs.existsSync(configPath)) {\n configPath = path.join(projectRoot, 'app.json');\n }\n }\n\n return {\n configPath,\n configName: path.basename(configPath),\n configNamespace: 'expo',\n };\n}\n\n// TODO: deprecate\nexport function configFilename(projectRoot: string): string {\n return findConfigFile(projectRoot).configName;\n}\n\nexport async function readExpRcAsync(projectRoot: string): Promise<ExpRc> {\n const expRcPath = path.join(projectRoot, '.exprc');\n return await JsonFile.readAsync(expRcPath, { json5: true, cantReadFileDefault: {} });\n}\n\nconst customConfigPaths: { [projectRoot: string]: string } = {};\n\nexport function resetCustomConfigPaths(): void {\n for (const key of Object.keys(customConfigPaths)) {\n delete customConfigPaths[key];\n }\n}\n\nexport function setCustomConfigPath(projectRoot: string, configPath: string): void {\n customConfigPaths[projectRoot] = configPath;\n}\n\n/**\n * Attempt to modify an Expo project config.\n * This will only fully work if the project is using static configs only.\n * Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.\n * The potentially modified config object will be returned for testing purposes.\n *\n * @param projectRoot\n * @param modifications modifications to make to an existing config\n * @param readOptions options for reading the current config file\n * @param writeOptions If true, the static config file will not be rewritten\n */\nexport async function modifyConfigAsync(\n projectRoot: string,\n modifications: Partial<ExpoConfig>,\n readOptions: GetConfigOptions = {},\n writeOptions: WriteConfigOptions = {}\n): Promise<{\n type: 'success' | 'warn' | 'fail';\n message?: string;\n config: AppJSONConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n if (config.dynamicConfigPath) {\n // We cannot automatically write to a dynamic config.\n /* Currently we should just use the safest approach possible, informing the user that they'll need to manually modify their dynamic config.\n\n if (config.staticConfigPath) {\n // Both a dynamic and a static config exist.\n if (config.dynamicConfigObjectType === 'function') {\n // The dynamic config exports a function, this means it possibly extends the static config.\n } else {\n // Dynamic config ignores the static config, there isn't a reason to automatically write to it.\n // Instead we should warn the user to add values to their dynamic config.\n }\n }\n */\n return {\n type: 'warn',\n message: `Cannot automatically write to dynamic config at: ${path.relative(\n projectRoot,\n config.dynamicConfigPath\n )}`,\n config: null,\n };\n } else if (config.staticConfigPath) {\n // Static with no dynamic config, this means we can append to the config automatically.\n let outputConfig: AppJSONConfig;\n // If the config has an expo object (app.json) then append the options to that object.\n if (config.rootConfig.expo) {\n outputConfig = {\n ...config.rootConfig,\n expo: { ...config.rootConfig.expo, ...modifications },\n };\n } else {\n // Otherwise (app.config.json) just add the config modification to the top most level.\n outputConfig = { ...config.rootConfig, ...modifications };\n }\n if (!writeOptions.dryRun) {\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n }\n return { type: 'success', config: outputConfig };\n }\n\n return { type: 'fail', message: 'No config exists', config: null };\n}\n\nconst APP_JSON_EXAMPLE = JSON.stringify({\n expo: {\n name: 'My app',\n slug: 'my-app',\n sdkVersion: '...',\n },\n});\n\nfunction ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n paths,\n packageJsonPath,\n skipSDKVersionRequirement = false,\n}: {\n projectRoot: string;\n exp: Partial<ExpoConfig> | null;\n pkg: JSONObject;\n skipSDKVersionRequirement?: boolean;\n paths?: ConfigFilePaths;\n packageJsonPath?: string;\n}): { exp: ExpoConfig; pkg: PackageJSONConfig } {\n if (!exp) {\n exp = {};\n }\n exp = withInternal(exp as any, {\n projectRoot,\n ...(paths ?? {}),\n packageJsonPath,\n });\n // Defaults for package.json fields\n const pkgName = typeof pkg.name === 'string' ? pkg.name : path.basename(projectRoot);\n const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';\n\n const pkgWithDefaults = { ...pkg, name: pkgName, version: pkgVersion };\n\n // Defaults for app.json/app.config.js fields\n const name = exp.name ?? pkgName;\n const slug = exp.slug ?? slugify(name.toLowerCase());\n const version = exp.version ?? pkgVersion;\n let description = exp.description;\n if (!description && typeof pkg.description === 'string') {\n description = pkg.description;\n }\n\n const expWithDefaults = { ...exp, name, slug, version, description };\n\n let sdkVersion;\n try {\n sdkVersion = getExpoSDKVersion(projectRoot, expWithDefaults);\n } catch (error) {\n if (!skipSDKVersionRequirement) throw error;\n }\n\n let platforms = exp.platforms;\n if (!platforms) {\n platforms = getSupportedPlatforms(projectRoot);\n }\n\n return {\n exp: { ...expWithDefaults, sdkVersion, platforms },\n pkg: pkgWithDefaults,\n };\n}\n\nexport async function writeConfigJsonAsync(\n projectRoot: string,\n options: object\n): Promise<ProjectConfig> {\n const paths = getConfigFilePaths(projectRoot);\n let { exp, pkg, rootConfig, dynamicConfigObjectType } = readConfigJson(projectRoot);\n exp = { ...rootConfig.expo, ...options };\n rootConfig = { ...rootConfig, expo: exp };\n\n if (paths.staticConfigPath) {\n await JsonFile.writeAsync(paths.staticConfigPath, rootConfig, { json5: false });\n } else {\n console.log('Failed to write to config: ', options);\n }\n\n return {\n exp,\n pkg,\n rootConfig,\n dynamicConfigObjectType,\n ...paths,\n };\n}\nconst DEFAULT_BUILD_PATH = `web-build`;\n\nexport function getWebOutputPath(config: { [key: string]: any } = {}): string {\n if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {\n return process.env.WEBPACK_BUILD_OUTPUT_PATH;\n }\n const expo = config.expo || config || {};\n return expo?.web?.build?.output || DEFAULT_BUILD_PATH;\n}\n\nexport function getNameFromConfig(\n exp: Record<string, any> = {}\n): { appName?: string; webName?: string } {\n // For RN CLI support\n const appManifest = exp.expo || exp;\n const { web = {} } = appManifest;\n\n // rn-cli apps use a displayName value as well.\n const appName = exp.displayName || appManifest.displayName || appManifest.name;\n const webName = web.name || appName;\n\n return {\n appName,\n webName,\n };\n}\n\nexport function getDefaultTarget(\n projectRoot: string,\n exp?: Pick<ExpoConfig, 'sdkVersion'>\n): ProjectTarget {\n exp ??= getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // before SDK 37, always default to managed to preserve previous behavior\n if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && semver.lt(exp.sdkVersion, '37.0.0')) {\n return 'managed';\n }\n return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';\n}\n\nfunction isBareWorkflowProject(projectRoot: string): boolean {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n\n if (pkg.dependencies && pkg.dependencies.expokit) {\n return false;\n }\n\n const xcodeprojFiles = globSync('ios/**/*.xcodeproj', {\n absolute: true,\n cwd: projectRoot,\n });\n if (xcodeprojFiles.length) {\n return true;\n }\n const gradleFiles = globSync('android/**/*.gradle', {\n absolute: true,\n cwd: projectRoot,\n });\n if (gradleFiles.length) {\n return true;\n }\n\n return false;\n}\n\n/**\n * true if the file is .js or .ts\n *\n * @param filePath\n */\nfunction isDynamicFilePath(filePath: string): boolean {\n return !!filePath.match(/\\.[j|t]s$/);\n}\n\n/**\n * Return a useful name describing the project config.\n * - dynamic: app.config.js\n * - static: app.json\n * - custom path app config relative to root folder\n * - both: app.config.js or app.json\n */\nexport function getProjectConfigDescription(projectRoot: string): string {\n const paths = getConfigFilePaths(projectRoot);\n return getProjectConfigDescriptionWithPaths(projectRoot, paths);\n}\n\n/**\n * Returns a string describing the configurations used for the given project root.\n * Will return null if no config is found.\n *\n * @param projectRoot\n * @param projectConfig\n */\nexport function getProjectConfigDescriptionWithPaths(\n projectRoot: string,\n projectConfig: ConfigFilePaths\n): string {\n if (projectConfig.dynamicConfigPath) {\n const relativeDynamicConfigPath = path.relative(projectRoot, projectConfig.dynamicConfigPath);\n if (projectConfig.staticConfigPath) {\n return `${relativeDynamicConfigPath} or ${path.relative(\n projectRoot,\n projectConfig.staticConfigPath\n )}`;\n }\n return relativeDynamicConfigPath;\n } else if (projectConfig.staticConfigPath) {\n return path.relative(projectRoot, projectConfig.staticConfigPath);\n }\n // If a config doesn't exist, our tooling will generate a static app.json\n return 'app.json';\n}\n\nexport * from './Config.types';\n\nexport { isLegacyImportsEnabled } from './isLegacyImportsEnabled';\n"],"file":"Config.js"}
|
|
1
|
+
{"version":3,"file":"Config.js","names":["reduceExpoObject","config","undefined","mods","expo","getSupportedPlatforms","projectRoot","platforms","resolveFrom","silent","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","isModdedConfig","withConfigPlugins","skipPlugins","isPublicConfig","_internal","hooks","ios","android","currentFullName","getFullName","originalFullName","updates","codeSigningCertificate","codeSigningMetadata","getContextConfig","exportedObjectType","rawDynamicConfig","getDynamicConfig","dynamicConfig","getPackageJson","getRootPackageJsonPath","JsonFile","read","readConfigJson","skipValidation","getConfigName","path","basename","outputRootConfig","ConfigError","resolve","APP_JSON_EXAMPLE","customPaths","getCustomConfigFilePaths","getDynamicConfigFilePath","getStaticConfigFilePath","customConfigPaths","isDynamicFilePath","fileName","configPath","join","fs","existsSync","findConfigFile","configName","configNamespace","configFilename","readExpRcAsync","expRcPath","readAsync","json5","cantReadFileDefault","resetCustomConfigPaths","key","Object","keys","setCustomConfigPath","modifyConfigAsync","modifications","readOptions","writeOptions","type","message","relative","outputConfig","dryRun","writeAsync","JSON","stringify","name","slug","sdkVersion","withInternal","pkgName","pkgVersion","version","pkgWithDefaults","slugify","toLowerCase","description","expWithDefaults","getExpoSDKVersion","error","writeConfigJsonAsync","console","log","DEFAULT_BUILD_PATH","getWebOutputPath","process","env","WEBPACK_BUILD_OUTPUT_PATH","web","build","output","getNameFromConfig","appManifest","appName","displayName","webName","getDefaultTarget","semver","lt","isBareWorkflowProject","dependencies","expokit","xcodeprojFiles","globSync","absolute","cwd","length","gradleFiles","filePath","match","getProjectConfigDescription","getProjectConfigDescriptionWithPaths","projectConfig","relativeDynamicConfigPath"],"sources":["../src/Config.ts"],"sourcesContent":["import { ModConfig } from '@expo/config-plugins';\nimport JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\nimport slugify from 'slugify';\n\nimport {\n AppJSONConfig,\n ConfigFilePaths,\n ExpoConfig,\n ExpRc,\n GetConfigOptions,\n PackageJSONConfig,\n Platform,\n ProjectConfig,\n ProjectTarget,\n WriteConfigOptions,\n} from './Config.types';\nimport { ConfigError } from './Errors';\nimport { getExpoSDKVersion } from './Project';\nimport { getDynamicConfig, getStaticConfig } from './getConfig';\nimport { getFullName } from './getFullName';\nimport { withConfigPlugins } from './plugins/withConfigPlugins';\nimport { withInternal } from './plugins/withInternal';\nimport { getRootPackageJsonPath } from './resolvePackageJson';\n\ntype SplitConfigs = { expo: ExpoConfig; mods: ModConfig };\n\n/**\n * If a config has an `expo` object then that will be used as the config.\n * This method reduces out other top level values if an `expo` object exists.\n *\n * @param config Input config object to reduce\n */\nfunction reduceExpoObject(config?: any): SplitConfigs {\n if (!config) return config === undefined ? null : config;\n\n const { mods, ...expo } = config.expo ?? config;\n\n return {\n expo,\n mods,\n };\n}\n\n/**\n * Get all platforms that a project is currently capable of running.\n *\n * @param projectRoot\n * @param exp\n */\nfunction getSupportedPlatforms(projectRoot: string): Platform[] {\n const platforms: Platform[] = [];\n if (resolveFrom.silent(projectRoot, 'react-native')) {\n platforms.push('ios', 'android');\n }\n if (resolveFrom.silent(projectRoot, 'react-native-web')) {\n platforms.push('web');\n }\n return platforms;\n}\n\n/**\n * Evaluate the config for an Expo project.\n * If a function is exported from the `app.config.js` then a partial config will be passed as an argument.\n * The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.\n *\n * If options.isPublicConfig is true, the Expo config will include only public-facing options (omitting private keys).\n * The resulting config should be suitable for hosting or embedding in a publicly readable location.\n *\n * **Example**\n * ```js\n * module.exports = function({ config }) {\n * // mutate the config before returning it.\n * config.slug = 'new slug'\n * return { expo: config };\n * }\n * ```\n *\n * **Supports**\n * - `app.config.ts`\n * - `app.config.js`\n * - `app.config.json`\n * - `app.json`\n *\n * @param projectRoot the root folder containing all of your application code\n * @param options enforce criteria for a project config\n */\nexport function getConfig(projectRoot: string, options: GetConfigOptions = {}): ProjectConfig {\n const paths = getConfigFilePaths(projectRoot);\n\n const rawStaticConfig = paths.staticConfigPath ? getStaticConfig(paths.staticConfigPath) : null;\n // For legacy reasons, always return an object.\n const rootConfig = (rawStaticConfig || {}) as AppJSONConfig;\n const staticConfig = reduceExpoObject(rawStaticConfig) || {};\n\n // Can only change the package.json location if an app.json or app.config.json exists\n const [packageJson, packageJsonPath] = getPackageJsonAndPath(projectRoot);\n\n function fillAndReturnConfig(config: SplitConfigs, dynamicConfigObjectType: string | null) {\n const configWithDefaultValues = {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: options.skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: config.mods,\n dynamicConfigObjectType,\n rootConfig,\n dynamicConfigPath: paths.dynamicConfigPath,\n staticConfigPath: paths.staticConfigPath,\n };\n\n if (options.isModdedConfig) {\n // @ts-ignore: Add the mods back to the object.\n configWithDefaultValues.exp.mods = config.mods ?? null;\n }\n\n // Apply static json plugins, should be done after _internal\n configWithDefaultValues.exp = withConfigPlugins(\n configWithDefaultValues.exp,\n !!options.skipPlugins\n );\n\n if (!options.isModdedConfig) {\n // @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated\n delete configWithDefaultValues.exp.mods;\n }\n\n if (options.isPublicConfig) {\n // Remove internal values with references to user's file paths from the public config.\n delete configWithDefaultValues.exp._internal;\n\n if (configWithDefaultValues.exp.hooks) {\n delete configWithDefaultValues.exp.hooks;\n }\n if (configWithDefaultValues.exp.ios?.config) {\n delete configWithDefaultValues.exp.ios.config;\n }\n if (configWithDefaultValues.exp.android?.config) {\n delete configWithDefaultValues.exp.android.config;\n }\n\n // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).\n // @ts-ignore: currentFullName not on type yet.\n configWithDefaultValues.exp.currentFullName = getFullName(configWithDefaultValues.exp);\n // @ts-ignore: originalFullName not on type yet.\n configWithDefaultValues.exp.originalFullName = getFullName(configWithDefaultValues.exp);\n\n delete configWithDefaultValues.exp.updates?.codeSigningCertificate;\n delete configWithDefaultValues.exp.updates?.codeSigningMetadata;\n }\n\n return configWithDefaultValues;\n }\n\n // Fill in the static config\n function getContextConfig(config: SplitConfigs) {\n return ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: true,\n paths,\n packageJsonPath,\n }).exp;\n }\n\n if (paths.dynamicConfigPath) {\n // No app.config.json or app.json but app.config.js\n const { exportedObjectType, config: rawDynamicConfig } = getDynamicConfig(\n paths.dynamicConfigPath,\n {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\n }\n );\n // Allow for the app.config.js to `export default null;`\n // Use `dynamicConfigPath` to detect if a dynamic config exists.\n const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};\n return fillAndReturnConfig(dynamicConfig, exportedObjectType);\n }\n\n // No app.config.js but json or no config\n return fillAndReturnConfig(staticConfig || {}, null);\n}\n\nexport function getPackageJson(projectRoot: string): PackageJSONConfig {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n return pkg;\n}\n\nfunction getPackageJsonAndPath(projectRoot: string): [PackageJSONConfig, string] {\n const packageJsonPath = getRootPackageJsonPath(projectRoot);\n return [JsonFile.read(packageJsonPath), packageJsonPath];\n}\n\nexport function readConfigJson(\n projectRoot: string,\n skipValidation: boolean = false,\n skipSDKVersionRequirement: boolean = false\n): ProjectConfig {\n const paths = getConfigFilePaths(projectRoot);\n\n const rawStaticConfig = paths.staticConfigPath ? getStaticConfig(paths.staticConfigPath) : null;\n\n const getConfigName = (): string => {\n if (paths.staticConfigPath) return ` \\`${path.basename(paths.staticConfigPath)}\\``;\n return '';\n };\n\n let outputRootConfig = rawStaticConfig as JSONObject | null;\n if (outputRootConfig === null || typeof outputRootConfig !== 'object') {\n if (skipValidation) {\n outputRootConfig = { expo: {} };\n } else {\n throw new ConfigError(\n `Project at path ${path.resolve(\n projectRoot\n )} does not contain a valid Expo config${getConfigName()}`,\n 'NOT_OBJECT'\n );\n }\n }\n let exp = outputRootConfig.expo as Partial<ExpoConfig>;\n if (exp === null || typeof exp !== 'object') {\n throw new ConfigError(\n `Property 'expo' in${getConfigName()} for project at path ${path.resolve(\n projectRoot\n )} is not an object. Please make sure${getConfigName()} includes a managed Expo app config like this: ${APP_JSON_EXAMPLE}`,\n 'NO_EXPO'\n );\n }\n\n exp = { ...exp };\n\n const [pkg, packageJsonPath] = getPackageJsonAndPath(projectRoot);\n\n return {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: null,\n dynamicConfigObjectType: null,\n rootConfig: { ...outputRootConfig } as AppJSONConfig,\n ...paths,\n };\n}\n\n/**\n * Get the static and dynamic config paths for a project. Also accounts for custom paths.\n *\n * @param projectRoot\n */\nexport function getConfigFilePaths(projectRoot: string): ConfigFilePaths {\n const customPaths = getCustomConfigFilePaths(projectRoot);\n if (customPaths) {\n return customPaths;\n }\n\n return {\n dynamicConfigPath: getDynamicConfigFilePath(projectRoot),\n staticConfigPath: getStaticConfigFilePath(projectRoot),\n };\n}\n\nfunction getCustomConfigFilePaths(projectRoot: string): ConfigFilePaths | null {\n if (!customConfigPaths[projectRoot]) {\n return null;\n }\n // If the user picks a custom config path, we will only use that and skip searching for a secondary config.\n if (isDynamicFilePath(customConfigPaths[projectRoot])) {\n return {\n dynamicConfigPath: customConfigPaths[projectRoot],\n staticConfigPath: null,\n };\n }\n // Anything that's not js or ts will be treated as json.\n return { staticConfigPath: customConfigPaths[projectRoot], dynamicConfigPath: null };\n}\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.ts', 'app.config.js']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.json', 'app.json']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n// TODO: This should account for dynamic configs\nexport function findConfigFile(projectRoot: string): {\n configPath: string;\n configName: string;\n configNamespace: 'expo';\n} {\n let configPath: string;\n // Check for a custom config path first.\n if (customConfigPaths[projectRoot]) {\n configPath = customConfigPaths[projectRoot];\n // We shouldn't verify if the file exists because\n // the user manually specified that this path should be used.\n return {\n configPath,\n configName: path.basename(configPath),\n configNamespace: 'expo',\n };\n } else {\n // app.config.json takes higher priority over app.json\n configPath = path.join(projectRoot, 'app.config.json');\n if (!fs.existsSync(configPath)) {\n configPath = path.join(projectRoot, 'app.json');\n }\n }\n\n return {\n configPath,\n configName: path.basename(configPath),\n configNamespace: 'expo',\n };\n}\n\n// TODO: deprecate\nexport function configFilename(projectRoot: string): string {\n return findConfigFile(projectRoot).configName;\n}\n\nexport async function readExpRcAsync(projectRoot: string): Promise<ExpRc> {\n const expRcPath = path.join(projectRoot, '.exprc');\n return await JsonFile.readAsync(expRcPath, { json5: true, cantReadFileDefault: {} });\n}\n\nconst customConfigPaths: { [projectRoot: string]: string } = {};\n\nexport function resetCustomConfigPaths(): void {\n for (const key of Object.keys(customConfigPaths)) {\n delete customConfigPaths[key];\n }\n}\n\nexport function setCustomConfigPath(projectRoot: string, configPath: string): void {\n customConfigPaths[projectRoot] = configPath;\n}\n\n/**\n * Attempt to modify an Expo project config.\n * This will only fully work if the project is using static configs only.\n * Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.\n * The potentially modified config object will be returned for testing purposes.\n *\n * @param projectRoot\n * @param modifications modifications to make to an existing config\n * @param readOptions options for reading the current config file\n * @param writeOptions If true, the static config file will not be rewritten\n */\nexport async function modifyConfigAsync(\n projectRoot: string,\n modifications: Partial<ExpoConfig>,\n readOptions: GetConfigOptions = {},\n writeOptions: WriteConfigOptions = {}\n): Promise<{\n type: 'success' | 'warn' | 'fail';\n message?: string;\n config: AppJSONConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n if (config.dynamicConfigPath) {\n // We cannot automatically write to a dynamic config.\n /* Currently we should just use the safest approach possible, informing the user that they'll need to manually modify their dynamic config.\n\n if (config.staticConfigPath) {\n // Both a dynamic and a static config exist.\n if (config.dynamicConfigObjectType === 'function') {\n // The dynamic config exports a function, this means it possibly extends the static config.\n } else {\n // Dynamic config ignores the static config, there isn't a reason to automatically write to it.\n // Instead we should warn the user to add values to their dynamic config.\n }\n }\n */\n return {\n type: 'warn',\n message: `Cannot automatically write to dynamic config at: ${path.relative(\n projectRoot,\n config.dynamicConfigPath\n )}`,\n config: null,\n };\n } else if (config.staticConfigPath) {\n // Static with no dynamic config, this means we can append to the config automatically.\n let outputConfig: AppJSONConfig;\n // If the config has an expo object (app.json) then append the options to that object.\n if (config.rootConfig.expo) {\n outputConfig = {\n ...config.rootConfig,\n expo: { ...config.rootConfig.expo, ...modifications },\n };\n } else {\n // Otherwise (app.config.json) just add the config modification to the top most level.\n outputConfig = { ...config.rootConfig, ...modifications };\n }\n if (!writeOptions.dryRun) {\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n }\n return { type: 'success', config: outputConfig };\n }\n\n return { type: 'fail', message: 'No config exists', config: null };\n}\n\nconst APP_JSON_EXAMPLE = JSON.stringify({\n expo: {\n name: 'My app',\n slug: 'my-app',\n sdkVersion: '...',\n },\n});\n\nfunction ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n paths,\n packageJsonPath,\n skipSDKVersionRequirement = false,\n}: {\n projectRoot: string;\n exp: Partial<ExpoConfig> | null;\n pkg: JSONObject;\n skipSDKVersionRequirement?: boolean;\n paths?: ConfigFilePaths;\n packageJsonPath?: string;\n}): { exp: ExpoConfig; pkg: PackageJSONConfig } {\n if (!exp) {\n exp = {};\n }\n exp = withInternal(exp as any, {\n projectRoot,\n ...(paths ?? {}),\n packageJsonPath,\n });\n // Defaults for package.json fields\n const pkgName = typeof pkg.name === 'string' ? pkg.name : path.basename(projectRoot);\n const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';\n\n const pkgWithDefaults = { ...pkg, name: pkgName, version: pkgVersion };\n\n // Defaults for app.json/app.config.js fields\n const name = exp.name ?? pkgName;\n const slug = exp.slug ?? slugify(name.toLowerCase());\n const version = exp.version ?? pkgVersion;\n let description = exp.description;\n if (!description && typeof pkg.description === 'string') {\n description = pkg.description;\n }\n\n const expWithDefaults = { ...exp, name, slug, version, description };\n\n let sdkVersion;\n try {\n sdkVersion = getExpoSDKVersion(projectRoot, expWithDefaults);\n } catch (error) {\n if (!skipSDKVersionRequirement) throw error;\n }\n\n let platforms = exp.platforms;\n if (!platforms) {\n platforms = getSupportedPlatforms(projectRoot);\n }\n\n return {\n exp: { ...expWithDefaults, sdkVersion, platforms },\n pkg: pkgWithDefaults,\n };\n}\n\nexport async function writeConfigJsonAsync(\n projectRoot: string,\n options: object\n): Promise<ProjectConfig> {\n const paths = getConfigFilePaths(projectRoot);\n let { exp, pkg, rootConfig, dynamicConfigObjectType } = readConfigJson(projectRoot);\n exp = { ...rootConfig.expo, ...options };\n rootConfig = { ...rootConfig, expo: exp };\n\n if (paths.staticConfigPath) {\n await JsonFile.writeAsync(paths.staticConfigPath, rootConfig, { json5: false });\n } else {\n console.log('Failed to write to config: ', options);\n }\n\n return {\n exp,\n pkg,\n rootConfig,\n dynamicConfigObjectType,\n ...paths,\n };\n}\nconst DEFAULT_BUILD_PATH = `web-build`;\n\nexport function getWebOutputPath(config: { [key: string]: any } = {}): string {\n if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {\n return process.env.WEBPACK_BUILD_OUTPUT_PATH;\n }\n const expo = config.expo || config || {};\n return expo?.web?.build?.output || DEFAULT_BUILD_PATH;\n}\n\nexport function getNameFromConfig(exp: Record<string, any> = {}): {\n appName?: string;\n webName?: string;\n} {\n // For RN CLI support\n const appManifest = exp.expo || exp;\n const { web = {} } = appManifest;\n\n // rn-cli apps use a displayName value as well.\n const appName = exp.displayName || appManifest.displayName || appManifest.name;\n const webName = web.name || appName;\n\n return {\n appName,\n webName,\n };\n}\n\nexport function getDefaultTarget(\n projectRoot: string,\n exp?: Pick<ExpoConfig, 'sdkVersion'>\n): ProjectTarget {\n exp ??= getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // before SDK 37, always default to managed to preserve previous behavior\n if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && semver.lt(exp.sdkVersion, '37.0.0')) {\n return 'managed';\n }\n return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';\n}\n\nfunction isBareWorkflowProject(projectRoot: string): boolean {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n\n if (pkg.dependencies && pkg.dependencies.expokit) {\n return false;\n }\n\n const xcodeprojFiles = globSync('ios/**/*.xcodeproj', {\n absolute: true,\n cwd: projectRoot,\n });\n if (xcodeprojFiles.length) {\n return true;\n }\n const gradleFiles = globSync('android/**/*.gradle', {\n absolute: true,\n cwd: projectRoot,\n });\n if (gradleFiles.length) {\n return true;\n }\n\n return false;\n}\n\n/**\n * true if the file is .js or .ts\n *\n * @param filePath\n */\nfunction isDynamicFilePath(filePath: string): boolean {\n return !!filePath.match(/\\.[j|t]s$/);\n}\n\n/**\n * Return a useful name describing the project config.\n * - dynamic: app.config.js\n * - static: app.json\n * - custom path app config relative to root folder\n * - both: app.config.js or app.json\n */\nexport function getProjectConfigDescription(projectRoot: string): string {\n const paths = getConfigFilePaths(projectRoot);\n return getProjectConfigDescriptionWithPaths(projectRoot, paths);\n}\n\n/**\n * Returns a string describing the configurations used for the given project root.\n * Will return null if no config is found.\n *\n * @param projectRoot\n * @param projectConfig\n */\nexport function getProjectConfigDescriptionWithPaths(\n projectRoot: string,\n projectConfig: ConfigFilePaths\n): string {\n if (projectConfig.dynamicConfigPath) {\n const relativeDynamicConfigPath = path.relative(projectRoot, projectConfig.dynamicConfigPath);\n if (projectConfig.staticConfigPath) {\n return `${relativeDynamicConfigPath} or ${path.relative(\n projectRoot,\n projectConfig.staticConfigPath\n )}`;\n }\n return relativeDynamicConfigPath;\n } else if (projectConfig.staticConfigPath) {\n return path.relative(projectRoot, projectConfig.staticConfigPath);\n }\n // If a config doesn't exist, our tooling will generate a static app.json\n return 'app.json';\n}\n\nexport * from './Config.types';\n\nexport { isLegacyImportsEnabled } from './isLegacyImportsEnabled';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA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W,GAAG,IAAAJ,YAAA,EAAS,qBAAT,EAAgC;IAClDC,QAAQ,EAAE,IADwC;IAElDC,GAAG,EAAErI;EAF6C,CAAhC,CAApB;;EAIA,IAAIuI,WAAW,CAACD,MAAhB,EAAwB;IACtB,OAAO,IAAP;EACD;;EAED,OAAO,KAAP;AACD;AAED;AACA;AACA;AACA;AACA;;;AACA,SAASxE,iBAAT,CAA2B0E,QAA3B,EAAsD;EACpD,OAAO,CAAC,CAACA,QAAQ,CAACC,KAAT,CAAe,WAAf,CAAT;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASC,2BAAT,CAAqC1I,WAArC,EAAkE;EACvE,MAAMO,KAAK,GAAGC,kBAAkB,CAACR,WAAD,CAAhC;EACA,OAAO2I,oCAAoC,CAAC3I,WAAD,EAAcO,KAAd,CAA3C;AACD;AAED;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASoI,oCAAT,CACL3I,WADK,EAEL4I,aAFK,EAGG;EACR,IAAIA,aAAa,CAACpH,iBAAlB,EAAqC;IACnC,MAAMqH,yBAAyB,GAAG1F,eAAA,CAAKqC,QAAL,CAAcxF,WAAd,EAA2B4I,aAAa,CAACpH,iBAAzC,CAAlC;;IACA,IAAIoH,aAAa,CAAClI,gBAAlB,EAAoC;MAClC,OAAQ,GAAEmI,yBAA0B,OAAM1F,eAAA,CAAKqC,QAAL,CACxCxF,WADwC,EAExC4I,aAAa,CAAClI,gBAF0B,CAGxC,EAHF;IAID;;IACD,OAAOmI,yBAAP;EACD,CATD,MASO,IAAID,aAAa,CAAClI,gBAAlB,EAAoC;IACzC,OAAOyC,eAAA,CAAKqC,QAAL,CAAcxF,WAAd,EAA2B4I,aAAa,CAAClI,gBAAzC,CAAP;EACD,CAZO,CAaR;;;EACA,OAAO,UAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Config.types.js","names":["ProjectPrivacy"],"sources":["../src/Config.types.ts"],"sourcesContent":["import { ModConfig } from '@expo/config-plugins';\nimport { ExpoConfig } from '@expo/config-types';\n\nexport { ExpoConfig };\n\nexport type PackageJSONConfig = { dependencies?: Record<string, string>; [key: string]: any };\n\nexport interface ProjectConfig {\n /**\n * Fully evaluated Expo config with default values injected.\n */\n exp: ExpoConfig;\n /**\n * Dynamic config for processing native files during the generation process.\n */\n mods?: ModConfig | null;\n /**\n * Project package.json object with default values injected.\n */\n pkg: PackageJSONConfig;\n /**\n * Unaltered static config (app.config.json, app.json, or custom json config).\n * For legacy, an empty object will be returned even if no static config exists.\n */\n rootConfig: AppJSONConfig;\n /**\n * Path to the static json config file if it exists.\n * If a project has an app.config.js and an app.json then app.json will be returned.\n * If a project has an app.config.json and an app.json then app.config.json will be returned.\n * Returns null if no static config file exists.\n */\n staticConfigPath: string | null;\n /**\n * Path to an app.config.js or app.config.ts.\n * Returns null if no dynamic config file exists.\n */\n dynamicConfigPath: string | null;\n\n /**\n * Returns the type of the value exported from the dynamic config.\n * This can be used to determine if the dynamic config is potentially extending a static config when (v === 'function').\n * Returns null if no dynamic config file exists.\n */\n dynamicConfigObjectType: string | null;\n}\nexport type AppJSONConfig = { expo: ExpoConfig; [key: string]: any };\nexport type BareAppConfig = { name: string; [key: string]: any };\nexport type HookArguments = {\n config: any;\n url: any;\n exp: ExpoConfig;\n iosBundle: string | Uint8Array;\n iosSourceMap: string | null;\n iosManifest: any;\n iosManifestUrl: string;\n androidBundle: string | Uint8Array;\n androidSourceMap: string | null;\n androidManifest: any;\n androidManifestUrl: string;\n projectRoot: string;\n log: (msg: any) => void;\n};\n\nexport type ExpoGoConfig = {\n mainModuleName: string;\n // A string that flipper checks to determine if Metro bundler is running\n // by adding it to the manifest, we can trick Flipper into working properly.\n // https://github.com/facebook/flipper/blob/9ca8bee208b7bfe2b8c0dab8eb4b79688a0c84bc/desktop/app/src/dispatcher/metroDevice.tsx#L37\n __flipperHack: 'React Native packager is running';\n debuggerHost: string;\n logUrl: string;\n developer: {\n tool: string | null;\n projectRoot?: string;\n };\n packagerOpts: {\n [key: string]: any;\n };\n};\n\nexport type EASConfig = {\n projectId?: string;\n};\n\nexport type ClientScopingConfig = {\n scopeKey?: string;\n};\n\nexport type ExpoClientConfig = ExpoConfig & {\n id?: string;\n releaseId?: string;\n revisionId?: string;\n bundleUrl?: string;\n hostUri?: string;\n publishedTime?: string;\n};\n\nexport type ExpoAppManifest = ExpoClientConfig &\n EASConfig &\n Partial<ExpoGoConfig> & {\n sdkVersion: string;\n bundledAssets?: string[];\n isKernel?: boolean;\n kernel?: { androidManifestPath?: string; iosManifestPath?: string };\n assetUrlOverride?: string;\n commitTime?: string;\n env?: Record<string, any>;\n };\n\nexport interface ExpoUpdatesManifestAsset {\n url: string;\n key: string;\n contentType: string;\n hash?: string;\n}\n\nexport interface ExpoUpdatesManifest {\n id: string;\n createdAt: string;\n runtimeVersion: string;\n launchAsset: ExpoUpdatesManifestAsset;\n assets: ExpoUpdatesManifestAsset[];\n metadata: { [key: string]: string };\n extra: ClientScopingConfig & {\n expoClient?: ExpoClientConfig;\n expoGo?: ExpoGoConfig;\n eas?: EASConfig;\n };\n}\n\nexport type Hook = {\n file: string;\n config: any;\n};\n\nexport type HookType = 'postPublish' | 'postExport';\n\nexport enum ProjectPrivacy {\n PUBLIC = 'public',\n UNLISTED = 'unlisted',\n}\n\nexport type ExpRc = { [key: string]: any };\nexport type Platform = 'android' | 'ios' | 'web';\nexport type ProjectTarget = 'managed' | 'bare';\n\nexport type ConfigErrorCode =\n | 'NO_APP_JSON'\n | 'NOT_OBJECT'\n | 'NO_EXPO'\n | 'MODULE_NOT_FOUND'\n | 'INVALID_MODE'\n | 'INVALID_FORMAT'\n | 'INVALID_PLUGIN'\n | 'INVALID_CONFIG';\n\nexport type ConfigContext = {\n projectRoot: string;\n /**\n * The static config path either app.json, app.config.json, or a custom user-defined config.\n */\n staticConfigPath: string | null;\n packageJsonPath: string | null;\n config: Partial<ExpoConfig>;\n};\n\nexport type GetConfigOptions = {\n isPublicConfig?: boolean;\n /**\n * Should the config `mods` be preserved in the config? Used for compiling mods in the eject command.\n *\n * @default false\n */\n isModdedConfig?: boolean;\n skipSDKVersionRequirement?: boolean;\n /**\n * Dangerously skip resolving plugins.\n */\n skipPlugins?: boolean;\n strict?: boolean;\n};\n\nexport type WriteConfigOptions = { dryRun?: boolean };\n\nexport type ConfigFilePaths = { staticConfigPath: string | null; dynamicConfigPath: string | null };\n"],"mappings":";;;;;;;;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;IAwIYA,c;;;WAAAA,c;EAAAA,c;EAAAA,c;GAAAA,c,8BAAAA,c"}
|
package/build/Errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Errors.js","names":["ConfigError","Error","constructor","message","code","cause","name"],"sources":["../src/Errors.ts"],"sourcesContent":["import { ConfigErrorCode } from './Config.types';\n\n/**\n * Based on `JsonFileError` from `@expo/json-file`\n */\nexport class ConfigError extends Error {\n readonly name = 'ConfigError';\n readonly isConfigError = true;\n\n constructor(message: string, public code: ConfigErrorCode, public cause?: Error) {\n super(cause ? `${message}\\n└─ Cause: ${cause.name}: ${cause.message}` : message);\n }\n}\n"],"mappings":";;;;;;;;;AAEA;AACA;AACA;AACO,MAAMA,WAAN,SAA0BC,KAA1B,CAAgC;EAIrCC,WAAW,CAACC,OAAD,EAAyBC,IAAzB,EAAuDC,KAAvD,EAAsE;IAC/E,MAAMA,KAAK,GAAI,GAAEF,OAAQ,eAAcE,KAAK,CAACC,IAAK,KAAID,KAAK,CAACF,OAAQ,EAAzD,GAA6DA,OAAxE;IAD+E,KAA7CC,IAA6C,GAA7CA,IAA6C;IAAA,KAAfC,KAAe,GAAfA,KAAe;;IAAA,8BAHjE,aAGiE;;IAAA,uCAFxD,IAEwD;EAEhF;;AANoC"}
|
package/build/Project.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Project.js","names":["getExpoSDKVersion","projectRoot","exp","sdkVersion","packageJsonPath","resolveFrom","silent","expoPackageJson","JsonFile","read","json5","version","packageVersion","majorVersion","split","shift","ConfigError"],"sources":["../src/Project.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\n\nimport { ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\n\nexport function getExpoSDKVersion(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'>\n): string {\n if (exp?.sdkVersion) {\n return exp.sdkVersion;\n }\n const packageJsonPath = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (packageJsonPath) {\n const expoPackageJson = JsonFile.read(packageJsonPath, { json5: true });\n const { version: packageVersion } = expoPackageJson;\n if (typeof packageVersion === 'string') {\n const majorVersion = packageVersion.split('.').shift();\n return `${majorVersion}.0.0`;\n }\n }\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` is not installed. Please install it with \\`yarn add expo\\` and try again.`,\n 'MODULE_NOT_FOUND'\n );\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEO,SAASA,iBAAT,CACLC,WADK,EAELC,GAFK,EAGG;EACR,IAAIA,GAAJ,aAAIA,GAAJ,eAAIA,GAAG,CAAEC,UAAT,EAAqB;IACnB,OAAOD,GAAG,CAACC,UAAX;EACD;;EACD,MAAMC,eAAe,GAAGC,sBAAA,CAAYC,MAAZ,CAAmBL,WAAnB,EAAgC,mBAAhC,CAAxB;;EACA,IAAIG,eAAJ,EAAqB;IACnB,MAAMG,eAAe,GAAGC,mBAAA,CAASC,IAAT,CAAcL,eAAd,EAA+B;MAAEM,KAAK,EAAE;IAAT,CAA/B,CAAxB;;IACA,MAAM;MAAEC,OAAO,EAAEC;IAAX,IAA8BL,eAApC;;IACA,IAAI,OAAOK,cAAP,KAA0B,QAA9B,EAAwC;MACtC,MAAMC,YAAY,GAAGD,cAAc,CAACE,KAAf,CAAqB,GAArB,EAA0BC,KAA1B,EAArB;MACA,OAAQ,GAAEF,YAAa,MAAvB;IACD;EACF;;EACD,MAAM,KAAIG,qBAAJ,EACH,mKADG,EAEJ,kBAFI,CAAN;AAID"}
|
package/build/Serialize.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"Serialize.js","names":["serializeAndEvaluate","val","includes","Array","isArray","map","output","property","hasOwnProperty","ConfigError","serializeSkippingMods","serializeAndEvaluatePlugin","name","serializeAfterStaticPlugins"],"sources":["../src/Serialize.ts"],"sourcesContent":["import { ConfigError } from './Errors';\n\nexport function serializeAndEvaluate(val: any): any {\n if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {\n return val;\n } else if (typeof val === 'function') {\n // TODO: Bacon: Should we support async methods?\n return val();\n } else if (Array.isArray(val)) {\n return val.map(serializeAndEvaluate);\n } else if (typeof val === 'object') {\n const output: { [key: string]: any } = {};\n for (const property in val) {\n if (val.hasOwnProperty(property)) {\n output[property] = serializeAndEvaluate(val[property]);\n }\n }\n return output;\n }\n // symbol\n throw new ConfigError(`Expo config doesn't support \\`Symbols\\`: ${val}`, 'INVALID_CONFIG');\n}\n\nexport function serializeSkippingMods(val: any): any {\n if (typeof val === 'object' && !Array.isArray(val)) {\n const output: { [key: string]: any } = {};\n for (const property in val) {\n if (val.hasOwnProperty(property)) {\n if (property === 'mods' || property === 'plugins') {\n // Don't serialize mods or plugins\n output[property] = val[property];\n } else {\n output[property] = serializeAndEvaluate(val[property]);\n }\n }\n }\n return output;\n }\n return serializeAndEvaluate(val);\n}\n\nfunction serializeAndEvaluatePlugin(val: any): any {\n if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {\n return val;\n } else if (typeof val === 'function') {\n return val.name ?? 'withAnonymous';\n } else if (Array.isArray(val)) {\n return val.map(serializeAndEvaluatePlugin);\n } else if (typeof val === 'object') {\n const output: { [key: string]: any } = {};\n for (const property in val) {\n if (val.hasOwnProperty(property)) {\n output[property] = serializeAndEvaluatePlugin(val[property]);\n }\n }\n return output;\n }\n // symbol\n throw new ConfigError(`Expo config doesn't support \\`Symbols\\`: ${val}`, 'INVALID_CONFIG');\n}\n\nexport function serializeAfterStaticPlugins(val: any): any {\n if (typeof val === 'object' && !Array.isArray(val)) {\n const output: { [key: string]: any } = {};\n for (const property in val) {\n if (val.hasOwnProperty(property)) {\n if (property === 'mods') {\n // Don't serialize mods\n output[property] = val[property];\n } else if (property === 'plugins' && Array.isArray(val[property])) {\n // Serialize the mods by removing any config plugins\n output[property] = val[property].map(serializeAndEvaluatePlugin);\n } else {\n output[property] = serializeAndEvaluate(val[property]);\n }\n }\n }\n return output;\n }\n return serializeAndEvaluate(val);\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEO,SAASA,oBAAT,CAA8BC,GAA9B,EAA6C;EAClD,IAAI,CAAC,WAAD,EAAc,QAAd,EAAwB,SAAxB,EAAmC,QAAnC,EAA6C,QAA7C,EAAuDC,QAAvD,CAAgE,OAAOD,GAAvE,CAAJ,EAAiF;IAC/E,OAAOA,GAAP;EACD,CAFD,MAEO,IAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;IACpC;IACA,OAAOA,GAAG,EAAV;EACD,CAHM,MAGA,IAAIE,KAAK,CAACC,OAAN,CAAcH,GAAd,CAAJ,EAAwB;IAC7B,OAAOA,GAAG,CAACI,GAAJ,CAAQL,oBAAR,CAAP;EACD,CAFM,MAEA,IAAI,OAAOC,GAAP,KAAe,QAAnB,EAA6B;IAClC,MAAMK,MAA8B,GAAG,EAAvC;;IACA,KAAK,MAAMC,QAAX,IAAuBN,GAAvB,EAA4B;MAC1B,IAAIA,GA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F;;IACD,OAAOD,MAAP;EACD;;EACD,OAAON,oBAAoB,CAACC,GAAD,CAA3B;AACD"}
|
package/build/evalConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"evalConfig.js","names":["evalConfig","configFile","request","contents","readFileSync","result","code","transform","filePath","transforms","requireString","error","location","extractLocationFromSyntaxError","codeFrameColumns","require","codeFrame","start","loc","highlightCode","message","importantStack","extractImportantStackFromNodeError","resolveConfigExport","line","lineNumber","column","columnNumber","isSyntaxError","traces","stack","split","filter","startsWith","length","pop","join","SyntaxError","constructor","name","default","exportedObjectType","Promise","ConfigError","expo","serializeSkippingMods","config"],"sources":["../src/evalConfig.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport requireString from 'require-from-string';\nimport { transform } from 'sucrase';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { serializeSkippingMods } from './Serialize';\n\ntype RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;\n\nexport type DynamicConfigResults = { config: RawDynamicConfig; exportedObjectType: string };\n\n/**\n * Transpile and evaluate the dynamic config object.\n * This method is shared between the standard reading method in getConfig, and the headless script.\n *\n * @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.\n * @returns the serialized and evaluated config along with the exported object type (object or function).\n */\nexport function evalConfig(\n configFile: string,\n request: ConfigContext | null\n): DynamicConfigResults {\n const contents = readFileSync(configFile, 'utf8');\n let result: any;\n try {\n const { code } = transform(contents, {\n filePath: configFile,\n transforms: ['typescript', 'imports'],\n });\n\n result = requireString(code, configFile);\n } catch (error: any) {\n const location = extractLocationFromSyntaxError(error);\n\n // Apply a code frame preview to the error if possible, sucrase doesn't do this by default.\n if (location) {\n const { codeFrameColumns } = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(contents, { start: error.loc }, { highlightCode: true });\n error.codeFrame = codeFrame;\n error.message += `\\n${codeFrame}`;\n } else {\n const importantStack = extractImportantStackFromNodeError(error);\n\n if (importantStack) {\n error.message += `\\n${importantStack}`;\n }\n }\n throw error;\n }\n return resolveConfigExport(result, configFile, request);\n}\n\nfunction extractLocationFromSyntaxError(\n error: Error | any\n): { line: number; column?: number } | null {\n // sucrase provides the `loc` object\n if (error.loc) {\n return error.loc;\n }\n\n // `SyntaxError`s provide the `lineNumber` and `columnNumber` properties\n if ('lineNumber' in error && 'columnNumber' in error) {\n return { line: error.lineNumber, column: error.columnNumber };\n }\n\n return null;\n}\n\n// These kinda errors often come from syntax errors in files that were imported by the main file.\n// An example is a module that includes an import statement.\nfunction extractImportantStackFromNodeError(error: any): string | null {\n if (isSyntaxError(error)) {\n const traces = error.stack?.split('\\n').filter((line) => !line.startsWith(' at '));\n if (!traces) return null;\n\n // Remove redundant line\n if (traces[traces.length - 1].startsWith('SyntaxError:')) {\n traces.pop();\n }\n return traces.join('\\n');\n }\n return null;\n}\n\nfunction isSyntaxError(error: any): error is SyntaxError {\n return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param result\n * @param configFile\n * @param request\n */\nexport function resolveConfigExport(\n result: any,\n configFile: string,\n request: ConfigContext | null\n) {\n if (result.default != null) {\n result = result.default;\n }\n const exportedObjectType = typeof result;\n if (typeof result === 'function') {\n result = result(request);\n }\n\n if (result instanceof Promise) {\n throw new ConfigError(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');\n }\n\n // If the expo object exists, ignore all other values.\n if (result?.expo) {\n result = serializeSkippingMods(result.expo);\n } else {\n result = serializeSkippingMods(result);\n }\n\n return { config: result, exportedObjectType };\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA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AAkB,GAAG,OAAOpC,MAAlC;;EACA,IAAI,OAAOA,MAAP,KAAkB,UAAtB,EAAkC;IAChCA,MAAM,GAAGA,MAAM,CAACH,OAAD,CAAf;EACD;;EAED,IAAIG,MAAM,YAAYqC,OAAtB,EAA+B;IAC7B,MAAM,KAAIC,qBAAJ,EAAiB,eAAc1C,UAAW,2BAA1C,EAAsE,gBAAtE,CAAN;EACD,CAXD,CAaA;;;EACA,eAAII,MAAJ,oCAAI,QAAQuC,IAAZ,EAAkB;IAChBvC,MAAM,GAAG,IAAAwC,kCAAA,EAAsBxC,MAAM,CAACuC,IAA7B,CAAT;EACD,CAFD,MAEO;IACLvC,MAAM,GAAG,IAAAwC,kCAAA,EAAsBxC,MAAtB,CAAT;EACD;;EAED,OAAO;IAAEyC,MAAM,EAAEzC,MAAV;IAAkBoC;EAAlB,CAAP;AACD"}
|
package/build/getConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getConfig.js","names":["readConfigFile","configFile","context","existsSync","evalConfig","error","isConfigError","message","getDynamicConfig","configPath","request","config","ConfigError","getStaticConfig","JsonFile","read","json5"],"sources":["../src/getConfig.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { existsSync } from 'fs';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { DynamicConfigResults, evalConfig } from './evalConfig';\n\n// We cannot use async config resolution right now because Next.js doesn't support async configs.\n// If they don't add support for async Webpack configs then we may need to pull support for Next.js.\nfunction readConfigFile(configFile: string, context: ConfigContext): null | DynamicConfigResults {\n // If the file doesn't exist then we should skip it and continue searching.\n if (!existsSync(configFile)) {\n return null;\n }\n try {\n return evalConfig(configFile, context);\n } catch (error: any) {\n // @ts-ignore\n error.isConfigError = true;\n error.message = `Error reading Expo config at ${configFile}:\\n\\n${error.message}`;\n throw error;\n }\n}\n\nexport function getDynamicConfig(configPath: string, request: ConfigContext): DynamicConfigResults {\n const config = readConfigFile(configPath, request);\n if (config) {\n // The config must be serialized and evaluated ahead of time so the spawned process can send it over.\n return config;\n }\n // TODO: It seems this is only thrown if the file cannot be found (which may never happen).\n // If so we should throw a more helpful error.\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n\nexport function getStaticConfig(configPath: string): AppJSONConfig | ExpoConfig {\n const config = JsonFile.read(configPath, { json5: true });\n if (config) {\n return config as any;\n }\n throw new ConfigError(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');\n}\n"],"mappings":";;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAGA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA;AACA;AACA,SAASA,cAAT,CAAwBC,UAAxB,EAA4CC,OAA5C,EAAiG;EAC/F;EACA,IAAI,CAAC,IAAAC,gBAAA,EAAWF,UAAX,CAAL,EAA6B;IAC3B,OAAO,IAAP;EACD;;EACD,IAAI;IACF,OAAO,IAAAG,wBAAA,EAAWH,UAAX,EAAuBC,OAAvB,CAAP;EACD,CAFD,CAEE,OAAOG,KAAP,EAAmB;IACnB;IACAA,KAAK,CAACC,aAAN,GAAsB,IAAtB;IACAD,KAAK,CAACE,OAAN,GAAiB,gCAA+BN,UAAW,QAAOI,KAAK,CAACE,OAAQ,EAAhF;IACA,MAAMF,KAAN;EACD;AACF;;AAEM,SAASG,gBAAT,CAA0BC,UAA1B,EAA8CC,OAA9C,EAA4F;EACjG,MAAMC,MAAM,GAAGX,cAAc,CAACS,UAAD,EAAaC,OAAb,CAA7B;;EACA,IAAIC,MAAJ,EAAY;IACV;IACA,OAAOA,MAAP;EACD,CALgG,CAMjG;EACA;;;EACA,MAAM,KAAIC,qBAAJ,EAAiB,6BAA4BH,UAAW,EAAxD,EAA2D,gBAA3D,CAAN;AACD;;AAEM,SAASI,eAAT,CAAyBJ,UAAzB,EAAyE;EAC9E,MAAME,MAAM,GAAGG,mBAAA,CAASC,IAAT,CAAcN,UAAd,EAA0B;IAAEO,KAAK,EAAE;EAAT,CAA1B,CAAf;;EACA,IAAIL,MAAJ,EAAY;IACV,OAAOA,MAAP;EACD;;EACD,MAAM,KAAIC,qBAAJ,EAAiB,6BAA4BH,UAAW,EAAxD,EAA2D,gBAA3D,CAAN;AACD"}
|
package/build/getFullName.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getFullName.js","names":["ANONYMOUS_USERNAME","getFullName","manifest","username","getAccountUsername","slug","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","getUserState","read","auth"],"sources":["../src/getFullName.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { getUserState } from './getUserState';\n\nconst ANONYMOUS_USERNAME = 'anonymous';\n\n/**\n * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.\n * This `id` is used for legacy Expo services AuthSession proxy and Expo notifications device ID.\n *\n * @param manifest\n * @returns\n */\nexport function getFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string {\n const username = getAccountUsername(manifest);\n return `@${username}/${manifest.slug}`;\n}\n\nexport function getAccountUsername(manifest: Pick<ExpoConfig, 'owner'> = {}): string {\n // TODO: Must match what's generated in Expo Go.\n const username =\n manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;\n if (username) {\n return username;\n }\n // Statically get the username from the global user state.\n return getUserState().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"mappings":";;;;;;;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA,MAAMA,kBAAkB,GAAG,WAA3B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,SAASC,WAAT,CAAqBC,QAArB,EAA2E;EAChF,MAAMC,QAAQ,GAAGC,kBAAkB,CAACF,QAAD,CAAnC;EACA,OAAQ,IAAGC,QAAS,IAAGD,QAAQ,CAACG,IAAK,EAArC;AACD;;AAEM,SAASD,kBAAT,CAA4BF,QAAmC,GAAG,EAAlE,EAA8E;EAAA;;EACnF;EACA,MAAMC,QAAQ,GACZD,QAAQ,CAACI,KAAT,IAAkBC,OAAO,CAACC,GAAR,CAAYC,iBAA9B,IAAmDF,OAAO,CAACC,GAAR,CAAYE,kBADjE;;EAEA,IAAIP,QAAJ,EAAc;IACZ,OAAOA,QAAP;EACD,CANkF,CAOnF;;;EACA,OAAO,8BAAAQ,4BAAA,IAAeC,IAAf,GAAsBC,IAAtB,gFAA4BV,QAA5B,KAAwCH,kBAA/C;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"getUserState.js","names":["getExpoHomeDirectory","home","homedir","process","env","__UNSAFE_EXPO_HOME_DIRECTORY","boolish","path","join","getUserStatePath","getUserState","JsonFile","jsonParseErrorDefault","cantReadFileDefault"],"sources":["../src/getUserState.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { boolish } from 'getenv';\nimport { homedir } from 'os';\nimport * as path from 'path';\n\nexport type UserSettingsData = {\n developmentCodeSigningId?: string;\n appleId?: string;\n accessToken?: string;\n auth?: UserData | null;\n ignoreBundledBinaries?: string[];\n openDevToolsAtStartup?: boolean;\n PATH?: string;\n sendTo?: string;\n uuid?: string;\n};\n\nexport type UserData = {\n appleId?: string;\n userId?: string;\n username?: string;\n currentConnection?: ConnectionType;\n sessionSecret?: string;\n};\n\nexport type ConnectionType =\n | 'Access-Token-Authentication'\n | 'Username-Password-Authentication'\n | 'facebook'\n | 'google-oauth2'\n | 'github';\n\n// The ~/.expo directory is used to store authentication sessions,\n// which are shared between EAS CLI and Expo CLI.\nexport function getExpoHomeDirectory() {\n const home = homedir();\n\n if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {\n return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;\n } else if (boolish('EXPO_STAGING', false)) {\n return path.join(home, '.expo-staging');\n } else if (boolish('EXPO_LOCAL', false)) {\n return path.join(home, '.expo-local');\n }\n return path.join(home, '.expo');\n}\n\nexport function getUserStatePath() {\n return path.join(getExpoHomeDirectory(), 'state.json');\n}\n\nexport function getUserState() {\n return new JsonFile<UserSettingsData>(getUserStatePath(), {\n jsonParseErrorDefault: {},\n // This will ensure that an error isn't thrown if the file doesn't exist.\n cantReadFileDefault: {},\n });\n}\n"],"mappings":";;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;;;;;AA6BA;AACA;AACO,SAASA,oBAAT,GAAgC;EACrC,MAAMC,IAAI,GAAG,IAAAC,aAAA,GAAb;;EAEA,IAAIC,OAAO,CAACC,GAAR,CAAYC,4BAAhB,EAA8C;IAC5C,OAAOF,OAAO,CAACC,GAAR,CAAYC,4BAAnB;EACD,CAFD,MAEO,IAAI,IAAAC,iBAAA,EAAQ,cAAR,EAAwB,KAAxB,CAAJ,EAAoC;IACzC,OAAOC,IAAI,GAACC,IAAL,CAAUP,IAAV,EAAgB,eAAhB,CAAP;EACD,CAFM,MAEA,IAAI,IAAAK,iBAAA,EAAQ,YAAR,EAAsB,KAAtB,CAAJ,EAAkC;IACvC,OAAOC,IAAI,GAACC,IAAL,CAAUP,IAAV,EAAgB,aAAhB,CAAP;EACD;;EACD,OAAOM,IAAI,GAACC,IAAL,CAAUP,IAAV,EAAgB,OAAhB,CAAP;AACD;;AAEM,SAASQ,gBAAT,GAA4B;EACjC,OAAOF,IAAI,GAACC,IAAL,CAAUR,oBAAoB,EAA9B,EAAkC,YAAlC,CAAP;AACD;;AAEM,SAASU,YAAT,GAAwB;EAC7B,OAAO,KAAIC,mBAAJ,EAA+BF,gBAAgB,EAA/C,EAAmD;IACxDG,qBAAqB,EAAE,EADiC;IAExD;IACAC,mBAAmB,EAAE;EAHmC,CAAnD,CAAP;AAKD"}
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable import/export */\n\nexport * from './Config';\nexport * from './Config.types';\nexport * from './Project';\nexport * from './Errors';\nexport { getAccountUsername } from './getFullName';\n"],"mappings":";;;;;;;;;;;;;;;AAEA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"isLegacyImportsEnabled.js","names":["isLegacyImportsEnabled","exp","boolish","console","warn","lteSdkVersion","expJson","sdkVersion","semver","lte","Error"],"sources":["../src/isLegacyImportsEnabled.ts"],"sourcesContent":["import { boolish } from 'getenv';\nimport semver from 'semver';\n\nimport { ExpoConfig } from './Config.types';\n\n/**\n * Should the bundler use .expo file extensions.\n *\n * @param exp\n */\nexport function isLegacyImportsEnabled(exp: Pick<ExpoConfig, 'sdkVersion'>) {\n if (boolish('EXPO_LEGACY_IMPORTS', false)) {\n console.warn(\n 'Dangerously enabled the deprecated `.expo` extensions feature, this functionality may be removed between SDK cycles.'\n );\n return true;\n }\n // Only allow target if the SDK version is available and it's less 41.\n // This is optimized for making future projects work.\n return lteSdkVersion(exp, '40.0.0');\n}\n\nfunction lteSdkVersion(expJson: Pick<ExpoConfig, 'sdkVersion'>, sdkVersion: string): boolean {\n if (!expJson.sdkVersion) {\n return false;\n }\n\n if (expJson.sdkVersion === 'UNVERSIONED') {\n return false;\n }\n\n try {\n return semver.lte(expJson.sdkVersion, sdkVersion);\n } catch {\n throw new Error(`${expJson.sdkVersion} is not a valid version. Must be in the form of x.y.z`);\n }\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASA,sBAAT,CAAgCC,GAAhC,EAAqE;EAC1E,IAAI,IAAAC,iBAAA,EAAQ,qBAAR,EAA+B,KAA/B,CAAJ,EAA2C;IACzCC,OAAO,CAACC,IAAR,CACE,sHADF;IAGA,OAAO,IAAP;EACD,CANyE,CAO1E;EACA;;;EACA,OAAOC,aAAa,CAACJ,GAAD,EAAM,QAAN,CAApB;AACD;;AAED,SAASI,aAAT,CAAuBC,OAAvB,EAAgEC,UAAhE,EAA6F;EAC3F,IAAI,CAACD,OAAO,CAACC,UAAb,EAAyB;IACvB,OAAO,KAAP;EACD;;EAED,IAAID,OAAO,CAACC,UAAR,KAAuB,aAA3B,EAA0C;IACxC,OAAO,KAAP;EACD;;EAED,IAAI;IACF,OAAOC,iBAAA,CAAOC,GAAP,CAAWH,OAAO,CAACC,UAAnB,EAA+BA,UAA/B,CAAP;EACD,CAFD,CAEE,MAAM;IACN,MAAM,IAAIG,KAAJ,CAAW,GAAEJ,OAAO,CAACC,UAAW,uDAAhC,CAAN;EACD;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"extensions.js","names":["getExtensions","platforms","extensions","workflows","assert","Array","isArray","fileExtensions","workflow","platform","extension","push","filter","Boolean","join","getLanguageExtensionsInOrder","isTS","isModern","isReact","addLanguage","lang","unshift","getManagedExtensions","languageOptions","_addMiscellaneousExtensions","getBareExtensions","includes"],"sources":["../../src/paths/extensions.ts"],"sourcesContent":["import assert from 'assert';\n\nexport type LanguageOptions = {\n isTS: boolean;\n isModern: boolean;\n isReact: boolean;\n};\n\nexport function getExtensions(\n platforms: string[],\n extensions: string[],\n workflows: string[]\n): string[] {\n // In the past we used spread operators to collect the values so now we enforce type safety on them.\n assert(Array.isArray(platforms), 'Expected: `platforms: string[]`');\n assert(Array.isArray(extensions), 'Expected: `extensions: string[]`');\n assert(Array.isArray(workflows), 'Expected: `workflows: string[]`');\n\n const fileExtensions = [];\n // support .expo files\n for (const workflow of [...workflows, '']) {\n // Ensure order is correct: [platformA.js, platformB.js, js]\n for (const platform of [...platforms, '']) {\n // Support both TypeScript and JavaScript\n for (const extension of extensions) {\n fileExtensions.push([platform, workflow, extension].filter(Boolean).join('.'));\n }\n }\n }\n return fileExtensions;\n}\n\nexport function getLanguageExtensionsInOrder({\n isTS,\n isModern,\n isReact,\n}: LanguageOptions): string[] {\n // @ts-ignore: filter removes false type\n const addLanguage = (lang: string): string[] => [lang, isReact && `${lang}x`].filter(Boolean);\n\n // Support JavaScript\n let extensions = addLanguage('js');\n\n if (isModern) {\n extensions.unshift('mjs');\n }\n if (isTS) {\n extensions = [...addLanguage('ts'), ...extensions];\n }\n\n return extensions;\n}\n\nexport function getManagedExtensions(\n platforms: string[],\n languageOptions: LanguageOptions = { isTS: true, isModern: true, isReact: true }\n): string[] {\n const fileExtensions = getExtensions(platforms, getLanguageExtensionsInOrder(languageOptions), [\n 'expo',\n ]);\n // Always add these last\n _addMiscellaneousExtensions(platforms, fileExtensions);\n return fileExtensions;\n}\n\nexport function getBareExtensions(\n platforms: string[],\n languageOptions: LanguageOptions = { isTS: true, isModern: true, isReact: true }\n): string[] {\n const fileExtensions = getExtensions(\n platforms,\n getLanguageExtensionsInOrder(languageOptions),\n []\n );\n // Always add these last\n _addMiscellaneousExtensions(platforms, fileExtensions);\n return fileExtensions;\n}\n\nfunction _addMiscellaneousExtensions(platforms: string[], fileExtensions: string[]): string[] {\n // Always add these with no platform extension\n // In the future we may want to add platform and workspace extensions to json.\n fileExtensions.push('json');\n // Native doesn't currently support web assembly.\n if (platforms.includes('web')) {\n fileExtensions.push('wasm');\n }\n return fileExtensions;\n}\n"],"mappings":";;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAQO,SAASA,aAAT,CACLC,SADK,EAELC,UAFK,EAGLC,SAHK,EAIK;EACV;EACA,IAAAC,iBAAA,EAAOC,KAAK,CAACC,OAAN,CAAcL,SAAd,CAAP,EAAiC,iCAAjC;EACA,IAAAG,iBAAA,EAAOC,KAAK,CAACC,OAAN,CAAcJ,UAAd,CAAP,EAAkC,kCAAlC;EACA,IAAAE,iBAAA,EAAOC,KAAK,CAACC,OAAN,CAAcH,SAAd,CAAP,EAAiC,iCAAjC;EAEA,MAAMI,cAAc,GAAG,EAAvB,CANU,CAOV;;EACA,KAAK,MAAMC,QAAX,IAAuB,CAAC,GAAGL,SAAJ,EAAe,EAAf,CAAvB,EAA2C;IACzC;IACA,KAAK,MAAMM,QAAX,IAAuB,CAAC,GAAGR,SAAJ,EAAe,EAAf,CAAvB,EAA2C;MACzC;MACA,KAAK,MAAMS,SAAX,IAAwBR,UAAxB,EAAoC;QAClCK,cAAc,CAACI,IAAf,CAAoB,CAACF,QAAD,EAAWD,QAAX,EAAqBE,SAArB,EAAgCE,MAAhC,CAAuCC,OAAvC,EAAgDC,IAAhD,CAAqD,GAArD,CAApB;MACD;IACF;EACF;;EACD,OAAOP,cAAP;AACD;;AAEM,SAASQ,4BAAT,CAAsC;EAC3CC,IAD2C;EAE3CC,QAF2C;EAG3CC;AAH2C,CAAtC,EAIuB;EAC5B;EACA,MAAMC,WAAW,GAAIC,IAAD,IAA4B,CAACA,IAAD,EAAOF,OAAO,IAAK,GAAEE,IAAK,GAA1B,EAA8BR,MAA9B,CA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AACD"}
|
package/build/paths/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../../src/paths/index.ts"],"sourcesContent":["export * from './paths';\nexport * from './extensions';\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/build/paths/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/paths/paths.ts"],"names":["ensureSlash","inputPath","needsSlash","hasSlash","endsWith","substr","length","getPossibleProjectRoot","fs","realpathSync","process","cwd","nativePlatforms","resolveEntryPoint","projectRoot","platform","projectConfig","platforms","includes","getEntryPoint","entryFiles","extensions","getEntryPointWithExtensions","exp","pkg","skipSDKVersionRequirement","entryPoint","entry","getFileWithExtensions","resolveFromSilentWithExtensions","main","Error","fileName","fromDirectory","moduleId","extension","modulePath","resolveFrom","silent","path","join","existsSync"],"mappings":";;;;;;;;;;;;;AAAA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AACA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;AAEA;AAAA;;AAAA;AAAA;AAAA;;AAAA;AAAA;;;;AAEA;AACO,SAASA,WAAT,CAAqBC,SAArB,EAAwCC,UAAxC,EAAqE;AAC1E,QAAMC,QAAQ,GAAGF,SAAS,CAACG,QAAV,CAAmB,GAAnB,CAAjB;;AACA,MAAID,QAAQ,IAAI,CAACD,UAAjB,EAA6B;AAC3B,WAAOD,SAAS,CAACI,MAAV,CAAiB,CAAjB,EAAoBJ,SAAS,CAACK,MAAV,GAAmB,CAAvC,CAAP;AACD,GAFD,MAEO,IAA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AGC,uBAAYC,MAAZ,CAAmBL,aAAnB,EAAmC,GAAEC,QAAS,IAAGC,SAAU,EAA3D,CAAnB;;AACA,QAAIC,UAAU,IAAIA,UAAU,CAAChC,QAAX,CAAoB+B,SAApB,CAAlB,EAAkD;AAChD,aAAOC,UAAP;AACD;AACF;;AACD,SAAOC,uBAAYC,MAAZ,CAAmBL,aAAnB,EAAkCC,QAAlC,KAA+C,IAAtD;AACD,C,CAED;AACA;;;AACO,SAASN,qBAAT,CACLK,aADK,EAELC,QAFK,EAGLb,UAHK,EAIU;AACf,QAAMe,UAAU,GAAGG,gBAAKC,IAAL,CAAUP,aAAV,EAAyBC,QAAzB,CAAnB;;AACA,MAAI1B,cAAGiC,UAAH,CAAcL,UAAd,CAAJ,EAA+B;AAC7B,WAAOA,UAAP;AACD;;AACD,OAAK,MAAMD,SAAX,IAAwBd,UAAxB,EAAoC;AAClC,UAAMe,UAAU,GAAGG,gBAAKC,IAAL,CAAUP,aAAV,EAA0B,GAAEC,QAAS,IAAGC,SAAU,EAAlD,CAAnB;;AACA,QAAI3B,cAAGiC,UAAH,CAAcL,UAAd,CAAJ,EAA+B;AAC7B,aAAOA,UAAP;AACD;AACF;;AACD,SAAO,IAAP;AACD","sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getConfig } from '../Config';\nimport { ProjectConfig } from '../Config.types';\nimport { getBareExtensions } from './extensions';\n\n// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22\nexport function ensureSlash(inputPath: string, needsSlash: boolean): string {\n const hasSlash = inputPath.endsWith('/');\n if (hasSlash && !needsSlash) {\n return inputPath.substr(0, inputPath.length - 1);\n } else if (!hasSlash && needsSlash) {\n return `${inputPath}/`;\n } else {\n return inputPath;\n }\n}\n\nexport function getPossibleProjectRoot(): string {\n return fs.realpathSync(process.cwd());\n}\n\nconst nativePlatforms = ['ios', 'android'];\n\nexport function resolveEntryPoint(\n projectRoot: string,\n { platform, projectConfig }: { platform: string; projectConfig?: ProjectConfig }\n) {\n const platforms = nativePlatforms.includes(platform) ? [platform, 'native'] : [platform];\n return getEntryPoint(projectRoot, ['./index'], platforms, projectConfig);\n}\n\nexport function getEntryPoint(\n projectRoot: string,\n entryFiles: string[],\n platforms: string[],\n projectConfig?: ProjectConfig\n): string | null {\n const extensions = getBareExtensions(platforms);\n return getEntryPointWithExtensions(projectRoot, entryFiles, extensions, projectConfig);\n}\n\n// Used to resolve the main entry file for a project.\nexport function getEntryPointWithExtensions(\n projectRoot: string,\n entryFiles: string[],\n extensions: string[],\n projectConfig?: ProjectConfig\n): string {\n const { exp, pkg } = projectConfig ?? getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // This will first look in the `app.json`s `expo.entryPoint` field for a potential main file.\n // We check the Expo config first in case you want your project to start differently with Expo then in a standalone environment.\n if (exp && exp.entryPoint && typeof exp.entryPoint === 'string') {\n // If the field exists then we want to test it against every one of the supplied extensions\n // to ensure the bundler resolves the same way.\n let entry = getFileWithExtensions(projectRoot, exp.entryPoint, extensions);\n if (!entry) {\n // Allow for paths like: `{ \"main\": \"expo/AppEntry\" }`\n entry = resolveFromSilentWithExtensions(projectRoot, exp.entryPoint, extensions);\n\n // If it doesn't resolve then just return the entryPoint as-is. This makes\n // it possible for people who have an unconventional setup (eg: multiple\n // apps in monorepo with metro at root) to customize entry point without\n // us imposing our assumptions.\n if (!entry) {\n return exp.entryPoint;\n }\n }\n return entry;\n } else if (pkg) {\n // If the config doesn't define a custom entry then we want to look at the `package.json`s `main` field, and try again.\n const { main } = pkg;\n if (main && typeof main === 'string') {\n // Testing the main field against all of the provided extensions - for legacy reasons we can't use node module resolution as the package.json allows you to pass in a file without a relative path and expect it as a relative path.\n let entry = getFileWithExtensions(projectRoot, main, extensions);\n if (!entry) {\n // Allow for paths like: `{ \"main\": \"expo/AppEntry\" }`\n entry = resolveFromSilentWithExtensions(projectRoot, main, extensions);\n if (!entry)\n throw new Error(\n `Cannot resolve entry file: The \\`main\\` field defined in your \\`package.json\\` points to a non-existent path.`\n );\n }\n return entry;\n }\n }\n\n // Now we will start looking for a default entry point using the provided `entryFiles` argument.\n // This will add support for create-react-app (src/index.js) and react-native-cli (index.js) which don't define a main.\n for (const fileName of entryFiles) {\n const entry = resolveFromSilentWithExtensions(projectRoot, fileName, extensions);\n if (entry) return entry;\n }\n\n try {\n // If none of the default files exist then we will attempt to use the main Expo entry point.\n // This requires `expo` to be installed in the project to work as it will use `node_module/expo/AppEntry.js`\n // Doing this enables us to create a bare minimum Expo project.\n\n // TODO(Bacon): We may want to do a check against `./App` and `expo` in the `package.json` `dependencies` as we can more accurately ensure that the project is expo-min without needing the modules installed.\n return resolveFrom(projectRoot, 'expo/AppEntry');\n } catch {\n throw new Error(\n `The project entry file could not be resolved. Please either define it in the \\`package.json\\` (main), \\`app.json\\` (expo.entryPoint), create an \\`index.js\\`, or install the \\`expo\\` package.`\n );\n }\n}\n\n// Resolve from but with the ability to resolve like a bundler\nexport function resolveFromSilentWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n for (const extension of extensions) {\n const modulePath = resolveFrom.silent(fromDirectory, `${moduleId}.${extension}`);\n if (modulePath && modulePath.endsWith(extension)) {\n return modulePath;\n }\n }\n return resolveFrom.silent(fromDirectory, moduleId) || null;\n}\n\n// Statically attempt to resolve a module but with the ability to resolve like a bundler.\n// This won't use node module resolution.\nexport function getFileWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n const modulePath = path.join(fromDirectory, moduleId);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n for (const extension of extensions) {\n const modulePath = path.join(fromDirectory, `${moduleId}.${extension}`);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n }\n return null;\n}\n"],"file":"paths.js"}
|
|
1
|
+
{"version":3,"file":"paths.js","names":["ensureSlash","inputPath","needsSlash","hasSlash","endsWith","substr","length","getPossibleProjectRoot","fs","realpathSync","process","cwd","nativePlatforms","resolveEntryPoint","projectRoot","platform","projectConfig","platforms","includes","getEntryPoint","entryFiles","extensions","getBareExtensions","getEntryPointWithExtensions","exp","pkg","getConfig","skipSDKVersionRequirement","entryPoint","entry","getFileWithExtensions","resolveFromSilentWithExtensions","main","Error","fileName","resolveFrom","fromDirectory","moduleId","extension","modulePath","silent","path","join","existsSync"],"sources":["../../src/paths/paths.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getConfig } from '../Config';\nimport { ProjectConfig } from '../Config.types';\nimport { getBareExtensions } from './extensions';\n\n// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22\nexport function ensureSlash(inputPath: string, needsSlash: boolean): string {\n const hasSlash = inputPath.endsWith('/');\n if (hasSlash && !needsSlash) {\n return inputPath.substr(0, inputPath.length - 1);\n } else if (!hasSlash && needsSlash) {\n return `${inputPath}/`;\n } else {\n return inputPath;\n }\n}\n\nexport function getPossibleProjectRoot(): string {\n return fs.realpathSync(process.cwd());\n}\n\nconst nativePlatforms = ['ios', 'android'];\n\nexport function resolveEntryPoint(\n projectRoot: string,\n { platform, projectConfig }: { platform: string; projectConfig?: ProjectConfig }\n) {\n const platforms = nativePlatforms.includes(platform) ? [platform, 'native'] : [platform];\n return getEntryPoint(projectRoot, ['./index'], platforms, projectConfig);\n}\n\nexport function getEntryPoint(\n projectRoot: string,\n entryFiles: string[],\n platforms: string[],\n projectConfig?: ProjectConfig\n): string | null {\n const extensions = getBareExtensions(platforms);\n return getEntryPointWithExtensions(projectRoot, entryFiles, extensions, projectConfig);\n}\n\n// Used to resolve the main entry file for a project.\nexport function getEntryPointWithExtensions(\n projectRoot: string,\n entryFiles: string[],\n extensions: string[],\n projectConfig?: ProjectConfig\n): string {\n const { exp, pkg } = projectConfig ?? getConfig(projectRoot, { skipSDKVersionRequirement: true });\n\n // This will first look in the `app.json`s `expo.entryPoint` field for a potential main file.\n // We check the Expo config first in case you want your project to start differently with Expo then in a standalone environment.\n if (exp && exp.entryPoint && typeof exp.entryPoint === 'string') {\n // If the field exists then we want to test it against every one of the supplied extensions\n // to ensure the bundler resolves the same way.\n let entry = getFileWithExtensions(projectRoot, exp.entryPoint, extensions);\n if (!entry) {\n // Allow for paths like: `{ \"main\": \"expo/AppEntry\" }`\n entry = resolveFromSilentWithExtensions(projectRoot, exp.entryPoint, extensions);\n\n // If it doesn't resolve then just return the entryPoint as-is. This makes\n // it possible for people who have an unconventional setup (eg: multiple\n // apps in monorepo with metro at root) to customize entry point without\n // us imposing our assumptions.\n if (!entry) {\n return exp.entryPoint;\n }\n }\n return entry;\n } else if (pkg) {\n // If the config doesn't define a custom entry then we want to look at the `package.json`s `main` field, and try again.\n const { main } = pkg;\n if (main && typeof main === 'string') {\n // Testing the main field against all of the provided extensions - for legacy reasons we can't use node module resolution as the package.json allows you to pass in a file without a relative path and expect it as a relative path.\n let entry = getFileWithExtensions(projectRoot, main, extensions);\n if (!entry) {\n // Allow for paths like: `{ \"main\": \"expo/AppEntry\" }`\n entry = resolveFromSilentWithExtensions(projectRoot, main, extensions);\n if (!entry)\n throw new Error(\n `Cannot resolve entry file: The \\`main\\` field defined in your \\`package.json\\` points to a non-existent path.`\n );\n }\n return entry;\n }\n }\n\n // Now we will start looking for a default entry point using the provided `entryFiles` argument.\n // This will add support for create-react-app (src/index.js) and react-native-cli (index.js) which don't define a main.\n for (const fileName of entryFiles) {\n const entry = resolveFromSilentWithExtensions(projectRoot, fileName, extensions);\n if (entry) return entry;\n }\n\n try {\n // If none of the default files exist then we will attempt to use the main Expo entry point.\n // This requires `expo` to be installed in the project to work as it will use `node_module/expo/AppEntry.js`\n // Doing this enables us to create a bare minimum Expo project.\n\n // TODO(Bacon): We may want to do a check against `./App` and `expo` in the `package.json` `dependencies` as we can more accurately ensure that the project is expo-min without needing the modules installed.\n return resolveFrom(projectRoot, 'expo/AppEntry');\n } catch {\n throw new Error(\n `The project entry file could not be resolved. Please either define it in the \\`package.json\\` (main), \\`app.json\\` (expo.entryPoint), create an \\`index.js\\`, or install the \\`expo\\` package.`\n );\n }\n}\n\n// Resolve from but with the ability to resolve like a bundler\nexport function resolveFromSilentWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n for (const extension of extensions) {\n const modulePath = resolveFrom.silent(fromDirectory, `${moduleId}.${extension}`);\n if (modulePath && modulePath.endsWith(extension)) {\n return modulePath;\n }\n }\n return resolveFrom.silent(fromDirectory, moduleId) || null;\n}\n\n// Statically attempt to resolve a module but with the ability to resolve like a bundler.\n// This won't use node module resolution.\nexport function getFileWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n const modulePath = path.join(fromDirectory, moduleId);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n for (const extension of extensions) {\n const modulePath = path.join(fromDirectory, `${moduleId}.${extension}`);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;;;AAEA;AACO,SAASA,WAAT,CAAqBC,SAArB,EAAwCC,UAAxC,EAAqE;EAC1E,MAAMC,QAAQ,GAAGF,SAAS,CAACG,QAAV,CAAmB,GAAnB,CAAjB;;EACA,IAAID,QAAQ,IAAI,CAACD,UAAjB,EAA6B;IAC3B,OAAOD,SAAS,CAACI,MAAV,CAAiB,CAAjB,EAAoBJ,SAAS,CAACK,MAAV,GAAmB,CAAvC,CAAP;EACD,CAFD,MAEO,IAAI,CAACH,QAAD,IAAaD,UAAjB,EAA6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AAmBJ,aAAnB,EAAmC,GAAEC,QAAS,IAAGC,SAAU,EAA3D,CAAnB;;IACA,IAAIC,UAAU,IAAIA,UAAU,CAACnC,QAAX,CAAoBkC,SAApB,CAAlB,EAAkD;MAChD,OAAOC,UAAP;IACD;EACF;;EACD,OAAOJ,sBAAA,CAAYK,MAAZ,CAAmBJ,aAAnB,EAAkCC,QAAlC,KAA+C,IAAtD;AACD,C,CAED;AACA;;;AACO,SAASP,qBAAT,CACLM,aADK,EAELC,QAFK,EAGLhB,UAHK,EAIU;EACf,MAAMkB,UAAU,GAAGE,eAAA,CAAKC,IAAL,CAAUN,aAAV,EAAyBC,QAAzB,CAAnB;;EACA,IAAI7B,aAAA,CAAGmC,UAAH,CAAcJ,UAAd,CAAJ,EAA+B;IAC7B,OAAOA,UAAP;EACD;;EACD,KAAK,MAAMD,SAAX,IAAwBjB,UAAxB,EAAoC;IAClC,MAAMkB,UAAU,GAAGE,eAAA,CAAKC,IAAL,CAAUN,aAAV,EAA0B,GAAEC,QAAS,IAAGC,SAAU,EAAlD,CAAnB;;IACA,IAAI9B,aAAA,CAAGmC,UAAH,CAAcJ,UAAd,CAAJ,EAA+B;MAC7B,OAAOA,UAAP;IACD;EACF;;EACD,OAAO,IAAP;AACD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"withConfigPlugins.js","names":["withConfigPlugins","config","skipPlugins","Array","isArray","plugins","length","withPlugins","serializeAfterStaticPlugins"],"sources":["../../src/plugins/withConfigPlugins.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\n\nimport { serializeAfterStaticPlugins } from '../Serialize';\n\n/**\n * Resolves static plugins array as config plugin functions.\n *\n * @param config\n * @param projectRoot\n */\nexport const withConfigPlugins: ConfigPlugin<boolean> = (config, skipPlugins) => {\n // @ts-ignore: plugins not on config type yet -- TODO\n if (!Array.isArray(config.plugins) || !config.plugins?.length) {\n return config;\n }\n if (!skipPlugins) {\n // Resolve and evaluate plugins\n // @ts-ignore: TODO: add plugins to the config schema\n config = withPlugins(config, config.plugins);\n } else {\n // Delete the plugins array in case someone added functions or other values which cannot be automatically serialized.\n delete config.plugins;\n }\n // plugins aren't serialized by default, serialize the plugins after resolving them.\n return serializeAfterStaticPlugins(config);\n};\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAwC,GAAG,CAACC,MAAD,EAASC,WAAT,KAAyB;EAAA;;EAC/E;EACA,IAAI,CAACC,KAAK,CAACC,OAAN,CAAcH,MAAM,CAACI,OAArB,CAAD,IAAkC,qBAACJ,MAAM,CAACI,OAAR,4CAAC,gBAAgBC,MAAjB,CAAtC,EAA+D;IAC7D,OAAOL,MAAP;EACD;;EACD,IAAI,CAACC,WAAL,EAAkB;IAChB;IACA;IACAD,MAAM,GAAG,IAAAM,4BAAA,EAAYN,MAAZ,EAAoBA,MAAM,CAACI,OAA3B,CAAT;EACD,CAJD,MAIO;IACL;IACA,OAAOJ,MAAM,CAACI,OAAd;EACD,CAZ8E,CAa/E;;;EACA,OAAO,IAAAG,wCAAA,EAA4BP,MAA5B,CAAP;AACD,CAfM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"withInternal.js","names":["EXPO_DEBUG","boolish","withInternal","config","internals","_internal","isDebug"],"sources":["../../src/plugins/withInternal.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\nimport { boolish } from 'getenv';\n\nimport { ConfigFilePaths } from '../Config.types';\n\nexport const EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\n/**\n * Adds the _internal object.\n *\n * @param config\n * @param projectRoot\n */\nexport const withInternal: ConfigPlugin<\n { projectRoot: string; packageJsonPath?: string } & Partial<ConfigFilePaths>\n> = (config, internals) => {\n if (!config._internal) {\n config._internal = {};\n }\n\n config._internal = {\n isDebug: EXPO_DEBUG,\n ...config._internal,\n ...internals,\n };\n\n return config;\n};\n"],"mappings":";;;;;;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAIO,MAAMA,UAAU,GAAG,IAAAC,iBAAA,EAAQ,YAAR,EAAsB,KAAtB,CAAnB;AAEP;AACA;AACA;AACA;AACA;AACA;;;;AACO,MAAMC,YAEZ,GAAG,CAACC,MAAD,EAASC,SAAT,KAAuB;EACzB,IAAI,CAACD,MAAM,CAACE,SAAZ,EAAuB;IACrBF,MAAM,CAACE,SAAP,GAAmB,EAAnB;EACD;;EAEDF,MAAM,CAACE,SAAP,GAAmB;IACjBC,OAAO,EAAEN,UADQ;IAEjB,GAAGG,MAAM,CAACE,SAFO;IAGjB,GAAGD;EAHc,CAAnB;EAMA,OAAOD,MAAP;AACD,CAdM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"resolvePackageJson.js","names":["fileExists","file","statSync","isFile","getRootPackageJsonPath","projectRoot","packageJsonPath","join","ConfigError"],"sources":["../src/resolvePackageJson.ts"],"sourcesContent":["import { statSync } from 'fs';\nimport { join } from 'path';\n\nimport { ConfigError } from './Errors';\n\nfunction fileExists(file: string): boolean {\n try {\n return statSync(file).isFile();\n } catch {\n return false;\n }\n}\n\nexport function getRootPackageJsonPath(projectRoot: string): string {\n const packageJsonPath = join(projectRoot, 'package.json');\n if (!fileExists(packageJsonPath)) {\n throw new ConfigError(\n `The expected package.json path: ${packageJsonPath} does not exist`,\n 'MODULE_NOT_FOUND'\n );\n }\n return packageJsonPath;\n}\n"],"mappings":";;;;;;;AAAA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAEA,SAASA,UAAT,CAAoBC,IAApB,EAA2C;EACzC,IAAI;IACF,OAAO,IAAAC,cAAA,EAASD,IAAT,EAAeE,MAAf,EAAP;EACD,CAFD,CAEE,MAAM;IACN,OAAO,KAAP;EACD;AACF;;AAEM,SAASC,sBAAT,CAAgCC,WAAhC,EAA6D;EAClE,MAAMC,eAAe,GAAG,IAAAC,YAAA,EAAKF,WAAL,EAAkB,cAAlB,CAAxB;;EACA,IAAI,CAACL,UAAU,CAACM,eAAD,CAAf,EAAkC;IAChC,MAAM,KAAIE,qBAAJ,EACH,mCAAkCF,eAAgB,iBAD/C,EAEJ,kBAFI,CAAN;EAID;;EACD,OAAOA,eAAP;AACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "A library for interacting with the app.json",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
},
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/expo/expo
|
|
17
|
-
"directory": "packages/config"
|
|
16
|
+
"url": "https://github.com/expo/expo.git",
|
|
17
|
+
"directory": "packages/@expo/config"
|
|
18
18
|
},
|
|
19
19
|
"keywords": [
|
|
20
20
|
"json",
|
|
@@ -24,17 +24,17 @@
|
|
|
24
24
|
],
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"bugs": {
|
|
27
|
-
"url": "https://github.com/expo/expo
|
|
27
|
+
"url": "https://github.com/expo/expo/issues"
|
|
28
28
|
},
|
|
29
|
-
"homepage": "https://github.com/expo/expo
|
|
29
|
+
"homepage": "https://github.com/expo/expo/tree/main/packages/@expo/config#readme",
|
|
30
30
|
"files": [
|
|
31
31
|
"build",
|
|
32
32
|
"paths"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/code-frame": "~7.10.4",
|
|
36
|
-
"@expo/config-plugins": "
|
|
37
|
-
"@expo/config-types": "^
|
|
36
|
+
"@expo/config-plugins": "~5.0.0",
|
|
37
|
+
"@expo/config-types": "^46.0.0",
|
|
38
38
|
"@expo/json-file": "8.2.36",
|
|
39
39
|
"getenv": "^1.0.0",
|
|
40
40
|
"glob": "7.1.6",
|
|
@@ -49,5 +49,6 @@
|
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "84ec8d38ec62bc88163fe8606c0395001e34366b"
|
|
53
54
|
}
|