Compare commits

...
Author SHA1 Message Date
Stanisław Chmiela 778a51d099 [release] Fix Yarn v4 prepack commands 2026-02-19 13:50:37 +01:00
Stanisław Chmiela 87967f4a8c [ci] Run scripts install and changelog lint only on coverage leg 2026-02-18 13:22:03 +01:00
Stanisław Chmiela 1ae6693149 [ci] Scope MISE_NODE_VERSION to setup-mise step 2026-02-18 10:51:23 +01:00
Stanisław Chmiela d61dfda4e0 [ci] Use repo yarn wrapper via mise path 2026-02-18 10:47:21 +01:00
Stanisław Chmiela 65771632d5 [ci] Use mise for node test matrix instead of setup-node 2026-02-18 10:44:46 +01:00
Stanisław Chmiela 3e517de3c8 [ci] Explicitly enable corepack after setup-mise 2026-02-18 10:43:06 +01:00
Stanisław Chmiela fe4b863647 [worker] Resolve package manager version using project context 2026-02-18 10:38:01 +01:00
Stanisław Chmiela 1bfeb40977 [worker] Use defaults.tools.corepack in EAS workflow 2026-02-18 10:35:54 +01:00
Stanisław Chmiela 34941f786c [chore] Enable corepack via mise env 2026-02-18 10:34:40 +01:00
Stanisław Chmiela 129446ea01 [chore] Let mise enable corepack for node 2026-02-18 10:29:07 +01:00
Stanisław Chmiela b9455b1d9b [worker] Run package-manager version checks outside project cwd 2026-02-18 10:24:51 +01:00
Stanisław Chmiela 4621c6cf2e [chore] Use Corepack-managed Yarn 4.12.0 2026-02-18 10:24:51 +01:00
Stanisław Chmiela 26f21a09ce [worker] Enable Corepack and prepare Yarn in EAS workflow 2026-02-18 10:18:06 +01:00
Stanisław Chmiela 34db166e50 [worker] Use global Yarn tool default in EAS workflow 2026-02-18 10:09:56 +01:00
Stanisław Chmiela 4cd3a9e206 [worker] Pin Yarn version in EAS worker build workflow 2026-02-18 10:08:45 +01:00
10 changed files with 89 additions and 26 deletions

No files matched your search

+5 -5
View File
@@ -24,10 +24,8 @@ jobs:
- uses: actions/checkout@v2
- name: Setup tools
uses: ./.github/actions/setup-mise
- name: Setup node
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
env:
MISE_NODE_VERSION: ${{ matrix.node }}
- name: Install dependencies
run: yarn install --immutable
env:
@@ -63,6 +61,7 @@ jobs:
- run: yarn lint
- run: yarn fmt:check
- name: Install scripts dependencies
if: ${{ matrix.coverage }}
run: yarn install --immutable
working-directory: ./scripts
env:
@@ -71,7 +70,8 @@ jobs:
if: ${{ matrix.coverage }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- run: yarn lint-changelog
- if: ${{ matrix.coverage }}
run: yarn lint-changelog
notify-slack:
runs-on: ubuntu-latest
+4 -1
View File
@@ -1,3 +1,6 @@
[env]
_.path = "./tools/bin"
MISE_NODE_COREPACK = "true"
[tools]
node = "20.19.4"
yarn = "4.12.0"
+2 -1
View File
@@ -32,5 +32,6 @@
"oxlint-tsgolint": "0.11.1",
"ts-jest": "29.1.1",
"typescript": "5.5.4"
}
},
"packageManager": "[email protected]"
}
@@ -32,7 +32,7 @@
"build:dev": "ncc build ./src/index.ts -o build/",
"build": "ncc build ./src/index.ts -o build/ --minify --no-cache --no-source-map-register",
"typecheck": "tsc",
"clean": "rimraf ./build/ *.tsbuildinfo"
"clean": "rimraf ./build/ \"*.tsbuildinfo\""
},
"dependencies": {
"@expo/steps": "18.0.1"
+1 -1
View File
@@ -2,6 +2,6 @@ const spawn = require('@expo/spawn-async');
(async () => {
if (!process.env.CLI_SIZE_CHECK) {
await spawn('yarn', ['oclif', 'manifest'], { stdio: 'inherit' });
await spawn('yarn', ['run', '-T', 'oclif', 'manifest'], { stdio: 'inherit' });
}
})();
@@ -1,5 +1,9 @@
name: Build Worker
defaults:
tools:
corepack: true
on:
workflow_dispatch:
inputs:
@@ -89,9 +89,21 @@ describe('prepareRuntimeEnvironment', () => {
await prepareRuntimeEnvironment(ctx, { bun: '2.0.0' }, false);
expect(spawn).toHaveBeenCalledWith('yarn', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith('pnpm', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith('bun', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith(
'yarn',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).toHaveBeenCalledWith(
'pnpm',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).toHaveBeenCalledWith(
'bun',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).toHaveBeenCalledWith(
'curl',
@@ -123,9 +135,21 @@ describe('prepareRuntimeEnvironment', () => {
await prepareRuntimeEnvironment(ctx, { bun: '2.0.0' }, false);
expect(spawn).toHaveBeenCalledWith('yarn', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith('pnpm', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith('bun', ['--version'], { stdio: 'pipe' });
expect(spawn).toHaveBeenCalledWith(
'yarn',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).toHaveBeenCalledWith(
'pnpm',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).toHaveBeenCalledWith(
'bun',
['--version'],
expect.objectContaining({ stdio: 'pipe', cwd: expect.any(String) })
);
expect(spawn).not.toHaveBeenCalledWith(
'curl',
+28 -5
View File
@@ -5,6 +5,7 @@ import { ExpoConfig } from '@expo/config-types';
import { BuildJob, EnvironmentSecret, Platform, Workflow } from '@expo/eas-build-job';
import spawnAsync from '@expo/spawn-async';
import { readFile, readJson } from 'fs-extra';
import os from 'os';
import path from 'path';
import semver from 'semver';
@@ -38,12 +39,13 @@ export async function logProjectDependenciesAsync(
const dependencies = (packageJSON?.dependencies as Record<string, string> | undefined) ?? {};
const devDependencies =
(packageJSON?.devDependencies as Record<string, string> | undefined) ?? {};
const projectDirectory = ctx.getReactNativeProjectDirectory();
const plugins = filterSecretsAndParsePlugins(
ctx.appConfig.plugins,
ctx.job.secrets?.environmentSecrets
);
const babelConfig = loadPartialConfig({ cwd: ctx.getReactNativeProjectDirectory() });
const babelConfig = loadPartialConfig({ cwd: projectDirectory });
const babelPlugins =
babelConfig?.options?.plugins
?.map(plugin => {
@@ -65,7 +67,10 @@ export async function logProjectDependenciesAsync(
version: dependency[1],
})),
packageManager: ctx.packageManager,
packageManagerVersion: await getPackageManagerVersion(ctx.packageManager),
packageManagerVersion: await getPackageManagerVersion(ctx.packageManager, {
cwd: projectDirectory,
env: ctx.env,
}),
jsEngine: resolveJsEngine(ctx, dependencies),
newArchEnabled: await resolveNewArchEnabled(ctx, dependencies['react-native']),
source: 'Turtle Worker',
@@ -202,11 +207,29 @@ function isConfigItem(plugin: PluginItem): plugin is ConfigItem {
return !Array.isArray(plugin) && (plugin as any)?.file;
}
async function getPackageManagerVersion(packageManager: string): Promise<string | undefined> {
async function getPackageManagerVersion(
packageManager: string,
{
cwd,
env,
}: {
cwd: string;
env: NodeJS.ProcessEnv;
}
): Promise<string | undefined> {
try {
const { stdout } = await spawnAsync(packageManager, ['--version']);
const { stdout } = await spawnAsync(packageManager, ['--version'], { cwd, env });
return stdout.toString().trim();
} catch {
return undefined;
// Some package managers can fail version checks in project dirs with mismatched packageManager fields.
try {
const { stdout } = await spawnAsync(packageManager, ['--version'], {
cwd: os.tmpdir(),
env,
});
return stdout.toString().trim();
} catch {
return undefined;
}
}
}
+12 -6
View File
@@ -72,9 +72,15 @@ export async function prepareRuntimeEnvironment(
return;
}
const currentYarnVersion = (await spawn('yarn', ['--version'], { stdio: 'pipe' })).stdout.trim();
const currentPnpmVersion = (await spawn('pnpm', ['--version'], { stdio: 'pipe' })).stdout.trim();
const currentBunVersion = (await spawn('bun', ['--version'], { stdio: 'pipe' })).stdout.trim();
const currentYarnVersion = (
await spawn('yarn', ['--version'], { stdio: 'pipe', cwd: os.tmpdir() })
).stdout.trim();
const currentPnpmVersion = (
await spawn('pnpm', ['--version'], { stdio: 'pipe', cwd: os.tmpdir() })
).stdout.trim();
const currentBunVersion = (
await spawn('bun', ['--version'], { stdio: 'pipe', cwd: os.tmpdir() })
).stdout.trim();
if (builderConfig.node) {
const installedNodeVersion = await installNode(ctx, builderConfig.node);
@@ -204,7 +210,7 @@ async function installBun({
});
const currentBunVersion = (
await spawn('bun', ['--version'], { stdio: 'pipe', env: ctx.env })
await spawn('bun', ['--version'], { stdio: 'pipe', env: ctx.env, cwd: os.tmpdir() })
).stdout.trim();
if (currentBunVersion !== versionToInstall) {
throw new Error(
@@ -242,7 +248,7 @@ async function installPnpm({
env: ctx.env,
});
const currentPnpmVersion = (
await spawn('pnpm', ['--version'], { stdio: 'pipe', env: ctx.env })
await spawn('pnpm', ['--version'], { stdio: 'pipe', env: ctx.env, cwd: os.tmpdir() })
).stdout.trim();
if (currentPnpmVersion !== versionToInstall) {
throw new Error(
@@ -279,7 +285,7 @@ async function installYarn({
env: ctx.env,
});
const currentYarnVersion = (
await spawn('yarn', ['--version'], { stdio: 'pipe', env: ctx.env })
await spawn('yarn', ['--version'], { stdio: 'pipe', env: ctx.env, cwd: os.tmpdir() })
).stdout.trim();
if (currentYarnVersion !== versionToInstall) {
throw new Error(
Executable
+2
View File
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
exec corepack yarn "$@"