@expo/config 8.5.5 → 9.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/Config.js +12 -18
- package/build/Config.js.map +1 -1
- package/build/Config.types.js +3 -4
- package/build/Config.types.js.map +1 -1
- package/build/environment.js +1 -2
- package/build/environment.js.map +1 -1
- package/build/evalConfig.js +4 -6
- package/build/evalConfig.js.map +1 -1
- package/build/getAccountUsername.js +1 -2
- package/build/getAccountUsername.js.map +1 -1
- package/build/getExpoSDKVersion.js +1 -2
- package/build/getExpoSDKVersion.js.map +1 -1
- package/build/getUserState.js +2 -2
- package/build/getUserState.js.map +1 -1
- package/build/paths/paths.js +1 -1
- package/build/paths/paths.js.map +1 -1
- package/build/plugins/withConfigPlugins.js +1 -2
- package/build/plugins/withConfigPlugins.js.map +1 -1
- package/build/plugins/withInternal.js +1 -2
- package/build/plugins/withInternal.js.map +1 -1
- package/package.json +6 -6
package/build/Config.js
CHANGED
|
@@ -127,12 +127,11 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
127
127
|
* @param config Input config object to reduce
|
|
128
128
|
*/
|
|
129
129
|
function reduceExpoObject(config) {
|
|
130
|
-
var _config$expo;
|
|
131
130
|
if (!config) return config === undefined ? null : config;
|
|
132
131
|
const {
|
|
133
132
|
mods,
|
|
134
133
|
...expo
|
|
135
|
-
} =
|
|
134
|
+
} = config.expo ?? config;
|
|
136
135
|
return {
|
|
137
136
|
expo,
|
|
138
137
|
mods
|
|
@@ -209,9 +208,8 @@ function getConfig(projectRoot, options = {}) {
|
|
|
209
208
|
hasUnusedStaticConfig: !!paths.staticConfigPath && !!paths.dynamicConfigPath && mayHaveUnusedStaticConfig
|
|
210
209
|
};
|
|
211
210
|
if (options.isModdedConfig) {
|
|
212
|
-
var _config$mods;
|
|
213
211
|
// @ts-ignore: Add the mods back to the object.
|
|
214
|
-
configWithDefaultValues.exp.mods =
|
|
212
|
+
configWithDefaultValues.exp.mods = config.mods ?? null;
|
|
215
213
|
}
|
|
216
214
|
|
|
217
215
|
// Apply static json plugins, should be done after _internal
|
|
@@ -221,7 +219,6 @@ function getConfig(projectRoot, options = {}) {
|
|
|
221
219
|
delete configWithDefaultValues.exp.mods;
|
|
222
220
|
}
|
|
223
221
|
if (options.isPublicConfig) {
|
|
224
|
-
var _configWithDefaultVal, _configWithDefaultVal2, _configWithDefaultVal3, _configWithDefaultVal4;
|
|
225
222
|
// TODD(EvanBacon): Drop plugins array after it's been resolved.
|
|
226
223
|
|
|
227
224
|
// Remove internal values with references to user's file paths from the public config.
|
|
@@ -229,14 +226,14 @@ function getConfig(projectRoot, options = {}) {
|
|
|
229
226
|
if (configWithDefaultValues.exp.hooks) {
|
|
230
227
|
delete configWithDefaultValues.exp.hooks;
|
|
231
228
|
}
|
|
232
|
-
if (
|
|
229
|
+
if (configWithDefaultValues.exp.ios?.config) {
|
|
233
230
|
delete configWithDefaultValues.exp.ios.config;
|
|
234
231
|
}
|
|
235
|
-
if (
|
|
232
|
+
if (configWithDefaultValues.exp.android?.config) {
|
|
236
233
|
delete configWithDefaultValues.exp.android.config;
|
|
237
234
|
}
|
|
238
|
-
|
|
239
|
-
|
|
235
|
+
delete configWithDefaultValues.exp.updates?.codeSigningCertificate;
|
|
236
|
+
delete configWithDefaultValues.exp.updates?.codeSigningMetadata;
|
|
240
237
|
}
|
|
241
238
|
return configWithDefaultValues;
|
|
242
239
|
}
|
|
@@ -386,13 +383,12 @@ function ensureConfigHasDefaultValues({
|
|
|
386
383
|
packageJsonPath,
|
|
387
384
|
skipSDKVersionRequirement = false
|
|
388
385
|
}) {
|
|
389
|
-
var _exp$name, _exp$slug, _exp$version;
|
|
390
386
|
if (!exp) {
|
|
391
387
|
exp = {};
|
|
392
388
|
}
|
|
393
389
|
exp = (0, _withInternal().withInternal)(exp, {
|
|
394
390
|
projectRoot,
|
|
395
|
-
...(paths
|
|
391
|
+
...(paths ?? {}),
|
|
396
392
|
packageJsonPath
|
|
397
393
|
});
|
|
398
394
|
// Defaults for package.json fields
|
|
@@ -405,9 +401,9 @@ function ensureConfigHasDefaultValues({
|
|
|
405
401
|
};
|
|
406
402
|
|
|
407
403
|
// Defaults for app.json/app.config.js fields
|
|
408
|
-
const name =
|
|
409
|
-
const slug =
|
|
410
|
-
const version =
|
|
404
|
+
const name = exp.name ?? pkgName;
|
|
405
|
+
const slug = exp.slug ?? (0, _slugify().default)(name.toLowerCase());
|
|
406
|
+
const version = exp.version ?? pkgVersion;
|
|
411
407
|
let description = exp.description;
|
|
412
408
|
if (!description && typeof pkg.description === 'string') {
|
|
413
409
|
description = pkg.description;
|
|
@@ -440,12 +436,11 @@ function ensureConfigHasDefaultValues({
|
|
|
440
436
|
}
|
|
441
437
|
const DEFAULT_BUILD_PATH = `web-build`;
|
|
442
438
|
function getWebOutputPath(config = {}) {
|
|
443
|
-
var _expo$web, _expo$web$build;
|
|
444
439
|
if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {
|
|
445
440
|
return process.env.WEBPACK_BUILD_OUTPUT_PATH;
|
|
446
441
|
}
|
|
447
442
|
const expo = config.expo || config || {};
|
|
448
|
-
return
|
|
443
|
+
return expo?.web?.build?.output || DEFAULT_BUILD_PATH;
|
|
449
444
|
}
|
|
450
445
|
function getNameFromConfig(exp = {}) {
|
|
451
446
|
// For RN CLI support
|
|
@@ -463,8 +458,7 @@ function getNameFromConfig(exp = {}) {
|
|
|
463
458
|
};
|
|
464
459
|
}
|
|
465
460
|
function getDefaultTarget(projectRoot, exp) {
|
|
466
|
-
|
|
467
|
-
(_exp = exp) !== null && _exp !== void 0 ? _exp : exp = getConfig(projectRoot, {
|
|
461
|
+
exp ??= getConfig(projectRoot, {
|
|
468
462
|
skipSDKVersionRequirement: true
|
|
469
463
|
}).exp;
|
|
470
464
|
|
package/build/Config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.js","names":["_jsonFile","data","_interopRequireDefault","require","_fs","_glob","_path","_resolveFrom","_semver","_slugify","_getConfig","_getExpoSDKVersion","_withConfigPlugins","_withInternal","_resolvePackageJson","_Config","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","obj","__esModule","default","reduceExpoObject","config","_config$expo","undefined","mods","expo","getSupportedPlatforms","projectRoot","platforms","resolveFrom","silent","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","mayHaveUnusedStaticConfig","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","hasUnusedStaticConfig","isModdedConfig","_config$mods","withConfigPlugins","skipPlugins","isPublicConfig","_configWithDefaultVal","_configWithDefaultVal2","_configWithDefaultVal3","_configWithDefaultVal4","_internal","hooks","ios","android","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","_exp$name","_exp$slug","_exp$version","withInternal","pkgName","name","basename","pkgVersion","version","pkgWithDefaults","slug","slugify","toLowerCase","description","expWithDefaults","sdkVersion","getExpoSDKVersion","error","DEFAULT_BUILD_PATH","getWebOutputPath","_expo$web","_expo$web$build","process","env","WEBPACK_BUILD_OUTPUT_PATH","web","build","output","getNameFromConfig","appManifest","appName","displayName","webName","getDefaultTarget","_exp","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 { 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(\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 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 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\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,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,O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nB"}
|
|
1
|
+
{"version":3,"file":"Config.js","names":["_jsonFile","data","_interopRequireDefault","require","_fs","_glob","_path","_resolveFrom","_semver","_slugify","_getConfig","_getExpoSDKVersion","_withConfigPlugins","_withInternal","_resolvePackageJson","_Config","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","obj","__esModule","default","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","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","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 { 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(\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 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 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\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,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,IAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,GAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,MAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,KAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,aAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,YAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,QAAA;EAAA,MAAAP,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAK,OAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,SAAA;EAAA,MAAAR,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAM,QAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAaA,SAAAS,WAAA;EAAA,MAAAT,IAA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BAAiB,CAAC;IAC7F,IAAImF,aAAa,CAAClG,gBAAgB,EAAE;MAClC,OAAQ,GAAEmG,yBAA0B,OAAM1D,eAAI,CAACU,QAAQ,CACrD7D,WAAW,EACX4G,aAAa,CAAClG,gBAChB,CAAE,EAAC;IACL;IACA,OAAOmG,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAAClG,gBAAgB,EAAE;IACzC,OAAOyC,eAAI,CAACU,QAAQ,CAAC7D,WAAW,EAAE4G,aAAa,CAAClG,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB"}
|
package/build/Config.types.js
CHANGED
|
@@ -17,10 +17,9 @@ function _configTypes() {
|
|
|
17
17
|
};
|
|
18
18
|
return data;
|
|
19
19
|
}
|
|
20
|
-
let ProjectPrivacy
|
|
21
|
-
exports.ProjectPrivacy = ProjectPrivacy;
|
|
22
|
-
(function (ProjectPrivacy) {
|
|
20
|
+
let ProjectPrivacy = exports.ProjectPrivacy = /*#__PURE__*/function (ProjectPrivacy) {
|
|
23
21
|
ProjectPrivacy["PUBLIC"] = "public";
|
|
24
22
|
ProjectPrivacy["UNLISTED"] = "unlisted";
|
|
25
|
-
|
|
23
|
+
return ProjectPrivacy;
|
|
24
|
+
}({});
|
|
26
25
|
//# sourceMappingURL=Config.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.types.js","names":["_configTypes","data","require","ProjectPrivacy","exports"],"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 /**\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 // 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 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 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":";;;;;;;;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgD,IAmIpCE,cAAc
|
|
1
|
+
{"version":3,"file":"Config.types.js","names":["_configTypes","data","require","ProjectPrivacy","exports"],"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 /**\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 // 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 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 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":";;;;;;;;;;;;AACA,SAAAA,aAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,YAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAgD,IAmIpCE,cAAc,GAAAC,OAAA,CAAAD,cAAA,0BAAdA,cAAc;EAAdA,cAAc;EAAdA,cAAc;EAAA,OAAdA,cAAc;AAAA"}
|
package/build/environment.js
CHANGED
|
@@ -4,6 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.NON_STANDARD_SYMBOL = void 0;
|
|
7
|
-
const NON_STANDARD_SYMBOL = Symbol('non-standard');
|
|
8
|
-
exports.NON_STANDARD_SYMBOL = NON_STANDARD_SYMBOL;
|
|
7
|
+
const NON_STANDARD_SYMBOL = exports.NON_STANDARD_SYMBOL = Symbol('non-standard');
|
|
9
8
|
//# sourceMappingURL=environment.js.map
|
package/build/environment.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"environment.js","names":["NON_STANDARD_SYMBOL","
|
|
1
|
+
{"version":3,"file":"environment.js","names":["NON_STANDARD_SYMBOL","exports","Symbol"],"sources":["../src/environment.ts"],"sourcesContent":["export const NON_STANDARD_SYMBOL = Symbol('non-standard');\n"],"mappings":";;;;;;AAAO,MAAMA,mBAAmB,GAAAC,OAAA,CAAAD,mBAAA,GAAGE,MAAM,CAAC,cAAc,CAAC"}
|
package/build/evalConfig.js
CHANGED
|
@@ -111,8 +111,7 @@ function extractLocationFromSyntaxError(error) {
|
|
|
111
111
|
// An example is a module that includes an import statement.
|
|
112
112
|
function extractImportantStackFromNodeError(error) {
|
|
113
113
|
if (isSyntaxError(error)) {
|
|
114
|
-
|
|
115
|
-
const traces = (_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : _error$stack.split('\n').filter(line => !line.startsWith(' at '));
|
|
114
|
+
const traces = error.stack?.split('\n').filter(line => !line.startsWith(' at '));
|
|
116
115
|
if (!traces) return null;
|
|
117
116
|
|
|
118
117
|
// Remove redundant line
|
|
@@ -138,11 +137,10 @@ function isSyntaxError(error) {
|
|
|
138
137
|
* @param request
|
|
139
138
|
*/
|
|
140
139
|
function resolveConfigExport(result, configFile, request) {
|
|
141
|
-
var _request$config, _result, _result2;
|
|
142
140
|
// add key to static config that we'll check for after the dynamic is evaluated
|
|
143
141
|
// to see if the static config was used in determining the dynamic
|
|
144
142
|
const hasBaseStaticConfig = _environment().NON_STANDARD_SYMBOL;
|
|
145
|
-
if (request
|
|
143
|
+
if (request?.config) {
|
|
146
144
|
// @ts-ignore
|
|
147
145
|
request.config[hasBaseStaticConfig] = true;
|
|
148
146
|
}
|
|
@@ -163,13 +161,13 @@ function resolveConfigExport(result, configFile, request) {
|
|
|
163
161
|
// to suggest that there *may* be a problem.
|
|
164
162
|
const mayHaveUnusedStaticConfig =
|
|
165
163
|
// @ts-ignore
|
|
166
|
-
|
|
164
|
+
request?.config?.[hasBaseStaticConfig] && !result?.[hasBaseStaticConfig];
|
|
167
165
|
if (result) {
|
|
168
166
|
delete result._hasBaseStaticConfig;
|
|
169
167
|
}
|
|
170
168
|
|
|
171
169
|
// If the expo object exists, ignore all other values.
|
|
172
|
-
if (
|
|
170
|
+
if (result?.expo) {
|
|
173
171
|
result = (0, _Serialize().serializeSkippingMods)(result.expo);
|
|
174
172
|
} else {
|
|
175
173
|
result = (0, _Serialize().serializeSkippingMods)(result);
|
package/build/evalConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evalConfig.js","names":["_fs","data","require","_requireFromString","_interopRequireDefault","_sucrase","_Errors","_Serialize","_environment","obj","__esModule","default","evalConfig","configFile","request","contents","readFileSync","result","code","transform","filePath","transforms","requireString","error","location","extractLocationFromSyntaxError","codeFrameColumns","codeFrame","start","loc","highlightCode","message","importantStack","extractImportantStackFromNodeError","resolveConfigExport","line","lineNumber","column","columnNumber","isSyntaxError","
|
|
1
|
+
{"version":3,"file":"evalConfig.js","names":["_fs","data","require","_requireFromString","_interopRequireDefault","_sucrase","_Errors","_Serialize","_environment","obj","__esModule","default","evalConfig","configFile","request","contents","readFileSync","result","code","transform","filePath","transforms","requireString","error","location","extractLocationFromSyntaxError","codeFrameColumns","codeFrame","start","loc","highlightCode","message","importantStack","extractImportantStackFromNodeError","resolveConfigExport","line","lineNumber","column","columnNumber","isSyntaxError","traces","stack","split","filter","startsWith","length","pop","join","SyntaxError","constructor","name","hasBaseStaticConfig","NON_STANDARD_SYMBOL","config","exportedObjectType","Promise","ConfigError","mayHaveUnusedStaticConfig","_hasBaseStaticConfig","expo","serializeSkippingMods"],"sources":["../src/evalConfig.ts"],"sourcesContent":["import { readFileSync } from 'fs';\nimport requireString from 'require-from-string';\nimport { transform } from 'sucrase';\n\nimport { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\nimport { serializeSkippingMods } from './Serialize';\nimport { NON_STANDARD_SYMBOL } from './environment';\n\ntype RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;\n\nexport type DynamicConfigResults = {\n config: RawDynamicConfig;\n exportedObjectType: string;\n mayHaveUnusedStaticConfig: boolean;\n};\n\n/**\n * Transpile and evaluate the dynamic config object.\n * This method is shared between the standard reading method in getConfig, and the headless script.\n *\n * @param options configFile path to the dynamic app.config.*, request to send to the dynamic config if it exports a function.\n * @returns the serialized and evaluated config along with the exported object type (object or function).\n */\nexport function evalConfig(\n configFile: string,\n request: ConfigContext | null\n): DynamicConfigResults {\n const contents = readFileSync(configFile, 'utf8');\n let result: any;\n try {\n const { code } = transform(contents, {\n filePath: configFile,\n transforms: ['typescript', 'imports'],\n });\n\n result = requireString(code, configFile);\n } catch (error: any) {\n const location = extractLocationFromSyntaxError(error);\n\n // Apply a code frame preview to the error if possible, sucrase doesn't do this by default.\n if (location) {\n const { codeFrameColumns } = require('@babel/code-frame');\n const codeFrame = codeFrameColumns(contents, { start: error.loc }, { highlightCode: true });\n error.codeFrame = codeFrame;\n error.message += `\\n${codeFrame}`;\n } else {\n const importantStack = extractImportantStackFromNodeError(error);\n\n if (importantStack) {\n error.message += `\\n${importantStack}`;\n }\n }\n throw error;\n }\n return resolveConfigExport(result, configFile, request);\n}\n\nfunction extractLocationFromSyntaxError(\n error: Error | any\n): { line: number; column?: number } | null {\n // sucrase provides the `loc` object\n if (error.loc) {\n return error.loc;\n }\n\n // `SyntaxError`s provide the `lineNumber` and `columnNumber` properties\n if ('lineNumber' in error && 'columnNumber' in error) {\n return { line: error.lineNumber, column: error.columnNumber };\n }\n\n return null;\n}\n\n// These kinda errors often come from syntax errors in files that were imported by the main file.\n// An example is a module that includes an import statement.\nfunction extractImportantStackFromNodeError(error: any): string | null {\n if (isSyntaxError(error)) {\n const traces = error.stack?.split('\\n').filter((line) => !line.startsWith(' at '));\n if (!traces) return null;\n\n // Remove redundant line\n if (traces[traces.length - 1].startsWith('SyntaxError:')) {\n traces.pop();\n }\n return traces.join('\\n');\n }\n return null;\n}\n\nfunction isSyntaxError(error: any): error is SyntaxError {\n return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';\n}\n\n/**\n * - Resolve the exported contents of an Expo config (be it default or module.exports)\n * - Assert no promise exports\n * - Return config type\n * - Serialize config\n *\n * @param result\n * @param configFile\n * @param request\n */\nexport function resolveConfigExport(\n result: any,\n configFile: string,\n request: ConfigContext | null\n) {\n // add key to static config that we'll check for after the dynamic is evaluated\n // to see if the static config was used in determining the dynamic\n const hasBaseStaticConfig = NON_STANDARD_SYMBOL;\n if (request?.config) {\n // @ts-ignore\n request.config[hasBaseStaticConfig] = true;\n }\n if (result.default != null) {\n result = result.default;\n }\n const exportedObjectType = typeof result;\n if (typeof result === 'function') {\n result = result(request);\n }\n\n if (result instanceof Promise) {\n throw new ConfigError(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');\n }\n\n // If the key is not added, it suggests that the static config was not used as the base for the dynamic.\n // note(Keith): This is the most common way to use static and dynamic config together, but not the only way.\n // Hence, this is only output from getConfig() for informational purposes for use by tools like Expo Doctor\n // to suggest that there *may* be a problem.\n const mayHaveUnusedStaticConfig =\n // @ts-ignore\n request?.config?.[hasBaseStaticConfig] && !result?.[hasBaseStaticConfig];\n if (result) {\n delete result._hasBaseStaticConfig;\n }\n\n // If the expo object exists, ignore all other values.\n if (result?.expo) {\n result = serializeSkippingMods(result.expo);\n } else {\n result = serializeSkippingMods(result);\n }\n\n return { config: result, exportedObjectType, mayHaveUnusedStaticConfig };\n}\n"],"mappings":";;;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,mBAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,kBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,SAAA;EAAA,MAAAJ,IAAA,GAAAC,OAAA;EAAAG,QAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,QAAA;EAAA,MAAAL,IA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MOUS_USERNAME = 'anonymous';
|
|
|
21
21
|
* the EAS project ID, falling back to the `owner` field.
|
|
22
22
|
*/
|
|
23
23
|
function getAccountUsername(manifest = {}) {
|
|
24
|
-
var _getUserState$read$au;
|
|
25
24
|
// TODO: Must match what's generated in Expo Go.
|
|
26
25
|
const username = manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;
|
|
27
26
|
if (username) {
|
|
28
27
|
return username;
|
|
29
28
|
}
|
|
30
29
|
// Statically get the username from the global user state.
|
|
31
|
-
return (
|
|
30
|
+
return (0, _getUserState().getUserState)().read().auth?.username || ANONYMOUS_USERNAME;
|
|
32
31
|
}
|
|
33
32
|
//# sourceMappingURL=getAccountUsername.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAccountUsername.js","names":["_getUserState","data","require","ANONYMOUS_USERNAME","getAccountUsername","manifest","
|
|
1
|
+
{"version":3,"file":"getAccountUsername.js","names":["_getUserState","data","require","ANONYMOUS_USERNAME","getAccountUsername","manifest","username","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","getUserState","read","auth"],"sources":["../src/getAccountUsername.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { getUserState } from './getUserState';\n\nconst ANONYMOUS_USERNAME = 'anonymous';\n\n/**\n * Get the owner of the project from the manifest if specified, falling back to a bunch of different things\n * which may or may not be the owner of the project.\n *\n * @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using\n * the EAS project ID, falling back to the `owner` field.\n */\nexport function getAccountUsername(manifest: Pick<ExpoConfig, 'owner'> = {}): string {\n // TODO: Must match what's generated in Expo Go.\n const username =\n manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;\n if (username) {\n return username;\n }\n // Statically get the username from the global user state.\n return getUserState().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"mappings":";;;;;;AAEA,SAAAA,cAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,aAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,MAAME,kBAAkB,GAAG,WAAW;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkBA,CAACC,QAAmC,GAAG,CAAC,CAAC,EAAU;EACnF;EACA,MAAMC,QAAQ,GACZD,QAAQ,CAACE,KAAK,IAAIC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAIF,OAAO,CAACC,GAAG,CAACE,kBAAkB;EACnF,IAAIL,QAAQ,EAAE;IACZ,OAAOA,QAAQ;EACjB;EACA;EACA,OAAO,IAAAM,4BAAY,EAAC,CAAC,CAACC,IAAI,CAAC,CAAC,CAACC,IAAI,EAAER,QAAQ,IAAIH,kBAAkB;AACnE"}
|
|
@@ -31,8 +31,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
31
31
|
* version of the `expo` package.
|
|
32
32
|
*/
|
|
33
33
|
function getExpoSDKVersion(projectRoot, exp = {}) {
|
|
34
|
-
|
|
35
|
-
return (_exp$sdkVersion = exp === null || exp === void 0 ? void 0 : exp.sdkVersion) !== null && _exp$sdkVersion !== void 0 ? _exp$sdkVersion : getExpoSDKVersionFromPackage(projectRoot);
|
|
34
|
+
return exp?.sdkVersion ?? getExpoSDKVersionFromPackage(projectRoot);
|
|
36
35
|
}
|
|
37
36
|
|
|
38
37
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getExpoSDKVersion.js","names":["_jsonFile","data","_interopRequireDefault","require","_resolveFrom","_Errors","obj","__esModule","default","getExpoSDKVersion","projectRoot","exp","
|
|
1
|
+
{"version":3,"file":"getExpoSDKVersion.js","names":["_jsonFile","data","_interopRequireDefault","require","_resolveFrom","_Errors","obj","__esModule","default","getExpoSDKVersion","projectRoot","exp","sdkVersion","getExpoSDKVersionFromPackage","packageJsonPath","resolveFrom","silent","ConfigError","expoPackageJson","JsonFile","read","json5","version","packageVersion","majorVersion","split","shift"],"sources":["../src/getExpoSDKVersion.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport resolveFrom from 'resolve-from';\n\nimport { ExpoConfig } from './Config.types';\nimport { ConfigError } from './Errors';\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nexport function getExpoSDKVersion(\n projectRoot: string,\n exp: Pick<ExpoConfig, 'sdkVersion'> = {}\n): string {\n return exp?.sdkVersion ?? getExpoSDKVersionFromPackage(projectRoot);\n}\n\n/**\n * Resolve the Expo SDK Version either from the input Expo config or from the installed\n * version of the `expo` package.\n */\nfunction getExpoSDKVersionFromPackage(projectRoot: string): string {\n const packageJsonPath = resolveFrom.silent(projectRoot, 'expo/package.json');\n if (!packageJsonPath) {\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` is not installed. Please install it with \\`yarn add expo\\` and try again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n const expoPackageJson = JsonFile.read(packageJsonPath, { json5: true });\n const { version: packageVersion } = expoPackageJson;\n\n if (!(typeof packageVersion === 'string')) {\n // This is technically impossible.\n throw new ConfigError(\n `Cannot determine which native SDK version your project uses because the module \\`expo\\` has an invalid package.json (missing \\`version\\` field). Try reinstalling node modules and trying again.`,\n 'MODULE_NOT_FOUND'\n );\n }\n\n const majorVersion = packageVersion.split('.').shift();\n return `${majorVersion}.0.0`;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,aAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,YAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAI,QAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,OAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAAuC,SAAAC,uBAAAI,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAEvC;AACA;AACA;AACA;AACO,SAASG,iBAAiBA,CAC/BC,WAAmB,EACnBC,GAAmC,GAAG,CAAC,CAAC,EAChC;EACR,OAAOA,GAAG,EAAEC,UAAU,IAAIC,4BAA4B,CAACH,WAAW,CAAC;AACrE;;AAEA;AACA;AACA;AACA;AACA,SAASG,4BAA4BA,CAACH,WAAmB,EAAU;EACjE,MAAMI,eAAe,GAAGC,sBAAW,CAACC,MAAM,CAACN,WAAW,EAAE,mBAAmB,CAAC;EAC5E,IAAI,CAACI,eAAe,EAAE;IACpB,MAAM,KAAIG,qBAAW,EAClB,mKAAkK,EACnK,kBACF,CAAC;EACH;EACA,MAAMC,eAAe,GAAGC,mBAAQ,CAACC,IAAI,CAACN,eAAe,EAAE;IAAEO,KAAK,EAAE;EAAK,CAAC,CAAC;EACvE,MAAM;IAAEC,OAAO,EAAEC;EAAe,CAAC,GAAGL,eAAe;EAEnD,IAAI,EAAE,OAAOK,cAAc,KAAK,QAAQ,CAAC,EAAE;IACzC;IACA,MAAM,KAAIN,qBAAW,EAClB,kMAAiM,EAClM,kBACF,CAAC;EACH;EAEA,MAAMO,YAAY,GAAGD,cAAc,CAACE,KAAK,CAAC,GAAG,CAAC,CAACC,KAAK,CAAC,CAAC;EACtD,OAAQ,GAAEF,YAAa,MAAK;AAC9B"}
|
package/build/getUserState.js
CHANGED
|
@@ -34,8 +34,8 @@ function path() {
|
|
|
34
34
|
};
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
37
|
-
function _getRequireWildcardCache(
|
|
38
|
-
function _interopRequireWildcard(
|
|
37
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
38
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
39
39
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
40
40
|
// The ~/.expo directory is used to store authentication sessions,
|
|
41
41
|
// which are shared between EAS CLI and Expo CLI.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUserState.js","names":["_jsonFile","data","_interopRequireDefault","require","_getenv","_os","path","_interopRequireWildcard","_getRequireWildcardCache","
|
|
1
|
+
{"version":3,"file":"getUserState.js","names":["_jsonFile","data","_interopRequireDefault","require","_getenv","_os","path","_interopRequireWildcard","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","obj","getExpoHomeDirectory","home","homedir","process","env","__UNSAFE_EXPO_HOME_DIRECTORY","boolish","join","getUserStatePath","getUserState","JsonFile","jsonParseErrorDefault","cantReadFileDefault"],"sources":["../src/getUserState.ts"],"sourcesContent":["import JsonFile from '@expo/json-file';\nimport { boolish } from 'getenv';\nimport { homedir } from 'os';\nimport * as path from 'path';\n\nexport type UserSettingsData = {\n developmentCodeSigningId?: string;\n appleId?: string;\n accessToken?: string;\n auth?: UserData | null;\n ignoreBundledBinaries?: string[];\n openDevToolsAtStartup?: boolean;\n PATH?: string;\n sendTo?: string;\n uuid?: string;\n};\n\nexport type UserData = {\n appleId?: string;\n userId?: string;\n username?: string;\n currentConnection?: ConnectionType;\n sessionSecret?: string;\n};\n\nexport type ConnectionType =\n | 'Access-Token-Authentication'\n | 'Username-Password-Authentication'\n | 'facebook'\n | 'google-oauth2'\n | 'github';\n\n// The ~/.expo directory is used to store authentication sessions,\n// which are shared between EAS CLI and Expo CLI.\nexport function getExpoHomeDirectory() {\n const home = homedir();\n\n if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {\n return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;\n } else if (boolish('EXPO_STAGING', false)) {\n return path.join(home, '.expo-staging');\n } else if (boolish('EXPO_LOCAL', false)) {\n return path.join(home, '.expo-local');\n }\n return path.join(home, '.expo');\n}\n\nexport function getUserStatePath() {\n return path.join(getExpoHomeDirectory(), 'state.json');\n}\n\nexport function getUserState() {\n return new JsonFile<UserSettingsData>(getUserStatePath(), {\n jsonParseErrorDefault: {},\n // This will ensure that an error isn't thrown if the file doesn't exist.\n cantReadFileDefault: {},\n });\n}\n"],"mappings":";;;;;;;;AAAA,SAAAA,UAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,SAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,QAAA;EAAA,MAAAH,IAAA,GAAAE,OAAA;EAAAC,OAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,IAAA;EAAA,MAAAJ,IAAA,GAAAE,OAAA;EAAAE,GAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,KAAA;EAAA,MAAAL,IAAA,GAAAM,uBAAA,CAAAJ,OAAA;EAAAG,IAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAA6B,SAAAO,yBA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AA,EAAG;EACrC,MAAMC,IAAI,GAAG,IAAAC,aAAO,EAAC,CAAC;EAEtB,IAAIC,OAAO,CAACC,GAAG,CAACC,4BAA4B,EAAE;IAC5C,OAAOF,OAAO,CAACC,GAAG,CAACC,4BAA4B;EACjD,CAAC,MAAM,IAAI,IAAAC,iBAAO,EAAC,cAAc,EAAE,KAAK,CAAC,EAAE;IACzC,OAAO9B,IAAI,CAAD,CAAC,CAAC+B,IAAI,CAACN,IAAI,EAAE,eAAe,CAAC;EACzC,CAAC,MAAM,IAAI,IAAAK,iBAAO,EAAC,YAAY,EAAE,KAAK,CAAC,EAAE;IACvC,OAAO9B,IAAI,CAAD,CAAC,CAAC+B,IAAI,CAACN,IAAI,EAAE,aAAa,CAAC;EACvC;EACA,OAAOzB,IAAI,CAAD,CAAC,CAAC+B,IAAI,CAACN,IAAI,EAAE,OAAO,CAAC;AACjC;AAEO,SAASO,gBAAgBA,CAAA,EAAG;EACjC,OAAOhC,IAAI,CAAD,CAAC,CAAC+B,IAAI,CAACP,oBAAoB,CAAC,CAAC,EAAE,YAAY,CAAC;AACxD;AAEO,SAASS,YAAYA,CAAA,EAAG;EAC7B,OAAO,KAAIC,mBAAQ,EAAmBF,gBAAgB,CAAC,CAAC,EAAE;IACxDG,qBAAqB,EAAE,CAAC,CAAC;IACzB;IACAC,mBAAmB,EAAE,CAAC;EACxB,CAAC,CAAC;AACJ"}
|
package/build/paths/paths.js
CHANGED
|
@@ -110,7 +110,7 @@ function resolveEntryPoint(projectRoot, {
|
|
|
110
110
|
function resolveFromSilentWithExtensions(fromDirectory, moduleId, extensions) {
|
|
111
111
|
for (const extension of extensions) {
|
|
112
112
|
const modulePath = _resolveFrom().default.silent(fromDirectory, `${moduleId}.${extension}`);
|
|
113
|
-
if (modulePath
|
|
113
|
+
if (modulePath?.endsWith(extension)) {
|
|
114
114
|
return modulePath;
|
|
115
115
|
}
|
|
116
116
|
}
|
package/build/paths/paths.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.js","names":["_fs","data","_interopRequireDefault","require","_path","_resolveFrom","_extensions","_Config","_Errors","obj","__esModule","default","ensureSlash","inputPath","needsSlash","hasSlash","endsWith","substr","length","getPossibleProjectRoot","fs","realpathSync","process","cwd","nativePlatforms","resolveEntryPoint","projectRoot","platform","pkg","getPackageJson","platforms","includes","extensions","getBareExtensions","main","entry","getFileWithExtensions","resolveFromSilentWithExtensions","ConfigError","resolveFrom","fromDirectory","moduleId","extension","modulePath","silent","path","join","existsSync"],"sources":["../../src/paths/paths.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getBareExtensions } from './extensions';\nimport { getPackageJson } from '../Config';\nimport { PackageJSONConfig } from '../Config.types';\nimport { ConfigError } from '../Errors';\n\n// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22\nexport function ensureSlash(inputPath: string, needsSlash: boolean): string {\n const hasSlash = inputPath.endsWith('/');\n if (hasSlash && !needsSlash) {\n return inputPath.substr(0, inputPath.length - 1);\n } else if (!hasSlash && needsSlash) {\n return `${inputPath}/`;\n } else {\n return inputPath;\n }\n}\n\nexport function getPossibleProjectRoot(): string {\n return fs.realpathSync(process.cwd());\n}\n\nconst nativePlatforms = ['ios', 'android'];\n\n/** @returns the absolute entry file for an Expo project. */\nexport function resolveEntryPoint(\n projectRoot: string,\n {\n platform,\n pkg = getPackageJson(projectRoot),\n }: {\n platform?: string;\n pkg?: PackageJSONConfig;\n } = {}\n): string {\n const platforms = !platform\n ? []\n : nativePlatforms.includes(platform)\n
|
|
1
|
+
{"version":3,"file":"paths.js","names":["_fs","data","_interopRequireDefault","require","_path","_resolveFrom","_extensions","_Config","_Errors","obj","__esModule","default","ensureSlash","inputPath","needsSlash","hasSlash","endsWith","substr","length","getPossibleProjectRoot","fs","realpathSync","process","cwd","nativePlatforms","resolveEntryPoint","projectRoot","platform","pkg","getPackageJson","platforms","includes","extensions","getBareExtensions","main","entry","getFileWithExtensions","resolveFromSilentWithExtensions","ConfigError","resolveFrom","fromDirectory","moduleId","extension","modulePath","silent","path","join","existsSync"],"sources":["../../src/paths/paths.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getBareExtensions } from './extensions';\nimport { getPackageJson } from '../Config';\nimport { PackageJSONConfig } from '../Config.types';\nimport { ConfigError } from '../Errors';\n\n// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22\nexport function ensureSlash(inputPath: string, needsSlash: boolean): string {\n const hasSlash = inputPath.endsWith('/');\n if (hasSlash && !needsSlash) {\n return inputPath.substr(0, inputPath.length - 1);\n } else if (!hasSlash && needsSlash) {\n return `${inputPath}/`;\n } else {\n return inputPath;\n }\n}\n\nexport function getPossibleProjectRoot(): string {\n return fs.realpathSync(process.cwd());\n}\n\nconst nativePlatforms = ['ios', 'android'];\n\n/** @returns the absolute entry file for an Expo project. */\nexport function resolveEntryPoint(\n projectRoot: string,\n {\n platform,\n pkg = getPackageJson(projectRoot),\n }: {\n platform?: string;\n pkg?: PackageJSONConfig;\n } = {}\n): string {\n const platforms = !platform\n ? []\n : nativePlatforms.includes(platform)\n ? [platform, 'native']\n : [platform];\n const extensions = getBareExtensions(platforms);\n\n // If the config doesn't define a custom entry then we want to look at the `package.json`s `main` field, and try again.\n const { main } = pkg;\n if (main && typeof main === 'string') {\n // Testing the main field against all of the provided extensions - for legacy reasons we can't use node module resolution as the package.json allows you to pass in a file without a relative path and expect it as a relative path.\n let entry = getFileWithExtensions(projectRoot, main, extensions);\n if (!entry) {\n // Allow for paths like: `{ \"main\": \"expo/AppEntry\" }`\n entry = resolveFromSilentWithExtensions(projectRoot, main, extensions);\n if (!entry)\n throw new ConfigError(\n `Cannot resolve entry file: The \\`main\\` field defined in your \\`package.json\\` points to an unresolvable or non-existent path.`,\n 'ENTRY_NOT_FOUND'\n );\n }\n return entry;\n }\n\n // Check for a root index.* file in the project root.\n const entry = resolveFromSilentWithExtensions(projectRoot, './index', extensions);\n if (entry) {\n return entry;\n }\n\n try {\n // If none of the default files exist then we will attempt to use the main Expo entry point.\n // This requires `expo` to be installed in the project to work as it will use `node_module/expo/AppEntry.js`\n // Doing this enables us to create a bare minimum Expo project.\n\n // TODO(Bacon): We may want to do a check against `./App` and `expo` in the `package.json` `dependencies` as we can more accurately ensure that the project is expo-min without needing the modules installed.\n return resolveFrom(projectRoot, 'expo/AppEntry');\n } catch {\n throw new ConfigError(\n `The project entry file could not be resolved. Define it in the \\`main\\` field of the \\`package.json\\`, create an \\`index.js\\`, or install the \\`expo\\` package.`,\n 'ENTRY_NOT_FOUND'\n );\n }\n}\n\n// Resolve from but with the ability to resolve like a bundler\nfunction resolveFromSilentWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n for (const extension of extensions) {\n const modulePath = resolveFrom.silent(fromDirectory, `${moduleId}.${extension}`);\n if (modulePath?.endsWith(extension)) {\n return modulePath;\n }\n }\n return resolveFrom.silent(fromDirectory, moduleId) || null;\n}\n\n// Statically attempt to resolve a module but with the ability to resolve like a bundler.\n// This won't use node module resolution.\nexport function getFileWithExtensions(\n fromDirectory: string,\n moduleId: string,\n extensions: string[]\n): string | null {\n const modulePath = path.join(fromDirectory, moduleId);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n for (const extension of extensions) {\n const modulePath = path.join(fromDirectory, `${moduleId}.${extension}`);\n if (fs.existsSync(modulePath)) {\n return modulePath;\n }\n }\n return null;\n}\n"],"mappings":";;;;;;;;;AAAA,SAAAA,IAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,GAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,MAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,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AS,IAAIV,UAAU,EAAE;IAClC,MAAMW,UAAU,GAAGJ,sBAAW,CAACK,MAAM,CAACJ,aAAa,EAAG,GAAEC,QAAS,IAAGC,SAAU,EAAC,CAAC;IAChF,IAAIC,UAAU,EAAE3B,QAAQ,CAAC0B,SAAS,CAAC,EAAE;MACnC,OAAOC,UAAU;IACnB;EACF;EACA,OAAOJ,sBAAW,CAACK,MAAM,CAACJ,aAAa,EAAEC,QAAQ,CAAC,IAAI,IAAI;AAC5D;;AAEA;AACA;AACO,SAASL,qBAAqBA,CACnCI,aAAqB,EACrBC,QAAgB,EAChBT,UAAoB,EACL;EACf,MAAMW,UAAU,GAAGE,eAAI,CAACC,IAAI,CAACN,aAAa,EAAEC,QAAQ,CAAC;EACrD,IAAIrB,aAAE,CAAC2B,UAAU,CAACJ,UAAU,CAAC,EAAE;IAC7B,OAAOA,UAAU;EACnB;EACA,KAAK,MAAMD,SAAS,IAAIV,UAAU,EAAE;IAClC,MAAMW,UAAU,GAAGE,eAAI,CAACC,IAAI,CAACN,aAAa,EAAG,GAAEC,QAAS,IAAGC,SAAU,EAAC,CAAC;IACvE,IAAItB,aAAE,CAAC2B,UAAU,CAACJ,UAAU,CAAC,EAAE;MAC7B,OAAOA,UAAU;IACnB;EACF;EACA,OAAO,IAAI;AACb"}
|
|
@@ -25,9 +25,8 @@ function _Serialize() {
|
|
|
25
25
|
* @param projectRoot
|
|
26
26
|
*/
|
|
27
27
|
const withConfigPlugins = (config, skipPlugins) => {
|
|
28
|
-
var _config$plugins;
|
|
29
28
|
// @ts-ignore: plugins not on config type yet -- TODO
|
|
30
|
-
if (!Array.isArray(config.plugins) || !
|
|
29
|
+
if (!Array.isArray(config.plugins) || !config.plugins?.length) {
|
|
31
30
|
return config;
|
|
32
31
|
}
|
|
33
32
|
if (!skipPlugins) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withConfigPlugins.js","names":["_configPlugins","data","require","_Serialize","withConfigPlugins","config","skipPlugins","
|
|
1
|
+
{"version":3,"file":"withConfigPlugins.js","names":["_configPlugins","data","require","_Serialize","withConfigPlugins","config","skipPlugins","Array","isArray","plugins","length","withPlugins","serializeAfterStaticPlugins","exports"],"sources":["../../src/plugins/withConfigPlugins.ts"],"sourcesContent":["import { ConfigPlugin, withPlugins } from '@expo/config-plugins';\n\nimport { serializeAfterStaticPlugins } from '../Serialize';\n\n/**\n * Resolves static plugins array as config plugin functions.\n *\n * @param config\n * @param projectRoot\n */\nexport const withConfigPlugins: ConfigPlugin<boolean> = (config, skipPlugins) => {\n // @ts-ignore: plugins not on config type yet -- TODO\n if (!Array.isArray(config.plugins) || !config.plugins?.length) {\n return config;\n }\n if (!skipPlugins) {\n // Resolve and evaluate plugins\n // @ts-ignore: TODO: add plugins to the config schema\n config = withPlugins(config, config.plugins);\n } else {\n // Delete the plugins array in case someone added functions or other values which cannot be automatically serialized.\n delete config.plugins;\n }\n // plugins aren't serialized by default, serialize the plugins after resolving them.\n return serializeAfterStaticPlugins(config);\n};\n"],"mappings":";;;;;;AAAA,SAAAA,eAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,cAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,WAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,UAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,iBAAwC,GAAGA,CAACC,MAAM,EAAEC,WAAW,KAAK;EAC/E;EACA,IAAI,CAACC,KAAK,CAACC,OAAO,CAACH,MAAM,CAACI,OAAO,CAAC,IAAI,CAACJ,MAAM,CAACI,OAAO,EAAEC,MAAM,EAAE;IAC7D,OAAOL,MAAM;EACf;EACA,IAAI,CAACC,WAAW,EAAE;IAChB;IACA;IACAD,MAAM,GAAG,IAAAM,4BAAW,EAACN,MAAM,EAAEA,MAAM,CAACI,OAAO,CAAC;EAC9C,CAAC,MAAM;IACL;IACA,OAAOJ,MAAM,CAACI,OAAO;EACvB;EACA;EACA,OAAO,IAAAG,wCAA2B,EAACP,MAAM,CAAC;AAC5C,CAAC;AAACQ,OAAA,CAAAT,iBAAA,GAAAA,iBAAA"}
|
|
@@ -11,7 +11,7 @@ function _getenv() {
|
|
|
11
11
|
};
|
|
12
12
|
return data;
|
|
13
13
|
}
|
|
14
|
-
const EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
|
|
14
|
+
const EXPO_DEBUG = exports.EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* Adds the _internal object.
|
|
@@ -19,7 +19,6 @@ const EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
|
|
|
19
19
|
* @param config
|
|
20
20
|
* @param projectRoot
|
|
21
21
|
*/
|
|
22
|
-
exports.EXPO_DEBUG = EXPO_DEBUG;
|
|
23
22
|
const withInternal = (config, internals) => {
|
|
24
23
|
if (!config._internal) {
|
|
25
24
|
config._internal = {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withInternal.js","names":["_getenv","data","require","EXPO_DEBUG","
|
|
1
|
+
{"version":3,"file":"withInternal.js","names":["_getenv","data","require","EXPO_DEBUG","exports","boolish","withInternal","config","internals","_internal","isDebug"],"sources":["../../src/plugins/withInternal.ts"],"sourcesContent":["import { ConfigPlugin } from '@expo/config-plugins';\nimport { boolish } from 'getenv';\n\nimport { ConfigFilePaths } from '../Config.types';\n\nexport const EXPO_DEBUG = boolish('EXPO_DEBUG', false);\n\n/**\n * Adds the _internal object.\n *\n * @param config\n * @param projectRoot\n */\nexport const withInternal: ConfigPlugin<\n { projectRoot: string; packageJsonPath?: string } & Partial<ConfigFilePaths>\n> = (config, internals) => {\n if (!config._internal) {\n config._internal = {};\n }\n\n config._internal = {\n isDebug: EXPO_DEBUG,\n ...config._internal,\n ...internals,\n };\n\n return config;\n};\n"],"mappings":";;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIO,MAAME,UAAU,GAAAC,OAAA,CAAAD,UAAA,GAAG,IAAAE,iBAAO,EAAC,YAAY,EAAE,KAAK,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,YAEZ,GAAGA,CAACC,MAAM,EAAEC,SAAS,KAAK;EACzB,IAAI,CAACD,MAAM,CAACE,SAAS,EAAE;IACrBF,MAAM,CAACE,SAAS,GAAG,CAAC,CAAC;EACvB;EAEAF,MAAM,CAACE,SAAS,GAAG;IACjBC,OAAO,EAAEP,UAAU;IACnB,GAAGI,MAAM,CAACE,SAAS;IACnB,GAAGD;EACL,CAAC;EAED,OAAOD,MAAM;AACf,CAAC;AAACH,OAAA,CAAAE,YAAA,GAAAA,YAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0-beta.0",
|
|
4
4
|
"description": "A library for interacting with the app.json",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@babel/code-frame": "~7.10.4",
|
|
37
|
-
"@expo/config-plugins": "~
|
|
38
|
-
"@expo/config-types": "^
|
|
39
|
-
"@expo/json-file": "^8.
|
|
37
|
+
"@expo/config-plugins": "~8.0.0-beta.0",
|
|
38
|
+
"@expo/config-types": "^51.0.0-unreleased",
|
|
39
|
+
"@expo/json-file": "^8.3.0",
|
|
40
40
|
"getenv": "^1.0.0",
|
|
41
41
|
"glob": "7.1.6",
|
|
42
42
|
"require-from-string": "^2.0.2",
|
|
43
43
|
"resolve-from": "^5.0.0",
|
|
44
|
-
"semver": "7.
|
|
44
|
+
"semver": "^7.6.0",
|
|
45
45
|
"slugify": "^1.3.4",
|
|
46
46
|
"sucrase": "3.34.0"
|
|
47
47
|
},
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "0546595aefd73806a57a62e6075e2744c6d21cf2"
|
|
56
56
|
}
|