@@ -125609,15 +125609,26 @@ const github_1 = __nccwpck_require__(95438);
125609125609const fingerprint_1 = __nccwpck_require__(3596);
125610125610const fs_1 = __nccwpck_require__(57147);
125611125611const { readFile, stat } = fs_1.promises;
125612+ const packageManagerName = (field) => {
125613+ if (typeof field === 'string')
125614+ return field;
125615+ if (Array.isArray(field))
125616+ return packageManagerName(field[0]);
125617+ if (typeof field === 'object' && field !== null) {
125618+ return field.name;
125619+ }
125620+ return undefined;
125621+ };
125612125622const detectPackageManager = async () => {
125613125623 try {
125614125624 const pkg = JSON.parse(await readFile('package.json', 'utf8'));
125615- const field = pkg.packageManager;
125616- if (field?.startsWith('pnpm@'))
125625+ const name = packageManagerName(pkg.packageManager) ??
125626+ packageManagerName(pkg.devEngines?.packageManager);
125627+ if (name?.startsWith('pnpm'))
125617125628 return 'pnpm';
125618- if (field ?.startsWith('npm@ '))
125629+ if (name ?.startsWith('npm'))
125619125630 return 'npm';
125620- if (field ?.startsWith('yarn@ '))
125631+ if (name ?.startsWith('yarn'))
125621125632 return 'yarn';
125622125633 }
125623125634 catch {
@@ -125642,16 +125653,21 @@ const detectPackageManager = async () => {
125642125653};
125643125654const runInstall = async (pm) => {
125644125655 if (pm === 'pnpm') {
125645- await (0, exec_1.exec)('corepack enable ');
125656+ await (0, exec_1.exec)('npm install -g pnpm@11.5.3 '); // > 10.21.0 will defer to `packageMananger` version.
125646125657 await (0, exec_1.exec)('pnpm install --frozen-lockfile');
125647125658 }
125648125659 else if (pm === 'npm') {
125649125660 await (0, exec_1.exec)('npm ci');
125650125661 }
125651125662 else {
125652- await (0, exec_1.exec)('yarn install');
125663+ await (0, exec_1.exec)('yarn install --frozen-lockfile ');
125653125664 }
125654125665};
125666+ const fingerprintCommand = (pm) => {
125667+ if (pm === 'pnpm')
125668+ return 'pnpm dlx @expo/fingerprint .';
125669+ return 'npx @expo/fingerprint .';
125670+ };
125655125671let info = {
125656125672 currentCommit: undefined,
125657125673 previousCommit: undefined,
@@ -125729,10 +125745,14 @@ const getPrevFP = async () => {
125729125745 }
125730125746 info.previousCommit = stdout.trim();
125731125747 }
125748+ if (!info.previousCommit) {
125749+ (0, core_1.setFailed)('Previous commit not found. Aborting.');
125750+ return false;
125751+ }
125732125752 await checkoutCommit(info.previousCommit);
125733125753 const pm = await detectPackageManager();
125734125754 await runInstall(pm);
125735- const { stdout } = await (0, exec_1.getExecOutput)(`npx @expo/fingerprint .` );
125755+ const { stdout } = await (0, exec_1.getExecOutput)(fingerprintCommand(pm) );
125736125756 info.previousFingerprint = JSON.parse(stdout.trim());
125737125757 return true;
125738125758};
0 commit comments