Skip to content

refactor: build dist one file per module instead of bundling - #88

Merged
Shinrai merged 1 commit into
nextfrom
refactor/per-module-build
Nov 28, 2026
Merged

Shinrai merged 1 commit into
nextfrom
refactor/per-module-build

Conversation

@cldmv-bot

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

Copy link
Copy Markdown
Contributor

🚀 What's Changed

💥 Breaking Changes

No breaking changes

✨ Features

No new features

🐛 Bug Fixes

No bug fixes

📦 Dependencies

No dependency updates

🔧 Other Changes

  • refactor: build dist one file per module instead of bundling (1d7398b)
👥 Contributors

The build is now esbuild with bundle: false, emitting one minified file per source module in dist/, with bin/gitmulti.mjs a thin file importing ../dist/cli.mjs. The require()/import shapes and exported subpaths are unchanged.

Resolves #83
@cldmv-bot cldmv-bot Bot added ! refactor → next v4 flow: refactor contributor PR targeting the next integration branch area: core Touches core library / runtime source code 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 28, 2026
@Shinrai
Shinrai merged commit 46fa827 into next Nov 28, 2026
37 checks passed
@cldmv-bot
cldmv-bot Bot deleted the refactor/per-module-build branch November 28, 2026 22:41
cldmv-bot Bot added a commit that referenced this pull request Nov 29, 2026
# gitmulti v0.1.2 Changelog

**Release Date**: November 2026
**Release Type**: Patch
**Branch**: `next` → `master`

---

## Overview

The published `dist/` and `bin/` are now built one file per module instead of as two bundles. The `gitmulti` command, the `import` and `require()` API and the exports are unchanged. No runtime behavior changed.

---

## 🔧 Build

### `dist/` mirrors `src/`, and `bin/` is a thin launcher ([#88](#88), fixes [#83](#83))

The tsup bundles are replaced by `scripts/build.mjs`. It runs esbuild over every `src/**/*.mjs` file except the executable with `bundle: false`, minifying each module on its own (names kept for stack traces) into `dist/` at the same relative path, with source maps next to them. `src/index.cjs` is still copied verbatim to `dist/index.cjs`, and the target stays `node22`.

`bin/gitmulti.mjs` is the minified `src/bin/gitmulti.mjs` with its one relative import repointed from `../cli.mjs` to `../dist/cli.mjs`. Before, the executable was its own bundle and carried a second copy of the library; now it is a few lines that import the built library from `dist/`, so the code exists once. `commander` stays an external import, installed from `dependencies`. The `.map` files are still left out of the tarball by `files`.

The `gitmulti` bin entry, the package `exports` and the shape of `require()` and `import` are unchanged. The tarball now holds one `.mjs` file per source module in `dist/` instead of a single `index.mjs`.

## 🔧 CI & tooling

- `bundle-size.yml` measures `dist/**.mjs`, `dist/**.cjs` and `bin/**.mjs`, the published runtime files, so source maps no longer count ([#88](#88)).
- `ci.yml` and `src/index.cjs` comments name the per-module build instead of tsup ([#88](#88)).

## 📚 Documentation

- **NEW:** [docs/changelog/v0/v0.1.2.md](https://github.com/CLDMV/gitmulti/blob/v0.1.2/docs/changelog/v0/v0.1.2.md), this changelog.
- README What's New promoted to v0.1.2. v0.1.1 moves to Recent Releases and v0.0.10 drops off.

## 🔧 Dependencies

Development dependencies only ([#88](#88)): `esbuild` ^0.28.2 added and `tsup` removed. The lockfile drops about 900 lines of tsup's dependency tree. `commander` is unchanged.

---

## Upgrade notes

- No breaking changes. Drop-in for v0.1.1; the `gitmulti` command and the API behave the same.



<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%** · `ecf3a13` · 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 ! refactor → next v4 flow: refactor 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