Skip to content

403 add published type checks attw publint to publish check ci#404

Draft
phillipc wants to merge 10 commits into
mainfrom
403-add-published-type-checks-attw-publint-to-publish-check-ci
Draft

403 add published type checks attw publint to publish check ci#404
phillipc wants to merge 10 commits into
mainfrom
403-add-published-type-checks-attw-publint-to-publish-check-ci

Conversation

@phillipc

@phillipc phillipc commented Jun 7, 2026

Copy link
Copy Markdown
Member

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

  • 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.

phillipc added 6 commits June 4, 2026 14:25
- 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.
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c2222b4-9536-43e1-91c4-8ee1c598d067

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 403-add-published-type-checks-attw-publint-to-publish-check-ci

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment thread tools/build-dts.ts
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'])

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

✅ Created PR with unit tests: #405

@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

✅ Created PR with unit tests: #406

@knockout knockout deleted a comment from coderabbitai Bot Jun 7, 2026
@knockout knockout deleted a comment from coderabbitai Bot Jun 7, 2026
phillipc added 2 commits June 7, 2026 17:55
CodeRabbit Generated Unit Tests: Add unit tests
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