From 85fccdaf5da152b45d91ff6db2500cccc9a0f27c Mon Sep 17 00:00:00 2001 From: dprevost-perso Date: Tue, 22 Sep 2026 20:46:20 -0400 Subject: [PATCH 1/2] fix: eliminate parallel build races that can produce empty output dirs - build: run-p clean compile -> run-s: rimraf and tsc wrote to the same packages/*/build dirs concurrently, so a slow filesystem could let clean delete output tsc had just emitted for one package. - cddl2ts cli-examples: run-p cli-examples:* -> run-s: local/remote each independently run the full `pnpm -w run compile`, so running them in parallel meant two concurrent tsc invocations writing to the same build output at once. This class of race is the likely cause of cddl2ts@0.11.0 publishing to npm without its build/ directory, breaking both the package's main export and its CLI. Co-Authored-By: Claude Sonnet 5 --- package.json | 2 +- packages/cddl2ts/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a43879d..2f59442 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ }, "type": "module", "scripts": { - "build": "run-p clean compile", + "build": "run-s clean compile", "clean": "rimraf --glob ./packages/*/build ./packages/*/coverage", "compile": "run-s compile:cddl compile:other", "compile:cddl": "pnpm --filter=cddl exec tsc -p ./tsconfig.json", diff --git a/packages/cddl2ts/package.json b/packages/cddl2ts/package.json index c6b70fd..628e806 100644 --- a/packages/cddl2ts/package.json +++ b/packages/cddl2ts/package.json @@ -26,7 +26,7 @@ "scripts": { "release": "release-it --config .release-it.ts --VV", "release:ci": "pnpm release --ci --npm.skipChecks", - "cli-examples": "run-p cli-examples:*", + "cli-examples": "run-s cli-examples:*", "cli-examples:local": "pnpm -w run compile && node ./bin/cddl2ts.js ../../examples/webdriver/local.cddl --unknown-as-any > ./cli-examples/local.ts && tsc -p ./cli-examples/tsconfig.json", "cli-examples:remote": "pnpm -w run compile && node ./bin/cddl2ts.js ../../examples/webdriver/remote.cddl --unknown-as-any > ./cli-examples/remote.ts && tsc -p ./cli-examples/tsconfig.json" }, From df59e2f21d9d330a3b403a0f05ca22e466f7de8c Mon Sep 17 00:00:00 2001 From: dprevost-perso Date: Tue, 22 Sep 2026 20:51:41 -0400 Subject: [PATCH 2/2] fix: avoid duplicate workspace compiles in cli-examples Per review feedback on PR #116: run-s avoided the concurrent-write race but each leaf script still ran the full `pnpm -w run compile` independently, compiling the workspace twice in a row. Hoist the compile into the parent script so it runs once before both generators. Co-Authored-By: Claude Sonnet 5 --- packages/cddl2ts/package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/cddl2ts/package.json b/packages/cddl2ts/package.json index 628e806..024da98 100644 --- a/packages/cddl2ts/package.json +++ b/packages/cddl2ts/package.json @@ -26,9 +26,9 @@ "scripts": { "release": "release-it --config .release-it.ts --VV", "release:ci": "pnpm release --ci --npm.skipChecks", - "cli-examples": "run-s cli-examples:*", - "cli-examples:local": "pnpm -w run compile && node ./bin/cddl2ts.js ../../examples/webdriver/local.cddl --unknown-as-any > ./cli-examples/local.ts && tsc -p ./cli-examples/tsconfig.json", - "cli-examples:remote": "pnpm -w run compile && node ./bin/cddl2ts.js ../../examples/webdriver/remote.cddl --unknown-as-any > ./cli-examples/remote.ts && tsc -p ./cli-examples/tsconfig.json" + "cli-examples": "pnpm -w run compile && run-s cli-examples:*", + "cli-examples:local": "node ./bin/cddl2ts.js ../../examples/webdriver/local.cddl --unknown-as-any > ./cli-examples/local.ts && tsc -p ./cli-examples/tsconfig.json", + "cli-examples:remote": "node ./bin/cddl2ts.js ../../examples/webdriver/remote.cddl --unknown-as-any > ./cli-examples/remote.ts && tsc -p ./cli-examples/tsconfig.json" }, "devDependencies": { "@types/node": "^26.0.1",