Skip to content

build: drop docker-bake in favor of plain npm#551

Merged
caarlos0 merged 2 commits intomasterfrom
drop-docker-bake
Apr 18, 2026
Merged

build: drop docker-bake in favor of plain npm#551
caarlos0 merged 2 commits intomasterfrom
drop-docker-bake

Conversation

@caarlos0
Copy link
Copy Markdown
Member

Replaces the docker buildx bake dev workflow with plain npm scripts, matching every TS action maintained by actions/* (checkout, setup-node, setup-go, cache, upload-artifact). The bake setup is a docker/* org convention that adds friction for a TypeScript action: contributors need Docker, the dev loop is ~10x slower than npm, and Alpine-vs-host byte drift in dist/index.js makes PRs bounce.

Changes

  • .node-version pins Node 24 (same version dev.Dockerfile used) so contributors and CI agree on bundler output.
  • package.json gains a pre-checkin script (format + build + test) — the npm equivalent of the old bake target.
  • .github/workflows/validate.yml rewritten as native npm jobs:
    • lintnpm run lint
    • buildnpm run build then git diff --ignore-space-at-eol dist, mirroring the actions/reusable-workflows check-dist pattern. Uploads the rebuilt dist/ as an artifact on failure so contributors can grab it.
    • vendornpm install --package-lock-only then git status, replacing bake vendor-validate.
  • .github/workflows/test.yml uses actions/setup-node + sigstore/cosign-installer + npm test instead of docker/bake-action.
  • .github/workflows/dependabot-build.yml regenerates dist/ via npm instead of bake.
  • dev.Dockerfile and docker-bake.hcl deleted.
  • CONTRIBUTING.md and README Development section updated.

Verification

  • Locally: npm ci && npm run build && npm run lint && npm test all pass.
  • Build is byte-identical to the previously-committed dist/index.js even on Node 25 / macOS — the bundler output is reproducible across hosts.
  • All 38 tests pass (one pre-existing flake on v0.182.0-pro Darwin is a release-tarball quirk, not related to this change; CI runs on ubuntu-latest).

Every TypeScript action maintained by actions/* (checkout, setup-node,
setup-go, cache, upload-artifact) uses plain npm scripts. The bake
setup is a docker/* org convention and adds friction for TS work:
contributors need Docker, the dev loop is ~10x slower than npm, and
Alpine-vs-host byte drift in dist/index.js makes PRs bounce.

Replace with the standard pattern:
- .node-version pins Node 24 so contributors and CI agree
- npm scripts (build, lint, format, test, pre-checkin) replace bake
  targets one-for-one
- validate.yml runs lint + a check-dist diff (mirrors actions/setup-node)
  and a vendor check that npm install --package-lock-only is a no-op
- test.yml uses setup-node + sigstore/cosign-installer, drops bake-action
- dependabot-build.yml regenerates dist via npm instead of bake

CONTRIBUTING.md and README development section updated to match.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@caarlos0 caarlos0 requested a review from crazy-max as a code owner April 18, 2026 17:51
Match the standard layout used by actions/checkout, actions/setup-node,
etc.:

- package.json scripts: split format/format-check (Prettier) from
  lint/lint:fix (ESLint), and have pre-checkin run all four (format,
  lint:fix, build, test) in that order.
- validate.yml lint job runs format-check + lint as separate steps.
- test.yml drops the redundant --coverage flag (now in the test script).
- Drop dependabot-build.yml: actions/* don't auto-rebuild dist on
  dependabot PRs; the check-dist style validate / build job catches
  drift and a maintainer rebuilds locally if needed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@caarlos0 caarlos0 enabled auto-merge (squash) April 18, 2026 18:21
@caarlos0 caarlos0 merged commit 4068afa into master Apr 18, 2026
44 checks passed
@caarlos0 caarlos0 deleted the drop-docker-bake branch April 18, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant