Skip to content

Commit 89c0082

Browse files
fix(server): a quoted extra or eas key replaces app.json's EAS project id too
Review (Macroscope): the key may be quoted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1 parent ae4f35b commit 89c0082

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

‎apps/server/src/device/easProjectId.test.ts‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,14 @@ it.effect.each([
360360
},
361361
expected: Option.none(),
362362
},
363+
{
364+
case: "gives no answer when a config spreads the config but replaces a quoted extra",
365+
files: {
366+
"app.config.js": `module.exports = ({ config }) => ({ ...config, "extra": {} });`,
367+
"app.json": JSON.stringify({ expo: { extra: { eas: { projectId: ID_A } } } }),
368+
},
369+
expected: Option.none(),
370+
},
363371
{
364372
case: "gives no answer when a config spreads the config but replaces eas",
365373
files: {

‎apps/server/src/device/easProjectId.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ const REPLACES_HOLDER = /\.\s*(?:extra|eas)\s*=(?!=)|\brequire\s*\(|\bimport\s*\
7878
// An `extra:` or `eas:` entry in a config that takes its id from app.json:
7979
// unless its value is an object that starts by spreading `config`'s own,
8080
// it replaces app.json's (`extra: {}` drops the id).
81-
const EXTRA_OR_EAS = /\b(?:extra|eas)\s*:\s*/g;
81+
const EXTRA_OR_EAS = /(?:\b(?:extra|eas)|["'`](?:extra|eas)["'`])\s*:\s*/g;
8282
const keepsStaticExtra = (source: string): boolean => {
8383
for (const entry of source.matchAll(EXTRA_OR_EAS)) {
8484
let at = entry.index + entry[0].length;

0 commit comments

Comments
 (0)