@expo/config 7.0.3 → 8.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.
Files changed (46) hide show
  1. package/build/Config.d.ts +1 -13
  2. package/build/Config.js +56 -363
  3. package/build/Config.js.map +1 -1
  4. package/build/Config.types.d.ts +18 -21
  5. package/build/Config.types.js +0 -5
  6. package/build/Config.types.js.map +1 -1
  7. package/build/Errors.js +3 -7
  8. package/build/Errors.js.map +1 -1
  9. package/build/Serialize.js +4 -24
  10. package/build/Serialize.js.map +1 -1
  11. package/build/evalConfig.d.ts +2 -2
  12. package/build/evalConfig.js +12 -44
  13. package/build/evalConfig.js.map +1 -1
  14. package/build/getConfig.js +2 -23
  15. package/build/getConfig.js.map +1 -1
  16. package/build/getExpoSDKVersion.d.ts +6 -0
  17. package/build/getExpoSDKVersion.js +60 -0
  18. package/build/getExpoSDKVersion.js.map +1 -0
  19. package/build/getFullName.js +3 -11
  20. package/build/getFullName.js.map +1 -1
  21. package/build/getUserState.d.ts +3 -3
  22. package/build/getUserState.js +0 -20
  23. package/build/getUserState.js.map +1 -1
  24. package/build/index.d.ts +1 -1
  25. package/build/index.js +4 -15
  26. package/build/index.js.map +1 -1
  27. package/build/paths/extensions.d.ts +1 -2
  28. package/build/paths/extensions.js +8 -35
  29. package/build/paths/extensions.js.map +1 -1
  30. package/build/paths/index.js +0 -4
  31. package/build/paths/index.js.map +1 -1
  32. package/build/paths/paths.js +37 -67
  33. package/build/paths/paths.js.map +1 -1
  34. package/build/plugins/withConfigPlugins.js +2 -13
  35. package/build/plugins/withConfigPlugins.js.map +1 -1
  36. package/build/plugins/withInternal.js +1 -8
  37. package/build/plugins/withInternal.js.map +1 -1
  38. package/build/resolvePackageJson.js +1 -21
  39. package/build/resolvePackageJson.js.map +1 -1
  40. package/package.json +5 -5
  41. package/build/Project.d.ts +0 -2
  42. package/build/Project.js +0 -64
  43. package/build/Project.js.map +0 -1
  44. package/build/isLegacyImportsEnabled.d.ts +0 -7
  45. package/build/isLegacyImportsEnabled.js +0 -61
  46. package/build/isLegacyImportsEnabled.js.map +0 -1
@@ -1 +1 @@
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;;EAAA;AAAA;;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;;EAAA;AAAA;;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;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AACA;EAAA;;EAAA;IAAA;EAAA;;EAAA;AAAA;;AAkmBA;;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAA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ACD;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
+ {"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","getDynamicConfigFilePath","getStaticConfigFilePath","fileName","configPath","path","join","fs","existsSync","modifyConfigAsync","modifications","readOptions","writeOptions","type","message","relative","outputConfig","dryRun","writeAsync","json5","withInternal","pkgName","name","basename","pkgVersion","version","pkgWithDefaults","slug","slugify","toLowerCase","description","expWithDefaults","sdkVersion","getExpoSDKVersion","error","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","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 GetConfigOptions,\n PackageJSONConfig,\n Platform,\n ProjectConfig,\n ProjectTarget,\n WriteConfigOptions,\n} from './Config.types';\nimport { getDynamicConfig, getStaticConfig } from './getConfig';\nimport { getExpoSDKVersion } from './getExpoSDKVersion';\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 // TODD(EvanBacon): Drop plugins array after it's been resolved.\n\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\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 return {\n dynamicConfigPath: getDynamicConfigFilePath(projectRoot),\n staticConfigPath: getStaticConfigFilePath(projectRoot),\n };\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/**\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\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\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 // TODO: Drop this\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 * 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"],"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;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;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;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AA0bA;AAAA;EAAA;EAAA;EAAA;EAAA;IA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CAACR,WAAW,CAAC;EAC7C,OAAO4G,oCAAoC,CAAC5G,WAAW,EAAEO,KAAK,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASqG,oCAAoC,CAClD5G,WAAmB,EACnB6G,aAA8B,EACtB;EACR,IAAIA,aAAa,CAACrF,iBAAiB,EAAE;IACnC,MAAMsF,yBAAyB,GAAG1D,eAAI,CAACU,QAAQ,CAAC9D,WAAW,EAAE6G,aAAa,CAACrF,iBAAiB,CAAC;IAC7F,IAAIqF,aAAa,CAACnG,gBAAgB,EAAE;MAClC,OAAQ,GAAEoG,yBAA0B,OAAM1D,eAAI,CAACU,QAAQ,CACrD9D,WAAW,EACX6G,aAAa,CAACnG,gBAAgB,CAC9B,EAAC;IACL;IACA,OAAOoG,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAACnG,gBAAgB,EAAE;IACzC,OAAO0C,eAAI,CAACU,QAAQ,CAAC9D,WAAW,EAAE6G,aAAa,CAACnG,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB"}
@@ -1,7 +1,7 @@
1
1
  import { ModConfig } from '@expo/config-plugins';
2
2
  import { ExpoConfig } from '@expo/config-types';
3
3
  export { ExpoConfig };
4
- export declare type PackageJSONConfig = {
4
+ export type PackageJSONConfig = {
5
5
  dependencies?: Record<string, string>;
6
6
  [key: string]: any;
7
7
  };
@@ -42,15 +42,15 @@ export interface ProjectConfig {
42
42
  */
43
43
  dynamicConfigObjectType: string | null;
44
44
  }
45
- export declare type AppJSONConfig = {
45
+ export type AppJSONConfig = {
46
46
  expo: ExpoConfig;
47
47
  [key: string]: any;
48
48
  };
49
- export declare type BareAppConfig = {
49
+ export type BareAppConfig = {
50
50
  name: string;
51
51
  [key: string]: any;
52
52
  };
53
- export declare type HookArguments = {
53
+ export type HookArguments = {
54
54
  config: any;
55
55
  url: any;
56
56
  exp: ExpoConfig;
@@ -65,7 +65,7 @@ export declare type HookArguments = {
65
65
  projectRoot: string;
66
66
  log: (msg: any) => void;
67
67
  };
68
- export declare type ExpoGoConfig = {
68
+ export type ExpoGoConfig = {
69
69
  mainModuleName: string;
70
70
  __flipperHack: 'React Native packager is running';
71
71
  debuggerHost: string;
@@ -78,13 +78,13 @@ export declare type ExpoGoConfig = {
78
78
  [key: string]: any;
79
79
  };
80
80
  };
81
- export declare type EASConfig = {
81
+ export type EASConfig = {
82
82
  projectId?: string;
83
83
  };
84
- export declare type ClientScopingConfig = {
84
+ export type ClientScopingConfig = {
85
85
  scopeKey?: string;
86
86
  };
87
- export declare type ExpoClientConfig = ExpoConfig & {
87
+ export type ExpoClientConfig = ExpoConfig & {
88
88
  id?: string;
89
89
  releaseId?: string;
90
90
  revisionId?: string;
@@ -92,7 +92,7 @@ export declare type ExpoClientConfig = ExpoConfig & {
92
92
  hostUri?: string;
93
93
  publishedTime?: string;
94
94
  };
95
- export declare type ExpoAppManifest = ExpoClientConfig & EASConfig & Partial<ExpoGoConfig> & {
95
+ export type ExpoAppManifest = ExpoClientConfig & EASConfig & Partial<ExpoGoConfig> & {
96
96
  sdkVersion: string;
97
97
  bundledAssets?: string[];
98
98
  isKernel?: boolean;
@@ -125,22 +125,19 @@ export interface ExpoUpdatesManifest {
125
125
  eas?: EASConfig;
126
126
  };
127
127
  }
128
- export declare type Hook = {
128
+ export type Hook = {
129
129
  file: string;
130
130
  config: any;
131
131
  };
132
- export declare type HookType = 'postPublish' | 'postExport';
132
+ export type HookType = 'postPublish' | 'postExport';
133
133
  export declare enum ProjectPrivacy {
134
134
  PUBLIC = "public",
135
135
  UNLISTED = "unlisted"
136
136
  }
137
- export declare type ExpRc = {
138
- [key: string]: any;
139
- };
140
- export declare type Platform = 'android' | 'ios' | 'web';
141
- export declare type ProjectTarget = 'managed' | 'bare';
142
- export declare type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG';
143
- export declare type ConfigContext = {
137
+ export type Platform = 'android' | 'ios' | 'web';
138
+ export type ProjectTarget = 'managed' | 'bare';
139
+ export type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'DEPRECATED' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG';
140
+ export type ConfigContext = {
144
141
  projectRoot: string;
145
142
  /**
146
143
  * The static config path either app.json, app.config.json, or a custom user-defined config.
@@ -149,7 +146,7 @@ export declare type ConfigContext = {
149
146
  packageJsonPath: string | null;
150
147
  config: Partial<ExpoConfig>;
151
148
  };
152
- export declare type GetConfigOptions = {
149
+ export type GetConfigOptions = {
153
150
  isPublicConfig?: boolean;
154
151
  /**
155
152
  * Should the config `mods` be preserved in the config? Used for compiling mods in the eject command.
@@ -164,10 +161,10 @@ export declare type GetConfigOptions = {
164
161
  skipPlugins?: boolean;
165
162
  strict?: boolean;
166
163
  };
167
- export declare type WriteConfigOptions = {
164
+ export type WriteConfigOptions = {
168
165
  dryRun?: boolean;
169
166
  };
170
- export declare type ConfigFilePaths = {
167
+ export type ConfigFilePaths = {
171
168
  staticConfigPath: string | null;
172
169
  dynamicConfigPath: string | null;
173
170
  };
@@ -10,20 +10,15 @@ Object.defineProperty(exports, "ExpoConfig", {
10
10
  }
11
11
  });
12
12
  exports.ProjectPrivacy = void 0;
13
-
14
13
  function _configTypes() {
15
14
  const data = require("@expo/config-types");
16
-
17
15
  _configTypes = function () {
18
16
  return data;
19
17
  };
20
-
21
18
  return data;
22
19
  }
23
-
24
20
  let ProjectPrivacy;
25
21
  exports.ProjectPrivacy = ProjectPrivacy;
26
-
27
22
  (function (ProjectPrivacy) {
28
23
  ProjectPrivacy["PUBLIC"] = "public";
29
24
  ProjectPrivacy["UNLISTED"] = "unlisted";
@@ -1 +1 @@
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"}
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 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 | 'DEPRECATED'\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;AAAgD,IAwIpCA,cAAc;AAAA;AAAA,WAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;AAAA,GAAdA,cAAc,8BAAdA,cAAc"}
package/build/Errors.js CHANGED
@@ -4,9 +4,9 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.ConfigError = void 0;
7
-
8
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
-
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
10
10
  /**
11
11
  * Based on `JsonFileError` from `@expo/json-file`
12
12
  */
@@ -15,13 +15,9 @@ class ConfigError extends Error {
15
15
  super(cause ? `${message}\n└─ Cause: ${cause.name}: ${cause.message}` : message);
16
16
  this.code = code;
17
17
  this.cause = cause;
18
-
19
18
  _defineProperty(this, "name", 'ConfigError');
20
-
21
19
  _defineProperty(this, "isConfigError", true);
22
20
  }
23
-
24
21
  }
25
-
26
22
  exports.ConfigError = ConfigError;
27
23
  //# sourceMappingURL=Errors.js.map
@@ -1 +1 @@
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"}
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,WAAW,SAASC,KAAK,CAAC;EAIrCC,WAAW,CAACC,OAAe,EAASC,IAAqB,EAASC,KAAa,EAAE;IAC/E,KAAK,CAACA,KAAK,GAAI,GAAEF,OAAQ,eAAcE,KAAK,CAACC,IAAK,KAAID,KAAK,CAACF,OAAQ,EAAC,GAAGA,OAAO,CAAC;IAAC,KAD/CC,IAAqB,GAArBA,IAAqB;IAAA,KAASC,KAAa,GAAbA,KAAa;IAAA,8BAH/D,aAAa;IAAA,uCACJ,IAAI;EAI7B;AACF;AAAC"}
@@ -6,17 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.serializeAfterStaticPlugins = serializeAfterStaticPlugins;
7
7
  exports.serializeAndEvaluate = serializeAndEvaluate;
8
8
  exports.serializeSkippingMods = serializeSkippingMods;
9
-
10
9
  function _Errors() {
11
10
  const data = require("./Errors");
12
-
13
11
  _Errors = function () {
14
12
  return data;
15
13
  };
16
-
17
14
  return data;
18
15
  }
19
-
20
16
  function serializeAndEvaluate(val) {
21
17
  if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {
22
18
  return val;
@@ -27,24 +23,19 @@ function serializeAndEvaluate(val) {
27
23
  return val.map(serializeAndEvaluate);
28
24
  } else if (typeof val === 'object') {
29
25
  const output = {};
30
-
31
26
  for (const property in val) {
32
27
  if (val.hasOwnProperty(property)) {
33
28
  output[property] = serializeAndEvaluate(val[property]);
34
29
  }
35
30
  }
36
-
37
31
  return output;
38
- } // symbol
39
-
40
-
32
+ }
33
+ // symbol
41
34
  throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
42
35
  }
43
-
44
36
  function serializeSkippingMods(val) {
45
37
  if (typeof val === 'object' && !Array.isArray(val)) {
46
38
  const output = {};
47
-
48
39
  for (const property in val) {
49
40
  if (val.hasOwnProperty(property)) {
50
41
  if (property === 'mods' || property === 'plugins') {
@@ -55,42 +46,33 @@ function serializeSkippingMods(val) {
55
46
  }
56
47
  }
57
48
  }
58
-
59
49
  return output;
60
50
  }
61
-
62
51
  return serializeAndEvaluate(val);
63
52
  }
64
-
65
53
  function serializeAndEvaluatePlugin(val) {
66
54
  if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {
67
55
  return val;
68
56
  } else if (typeof val === 'function') {
69
57
  var _val$name;
70
-
71
58
  return (_val$name = val.name) !== null && _val$name !== void 0 ? _val$name : 'withAnonymous';
72
59
  } else if (Array.isArray(val)) {
73
60
  return val.map(serializeAndEvaluatePlugin);
74
61
  } else if (typeof val === 'object') {
75
62
  const output = {};
76
-
77
63
  for (const property in val) {
78
64
  if (val.hasOwnProperty(property)) {
79
65
  output[property] = serializeAndEvaluatePlugin(val[property]);
80
66
  }
81
67
  }
82
-
83
68
  return output;
84
- } // symbol
85
-
86
-
69
+ }
70
+ // symbol
87
71
  throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
88
72
  }
89
-
90
73
  function serializeAfterStaticPlugins(val) {
91
74
  if (typeof val === 'object' && !Array.isArray(val)) {
92
75
  const output = {};
93
-
94
76
  for (const property in val) {
95
77
  if (val.hasOwnProperty(property)) {
96
78
  if (property === 'mods') {
@@ -104,10 +86,8 @@ function serializeAfterStaticPlugins(val) {
104
86
  }
105
87
  }
106
88
  }
107
-
108
89
  return output;
109
90
  }
110
-
111
91
  return serializeAndEvaluate(val);
112
92
  }
113
93
  //# sourceMappingURL=Serialize.js.map
@@ -1 +1 @@
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,GAAG,CAACO,cAAJ,CAAmBD,QAAnB,CAAJ,EAAkC;QAChCD,MAAM,CAACC,QAAD,CAAN,GAAmBP,oBAAoB,CAACC,GAAG,CAACM,QAAD,CAAJ,CAAvC;MACD;IACF;;IACD,OAAOD,MAAP;EACD,CAhBiD,CAiBlD;;;EACA,MAAM,KAAIG,qBAAJ,EAAiB,4CAA2CR,GAAI,EAAhE,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J,CAAmBD,QAAnB,CAAJ,EAAkC;QAChCD,MAAM,CAACC,QAAD,CAAN,GAAmBI,0BAA0B,CAACV,GAAG,CAACM,QAAD,CAAJ,CAA7C;MACD;IACF;;IACD,OAAOD,MAAP;EACD,CAfgD,CAgBjD;;;EACA,MAAM,KAAIG,qBAAJ,EAAiB,4CAA2CR,GAAI,EAAhE,EAAmE,gBAAnE,CAAN;AACD;;AAEM,SAASY,2BAAT,CAAqCZ,GAArC,EAAoD;EACzD,IAAI,OAAOA,GAAP,KAAe,QAAf,IAA2B,CAACE,KAAK,CAACC,OAAN,CAAcH,GAAd,CAAhC,EAAoD;IAClD,MAAMK,MAA8B,GAAG,EAAvC;;IACA,KAAK,MAAMC,QAAX,IAAuBN,GAAvB,EAA4B;MAC1B,IAAIA,GAAG,CAACO,cAAJ,CAAmBD,QAAnB,CAAJ,EAAkC;QAChC,IAAIA,QAAQ,KAAK,MAAjB,EAAyB;UACvB;UACAD,MAAM,CAACC,QAAD,CAAN,GAAmBN,GAAG,CAACM,QAAD,CAAtB;QACD,CAHD,MAGO,IAAIA,QAAQ,KAAK,SAAb,IAA0BJ,KAAK,CAACC,OAAN,CAAcH,GAAG,CAACM,QAAD,CAAjB,CAA9B,EAA4D;UACjE;UACAD,MAAM,CAACC,QAAD,CAAN,GAAmBN,GAAG,CAACM,QAAD,CAAH,CAAcF,GAAd,CAAkBM,0BAAlB,CAAnB;QACD,CAHM,MAGA;UACLL,MAAM,CAACC,QAAD,CAAN,GAAmBP,oBAAoB,CAACC,GAAG,CAACM,QAAD,CAAJ,CAAvC;QACD;MACF;IACF;;IACD,OAAOD,MAAP;EACD;;EACD,OAAON,oBAAoB,CAACC,GAAD,CAA3B;AACD"}
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,oBAAoB,CAACC,GAAQ,EAAO;EAClD,IAAI,CAAC,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAACC,QAAQ,CAAC,OAAOD,GAAG,CAAC,EAAE;IAC/E,OAAOA,GAAG;EACZ,CAAC,MAAM,IAAI,OAAOA,GAAG,KAAK,UAAU,EAAE;IACpC;IACA,OAAOA,GAAG,EAAE;EACd,CAAC,MAAM,IAAIE,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,EAAE;IAC7B,OAAOA,GAAG,CAACI,GAAG,CAACL,oBAAoB,CAAC;EACtC,CAAC,MAAM,IAAI,OAAOC,GAAG,KAAK,QAAQ,EAAE;IAClC,MAAMK,MAA8B,GAAG,CAAC,CAAC;IACzC,KAAK,MAAMC,QAAQ,IAAIN,GAAG,EAAE;MAC1B,IAAIA,GAAG,CAACO,cAAc,CAACD,QAAQ,CAAC,EAAE;QAChCD,MAAM,CAACC,QAAQ,CAAC,GAAGP,oBAAoB,CAACC,GAAG,CAACM,QAAQ,CAAC,CAAC;MACxD;IACF;IACA,OAAOD,MAAM;EACf;EACA;EACA,MAAM,KAAIG,qBAAW,EAAE,4CAA2CR,GAAI,EAAC,EAAE,gBAAgB,CAAC;AAC5F;AAEO,SAASS,qBAAqB,CAACT,GAAQ,EAAO;EACnD,IAAI,OAAOA,GAAG,KAAK,QAAQ,IAAI,CAACE,KAAK,CAACC,OAAO,CAACH,GAAG,CAAC,EAAE;IAClD,MAAMK,MAA8B,GAAG,CAAC,CAAC;IACzC,KAAK,MAAMC,QAAQ,IAAIN,GAAG,EAAE;MAC1B,IAAIA,GAAG,CAACO,cAAc,CAACD,QAAQ,CAAC,EAAE;QAChC,IAAI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AAO,CAACH,GAAG,CAAC,EAAE;IAClD,MAAMK,MAA8B,GAAG,CAAC,CAAC;IACzC,KAAK,MAAMC,QAAQ,IAAIN,GAAG,EAAE;MAC1B,IAAIA,GAAG,CAACO,cAAc,CAACD,QAAQ,CAAC,EAAE;QAChC,IAAIA,QAAQ,KAAK,MAAM,EAAE;UACvB;UACAD,MAAM,CAACC,QAAQ,CAAC,GAAGN,GAAG,CAACM,QAAQ,CAAC;QAClC,CAAC,MAAM,IAAIA,QAAQ,KAAK,SAAS,IAAIJ,KAAK,CAACC,OAAO,CAACH,GAAG,CAACM,QAAQ,CAAC,CAAC,EAAE;UACjE;UACAD,MAAM,CAACC,QAAQ,CAAC,GAAGN,GAAG,CAACM,QAAQ,CAAC,CAACF,GAAG,CAACM,0BAA0B,CAAC;QAClE,CAAC,MAAM;UACLL,MAAM,CAACC,QAAQ,CAAC,GAAGP,oBAAoB,CAACC,GAAG,CAACM,QAAQ,CAAC,CAAC;QACxD;MACF;IACF;IACA,OAAOD,MAAM;EACf;EACA,OAAON,oBAAoB,CAACC,GAAG,CAAC;AAClC"}
@@ -1,6 +1,6 @@
1
1
  import { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';
2
- declare type RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;
3
- export declare type DynamicConfigResults = {
2
+ type RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;
3
+ export type DynamicConfigResults = {
4
4
  config: RawDynamicConfig;
5
5
  exportedObjectType: string;
6
6
  };