From 2c787fa8bcd772517d5b34e65a6275815e3a1389 Mon Sep 17 00:00:00 2001 From: hermann-p Date: Tue, 15 Sep 2026 16:47:05 +0200 Subject: [PATCH 1/2] Fix build step order --- .github/workflows/publish.yml | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 3e75156..e563456 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -32,13 +32,14 @@ jobs: - name: Run tests run: deno task test - - name: Publish to JSR - run: deno publish - - # No npm/JSR publish rights required from here on - this only needs push access to this - # repo's own npm-dist branch, which the default GITHUB_TOKEN already has via the - # `contents: write` permission above. Consumers add it as a git dependency instead of a - # registry one, e.g. "grud-devtools": "git+https://github.com/campudus/grud-devtools.git#npm-dist". + # Runs before "Publish to JSR" on purpose: a failed step aborts every step after it in the + # same job (no guard/continue-on-error was in place), which is exactly what silently skipped + # both of these the first time around when deno publish failed. Building/pushing npm-dist + # first means it always happens regardless of whether the JSR publish succeeds - it only + # needs push access to this repo's own npm-dist branch, which the default GITHUB_TOKEN + # already has via the `contents: write` permission above, no npm/JSR publish rights at all. + # Consumers add it as a git dependency instead of a registry one, e.g. + # "grud-devtools": "git+https://github.com/campudus/grud-devtools.git#npm-dist". - name: Build npm package with dnt run: deno run -A scripts/build_npm.ts @@ -57,3 +58,6 @@ jobs: -c user.email="github-actions[bot]@users.noreply.github.com" \ commit -q -m "npm-dist: ${{ github.sha }}" git push -f "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" npm-dist:npm-dist + + - name: Publish to JSR + run: deno publish From b19ab17c524235047013b74e1bcc77bb8e059b12 Mon Sep 17 00:00:00 2001 From: hermann-p Date: Tue, 15 Sep 2026 16:54:16 +0200 Subject: [PATCH 2/2] Pull deps in build env --- scripts/build_npm.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/build_npm.ts b/scripts/build_npm.ts index d3e5d12..a69ad6d 100644 --- a/scripts/build_npm.ts +++ b/scripts/build_npm.ts @@ -48,6 +48,16 @@ await build({ dependencies: { ramda: "^0.30.1", }, + // dnt's own type-check pass (below) runs npm install inside ./outDir first, then relies on + // TypeScript's automatic @types/ resolution against whatever ended up in that node_modules - + // it does not fall back to any ambient types from outside that directory. Without these two, + // that check fails on `ramda` having no bundled types and on `console` (a Node global that + // only exists once @types/node's ambient declarations are present), even though nothing here + // is Deno-specific - see jsr.io/@deno/dnt/0.41.3/mod.ts's getProgramAndMaybeTypeCheck. + devDependencies: { + "@types/ramda": "^0.30.1", + "@types/node": "^20.11.0", + }, }, postBuild() { Deno.copyFileSync("LICENSE", "npm/LICENSE");