diff --git a/.changeset/fast-cli-startup.md b/.changeset/fast-cli-startup.md deleted file mode 100644 index ce38abc0..00000000 --- a/.changeset/fast-cli-startup.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"politty": patch ---- - -Add Node.js on-disk compile cache (V8 code cache) support for faster warm starts. - -- `runMain` now enables the compile cache automatically (Node.js >= 22.8.0; silent no-op otherwise), so dynamically imported modules such as `lazy()` subcommands skip recompilation. Note this is on by default: CLIs built with politty start writing cache files to `${XDG_CACHE_HOME:-$HOME/.cache}//node-compile-cache` (the same XDG convention as the shell-completion workers) on end users' machines. `NODE_COMPILE_CACHE` always takes precedence; opt out or override via the new `MainOptions.compileCache` option (`false` | custom directory). -- New dependency-free `politty/compile-cache` subpath exporting `enableCompileCache`, for the bin-shim pattern that caches the whole CLI graph (ESM static imports are compiled before any code runs, so full coverage requires enabling the cache in a minimal shim that loads the real entry with a dynamic import). See "Faster Startup (Compile Cache)" in docs/recipes.md. -- New `politty generate-shim` CLI command (and `generateCompileCacheShim` export) that generates one bin shim per `bin` entry as part of a `postbuild`/`prepack` script. Output paths default to the package's `bin` paths and program names to the `bin` names; `--entry` is repeatable for multi-bin packages (paired in declaration order, or with `--out` paths of the same count) and can be omitted when a conventional built module (`./cli.js`, `./index.js`, ...) sits next to the shim. Refuses to overwrite files it did not generate, and the generated shim starts the CLI without the cache when `politty` is not resolvable at runtime (e.g. fully bundled CLIs) instead of failing. diff --git a/.changeset/fix-dts-build-ts7.md b/.changeset/fix-dts-build-ts7.md deleted file mode 100644 index 2973fef3..00000000 --- a/.changeset/fix-dts-build-ts7.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"politty": patch ---- - -Fix `.d.ts` generation broken by the TypeScript 7 upgrade. TypeScript 7 (tsgo) has no JS compiler API, so rolldown-plugin-dts's default tsc-based DTS generation crashed the build (and the Release workflow). tsdown now generates declarations with the tsgo binary from `@typescript/native-preview`; the emitted declarations are equivalent to the previous tsc output. diff --git a/CHANGELOG.md b/CHANGELOG.md index 74d23825..e511c038 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ # politty +## 0.11.5 + +### Patch Changes + +- 3835069: Add Node.js on-disk compile cache (V8 code cache) support for faster warm starts. + + - `runMain` now enables the compile cache automatically (Node.js >= 22.8.0; silent no-op otherwise), so dynamically imported modules such as `lazy()` subcommands skip recompilation. Note this is on by default: CLIs built with politty start writing cache files to `${XDG_CACHE_HOME:-$HOME/.cache}//node-compile-cache` (the same XDG convention as the shell-completion workers) on end users' machines. `NODE_COMPILE_CACHE` always takes precedence; opt out or override via the new `MainOptions.compileCache` option (`false` | custom directory). + - New dependency-free `politty/compile-cache` subpath exporting `enableCompileCache`, for the bin-shim pattern that caches the whole CLI graph (ESM static imports are compiled before any code runs, so full coverage requires enabling the cache in a minimal shim that loads the real entry with a dynamic import). See "Faster Startup (Compile Cache)" in docs/recipes.md. + - New `politty generate-shim` CLI command (and `generateCompileCacheShim` export) that generates one bin shim per `bin` entry as part of a `postbuild`/`prepack` script. Output paths default to the package's `bin` paths and program names to the `bin` names; `--entry` is repeatable for multi-bin packages (paired in declaration order, or with `--out` paths of the same count) and can be omitted when a conventional built module (`./cli.js`, `./index.js`, ...) sits next to the shim. Refuses to overwrite files it did not generate, and the generated shim starts the CLI without the cache when `politty` is not resolvable at runtime (e.g. fully bundled CLIs) instead of failing. + +- 56fdde5: Fix `.d.ts` generation broken by the TypeScript 7 upgrade. TypeScript 7 (tsgo) has no JS compiler API, so rolldown-plugin-dts's default tsc-based DTS generation crashed the build (and the Release workflow). tsdown now generates declarations with the tsgo binary from `@typescript/native-preview`; the emitted declarations are equivalent to the previous tsc output. + ## 0.11.4 ### Patch Changes diff --git a/package.json b/package.json index c7ae3ab8..b601fe9a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "politty", - "version": "0.11.4", + "version": "0.11.5", "description": "A lightweight CLI framework inspired by citty with zod v4 registry integration for type-safe metadata management", "keywords": [ "argument-parser",