Use tsc for DTS emit in chai-openapi-response-validator; keep tsup for JS bundling#97
Merged
Merged
Conversation
Copilot
AI
changed the title
[WIP] Implement minimal fix for TypeScript 6 DTS build failure
Use May 31, 2026
tsc for DTS emit in chai-openapi-response-validator; keep tsup for JS bundling
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #97 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 410 410
Branches 77 77
=========================================
Hits 410 410 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ehuelsmann
approved these changes
May 31, 2026
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.
TypeScript 6 started failing declaration generation in
@ehuelsmann/chai-openapi-response-validatorduringtsup’s DTS phase (TS5101/ deprecatedbaseUrlpath). This PR applies the durable split build path:tscemits declarations,tsuponly bundles JS.Build pipeline split (DTS via
tsc, JS viatsup)packages/chai-openapi-response-validator/tsup.config.ts(dts: false).tsc -p tsconfig.json --rootDir lib --types chaiand keeptsupas the JS bundler.build:dtsscript and wiredbuildto run:distaftertsupclean).Package export type mapping alignment
packages/chai-openapi-response-validator/package.jsonexports so both:exports["."].import.typesexports["."].require.typespoint to
./dist/index.d.ts.TypeScript config for declaration output
packages/chai-openapi-response-validator/tsconfig.jsonto declaration-oriented settings for the new path:outDir: "dist"emitDeclarationOnly: true{ "scripts": { "build:dts": "tsc -p tsconfig.json --rootDir lib --types chai", "build": "yarn build:openapi-validator && yarn build:dts && tsup && yarn build:dts" }, "exports": { ".": { "import": { "types": "./dist/index.d.ts", "default": "./dist/index.mjs" }, "require": { "types": "./dist/index.d.ts", "default": "./dist/index.js" } } } }Original prompt
Create a pull request in repository
ehuelsmann/OpenAPIValidatorsto implement the minimal durable fix for the TypeScript 6 DTS build failure in@ehuelsmann/chai-openapi-response-validator.Context:
TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.tsupdeclaration generation, not during the JS bundle step.tsupfor JS bundling and usetscfor declaration generation.ignoreDeprecations.tsc-only build.Required changes:
Update
packages/chai-openapi-response-validator/tsup.config.tsdts: false.Update
packages/chai-openapi-response-validator/package.jsonbuildscript so it runstsc -p tsconfig.jsonbeforetsup, while preserving the existing dependency build step.tsupresponsible for JS bundling.exportsso bothimport.typesandrequire.typespoint to./dist/index.d.ts.Update
packages/chai-openapi-response-validator/tsconfig.jsontscintodist.Validation expectations:
tscintodist.Please make the code changes and open a PR.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The failure is caused by TypeScript 6 rejecting the deprecated
baseUrloption during the DTS build for@ehuelsmann/chai-openapi-response-validator.Where it fails:
.github/workflows/ci.ymlrunsyarn test:ci, which eventually runs the package build at line 33: https://github.com/ehuelsmann/OpenAPIValidators/blob/a76536017f7865e06c596d26ba4ab9d52c10f22e/.github/workflows/ci.ymlpackages/chai-openapi-response-validator/package.json:28runstsup: https://github.com/ehuelsmann/OpenAPIValidators/blob/a76536017f7865e06c596d26ba4ab9d52c10f22e/packages/chai-openapi-response-validator/package.jsonTS5101: Option 'baseUrl' is deprecated ... Specify compilerOption '"ignoreDeprecations": "6.0"'Root cause:
packages/chai-openapi-response-validator/tsconfig.jsonextends the repo root config: https://github.com/ehuelsmann/OpenAPIValidators/blob/a76536017f7865e06c596d26ba4ab9d52c10f22e/packages/chai-openapi-response-validator/tsconfig.jsontsconfig.jsonor another config used bytsupduring declaration generation. The current root file shown here doesn’t includebaseUrl, which suggests the DTS build is resolving a config chain or tool-default path that still triggers the TS6 deprecation check.Recommended fix:
Add
ignoreDeprecations: "6.0"to the roottsconfig.jsonundercompilerOptions.Suggested patch:
{ "files": ["./types/combos.d.ts"], "compilerOptions": { "target": "ES2018", "lib": ["ES2018", "ES2022.Error"], "module": "node16", "moduleResolution": "node16", "declaration": true, "declarationMap": true, "sourceMap": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "strict": true, "noImplicitAny": true, "strictNullChecks": true, "strictFunctionTypes": true, "strictBindCallApply": true, "strictPropertyInitialization": true, "noImplicitThis": true, "useUnknownInCatchVariables": true, "alwaysStrict": true, "noUnusedLocals": true, "noUnusedParameters": true, "exactOptionalPropertyTypes": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, "noUncheckedIndexedAccess": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "allowUnusedLabels": false, "allowUnre... </details> <!-- START COPILOT CODING AGENT SUFFIX --> *This pull request was created from Copilot chat.* >