@expo/config 57.0.0 → 57.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Config.d.ts +8 -1
- package/build/Config.js +29 -5
- package/build/Config.js.map +1 -1
- package/build/Config.types.d.ts +2 -1
- package/build/Config.types.js.map +1 -1
- package/build/paths/extensions.d.ts +3 -1
- package/build/paths/extensions.js +11 -0
- package/build/paths/extensions.js.map +1 -1
- package/package.json +4 -4
package/build/Config.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import type { ConfigFilePaths, ExpoConfig, GetConfigOptions, PackageJSONConfig, ProjectConfig, ProjectTarget, WriteConfigOptions } from './Config.types';
|
|
1
|
+
import type { ConfigFilePaths, ExpoConfig, GetConfigOptions, PackageJSONConfig, Platform, ProjectConfig, ProjectTarget, WriteConfigOptions } from './Config.types';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves the platforms a project targets, as configured or detected.
|
|
4
|
+
*
|
|
5
|
+
* @param projectRoot
|
|
6
|
+
* @param exp
|
|
7
|
+
*/
|
|
8
|
+
export declare function getPlatformsFromConfig(projectRoot: string, exp: Partial<ExpoConfig>): Platform[];
|
|
2
9
|
/**
|
|
3
10
|
* Evaluate the config for an Expo project.
|
|
4
11
|
* If a function is exported from the `app.config.js` then a partial config will be passed as an argument.
|
package/build/Config.js
CHANGED
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
var _exportNames = {
|
|
7
|
+
getPlatformsFromConfig: true,
|
|
7
8
|
getConfig: true,
|
|
8
9
|
getPackageJson: true,
|
|
9
10
|
getConfigFilePaths: true,
|
|
@@ -19,6 +20,7 @@ exports.getConfigFilePaths = getConfigFilePaths;
|
|
|
19
20
|
exports.getDefaultTarget = getDefaultTarget;
|
|
20
21
|
exports.getNameFromConfig = getNameFromConfig;
|
|
21
22
|
exports.getPackageJson = getPackageJson;
|
|
23
|
+
exports.getPlatformsFromConfig = getPlatformsFromConfig;
|
|
22
24
|
exports.getProjectConfigDescription = getProjectConfigDescription;
|
|
23
25
|
exports.getProjectConfigDescriptionWithPaths = getProjectConfigDescriptionWithPaths;
|
|
24
26
|
exports.getWebOutputPath = getWebOutputPath;
|
|
@@ -157,7 +159,7 @@ function reduceExpoObject(config) {
|
|
|
157
159
|
* @param projectRoot
|
|
158
160
|
* @param exp
|
|
159
161
|
*/
|
|
160
|
-
function getSupportedPlatforms(projectRoot) {
|
|
162
|
+
function getSupportedPlatforms(projectRoot, exp) {
|
|
161
163
|
const platforms = [];
|
|
162
164
|
if ((0, _requireUtils().resolveFrom)(projectRoot, 'react-native/package.json')) {
|
|
163
165
|
platforms.push('ios', 'android');
|
|
@@ -165,6 +167,29 @@ function getSupportedPlatforms(projectRoot) {
|
|
|
165
167
|
if ((0, _requireUtils().resolveFrom)(projectRoot, 'react-dom/package.json')) {
|
|
166
168
|
platforms.push('web');
|
|
167
169
|
}
|
|
170
|
+
if (exp.experiments?.outOfTreePlatforms) {
|
|
171
|
+
if ((0, _requireUtils().resolveFrom)(projectRoot, 'react-native-tvos/package.json')) {
|
|
172
|
+
platforms.push('tvos');
|
|
173
|
+
}
|
|
174
|
+
if ((0, _requireUtils().resolveFrom)(projectRoot, 'react-native-macos/package.json')) {
|
|
175
|
+
platforms.push('macos');
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return platforms;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Resolves the platforms a project targets, as configured or detected.
|
|
183
|
+
*
|
|
184
|
+
* @param projectRoot
|
|
185
|
+
* @param exp
|
|
186
|
+
*/
|
|
187
|
+
function getPlatformsFromConfig(projectRoot, exp) {
|
|
188
|
+
let platforms = exp?.platforms ?? getSupportedPlatforms(projectRoot, exp);
|
|
189
|
+
// TODO(@kitten): Update when XDL schema is modified
|
|
190
|
+
if (!exp.experiments?.outOfTreePlatforms) {
|
|
191
|
+
platforms = platforms.filter(platform => platform === 'android' || platform === 'ios' || platform === 'web');
|
|
192
|
+
}
|
|
168
193
|
return platforms;
|
|
169
194
|
}
|
|
170
195
|
|
|
@@ -511,10 +536,9 @@ function ensureConfigHasDefaultValues({
|
|
|
511
536
|
} catch (error) {
|
|
512
537
|
if (!skipSDKVersionRequirement) throw error;
|
|
513
538
|
}
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
}
|
|
539
|
+
|
|
540
|
+
// TODO(@kitten): Remove once platforms are updated in XDL schema
|
|
541
|
+
const platforms = getPlatformsFromConfig(projectRoot, exp);
|
|
518
542
|
return {
|
|
519
543
|
exp: {
|
|
520
544
|
...expWithDefaults,
|
package/build/Config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","names":["_jsonFile","data","_interopRequireDefault","require","_requireUtils","_deepmerge","_glob","_path","_semver","_slugify","_getConfig","_getExpoSDKVersion","_withConfigPlugins","_withInternal","_resolvePackageJson","_Config","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","hasWarnedAboutRootConfig","reduceExpoObject","config","expo","filter","length","ansiYellow","str","ansiGray","ansiBold","plural","console","warn","map","join","mods","getSupportedPlatforms","projectRoot","platforms","resolveFrom","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","mayHaveUnusedStaticConfig","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","hasUnusedStaticConfig","isModdedConfig","withConfigPlugins","skipPlugins","isPublicConfig","_internal","hooks","ios","android","updates","codeSigningCertificate","codeSigningMetadata","getContextConfig","exportedObjectType","rawDynamicConfig","getDynamicConfig","dynamicConfig","getPackageJson","getRootPackageJsonPath","JsonFile","read","getDynamicConfigFilePath","getStaticConfigFilePath","DYNAMIC_CONFIG_EXTS","extensions","modifyConfigAsync","modifications","readOptions","writeOptions","isDryRun","dryRun","outputConfig","mergeConfigModifications","configPath","path","writeAsync","json5","type","message","relative","newConfig","newConfighasModifications","isMatchingObject","plugins","modifiedExpoConfig","deepMerge","existingPlugins","fromEntries","definition","undefined","plugin","pluginName","pluginProps","Array","isArray","existingPlugin","existingPluginName","finalizedConfig","expectedValues","actualValues","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","gradleFiles","getProjectConfigDescription","getProjectConfigDescriptionWithPaths","projectConfig","relativeDynamicConfigPath"],"sources":["../src/Config.ts"],"sourcesContent":["import type { ModConfig } from '@expo/config-plugins';\nimport type { JSONObject } from '@expo/json-file';\nimport JsonFile from '@expo/json-file';\nimport { resolveFrom } from '@expo/require-utils';\nimport deepMerge from 'deepmerge';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport semver from 'semver';\nimport slugify from 'slugify';\n\nimport type {\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 { withConfigPlugins } from './plugins/withConfigPlugins';\nimport { withInternal } from './plugins/withInternal';\nimport { getRootPackageJsonPath } from './resolvePackageJson';\n\ntype SplitConfigs = { expo?: ExpoConfig; mods?: ModConfig };\n\nlet hasWarnedAboutRootConfig = false;\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 | null {\n if (!config) return config || null;\n\n if (config.expo && !hasWarnedAboutRootConfig) {\n const keys = Object.keys(config).filter((key) => key !== 'expo');\n if (keys.length) {\n hasWarnedAboutRootConfig = true;\n const ansiYellow = (str: string) => `\\u001B[33m${str}\\u001B[0m`;\n const ansiGray = (str: string) => `\\u001B[90m${str}\\u001B[0m`;\n const ansiBold = (str: string) => `\\u001B[1m${str}\\u001B[22m`;\n const plural = keys.length > 1;\n console.warn(\n ansiYellow(\n ansiBold('Warning: ') +\n `Root-level ${ansiBold(`\"expo\"`)} object found. Ignoring extra key${plural ? 's' : ''} in Expo config: ${keys\n .map((key) => `\"${key}\"`)\n .join(', ')}\\n` +\n ansiGray(`Learn more: https://expo.fyi/root-expo-object`)\n )\n );\n }\n }\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(projectRoot, 'react-native/package.json')) {\n platforms.push('ios', 'android');\n }\n if (resolveFrom(projectRoot, 'react-dom/package.json')) {\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(\n config: SplitConfigs,\n dynamicConfigObjectType: string | null,\n mayHaveUnusedStaticConfig: boolean = false\n ) {\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 hasUnusedStaticConfig:\n !!paths.staticConfigPath && !!paths.dynamicConfigPath && mayHaveUnusedStaticConfig,\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 // hooks no longer exists in the typescript type but should still be removed\n if ('hooks' in configWithDefaultValues.exp) {\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 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 {\n exportedObjectType,\n config: rawDynamicConfig,\n mayHaveUnusedStaticConfig,\n } = getDynamicConfig(paths.dynamicConfigPath, {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\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, mayHaveUnusedStaticConfig);\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\nconst DYNAMIC_CONFIG_EXTS = ['.ts', '.mts', '.cts', '.mjs', '.cjs', '.js'];\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n return resolveFrom(projectRoot, './app.config', { extensions: DYNAMIC_CONFIG_EXTS });\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n return resolveFrom(projectRoot, './app.config.json') ?? resolveFrom(projectRoot, './app.json');\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: ExpoConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n const isDryRun = writeOptions.dryRun;\n\n // Create or modify the static config, when not using dynamic config\n if (!config.dynamicConfigPath) {\n const outputConfig = mergeConfigModifications(config, modifications);\n\n if (!isDryRun) {\n const configPath = config.staticConfigPath ?? path.join(projectRoot, 'app.json');\n await JsonFile.writeAsync(configPath, outputConfig, { json5: false });\n }\n\n return { type: 'success', config: outputConfig.expo ?? outputConfig };\n }\n\n // Attempt to write to a function-like dynamic config, when used with a static config\n if (\n config.staticConfigPath &&\n config.dynamicConfigObjectType === 'function' &&\n !modifications.hasOwnProperty('plugins') // We don't know what plugins are in dynamic configs\n ) {\n const outputConfig = mergeConfigModifications(config, modifications);\n\n if (isDryRun) {\n return {\n type: 'warn',\n message: `Cannot verify config modifications in dry-run mode for config at: ${path.relative(projectRoot, config.dynamicConfigPath)}`,\n config: null,\n };\n }\n\n // Attempt to write the static config with the config modifications\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n\n // Verify that the dynamic config is using the static config\n const newConfig = getConfig(projectRoot, readOptions);\n const newConfighasModifications = isMatchingObject(modifications, newConfig.exp);\n if (newConfighasModifications) {\n return {\n type: 'success',\n config: newConfig.exp,\n };\n }\n\n // Rollback the changes when the reloaded config did not include the modifications\n await JsonFile.writeAsync(config.staticConfigPath, config.rootConfig, { json5: false });\n }\n\n // We cannot automatically write to a dynamic config\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}\n\n/**\n * Merge the config modifications, using an optional possible top-level `expo` object.\n * Note, changes in the plugins are merged differently to avoid duplicate entries.\n */\nfunction mergeConfigModifications(\n config: ProjectConfig,\n { plugins, ...modifications }: Partial<ExpoConfig>\n): AppJSONConfig {\n const modifiedExpoConfig: ExpoConfig = !config.rootConfig.expo\n ? deepMerge(config.rootConfig, modifications)\n : deepMerge(config.rootConfig.expo, modifications);\n\n if (plugins?.length) {\n // When adding plugins, ensure the config has a plugin list\n if (!modifiedExpoConfig.plugins) {\n modifiedExpoConfig.plugins = [];\n }\n\n // Create a plugin lookup map\n const existingPlugins: Record<string, any> = Object.fromEntries(\n modifiedExpoConfig.plugins.map((definition) =>\n typeof definition === 'string' ? [definition, undefined] : definition\n )\n );\n\n for (const plugin of plugins) {\n // Unpack the plugin definition, using either the short (string) or normal (array) notation\n const [pluginName, pluginProps] = Array.isArray(plugin) ? plugin : [plugin];\n // Abort if the plugin definition is empty\n if (!pluginName) continue;\n\n // Add the plugin if it doesn't exist yet, including its properties\n if (!(pluginName in existingPlugins)) {\n modifiedExpoConfig.plugins.push(plugin);\n continue;\n }\n\n // If the plugin has properties, and it exists, merge the properties\n if (pluginProps) {\n modifiedExpoConfig.plugins = modifiedExpoConfig.plugins.map((existingPlugin) => {\n const [existingPluginName] = Array.isArray(existingPlugin)\n ? existingPlugin\n : [existingPlugin];\n\n // Do not modify other plugins\n if (existingPluginName !== pluginName) {\n return existingPlugin;\n }\n\n // Add the props to the existing plugin entry\n if (typeof existingPlugin === 'string') {\n return [existingPlugin, pluginProps];\n }\n\n // Merge the props to the existing plugin properties\n if (Array.isArray(existingPlugin) && existingPlugin[0]) {\n return [existingPlugin[0], deepMerge(existingPlugin[1] ?? {}, pluginProps)];\n }\n\n return existingPlugin;\n });\n continue;\n }\n\n // If the same plugin exists with properties, and the modification does not contain properties, ignore\n }\n }\n\n const finalizedConfig = !config.rootConfig.expo\n ? modifiedExpoConfig\n : { ...config.rootConfig, expo: modifiedExpoConfig };\n\n return finalizedConfig as AppJSONConfig;\n}\n\nfunction isMatchingObject<T extends Record<string, any>>(\n expectedValues: T,\n actualValues: T\n): boolean {\n for (const key in expectedValues) {\n if (!expectedValues.hasOwnProperty(key)) {\n continue;\n }\n\n if (typeof expectedValues[key] === 'object' && actualValues[key] !== null) {\n if (!isMatchingObject(expectedValues[key], actualValues[key])) {\n return false;\n }\n } else {\n if (expectedValues[key] !== actualValues[key]) {\n return false;\n }\n }\n }\n return true;\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":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA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qBAAqB,EAAE;IAClDC,QAAQ,EAAE,IAAI;IACdC,GAAG,EAAE1H;EACP,CAAC,CAAC;EACF,IAAI2H,WAAW,CAACvI,MAAM,EAAE;IACtB,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASwI,2BAA2BA,CAAC5H,WAAmB,EAAU;EACvE,MAAMM,KAAK,GAAGC,kBAAkB,CAACP,WAAW,CAAC;EAC7C,OAAO6H,oCAAoC,CAAC7H,WAAW,EAAEM,KAAK,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASuH,oCAAoCA,CAClD7H,WAAmB,EACnB8H,aAA8B,EACtB;EACR,IAAIA,aAAa,CAACtG,iBAAiB,EAAE;IACnC,MAAMuG,yBAAyB,GAAGpE,eAAI,CAACK,QAAQ,CAAChE,WAAW,EAAE8H,aAAa,CAACtG,iBAAiB,CAAC;IAC7F,IAAIsG,aAAa,CAACrH,gBAAgB,EAAE;MAClC,OAAO,GAAGsH,yBAAyB,OAAOpE,eAAI,CAACK,QAAQ,CACrDhE,WAAW,EACX8H,aAAa,CAACrH,gBAChB,CAAC,EAAE;IACL;IACA,OAAOsH,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAACrH,gBAAgB,EAAE;IACzC,OAAOkD,eAAI,CAACK,QAAQ,CAAChE,WAAW,EAAE8H,aAAa,CAACrH,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Config.js","names":["_jsonFile","data","_interopRequireDefault","require","_requireUtils","_deepmerge","_glob","_path","_semver","_slugify","_getConfig","_getExpoSDKVersion","_withConfigPlugins","_withInternal","_resolvePackageJson","_Config","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","e","__esModule","default","hasWarnedAboutRootConfig","reduceExpoObject","config","expo","filter","length","ansiYellow","str","ansiGray","ansiBold","plural","console","warn","map","join","mods","getSupportedPlatforms","projectRoot","exp","platforms","resolveFrom","push","experiments","outOfTreePlatforms","getPlatformsFromConfig","platform","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","mayHaveUnusedStaticConfig","configWithDefaultValues","ensureConfigHasDefaultValues","pkg","skipSDKVersionRequirement","dynamicConfigPath","hasUnusedStaticConfig","isModdedConfig","withConfigPlugins","skipPlugins","isPublicConfig","_internal","hooks","ios","android","updates","codeSigningCertificate","codeSigningMetadata","getContextConfig","exportedObjectType","rawDynamicConfig","getDynamicConfig","dynamicConfig","getPackageJson","getRootPackageJsonPath","JsonFile","read","getDynamicConfigFilePath","getStaticConfigFilePath","DYNAMIC_CONFIG_EXTS","extensions","modifyConfigAsync","modifications","readOptions","writeOptions","isDryRun","dryRun","outputConfig","mergeConfigModifications","configPath","path","writeAsync","json5","type","message","relative","newConfig","newConfighasModifications","isMatchingObject","plugins","modifiedExpoConfig","deepMerge","existingPlugins","fromEntries","definition","undefined","plugin","pluginName","pluginProps","Array","isArray","existingPlugin","existingPluginName","finalizedConfig","expectedValues","actualValues","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","gradleFiles","getProjectConfigDescription","getProjectConfigDescriptionWithPaths","projectConfig","relativeDynamicConfigPath"],"sources":["../src/Config.ts"],"sourcesContent":["import type { ModConfig } from '@expo/config-plugins';\nimport type { JSONObject } from '@expo/json-file';\nimport JsonFile from '@expo/json-file';\nimport { resolveFrom } from '@expo/require-utils';\nimport deepMerge from 'deepmerge';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport semver from 'semver';\nimport slugify from 'slugify';\n\nimport type {\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 { withConfigPlugins } from './plugins/withConfigPlugins';\nimport { withInternal } from './plugins/withInternal';\nimport { getRootPackageJsonPath } from './resolvePackageJson';\n\ntype SplitConfigs = { expo?: ExpoConfig; mods?: ModConfig };\n\nlet hasWarnedAboutRootConfig = false;\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 | null {\n if (!config) return config || null;\n\n if (config.expo && !hasWarnedAboutRootConfig) {\n const keys = Object.keys(config).filter((key) => key !== 'expo');\n if (keys.length) {\n hasWarnedAboutRootConfig = true;\n const ansiYellow = (str: string) => `\\u001B[33m${str}\\u001B[0m`;\n const ansiGray = (str: string) => `\\u001B[90m${str}\\u001B[0m`;\n const ansiBold = (str: string) => `\\u001B[1m${str}\\u001B[22m`;\n const plural = keys.length > 1;\n console.warn(\n ansiYellow(\n ansiBold('Warning: ') +\n `Root-level ${ansiBold(`\"expo\"`)} object found. Ignoring extra key${plural ? 's' : ''} in Expo config: ${keys\n .map((key) => `\"${key}\"`)\n .join(', ')}\\n` +\n ansiGray(`Learn more: https://expo.fyi/root-expo-object`)\n )\n );\n }\n }\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, exp: Partial<ExpoConfig>): Platform[] {\n const platforms: Platform[] = [];\n if (resolveFrom(projectRoot, 'react-native/package.json')) {\n platforms.push('ios', 'android');\n }\n if (resolveFrom(projectRoot, 'react-dom/package.json')) {\n platforms.push('web');\n }\n if (exp.experiments?.outOfTreePlatforms) {\n if (resolveFrom(projectRoot, 'react-native-tvos/package.json')) {\n platforms.push('tvos');\n }\n if (resolveFrom(projectRoot, 'react-native-macos/package.json')) {\n platforms.push('macos');\n }\n }\n return platforms;\n}\n\n/**\n * Resolves the platforms a project targets, as configured or detected.\n *\n * @param projectRoot\n * @param exp\n */\nexport function getPlatformsFromConfig(projectRoot: string, exp: Partial<ExpoConfig>): Platform[] {\n let platforms =\n (exp?.platforms as Platform[] | undefined) ?? getSupportedPlatforms(projectRoot, exp);\n // TODO(@kitten): Update when XDL schema is modified\n if (!exp.experiments?.outOfTreePlatforms) {\n platforms = platforms.filter(\n (platform) => platform === 'android' || platform === 'ios' || platform === 'web'\n );\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(\n config: SplitConfigs,\n dynamicConfigObjectType: string | null,\n mayHaveUnusedStaticConfig: boolean = false\n ) {\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 hasUnusedStaticConfig:\n !!paths.staticConfigPath && !!paths.dynamicConfigPath && mayHaveUnusedStaticConfig,\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 // hooks no longer exists in the typescript type but should still be removed\n if ('hooks' in configWithDefaultValues.exp) {\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 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 {\n exportedObjectType,\n config: rawDynamicConfig,\n mayHaveUnusedStaticConfig,\n } = getDynamicConfig(paths.dynamicConfigPath, {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\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, mayHaveUnusedStaticConfig);\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\nconst DYNAMIC_CONFIG_EXTS = ['.ts', '.mts', '.cts', '.mjs', '.cjs', '.js'];\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n return resolveFrom(projectRoot, './app.config', { extensions: DYNAMIC_CONFIG_EXTS });\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n return resolveFrom(projectRoot, './app.config.json') ?? resolveFrom(projectRoot, './app.json');\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: ExpoConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n const isDryRun = writeOptions.dryRun;\n\n // Create or modify the static config, when not using dynamic config\n if (!config.dynamicConfigPath) {\n const outputConfig = mergeConfigModifications(config, modifications);\n\n if (!isDryRun) {\n const configPath = config.staticConfigPath ?? path.join(projectRoot, 'app.json');\n await JsonFile.writeAsync(configPath, outputConfig, { json5: false });\n }\n\n return { type: 'success', config: outputConfig.expo ?? outputConfig };\n }\n\n // Attempt to write to a function-like dynamic config, when used with a static config\n if (\n config.staticConfigPath &&\n config.dynamicConfigObjectType === 'function' &&\n !modifications.hasOwnProperty('plugins') // We don't know what plugins are in dynamic configs\n ) {\n const outputConfig = mergeConfigModifications(config, modifications);\n\n if (isDryRun) {\n return {\n type: 'warn',\n message: `Cannot verify config modifications in dry-run mode for config at: ${path.relative(projectRoot, config.dynamicConfigPath)}`,\n config: null,\n };\n }\n\n // Attempt to write the static config with the config modifications\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n\n // Verify that the dynamic config is using the static config\n const newConfig = getConfig(projectRoot, readOptions);\n const newConfighasModifications = isMatchingObject(modifications, newConfig.exp);\n if (newConfighasModifications) {\n return {\n type: 'success',\n config: newConfig.exp,\n };\n }\n\n // Rollback the changes when the reloaded config did not include the modifications\n await JsonFile.writeAsync(config.staticConfigPath, config.rootConfig, { json5: false });\n }\n\n // We cannot automatically write to a dynamic config\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}\n\n/**\n * Merge the config modifications, using an optional possible top-level `expo` object.\n * Note, changes in the plugins are merged differently to avoid duplicate entries.\n */\nfunction mergeConfigModifications(\n config: ProjectConfig,\n { plugins, ...modifications }: Partial<ExpoConfig>\n): AppJSONConfig {\n const modifiedExpoConfig: ExpoConfig = !config.rootConfig.expo\n ? deepMerge(config.rootConfig, modifications)\n : deepMerge(config.rootConfig.expo, modifications);\n\n if (plugins?.length) {\n // When adding plugins, ensure the config has a plugin list\n if (!modifiedExpoConfig.plugins) {\n modifiedExpoConfig.plugins = [];\n }\n\n // Create a plugin lookup map\n const existingPlugins: Record<string, any> = Object.fromEntries(\n modifiedExpoConfig.plugins.map((definition) =>\n typeof definition === 'string' ? [definition, undefined] : definition\n )\n );\n\n for (const plugin of plugins) {\n // Unpack the plugin definition, using either the short (string) or normal (array) notation\n const [pluginName, pluginProps] = Array.isArray(plugin) ? plugin : [plugin];\n // Abort if the plugin definition is empty\n if (!pluginName) continue;\n\n // Add the plugin if it doesn't exist yet, including its properties\n if (!(pluginName in existingPlugins)) {\n modifiedExpoConfig.plugins.push(plugin);\n continue;\n }\n\n // If the plugin has properties, and it exists, merge the properties\n if (pluginProps) {\n modifiedExpoConfig.plugins = modifiedExpoConfig.plugins.map((existingPlugin) => {\n const [existingPluginName] = Array.isArray(existingPlugin)\n ? existingPlugin\n : [existingPlugin];\n\n // Do not modify other plugins\n if (existingPluginName !== pluginName) {\n return existingPlugin;\n }\n\n // Add the props to the existing plugin entry\n if (typeof existingPlugin === 'string') {\n return [existingPlugin, pluginProps];\n }\n\n // Merge the props to the existing plugin properties\n if (Array.isArray(existingPlugin) && existingPlugin[0]) {\n return [existingPlugin[0], deepMerge(existingPlugin[1] ?? {}, pluginProps)];\n }\n\n return existingPlugin;\n });\n continue;\n }\n\n // If the same plugin exists with properties, and the modification does not contain properties, ignore\n }\n }\n\n const finalizedConfig = !config.rootConfig.expo\n ? modifiedExpoConfig\n : { ...config.rootConfig, expo: modifiedExpoConfig };\n\n return finalizedConfig as AppJSONConfig;\n}\n\nfunction isMatchingObject<T extends Record<string, any>>(\n expectedValues: T,\n actualValues: T\n): boolean {\n for (const key in expectedValues) {\n if (!expectedValues.hasOwnProperty(key)) {\n continue;\n }\n\n if (typeof expectedValues[key] === 'object' && actualValues[key] !== null) {\n if (!isMatchingObject(expectedValues[key], actualValues[key])) {\n return false;\n }\n } else {\n if (expectedValues[key] !== actualValues[key]) {\n return false;\n }\n }\n }\n return true;\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 // TODO(@kitten): Remove once platforms are updated in XDL schema\n const platforms = getPlatformsFromConfig(projectRoot, exp) as NonNullable<\n ExpoConfig['platforms']\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,cAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,aAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,WAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAE,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,MAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,KAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,OAAA,YAA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H,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAACpH,gBAAgB,EAAE;IACzC,OAAOiD,eAAI,CAACK,QAAQ,CAACpE,WAAW,EAAEkI,aAAa,CAACpH,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB","ignoreList":[]}
|
package/build/Config.types.d.ts
CHANGED
|
@@ -130,7 +130,8 @@ export declare enum ProjectPrivacy {
|
|
|
130
130
|
PUBLIC = "public",
|
|
131
131
|
UNLISTED = "unlisted"
|
|
132
132
|
}
|
|
133
|
-
export type Platform = 'android' | 'ios' | 'web';
|
|
133
|
+
export type Platform = 'android' | 'ios' | 'web' | 'tvos' | 'macos';
|
|
134
|
+
export type NativePlatform = Exclude<Platform, 'web'>;
|
|
134
135
|
export type ProjectTarget = 'managed' | 'bare';
|
|
135
136
|
export type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'DEPRECATED' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG' | 'ENTRY_NOT_FOUND';
|
|
136
137
|
export type ConfigContext = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.types.js","names":["ProjectPrivacy","exports"],"sources":["../src/Config.types.ts"],"sourcesContent":["import type { ModConfig } from '@expo/config-plugins';\nimport type { ExpoConfig } from '@expo/config-types';\n\nexport type {\n ExpoConfig,\n Web as ExpoConfigWeb,\n Android as ExpoConfigAndroid,\n IOS as ExpoConfigIOS,\n IOSIcons as ExpoConfigIOSIcons,\n AndroidIntentFiltersData as ExpoConfigAndroidIntentFiltersData,\n} from '@expo/config-types';\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 /**\n * Returns true if both a static and dynamic config are present, and the dynamic config is applied on top of the static.\n * This is only used for expo-doctor diagnostic warnings. This flag may be true even in cases where all static config values are used.\n * It only checks against a typical pattern for layering static and dynamic config, e.g.,:\n * module.exports = ({ config }) => {\n return {\n ...config,\n name: 'name overridden by dynamic config',\n };\n };\n */\n hasUnusedStaticConfig: boolean;\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 debuggerHost: string;\n developer: {\n tool: string | null;\n projectRoot?: string;\n };\n packagerOpts: {\n [key: string]: any;\n };\n username?: string;\n};\n\nexport type EASConfig = {\n projectId?: string;\n};\n\nexport type ClientScopingConfig = {\n scopeKey?: string;\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?: ExpoConfig & {\n /**\n * Only present during development using @expo/cli.\n */\n hostUri?: string;\n };\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 | 'ENTRY_NOT_FOUND';\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":";;;;;;IAwIYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"Config.types.js","names":["ProjectPrivacy","exports"],"sources":["../src/Config.types.ts"],"sourcesContent":["import type { ModConfig } from '@expo/config-plugins';\nimport type { ExpoConfig } from '@expo/config-types';\n\nexport type {\n ExpoConfig,\n Web as ExpoConfigWeb,\n Android as ExpoConfigAndroid,\n IOS as ExpoConfigIOS,\n IOSIcons as ExpoConfigIOSIcons,\n AndroidIntentFiltersData as ExpoConfigAndroidIntentFiltersData,\n} from '@expo/config-types';\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 /**\n * Returns true if both a static and dynamic config are present, and the dynamic config is applied on top of the static.\n * This is only used for expo-doctor diagnostic warnings. This flag may be true even in cases where all static config values are used.\n * It only checks against a typical pattern for layering static and dynamic config, e.g.,:\n * module.exports = ({ config }) => {\n return {\n ...config,\n name: 'name overridden by dynamic config',\n };\n };\n */\n hasUnusedStaticConfig: boolean;\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 debuggerHost: string;\n developer: {\n tool: string | null;\n projectRoot?: string;\n };\n packagerOpts: {\n [key: string]: any;\n };\n username?: string;\n};\n\nexport type EASConfig = {\n projectId?: string;\n};\n\nexport type ClientScopingConfig = {\n scopeKey?: string;\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?: ExpoConfig & {\n /**\n * Only present during development using @expo/cli.\n */\n hostUri?: string;\n };\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' | 'tvos' | 'macos';\nexport type NativePlatform = Exclude<Platform, '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 | 'ENTRY_NOT_FOUND';\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":";;;;;;IAwIYA,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA","ignoreList":[]}
|
|
@@ -3,6 +3,8 @@ export type LanguageOptions = {
|
|
|
3
3
|
isModern: boolean;
|
|
4
4
|
isReact: boolean;
|
|
5
5
|
};
|
|
6
|
-
export declare function getExtensions(platforms: string[], extensions: string[], workflows: string[]): string[];
|
|
6
|
+
export declare function getExtensions(platforms: readonly string[], extensions: readonly string[], workflows: readonly string[]): string[];
|
|
7
7
|
export declare function getLanguageExtensionsInOrder({ isTS, isModern, isReact, }: LanguageOptions): string[];
|
|
8
8
|
export declare function getBareExtensions(platforms: string[], languageOptions?: LanguageOptions): string[];
|
|
9
|
+
/** Expand `extensions` with OOT platform extensions for platform */
|
|
10
|
+
export declare function getPlatformExtensions(platform: string, extensions: readonly string[], customPlatformExtensions: readonly string[] | undefined): string[] | null;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getBareExtensions = getBareExtensions;
|
|
7
7
|
exports.getExtensions = getExtensions;
|
|
8
8
|
exports.getLanguageExtensionsInOrder = getLanguageExtensionsInOrder;
|
|
9
|
+
exports.getPlatformExtensions = getPlatformExtensions;
|
|
9
10
|
function _assert() {
|
|
10
11
|
const data = _interopRequireDefault(require("assert"));
|
|
11
12
|
_assert = function () {
|
|
@@ -60,6 +61,16 @@ function getBareExtensions(platforms, languageOptions = {
|
|
|
60
61
|
_addMiscellaneousExtensions(platforms, fileExtensions);
|
|
61
62
|
return fileExtensions;
|
|
62
63
|
}
|
|
64
|
+
const PLATFORM_EXTENSIONS = {
|
|
65
|
+
tvos: ['tvos', 'ios', 'native'],
|
|
66
|
+
macos: ['macos', 'ios', 'native']
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
/** Expand `extensions` with OOT platform extensions for platform */
|
|
70
|
+
function getPlatformExtensions(platform, extensions, customPlatformExtensions) {
|
|
71
|
+
const platformExtensions = customPlatformExtensions || PLATFORM_EXTENSIONS[platform];
|
|
72
|
+
return platformExtensions ? getExtensions(platformExtensions, extensions, []) : null;
|
|
73
|
+
}
|
|
63
74
|
function _addMiscellaneousExtensions(platforms, fileExtensions) {
|
|
64
75
|
// Always add these with no platform extension
|
|
65
76
|
// In the future we may want to add platform and workspace extensions to json.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extensions.js","names":["_assert","data","_interopRequireDefault","require","e","__esModule","default","getExtensions","platforms","extensions","workflows","assert","Array","isArray","fileExtensions","workflow","platform","extension","push","filter","Boolean","join","getLanguageExtensionsInOrder","isTS","isModern","isReact","addLanguage","lang","unshift","getBareExtensions","languageOptions","_addMiscellaneousExtensions","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 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":"
|
|
1
|
+
{"version":3,"file":"extensions.js","names":["_assert","data","_interopRequireDefault","require","e","__esModule","default","getExtensions","platforms","extensions","workflows","assert","Array","isArray","fileExtensions","workflow","platform","extension","push","filter","Boolean","join","getLanguageExtensionsInOrder","isTS","isModern","isReact","addLanguage","lang","unshift","getBareExtensions","languageOptions","_addMiscellaneousExtensions","PLATFORM_EXTENSIONS","tvos","macos","getPlatformExtensions","customPlatformExtensions","platformExtensions","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: readonly string[],\n extensions: readonly string[],\n workflows: readonly 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 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\nconst PLATFORM_EXTENSIONS: Record<string, readonly string[]> = {\n tvos: ['tvos', 'ios', 'native'],\n macos: ['macos', 'ios', 'native'],\n};\n\n/** Expand `extensions` with OOT platform extensions for platform */\nexport function getPlatformExtensions(\n platform: string,\n extensions: readonly string[],\n customPlatformExtensions: readonly string[] | undefined\n): string[] | null {\n const platformExtensions = customPlatformExtensions || PLATFORM_EXTENSIONS[platform];\n return platformExtensions ? getExtensions(platformExtensions, extensions, []) : null;\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('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xB,cAAc,CAACI,IAAI,CAAC,MAAM,CAAC;EAC7B;EACA,OAAOJ,cAAc;AACvB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config",
|
|
3
|
-
"version": "57.0.
|
|
3
|
+
"version": "57.0.1",
|
|
4
4
|
"description": "A library for interacting with the app.json",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"repository": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"paths"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@expo/config-plugins": "~57.0.
|
|
28
|
-
"@expo/config-types": "^57.0.
|
|
27
|
+
"@expo/config-plugins": "~57.0.1",
|
|
28
|
+
"@expo/config-types": "^57.0.1",
|
|
29
29
|
"@expo/json-file": "^11.0.0",
|
|
30
30
|
"@expo/require-utils": "^57.0.0",
|
|
31
31
|
"deepmerge": "^4.3.1",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "b134c8d1eb906156ef7d5f6fee1a70ff0d9a8f22",
|
|
49
49
|
"scripts": {
|
|
50
50
|
"build": "tsc --emitDeclarationOnly && babel src --out-dir build --extensions \".ts\" --source-maps --ignore \"src/**/__mocks__/*\",\"src/**/__tests__/*\"",
|
|
51
51
|
"clean": "expo-module clean",
|