Skip to content

fix: build dist/ one file per module instead of bundling - #206

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

Builds dist/ with esbuild (bundle: false) so it mirrors src/ file for file; the CLI is dist/cli.mjs and imports the library instead of bundling its own copy. tsup and bin/ are gone.

Resolves #205

The tsup build bundled the library into dist/index.mjs and a second full
copy into bin/fix-headers.mjs. scripts/build.mjs now minifies every
src/**/*.mjs into the same path under dist/ with esbuild (bundle: false),
so dist/ mirrors src/ and dist/cli.mjs imports the library from its
sibling files. The package "bin" points at dist/cli.mjs and bin/ is gone.
tsup is dropped.

Resolves #205
@cldmv-bot cldmv-bot Bot added ! fix → next v4 flow: fix contributor PR targeting the next integration branch 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 labels Nov 26, 2026
@Shinrai Shinrai changed the title release: v2.5.0 - rewriteDeclarationCopies restamps tsc-copied… fix: build dist/ one file per module instead of bundling Nov 26, 2026
@Shinrai
Shinrai merged commit 9c18411 into next Nov 26, 2026
36 checks passed
@cldmv-bot
cldmv-bot Bot deleted the fix/unbundled-dist branch November 26, 2026 04:12
cldmv-bot Bot added a commit that referenced this pull request Nov 26, 2026
# `@cldmv/fix-headers` v2.5.1 Changelog

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

---

## Overview

The published package is no longer bundled. `dist/` mirrors `src/` one file per module, and the CLI imports the library from those files instead of carrying a second copy of it. The library's behaviour, options and CLI flags are unchanged.

---

## 🐛 Bug Fixes

### `dist/` is built one file per module ([#206](#206))

The tsup build bundled the library into `dist/index.mjs` and a second full copy into `bin/fix-headers.mjs`. `scripts/build.mjs` now minifies each `src/**/*.mjs` in place into the same path under `dist/` with esbuild (`bundle: false`), with its imports left as they are. `dist/index.cjs` is still the small CommonJS wrapper copied verbatim from `src/index.cjs`.

The package's `bin` now points at `dist/cli.mjs`, which imports `./index.mjs`, and the `bin/` folder is no longer published. The `fix-headers` command works as before; only a script that ran `node_modules/@cldmv/fix-headers/bin/fix-headers.mjs` by path needs to call `dist/cli.mjs` (or the `fix-headers` command) instead.

Fixes [#205](#205).

## 📚 Documentation

- **NEW:** [docs/changelog/v2/v2.5.1.md](https://github.com/CLDMV/fix-headers/blob/v2.5.1/docs/changelog/v2/v2.5.1.md): this changelog.
- README What's New promoted to v2.5.1.

## 🔧 Dependencies

- `tsup` removed from devDependencies; the build uses `esbuild` directly ([#206](#206)).

---

## Upgrade notes

- No API or option changes. Call the CLI through the `fix-headers` command rather than the old `bin/fix-headers.mjs` path.



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

- @Shinrai

</details>

---

<!-- coverage-start -->

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

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

*Avg: **99.6%** · `053dd24` · 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 ! fix → next v4 flow: fix contributor PR targeting the next integration branch 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant