Skip to content

Commit 7f018f3

Browse files
committed
ci(experimental): scope current tarball builds
1 parent 740488f commit 7f018f3

5 files changed

Lines changed: 27 additions & 11 deletions

File tree

experimental/install/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function main() {
3434
}
3535

3636
function prepareCurrentTarballs() {
37-
run("pnpm run build:current", root);
37+
run("pnpm run build:current", root, { TTSC_BUILD_SCOPE: "experimental" });
3838

3939
fs.mkdirSync(tarballs, { recursive: true });
4040
for (const name of ["ttsc", platformTarball, ...currentPackageTarballs]) {
@@ -408,13 +408,14 @@ function tarball(name) {
408408
return file;
409409
}
410410

411-
function run(command, cwd) {
411+
function run(command, cwd, extraEnv = {}) {
412412
console.log(`$ ${command}`);
413413
const result = cp.execSync(command, {
414414
cwd,
415415
encoding: "utf8",
416416
env: {
417417
...process.env,
418+
...extraEnv,
418419
npm_config_cache: path.join(os.tmpdir(), "ttsc-npm-cache"),
419420
},
420421
stdio: ["ignore", "pipe", "pipe"],

experimental/source-map/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function main() {
5757
}
5858

5959
function prepareCurrentTarballs() {
60-
run("pnpm run build:current", root);
60+
run("pnpm run build:current", root, { TTSC_BUILD_SCOPE: "experimental" });
6161

6262
fs.mkdirSync(tarballs, { recursive: true });
6363
for (const name of ["ttsc", platformTarball]) {
@@ -248,13 +248,14 @@ function tarball(name) {
248248
return file;
249249
}
250250

251-
function run(command, cwd) {
251+
function run(command, cwd, extraEnv = {}) {
252252
console.log(`$ ${command}`);
253253
const result = cp.execSync(command, {
254254
cwd,
255255
encoding: "utf8",
256256
env: {
257257
...process.env,
258+
...extraEnv,
258259
npm_config_cache: path.join(os.tmpdir(), "ttsc-npm-cache"),
259260
},
260261
maxBuffer: 1024 * 1024 * 64,

experimental/tarballs/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ function preparePackages() {
3131
console.log(`Preparing packages (pnpm run ${script})`);
3232
cp.execSync(`pnpm run ${script}`, {
3333
cwd: root,
34+
env: {
35+
...process.env,
36+
...(CURRENT_ONLY ? { TTSC_BUILD_SCOPE: "experimental" } : {}),
37+
},
3438
stdio: "inherit",
3539
});
3640
}

experimental/test-unplugin/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ function main() {
9292
}
9393

9494
function prepareCurrentTarballs() {
95-
run("pnpm run build:current", root);
95+
run("pnpm run build:current", root, { TTSC_BUILD_SCOPE: "experimental" });
9696

9797
fs.mkdirSync(tarballs, { recursive: true });
9898
for (const name of ["ttsc", platformTarball, "unplugin"]) {
@@ -884,14 +884,15 @@ function tarball(name) {
884884
return file;
885885
}
886886

887-
function run(command, cwd) {
887+
function run(command, cwd, extraEnv = {}) {
888888
console.log(`$ ${command}`);
889889
try {
890890
const result = cp.execSync(command, {
891891
cwd,
892892
encoding: "utf8",
893893
env: {
894894
...process.env,
895+
...extraEnv,
895896
npm_config_cache: path.join(os.tmpdir(), "ttsc-npm-cache"),
896897
// ttsc resolves the native `tsc` binary from here, so the consumer need
897898
// not install the native `typescript` package (Next cannot load it).

scripts/build-current.cjs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ if (!fs.existsSync(path.join(platformDir, "package.json"))) {
1515
// (e.g. @ttsc/graph, lint-contributor-demo).
1616
const PLATFORM = Symbol("platform");
1717

18-
// `TTSC_BUILD_SCOPE` trims the build to what a given test lane actually
19-
// exercises. The heavy cost in a full build is @ttsc/graph (its build runs
20-
// `ttsc` with the typia plugin) plus the native binary; the test suites below
21-
// reference neither graph, vscode, metro, nor unplugin, so skipping them cuts
22-
// the per-lane build roughly in half.
18+
// `TTSC_BUILD_SCOPE` trims the build to what a given test or experiment lane
19+
// actually exercises. The heavy cost in a full build is @ttsc/graph (its build
20+
// runs `ttsc` with the typia plugin) plus the native binary; scoped lanes skip
21+
// packages they never package or execute.
2322
const SCOPES = {
2423
// Everything, in dependency-safe order (native binary before graph/demo).
2524
full: [
@@ -46,6 +45,16 @@ const SCOPES = {
4645
PLATFORM,
4746
"lint-contributor-demo",
4847
],
48+
// Experimental tarball smoke tests pack only ttsc, the current platform, and
49+
// first-party packages consumed by the install/unplugin checks. paths/strip
50+
// ship source files directly and have no build script.
51+
experimental: [
52+
"ttsc",
53+
"@ttsc/banner",
54+
"@ttsc/lint",
55+
"@ttsc/unplugin",
56+
PLATFORM,
57+
],
4958
};
5059

5160
const scope = process.env.TTSC_BUILD_SCOPE || "full";

0 commit comments

Comments
 (0)