Commit 2f50562
authored
fix(api): Isolate API package validation consumers from ambient type definitions (#1800)
## 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.
* [x] Test A: `npm --prefix api run test:package` completed with 0
errors (modern and legacy consumers verified).
* [x] Test B: `npm --prefix api test` ran successfully.
* [x] Test C: Root unit tests (`npm run unittest`) passed with 2,411
passing tests.
* [x] Test D: Root linter (`npm run lint`) passed with 0
errors/warnings.
* [x] Test E: TypeScript compilation (`npm run compile-tests`) succeeded
with 0 errors.
## Checklist
- [x] My code follows the style guidelines of this project
- [x] I have performed a self-review of my own code
- [x] I have commented my code, particularly in hard-to-understand areas
- [x] My changes generate no new warnings1 parent e4ab62b commit 2f50562
4 files changed
Lines changed: 9 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
0 commit comments