Releases: ngrok/gen-x
Release list
v0.5.0
Minor Changes
-
#32
65f197fThanks @cody-dot-js! - Declareengines.node >= 24: gen-x supports the current Node LTS line only. (The CLI's compile-cache bootstrap relies onmodule.enableCompileCache, available since Node 22.8.) -
#32
65f197fThanks @cody-dot-js! - Fail loudly instead of silently wiping exports: a missing or non-directory input now exits with an error instead of replacing the entire exports map with just./package.json(watch mode validates before its first destructive write too), and a run whose include/exclude globs match zero files prints a warning before writing. -
#32
65f197fThanks @cody-dot-js! - Performance: skip the package.json write entirely when the generated output is byte-identical (saves the ~5ms atomic-write/fsync path and keeps package.json's mtime stable so build-system caches aren't invalidated by no-op runs); sort gathered file paths with the default UTF-16 code-unit comparator instead oflocaleCompare(avoids ~6ms of ICU collator init per invocation and makes the emitted exports order deterministic across machines/locales — key order in generated exports may change once on repos with mixed-case filenames); compute export paths with a prefix slice instead of per-filepath.relative(~10% faster end-to-end at 2000 files); enable Node's on-disk V8 compile cache in the CLI bootstrap (~2-2.5ms per warm invocation, disable withNODE_DISABLE_COMPILE_CACHE=1); remove the unused@commander-js/extra-typingsdependency. -
#32
65f197fThanks @cody-dot-js! - Remove config-file support and the esbuild dependency. gen-x no longer loadsgen-x.config.{ts,js,mjs,cjs,json}orpackage.json#genx, and no longer exportsdefineConfig— CLI flags are the only configuration source. The programmaticgenerateExports(config)API and all CLI flags are unchanged. Dropping esbuild removes gen-x's only heavyweight dependency (a ~10MB platform binary) and shaves module-load time off every CLI invocation.
Patch Changes
-
#32
65f197fThanks @cody-dot-js! - Emit customCondition/sourceOnly source paths relative to the target package.json's directory instead of the process cwd. Previously, running gen-x from outside the package directory (e.g.gen-x -p packages/foo/package.jsonfrom a monorepo root) produced source paths that neither Node nor TypeScript could resolve.generateExportsgains an optional secondpackageJsonPathargument (defaults to"package.json", preserving existing behavior for cwd-based calls). -
#32
65f197fThanks @cody-dot-js! - Fix--replaceregex parsing corrupting patterns with escaped slashes at the edges:/\/foo\//was double-stripped into/foo/instead of matching a slash-delimitedfoo. The capture between the outer delimiters is now used as-is.
v0.4.2
Patch Changes
-
#29
0b1bb32Thanks @cody-dot-js! - Write package.json atomically (write to a temp file, then rename) instead of truncating it in place. Previously a concurrent reader — e.g. a bundler resolving the package mid-build, or a build tool capturing task outputs — could observe an empty or partially-written package.json. The write resolves symlinks so a symlinked package.json is still written through to its target, preserves the original file's permissions, and cleans up its temp file on failure. -
#31
7408e84Thanks @cody-dot-js! - Update runtime dependencies to their latest versions: commander 15, @commander-js/extra-typings 15, esbuild 0.28.1, and tinyglobby 0.2.17. Also migrates the toolchain to TypeScript 7, oxlint 1.73, oxfmt 0.58, vitest 4.1, and pnpm 11, and switches local tooling management from direnv/fnm to mise.
v0.4.1
Patch Changes
- #27
ad8b4b1Thanks @cody-dot-js! - Preserveexportskey position when updatingpackage.json. Previously, gen-x always deleted and re-appended theexportsfield, moving it to the end of the file on every run. Now, ifexportsalready exists, it is updated in-place so its position relative to other keys is unchanged.
v0.4.0
Minor Changes
- #24
36cbeb4Thanks @cody-dot-js! - Added--watch/-wflag to watch the input directory for file changes and automatically regeneratepackage.json#exports. Config is loaded once at startup, and writes are skipped when exports are unchanged, making it efficient for use across many packages in a monorepo.
v0.3.0
Minor Changes
- #22
fdb1104Thanks @cody-dot-js! - Add--sourceOnlyoption that emits plain source file paths in the exports map, omittingimport,types, and custom condition entries.
v0.2.1
Patch Changes
- #19
57457e0Thanks @cody-dot-js! - Fixed mode transforms incorrectly converting multi-part extensions like.module.cssto-module.css. Export keys now preserve the full extension while transforming only the basename (e.g.,FancyButton.module.css→./fancy-button.module.csswith kebab-case mode)
v0.2.0
Minor Changes
-
#15
16b342bThanks @dependabot! - Improved default include/exclude patterns - now includes CSS, excludes declaration files and common test patterns -
#15
16b342bThanks @dependabot! - Added config file support with TypeScript support and type-safedefineConfighelper. Supports gen-x.config.{ts,js,mjs,cjs,json} or package.json#genx field. Priority: CLI flags > config file > defaults. TypeScript configs are transformed using esbuild for zero-dependency usage. -
#15
16b342bThanks @dependabot! - Added support for CSS files - extensions are preserved in export keys and no types field is generated for asset files -
#15
16b342bThanks @dependabot! - Index files now automatically flatten to their directory path (e.g., index.ts → ".", lib/index.ts → "./lib")
Patch Changes
-
#15
16b342bThanks @dependabot! - Added esbuild as a dependency for TypeScript config file transformation -
#15
16b342bThanks @dependabot! - Fixed absolute paths leaking into package.json exports. Input is now normalized to absolute for filesystem operations, output stays relative -
#15
16b342bThanks @dependabot! - Fixed CLI vs programmatic API defaults inconsistency for better predictable behavior -
#15
16b342bThanks @dependabot! - Added collision detection for duplicate export keys with helpful error messages showing conflicting files -
#15
16b342bThanks @dependabot! - Fixed double globbing performance issue - now uses single glob call with ignore option for better performance -
#15
16b342bThanks @dependabot! - Fixed dry-run output to use JSON.stringify for better readability -
#15
16b342bThanks @dependabot! - Fixed potential duplicate "./" in source paths when srcDir is "." -
#15
16b342bThanks @dependabot! - Added proper error handling for package.json read/parse/write operations with clear error messages -
#15
16b342bThanks @dependabot! - Fixed shared mutable baseExports object causing state leakage across function calls in long-lived processes -
#15
16b342bThanks @dependabot! - Fixed OS-dependent path separators - package.json exports now always use POSIX forward slashes on all platforms
v0.1.2
What's Changed
- update dependencies; fix shebang by @cody-dot-js in #13
Full Changelog: v0.1.1...v0.1.2
v0.1.1
v0.1.0
What's Changed
- update dependencies by @cody-dot-js in #10
- support custom condition exports for supporting live types in a monorepo by @cody-dot-js in #11
Full Changelog: v0.0.6...v0.1.0