Skip to content

fix(gen): preserve fromTypes compiler defaults#342

Open
lxy2500798479 wants to merge 1 commit into
elysiajs:mainfrom
lxy2500798479:fix/from-types-compiler-options
Open

fix(gen): preserve fromTypes compiler defaults#342
lxy2500798479 wants to merge 1 commit into
elysiajs:mainfrom
lxy2500798479:fix/from-types-compiler-options

Conversation

@lxy2500798479
Copy link
Copy Markdown

Summary

  • preserve declaration compiler defaults when fromTypes(..., { compilerOptions }) is used
  • set the generated tsconfig rootDir to the project root and keep declaration output inside tmpRoot/dist
  • add regression coverage for a partial compilerOptions override

Why

compilerOptions previously replaced the whole generated block. Passing an override such as { strict: true } dropped required declaration emit settings like declaration, emitDeclarationOnly, noEmit: false, and outDir. With newer TypeScript behavior, missing rootDir/outDir can also let generated .d.ts files appear beside project sources instead of staying in the temporary directory.

Tests

  • PATH="$PWD/node_modules/.bin:$PATH" bun test test/gen/index.test.ts --timeout 20000
  • git diff --check
  • bun run build
  • PATH="$PWD/node_modules/.bin:$PATH" bun run test

Closes elysiajs/elysia#1855

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 1, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (2)
  • src/gen/index.ts is excluded by !**/gen/**
  • test/gen/index.test.ts is excluded by !**/gen/**

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2689f49a-95d5-435b-8989-d36647c192f8

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

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.

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.

fromTypes: .d.ts files leak into project directory on TypeScript 6, and compilerOptions override loses required defaults

1 participant