Skip to content

Commit

Permalink
Update the init template to document the glob syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Feb 29, 2024
1 parent 4093a0f commit 323c72e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/api-extractor/src/generators/DtsRollupGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export class DtsRollupGenerator {
if (entity.astEntity instanceof AstImport) {
// Note: it isn't valid to trim imports based on their release tags.
// E.g. class Foo (`@public`) extends interface Bar (`@beta`) from some external library.
// API-Extractor cannot trim `import { Bar } from "externa-library"` when generating its public rollup,
// API-Extractor cannot trim `import { Bar } from "external-library"` when generating its public rollup,
// or the export of `Foo` would include a broken reference to `Bar`.
const astImport: AstImport = entity.astEntity;
DtsEmitHelpers.emitImport(writer, entity, astImport);
Expand Down
9 changes: 8 additions & 1 deletion apps/api-extractor/src/schemas/api-extractor-template.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,19 @@
* For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
* and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part
* of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
* imports library2. To avoid this, we can specify:
* imports library2. To avoid this, we might specify:
*
* "bundledPackages": [ "library2" ],
*
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
* local files for library1.
*
* The "bundledPackages" elements may specify glob patterns using minimatch syntax. To ensure deterministic
* output, globs are expanded by matching explicitly declared top-level dependencies only. For example,
* the pattern below will NOT match "@my-company/example" unless it appears in a field such as "dependencies"
* or "devDependencies" of the project's package.json file:
*
* "bundledPackages": [ "@my-company/*" ],
*/
"bundledPackages": [],

Expand Down

0 comments on commit 323c72e

Please sign in to comment.