Skip to content

[api-extractor] .api.md files don't contain generated namespaces #2798

Open
@bgotink

Description

@bgotink

Summary

#1029 introduced support for import * as __ from __ syntax, using namespaces. These namespaces are present in the rolled up .d.ts file, but they are absent (with a warning) in the corresponding .api.md file.

Repro steps

Check out https://github.com/bgotink/api-extractor-repro-20210708, run yarn to install dependencies and yarn api-extractor run to generate the files.

Expected result:

API markdown contains namespaces i1 and i2 that were generated

// from the dist/ .d.ts file

declare namespace i1 {
    export {
        LoremDirective
    }
}

declare namespace i2 {
    export {
        IpsumDirective
    }
}

Actual result:

API markdown doesn't have these namespaces and it contains warnings:

// @public (undocumented)
export class LoremIpsumModule {
    // (undocumented)
    static ɵfac: i0.ɵɵFactoryDeclaration<LoremIpsumModule, never>;
    // (undocumented)
    static ɵinj: i0.ɵɵInjectorDeclaration<LoremIpsumModule>;
    // Warning: (ae-forgotten-export) The symbol "i1" needs to be exported by the entry point index.d.ts
    // Warning: (ae-forgotten-export) The symbol "i2" needs to be exported by the entry point index.d.ts
    //
    // (undocumented)
    static ɵmod: i0.ɵɵNgModuleDeclaration<LoremIpsumModule, [typeof i1.LoremDirective, typeof i2.IpsumValidator]>;
}

Details

Standard questions

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

Question Answer
@microsoft/api-extractor version? 7.18.0
Operating system? Mac
API Extractor scenario? reporting (.api.md)
Would you consider contributing a PR? Yes
TypeScript compiler version? 4.3.5
Node.js version (node -v)? v14.15.3

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