Skip to content

fix: wipe dist/ext at the start of build:ext - #4042

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

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 is just rm -rf dist/ext at the start of build:ext, per @1cg. No runtime change. dist/ is not in this PR; the next release build drops the orphans from the tarball.

Corresponding issue: #4041

Not asking to move npm latest off 2.x.

Testing

npm run build:ext now starts from an empty dist/ext, so only current src/ext/*.js names are emitted.

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 is a one-line build-script change

Optional follow-ups (not in this PR)

Dropped the checker, CI job, and dev/RELEASE.md notes from the first version. Recording them here in case they are useful later:

  1. Release-only completeness check — a tag / workflow_dispatch job that compares committed dist/ext to src/ext without rebuilding. A PR-time bun run build then check always passes once the wipe is in, so it would not gate the published tarball. A tag check would catch “forgot to rebuild dist/ before publish.” Keep any such script out of src/scripts/ (build:scripts copies *.py into the npm package).
  2. Same wipe for other generated treesbuild:editors, build:skills, and build:scripts are also copy-without-clean. A single rm -rf dist && mkdir -p dist at the start of npm run build would cover them, still with no extra tooling.
  3. dev/RELEASE.mdnpm build is a typo for npm run build. While 2.x is npm latest, 4.x needs npm publish --tag next. gh release create --prerelease when the version contains - keeps GitHub Latest on a real GA tag (v4.0.0-beta3 through beta5 were not marked prerelease).
  4. Changelog on the next 4.xhx-optimistic was renamed to hx-pending (rename hx-optimistic to hx-pending #3958); the old CDN path 404s.

@1cg

1cg commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Hey @manwithacat I like the cleaning out the dist on build but don't think we need the rest of the infrastructure. Can you update that?

build:ext copied src/ext into dist/ext but never deleted the directory,
so renamed extensions left orphans in the 4.0.0 tarball (hx-optimistic
after bigskysoftware#3958, leftover hx-compat). rm -rf first makes dist/ext a pure
function of src/ext.

Closes bigskysoftware#4041
@manwithacat
manwithacat force-pushed the fix/dist-ext-clean-and-check branch from 0e95e31 to cda5e0e Compare September 20, 2026 15:30
@manwithacat manwithacat changed the title fix: wipe dist/ext on build and check completeness in CI fix: wipe dist/ext at the start of build:ext Sep 20, 2026
@manwithacat

Copy link
Copy Markdown
Contributor Author

Updated — this PR is now just rm -rf dist/ext at the start of build:ext. Dropped the checker, the CI job, and the RELEASE.md notes.

The next release build will drop the leftover hx-optimistic / hx-compat files from the tarball. I left a couple of optional follow-ups at the bottom of the description if they ever become useful.

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.

2 participants