Open mkilpatrick opened 2 years ago
dupe of https://github.com/microsoft/rushstack/issues/3274 as well.
Is additionalEntryPoints
suppose to allow this:
Be great to get an official steer on this.
In the meantime, I've created a single entry point in src that exports all the package.json exports which works for now:
// ./src/index.docs.ts
/**
* API Docs index. This is used by api-extractor given our package.json exports.
* Monitoring: https://github.com/microsoft/rushstack/issues/3557
*/
export * from './index';
export * from './exportA';
export * from './exportB';
...and reference that instead as the mainEntryPointFilePath
.
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../api-extractor.json",
"mainEntryPointFilePath": "<projectFolder>/dist/dts/index.docs.d.ts"
}
Tried and failed on various workarounds.
Invalid schema. I think additionalEntryPoints
is a cmd line option, but not sure it's really exposed / works.
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../api-extractor.json",
"additionalEntryPoints": [
{
"modulePath": "exportA",
"filePath": "<projectFolder>/dist/dts/exportA/index.d.ts"
},
{
"modulePath": "exportB",
"filePath": "<projectFolder>/dist/dts/exportB/index.d.ts"
}
]
}
Not a valid node_module or something to that effect.
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "../../../api-extractor.json",
"bundledPackages": ["<projectFolder>/dist/dts/exportA/index.d.ts", "<projectFolder>/dist/dts/exportB/index.d.ts"]
}
The root api-extractor.json
file contains a standard mainEntryPointFilePath
, which is:
"mainEntryPointFilePath": "<projectFolder>/dist/dts/index.d.ts",
Is additionalEntryPoints suppose to allow this:
it feels like maybe but its not exposed to consumers it seems
I've tried additionalEntryPoints, i've removed the "throw" in json validator lib to ignore schema validation and additional entry points are ignored. So it's not "just" not exposed to consumers.
mainEntryPointFilePath
only allows a single entrypoint.Let's say I have a repo that has multiple exports and types:
I can't generate correct docs based on this. The only thing you can do is export all types at the root, but that is incorrect for this project structure.