Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Add originalFullName to the public config #3494

Merged
merged 1 commit into from
May 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/config/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These values

// @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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ANONYMOUS_USERNAME = 'anonymous';
* @param manifest
* @returns
*/
export function getCurrentFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string {
export function getFullName(manifest: Pick<ExpoConfig, 'owner' | 'slug'>): string {
const username = getAccountUsername(manifest);
return `@${username}/${manifest.slug}`;
}
Expand Down