Skip to content

Commit 9a970c4

Browse files
committed
run-all: fix resolveConcurrency to parse an explicit WORKBENCH_CHECK_CONCURRENCY instead of re-reading process.env
1 parent c04b7a8 commit 9a970c4

4 files changed

Lines changed: 34 additions & 9 deletions

File tree

‎packages/collections/tsconfig.json‎

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
{
2-
"extends": "../../tsconfig.base.json",
2+
"extends": "./tsconfig.src.json",
33
"compilerOptions": {
4-
"lib": ["ESNext"],
5-
"types": ["bun"]
4+
"composite": false,
5+
"noEmit": true,
6+
"disableSourceOfProjectReferenceRedirect": true,
7+
"declaration": false,
8+
"declarationMap": false,
9+
"emitDeclarationOnly": false,
10+
"rootDir": "../.."
611
},
7-
"include": ["src"]
12+
"include": ["src"],
13+
"exclude": []
814
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"include": ["src", "package.json", "src/**/*.json"],
4+
"exclude": ["src/**/*.test.ts", "src/**/*.test.tsx"],
5+
"compilerOptions": {
6+
"lib": ["ESNext"],
7+
"types": ["bun"],
8+
"composite": true,
9+
"emitDeclarationOnly": true,
10+
"outDir": "dist",
11+
"tsBuildInfoFile": "dist/tsconfig.tsbuildinfo"
12+
}
13+
}

‎scripts/run-all.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44
import { Glob } from "bun";
55
import { availableParallelism } from "node:os";
66

7-
import {
8-
CONCURRENCY_ENV,
9-
resolveConcurrency as resolveBaseConcurrency,
10-
} from "./concurrency.ts";
7+
import { CONCURRENCY_ENV } from "./concurrency.ts";
118
import { SEQUENTIAL_SCRIPTS } from "./sequential-scripts.ts";
129

1310
type Job = { readonly name: string; readonly dir: string };
@@ -27,7 +24,13 @@ export function resolveConcurrency(
2724
if (env["GITHUB_ACTIONS"] === "true") return Math.max(1, cores);
2825
return Math.max(1, cores - 2);
2926
}
30-
return resolveBaseConcurrency();
27+
const parsed = Number.parseInt(raw, 10);
28+
if (!Number.isInteger(parsed) || parsed < 1) {
29+
throw new Error(
30+
`${CONCURRENCY_ENV} must be a positive integer, got "${raw}"`,
31+
);
32+
}
33+
return parsed;
3134
}
3235

3336
// Bun's Glob silently matches nothing when a brace alternative contains a

‎tsconfig.build.json‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
{
4747
"path": "./packages/code-review/tsconfig.src.json"
4848
},
49+
{
50+
"path": "./packages/collections/tsconfig.src.json"
51+
},
4952
{
5053
"path": "./packages/command-palette/tsconfig.src.json"
5154
},

0 commit comments

Comments
 (0)