Skip to content

Commit 52ee968

Browse files
committed
build: 📦 speed up cascade-changes
script was changing the nx graph then using nx which made the script slow
1 parent dc4ca1d commit 52ee968

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@
9999
"typescript-eslint": "^8.40.0",
100100
"unplugin-swc": "1.5.1",
101101
"vite": "7.1.5",
102-
"vitest": "4.0.6"
102+
"vitest": "4.0.6",
103+
"zx": "8.8.5"
103104
},
104105
"pnpm": {
105106
"onlyBuiltDependencies": [

‎pnpm-lock.yaml‎

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tools/cascade-changes.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
#!/usr/bin/env node
22

3-
import { execSync } from 'child_process';
3+
import { $ } from 'zx';
44
import { config } from './cook/config.ts';
5+
import { dirname, join } from 'path/posix';
6+
import { fileURLToPath } from 'url';
7+
58
const { exercises } = config;
69

10+
const __dirname = dirname(fileURLToPath(import.meta.url));
11+
const CLONE_CHANGES_CMD = join(__dirname, 'clone-changes.sh');
12+
713
async function main(args: string[]) {
814
const [startProject = computeExerciseProjects(exercises[0].id).starter] =
915
args;
@@ -27,10 +33,7 @@ async function main(args: string[]) {
2733
const pairwisedProjects = pairwise(filteredProjects);
2834

2935
for (const [source, destination] of pairwisedProjects) {
30-
execSync(
31-
`pnpm nx run tools:clone-changes --no-tui ${source} ${destination}`,
32-
{ stdio: 'inherit' },
33-
);
36+
await $`${CLONE_CHANGES_CMD} ${source} ${destination}`;
3437
}
3538
}
3639

0 commit comments

Comments
 (0)