Skip to content

fix: wipe dist/ext on build and check completeness in CI - #4042

Open
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/dist-ext-clean-and-check
Open

fix: wipe dist/ext on build and check completeness in CI#4042
manwithacat wants to merge 1 commit into
bigskysoftware:four-devfrom
manwithacat:fix/dist-ext-clean-and-check

Conversation

@manwithacat

@manwithacat manwithacat commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Description

build:ext copied src/ext/*.js into dist/ext but never wiped the directory. After a rename, the old basename stayed in the published tarball.

On 4.0.0 that shows up as:

  • https://cdn.jsdelivr.net/npm/htmx.org@4.0.0/dist/ext/hx-optimistic.min.js404 (hx-optimistic was renamed to hx-pending in rename hx-optimistic to hx-pending #3958; only an orphan .map shipped)
  • leftover dist/ext/hx-compat.* with no src/ext/hx-compat.js

This PR does not change runtime behaviour. It makes dist/ext a pure function of src/ext and fails CI if a future rename leaves leftovers.

Corresponding issue: #4041

Changes:

  1. rm -rf dist/ext at the start of build:ext
  2. src/scripts/check_dist.py — every src/ext/*.js has .js + .min.js; no dist basename that is not in src; every .map has a matching .js
  3. CI dist job: check:dist:test, then bun run build, then check:dist
  4. dev/RELEASE.md: run check:dist after build; npm publish --tag next while 2.x is npm latest; --prerelease on GitHub when the version contains -

dist/ is not in this PR. The next release build with the new build:ext will drop the orphans from the tarball. A changelog line on that release (hx-optimistichx-pending, old CDN path 404s) would help consumers.

Not asking to move npm latest off 2.x.

Testing

python3 src/scripts/check_dist.py --self-test   # pass
python3 src/scripts/check_dist.py               # fail on current four-dev leftovers (hx-optimistic, hx-compat)

The new CI dist job is the full-build gate (bun run build then check:dist). Runtime tests are unchanged.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (four-dev for htmx 4 source)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly approved via an issue
  • I ran the full browser test suite locally (npm run test) — not applicable; this change is the dist build/check path, covered by check:dist:test and the new CI job

build:ext never deleted dist/ext, so renamed extensions (hx-optimistic
-> hx-pending, hx-compat -> htmx-2-compat) left orphans in the 4.0.0
tarball and 404'd on the CDN. Clean the output dir, add a src/ext vs
dist/ext completeness check, run it after bun run build, and document
--tag next / --prerelease on the release checklist.

Closes bigskysoftware#4041
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