Repository navigation
feat!: v2 packaging - format-split typings, drop es5 tier, node10 cleanup, attw gate - #394
Merged
Merged
Conversation
…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>
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.
Summary
The v2 packaging set: fixes every defect
arethetypeswrongreports 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/typesserved both module formats, sonodenextESM consumers got CommonJS-typed declarations. The build now copies declarations into an ESM scope (dist/types-esm, explicit.jsspecifiers including inlineimport("...")type references) and the exports map serves format-matched typings via nestedimport/requireconditions.node10 deep-import types —
typesVersionsgains a wildcard mapping (dist/types/*), so@fxts/core/Lazy/take-style imports resolve types under classic resolution again.Drop the es5 tier (breaking) —
./esm5subpath exports,tsconfig.esm5.json, andcompile:esm5are 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 revertedwords.jsdiffers. All tsconfigs are now TS 6/7-ready.TypeScript floor (breaking) —
typesVersionsmoves from>= 4.2to>=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 buildplusnpx @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)compile:checkexit 0; lint 0 errors🤖 Generated with Claude Code