From 08648ae9ba1f95e3204f0cf6c474dfa576db08d4 Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Sun, 16 May 2021 11:42:31 -0700 Subject: [PATCH] Add `originalFullName` to the public config --- packages/config/src/Config.ts | 8 +++++--- .../{getCurrentFullName-test.ts => getFullName-test.ts} | 2 +- .../config/src/{getCurrentFullName.ts => getFullName.ts} | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) rename packages/config/src/__tests__/{getCurrentFullName-test.ts => getFullName-test.ts} (96%) rename packages/config/src/{getCurrentFullName.ts => getFullName.ts} (90%) diff --git a/packages/config/src/Config.ts b/packages/config/src/Config.ts index 9c8cb8757f..64c808530b 100644 --- a/packages/config/src/Config.ts +++ b/packages/config/src/Config.ts @@ -22,7 +22,7 @@ import { import { ConfigError } from './Errors'; import { getExpoSDKVersion } from './Project'; import { getDynamicConfig, getStaticConfig } from './getConfig'; -import { getCurrentFullName } from './getCurrentFullName'; +import { getFullName } from './getFullName'; import { withConfigPlugins } from './plugins/withConfigPlugins'; import { withInternal } from './plugins/withInternal'; import { getRootPackageJsonPath } from './resolvePackageJson'; @@ -143,9 +143,11 @@ export function getConfig(projectRoot: string, options: GetConfigOptions = {}): delete configWithDefaultValues.exp.android.config; } - // This value will be overwritten when the manifest is being served from the host (i.e. not completely accurate). + // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate). // @ts-ignore: currentFullName not on type yet. - configWithDefaultValues.exp.currentFullName = getCurrentFullName(configWithDefaultValues.exp); + configWithDefaultValues.exp.currentFullName = getFullName(configWithDefaultValues.exp); + // @ts-ignore: originalFullName not on type yet. + configWithDefaultValues.exp.originalFullName = getFullName(configWithDefaultValues.exp); } return configWithDefaultValues; diff --git a/packages/config/src/__tests__/getCurrentFullName-test.ts b/packages/config/src/__tests__/getFullName-test.ts similarity index 96% rename from packages/config/src/__tests__/getCurrentFullName-test.ts rename to packages/config/src/__tests__/getFullName-test.ts index 527d4ac48b..24612d3adf 100644 --- a/packages/config/src/__tests__/getCurrentFullName-test.ts +++ b/packages/config/src/__tests__/getFullName-test.ts @@ -1,6 +1,6 @@ import { ensureDir } from 'fs-extra'; -import { getAccountUsername } from '../getCurrentFullName'; +import { getAccountUsername } from '../getFullName'; import { getExpoHomeDirectory, getUserState } from '../getUserState'; jest.mock('os'); diff --git a/packages/config/src/getCurrentFullName.ts b/packages/config/src/getFullName.ts similarity index 90% rename from packages/config/src/getCurrentFullName.ts rename to packages/config/src/getFullName.ts index 9390f34729..473ba6ae1a 100644 --- a/packages/config/src/getCurrentFullName.ts +++ b/packages/config/src/getFullName.ts @@ -11,7 +11,7 @@ const ANONYMOUS_USERNAME = 'anonymous'; * @param manifest * @returns */ -export function getCurrentFullName(manifest: Pick): string { +export function getFullName(manifest: Pick): string { const username = getAccountUsername(manifest); return `@${username}/${manifest.slug}`; }