403 add published type checks attw publint to publish check ci#404
403 add published type checks attw publint to publish check ci#404phillipc wants to merge 10 commits into
Conversation
- Introduced a `types/` directory for each package and build to publish TypeScript declaration files. - Updated package manifests to include `types` metadata and `exports` conditions for better type resolution. - Implemented a new build script to generate declarations and clean up generated artifacts. - Enhanced the build process to ensure all public packages and builds have corresponding type definitions. - Added smoke tests to verify type imports from the generated declarations.
- Updated package.json scripts to include additional type verification for Node16 and Nodenext configurations. - Added new `verify:publish-types` script to ensure publishable packages meet type and output requirements. - Modified package exports to support ESM and CJS formats with appropriate type declarations. - Introduced new TypeScript configuration files for Node16 and Nodenext compatibility. - Enhanced build-dts script to generate mode-aware declaration files. - Created smoke tests for type verification in both CommonJS and ESM formats. - Updated all package.json files to use .mjs for ESM entry points and .cts for CJS declarations.
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const packageWorkspaces: string[] = [] | ||
| // These entrypoints publish a package-level default export, but their CommonJS | ||
| // runtime shape is module.exports = value rather than { default: value }. | ||
| const cjsEntrypointsNeedingExportEquals = new Set(['builds/knockout', 'builds/reference', 'packages/utils.component']) |
There was a problem hiding this comment.
utils and utils.component can also be changed. But I think this is more a task for tko5 and the reference build focus.
@brianmhunt what do you think?
|
✅ Created PR with unit tests: #405 |
|
✅ Created PR with unit tests: #406 |
…heck-ci' into coderabbitai/utg/8733691
CodeRabbit Generated Unit Tests: Add unit tests
Combination of #402 and #403
Implemented the issue as a full package-surface fix rather than an attw ignore. TKO now publishes mode-aware declarations and export maps so bundler, node16, and nodenext all resolve cleanly. The core changes are in tools/build-dts.ts, tools/verify-publish-types.ts, package.json, .github/workflows/publish-check.yml, plus the public package.json files under packages/* and builds/*. I also added the required plan at plans/2026-06-07-module-resolution-publish-check.md.
What changed: the declaration build now emits .d.mts and .d.cts siblings alongside .d.ts, rewrites relative specifiers to .mjs/.cjs as needed, and special-cases the package-level default-export entrypoints that need export = on the CommonJS side. Public manifests now use nested exports so import gets ESM JS plus .d.mts, and require gets CJS JS plus .d.cts. I also added publint and @arethetypeswrong/cli to local/CI verification, and expanded the type smoke tests with node16 and nodenext configs plus CJS/ESM consumers.
Verified locally with bun run dts, bun run build, bun run tsc, bun run verify:types, bun run verify:publish-types, and bun run verify:esm. attw --pack is now green across the full public package set. I did not run the full Vitest suite. I also tried bun run check; it still fails on pre-existing Biome findings in packages/utils.parser/src/*, but the new/changed file tools/build-dts.ts passes Biome on its own.
feat: enhance type verification and module resolution for TKO packages
verify:publish-typesscript to ensure publishable packages meet type and output requirements.