@expo/cli 1.0.0-canary-20250131-5c4e588 → 1.0.0-canary-20250207-8bc5146
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/bin/cli +1 -1
- package/build/src/api/graphql/types/App.js +1 -0
- package/build/src/api/graphql/types/App.js.map +1 -1
- package/build/src/graphql/generated.js +494 -23
- package/build/src/graphql/generated.js.map +1 -1
- package/build/src/prebuild/configureProjectAsync.js +2 -2
- package/build/src/prebuild/configureProjectAsync.js.map +1 -1
- package/build/src/prebuild/ensureConfigAsync.js +2 -2
- package/build/src/prebuild/ensureConfigAsync.js.map +1 -1
- package/build/src/start/resolveOptions.js +5 -0
- package/build/src/start/resolveOptions.js.map +1 -1
- package/build/src/start/server/AsyncWsTunnel.js +124 -0
- package/build/src/start/server/AsyncWsTunnel.js.map +1 -0
- package/build/src/start/server/BundlerDevServer.js +17 -10
- package/build/src/start/server/BundlerDevServer.js.map +1 -1
- package/build/src/utils/env.js +30 -5
- package/build/src/utils/env.js.map +1 -1
- package/build/src/utils/getOrPromptApplicationId.js +58 -24
- package/build/src/utils/getOrPromptApplicationId.js.map +1 -1
- package/build/src/utils/telemetry/clients/FetchClient.js +1 -1
- package/build/src/utils/telemetry/utils/context.js +1 -1
- package/package.json +16 -14
- package/build/src/utils/getAccountUsername.js +0 -22
- package/build/src/utils/getAccountUsername.js.map +0 -1
|
@@ -9,9 +9,16 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
getOrPromptForBundleIdentifierAsync: ()=>getOrPromptForBundleIdentifierAsync,
|
|
13
|
+
getOrPromptForPackageAsync: ()=>getOrPromptForPackageAsync
|
|
14
14
|
});
|
|
15
|
+
function _graphqlWeb() {
|
|
16
|
+
const data = require("@0no-co/graphql.web");
|
|
17
|
+
_graphqlWeb = function() {
|
|
18
|
+
return data;
|
|
19
|
+
};
|
|
20
|
+
return data;
|
|
21
|
+
}
|
|
15
22
|
function _config() {
|
|
16
23
|
const data = require("@expo/config");
|
|
17
24
|
_config = function() {
|
|
@@ -19,6 +26,13 @@ function _config() {
|
|
|
19
26
|
};
|
|
20
27
|
return data;
|
|
21
28
|
}
|
|
29
|
+
function _core() {
|
|
30
|
+
const data = require("@urql/core");
|
|
31
|
+
_core = function() {
|
|
32
|
+
return data;
|
|
33
|
+
};
|
|
34
|
+
return data;
|
|
35
|
+
}
|
|
22
36
|
function _chalk() {
|
|
23
37
|
const data = /*#__PURE__*/ _interopRequireDefault(require("chalk"));
|
|
24
38
|
_chalk = function() {
|
|
@@ -31,8 +45,8 @@ const _link = require("./link");
|
|
|
31
45
|
const _modifyConfigAsync = require("./modifyConfigAsync");
|
|
32
46
|
const _prompts = /*#__PURE__*/ _interopRequireWildcard(require("./prompts"));
|
|
33
47
|
const _validateApplicationId = require("./validateApplicationId");
|
|
48
|
+
const _appQuery = require("../api/graphql/queries/AppQuery");
|
|
34
49
|
const _log = /*#__PURE__*/ _interopRequireWildcard(require("../log"));
|
|
35
|
-
const _getAccountUsername = require("./getAccountUsername");
|
|
36
50
|
function _interopRequireDefault(obj) {
|
|
37
51
|
return obj && obj.__esModule ? obj : {
|
|
38
52
|
default: obj
|
|
@@ -78,20 +92,32 @@ function _interopRequireWildcard(obj, nodeInterop) {
|
|
|
78
92
|
return newObj;
|
|
79
93
|
}
|
|
80
94
|
const debug = require("debug")("expo:app-id");
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
95
|
+
async function getRecommendedReverseDomainNameSecondPartAsync(exp) {
|
|
96
|
+
var ref, ref1;
|
|
97
|
+
const easProjectId = (ref = exp.extra) == null ? void 0 : (ref1 = ref.eas) == null ? void 0 : ref1.projectId;
|
|
98
|
+
if (!easProjectId) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
try {
|
|
102
|
+
const app = await _appQuery.AppQuery.byIdAsync(easProjectId);
|
|
103
|
+
return app.ownerAccount.name;
|
|
104
|
+
} catch (e) {
|
|
105
|
+
if (e instanceof _graphqlWeb().GraphQLError || e instanceof _core().CombinedError) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
throw e;
|
|
109
|
+
}
|
|
84
110
|
}
|
|
85
111
|
const NO_BUNDLE_ID_MESSAGE = `Project must have a \`ios.bundleIdentifier\` set in the Expo config (app.json or app.config.js).`;
|
|
86
112
|
const NO_PACKAGE_MESSAGE = `Project must have a \`android.package\` set in the Expo config (app.json or app.config.js).`;
|
|
87
|
-
async function
|
|
113
|
+
async function getOrPromptForBundleIdentifierAsync(projectRoot, exp = (0, _config().getConfig)(projectRoot).exp) {
|
|
88
114
|
var ref;
|
|
89
115
|
const current = (ref = exp.ios) == null ? void 0 : ref.bundleIdentifier;
|
|
90
116
|
if (current) {
|
|
91
117
|
(0, _validateApplicationId.assertValidBundleId)(current);
|
|
92
118
|
return current;
|
|
93
119
|
}
|
|
94
|
-
return promptForBundleIdWithInitialAsync(projectRoot, exp,
|
|
120
|
+
return promptForBundleIdWithInitialAsync(projectRoot, exp, await getRecommendedBundleIdAsync(exp));
|
|
95
121
|
}
|
|
96
122
|
const memoLog = (0, _fn.memoize)(_log.log);
|
|
97
123
|
async function promptForBundleIdWithInitialAsync(projectRoot, exp, bundleIdentifier) {
|
|
@@ -145,41 +171,49 @@ async function warnAndConfirmAsync(warning) {
|
|
|
145
171
|
}
|
|
146
172
|
return true;
|
|
147
173
|
}
|
|
148
|
-
// Recommend a bundle identifier based on the
|
|
149
|
-
function
|
|
174
|
+
// Recommend a bundle identifier based on the account name of the owner of the project and project slug.
|
|
175
|
+
async function getRecommendedBundleIdAsync(exp) {
|
|
150
176
|
var ref;
|
|
151
177
|
const possibleIdFromAndroid = ((ref = exp.android) == null ? void 0 : ref.package) ? (0, _validateApplicationId.getSanitizedBundleIdentifier)(exp.android.package) : undefined;
|
|
152
178
|
// Attempt to use the android package name first since it's convenient to have them aligned.
|
|
153
179
|
if (possibleIdFromAndroid && (0, _validateApplicationId.validateBundleId)(possibleIdFromAndroid)) {
|
|
154
180
|
return possibleIdFromAndroid;
|
|
155
181
|
} else {
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
182
|
+
const recommendedReverseDomainNameSecondPart = await getRecommendedReverseDomainNameSecondPartAsync(exp);
|
|
183
|
+
if (recommendedReverseDomainNameSecondPart) {
|
|
184
|
+
const possibleId = (0, _validateApplicationId.getSanitizedBundleIdentifier)(`com.${recommendedReverseDomainNameSecondPart}.${exp.slug}`);
|
|
185
|
+
if ((0, _validateApplicationId.validateBundleId)(possibleId)) {
|
|
186
|
+
return possibleId;
|
|
187
|
+
}
|
|
188
|
+
} else {
|
|
189
|
+
debug("Could not generate recommended name from EAS");
|
|
160
190
|
}
|
|
161
191
|
}
|
|
162
192
|
return undefined;
|
|
163
193
|
}
|
|
164
|
-
// Recommend a package name based on the
|
|
165
|
-
function
|
|
194
|
+
// Recommend a package name based on the account name of the owner of the project and project slug.
|
|
195
|
+
async function getRecommendedPackageNameAsync(exp) {
|
|
166
196
|
var ref;
|
|
167
197
|
const possibleIdFromApple = ((ref = exp.ios) == null ? void 0 : ref.bundleIdentifier) ? (0, _validateApplicationId.getSanitizedPackage)(exp.ios.bundleIdentifier) : undefined;
|
|
168
198
|
// Attempt to use the ios bundle id first since it's convenient to have them aligned.
|
|
169
199
|
if (possibleIdFromApple && (0, _validateApplicationId.validatePackage)(possibleIdFromApple)) {
|
|
170
200
|
return possibleIdFromApple;
|
|
171
201
|
} else {
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
202
|
+
const recommendedReverseDomainNameSecondPart = await getRecommendedReverseDomainNameSecondPartAsync(exp);
|
|
203
|
+
if (recommendedReverseDomainNameSecondPart) {
|
|
204
|
+
const possibleId = (0, _validateApplicationId.getSanitizedPackage)(`com.${recommendedReverseDomainNameSecondPart}.${exp.slug}`);
|
|
205
|
+
if ((0, _validateApplicationId.validatePackage)(possibleId)) {
|
|
206
|
+
return possibleId;
|
|
207
|
+
} else {
|
|
208
|
+
debug(`Recommended package name is invalid: "${possibleId}" (owner: ${recommendedReverseDomainNameSecondPart}, slug: ${exp.slug})`);
|
|
209
|
+
}
|
|
176
210
|
} else {
|
|
177
|
-
debug(
|
|
211
|
+
debug("Could not generate recommended name from EAS");
|
|
178
212
|
}
|
|
179
213
|
}
|
|
180
214
|
return undefined;
|
|
181
215
|
}
|
|
182
|
-
async function
|
|
216
|
+
async function getOrPromptForPackageAsync(projectRoot, exp = (0, _config().getConfig)(projectRoot).exp) {
|
|
183
217
|
var ref;
|
|
184
218
|
const current = (ref = exp.android) == null ? void 0 : ref.package;
|
|
185
219
|
if (current) {
|
|
@@ -188,8 +222,8 @@ async function getOrPromptForPackage(projectRoot, exp = (0, _config().getConfig)
|
|
|
188
222
|
}
|
|
189
223
|
return await promptForPackageAsync(projectRoot, exp);
|
|
190
224
|
}
|
|
191
|
-
function promptForPackageAsync(projectRoot, exp) {
|
|
192
|
-
return promptForPackageWithInitialAsync(projectRoot, exp,
|
|
225
|
+
async function promptForPackageAsync(projectRoot, exp) {
|
|
226
|
+
return promptForPackageWithInitialAsync(projectRoot, exp, await getRecommendedPackageNameAsync(exp));
|
|
193
227
|
}
|
|
194
228
|
async function promptForPackageWithInitialAsync(projectRoot, exp, packageName) {
|
|
195
229
|
if (!packageName) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getOrPromptApplicationId.ts"],"sourcesContent":["import { ExpoConfig, getConfig } from '@expo/config';\nimport chalk from 'chalk';\n\nimport { memoize } from './fn';\nimport { learnMore } from './link';\nimport { attemptModification } from './modifyConfigAsync';\nimport prompt, { confirmAsync } from './prompts';\nimport {\n assertValidBundleId,\n assertValidPackage,\n getBundleIdWarningAsync,\n getPackageNameWarningAsync,\n getSanitizedBundleIdentifier,\n getSanitizedPackage,\n validateBundleId,\n validatePackage,\n validatePackageWithWarning,\n} from './validateApplicationId';\nimport * as Log from '../log';\nimport { getAccountUsername } from './getAccountUsername';\n\nconst debug = require('debug')('expo:app-id') as typeof console.log;\n\nfunction getExpoUsername(exp: ExpoConfig) {\n // Account for if the environment variable was an empty string.\n return getAccountUsername(exp) || 'anonymous';\n}\n\nconst NO_BUNDLE_ID_MESSAGE = `Project must have a \\`ios.bundleIdentifier\\` set in the Expo config (app.json or app.config.js).`;\n\nconst NO_PACKAGE_MESSAGE = `Project must have a \\`android.package\\` set in the Expo config (app.json or app.config.js).`;\n\n/**\n * Get the bundle identifier from the Expo config or prompt the user to choose a new bundle identifier.\n * Prompted value will be validated against the App Store and a local regex.\n * If the project Expo config is a static JSON file, the bundle identifier will be updated in the config automatically.\n */\nexport async function getOrPromptForBundleIdentifier(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\n const current = exp.ios?.bundleIdentifier;\n if (current) {\n assertValidBundleId(current);\n return current;\n }\n\n return promptForBundleIdWithInitialAsync(projectRoot, exp, getRecommendedBundleId(exp));\n}\n\nconst memoLog = memoize(Log.log);\n\nasync function promptForBundleIdWithInitialAsync(\n projectRoot: string,\n exp: ExpoConfig,\n bundleIdentifier?: string\n): Promise<string> {\n if (!bundleIdentifier) {\n memoLog(\n chalk`\\n{bold 📝 iOS Bundle Identifier} {dim ${learnMore(\n 'https://expo.fyi/bundle-identifier'\n )}}\\n`\n );\n\n // Prompt the user for the bundle ID.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom bundle ID upfront.\n const { input } = await prompt(\n {\n type: 'text',\n name: 'input',\n // The Apple helps people know this isn't an EAS feature.\n message: `What would you like your iOS bundle identifier to be?`,\n validate: validateBundleId,\n },\n {\n nonInteractiveHelp: NO_BUNDLE_ID_MESSAGE,\n }\n );\n bundleIdentifier = input as string;\n }\n\n // Warn the user if the bundle ID is already in use.\n const warning = await getBundleIdWarningAsync(bundleIdentifier);\n\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Bundle ID prompt to try again.\n return await promptForBundleIdWithInitialAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n if (\n await attemptModification(\n projectRoot,\n {\n ios: { ...(exp.ios || {}), bundleIdentifier },\n },\n { ios: { bundleIdentifier } }\n )\n ) {\n Log.log(chalk.gray`\\u203A Apple bundle identifier: ${bundleIdentifier}`);\n }\n\n return bundleIdentifier;\n}\n\nasync function warnAndConfirmAsync(warning: string): Promise<boolean> {\n Log.log();\n Log.warn(warning);\n Log.log();\n if (\n !(await confirmAsync({\n message: `Continue?`,\n initial: true,\n }))\n ) {\n return false;\n }\n return true;\n}\n\n// Recommend a bundle identifier based on the username and project slug.\nfunction getRecommendedBundleId(exp: ExpoConfig): string | undefined {\n const possibleIdFromAndroid = exp.android?.package\n ? getSanitizedBundleIdentifier(exp.android.package)\n : undefined;\n // Attempt to use the android package name first since it's convenient to have them aligned.\n if (possibleIdFromAndroid && validateBundleId(possibleIdFromAndroid)) {\n return possibleIdFromAndroid;\n } else {\n const username = getExpoUsername(exp);\n const possibleId = getSanitizedBundleIdentifier(`com.${username}.${exp.slug}`);\n if (validateBundleId(possibleId)) {\n return possibleId;\n }\n }\n\n return undefined;\n}\n\n// Recommend a package name based on the username and project slug.\nfunction getRecommendedPackageName(exp: ExpoConfig): string | undefined {\n const possibleIdFromApple = exp.ios?.bundleIdentifier\n ? getSanitizedPackage(exp.ios.bundleIdentifier)\n : undefined;\n\n // Attempt to use the ios bundle id first since it's convenient to have them aligned.\n if (possibleIdFromApple && validatePackage(possibleIdFromApple)) {\n return possibleIdFromApple;\n } else {\n const username = getExpoUsername(exp);\n const possibleId = getSanitizedPackage(`com.${username}.${exp.slug}`);\n if (validatePackage(possibleId)) {\n return possibleId;\n } else {\n debug(\n `Recommended package name is invalid: \"${possibleId}\" (username: ${username}, slug: ${exp.slug})`\n );\n }\n }\n return undefined;\n}\n\n/**\n * Get the package name from the Expo config or prompt the user to choose a new package name.\n * Prompted value will be validated against the Play Store and a local regex.\n * If the project Expo config is a static JSON file, the package name will be updated in the config automatically.\n */\nexport async function getOrPromptForPackage(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\n const current = exp.android?.package;\n if (current) {\n assertValidPackage(current);\n return current;\n }\n\n return await promptForPackageAsync(projectRoot, exp);\n}\n\nfunction promptForPackageAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n return promptForPackageWithInitialAsync(projectRoot, exp, getRecommendedPackageName(exp));\n}\n\nasync function promptForPackageWithInitialAsync(\n projectRoot: string,\n exp: ExpoConfig,\n packageName?: string\n): Promise<string> {\n if (!packageName) {\n memoLog(\n chalk`\\n{bold 📝 Android package} {dim ${learnMore('https://expo.fyi/android-package')}}\\n`\n );\n\n // Prompt the user for the android package.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom android package upfront.\n const { input } = await prompt(\n {\n type: 'text',\n name: 'input',\n message: `What would you like your Android package name to be?`,\n validate: validatePackageWithWarning,\n },\n {\n nonInteractiveHelp: NO_PACKAGE_MESSAGE,\n }\n );\n packageName = input as string;\n }\n\n // Warn the user if the package name is already in use.\n const warning = await getPackageNameWarningAsync(packageName);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Package name prompt to try again.\n return promptForPackageWithInitialAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n if (\n await attemptModification(\n projectRoot,\n {\n android: { ...(exp.android || {}), package: packageName },\n },\n {\n android: { package: packageName },\n }\n )\n ) {\n Log.log(chalk.gray`\\u203A Android package name: ${packageName}`);\n }\n\n return packageName;\n}\n"],"names":["getOrPromptForBundleIdentifier","getOrPromptForPackage","debug","require","getExpoUsername","exp","getAccountUsername","NO_BUNDLE_ID_MESSAGE","NO_PACKAGE_MESSAGE","projectRoot","getConfig","current","ios","bundleIdentifier","assertValidBundleId","promptForBundleIdWithInitialAsync","getRecommendedBundleId","memoLog","memoize","Log","log","chalk","learnMore","input","prompt","type","name","message","validate","validateBundleId","nonInteractiveHelp","warning","getBundleIdWarningAsync","warnAndConfirmAsync","attemptModification","gray","warn","confirmAsync","initial","possibleIdFromAndroid","android","package","getSanitizedBundleIdentifier","undefined","username","possibleId","slug","getRecommendedPackageName","possibleIdFromApple","getSanitizedPackage","validatePackage","assertValidPackage","promptForPackageAsync","promptForPackageWithInitialAsync","packageName","validatePackageWithWarning","getPackageNameWarningAsync"],"mappings":"AAAA;;;;;;;;;;;IAqCsBA,8BAA8B,MAA9BA,8BAA8B;IAoI9BC,qBAAqB,MAArBA,qBAAqB;;;yBAzKL,cAAc;;;;;;;8DAClC,OAAO;;;;;;oBAED,MAAM;sBACJ,QAAQ;mCACE,qBAAqB;+DACpB,WAAW;uCAWzC,yBAAyB;2DACX,QAAQ;oCACM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzD,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,AAAsB,AAAC;AAEpE,SAASC,eAAe,CAACC,GAAe,EAAE;IACxC,+DAA+D;IAC/D,OAAOC,IAAAA,mBAAkB,mBAAA,EAACD,GAAG,CAAC,IAAI,WAAW,CAAC;AAChD,CAAC;AAED,MAAME,oBAAoB,GAAG,CAAC,gGAAgG,CAAC,AAAC;AAEhI,MAAMC,kBAAkB,GAAG,CAAC,2FAA2F,CAAC,AAAC;AAOlH,eAAeR,8BAA8B,CAClDS,WAAmB,EACnBJ,GAAe,GAAGK,IAAAA,OAAS,EAAA,UAAA,EAACD,WAAW,CAAC,CAACJ,GAAG,EAC3B;QACDA,GAAO;IAAvB,MAAMM,OAAO,GAAGN,CAAAA,GAAO,GAAPA,GAAG,CAACO,GAAG,SAAkB,GAAzBP,KAAAA,CAAyB,GAAzBA,GAAO,CAAEQ,gBAAgB,AAAC;IAC1C,IAAIF,OAAO,EAAE;QACXG,IAAAA,sBAAmB,oBAAA,EAAC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DAAuD;IACvD,MAAMQ,OAAO,GAAG,MAAMyB,IAAAA,sBAA0B,2BAAA,EAACF,WAAW,CAAC,AAAC;IAC9D,IAAIvB,OAAO,IAAI,CAAE,MAAME,mBAAmB,CAACF,OAAO,CAAC,AAAC,EAAE;QACpD,8CAA8C;QAC9C,OAAOsB,gCAAgC,CAAC5C,WAAW,EAAEJ,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,mCAAmC;IACnC,IACE,MAAM6B,IAAAA,kBAAmB,oBAAA,EACvBzB,WAAW,EACX;QACE+B,OAAO,EAAE;YAAE,GAAInC,GAAG,CAACmC,OAAO,IAAI,EAAE;YAAGC,OAAO,EAAEa,WAAW;SAAE;KAC1D,EACD;QACEd,OAAO,EAAE;YAAEC,OAAO,EAAEa,WAAW;SAAE;KAClC,CACF,EACD;QACAnC,IAAG,CAACC,GAAG,CAACC,MAAK,EAAA,QAAA,CAACc,IAAI,CAAC,6BAA6B,EAAEmB,WAAW,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAOA,WAAW,CAAC;AACrB,CAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/getOrPromptApplicationId.ts"],"sourcesContent":["import { GraphQLError } from '@0no-co/graphql.web';\nimport { ExpoConfig, getConfig } from '@expo/config';\nimport { CombinedError } from '@urql/core';\nimport chalk from 'chalk';\n\nimport { memoize } from './fn';\nimport { learnMore } from './link';\nimport { attemptModification } from './modifyConfigAsync';\nimport prompt, { confirmAsync } from './prompts';\nimport {\n assertValidBundleId,\n assertValidPackage,\n getBundleIdWarningAsync,\n getPackageNameWarningAsync,\n getSanitizedBundleIdentifier,\n getSanitizedPackage,\n validateBundleId,\n validatePackage,\n validatePackageWithWarning,\n} from './validateApplicationId';\nimport { AppQuery } from '../api/graphql/queries/AppQuery';\nimport * as Log from '../log';\n\nconst debug = require('debug')('expo:app-id') as typeof console.log;\n\nasync function getRecommendedReverseDomainNameSecondPartAsync(\n exp: ExpoConfig\n): Promise<string | null> {\n const easProjectId = exp.extra?.eas?.projectId;\n if (!easProjectId) {\n return null;\n }\n\n try {\n const app = await AppQuery.byIdAsync(easProjectId);\n return app.ownerAccount.name;\n } catch (e) {\n if (e instanceof GraphQLError || e instanceof CombinedError) {\n return null;\n }\n throw e;\n }\n}\n\nconst NO_BUNDLE_ID_MESSAGE = `Project must have a \\`ios.bundleIdentifier\\` set in the Expo config (app.json or app.config.js).`;\n\nconst NO_PACKAGE_MESSAGE = `Project must have a \\`android.package\\` set in the Expo config (app.json or app.config.js).`;\n\n/**\n * Get the bundle identifier from the Expo config or prompt the user to choose a new bundle identifier.\n * Prompted value will be validated against the App Store and a local regex.\n * If the project Expo config is a static JSON file, the bundle identifier will be updated in the config automatically.\n */\nexport async function getOrPromptForBundleIdentifierAsync(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\n const current = exp.ios?.bundleIdentifier;\n if (current) {\n assertValidBundleId(current);\n return current;\n }\n\n return promptForBundleIdWithInitialAsync(\n projectRoot,\n exp,\n await getRecommendedBundleIdAsync(exp)\n );\n}\n\nconst memoLog = memoize(Log.log);\n\nasync function promptForBundleIdWithInitialAsync(\n projectRoot: string,\n exp: ExpoConfig,\n bundleIdentifier?: string\n): Promise<string> {\n if (!bundleIdentifier) {\n memoLog(\n chalk`\\n{bold 📝 iOS Bundle Identifier} {dim ${learnMore(\n 'https://expo.fyi/bundle-identifier'\n )}}\\n`\n );\n\n // Prompt the user for the bundle ID.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom bundle ID upfront.\n const { input } = await prompt(\n {\n type: 'text',\n name: 'input',\n // The Apple helps people know this isn't an EAS feature.\n message: `What would you like your iOS bundle identifier to be?`,\n validate: validateBundleId,\n },\n {\n nonInteractiveHelp: NO_BUNDLE_ID_MESSAGE,\n }\n );\n bundleIdentifier = input as string;\n }\n\n // Warn the user if the bundle ID is already in use.\n const warning = await getBundleIdWarningAsync(bundleIdentifier);\n\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Bundle ID prompt to try again.\n return await promptForBundleIdWithInitialAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n if (\n await attemptModification(\n projectRoot,\n {\n ios: { ...(exp.ios || {}), bundleIdentifier },\n },\n { ios: { bundleIdentifier } }\n )\n ) {\n Log.log(chalk.gray`\\u203A Apple bundle identifier: ${bundleIdentifier}`);\n }\n\n return bundleIdentifier;\n}\n\nasync function warnAndConfirmAsync(warning: string): Promise<boolean> {\n Log.log();\n Log.warn(warning);\n Log.log();\n if (\n !(await confirmAsync({\n message: `Continue?`,\n initial: true,\n }))\n ) {\n return false;\n }\n return true;\n}\n\n// Recommend a bundle identifier based on the account name of the owner of the project and project slug.\nasync function getRecommendedBundleIdAsync(exp: ExpoConfig): Promise<string | undefined> {\n const possibleIdFromAndroid = exp.android?.package\n ? getSanitizedBundleIdentifier(exp.android.package)\n : undefined;\n // Attempt to use the android package name first since it's convenient to have them aligned.\n if (possibleIdFromAndroid && validateBundleId(possibleIdFromAndroid)) {\n return possibleIdFromAndroid;\n } else {\n const recommendedReverseDomainNameSecondPart =\n await getRecommendedReverseDomainNameSecondPartAsync(exp);\n if (recommendedReverseDomainNameSecondPart) {\n const possibleId = getSanitizedBundleIdentifier(\n `com.${recommendedReverseDomainNameSecondPart}.${exp.slug}`\n );\n if (validateBundleId(possibleId)) {\n return possibleId;\n }\n } else {\n debug('Could not generate recommended name from EAS');\n }\n }\n\n return undefined;\n}\n\n// Recommend a package name based on the account name of the owner of the project and project slug.\nasync function getRecommendedPackageNameAsync(exp: ExpoConfig): Promise<string | undefined> {\n const possibleIdFromApple = exp.ios?.bundleIdentifier\n ? getSanitizedPackage(exp.ios.bundleIdentifier)\n : undefined;\n\n // Attempt to use the ios bundle id first since it's convenient to have them aligned.\n if (possibleIdFromApple && validatePackage(possibleIdFromApple)) {\n return possibleIdFromApple;\n } else {\n const recommendedReverseDomainNameSecondPart =\n await getRecommendedReverseDomainNameSecondPartAsync(exp);\n if (recommendedReverseDomainNameSecondPart) {\n const possibleId = getSanitizedPackage(\n `com.${recommendedReverseDomainNameSecondPart}.${exp.slug}`\n );\n if (validatePackage(possibleId)) {\n return possibleId;\n } else {\n debug(\n `Recommended package name is invalid: \"${possibleId}\" (owner: ${recommendedReverseDomainNameSecondPart}, slug: ${exp.slug})`\n );\n }\n } else {\n debug('Could not generate recommended name from EAS');\n }\n }\n return undefined;\n}\n\n/**\n * Get the package name from the Expo config or prompt the user to choose a new package name.\n * Prompted value will be validated against the Play Store and a local regex.\n * If the project Expo config is a static JSON file, the package name will be updated in the config automatically.\n */\nexport async function getOrPromptForPackageAsync(\n projectRoot: string,\n exp: ExpoConfig = getConfig(projectRoot).exp\n): Promise<string> {\n const current = exp.android?.package;\n if (current) {\n assertValidPackage(current);\n return current;\n }\n\n return await promptForPackageAsync(projectRoot, exp);\n}\n\nasync function promptForPackageAsync(projectRoot: string, exp: ExpoConfig): Promise<string> {\n return promptForPackageWithInitialAsync(\n projectRoot,\n exp,\n await getRecommendedPackageNameAsync(exp)\n );\n}\n\nasync function promptForPackageWithInitialAsync(\n projectRoot: string,\n exp: ExpoConfig,\n packageName?: string\n): Promise<string> {\n if (!packageName) {\n memoLog(\n chalk`\\n{bold 📝 Android package} {dim ${learnMore('https://expo.fyi/android-package')}}\\n`\n );\n\n // Prompt the user for the android package.\n // Even if the project is using a dynamic config we can still\n // prompt a better error message, recommend a default value, and help the user\n // validate their custom android package upfront.\n const { input } = await prompt(\n {\n type: 'text',\n name: 'input',\n message: `What would you like your Android package name to be?`,\n validate: validatePackageWithWarning,\n },\n {\n nonInteractiveHelp: NO_PACKAGE_MESSAGE,\n }\n );\n packageName = input as string;\n }\n\n // Warn the user if the package name is already in use.\n const warning = await getPackageNameWarningAsync(packageName);\n if (warning && !(await warnAndConfirmAsync(warning))) {\n // Cycle the Package name prompt to try again.\n return promptForPackageWithInitialAsync(projectRoot, exp);\n }\n\n // Apply the changes to the config.\n if (\n await attemptModification(\n projectRoot,\n {\n android: { ...(exp.android || {}), package: packageName },\n },\n {\n android: { package: packageName },\n }\n )\n ) {\n Log.log(chalk.gray`\\u203A Android package name: ${packageName}`);\n }\n\n return packageName;\n}\n"],"names":["getOrPromptForBundleIdentifierAsync","getOrPromptForPackageAsync","debug","require","getRecommendedReverseDomainNameSecondPartAsync","exp","easProjectId","extra","eas","projectId","app","AppQuery","byIdAsync","ownerAccount","name","e","GraphQLError","CombinedError","NO_BUNDLE_ID_MESSAGE","NO_PACKAGE_MESSAGE","projectRoot","getConfig","current","ios","bundleIdentifier","assertValidBundleId","promptForBundleIdWithInitialAsync","getRecommendedBundleIdAsync","memoLog","memoize","Log","log","chalk","learnMore","input","prompt","type","message","validate","validateBundleId","nonInteractiveHelp","warning","getBundleIdWarningAsync","warnAndConfirmAsync","attemptModification","gray","warn","confirmAsync","initial","possibleIdFromAndroid","android","package","getSanitizedBundleIdentifier","undefined","recommendedReverseDomainNameSecondPart","possibleId","slug","getRecommendedPackageNameAsync","possibleIdFromApple","getSanitizedPackage","validatePackage","assertValidPackage","promptForPackageAsync","promptForPackageWithInitialAsync","packageName","validatePackageWithWarning","getPackageNameWarningAsync"],"mappings":"AAAA;;;;;;;;;;;IAqDsBA,mCAAmC,MAAnCA,mCAAmC;IAsJnCC,0BAA0B,MAA1BA,0BAA0B;;;yBA3MnB,qBAAqB;;;;;;;yBACZ,cAAc;;;;;;;yBACtB,YAAY;;;;;;;8DACxB,OAAO;;;;;;oBAED,MAAM;sBACJ,QAAQ;mCACE,qBAAqB;+DACpB,WAAW;uCAWzC,yBAAyB;0BACP,iCAAiC;2DACrC,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE7B,MAAMC,KAAK,GAAGC,OAAO,CAAC,OAAO,CAAC,CAAC,aAAa,CAAC,AAAsB,AAAC;AAEpE,eAAeC,8CAA8C,CAC3DC,GAAe,EACS;QACHA,GAAS;IAA9B,MAAMC,YAAY,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,uDAAuD;IACvD,MAAMO,OAAO,GAAG,MAAMyB,IAAAA,sBAA0B,2BAAA,EAACF,WAAW,CAAC,AAAC;IAC9D,IAAIvB,OAAO,IAAI,CAAE,MAAME,mBAAmB,CAACF,OAAO,CAAC,AAAC,EAAE;QACpD,8CAA8C;QAC9C,OAAOsB,gCAAgC,CAAC3C,WAAW,EAAEf,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,mCAAmC;IACnC,IACE,MAAMuC,IAAAA,kBAAmB,oBAAA,EACvBxB,WAAW,EACX;QACE8B,OAAO,EAAE;YAAE,GAAI7C,GAAG,CAAC6C,OAAO,IAAI,EAAE;YAAGC,OAAO,EAAEa,WAAW;SAAE;KAC1D,EACD;QACEd,OAAO,EAAE;YAAEC,OAAO,EAAEa,WAAW;SAAE;KAClC,CACF,EACD;QACAlC,IAAG,CAACC,GAAG,CAACC,MAAK,EAAA,QAAA,CAACa,IAAI,CAAC,6BAA6B,EAAEmB,WAAW,CAAC,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAOA,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -31,7 +31,7 @@ class FetchClient {
|
|
|
31
31
|
this.headers = {
|
|
32
32
|
accept: "application/json",
|
|
33
33
|
"content-type": "application/json",
|
|
34
|
-
"user-agent": `expo-cli/${"1.0.0-canary-
|
|
34
|
+
"user-agent": `expo-cli/${"1.0.0-canary-20250207-8bc5146"}`,
|
|
35
35
|
authorization: "Basic " + _nodeBuffer().Buffer.from(`${target}:`).toString("base64")
|
|
36
36
|
};
|
|
37
37
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/cli",
|
|
3
|
-
"version": "1.0.0-canary-
|
|
3
|
+
"version": "1.0.0-canary-20250207-8bc5146",
|
|
4
4
|
"description": "The Expo CLI",
|
|
5
5
|
"main": "build/bin/cli",
|
|
6
6
|
"bin": {
|
|
@@ -42,19 +42,20 @@
|
|
|
42
42
|
"@0no-co/graphql.web": "^1.0.8",
|
|
43
43
|
"@babel/runtime": "^7.20.0",
|
|
44
44
|
"@expo/code-signing-certificates": "^0.0.5",
|
|
45
|
-
"@expo/config": "11.0.0-canary-
|
|
46
|
-
"@expo/config-plugins": "9.0.
|
|
45
|
+
"@expo/config": "11.0.0-canary-20250207-8bc5146",
|
|
46
|
+
"@expo/config-plugins": "9.0.16-canary-20250207-8bc5146",
|
|
47
47
|
"@expo/devcert": "^1.1.2",
|
|
48
|
-
"@expo/env": "1.0.1-canary-
|
|
49
|
-
"@expo/image-utils": "0.6.5-canary-
|
|
50
|
-
"@expo/json-file": "9.0.2-canary-
|
|
51
|
-
"@expo/metro-config": "0.20.0-canary-
|
|
52
|
-
"@expo/osascript": "2.1.6-canary-
|
|
53
|
-
"@expo/package-manager": "1.8.0-canary-
|
|
54
|
-
"@expo/plist": "0.2.2-canary-
|
|
55
|
-
"@expo/prebuild-config": "8.0.
|
|
48
|
+
"@expo/env": "1.0.1-canary-20250207-8bc5146",
|
|
49
|
+
"@expo/image-utils": "0.6.5-canary-20250207-8bc5146",
|
|
50
|
+
"@expo/json-file": "9.0.2-canary-20250207-8bc5146",
|
|
51
|
+
"@expo/metro-config": "0.20.0-canary-20250207-8bc5146",
|
|
52
|
+
"@expo/osascript": "2.1.6-canary-20250207-8bc5146",
|
|
53
|
+
"@expo/package-manager": "1.8.0-canary-20250207-8bc5146",
|
|
54
|
+
"@expo/plist": "0.2.2-canary-20250207-8bc5146",
|
|
55
|
+
"@expo/prebuild-config": "8.0.27-canary-20250207-8bc5146",
|
|
56
56
|
"@expo/rudder-sdk-node": "^1.1.1",
|
|
57
57
|
"@expo/spawn-async": "^1.7.2",
|
|
58
|
+
"@expo/ws-tunnel": "^1.0.1",
|
|
58
59
|
"@expo/xcpretty": "^4.3.0",
|
|
59
60
|
"@react-native/dev-middleware": "0.76.5",
|
|
60
61
|
"@urql/core": "^5.0.6",
|
|
@@ -119,7 +120,7 @@
|
|
|
119
120
|
"devDependencies": {
|
|
120
121
|
"@expo/multipart-body-parser": "^1.0.0",
|
|
121
122
|
"@expo/ngrok": "4.1.3",
|
|
122
|
-
"@expo/server": "0.5.2-canary-
|
|
123
|
+
"@expo/server": "0.5.2-canary-20250207-8bc5146",
|
|
123
124
|
"@graphql-codegen/cli": "^2.16.3",
|
|
124
125
|
"@graphql-codegen/typescript": "^2.8.7",
|
|
125
126
|
"@graphql-codegen/typescript-operations": "^2.5.12",
|
|
@@ -154,7 +155,7 @@
|
|
|
154
155
|
"@types/ws": "^8.5.4",
|
|
155
156
|
"devtools-protocol": "^0.0.1113120",
|
|
156
157
|
"expo-atlas": "^0.4.0",
|
|
157
|
-
"expo-module-scripts": "4.0.4-canary-
|
|
158
|
+
"expo-module-scripts": "4.0.4-canary-20250207-8bc5146",
|
|
158
159
|
"find-process": "^1.4.7",
|
|
159
160
|
"jest-runner-tsd": "^6.0.0",
|
|
160
161
|
"klaw-sync": "^6.0.0",
|
|
@@ -166,5 +167,6 @@
|
|
|
166
167
|
"taskr": "^1.1.0",
|
|
167
168
|
"tree-kill": "^1.2.2",
|
|
168
169
|
"tsd": "^0.28.1"
|
|
169
|
-
}
|
|
170
|
+
},
|
|
171
|
+
"gitHead": "8bc5146852ccd7033138bac9ef8d3c41ae85a211"
|
|
170
172
|
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "getAccountUsername", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: ()=>getAccountUsername
|
|
8
|
-
});
|
|
9
|
-
const _userSettings = require("../api/user/UserSettings");
|
|
10
|
-
const ANONYMOUS_USERNAME = "anonymous";
|
|
11
|
-
function getAccountUsername(manifest = {}) {
|
|
12
|
-
var ref;
|
|
13
|
-
// TODO: Must match what's generated in Expo Go.
|
|
14
|
-
const username = manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;
|
|
15
|
-
if (username) {
|
|
16
|
-
return username;
|
|
17
|
-
}
|
|
18
|
-
// Statically get the username from the global user state.
|
|
19
|
-
return ((ref = (0, _userSettings.getSettings)().read().auth) == null ? void 0 : ref.username) || ANONYMOUS_USERNAME;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
//# sourceMappingURL=getAccountUsername.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/getAccountUsername.ts"],"sourcesContent":["import { ExpoConfig } from '@expo/config';\n\nimport { getSettings } from '../api/user/UserSettings';\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 getSettings().read().auth?.username || ANONYMOUS_USERNAME;\n}\n"],"names":["getAccountUsername","ANONYMOUS_USERNAME","manifest","getSettings","username","owner","process","env","EXPO_CLI_USERNAME","EAS_BUILD_USERNAME","read","auth"],"mappings":"AAAA;;;;+BAagBA,oBAAkB;;aAAlBA,kBAAkB;;8BAXN,0BAA0B;AAEtD,MAAMC,kBAAkB,GAAG,WAAW,AAAC;AAShC,SAASD,kBAAkB,CAACE,QAAmC,GAAG,EAAE,EAAU;QAQ5EC,GAAyB;IAPhC,gDAAgD;IAChD,MAAMC,QAAQ,GACZF,QAAQ,CAACG,KAAK,IAAIC,OAAO,CAACC,GAAG,CAACC,iBAAiB,IAAIF,OAAO,CAACC,GAAG,CAACE,kBAAkB,AAAC;IACpF,IAAIL,QAAQ,EAAE;QACZ,OAAOA,QAAQ,CAAC;IAClB,CAAC;IACD,0DAA0D;IAC1D,OAAOD,CAAAA,CAAAA,GAAyB,GAAzBA,IAAAA,aAAW,YAAA,GAAE,CAACO,IAAI,EAAE,CAACC,IAAI,SAAU,GAAnCR,KAAAA,CAAmC,GAAnCA,GAAyB,CAAEC,QAAQ,CAAA,IAAIH,kBAAkB,CAAC;AACnE,CAAC"}
|