In #1130 we use the stripInternal config option and /** @internal */ JSDoc comments to control which symbols are exported by the TypeScript compiler into .d.ts files, which in turn controls what TypeScript-enabled editors will suggest for autocompletions.
This is quite error-prone, since as @tombruijn pointed out (https://github.com/appsignal/appsignal-nodejs/pull/1130#pullrequestreview-2315583759) the compiler does not validate that the resulting set of .d.ts files is valid -- that is, some type definitions in one file might reference type definitions in another file that have been stripped out, causing the TypeScript compiler to error when handling its type definitions.
In our setup, this failure mode is mitigated somewhat by our integration tests, which attempt to compile TypeScript projects that use these definitions, failing the build if this compilation fails. Still, it might be worth looking into api-extractor, as recommended by the TypeScript documentation, which seems to be a Microsoft-backed solution for this problem space.
In #1130 we use the
stripInternal
config option and/** @internal */
JSDoc comments to control which symbols are exported by the TypeScript compiler into.d.ts
files, which in turn controls what TypeScript-enabled editors will suggest for autocompletions.This is quite error-prone, since as @tombruijn pointed out (https://github.com/appsignal/appsignal-nodejs/pull/1130#pullrequestreview-2315583759) the compiler does not validate that the resulting set of
.d.ts
files is valid -- that is, some type definitions in one file might reference type definitions in another file that have been stripped out, causing the TypeScript compiler to error when handling its type definitions.In our setup, this failure mode is mitigated somewhat by our integration tests, which attempt to compile TypeScript projects that use these definitions, failing the build if this compilation fails. Still, it might be worth looking into
api-extractor
, as recommended by the TypeScript documentation, which seems to be a Microsoft-backed solution for this problem space.