mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
The API Extractor uses `tsconfig.src.json` as its TypeScript configuration when generating all API files. However, each generated API file must be compliant with its target runtime environment. This means that all publicly exposed types must be fully defined for that runtime. For example, Node.js-specific types should not appear in a browser API report unless they have been explicitly redefined for the browser context. If we were to generate the complete API for the browser for ts-http-runtime today, we will find many references to undefined types in the browser context such as the `NodeJS` namespace: <img width="1377" height="277" alt="image" src="https://github.com/user-attachments/assets/d0320e21-6bf8-440f-b6b2-9e12984ed4c3" /> This PR improves the API extractor logic to look for `tsocnfig.src.<runtime name>.json` to use when generating the API files and falls back to `tsconfig.src.json` if one doesn't exist. A library author can provide such a targeted tsconfig file to catch any such unresolvable type references in the target runtime.
31 lines
658 B
JSON
31 lines
658 B
JSON
{
|
|
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
"mainEntryPointFilePath": "<projectFolder>/dist/esm/index.d.ts",
|
|
"docModel": {
|
|
"enabled": true
|
|
},
|
|
"dtsRollup": {
|
|
"enabled": false
|
|
},
|
|
"apiReport": {
|
|
"enabled": true,
|
|
"reportFolder": "<projectFolder>/review"
|
|
},
|
|
"newlineKind": "lf",
|
|
"messages": {
|
|
"tsdocMessageReporting": {
|
|
"default": {
|
|
"logLevel": "none"
|
|
}
|
|
},
|
|
"extractorMessageReporting": {
|
|
"ae-missing-release-tag": {
|
|
"logLevel": "none"
|
|
},
|
|
"ae-unresolved-link": {
|
|
"logLevel": "none"
|
|
}
|
|
}
|
|
}
|
|
}
|