Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion apps/api-extractor/src/collector/Collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,11 @@ export class Collector {
let nameForEmit: string = idealNameForEmit;

// Choose a name that doesn't conflict with usedNames or a global name
while (usedNames.has(nameForEmit) || this.globalVariableAnalyzer.hasGlobalName(nameForEmit)) {
while (
nameForEmit === 'default' ||
usedNames.has(nameForEmit) ||
this.globalVariableAnalyzer.hasGlobalName(nameForEmit)
) {
nameForEmit = `${idealNameForEmit}_${++suffix}`;
}
entity.nameForEmit = nameForEmit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"importType",
"inconsistentReleaseTags",
"internationalCharacters",
"namedDefaultImport",
"preapproved",
"spanSorting",
"typeOf",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,276 @@
{
"metadata": {
"toolPackage": "@microsoft/api-extractor",
"toolVersion": "[test mode]",
"schemaVersion": 1004,
"oldestForwardsCompatibleVersion": 1001,
"tsdocConfig": {
"$schema": "https://developer.microsoft.com/json-schemas/tsdoc/v0/tsdoc.schema.json",
"noStandardTags": true,
"tagDefinitions": [
{
"tagName": "@alpha",
"syntaxKind": "modifier"
},
{
"tagName": "@beta",
"syntaxKind": "modifier"
},
{
"tagName": "@defaultValue",
"syntaxKind": "block"
},
{
"tagName": "@decorator",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@deprecated",
"syntaxKind": "block"
},
{
"tagName": "@eventProperty",
"syntaxKind": "modifier"
},
{
"tagName": "@example",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@experimental",
"syntaxKind": "modifier"
},
{
"tagName": "@inheritDoc",
"syntaxKind": "inline"
},
{
"tagName": "@internal",
"syntaxKind": "modifier"
},
{
"tagName": "@label",
"syntaxKind": "inline"
},
{
"tagName": "@link",
"syntaxKind": "inline",
"allowMultiple": true
},
{
"tagName": "@override",
"syntaxKind": "modifier"
},
{
"tagName": "@packageDocumentation",
"syntaxKind": "modifier"
},
{
"tagName": "@param",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@privateRemarks",
"syntaxKind": "block"
},
{
"tagName": "@public",
"syntaxKind": "modifier"
},
{
"tagName": "@readonly",
"syntaxKind": "modifier"
},
{
"tagName": "@remarks",
"syntaxKind": "block"
},
{
"tagName": "@returns",
"syntaxKind": "block"
},
{
"tagName": "@sealed",
"syntaxKind": "modifier"
},
{
"tagName": "@see",
"syntaxKind": "block"
},
{
"tagName": "@throws",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@typeParam",
"syntaxKind": "block",
"allowMultiple": true
},
{
"tagName": "@virtual",
"syntaxKind": "modifier"
},
{
"tagName": "@betaDocumentation",
"syntaxKind": "modifier"
},
{
"tagName": "@internalRemarks",
"syntaxKind": "block"
},
{
"tagName": "@preapproved",
"syntaxKind": "modifier"
}
],
"supportForTags": {
"@alpha": true,
"@beta": true,
"@defaultValue": true,
"@decorator": true,
"@deprecated": true,
"@eventProperty": true,
"@example": true,
"@experimental": true,
"@inheritDoc": true,
"@internal": true,
"@label": true,
"@link": true,
"@override": true,
"@packageDocumentation": true,
"@param": true,
"@privateRemarks": true,
"@public": true,
"@readonly": true,
"@remarks": true,
"@returns": true,
"@sealed": true,
"@see": true,
"@throws": true,
"@typeParam": true,
"@virtual": true,
"@betaDocumentation": true,
"@internalRemarks": true,
"@preapproved": true
}
}
},
"kind": "Package",
"canonicalReference": "api-extractor-scenarios!",
"docComment": "",
"name": "api-extractor-scenarios",
"members": [
{
"kind": "EntryPoint",
"canonicalReference": "api-extractor-scenarios!",
"name": "",
"members": [
{
"kind": "Interface",
"canonicalReference": "api-extractor-scenarios!DefaultImportTypes:interface",
"docComment": "/**\n * @public\n */\n",
"excerptTokens": [
{
"kind": "Content",
"text": "export interface DefaultImportTypes "
}
],
"releaseTag": "Public",
"name": "DefaultImportTypes",
"members": [
{
"kind": "PropertySignature",
"canonicalReference": "api-extractor-scenarios!DefaultImportTypes#dynamicImport:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "dynamicImport: "
},
{
"kind": "Content",
"text": "import('api-extractor-lib2-test')."
},
{
"kind": "Reference",
"text": "default",
"canonicalReference": "api-extractor-lib2-test!~DefaultClass:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"releaseTag": "Public",
"name": "dynamicImport",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 3
}
},
{
"kind": "PropertySignature",
"canonicalReference": "api-extractor-scenarios!DefaultImportTypes#namedImport:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "namedImport: "
},
{
"kind": "Reference",
"text": "DefaultClass_namedImport",
"canonicalReference": "api-extractor-lib2-test!~DefaultClass:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"releaseTag": "Public",
"name": "namedImport",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
},
{
"kind": "PropertySignature",
"canonicalReference": "api-extractor-scenarios!DefaultImportTypes#reExport:member",
"docComment": "",
"excerptTokens": [
{
"kind": "Content",
"text": "reExport: "
},
{
"kind": "Reference",
"text": "DefaultClass_reExport",
"canonicalReference": "api-extractor-lib2-test!~DefaultClass:class"
},
{
"kind": "Content",
"text": ";"
}
],
"isOptional": false,
"releaseTag": "Public",
"name": "reExport",
"propertyTypeTokenRange": {
"startIndex": 1,
"endIndex": 2
}
}
],
"extendsTokenRanges": []
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## API Report File for "api-extractor-scenarios"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

import { default as default_2 } from 'api-extractor-lib2-test';

// @public (undocumented)
export interface DefaultImportTypes {
// (undocumented)
dynamicImport: default_2;
// (undocumented)
namedImport: default_2;
// (undocumented)
reExport: default_2;
}

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { default as default_2 } from 'api-extractor-lib2-test';

/** @public */
export declare interface DefaultImportTypes {
namedImport: default_2;
reExport: default_2;
dynamicImport: default_2;
}

export { }
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { default as DefaultClass_namedImport } from 'api-extractor-lib2-test';
import { DefaultClass_reExport } from './re-export';

/** @public */
export interface DefaultImportTypes {
namedImport: DefaultClass_namedImport;
reExport: DefaultClass_reExport;
dynamicImport: import('api-extractor-lib2-test').default;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default as DefaultClass_reExport } from 'api-extractor-lib2-test';
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "@microsoft/api-extractor",
"comment": "Fix an issue where the .d.ts rollup sometimes used \"default\" as an identifier name causing a syntax error (GitHub #2804)",
"type": "patch"
}
],
"packageName": "@microsoft/api-extractor",
"email": "[email protected]"
}