This project demonstrates a problem with api-extractor.
My objective is the following:
- I have a Typescript file which defines a basic API.
- I want this file to be used for generating a declarations TS file (
.d.ts
file). - I don't want to generate actual JS files as those are not relevant.
- Use the
.d.ts
file to generate markdown docs for my API.
The source file is in the ts-project
directory, so I tell tsc
:
"include": ["ts-project/*"],
The project structure is as follows:
.
|-- api-extractor.json
|-- package.json
|-- ts-project
| |-- index.d.ts
| |-- index.d.ts.map
| `-- index.ts
`-- tsconfig.json
Now, running api-extractor
, I get this:
▶ api-extractor run --local --verbose
api-extractor 7.19.4 - https://api-extractor.com/
Using configuration from ./api-extractor.json
Analysis will use the bundled TypeScript version 4.5.4
ERROR: Internal Error: Unable to determine module for: /Users/renato/programming/projects/identity-server/docs/procedures-docs/testing-ts/ts-project/index.d.ts
You have encountered a software defect. Please consider reporting the issue to the maintainers of this application.
What was wrong: apparently, just the export in the
.ts
file!Instead of this:
It needs to be: