Skip to content

[api-extractor]: TS paths aliases force bundling cross package definitions when rolluping dts #3443

@Hotell

Description

@Hotell

Summary

We wanna leverage stripping @internal APIs from rolluped dts definition by leveraging publicTrimmedFilePath config. Unfortunately things doesn't work as one would expect.

Actual
When TS Paths aliases are used, cross package type declarations are always inlined(bundled), although there is no bundledPackages being applied.

Expected
No matter if yarn workspaces/lerna/symlink resolution or TS path aliases is applied within monorepo to resolve absolute package paths, api-extractor should not inline(bundle) cross package type definitions.

Repro steps

Link to whole repro

Steps:

  1. run yarn build
  2. check output:

check packages/one/dist/public.d.ts:

issues with rolluping API for package/one

check packages/two/dist/public.d.ts:

ssues with rolluping API for package/one

  • internalOne has been stripped as expected (re-export from a different within repo package API)
  • 🐛 inlined Baseball and Hello from @org/two package (re-export from a different within repo package ) - should have been only re-export of Baseball !

Details

Standard questions

Please answer these questions to help us investigate your issue more quickly:

Question Answer
@microsoft/api-extractor version? 7.24.2
Operating system? Linux/Mac
API Extractor scenario? rollups (.d.ts)
Would you consider contributing a PR? Maybe
TypeScript compiler version? 4.6.4
Node.js version (node -v)? 14.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    AE/AD

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions