@expo/config 8.0.0 → 8.0.2

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 CHANGED
@@ -86,13 +86,6 @@ function _getExpoSDKVersion() {
86
86
  };
87
87
  return data;
88
88
  }
89
- function _getFullName() {
90
- const data = require("./getFullName");
91
- _getFullName = function () {
92
- return data;
93
- };
94
- return data;
95
- }
96
89
  function _withConfigPlugins() {
97
90
  const data = require("./plugins/withConfigPlugins");
98
91
  _withConfigPlugins = function () {
@@ -241,12 +234,6 @@ function getConfig(projectRoot, options = {}) {
241
234
  if ((_configWithDefaultVal2 = configWithDefaultValues.exp.android) !== null && _configWithDefaultVal2 !== void 0 && _configWithDefaultVal2.config) {
242
235
  delete configWithDefaultValues.exp.android.config;
243
236
  }
244
-
245
- // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).
246
- // @ts-ignore: currentFullName not on type yet.
247
- configWithDefaultValues.exp.currentFullName = (0, _getFullName().getFullName)(configWithDefaultValues.exp);
248
- // @ts-ignore: originalFullName not on type yet.
249
- configWithDefaultValues.exp.originalFullName = (0, _getFullName().getFullName)(configWithDefaultValues.exp);
250
237
  (_configWithDefaultVal3 = configWithDefaultValues.exp.updates) === null || _configWithDefaultVal3 === void 0 ? true : delete _configWithDefaultVal3.codeSigningCertificate;
251
238
  (_configWithDefaultVal4 = configWithDefaultValues.exp.updates) === null || _configWithDefaultVal4 === void 0 ? true : delete _configWithDefaultVal4.codeSigningMetadata;
252
239
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Config.js","names":["reduceExpoObject","config","undefined","mods","expo","getSupportedPlatforms","projectRoot","platforms","resolveFrom","silent","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","isModdedConfig","withConfigPlugins","skipPlugins","isPublicConfig","_internal","hooks","ios","android","currentFullName","getFullName","originalFullName","updates","codeSigningCertificate","codeSigningMetadata","getContextConfig","exportedObjectType","rawDynamicConfig","getDynamicConfig","dynamicConfig","getPackageJson","getRootPackageJsonPath","JsonFile","read","getDynamicConfigFilePath","getStaticConfigFilePath","fileName","configPath","path","join","fs","existsSync","modifyConfigAsync","modifications","readOptions","writeOptions","type","message","relative","outputConfig","dryRun","writeAsync","json5","withInternal","pkgName","name","basename","pkgVersion","version","pkgWithDefaults","slug","slugify","toLowerCase","description","expWithDefaults","sdkVersion","getExpoSDKVersion","error","DEFAULT_BUILD_PATH","getWebOutputPath","process","env","WEBPACK_BUILD_OUTPUT_PATH","web","build","output","getNameFromConfig","appManifest","appName","displayName","webName","getDefaultTarget","semver","lt","isBareWorkflowProject","dependencies","expokit","xcodeprojFiles","globSync","absolute","cwd","length","gradleFiles","getProjectConfigDescription","getProjectConfigDescriptionWithPaths","projectConfig","relativeDynamicConfigPath"],"sources":["../src/Config.ts"],"sourcesContent":["import { ModConfig } from '@expo/config-plugins';\nimport JsonFile, { JSONObject } from '@expo/json-file';\nimport fs from 'fs';\nimport { sync as globSync } from 'glob';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\nimport semver from 'semver';\nimport slugify from 'slugify';\n\nimport {\n AppJSONConfig,\n ConfigFilePaths,\n ExpoConfig,\n GetConfigOptions,\n PackageJSONConfig,\n Platform,\n ProjectConfig,\n ProjectTarget,\n WriteConfigOptions,\n} from './Config.types';\nimport { getDynamicConfig, getStaticConfig } from './getConfig';\nimport { getExpoSDKVersion } from './getExpoSDKVersion';\nimport { getFullName } from './getFullName';\nimport { withConfigPlugins } from './plugins/withConfigPlugins';\nimport { withInternal } from './plugins/withInternal';\nimport { getRootPackageJsonPath } from './resolvePackageJson';\n\ntype SplitConfigs = { expo: ExpoConfig; mods: ModConfig };\n\n/**\n * If a config has an `expo` object then that will be used as the config.\n * This method reduces out other top level values if an `expo` object exists.\n *\n * @param config Input config object to reduce\n */\nfunction reduceExpoObject(config?: any): SplitConfigs {\n if (!config) return config === undefined ? null : config;\n\n const { mods, ...expo } = config.expo ?? config;\n\n return {\n expo,\n mods,\n };\n}\n\n/**\n * Get all platforms that a project is currently capable of running.\n *\n * @param projectRoot\n * @param exp\n */\nfunction getSupportedPlatforms(projectRoot: string): Platform[] {\n const platforms: Platform[] = [];\n if (resolveFrom.silent(projectRoot, 'react-native')) {\n platforms.push('ios', 'android');\n }\n if (resolveFrom.silent(projectRoot, 'react-native-web')) {\n platforms.push('web');\n }\n return platforms;\n}\n\n/**\n * Evaluate the config for an Expo project.\n * If a function is exported from the `app.config.js` then a partial config will be passed as an argument.\n * The partial config is composed from any existing app.json, and certain fields from the `package.json` like name and description.\n *\n * If options.isPublicConfig is true, the Expo config will include only public-facing options (omitting private keys).\n * The resulting config should be suitable for hosting or embedding in a publicly readable location.\n *\n * **Example**\n * ```js\n * module.exports = function({ config }) {\n * // mutate the config before returning it.\n * config.slug = 'new slug'\n * return { expo: config };\n * }\n * ```\n *\n * **Supports**\n * - `app.config.ts`\n * - `app.config.js`\n * - `app.config.json`\n * - `app.json`\n *\n * @param projectRoot the root folder containing all of your application code\n * @param options enforce criteria for a project config\n */\nexport function getConfig(projectRoot: string, options: GetConfigOptions = {}): ProjectConfig {\n const paths = getConfigFilePaths(projectRoot);\n\n const rawStaticConfig = paths.staticConfigPath ? getStaticConfig(paths.staticConfigPath) : null;\n // For legacy reasons, always return an object.\n const rootConfig = (rawStaticConfig || {}) as AppJSONConfig;\n const staticConfig = reduceExpoObject(rawStaticConfig) || {};\n\n // Can only change the package.json location if an app.json or app.config.json exists\n const [packageJson, packageJsonPath] = getPackageJsonAndPath(projectRoot);\n\n function fillAndReturnConfig(config: SplitConfigs, dynamicConfigObjectType: string | null) {\n const configWithDefaultValues = {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: options.skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: config.mods,\n dynamicConfigObjectType,\n rootConfig,\n dynamicConfigPath: paths.dynamicConfigPath,\n staticConfigPath: paths.staticConfigPath,\n };\n\n if (options.isModdedConfig) {\n // @ts-ignore: Add the mods back to the object.\n configWithDefaultValues.exp.mods = config.mods ?? null;\n }\n\n // Apply static json plugins, should be done after _internal\n configWithDefaultValues.exp = withConfigPlugins(\n configWithDefaultValues.exp,\n !!options.skipPlugins\n );\n\n if (!options.isModdedConfig) {\n // @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated\n delete configWithDefaultValues.exp.mods;\n }\n\n if (options.isPublicConfig) {\n // TODD(EvanBacon): Drop plugins array after it's been resolved.\n\n // Remove internal values with references to user's file paths from the public config.\n delete configWithDefaultValues.exp._internal;\n\n if (configWithDefaultValues.exp.hooks) {\n delete configWithDefaultValues.exp.hooks;\n }\n if (configWithDefaultValues.exp.ios?.config) {\n delete configWithDefaultValues.exp.ios.config;\n }\n if (configWithDefaultValues.exp.android?.config) {\n delete configWithDefaultValues.exp.android.config;\n }\n\n // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).\n // @ts-ignore: currentFullName not on type yet.\n configWithDefaultValues.exp.currentFullName = getFullName(configWithDefaultValues.exp);\n // @ts-ignore: originalFullName not on type yet.\n configWithDefaultValues.exp.originalFullName = getFullName(configWithDefaultValues.exp);\n\n delete configWithDefaultValues.exp.updates?.codeSigningCertificate;\n delete configWithDefaultValues.exp.updates?.codeSigningMetadata;\n }\n\n return configWithDefaultValues;\n }\n\n // Fill in the static config\n function getContextConfig(config: SplitConfigs) {\n return ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: true,\n paths,\n packageJsonPath,\n }).exp;\n }\n\n if (paths.dynamicConfigPath) {\n // No app.config.json or app.json but app.config.js\n const { exportedObjectType, config: rawDynamicConfig } = getDynamicConfig(\n paths.dynamicConfigPath,\n {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\n }\n );\n // Allow for the app.config.js to `export default null;`\n // Use `dynamicConfigPath` to detect if a dynamic config exists.\n const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};\n return fillAndReturnConfig(dynamicConfig, exportedObjectType);\n }\n\n // No app.config.js but json or no config\n return fillAndReturnConfig(staticConfig || {}, null);\n}\n\nexport function getPackageJson(projectRoot: string): PackageJSONConfig {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n return pkg;\n}\n\nfunction getPackageJsonAndPath(projectRoot: string): [PackageJSONConfig, string] {\n const packageJsonPath = getRootPackageJsonPath(projectRoot);\n return [JsonFile.read(packageJsonPath), packageJsonPath];\n}\n\n/**\n * Get the static and dynamic config paths for a project. Also accounts for custom paths.\n *\n * @param projectRoot\n */\nexport function getConfigFilePaths(projectRoot: string): ConfigFilePaths {\n return {\n dynamicConfigPath: getDynamicConfigFilePath(projectRoot),\n staticConfigPath: getStaticConfigFilePath(projectRoot),\n };\n}\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.ts', 'app.config.js']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.json', 'app.json']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n/**\n * Attempt to modify an Expo project config.\n * This will only fully work if the project is using static configs only.\n * Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.\n * The potentially modified config object will be returned for testing purposes.\n *\n * @param projectRoot\n * @param modifications modifications to make to an existing config\n * @param readOptions options for reading the current config file\n * @param writeOptions If true, the static config file will not be rewritten\n */\nexport async function modifyConfigAsync(\n projectRoot: string,\n modifications: Partial<ExpoConfig>,\n readOptions: GetConfigOptions = {},\n writeOptions: WriteConfigOptions = {}\n): Promise<{\n type: 'success' | 'warn' | 'fail';\n message?: string;\n config: AppJSONConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n if (config.dynamicConfigPath) {\n // We cannot automatically write to a dynamic config.\n /* Currently we should just use the safest approach possible, informing the user that they'll need to manually modify their dynamic config.\n\n if (config.staticConfigPath) {\n // Both a dynamic and a static config exist.\n if (config.dynamicConfigObjectType === 'function') {\n // The dynamic config exports a function, this means it possibly extends the static config.\n } else {\n // Dynamic config ignores the static config, there isn't a reason to automatically write to it.\n // Instead we should warn the user to add values to their dynamic config.\n }\n }\n */\n return {\n type: 'warn',\n message: `Cannot automatically write to dynamic config at: ${path.relative(\n projectRoot,\n config.dynamicConfigPath\n )}`,\n config: null,\n };\n } else if (config.staticConfigPath) {\n // Static with no dynamic config, this means we can append to the config automatically.\n let outputConfig: AppJSONConfig;\n // If the config has an expo object (app.json) then append the options to that object.\n if (config.rootConfig.expo) {\n outputConfig = {\n ...config.rootConfig,\n expo: { ...config.rootConfig.expo, ...modifications },\n };\n } else {\n // Otherwise (app.config.json) just add the config modification to the top most level.\n outputConfig = { ...config.rootConfig, ...modifications };\n }\n if (!writeOptions.dryRun) {\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n }\n return { type: 'success', config: outputConfig };\n }\n\n return { type: 'fail', message: 'No config exists', config: null };\n}\n\nfunction ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n paths,\n packageJsonPath,\n skipSDKVersionRequirement = false,\n}: {\n projectRoot: string;\n exp: Partial<ExpoConfig> | null;\n pkg: JSONObject;\n skipSDKVersionRequirement?: boolean;\n paths?: ConfigFilePaths;\n packageJsonPath?: string;\n}): { exp: ExpoConfig; pkg: PackageJSONConfig } {\n if (!exp) {\n exp = {};\n }\n exp = withInternal(exp as any, {\n projectRoot,\n ...(paths ?? {}),\n packageJsonPath,\n });\n // Defaults for package.json fields\n const pkgName = typeof pkg.name === 'string' ? pkg.name : path.basename(projectRoot);\n const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';\n\n const pkgWithDefaults = { ...pkg, name: pkgName, version: pkgVersion };\n\n // Defaults for app.json/app.config.js fields\n const name = exp.name ?? pkgName;\n const slug = exp.slug ?? slugify(name.toLowerCase());\n const version = exp.version ?? pkgVersion;\n let description = exp.description;\n if (!description && typeof pkg.description === 'string') {\n description = pkg.description;\n }\n\n const expWithDefaults = { ...exp, name, slug, version, description };\n\n let sdkVersion;\n try {\n sdkVersion = getExpoSDKVersion(projectRoot, expWithDefaults);\n } catch (error) {\n if (!skipSDKVersionRequirement) throw error;\n }\n\n let platforms = exp.platforms;\n if (!platforms) {\n platforms = getSupportedPlatforms(projectRoot);\n }\n\n return {\n exp: { ...expWithDefaults, sdkVersion, platforms },\n pkg: pkgWithDefaults,\n };\n}\n\nconst DEFAULT_BUILD_PATH = `web-build`;\n\nexport function getWebOutputPath(config: { [key: string]: any } = {}): string {\n if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {\n return process.env.WEBPACK_BUILD_OUTPUT_PATH;\n }\n const expo = config.expo || config || {};\n return expo?.web?.build?.output || DEFAULT_BUILD_PATH;\n}\n\nexport function getNameFromConfig(exp: Record<string, any> = {}): {\n appName?: string;\n webName?: string;\n} {\n // For RN CLI support\n const appManifest = exp.expo || exp;\n const { web = {} } = appManifest;\n\n // rn-cli apps use a displayName value as well.\n const appName = exp.displayName || appManifest.displayName || appManifest.name;\n const webName = web.name || appName;\n\n return {\n appName,\n webName,\n };\n}\n\nexport function getDefaultTarget(\n projectRoot: string,\n exp?: Pick<ExpoConfig, 'sdkVersion'>\n): ProjectTarget {\n exp ??= getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // before SDK 37, always default to managed to preserve previous behavior\n if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && semver.lt(exp.sdkVersion, '37.0.0')) {\n return 'managed';\n }\n return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';\n}\n\nfunction isBareWorkflowProject(projectRoot: string): boolean {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n\n // TODO: Drop this\n if (pkg.dependencies && pkg.dependencies.expokit) {\n return false;\n }\n\n const xcodeprojFiles = globSync('ios/**/*.xcodeproj', {\n absolute: true,\n cwd: projectRoot,\n });\n if (xcodeprojFiles.length) {\n return true;\n }\n const gradleFiles = globSync('android/**/*.gradle', {\n absolute: true,\n cwd: projectRoot,\n });\n if (gradleFiles.length) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Return a useful name describing the project config.\n * - dynamic: app.config.js\n * - static: app.json\n * - custom path app config relative to root folder\n * - both: app.config.js or app.json\n */\nexport function getProjectConfigDescription(projectRoot: string): string {\n const paths = getConfigFilePaths(projectRoot);\n return getProjectConfigDescriptionWithPaths(projectRoot, paths);\n}\n\n/**\n * Returns a string describing the configurations used for the given project root.\n * Will return null if no config is found.\n *\n * @param projectRoot\n * @param projectConfig\n */\nexport function getProjectConfigDescriptionWithPaths(\n projectRoot: string,\n projectConfig: ConfigFilePaths\n): string {\n if (projectConfig.dynamicConfigPath) {\n const relativeDynamicConfigPath = path.relative(projectRoot, projectConfig.dynamicConfigPath);\n if (projectConfig.staticConfigPath) {\n return `${relativeDynamicConfigPath} or ${path.relative(\n projectRoot,\n projectConfig.staticConfigPath\n )}`;\n }\n return relativeDynamicConfigPath;\n } else if (projectConfig.staticConfigPath) {\n return path.relative(projectRoot, projectConfig.staticConfigPath);\n }\n // If a config doesn't exist, our tooling will generate a static app.json\n return 'app.json';\n}\n\nexport * from './Config.types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EA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c,CAACI,MAAM,EAAE;IACzB,OAAO,IAAI;EACb;EACA,MAAMC,WAAW,GAAG,IAAAJ,YAAQ,EAAC,qBAAqB,EAAE;IAClDC,QAAQ,EAAE,IAAI;IACdC,GAAG,EAAExG;EACP,CAAC,CAAC;EACF,IAAI0G,WAAW,CAACD,MAAM,EAAE;IACtB,OAAO,IAAI;EACb;EAEA,OAAO,KAAK;AACd;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASE,2BAA2B,CAAC3G,WAAmB,EAAU;EACvE,MAAMO,KAAK,GAAGC,kBAAkB,CAACR,WAAW,CAAC;EAC7C,OAAO4G,oCAAoC,CAAC5G,WAAW,EAAEO,KAAK,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASqG,oCAAoC,CAClD5G,WAAmB,EACnB6G,aAA8B,EACtB;EACR,IAAIA,aAAa,CAACrF,iBAAiB,EAAE;IACnC,MAAMsF,yBAAyB,GAAG1D,eAAI,CAACU,QAAQ,CAAC9D,WAAW,EAAE6G,aAAa,CAACrF,iBAAiB,CAAC;IAC7F,IAAIqF,aAAa,CAACnG,gBAAgB,EAAE;MAClC,OAAQ,GAAEoG,yBAA0B,OAAM1D,eAAI,CAACU,QAAQ,CACrD9D,WAAW,EACX6G,aAAa,CAACnG,gBAAgB,CAC9B,EAAC;IACL;IACA,OAAOoG,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAACnG,gBAAgB,EAAE;IACzC,OAAO0C,eAAI,CAACU,QAAQ,CAAC9D,WAAW,EAAE6G,aAAa,CAACnG,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB"}
1
+ {"version":3,"file":"Config.js","names":["reduceExpoObject","config","undefined","mods","expo","getSupportedPlatforms","projectRoot","platforms","resolveFrom","silent","push","getConfig","options","paths","getConfigFilePaths","rawStaticConfig","staticConfigPath","getStaticConfig","rootConfig","staticConfig","packageJson","packageJsonPath","getPackageJsonAndPath","fillAndReturnConfig","dynamicConfigObjectType","configWithDefaultValues","ensureConfigHasDefaultValues","exp","pkg","skipSDKVersionRequirement","dynamicConfigPath","isModdedConfig","withConfigPlugins","skipPlugins","isPublicConfig","_internal","hooks","ios","android","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(config: SplitConfigs, dynamicConfigObjectType: string | null) {\n const configWithDefaultValues = {\n ...ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: options.skipSDKVersionRequirement,\n paths,\n packageJsonPath,\n }),\n mods: config.mods,\n dynamicConfigObjectType,\n rootConfig,\n dynamicConfigPath: paths.dynamicConfigPath,\n staticConfigPath: paths.staticConfigPath,\n };\n\n if (options.isModdedConfig) {\n // @ts-ignore: Add the mods back to the object.\n configWithDefaultValues.exp.mods = config.mods ?? null;\n }\n\n // Apply static json plugins, should be done after _internal\n configWithDefaultValues.exp = withConfigPlugins(\n configWithDefaultValues.exp,\n !!options.skipPlugins\n );\n\n if (!options.isModdedConfig) {\n // @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated\n delete configWithDefaultValues.exp.mods;\n }\n\n if (options.isPublicConfig) {\n // TODD(EvanBacon): Drop plugins array after it's been resolved.\n\n // Remove internal values with references to user's file paths from the public config.\n delete configWithDefaultValues.exp._internal;\n\n if (configWithDefaultValues.exp.hooks) {\n delete configWithDefaultValues.exp.hooks;\n }\n if (configWithDefaultValues.exp.ios?.config) {\n delete configWithDefaultValues.exp.ios.config;\n }\n if (configWithDefaultValues.exp.android?.config) {\n delete configWithDefaultValues.exp.android.config;\n }\n\n delete configWithDefaultValues.exp.updates?.codeSigningCertificate;\n delete configWithDefaultValues.exp.updates?.codeSigningMetadata;\n }\n\n return configWithDefaultValues;\n }\n\n // Fill in the static config\n function getContextConfig(config: SplitConfigs) {\n return ensureConfigHasDefaultValues({\n projectRoot,\n exp: config.expo,\n pkg: packageJson,\n skipSDKVersionRequirement: true,\n paths,\n packageJsonPath,\n }).exp;\n }\n\n if (paths.dynamicConfigPath) {\n // No app.config.json or app.json but app.config.js\n const { exportedObjectType, config: rawDynamicConfig } = getDynamicConfig(\n paths.dynamicConfigPath,\n {\n projectRoot,\n staticConfigPath: paths.staticConfigPath,\n packageJsonPath,\n config: getContextConfig(staticConfig),\n }\n );\n // Allow for the app.config.js to `export default null;`\n // Use `dynamicConfigPath` to detect if a dynamic config exists.\n const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};\n return fillAndReturnConfig(dynamicConfig, exportedObjectType);\n }\n\n // No app.config.js but json or no config\n return fillAndReturnConfig(staticConfig || {}, null);\n}\n\nexport function getPackageJson(projectRoot: string): PackageJSONConfig {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n return pkg;\n}\n\nfunction getPackageJsonAndPath(projectRoot: string): [PackageJSONConfig, string] {\n const packageJsonPath = getRootPackageJsonPath(projectRoot);\n return [JsonFile.read(packageJsonPath), packageJsonPath];\n}\n\n/**\n * Get the static and dynamic config paths for a project. Also accounts for custom paths.\n *\n * @param projectRoot\n */\nexport function getConfigFilePaths(projectRoot: string): ConfigFilePaths {\n return {\n dynamicConfigPath: getDynamicConfigFilePath(projectRoot),\n staticConfigPath: getStaticConfigFilePath(projectRoot),\n };\n}\n\nfunction getDynamicConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.ts', 'app.config.js']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\nfunction getStaticConfigFilePath(projectRoot: string): string | null {\n for (const fileName of ['app.config.json', 'app.json']) {\n const configPath = path.join(projectRoot, fileName);\n if (fs.existsSync(configPath)) {\n return configPath;\n }\n }\n return null;\n}\n\n/**\n * Attempt to modify an Expo project config.\n * This will only fully work if the project is using static configs only.\n * Otherwise 'warn' | 'fail' will return with a message about why the config couldn't be updated.\n * The potentially modified config object will be returned for testing purposes.\n *\n * @param projectRoot\n * @param modifications modifications to make to an existing config\n * @param readOptions options for reading the current config file\n * @param writeOptions If true, the static config file will not be rewritten\n */\nexport async function modifyConfigAsync(\n projectRoot: string,\n modifications: Partial<ExpoConfig>,\n readOptions: GetConfigOptions = {},\n writeOptions: WriteConfigOptions = {}\n): Promise<{\n type: 'success' | 'warn' | 'fail';\n message?: string;\n config: AppJSONConfig | null;\n}> {\n const config = getConfig(projectRoot, readOptions);\n if (config.dynamicConfigPath) {\n // We cannot automatically write to a dynamic config.\n /* Currently we should just use the safest approach possible, informing the user that they'll need to manually modify their dynamic config.\n\n if (config.staticConfigPath) {\n // Both a dynamic and a static config exist.\n if (config.dynamicConfigObjectType === 'function') {\n // The dynamic config exports a function, this means it possibly extends the static config.\n } else {\n // Dynamic config ignores the static config, there isn't a reason to automatically write to it.\n // Instead we should warn the user to add values to their dynamic config.\n }\n }\n */\n return {\n type: 'warn',\n message: `Cannot automatically write to dynamic config at: ${path.relative(\n projectRoot,\n config.dynamicConfigPath\n )}`,\n config: null,\n };\n } else if (config.staticConfigPath) {\n // Static with no dynamic config, this means we can append to the config automatically.\n let outputConfig: AppJSONConfig;\n // If the config has an expo object (app.json) then append the options to that object.\n if (config.rootConfig.expo) {\n outputConfig = {\n ...config.rootConfig,\n expo: { ...config.rootConfig.expo, ...modifications },\n };\n } else {\n // Otherwise (app.config.json) just add the config modification to the top most level.\n outputConfig = { ...config.rootConfig, ...modifications };\n }\n if (!writeOptions.dryRun) {\n await JsonFile.writeAsync(config.staticConfigPath, outputConfig, { json5: false });\n }\n return { type: 'success', config: outputConfig };\n }\n\n return { type: 'fail', message: 'No config exists', config: null };\n}\n\nfunction ensureConfigHasDefaultValues({\n projectRoot,\n exp,\n pkg,\n paths,\n packageJsonPath,\n skipSDKVersionRequirement = false,\n}: {\n projectRoot: string;\n exp: Partial<ExpoConfig> | null;\n pkg: JSONObject;\n skipSDKVersionRequirement?: boolean;\n paths?: ConfigFilePaths;\n packageJsonPath?: string;\n}): { exp: ExpoConfig; pkg: PackageJSONConfig } {\n if (!exp) {\n exp = {};\n }\n exp = withInternal(exp as any, {\n projectRoot,\n ...(paths ?? {}),\n packageJsonPath,\n });\n // Defaults for package.json fields\n const pkgName = typeof pkg.name === 'string' ? pkg.name : path.basename(projectRoot);\n const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';\n\n const pkgWithDefaults = { ...pkg, name: pkgName, version: pkgVersion };\n\n // Defaults for app.json/app.config.js fields\n const name = exp.name ?? pkgName;\n const slug = exp.slug ?? slugify(name.toLowerCase());\n const version = exp.version ?? pkgVersion;\n let description = exp.description;\n if (!description && typeof pkg.description === 'string') {\n description = pkg.description;\n }\n\n const expWithDefaults = { ...exp, name, slug, version, description };\n\n let sdkVersion;\n try {\n sdkVersion = getExpoSDKVersion(projectRoot, expWithDefaults);\n } catch (error) {\n if (!skipSDKVersionRequirement) throw error;\n }\n\n let platforms = exp.platforms;\n if (!platforms) {\n platforms = getSupportedPlatforms(projectRoot);\n }\n\n return {\n exp: { ...expWithDefaults, sdkVersion, platforms },\n pkg: pkgWithDefaults,\n };\n}\n\nconst DEFAULT_BUILD_PATH = `web-build`;\n\nexport function getWebOutputPath(config: { [key: string]: any } = {}): string {\n if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {\n return process.env.WEBPACK_BUILD_OUTPUT_PATH;\n }\n const expo = config.expo || config || {};\n return expo?.web?.build?.output || DEFAULT_BUILD_PATH;\n}\n\nexport function getNameFromConfig(exp: Record<string, any> = {}): {\n appName?: string;\n webName?: string;\n} {\n // For RN CLI support\n const appManifest = exp.expo || exp;\n const { web = {} } = appManifest;\n\n // rn-cli apps use a displayName value as well.\n const appName = exp.displayName || appManifest.displayName || appManifest.name;\n const webName = web.name || appName;\n\n return {\n appName,\n webName,\n };\n}\n\nexport function getDefaultTarget(\n projectRoot: string,\n exp?: Pick<ExpoConfig, 'sdkVersion'>\n): ProjectTarget {\n exp ??= getConfig(projectRoot, { skipSDKVersionRequirement: true }).exp;\n\n // before SDK 37, always default to managed to preserve previous behavior\n if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && semver.lt(exp.sdkVersion, '37.0.0')) {\n return 'managed';\n }\n return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';\n}\n\nfunction isBareWorkflowProject(projectRoot: string): boolean {\n const [pkg] = getPackageJsonAndPath(projectRoot);\n\n // TODO: Drop this\n if (pkg.dependencies && pkg.dependencies.expokit) {\n return false;\n }\n\n const xcodeprojFiles = globSync('ios/**/*.xcodeproj', {\n absolute: true,\n cwd: projectRoot,\n });\n if (xcodeprojFiles.length) {\n return true;\n }\n const gradleFiles = globSync('android/**/*.gradle', {\n absolute: true,\n cwd: projectRoot,\n });\n if (gradleFiles.length) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Return a useful name describing the project config.\n * - dynamic: app.config.js\n * - static: app.json\n * - custom path app config relative to root folder\n * - both: app.config.js or app.json\n */\nexport function getProjectConfigDescription(projectRoot: string): string {\n const paths = getConfigFilePaths(projectRoot);\n return getProjectConfigDescriptionWithPaths(projectRoot, paths);\n}\n\n/**\n * Returns a string describing the configurations used for the given project root.\n * Will return null if no config is found.\n *\n * @param projectRoot\n * @param projectConfig\n */\nexport function getProjectConfigDescriptionWithPaths(\n projectRoot: string,\n projectConfig: ConfigFilePaths\n): string {\n if (projectConfig.dynamicConfigPath) {\n const relativeDynamicConfigPath = path.relative(projectRoot, projectConfig.dynamicConfigPath);\n if (projectConfig.staticConfigPath) {\n return `${relativeDynamicConfigPath} or ${path.relative(\n projectRoot,\n projectConfig.staticConfigPath\n )}`;\n }\n return relativeDynamicConfigPath;\n } else if (projectConfig.staticConfigPath) {\n return path.relative(projectRoot, projectConfig.staticConfigPath);\n }\n // If a config doesn't exist, our tooling will generate a static app.json\n return 'app.json';\n}\n\nexport * from './Config.types';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAaA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AACA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AACzG,WAAW,EAAEO,KAAK,CAAC;AACjE;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASkG,oCAAoC,CAClDzG,WAAmB,EACnB0G,aAA8B,EACtB;EACR,IAAIA,aAAa,CAAClF,iBAAiB,EAAE;IACnC,MAAMmF,yBAAyB,GAAG1D,eAAI,CAACU,QAAQ,CAAC3D,WAAW,EAAE0G,aAAa,CAAClF,iBAAiB,CAAC;IAC7F,IAAIkF,aAAa,CAAChG,gBAAgB,EAAE;MAClC,OAAQ,GAAEiG,yBAA0B,OAAM1D,eAAI,CAACU,QAAQ,CACrD3D,WAAW,EACX0G,aAAa,CAAChG,gBAAgB,CAC9B,EAAC;IACL;IACA,OAAOiG,yBAAyB;EAClC,CAAC,MAAM,IAAID,aAAa,CAAChG,gBAAgB,EAAE;IACzC,OAAOuC,eAAI,CAACU,QAAQ,CAAC3D,WAAW,EAAE0G,aAAa,CAAChG,gBAAgB,CAAC;EACnE;EACA;EACA,OAAO,UAAU;AACnB"}
@@ -0,0 +1,9 @@
1
+ import { ExpoConfig } from '@expo/config-types';
2
+ /**
3
+ * Get the owner of the project from the manifest if specified, falling back to a bunch of different things
4
+ * which may or may not be the owner of the project.
5
+ *
6
+ * @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using
7
+ * the EAS project ID, falling back to the `owner` field.
8
+ */
9
+ export declare function getAccountUsername(manifest?: Pick<ExpoConfig, 'owner'>): string;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.getAccountUsername = getAccountUsername;
7
- exports.getFullName = getFullName;
8
7
  function _getUserState() {
9
8
  const data = require("./getUserState");
10
9
  _getUserState = function () {
@@ -15,16 +14,12 @@ function _getUserState() {
15
14
  const ANONYMOUS_USERNAME = 'anonymous';
16
15
 
17
16
  /**
18
- * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.
19
- * This `id` is used for legacy Expo services AuthSession proxy and Expo notifications device ID.
17
+ * Get the owner of the project from the manifest if specified, falling back to a bunch of different things
18
+ * which may or may not be the owner of the project.
20
19
  *
21
- * @param manifest
22
- * @returns
20
+ * @deprecated This may not actually be the owner of the project. Prefer to fetch the project owner using
21
+ * the EAS project ID, falling back to the `owner` field.
23
22
  */
24
- function getFullName(manifest) {
25
- const username = getAccountUsername(manifest);
26
- return `@${username}/${manifest.slug}`;
27
- }
28
23
  function getAccountUsername(manifest = {}) {
29
24
  var _getUserState$read$au;
30
25
  // TODO: Must match what's generated in Expo Go.
@@ -35,4 +30,4 @@ function getAccountUsername(manifest = {}) {
35
30
  // Statically get the username from the global user state.
36
31
  return ((_getUserState$read$au = (0, _getUserState().getUserState)().read().auth) === null || _getUserState$read$au === void 0 ? void 0 : _getUserState$read$au.username) || ANONYMOUS_USERNAME;
37
32
  }
38
- //# sourceMappingURL=getFullName.js.map
33
+ //# sourceMappingURL=getAccountUsername.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getAccountUsername.js","names":["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;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,kBAAkB,GAAG,WAAW;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,kBAAkB,CAACC,QAAmC,GAAG,CAAC,CAAC,EAAU;EAAA;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,8BAAAM,4BAAY,GAAE,CAACC,IAAI,EAAE,CAACC,IAAI,0DAA1B,sBAA4BR,QAAQ,KAAIH,kBAAkB;AACnE"}
package/build/index.d.ts CHANGED
@@ -2,4 +2,4 @@ export * from './Config';
2
2
  export * from './Config.types';
3
3
  export * from './getExpoSDKVersion';
4
4
  export * from './Errors';
5
- export { getAccountUsername } from './getFullName';
5
+ export { getAccountUsername } from './getAccountUsername';
package/build/index.js CHANGED
@@ -9,7 +9,7 @@ var _exportNames = {
9
9
  Object.defineProperty(exports, "getAccountUsername", {
10
10
  enumerable: true,
11
11
  get: function () {
12
- return _getFullName().getAccountUsername;
12
+ return _getAccountUsername().getAccountUsername;
13
13
  }
14
14
  });
15
15
  var _Config = require("./Config");
@@ -60,9 +60,9 @@ Object.keys(_Errors).forEach(function (key) {
60
60
  }
61
61
  });
62
62
  });
63
- function _getFullName() {
64
- const data = require("./getFullName");
65
- _getFullName = function () {
63
+ function _getAccountUsername() {
64
+ const data = require("./getAccountUsername");
65
+ _getAccountUsername = function () {
66
66
  return data;
67
67
  };
68
68
  return data;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable import/export */\n\nexport * from './Config';\nexport * from './Config.types';\nexport * from './getExpoSDKVersion';\nexport * from './Errors';\nexport { getAccountUsername } from './getFullName';\n"],"mappings":";;;;;;;;;;;;;;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable import/export */\n\nexport * from './Config';\nexport * from './Config.types';\nexport * from './getExpoSDKVersion';\nexport * from './Errors';\nexport { getAccountUsername } from './getAccountUsername';\n"],"mappings":";;;;;;;;;;;;;;AAEA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/config",
3
- "version": "8.0.0",
3
+ "version": "8.0.2",
4
4
  "description": "A library for interacting with the app.json",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -50,5 +50,5 @@
50
50
  "publishConfig": {
51
51
  "access": "public"
52
52
  },
53
- "gitHead": "1815e2eaad8c753588c7b1eb74420174a28e01f4"
53
+ "gitHead": "d7ecf4eaf234d2f1100249a2c893a948d47376aa"
54
54
  }
@@ -1,10 +0,0 @@
1
- import { ExpoConfig } from '@expo/config-types';
2
- /**
3
- * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.
4
- * This `id` is used for legacy Expo services AuthSession proxy and Expo notifications device ID.
5
- *
6
- * @param manifest
7
- * @returns
8
- */
9
- export declare function getFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string;
10
- export declare function getAccountUsername(manifest?: Pick<ExpoConfig, 'owner'>): string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFullName.js","names":["ANONYMOUS_USERNAME","getFullName","manifest","username","getAccountUsername","slug","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","getUserState","read","auth"],"sources":["../src/getFullName.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config-types';\n\nimport { getUserState } from './getUserState';\n\nconst ANONYMOUS_USERNAME = 'anonymous';\n\n/**\n * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.\n * This `id` is used for legacy Expo services AuthSession proxy and Expo notifications device ID.\n *\n * @param manifest\n * @returns\n */\nexport function getFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string {\n const username = getAccountUsername(manifest);\n return `@${username}/${manifest.slug}`;\n}\n\nexport function getAccountUsername(manifest: Pick<ExpoConfig, 'owner'> = {}): string {\n // TODO: Must match what's generated in Expo Go.\n const username =\n manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;\n if (username) {\n return username;\n }\n // Statically get the username from the global user state.\n return getUserState().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"mappings":";;;;;;;AAEA;EAAA;EAAA;IAAA;EAAA;EAAA;AAAA;AAEA,MAAMA,kBAAkB,GAAG,WAAW;;AAEtC;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,WAAW,CAACC,QAA4C,EAAU;EAChF,MAAMC,QAAQ,GAAGC,kBAAkB,CAACF,QAAQ,CAAC;EAC7C,OAAQ,IAAGC,QAAS,IAAGD,QAAQ,CAACG,IAAK,EAAC;AACxC;AAEO,SAASD,kBAAkB,CAACF,QAAmC,GAAG,CAAC,CAAC,EAAU;EAAA;EACnF;EACA,MAAMC,QAAQ,GACZD,QAAQ,CAACI,KAAK,IAAIC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAIF,OAAO,CAACC,GAAG,CAACE,kBAAkB;EACnF,IAAIP,QAAQ,EAAE;IACZ,OAAOA,QAAQ;EACjB;EACA;EACA,OAAO,8BAAAQ,4BAAY,GAAE,CAACC,IAAI,EAAE,CAACC,IAAI,0DAA1B,sBAA4BV,QAAQ,KAAIH,kBAAkB;AACnE"}