Skip to content

fix(api): Isolate API package validation consumers from ambient type definitions - #1800

Open
Satyam Pandey (SatyamPandey-07) wants to merge 2 commits into
microsoft:mainfrom
SatyamPandey-07:bugfix/isolate-api-package-consumer-types
Open

Satyam Pandey (SatyamPandey-07) wants to merge 2 commits into
microsoft:mainfrom
SatyamPandey-07:bugfix/isolate-api-package-consumer-types

Conversation

@SatyamPandey-07

Copy link
Copy Markdown

Related Issue

Fixes #1799

Changes Proposed

  • [API Test Configurations]: Configured "types": ["node", "vscode"] and "typeRoots": ["../node_modules/@types"] in api/test/tsconfig.modern.json and api/test/tsconfig.legacy.json to prevent tsc from traversing parent directories for ambient type definitions.
  • [Test Package Runner]: Updated api/scripts/test-package.cjs to resolve typescript/bin/tsc dynamically via createRequire instead of hardcoding packageRoot/node_modules/typescript/bin/tsc.
  • [API Package Scripts]: Added "test": "npm run test:package" to api/package.json so standard npm test runs package validation.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

  • Test A: npm --prefix api run test:package completed with 0 errors (modern and legacy consumers verified).
  • Test B: npm --prefix api test ran successfully.
  • Test C: Root unit tests (npm run unittest) passed with 2,411 passing tests.
  • Test D: Root linter (npm run lint) passed with 0 errors/warnings.
  • Test E: TypeScript compilation (npm run compile-tests) succeeded with 0 errors.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings

@SatyamPandey-07

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@SatyamPandey-07

Copy link
Copy Markdown
Author

Bill Schnurr (@bschnurr) Hi, just bumping this PR in case it slipped through your notifications. Let me know if you need any changes or further testing!

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.

API package validation fails due to ambient type definitions in parent directories

1 participant