Skip to content

fix(build): ship dist/ as one file per module instead of hashed chunks - #14

Merged
Shinrai merged 1 commit into
nextfrom
fix/unbundled-dist
Nov 26, 2026
Merged

Shinrai merged 1 commit into
nextfrom
fix/unbundled-dist

Conversation

@cldmv-bot

@cldmv-bot cldmv-bot Bot commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

  • fix(build): ship dist/ as one file per module instead of hashed chunks (13727b0)

📦 Dependencies

No dependency updates

🔧 Other Changes

No other changes

👥 Contributors

@cldmv-bot cldmv-bot Bot added area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments labels Nov 26, 2026
@Shinrai
Shinrai merged commit e6840d8 into next Nov 26, 2026
34 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/unbundled-dist branch November 26, 2026 04:13
cldmv-bot Bot added a commit that referenced this pull request Nov 26, 2026
# `@cldmv/sqlite-wasm` v0.2.1 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `release/0.2.1`

---

## Overview

`dist/` is now one file per source module, in the same layout as `src/`, instead of four bundles that shared code through hashed `chunk-*.mjs` files. Every module still exists once, so `instanceof` keeps working across `@cldmv/sqlite-wasm`, `/host`, `/worker` and `/drizzle`. The public API, the import names and the wasm module are unchanged.

---

## 🐛 Bug Fixes

### `dist/` mirrors `src/` instead of hashed chunks ([#14](#14))

v0.1.0 and v0.2.0 built the four entry points with one tsup bundle and code splitting, which put the shared code into files named `chunk-<hash>.mjs`. Nothing in them said what they held, and the hashes changed on every build. The build now compiles each `src/**/*.mts` to `dist/**/*.mjs` at the same path with `tsc`, then minifies each file in place with esbuild (`keepNames`, source maps back to `src/`). Nothing is bundled: the entries share modules through plain relative imports, so there is still one copy of each class.

- `./host` and `./worker` now resolve to `dist/worker/host.mjs` and `dist/worker/client.mjs`. The package's import names are the same.
- The Node and browser loaders find `sqlite3.wasm` at `../sqlite3.wasm` from `dist/core/`, still the same `dist/sqlite3.wasm`. Bundlers that copy the wasm from the `new URL(..., import.meta.url)` pattern keep doing so.
- tsup is no longer a dev dependency; `scripts/build-js.mjs` replaces `tsup.config.mjs`.
- A test checks that `dist/` has exactly one `.mjs` per source module and no generated chunks.

## 🔧 CI & tooling

- The bundle-size check measured `dist/**.mjs`, which only matches files at the top of `dist/`. It now uses `dist/**/*.mjs`, `dist/**/*.cjs` and `dist/**/*.wasm`.

## 📚 Documentation

- `docs/DESIGN.md` and the README describe the per-module build.
- **NEW:** [docs/changelog/v0/v0.2.1.md](https://github.com/CLDMV/lib-sqlite-wasm/blob/v0.2.1/docs/changelog/v0/v0.2.1.md) — this changelog.

## 🔧 Dependencies

- Removed `tsup` (dev). Added `esbuild` (dev), used directly.

---

## Upgrade notes

- No API changes. Drop-in for v0.2.0.
- Code that imported files inside `dist/` by path (not through the package's exports) needs the new paths; the `chunk-*.mjs` files and `dist/host.mjs` / `dist/worker.mjs` no longer exist.



<details>
<summary>👥 Contributors</summary>

- @Shinrai

</details>

---

<!-- coverage-start -->

![coverage](https://img.shields.io/badge/coverage-100.0%25-brightgreen?style=for-the-badge&logo=vitest&logoColor=white)

| Metric | Coverage |
|--------|----------|
| Statements | 100.0% |
| Branches   | 100.0% |
| Functions  | 100.0% |
| Lines      | 100.0% |

*Avg: **100.0%** · `218ad8e` · Node lts/**

<!-- coverage-end -->

<!-- co-authors -->

Co-authored-by: Shinrai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: core Touches core library / runtime source code area: tests Touches test files, fixtures, or test infrastructure type: ci Changes to CI workflows, actions, or build pipelines type: config Changes to repository or project configuration files type: dependencies Relates to dependency updates, version bumps, or package management type: documentation Relates to docs, README updates, guides, or inline code comments

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant