Repository navigation
feat: build the CLI from src/bin/ with tsup - #125
Merged
Merged
Conversation
bin/ is now build output: the CLI lives in src/bin/git-embedded.mjs and tsup writes bin/git-embedded.mjs (prepack builds it, bin/ is gitignored, files leaves src/bin/ out). The entry finds the package root by its package.json so it runs from both places. The placeholder build script is replaced by the real build, and build:ci runs it. The CLI entry is now under coverage and tests/bin-cli.test.vitest.mjs drives it in-process, keeping the suite at 100%. The dead program.createHelp assignment is removed; applyCustomHelpRecursive sets it on every command. Follows the bin/ convention in CLDMV/.github docs/conventions/package-layout.md (CLDMV/.github#429).
The first pass only bundled the CLI entry into bin/, and that file loaded the slothlet API from src/api/ at runtime, so the package still shipped src/. tsup now mirrors src/ into dist/ file by file (bundle: false), which keeps slothlet's api/ folder discoverable: the CLI is dist/bin/git-embedded.mjs and loads ../api next to itself, and the Windows elevation helper resolves its child script next to its own module. files ships dist/ (plus hooks/, messages/, docs/), not src/, and bundle-size measures dist/.
This was referenced Nov 8, 2026
cldmv-bot Bot
added a commit
that referenced
this pull request
Nov 8, 2026
# `@cldmv/git-embedded` v1.2.0 Changelog **Release Date**: November 2026 **Release Type**: Minor **Branch**: `release/1.2.0` --- ## Overview Version 1.2.0 gives the package a real build. The CLI moved from a hand-written `bin/git-embedded.mjs` to `src/bin/git-embedded.mjs`, and tsup now builds all of `src/` into `dist/`, file by file. The published package ships `dist/` instead of `bin/` and `src/`, and the `git-embedded` command points at `dist/bin/git-embedded.mjs`. The CLI's commands, hooks and messages behave the same. It also refreshes the dependencies, clearing every `npm audit` finding, passes slothlet's `base` option so a current slothlet doesn't print a deprecation warning, and separates the package's runtime Node.js floor from the development one: `engines.node` stays `>=22.15.0`, and the test toolchain's `>=22.22.0` moves to `devEngines` and the CI minimum. --- ## ✨ Features ### The CLI and API are built from `src/` with tsup ([#125](#125)) `build` was a placeholder `echo` that only existed so the CI coverage jobs had something to run. It is now `tsup`, configured in `tsup.config.mjs` with `bundle: false`: every `src/**/*.mjs` file is minified into the same path under `dist/` (with `keepNames`, and `node:` specifiers kept), so slothlet still discovers the `dist/api/` tree file by file. `prepack` runs the build, so `npm pack` and `npm publish` always ship a fresh `dist/`, and `build:ci` now runs lint, the format check and the build. - `package.json` `files` lists `dist`, `hooks`, `messages`, `docs`, `README.md` and `LICENSE`; `bin` and `src` are gone. - `bin` points at `./dist/bin/git-embedded.mjs`, and `npm start` runs `src/bin/git-embedded.mjs` from a checkout. - The CLI finds its package root by walking up to the nearest `package.json`, so the same file works from `src/bin/` and `dist/bin/`, and the Windows elevation helper resolves its child script relative to the built module. - `tests/bin-cli.test.vitest.mjs` covers the CLI entry point, and the bundle-size workflow measures `dist/**`. Resolves [#31](#31). ## 🐛 Bug Fixes ### Runtime and development Node.js floors ([#122](#122)) `engines.node` stays `>=22.15.0`, which is what the package and `@cldmv/slothlet` 3.22 need at runtime. The vitest 5 toolchain needs 22.22.0, so that floor is now declared in `devEngines` (`onFail: "error"`), and the CI and publish minimum Node versions, which were 22.15.0 and 22.12.0, follow it. The README states both. ### No deprecation warning from slothlet 3.24 ([#128](#128)) slothlet 3.24 warns when a project passes the `dir` option, which was renamed to `base` in 3.9, so with a current slothlet every CLI run printed a `V3_CONFIG_DEPRECATED` warning. The CLI now passes `base`, and a test runs the CLI and checks that no deprecation warning reaches stderr. ## 🔧 Dependencies ### Runtime dependencies - **`@cldmv/slothlet` `^3.7.0` → `^3.24.0`**, resolving 3.22.0 → 3.24.0, because the CLI now passes the `base` option ([#128](#128)). - **`@cldmv/wisp` 1.0.6 → 1.0.9** in the lockfile, inside the existing `^1.0.1` range ([#128](#128)). ### Development dependencies - **`tsup` 9.0.0** (new, with `esbuild` 0.28.2) and **`typescript` 6.0.3** (new, tsup's peer dependency) for the build ([#125](#125)). - **`prettier` 3.9.9 → 3.9.10** ([#106](#106)). - **Lockfile refresh within the existing ranges** ([#128](#128)), replacing seven Dependabot PRs: `vitest` and `@vitest/coverage-v8` 5.0.3 → 5.1.0, `vite` 8.3.2 → 8.3.6, `eslint` 10.12.0 → 10.14.0, `@cldmv/fix-headers` 2.2.0 → 2.2.6 and `nanoid` 3.3.19 → 3.3.20, among others. - **`overrides` for `katex` (`>=0.19.1 <1.0.0`) and `minimatch` (`^11.0.3`)**, the fleet fix for advisories in the `eslint` / `@eslint/markdown` chain ([#128](#128)). `npm audit` reports 0 vulnerabilities. ## 📚 Documentation - **NEW:** [docs/changelog/v1/v1.2.0.md](./v1.2.0.md): this changelog. - README What's New promoted to v1.2.0. --- ## Upgrade notes - `@cldmv/slothlet` now needs `^3.24.0`; its `engines.node` is `>=22.15.0`, the same as this package. - No breaking changes for anyone running the `git-embedded` command: installing the package still puts it on `PATH`, and its commands and hooks are unchanged. - Code that imported files from the package's `src/` or `bin/` directly will no longer find them; the same modules are under `dist/`. The package has no `exports` map, so these were never a supported entry point. - Contributors need Node.js 22.22 or later, and a checkout must run `npm run build` before `npm pack` or a local install from the folder uses `dist/` (`prepack` does this automatically). <details> <summary>👥 Contributors</summary> - @Shinrai </details> --- <!-- coverage-start -->  | Metric | Coverage | |--------|----------| | Statements | 100.0% | | Branches | 100.0% | | Functions | 100.0% | | Lines | 100.0% | *Avg: **100.0%** · `7b9d767` · Node lts/** <!-- coverage-end --> <!-- co-authors --> Co-authored-by: Shinrai <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Moves the CLI to
src/bin/git-embedded.mjsand builds all ofsrc/intodist/with tsup (bundle: false), so the package shipsdist/and nosrc/.binpoints atdist/bin/git-embedded.mjs. Replaces the dummybuildscript.Resolves #31