@microsoft/api-extractor
Advanced tools
Comparing version
# Change Log - @microsoft/api-extractor | ||
This log was last generated on Thu, 01 May 2025 00:11:12 GMT and should not be manually modified. | ||
This log was last generated on Thu, 01 May 2025 15:11:33 GMT and should not be manually modified. | ||
## 7.52.7 | ||
Thu, 01 May 2025 15:11:33 GMT | ||
### Patches | ||
- Fix an issue where default exports were sometimes trimmed incorrectly in .api.md files when using `reportVariants` (GitHub #4775) | ||
## 7.52.6 | ||
@@ -6,0 +13,0 @@ Thu, 01 May 2025 00:11:12 GMT |
@@ -24,3 +24,4 @@ import { Collector } from '../collector/Collector'; | ||
private static _modifySpan; | ||
private static _shouldIncludeInReport; | ||
private static _shouldIncludeDeclaration; | ||
private static _shouldIncludeReleaseTag; | ||
/** | ||
@@ -27,0 +28,0 @@ * For declarations marked as `@preapproved`, this is used instead of _modifySpan(). |
@@ -74,2 +74,3 @@ "use strict"; | ||
static generateReviewFileContent(collector, reportVariant) { | ||
var _a; | ||
const writer = new IndentedWriter_1.IndentedWriter(); | ||
@@ -109,2 +110,7 @@ writer.trimLeadingSpaces = true; | ||
const astEntity = entity.astEntity; | ||
const symbolMetadata = collector.tryFetchMetadataForAstEntity(astEntity); | ||
const maxEffectiveReleaseTag = (_a = symbolMetadata === null || symbolMetadata === void 0 ? void 0 : symbolMetadata.maxEffectiveReleaseTag) !== null && _a !== void 0 ? _a : api_extractor_model_1.ReleaseTag.None; | ||
if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, reportVariant)) { | ||
continue; | ||
} | ||
if (entity.consumable || collector.extractorConfig.apiReportIncludeForgottenExports) { | ||
@@ -136,3 +142,3 @@ const exportsToEmit = new Map(); | ||
} | ||
if (this._shouldIncludeInReport(collector, astDeclaration, reportVariant)) { | ||
if (this._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) { | ||
writer.ensureSkippedLine(); | ||
@@ -243,3 +249,3 @@ writer.write(ApiReportGenerator._getAedocSynopsis(collector, astDeclaration, messagesToReport)); | ||
// eslint-disable-next-line no-bitwise | ||
if (!ApiReportGenerator._shouldIncludeInReport(collector, astDeclaration, reportVariant)) { | ||
if (!ApiReportGenerator._shouldIncludeDeclaration(collector, astDeclaration, reportVariant)) { | ||
span.modification.skipAll(); | ||
@@ -355,3 +361,3 @@ return; | ||
childAstDeclaration = collector.astSymbolTable.getChildAstDeclarationByNode(child.node, astDeclaration); | ||
if (ApiReportGenerator._shouldIncludeInReport(collector, childAstDeclaration, reportVariant)) { | ||
if (ApiReportGenerator._shouldIncludeDeclaration(collector, childAstDeclaration, reportVariant)) { | ||
if (sortChildren) { | ||
@@ -373,3 +379,3 @@ span.modification.sortChildren = true; | ||
} | ||
static _shouldIncludeInReport(collector, astDeclaration, reportVariant) { | ||
static _shouldIncludeDeclaration(collector, astDeclaration, reportVariant) { | ||
// Private declarations are not included in the API report | ||
@@ -381,7 +387,5 @@ // eslint-disable-next-line no-bitwise | ||
const apiItemMetadata = collector.fetchApiItemMetadata(astDeclaration); | ||
// No specified release tag is considered the same as `@public`. | ||
const releaseTag = apiItemMetadata.effectiveReleaseTag === api_extractor_model_1.ReleaseTag.None | ||
? api_extractor_model_1.ReleaseTag.Public | ||
: apiItemMetadata.effectiveReleaseTag; | ||
// If the declaration has a release tag that is not in scope, omit it from the report. | ||
return this._shouldIncludeReleaseTag(apiItemMetadata.effectiveReleaseTag, reportVariant); | ||
} | ||
static _shouldIncludeReleaseTag(releaseTag, reportVariant) { | ||
switch (reportVariant) { | ||
@@ -391,7 +395,16 @@ case 'complete': | ||
case 'alpha': | ||
return releaseTag >= api_extractor_model_1.ReleaseTag.Alpha; | ||
return (releaseTag === api_extractor_model_1.ReleaseTag.Alpha || | ||
releaseTag === api_extractor_model_1.ReleaseTag.Beta || | ||
releaseTag === api_extractor_model_1.ReleaseTag.Public || | ||
// NOTE: No specified release tag is implicitly treated as `@public`. | ||
releaseTag === api_extractor_model_1.ReleaseTag.None); | ||
case 'beta': | ||
return releaseTag >= api_extractor_model_1.ReleaseTag.Beta; | ||
return (releaseTag === api_extractor_model_1.ReleaseTag.Beta || | ||
releaseTag === api_extractor_model_1.ReleaseTag.Public || | ||
// NOTE: No specified release tag is implicitly treated as `@public`. | ||
releaseTag === api_extractor_model_1.ReleaseTag.None); | ||
case 'public': | ||
return releaseTag === api_extractor_model_1.ReleaseTag.Public; | ||
return (releaseTag === api_extractor_model_1.ReleaseTag.Public || | ||
// NOTE: No specified release tag is implicitly treated as `@public`. | ||
releaseTag === api_extractor_model_1.ReleaseTag.None); | ||
default: | ||
@@ -398,0 +411,0 @@ throw new Error(`Unrecognized release level: ${reportVariant}`); |
{ | ||
"name": "@microsoft/api-extractor", | ||
"version": "7.52.6", | ||
"version": "7.52.7", | ||
"description": "Analyze the exported API for a TypeScript library and generate reviews, documentation, and .d.ts rollups", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
2008249
0.15%25282
0.1%