Skip to content

feat!: v2 packaging - format-split typings, drop es5 tier, node10 cleanup, attw gate - #394

Merged
ppeeou merged 2 commits into
mainfrom
feat/packaging-hardening
Aug 8, 2026
Merged

ppeeou merged 2 commits into
mainfrom
feat/packaging-hardening

Conversation

@ppeeou

@ppeeou ppeeou commented Aug 8, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The v2 packaging set: fixes every defect arethetypeswrong reports against the published package, drops the legacy es5 tier, finishes the node10 cleanup, and adds a CI gate so none of it can regress. Verified locally: "No problems found 🌟" with no ignored rules, across node10 / node16-CJS / node16-ESM / bundler for every subpath.

Format-split typings (fixes FalseCJS) — the single CJS-scoped dist/types served both module formats, so nodenext ESM consumers got CommonJS-typed declarations. The build now copies declarations into an ESM scope (dist/types-esm, explicit .js specifiers including inline import("...") type references) and the exports map serves format-matched typings via nested import/require conditions.

node10 deep-import types — typesVersions gains a wildcard mapping (dist/types/*), so @fxts/core/Lazy/take-style imports resolve types under classic resolution again.

Drop the es5 tier (breaking) — ./esm5 subpath exports, tsconfig.esm5.json, and compile:esm5 are removed; cjs/esm (es2018) are the only module builds. The CDN UMD bundle (fx.min.js, babel-built es5 + polyfill) stays for legacy browsers. This also lets the word-split RegExp go back to a plain literal and removes the per-change es5-syntax tax on new code.

node10 resolution cleanup — emit configs move off the deprecated node10: cjs → node16/node16, esm → es2015 + bundler, types → esnext + bundler. Output verified byte-identical per-file (sha256); only the intentionally reverted words.js differs. All tsconfigs are now TS 6/7-ready.

TypeScript floor (breaking) — typesVersions moves from >= 4.2 to >=5.5, matching the current market baseline (Zod 4 requires 5.5+, tRPC 11 requires 5.7+). Release notes will state TypeScript 5.5+ as the supported minimum.

CI gate — the compile step becomes the full npm run build plus npx @arethetypeswrong/cli --pack . with no ignored rules.

getting-started (en/ko/ja/zh) drops the esm5 guidance and documents the es2018 baseline.

Test plan

  • attw --pack: no problems, no ignored rules (was: FalseCJS on every entry, dead deep-import types, untyped esm5)
  • Emit-config migration proven byte-identical via per-file sha256 diff
  • Full jest suite passes; compile:check exit 0; lint 0 errors
  • The new CI gate runs on this PR

🤖 Generated with Claude Code

ppeeou and others added 2 commits August 8, 2026 16:53
…gate

Fixes the three packaging defects reported by arethetypeswrong against
the published package:

- FalseCJS under nodenext: the single CJS-scoped dist/types served both
  module formats, so ESM consumers got CommonJS-typed declarations.
  The build now copies declarations into an ESM scope (dist/types-esm,
  with explicit .js specifiers including inline import("...") type
  references) and the exports map serves format-matched typings via
  nested import/require conditions.
- Dead node10 deep imports: typesVersions only mapped to the root
  index.d.ts; a wildcard mapping now resolves @fxts/core/Lazy/* and
  friends for classic-resolution consumers. The floor moves to >=5.0
  for the upcoming v2 (TypeScript 5.0+ is the supported minimum).
- Untyped ./esm5 subpaths: they now carry a types condition using the
  ESM-scoped declarations.

CI replaces the compile step with the full build plus an
arethetypeswrong gate (--pack, ignoring only the intentional
cjs-resolves-to-esm on the legacy ./esm5 escape hatch), so packaging
regressions fail PRs instead of surfacing after publish.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Remove the ./esm5 subpath exports, tsconfig.esm5.json, and the
  compile:esm5 step. The cjs/esm tiers (es2018) are the only builds;
  the CDN UMD bundle (fx.min.js, babel-built es5 + polyfill) stays.
  The word-split RegExp goes back to a plain literal now that no es5
  emit exists.
- Move the emit configs off the deprecated node10 resolution:
  cjs -> module/moduleResolution node16, esm -> es2015 + bundler,
  types -> esnext + bundler. Output verified byte-identical (per-file
  sha256; only the intentionally reverted words.js differs).
- typesVersions floor >=5.5, matching the market baseline
  (Zod 4: 5.5+, tRPC 11: 5.7+); release notes will state
  TypeScript 5.5+ as the supported minimum.
- The attw CI gate runs with no ignored rules now that the esm5
  ESM-only escape hatch is gone.
- getting-started (en/ko/ja/zh) drops the esm5 guidance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ppeeou ppeeou changed the title feat: format-split typings, node10 deep-import types, and an attw CI gate feat!: v2 packaging - format-split typings, drop es5 tier, node10 cleanup, attw gate Aug 8, 2026
@ppeeou ppeeou self-assigned this Aug 8, 2026
@ppeeou
ppeeou merged commit e074047 into main Aug 8, 2026
4 checks passed
@ppeeou
ppeeou deleted the feat/packaging-hardening branch August 8, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant