refactor(repo): inline tsdown per-package, lift integration tests to root, consolidate test utils#76
Conversation
…sts to root - Remove shared tsdown.base.mjs; inline clean/dts/fixedExtension/outDir into each package's tsdown.config.ts directly - Fix packages/cli bin field: dist/index.mjs → dist/index.js (fixedExtension: false + "type":"module" outputs .js, not .mjs) - Add tests/exports.test.ts with parameterized it.each checks that every exports condition and bin entry in each package.json resolves to an actual file on disk after build — prevents export/build drift - Add vitest.exports.config.ts (root) with @ alias → packages/core/src for integration tests that use @/ imports - Add turbo.json test:exports task with dependsOn: ["^build"] - Add root package.json test:exports script - Move all integration tests from packages/core/test/integration/ to tests/integration/ - Move mock-oauth-server helper from packages/core/test/helpers/ to tests/helpers/ - Add tests/helpers/core-utils.ts re-exporting from @kidd-cli/core/test public API - Add tests/tsconfig.json with paths for @/* alias; reference it from root tsconfig.json - Remove packages/core/test/integration/ and packages/core/test/helpers/ directories - Narrow packages/core vitest.config.ts include to src/**/*.test.ts only Co-Authored-By: Claude <noreply@anthropic.com>
…ic test API Move setArgv and runTestCli from the local test/core-utils.ts shim into packages/core/src/test/cli.ts and export them from the public @kidd-cli/core/test entry point. Both test/core-utils.ts (internal) and tests/helpers/core-utils.ts (root) now simply re-export from the same canonical source with no duplication. Co-Authored-By: Claude <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 3d48d12 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughThis PR refactors build configuration and test infrastructure across the monorepo. It removes the shared Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment Tip CodeRabbit can scan for known vulnerabilities in your dependencies using OSV Scanner.OSV Scanner will automatically detect and report security vulnerabilities in your project's dependencies. No additional configuration is required. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/core/src/test/cli.ts`:
- Around line 3-16: Add JSDoc blocks to the two exported functions: for
setArgv(document that it accepts a rest parameter args: readonly string[] and
returns void) and for runTestCli(document that it accepts options: CliOptions
and returns Promise<void>); place `@param` tags naming the parameter and its
type/description and an `@returns` tag describing the return type (void or
Promise<void>) so the exported functions setArgv and runTestCli meet the
guideline requiring `@param` and `@returns` annotations.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 43560a49-c43d-4b8d-a72b-45fd6968b529
📒 Files selected for processing (28)
package.jsonpackages/bundler/tsdown.config.tspackages/cli/package.jsonpackages/cli/tsdown.config.tspackages/config/tsdown.config.tspackages/core/src/test/cli.tspackages/core/src/test/index.tspackages/core/test/core-utils.tspackages/core/tsdown.config.tspackages/core/vitest.config.tspackages/utils/tsdown.config.tstests/exports.test.tstests/helpers/core-utils.tstests/helpers/mock-oauth-server.tstests/integration/advanced-deploy.test.tstests/integration/advanced-status.test.tstests/integration/auth-device-code.test.tstests/integration/auth-http-chain.test.tstests/integration/auth-oauth-pkce.test.tstests/integration/simple-greet.test.tstests/integration/simple-init.test.tstests/integration/simple-list.test.tstests/integration/typed-middleware.test.tstests/tsconfig.jsontsconfig.jsontsdown.base.mjsturbo.jsonvitest.exports.config.ts
💤 Files with no reviewable changes (1)
- tsdown.base.mjs
Co-Authored-By: Claude <noreply@anthropic.com>
Summary
tsdown.base.mjs— inlineclean/dts/fixedExtension/outDiroptions directly into each package'stsdown.config.tspackages/clibin field —dist/index.mjs→dist/index.js(fixedExtension: false+"type":"module"outputs.js, not.mjs)tests/exports.test.ts— parameterizedit.eachtest that validates everyexportscondition andbinentry in eachpackage.jsonresolves to an actual file on disk after build; prevents export/build drift in future releasesturbo.jsontest:exportstask withdependsOn: ["^build"]so exports are only checked after all packages are builtpackages/core/test/integration/→tests/integration/(9 files); movemock-oauth-serverhelper totests/helpers/tests/helpers/core-utils.tsre-exporting from@kidd-cli/core/testpublic APItests/tsconfig.jsonwithpaths: { "@/*": ["../packages/core/src/*"] }for IDE type support; reference from roottsconfig.jsonvitest.exports.config.ts(root) with@alias →packages/core/srcso@/imports in integration tests resolve correctlypackages/corevitest include tosrc/**/*.test.tsonly (integration tests are now at root)setArgv+runTestCliintopackages/core/src/test/cli.tsand export from the public@kidd-cli/core/testentry; bothcore-utils.tsfiles now just re-export from that single source with no duplicationTest plan
pnpm checkpasses (typecheck + lint + format)pnpm testpasses for all packagespnpm test:exportspasses afterpnpm build