From efdde26118042f16ef960e0aa92d017fa2417580 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 25 Mar 2020 14:02:43 +0100 Subject: [PATCH 01/32] added support for 'import * as module from ./local-module' --- .../src/analyzer/AstImportAsModule.ts | 50 ++++++++ .../src/analyzer/AstReferenceResolver.ts | 5 + .../src/analyzer/AstSymbolTable.ts | 108 ++++++++++++------ .../src/analyzer/ExportAnalyzer.ts | 22 +++- apps/api-extractor/src/collector/Collector.ts | 35 ++++-- .../src/enhancers/ValidationEnhancer.ts | 10 ++ .../src/generators/ApiModelGenerator.ts | 53 +++++++-- .../src/generators/ApiReportGenerator.ts | 7 ++ .../src/generators/DtsRollupGenerator.ts | 41 +++++++ 9 files changed, 273 insertions(+), 58 deletions(-) create mode 100644 apps/api-extractor/src/analyzer/AstImportAsModule.ts diff --git a/apps/api-extractor/src/analyzer/AstImportAsModule.ts b/apps/api-extractor/src/analyzer/AstImportAsModule.ts new file mode 100644 index 00000000000..3898bb30462 --- /dev/null +++ b/apps/api-extractor/src/analyzer/AstImportAsModule.ts @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +import { AstModule } from './AstModule'; + +export interface IAstImportAsModuleOptions { + readonly astModule: AstModule; + readonly exportName: string; +} + +// TODO [MA]: add documentation +export class AstImportAsModule { + // TODO [MA]: add documentation + public analyzed: boolean = false; + + // TODO [MA]: add documentation + public readonly astModule: AstModule; + + /** + * The name of the symbol being imported. + * + * @remarks + * + * The name depends on the type of import: + * + * ```ts + * // For AstImportKind.DefaultImport style, exportName would be "X" in this example: + * import X from "y"; + * + * // For AstImportKind.NamedImport style, exportName would be "X" in this example: + * import { X } from "y"; + * + * // For AstImportKind.StarImport style, exportName would be "x" in this example: + * import * as x from "y"; + * + * // For AstImportKind.EqualsImport style, exportName would be "x" in this example: + * import x = require("y"); + * ``` + */ + public readonly exportName: string; + + public constructor(options: IAstImportAsModuleOptions) { + this.astModule = options.astModule; + this.exportName = options.exportName; + } + + public get localName(): string { + return this.exportName; + } +} \ No newline at end of file diff --git a/apps/api-extractor/src/analyzer/AstReferenceResolver.ts b/apps/api-extractor/src/analyzer/AstReferenceResolver.ts index 724f97148d4..8866c164a15 100644 --- a/apps/api-extractor/src/analyzer/AstReferenceResolver.ts +++ b/apps/api-extractor/src/analyzer/AstReferenceResolver.ts @@ -11,6 +11,7 @@ import { AstModule } from './AstModule'; import { AstImport } from './AstImport'; import { Collector } from '../collector/Collector'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; +import { AstImportAsModule } from './AstImportAsModule'; /** * Used by `AstReferenceResolver` to report a failed resolution. @@ -87,6 +88,10 @@ export class AstReferenceResolver { return new ResolverFailure('Reexported declarations are not supported'); } + if (rootAstEntity instanceof AstImportAsModule) { + return new ResolverFailure('Source file export declarations are not supported'); + } + let currentDeclaration: AstDeclaration | ResolverFailure = this._selectDeclaration(rootAstEntity.astDeclarations, rootMemberReference, rootAstEntity.localName); diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index 19b998eb265..2242f1bcee5 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -11,11 +11,12 @@ import { AstModule, AstModuleExportInfo } from './AstModule'; import { PackageMetadataManager } from './PackageMetadataManager'; import { ExportAnalyzer } from './ExportAnalyzer'; import { AstImport } from './AstImport'; +import { AstImportAsModule } from './AstImportAsModule'; import { MessageRouter } from '../collector/MessageRouter'; import { TypeScriptInternals } from './TypeScriptInternals'; import { StringChecks } from './StringChecks'; -export type AstEntity = AstSymbol | AstImport; +export type AstEntity = AstSymbol | AstImport | AstImportAsModule; /** * Options for `AstSymbolTable._fetchAstSymbol()` @@ -137,43 +138,13 @@ export class AstSymbolTable { * or members. (We do always construct its parents however, since AstDefinition.parent * is immutable, and needed e.g. to calculate release tag inheritance.) */ - public analyze(astSymbol: AstSymbol): void { - if (astSymbol.analyzed) { - return; + public analyze(astEntity: AstEntity): void { + if (astEntity instanceof AstSymbol) { + return this._analyzeAstSymbol(astEntity); } - if (astSymbol.nominalAnalysis) { - // We don't analyze nominal symbols - astSymbol._notifyAnalyzed(); - return; - } - - // Start at the root of the tree - const rootAstSymbol: AstSymbol = astSymbol.rootAstSymbol; - - // Calculate the full child tree for each definition - for (const astDeclaration of rootAstSymbol.astDeclarations) { - this._analyzeChildTree(astDeclaration.declaration, astDeclaration); - } - - rootAstSymbol._notifyAnalyzed(); - - if (!astSymbol.isExternal) { - // If this symbol is non-external (i.e. it belongs to the working package), then we also analyze any - // referencedAstSymbols that are non-external. For example, this ensures that forgotten exports - // get analyzed. - rootAstSymbol.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { - for (const referencedAstEntity of astDeclaration.referencedAstEntities) { - - // Walk up to the root of the tree, looking for any imports along the way - if (referencedAstEntity instanceof AstSymbol) { - if (!referencedAstEntity.isExternal) { - this.analyze(referencedAstEntity); - } - } - - } - }); + if (astEntity instanceof AstImportAsModule) { + return this._analyzeAstImportAsModule(astEntity); } } @@ -292,6 +263,71 @@ export class AstSymbolTable { return unquotedName; } + + private _analyzeAstImportAsModule(astImportAsModule: AstImportAsModule): void { + if (astImportAsModule.analyzed) { + return; + } + + // mark before actual analyzing, to handle module cyclic reexport + astImportAsModule.analyzed = true; + + this.fetchAstModuleExportInfo(astImportAsModule.astModule).exportedLocalEntities.forEach(exportedEntity => { + if (exportedEntity instanceof AstImportAsModule) { + this._analyzeAstImportAsModule(exportedEntity); + } + + if (exportedEntity instanceof AstSymbol) { + this._analyzeAstSymbol(exportedEntity); + } + }); + } + + private _analyzeAstSymbol(astSymbol: AstSymbol): void { + if (astSymbol.analyzed) { + return; + } + + if (astSymbol.nominalAnalysis) { + // We don't analyze nominal symbols + astSymbol._notifyAnalyzed(); + return; + } + + // Start at the root of the tree + const rootAstSymbol: AstSymbol = astSymbol.rootAstSymbol; + + // Calculate the full child tree for each definition + for (const astDeclaration of rootAstSymbol.astDeclarations) { + this._analyzeChildTree(astDeclaration.declaration, astDeclaration); + } + + rootAstSymbol._notifyAnalyzed(); + + if (!astSymbol.isExternal) { + // If this symbol is non-external (i.e. it belongs to the working package), then we also analyze any + // referencedAstSymbols that are non-external. For example, this ensures that forgotten exports + // get analyzed. + rootAstSymbol.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { + for (const referencedAstEntity of astDeclaration.referencedAstEntities) { + + // Walk up to the root of the tree, looking for any imports along the way + if (referencedAstEntity instanceof AstSymbol) { + if (!referencedAstEntity.isExternal) { + this._analyzeAstSymbol(referencedAstEntity); + } + } + + if (referencedAstEntity instanceof AstImportAsModule) { + if (!referencedAstEntity.astModule.isExternal) { + this._analyzeAstImportAsModule(referencedAstEntity) + } + } + } + }); + } + } + /** * Used by analyze to recursively analyze the entire child tree. */ diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 4e9b36e1918..5afa611c9c8 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -11,6 +11,7 @@ import { AstModule, AstModuleExportInfo } from './AstModule'; import { TypeScriptInternals } from './TypeScriptInternals'; import { TypeScriptMessageFormatter } from './TypeScriptMessageFormatter'; import { IFetchAstSymbolOptions, AstEntity } from './AstSymbolTable'; +import { AstImportAsModule } from './AstImportAsModule'; /** * Exposes the minimal APIs from AstSymbolTable that are needed by ExportAnalyzer. @@ -21,7 +22,7 @@ import { IFetchAstSymbolOptions, AstEntity } from './AstSymbolTable'; export interface IAstSymbolTable { fetchAstSymbol(options: IFetchAstSymbolOptions): AstSymbol | undefined; - analyze(astSymbol: AstSymbol): void; + analyze(astEntity: AstEntity): void; } /** @@ -73,6 +74,7 @@ export class ExportAnalyzer { private readonly _importableAmbientSourceFiles: Set = new Set(); private readonly _astImportsByKey: Map = new Map(); + private readonly _astImportAsModuleByModule: Map = new Map(); public constructor(program: ts.Program, typeChecker: ts.TypeChecker, bundledPackageNames: Set, astSymbolTable: IAstSymbolTable) { @@ -308,6 +310,10 @@ export class ExportAnalyzer { this._astSymbolTable.analyze(astEntity); } + if (astEntity instanceof AstImportAsModule && !astEntity.astModule.isExternal) { + this._astSymbolTable.analyze(astEntity); + } + astModuleExportInfo.exportedLocalEntities.set(exportSymbol.name, astEntity); } } @@ -447,10 +453,16 @@ export class ExportAnalyzer { // SemicolonToken: pre=[;] if (externalModulePath === undefined) { - // The implementation here only works when importing from an external module. - // The full solution is tracked by: https://github.com/microsoft/rushstack/issues/1029 - throw new Error('"import * as ___ from ___;" is not supported yet for local files.' - + '\nFailure in: ' + importDeclaration.getSourceFile().fileName); + const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol); + let importAsModule: AstImportAsModule | undefined = this._astImportAsModuleByModule.get(astModule); + if (!importAsModule) { + importAsModule = new AstImportAsModule({ + exportName: declarationSymbol.name, + astModule: astModule + }); + this._astImportAsModuleByModule.set(astModule, importAsModule); + } + return importAsModule; } // Here importSymbol=undefined because {@inheritDoc} and such are not going to work correctly for diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index 343e55a665b..3907e33f2ff 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -30,6 +30,7 @@ import { TypeScriptInternals } from '../analyzer/TypeScriptInternals'; import { MessageRouter } from './MessageRouter'; import { AstReferenceResolver } from '../analyzer/AstReferenceResolver'; import { ExtractorConfig } from '../api/ExtractorConfig'; +import { AstImportAsModule } from '../analyzer/AstImportAsModule'; /** * Options for Collector constructor. @@ -294,6 +295,9 @@ export class Collector { } public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined { + if (astEntity instanceof AstImportAsModule) { + return undefined; + } if (astEntity instanceof AstSymbol) { return this.fetchSymbolMetadata(astEntity); } @@ -382,10 +386,7 @@ export class Collector { this._entitiesByAstEntity.set(astEntity, entity); this._entities.push(entity); - - if (astEntity instanceof AstSymbol) { - this._collectReferenceDirectives(astEntity); - } + this._collectReferenceDirectives(astEntity); } if (exportedName) { @@ -417,6 +418,14 @@ export class Collector { } }); } + + if (astEntity instanceof AstImportAsModule) { + this.astSymbolTable.fetchAstModuleExportInfo(astEntity.astModule).exportedLocalEntities.forEach((exportedEntity: AstEntity) => { + // Create a CollectorEntity for each top-level export of AstImportInternal entity + this._createCollectorEntity(exportedEntity, undefined); + this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities); // TODO- create entity for module export + }); + } } /** @@ -883,11 +892,23 @@ export class Collector { return parserContext; } - private _collectReferenceDirectives(astSymbol: AstSymbol): void { + private _collectReferenceDirectives(astEntity: AstEntity): void { + if (astEntity instanceof AstSymbol) { + const sourceFiles: ts.SourceFile[] = astEntity.astDeclarations.map(astDeclaration => + astDeclaration.declaration.getSourceFile()); + return this._collectReferenceDirectivesFromSourceFiles(sourceFiles); + } + + if (astEntity instanceof AstImportAsModule) { + const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile]; + return this._collectReferenceDirectivesFromSourceFiles(sourceFiles); + } + } + + private _collectReferenceDirectivesFromSourceFiles(sourceFiles: ts.SourceFile[]): void { const seenFilenames: Set = new Set(); - for (const astDeclaration of astSymbol.astDeclarations) { - const sourceFile: ts.SourceFile = astDeclaration.declaration.getSourceFile(); + for (const sourceFile of sourceFiles) { if (sourceFile && sourceFile.fileName) { if (!seenFilenames.has(sourceFile.fileName)) { seenFilenames.add(sourceFile.fileName); diff --git a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts index 94bed1b2588..1abc37f04cd 100644 --- a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts +++ b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts @@ -12,6 +12,7 @@ import { SymbolMetadata } from '../collector/SymbolMetadata'; import { CollectorEntity } from '../collector/CollectorEntity'; import { ExtractorMessageId } from '../api/ExtractorMessageId'; import { ReleaseTag } from '@microsoft/api-extractor-model'; +import { AstImportAsModule } from '../analyzer/AstImportAsModule'; export class ValidationEnhancer { @@ -30,6 +31,10 @@ export class ValidationEnhancer { ValidationEnhancer._checkForInconsistentReleaseTags(collector, entity.astEntity, symbolMetadata); } } + + if (entity.astEntity instanceof AstImportAsModule) { + // TODO [MA]: validation for local module import + } } } @@ -175,6 +180,7 @@ export class ValidationEnhancer { const rootSymbol: AstSymbol = referencedEntity.rootAstSymbol; if (!rootSymbol.isExternal) { + // TODO: consider exported by local module import const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(rootSymbol); if (collectorEntity && collectorEntity.exported) { @@ -210,6 +216,10 @@ export class ValidationEnhancer { } } } + + if (referencedEntity instanceof AstImportAsModule) { + // TODO [MA]: add validation for local import + } } } diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index aaaeb3935fb..f752af80873 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -40,6 +40,9 @@ import { AstSymbol } from '../analyzer/AstSymbol'; import { DeclarationReferenceGenerator } from './DeclarationReferenceGenerator'; import { ApiItemMetadata } from '../collector/ApiItemMetadata'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; +import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstEntity } from '../analyzer/AstSymbolTable'; +import { AstModule } from '../analyzer/AstModule'; export class ApiModelGenerator { private readonly _collector: Collector; @@ -75,22 +78,52 @@ export class ApiModelGenerator { // Create a CollectorEntity for each top-level export for (const entity of this._collector.entities) { if (entity.exported) { - if (entity.astEntity instanceof AstSymbol) { - // Skip ancillary declarations; we will process them with the main declaration - for (const astDeclaration of this._collector.getNonAncillaryDeclarations(entity.astEntity)) { - this._processDeclaration(astDeclaration, entity.nameForEmit, apiEntryPoint); - } - } else { - // TODO: Figure out how to represent reexported AstImport objects. Basically we need to introduce a new - // ApiItem subclass for "export alias", similar to a type alias, but representing declarations of the - // form "export { X } from 'external-package'". We can also use this to solve GitHub issue #950. - } + this._processAstEntity(entity.astEntity, entity.nameForEmit, apiEntryPoint); } } return apiPackage; } + private _processAstEntity(astEntity: AstEntity, exportedName: string | undefined, + parentApiItem: ApiItemContainerMixin): void { + + if (astEntity instanceof AstSymbol) { + // Skip ancillary declarations; we will process them with the main declaration + for (const astDeclaration of this._collector.getNonAncillaryDeclarations(astEntity)) { + this._processDeclaration(astDeclaration, exportedName, parentApiItem); + } + return; + } + + if (astEntity instanceof AstImportAsModule) { + this._processAstModule(astEntity.astModule, exportedName, parentApiItem); + return; + } + + // TODO: Figure out how to represent reexported AstImport objects. Basically we need to introduce a new + // ApiItem subclass for "export alias", similar to a type alias, but representing declarations of the + // form "export { X } from 'external-package'". We can also use this to solve GitHub issue #950. + } + + private _processAstModule(astModule: AstModule, exportedName: string | undefined, + parentApiItem: ApiItemContainerMixin): void { + + const name: string = exportedName ? exportedName : astModule.moduleSymbol.name; + const containerKey: string = ApiNamespace.getContainerKey(name); + + let apiNamespace: ApiNamespace | undefined = parentApiItem.tryGetMemberByKey(containerKey) as ApiNamespace; + + if (apiNamespace === undefined) { + apiNamespace = new ApiNamespace({ name, docComment: undefined, releaseTag: ReleaseTag.None, excerptTokens: [] }); + parentApiItem.addMember(apiNamespace); + } + + astModule.astModuleExportInfo!.exportedLocalEntities.forEach((exportedEntity: AstEntity, exportedName: string) => { + this._processAstEntity(exportedEntity, exportedName, apiNamespace!); + }); + } + private _processDeclaration(astDeclaration: AstDeclaration, exportedName: string | undefined, parentApiItem: ApiItemContainerMixin): void { diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 2d76419f6c7..a6d0f182d9b 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -16,6 +16,7 @@ import { AstSymbol } from '../analyzer/AstSymbol'; import { ExtractorMessage } from '../api/ExtractorMessage'; import { StringWriter } from './StringWriter'; import { DtsEmitHelpers } from './DtsEmitHelpers'; +import { AstImportAsModule } from '../analyzer/AstImportAsModule'; export class ApiReportGenerator { private static _TrimSpacesRegExp: RegExp = / +$/gm; @@ -118,6 +119,12 @@ export class ApiReportGenerator { } } + if (entity.astEntity instanceof AstImportAsModule) { + // TODO [MA]: add file path to error message. + throw new Error('"import * as ___ from ___;" is not supported for local files when generating report.' + + '\nFailure in: ' + 'entity.astEntity.getSourceFile().fileName'); + } + // Now emit the export statements for this entity. for (const exportToEmit of exportsToEmit.values()) { // Write any associated messages diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index dca08949d42..4bee2833a9c 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -19,6 +19,8 @@ import { SymbolMetadata } from '../collector/SymbolMetadata'; import { StringWriter } from './StringWriter'; import { DtsEmitHelpers } from './DtsEmitHelpers'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; +import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstModuleExportInfo } from '../analyzer/AstModule'; /** * Used with DtsRollupGenerator.writeTypingsFile() @@ -133,6 +135,45 @@ export class DtsRollupGenerator { } } + if (entity.astEntity instanceof AstImportAsModule) { + const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo(entity.astEntity.astModule); + + if (!entity.nameForEmit) { + // This should never happen + throw new InternalError('referencedEntry.nameForEmit is undefined'); + } + // manually generate typings for local imported module + stringWriter.writeLine(); + if (entity.shouldInlineExport) { + stringWriter.write('export '); + } + stringWriter.writeLine(`declare namespace ${entity.nameForEmit} {`); + + // all local exports of local imported module are just references to top-level declarations + stringWriter.writeLine(' export {'); + astModuleExportInfo.exportedLocalEntities.forEach((exportedEntity, exportedName) => { + const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(exportedEntity); + if (!collectorEntity) { + // This should never happen + // top-level exports of local imported module should be added as collector entities before + throw new InternalError(`Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`); + } + if (collectorEntity.nameForEmit === exportedName) { + stringWriter.writeLine(` ${collectorEntity.nameForEmit},`); + } else { + stringWriter.writeLine(` ${collectorEntity.nameForEmit} as ${exportedName},`); + } + }); + stringWriter.writeLine(' }'); // end of "export { ... }" + + if (astModuleExportInfo.starExportedExternalModules.size > 0) { + // TODO [MA]: write a better error message. + throw new Error(`Unsupported star export of external module inside namespace imported module: ${entity.nameForEmit}`); + } + + stringWriter.writeLine('}'); // end of "declare namespace { ... }" + } + if (!entity.shouldInlineExport) { for (const exportName of entity.exportNames) { DtsEmitHelpers.emitNamedExport(stringWriter, exportName, entity); From 1a94da58f7a009cd9d287dd96d9b56ebfee1fa93 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 25 Mar 2020 14:54:24 +0100 Subject: [PATCH 02/32] added change description. --- .../export-star-as-support_2020-03-25-13-53.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json diff --git a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json new file mode 100644 index 00000000000..08c63edc4a4 --- /dev/null +++ b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "\"Added support from 'import * as module from ./local/module'\"", + "type": "minor" + } + ], + "packageName": "@microsoft/api-extractor", + "email": "systemvetaren@gmail.com" +} \ No newline at end of file From 79b397e86066c94651f0a3047218d171289ea228 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Wed, 25 Mar 2020 15:07:44 +0100 Subject: [PATCH 03/32] fixed so we return a proper error messae. --- apps/api-extractor/src/generators/ApiReportGenerator.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index a6d0f182d9b..67578cf130a 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -120,9 +120,8 @@ export class ApiReportGenerator { } if (entity.astEntity instanceof AstImportAsModule) { - // TODO [MA]: add file path to error message. throw new Error('"import * as ___ from ___;" is not supported for local files when generating report.' - + '\nFailure in: ' + 'entity.astEntity.getSourceFile().fileName'); + + '\nFailure in: ' + ApiReportGenerator._getSourceFilePath(entity.astEntity)); } // Now emit the export statements for this entity. @@ -167,6 +166,11 @@ export class ApiReportGenerator { return stringWriter.toString().replace(ApiReportGenerator._TrimSpacesRegExp, ''); } + private static _getSourceFilePath(importAsModule: AstImportAsModule): string { + const sourceFile: ts.SourceFile = importAsModule.astModule?.sourceFile?.getSourceFile(); + return sourceFile ? sourceFile.fileName : 'unkown source file'; + } + /** * Before writing out a declaration, _modifySpan() applies various fixups to make it nice. */ From 6e8b0e2b4b3a477106018ca29f2b395d5886bb44 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Thu, 26 Mar 2020 07:52:36 +0100 Subject: [PATCH 04/32] fixed build errors. --- .../src/generators/ApiReportGenerator.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 67578cf130a..74146d11e9b 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -167,8 +167,15 @@ export class ApiReportGenerator { } private static _getSourceFilePath(importAsModule: AstImportAsModule): string { - const sourceFile: ts.SourceFile = importAsModule.astModule?.sourceFile?.getSourceFile(); - return sourceFile ? sourceFile.fileName : 'unkown source file'; + const fallback = 'unkown source file'; + const { astModule } = importAsModule; + + if (!astModule || !astModule.sourceFile) { + return fallback; + } + + const sourceFile: ts.SourceFile = astModule.sourceFile.getSourceFile(); + return sourceFile ? sourceFile.fileName : fallback; } /** From 9c3d85ad8174093b9a658f2350e6eede6459b73b Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Thu, 26 Mar 2020 07:55:02 +0100 Subject: [PATCH 05/32] added missing annotation. --- apps/api-extractor/src/generators/ApiReportGenerator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 74146d11e9b..59f242ecd85 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -167,7 +167,7 @@ export class ApiReportGenerator { } private static _getSourceFilePath(importAsModule: AstImportAsModule): string { - const fallback = 'unkown source file'; + const fallback: string = 'unkown source file'; const { astModule } = importAsModule; if (!astModule || !astModule.sourceFile) { From ec5757adc2096a3883cfe92b147007f8db47b0c0 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Fri, 27 Mar 2020 21:18:27 +0100 Subject: [PATCH 06/32] fixed feedback on pr. --- apps/api-extractor/src/analyzer/ExportAnalyzer.ts | 2 +- apps/api-extractor/src/generators/ApiReportGenerator.ts | 4 ++-- apps/api-extractor/src/generators/DtsRollupGenerator.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 5afa611c9c8..a2e521c3062 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -455,7 +455,7 @@ export class ExportAnalyzer { if (externalModulePath === undefined) { const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol); let importAsModule: AstImportAsModule | undefined = this._astImportAsModuleByModule.get(astModule); - if (!importAsModule) { + if (importAsModule === undefined) { importAsModule = new AstImportAsModule({ exportName: declarationSymbol.name, astModule: astModule diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 59f242ecd85..8f00c63fb8c 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -167,10 +167,10 @@ export class ApiReportGenerator { } private static _getSourceFilePath(importAsModule: AstImportAsModule): string { - const fallback: string = 'unkown source file'; + const fallback: string = 'unknown source file'; const { astModule } = importAsModule; - if (!astModule || !astModule.sourceFile) { + if (astModule === undefined || astModule.sourceFile === undefined) { return fallback; } diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index 4bee2833a9c..034345aa9bd 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -138,7 +138,7 @@ export class DtsRollupGenerator { if (entity.astEntity instanceof AstImportAsModule) { const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo(entity.astEntity.astModule); - if (!entity.nameForEmit) { + if (entity.nameForEmit === undefined) { // This should never happen throw new InternalError('referencedEntry.nameForEmit is undefined'); } @@ -153,7 +153,7 @@ export class DtsRollupGenerator { stringWriter.writeLine(' export {'); astModuleExportInfo.exportedLocalEntities.forEach((exportedEntity, exportedName) => { const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(exportedEntity); - if (!collectorEntity) { + if (collectorEntity === undefined) { // This should never happen // top-level exports of local imported module should be added as collector entities before throw new InternalError(`Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}`); From a4ea1c11672607d48e20a623e4d1a03305abeff7 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Mon, 30 Mar 2020 11:15:03 +0200 Subject: [PATCH 07/32] added tests. --- .../api-extractor-test-no-report/build.js | 36 ++++ .../config/api-extractor.json | 22 +++ .../api-extractor-test-no-report/package.json | 17 ++ .../src/ExportedFunctions.ts | 16 ++ .../api-extractor-test-no-report/src/index.ts | 2 + .../tsconfig.json | 28 ++++ common/config/rush/pnpm-lock.yaml | 155 ++++++++++-------- rush.json | 6 + 8 files changed, 211 insertions(+), 71 deletions(-) create mode 100644 build-tests/api-extractor-test-no-report/build.js create mode 100644 build-tests/api-extractor-test-no-report/config/api-extractor.json create mode 100644 build-tests/api-extractor-test-no-report/package.json create mode 100644 build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts create mode 100644 build-tests/api-extractor-test-no-report/src/index.ts create mode 100644 build-tests/api-extractor-test-no-report/tsconfig.json diff --git a/build-tests/api-extractor-test-no-report/build.js b/build-tests/api-extractor-test-no-report/build.js new file mode 100644 index 00000000000..b4b2b370604 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/build.js @@ -0,0 +1,36 @@ +const fsx = require('../api-extractor-test-04/node_modules/fs-extra/lib'); +const child_process = require('child_process'); +const path = require('path'); +const process = require('process'); + +console.log(`==> Invoking tsc in the "beta-consumer" folder`); + +function executeCommand(command, cwd) { + console.log('---> ' + command); + child_process.execSync(command, { stdio: 'inherit', cwd: cwd }); +} + +// Clean the old build outputs +console.log(`==> Starting build.js for ${path.basename(process.cwd())}`); +fsx.emptyDirSync('dist'); +fsx.emptyDirSync('lib'); +fsx.emptyDirSync('temp'); + +// Run the TypeScript compiler +executeCommand('node node_modules/typescript/lib/tsc'); + +// Run the API Extractor command-line +if (process.argv.indexOf('--production') >= 0) { + executeCommand('node node_modules/@microsoft/api-extractor/lib/start run'); +} else { + executeCommand('node node_modules/@microsoft/api-extractor/lib/start run --local'); +} + +// Run the TypeScript compiler in the beta-consumer folder +console.log(`==> Invoking tsc in the "beta-consumer" folder`); + +fsx.emptyDirSync('beta-consumer/lib'); +const tscPath = path.resolve('node_modules/typescript/lib/tsc'); +executeCommand(`node ${tscPath}`, 'beta-consumer'); + +console.log(`==> Finished build.js for ${path.basename(process.cwd())}`); diff --git a/build-tests/api-extractor-test-no-report/config/api-extractor.json b/build-tests/api-extractor-test-no-report/config/api-extractor.json new file mode 100644 index 00000000000..d65f934e7b4 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/config/api-extractor.json @@ -0,0 +1,22 @@ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + "mainEntryPointFilePath": "/lib/index.d.ts", + + "apiReport": { + "enabled": false, + }, + + "docModel": { + "enabled": true + }, + + "dtsRollup": { + "enabled": true, + + "betaTrimmedFilePath": "/dist/-beta.d.ts", + "publicTrimmedFilePath": "/dist/-public.d.ts" + }, + + "testMode": true +} diff --git a/build-tests/api-extractor-test-no-report/package.json b/build-tests/api-extractor-test-no-report/package.json new file mode 100644 index 00000000000..f5ad95c7da3 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/package.json @@ -0,0 +1,17 @@ +{ + "name": "api-extractor-test-no-report", + "description": "Building this project is a regression test for api-extractor", + "version": "1.0.0", + "private": true, + "main": "lib/index.js", + "typings": "dist/api-extractor-test-no-report.d.ts", + "scripts": { + "build": "node build.js" + }, + "dependencies": { + "@microsoft/api-extractor": "7.7.10", + "api-extractor-lib1-test": "1.0.0", + "fs-extra": "~7.0.1", + "typescript": "~3.7.2" + } +} diff --git a/build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts b/build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts new file mode 100644 index 00000000000..2aaab3cdc81 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts @@ -0,0 +1,16 @@ + +/** + * Returns the sum of adding b to a + * @param a - first number + * @param b - second number + * @returns Sum of adding b to a + */ +export const add = (a: number, b: number): number => a + b; + +/** + * Returns the sum of subtracting b from a + * @param a - first number + * @param b - second number + * @returns Sum of subtract b from a + */ +export const subtract = (a: number, b: number): number => a - b; \ No newline at end of file diff --git a/build-tests/api-extractor-test-no-report/src/index.ts b/build-tests/api-extractor-test-no-report/src/index.ts new file mode 100644 index 00000000000..220c57c9974 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/src/index.ts @@ -0,0 +1,2 @@ +import * as calculator from './ExportedFunctions' +export { calculator }; \ No newline at end of file diff --git a/build-tests/api-extractor-test-no-report/tsconfig.json b/build-tests/api-extractor-test-no-report/tsconfig.json new file mode 100644 index 00000000000..f6c01bb8017 --- /dev/null +++ b/build-tests/api-extractor-test-no-report/tsconfig.json @@ -0,0 +1,28 @@ +{ + "compilerOptions": { + "target": "es6", + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "declaration": true, + "sourceMap": true, + "declarationMap": true, + "experimentalDecorators": true, + "strictNullChecks": true, + "esModuleInterop": true, + "types": [ + ], + "lib": [ + "es5", + "scripthost", + "es2015.collection", + "es2015.promise", + "es2015.iterable", + "dom" + ], + "outDir": "lib" + }, + "include": [ + "src/**/*.ts", + "typings/tsd.d.ts" + ] +} \ No newline at end of file diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 9d95999c79f..6fda61171ee 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -16,6 +16,7 @@ dependencies: '@rush-temp/api-extractor-test-02': 'file:projects/api-extractor-test-02.tgz' '@rush-temp/api-extractor-test-03': 'file:projects/api-extractor-test-03.tgz' '@rush-temp/api-extractor-test-04': 'file:projects/api-extractor-test-04.tgz' + '@rush-temp/api-extractor-test-no-report': 'file:projects/api-extractor-test-no-report.tgz' '@rush-temp/debug-certificate-manager': 'file:projects/debug-certificate-manager.tgz' '@rush-temp/doc-plugin-rush-stack': 'file:projects/doc-plugin-rush-stack.tgz' '@rush-temp/eslint-config': 'file:projects/eslint-config.tgz' @@ -11809,7 +11810,7 @@ packages: dev: false name: '@rush-temp/api-documenter-test' resolution: - integrity: sha512-IxYzaUsjim00TpAsKyonGc2LzvFG66s/P/ouKHeYeyegl6Na/UkglOG6sq0rai+P7wlxDkCXzdlhH1VApSP5jg== + integrity: sha512-y/grzsT4wCktTYS0kAR2NwZgrMrS3+A2QuJARXYRZb4UaYhLJOCh6YsP2nBjcUmUWc6a4xJJPayGpYfIfmeFfg== tarball: 'file:projects/api-documenter-test.tgz' version: 0.0.0 'file:projects/api-documenter.tgz': @@ -11827,7 +11828,7 @@ packages: dev: false name: '@rush-temp/api-documenter' resolution: - integrity: sha512-6fmG46uYHM4SGmlM+RIRc9iuaKpEzblcY1nO6GY84+45Ylv7FzV4f9gjdckksD1s3/A5pav8MxmgRRC8ZyHmdg== + integrity: sha512-Hvwd5eVsMRgoxcts/VZCjHBypZ+MFeslOLZg8bhptizgPlEiEkmKy5p5+I4Mb/TaVLo4Q4X09DskHAXxfACnbQ== tarball: 'file:projects/api-documenter.tgz' version: 0.0.0 'file:projects/api-extractor-lib1-test.tgz': @@ -11839,7 +11840,7 @@ packages: dev: false name: '@rush-temp/api-extractor-lib1-test' resolution: - integrity: sha512-RpxJbIdjnT5NGC/QbRhvXMlNKZrkXCjrb4QMYC4bOfl7It2bHUhFVC7ia/MVfiSfy3j/WOfLWlWEvfV+aUb3kg== + integrity: sha512-yWObOk8ypI+eyEFbPdoezwhH2Lkz4OkFHogffwfBl2s55Y1Of9y6TKhn0R3qeeHx3IlywY9gpq5B5kVGivQe2w== tarball: 'file:projects/api-extractor-lib1-test.tgz' version: 0.0.0 'file:projects/api-extractor-lib2-test.tgz': @@ -11851,7 +11852,7 @@ packages: dev: false name: '@rush-temp/api-extractor-lib2-test' resolution: - integrity: sha512-Y8EjDqx8kh5POt2ahj5xHukdlDu7OwlYu48hQ20vwzCe7clrZGGITVzohSh5KCQpLj6lC0ViJ6bhnUC8Zn9itA== + integrity: sha512-HszIRlFg/xxXVRAMLaE+V42wKZCubFm/9Ts40xdVCgb1eHB9GQ9T0WBdHJkS3GbVLxdmRE+lnDuPb05FCELedg== tarball: 'file:projects/api-extractor-lib2-test.tgz' version: 0.0.0 'file:projects/api-extractor-lib3-test.tgz': @@ -11863,7 +11864,7 @@ packages: dev: false name: '@rush-temp/api-extractor-lib3-test' resolution: - integrity: sha512-YZUv3cpx/vGYl4LRHh88mJgIUdu3x9csIkg/ex4VSrOOENIxY2508y8zaQbOLN7wQnGtdFh3e2naPZ8+PaZUGQ== + integrity: sha512-dQE2OCKumTb3l3Dzqx1CsB4oJo4HTuoheEZZGzTPslhTqSGGHnG7TcEG9Kb4Zrz+dRluwdiRth/VjK6WZzDTDg== tarball: 'file:projects/api-extractor-lib3-test.tgz' version: 0.0.0 'file:projects/api-extractor-model.tgz': @@ -11877,7 +11878,7 @@ packages: dev: false name: '@rush-temp/api-extractor-model' resolution: - integrity: sha512-el+CZgEsaP2zfKtaVgq5In7pGTCokGxXSXRN1Umn15rx7mj24jsm6a0YCUh2Oy68aLrzfzaWuusrbDsvkTObFQ== + integrity: sha512-OHqbMuIwf1zK7mUz3pZmZO+UqGLMNsWryaOH9Ny7CcnsY4Dt7F/C8LSClYBSOaUbLpsO0VDJatA2lwUA8DSNgg== tarball: 'file:projects/api-extractor-model.tgz' version: 0.0.0 'file:projects/api-extractor-scenarios.tgz': @@ -11891,7 +11892,7 @@ packages: dev: false name: '@rush-temp/api-extractor-scenarios' resolution: - integrity: sha512-EWlVSacl5IXdOzG100I5ThL24K7a92PjJ9xyeFUwsvKKVMrnyTer2VxEObYwIsDeeivGSmtOj10+ZSONNKHrlA== + integrity: sha512-ixVM5zWa3ppPUoTwd3iwsZW6GBKALD8mI0JlJ8lD2GHBYWxjjc9KunPHTfJkaiaRzSi4eyvigepHU8ZAA7qeSw== tarball: 'file:projects/api-extractor-scenarios.tgz' version: 0.0.0 'file:projects/api-extractor-test-01.tgz': @@ -11905,7 +11906,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-01' resolution: - integrity: sha512-pe7+dQ87T/Xx2XnUdqxl3NYKP3AUlBre/sE4PYyMxR3ReD5fEVwZC50/po4Q+YKtH+z2lcDDftx/2qo6MOsXtw== + integrity: sha512-PS/VBWdISrPbioLEbtkpfAoO+mZvzbaKHsjacN53X3XxPZIKTSrW48BqLoQ6RdUCn05wNB7PD/PxrEsu0f9gNA== tarball: 'file:projects/api-extractor-test-01.tgz' version: 0.0.0 'file:projects/api-extractor-test-02.tgz': @@ -11918,7 +11919,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-02' resolution: - integrity: sha512-snzcy5ZBrY7jG3JpZSQHJa5CJh6mLu0Sn0+w+k3EnRH9dpb/aY+Ty7G1cTEv7KE8vBsdbtXVC5XHFHU/8vnjBw== + integrity: sha512-hIFaofNb9/ox8CeCRcbN2YZnTo8RmE5zVEqYwGmNX7mm9xwGN0UJfVB4lYRUT1kwUDLzR3a0rNsG8Ooiln2qsA== tarball: 'file:projects/api-extractor-test-02.tgz' version: 0.0.0 'file:projects/api-extractor-test-03.tgz': @@ -11930,7 +11931,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-03' resolution: - integrity: sha512-u3+vi0EJBQ0lENBb57W3IyIbmxGPaSO6D7IgCXZsoZUjr41Vl5+4QiNsEoePJuRk5yzo20r8nsLfXKCL1PspMQ== + integrity: sha512-GDHhHAsnK8BECHJUZV/Rk17hShhfzPZxsHXl24ZfEppd9hijGU8J8wG2HDoz9Kr3qp82okgWpeT1c9NcNuf7Aw== tarball: 'file:projects/api-extractor-test-03.tgz' version: 0.0.0 'file:projects/api-extractor-test-04.tgz': @@ -11940,9 +11941,19 @@ packages: dev: false name: '@rush-temp/api-extractor-test-04' resolution: - integrity: sha512-2BItXxUajGahw84OndJ7wTPIDshJpZV4r+XXOYurJKaswoxrez6VGKBDUpD+ar7tkPLyPoTW435yxFRCTDgHIg== + integrity: sha512-AA7zu/aWU9kPjOyUuZa/xrfk6XYiMQ6O3vsHXwqlpsJOcojapiFN/xl4baA5EdCehyFKS4x6is2SrUfg1ye7zg== tarball: 'file:projects/api-extractor-test-04.tgz' version: 0.0.0 + 'file:projects/api-extractor-test-no-report.tgz': + dependencies: + fs-extra: 7.0.1 + typescript: 3.7.5 + dev: false + name: '@rush-temp/api-extractor-test-no-report' + resolution: + integrity: sha512-8MKXDKoKinqAGMWlE4UzvkF6Ymzwl9nsl8SlNq62CoTMNxUxDmiFl9NJOqE6YABYsVL5ZvSBeyhVY/1WA9Vxxg== + tarball: 'file:projects/api-extractor-test-no-report.tgz' + version: 0.0.0 'file:projects/api-extractor.tgz': dependencies: '@microsoft/node-library-build': 6.4.5 @@ -11960,7 +11971,7 @@ packages: dev: false name: '@rush-temp/api-extractor' resolution: - integrity: sha512-Z13gp+jB7xAMgpL19acjqLs6LJSmSltXGfYvC0ylJmA7OGlhuwqceO9SmXivupiDlxcXcTmDF7uX1ZHqj2xcNw== + integrity: sha512-rcEO5AwIftC3DrUReufxQkfpvOpOkChkM0tZQKvrZU8e6nCU71krcgbgEJvqK/e2NSA8FpETjkbxvzXvhZ1clA== tarball: 'file:projects/api-extractor.tgz' version: 0.0.0 'file:projects/debug-certificate-manager.tgz': @@ -11975,7 +11986,7 @@ packages: dev: false name: '@rush-temp/debug-certificate-manager' resolution: - integrity: sha512-7bMbqGDJ8PilmabfpXZ5vbubQzWcoUlYSWkbly0IgeHzc8Dpk9AXfD+2BT/JIk/ZMN6JkxkjA41b1BMeNTlgFg== + integrity: sha512-2gvCrBuoTdsEO01Vw7FP/Z7rK2ERuF6OF7cTaAWbXHu2UEa9XqsvTRHpo9TIeem/fSB9PKM08DQltPPzrmaiMg== tarball: 'file:projects/debug-certificate-manager.tgz' version: 0.0.0 'file:projects/doc-plugin-rush-stack.tgz': @@ -11988,7 +11999,7 @@ packages: dev: false name: '@rush-temp/doc-plugin-rush-stack' resolution: - integrity: sha512-0MR4gl0OuC63vn+Hkc8ejeFJlwCNjwE697M6g+dK/e9ctNr813RPDbwSHPzwu2R77olcxIay4kvK+i3pPHfPeg== + integrity: sha512-B5gZQqoSUwk4L3ToEZObhdiKmDhebVi3b3eoJqJXCrYQzbEKlNgODo2M45FjpGO0aIH/CyWRvwLg7nL5+/56EA== tarball: 'file:projects/doc-plugin-rush-stack.tgz' version: 0.0.0 'file:projects/eslint-config.tgz': @@ -12006,7 +12017,7 @@ packages: dev: false name: '@rush-temp/eslint-config' resolution: - integrity: sha512-h6SLC+GZuBXl0iAiUzX9QQ72ZtQCAOxi6Cc+JvAMgROh491oiVRotKtGY7RDAOO76t3yZ08ryVdu/WH0xSVLRw== + integrity: sha512-gUIH2uS4R7skvBk55sagvt7cTLaiahHTI18Sn5feSSKbo9xZ8aRnjNw8dMTlGVWNdjoRJSjRV0lZGn26FvU3pA== tarball: 'file:projects/eslint-config.tgz' version: 0.0.0 'file:projects/eslint-plugin.tgz': @@ -12025,14 +12036,14 @@ packages: dev: false name: '@rush-temp/eslint-plugin' resolution: - integrity: sha512-r2NnXz0aAKrLDgBXx29fRUaPnnK2DqQGVUHv55x2r3TzrioMIPzGjw80+CGNvfluCmZ/B6NMJ3CSHBz7W2d8Uw== + integrity: sha512-yZrDhrk5tLHUyUOyU9Ldk/XkwEU8XGedIh0MhrJuAq21/h4SsUbRkeX/10l5UK3mFAf6Iow03ug+i5y88oub/Q== tarball: 'file:projects/eslint-plugin.tgz' version: 0.0.0 'file:projects/generate-api-docs.tgz': dev: false name: '@rush-temp/generate-api-docs' resolution: - integrity: sha512-0StXpRcO30Y6eXubYyMtaS5BVse0ZLIFv2Gy8rXB+rcVyMiGgtz2lnzvFPDprfn/sjrwWaV2Plj7ZzYUJ+rg0g== + integrity: sha512-gNxomXYQVXx/YdxhJDvMUgfzR9F3z2dOLKxq8qyDjW2zYjSuwX/l3Oype7PRg1V/IpYwUGoYKF0ayskEjZjYOg== tarball: 'file:projects/generate-api-docs.tgz' version: 0.0.0 'file:projects/gulp-core-build-mocha.tgz': @@ -12053,7 +12064,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-mocha' resolution: - integrity: sha512-iCjRPZQkgnuN0x6HlxXAnK6/w53Bolq8tpLob3m3Sfea4EwLILx4CX9xLNLiIHu2qXSn7B/NH2LTCe+sKLPehw== + integrity: sha512-qVUrGic4cESplVC0SUhraKorCPgnSKaC2p3e8m2hBwi2RS1KHxOF4NWKUeXw+KF/tgRhaD2KGGchK/41pScmHw== tarball: 'file:projects/gulp-core-build-mocha.tgz' version: 0.0.0 'file:projects/gulp-core-build-sass.tgz': @@ -12075,7 +12086,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-sass' resolution: - integrity: sha512-QwZeLsLphU25Yj80vX1xnI9F5+odHgGR6AqHYwj7OaBsBuvPH1/wclRc1eTFdWl15Fbq96FNfDXa6EAbKGZsjQ== + integrity: sha512-kKpknzxwaPZQPXeI9/zBiRG6hKrpIjIDjBBtTff2blsvKrsTZ6uDGPvEWLUGG7y45RStdLuhHSLxNoWPQeAA3g== tarball: 'file:projects/gulp-core-build-sass.tgz' version: 0.0.0 'file:projects/gulp-core-build-serve.tgz': @@ -12098,7 +12109,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-serve' resolution: - integrity: sha512-kOe08Xlz9hCXlu0ZmUkKHmVrCUymJHaRtF9WrLOkfcR3JqYdbGhW/vawTcomwIusxqtG+anY3aZlSaCVZGXrUg== + integrity: sha512-GfFU+r5DLxwoZQGnRbfka/8yfypdzdQHxnqcanqcvO+zG9+7ARkxwj64GLT2b71KR1Wp/UK6vsmpq9iO6BS+0w== tarball: 'file:projects/gulp-core-build-serve.tgz' version: 0.0.0 'file:projects/gulp-core-build-typescript.tgz': @@ -12117,7 +12128,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-typescript' resolution: - integrity: sha512-RWfs2T5bymwsKeVFcjNwQKpJRsV34M8kZILiXibai0WgAeaTuKclL1iWvVXpNp8z3mE+3uIZz/ozr5CmJ9VErQ== + integrity: sha512-1/aJJ6dAo1uQaRPhc7BtIqxymOzDp/gBKBjf2y/+UqZGWWoYWDPoFlhcUDOahJI0dhSQkjnw5ttQZu79B+JLJg== tarball: 'file:projects/gulp-core-build-typescript.tgz' version: 0.0.0 'file:projects/gulp-core-build-webpack.tgz': @@ -12135,7 +12146,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-webpack' resolution: - integrity: sha512-bAYuyYu7KrRxgpN8CKcZQjO9cSgpTq1zA9bS5+mc1m4gEUOKzcXggYerDQOOwAtHAgwLNTc4l/1DFMwU2cpcbg== + integrity: sha512-6JDrBjcVhPG8+S3/2nlbgiphmNWId4Cid6vgpFYPkurIw5MhQyan3cDjKt81bE5mXApdSnAi+SscTxpZUH+Opw== tarball: 'file:projects/gulp-core-build-webpack.tgz' version: 0.0.0 'file:projects/gulp-core-build.tgz': @@ -12187,7 +12198,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build' resolution: - integrity: sha512-KY/rDdu8MtDPhtRmMBjr2t+mHIbRUUeAsaLuwJrY4u3CqeNHSWiReblaPQQ1MMsBmiYacTKdqv6/e23LTTrILQ== + integrity: sha512-TBJ5pKoXyHPiS6N7O3sRjoKQT6Hi8QWyUaaAsk+XkSeTuebXQlErQmJAylG9tYo0pfK2LUX1s2x1WjM2ld8Pag== tarball: 'file:projects/gulp-core-build.tgz' version: 0.0.0 'file:projects/load-themed-styles.tgz': @@ -12200,7 +12211,7 @@ packages: dev: false name: '@rush-temp/load-themed-styles' resolution: - integrity: sha512-eZ/uPtBcR8i4G4NhO6WOek1/GW4pj7Ji7anhJLdHHpnYEhTuM7sc/ccFsxhO2wzLqJiFT7URd4N3aj1arUDx4w== + integrity: sha512-Px7WgHzBIP9JHvoWBTJTDVrqFG48czl0odQveA9NyDd36tPWF9llqUooZhYEdS3Wa1V+QkSOaoHNTtLcKBlFHg== tarball: 'file:projects/load-themed-styles.tgz' version: 0.0.0 'file:projects/loader-load-themed-styles.tgz': @@ -12215,7 +12226,7 @@ packages: dev: false name: '@rush-temp/loader-load-themed-styles' resolution: - integrity: sha512-aeoLRx7pZVrNwLQXu6h0bwvQfeCvVVFKAQ2iSQtqfXipNj/sA6AKH/TCtjfqPjVOqtTjXTh2iC0uwfsRfSOpGA== + integrity: sha512-F5EAjysmtnbrZtm8H+Ff7+hyPFE6FstXx0GaIS86tUxeVlb0RPOqX17YDo8eiURKn7MEczI+a0w5ncNxULaHKQ== tarball: 'file:projects/loader-load-themed-styles.tgz' version: 0.0.0 'file:projects/loader-raw-script.tgz': @@ -12229,7 +12240,7 @@ packages: dev: false name: '@rush-temp/loader-raw-script' resolution: - integrity: sha512-ZpToFNpTp6p2EQiT68voxDXd9reTZ2a+UUDdmntmJ1HIlWASYtUOZ9NvceephLav339QWfCPwuIkv6X1c4vQmw== + integrity: sha512-7pv2jKJawO+Xgl0I3NeUAtwyR8Sj5gP2qzSCd2icEVIoRTpuso12GyBw0/Bi9IQMVoqCqfH5WcCi/KsBH+RIkA== tarball: 'file:projects/loader-raw-script.tgz' version: 0.0.0 'file:projects/localization-plugin-test-01.tgz': @@ -12244,7 +12255,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-01' resolution: - integrity: sha512-CPM8VgA662a5JXyszLuTJ+TgLe0ff/qkH0KkkrwHwrh3UOH7ST7zKtAcrKCtVKySV94GlVT5JGgD0rFcNj7Gbg== + integrity: sha512-rQeaXK9WMAtzCX1aguuhwybBnT0s4yG3IYxjWVwdOJRihQC4JUmRkiGSrwWp8FrEn8rEKMJs50+/9R5dQc2r3g== tarball: 'file:projects/localization-plugin-test-01.tgz' version: 0.0.0 'file:projects/localization-plugin-test-02.tgz': @@ -12261,7 +12272,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-02' resolution: - integrity: sha512-rZhAPTjsiuv1gkEODxe7qwWKzp0a0+ugO7oRhHULBkQFf2Uxcm9Vc3GCa8PDqQ9jLUFpqAXvxUyuCmB8YMBicA== + integrity: sha512-Or7nEdm+YSzPqvSZhSGwG+BCXyanthGlAFcRpGfOvLeMv5iaRLl5IBwgrxObaRBKQZ6ZZYhQZINH9dvoZnPP5A== tarball: 'file:projects/localization-plugin-test-02.tgz' version: 0.0.0 'file:projects/localization-plugin-test-03.tgz': @@ -12276,7 +12287,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-03' resolution: - integrity: sha512-Fiyizz/cRAZ3dct6uDburgjEM0r1PKcDmBRsWPPFtq+CbDZ/KVsUdmLrUqUiaJIgUsX7cx3L534QFJMt89PEDg== + integrity: sha512-oRWFyOalOx2dO208LQ9b6uAzQPsxqv2bYbOlQMA+WFZ+6nH5yQQ/Zyi1V5tcxnVSo3DTxgE9z06a2sRbkfIKvQ== tarball: 'file:projects/localization-plugin-test-03.tgz' version: 0.0.0 'file:projects/localization-plugin.tgz': @@ -12299,7 +12310,7 @@ packages: dev: false name: '@rush-temp/localization-plugin' resolution: - integrity: sha512-C3kNhJQw5WnzAdtFxJ4R9dN7mFDkN7JguaJrz962quVAzHqfnvcJG6g8m0jKgoLnmIhSlIbpweDmwRF0eYMnhg== + integrity: sha512-0DXgSamzqT3UUNvfwLFfKuiwluQlf7g7Ug2xqbqqme2DdSRzdis5dPW7b0e8OxQdTKf6F6b9pJu5Pbfe8DoWlA== tarball: 'file:projects/localization-plugin.tgz' version: 0.0.0 'file:projects/node-core-library.tgz': @@ -12323,7 +12334,7 @@ packages: dev: false name: '@rush-temp/node-core-library' resolution: - integrity: sha512-VBJmtX4C94d3dRP/R4JrtWf/kjJfN6h1lR6mu7noenJXhShuGurdOCdiHIBO5TAzPWG8ESklKJWV7O7dlJs4Kg== + integrity: sha512-mNaK1wPSR84IeP439aCMWWc0k8Jdsj5r0MX3dueMVZgVSaU9h0QpIFFhlkJW3d777p3KjguB/EHcoKIW7USDVQ== tarball: 'file:projects/node-core-library.tgz' version: 0.0.0 'file:projects/node-library-build-eslint-test.tgz': @@ -12336,7 +12347,7 @@ packages: dev: false name: '@rush-temp/node-library-build-eslint-test' resolution: - integrity: sha512-qmkHvn+IPfP04YSjVPBPrtxQgdIsk8asL4Iik8O7ewL0bliV9N3EF2aFZ5CdM6jp4I97DLbXJ464duErJdCazw== + integrity: sha512-ooS22KNoEzSpjdsxHI2t/Olr0lxy8zgZdm+qUoTVtUTgLNyDewJ8mnKL++OmYlDvVsRHl4bdyiTBXBMVZXzUvA== tarball: 'file:projects/node-library-build-eslint-test.tgz' version: 0.0.0 'file:projects/node-library-build-tslint-test.tgz': @@ -12349,7 +12360,7 @@ packages: dev: false name: '@rush-temp/node-library-build-tslint-test' resolution: - integrity: sha512-Q1LEO/baVdHPY5q3ZOob535X5xX+x9YvKVXlstySiQpuW8tCeWFHp/I/5R6fjCpbGlpPAF+LQIMtV5he56IMfQ== + integrity: sha512-AXsCUFwuemYxjULtfBjuBu0h9LMTjQiUUgAFSO4w1zQIn2qZZMCN41lQ4T7z3o3+dp4+OMiv+qz/zgPQ6+Scug== tarball: 'file:projects/node-library-build-tslint-test.tgz' version: 0.0.0 'file:projects/node-library-build.tgz': @@ -12360,7 +12371,7 @@ packages: dev: false name: '@rush-temp/node-library-build' resolution: - integrity: sha512-CmYLuKAdg4uXDwivFZ0aYhlnuOl0GKib5XcaCeR8WufNMO8CCq7W/lVKYjprSNQQah+JZ/7uIzgMn8sq8z4g8g== + integrity: sha512-brxn7vy3E/UJda7FyBBmbF2td7UxVmXKxi9znjs0bBUIu8DFoQWf9+8G0hBjZmPuZh5hMXFyuY31SqQqLkwlzg== tarball: 'file:projects/node-library-build.tgz' version: 0.0.0 'file:projects/package-deps-hash.tgz': @@ -12373,7 +12384,7 @@ packages: dev: false name: '@rush-temp/package-deps-hash' resolution: - integrity: sha512-fdcsFoUbDnpPmXJUlp5UQndUtZEM0Oz37LjmVUW2ixCY4YcSOHKxXN2LOAv8XjBYHIaCBvUcO0t+mTpe5NMkvQ== + integrity: sha512-wdTfpUcyaA9l46+pcBNLLuU19QZuhHPkpTCWdJKfnbZXSuj7oSo1Z4R+ve3ttKTLp836f0Yu/uai4vrSA2IEIA== tarball: 'file:projects/package-deps-hash.tgz' version: 0.0.0 'file:projects/repo-toolbox.tgz': @@ -12383,7 +12394,7 @@ packages: dev: false name: '@rush-temp/repo-toolbox' resolution: - integrity: sha512-/eYU/rWThcXqbxpmxJDCsn2pP4jaakDN8zY1b9rpzh+GbuJsBaMoJ8ClS/m6OqUwnfDoYcRxt2SkGU6s1dPQmg== + integrity: sha512-oJo/54Pa7ndqm2NOT9RqD6NabB8c3agC0pIbcAx6l0YAdwtFomdFOKCM3VFbtDfCzpEWtqW6T6FMogixJ7bDMQ== tarball: 'file:projects/repo-toolbox.tgz' version: 0.0.0 'file:projects/rush-buildxl.tgz': @@ -12394,7 +12405,7 @@ packages: dev: false name: '@rush-temp/rush-buildxl' resolution: - integrity: sha512-27S1WLqqbx3f9A9TlTza9GSRfzmehT4rr1t25w2AedvBxd3/5/UoIRaAMxIR2kFMaJQSqCURJZ9bqVGwpJDr5g== + integrity: sha512-gbwFn3jiaNLbr3cKzI9tOxXlvg49/GpZwt0rUeBRh6HgABP4Kfdb2oIfwq+p+XVLMnXgERChyIx8jYqGuRs5Aw== tarball: 'file:projects/rush-buildxl.tgz' version: 0.0.0 'file:projects/rush-lib.tgz': @@ -12441,7 +12452,7 @@ packages: dev: false name: '@rush-temp/rush-lib' resolution: - integrity: sha512-MDjsPBNWxfYSrSmf097WE5XB81WNxmWIgqZYFz7LkEteY227GKZosebIvMHx/G5xfButfzUXY/eyxA5OTd4Fbg== + integrity: sha512-IpICWQjJfIKEjUhqHwzCC8czQ1DIjR9igS2y8p58Qt6g7Fz7x+jUBifFJMK558PuCKTNzO+qoasqOl5HtxqaDw== tarball: 'file:projects/rush-lib.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.4-library-test.tgz': @@ -12451,7 +12462,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.4-library-test' resolution: - integrity: sha512-7ZNxj1iqqVXwPbwtLdOReCe0exBMkdAnTemNmHQacbykf4wAZVHndONQP1gOoF0ucqbpdUDQz0UjiX7ewSyvFQ== + integrity: sha512-r+61wynX/l1BQCqlb7wUJkUj/DEfnRFlaQXlxRHSbUMcj3wIZ4tFVWbpqjUMeodNFyKfNq4aSKl7ndUZe8yNzQ== tarball: 'file:projects/rush-stack-compiler-2.4-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.4.tgz': @@ -12467,7 +12478,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.4' resolution: - integrity: sha512-i9CHdMK8a6sC8cVV3q2BKvaEf/z22X839BiTekinVB6YlfKG5cowo2Km68Vg/BMQSfKjwBPwZOFsWJhYJFLMGQ== + integrity: sha512-OKG0UUxpmdS+5pxKFOnms3hIBXmHnJHVZrjUvMaEPvsq+hvSnTm7PWUzS5oqZHR4mea0v2gNswWG8HY+1lnpXg== tarball: 'file:projects/rush-stack-compiler-2.4.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.7-library-test.tgz': @@ -12477,7 +12488,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.7-library-test' resolution: - integrity: sha512-D+IQjPyadH3IFm2mC2vPulgsR7gKgHzx6Lb32SjvU5HHJb1vNFwiO6/KJ6P5lUN7x8s/amWYO/NAOFiTiEkpDA== + integrity: sha512-yuuL5m1xujGAC1IpsKLgc+BT71K/n5CNeQqh2vjhOkCD7Z8SXw1S1muRqrMS8RZANp/2RmUpjCWW2QED9vk8rA== tarball: 'file:projects/rush-stack-compiler-2.7-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.7.tgz': @@ -12493,7 +12504,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.7' resolution: - integrity: sha512-i4s1pk8uaZN4UkHaK17S36jl4a9iQfNns5qtk2w/bNpfmB2qWsEJrRPG4SpJMqFFvNxCwLa2p+jxClD4mCujaw== + integrity: sha512-fU1nZeHVEXjvYMiMl/l+T45JTlS1WXSSckvKMZTYlGEm+QkHt8AFgkdK/vTBgurV+q4jlj7E1wgv7VnVhhpM4A== tarball: 'file:projects/rush-stack-compiler-2.7.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.8-library-test.tgz': @@ -12503,7 +12514,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.8-library-test' resolution: - integrity: sha512-/Va365kd2m2+bkAocpmaU9KdGUbTYVE/PUCVRjHRaC1dDExeU6MjCzDM7yP1Rul1MgMzhI7NOLqr3HxXW2qGCA== + integrity: sha512-7Wlc10SfkL+R3EtY1ntD6RXZAwpQkgq9asddt5ExmAjMzyhP4mDAh24ARNvCjAssaMGBZJO2hBAA9D7O/zwQ4Q== tarball: 'file:projects/rush-stack-compiler-2.8-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.8.tgz': @@ -12519,7 +12530,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.8' resolution: - integrity: sha512-Pd2ZgQ8gZ20slCfO4//M2B5sCj9R0cKURWf8G/HwnxeTAJdnKdScW0IsU1TjNbPayQ7FpIGrZulPe2iWJt7D3Q== + integrity: sha512-4vijV5ByPHQ0a3W+4pPv8pQtJS8jLE3TEwoE/kGOWVZEjqytoz8FE4sGGdpigAqf9Sd33GOJrcsFe1ywcMbdjA== tarball: 'file:projects/rush-stack-compiler-2.8.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.9-library-test.tgz': @@ -12529,7 +12540,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.9-library-test' resolution: - integrity: sha512-IMW41OF+UdMyjG3H+7KomOuyYdsc0RWOwdFPrZ5wbRHs8RauAmc4vjwlTuA9JL1UPMnFfVJyIgm2M//xqoqNpQ== + integrity: sha512-V0fFOP9Lit3RL2OI2BlIjXuVg/4/J6jgR3my9MddSToMju9ILUcU9OVVjyZnvfRnynHbHGtvuUWuUYa+JwrmsQ== tarball: 'file:projects/rush-stack-compiler-2.9-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.9.tgz': @@ -12545,7 +12556,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.9' resolution: - integrity: sha512-wIpzf1RV5DLumxI61U+dVXj7K/wQ6VtQAuiG0BSA7GZOf50NWlIiA4AmnpLDpp6HkPVM8q5NK4PLsNfT2KJdUA== + integrity: sha512-93KGGVL6UtODnK1TBTR+nVKeuXcOVbjKFQSw94wn5A0wfUQn5fHMl2edjTZBo0ef1vBt/NHoQ7MJ/k3Yz4VZ2A== tarball: 'file:projects/rush-stack-compiler-2.9.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.0-library-test.tgz': @@ -12555,7 +12566,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.0-library-test' resolution: - integrity: sha512-TchuH9wEKUC/IPTSfsBNGHdMBcFsA3MZIx8CzH+UTp6mLG8Xjef7iXz65Fhmq0NEAHsnx2kllvRfzbGYQ8ZIeQ== + integrity: sha512-YJ45t+v1n3bhQWsuWPqCtfUVVHewuBnuUiPKCHkbZLh1vlQpJ0w+J2XcgwBnTCqv9U38H+aswOgF03xWUGBElQ== tarball: 'file:projects/rush-stack-compiler-3.0-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.0.tgz': @@ -12571,7 +12582,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.0' resolution: - integrity: sha512-Zg0TDAbTq1L05fhOZtN6dYIpuidtrij/dTh5J+LEkqRIU+pA7CQeELynaViTFBuo/w+nr/54FPpGXMleTccukg== + integrity: sha512-MIQk6dGf4Ieq3d4atO1mszd4/Xnt0pWUog4USPHHdg1/FxI27h/BVP//Ci+YGIyQYUbH4fcgdZAgavlmHx8Rkw== tarball: 'file:projects/rush-stack-compiler-3.0.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.1-library-test.tgz': @@ -12581,7 +12592,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.1-library-test' resolution: - integrity: sha512-Uwy2U52LzHIdfrL+VIUAILbcjpeN5YItGHzwKqpzpIMWaunrEcfTXlaGm8yV4arVuwCGN7bX65kCR3Lh46JvBg== + integrity: sha512-MZ3dT7k9zaf6MI9VvylZcdxKA3MGWhWhZjtRN3TZGkmrUSPb4pK+7gv+63ngtljomJ0hfMJ0GBvqHT7TNSCXaA== tarball: 'file:projects/rush-stack-compiler-3.1-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.1.tgz': @@ -12597,7 +12608,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.1' resolution: - integrity: sha512-1TzClDXZW4wzfJ8n3h0R+v/iTuVOkm4BKyjvsOOKYaERIsAlOtL4RekqPUcvuKXxvZ0r0+jhoWR9w6COVcq5jg== + integrity: sha512-8aj3oKi3uSI4WFPmkBMt1sySlwnRvY7v1oEhtzWzbRCRhDZvSeqZ9OjzSj9zIh+XE8s8bL3Tsc62kpfBdrpzGQ== tarball: 'file:projects/rush-stack-compiler-3.1.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.2-library-test.tgz': @@ -12607,7 +12618,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.2-library-test' resolution: - integrity: sha512-55IVFkfBXuP0F/vnoep1IgHyNyKaQmhyizwzsJOD0HimOcQgdGFJjTM78JwIAJ0sSjE/VFtLrzgMfdXaZcHpSQ== + integrity: sha512-jlsp7HEXMw/Sn6c//hpjv1TZwG5hG6GBG0bZ2pwqC0v9dNxKOVjmZLyJQDlC4V/AkB2uPTnwmABe1ZTF4+flwQ== tarball: 'file:projects/rush-stack-compiler-3.2-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.2.tgz': @@ -12623,7 +12634,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.2' resolution: - integrity: sha512-2pnyX4ztXcsGi1MU+qQSYkAixvbuPE8m++f/swfzx6NmCpeUDW04xGvmhJd0zEGAmz/m4OJNUNL0cnRCI0PaNQ== + integrity: sha512-P0syfnvO6BRPu3sVrOHJROQif/+fPEUJlZtteSqRBM1zCOEJZ08HEZV22/4IcRnBSVHnvj7FFWlj8wymMt8Uow== tarball: 'file:projects/rush-stack-compiler-3.2.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.3-library-test.tgz': @@ -12633,7 +12644,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.3-library-test' resolution: - integrity: sha512-wI6xA92vRBYzwLf6XPjhCBG3GHgm5d9cLfcXbTGBPjUPf2OvO2UIoThTjpzj0M6e4Togzq/92LNvVU9BKOfHgQ== + integrity: sha512-FHmtkLFnM2+Dr4wKI9P7bQmMIHSJW93mF3Bwxm8cBSHKLHhJq98QX2GM5OR9zPj0yX8bZSDgX50SSLhI9eM3xw== tarball: 'file:projects/rush-stack-compiler-3.3-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.3.tgz': @@ -12649,7 +12660,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.3' resolution: - integrity: sha512-aKQ68jmk8I9dsgZgsPjkrrcMcwnnqsldV4hbfOC5sS/bU+SnQDnWf/yB2exPVOOQNcREm/k7loQNr1Rtq6Od2A== + integrity: sha512-9w7AgTiEb9Agf79J4OojrKlj/gxzJq7MK0249FllOsdTZTKHee/dXcOrPIculqis8Dv+eIZy5Pa/rae+cVnPpA== tarball: 'file:projects/rush-stack-compiler-3.3.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.4-library-test.tgz': @@ -12659,7 +12670,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.4-library-test' resolution: - integrity: sha512-jB9yt5V9KGMBKZOxM/m5ToRx05iru7Lyl+R35H91eXZeaxAh9+AJQqkLr4DRpjBlUr7E65rdU/PX1ipviuC1Bg== + integrity: sha512-HUsNfy49Tf67Npdw/cyG/pVlWhoy7gK5GsrRhmbwRsvA33V15cb7ysFGgtcGY4znXjh3EIelrcNPku8uqQcxTw== tarball: 'file:projects/rush-stack-compiler-3.4-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.4.tgz': @@ -12675,7 +12686,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.4' resolution: - integrity: sha512-uKE+rdbci95UTkFYes6/in4uqHw+KgDQVKyduQsQaHjo4QjLtqsSfoZdqiCHB2hOiUSnEX//DUP8B/hYPqW1Dg== + integrity: sha512-heMFO5MtgD3H9IBzSdOWYyw/LKC5+Eo2t/s+94MrpbkUxDmFV0LeU39ByonXhxJepNspSaRpl5QGXuYBK1Uyhg== tarball: 'file:projects/rush-stack-compiler-3.4.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.5-library-test.tgz': @@ -12685,7 +12696,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.5-library-test' resolution: - integrity: sha512-aS/KD27qxwtqf3DoxL8FOGYL4n0M60SqqwcTnIbcKsQSrqPkJgvLM6H25b2cZFetrqJ0G7+UbAfLGRz3yxU77w== + integrity: sha512-ZD0JWyoXjDdjTCbIUlIej1XbDK+DqVBNQIjDLBa5oWeumw1Xm5YlARYtBKY8V8eBCcXu+iusxce1jDG+McY6MA== tarball: 'file:projects/rush-stack-compiler-3.5-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.5.tgz': @@ -12701,7 +12712,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.5' resolution: - integrity: sha512-f+9GjlB9iS9mlK9irqXrPnOHUoW0F4yJ8ELKddDMgIl4t+6ghbFZWZd/nEThPrpXg+jlthiNEzCAbA1p4AIZeg== + integrity: sha512-x4UzicPgHiesZLUEBNJw8ifeWuw0XuKFc0jWCX2FBmHF/GaJgpkjwh89O+XrijMEqVCbK2eVD1lLHwMS6Vjj8Q== tarball: 'file:projects/rush-stack-compiler-3.5.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.6-library-test.tgz': @@ -12711,7 +12722,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.6-library-test' resolution: - integrity: sha512-C7AppePylD6ra5gVLzNn8PlPqr8N1WYoVs063Al6OYyM3X6Y3LHayx5Nwo7PtTAuMlLMcSnyA0ehCqacOVxPmw== + integrity: sha512-x1dleBqpSdWv3Q6iBNO0t3PHA5mZRXFwtxtWlb+9WlQ39yAX0jO0wZhb6SDY+WLz/wMEZhtzvBVskIKyRWGIzA== tarball: 'file:projects/rush-stack-compiler-3.6-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.6.tgz': @@ -12727,7 +12738,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.6' resolution: - integrity: sha512-sD9mh0bxNR59NYAqJFfGuxygXylJExWU7fweb9W18EA2oPFvXtp0xxhlEmc2E5D7Cb09wDZ01DeWuW1Y4oPgWA== + integrity: sha512-2HQ2jnE8oVzB62b07NNwfrNMuK31pVJClQLFTy+YQMorrN4O99HoQ2jiH19cHqe0eXDd7jErkngZb/HFxBqw8g== tarball: 'file:projects/rush-stack-compiler-3.6.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.7-library-test.tgz': @@ -12737,7 +12748,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.7-library-test' resolution: - integrity: sha512-eF6EZ7mJKXEppJxHwozf4Wd+5dBQOXt2OTE49+1dmZQ3EOfaMsvZMGVZsts2cR0qBpxRxtoCIdCS4Yvp8t6yKA== + integrity: sha512-FhWl8h3OkLYZhQVsIneW/VlFn3t7Ud6rITyfZU4izlMcr9Lbgc/BjrA3hTUcdZNAxitxv72VAQLFbrav/f78OQ== tarball: 'file:projects/rush-stack-compiler-3.7-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.7.tgz': @@ -12753,14 +12764,14 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.7' resolution: - integrity: sha512-iz62BYFkSDWqd/pGoiqu/yZ0o3FPIrjmP8jjDdIry0C5niJmcRvXxu7yBwl5vkOkAdxRzVzIjG5Jaz3A7RnSVw== + integrity: sha512-wAXFU469QXckKd9HjLi+GVUzLNQEJiyhnklanQV5wxCIihEYebKiR0pO3c6ngbMJJ2u1uCF7E5dKy3/zE+TnwQ== tarball: 'file:projects/rush-stack-compiler-3.7.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-shared.tgz': dev: false name: '@rush-temp/rush-stack-compiler-shared' resolution: - integrity: sha512-3DA+ZdhWSjTNrAVaC6G9AizudJaiO82PoNgCTQ/3PQ4g4J9xx6BrNv+sVPv/4h5ST2WQhdHiY9OW0/2xWDWY/A== + integrity: sha512-/ESo2NW0DtSk6Gnr6Mz6Fk4Js9b9g03E9CaTOKQ9oNJ0TTmADlf0J1X9J/mC0BbT7Mr+0sKOQlsizmvQ0UMSSg== tarball: 'file:projects/rush-stack-compiler-shared.tgz' version: 0.0.0 'file:projects/rush.tgz': @@ -12778,7 +12789,7 @@ packages: dev: false name: '@rush-temp/rush' resolution: - integrity: sha512-vFJN0QE+9/f8jEmZ860EJwJ1dIlIRacHSWsS9tyWvvPMXdVDaCY2LscEY/Or/j4ykaBuSq8jLYch3dwgw2b00w== + integrity: sha512-NnhG8kwgWT34PTFS/IEoCApapvtRJohUFdgP94UgEjOXRwH4MehXmoGA6XWy0OWiAUJPkAc1HxoFOjbLZvpMrA== tarball: 'file:projects/rush.tgz' version: 0.0.0 'file:projects/rushell.tgz': @@ -12791,7 +12802,7 @@ packages: dev: false name: '@rush-temp/rushell' resolution: - integrity: sha512-wnglr+80les1iH99ovZyyWYraleLtgfnlmariJDjO3pXMA8OIsZeDUB1bw3OgWO5iwyHIELlMeyylYm5wsHhYg== + integrity: sha512-bLunJ/+Ocx0wBZow15u48a8i3TYj56/czMCmS+to0oIGh6BMp90dHFLrlQZ1QLqeGTgkP+97qTRjYYjQDmxQrQ== tarball: 'file:projects/rushell.tgz' version: 0.0.0 'file:projects/set-webpack-public-path-plugin.tgz': @@ -12810,7 +12821,7 @@ packages: dev: false name: '@rush-temp/set-webpack-public-path-plugin' resolution: - integrity: sha512-X9EEFU4KfZ/gWj414QGJetKB27Ymoy2Vh6eljj++18FiqSIbm47GCyYoG2Si/z50NE24NeLZPGlUg7V9qA0RHQ== + integrity: sha512-C9QJuBPRvPtDd4zDjx2iECw3qF87r4ajdQ1iwE0no3ZEjJ2JNq5dzNsWQIwODF+lnRIZMrhcZMMwJc6abs9tCw== tarball: 'file:projects/set-webpack-public-path-plugin.tgz' version: 0.0.0 'file:projects/stream-collator.tgz': @@ -12825,7 +12836,7 @@ packages: dev: false name: '@rush-temp/stream-collator' resolution: - integrity: sha512-MOiVvKeiunyw6QF7x5Ti1XSDVNcDz6WI9ZtDPjqVCuPPGuhlC3RdShj+uRKCM/eGIulQ3Z4nLDIjPg6QXvYVww== + integrity: sha512-G6wkwmIJm4ctetqGMsk5gFcBdLE/mz3Ez969c94LbmEO9eVATlgUAtD6yzKJCqCftiqz2UY+xB9Srh7vH8e9/g== tarball: 'file:projects/stream-collator.tgz' version: 0.0.0 'file:projects/ts-command-line.tgz': @@ -12841,7 +12852,7 @@ packages: dev: false name: '@rush-temp/ts-command-line' resolution: - integrity: sha512-swS3RsDJWBig5w1dsxSOh25SmLrUmiCDocjn5+v0dJRyYYWapciSDZAbHKvBZt8qvOOp2LIxdmG+uLscPdWsRA== + integrity: sha512-gCyLGYctiU6FrjEyfOdsszoARGldeCU5Xpib5J2WmhyutggdzUKkl5T6zIdGSLHGkgzGuZhUAvE3yCEaFSVX4Q== tarball: 'file:projects/ts-command-line.tgz' version: 0.0.0 'file:projects/typings-generator.tgz': @@ -12854,7 +12865,7 @@ packages: dev: false name: '@rush-temp/typings-generator' resolution: - integrity: sha512-xEsjhfmkSJN2/noguMF6JjLLNEFeAq11m2Z4rudZCQ2ci3fuFyPu4pjXQdlcV2fj8OblhcNG+5Zppe2vuXCx1A== + integrity: sha512-JqeX9NgZO8DBaBukdNvaufsT7dKpn5G2dDuwdw5lJ019Gw2+UNXgJluDz36OXJ2/GlQ5d5juFpuJTkNWQis01A== tarball: 'file:projects/typings-generator.tgz' version: 0.0.0 'file:projects/web-library-build-test.tgz': @@ -12866,7 +12877,7 @@ packages: dev: false name: '@rush-temp/web-library-build-test' resolution: - integrity: sha512-riChd+XLc6SgkTa3F/JnlGPpotEg5G8HUD5emTnut/TES/8ZfPv9JCUs0Alj9+9zff9dzKQzoyUOtzr7nnFZNg== + integrity: sha512-Pqd+aedwUHPEbAL+UWNHD6XFQRs935xJdHG7nb/1W6QNspzrmTOC9G9BePeaTWXOdjZh91zCfkG+fSdyHC+Z6g== tarball: 'file:projects/web-library-build-test.tgz' version: 0.0.0 'file:projects/web-library-build.tgz': @@ -12878,9 +12889,10 @@ packages: dev: false name: '@rush-temp/web-library-build' resolution: - integrity: sha512-Wj4BXEHuZYUpgfJv6FndgcsYmAPEIJlfXMk43djaBK6iAPWJQGyo6MM9aJ24P126slwBtDrPiXWZMooYFDvm3g== + integrity: sha512-yTjFZ2MNIeJG+MyW/BhGYiR7E/Ju3QMR0dyBVI//hQMnSDjAkrtZFm7v+1rqK4a4kc4Pjo6zsFaOPgYFvVQcJg== tarball: 'file:projects/web-library-build.tgz' version: 0.0.0 +registry: '' specifiers: '@microsoft/node-library-build': 6.4.5 '@microsoft/rush-stack-compiler-3.5': 0.4.4 @@ -12899,6 +12911,7 @@ specifiers: '@rush-temp/api-extractor-test-02': 'file:./projects/api-extractor-test-02.tgz' '@rush-temp/api-extractor-test-03': 'file:./projects/api-extractor-test-03.tgz' '@rush-temp/api-extractor-test-04': 'file:./projects/api-extractor-test-04.tgz' + '@rush-temp/api-extractor-test-no-report': 'file:./projects/api-extractor-test-no-report.tgz' '@rush-temp/debug-certificate-manager': 'file:./projects/debug-certificate-manager.tgz' '@rush-temp/doc-plugin-rush-stack': 'file:./projects/doc-plugin-rush-stack.tgz' '@rush-temp/eslint-config': 'file:./projects/eslint-config.tgz' diff --git a/rush.json b/rush.json index 7d36c6795f0..db0ba88f592 100644 --- a/rush.json +++ b/rush.json @@ -461,6 +461,12 @@ "reviewCategory": "tests", "shouldPublish": false }, + { + "packageName": "api-extractor-test-no-report", + "projectFolder": "build-tests/api-extractor-test-no-report", + "reviewCategory": "tests", + "shouldPublish": false + }, { "packageName": "localization-plugin-test-01", "projectFolder": "build-tests/localization-plugin-test-01", From 64e2c664641a3f033333a1c7bee20106b4e04111 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Thu, 2 Apr 2020 09:48:23 +0200 Subject: [PATCH 08/32] fixed version missmatch. --- .../api-extractor-test-no-report/package.json | 2 +- common/config/rush/pnpm-lock.yaml | 176 ++++++++++-------- 2 files changed, 99 insertions(+), 79 deletions(-) diff --git a/build-tests/api-extractor-test-no-report/package.json b/build-tests/api-extractor-test-no-report/package.json index f5ad95c7da3..5179f8002c1 100644 --- a/build-tests/api-extractor-test-no-report/package.json +++ b/build-tests/api-extractor-test-no-report/package.json @@ -9,7 +9,7 @@ "build": "node build.js" }, "dependencies": { - "@microsoft/api-extractor": "7.7.10", + "@microsoft/api-extractor": "7.7.12", "api-extractor-lib1-test": "1.0.0", "fs-extra": "~7.0.1", "typescript": "~3.7.2" diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 6fda61171ee..3ffebb49a2e 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2,7 +2,7 @@ dependencies: '@microsoft/node-library-build': 6.4.5 '@microsoft/rush-stack-compiler-3.5': 0.4.4 '@microsoft/teams-js': 1.3.0-beta.4 - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@pnpm/link-bins': 5.1.7 '@rush-temp/api-documenter': 'file:projects/api-documenter.tgz' '@rush-temp/api-documenter-test': 'file:projects/api-documenter-test.tgz' @@ -148,7 +148,7 @@ dependencies: eslint-plugin-promise: 4.2.1 eslint-plugin-react: 7.16.0_eslint@6.5.1 eslint-plugin-security: 1.4.0 - eslint-plugin-tsdoc: 0.2.3 + eslint-plugin-tsdoc: 0.2.4 express: 4.16.4 fs-extra: 7.0.1 git-repo-info: 2.1.1 @@ -361,6 +361,15 @@ packages: dev: false resolution: integrity: sha512-XSwH2Gs+oPDom9BDFfH8Y+x440m1aKE9dvRmjJyNgakOBevLeEg+ELcrhC93gyf+bH9Ah8vGtC0CmpH9EvWdhQ== + /@microsoft/tsdoc-config/0.13.3: + dependencies: + '@microsoft/tsdoc': 0.12.19 + ajv: 6.10.2 + jju: 1.4.0 + resolve: 1.12.3 + dev: false + resolution: + integrity: sha512-6v2JUsfQIr2KStZgRusIuJmNvXX/xZMkzXA9YKY99hpj7uuAeAsHeKTe07D8t7hKlz79qCZMmg6ptJ55dYP9Xg== /@microsoft/tsdoc/0.12.14: dev: false resolution: @@ -369,6 +378,10 @@ packages: dev: false resolution: integrity: sha512-3rypGnknRaPGlU4HFx2MorC4zmhoGJx773cVbDfcUgc6zI/PFfFaiWmeRR6JiVyKRrLnU/ZH0pc/6jePzy/QyQ== + /@microsoft/tsdoc/0.12.19: + dev: false + resolution: + integrity: sha512-IpgPxHrNxZiMNUSXqR1l/gePKPkfAmIKoDRP9hp7OwjU29ZR8WCJsOJ8iBKgw0Qk+pFwR+8Y1cy8ImLY6e9m4A== /@pnpm/error/1.1.0: dev: false engines: @@ -3652,6 +3665,13 @@ packages: dev: false resolution: integrity: sha512-pYvYK94ISH9jKHgLjKlHZ9iFvXUsy4jQ944q5Cmp3kr7tAXH4MqJFfefGc47y6K7aOaGnKowGzeeoe1T4oQ1Mg== + /eslint-plugin-tsdoc/0.2.4: + dependencies: + '@microsoft/tsdoc': 0.12.19 + '@microsoft/tsdoc-config': 0.13.3 + dev: false + resolution: + integrity: sha512-iUHb4SkithNERIfrHGWAdsR0cjHplF9F9Mop4cnDSplAw/0oKyPb9eDjcqwFfO4E2pz+JLv24TzgM7gFAGqO9A== /eslint-scope/4.0.3: dependencies: esrecurse: 4.2.1 @@ -11810,12 +11830,12 @@ packages: dev: false name: '@rush-temp/api-documenter-test' resolution: - integrity: sha512-y/grzsT4wCktTYS0kAR2NwZgrMrS3+A2QuJARXYRZb4UaYhLJOCh6YsP2nBjcUmUWc6a4xJJPayGpYfIfmeFfg== + integrity: sha512-vrCebZGZdW9BQr87blPMXZZrSsNGNb1Kr9GP5UL+xZjcGhoVxyCsaspN/TwNNX3HiX2UwKke+Q5lu3D+OMt2fQ== tarball: 'file:projects/api-documenter-test.tgz' version: 0.0.0 'file:projects/api-documenter.tgz': dependencies: - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@types/jest': 23.3.11 '@types/js-yaml': 3.12.1 '@types/node': 10.17.13 @@ -11828,7 +11848,7 @@ packages: dev: false name: '@rush-temp/api-documenter' resolution: - integrity: sha512-Hvwd5eVsMRgoxcts/VZCjHBypZ+MFeslOLZg8bhptizgPlEiEkmKy5p5+I4Mb/TaVLo4Q4X09DskHAXxfACnbQ== + integrity: sha512-5LMna9kIwmYjBLsm/jYYLi+R34MWcWbb7qz3ch9/79VatTAqISzVbcsMnEzU1P+lDQqhfrmESxZw/bvNKplLTg== tarball: 'file:projects/api-documenter.tgz' version: 0.0.0 'file:projects/api-extractor-lib1-test.tgz': @@ -11840,7 +11860,7 @@ packages: dev: false name: '@rush-temp/api-extractor-lib1-test' resolution: - integrity: sha512-yWObOk8ypI+eyEFbPdoezwhH2Lkz4OkFHogffwfBl2s55Y1Of9y6TKhn0R3qeeHx3IlywY9gpq5B5kVGivQe2w== + integrity: sha512-jh1IesMLl04jEkKug6RhTUjCSm+kOMvm4lYcJfsv3SrpHjNR/1UZEzUpJBPefWKi5p+ZF5kZiCphMYUCcWhlPg== tarball: 'file:projects/api-extractor-lib1-test.tgz' version: 0.0.0 'file:projects/api-extractor-lib2-test.tgz': @@ -11852,7 +11872,7 @@ packages: dev: false name: '@rush-temp/api-extractor-lib2-test' resolution: - integrity: sha512-HszIRlFg/xxXVRAMLaE+V42wKZCubFm/9Ts40xdVCgb1eHB9GQ9T0WBdHJkS3GbVLxdmRE+lnDuPb05FCELedg== + integrity: sha512-z6+stvrMxqj3wpnrW30RPUzfbUQhWDAUyYCGrqPBwjff9dWlJndp1MEmyqb2m6XbXHVldVhe/4vO5yoZ2qsueA== tarball: 'file:projects/api-extractor-lib2-test.tgz' version: 0.0.0 'file:projects/api-extractor-lib3-test.tgz': @@ -11864,21 +11884,21 @@ packages: dev: false name: '@rush-temp/api-extractor-lib3-test' resolution: - integrity: sha512-dQE2OCKumTb3l3Dzqx1CsB4oJo4HTuoheEZZGzTPslhTqSGGHnG7TcEG9Kb4Zrz+dRluwdiRth/VjK6WZzDTDg== + integrity: sha512-anp3vTUrf1L+H5GoYh5ESkfSjEj7cvB3/agJjoXsyX2nYQWJnGOXwb0Rf6v4cb+zqPP9ACkzkAQRcfCNgwoWlw== tarball: 'file:projects/api-extractor-lib3-test.tgz' version: 0.0.0 'file:projects/api-extractor-model.tgz': dependencies: '@microsoft/node-library-build': 6.4.5 '@microsoft/rush-stack-compiler-3.5': 0.4.4 - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@types/jest': 23.3.11 '@types/node': 10.17.13 gulp: 4.0.2 dev: false name: '@rush-temp/api-extractor-model' resolution: - integrity: sha512-OHqbMuIwf1zK7mUz3pZmZO+UqGLMNsWryaOH9Ny7CcnsY4Dt7F/C8LSClYBSOaUbLpsO0VDJatA2lwUA8DSNgg== + integrity: sha512-JZiaeYTBiRT4IgJWMLRjO3L32Wj4Mkf3FiWzRR6yyB6iVSU+7yuhT+Dj88MCBmfAR3ox389Cdtf7QwG+1oIBKw== tarball: 'file:projects/api-extractor-model.tgz' version: 0.0.0 'file:projects/api-extractor-scenarios.tgz': @@ -11892,7 +11912,7 @@ packages: dev: false name: '@rush-temp/api-extractor-scenarios' resolution: - integrity: sha512-ixVM5zWa3ppPUoTwd3iwsZW6GBKALD8mI0JlJ8lD2GHBYWxjjc9KunPHTfJkaiaRzSi4eyvigepHU8ZAA7qeSw== + integrity: sha512-KfKZoWNqV8+4phtTLcG0a2AcQdPJkgWgUzRCQfXqZmUOxof5HA1tk4uebXn9CYaAnQxuQvYtaDugPsy93yQCZA== tarball: 'file:projects/api-extractor-scenarios.tgz' version: 0.0.0 'file:projects/api-extractor-test-01.tgz': @@ -11906,7 +11926,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-01' resolution: - integrity: sha512-PS/VBWdISrPbioLEbtkpfAoO+mZvzbaKHsjacN53X3XxPZIKTSrW48BqLoQ6RdUCn05wNB7PD/PxrEsu0f9gNA== + integrity: sha512-+mSryAXgDudtQ6j4NSReNGBO41QL8Ea3fZxfTk09UFbiuDb+vVce9Lcn96Bhs1WjIu4Lx6v3LEugIP3+Wk6q9A== tarball: 'file:projects/api-extractor-test-01.tgz' version: 0.0.0 'file:projects/api-extractor-test-02.tgz': @@ -11919,7 +11939,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-02' resolution: - integrity: sha512-hIFaofNb9/ox8CeCRcbN2YZnTo8RmE5zVEqYwGmNX7mm9xwGN0UJfVB4lYRUT1kwUDLzR3a0rNsG8Ooiln2qsA== + integrity: sha512-rW2B3zf3gfvjQVTUk8JGz0cmKB0Os4PNVOHt/QmKZPT/aprGU4TkFW8A14psc0EdMg9mDOjRDDkgdxE93kN1hQ== tarball: 'file:projects/api-extractor-test-02.tgz' version: 0.0.0 'file:projects/api-extractor-test-03.tgz': @@ -11941,7 +11961,7 @@ packages: dev: false name: '@rush-temp/api-extractor-test-04' resolution: - integrity: sha512-AA7zu/aWU9kPjOyUuZa/xrfk6XYiMQ6O3vsHXwqlpsJOcojapiFN/xl4baA5EdCehyFKS4x6is2SrUfg1ye7zg== + integrity: sha512-K4QeNMtB2L41QSa+cIZb48ZIKRkboF3/M+o9PMLYO7uILe67Wo0F+mm57P5ms2JGrqjlyPZTsIo9wpMCuxeEdg== tarball: 'file:projects/api-extractor-test-04.tgz' version: 0.0.0 'file:projects/api-extractor-test-no-report.tgz': @@ -11951,14 +11971,14 @@ packages: dev: false name: '@rush-temp/api-extractor-test-no-report' resolution: - integrity: sha512-8MKXDKoKinqAGMWlE4UzvkF6Ymzwl9nsl8SlNq62CoTMNxUxDmiFl9NJOqE6YABYsVL5ZvSBeyhVY/1WA9Vxxg== + integrity: sha512-UEryMIT/TLb6MW6dOmHpCIMjQw+caE+Twu9wllw5OZm6EsblUDGmq0XOkgb8vqNXQO7BVEz5psL+gr6Uq+aaNg== tarball: 'file:projects/api-extractor-test-no-report.tgz' version: 0.0.0 'file:projects/api-extractor.tgz': dependencies: '@microsoft/node-library-build': 6.4.5 '@microsoft/rush-stack-compiler-3.5': 0.4.4 - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@types/jest': 23.3.11 '@types/lodash': 4.14.116 '@types/node': 10.17.13 @@ -11971,7 +11991,7 @@ packages: dev: false name: '@rush-temp/api-extractor' resolution: - integrity: sha512-rcEO5AwIftC3DrUReufxQkfpvOpOkChkM0tZQKvrZU8e6nCU71krcgbgEJvqK/e2NSA8FpETjkbxvzXvhZ1clA== + integrity: sha512-erPP0nxgC2oASVZb+tKI3frE4o1+Yr4puYfyBbcO1Sia1cduH3jGKWNq3WPMlVOf6QWJyt0gJt8mtGRO2VBNhQ== tarball: 'file:projects/api-extractor.tgz' version: 0.0.0 'file:projects/debug-certificate-manager.tgz': @@ -11986,12 +12006,12 @@ packages: dev: false name: '@rush-temp/debug-certificate-manager' resolution: - integrity: sha512-2gvCrBuoTdsEO01Vw7FP/Z7rK2ERuF6OF7cTaAWbXHu2UEa9XqsvTRHpo9TIeem/fSB9PKM08DQltPPzrmaiMg== + integrity: sha512-GCQqojOxe53o84zGKYSOlxSqz4JnmA2PHdqYkJypKe7nLnCjHJcLmg8DUBcaTnop0MggFHdsWJnw7yYBfOkj9A== tarball: 'file:projects/debug-certificate-manager.tgz' version: 0.0.0 'file:projects/doc-plugin-rush-stack.tgz': dependencies: - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@types/js-yaml': 3.12.1 '@types/node': 10.17.13 gulp: 4.0.2 @@ -11999,7 +12019,7 @@ packages: dev: false name: '@rush-temp/doc-plugin-rush-stack' resolution: - integrity: sha512-B5gZQqoSUwk4L3ToEZObhdiKmDhebVi3b3eoJqJXCrYQzbEKlNgODo2M45FjpGO0aIH/CyWRvwLg7nL5+/56EA== + integrity: sha512-EbKRnxdQURfCHlfXj7+5MWk7RnLQn+bhrNknGzL26ssZPo7twIne2UwckEbUaTp4oS4/bLuzRsCLQsvWiX+wFg== tarball: 'file:projects/doc-plugin-rush-stack.tgz' version: 0.0.0 'file:projects/eslint-config.tgz': @@ -12012,12 +12032,12 @@ packages: eslint-plugin-promise: 4.2.1 eslint-plugin-react: 7.16.0_eslint@6.5.1 eslint-plugin-security: 1.4.0 - eslint-plugin-tsdoc: 0.2.3 + eslint-plugin-tsdoc: 0.2.4 typescript: 3.5.3 dev: false name: '@rush-temp/eslint-config' resolution: - integrity: sha512-gUIH2uS4R7skvBk55sagvt7cTLaiahHTI18Sn5feSSKbo9xZ8aRnjNw8dMTlGVWNdjoRJSjRV0lZGn26FvU3pA== + integrity: sha512-NCvbX0gN+a+ACcTv6Aetjc2pjTd2PjfjdTLx6w4U36yc0Q46k1D0sF7fe79k7OtgTus9uekO/rw9QFDU7OulJg== tarball: 'file:projects/eslint-config.tgz' version: 0.0.0 'file:projects/eslint-plugin.tgz': @@ -12043,7 +12063,7 @@ packages: dev: false name: '@rush-temp/generate-api-docs' resolution: - integrity: sha512-gNxomXYQVXx/YdxhJDvMUgfzR9F3z2dOLKxq8qyDjW2zYjSuwX/l3Oype7PRg1V/IpYwUGoYKF0ayskEjZjYOg== + integrity: sha512-q5a2GCLoWb+NLvXLo93KePzZi2eGwn4WT8h6yI/7SCduw401x/Wr7pofOJskm5jY8GNhyu0JEsAzS0Ugukx8HA== tarball: 'file:projects/generate-api-docs.tgz' version: 0.0.0 'file:projects/gulp-core-build-mocha.tgz': @@ -12064,7 +12084,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-mocha' resolution: - integrity: sha512-qVUrGic4cESplVC0SUhraKorCPgnSKaC2p3e8m2hBwi2RS1KHxOF4NWKUeXw+KF/tgRhaD2KGGchK/41pScmHw== + integrity: sha512-fxf7zR4iwz+776FFP4OkNAux9Ml08nvpoYBa+97ILO9ky8yadh7ktzaIUTy9sQeS7TryIZgLGu9mWMnNSVZpLA== tarball: 'file:projects/gulp-core-build-mocha.tgz' version: 0.0.0 'file:projects/gulp-core-build-sass.tgz': @@ -12086,7 +12106,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-sass' resolution: - integrity: sha512-kKpknzxwaPZQPXeI9/zBiRG6hKrpIjIDjBBtTff2blsvKrsTZ6uDGPvEWLUGG7y45RStdLuhHSLxNoWPQeAA3g== + integrity: sha512-MC4wglv5KcZHaWimCExyRVQ9Hi5gA/jI5b1/gZlb+PwdNrxrjvYHPQmWosLJn75ftpY4e8yeFMED/6U7EXo49Q== tarball: 'file:projects/gulp-core-build-sass.tgz' version: 0.0.0 'file:projects/gulp-core-build-serve.tgz': @@ -12109,7 +12129,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-serve' resolution: - integrity: sha512-GfFU+r5DLxwoZQGnRbfka/8yfypdzdQHxnqcanqcvO+zG9+7ARkxwj64GLT2b71KR1Wp/UK6vsmpq9iO6BS+0w== + integrity: sha512-03Z/fUC9jJm/mC8y6viGRynRMEel+9I806d7T60QqNWER7ljSvZjAODmyio8HbOwf8i5FSQIw04s+3SgVFoLoQ== tarball: 'file:projects/gulp-core-build-serve.tgz' version: 0.0.0 'file:projects/gulp-core-build-typescript.tgz': @@ -12128,7 +12148,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-typescript' resolution: - integrity: sha512-1/aJJ6dAo1uQaRPhc7BtIqxymOzDp/gBKBjf2y/+UqZGWWoYWDPoFlhcUDOahJI0dhSQkjnw5ttQZu79B+JLJg== + integrity: sha512-TqwU5LJV4bkBJ+SElvVlI6+c+dibs3Li8LTug6GgugI6WBo8JEG5VBJQdlZlLgKxFCT0vTJYEacCfmA4eGbY4A== tarball: 'file:projects/gulp-core-build-typescript.tgz' version: 0.0.0 'file:projects/gulp-core-build-webpack.tgz': @@ -12146,7 +12166,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build-webpack' resolution: - integrity: sha512-6JDrBjcVhPG8+S3/2nlbgiphmNWId4Cid6vgpFYPkurIw5MhQyan3cDjKt81bE5mXApdSnAi+SscTxpZUH+Opw== + integrity: sha512-j9sGCTi8B86qrmKxwL++ktwf7SwVScunuu4terIiWMDe+gMV65RWgR7VBfc6qQLMvk17/Y02Td87DDg6N4q7hQ== tarball: 'file:projects/gulp-core-build-webpack.tgz' version: 0.0.0 'file:projects/gulp-core-build.tgz': @@ -12198,7 +12218,7 @@ packages: dev: false name: '@rush-temp/gulp-core-build' resolution: - integrity: sha512-TBJ5pKoXyHPiS6N7O3sRjoKQT6Hi8QWyUaaAsk+XkSeTuebXQlErQmJAylG9tYo0pfK2LUX1s2x1WjM2ld8Pag== + integrity: sha512-1USmgziInF+TIXaHZE+o6QZ5glFMkOStmoyIJY9aX884UU+mNFjBiU1EeIbUNzmDKAmmAxE/sAEB38oKNsgWNQ== tarball: 'file:projects/gulp-core-build.tgz' version: 0.0.0 'file:projects/load-themed-styles.tgz': @@ -12211,7 +12231,7 @@ packages: dev: false name: '@rush-temp/load-themed-styles' resolution: - integrity: sha512-Px7WgHzBIP9JHvoWBTJTDVrqFG48czl0odQveA9NyDd36tPWF9llqUooZhYEdS3Wa1V+QkSOaoHNTtLcKBlFHg== + integrity: sha512-vHAJsWsHIUYoiIHkGS0MZ7PVAmBhIEyTF8u15/0JrzpExFzfyfa2jeLgY0OJTLJa0UW12DA+0e7gKlL6dQL60g== tarball: 'file:projects/load-themed-styles.tgz' version: 0.0.0 'file:projects/loader-load-themed-styles.tgz': @@ -12226,7 +12246,7 @@ packages: dev: false name: '@rush-temp/loader-load-themed-styles' resolution: - integrity: sha512-F5EAjysmtnbrZtm8H+Ff7+hyPFE6FstXx0GaIS86tUxeVlb0RPOqX17YDo8eiURKn7MEczI+a0w5ncNxULaHKQ== + integrity: sha512-0WIUF+C52kGw2ppRPaEXKnC78qmzZYVhBQyyKhxxrezNradWeUTlQEMcewMfjlR/Y8ETbi3pW6IIG3YvmPK9BA== tarball: 'file:projects/loader-load-themed-styles.tgz' version: 0.0.0 'file:projects/loader-raw-script.tgz': @@ -12240,7 +12260,7 @@ packages: dev: false name: '@rush-temp/loader-raw-script' resolution: - integrity: sha512-7pv2jKJawO+Xgl0I3NeUAtwyR8Sj5gP2qzSCd2icEVIoRTpuso12GyBw0/Bi9IQMVoqCqfH5WcCi/KsBH+RIkA== + integrity: sha512-qLbo2Fx1Q3NS45NgpTMJFpfwXeFW2iiRcNZ4WL+Zhx5kmcBPPswC4+mIE0oehvSk4Ng61P4KV5zt8iQiAZ4SgA== tarball: 'file:projects/loader-raw-script.tgz' version: 0.0.0 'file:projects/localization-plugin-test-01.tgz': @@ -12255,7 +12275,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-01' resolution: - integrity: sha512-rQeaXK9WMAtzCX1aguuhwybBnT0s4yG3IYxjWVwdOJRihQC4JUmRkiGSrwWp8FrEn8rEKMJs50+/9R5dQc2r3g== + integrity: sha512-7LcdwcgEorVX0KXkRq261GNaMvr/M7oB/yJWmIe2a6z1ojvGTLEqo4TXMoD4qc1sa6v5BlFmQovzL09aQnTQfQ== tarball: 'file:projects/localization-plugin-test-01.tgz' version: 0.0.0 'file:projects/localization-plugin-test-02.tgz': @@ -12272,7 +12292,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-02' resolution: - integrity: sha512-Or7nEdm+YSzPqvSZhSGwG+BCXyanthGlAFcRpGfOvLeMv5iaRLl5IBwgrxObaRBKQZ6ZZYhQZINH9dvoZnPP5A== + integrity: sha512-pq3YlLKVcW8pfOWGPykx9+VoqXb8DrtC7GynH4urcBA05zBk0CIIYRiQUN0BIDviD/chIT2jXGeAYAEmDkAWoA== tarball: 'file:projects/localization-plugin-test-02.tgz' version: 0.0.0 'file:projects/localization-plugin-test-03.tgz': @@ -12287,7 +12307,7 @@ packages: dev: false name: '@rush-temp/localization-plugin-test-03' resolution: - integrity: sha512-oRWFyOalOx2dO208LQ9b6uAzQPsxqv2bYbOlQMA+WFZ+6nH5yQQ/Zyi1V5tcxnVSo3DTxgE9z06a2sRbkfIKvQ== + integrity: sha512-AWaZlF6L7/duquvBWlcqpPWNiBaCL5NjFSXPz+yErFNGogC7AZGZqOJSGOwN6M1kC12uNINGxBrgqoonIeFJ8g== tarball: 'file:projects/localization-plugin-test-03.tgz' version: 0.0.0 'file:projects/localization-plugin.tgz': @@ -12310,7 +12330,7 @@ packages: dev: false name: '@rush-temp/localization-plugin' resolution: - integrity: sha512-0DXgSamzqT3UUNvfwLFfKuiwluQlf7g7Ug2xqbqqme2DdSRzdis5dPW7b0e8OxQdTKf6F6b9pJu5Pbfe8DoWlA== + integrity: sha512-mnTQbqCqXqIKfnt3bPGmG3ZUs4NT3GK7LASaLC+CzBMtsRbdP73i7Amhr9Ad0GWLbGzSKwOmSCXH0nSJvS66EQ== tarball: 'file:projects/localization-plugin.tgz' version: 0.0.0 'file:projects/node-core-library.tgz': @@ -12334,7 +12354,7 @@ packages: dev: false name: '@rush-temp/node-core-library' resolution: - integrity: sha512-mNaK1wPSR84IeP439aCMWWc0k8Jdsj5r0MX3dueMVZgVSaU9h0QpIFFhlkJW3d777p3KjguB/EHcoKIW7USDVQ== + integrity: sha512-FAdL3oJZXafVb1JPQREdDK/RbLj6Oyy9NmYiYJar7mb/EZJ9uVyPDlkpaURJaVSlsYIYESHcxrKu3ymslCMFkQ== tarball: 'file:projects/node-core-library.tgz' version: 0.0.0 'file:projects/node-library-build-eslint-test.tgz': @@ -12347,7 +12367,7 @@ packages: dev: false name: '@rush-temp/node-library-build-eslint-test' resolution: - integrity: sha512-ooS22KNoEzSpjdsxHI2t/Olr0lxy8zgZdm+qUoTVtUTgLNyDewJ8mnKL++OmYlDvVsRHl4bdyiTBXBMVZXzUvA== + integrity: sha512-MHLJvxc7T14Qi/u+SZSMeW0wYeZXTc05TFAWMp/1QElOHHifn2Vz4W2F7OhLKN423dY6U2SFF/IpU7GuwYsTPQ== tarball: 'file:projects/node-library-build-eslint-test.tgz' version: 0.0.0 'file:projects/node-library-build-tslint-test.tgz': @@ -12360,7 +12380,7 @@ packages: dev: false name: '@rush-temp/node-library-build-tslint-test' resolution: - integrity: sha512-AXsCUFwuemYxjULtfBjuBu0h9LMTjQiUUgAFSO4w1zQIn2qZZMCN41lQ4T7z3o3+dp4+OMiv+qz/zgPQ6+Scug== + integrity: sha512-l/Dr5AinLbJStIgILJh6otBizUs+Hg55Ap2fP5PjGqyGQePyibHz2CiGX+R87btIGORy8pYdAz+xYuI0tCeSGg== tarball: 'file:projects/node-library-build-tslint-test.tgz' version: 0.0.0 'file:projects/node-library-build.tgz': @@ -12371,7 +12391,7 @@ packages: dev: false name: '@rush-temp/node-library-build' resolution: - integrity: sha512-brxn7vy3E/UJda7FyBBmbF2td7UxVmXKxi9znjs0bBUIu8DFoQWf9+8G0hBjZmPuZh5hMXFyuY31SqQqLkwlzg== + integrity: sha512-U6Q0tQwezZo6dbBmt1Pkxco47xM8oozCjWePL+nE9UW2xw8tee2V10RuSiBD0GqtRQjP/+fufId4dQ03HIagRw== tarball: 'file:projects/node-library-build.tgz' version: 0.0.0 'file:projects/package-deps-hash.tgz': @@ -12384,7 +12404,7 @@ packages: dev: false name: '@rush-temp/package-deps-hash' resolution: - integrity: sha512-wdTfpUcyaA9l46+pcBNLLuU19QZuhHPkpTCWdJKfnbZXSuj7oSo1Z4R+ve3ttKTLp836f0Yu/uai4vrSA2IEIA== + integrity: sha512-K7R7QgMnZNFxVhvNq1gGLkH4j/nH7wMqsfR8u0dOLjm+RVWTkBAZZDckUy62MS3vpG+ts2Ju2Zu35VAK2pvpbw== tarball: 'file:projects/package-deps-hash.tgz' version: 0.0.0 'file:projects/repo-toolbox.tgz': @@ -12394,7 +12414,7 @@ packages: dev: false name: '@rush-temp/repo-toolbox' resolution: - integrity: sha512-oJo/54Pa7ndqm2NOT9RqD6NabB8c3agC0pIbcAx6l0YAdwtFomdFOKCM3VFbtDfCzpEWtqW6T6FMogixJ7bDMQ== + integrity: sha512-STlskauBzzuR5+fqPAlNgezb2FgosNOZlrJyIPRs3DahVbkndq6/clj4hXl92zaDJzh50ZNv5Qtdam/fnzZVHw== tarball: 'file:projects/repo-toolbox.tgz' version: 0.0.0 'file:projects/rush-buildxl.tgz': @@ -12405,7 +12425,7 @@ packages: dev: false name: '@rush-temp/rush-buildxl' resolution: - integrity: sha512-gbwFn3jiaNLbr3cKzI9tOxXlvg49/GpZwt0rUeBRh6HgABP4Kfdb2oIfwq+p+XVLMnXgERChyIx8jYqGuRs5Aw== + integrity: sha512-yi9bbNN/BsTA0Yj+q/27Gm8iAPK0di7Emsbrcid5HY6C0mXqvafY8YNGObVTNRR4MCDczwHjHDmqKYaoZeZNWw== tarball: 'file:projects/rush-buildxl.tgz' version: 0.0.0 'file:projects/rush-lib.tgz': @@ -12452,7 +12472,7 @@ packages: dev: false name: '@rush-temp/rush-lib' resolution: - integrity: sha512-IpICWQjJfIKEjUhqHwzCC8czQ1DIjR9igS2y8p58Qt6g7Fz7x+jUBifFJMK558PuCKTNzO+qoasqOl5HtxqaDw== + integrity: sha512-JbFY4Ncp8+GTW17w94GWX9NSZ2/6xSN/HzPGsX0tokzqyqIhHaIgHHOyhxGzomxH9PDz4ca5DMusSyg8yzobhQ== tarball: 'file:projects/rush-lib.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.4-library-test.tgz': @@ -12462,7 +12482,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.4-library-test' resolution: - integrity: sha512-r+61wynX/l1BQCqlb7wUJkUj/DEfnRFlaQXlxRHSbUMcj3wIZ4tFVWbpqjUMeodNFyKfNq4aSKl7ndUZe8yNzQ== + integrity: sha512-VTvDsDYpsYB8j2qStosoCVbMy3ZSzT5HyWVR88leHuQi7iLwu/XlLnMM50HaUhJLnaQSghsXxEt5NkUvRFriJQ== tarball: 'file:projects/rush-stack-compiler-2.4-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.4.tgz': @@ -12478,7 +12498,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.4' resolution: - integrity: sha512-OKG0UUxpmdS+5pxKFOnms3hIBXmHnJHVZrjUvMaEPvsq+hvSnTm7PWUzS5oqZHR4mea0v2gNswWG8HY+1lnpXg== + integrity: sha512-U4JYLnC11+evIcWLqmfK0LYZvmcCf7baorIy8FsmCVa26cbTd4YebU/gpdHLf7SF/bXOS9jjvFeZXy86zjkwFw== tarball: 'file:projects/rush-stack-compiler-2.4.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.7-library-test.tgz': @@ -12488,7 +12508,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.7-library-test' resolution: - integrity: sha512-yuuL5m1xujGAC1IpsKLgc+BT71K/n5CNeQqh2vjhOkCD7Z8SXw1S1muRqrMS8RZANp/2RmUpjCWW2QED9vk8rA== + integrity: sha512-pu/PWbTRRWSu2nEdeqOvmLHGdZOCU9AjJnbmWxohagTIMgv63xkhlj3BmmMpJ5c4b0nhoGeZTq5cgwjmY8JMkg== tarball: 'file:projects/rush-stack-compiler-2.7-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.7.tgz': @@ -12504,7 +12524,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.7' resolution: - integrity: sha512-fU1nZeHVEXjvYMiMl/l+T45JTlS1WXSSckvKMZTYlGEm+QkHt8AFgkdK/vTBgurV+q4jlj7E1wgv7VnVhhpM4A== + integrity: sha512-Q87PhPhWxrnGJkrTVICLRU75KzacQKLMEaVFxiMwU1jE5ZhMTMcXBRDvT5Nn6wQoY4oid5MoG+YAF3n0fCXCSg== tarball: 'file:projects/rush-stack-compiler-2.7.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.8-library-test.tgz': @@ -12514,7 +12534,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.8-library-test' resolution: - integrity: sha512-7Wlc10SfkL+R3EtY1ntD6RXZAwpQkgq9asddt5ExmAjMzyhP4mDAh24ARNvCjAssaMGBZJO2hBAA9D7O/zwQ4Q== + integrity: sha512-yeB2HuM4RJeJfGSElHR9vY+y/Wm7knZPOumE7HEKUQGtR0lPYzuoyulsgu2DFMLApOnabZ4hYY0jWKHXvvunWw== tarball: 'file:projects/rush-stack-compiler-2.8-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.8.tgz': @@ -12530,7 +12550,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.8' resolution: - integrity: sha512-4vijV5ByPHQ0a3W+4pPv8pQtJS8jLE3TEwoE/kGOWVZEjqytoz8FE4sGGdpigAqf9Sd33GOJrcsFe1ywcMbdjA== + integrity: sha512-jUySiOreNGRnLr+fVrJ3G96jMnA0JsQiZ8l6EQnqhKSeBqw/iZOTcZF6Z1qqoIWqMpDf0CFR6NGpF7QixCubSw== tarball: 'file:projects/rush-stack-compiler-2.8.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.9-library-test.tgz': @@ -12540,7 +12560,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.9-library-test' resolution: - integrity: sha512-V0fFOP9Lit3RL2OI2BlIjXuVg/4/J6jgR3my9MddSToMju9ILUcU9OVVjyZnvfRnynHbHGtvuUWuUYa+JwrmsQ== + integrity: sha512-2xLDK/QiKpWg4fPAm5IHOXQbb+TsQf9okvs1FD16Ih2kewcNV4i2h2f6crI+5/a/Ap/D2ExOa5lU3oxd5OIZ9Q== tarball: 'file:projects/rush-stack-compiler-2.9-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-2.9.tgz': @@ -12556,7 +12576,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-2.9' resolution: - integrity: sha512-93KGGVL6UtODnK1TBTR+nVKeuXcOVbjKFQSw94wn5A0wfUQn5fHMl2edjTZBo0ef1vBt/NHoQ7MJ/k3Yz4VZ2A== + integrity: sha512-pT2XQOJSccm0bola1kiWdBKiiLnn88ZpZRWQ/I7BZJu5o1omGxfJ1DJdbjfdJJ7OhmxwNM4oMIp/nI1CExJccw== tarball: 'file:projects/rush-stack-compiler-2.9.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.0-library-test.tgz': @@ -12566,7 +12586,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.0-library-test' resolution: - integrity: sha512-YJ45t+v1n3bhQWsuWPqCtfUVVHewuBnuUiPKCHkbZLh1vlQpJ0w+J2XcgwBnTCqv9U38H+aswOgF03xWUGBElQ== + integrity: sha512-KMg3wWNCTmq/dLqM0e1FUORe7TOKR/SQ7Fm21jL/v5Zyn5bKTqt5R3rS4+BnHKHiCxaXrQjmNKUNUT5BykjU/w== tarball: 'file:projects/rush-stack-compiler-3.0-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.0.tgz': @@ -12582,7 +12602,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.0' resolution: - integrity: sha512-MIQk6dGf4Ieq3d4atO1mszd4/Xnt0pWUog4USPHHdg1/FxI27h/BVP//Ci+YGIyQYUbH4fcgdZAgavlmHx8Rkw== + integrity: sha512-oOeAL5lEazzXoGFg/3ZV95RgZx9E+DBWoarVsIP4nsWNGIhJ0+u+hXPqrICwyGQvwMefvxDmuuTspTDiYl6hdA== tarball: 'file:projects/rush-stack-compiler-3.0.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.1-library-test.tgz': @@ -12592,7 +12612,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.1-library-test' resolution: - integrity: sha512-MZ3dT7k9zaf6MI9VvylZcdxKA3MGWhWhZjtRN3TZGkmrUSPb4pK+7gv+63ngtljomJ0hfMJ0GBvqHT7TNSCXaA== + integrity: sha512-Es9eW0Ku30vjPl6dtqAEQuLSoOYoye3T01OVyfzNewJSR6jcTpXoE1tnbbVdZGNF3tATHIzAfWsFHClNx/AQ9A== tarball: 'file:projects/rush-stack-compiler-3.1-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.1.tgz': @@ -12608,7 +12628,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.1' resolution: - integrity: sha512-8aj3oKi3uSI4WFPmkBMt1sySlwnRvY7v1oEhtzWzbRCRhDZvSeqZ9OjzSj9zIh+XE8s8bL3Tsc62kpfBdrpzGQ== + integrity: sha512-OOQFCJc27evF9vxQeuQMOK6gP0z3eOmpgR1REPBaBriJqZWqNZHQR+yQI02NCawXZI7BhG3ZH/fj9VOw139gyg== tarball: 'file:projects/rush-stack-compiler-3.1.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.2-library-test.tgz': @@ -12618,7 +12638,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.2-library-test' resolution: - integrity: sha512-jlsp7HEXMw/Sn6c//hpjv1TZwG5hG6GBG0bZ2pwqC0v9dNxKOVjmZLyJQDlC4V/AkB2uPTnwmABe1ZTF4+flwQ== + integrity: sha512-1jbbu/R0j9NpUdpCrn4Kf3g+hk2s8TOWSqOfVMekjcBAuFfepAcuO2AMm6BmQuTGPwm9dQYcPK/a1k7oIN7dag== tarball: 'file:projects/rush-stack-compiler-3.2-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.2.tgz': @@ -12634,7 +12654,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.2' resolution: - integrity: sha512-P0syfnvO6BRPu3sVrOHJROQif/+fPEUJlZtteSqRBM1zCOEJZ08HEZV22/4IcRnBSVHnvj7FFWlj8wymMt8Uow== + integrity: sha512-/ENkb34667diWfmWWoVrJ3aXPJ+miT6URVIQ4mCDnt0ugpOhUPpeQu5Pvc2yQtQtvN6+/0MJRFDQeBwo//RRqQ== tarball: 'file:projects/rush-stack-compiler-3.2.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.3-library-test.tgz': @@ -12644,7 +12664,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.3-library-test' resolution: - integrity: sha512-FHmtkLFnM2+Dr4wKI9P7bQmMIHSJW93mF3Bwxm8cBSHKLHhJq98QX2GM5OR9zPj0yX8bZSDgX50SSLhI9eM3xw== + integrity: sha512-bIMzNA4qC4FhtkjTss2Z6OEWCyUAHBDgYrJKT8Nkfrhwszg/bgIjd3si5KHK1lI5cGAlb4EPrQxk3NbLCwVBQQ== tarball: 'file:projects/rush-stack-compiler-3.3-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.3.tgz': @@ -12660,7 +12680,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.3' resolution: - integrity: sha512-9w7AgTiEb9Agf79J4OojrKlj/gxzJq7MK0249FllOsdTZTKHee/dXcOrPIculqis8Dv+eIZy5Pa/rae+cVnPpA== + integrity: sha512-wjBq4NPY3Hc/oRcb0fop9o3XCkc9e2minktLJfv0a0d21vmzO1HhkNrYb+Lfue3AQkoR1Byx62uVJQBPN4GNWA== tarball: 'file:projects/rush-stack-compiler-3.3.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.4-library-test.tgz': @@ -12670,7 +12690,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.4-library-test' resolution: - integrity: sha512-HUsNfy49Tf67Npdw/cyG/pVlWhoy7gK5GsrRhmbwRsvA33V15cb7ysFGgtcGY4znXjh3EIelrcNPku8uqQcxTw== + integrity: sha512-TlZTa4/CbDpjnGekcGItJwnnj3KHPeDUSNdx9MEJwaZbYSJYwNhgdOiL63S7Cux7B6LZktW5IbWp4rM1JtZlyw== tarball: 'file:projects/rush-stack-compiler-3.4-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.4.tgz': @@ -12686,7 +12706,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.4' resolution: - integrity: sha512-heMFO5MtgD3H9IBzSdOWYyw/LKC5+Eo2t/s+94MrpbkUxDmFV0LeU39ByonXhxJepNspSaRpl5QGXuYBK1Uyhg== + integrity: sha512-O7OGlF9xwlS8EVhPewEBWdxUJjP4DWfQWeux17k2eO3WLJKzrQb8101CFKgvoI2Cv1fKv1RGCzwVLII3Ri0hHQ== tarball: 'file:projects/rush-stack-compiler-3.4.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.5-library-test.tgz': @@ -12696,7 +12716,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.5-library-test' resolution: - integrity: sha512-ZD0JWyoXjDdjTCbIUlIej1XbDK+DqVBNQIjDLBa5oWeumw1Xm5YlARYtBKY8V8eBCcXu+iusxce1jDG+McY6MA== + integrity: sha512-KrIK0nbKeq7peNZU0ba1HGSm04euc4oiMwJlu7xXD8neGHFQ+Y7pjzzROpgN/lDe7UKvLbvVGCC/RUdjtTPcxQ== tarball: 'file:projects/rush-stack-compiler-3.5-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.5.tgz': @@ -12712,7 +12732,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.5' resolution: - integrity: sha512-x4UzicPgHiesZLUEBNJw8ifeWuw0XuKFc0jWCX2FBmHF/GaJgpkjwh89O+XrijMEqVCbK2eVD1lLHwMS6Vjj8Q== + integrity: sha512-XtD5Y65OZrSqCvInlxYfnB9RaBbUBBS9YyOTVkyhKrB6RdfaKVi2njHKopAHG9t8+rnKe7ifj4/OUkiQsxc5xQ== tarball: 'file:projects/rush-stack-compiler-3.5.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.6-library-test.tgz': @@ -12722,7 +12742,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.6-library-test' resolution: - integrity: sha512-x1dleBqpSdWv3Q6iBNO0t3PHA5mZRXFwtxtWlb+9WlQ39yAX0jO0wZhb6SDY+WLz/wMEZhtzvBVskIKyRWGIzA== + integrity: sha512-DawXTVELF889TaMFrk2Jw+567Dse2T6TTlWnN7EEd4b9d4WU7722+VW5ZuuaR24y7at45IsIc99b4Mo6BrDVjw== tarball: 'file:projects/rush-stack-compiler-3.6-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.6.tgz': @@ -12738,7 +12758,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.6' resolution: - integrity: sha512-2HQ2jnE8oVzB62b07NNwfrNMuK31pVJClQLFTy+YQMorrN4O99HoQ2jiH19cHqe0eXDd7jErkngZb/HFxBqw8g== + integrity: sha512-l3Cn3LPyo9eys3FfZ0dU5GU/HdrN3ojC2t6Aa/RjEByjLGN9MXKCppbV+Hy1AFPwtIiRiksc/hiRy2bDgkhxNQ== tarball: 'file:projects/rush-stack-compiler-3.6.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.7-library-test.tgz': @@ -12748,7 +12768,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.7-library-test' resolution: - integrity: sha512-FhWl8h3OkLYZhQVsIneW/VlFn3t7Ud6rITyfZU4izlMcr9Lbgc/BjrA3hTUcdZNAxitxv72VAQLFbrav/f78OQ== + integrity: sha512-zJmTnOjnTrQf55O3MqUPQBOG1n+KfLDlsVEzihmI5WHORbd/FbIQgsUxyVrmCrzoVHCgstZdpwEMKJhHPaOkjw== tarball: 'file:projects/rush-stack-compiler-3.7-library-test.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-3.7.tgz': @@ -12764,7 +12784,7 @@ packages: dev: false name: '@rush-temp/rush-stack-compiler-3.7' resolution: - integrity: sha512-wAXFU469QXckKd9HjLi+GVUzLNQEJiyhnklanQV5wxCIihEYebKiR0pO3c6ngbMJJ2u1uCF7E5dKy3/zE+TnwQ== + integrity: sha512-W8RsMmkI0TA/MSLcU9U0yM7PAlH4sX5T9j59PQQu3tXTMByBm/q7H6FnNUXFJYb1WmJH19BqC+iDsaB7LVtPOw== tarball: 'file:projects/rush-stack-compiler-3.7.tgz' version: 0.0.0 'file:projects/rush-stack-compiler-shared.tgz': @@ -12789,7 +12809,7 @@ packages: dev: false name: '@rush-temp/rush' resolution: - integrity: sha512-NnhG8kwgWT34PTFS/IEoCApapvtRJohUFdgP94UgEjOXRwH4MehXmoGA6XWy0OWiAUJPkAc1HxoFOjbLZvpMrA== + integrity: sha512-1TWxzS2gp+ir3rqKfQJAAveXk2pDREEN0tXwqKVJWIc1zxHwjKSLHikbOpFVqpy/GvaLD+6PtT/inevI+eTLvg== tarball: 'file:projects/rush.tgz' version: 0.0.0 'file:projects/rushell.tgz': @@ -12802,7 +12822,7 @@ packages: dev: false name: '@rush-temp/rushell' resolution: - integrity: sha512-bLunJ/+Ocx0wBZow15u48a8i3TYj56/czMCmS+to0oIGh6BMp90dHFLrlQZ1QLqeGTgkP+97qTRjYYjQDmxQrQ== + integrity: sha512-qcKtQH4MLhMcn2LWl3R1kTJERcf/pexR+MOamKhvra2mjXVTtuqBpgnns+po/iSEwkHPDGCmHfJrbbeCqRY54A== tarball: 'file:projects/rushell.tgz' version: 0.0.0 'file:projects/set-webpack-public-path-plugin.tgz': @@ -12821,7 +12841,7 @@ packages: dev: false name: '@rush-temp/set-webpack-public-path-plugin' resolution: - integrity: sha512-C9QJuBPRvPtDd4zDjx2iECw3qF87r4ajdQ1iwE0no3ZEjJ2JNq5dzNsWQIwODF+lnRIZMrhcZMMwJc6abs9tCw== + integrity: sha512-7caev29Z+DDRIucHyuF/FFBTQZZoStNkqRxhS0UBl8FEfaEhAkQB4gKI12EBG+DbpjPnAWqxCUrfJSjUVXm1gg== tarball: 'file:projects/set-webpack-public-path-plugin.tgz' version: 0.0.0 'file:projects/stream-collator.tgz': @@ -12836,7 +12856,7 @@ packages: dev: false name: '@rush-temp/stream-collator' resolution: - integrity: sha512-G6wkwmIJm4ctetqGMsk5gFcBdLE/mz3Ez969c94LbmEO9eVATlgUAtD6yzKJCqCftiqz2UY+xB9Srh7vH8e9/g== + integrity: sha512-7dCmflOTtJ0a8i8rR5wftZ+0arRT0OW4xn8no5Bfq2pYaZzx5l+aSUxkZFttHn/XBd5n4n5W1aOhYOV6rAvjcg== tarball: 'file:projects/stream-collator.tgz' version: 0.0.0 'file:projects/ts-command-line.tgz': @@ -12852,7 +12872,7 @@ packages: dev: false name: '@rush-temp/ts-command-line' resolution: - integrity: sha512-gCyLGYctiU6FrjEyfOdsszoARGldeCU5Xpib5J2WmhyutggdzUKkl5T6zIdGSLHGkgzGuZhUAvE3yCEaFSVX4Q== + integrity: sha512-YACzPThG22NnWNKHdA/1GNJRPvI5/6ErNOxj4yu6xgFDRAFcAbeW4LULUgdHLXi/z13d5VsFslMPXHT0WT8vZg== tarball: 'file:projects/ts-command-line.tgz' version: 0.0.0 'file:projects/typings-generator.tgz': @@ -12865,7 +12885,7 @@ packages: dev: false name: '@rush-temp/typings-generator' resolution: - integrity: sha512-JqeX9NgZO8DBaBukdNvaufsT7dKpn5G2dDuwdw5lJ019Gw2+UNXgJluDz36OXJ2/GlQ5d5juFpuJTkNWQis01A== + integrity: sha512-emdPyosQO1PVI4UcDDZLy1jCa7sHf88OSNCzW2voiii3qXaZ8ARwxOCcbvvxDTCUU8C6Kdk4fn/lz9Z05DQhGw== tarball: 'file:projects/typings-generator.tgz' version: 0.0.0 'file:projects/web-library-build-test.tgz': @@ -12877,7 +12897,7 @@ packages: dev: false name: '@rush-temp/web-library-build-test' resolution: - integrity: sha512-Pqd+aedwUHPEbAL+UWNHD6XFQRs935xJdHG7nb/1W6QNspzrmTOC9G9BePeaTWXOdjZh91zCfkG+fSdyHC+Z6g== + integrity: sha512-sIKJ2M2UmMzx1NQdcmci2cGHdzqxTMbGc52eFqj3NraKBX9KiyUQdylmj0dAqpfLdckiWTswlv8IzWrR+XUl0w== tarball: 'file:projects/web-library-build-test.tgz' version: 0.0.0 'file:projects/web-library-build.tgz': @@ -12889,7 +12909,7 @@ packages: dev: false name: '@rush-temp/web-library-build' resolution: - integrity: sha512-yTjFZ2MNIeJG+MyW/BhGYiR7E/Ju3QMR0dyBVI//hQMnSDjAkrtZFm7v+1rqK4a4kc4Pjo6zsFaOPgYFvVQcJg== + integrity: sha512-XFgJJXZIAfNQKyQc9R3M+MhkxDjrIFxGfh2yrg47xZkGzmSd0UhvkL1OAFzlYca6OoD5el2dtzxxKY0TGCP9mg== tarball: 'file:projects/web-library-build.tgz' version: 0.0.0 registry: '' @@ -12897,7 +12917,7 @@ specifiers: '@microsoft/node-library-build': 6.4.5 '@microsoft/rush-stack-compiler-3.5': 0.4.4 '@microsoft/teams-js': 1.3.0-beta.4 - '@microsoft/tsdoc': 0.12.14 + '@microsoft/tsdoc': 0.12.19 '@pnpm/link-bins': ~5.1.0 '@rush-temp/api-documenter': 'file:./projects/api-documenter.tgz' '@rush-temp/api-documenter-test': 'file:./projects/api-documenter-test.tgz' @@ -13043,7 +13063,7 @@ specifiers: eslint-plugin-promise: ~4.2.1 eslint-plugin-react: ~7.16.0 eslint-plugin-security: ~1.4.0 - eslint-plugin-tsdoc: ~0.2.1 + eslint-plugin-tsdoc: ~0.2.4 express: ~4.16.2 fs-extra: ~7.0.1 git-repo-info: ~2.1.0 From c88df794ca275d59ab5860ff622c377a1f92dc94 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 7 Apr 2020 14:00:20 -0700 Subject: [PATCH 09/32] Convert "api-extractor-test-no-report" to be a scenario test --- .../config/build-config.json | 1 + .../api-extractor-scenarios.api.json | 73 +++++++++++++++++++ .../exportImportStarAs/rollup.d.ts | 26 +++++++ .../exportImportStarAs}/ExportedFunctions.ts | 0 .../config/api-extractor-overrides.json | 5 ++ .../src/exportImportStarAs}/index.ts | 0 .../api-extractor-test-no-report/build.js | 36 --------- .../config/api-extractor.json | 22 ------ .../api-extractor-test-no-report/package.json | 17 ----- .../tsconfig.json | 28 ------- rush.json | 6 -- 11 files changed, 105 insertions(+), 109 deletions(-) create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts rename build-tests/{api-extractor-test-no-report/src => api-extractor-scenarios/src/exportImportStarAs}/ExportedFunctions.ts (100%) create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json rename build-tests/{api-extractor-test-no-report/src => api-extractor-scenarios/src/exportImportStarAs}/index.ts (100%) delete mode 100644 build-tests/api-extractor-test-no-report/build.js delete mode 100644 build-tests/api-extractor-test-no-report/config/api-extractor.json delete mode 100644 build-tests/api-extractor-test-no-report/package.json delete mode 100644 build-tests/api-extractor-test-no-report/tsconfig.json diff --git a/build-tests/api-extractor-scenarios/config/build-config.json b/build-tests/api-extractor-scenarios/config/build-config.json index f8ad516b6bd..18c39f57f6b 100644 --- a/build-tests/api-extractor-scenarios/config/build-config.json +++ b/build-tests/api-extractor-scenarios/config/build-config.json @@ -18,6 +18,7 @@ "exportEquals", "exportImportedExternal", "exportImportedExternal2", + "exportImportStarAs", "exportStar", "exportStar2", "exportStar3", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json new file mode 100644 index 00000000000..bf8cd5c6d3d --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -0,0 +1,73 @@ +{ + "metadata": { + "toolPackage": "@microsoft/api-extractor", + "toolVersion": "[test mode]", + "schemaVersion": 1003, + "oldestForwardsCompatibleVersion": 1001 + }, + "kind": "Package", + "canonicalReference": "api-extractor-scenarios!", + "docComment": "", + "name": "api-extractor-scenarios", + "members": [ + { + "kind": "EntryPoint", + "canonicalReference": "api-extractor-scenarios!", + "name": "", + "members": [ + { + "kind": "Namespace", + "canonicalReference": "api-extractor-scenarios!calculator:namespace", + "docComment": "", + "excerptTokens": [], + "releaseTag": "None", + "name": "calculator", + "members": [ + { + "kind": "Variable", + "canonicalReference": "api-extractor-scenarios!calculator.add:var", + "docComment": "/**\n * Returns the sum of adding b to a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding b to a\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "add: " + }, + { + "kind": "Content", + "text": "(a: number, b: number) => number" + } + ], + "releaseTag": "Public", + "name": "add", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "kind": "Variable", + "canonicalReference": "api-extractor-scenarios!calculator.subtract:var", + "docComment": "/**\n * Returns the sum of subtracting b from a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract b from a\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "subtract: " + }, + { + "kind": "Content", + "text": "(a: number, b: number) => number" + } + ], + "releaseTag": "Public", + "name": "subtract", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + } + ] + } + ] + } + ] +} diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts new file mode 100644 index 00000000000..e6cb4567126 --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -0,0 +1,26 @@ + +/** + * Returns the sum of adding b to a + * @param a - first number + * @param b - second number + * @returns Sum of adding b to a + */ +declare const add: (a: number, b: number) => number; + +declare namespace calculator { + export { + add, + subtract, + } +} +export { calculator } + +/** + * Returns the sum of subtracting b from a + * @param a - first number + * @param b - second number + * @returns Sum of subtract b from a + */ +declare const subtract: (a: number, b: number) => number; + +export { } diff --git a/build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts similarity index 100% rename from build-tests/api-extractor-test-no-report/src/ExportedFunctions.ts rename to build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json b/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json new file mode 100644 index 00000000000..970eac2512a --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json @@ -0,0 +1,5 @@ +{ + "apiReport": { + "enabled": false + } +} \ No newline at end of file diff --git a/build-tests/api-extractor-test-no-report/src/index.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts similarity index 100% rename from build-tests/api-extractor-test-no-report/src/index.ts rename to build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts diff --git a/build-tests/api-extractor-test-no-report/build.js b/build-tests/api-extractor-test-no-report/build.js deleted file mode 100644 index b4b2b370604..00000000000 --- a/build-tests/api-extractor-test-no-report/build.js +++ /dev/null @@ -1,36 +0,0 @@ -const fsx = require('../api-extractor-test-04/node_modules/fs-extra/lib'); -const child_process = require('child_process'); -const path = require('path'); -const process = require('process'); - -console.log(`==> Invoking tsc in the "beta-consumer" folder`); - -function executeCommand(command, cwd) { - console.log('---> ' + command); - child_process.execSync(command, { stdio: 'inherit', cwd: cwd }); -} - -// Clean the old build outputs -console.log(`==> Starting build.js for ${path.basename(process.cwd())}`); -fsx.emptyDirSync('dist'); -fsx.emptyDirSync('lib'); -fsx.emptyDirSync('temp'); - -// Run the TypeScript compiler -executeCommand('node node_modules/typescript/lib/tsc'); - -// Run the API Extractor command-line -if (process.argv.indexOf('--production') >= 0) { - executeCommand('node node_modules/@microsoft/api-extractor/lib/start run'); -} else { - executeCommand('node node_modules/@microsoft/api-extractor/lib/start run --local'); -} - -// Run the TypeScript compiler in the beta-consumer folder -console.log(`==> Invoking tsc in the "beta-consumer" folder`); - -fsx.emptyDirSync('beta-consumer/lib'); -const tscPath = path.resolve('node_modules/typescript/lib/tsc'); -executeCommand(`node ${tscPath}`, 'beta-consumer'); - -console.log(`==> Finished build.js for ${path.basename(process.cwd())}`); diff --git a/build-tests/api-extractor-test-no-report/config/api-extractor.json b/build-tests/api-extractor-test-no-report/config/api-extractor.json deleted file mode 100644 index d65f934e7b4..00000000000 --- a/build-tests/api-extractor-test-no-report/config/api-extractor.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", - - "mainEntryPointFilePath": "/lib/index.d.ts", - - "apiReport": { - "enabled": false, - }, - - "docModel": { - "enabled": true - }, - - "dtsRollup": { - "enabled": true, - - "betaTrimmedFilePath": "/dist/-beta.d.ts", - "publicTrimmedFilePath": "/dist/-public.d.ts" - }, - - "testMode": true -} diff --git a/build-tests/api-extractor-test-no-report/package.json b/build-tests/api-extractor-test-no-report/package.json deleted file mode 100644 index 5179f8002c1..00000000000 --- a/build-tests/api-extractor-test-no-report/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "api-extractor-test-no-report", - "description": "Building this project is a regression test for api-extractor", - "version": "1.0.0", - "private": true, - "main": "lib/index.js", - "typings": "dist/api-extractor-test-no-report.d.ts", - "scripts": { - "build": "node build.js" - }, - "dependencies": { - "@microsoft/api-extractor": "7.7.12", - "api-extractor-lib1-test": "1.0.0", - "fs-extra": "~7.0.1", - "typescript": "~3.7.2" - } -} diff --git a/build-tests/api-extractor-test-no-report/tsconfig.json b/build-tests/api-extractor-test-no-report/tsconfig.json deleted file mode 100644 index f6c01bb8017..00000000000 --- a/build-tests/api-extractor-test-no-report/tsconfig.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", - "forceConsistentCasingInFileNames": true, - "module": "commonjs", - "declaration": true, - "sourceMap": true, - "declarationMap": true, - "experimentalDecorators": true, - "strictNullChecks": true, - "esModuleInterop": true, - "types": [ - ], - "lib": [ - "es5", - "scripthost", - "es2015.collection", - "es2015.promise", - "es2015.iterable", - "dom" - ], - "outDir": "lib" - }, - "include": [ - "src/**/*.ts", - "typings/tsd.d.ts" - ] -} \ No newline at end of file diff --git a/rush.json b/rush.json index db0ba88f592..7d36c6795f0 100644 --- a/rush.json +++ b/rush.json @@ -461,12 +461,6 @@ "reviewCategory": "tests", "shouldPublish": false }, - { - "packageName": "api-extractor-test-no-report", - "projectFolder": "build-tests/api-extractor-test-no-report", - "reviewCategory": "tests", - "shouldPublish": false - }, { "packageName": "localization-plugin-test-01", "projectFolder": "build-tests/localization-plugin-test-01", From dc9bb83c029fa9817043a28f93f7ae7d9f2c92f8 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 7 Apr 2020 14:04:30 -0700 Subject: [PATCH 10/32] Convert test functions to be stereotypical functions instead of lambda constants. --- .../api-extractor-scenarios.api.json | 110 +++++++++++++++--- .../exportImportStarAs/rollup.d.ts | 4 +- .../exportImportStarAs/ExportedFunctions.ts | 8 +- 3 files changed, 100 insertions(+), 22 deletions(-) diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index bf8cd5c6d3d..cf08b13bbaa 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -24,46 +24,120 @@ "name": "calculator", "members": [ { - "kind": "Variable", - "canonicalReference": "api-extractor-scenarios!calculator.add:var", + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!calculator.add:function(1)", "docComment": "/**\n * Returns the sum of adding b to a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding b to a\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "add: " + "text": "export declare function add(a: " }, { "kind": "Content", - "text": "(a: number, b: number) => number" + "text": "number" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": ";" } ], + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, "releaseTag": "Public", - "name": "add", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "a", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "b", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + } + ], + "name": "add" }, { - "kind": "Variable", - "canonicalReference": "api-extractor-scenarios!calculator.subtract:var", + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!calculator.subtract:function(1)", "docComment": "/**\n * Returns the sum of subtracting b from a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract b from a\n */\n", "excerptTokens": [ { "kind": "Content", - "text": "subtract: " + "text": "export declare function subtract(a: " }, { "kind": "Content", - "text": "(a: number, b: number) => number" + "text": "number" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "number" + }, + { + "kind": "Content", + "text": ";" } ], + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, "releaseTag": "Public", - "name": "subtract", - "variableTypeTokenRange": { - "startIndex": 1, - "endIndex": 2 - } + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "a", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "b", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + } + ], + "name": "subtract" } ] } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index e6cb4567126..b6bb0490282 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -5,7 +5,7 @@ * @param b - second number * @returns Sum of adding b to a */ -declare const add: (a: number, b: number) => number; +declare function add(a: number, b: number): number; declare namespace calculator { export { @@ -21,6 +21,6 @@ export { calculator } * @param b - second number * @returns Sum of subtract b from a */ -declare const subtract: (a: number, b: number) => number; +declare function subtract(a: number, b: number): number; export { } diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts index 2aaab3cdc81..fe1defc21a3 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts @@ -5,7 +5,9 @@ * @param b - second number * @returns Sum of adding b to a */ -export const add = (a: number, b: number): number => a + b; +export function add(a: number, b: number): number { + return a + b; +} /** * Returns the sum of subtracting b from a @@ -13,4 +15,6 @@ export const add = (a: number, b: number): number => a + b; * @param b - second number * @returns Sum of subtract b from a */ -export const subtract = (a: number, b: number): number => a - b; \ No newline at end of file +export function subtract(a: number, b: number): number { + return a - b; +} From 0b81dfb58e9a6218d4b4fd9b7ded9e3f247abe88 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Thu, 16 Apr 2020 14:37:36 -0700 Subject: [PATCH 11/32] Adjust changelog --- .../export-star-as-support_2020-03-25-13-53.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json index 08c63edc4a4..ffb7dae3ee1 100644 --- a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json +++ b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json @@ -2,10 +2,10 @@ "changes": [ { "packageName": "@microsoft/api-extractor", - "comment": "\"Added support from 'import * as module from ./local/module'\"", + "comment": "Added support for "import * as module from './local/module';\"", "type": "minor" } ], "packageName": "@microsoft/api-extractor", - "email": "systemvetaren@gmail.com" + "email": "mckn@users.noreply.github.com" } \ No newline at end of file From 3651886a229a3ff27a97cf3b6bce1e3d8894cc93 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 17 Apr 2020 12:34:03 -0700 Subject: [PATCH 12/32] Improve test to show how top-level name conflicts are handled --- .../api-extractor-scenarios.api.json | 130 +++++++++++++++++- .../exportImportStarAs/rollup.d.ts | 32 ++++- .../{ExportedFunctions.ts => calculator.ts} | 8 +- .../src/exportImportStarAs/calculator2.ts | 20 +++ .../src/exportImportStarAs/index.ts | 7 +- 5 files changed, 185 insertions(+), 12 deletions(-) rename build-tests/api-extractor-scenarios/src/exportImportStarAs/{ExportedFunctions.ts => calculator.ts} (62%) create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index cf08b13bbaa..c35f67236a2 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -26,7 +26,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator.add:function(1)", - "docComment": "/**\n * Returns the sum of adding b to a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding b to a\n */\n", + "docComment": "/**\n * Returns the sum of adding `b` to `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n */\n", "excerptTokens": [ { "kind": "Content", @@ -84,7 +84,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator.subtract:function(1)", - "docComment": "/**\n * Returns the sum of subtracting b from a\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract b from a\n */\n", + "docComment": "/**\n * Returns the sum of subtracting `b` from `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n */\n", "excerptTokens": [ { "kind": "Content", @@ -140,6 +140,132 @@ "name": "subtract" } ] + }, + { + "kind": "Namespace", + "canonicalReference": "api-extractor-scenarios!calculator2:namespace", + "docComment": "", + "excerptTokens": [], + "releaseTag": "None", + "name": "calculator2", + "members": [ + { + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!calculator2.add:function(1)", + "docComment": "/**\n * Returns the sum of adding `b` to `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function add(a: " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "a", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "b", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + } + ], + "name": "add" + }, + { + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!calculator2.subtract:function(1)", + "docComment": "/**\n * Returns the sum of subtracting `b` from `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function subtract(a: " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": ", b: " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": "): " + }, + { + "kind": "Content", + "text": "bigint" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 5, + "endIndex": 6 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [ + { + "parameterName": "a", + "parameterTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, + { + "parameterName": "b", + "parameterTypeTokenRange": { + "startIndex": 3, + "endIndex": 4 + } + } + ], + "name": "subtract" + } + ] } ] } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index b6bb0490282..688a3d67279 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -1,12 +1,20 @@ /** - * Returns the sum of adding b to a + * Returns the sum of adding `b` to `a` * @param a - first number * @param b - second number - * @returns Sum of adding b to a + * @returns Sum of adding `b` to `a` */ declare function add(a: number, b: number): number; +/** + * Returns the sum of adding `b` to `a` for large integers + * @param a - first number + * @param b - second number + * @returns Sum of adding `b` to `a` + */ +declare function add_2(a: bigint, b: bigint): bigint; + declare namespace calculator { export { add, @@ -15,12 +23,28 @@ declare namespace calculator { } export { calculator } +declare namespace calculator2 { + export { + add_2 as add, + subtract_2 as subtract, + } +} +export { calculator2 } + /** - * Returns the sum of subtracting b from a + * Returns the sum of subtracting `b` from `a` * @param a - first number * @param b - second number - * @returns Sum of subtract b from a + * @returns Sum of subtract `b` from `a` */ declare function subtract(a: number, b: number): number; +/** + * Returns the sum of subtracting `b` from `a` for large integers + * @param a - first number + * @param b - second number + * @returns Sum of subtract `b` from `a` + */ +declare function subtract_2(a: bigint, b: bigint): bigint; + export { } diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts similarity index 62% rename from build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts rename to build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts index fe1defc21a3..509bde74f46 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/ExportedFunctions.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts @@ -1,19 +1,19 @@ /** - * Returns the sum of adding b to a + * Returns the sum of adding `b` to `a` * @param a - first number * @param b - second number - * @returns Sum of adding b to a + * @returns Sum of adding `b` to `a` */ export function add(a: number, b: number): number { return a + b; } /** - * Returns the sum of subtracting b from a + * Returns the sum of subtracting `b` from `a` * @param a - first number * @param b - second number - * @returns Sum of subtract b from a + * @returns Sum of subtract `b` from `a` */ export function subtract(a: number, b: number): number { return a - b; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts new file mode 100644 index 00000000000..2c5aedf65f2 --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts @@ -0,0 +1,20 @@ + +/** + * Returns the sum of adding `b` to `a` for large integers + * @param a - first number + * @param b - second number + * @returns Sum of adding `b` to `a` + */ +export function add(a: bigint, b: bigint): bigint { + return a + b; +} + +/** + * Returns the sum of subtracting `b` from `a` for large integers + * @param a - first number + * @param b - second number + * @returns Sum of subtract `b` from `a` + */ +export function subtract(a: bigint, b: bigint): bigint { + return a - b; +} diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts index 220c57c9974..bece34025b8 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/index.ts @@ -1,2 +1,5 @@ -import * as calculator from './ExportedFunctions' -export { calculator }; \ No newline at end of file +import * as calculator from './calculator' +export { calculator }; + +import * as calculator2 from './calculator2' +export { calculator2 }; From de802292a6b7b50e1096c275b6211d1bc000372a Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 17 Apr 2020 12:37:07 -0700 Subject: [PATCH 13/32] Show how aliases are handled --- .../api-extractor-scenarios.api.json | 42 +++++++++++++++++++ .../exportImportStarAs/rollup.d.ts | 7 ++++ .../src/exportImportStarAs/calculator.ts | 2 + .../src/exportImportStarAs/calculator2.ts | 2 + .../src/exportImportStarAs/common.ts | 5 +++ 5 files changed, 58 insertions(+) create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index c35f67236a2..f998ac3659f 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -81,6 +81,27 @@ ], "name": "add" }, + { + "kind": "Variable", + "canonicalReference": "api-extractor-scenarios!calculator.calucatorVersion:var", + "docComment": "/**\n * Returns the version of the calculator.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "calucatorVersion: " + }, + { + "kind": "Content", + "text": "string" + } + ], + "releaseTag": "Public", + "name": "calucatorVersion", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator.subtract:function(1)", @@ -207,6 +228,27 @@ ], "name": "add" }, + { + "kind": "Variable", + "canonicalReference": "api-extractor-scenarios!calculator2.calucatorVersion:var", + "docComment": "/**\n * Returns the version of the calculator.\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "calucatorVersion: " + }, + { + "kind": "Content", + "text": "string" + } + ], + "releaseTag": "Public", + "name": "calucatorVersion", + "variableTypeTokenRange": { + "startIndex": 1, + "endIndex": 2 + } + }, { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator2.subtract:function(1)", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index 688a3d67279..2db5ee04542 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -19,6 +19,7 @@ declare namespace calculator { export { add, subtract, + calucatorVersion, } } export { calculator } @@ -27,10 +28,16 @@ declare namespace calculator2 { export { add_2 as add, subtract_2 as subtract, + calucatorVersion, } } export { calculator2 } +/** + * Returns the version of the calculator. + */ +declare const calucatorVersion: string; + /** * Returns the sum of subtracting `b` from `a` * @param a - first number diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts index 509bde74f46..7a3af5a8a12 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts @@ -18,3 +18,5 @@ export function add(a: number, b: number): number { export function subtract(a: number, b: number): number { return a - b; } + +export * from './common'; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts index 2c5aedf65f2..b4596ee89b2 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts @@ -18,3 +18,5 @@ export function add(a: bigint, b: bigint): bigint { export function subtract(a: bigint, b: bigint): bigint { return a - b; } + +export * from './common'; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts new file mode 100644 index 00000000000..987fa1ca55d --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts @@ -0,0 +1,5 @@ + +/** + * Returns the version of the calculator. + */ +export const calucatorVersion: string = '1.0.0'; From dd449f4c9c1a90083eb5e66e6f4fd686b5ed665a Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sat, 16 May 2020 00:10:10 -0700 Subject: [PATCH 14/32] Refactor AstEntity into a proper base class --- .../src/analyzer/AstDeclaration.ts | 2 +- apps/api-extractor/src/analyzer/AstEntity.ts | 47 +++++++++++++++++++ apps/api-extractor/src/analyzer/AstImport.ts | 12 ++--- .../src/analyzer/AstImportAsModule.ts | 7 ++- apps/api-extractor/src/analyzer/AstModule.ts | 14 +++--- .../src/analyzer/AstReferenceResolver.ts | 14 ++---- apps/api-extractor/src/analyzer/AstSymbol.ts | 18 +++---- .../src/analyzer/AstSymbolTable.ts | 4 +- .../src/analyzer/ExportAnalyzer.ts | 3 +- apps/api-extractor/src/collector/Collector.ts | 13 ++--- .../src/collector/CollectorEntity.ts | 4 +- .../src/generators/ApiModelGenerator.ts | 2 +- 12 files changed, 90 insertions(+), 50 deletions(-) create mode 100644 apps/api-extractor/src/analyzer/AstEntity.ts diff --git a/apps/api-extractor/src/analyzer/AstDeclaration.ts b/apps/api-extractor/src/analyzer/AstDeclaration.ts index 10e906081ae..48a83380a40 100644 --- a/apps/api-extractor/src/analyzer/AstDeclaration.ts +++ b/apps/api-extractor/src/analyzer/AstDeclaration.ts @@ -5,7 +5,7 @@ import * as ts from 'typescript'; import { AstSymbol } from './AstSymbol'; import { Span } from './Span'; import { InternalError } from '@rushstack/node-core-library'; -import { AstEntity } from './AstSymbolTable'; +import { AstEntity } from './AstEntity'; /** * Constructor options for AstDeclaration diff --git a/apps/api-extractor/src/analyzer/AstEntity.ts b/apps/api-extractor/src/analyzer/AstEntity.ts new file mode 100644 index 00000000000..5178bde5f92 --- /dev/null +++ b/apps/api-extractor/src/analyzer/AstEntity.ts @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. +// See LICENSE in the project root for license information. + +/** + * `AstEntity` is the abstract base class for analyzer objects that can become a CollectorEntity. + * + * @remarks + * + * The subclasses are: + * + * - `AstSymbol` + * - `AstSyntheticEntity` + */ +export abstract class AstEntity { + /** + * The original name of the symbol, as exported from the module (i.e. source file) + * containing the original TypeScript definition. Constructs such as + * `import { X as Y } from` may introduce other names that differ from the local name. + * + * @remarks + * For the most part, `localName` corresponds to `followedSymbol.name`, but there + * are some edge cases. For example, the symbol name for `export default class X { }` + * is actually `"default"`, not `"X"`. + */ + public abstract readonly localName: string; +} + +/** + * `AstSyntheticEntity` is the abstract base class for analyzer objects whose emitted declarations + * are not text transformations performed by the `Span` helper. + * + * @remarks + * Most of API Extractor's output is produced by using the using the `Span` utility to regurgitate strings from + * the input .d.ts files. If we need to rename an identifier, the `Span` visitor can pick out an interesting + * node and rewrite its string, but otherwise the transformation operates on dumb text and not compiler concepts. + * (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages.) + * + * This strategy does not work for cases where the output looks very different from the input. Today these + * cases are always kinds of `import` statements, but that may change in the future. + * + * The subclasses are: + * + * - `AstImport` + * - `AstImportAsModule` + */ +export abstract class AstSyntheticEntity extends AstEntity { +} diff --git a/apps/api-extractor/src/analyzer/AstImport.ts b/apps/api-extractor/src/analyzer/AstImport.ts index 7d7a6b5fb7a..9919f8341b0 100644 --- a/apps/api-extractor/src/analyzer/AstImport.ts +++ b/apps/api-extractor/src/analyzer/AstImport.ts @@ -3,6 +3,7 @@ import { AstSymbol } from './AstSymbol'; import { InternalError } from '@rushstack/node-core-library'; +import { AstSyntheticEntity } from './AstEntity'; /** * Indicates the import kind for an `AstImport`. @@ -48,7 +49,7 @@ export interface IAstImportOptions { * For a symbol that was imported from an external package, this tracks the import * statement that was used to reach it. */ -export class AstImport { +export class AstImport extends AstSyntheticEntity { public readonly importKind: AstImportKind; /** @@ -98,6 +99,8 @@ export class AstImport { public readonly key: string; public constructor(options: IAstImportOptions) { + super(); + this.importKind = options.importKind; this.modulePath = options.modulePath; this.exportName = options.exportName; @@ -105,11 +108,8 @@ export class AstImport { this.key = AstImport.getKey(options); } - /** - * Allows `AstEntity.localName` to be used as a convenient generalization of `AstSymbol.localName` and - * `AstImport.exportName`. - */ - public get localName(): string { + /** {@inheritdoc} */ + public get localName(): string { // abstract return this.exportName; } diff --git a/apps/api-extractor/src/analyzer/AstImportAsModule.ts b/apps/api-extractor/src/analyzer/AstImportAsModule.ts index 3898bb30462..b4ef385eada 100644 --- a/apps/api-extractor/src/analyzer/AstImportAsModule.ts +++ b/apps/api-extractor/src/analyzer/AstImportAsModule.ts @@ -2,6 +2,7 @@ // See LICENSE in the project root for license information. import { AstModule } from './AstModule'; +import { AstSyntheticEntity } from './AstEntity'; export interface IAstImportAsModuleOptions { readonly astModule: AstModule; @@ -9,7 +10,7 @@ export interface IAstImportAsModuleOptions { } // TODO [MA]: add documentation -export class AstImportAsModule { +export class AstImportAsModule extends AstSyntheticEntity { // TODO [MA]: add documentation public analyzed: boolean = false; @@ -40,11 +41,13 @@ export class AstImportAsModule { public readonly exportName: string; public constructor(options: IAstImportAsModuleOptions) { + super(); this.astModule = options.astModule; this.exportName = options.exportName; } - public get localName(): string { + /** {@inheritdoc} */ + public get localName(): string { // abstract return this.exportName; } } \ No newline at end of file diff --git a/apps/api-extractor/src/analyzer/AstModule.ts b/apps/api-extractor/src/analyzer/AstModule.ts index f18efb60a42..264d06d5f19 100644 --- a/apps/api-extractor/src/analyzer/AstModule.ts +++ b/apps/api-extractor/src/analyzer/AstModule.ts @@ -4,7 +4,7 @@ import * as ts from 'typescript'; import { AstSymbol } from './AstSymbol'; -import { AstEntity } from './AstSymbolTable'; +import { AstEntity } from './AstEntity'; /** * Represents information collected by {@link AstSymbolTable.fetchAstModuleExportInfo} @@ -16,6 +16,12 @@ export class AstModuleExportInfo { /** * Constructor parameters for AstModule + * + * @privateRemarks + * Our naming convention is to use I____Parameters for constructor options and + * I____Options for general function options. However the word "parameters" is + * confusingly similar to the terminology for function parameters modeled by API Extractor, + * so we use I____Options for both cases in this code base. */ export interface IAstModuleOptions { sourceFile: ts.SourceFile; @@ -25,12 +31,6 @@ export interface IAstModuleOptions { /** * An internal data structure that represents a source file that is analyzed by AstSymbolTable. - * - * @privateRemarks - * Our naming convention is to use I____Parameters for constructor options and - * I____Options for general function options. However the word "parameters" is - * confusingly similar to the terminology for function parameters modeled by API Extractor, - * so we use I____Options for both cases in this code base. */ export class AstModule { /** diff --git a/apps/api-extractor/src/analyzer/AstReferenceResolver.ts b/apps/api-extractor/src/analyzer/AstReferenceResolver.ts index 8866c164a15..675c3c9aa81 100644 --- a/apps/api-extractor/src/analyzer/AstReferenceResolver.ts +++ b/apps/api-extractor/src/analyzer/AstReferenceResolver.ts @@ -4,14 +4,14 @@ import * as ts from 'typescript'; import * as tsdoc from '@microsoft/tsdoc'; -import { AstSymbolTable, AstEntity } from './AstSymbolTable'; +import { AstSymbolTable } from './AstSymbolTable'; +import { AstEntity } from './AstEntity'; import { AstDeclaration } from './AstDeclaration'; import { WorkingPackage } from '../collector/WorkingPackage'; import { AstModule } from './AstModule'; -import { AstImport } from './AstImport'; import { Collector } from '../collector/Collector'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; -import { AstImportAsModule } from './AstImportAsModule'; +import { AstSymbol } from './AstSymbol'; /** * Used by `AstReferenceResolver` to report a failed resolution. @@ -84,12 +84,8 @@ export class AstReferenceResolver { return new ResolverFailure(`The package "${this._workingPackage.name}" does not have an export "${exportName}"`); } - if (rootAstEntity instanceof AstImport) { - return new ResolverFailure('Reexported declarations are not supported'); - } - - if (rootAstEntity instanceof AstImportAsModule) { - return new ResolverFailure('Source file export declarations are not supported'); + if (!(rootAstEntity instanceof AstSymbol)) { + return new ResolverFailure('This type of declaration is not supported yet by the resolver'); } let currentDeclaration: AstDeclaration | ResolverFailure = this._selectDeclaration(rootAstEntity.astDeclarations, diff --git a/apps/api-extractor/src/analyzer/AstSymbol.ts b/apps/api-extractor/src/analyzer/AstSymbol.ts index ce9d2861c1d..fcb3269cf36 100644 --- a/apps/api-extractor/src/analyzer/AstSymbol.ts +++ b/apps/api-extractor/src/analyzer/AstSymbol.ts @@ -4,6 +4,7 @@ import * as ts from 'typescript'; import { AstDeclaration } from './AstDeclaration'; import { InternalError } from '@rushstack/node-core-library'; +import { AstEntity } from './AstEntity'; /** * Constructor options for AstSymbol @@ -50,18 +51,9 @@ export interface IAstSymbolOptions { * - g * ``` */ -export class AstSymbol { - /** - * The original name of the symbol, as exported from the module (i.e. source file) - * containing the original TypeScript definition. Constructs such as - * `import { X as Y } from` may introduce other names that differ from the local name. - * - * @remarks - * For the most part, `localName` corresponds to `followedSymbol.name`, but there - * are some edge cases. For example, the symbol name for `export default class X { }` - * is actually `"default"`, not `"X"`. - */ - public readonly localName: string; +export class AstSymbol extends AstEntity { + /** {@inheritdoc} */ + public readonly localName: string; // abstract /** * If true, then the `followedSymbol` (i.e. original declaration) of this symbol @@ -121,6 +113,8 @@ export class AstSymbol { private _analyzed: boolean = false; public constructor(options: IAstSymbolOptions) { + super(); + this.followedSymbol = options.followedSymbol; this.localName = options.localName; this.isExternal = options.isExternal; diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index 2020bc4356b..fb6e5852026 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -10,15 +10,13 @@ import { AstSymbol } from './AstSymbol'; import { AstModule, AstModuleExportInfo } from './AstModule'; import { PackageMetadataManager } from './PackageMetadataManager'; import { ExportAnalyzer } from './ExportAnalyzer'; -import { AstImport } from './AstImport'; +import { AstEntity } from './AstEntity'; import { AstImportAsModule } from './AstImportAsModule'; import { MessageRouter } from '../collector/MessageRouter'; import { TypeScriptInternals, IGlobalVariableAnalyzer } from './TypeScriptInternals'; import { StringChecks } from './StringChecks'; import { SourceFileLocationFormatter } from './SourceFileLocationFormatter'; -export type AstEntity = AstSymbol | AstImport | AstImportAsModule; - /** * Options for `AstSymbolTable._fetchAstSymbol()` */ diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 4b3b002f8f8..3df2d186b5b 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -10,7 +10,8 @@ import { AstImport, IAstImportOptions, AstImportKind } from './AstImport'; import { AstModule, AstModuleExportInfo } from './AstModule'; import { TypeScriptInternals } from './TypeScriptInternals'; import { SourceFileLocationFormatter } from './SourceFileLocationFormatter'; -import { IFetchAstSymbolOptions, AstEntity } from './AstSymbolTable'; +import { IFetchAstSymbolOptions } from './AstSymbolTable'; +import { AstEntity } from './AstEntity'; import { AstImportAsModule } from './AstImportAsModule'; /** diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index 834448d3542..1d5d119956b 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -16,7 +16,8 @@ import { import { ExtractorMessageId } from '../api/ExtractorMessageId'; import { CollectorEntity } from './CollectorEntity'; -import { AstSymbolTable, AstEntity } from '../analyzer/AstSymbolTable'; +import { AstSymbolTable, } from '../analyzer/AstSymbolTable'; +import { AstEntity } from '../analyzer/AstEntity'; import { AstModule, AstModuleExportInfo } from '../analyzer/AstModule'; import { AstSymbol } from '../analyzer/AstSymbol'; import { AstDeclaration } from '../analyzer/AstDeclaration'; @@ -31,6 +32,7 @@ import { MessageRouter } from './MessageRouter'; import { AstReferenceResolver } from '../analyzer/AstReferenceResolver'; import { ExtractorConfig } from '../api/ExtractorConfig'; import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstImport } from '../analyzer/AstImport'; /** * Options for Collector constructor. @@ -297,14 +299,13 @@ export class Collector { } public tryFetchMetadataForAstEntity(astEntity: AstEntity): SymbolMetadata | undefined { - if (astEntity instanceof AstImportAsModule) { - return undefined; - } if (astEntity instanceof AstSymbol) { return this.fetchSymbolMetadata(astEntity); } - if (astEntity.astSymbol) { // astImport - return this.fetchSymbolMetadata(astEntity.astSymbol); + if (astEntity instanceof AstImport) { + if (astEntity.astSymbol) { + return this.fetchSymbolMetadata(astEntity.astSymbol); + } } return undefined; } diff --git a/apps/api-extractor/src/collector/CollectorEntity.ts b/apps/api-extractor/src/collector/CollectorEntity.ts index f23fd22f1a5..5ab4e75fea9 100644 --- a/apps/api-extractor/src/collector/CollectorEntity.ts +++ b/apps/api-extractor/src/collector/CollectorEntity.ts @@ -6,7 +6,7 @@ import * as ts from 'typescript'; import { AstSymbol } from '../analyzer/AstSymbol'; import { Collector } from './Collector'; import { Sort } from '@rushstack/node-core-library'; -import { AstEntity } from '../analyzer/AstSymbolTable'; +import { AstEntity } from '../analyzer/AstEntity'; /** * This is a data structure used by the Collector to track an AstEntity that may be emitted in the *.d.ts file. @@ -15,7 +15,7 @@ import { AstEntity } from '../analyzer/AstSymbolTable'; * The additional contextual state beyond AstSymbol is: * - Whether it's an export of this entry point or not * - The nameForEmit, which may get renamed by DtsRollupGenerator._makeUniqueNames() - * - The export name (or names, if the same declaration is exported multiple times) + * - The export name (or names, if the same symbol is exported multiple times) */ export class CollectorEntity { /** diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index f752af80873..9fa54f39414 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -41,7 +41,7 @@ import { DeclarationReferenceGenerator } from './DeclarationReferenceGenerator'; import { ApiItemMetadata } from '../collector/ApiItemMetadata'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; import { AstImportAsModule } from '../analyzer/AstImportAsModule'; -import { AstEntity } from '../analyzer/AstSymbolTable'; +import { AstEntity } from '../analyzer/AstEntity'; import { AstModule } from '../analyzer/AstModule'; export class ApiModelGenerator { From 9481016384d20efccef73f44751178d1f0a08085 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 01:23:59 -0700 Subject: [PATCH 15/32] Fix lint warnings from merge --- apps/api-extractor/src/analyzer/AstSymbolTable.ts | 10 ++++++---- apps/api-extractor/src/analyzer/ExportAnalyzer.ts | 2 +- build-tests/api-documenter-test/src/DocClass1.ts | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index 7ca0b2ea12a..dbfff3bdbb4 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -1,6 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +/* eslint-disable no-bitwise */ // for ts.SymbolFlags + import * as ts from 'typescript'; import { PackageJsonLookup, InternalError } from '@rushstack/node-core-library'; @@ -523,13 +525,13 @@ export class AstSymbolTable { const arbitraryDeclaration: ts.Declaration = followedSymbol.declarations[0]; - // eslint-disable-next-line no-bitwise if ( followedSymbol.flags & - (ts.SymbolFlags.TypeParameter | ts.SymbolFlags.TypeLiteral | ts.SymbolFlags.Transient) && - !TypeScriptInternals.isLateBoundSymbol(followedSymbol) + (ts.SymbolFlags.TypeParameter | ts.SymbolFlags.TypeLiteral | ts.SymbolFlags.Transient) ) { - return undefined; + if (!TypeScriptInternals.isLateBoundSymbol(followedSymbol)) { + return undefined; + } } // API Extractor doesn't analyze ambient declarations at all diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 8cf023de713..ef07d54f1ec 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -377,8 +377,8 @@ export class ExportAnalyzer { } } + // eslint-disable-next-line no-bitwise if (!(current.flags & ts.SymbolFlags.Alias)) { - // eslint-disable-line no-bitwise break; } diff --git a/build-tests/api-documenter-test/src/DocClass1.ts b/build-tests/api-documenter-test/src/DocClass1.ts index d82e82f971f..59b3dbb68df 100644 --- a/build-tests/api-documenter-test/src/DocClass1.ts +++ b/build-tests/api-documenter-test/src/DocClass1.ts @@ -100,7 +100,7 @@ export interface IDocInterface3 { * An identifier that does need quotes. It misleadingly looks like an ECMAScript symbol. */ // prettier-ignore - "[not.a.symbol]": string;; + "[not.a.symbol]": string; } /** From 828baade9544a1a78386d8db4b203e9a2c8a4a6f Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 02:17:43 -0700 Subject: [PATCH 16/32] Some minor cleanups (no semantic changes) --- apps/api-extractor/src/analyzer/AstEntity.ts | 19 +++++++++---------- .../src/analyzer/AstSymbolTable.ts | 16 +++++----------- .../src/analyzer/ExportAnalyzer.ts | 5 +---- apps/api-extractor/src/collector/Collector.ts | 17 ++++++++++------- 4 files changed, 25 insertions(+), 32 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstEntity.ts b/apps/api-extractor/src/analyzer/AstEntity.ts index c1887b08d30..b16f908e96e 100644 --- a/apps/api-extractor/src/analyzer/AstEntity.ts +++ b/apps/api-extractor/src/analyzer/AstEntity.ts @@ -2,14 +2,18 @@ // See LICENSE in the project root for license information. /** - * `AstEntity` is the abstract base class for analyzer objects that can become a CollectorEntity. + * `AstEntity` is the abstract base class for analyzer objects that can become a `CollectorEntity`. * * @remarks * * The subclasses are: - * - * - `AstSymbol` - * - `AstSyntheticEntity` + * ``` + * - AstEntity + * - AstSymbol + * - AstSyntheticEntity + * - AstImport + * - AstImportAsModule + * ``` */ export abstract class AstEntity { /** @@ -19,7 +23,7 @@ export abstract class AstEntity { * * @remarks * For the most part, `localName` corresponds to `followedSymbol.name`, but there - * are some edge cases. For example, the symbol name for `export default class X { }` + * are some edge cases. For example, the ts.Symbol.name for `export default class X { }` * is actually `"default"`, not `"X"`. */ public abstract readonly localName: string; @@ -37,10 +41,5 @@ export abstract class AstEntity { * * This strategy does not work for cases where the output looks very different from the input. Today these * cases are always kinds of `import` statements, but that may change in the future. - * - * The subclasses are: - * - * - `AstImport` - * - `AstImportAsModule` */ export abstract class AstSyntheticEntity extends AstEntity {} diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index dbfff3bdbb4..567a5480a20 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -284,17 +284,11 @@ export class AstSymbolTable { // mark before actual analyzing, to handle module cyclic reexport astImportAsModule.analyzed = true; - this.fetchAstModuleExportInfo(astImportAsModule.astModule).exportedLocalEntities.forEach( - (exportedEntity) => { - if (exportedEntity instanceof AstImportAsModule) { - this._analyzeAstImportAsModule(exportedEntity); - } - - if (exportedEntity instanceof AstSymbol) { - this._analyzeAstSymbol(exportedEntity); - } - } - ); + for (const exportedEntity of this.fetchAstModuleExportInfo( + astImportAsModule.astModule + ).exportedLocalEntities.values()) { + this.analyze(exportedEntity); + } } private _analyzeAstSymbol(astSymbol: AstSymbol): void { diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index ef07d54f1ec..9122ae68e14 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -74,10 +74,7 @@ export class ExportAnalyzer { private readonly _importableAmbientSourceFiles: Set = new Set(); private readonly _astImportsByKey: Map = new Map(); - private readonly _astImportAsModuleByModule: Map = new Map< - AstModule, - AstImportAsModule - >(); + private readonly _astImportAsModuleByModule: Map = new Map(); public constructor( program: ts.Program, diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index 732a1af7823..d26dc43de0e 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -440,13 +440,16 @@ export class Collector { } if (astEntity instanceof AstImportAsModule) { - this.astSymbolTable - .fetchAstModuleExportInfo(astEntity.astModule) - .exportedLocalEntities.forEach((exportedEntity: AstEntity) => { - // Create a CollectorEntity for each top-level export of AstImportInternal entity - this._createCollectorEntity(exportedEntity, undefined); - this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities); // TODO- create entity for module export - }); + const astModuleExportInfo: AstModuleExportInfo = this.astSymbolTable.fetchAstModuleExportInfo( + astEntity.astModule + ); + for (const exportedEntity of astModuleExportInfo.exportedLocalEntities.values()) { + // Create a CollectorEntity for each top-level export of AstImportInternal entity + this._createCollectorEntity(exportedEntity, undefined); + this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities); + + // TODO - create entity for module export + } } } From 4fbadd8b079b3ad3d0003d5f5b21bc7c3595e8bc Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 02:52:30 -0700 Subject: [PATCH 17/32] Add class documentation, rename "exportName" to "namespaceName" --- .../src/analyzer/AstImportAsModule.ts | 70 ++++++++++++------- .../src/analyzer/ExportAnalyzer.ts | 2 +- 2 files changed, 45 insertions(+), 27 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstImportAsModule.ts b/apps/api-extractor/src/analyzer/AstImportAsModule.ts index 4d0226da289..00ef3a10cf7 100644 --- a/apps/api-extractor/src/analyzer/AstImportAsModule.ts +++ b/apps/api-extractor/src/analyzer/AstImportAsModule.ts @@ -6,49 +6,67 @@ import { AstSyntheticEntity } from './AstEntity'; export interface IAstImportAsModuleOptions { readonly astModule: AstModule; - readonly exportName: string; + readonly namespaceName: string; } -// TODO [MA]: add documentation +/** + * `AstImportAsModule` represents a namespace that is created implicitly by a statement + * such as `import * as example from "./file";` + * + * @remarks + * + * A typical input looks like this: + * ```ts + * // Suppose that example.ts exports two functions f1() and f2(). + * import * as example from "./file"; + * export { example }; + * ``` + * + * API Extractor's .d.ts rollup will transform it into an explicit namespace, like this: + * ```ts + * declare f1(): void; + * declare f2(): void; + * + * declare namespace example { + * export { + * f1, + * f2 + * } + * } + * ``` + * + * The current implementation does not attempt to relocate f1()/f2() to be inside the `namespace` + * because other type signatures may reference them directly (without using the namespace qualifier). + * The `declare namespace example` is a synthetic construct represented by `AstImportAsModule`. + */ export class AstImportAsModule extends AstSyntheticEntity { - // TODO [MA]: add documentation + /** + * Returns true if the AstSymbolTable.analyze() was called for this object. + * See that function for details. + */ public analyzed: boolean = false; - // TODO [MA]: add documentation + /** + * For example, if the original statement was `import * as example from "./file";` + * then `astModule` refers to the `./file.d.ts` file. + */ public readonly astModule: AstModule; /** - * The name of the symbol being imported. - * - * @remarks - * - * The name depends on the type of import: - * - * ```ts - * // For AstImportKind.DefaultImport style, exportName would be "X" in this example: - * import X from "y"; - * - * // For AstImportKind.NamedImport style, exportName would be "X" in this example: - * import { X } from "y"; - * - * // For AstImportKind.StarImport style, exportName would be "x" in this example: - * import * as x from "y"; - * - * // For AstImportKind.EqualsImport style, exportName would be "x" in this example: - * import x = require("y"); - * ``` + * For example, if the original statement was `import * as example from "./file";` + * then `namespaceName` would be `example`. */ - public readonly exportName: string; + public readonly namespaceName: string; public constructor(options: IAstImportAsModuleOptions) { super(); this.astModule = options.astModule; - this.exportName = options.exportName; + this.namespaceName = options.namespaceName; } /** {@inheritdoc} */ public get localName(): string { // abstract - return this.exportName; + return this.namespaceName; } } diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 9122ae68e14..77b2a8fb253 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -497,7 +497,7 @@ export class ExportAnalyzer { let importAsModule: AstImportAsModule | undefined = this._astImportAsModuleByModule.get(astModule); if (importAsModule === undefined) { importAsModule = new AstImportAsModule({ - exportName: declarationSymbol.name, + namespaceName: declarationSymbol.name, astModule: astModule }); this._astImportAsModuleByModule.set(astModule, importAsModule); From cfc693ca6aac2756c2f93b237b79e1779ca3f5ef Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 02:54:39 -0700 Subject: [PATCH 18/32] Rename AstImportAsModule --> AstNamespaceImport because that's what the compiler calls it --- .../src/analyzer/{AstImportAsModule.ts => AstNamespaceImport.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename apps/api-extractor/src/analyzer/{AstImportAsModule.ts => AstNamespaceImport.ts} (100%) diff --git a/apps/api-extractor/src/analyzer/AstImportAsModule.ts b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts similarity index 100% rename from apps/api-extractor/src/analyzer/AstImportAsModule.ts rename to apps/api-extractor/src/analyzer/AstNamespaceImport.ts From 2e75e8376df1c417212a8fb9be3e8e1547046da8 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 02:56:57 -0700 Subject: [PATCH 19/32] Rename AstImportAsModule --> AstNamespaceImport because that's what the compiler calls it --- apps/api-extractor/src/analyzer/AstEntity.ts | 2 +- .../src/analyzer/AstNamespaceImport.ts | 10 +++++----- .../src/analyzer/AstSymbolTable.ts | 18 +++++++++--------- .../src/analyzer/ExportAnalyzer.ts | 18 ++++++++++-------- apps/api-extractor/src/collector/Collector.ts | 6 +++--- .../src/enhancers/ValidationEnhancer.ts | 6 +++--- .../src/generators/ApiModelGenerator.ts | 4 ++-- .../src/generators/ApiReportGenerator.ts | 8 ++++---- .../src/generators/DtsRollupGenerator.ts | 4 ++-- 9 files changed, 39 insertions(+), 37 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstEntity.ts b/apps/api-extractor/src/analyzer/AstEntity.ts index b16f908e96e..23c4091014a 100644 --- a/apps/api-extractor/src/analyzer/AstEntity.ts +++ b/apps/api-extractor/src/analyzer/AstEntity.ts @@ -12,7 +12,7 @@ * - AstSymbol * - AstSyntheticEntity * - AstImport - * - AstImportAsModule + * - AstNamespaceImport * ``` */ export abstract class AstEntity { diff --git a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts index 00ef3a10cf7..02e0a037bf2 100644 --- a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts +++ b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts @@ -4,13 +4,13 @@ import { AstModule } from './AstModule'; import { AstSyntheticEntity } from './AstEntity'; -export interface IAstImportAsModuleOptions { +export interface IAstNamespaceImportOptions { readonly astModule: AstModule; readonly namespaceName: string; } /** - * `AstImportAsModule` represents a namespace that is created implicitly by a statement + * `AstNamespaceImport` represents a namespace that is created implicitly by a statement * such as `import * as example from "./file";` * * @remarks @@ -37,9 +37,9 @@ export interface IAstImportAsModuleOptions { * * The current implementation does not attempt to relocate f1()/f2() to be inside the `namespace` * because other type signatures may reference them directly (without using the namespace qualifier). - * The `declare namespace example` is a synthetic construct represented by `AstImportAsModule`. + * The `declare namespace example` is a synthetic construct represented by `AstNamespaceImport`. */ -export class AstImportAsModule extends AstSyntheticEntity { +export class AstNamespaceImport extends AstSyntheticEntity { /** * Returns true if the AstSymbolTable.analyze() was called for this object. * See that function for details. @@ -58,7 +58,7 @@ export class AstImportAsModule extends AstSyntheticEntity { */ public readonly namespaceName: string; - public constructor(options: IAstImportAsModuleOptions) { + public constructor(options: IAstNamespaceImportOptions) { super(); this.astModule = options.astModule; this.namespaceName = options.namespaceName; diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index 567a5480a20..0b6121b0938 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -13,7 +13,7 @@ import { AstModule, AstModuleExportInfo } from './AstModule'; import { PackageMetadataManager } from './PackageMetadataManager'; import { ExportAnalyzer } from './ExportAnalyzer'; import { AstEntity } from './AstEntity'; -import { AstImportAsModule } from './AstImportAsModule'; +import { AstNamespaceImport } from './AstNamespaceImport'; import { MessageRouter } from '../collector/MessageRouter'; import { TypeScriptInternals, IGlobalVariableAnalyzer } from './TypeScriptInternals'; import { StringChecks } from './StringChecks'; @@ -154,8 +154,8 @@ export class AstSymbolTable { return this._analyzeAstSymbol(astEntity); } - if (astEntity instanceof AstImportAsModule) { - return this._analyzeAstImportAsModule(astEntity); + if (astEntity instanceof AstNamespaceImport) { + return this._analyzeAstNamespaceImport(astEntity); } } @@ -276,16 +276,16 @@ export class AstSymbolTable { return unquotedName; } - private _analyzeAstImportAsModule(astImportAsModule: AstImportAsModule): void { - if (astImportAsModule.analyzed) { + private _analyzeAstNamespaceImport(astNamespaceImport: AstNamespaceImport): void { + if (astNamespaceImport.analyzed) { return; } // mark before actual analyzing, to handle module cyclic reexport - astImportAsModule.analyzed = true; + astNamespaceImport.analyzed = true; for (const exportedEntity of this.fetchAstModuleExportInfo( - astImportAsModule.astModule + astNamespaceImport.astModule ).exportedLocalEntities.values()) { this.analyze(exportedEntity); } @@ -325,9 +325,9 @@ export class AstSymbolTable { } } - if (referencedAstEntity instanceof AstImportAsModule) { + if (referencedAstEntity instanceof AstNamespaceImport) { if (!referencedAstEntity.astModule.isExternal) { - this._analyzeAstImportAsModule(referencedAstEntity); + this._analyzeAstNamespaceImport(referencedAstEntity); } } } diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 77b2a8fb253..083385eab7b 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -12,7 +12,7 @@ import { TypeScriptInternals } from './TypeScriptInternals'; import { SourceFileLocationFormatter } from './SourceFileLocationFormatter'; import { IFetchAstSymbolOptions } from './AstSymbolTable'; import { AstEntity } from './AstEntity'; -import { AstImportAsModule } from './AstImportAsModule'; +import { AstNamespaceImport } from './AstNamespaceImport'; /** * Exposes the minimal APIs from AstSymbolTable that are needed by ExportAnalyzer. @@ -74,7 +74,7 @@ export class ExportAnalyzer { private readonly _importableAmbientSourceFiles: Set = new Set(); private readonly _astImportsByKey: Map = new Map(); - private readonly _astImportAsModuleByModule: Map = new Map(); + private readonly _astNamespaceImportByModule: Map = new Map(); public constructor( program: ts.Program, @@ -328,7 +328,7 @@ export class ExportAnalyzer { this._astSymbolTable.analyze(astEntity); } - if (astEntity instanceof AstImportAsModule && !astEntity.astModule.isExternal) { + if (astEntity instanceof AstNamespaceImport && !astEntity.astModule.isExternal) { this._astSymbolTable.analyze(astEntity); } @@ -494,15 +494,17 @@ export class ExportAnalyzer { if (externalModulePath === undefined) { const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol); - let importAsModule: AstImportAsModule | undefined = this._astImportAsModuleByModule.get(astModule); - if (importAsModule === undefined) { - importAsModule = new AstImportAsModule({ + let namespaceImport: AstNamespaceImport | undefined = this._astNamespaceImportByModule.get( + astModule + ); + if (namespaceImport === undefined) { + namespaceImport = new AstNamespaceImport({ namespaceName: declarationSymbol.name, astModule: astModule }); - this._astImportAsModuleByModule.set(astModule, importAsModule); + this._astNamespaceImportByModule.set(astModule, namespaceImport); } - return importAsModule; + return namespaceImport; } // Here importSymbol=undefined because {@inheritDoc} and such are not going to work correctly for diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index d26dc43de0e..41732150b9d 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -24,7 +24,7 @@ import { TypeScriptInternals, IGlobalVariableAnalyzer } from '../analyzer/TypeSc import { MessageRouter } from './MessageRouter'; import { AstReferenceResolver } from '../analyzer/AstReferenceResolver'; import { ExtractorConfig } from '../api/ExtractorConfig'; -import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; import { AstImport } from '../analyzer/AstImport'; /** @@ -439,7 +439,7 @@ export class Collector { }); } - if (astEntity instanceof AstImportAsModule) { + if (astEntity instanceof AstNamespaceImport) { const astModuleExportInfo: AstModuleExportInfo = this.astSymbolTable.fetchAstModuleExportInfo( astEntity.astModule ); @@ -876,7 +876,7 @@ export class Collector { return this._collectReferenceDirectivesFromSourceFiles(sourceFiles); } - if (astEntity instanceof AstImportAsModule) { + if (astEntity instanceof AstNamespaceImport) { const sourceFiles: ts.SourceFile[] = [astEntity.astModule.sourceFile]; return this._collectReferenceDirectivesFromSourceFiles(sourceFiles); } diff --git a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts index 6c5b377db58..582c251eb09 100644 --- a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts +++ b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts @@ -12,7 +12,7 @@ import { SymbolMetadata } from '../collector/SymbolMetadata'; import { CollectorEntity } from '../collector/CollectorEntity'; import { ExtractorMessageId } from '../api/ExtractorMessageId'; import { ReleaseTag } from '@microsoft/api-extractor-model'; -import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; export class ValidationEnhancer { public static analyze(collector: Collector): void { @@ -31,7 +31,7 @@ export class ValidationEnhancer { } } - if (entity.astEntity instanceof AstImportAsModule) { + if (entity.astEntity instanceof AstNamespaceImport) { // TODO [MA]: validation for local module import } } @@ -217,7 +217,7 @@ export class ValidationEnhancer { } } - if (referencedEntity instanceof AstImportAsModule) { + if (referencedEntity instanceof AstNamespaceImport) { // TODO [MA]: add validation for local import } } diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index 59c0a828db2..27d8230a6e2 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -40,7 +40,7 @@ import { AstSymbol } from '../analyzer/AstSymbol'; import { DeclarationReferenceGenerator } from './DeclarationReferenceGenerator'; import { ApiItemMetadata } from '../collector/ApiItemMetadata'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; -import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; import { AstEntity } from '../analyzer/AstEntity'; import { AstModule } from '../analyzer/AstModule'; @@ -100,7 +100,7 @@ export class ApiModelGenerator { return; } - if (astEntity instanceof AstImportAsModule) { + if (astEntity instanceof AstNamespaceImport) { this._processAstModule(astEntity.astModule, exportedName, parentApiItem); return; } diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index bad427c22fd..078b5c9aacf 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -16,7 +16,7 @@ import { AstSymbol } from '../analyzer/AstSymbol'; import { ExtractorMessage } from '../api/ExtractorMessage'; import { StringWriter } from './StringWriter'; import { DtsEmitHelpers } from './DtsEmitHelpers'; -import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; export class ApiReportGenerator { private static _trimSpacesRegExp: RegExp = / +$/gm; @@ -127,7 +127,7 @@ export class ApiReportGenerator { } } - if (entity.astEntity instanceof AstImportAsModule) { + if (entity.astEntity instanceof AstNamespaceImport) { throw new Error( '"import * as ___ from ___;" is not supported for local files when generating report.' + '\nFailure in: ' + @@ -182,9 +182,9 @@ export class ApiReportGenerator { return stringWriter.toString().replace(ApiReportGenerator._trimSpacesRegExp, ''); } - private static _getSourceFilePath(importAsModule: AstImportAsModule): string { + private static _getSourceFilePath(namespaceImport: AstNamespaceImport): string { const fallback: string = 'unknown source file'; - const { astModule } = importAsModule; + const { astModule } = namespaceImport; if (astModule === undefined || astModule.sourceFile === undefined) { return fallback; diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index b996200db0f..e724d89eeda 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -19,7 +19,7 @@ import { SymbolMetadata } from '../collector/SymbolMetadata'; import { StringWriter } from './StringWriter'; import { DtsEmitHelpers } from './DtsEmitHelpers'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; -import { AstImportAsModule } from '../analyzer/AstImportAsModule'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; import { AstModuleExportInfo } from '../analyzer/AstModule'; /** @@ -146,7 +146,7 @@ export class DtsRollupGenerator { } } - if (entity.astEntity instanceof AstImportAsModule) { + if (entity.astEntity instanceof AstNamespaceImport) { const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( entity.astEntity.astModule ); From b2fa1236c8bb637d0c0acad78f83113432e10085 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 03:16:06 -0700 Subject: [PATCH 20/32] Tune up the code for generating the .d.ts rollup and add a location for the error message --- .../src/analyzer/AstNamespaceImport.ts | 9 ++++ .../src/analyzer/ExportAnalyzer.ts | 3 +- .../src/generators/DtsRollupGenerator.ts | 49 ++++++++++++------- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts index 02e0a037bf2..1ba6985beef 100644 --- a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts +++ b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts @@ -1,12 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license. // See LICENSE in the project root for license information. +import * as ts from 'typescript'; + import { AstModule } from './AstModule'; import { AstSyntheticEntity } from './AstEntity'; export interface IAstNamespaceImportOptions { readonly astModule: AstModule; readonly namespaceName: string; + readonly declaration: ts.Declaration; } /** @@ -58,10 +61,16 @@ export class AstNamespaceImport extends AstSyntheticEntity { */ public readonly namespaceName: string; + /** + * The original `ts.SyntaxKind.NamespaceImport` which can be used as a location for error messages. + */ + public readonly declaration: ts.Declaration; + public constructor(options: IAstNamespaceImportOptions) { super(); this.astModule = options.astModule; this.namespaceName = options.namespaceName; + this.declaration = options.declaration; } /** {@inheritdoc} */ diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 083385eab7b..49d2ece33c4 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -500,7 +500,8 @@ export class ExportAnalyzer { if (namespaceImport === undefined) { namespaceImport = new AstNamespaceImport({ namespaceName: declarationSymbol.name, - astModule: astModule + astModule: astModule, + declaration: declaration }); this._astNamespaceImportByModule.set(astModule, namespaceImport); } diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index e724d89eeda..38463370984 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -21,6 +21,8 @@ import { DtsEmitHelpers } from './DtsEmitHelpers'; import { DeclarationMetadata } from '../collector/DeclarationMetadata'; import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; import { AstModuleExportInfo } from '../analyzer/AstModule'; +import { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter'; +import { AstEntity } from '../analyzer/AstEntity'; /** * Used with DtsRollupGenerator.writeTypingsFile() @@ -109,9 +111,8 @@ export class DtsRollupGenerator { // Emit the regular declarations for (const entity of collector.entities) { - const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity( - entity.astEntity - ); + const astEntity: AstEntity = entity.astEntity; + const symbolMetadata: SymbolMetadata | undefined = collector.tryFetchMetadataForAstEntity(astEntity); const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata ? symbolMetadata.maxEffectiveReleaseTag : ReleaseTag.None; @@ -124,9 +125,9 @@ export class DtsRollupGenerator { continue; } - if (entity.astEntity instanceof AstSymbol) { + if (astEntity instanceof AstSymbol) { // Emit all the declarations for this entry - for (const astDeclaration of entity.astEntity.astDeclarations || []) { + for (const astDeclaration of astEntity.astDeclarations || []) { const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration); if (!this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, dtsKind)) { @@ -146,16 +147,36 @@ export class DtsRollupGenerator { } } - if (entity.astEntity instanceof AstNamespaceImport) { + if (astEntity instanceof AstNamespaceImport) { const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( - entity.astEntity.astModule + astEntity.astModule ); if (entity.nameForEmit === undefined) { // This should never happen throw new InternalError('referencedEntry.nameForEmit is undefined'); } - // manually generate typings for local imported module + + if (astModuleExportInfo.starExportedExternalModules.size > 0) { + // We could support this, but we would need to find a way to safely represent it. + throw new Error( + `The ${entity.nameForEmit} namespace import includes a start export, which is not supported:\n` + + +SourceFileLocationFormatter.formatDeclaration(astEntity.declaration) + ); + } + + // Emit a synthetic declaration for the namespace. It will look like this: + // + // declare namespace example { + // export { + // f1, + // f2 + // } + // } + // + // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type + // signatures may reference them directly (without using the namespace qualifier). + stringWriter.writeLine(); if (entity.shouldInlineExport) { stringWriter.write('export '); @@ -164,7 +185,7 @@ export class DtsRollupGenerator { // all local exports of local imported module are just references to top-level declarations stringWriter.writeLine(' export {'); - astModuleExportInfo.exportedLocalEntities.forEach((exportedEntity, exportedName) => { + for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity( exportedEntity ); @@ -175,21 +196,15 @@ export class DtsRollupGenerator { `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}` ); } + if (collectorEntity.nameForEmit === exportedName) { stringWriter.writeLine(` ${collectorEntity.nameForEmit},`); } else { stringWriter.writeLine(` ${collectorEntity.nameForEmit} as ${exportedName},`); } - }); - stringWriter.writeLine(' }'); // end of "export { ... }" - - if (astModuleExportInfo.starExportedExternalModules.size > 0) { - // TODO [MA]: write a better error message. - throw new Error( - `Unsupported star export of external module inside namespace imported module: ${entity.nameForEmit}` - ); } + stringWriter.writeLine(' }'); // end of "export { ... }" stringWriter.writeLine('}'); // end of "declare namespace { ... }" } From 857a27a9acb2a36a9dde1b3c5d2ca10cdf68ea64 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 28 Aug 2020 03:26:35 -0700 Subject: [PATCH 21/32] Start work on generating an API report for namespace imports --- .../src/generators/ApiReportGenerator.ts | 79 ++++++++++++++----- .../src/generators/DtsRollupGenerator.ts | 2 +- .../api-extractor-scenarios.api.md | 28 +++++++ .../config/api-extractor-overrides.json | 5 -- 4 files changed, 89 insertions(+), 25 deletions(-) create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md delete mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 078b5c9aacf..eb56188dad6 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -17,6 +17,9 @@ import { ExtractorMessage } from '../api/ExtractorMessage'; import { StringWriter } from './StringWriter'; import { DtsEmitHelpers } from './DtsEmitHelpers'; import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; +import { AstEntity } from '../analyzer/AstEntity'; +import { AstModuleExportInfo } from '../analyzer/AstModule'; +import { SourceFileLocationFormatter } from '../analyzer/SourceFileLocationFormatter'; export class ApiReportGenerator { private static _trimSpacesRegExp: RegExp = / +$/gm; @@ -68,6 +71,7 @@ export class ApiReportGenerator { // Emit the regular declarations for (const entity of collector.entities) { + const astEntity: AstEntity = entity.astEntity; if (entity.exported) { // First, collect the list of export names for this symbol. When reporting messages with // ExtractorMessage.properties.exportName, this will enable us to emit the warning comments alongside @@ -84,9 +88,9 @@ export class ApiReportGenerator { } } - if (entity.astEntity instanceof AstSymbol) { + if (astEntity instanceof AstSymbol) { // Emit all the declarations for this entity - for (const astDeclaration of entity.astEntity.astDeclarations || []) { + for (const astDeclaration of astEntity.astDeclarations || []) { // Get the messages associated with this declaration const fetchedMessages: ExtractorMessage[] = collector.messageRouter.fetchAssociatedMessagesForReviewFile( astDeclaration @@ -127,12 +131,61 @@ export class ApiReportGenerator { } } - if (entity.astEntity instanceof AstNamespaceImport) { - throw new Error( - '"import * as ___ from ___;" is not supported for local files when generating report.' + - '\nFailure in: ' + - ApiReportGenerator._getSourceFilePath(entity.astEntity) + if (astEntity instanceof AstNamespaceImport) { + const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( + astEntity.astModule ); + + if (entity.nameForEmit === undefined) { + // This should never happen + throw new InternalError('referencedEntry.nameForEmit is undefined'); + } + + if (astModuleExportInfo.starExportedExternalModules.size > 0) { + // We could support this, but we would need to find a way to safely represent it. + throw new Error( + `The ${entity.nameForEmit} namespace import includes a start export, which is not supported:\n` + + SourceFileLocationFormatter.formatDeclaration(astEntity.declaration) + ); + } + + // Emit a synthetic declaration for the namespace. It will look like this: + // + // declare namespace example { + // export { + // f1, + // f2 + // } + // } + // + // Note that we do not try to relocate f1()/f2() to be inside the namespace because other type + // signatures may reference them directly (without using the namespace qualifier). + + stringWriter.writeLine(`declare namespace ${entity.nameForEmit} {`); + + // all local exports of local imported module are just references to top-level declarations + stringWriter.writeLine(' export {'); + for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { + const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity( + exportedEntity + ); + if (collectorEntity === undefined) { + // This should never happen + // top-level exports of local imported module should be added as collector entities before + throw new InternalError( + `Cannot find collector entity for ${entity.nameForEmit}.${exportedEntity.localName}` + ); + } + + if (collectorEntity.nameForEmit === exportedName) { + stringWriter.writeLine(` ${collectorEntity.nameForEmit},`); + } else { + stringWriter.writeLine(` ${collectorEntity.nameForEmit} as ${exportedName},`); + } + } + + stringWriter.writeLine(' }'); // end of "export { ... }" + stringWriter.writeLine('}'); // end of "declare namespace { ... }" } // Now emit the export statements for this entity. @@ -182,18 +235,6 @@ export class ApiReportGenerator { return stringWriter.toString().replace(ApiReportGenerator._trimSpacesRegExp, ''); } - private static _getSourceFilePath(namespaceImport: AstNamespaceImport): string { - const fallback: string = 'unknown source file'; - const { astModule } = namespaceImport; - - if (astModule === undefined || astModule.sourceFile === undefined) { - return fallback; - } - - const sourceFile: ts.SourceFile = astModule.sourceFile.getSourceFile(); - return sourceFile ? sourceFile.fileName : fallback; - } - /** * Before writing out a declaration, _modifySpan() applies various fixups to make it nice. */ diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index 38463370984..f628e9c8650 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -161,7 +161,7 @@ export class DtsRollupGenerator { // We could support this, but we would need to find a way to safely represent it. throw new Error( `The ${entity.nameForEmit} namespace import includes a start export, which is not supported:\n` + - +SourceFileLocationFormatter.formatDeclaration(astEntity.declaration) + SourceFileLocationFormatter.formatDeclaration(astEntity.declaration) ); } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md new file mode 100644 index 00000000000..eb413e28fd0 --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md @@ -0,0 +1,28 @@ +## 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 + +declare namespace calculator { + export { + add, + subtract, + calucatorVersion, + } +} +export { calculator } + +declare namespace calculator2 { + export { + add_2 as add, + subtract_2 as subtract, + calucatorVersion, + } +} +export { calculator2 } + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json b/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json deleted file mode 100644 index bcf667e2338..00000000000 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/config/api-extractor-overrides.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "apiReport": { - "enabled": false - } -} From 88ce9ca11277d41f3127a35ef0ae9813211f6ed2 Mon Sep 17 00:00:00 2001 From: Marcus Andersson Date: Thu, 1 Oct 2020 09:17:11 +0200 Subject: [PATCH 22/32] fixed issue in change log. --- .../api-extractor/export-star-as-support_2020-03-25-13-53.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json index ffb7dae3ee1..69967bd0531 100644 --- a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json +++ b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json @@ -2,7 +2,7 @@ "changes": [ { "packageName": "@microsoft/api-extractor", - "comment": "Added support for "import * as module from './local/module';\"", + "comment": "Added support for \"import * as module from './local/module';\"", "type": "minor" } ], From 615a387bd78440d943b35f5f9ad8a7d647d7af98 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:09:45 -0700 Subject: [PATCH 23/32] rush build --- .../api-extractor-scenarios.api.json | 158 +++++++++++++++++- 1 file changed, 156 insertions(+), 2 deletions(-) diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index f998ac3659f..7f556f745bd 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -2,8 +2,162 @@ "metadata": { "toolPackage": "@microsoft/api-extractor", "toolVersion": "[test mode]", - "schemaVersion": 1003, - "oldestForwardsCompatibleVersion": 1001 + "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!", From 2e100e690851a54fb1f4a95d7e7bd30b6b4f51e2 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Fri, 25 Jun 2021 15:12:32 -0700 Subject: [PATCH 24/32] Update lockfile --- .../workspace/common/pnpm-lock.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml b/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml index 37659e3b16a..ccdd377ab35 100644 --- a/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml +++ b/build-tests/install-test-workspace/workspace/common/pnpm-lock.yaml @@ -5,13 +5,13 @@ importers: typescript-newest-test: specifiers: '@rushstack/eslint-config': file:rushstack-eslint-config-2.3.4.tgz - '@rushstack/heft': file:rushstack-heft-0.33.0.tgz + '@rushstack/heft': file:rushstack-heft-0.34.0.tgz eslint: ~7.12.1 tslint: ~5.20.1 typescript: ~4.3.2 devDependencies: '@rushstack/eslint-config': file:../temp/tarballs/rushstack-eslint-config-2.3.4.tgz_eslint@7.12.1+typescript@4.3.2 - '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.33.0.tgz + '@rushstack/heft': file:../temp/tarballs/rushstack-heft-0.34.0.tgz eslint: 7.12.1 tslint: 5.20.1_typescript@4.3.2 typescript: 4.3.2 @@ -2771,10 +2771,10 @@ packages: - typescript dev: true - file:../temp/tarballs/rushstack-heft-0.33.0.tgz: - resolution: {tarball: file:../temp/tarballs/rushstack-heft-0.33.0.tgz} + file:../temp/tarballs/rushstack-heft-0.34.0.tgz: + resolution: {tarball: file:../temp/tarballs/rushstack-heft-0.34.0.tgz} name: '@rushstack/heft' - version: 0.33.0 + version: 0.34.0 engines: {node: '>=10.13.0'} hasBin: true dependencies: From 8cac97bdb3399fa9afc7f710f4eeeaa7cd744e46 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sat, 26 Jun 2021 15:06:41 -0700 Subject: [PATCH 25/32] Include /// directives in API report, since they are relevant to API reviews --- apps/api-extractor/src/analyzer/AstEntity.ts | 3 ++- .../src/generators/ApiReportGenerator.ts | 21 ++++++++++++++++--- .../src/generators/DtsRollupGenerator.ts | 12 ++++++++--- .../dist/api-extractor-test-01-beta.d.ts | 1 + .../dist/api-extractor-test-01-public.d.ts | 1 + .../dist/api-extractor-test-01.d.ts | 1 + .../etc/api-extractor-test-01.api.md | 4 ++++ ...port-star-as-support_2021-06-26-22-06.json | 11 ++++++++++ 8 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 common/changes/@microsoft/api-extractor/export-star-as-support_2021-06-26-22-06.json diff --git a/apps/api-extractor/src/analyzer/AstEntity.ts b/apps/api-extractor/src/analyzer/AstEntity.ts index 23c4091014a..b3c6ceeda1b 100644 --- a/apps/api-extractor/src/analyzer/AstEntity.ts +++ b/apps/api-extractor/src/analyzer/AstEntity.ts @@ -37,7 +37,8 @@ export abstract class AstEntity { * Most of API Extractor's output is produced by using the using the `Span` utility to regurgitate strings from * the input .d.ts files. If we need to rename an identifier, the `Span` visitor can pick out an interesting * node and rewrite its string, but otherwise the transformation operates on dumb text and not compiler concepts. - * (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages.) + * (Historically we did this because the compiler's emitter was an internal API, but it still has some advantages, + * for example preserving syntaxes generated by an older compiler to avoid incompatibilities.) * * This strategy does not work for cases where the output looks very different from the input. Today these * cases are always kinds of `import` statements, but that may change in the future. diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 070e790c670..fa1eac67e45 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -56,6 +56,22 @@ export class ApiReportGenerator { // Write the opening delimiter for the Markdown code fence stringWriter.writeLine('```ts\n'); + // Emit the triple slash directives + let directivesEmitted: boolean = false; + for (const typeDirectiveReference of Array.from(collector.dtsTypeReferenceDirectives).sort()) { + // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162 + stringWriter.writeLine(`/// `); + directivesEmitted = true; + } + + for (const libDirectiveReference of Array.from(collector.dtsLibReferenceDirectives).sort()) { + stringWriter.writeLine(`/// `); + directivesEmitted = true; + } + if (directivesEmitted) { + stringWriter.writeLine(); + } + // Emit the imports let importsEmitted: boolean = false; for (const entity of collector.entities) { @@ -165,9 +181,8 @@ export class ApiReportGenerator { // all local exports of local imported module are just references to top-level declarations stringWriter.writeLine(' export {'); for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { - const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity( - exportedEntity - ); + const collectorEntity: CollectorEntity | undefined = + collector.tryGetCollectorEntity(exportedEntity); if (collectorEntity === undefined) { // This should never happen // top-level exports of local imported module should be added as collector entities before diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index 58c6cb5d2b8..870c2ea704e 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -76,19 +76,26 @@ export class DtsRollupGenerator { stringWriter: StringWriter, dtsKind: DtsRollupKind ): void { + // Emit the @packageDocumentation comment at the top of the file if (collector.workingPackage.tsdocParserContext) { stringWriter.writeLine(collector.workingPackage.tsdocParserContext.sourceRange.toString()); stringWriter.writeLine(); } // Emit the triple slash directives + let directivesEmitted: boolean = false; for (const typeDirectiveReference of collector.dtsTypeReferenceDirectives) { // https://github.com/microsoft/TypeScript/blob/611ebc7aadd7a44a4c0447698bfda9222a78cb66/src/compiler/declarationEmitter.ts#L162 stringWriter.writeLine(`/// `); + directivesEmitted = true; } for (const libDirectiveReference of collector.dtsLibReferenceDirectives) { stringWriter.writeLine(`/// `); + directivesEmitted = true; + } + if (directivesEmitted) { + stringWriter.writeLine(); } // Emit the imports @@ -186,9 +193,8 @@ export class DtsRollupGenerator { // all local exports of local imported module are just references to top-level declarations stringWriter.writeLine(' export {'); for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { - const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity( - exportedEntity - ); + const collectorEntity: CollectorEntity | undefined = + collector.tryGetCollectorEntity(exportedEntity); if (collectorEntity === undefined) { // This should never happen // top-level exports of local imported module should be added as collector entities before diff --git a/build-tests/api-extractor-test-01/dist/api-extractor-test-01-beta.d.ts b/build-tests/api-extractor-test-01/dist/api-extractor-test-01-beta.d.ts index 5c348e3cd95..bed419876f7 100644 --- a/build-tests/api-extractor-test-01/dist/api-extractor-test-01-beta.d.ts +++ b/build-tests/api-extractor-test-01/dist/api-extractor-test-01-beta.d.ts @@ -12,6 +12,7 @@ /// /// /// + import { default as Long_2 } from 'long'; import { MAX_UNSIGNED_VALUE } from 'long'; diff --git a/build-tests/api-extractor-test-01/dist/api-extractor-test-01-public.d.ts b/build-tests/api-extractor-test-01/dist/api-extractor-test-01-public.d.ts index 4f8d48dcead..3b331dcbbfa 100644 --- a/build-tests/api-extractor-test-01/dist/api-extractor-test-01-public.d.ts +++ b/build-tests/api-extractor-test-01/dist/api-extractor-test-01-public.d.ts @@ -12,6 +12,7 @@ /// /// /// + import { default as Long_2 } from 'long'; import { MAX_UNSIGNED_VALUE } from 'long'; diff --git a/build-tests/api-extractor-test-01/dist/api-extractor-test-01.d.ts b/build-tests/api-extractor-test-01/dist/api-extractor-test-01.d.ts index dfcd640e294..dfc4227c12e 100644 --- a/build-tests/api-extractor-test-01/dist/api-extractor-test-01.d.ts +++ b/build-tests/api-extractor-test-01/dist/api-extractor-test-01.d.ts @@ -12,6 +12,7 @@ /// /// /// + import { default as Long_2 } from 'long'; import { MAX_UNSIGNED_VALUE } from 'long'; diff --git a/build-tests/api-extractor-test-01/etc/api-extractor-test-01.api.md b/build-tests/api-extractor-test-01/etc/api-extractor-test-01.api.md index fe3cbefe315..87e44be72c0 100644 --- a/build-tests/api-extractor-test-01/etc/api-extractor-test-01.api.md +++ b/build-tests/api-extractor-test-01/etc/api-extractor-test-01.api.md @@ -4,6 +4,10 @@ ```ts +/// +/// +/// + import { default as Long_2 } from 'long'; import { MAX_UNSIGNED_VALUE } from 'long'; diff --git a/common/changes/@microsoft/api-extractor/export-star-as-support_2021-06-26-22-06.json b/common/changes/@microsoft/api-extractor/export-star-as-support_2021-06-26-22-06.json new file mode 100644 index 00000000000..119fff65bef --- /dev/null +++ b/common/changes/@microsoft/api-extractor/export-star-as-support_2021-06-26-22-06.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "@microsoft/api-extractor", + "comment": "Include /// directives in API report", + "type": "patch" + } + ], + "packageName": "@microsoft/api-extractor", + "email": "4673363+octogonz@users.noreply.github.com" +} \ No newline at end of file From 66636f4458a8154e81824839b0b1d4acb610a9d1 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sat, 26 Jun 2021 17:25:26 -0700 Subject: [PATCH 26/32] Introduce CollectorEntity.consumable distinction to ensure that AstNamespaceImport members get analyzed similar to exported APIs --- .../src/analyzer/AstSymbolTable.ts | 6 ++- apps/api-extractor/src/collector/Collector.ts | 11 +++-- .../src/collector/CollectorEntity.ts | 47 ++++++++++++++++++- .../src/enhancers/ValidationEnhancer.ts | 4 +- .../src/generators/ApiReportGenerator.ts | 3 +- .../api-extractor-scenarios.api.json | 8 ++-- .../api-extractor-scenarios.api.md | 15 ++++++ .../exportImportStarAs/rollup.d.ts | 2 + .../src/exportImportStarAs/calculator.ts | 1 + .../src/exportImportStarAs/calculator2.ts | 1 + 10 files changed, 84 insertions(+), 14 deletions(-) diff --git a/apps/api-extractor/src/analyzer/AstSymbolTable.ts b/apps/api-extractor/src/analyzer/AstSymbolTable.ts index 7338285e6dd..e5eae1ffd8c 100644 --- a/apps/api-extractor/src/analyzer/AstSymbolTable.ts +++ b/apps/api-extractor/src/analyzer/AstSymbolTable.ts @@ -284,9 +284,11 @@ export class AstSymbolTable { // mark before actual analyzing, to handle module cyclic reexport astNamespaceImport.analyzed = true; - for (const exportedEntity of this.fetchAstModuleExportInfo( + const exportedLocalEntities: Map = this.fetchAstModuleExportInfo( astNamespaceImport.astModule - ).exportedLocalEntities.values()) { + ).exportedLocalEntities; + + for (const exportedEntity of exportedLocalEntities.values()) { this.analyze(exportedEntity); } } diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index fb641e28945..625bb5778ab 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -393,7 +393,7 @@ export class Collector { return overloadIndex; } - private _createCollectorEntity(astEntity: AstEntity, exportedName: string | undefined): void { + private _createCollectorEntity(astEntity: AstEntity, exportedName: string | undefined): CollectorEntity { let entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astEntity); if (!entity) { @@ -407,6 +407,8 @@ export class Collector { if (exportedName) { entity.addExportName(exportedName); } + + return entity; } private _createEntityForIndirectReferences( @@ -441,9 +443,12 @@ export class Collector { const astModuleExportInfo: AstModuleExportInfo = this.astSymbolTable.fetchAstModuleExportInfo( astEntity.astModule ); + for (const exportedEntity of astModuleExportInfo.exportedLocalEntities.values()) { // Create a CollectorEntity for each top-level export of AstImportInternal entity - this._createCollectorEntity(exportedEntity, undefined); + const entity: CollectorEntity = this._createCollectorEntity(exportedEntity, undefined); + entity.addAstNamespaceImports(astEntity); + this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities); // TODO - create entity for module export @@ -784,7 +789,7 @@ export class Collector { // Don't report missing release tags for forgotten exports const astSymbol: AstSymbol = astDeclaration.astSymbol; const entity: CollectorEntity | undefined = this._entitiesByAstEntity.get(astSymbol.rootAstSymbol); - if (entity && entity.exported) { + if (entity && entity.consumable) { // We also don't report errors for the default export of an entry point, since its doc comment // isn't easy to obtain from the .d.ts file if (astSymbol.rootAstSymbol.localName !== '_default') { diff --git a/apps/api-extractor/src/collector/CollectorEntity.ts b/apps/api-extractor/src/collector/CollectorEntity.ts index 8a7834e33dc..23f57db2c6b 100644 --- a/apps/api-extractor/src/collector/CollectorEntity.ts +++ b/apps/api-extractor/src/collector/CollectorEntity.ts @@ -7,6 +7,7 @@ import { AstSymbol } from '../analyzer/AstSymbol'; import { Collector } from './Collector'; import { Sort } from '@rushstack/node-core-library'; import { AstEntity } from '../analyzer/AstEntity'; +import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; /** * This is a data structure used by the Collector to track an AstEntity that may be emitted in the *.d.ts file. @@ -23,7 +24,7 @@ export class CollectorEntity { */ public readonly astEntity: AstEntity; - private _exportNames: Set = new Set(); + private _exportNames: Set = new Set(); private _exportNamesSorted: boolean = false; private _singleExportName: string | undefined = undefined; @@ -31,6 +32,8 @@ export class CollectorEntity { private _sortKey: string | undefined = undefined; + private _astNamespaceImports: Set = new Set(); + public constructor(astEntity: AstEntity) { this.astEntity = astEntity; } @@ -101,6 +104,48 @@ export class CollectorEntity { return this.exportNames.size > 0; } + /** + * Indicates that it is possible for a consumer of the API to access this declaration, either by importing + * it directly, or via some other alias such as a member of a namespace. If a collector entity is not consumable, + * then API Extractor will report a ExtractorMessageId.ForgottenExport warning. + * + * @remarks + * Generally speaking, an API item is consumable if: + * + * - The collector encounters it while crawling the entry point, and it is a root symbol + * (i.e. there is a corresponding a CollectorEntity) + * + * - AND it is exported by the entry point + * + * However a special case occurs with `AstNamespaceImport` which produces a rollup like this: + * + * ```ts + * declare interface IForgottenExport { } + * + * declare function member(): IForgottenExport; + * + * declare namespace ns { + * export { + * member + * } + * } + * export { ns } + * ``` + * + * In this example, `IForgottenExport` is not consumable. Whereas `member()` is consumable as `ns.member()` + * even though `member()` itself is not exported. + */ + public get consumable(): boolean { + return this.exported || this._astNamespaceImports.size > 0; + } + + /** + * Associates this entity with a `AstNamespaceImport`. + */ + public addAstNamespaceImports(astNamespaceImport: AstNamespaceImport): void { + this._astNamespaceImports.add(astNamespaceImport); + } + /** * Adds a new exportName to the exportNames set. */ diff --git a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts index 582c251eb09..31969391b54 100644 --- a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts +++ b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts @@ -20,7 +20,7 @@ export class ValidationEnhancer { for (const entity of collector.entities) { if (entity.astEntity instanceof AstSymbol) { - if (entity.exported) { + if (entity.consumable) { entity.astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { ValidationEnhancer._checkReferences(collector, astDeclaration, alreadyWarnedSymbols); }); @@ -180,7 +180,7 @@ export class ValidationEnhancer { // TODO: consider exported by local module import const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(rootSymbol); - if (collectorEntity && collectorEntity.exported) { + if (collectorEntity && collectorEntity.consumable) { const referencedMetadata: SymbolMetadata = collector.fetchSymbolMetadata(referencedEntity); const referencedReleaseTag: ReleaseTag = referencedMetadata.maxEffectiveReleaseTag; diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index fa1eac67e45..4fe736043e6 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -80,7 +80,6 @@ export class ApiReportGenerator { importsEmitted = true; } } - if (importsEmitted) { stringWriter.writeLine(); } @@ -88,7 +87,7 @@ export class ApiReportGenerator { // Emit the regular declarations for (const entity of collector.entities) { const astEntity: AstEntity = entity.astEntity; - if (entity.exported) { + if (entity.consumable) { // First, collect the list of export names for this symbol. When reporting messages with // ExtractorMessage.properties.exportName, this will enable us to emit the warning comments alongside // the associated export statement. diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index 7f556f745bd..9470b51d53e 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -259,7 +259,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator.subtract:function(1)", - "docComment": "/**\n * Returns the sum of subtracting `b` from `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n */\n", + "docComment": "/**\n * Returns the sum of subtracting `b` from `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n *\n * @beta\n */\n", "excerptTokens": [ { "kind": "Content", @@ -294,7 +294,7 @@ "startIndex": 5, "endIndex": 6 }, - "releaseTag": "Public", + "releaseTag": "Beta", "overloadIndex": 1, "parameters": [ { @@ -406,7 +406,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator2.subtract:function(1)", - "docComment": "/**\n * Returns the sum of subtracting `b` from `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n */\n", + "docComment": "/**\n * Returns the sum of subtracting `b` from `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of subtract `b` from `a`\n *\n * @beta\n */\n", "excerptTokens": [ { "kind": "Content", @@ -441,7 +441,7 @@ "startIndex": 5, "endIndex": 6 }, - "releaseTag": "Public", + "releaseTag": "Beta", "overloadIndex": 1, "parameters": [ { diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md index eb413e28fd0..f2bb979e4c0 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md @@ -4,6 +4,12 @@ ```ts +// @public (undocumented) +function add(a: number, b: number): number; + +// @public (undocumented) +function add_2(a: bigint, b: bigint): bigint; + declare namespace calculator { export { add, @@ -22,6 +28,15 @@ declare namespace calculator2 { } export { calculator2 } +// @public (undocumented) +const calucatorVersion: string; + +// @beta (undocumented) +function subtract(a: number, b: number): number; + +// @beta (undocumented) +function subtract_2(a: bigint, b: bigint): bigint; + // (No @packageDocumentation comment for this package) diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index 2db5ee04542..856ab4b82a4 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -43,6 +43,7 @@ declare const calucatorVersion: string; * @param a - first number * @param b - second number * @returns Sum of subtract `b` from `a` + * @beta */ declare function subtract(a: number, b: number): number; @@ -51,6 +52,7 @@ declare function subtract(a: number, b: number): number; * @param a - first number * @param b - second number * @returns Sum of subtract `b` from `a` + * @beta */ declare function subtract_2(a: bigint, b: bigint): bigint; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts index 5fe740c6fa4..e8974b66f1a 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts @@ -13,6 +13,7 @@ export function add(a: number, b: number): number { * @param a - first number * @param b - second number * @returns Sum of subtract `b` from `a` + * @beta */ export function subtract(a: number, b: number): number { return a - b; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts index 8f69730bd46..a7aff4d79e6 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts @@ -13,6 +13,7 @@ export function add(a: bigint, b: bigint): bigint { * @param a - first number * @param b - second number * @returns Sum of subtract `b` from `a` + * @beta */ export function subtract(a: bigint, b: bigint): bigint { return a - b; From ec267b3c0f4eb638a2238dc3018396e1b1fab62c Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sat, 26 Jun 2021 17:37:06 -0700 Subject: [PATCH 27/32] Fix an issue where DocCommentEnhancer was skipping AstNamespaceImport members --- apps/api-extractor/src/enhancers/DocCommentEnhancer.ts | 2 +- .../api-extractor-scenarios.api.json | 8 ++++---- .../exportImportStarAs/api-extractor-scenarios.api.md | 10 +++++----- .../etc/test-outputs/exportImportStarAs/rollup.d.ts | 3 +++ .../src/exportImportStarAs/calculator.ts | 1 + .../src/exportImportStarAs/calculator2.ts | 1 + .../src/exportImportStarAs/common.ts | 1 + 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/apps/api-extractor/src/enhancers/DocCommentEnhancer.ts b/apps/api-extractor/src/enhancers/DocCommentEnhancer.ts index b3596062b57..ee7637d0161 100644 --- a/apps/api-extractor/src/enhancers/DocCommentEnhancer.ts +++ b/apps/api-extractor/src/enhancers/DocCommentEnhancer.ts @@ -28,7 +28,7 @@ export class DocCommentEnhancer { public analyze(): void { for (const entity of this._collector.entities) { if (entity.astEntity instanceof AstSymbol) { - if (entity.exported) { + if (entity.consumable) { entity.astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { this._analyzeApiItem(astDeclaration); }); diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json index 9470b51d53e..e2d42c40dbc 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.json @@ -180,7 +180,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator.add:function(1)", - "docComment": "/**\n * Returns the sum of adding `b` to `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n */\n", + "docComment": "/**\n * Returns the sum of adding `b` to `a`\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", @@ -238,7 +238,7 @@ { "kind": "Variable", "canonicalReference": "api-extractor-scenarios!calculator.calucatorVersion:var", - "docComment": "/**\n * Returns the version of the calculator.\n */\n", + "docComment": "/**\n * Returns the version of the calculator.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", @@ -327,7 +327,7 @@ { "kind": "Function", "canonicalReference": "api-extractor-scenarios!calculator2.add:function(1)", - "docComment": "/**\n * Returns the sum of adding `b` to `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n */\n", + "docComment": "/**\n * Returns the sum of adding `b` to `a` for large integers\n *\n * @param a - first number\n *\n * @param b - second number\n *\n * @returns Sum of adding `b` to `a`\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", @@ -385,7 +385,7 @@ { "kind": "Variable", "canonicalReference": "api-extractor-scenarios!calculator2.calucatorVersion:var", - "docComment": "/**\n * Returns the version of the calculator.\n */\n", + "docComment": "/**\n * Returns the version of the calculator.\n *\n * @public\n */\n", "excerptTokens": [ { "kind": "Content", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md index f2bb979e4c0..ac0742b2378 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md @@ -4,10 +4,10 @@ ```ts -// @public (undocumented) +// @public function add(a: number, b: number): number; -// @public (undocumented) +// @public function add_2(a: bigint, b: bigint): bigint; declare namespace calculator { @@ -28,13 +28,13 @@ declare namespace calculator2 { } export { calculator2 } -// @public (undocumented) +// @public const calucatorVersion: string; -// @beta (undocumented) +// @beta function subtract(a: number, b: number): number; -// @beta (undocumented) +// @beta function subtract_2(a: bigint, b: bigint): bigint; diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index 856ab4b82a4..df1bc3c75de 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -4,6 +4,7 @@ * @param a - first number * @param b - second number * @returns Sum of adding `b` to `a` + * @public */ declare function add(a: number, b: number): number; @@ -12,6 +13,7 @@ declare function add(a: number, b: number): number; * @param a - first number * @param b - second number * @returns Sum of adding `b` to `a` + * @public */ declare function add_2(a: bigint, b: bigint): bigint; @@ -35,6 +37,7 @@ export { calculator2 } /** * Returns the version of the calculator. + * @public */ declare const calucatorVersion: string; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts index e8974b66f1a..17df6809b45 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator.ts @@ -3,6 +3,7 @@ * @param a - first number * @param b - second number * @returns Sum of adding `b` to `a` + * @public */ export function add(a: number, b: number): number { return a + b; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts index a7aff4d79e6..38b5ef6950a 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/calculator2.ts @@ -3,6 +3,7 @@ * @param a - first number * @param b - second number * @returns Sum of adding `b` to `a` + * @public */ export function add(a: bigint, b: bigint): bigint { return a + b; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts index 3137419e17f..1e4914ce34e 100644 --- a/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs/common.ts @@ -1,4 +1,5 @@ /** * Returns the version of the calculator. + * @public */ export const calucatorVersion: string = '1.0.0'; From 0ba97489e623025c1549ca96a2e32cbd08a2edb6 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Sat, 26 Jun 2021 17:45:55 -0700 Subject: [PATCH 28/32] Eliminate trailing comma --- apps/api-extractor/src/generators/ApiReportGenerator.ts | 7 +++++-- apps/api-extractor/src/generators/DtsRollupGenerator.ts | 7 +++++-- .../exportImportStarAs/api-extractor-scenarios.api.md | 4 ++-- .../etc/test-outputs/exportImportStarAs/rollup.d.ts | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index 4fe736043e6..c8eb23b54ca 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -179,6 +179,8 @@ export class ApiReportGenerator { // all local exports of local imported module are just references to top-level declarations stringWriter.writeLine(' export {'); + + const exportClauses: string[] = []; for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(exportedEntity); @@ -191,11 +193,12 @@ export class ApiReportGenerator { } if (collectorEntity.nameForEmit === exportedName) { - stringWriter.writeLine(` ${collectorEntity.nameForEmit},`); + exportClauses.push(collectorEntity.nameForEmit); } else { - stringWriter.writeLine(` ${collectorEntity.nameForEmit} as ${exportedName},`); + exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`); } } + stringWriter.writeLine(exportClauses.map((x) => ` ${x}`).join(',\n')); stringWriter.writeLine(' }'); // end of "export { ... }" stringWriter.writeLine('}'); // end of "declare namespace { ... }" diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index 870c2ea704e..f088fdee383 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -192,6 +192,8 @@ export class DtsRollupGenerator { // all local exports of local imported module are just references to top-level declarations stringWriter.writeLine(' export {'); + + const exportClauses: string[] = []; for (const [exportedName, exportedEntity] of astModuleExportInfo.exportedLocalEntities) { const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(exportedEntity); @@ -204,11 +206,12 @@ export class DtsRollupGenerator { } if (collectorEntity.nameForEmit === exportedName) { - stringWriter.writeLine(` ${collectorEntity.nameForEmit},`); + exportClauses.push(collectorEntity.nameForEmit); } else { - stringWriter.writeLine(` ${collectorEntity.nameForEmit} as ${exportedName},`); + exportClauses.push(`${collectorEntity.nameForEmit} as ${exportedName}`); } } + stringWriter.writeLine(exportClauses.map((x) => ` ${x}`).join(',\n')); stringWriter.writeLine(' }'); // end of "export { ... }" stringWriter.writeLine('}'); // end of "declare namespace { ... }" diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md index ac0742b2378..3bbae48831e 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/api-extractor-scenarios.api.md @@ -14,7 +14,7 @@ declare namespace calculator { export { add, subtract, - calucatorVersion, + calucatorVersion } } export { calculator } @@ -23,7 +23,7 @@ declare namespace calculator2 { export { add_2 as add, subtract_2 as subtract, - calucatorVersion, + calucatorVersion } } export { calculator2 } diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts index df1bc3c75de..2739b94b6fc 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs/rollup.d.ts @@ -21,7 +21,7 @@ declare namespace calculator { export { add, subtract, - calucatorVersion, + calucatorVersion } } export { calculator } @@ -30,7 +30,7 @@ declare namespace calculator2 { export { add_2 as add, subtract_2 as subtract, - calucatorVersion, + calucatorVersion } } export { calculator2 } From 51acb5490c90ef7f83c748221d4332883ad41118 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 29 Jun 2021 22:00:33 -0700 Subject: [PATCH 29/32] Add a second test case --- .../config/build-config.json | 1 + .../api-extractor-scenarios.api.json | 217 ++++++++++++++++++ .../api-extractor-scenarios.api.md | 24 ++ .../exportImportStarAs2/rollup.d.ts | 26 +++ .../src/exportImportStarAs2/forgottenNs.ts | 4 + .../src/exportImportStarAs2/index.ts | 2 + .../src/exportImportStarAs2/ns.ts | 8 + 7 files changed, 282 insertions(+) create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.json create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md create mode 100644 build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/rollup.d.ts create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs2/forgottenNs.ts create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs2/index.ts create mode 100644 build-tests/api-extractor-scenarios/src/exportImportStarAs2/ns.ts diff --git a/build-tests/api-extractor-scenarios/config/build-config.json b/build-tests/api-extractor-scenarios/config/build-config.json index 221eb306b87..b2716da13c5 100644 --- a/build-tests/api-extractor-scenarios/config/build-config.json +++ b/build-tests/api-extractor-scenarios/config/build-config.json @@ -21,6 +21,7 @@ "exportImportedExternal2", "exportImportedExternalDefault", "exportImportStarAs", + "exportImportStarAs2", "exportStar", "exportStar2", "exportStar3", diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.json b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.json new file mode 100644 index 00000000000..28fe5c46bfe --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.json @@ -0,0 +1,217 @@ +{ + "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": "Namespace", + "canonicalReference": "api-extractor-scenarios!ns:namespace", + "docComment": "", + "excerptTokens": [], + "releaseTag": "None", + "name": "ns", + "members": [ + { + "kind": "Function", + "canonicalReference": "api-extractor-scenarios!ns.exportedApi:function(1)", + "docComment": "/**\n * @public\n */\n", + "excerptTokens": [ + { + "kind": "Content", + "text": "export declare function exportedApi(): " + }, + { + "kind": "Content", + "text": "forgottenNs." + }, + { + "kind": "Reference", + "text": "ForgottenClass", + "canonicalReference": "api-extractor-scenarios!ForgottenClass:class" + }, + { + "kind": "Content", + "text": ";" + } + ], + "returnTypeTokenRange": { + "startIndex": 1, + "endIndex": 3 + }, + "releaseTag": "Public", + "overloadIndex": 1, + "parameters": [], + "name": "exportedApi" + } + ] + } + ] + } + ] +} diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md new file mode 100644 index 00000000000..67e52795bee --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md @@ -0,0 +1,24 @@ +## 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 + +// @public (undocumented) +function exportedApi(): forgottenNs.ForgottenClass; + +// @public (undocumented) +class ForgottenClass { +} + +declare namespace ns { + export { + exportedApi + } +} +export { ns } + + +// (No @packageDocumentation comment for this package) + +``` diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/rollup.d.ts b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/rollup.d.ts new file mode 100644 index 00000000000..e171807fd0f --- /dev/null +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/rollup.d.ts @@ -0,0 +1,26 @@ + +/** + * @public + */ +declare function exportedApi(): forgottenNs.ForgottenClass; + +/** + * @public + */ +declare class ForgottenClass { +} + +declare namespace forgottenNs { + export { + ForgottenClass + } +} + +declare namespace ns { + export { + exportedApi + } +} +export { ns } + +export { } diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs2/forgottenNs.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/forgottenNs.ts new file mode 100644 index 00000000000..fc104acc837 --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/forgottenNs.ts @@ -0,0 +1,4 @@ +/** + * @public + */ +export class ForgottenClass {} diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs2/index.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/index.ts new file mode 100644 index 00000000000..2e3ab2c86ca --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/index.ts @@ -0,0 +1,2 @@ +import * as ns from './ns'; +export { ns }; diff --git a/build-tests/api-extractor-scenarios/src/exportImportStarAs2/ns.ts b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/ns.ts new file mode 100644 index 00000000000..5ea39d1dc1c --- /dev/null +++ b/build-tests/api-extractor-scenarios/src/exportImportStarAs2/ns.ts @@ -0,0 +1,8 @@ +import * as forgottenNs from './forgottenNs'; + +/** + * @public + */ +export function exportedApi(): forgottenNs.ForgottenClass { + return new forgottenNs.ForgottenClass(); +} From 12799aab1781205097b920d4e0fc7d2e1bc2226d Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 29 Jun 2021 22:21:39 -0700 Subject: [PATCH 30/32] Implement the missing ae-forgotten-export analysis for AstNamespaceImport references --- apps/api-extractor/.vscode/launch.json | 8 +- .../src/analyzer/AstNamespaceImport.ts | 10 +- apps/api-extractor/src/collector/Collector.ts | 7 +- .../src/enhancers/ValidationEnhancer.ts | 147 +++++++++++------- .../src/generators/ApiModelGenerator.ts | 14 ++ .../src/generators/ApiReportGenerator.ts | 4 +- .../src/generators/DtsRollupGenerator.ts | 4 +- .../api-extractor-scenarios.api.md | 2 + 8 files changed, 130 insertions(+), 66 deletions(-) diff --git a/apps/api-extractor/.vscode/launch.json b/apps/api-extractor/.vscode/launch.json index f81af6c2ef3..2a4aa769b6b 100644 --- a/apps/api-extractor/.vscode/launch.json +++ b/apps/api-extractor/.vscode/launch.json @@ -74,7 +74,13 @@ "name": "scenario", "program": "${workspaceFolder}/lib/start.js", "cwd": "${workspaceFolder}/../../build-tests/api-extractor-scenarios", - "args": ["--debug", "run", "--local", "--config", "./temp/configs/api-extractor-typeof.json"], + "args": [ + "--debug", + "run", + "--local", + "--config", + "./temp/configs/api-extractor-exportImportStarAs2.json" + ], "sourceMaps": true } ] diff --git a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts index 1ba6985beef..955ef903d27 100644 --- a/apps/api-extractor/src/analyzer/AstNamespaceImport.ts +++ b/apps/api-extractor/src/analyzer/AstNamespaceImport.ts @@ -3,8 +3,9 @@ import * as ts from 'typescript'; -import { AstModule } from './AstModule'; +import { AstModule, AstModuleExportInfo } from './AstModule'; import { AstSyntheticEntity } from './AstEntity'; +import { Collector } from '../collector/Collector'; export interface IAstNamespaceImportOptions { readonly astModule: AstModule; @@ -78,4 +79,11 @@ export class AstNamespaceImport extends AstSyntheticEntity { // abstract return this.namespaceName; } + + public fetchAstModuleExportInfo(collector: Collector): AstModuleExportInfo { + const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( + this.astModule + ); + return astModuleExportInfo; + } } diff --git a/apps/api-extractor/src/collector/Collector.ts b/apps/api-extractor/src/collector/Collector.ts index 625bb5778ab..c963a448fe4 100644 --- a/apps/api-extractor/src/collector/Collector.ts +++ b/apps/api-extractor/src/collector/Collector.ts @@ -234,6 +234,7 @@ export class Collector { const astModuleExportInfo: AstModuleExportInfo = this.astSymbolTable.fetchAstModuleExportInfo(astEntryPoint); + for (const [exportName, astEntity] of astModuleExportInfo.exportedLocalEntities) { this._createCollectorEntity(astEntity, exportName); @@ -440,9 +441,7 @@ export class Collector { } if (astEntity instanceof AstNamespaceImport) { - const astModuleExportInfo: AstModuleExportInfo = this.astSymbolTable.fetchAstModuleExportInfo( - astEntity.astModule - ); + const astModuleExportInfo: AstModuleExportInfo = astEntity.fetchAstModuleExportInfo(this); for (const exportedEntity of astModuleExportInfo.exportedLocalEntities.values()) { // Create a CollectorEntity for each top-level export of AstImportInternal entity @@ -450,8 +449,6 @@ export class Collector { entity.addAstNamespaceImports(astEntity); this._createEntityForIndirectReferences(exportedEntity, alreadySeenAstEntities); - - // TODO - create entity for module export } } } diff --git a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts index 31969391b54..302480ee86d 100644 --- a/apps/api-extractor/src/enhancers/ValidationEnhancer.ts +++ b/apps/api-extractor/src/enhancers/ValidationEnhancer.ts @@ -13,26 +13,52 @@ import { CollectorEntity } from '../collector/CollectorEntity'; import { ExtractorMessageId } from '../api/ExtractorMessageId'; import { ReleaseTag } from '@microsoft/api-extractor-model'; import { AstNamespaceImport } from '../analyzer/AstNamespaceImport'; +import { AstModuleExportInfo } from '../analyzer/AstModule'; +import { AstEntity } from '../analyzer/AstEntity'; export class ValidationEnhancer { public static analyze(collector: Collector): void { - const alreadyWarnedSymbols: Set = new Set(); + const alreadyWarnedEntities: Set = new Set(); for (const entity of collector.entities) { - if (entity.astEntity instanceof AstSymbol) { - if (entity.consumable) { - entity.astEntity.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { - ValidationEnhancer._checkReferences(collector, astDeclaration, alreadyWarnedSymbols); - }); - - const symbolMetadata: SymbolMetadata = collector.fetchSymbolMetadata(entity.astEntity); - ValidationEnhancer._checkForInternalUnderscore(collector, entity, entity.astEntity, symbolMetadata); - ValidationEnhancer._checkForInconsistentReleaseTags(collector, entity.astEntity, symbolMetadata); - } + if (!entity.consumable) { + continue; } - if (entity.astEntity instanceof AstNamespaceImport) { - // TODO [MA]: validation for local module import + if (entity.astEntity instanceof AstSymbol) { + // A regular exported AstSymbol + + const astSymbol: AstSymbol = entity.astEntity; + + astSymbol.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { + ValidationEnhancer._checkReferences(collector, astDeclaration, alreadyWarnedEntities); + }); + + const symbolMetadata: SymbolMetadata = collector.fetchSymbolMetadata(astSymbol); + ValidationEnhancer._checkForInternalUnderscore(collector, entity, astSymbol, symbolMetadata); + ValidationEnhancer._checkForInconsistentReleaseTags(collector, astSymbol, symbolMetadata); + } else if (entity.astEntity instanceof AstNamespaceImport) { + // A namespace created using "import * as ___ from ___" + const astNamespaceImport: AstNamespaceImport = entity.astEntity; + + const astModuleExportInfo: AstModuleExportInfo = + astNamespaceImport.fetchAstModuleExportInfo(collector); + + for (const namespaceMemberAstEntity of astModuleExportInfo.exportedLocalEntities.values()) { + if (namespaceMemberAstEntity instanceof AstSymbol) { + const astSymbol: AstSymbol = namespaceMemberAstEntity; + + astSymbol.forEachDeclarationRecursive((astDeclaration: AstDeclaration) => { + ValidationEnhancer._checkReferences(collector, astDeclaration, alreadyWarnedEntities); + }); + + const symbolMetadata: SymbolMetadata = collector.fetchSymbolMetadata(astSymbol); + + // (Don't apply ValidationEnhancer._checkForInternalUnderscore() for AstNamespaceImport members) + + ValidationEnhancer._checkForInconsistentReleaseTags(collector, astSymbol, symbolMetadata); + } + } } } } @@ -163,12 +189,16 @@ export class ValidationEnhancer { private static _checkReferences( collector: Collector, astDeclaration: AstDeclaration, - alreadyWarnedSymbols: Set + alreadyWarnedEntities: Set ): void { const apiItemMetadata: ApiItemMetadata = collector.fetchApiItemMetadata(astDeclaration); const declarationReleaseTag: ReleaseTag = apiItemMetadata.effectiveReleaseTag; for (const referencedEntity of astDeclaration.referencedAstEntities) { + let collectorEntity: CollectorEntity | undefined; + let referencedReleaseTag: ReleaseTag; + let localName: string; + if (referencedEntity instanceof AstSymbol) { // If this is e.g. a member of a namespace, then we need to be checking the top-level scope to see // whether it's exported. @@ -176,50 +206,61 @@ export class ValidationEnhancer { // TODO: Technically we should also check each of the nested scopes along the way. const rootSymbol: AstSymbol = referencedEntity.rootAstSymbol; - if (!rootSymbol.isExternal) { - // TODO: consider exported by local module import - const collectorEntity: CollectorEntity | undefined = collector.tryGetCollectorEntity(rootSymbol); - - if (collectorEntity && collectorEntity.consumable) { - const referencedMetadata: SymbolMetadata = collector.fetchSymbolMetadata(referencedEntity); - const referencedReleaseTag: ReleaseTag = referencedMetadata.maxEffectiveReleaseTag; - - if (ReleaseTag.compare(declarationReleaseTag, referencedReleaseTag) > 0) { - collector.messageRouter.addAnalyzerIssue( - ExtractorMessageId.IncompatibleReleaseTags, - `The symbol "${astDeclaration.astSymbol.localName}"` + - ` is marked as ${ReleaseTag.getTagName(declarationReleaseTag)},` + - ` but its signature references "${referencedEntity.localName}"` + - ` which is marked as ${ReleaseTag.getTagName(referencedReleaseTag)}`, - astDeclaration - ); - } + if (rootSymbol.isExternal) { + continue; + } + + localName = rootSymbol.localName; + + collectorEntity = collector.tryGetCollectorEntity(rootSymbol); + + const referencedMetadata: SymbolMetadata = collector.fetchSymbolMetadata(referencedEntity); + referencedReleaseTag = referencedMetadata.maxEffectiveReleaseTag; + } else if (referencedEntity instanceof AstNamespaceImport) { + collectorEntity = collector.tryGetCollectorEntity(referencedEntity); + + // TODO: Currently the "import * as ___ from ___" syntax does not yet support doc comments + referencedReleaseTag = ReleaseTag.Public; + + localName = referencedEntity.localName; + } else { + continue; + } + + if (collectorEntity && collectorEntity.consumable) { + if (ReleaseTag.compare(declarationReleaseTag, referencedReleaseTag) > 0) { + collector.messageRouter.addAnalyzerIssue( + ExtractorMessageId.IncompatibleReleaseTags, + `The symbol "${astDeclaration.astSymbol.localName}"` + + ` is marked as ${ReleaseTag.getTagName(declarationReleaseTag)},` + + ` but its signature references "${referencedEntity.localName}"` + + ` which is marked as ${ReleaseTag.getTagName(referencedReleaseTag)}`, + astDeclaration + ); + } + } else { + const entryPointFilename: string = path.basename( + collector.workingPackage.entryPointSourceFile.fileName + ); + + if (!alreadyWarnedEntities.has(referencedEntity)) { + alreadyWarnedEntities.add(referencedEntity); + + if ( + referencedEntity instanceof AstSymbol && + ValidationEnhancer._isEcmaScriptSymbol(referencedEntity) + ) { + // The main usage scenario for ECMAScript symbols is to attach private data to a JavaScript object, + // so as a special case, we do NOT report them as forgotten exports. } else { - const entryPointFilename: string = path.basename( - collector.workingPackage.entryPointSourceFile.fileName + collector.messageRouter.addAnalyzerIssue( + ExtractorMessageId.ForgottenExport, + `The symbol "${localName}" needs to be exported by the entry point ${entryPointFilename}`, + astDeclaration ); - - if (!alreadyWarnedSymbols.has(referencedEntity)) { - alreadyWarnedSymbols.add(referencedEntity); - - // The main usage scenario for ECMAScript symbols is to attach private data to a JavaScript object, - // so as a special case, we do NOT report them as forgotten exports. - if (!ValidationEnhancer._isEcmaScriptSymbol(referencedEntity)) { - collector.messageRouter.addAnalyzerIssue( - ExtractorMessageId.ForgottenExport, - `The symbol "${rootSymbol.localName}" needs to be exported` + - ` by the entry point ${entryPointFilename}`, - astDeclaration - ); - } - } } } } - - if (referencedEntity instanceof AstNamespaceImport) { - // TODO [MA]: add validation for local import - } } } diff --git a/apps/api-extractor/src/generators/ApiModelGenerator.ts b/apps/api-extractor/src/generators/ApiModelGenerator.ts index 5b6557b6149..648a762a0b6 100644 --- a/apps/api-extractor/src/generators/ApiModelGenerator.ts +++ b/apps/api-extractor/src/generators/ApiModelGenerator.ts @@ -102,6 +102,20 @@ export class ApiModelGenerator { } if (astEntity instanceof AstNamespaceImport) { + // Note that a single API item can belong to two different AstNamespaceImport namespaces. For example: + // + // // file.ts defines "thing()" + // import * as example1 from "./file"; + // import * as example2 from "./file"; + // + // // ...so here we end up with example1.thing() and example2.thing() + // export { example1, example2 } + // + // The current logic does not try to associate "thing()" with a specific parent. Instead + // the API documentation will show duplicated entries for example1.thing() and example2.thing()./ + // + // This could be improved in the future, but it requires a stable mechanism for choosing an associated parent. + // For thoughts about this: https://github.com/microsoft/rushstack/issues/1308 this._processAstModule(astEntity.astModule, exportedName, parentApiItem); return; } diff --git a/apps/api-extractor/src/generators/ApiReportGenerator.ts b/apps/api-extractor/src/generators/ApiReportGenerator.ts index c8eb23b54ca..e9a40e283e0 100644 --- a/apps/api-extractor/src/generators/ApiReportGenerator.ts +++ b/apps/api-extractor/src/generators/ApiReportGenerator.ts @@ -146,9 +146,7 @@ export class ApiReportGenerator { } if (astEntity instanceof AstNamespaceImport) { - const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( - astEntity.astModule - ); + const astModuleExportInfo: AstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector); if (entity.nameForEmit === undefined) { // This should never happen diff --git a/apps/api-extractor/src/generators/DtsRollupGenerator.ts b/apps/api-extractor/src/generators/DtsRollupGenerator.ts index f088fdee383..452dcd3b37e 100644 --- a/apps/api-extractor/src/generators/DtsRollupGenerator.ts +++ b/apps/api-extractor/src/generators/DtsRollupGenerator.ts @@ -155,9 +155,7 @@ export class DtsRollupGenerator { } if (astEntity instanceof AstNamespaceImport) { - const astModuleExportInfo: AstModuleExportInfo = collector.astSymbolTable.fetchAstModuleExportInfo( - astEntity.astModule - ); + const astModuleExportInfo: AstModuleExportInfo = astEntity.fetchAstModuleExportInfo(collector); if (entity.nameForEmit === undefined) { // This should never happen diff --git a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md index 67e52795bee..cdb87e341e9 100644 --- a/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md +++ b/build-tests/api-extractor-scenarios/etc/test-outputs/exportImportStarAs2/api-extractor-scenarios.api.md @@ -4,6 +4,8 @@ ```ts +// Warning: (ae-forgotten-export) The symbol "forgottenNs" needs to be exported by the entry point index.d.ts +// // @public (undocumented) function exportedApi(): forgottenNs.ForgottenClass; From fcc005afefaa3cc8ff4e784166517efc67ade16c Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 29 Jun 2021 22:31:43 -0700 Subject: [PATCH 31/32] Update change log --- .../export-star-as-support_2020-03-25-13-53.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json index 69967bd0531..dfb20e6e7ce 100644 --- a/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json +++ b/common/changes/@microsoft/api-extractor/export-star-as-support_2020-03-25-13-53.json @@ -2,10 +2,10 @@ "changes": [ { "packageName": "@microsoft/api-extractor", - "comment": "Added support for \"import * as module from './local/module';\"", + "comment": "Added support for \"import * as module from './local/module';\" (GitHub #1029) -- Big thanks to @adventure-yunfei, @mckn, @rbuckton, and @octogonz who all helped with this difficult PR!", "type": "minor" } ], "packageName": "@microsoft/api-extractor", "email": "mckn@users.noreply.github.com" -} \ No newline at end of file +} From 73a34980f6b623f19af9f92efa43983d08af8181 Mon Sep 17 00:00:00 2001 From: Pete Gonzalez <4673363+octogonz@users.noreply.github.com> Date: Tue, 29 Jun 2021 23:01:41 -0700 Subject: [PATCH 32/32] Improve the error message for not yet supported "export * as ___ from" syntax --- .../src/analyzer/ExportAnalyzer.ts | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts index 19f6e8715dd..46937c8f42f 100644 --- a/apps/api-extractor/src/analyzer/ExportAnalyzer.ts +++ b/apps/api-extractor/src/analyzer/ExportAnalyzer.ts @@ -445,6 +445,26 @@ export class ExportAnalyzer { // Example: " ExportName as RenamedName" const exportSpecifier: ts.ExportSpecifier = declaration as ts.ExportSpecifier; exportName = (exportSpecifier.propertyName || exportSpecifier.name).getText().trim(); + } else if (declaration.kind === ts.SyntaxKind.NamespaceExport) { + // EXAMPLE: + // "export * as theLib from 'the-lib';" + // + // ExportDeclaration: + // ExportKeyword: pre=[export] sep=[ ] + // NamespaceExport: + // AsteriskToken: pre=[*] sep=[ ] + // AsKeyword: pre=[as] sep=[ ] + // Identifier: pre=[theLib] sep=[ ] + // FromKeyword: pre=[from] sep=[ ] + // StringLiteral: pre=['the-lib'] + // SemicolonToken: pre=[;] + + // Issue tracking this feature: https://github.com/microsoft/rushstack/issues/2780 + throw new Error( + `The "export * as ___" syntax is not supported yet; as a workaround,` + + ` use "import * as ___" with a separate "export { ___ }" declaration\n` + + SourceFileLocationFormatter.formatDeclaration(declaration) + ); } else { throw new InternalError( `Unimplemented export declaration kind: ${declaration.getText()}\n` + @@ -505,9 +525,8 @@ export class ExportAnalyzer { if (externalModulePath === undefined) { const astModule: AstModule = this._fetchSpecifierAstModule(importDeclaration, declarationSymbol); - let namespaceImport: AstNamespaceImport | undefined = this._astNamespaceImportByModule.get( - astModule - ); + let namespaceImport: AstNamespaceImport | undefined = + this._astNamespaceImportByModule.get(astModule); if (namespaceImport === undefined) { namespaceImport = new AstNamespaceImport({ namespaceName: declarationSymbol.name,