@microsoft/api-extractor 7.56.3 → 7.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +29 -0
- package/CHANGELOG.md +8 -1
- package/bin/api-extractor +1 -1
- package/lib-esm/aedoc/PackageDocComment.js +56 -0
- package/lib-esm/aedoc/PackageDocComment.js.map +1 -0
- package/lib-esm/analyzer/AstDeclaration.js +214 -0
- package/lib-esm/analyzer/AstDeclaration.js.map +1 -0
- package/lib-esm/analyzer/AstEntity.js +35 -0
- package/lib-esm/analyzer/AstEntity.js.map +1 -0
- package/lib-esm/analyzer/AstImport.js +76 -0
- package/lib-esm/analyzer/AstImport.js.map +1 -0
- package/lib-esm/analyzer/AstModule.js +22 -0
- package/lib-esm/analyzer/AstModule.js.map +1 -0
- package/lib-esm/analyzer/AstNamespaceExport.js +38 -0
- package/lib-esm/analyzer/AstNamespaceExport.js.map +1 -0
- package/lib-esm/analyzer/AstNamespaceImport.js +57 -0
- package/lib-esm/analyzer/AstNamespaceImport.js.map +1 -0
- package/lib-esm/analyzer/AstReferenceResolver.js +202 -0
- package/lib-esm/analyzer/AstReferenceResolver.js.map +1 -0
- package/lib-esm/analyzer/AstSymbol.js +104 -0
- package/lib-esm/analyzer/AstSymbol.js.map +1 -0
- package/lib-esm/analyzer/AstSymbolTable.js +524 -0
- package/lib-esm/analyzer/AstSymbolTable.js.map +1 -0
- package/lib-esm/analyzer/ExportAnalyzer.js +725 -0
- package/lib-esm/analyzer/ExportAnalyzer.js.map +1 -0
- package/lib-esm/analyzer/PackageMetadataManager.js +235 -0
- package/lib-esm/analyzer/PackageMetadataManager.js.map +1 -0
- package/lib-esm/analyzer/SourceFileLocationFormatter.js +44 -0
- package/lib-esm/analyzer/SourceFileLocationFormatter.js.map +1 -0
- package/lib-esm/analyzer/Span.js +545 -0
- package/lib-esm/analyzer/Span.js.map +1 -0
- package/lib-esm/analyzer/SyntaxHelpers.js +72 -0
- package/lib-esm/analyzer/SyntaxHelpers.js.map +1 -0
- package/lib-esm/analyzer/TypeScriptHelpers.js +242 -0
- package/lib-esm/analyzer/TypeScriptHelpers.js.map +1 -0
- package/lib-esm/analyzer/TypeScriptInternals.js +114 -0
- package/lib-esm/analyzer/TypeScriptInternals.js.map +1 -0
- package/lib-esm/api/CompilerState.js +149 -0
- package/lib-esm/api/CompilerState.js.map +1 -0
- package/lib-esm/api/ConsoleMessageId.js +82 -0
- package/lib-esm/api/ConsoleMessageId.js.map +1 -0
- package/lib-esm/api/Extractor.js +290 -0
- package/lib-esm/api/Extractor.js.map +1 -0
- package/lib-esm/api/ExtractorConfig.js +801 -0
- package/lib-esm/api/ExtractorConfig.js.map +1 -0
- package/lib-esm/api/ExtractorLogLevel.js +46 -0
- package/lib-esm/api/ExtractorLogLevel.js.map +1 -0
- package/lib-esm/api/ExtractorMessage.js +140 -0
- package/lib-esm/api/ExtractorMessage.js.map +1 -0
- package/lib-esm/api/ExtractorMessageId.js +128 -0
- package/lib-esm/api/ExtractorMessageId.js.map +1 -0
- package/lib-esm/api/IConfigFile.js +4 -0
- package/lib-esm/api/IConfigFile.js.map +1 -0
- package/lib-esm/cli/ApiExtractorCommandLine.js +51 -0
- package/lib-esm/cli/ApiExtractorCommandLine.js.map +1 -0
- package/lib-esm/cli/InitAction.js +35 -0
- package/lib-esm/cli/InitAction.js.map +1 -0
- package/lib-esm/cli/RunAction.js +123 -0
- package/lib-esm/cli/RunAction.js.map +1 -0
- package/lib-esm/collector/ApiItemMetadata.js +55 -0
- package/lib-esm/collector/ApiItemMetadata.js.map +1 -0
- package/lib-esm/collector/Collector.js +794 -0
- package/lib-esm/collector/Collector.js.map +1 -0
- package/lib-esm/collector/CollectorEntity.js +219 -0
- package/lib-esm/collector/CollectorEntity.js.map +1 -0
- package/lib-esm/collector/DeclarationMetadata.js +24 -0
- package/lib-esm/collector/DeclarationMetadata.js.map +1 -0
- package/lib-esm/collector/MessageRouter.js +476 -0
- package/lib-esm/collector/MessageRouter.js.map +1 -0
- package/lib-esm/collector/SourceMapper.js +171 -0
- package/lib-esm/collector/SourceMapper.js.map +1 -0
- package/lib-esm/collector/SymbolMetadata.js +12 -0
- package/lib-esm/collector/SymbolMetadata.js.map +1 -0
- package/lib-esm/collector/VisitorState.js +23 -0
- package/lib-esm/collector/VisitorState.js.map +1 -0
- package/lib-esm/collector/WorkingPackage.js +30 -0
- package/lib-esm/collector/WorkingPackage.js.map +1 -0
- package/lib-esm/enhancers/DocCommentEnhancer.js +213 -0
- package/lib-esm/enhancers/DocCommentEnhancer.js.map +1 -0
- package/lib-esm/enhancers/ValidationEnhancer.js +217 -0
- package/lib-esm/enhancers/ValidationEnhancer.js.map +1 -0
- package/lib-esm/generators/ApiModelGenerator.js +852 -0
- package/lib-esm/generators/ApiModelGenerator.js.map +1 -0
- package/lib-esm/generators/ApiReportGenerator.js +518 -0
- package/lib-esm/generators/ApiReportGenerator.js.map +1 -0
- package/lib-esm/generators/DeclarationReferenceGenerator.js +292 -0
- package/lib-esm/generators/DeclarationReferenceGenerator.js.map +1 -0
- package/lib-esm/generators/DtsEmitHelpers.js +227 -0
- package/lib-esm/generators/DtsEmitHelpers.js.map +1 -0
- package/lib-esm/generators/DtsRollupGenerator.js +391 -0
- package/lib-esm/generators/DtsRollupGenerator.js.map +1 -0
- package/lib-esm/generators/ExcerptBuilder.js +259 -0
- package/lib-esm/generators/ExcerptBuilder.js.map +1 -0
- package/lib-esm/generators/IndentedWriter.js +238 -0
- package/lib-esm/generators/IndentedWriter.js.map +1 -0
- package/lib-esm/index.js +17 -0
- package/lib-esm/index.js.map +1 -0
- package/lib-esm/schemas/api-extractor-defaults.json +94 -0
- package/lib-esm/schemas/api-extractor-template.json +454 -0
- package/lib-esm/schemas/api-extractor.schema.json +257 -0
- package/lib-esm/start.js +14 -0
- package/lib-esm/start.js.map +1 -0
- package/package.json +36 -10
- /package/{lib → lib-commonjs}/aedoc/PackageDocComment.js +0 -0
- /package/{lib → lib-commonjs}/aedoc/PackageDocComment.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstDeclaration.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstDeclaration.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstEntity.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstEntity.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstImport.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstImport.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstModule.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstModule.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstNamespaceExport.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstNamespaceExport.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstNamespaceImport.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstNamespaceImport.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstReferenceResolver.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstReferenceResolver.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstSymbol.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstSymbol.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstSymbolTable.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/AstSymbolTable.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/ExportAnalyzer.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/ExportAnalyzer.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/PackageMetadataManager.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/PackageMetadataManager.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/SourceFileLocationFormatter.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/SourceFileLocationFormatter.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/Span.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/Span.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/SyntaxHelpers.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/SyntaxHelpers.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/TypeScriptHelpers.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/TypeScriptHelpers.js.map +0 -0
- /package/{lib → lib-commonjs}/analyzer/TypeScriptInternals.js +0 -0
- /package/{lib → lib-commonjs}/analyzer/TypeScriptInternals.js.map +0 -0
- /package/{lib → lib-commonjs}/api/CompilerState.js +0 -0
- /package/{lib → lib-commonjs}/api/CompilerState.js.map +0 -0
- /package/{lib → lib-commonjs}/api/ConsoleMessageId.js +0 -0
- /package/{lib → lib-commonjs}/api/ConsoleMessageId.js.map +0 -0
- /package/{lib → lib-commonjs}/api/Extractor.js +0 -0
- /package/{lib → lib-commonjs}/api/Extractor.js.map +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorConfig.js +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorConfig.js.map +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorLogLevel.js +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorLogLevel.js.map +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorMessage.js +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorMessage.js.map +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorMessageId.js +0 -0
- /package/{lib → lib-commonjs}/api/ExtractorMessageId.js.map +0 -0
- /package/{lib → lib-commonjs}/api/IConfigFile.js +0 -0
- /package/{lib → lib-commonjs}/api/IConfigFile.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/ApiExtractorCommandLine.js +0 -0
- /package/{lib → lib-commonjs}/cli/ApiExtractorCommandLine.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/InitAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/InitAction.js.map +0 -0
- /package/{lib → lib-commonjs}/cli/RunAction.js +0 -0
- /package/{lib → lib-commonjs}/cli/RunAction.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/ApiItemMetadata.js +0 -0
- /package/{lib → lib-commonjs}/collector/ApiItemMetadata.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/Collector.js +0 -0
- /package/{lib → lib-commonjs}/collector/Collector.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/CollectorEntity.js +0 -0
- /package/{lib → lib-commonjs}/collector/CollectorEntity.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/DeclarationMetadata.js +0 -0
- /package/{lib → lib-commonjs}/collector/DeclarationMetadata.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/MessageRouter.js +0 -0
- /package/{lib → lib-commonjs}/collector/MessageRouter.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/SourceMapper.js +0 -0
- /package/{lib → lib-commonjs}/collector/SourceMapper.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/SymbolMetadata.js +0 -0
- /package/{lib → lib-commonjs}/collector/SymbolMetadata.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/VisitorState.js +0 -0
- /package/{lib → lib-commonjs}/collector/VisitorState.js.map +0 -0
- /package/{lib → lib-commonjs}/collector/WorkingPackage.js +0 -0
- /package/{lib → lib-commonjs}/collector/WorkingPackage.js.map +0 -0
- /package/{lib → lib-commonjs}/enhancers/DocCommentEnhancer.js +0 -0
- /package/{lib → lib-commonjs}/enhancers/DocCommentEnhancer.js.map +0 -0
- /package/{lib → lib-commonjs}/enhancers/ValidationEnhancer.js +0 -0
- /package/{lib → lib-commonjs}/enhancers/ValidationEnhancer.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/ApiModelGenerator.js +0 -0
- /package/{lib → lib-commonjs}/generators/ApiModelGenerator.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/ApiReportGenerator.js +0 -0
- /package/{lib → lib-commonjs}/generators/ApiReportGenerator.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/DeclarationReferenceGenerator.js +0 -0
- /package/{lib → lib-commonjs}/generators/DeclarationReferenceGenerator.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/DtsEmitHelpers.js +0 -0
- /package/{lib → lib-commonjs}/generators/DtsEmitHelpers.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/DtsRollupGenerator.js +0 -0
- /package/{lib → lib-commonjs}/generators/DtsRollupGenerator.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/ExcerptBuilder.js +0 -0
- /package/{lib → lib-commonjs}/generators/ExcerptBuilder.js.map +0 -0
- /package/{lib → lib-commonjs}/generators/IndentedWriter.js +0 -0
- /package/{lib → lib-commonjs}/generators/IndentedWriter.js.map +0 -0
- /package/{lib → lib-commonjs}/index.js +0 -0
- /package/{lib → lib-commonjs}/index.js.map +0 -0
- /package/{lib → lib-commonjs}/schemas/api-extractor-defaults.json +0 -0
- /package/{lib → lib-commonjs}/schemas/api-extractor-template.json +0 -0
- /package/{lib → lib-commonjs}/schemas/api-extractor.schema.json +0 -0
- /package/{lib → lib-commonjs}/start.js +0 -0
- /package/{lib → lib-commonjs}/start.js.map +0 -0
- /package/{lib → lib-dts}/aedoc/PackageDocComment.d.ts +0 -0
- /package/{lib → lib-dts}/aedoc/PackageDocComment.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstDeclaration.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstDeclaration.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstEntity.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstEntity.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstImport.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstImport.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstModule.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstModule.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstNamespaceExport.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstNamespaceExport.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstNamespaceImport.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstNamespaceImport.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstReferenceResolver.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstReferenceResolver.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstSymbol.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstSymbol.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/AstSymbolTable.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/AstSymbolTable.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/ExportAnalyzer.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/ExportAnalyzer.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/PackageMetadataManager.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/PackageMetadataManager.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/SourceFileLocationFormatter.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/SourceFileLocationFormatter.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/Span.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/Span.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/SyntaxHelpers.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/SyntaxHelpers.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/TypeScriptHelpers.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/TypeScriptHelpers.d.ts.map +0 -0
- /package/{lib → lib-dts}/analyzer/TypeScriptInternals.d.ts +0 -0
- /package/{lib → lib-dts}/analyzer/TypeScriptInternals.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/CompilerState.d.ts +0 -0
- /package/{lib → lib-dts}/api/CompilerState.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/ConsoleMessageId.d.ts +0 -0
- /package/{lib → lib-dts}/api/ConsoleMessageId.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/Extractor.d.ts +0 -0
- /package/{lib → lib-dts}/api/Extractor.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/ExtractorConfig.d.ts +0 -0
- /package/{lib → lib-dts}/api/ExtractorConfig.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/ExtractorLogLevel.d.ts +0 -0
- /package/{lib → lib-dts}/api/ExtractorLogLevel.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/ExtractorMessage.d.ts +0 -0
- /package/{lib → lib-dts}/api/ExtractorMessage.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/ExtractorMessageId.d.ts +0 -0
- /package/{lib → lib-dts}/api/ExtractorMessageId.d.ts.map +0 -0
- /package/{lib → lib-dts}/api/IConfigFile.d.ts +0 -0
- /package/{lib → lib-dts}/api/IConfigFile.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/ApiExtractorCommandLine.d.ts +0 -0
- /package/{lib → lib-dts}/cli/ApiExtractorCommandLine.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/InitAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/InitAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/cli/RunAction.d.ts +0 -0
- /package/{lib → lib-dts}/cli/RunAction.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/ApiItemMetadata.d.ts +0 -0
- /package/{lib → lib-dts}/collector/ApiItemMetadata.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/Collector.d.ts +0 -0
- /package/{lib → lib-dts}/collector/Collector.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/CollectorEntity.d.ts +0 -0
- /package/{lib → lib-dts}/collector/CollectorEntity.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/DeclarationMetadata.d.ts +0 -0
- /package/{lib → lib-dts}/collector/DeclarationMetadata.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/MessageRouter.d.ts +0 -0
- /package/{lib → lib-dts}/collector/MessageRouter.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/SourceMapper.d.ts +0 -0
- /package/{lib → lib-dts}/collector/SourceMapper.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/SymbolMetadata.d.ts +0 -0
- /package/{lib → lib-dts}/collector/SymbolMetadata.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/VisitorState.d.ts +0 -0
- /package/{lib → lib-dts}/collector/VisitorState.d.ts.map +0 -0
- /package/{lib → lib-dts}/collector/WorkingPackage.d.ts +0 -0
- /package/{lib → lib-dts}/collector/WorkingPackage.d.ts.map +0 -0
- /package/{lib → lib-dts}/enhancers/DocCommentEnhancer.d.ts +0 -0
- /package/{lib → lib-dts}/enhancers/DocCommentEnhancer.d.ts.map +0 -0
- /package/{lib → lib-dts}/enhancers/ValidationEnhancer.d.ts +0 -0
- /package/{lib → lib-dts}/enhancers/ValidationEnhancer.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/ApiModelGenerator.d.ts +0 -0
- /package/{lib → lib-dts}/generators/ApiModelGenerator.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/ApiReportGenerator.d.ts +0 -0
- /package/{lib → lib-dts}/generators/ApiReportGenerator.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/DeclarationReferenceGenerator.d.ts +0 -0
- /package/{lib → lib-dts}/generators/DeclarationReferenceGenerator.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/DtsEmitHelpers.d.ts +0 -0
- /package/{lib → lib-dts}/generators/DtsEmitHelpers.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/DtsRollupGenerator.d.ts +0 -0
- /package/{lib → lib-dts}/generators/DtsRollupGenerator.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/ExcerptBuilder.d.ts +0 -0
- /package/{lib → lib-dts}/generators/ExcerptBuilder.d.ts.map +0 -0
- /package/{lib → lib-dts}/generators/IndentedWriter.d.ts +0 -0
- /package/{lib → lib-dts}/generators/IndentedWriter.d.ts.map +0 -0
- /package/{lib → lib-dts}/index.d.ts +0 -0
- /package/{lib → lib-dts}/index.d.ts.map +0 -0
- /package/{lib → lib-dts}/start.d.ts +0 -0
- /package/{lib → lib-dts}/start.d.ts.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CompilerState.js","sourceRoot":"","sources":["../../src/api/CompilerState.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAiBpD;;;;;GAKG;AACH,MAAM,OAAO,aAAa;IAMxB,YAAoB,UAAyB;QAC3C,IAAI,CAAC,OAAO,GAAG,UAAU,CAAC,OAAO,CAAC;IACpC,CAAC;IAED;;OAEG;IACI,MAAM,CAAC,MAAM,CAClB,eAAgC,EAChC,OAAqC;QAErC,IAAI,QAAQ,GAAmB,eAAe,CAAC,gBAAgB,CAAC;QAChE,IAAI,cAAc,GAAW,eAAe,CAAC,aAAa,CAAC;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,kDAAkD;YAClD,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;YAC3D,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC,CAAC;QAChF,CAAC;QAED,MAAM,WAAW,GAAyB,EAAE,CAAC,0BAA0B,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,EAAE,cAAc,CAAC,CAAC;QAE1G,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,IAAI,eAAe,CAAC,YAAY,EAAE,CAAC;YACtE,WAAW,CAAC,OAAO,CAAC,YAAY,GA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AY,CAAC;IACtB,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\n\nimport * as ts from 'typescript';\n\nimport { JsonFile } from '@rushstack/node-core-library';\nimport { Colorize } from '@rushstack/terminal';\n\nimport { ExtractorConfig } from './ExtractorConfig';\nimport type { IExtractorInvokeOptions } from './Extractor';\n\n/**\n * Options for {@link CompilerState.create}\n * @public\n */\nexport interface ICompilerStateCreateOptions {\n /** {@inheritDoc IExtractorInvokeOptions.typescriptCompilerFolder} */\n typescriptCompilerFolder?: string;\n\n /**\n * Additional .d.ts files to include in the analysis.\n */\n additionalEntryPoints?: string[];\n}\n\n/**\n * This class represents the TypeScript compiler state. This allows an optimization where multiple invocations\n * of API Extractor can reuse the same TypeScript compiler analysis.\n *\n * @public\n */\nexport class CompilerState {\n /**\n * The TypeScript compiler's `Program` object, which represents a complete scope of analysis.\n */\n public readonly program: unknown;\n\n private constructor(properties: CompilerState) {\n this.program = properties.program;\n }\n\n /**\n * Create a compiler state for use with the specified `IExtractorInvokeOptions`.\n */\n public static create(\n extractorConfig: ExtractorConfig,\n options?: ICompilerStateCreateOptions\n ): CompilerState {\n let tsconfig: {} | undefined = extractorConfig.overrideTsconfig;\n let configBasePath: string = extractorConfig.projectFolder;\n if (!tsconfig) {\n // If it wasn't overridden, then load it from disk\n tsconfig = JsonFile.load(extractorConfig.tsconfigFilePath);\n configBasePath = path.resolve(path.dirname(extractorConfig.tsconfigFilePath));\n }\n\n const commandLine: ts.ParsedCommandLine = ts.parseJsonConfigFileContent(tsconfig, ts.sys, configBasePath);\n\n if (!commandLine.options.skipLibCheck && extractorConfig.skipLibCheck) {\n commandLine.options.skipLibCheck = true;\n console.log(\n Colorize.cyan(\n 'API Extractor was invoked with skipLibCheck. This is not recommended and may cause ' +\n 'incorrect type analysis.'\n )\n );\n }\n\n // Delete outDir and declarationDir to prevent TypeScript from redirecting self-package\n // imports to source files. When these options are set, TypeScript's module resolution\n // tries to map output .d.ts files back to their source .ts files to avoid analyzing\n // build outputs during compilation. However, API Extractor specifically wants to analyze\n // the .d.ts build artifacts, not the source files. Since API Extractor doesn't emit any\n // files, these options are unnecessary and interfere with correct module resolution.\n delete commandLine.options.outDir;\n delete commandLine.options.declarationDir;\n\n const inputFilePaths: string[] = commandLine.fileNames.concat(extractorConfig.mainEntryPointFilePath);\n if (options && options.additionalEntryPoints) {\n inputFilePaths.push(...options.additionalEntryPoints);\n }\n\n // Append the entry points and remove any non-declaration files from the list\n const analysisFilePaths: string[] = CompilerState._generateFilePathsForAnalysis(inputFilePaths);\n\n const compilerHost: ts.CompilerHost = CompilerState._createCompilerHost(commandLine, options);\n\n const program: ts.Program = ts.createProgram(analysisFilePaths, commandLine.options, compilerHost);\n\n if (commandLine.errors.length > 0) {\n const errorText: string = ts.flattenDiagnosticMessageText(commandLine.errors[0].messageText, '\\n');\n throw new Error(`Error parsing tsconfig.json content: ${errorText}`);\n }\n\n return new CompilerState({\n program\n });\n }\n\n /**\n * Given a list of absolute file paths, return a list containing only the declaration\n * files. Duplicates are also eliminated.\n *\n * @remarks\n * The tsconfig.json settings specify the compiler's input (a set of *.ts source files,\n * plus some *.d.ts declaration files used for legacy typings). However API Extractor\n * analyzes the compiler's output (a set of *.d.ts entry point files, plus any legacy\n * typings). This requires API Extractor to generate a special file list when it invokes\n * the compiler.\n *\n * Duplicates are removed so that entry points can be appended without worrying whether they\n * may already appear in the tsconfig.json file list.\n */\n private static _generateFilePathsForAnalysis(inputFilePaths: string[]): string[] {\n const analysisFilePaths: string[] = [];\n\n const seenFiles: Set<string> = new Set<string>();\n\n for (const inputFilePath of inputFilePaths) {\n const inputFileToUpper: string = inputFilePath.toUpperCase();\n if (!seenFiles.has(inputFileToUpper)) {\n seenFiles.add(inputFileToUpper);\n\n if (!path.isAbsolute(inputFilePath)) {\n throw new Error('Input file is not an absolute path: ' + inputFilePath);\n }\n\n if (ExtractorConfig.hasDtsFileExtension(inputFilePath)) {\n analysisFilePaths.push(inputFilePath);\n }\n }\n }\n\n return analysisFilePaths;\n }\n\n private static _createCompilerHost(\n commandLine: ts.ParsedCommandLine,\n options: IExtractorInvokeOptions | undefined\n ): ts.CompilerHost {\n // Create a default CompilerHost that we will override\n const compilerHost: ts.CompilerHost = ts.createCompilerHost(commandLine.options);\n\n // Save a copy of the original members. Note that \"compilerHost\" cannot be the copy, because\n // createCompilerHost() captures that instance in a closure that is used by the members.\n const defaultCompilerHost: ts.CompilerHost = { ...compilerHost };\n\n if (options && options.typescriptCompilerFolder) {\n // Prevent a closure parameter\n const typescriptCompilerLibFolder: string = path.join(options.typescriptCompilerFolder, 'lib');\n compilerHost.getDefaultLibLocation = () => typescriptCompilerLibFolder;\n }\n\n // Used by compilerHost.fileExists()\n // .d.ts file path --> whether the file exists\n const dtsExistsCache: Map<string, boolean> = new Map<string, boolean>();\n\n // Used by compilerHost.fileExists()\n // Example: \"c:/folder/file.part.ts\"\n const fileExtensionRegExp: RegExp = /^(.+)(\\.[a-z0-9_]+)$/i;\n\n compilerHost.fileExists = (fileName: string): boolean => {\n // In certain deprecated setups, the compiler may write its output files (.js and .d.ts)\n // in the same folder as the corresponding input file (.ts or .tsx). When following imports,\n // API Extractor wants to analyze the .d.ts file; however recent versions of the compiler engine\n // will instead choose the .ts file. To work around this, we hook fileExists() to hide the\n // existence of those files.\n\n // Is \"fileName\" a .d.ts file? The double extension \".d.ts\" needs to be matched specially.\n if (!ExtractorConfig.hasDtsFileExtension(fileName)) {\n // It's not a .d.ts file. Is the file extension a potential source file?\n const match: RegExpExecArray | null = fileExtensionRegExp.exec(fileName);\n if (match) {\n // Example: \"c:/folder/file.part\"\n const pathWithoutExtension: string = match[1];\n // Example: \".ts\"\n const fileExtension: string = match[2];\n\n switch (fileExtension.toLocaleLowerCase()) {\n case '.ts':\n case '.tsx':\n case '.js':\n case '.jsx':\n // Yes, this is a possible source file. Is there a corresponding .d.ts file in the same folder?\n const dtsFileName: string = `${pathWithoutExtension}.d.ts`;\n\n let dtsFileExists: boolean | undefined = dtsExistsCache.get(dtsFileName);\n if (dtsFileExists === undefined) {\n dtsFileExists = defaultCompilerHost.fileExists!(dtsFileName);\n dtsExistsCache.set(dtsFileName, dtsFileExists);\n }\n\n if (dtsFileExists) {\n // fileName is a potential source file and a corresponding .d.ts file exists.\n // Thus, API Extractor should ignore this file (so the .d.ts file will get analyzed instead).\n return false;\n }\n break;\n }\n }\n }\n\n // Fall through to the default implementation\n return defaultCompilerHost.fileExists!(fileName);\n };\n\n return compilerHost;\n }\n}\n"]}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
/**
|
|
4
|
+
* Unique identifiers for console messages reported by API Extractor.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
*
|
|
8
|
+
* These strings are possible values for the {@link ExtractorMessage.messageId} property
|
|
9
|
+
* when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Console}.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
13
|
+
export var ConsoleMessageId;
|
|
14
|
+
(function (ConsoleMessageId) {
|
|
15
|
+
/**
|
|
16
|
+
* "Analysis will use the bundled TypeScript version ___"
|
|
17
|
+
*/
|
|
18
|
+
ConsoleMessageId["Preamble"] = "console-preamble";
|
|
19
|
+
/**
|
|
20
|
+
* "The target project appears to use TypeScript ___ which is newer than the bundled compiler engine;
|
|
21
|
+
* consider upgrading API Extractor."
|
|
22
|
+
*/
|
|
23
|
+
ConsoleMessageId["CompilerVersionNotice"] = "console-compiler-version-notice";
|
|
24
|
+
/**
|
|
25
|
+
* "Using custom TSDoc config from ___"
|
|
26
|
+
*/
|
|
27
|
+
ConsoleMessageId["UsingCustomTSDocConfig"] = "console-using-custom-tsdoc-config";
|
|
28
|
+
/**
|
|
29
|
+
* "Found metadata in ___"
|
|
30
|
+
*/
|
|
31
|
+
ConsoleMessageId["FoundTSDocMetadata"] = "console-found-tsdoc-metadata";
|
|
32
|
+
/**
|
|
33
|
+
* "Writing: ___"
|
|
34
|
+
*/
|
|
35
|
+
ConsoleMessageId["WritingDocModelFile"] = "console-writing-doc-model-file";
|
|
36
|
+
/**
|
|
37
|
+
* "Writing package typings: ___"
|
|
38
|
+
*/
|
|
39
|
+
ConsoleMessageId["WritingDtsRollup"] = "console-writing-dts-rollup";
|
|
40
|
+
/**
|
|
41
|
+
* "Generating ___ API report: ___"
|
|
42
|
+
*/
|
|
43
|
+
ConsoleMessageId["WritingApiReport"] = "console-writing-api-report";
|
|
44
|
+
/**
|
|
45
|
+
* "You have changed the public API signature for this project.
|
|
46
|
+
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
|
|
47
|
+
* See the Git repo documentation for more info."
|
|
48
|
+
*
|
|
49
|
+
* OR
|
|
50
|
+
*
|
|
51
|
+
* "The API report file is missing.
|
|
52
|
+
* Please copy the file ___ to ___, or perform a local build (which does this automatically).
|
|
53
|
+
* See the Git repo documentation for more info."
|
|
54
|
+
*/
|
|
55
|
+
ConsoleMessageId["ApiReportNotCopied"] = "console-api-report-not-copied";
|
|
56
|
+
/**
|
|
57
|
+
* Changes to the API report:
|
|
58
|
+
* ___
|
|
59
|
+
*/
|
|
60
|
+
ConsoleMessageId["ApiReportDiff"] = "console-api-report-diff";
|
|
61
|
+
/**
|
|
62
|
+
* "You have changed the public API signature for this project. Updating ___"
|
|
63
|
+
*/
|
|
64
|
+
ConsoleMessageId["ApiReportCopied"] = "console-api-report-copied";
|
|
65
|
+
/**
|
|
66
|
+
* "The API report is up to date: ___"
|
|
67
|
+
*/
|
|
68
|
+
ConsoleMessageId["ApiReportUnchanged"] = "console-api-report-unchanged";
|
|
69
|
+
/**
|
|
70
|
+
* "The API report file was missing, so a new file was created. Please add this file to Git: ___"
|
|
71
|
+
*/
|
|
72
|
+
ConsoleMessageId["ApiReportCreated"] = "console-api-report-created";
|
|
73
|
+
/**
|
|
74
|
+
* "Unable to create the API report file. Please make sure the target folder exists: ___"
|
|
75
|
+
*/
|
|
76
|
+
ConsoleMessageId["ApiReportFolderMissing"] = "console-api-report-folder-missing";
|
|
77
|
+
/**
|
|
78
|
+
* Used for the information printed when the "--diagnostics" flag is enabled.
|
|
79
|
+
*/
|
|
80
|
+
ConsoleMessageId["Diagnostics"] = "console-diagnostics";
|
|
81
|
+
})(ConsoleMessageId || (ConsoleMessageId = {}));
|
|
82
|
+
//# sourceMappingURL=ConsoleMessageId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConsoleMessageId.js","sourceRoot":"","sources":["../../src/api/ConsoleMessageId.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D;;;;;;;;;GASG;AACH,MAAM,CAAN,IAAY,gBAgFX;AAhFD,WAAY,gBAAgB;IAC1B;;OAEG;IACH,iDAA6B,CAAA;IAE7B;;;OAGG;IACH,6EAAyD,CAAA;IAEzD;;OAEG;IACH,gFAA4D,CAAA;IAE5D;;OAEG;IACH,uEAAmD,CAAA;IAEnD;;OAEG;IACH,0EAAsD,CAAA;IAEtD;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;;;;;;;;;OAUG;IACH,wEAAoD,CAAA;IAEpD;;;OAGG;IACH,6DAAyC,CAAA;IAEzC;;OAEG;IACH,iEAA6C,CAAA;IAE7C;;OAEG;IACH,uEAAmD,CAAA;IAEnD;;OAEG;IACH,mEAA+C,CAAA;IAE/C;;OAEG;IACH,gFAA4D,CAAA;IAE5D;;OAEG;IACH,uDAAmC,CAAA;AACrC,CAAC,EAhFW,gBAAgB,KAAhB,gBAAgB,QAgF3B","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\n/**\n * Unique identifiers for console messages reported by API Extractor.\n *\n * @remarks\n *\n * These strings are possible values for the {@link ExtractorMessage.messageId} property\n * when the `ExtractorMessage.category` is {@link ExtractorMessageCategory.Console}.\n *\n * @public\n */\nexport enum ConsoleMessageId {\n /**\n * \"Analysis will use the bundled TypeScript version ___\"\n */\n Preamble = 'console-preamble',\n\n /**\n * \"The target project appears to use TypeScript ___ which is newer than the bundled compiler engine;\n * consider upgrading API Extractor.\"\n */\n CompilerVersionNotice = 'console-compiler-version-notice',\n\n /**\n * \"Using custom TSDoc config from ___\"\n */\n UsingCustomTSDocConfig = 'console-using-custom-tsdoc-config',\n\n /**\n * \"Found metadata in ___\"\n */\n FoundTSDocMetadata = 'console-found-tsdoc-metadata',\n\n /**\n * \"Writing: ___\"\n */\n WritingDocModelFile = 'console-writing-doc-model-file',\n\n /**\n * \"Writing package typings: ___\"\n */\n WritingDtsRollup = 'console-writing-dts-rollup',\n\n /**\n * \"Generating ___ API report: ___\"\n */\n WritingApiReport = 'console-writing-api-report',\n\n /**\n * \"You have changed the public API signature for this project.\n * Please copy the file ___ to ___, or perform a local build (which does this automatically).\n * See the Git repo documentation for more info.\"\n *\n * OR\n *\n * \"The API report file is missing.\n * Please copy the file ___ to ___, or perform a local build (which does this automatically).\n * See the Git repo documentation for more info.\"\n */\n ApiReportNotCopied = 'console-api-report-not-copied',\n\n /**\n * Changes to the API report:\n * ___\n */\n ApiReportDiff = 'console-api-report-diff',\n\n /**\n * \"You have changed the public API signature for this project. Updating ___\"\n */\n ApiReportCopied = 'console-api-report-copied',\n\n /**\n * \"The API report is up to date: ___\"\n */\n ApiReportUnchanged = 'console-api-report-unchanged',\n\n /**\n * \"The API report file was missing, so a new file was created. Please add this file to Git: ___\"\n */\n ApiReportCreated = 'console-api-report-created',\n\n /**\n * \"Unable to create the API report file. Please make sure the target folder exists: ___\"\n */\n ApiReportFolderMissing = 'console-api-report-folder-missing',\n\n /**\n * Used for the information printed when the \"--diagnostics\" flag is enabled.\n */\n Diagnostics = 'console-diagnostics'\n}\n"]}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
|
|
2
|
+
// See LICENSE in the project root for license information.
|
|
3
|
+
import * as path from 'node:path';
|
|
4
|
+
import * as semver from 'semver';
|
|
5
|
+
import * as ts from 'typescript';
|
|
6
|
+
import * as resolve from 'resolve';
|
|
7
|
+
import { TSDocConfigFile } from '@microsoft/tsdoc-config';
|
|
8
|
+
import { FileSystem, NewlineKind, PackageJsonLookup, Path } from '@rushstack/node-core-library';
|
|
9
|
+
import { ExtractorConfig } from './ExtractorConfig';
|
|
10
|
+
import { Collector } from '../collector/Collector';
|
|
11
|
+
import { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';
|
|
12
|
+
import { ApiModelGenerator } from '../generators/ApiModelGenerator';
|
|
13
|
+
import { ApiReportGenerator } from '../generators/ApiReportGenerator';
|
|
14
|
+
import { PackageMetadataManager } from '../analyzer/PackageMetadataManager';
|
|
15
|
+
import { ValidationEnhancer } from '../enhancers/ValidationEnhancer';
|
|
16
|
+
import { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';
|
|
17
|
+
import { CompilerState } from './CompilerState';
|
|
18
|
+
import { MessageRouter } from '../collector/MessageRouter';
|
|
19
|
+
import { ConsoleMessageId } from './ConsoleMessageId';
|
|
20
|
+
import { SourceMapper } from '../collector/SourceMapper';
|
|
21
|
+
/**
|
|
22
|
+
* This object represents the outcome of an invocation of API Extractor.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export class ExtractorResult {
|
|
27
|
+
/** @internal */
|
|
28
|
+
constructor(properties) {
|
|
29
|
+
this.compilerState = properties.compilerState;
|
|
30
|
+
this.extractorConfig = properties.extractorConfig;
|
|
31
|
+
this.succeeded = properties.succeeded;
|
|
32
|
+
this.apiReportChanged = properties.apiReportChanged;
|
|
33
|
+
this.errorCount = properties.errorCount;
|
|
34
|
+
this.warningCount = properties.warningCount;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The starting point for invoking the API Extractor tool.
|
|
39
|
+
* @public
|
|
40
|
+
*/
|
|
41
|
+
export class Extractor {
|
|
42
|
+
/**
|
|
43
|
+
* Returns the version number of the API Extractor NPM package.
|
|
44
|
+
*/
|
|
45
|
+
static get version() {
|
|
46
|
+
return Extractor._getPackageJson().version;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns the package name of the API Extractor NPM package.
|
|
50
|
+
*/
|
|
51
|
+
static get packageName() {
|
|
52
|
+
return Extractor._getPackageJson().name;
|
|
53
|
+
}
|
|
54
|
+
static _getPackageJson() {
|
|
55
|
+
return PackageJsonLookup.loadOwnPackageJson(__dirname);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Load the api-extractor.json config file from the specified path, and then invoke API Extractor.
|
|
59
|
+
*/
|
|
60
|
+
static loadConfigAndInvoke(configFilePath, options) {
|
|
61
|
+
const extractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);
|
|
62
|
+
return Extractor.invoke(extractorConfig, options);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Invoke API Extractor using an already prepared `ExtractorConfig` object.
|
|
66
|
+
*/
|
|
67
|
+
static invoke(extractorConfig, options) {
|
|
68
|
+
const { packageFolder, messages, tsdocConfiguration, tsdocConfigFile: { filePath: tsdocConfigFilePath, fileNotFound: tsdocConfigFileNotFound }, apiJsonFilePath, newlineKind, reportTempFolder, reportFolder, apiReportEnabled, reportConfigs, testMode, rollupEnabled, publicTrimmedFilePath, alphaTrimmedFilePath, betaTrimmedFilePath, untrimmedFilePath, tsdocMetadataEnabled, tsdocMetadataFilePath } = extractorConfig;
|
|
69
|
+
const { localBuild = false, compilerState = CompilerState.create(extractorConfig, options), messageCallback, showVerboseMessages = false, showDiagnostics = false, printApiReportDiff = false } = options !== null && options !== void 0 ? options : {};
|
|
70
|
+
const sourceMapper = new SourceMapper();
|
|
71
|
+
const messageRouter = new MessageRouter({
|
|
72
|
+
workingPackageFolder: packageFolder,
|
|
73
|
+
messageCallback,
|
|
74
|
+
messagesConfig: messages || {},
|
|
75
|
+
showVerboseMessages,
|
|
76
|
+
showDiagnostics,
|
|
77
|
+
tsdocConfiguration,
|
|
78
|
+
sourceMapper
|
|
79
|
+
});
|
|
80
|
+
if (tsdocConfigFilePath && !tsdocConfigFileNotFound) {
|
|
81
|
+
if (!Path.isEqual(tsdocConfigFilePath, ExtractorConfig._tsdocBaseFilePath)) {
|
|
82
|
+
messageRouter.logVerbose(ConsoleMessageId.UsingCustomTSDocConfig, `Using custom TSDoc config from ${tsdocConfigFilePath}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
this._checkCompilerCompatibility(extractorConfig, messageRouter);
|
|
86
|
+
if (messageRouter.showDiagnostics) {
|
|
87
|
+
messageRouter.logDiagnostic('');
|
|
88
|
+
messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');
|
|
89
|
+
messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());
|
|
90
|
+
messageRouter.logDiagnosticFooter();
|
|
91
|
+
messageRouter.logDiagnosticHeader('Compiler options');
|
|
92
|
+
const serializedCompilerOptions = MessageRouter.buildJsonDumpObject(compilerState.program.getCompilerOptions());
|
|
93
|
+
messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));
|
|
94
|
+
messageRouter.logDiagnosticFooter();
|
|
95
|
+
messageRouter.logDiagnosticHeader('TSDoc configuration');
|
|
96
|
+
// Convert the TSDocConfiguration into a tsdoc.json representation
|
|
97
|
+
const combinedConfigFile = TSDocConfigFile.loadFromParser(tsdocConfiguration);
|
|
98
|
+
const serializedTSDocConfig = MessageRouter.buildJsonDumpObject(combinedConfigFile.saveToObject());
|
|
99
|
+
messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));
|
|
100
|
+
messageRouter.logDiagnosticFooter();
|
|
101
|
+
}
|
|
102
|
+
const collector = new Collector({
|
|
103
|
+
program: compilerState.program,
|
|
104
|
+
messageRouter,
|
|
105
|
+
extractorConfig,
|
|
106
|
+
sourceMapper
|
|
107
|
+
});
|
|
108
|
+
collector.analyze();
|
|
109
|
+
DocCommentEnhancer.analyze(collector);
|
|
110
|
+
ValidationEnhancer.analyze(collector);
|
|
111
|
+
const modelBuilder = new ApiModelGenerator(collector, extractorConfig);
|
|
112
|
+
const apiPackage = modelBuilder.buildApiPackage();
|
|
113
|
+
if (messageRouter.showDiagnostics) {
|
|
114
|
+
messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages
|
|
115
|
+
}
|
|
116
|
+
if (modelBuilder.docModelEnabled) {
|
|
117
|
+
messageRouter.logVerbose(ConsoleMessageId.WritingDocModelFile, `Writing: ${apiJsonFilePath}`);
|
|
118
|
+
apiPackage.saveToJsonFile(apiJsonFilePath, {
|
|
119
|
+
toolPackage: Extractor.packageName,
|
|
120
|
+
toolVersion: Extractor.version,
|
|
121
|
+
newlineConversion: newlineKind,
|
|
122
|
+
ensureFolderExists: true,
|
|
123
|
+
testMode
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
function writeApiReport(reportConfig) {
|
|
127
|
+
return Extractor._writeApiReport(collector, extractorConfig, messageRouter, reportTempFolder, reportFolder, reportConfig, localBuild, printApiReportDiff);
|
|
128
|
+
}
|
|
129
|
+
let anyReportChanged = false;
|
|
130
|
+
if (apiReportEnabled) {
|
|
131
|
+
for (const reportConfig of reportConfigs) {
|
|
132
|
+
anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
if (rollupEnabled) {
|
|
136
|
+
Extractor._generateRollupDtsFile(collector, publicTrimmedFilePath, DtsRollupKind.PublicRelease, newlineKind);
|
|
137
|
+
Extractor._generateRollupDtsFile(collector, alphaTrimmedFilePath, DtsRollupKind.AlphaRelease, newlineKind);
|
|
138
|
+
Extractor._generateRollupDtsFile(collector, betaTrimmedFilePath, DtsRollupKind.BetaRelease, newlineKind);
|
|
139
|
+
Extractor._generateRollupDtsFile(collector, untrimmedFilePath, DtsRollupKind.InternalRelease, newlineKind);
|
|
140
|
+
}
|
|
141
|
+
if (tsdocMetadataEnabled) {
|
|
142
|
+
// Write the tsdoc-metadata.json file for this project
|
|
143
|
+
PackageMetadataManager.writeTsdocMetadataFile(tsdocMetadataFilePath, newlineKind);
|
|
144
|
+
}
|
|
145
|
+
// Show all the messages that we collected during analysis
|
|
146
|
+
messageRouter.handleRemainingNonConsoleMessages();
|
|
147
|
+
// Determine success
|
|
148
|
+
let succeeded;
|
|
149
|
+
if (localBuild) {
|
|
150
|
+
// For a local build, fail if there were errors (but ignore warnings)
|
|
151
|
+
succeeded = messageRouter.errorCount === 0;
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
// For a production build, fail if there were any errors or warnings
|
|
155
|
+
succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;
|
|
156
|
+
}
|
|
157
|
+
return new ExtractorResult({
|
|
158
|
+
compilerState,
|
|
159
|
+
extractorConfig,
|
|
160
|
+
succeeded,
|
|
161
|
+
apiReportChanged: anyReportChanged,
|
|
162
|
+
errorCount: messageRouter.errorCount,
|
|
163
|
+
warningCount: messageRouter.warningCount
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Generates the API report at the specified release level, writes it to the specified file path, and compares
|
|
168
|
+
* the output to the existing report (if one exists).
|
|
169
|
+
*
|
|
170
|
+
* @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior
|
|
171
|
+
* to comparison with an existing report.
|
|
172
|
+
* @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to
|
|
173
|
+
* which the new report will be written post-comparison.
|
|
174
|
+
* @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.
|
|
175
|
+
* @param printApiReportDiff - {@link IExtractorInvokeOptions.printApiReportDiff}
|
|
176
|
+
*
|
|
177
|
+
* @returns Whether or not the newly generated report differs from the existing report (if one exists).
|
|
178
|
+
*/
|
|
179
|
+
static _writeApiReport(collector, extractorConfig, messageRouter, reportTempDirectoryPath, reportDirectoryPath, reportConfig, localBuild, printApiReportDiff) {
|
|
180
|
+
let apiReportChanged = false;
|
|
181
|
+
const actualApiReportPath = path.resolve(reportTempDirectoryPath, reportConfig.fileName);
|
|
182
|
+
const actualApiReportShortPath = extractorConfig._getShortFilePath(actualApiReportPath);
|
|
183
|
+
const expectedApiReportPath = path.resolve(reportDirectoryPath, reportConfig.fileName);
|
|
184
|
+
const expectedApiReportShortPath = extractorConfig._getShortFilePath(expectedApiReportPath);
|
|
185
|
+
collector.messageRouter.logVerbose(ConsoleMessageId.WritingApiReport, `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`);
|
|
186
|
+
const actualApiReportContent = ApiReportGenerator.generateReviewFileContent(collector, reportConfig.variant);
|
|
187
|
+
// Write the actual file
|
|
188
|
+
FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {
|
|
189
|
+
ensureFolderExists: true,
|
|
190
|
+
convertLineEndings: extractorConfig.newlineKind
|
|
191
|
+
});
|
|
192
|
+
// Compare it against the expected file
|
|
193
|
+
if (FileSystem.exists(expectedApiReportPath)) {
|
|
194
|
+
const expectedApiReportContent = FileSystem.readFile(expectedApiReportPath, {
|
|
195
|
+
convertLineEndings: NewlineKind.Lf
|
|
196
|
+
});
|
|
197
|
+
if (!ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)) {
|
|
198
|
+
apiReportChanged = true;
|
|
199
|
+
if (!localBuild) {
|
|
200
|
+
// For a production build, issue a warning that will break the CI build.
|
|
201
|
+
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied, 'You have changed the API signature for this project.' +
|
|
202
|
+
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +
|
|
203
|
+
` or perform a local build (which does this automatically).` +
|
|
204
|
+
` See the Git repo documentation for more info.`);
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
// For a local build, just copy the file automatically.
|
|
208
|
+
messageRouter.logWarning(ConsoleMessageId.ApiReportCopied, `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`);
|
|
209
|
+
FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
|
|
210
|
+
ensureFolderExists: true,
|
|
211
|
+
convertLineEndings: extractorConfig.newlineKind
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (messageRouter.showVerboseMessages || printApiReportDiff) {
|
|
215
|
+
const Diff = require('diff');
|
|
216
|
+
const patch = Diff.structuredPatch(expectedApiReportShortPath, actualApiReportShortPath, expectedApiReportContent, actualApiReportContent);
|
|
217
|
+
const logFunction = printApiReportDiff
|
|
218
|
+
? messageRouter.logWarning.bind(messageRouter)
|
|
219
|
+
: messageRouter.logVerbose.bind(messageRouter);
|
|
220
|
+
logFunction(ConsoleMessageId.ApiReportDiff, 'Changes to the API report:\n\n' + Diff.formatPatch(patch));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
else {
|
|
224
|
+
messageRouter.logVerbose(ConsoleMessageId.ApiReportUnchanged, `The API report is up to date: ${actualApiReportShortPath}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
// The target file does not exist, so we are setting up the API review file for the first time.
|
|
229
|
+
//
|
|
230
|
+
// NOTE: People sometimes make a mistake where they move a project and forget to update the "reportFolder"
|
|
231
|
+
// setting, which causes a new file to silently get written to the wrong place. This can be confusing.
|
|
232
|
+
// Thus we treat the initial creation of the file specially.
|
|
233
|
+
apiReportChanged = true;
|
|
234
|
+
if (!localBuild) {
|
|
235
|
+
// For a production build, issue a warning that will break the CI build.
|
|
236
|
+
messageRouter.logWarning(ConsoleMessageId.ApiReportNotCopied, 'The API report file is missing.' +
|
|
237
|
+
` Please copy the file "${actualApiReportShortPath}" to "${expectedApiReportShortPath}",` +
|
|
238
|
+
` or perform a local build (which does this automatically).` +
|
|
239
|
+
` See the Git repo documentation for more info.`);
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
const expectedApiReportFolder = path.dirname(expectedApiReportPath);
|
|
243
|
+
if (!FileSystem.exists(expectedApiReportFolder)) {
|
|
244
|
+
messageRouter.logError(ConsoleMessageId.ApiReportFolderMissing, 'Unable to create the API report file. Please make sure the target folder exists:\n' +
|
|
245
|
+
expectedApiReportFolder);
|
|
246
|
+
}
|
|
247
|
+
else {
|
|
248
|
+
FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {
|
|
249
|
+
convertLineEndings: extractorConfig.newlineKind
|
|
250
|
+
});
|
|
251
|
+
messageRouter.logWarning(ConsoleMessageId.ApiReportCreated, 'The API report file was missing, so a new file was created. Please add this file to Git:\n' +
|
|
252
|
+
expectedApiReportPath);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
return apiReportChanged;
|
|
257
|
+
}
|
|
258
|
+
static _checkCompilerCompatibility(extractorConfig, messageRouter) {
|
|
259
|
+
messageRouter.logInfo(ConsoleMessageId.Preamble, `Analysis will use the bundled TypeScript version ${ts.version}`);
|
|
260
|
+
try {
|
|
261
|
+
const typescriptPath = resolve.sync('typescript', {
|
|
262
|
+
basedir: extractorConfig.projectFolder,
|
|
263
|
+
preserveSymlinks: false
|
|
264
|
+
});
|
|
265
|
+
const packageJsonLookup = new PackageJsonLookup();
|
|
266
|
+
const packageJson = packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);
|
|
267
|
+
if (packageJson && packageJson.version && semver.valid(packageJson.version)) {
|
|
268
|
+
// Consider a newer MINOR release to be incompatible
|
|
269
|
+
const ourMajor = semver.major(ts.version);
|
|
270
|
+
const ourMinor = semver.minor(ts.version);
|
|
271
|
+
const theirMajor = semver.major(packageJson.version);
|
|
272
|
+
const theirMinor = semver.minor(packageJson.version);
|
|
273
|
+
if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {
|
|
274
|
+
messageRouter.logInfo(ConsoleMessageId.CompilerVersionNotice, `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +
|
|
275
|
+
` bundled compiler engine; consider upgrading API Extractor.`);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
catch (e) {
|
|
280
|
+
// The compiler detection heuristic is not expected to work in many configurations
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
static _generateRollupDtsFile(collector, outputPath, dtsKind, newlineKind) {
|
|
284
|
+
if (outputPath !== '') {
|
|
285
|
+
collector.messageRouter.logVerbose(ConsoleMessageId.WritingDtsRollup, `Writing package typings: ${outputPath}`);
|
|
286
|
+
DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=Extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Extractor.js","sourceRoot":"","sources":["../../src/api/Extractor.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,2DAA2D;AAE3D,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,OAAO,MAAM,SAAS,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,UAAU,EACV,WAAW,EACX,iBAAiB,EAGjB,IAAI,EACL,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,eAAe,EAAkC,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,E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AC,CAAC;gBAClD,MAAM,QAAQ,GAAW,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;gBAElD,MAAM,UAAU,GAAW,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAC7D,MAAM,UAAU,GAAW,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBAE7D,IAAI,UAAU,GAAG,QAAQ,IAAI,CAAC,UAAU,KAAK,QAAQ,IAAI,UAAU,GAAG,QAAQ,CAAC,EAAE,CAAC;oBAChF,aAAa,CAAC,OAAO,CACnB,gBAAgB,CAAC,qBAAqB,EACtC,oDAAoD,WAAW,CAAC,OAAO,0BAA0B;wBAC/F,6DAA6D,CAChE,CAAC;gBACJ,CAAC;YACH,CAAC;QACH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,kFAAkF;QACpF,CAAC;IACH,CAAC;IAEO,MAAM,CAAC,sBAAsB,CACnC,SAAoB,EACpB,UAAkB,EAClB,OAAsB,EACtB,WAAwB;QAExB,IAAI,UAAU,KAAK,EAAE,EAAE,CAAC;YACtB,SAAS,CAAC,aAAa,CAAC,UAAU,CAChC,gBAAgB,CAAC,gBAAgB,EACjC,4BAA4B,UAAU,EAAE,CACzC,CAAC;YACF,kBAAkB,CAAC,gBAAgB,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n// See LICENSE in the project root for license information.\n\nimport * as path from 'node:path';\n\nimport * as semver from 'semver';\nimport * as ts from 'typescript';\nimport * as resolve from 'resolve';\n\nimport type { ApiPackage } from '@microsoft/api-extractor-model';\nimport { TSDocConfigFile } from '@microsoft/tsdoc-config';\nimport {\n FileSystem,\n NewlineKind,\n PackageJsonLookup,\n type IPackageJson,\n type INodePackageJson,\n Path\n} from '@rushstack/node-core-library';\n\nimport { ExtractorConfig, type IExtractorConfigApiReport } from './ExtractorConfig';\nimport { Collector } from '../collector/Collector';\nimport { DtsRollupGenerator, DtsRollupKind } from '../generators/DtsRollupGenerator';\nimport { ApiModelGenerator } from '../generators/ApiModelGenerator';\nimport { ApiReportGenerator } from '../generators/ApiReportGenerator';\nimport { PackageMetadataManager } from '../analyzer/PackageMetadataManager';\nimport { ValidationEnhancer } from '../enhancers/ValidationEnhancer';\nimport { DocCommentEnhancer } from '../enhancers/DocCommentEnhancer';\nimport { CompilerState } from './CompilerState';\nimport type { ExtractorMessage } from './ExtractorMessage';\nimport { MessageRouter } from '../collector/MessageRouter';\nimport { ConsoleMessageId } from './ConsoleMessageId';\nimport { SourceMapper } from '../collector/SourceMapper';\n\n/**\n * Runtime options for Extractor.\n *\n * @public\n */\nexport interface IExtractorInvokeOptions {\n /**\n * An optional TypeScript compiler state. This allows an optimization where multiple invocations of API Extractor\n * can reuse the same TypeScript compiler analysis.\n */\n compilerState?: CompilerState;\n\n /**\n * Indicates that API Extractor is running as part of a local build, e.g. on developer's\n * machine.\n *\n * @remarks\n * This disables certain validation that would normally be performed for a ship/production build. For example,\n * the *.api.md report file is automatically updated in a local build.\n *\n * The default value is false.\n */\n localBuild?: boolean;\n\n /**\n * If true, API Extractor will include {@link ExtractorLogLevel.Verbose} messages in its output.\n */\n showVerboseMessages?: boolean;\n\n /**\n * If true, API Extractor will print diagnostic information used for troubleshooting problems.\n * These messages will be included as {@link ExtractorLogLevel.Verbose} output.\n *\n * @remarks\n * Setting `showDiagnostics=true` forces `showVerboseMessages=true`.\n */\n showDiagnostics?: boolean;\n\n /**\n * Specifies an alternate folder path to be used when loading the TypeScript system typings.\n *\n * @remarks\n * API Extractor uses its own TypeScript compiler engine to analyze your project. If your project\n * is built with a significantly different TypeScript version, sometimes API Extractor may report compilation\n * errors due to differences in the system typings (e.g. lib.dom.d.ts). You can use the \"--typescriptCompilerFolder\"\n * option to specify the folder path where you installed the TypeScript package, and API Extractor's compiler will\n * use those system typings instead.\n */\n typescriptCompilerFolder?: string;\n\n /**\n * An optional callback function that will be called for each `ExtractorMessage` before it is displayed by\n * API Extractor. The callback can customize the message, handle it, or discard it.\n *\n * @remarks\n * If a `messageCallback` is not provided, then by default API Extractor will print the messages to\n * the STDERR/STDOUT console.\n */\n messageCallback?: (message: ExtractorMessage) => void;\n\n /**\n * If true, then any differences between the actual and expected API reports will be\n * printed on the console.\n *\n * @remarks\n * The diff is not printed if the expected API report file has not been created yet.\n */\n printApiReportDiff?: boolean;\n}\n\n/**\n * This object represents the outcome of an invocation of API Extractor.\n *\n * @public\n */\nexport class ExtractorResult {\n /**\n * The TypeScript compiler state that was used.\n */\n public readonly compilerState: CompilerState;\n\n /**\n * The API Extractor configuration that was used.\n */\n public readonly extractorConfig: ExtractorConfig;\n\n /**\n * Whether the invocation of API Extractor was successful. For example, if `succeeded` is false, then the build task\n * would normally return a nonzero process exit code, indicating that the operation failed.\n *\n * @remarks\n *\n * Normally the operation \"succeeds\" if `errorCount` and `warningCount` are both zero. However if\n * {@link IExtractorInvokeOptions.localBuild} is `true`, then the operation \"succeeds\" if `errorCount` is zero\n * (i.e. warnings are ignored).\n */\n public readonly succeeded: boolean;\n\n /**\n * Returns true if the API report was found to have changed.\n */\n public readonly apiReportChanged: boolean;\n\n /**\n * Reports the number of errors encountered during analysis.\n *\n * @remarks\n * This does not count exceptions, where unexpected issues prematurely abort the operation.\n */\n public readonly errorCount: number;\n\n /**\n * Reports the number of warnings encountered during analysis.\n *\n * @remarks\n * This does not count warnings that are emitted in the API report file.\n */\n public readonly warningCount: number;\n\n /** @internal */\n public constructor(properties: ExtractorResult) {\n this.compilerState = properties.compilerState;\n this.extractorConfig = properties.extractorConfig;\n this.succeeded = properties.succeeded;\n this.apiReportChanged = properties.apiReportChanged;\n this.errorCount = properties.errorCount;\n this.warningCount = properties.warningCount;\n }\n}\n\n/**\n * The starting point for invoking the API Extractor tool.\n * @public\n */\nexport class Extractor {\n /**\n * Returns the version number of the API Extractor NPM package.\n */\n public static get version(): string {\n return Extractor._getPackageJson().version;\n }\n\n /**\n * Returns the package name of the API Extractor NPM package.\n */\n public static get packageName(): string {\n return Extractor._getPackageJson().name;\n }\n\n private static _getPackageJson(): IPackageJson {\n return PackageJsonLookup.loadOwnPackageJson(__dirname);\n }\n\n /**\n * Load the api-extractor.json config file from the specified path, and then invoke API Extractor.\n */\n public static loadConfigAndInvoke(\n configFilePath: string,\n options?: IExtractorInvokeOptions\n ): ExtractorResult {\n const extractorConfig: ExtractorConfig = ExtractorConfig.loadFileAndPrepare(configFilePath);\n\n return Extractor.invoke(extractorConfig, options);\n }\n\n /**\n * Invoke API Extractor using an already prepared `ExtractorConfig` object.\n */\n public static invoke(extractorConfig: ExtractorConfig, options?: IExtractorInvokeOptions): ExtractorResult {\n const {\n packageFolder,\n messages,\n tsdocConfiguration,\n tsdocConfigFile: { filePath: tsdocConfigFilePath, fileNotFound: tsdocConfigFileNotFound },\n apiJsonFilePath,\n newlineKind,\n reportTempFolder,\n reportFolder,\n apiReportEnabled,\n reportConfigs,\n testMode,\n rollupEnabled,\n publicTrimmedFilePath,\n alphaTrimmedFilePath,\n betaTrimmedFilePath,\n untrimmedFilePath,\n tsdocMetadataEnabled,\n tsdocMetadataFilePath\n } = extractorConfig;\n const {\n localBuild = false,\n compilerState = CompilerState.create(extractorConfig, options),\n messageCallback,\n showVerboseMessages = false,\n showDiagnostics = false,\n printApiReportDiff = false\n } = options ?? {};\n\n const sourceMapper: SourceMapper = new SourceMapper();\n\n const messageRouter: MessageRouter = new MessageRouter({\n workingPackageFolder: packageFolder,\n messageCallback,\n messagesConfig: messages || {},\n showVerboseMessages,\n showDiagnostics,\n tsdocConfiguration,\n sourceMapper\n });\n\n if (tsdocConfigFilePath && !tsdocConfigFileNotFound) {\n if (!Path.isEqual(tsdocConfigFilePath, ExtractorConfig._tsdocBaseFilePath)) {\n messageRouter.logVerbose(\n ConsoleMessageId.UsingCustomTSDocConfig,\n `Using custom TSDoc config from ${tsdocConfigFilePath}`\n );\n }\n }\n\n this._checkCompilerCompatibility(extractorConfig, messageRouter);\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic('');\n messageRouter.logDiagnosticHeader('Final prepared ExtractorConfig');\n messageRouter.logDiagnostic(extractorConfig.getDiagnosticDump());\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('Compiler options');\n const serializedCompilerOptions: object = MessageRouter.buildJsonDumpObject(\n (compilerState.program as ts.Program).getCompilerOptions()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedCompilerOptions, undefined, 2));\n messageRouter.logDiagnosticFooter();\n\n messageRouter.logDiagnosticHeader('TSDoc configuration');\n // Convert the TSDocConfiguration into a tsdoc.json representation\n const combinedConfigFile: TSDocConfigFile = TSDocConfigFile.loadFromParser(tsdocConfiguration);\n const serializedTSDocConfig: object = MessageRouter.buildJsonDumpObject(\n combinedConfigFile.saveToObject()\n );\n messageRouter.logDiagnostic(JSON.stringify(serializedTSDocConfig, undefined, 2));\n messageRouter.logDiagnosticFooter();\n }\n\n const collector: Collector = new Collector({\n program: compilerState.program as ts.Program,\n messageRouter,\n extractorConfig,\n sourceMapper\n });\n\n collector.analyze();\n\n DocCommentEnhancer.analyze(collector);\n ValidationEnhancer.analyze(collector);\n\n const modelBuilder: ApiModelGenerator = new ApiModelGenerator(collector, extractorConfig);\n const apiPackage: ApiPackage = modelBuilder.buildApiPackage();\n\n if (messageRouter.showDiagnostics) {\n messageRouter.logDiagnostic(''); // skip a line after any diagnostic messages\n }\n\n if (modelBuilder.docModelEnabled) {\n messageRouter.logVerbose(ConsoleMessageId.WritingDocModelFile, `Writing: ${apiJsonFilePath}`);\n apiPackage.saveToJsonFile(apiJsonFilePath, {\n toolPackage: Extractor.packageName,\n toolVersion: Extractor.version,\n\n newlineConversion: newlineKind,\n ensureFolderExists: true,\n testMode\n });\n }\n\n function writeApiReport(reportConfig: IExtractorConfigApiReport): boolean {\n return Extractor._writeApiReport(\n collector,\n extractorConfig,\n messageRouter,\n reportTempFolder,\n reportFolder,\n reportConfig,\n localBuild,\n printApiReportDiff\n );\n }\n\n let anyReportChanged: boolean = false;\n if (apiReportEnabled) {\n for (const reportConfig of reportConfigs) {\n anyReportChanged = writeApiReport(reportConfig) || anyReportChanged;\n }\n }\n\n if (rollupEnabled) {\n Extractor._generateRollupDtsFile(\n collector,\n publicTrimmedFilePath,\n DtsRollupKind.PublicRelease,\n newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n alphaTrimmedFilePath,\n DtsRollupKind.AlphaRelease,\n newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n betaTrimmedFilePath,\n DtsRollupKind.BetaRelease,\n newlineKind\n );\n Extractor._generateRollupDtsFile(\n collector,\n untrimmedFilePath,\n DtsRollupKind.InternalRelease,\n newlineKind\n );\n }\n\n if (tsdocMetadataEnabled) {\n // Write the tsdoc-metadata.json file for this project\n PackageMetadataManager.writeTsdocMetadataFile(tsdocMetadataFilePath, newlineKind);\n }\n\n // Show all the messages that we collected during analysis\n messageRouter.handleRemainingNonConsoleMessages();\n\n // Determine success\n let succeeded: boolean;\n if (localBuild) {\n // For a local build, fail if there were errors (but ignore warnings)\n succeeded = messageRouter.errorCount === 0;\n } else {\n // For a production build, fail if there were any errors or warnings\n succeeded = messageRouter.errorCount + messageRouter.warningCount === 0;\n }\n\n return new ExtractorResult({\n compilerState,\n extractorConfig,\n succeeded,\n apiReportChanged: anyReportChanged,\n errorCount: messageRouter.errorCount,\n warningCount: messageRouter.warningCount\n });\n }\n\n /**\n * Generates the API report at the specified release level, writes it to the specified file path, and compares\n * the output to the existing report (if one exists).\n *\n * @param reportTempDirectoryPath - The path to the directory under which the temp report file will be written prior\n * to comparison with an existing report.\n * @param reportDirectoryPath - The path to the directory under which the existing report file is located, and to\n * which the new report will be written post-comparison.\n * @param reportConfig - API report configuration, including its file name and {@link ApiReportVariant}.\n * @param printApiReportDiff - {@link IExtractorInvokeOptions.printApiReportDiff}\n *\n * @returns Whether or not the newly generated report differs from the existing report (if one exists).\n */\n private static _writeApiReport(\n collector: Collector,\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter,\n reportTempDirectoryPath: string,\n reportDirectoryPath: string,\n reportConfig: IExtractorConfigApiReport,\n localBuild: boolean,\n printApiReportDiff: boolean\n ): boolean {\n let apiReportChanged: boolean = false;\n\n const actualApiReportPath: string = path.resolve(reportTempDirectoryPath, reportConfig.fileName);\n const actualApiReportShortPath: string = extractorConfig._getShortFilePath(actualApiReportPath);\n\n const expectedApiReportPath: string = path.resolve(reportDirectoryPath, reportConfig.fileName);\n const expectedApiReportShortPath: string = extractorConfig._getShortFilePath(expectedApiReportPath);\n\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingApiReport,\n `Generating ${reportConfig.variant} API report: ${expectedApiReportPath}`\n );\n\n const actualApiReportContent: string = ApiReportGenerator.generateReviewFileContent(\n collector,\n reportConfig.variant\n );\n\n // Write the actual file\n FileSystem.writeFile(actualApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n\n // Compare it against the expected file\n if (FileSystem.exists(expectedApiReportPath)) {\n const expectedApiReportContent: string = FileSystem.readFile(expectedApiReportPath, {\n convertLineEndings: NewlineKind.Lf\n });\n\n if (\n !ApiReportGenerator.areEquivalentApiFileContents(actualApiReportContent, expectedApiReportContent)\n ) {\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'You have changed the API signature for this project.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n // For a local build, just copy the file automatically.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCopied,\n `You have changed the API signature for this project. Updating ${expectedApiReportShortPath}`\n );\n\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n ensureFolderExists: true,\n convertLineEndings: extractorConfig.newlineKind\n });\n }\n\n if (messageRouter.showVerboseMessages || printApiReportDiff) {\n const Diff: typeof import('diff') = require('diff');\n const patch: import('diff').StructuredPatch = Diff.structuredPatch(\n expectedApiReportShortPath,\n actualApiReportShortPath,\n expectedApiReportContent,\n actualApiReportContent\n );\n const logFunction:\n | (typeof MessageRouter.prototype)['logWarning']\n | (typeof MessageRouter.prototype)['logVerbose'] = printApiReportDiff\n ? messageRouter.logWarning.bind(messageRouter)\n : messageRouter.logVerbose.bind(messageRouter);\n\n logFunction(\n ConsoleMessageId.ApiReportDiff,\n 'Changes to the API report:\\n\\n' + Diff.formatPatch(patch)\n );\n }\n } else {\n messageRouter.logVerbose(\n ConsoleMessageId.ApiReportUnchanged,\n `The API report is up to date: ${actualApiReportShortPath}`\n );\n }\n } else {\n // The target file does not exist, so we are setting up the API review file for the first time.\n //\n // NOTE: People sometimes make a mistake where they move a project and forget to update the \"reportFolder\"\n // setting, which causes a new file to silently get written to the wrong place. This can be confusing.\n // Thus we treat the initial creation of the file specially.\n apiReportChanged = true;\n\n if (!localBuild) {\n // For a production build, issue a warning that will break the CI build.\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportNotCopied,\n 'The API report file is missing.' +\n ` Please copy the file \"${actualApiReportShortPath}\" to \"${expectedApiReportShortPath}\",` +\n ` or perform a local build (which does this automatically).` +\n ` See the Git repo documentation for more info.`\n );\n } else {\n const expectedApiReportFolder: string = path.dirname(expectedApiReportPath);\n if (!FileSystem.exists(expectedApiReportFolder)) {\n messageRouter.logError(\n ConsoleMessageId.ApiReportFolderMissing,\n 'Unable to create the API report file. Please make sure the target folder exists:\\n' +\n expectedApiReportFolder\n );\n } else {\n FileSystem.writeFile(expectedApiReportPath, actualApiReportContent, {\n convertLineEndings: extractorConfig.newlineKind\n });\n messageRouter.logWarning(\n ConsoleMessageId.ApiReportCreated,\n 'The API report file was missing, so a new file was created. Please add this file to Git:\\n' +\n expectedApiReportPath\n );\n }\n }\n }\n return apiReportChanged;\n }\n\n private static _checkCompilerCompatibility(\n extractorConfig: ExtractorConfig,\n messageRouter: MessageRouter\n ): void {\n messageRouter.logInfo(\n ConsoleMessageId.Preamble,\n `Analysis will use the bundled TypeScript version ${ts.version}`\n );\n\n try {\n const typescriptPath: string = resolve.sync('typescript', {\n basedir: extractorConfig.projectFolder,\n preserveSymlinks: false\n });\n const packageJsonLookup: PackageJsonLookup = new PackageJsonLookup();\n const packageJson: INodePackageJson | undefined =\n packageJsonLookup.tryLoadNodePackageJsonFor(typescriptPath);\n if (packageJson && packageJson.version && semver.valid(packageJson.version)) {\n // Consider a newer MINOR release to be incompatible\n const ourMajor: number = semver.major(ts.version);\n const ourMinor: number = semver.minor(ts.version);\n\n const theirMajor: number = semver.major(packageJson.version);\n const theirMinor: number = semver.minor(packageJson.version);\n\n if (theirMajor > ourMajor || (theirMajor === ourMajor && theirMinor > ourMinor)) {\n messageRouter.logInfo(\n ConsoleMessageId.CompilerVersionNotice,\n `*** The target project appears to use TypeScript ${packageJson.version} which is newer than the` +\n ` bundled compiler engine; consider upgrading API Extractor.`\n );\n }\n }\n } catch (e) {\n // The compiler detection heuristic is not expected to work in many configurations\n }\n }\n\n private static _generateRollupDtsFile(\n collector: Collector,\n outputPath: string,\n dtsKind: DtsRollupKind,\n newlineKind: NewlineKind\n ): void {\n if (outputPath !== '') {\n collector.messageRouter.logVerbose(\n ConsoleMessageId.WritingDtsRollup,\n `Writing package typings: ${outputPath}`\n );\n DtsRollupGenerator.writeTypingsFile(collector, outputPath, dtsKind, newlineKind);\n }\n }\n}\n"]}
|