Skip to content

Releases: ngrok/gen-x

v0.5.0

Choose a tag to compare

@github-actions github-actions released this 14 Jul 02:32
841b710

Minor Changes

  • #32 65f197f Thanks @cody-dot-js! - Declare engines.node >= 24: gen-x supports the current Node LTS line only. (The CLI's compile-cache bootstrap relies on module.enableCompileCache, available since Node 22.8.)

  • #32 65f197f Thanks @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 65f197f Thanks @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 of localeCompare (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-file path.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 with NODE_DISABLE_COMPILE_CACHE=1); remove the unused @commander-js/extra-typings dependency.

  • #32 65f197f Thanks @cody-dot-js! - Remove config-file support and the esbuild dependency. gen-x no longer loads gen-x.config.{ts,js,mjs,cjs,json} or package.json#genx, and no longer exports defineConfig — CLI flags are the only configuration source. The programmatic generateExports(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 65f197f Thanks @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.json from a monorepo root) produced source paths that neither Node nor TypeScript could resolve. generateExports gains an optional second packageJsonPath argument (defaults to "package.json", preserving existing behavior for cwd-based calls).

  • #32 65f197f Thanks @cody-dot-js! - Fix --replace regex parsing corrupting patterns with escaped slashes at the edges: /\/foo\// was double-stripped into /foo/ instead of matching a slash-delimited foo. The capture between the outer delimiters is now used as-is.

v0.4.2

Choose a tag to compare

@github-actions github-actions released this 13 Jul 21:58
747a512

Patch Changes

  • #29 0b1bb32 Thanks @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 7408e84 Thanks @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

Choose a tag to compare

@github-actions github-actions released this 22 Feb 16:40
9cf90b6

Patch Changes

  • #27 ad8b4b1 Thanks @cody-dot-js! - Preserve exports key position when updating package.json. Previously, gen-x always deleted and re-appended the exports field, moving it to the end of the file on every run. Now, if exports already exists, it is updated in-place so its position relative to other keys is unchanged.

v0.4.0

Choose a tag to compare

@github-actions github-actions released this 10 Feb 15:05
815533a

Minor Changes

  • #24 36cbeb4 Thanks @cody-dot-js! - Added --watch / -w flag to watch the input directory for file changes and automatically regenerate package.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

Choose a tag to compare

@github-actions github-actions released this 10 Feb 00:17
9e4ab2d

Minor Changes

  • #22 fdb1104 Thanks @cody-dot-js! - Add --sourceOnly option that emits plain source file paths in the exports map, omitting import, types, and custom condition entries.

v0.2.1

Choose a tag to compare

@github-actions github-actions released this 18 Nov 17:16
7617c2d

Patch Changes

  • #19 57457e0 Thanks @cody-dot-js! - Fixed mode transforms incorrectly converting multi-part extensions like .module.css to -module.css. Export keys now preserve the full extension while transforming only the basename (e.g., FancyButton.module.css./fancy-button.module.css with kebab-case mode)

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 16:35
11f88c2

Minor Changes

  • #15 16b342b Thanks @dependabot! - Improved default include/exclude patterns - now includes CSS, excludes declaration files and common test patterns

  • #15 16b342b Thanks @dependabot! - Added config file support with TypeScript support and type-safe defineConfig helper. 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 16b342b Thanks @dependabot! - Added support for CSS files - extensions are preserved in export keys and no types field is generated for asset files

  • #15 16b342b Thanks @dependabot! - Index files now automatically flatten to their directory path (e.g., index.ts → ".", lib/index.ts → "./lib")

Patch Changes

  • #15 16b342b Thanks @dependabot! - Added esbuild as a dependency for TypeScript config file transformation

  • #15 16b342b Thanks @dependabot! - Fixed absolute paths leaking into package.json exports. Input is now normalized to absolute for filesystem operations, output stays relative

  • #15 16b342b Thanks @dependabot! - Fixed CLI vs programmatic API defaults inconsistency for better predictable behavior

  • #15 16b342b Thanks @dependabot! - Added collision detection for duplicate export keys with helpful error messages showing conflicting files

  • #15 16b342b Thanks @dependabot! - Fixed double globbing performance issue - now uses single glob call with ignore option for better performance

  • #15 16b342b Thanks @dependabot! - Fixed dry-run output to use JSON.stringify for better readability

  • #15 16b342b Thanks @dependabot! - Fixed potential duplicate "./" in source paths when srcDir is "."

  • #15 16b342b Thanks @dependabot! - Added proper error handling for package.json read/parse/write operations with clear error messages

  • #15 16b342b Thanks @dependabot! - Fixed shared mutable baseExports object causing state leakage across function calls in long-lived processes

  • #15 16b342b Thanks @dependabot! - Fixed OS-dependent path separators - package.json exports now always use POSIX forward slashes on all platforms

v0.1.2

Choose a tag to compare

@cody-dot-js cody-dot-js released this 28 Jan 16:16
4ad4ca7

What's Changed

Full Changelog: v0.1.1...v0.1.2

v0.1.1

Choose a tag to compare

@cody-dot-js cody-dot-js released this 26 Sep 04:54
cba997a

What's Changed

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@cody-dot-js cody-dot-js released this 24 Sep 15:17
46ddb5c

What's Changed

Full Changelog: v0.0.6...v0.1.0