mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 17:50:32 -10:00
Compare commits
15
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
778a51d099 | ||
|
|
87967f4a8c | ||
|
|
1ae6693149 | ||
|
|
d61dfda4e0 | ||
|
|
65771632d5 | ||
|
|
3e517de3c8 | ||
|
|
fe4b863647 | ||
|
|
1bfeb40977 | ||
|
|
34941f786c | ||
|
|
129446ea01 | ||
|
|
b9455b1d9b | ||
|
|
4621c6cf2e | ||
|
|
26f21a09ce | ||
|
|
34db166e50 | ||
|
|
4cd3a9e206 |
No files matched your search
@@ -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
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
[env]
|
||||
_.path = "./tools/bin"
|
||||
MISE_NODE_COREPACK = "true"
|
||||
|
||||
[tools]
|
||||
node = "20.19.4"
|
||||
yarn = "4.12.0"
|
||||
+2
-1
@@ -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"
|
||||
|
||||
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
@@ -0,0 +1,2 @@
|
||||
#!/usr/bin/env bash
|
||||
exec corepack yarn "$@"
|
||||
Reference in new issue
Block a user