Skip to content

Remove tsconfig-paths from chai test bootstrap#95

Merged
ehuelsmann merged 3 commits into
masterfrom
copilot/fix-dts-build-issues
May 31, 2026
Merged

Remove tsconfig-paths from chai test bootstrap#95
ehuelsmann merged 3 commits into
masterfrom
copilot/fix-dts-build-issues

Conversation

Copy link
Copy Markdown

Copilot AI commented May 31, 2026

CI was emitting a tsconfig-paths warning because the chai test runner still loaded tsconfig-paths/register even though the package does not define a baseUrl or path aliases. This change removes that stale bootstrap so the test command matches the package’s actual TypeScript setup.

  • Test runner cleanup

    • Drops tsconfig-paths/register from packages/chai-openapi-response-validator's Mocha invocation
    • Keeps ts-node/register in place for TypeScript test execution
  • Behavioral impact

    • No production code changes
    • Test execution remains the same, minus the unnecessary path-resolution hook and its CI warning
{
  "test": "yarn build:openapi-validator && yarn build:common-test-resources && mocha --require ts-node/register --extension ts --recursive"
}
Original prompt

Update the existing pull request in repository ehuelsmann/OpenAPIValidators to fix the failing CI job caused by the TypeScript DTS build in @ehuelsmann/chai-openapi-response-validator.

Context:

  • The failing job logs show error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
  • The failure occurs during the tsup DTS build for packages/chai-openapi-response-validator.
  • The user specifically wants the bundler-based solution where tsup remains the source of truth.

Requested solution:

  • Update the relevant TypeScript configuration for packages/chai-openapi-response-validator to use a bundler-oriented module resolution strategy.
  • Prefer moduleResolution: "bundler" with module: "ESNext" for the package where appropriate.
  • Add any necessary deprecation silencing needed to unblock the build now, including ignoreDeprecations: "6.0" if still required.
  • Keep the change focused on fixing the CI/build failure rather than doing a large repo-wide refactor.
  • Ensure the resulting configuration is compatible with tsup generating DTS output.

Please modify the PR with the minimal code changes needed and open/update the pull request accordingly.

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 treating compilerOptions.baseUrl as deprecated during the DTS build for @ehuelsmann/chai-openapi-response-validator.

Root cause

The job fails in the package build step, specifically while tsup generates declarations:

From the log:

error TS5101: Option 'baseUrl' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

This package tsconfig extends the repo root tsconfig, so the deprecated baseUrl is almost certainly inherited there. The DTS build now fails because TypeScript wants that deprecation explicitly acknowledged.

Solution

Add ignoreDeprecations: "6.0" to the compiler options used by the failing package, or preferably to the shared root tsconfig.json if other packages inherit the same deprecated setting.

Minimal fix in packages/chai-openapi-response-validator/tsconfig.json

{
  "extends": "../../tsconfig.json",
  "include": ["lib"],
  "compilerOptions": {
    "outDir": "dist",
    "ignoreDeprecations": "6.0"
  }
}

That is the smallest targeted fix and should unblock the DTS build immediately.

Better repo-wide fix

If the root tsconfig.json contains baseUrl, update that shared config instead so all packages behave consistently:

{
  "compilerOptions": {
    "baseUrl": ".",
    "ignoreDeprecations": "6.0"
  }
}

Recommended follow-up cleanup

Since this is only silencing a TypeScript 6 deprecation, the longer-term fix is to remove reliance on baseUrl entirely and migrate imports to supported alternatives such as:

  • relative imports, or
  • paths with an explicit modern module resolution strategy where appropriate

But for this CI failure, ignoreDeprecations: "6.0" is the correct direct fix.

User: Ehat does the modern module resolution strategy look like?

Assistant: Use moduleResolution: "nodenext" for Node-targeted packages, or moduleResolution: "bundler" for packages primarily built by tsup/esbuild. That’s the modern replacement direction TypeScript recommends instead of older node/baseUrl-driven setups. (typescriptlang.org)

For this repo, since tsup is doing the build and the package exports both CJS and ESM artifacts, the most practical modern shape is usually:

{
  "extends": "../../tsconfig.json",
  "include": ["lib"],
  "compilerOptions": {
    "outDir": "dist",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "ignoreDeprecations": "6.0"
  }
}

That works well when a bundler owns resolution, and TypeScript explicitly says bundler...

This pull request was created from Copilot chat.

Copilot AI changed the title [WIP] Fix failing CI job due to TypeScript DTS build Scope chai-openapi-response-validator DTS builds to a tsup-specific bundler tsconfig May 31, 2026
Copilot AI requested a review from ehuelsmann May 31, 2026 05:50
@codecov
Copy link
Copy Markdown

codecov Bot commented May 31, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ca892e9) to head (e58763c).

Additional details and impacted files
@@            Coverage Diff            @@
##            master       #95   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           16        16           
  Lines          410       410           
  Branches        77        77           
=========================================
  Hits           410       410           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ehuelsmann ehuelsmann marked this pull request as ready for review May 31, 2026 05:58
Copilot AI changed the title Scope chai-openapi-response-validator DTS builds to a tsup-specific bundler tsconfig Remove tsconfig-paths from chai test bootstrap May 31, 2026
@ehuelsmann ehuelsmann merged commit c851879 into master May 31, 2026
7 checks passed
@ehuelsmann ehuelsmann deleted the copilot/fix-dts-build-issues branch May 31, 2026 06:01
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.

2 participants