Skip to content

build:ext does not clean dist/ext, so renamed extensions 404 (hx-optimistic at 4.0.0) #4041

Description

@manwithacat

build:ext copies src/ext/*.js into dist/ext but never deletes the directory first. After a rename, the old basename stays in the published tarball (or an orphan .map does).

Repro (4.0.0)

curl -I https://cdn.jsdelivr.net/npm/htmx.org@4.0.0/dist/ext/hx-optimistic.min.js
# 404

curl -I https://cdn.jsdelivr.net/npm/htmx.org@4.0.0/dist/ext/hx-pending.min.js
# 200

hx-optimistic.js was renamed to hx-pending.js in #3958. The 4.0.0 tree / npm pack still contains dist/ext/hx-optimistic.min.js.map with no matching .js. The same tree also still has a full leftover hx-compat.* set (src/ext only has htmx-2-compat.js).

Cause is mechanical: package.json build:ext is mkdir -p dist/ext && for file in src/ext/*.js … with no wipe. CI (htmx 4 CI) runs tests and src/scripts/content/check.py, but does not build dist or compare src/ext to dist/ext. dev/RELEASE.md also has no completeness check and no --prerelease for -beta / -rc tags (v4.0.0-beta3 through beta5 were published with prerelease=false; beta6 was marked correctly).

Ask

  1. Wipe dist/ext at the start of build:ext so a release tarball is a pure function of src/ext.
  2. Add a cheap completeness check (every src/ext/*.js has .js + .min.js; no dist basename that is not in src; every .map has a matching .js) and run it from CI after bun run build, and from the release checklist before npm publish / gh release create.
  3. In dev/RELEASE.md: npm publish --tag next while 2.x remains npm latest; pass --prerelease on GitHub when the version contains -.

No runtime change. A changelog line on the next 4.x release that hx-optimistic is now hx-pending (old CDN path 404s) would help consumers. I am happy to send a four-dev PR for (1)–(3).

Not asking to move npm latest off 2.x — that policy is already documented.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions