@fern-api/fern-api-dev 5.8.1-6-g373abe1fdc5 → 5.9.0-rc.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/cli.cjs +262 -314
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -105573,12 +105573,12 @@ ${problem.message}
|
|
|
105573
105573
|
endLine: location2.end?.line,
|
|
105574
105574
|
endColumn: location2.end?.col
|
|
105575
105575
|
};
|
|
105576
|
-
output_1.output.write(`::${command3} ${
|
|
105576
|
+
output_1.output.write(`::${command3} ${formatProperties2(properties7)}::${escapeMessage(message)}
|
|
105577
105577
|
`);
|
|
105578
105578
|
}
|
|
105579
105579
|
}
|
|
105580
|
-
function
|
|
105581
|
-
return Object.entries(props).filter(([, v9]) => v9 !== null && v9 !== void 0).map(([k5, v9]) => `${k5}=${
|
|
105580
|
+
function formatProperties2(props) {
|
|
105581
|
+
return Object.entries(props).filter(([, v9]) => v9 !== null && v9 !== void 0).map(([k5, v9]) => `${k5}=${escapeProperty2(v9)}`).join(",");
|
|
105582
105582
|
}
|
|
105583
105583
|
function toString10(v9) {
|
|
105584
105584
|
if (v9 === null || v9 === void 0) {
|
|
@@ -105591,7 +105591,7 @@ ${problem.message}
|
|
|
105591
105591
|
function escapeMessage(v9) {
|
|
105592
105592
|
return toString10(v9).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A");
|
|
105593
105593
|
}
|
|
105594
|
-
function
|
|
105594
|
+
function escapeProperty2(v9) {
|
|
105595
105595
|
return toString10(v9).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
105596
105596
|
}
|
|
105597
105597
|
}
|
|
@@ -257357,14 +257357,14 @@ var require_emoji_regex = __commonJS({
|
|
|
257357
257357
|
var require_string_width = __commonJS({
|
|
257358
257358
|
"../../../node_modules/.pnpm/string-width@4.2.3/node_modules/string-width/index.js"(exports2, module4) {
|
|
257359
257359
|
"use strict";
|
|
257360
|
-
var
|
|
257360
|
+
var stripAnsi6 = require_strip_ansi();
|
|
257361
257361
|
var isFullwidthCodePoint = require_is_fullwidth_code_point();
|
|
257362
257362
|
var emojiRegex3 = require_emoji_regex();
|
|
257363
257363
|
var stringWidth4 = (string28) => {
|
|
257364
257364
|
if (typeof string28 !== "string" || string28.length === 0) {
|
|
257365
257365
|
return 0;
|
|
257366
257366
|
}
|
|
257367
|
-
string28 =
|
|
257367
|
+
string28 = stripAnsi6(string28);
|
|
257368
257368
|
if (string28.length === 0) {
|
|
257369
257369
|
return 0;
|
|
257370
257370
|
}
|
|
@@ -258499,7 +258499,7 @@ var require_wrap_ansi = __commonJS({
|
|
|
258499
258499
|
"../../../node_modules/.pnpm/wrap-ansi@6.2.0/node_modules/wrap-ansi/index.js"(exports2, module4) {
|
|
258500
258500
|
"use strict";
|
|
258501
258501
|
var stringWidth4 = require_string_width();
|
|
258502
|
-
var
|
|
258502
|
+
var stripAnsi6 = require_strip_ansi();
|
|
258503
258503
|
var ansiStyles3 = require_ansi_styles();
|
|
258504
258504
|
var ESCAPES2 = /* @__PURE__ */ new Set([
|
|
258505
258505
|
"\x1B",
|
|
@@ -258511,7 +258511,7 @@ var require_wrap_ansi = __commonJS({
|
|
|
258511
258511
|
var wrapWord2 = (rows, word, columns) => {
|
|
258512
258512
|
const characters = [...word];
|
|
258513
258513
|
let isInsideEscape = false;
|
|
258514
|
-
let visible = stringWidth4(
|
|
258514
|
+
let visible = stringWidth4(stripAnsi6(rows[rows.length - 1]));
|
|
258515
258515
|
for (const [index3, character] of characters.entries()) {
|
|
258516
258516
|
const characterLength = stringWidth4(character);
|
|
258517
258517
|
if (visible + characterLength <= columns) {
|
|
@@ -259899,7 +259899,7 @@ var require_ora = __commonJS({
|
|
|
259899
259899
|
var cliCursor2 = require_cli_cursor();
|
|
259900
259900
|
var cliSpinners2 = require_cli_spinners();
|
|
259901
259901
|
var logSymbols2 = require_log_symbols();
|
|
259902
|
-
var
|
|
259902
|
+
var stripAnsi6 = require_strip_ansi();
|
|
259903
259903
|
var wcwidth = require_wcwidth();
|
|
259904
259904
|
var isInteractive2 = require_is_interactive();
|
|
259905
259905
|
var isUnicodeSupported3 = require_is_unicode_supported();
|
|
@@ -260066,7 +260066,7 @@ var require_ora = __commonJS({
|
|
|
260066
260066
|
const columns = this.stream.columns || 80;
|
|
260067
260067
|
const fullPrefixText = this.getFullPrefixText(this.prefixText, "-");
|
|
260068
260068
|
this.lineCount = 0;
|
|
260069
|
-
for (const line of
|
|
260069
|
+
for (const line of stripAnsi6(fullPrefixText + "--" + this[TEXT]).split("\n")) {
|
|
260070
260070
|
this.lineCount += Math.max(1, Math.ceil(wcwidth(line) / columns));
|
|
260071
260071
|
}
|
|
260072
260072
|
}
|
|
@@ -427270,7 +427270,7 @@ var require_wrap_ansi2 = __commonJS({
|
|
|
427270
427270
|
"../../../node_modules/.pnpm/wrap-ansi@7.0.0/node_modules/wrap-ansi/index.js"(exports2, module4) {
|
|
427271
427271
|
"use strict";
|
|
427272
427272
|
var stringWidth4 = require_string_width();
|
|
427273
|
-
var
|
|
427273
|
+
var stripAnsi6 = require_strip_ansi();
|
|
427274
427274
|
var ansiStyles3 = require_ansi_styles();
|
|
427275
427275
|
var ESCAPES2 = /* @__PURE__ */ new Set([
|
|
427276
427276
|
"\x1B",
|
|
@@ -427289,7 +427289,7 @@ var require_wrap_ansi2 = __commonJS({
|
|
|
427289
427289
|
const characters = [...word];
|
|
427290
427290
|
let isInsideEscape = false;
|
|
427291
427291
|
let isInsideLinkEscape = false;
|
|
427292
|
-
let visible = stringWidth4(
|
|
427292
|
+
let visible = stringWidth4(stripAnsi6(rows[rows.length - 1]));
|
|
427293
427293
|
for (const [index3, character] of characters.entries()) {
|
|
427294
427294
|
const characterLength = stringWidth4(character);
|
|
427295
427295
|
if (visible + characterLength <= columns) {
|
|
@@ -427683,12 +427683,12 @@ var require_build5 = __commonJS({
|
|
|
427683
427683
|
});
|
|
427684
427684
|
}
|
|
427685
427685
|
var stringWidth4 = require_string_width();
|
|
427686
|
-
var
|
|
427686
|
+
var stripAnsi6 = require_strip_ansi();
|
|
427687
427687
|
var wrap10 = require_wrap_ansi2();
|
|
427688
427688
|
function ui10(opts) {
|
|
427689
427689
|
return cliui2(opts, {
|
|
427690
427690
|
stringWidth: stringWidth4,
|
|
427691
|
-
stripAnsi:
|
|
427691
|
+
stripAnsi: stripAnsi6,
|
|
427692
427692
|
wrap: wrap10
|
|
427693
427693
|
});
|
|
427694
427694
|
}
|
|
@@ -511686,8 +511686,7 @@ var CheckRulesConfig = external_exports.object({
|
|
|
511686
511686
|
"valid-local-references": CheckRuleSeverity.optional(),
|
|
511687
511687
|
"no-circular-redirects": CheckRuleSeverity.optional(),
|
|
511688
511688
|
"valid-docs-endpoints": CheckRuleSeverity.optional(),
|
|
511689
|
-
"missing-redirects": CheckRuleSeverity.optional()
|
|
511690
|
-
"valid-changelog-slug": CheckRuleSeverity.optional()
|
|
511689
|
+
"missing-redirects": CheckRuleSeverity.optional()
|
|
511691
511690
|
});
|
|
511692
511691
|
var CheckConfig = external_exports.object({
|
|
511693
511692
|
rules: CheckRulesConfig.optional()
|
|
@@ -514650,8 +514649,7 @@ var CheckRulesConfig2 = schemas_exports6.object({
|
|
|
514650
514649
|
validLocalReferences: schemas_exports6.property("valid-local-references", CheckRuleSeverity3.optional()),
|
|
514651
514650
|
noCircularRedirects: schemas_exports6.property("no-circular-redirects", CheckRuleSeverity3.optional()),
|
|
514652
514651
|
validDocsEndpoints: schemas_exports6.property("valid-docs-endpoints", CheckRuleSeverity3.optional()),
|
|
514653
|
-
missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional())
|
|
514654
|
-
validChangelogSlug: schemas_exports6.property("valid-changelog-slug", CheckRuleSeverity3.optional())
|
|
514652
|
+
missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional())
|
|
514655
514653
|
});
|
|
514656
514654
|
|
|
514657
514655
|
// ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CheckConfig.js
|
|
@@ -544585,8 +544583,7 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir:
|
|
|
544585
544583
|
subtitle: typeof productObj.subtitle === "string" ? productObj.subtitle : void 0,
|
|
544586
544584
|
announcement: void 0,
|
|
544587
544585
|
tabs: void 0,
|
|
544588
|
-
navigation: void 0
|
|
544589
|
-
versions: void 0
|
|
544586
|
+
navigation: void 0
|
|
544590
544587
|
};
|
|
544591
544588
|
if (isPlainObject4(productObj.announcement)) {
|
|
544592
544589
|
const message = extractString(productObj.announcement, "message");
|
|
@@ -544595,28 +544592,28 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir:
|
|
|
544595
544592
|
}
|
|
544596
544593
|
}
|
|
544597
544594
|
if (typeof productObj.path === "string") {
|
|
544598
|
-
const
|
|
544599
|
-
|
|
544600
|
-
|
|
544601
|
-
|
|
544602
|
-
|
|
544603
|
-
});
|
|
544604
|
-
if (navFile != null) {
|
|
544605
|
-
productOverlay.tabs = navFile.tabs;
|
|
544606
|
-
productOverlay.navigation = navFile.navigation;
|
|
544595
|
+
const resolvedNavFilePath = import_path22.default.resolve(overlayDir, productObj.path);
|
|
544596
|
+
if (!resolvedNavFilePath.startsWith(overlayDir)) {
|
|
544597
|
+
context3.logger.warn(`Invalid path in product overlay: "${productObj.path}" escapes the translations directory. Skipping.`);
|
|
544598
|
+
overlay.products.push(productOverlay);
|
|
544599
|
+
continue;
|
|
544607
544600
|
}
|
|
544608
|
-
|
|
544609
|
-
|
|
544610
|
-
|
|
544611
|
-
|
|
544612
|
-
|
|
544613
|
-
|
|
544601
|
+
const navFilePath = resolvedNavFilePath;
|
|
544602
|
+
if (await doesPathExist(navFilePath)) {
|
|
544603
|
+
try {
|
|
544604
|
+
const navContent = jsYaml.load(await (0, import_promises14.readFile)(navFilePath, "utf-8"));
|
|
544605
|
+
if (isPlainObject4(navContent)) {
|
|
544606
|
+
const navObj = navContent;
|
|
544607
|
+
if (isPlainObject4(navObj.tabs)) {
|
|
544608
|
+
productOverlay.tabs = parseTabOverlays(navObj.tabs);
|
|
544609
|
+
}
|
|
544610
|
+
if (Array.isArray(navObj.navigation)) {
|
|
544611
|
+
productOverlay.navigation = parseNavigationItemOverlays(navObj.navigation);
|
|
544612
|
+
}
|
|
544613
|
+
}
|
|
544614
|
+
} catch (error50) {
|
|
544615
|
+
context3.logger.warn(`Failed to load translation nav file "${navFilePath}": ${String(error50)}`);
|
|
544614
544616
|
}
|
|
544615
|
-
productOverlay.versions.push(await parseVersionOverlay({
|
|
544616
|
-
versionObj: version7,
|
|
544617
|
-
overlayDir,
|
|
544618
|
-
context: context3
|
|
544619
|
-
}));
|
|
544620
544617
|
}
|
|
544621
544618
|
}
|
|
544622
544619
|
overlay.products.push(productOverlay);
|
|
@@ -544628,11 +544625,11 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir:
|
|
|
544628
544625
|
if (!isPlainObject4(version7)) {
|
|
544629
544626
|
continue;
|
|
544630
544627
|
}
|
|
544631
|
-
|
|
544632
|
-
|
|
544633
|
-
|
|
544634
|
-
|
|
544635
|
-
})
|
|
544628
|
+
const versionObj = version7;
|
|
544629
|
+
overlay.versions.push({
|
|
544630
|
+
slug: typeof versionObj.slug === "string" ? versionObj.slug : void 0,
|
|
544631
|
+
displayName: typeof versionObj["display-name"] === "string" ? versionObj["display-name"] : void 0
|
|
544632
|
+
});
|
|
544636
544633
|
}
|
|
544637
544634
|
}
|
|
544638
544635
|
if (Array.isArray(docsYmlContent.navigation)) {
|
|
@@ -544640,51 +544637,6 @@ async function parseNavigationOverlayFromDocsYml({ docsYmlContent, langFernDir:
|
|
|
544640
544637
|
}
|
|
544641
544638
|
return overlay;
|
|
544642
544639
|
}
|
|
544643
|
-
async function parseVersionOverlay({ versionObj, overlayDir, context: context3 }) {
|
|
544644
|
-
const versionOverlay = {
|
|
544645
|
-
slug: typeof versionObj.slug === "string" ? versionObj.slug : void 0,
|
|
544646
|
-
displayName: typeof versionObj["display-name"] === "string" ? versionObj["display-name"] : void 0,
|
|
544647
|
-
tabs: void 0,
|
|
544648
|
-
navigation: void 0
|
|
544649
|
-
};
|
|
544650
|
-
if (typeof versionObj.path === "string") {
|
|
544651
|
-
const navFile = await loadNavOverlayFile({
|
|
544652
|
-
relativeNavPath: versionObj.path,
|
|
544653
|
-
overlayDir,
|
|
544654
|
-
overlayKind: "version",
|
|
544655
|
-
context: context3
|
|
544656
|
-
});
|
|
544657
|
-
if (navFile != null) {
|
|
544658
|
-
versionOverlay.tabs = navFile.tabs;
|
|
544659
|
-
versionOverlay.navigation = navFile.navigation;
|
|
544660
|
-
}
|
|
544661
|
-
}
|
|
544662
|
-
return versionOverlay;
|
|
544663
|
-
}
|
|
544664
|
-
async function loadNavOverlayFile({ relativeNavPath, overlayDir, overlayKind, context: context3 }) {
|
|
544665
|
-
const resolvedNavFilePath = import_path22.default.resolve(overlayDir, relativeNavPath);
|
|
544666
|
-
if (!resolvedNavFilePath.startsWith(overlayDir)) {
|
|
544667
|
-
context3.logger.warn(`Invalid path in ${overlayKind} overlay: "${relativeNavPath}" escapes the translations directory. Skipping.`);
|
|
544668
|
-
return void 0;
|
|
544669
|
-
}
|
|
544670
|
-
if (!await doesPathExist(resolvedNavFilePath)) {
|
|
544671
|
-
return void 0;
|
|
544672
|
-
}
|
|
544673
|
-
try {
|
|
544674
|
-
const navContent = jsYaml.load(await (0, import_promises14.readFile)(resolvedNavFilePath, "utf-8"));
|
|
544675
|
-
if (!isPlainObject4(navContent)) {
|
|
544676
|
-
return void 0;
|
|
544677
|
-
}
|
|
544678
|
-
const navObj = navContent;
|
|
544679
|
-
return {
|
|
544680
|
-
tabs: isPlainObject4(navObj.tabs) ? parseTabOverlays(navObj.tabs) : void 0,
|
|
544681
|
-
navigation: Array.isArray(navObj.navigation) ? parseNavigationItemOverlays(navObj.navigation) : void 0
|
|
544682
|
-
};
|
|
544683
|
-
} catch (error50) {
|
|
544684
|
-
context3.logger.warn(`Failed to load translation nav file "${resolvedNavFilePath}": ${String(error50)}`);
|
|
544685
|
-
return void 0;
|
|
544686
|
-
}
|
|
544687
|
-
}
|
|
544688
544640
|
function parseTabOverlays(tabsObj) {
|
|
544689
544641
|
const result = {};
|
|
544690
544642
|
for (const [tabId, tabConfig] of Object.entries(tabsObj)) {
|
|
@@ -574121,6 +574073,85 @@ function formatLog({ breadcrumbs = [], title: title2, subtitle }) {
|
|
|
574121
574073
|
return lines.join("\n");
|
|
574122
574074
|
}
|
|
574123
574075
|
|
|
574076
|
+
// ../cli-logger/lib/githubAnnotations.js
|
|
574077
|
+
function shouldEmitGithubAnnotations() {
|
|
574078
|
+
return process.env.GITHUB_ACTIONS === "true";
|
|
574079
|
+
}
|
|
574080
|
+
var loggerAnnotationsSuppressed = false;
|
|
574081
|
+
async function withSuppressedLoggerAnnotations(fn10) {
|
|
574082
|
+
const previous4 = loggerAnnotationsSuppressed;
|
|
574083
|
+
loggerAnnotationsSuppressed = true;
|
|
574084
|
+
try {
|
|
574085
|
+
return await fn10();
|
|
574086
|
+
} finally {
|
|
574087
|
+
loggerAnnotationsSuppressed = previous4;
|
|
574088
|
+
}
|
|
574089
|
+
}
|
|
574090
|
+
function areLoggerAnnotationsSuppressed() {
|
|
574091
|
+
return loggerAnnotationsSuppressed;
|
|
574092
|
+
}
|
|
574093
|
+
function renderGithubAnnotation(level, body, properties7 = {}) {
|
|
574094
|
+
const sanitized = sanitizeForAnnotationBody(body);
|
|
574095
|
+
if (sanitized.trim().length === 0) {
|
|
574096
|
+
return void 0;
|
|
574097
|
+
}
|
|
574098
|
+
const propertiesString = formatProperties(properties7);
|
|
574099
|
+
const prefix2 = propertiesString.length > 0 ? `::${level} ${propertiesString}::` : `::${level}::`;
|
|
574100
|
+
return `${prefix2}${sanitized}
|
|
574101
|
+
`;
|
|
574102
|
+
}
|
|
574103
|
+
function renderGithubAnnotationFromLog(log4) {
|
|
574104
|
+
if (log4.omitOnTTY === true) {
|
|
574105
|
+
return void 0;
|
|
574106
|
+
}
|
|
574107
|
+
const level = logLevelToAnnotationLevel(log4.level);
|
|
574108
|
+
if (level == null) {
|
|
574109
|
+
return void 0;
|
|
574110
|
+
}
|
|
574111
|
+
const body = log4.parts.join(" ");
|
|
574112
|
+
const title2 = log4.prefix != null ? extractTitleFromPrefix(log4.prefix) : void 0;
|
|
574113
|
+
return renderGithubAnnotation(level, body, title2 != null ? { title: title2 } : {});
|
|
574114
|
+
}
|
|
574115
|
+
function logLevelToAnnotationLevel(level) {
|
|
574116
|
+
switch (level) {
|
|
574117
|
+
case LogLevel.Error:
|
|
574118
|
+
return "error";
|
|
574119
|
+
case LogLevel.Warn:
|
|
574120
|
+
return "warning";
|
|
574121
|
+
case LogLevel.Info:
|
|
574122
|
+
case LogLevel.Debug:
|
|
574123
|
+
case LogLevel.Trace:
|
|
574124
|
+
return void 0;
|
|
574125
|
+
}
|
|
574126
|
+
}
|
|
574127
|
+
function extractTitleFromPrefix(prefix2) {
|
|
574128
|
+
const cleaned = stripAnsi3(prefix2).trim();
|
|
574129
|
+
return cleaned.length > 0 ? cleaned : void 0;
|
|
574130
|
+
}
|
|
574131
|
+
function sanitizeForAnnotationBody(content5) {
|
|
574132
|
+
return stripAnsi3(content5).replace(/\r\n/g, "\n").replace(/\r/g, "").replace(/\n+$/g, "").replace(/\n/g, "%0A");
|
|
574133
|
+
}
|
|
574134
|
+
function formatProperties(properties7) {
|
|
574135
|
+
const parts = [];
|
|
574136
|
+
if (properties7.file != null && properties7.file.length > 0) {
|
|
574137
|
+
parts.push(`file=${escapeProperty(properties7.file)}`);
|
|
574138
|
+
}
|
|
574139
|
+
if (properties7.line != null) {
|
|
574140
|
+
parts.push(`line=${properties7.line}`);
|
|
574141
|
+
}
|
|
574142
|
+
if (properties7.title != null && properties7.title.length > 0) {
|
|
574143
|
+
parts.push(`title=${escapeProperty(properties7.title)}`);
|
|
574144
|
+
}
|
|
574145
|
+
return parts.join(",");
|
|
574146
|
+
}
|
|
574147
|
+
function escapeProperty(value2) {
|
|
574148
|
+
return stripAnsi3(value2).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
574149
|
+
}
|
|
574150
|
+
var ANSI_ESCAPE_PATTERN = /\[[0-?]*[ -/]*[@-~]/g;
|
|
574151
|
+
function stripAnsi3(content5) {
|
|
574152
|
+
return content5.replace(ANSI_ESCAPE_PATTERN, "");
|
|
574153
|
+
}
|
|
574154
|
+
|
|
574124
574155
|
// ../cli-logger/lib/logErrorMessage.js
|
|
574125
574156
|
var USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above.";
|
|
574126
574157
|
function logErrorMessage({ message, error: error50, logger: logger4, logLevel = LogLevel.Error }) {
|
|
@@ -574866,6 +574897,7 @@ var TtyAwareLogger = class {
|
|
|
574866
574897
|
this.writeStdout(content5);
|
|
574867
574898
|
}
|
|
574868
574899
|
};
|
|
574900
|
+
const emitAnnotations = shouldEmitGithubAnnotations() && !areLoggerAnnotationsSuppressed();
|
|
574869
574901
|
for (const log4 of logs4) {
|
|
574870
574902
|
const content5 = formatLog2(log4, { includeDebugInfo });
|
|
574871
574903
|
const omitOnTTY = log4.omitOnTTY ?? false;
|
|
@@ -574874,6 +574906,12 @@ var TtyAwareLogger = class {
|
|
|
574874
574906
|
} else if (!omitOnTTY) {
|
|
574875
574907
|
write3(this.clear() + content5 + this.lastPaint);
|
|
574876
574908
|
}
|
|
574909
|
+
if (emitAnnotations) {
|
|
574910
|
+
const annotation = renderGithubAnnotationFromLog(log4);
|
|
574911
|
+
if (annotation != null) {
|
|
574912
|
+
this.stdout.write(annotation);
|
|
574913
|
+
}
|
|
574914
|
+
}
|
|
574877
574915
|
}
|
|
574878
574916
|
}
|
|
574879
574917
|
repaint() {
|
|
@@ -622632,7 +622670,7 @@ var AccessTokenPosthogManager = class {
|
|
|
622632
622670
|
properties: {
|
|
622633
622671
|
...event,
|
|
622634
622672
|
...event.properties,
|
|
622635
|
-
version: "5.
|
|
622673
|
+
version: "5.9.0-rc.0",
|
|
622636
622674
|
usingAccessToken: true
|
|
622637
622675
|
}
|
|
622638
622676
|
});
|
|
@@ -622686,7 +622724,7 @@ var UserPosthogManager = class {
|
|
|
622686
622724
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
622687
622725
|
event: "CLI",
|
|
622688
622726
|
properties: {
|
|
622689
|
-
version: "5.
|
|
622727
|
+
version: "5.9.0-rc.0",
|
|
622690
622728
|
...event,
|
|
622691
622729
|
...event.properties,
|
|
622692
622730
|
usingAccessToken: false,
|
|
@@ -628989,13 +629027,13 @@ function command2(cli, name2, description, handler3, builder) {
|
|
|
628989
629027
|
|
|
628990
629028
|
// ../cli-v2/lib/commands/_internal/toJsonViolation.js
|
|
628991
629029
|
var ANSI_REGEX = new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`, "g");
|
|
628992
|
-
function
|
|
629030
|
+
function stripAnsi5(text9) {
|
|
628993
629031
|
return text9.replace(ANSI_REGEX, "");
|
|
628994
629032
|
}
|
|
628995
629033
|
function toJsonViolation(violation, options2) {
|
|
628996
629034
|
const result = {
|
|
628997
629035
|
severity: violation.severity,
|
|
628998
|
-
message:
|
|
629036
|
+
message: stripAnsi5(violation.message)
|
|
628999
629037
|
};
|
|
629000
629038
|
if (options2?.api != null) {
|
|
629001
629039
|
result.api = options2.api;
|
|
@@ -804627,7 +804665,7 @@ function applyChildOverlays(children2, parent, overlay) {
|
|
|
804627
804665
|
const scopedOverlay = {
|
|
804628
804666
|
tabs: productOverlay.tabs ?? overlay.tabs,
|
|
804629
804667
|
products: void 0,
|
|
804630
|
-
versions:
|
|
804668
|
+
versions: overlay.versions,
|
|
804631
804669
|
announcement: productOverlay.announcement ?? overlay.announcement,
|
|
804632
804670
|
navigation: productOverlay.navigation ?? overlay.navigation,
|
|
804633
804671
|
navbarLinks: overlay.navbarLinks
|
|
@@ -804645,19 +804683,11 @@ function applyChildOverlays(children2, parent, overlay) {
|
|
|
804645
804683
|
return walkAndApply(child, overlay);
|
|
804646
804684
|
}
|
|
804647
804685
|
const versionOverlay = findVersionOverlay(childObj, overlay.versions ?? [], index3);
|
|
804686
|
+
const walked = walkAndApply(child, overlay);
|
|
804648
804687
|
if (versionOverlay != null) {
|
|
804649
|
-
const scopedOverlay = {
|
|
804650
|
-
tabs: versionOverlay.tabs ?? overlay.tabs,
|
|
804651
|
-
products: void 0,
|
|
804652
|
-
versions: void 0,
|
|
804653
|
-
announcement: overlay.announcement,
|
|
804654
|
-
navigation: versionOverlay.navigation ?? overlay.navigation,
|
|
804655
|
-
navbarLinks: overlay.navbarLinks
|
|
804656
|
-
};
|
|
804657
|
-
const walked = walkAndApply(child, scopedOverlay);
|
|
804658
804688
|
return applyVersionOverlayToNode(walked, versionOverlay);
|
|
804659
804689
|
}
|
|
804660
|
-
return
|
|
804690
|
+
return walked;
|
|
804661
804691
|
});
|
|
804662
804692
|
}
|
|
804663
804693
|
if (parentType === "tabbed") {
|
|
@@ -819810,14 +819840,12 @@ var rules_exports = {};
|
|
|
819810
819840
|
__export(rules_exports, {
|
|
819811
819841
|
AccentColorContrastRule: () => AccentColorContrastRule,
|
|
819812
819842
|
AllRolesMustBeDeclaredRule: () => AllRolesMustBeDeclaredRule,
|
|
819813
|
-
CHANGELOG_FEED_ALLOWED_SLUGS: () => CHANGELOG_FEED_ALLOWED_SLUGS,
|
|
819814
819843
|
FilepathsExistRule: () => FilepathsExistRule,
|
|
819815
819844
|
MissingRedirectsRule: () => MissingRedirectsRule,
|
|
819816
819845
|
NoCircularRedirectsRule: () => NoCircularRedirectsRule,
|
|
819817
819846
|
OnlyVersionedNavigation: () => OnlyVersionedNavigation,
|
|
819818
819847
|
TabWithHrefRule: () => TabWithHrefRule,
|
|
819819
819848
|
TranslationDirectoriesExistRule: () => TranslationDirectoriesExistRule,
|
|
819820
|
-
ValidChangelogSlugRule: () => ValidChangelogSlugRule,
|
|
819821
819849
|
ValidDocsEndpoints: () => ValidDocsEndpoints,
|
|
819822
819850
|
ValidFileTypes: () => ValidFileTypes,
|
|
819823
819851
|
ValidFrontmatter: () => ValidFrontmatter,
|
|
@@ -819828,8 +819856,6 @@ __export(rules_exports, {
|
|
|
819828
819856
|
ValidateProductFileRule: () => ValidateProductFileRule,
|
|
819829
819857
|
ValidateVersionFileRule: () => ValidateVersionFileRule,
|
|
819830
819858
|
enforceBackgroundTheme: () => enforceBackgroundTheme,
|
|
819831
|
-
getEffectiveChangelogSlugLastSegment: () => getEffectiveChangelogSlugLastSegment,
|
|
819832
|
-
isAllowedChangelogSlug: () => isAllowedChangelogSlug,
|
|
819833
819859
|
validateTheme: () => validateTheme
|
|
819834
819860
|
});
|
|
819835
819861
|
|
|
@@ -820856,148 +820882,6 @@ function buildExpectedDirectoryTree({ translationsDirExists, missingDirs, fernFo
|
|
|
820856
820882
|
return lines.join("\n");
|
|
820857
820883
|
}
|
|
820858
820884
|
|
|
820859
|
-
// ../yaml/docs-validator/lib/rules/valid-changelog-slug/valid-changelog-slug.js
|
|
820860
|
-
init_lodash();
|
|
820861
|
-
var CHANGELOG_FEED_ALLOWED_SLUGS = [
|
|
820862
|
-
"changelog",
|
|
820863
|
-
"changelogs",
|
|
820864
|
-
"release-notes",
|
|
820865
|
-
"releasenotes",
|
|
820866
|
-
"whats-new",
|
|
820867
|
-
"whatsnew"
|
|
820868
|
-
];
|
|
820869
|
-
var DEFAULT_CHANGELOG_TITLE3 = "Changelog";
|
|
820870
|
-
function getEffectiveChangelogSlugLastSegment(config5) {
|
|
820871
|
-
const raw = config5.slug ?? kebabCase_default(config5.title ?? DEFAULT_CHANGELOG_TITLE3);
|
|
820872
|
-
const segments = raw.split("/").filter((s9) => s9.length > 0);
|
|
820873
|
-
return segments[segments.length - 1] ?? "";
|
|
820874
|
-
}
|
|
820875
|
-
function isAllowedChangelogSlug(lastSegment) {
|
|
820876
|
-
return CHANGELOG_FEED_ALLOWED_SLUGS.includes(lastSegment);
|
|
820877
|
-
}
|
|
820878
|
-
function collectChangelogLocations(items, breadcrumb) {
|
|
820879
|
-
if (items == null) {
|
|
820880
|
-
return [];
|
|
820881
|
-
}
|
|
820882
|
-
const out = [];
|
|
820883
|
-
for (const item of items) {
|
|
820884
|
-
if (isChangelog(item)) {
|
|
820885
|
-
out.push({
|
|
820886
|
-
where: `${breadcrumb} > changelog (${item.changelog})`,
|
|
820887
|
-
slug: item.slug,
|
|
820888
|
-
title: item.title
|
|
820889
|
-
});
|
|
820890
|
-
continue;
|
|
820891
|
-
}
|
|
820892
|
-
if (isSection3(item)) {
|
|
820893
|
-
const next2 = `${breadcrumb} > section "${item.section}"`;
|
|
820894
|
-
out.push(...collectChangelogLocations(item.contents, next2));
|
|
820895
|
-
}
|
|
820896
|
-
}
|
|
820897
|
-
return out;
|
|
820898
|
-
}
|
|
820899
|
-
function collectFromTabs(tabs, breadcrumb) {
|
|
820900
|
-
if (tabs == null) {
|
|
820901
|
-
return [];
|
|
820902
|
-
}
|
|
820903
|
-
const out = [];
|
|
820904
|
-
for (const [tabId, tab2] of Object.entries(tabs)) {
|
|
820905
|
-
if (tab2.changelog != null) {
|
|
820906
|
-
out.push({
|
|
820907
|
-
where: `${breadcrumb} > tab "${tabId}" (changelog: ${tab2.changelog})`,
|
|
820908
|
-
slug: tab2.slug,
|
|
820909
|
-
title: tab2.displayName
|
|
820910
|
-
});
|
|
820911
|
-
}
|
|
820912
|
-
}
|
|
820913
|
-
return out;
|
|
820914
|
-
}
|
|
820915
|
-
function collectFromNavigation(navigation2, breadcrumb) {
|
|
820916
|
-
if (navigation2 == null || !Array.isArray(navigation2) || navigation2.length === 0) {
|
|
820917
|
-
return [];
|
|
820918
|
-
}
|
|
820919
|
-
if (isTabbedNavigation(navigation2)) {
|
|
820920
|
-
const out = [];
|
|
820921
|
-
for (const item of navigation2) {
|
|
820922
|
-
const next2 = `${breadcrumb} > tab "${item.tab}"`;
|
|
820923
|
-
if ("layout" in item && Array.isArray(item.layout)) {
|
|
820924
|
-
out.push(...collectChangelogLocations(item.layout, next2));
|
|
820925
|
-
}
|
|
820926
|
-
if ("variants" in item && Array.isArray(item.variants)) {
|
|
820927
|
-
for (const variant of item.variants) {
|
|
820928
|
-
const variantBreadcrumb = `${next2} > variant "${variant.title}"`;
|
|
820929
|
-
out.push(...collectChangelogLocations(variant.layout, variantBreadcrumb));
|
|
820930
|
-
}
|
|
820931
|
-
}
|
|
820932
|
-
}
|
|
820933
|
-
return out;
|
|
820934
|
-
}
|
|
820935
|
-
return collectChangelogLocations(navigation2, breadcrumb);
|
|
820936
|
-
}
|
|
820937
|
-
function violationsForLocations(locations) {
|
|
820938
|
-
const violations = [];
|
|
820939
|
-
for (const loc of locations) {
|
|
820940
|
-
const lastSegment = getEffectiveChangelogSlugLastSegment(loc);
|
|
820941
|
-
if (lastSegment === "" || isAllowedChangelogSlug(lastSegment)) {
|
|
820942
|
-
continue;
|
|
820943
|
-
}
|
|
820944
|
-
const allowed = CHANGELOG_FEED_ALLOWED_SLUGS.join(", ");
|
|
820945
|
-
const sourceField = loc.slug != null ? `slug: "${loc.slug}"` : `title: "${loc.title ?? DEFAULT_CHANGELOG_TITLE3}"`;
|
|
820946
|
-
violations.push({
|
|
820947
|
-
severity: "error",
|
|
820948
|
-
message: `Changelog at ${loc.where} resolves to URL segment "${lastSegment}" (from ${sourceField}). The docs server only serves changelog feeds (.rss, .atom, .json) when the final URL segment is one of: ${allowed}. Rename the changelog's title or set an explicit slug to one of these values, otherwise subscribers will get a 404 when they request the feed.`
|
|
820949
|
-
});
|
|
820950
|
-
}
|
|
820951
|
-
return violations;
|
|
820952
|
-
}
|
|
820953
|
-
var ValidChangelogSlugRule = {
|
|
820954
|
-
name: "valid-changelog-slug",
|
|
820955
|
-
create: () => {
|
|
820956
|
-
return {
|
|
820957
|
-
file: async ({ config: config5 }) => {
|
|
820958
|
-
const locations = [
|
|
820959
|
-
...collectFromNavigation(config5.navigation, "navigation"),
|
|
820960
|
-
...collectFromTabs(config5.tabs, "tabs")
|
|
820961
|
-
];
|
|
820962
|
-
return violationsForLocations(locations);
|
|
820963
|
-
},
|
|
820964
|
-
versionFile: async ({ path: path106, content: content5 }) => {
|
|
820965
|
-
const parseResult = await validateVersionConfigFileSchema({ value: content5 });
|
|
820966
|
-
if (parseResult.type !== "success") {
|
|
820967
|
-
return [];
|
|
820968
|
-
}
|
|
820969
|
-
const versionConfig = parseResult.contents;
|
|
820970
|
-
const locations = [
|
|
820971
|
-
...collectFromNavigation(versionConfig.navigation, `version "${path106}" navigation`),
|
|
820972
|
-
...collectFromTabs(versionConfig.tabs, `version "${path106}" tabs`)
|
|
820973
|
-
];
|
|
820974
|
-
return violationsForLocations(locations);
|
|
820975
|
-
},
|
|
820976
|
-
productFile: async ({ path: path106, content: content5 }) => {
|
|
820977
|
-
const parseResult = await validateProductConfigFileSchema({ value: content5 });
|
|
820978
|
-
if (parseResult.type !== "success") {
|
|
820979
|
-
return [];
|
|
820980
|
-
}
|
|
820981
|
-
const productConfig = parseResult.contents;
|
|
820982
|
-
const locations = [
|
|
820983
|
-
...collectFromNavigation(productConfig.navigation, `product "${path106}" navigation`),
|
|
820984
|
-
...collectFromTabs(productConfig.tabs, `product "${path106}" tabs`)
|
|
820985
|
-
];
|
|
820986
|
-
return violationsForLocations(locations);
|
|
820987
|
-
}
|
|
820988
|
-
};
|
|
820989
|
-
}
|
|
820990
|
-
};
|
|
820991
|
-
function isChangelog(item) {
|
|
820992
|
-
return item?.changelog != null;
|
|
820993
|
-
}
|
|
820994
|
-
function isSection3(item) {
|
|
820995
|
-
return item?.section != null;
|
|
820996
|
-
}
|
|
820997
|
-
function isTabbedNavigation(navigation2) {
|
|
820998
|
-
return Array.isArray(navigation2) && navigation2.length > 0 && navigation2[0]?.tab != null;
|
|
820999
|
-
}
|
|
821000
|
-
|
|
821001
820885
|
// ../yaml/docs-validator/lib/rules/valid-docs-endpoints/valid-docs-endpoints.js
|
|
821002
820886
|
var ValidDocsEndpoints = {
|
|
821003
820887
|
name: "valid-docs-endpoints",
|
|
@@ -843477,8 +843361,7 @@ var allRules = [
|
|
|
843477
843361
|
ValidDocsEndpoints,
|
|
843478
843362
|
AllRolesMustBeDeclaredRule,
|
|
843479
843363
|
ValidFrontmatter,
|
|
843480
|
-
TranslationDirectoriesExistRule
|
|
843481
|
-
ValidChangelogSlugRule
|
|
843364
|
+
TranslationDirectoriesExistRule
|
|
843482
843365
|
// ValidMarkdownFileReferences
|
|
843483
843366
|
];
|
|
843484
843367
|
function getAllRules3(exclusions) {
|
|
@@ -843507,8 +843390,7 @@ var CHECK_RULE_CONFIG_TO_RULE_NAME = {
|
|
|
843507
843390
|
validLocalReferences: ValidLocalReferencesRule.name,
|
|
843508
843391
|
noCircularRedirects: NoCircularRedirectsRule.name,
|
|
843509
843392
|
validDocsEndpoints: ValidDocsEndpoints.name,
|
|
843510
|
-
missingRedirects: MissingRedirectsRule.name
|
|
843511
|
-
validChangelogSlug: ValidChangelogSlugRule.name
|
|
843393
|
+
missingRedirects: MissingRedirectsRule.name
|
|
843512
843394
|
};
|
|
843513
843395
|
function buildSeverityOverrides(checkConfig) {
|
|
843514
843396
|
const severityOverrides = /* @__PURE__ */ new Map();
|
|
@@ -847588,7 +847470,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
|
847588
847470
|
var LOGS_FOLDER_NAME = "logs";
|
|
847589
847471
|
var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
|
|
847590
847472
|
function getCliSource() {
|
|
847591
|
-
const version7 = "5.
|
|
847473
|
+
const version7 = "5.9.0-rc.0";
|
|
847592
847474
|
return `cli@${version7}`;
|
|
847593
847475
|
}
|
|
847594
847476
|
var DebugLogger = class {
|
|
@@ -856375,16 +856257,6 @@ var definitions6 = {
|
|
|
856375
856257
|
type: "null"
|
|
856376
856258
|
}
|
|
856377
856259
|
]
|
|
856378
|
-
},
|
|
856379
|
-
"valid-changelog-slug": {
|
|
856380
|
-
oneOf: [
|
|
856381
|
-
{
|
|
856382
|
-
$ref: "#/definitions/docs.CheckRuleSeverity"
|
|
856383
|
-
},
|
|
856384
|
-
{
|
|
856385
|
-
type: "null"
|
|
856386
|
-
}
|
|
856387
|
-
]
|
|
856388
856260
|
}
|
|
856389
856261
|
},
|
|
856390
856262
|
additionalProperties: false
|
|
@@ -860241,7 +860113,7 @@ var LegacyDocsPublisher = class {
|
|
|
860241
860113
|
previewId,
|
|
860242
860114
|
disableTemplates: void 0,
|
|
860243
860115
|
skipUpload,
|
|
860244
|
-
cliVersion: "5.
|
|
860116
|
+
cliVersion: "5.9.0-rc.0",
|
|
860245
860117
|
loginCommand: "fern auth login"
|
|
860246
860118
|
});
|
|
860247
860119
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
@@ -934683,7 +934555,7 @@ var CliContext = class _CliContext {
|
|
|
934683
934555
|
if (false) {
|
|
934684
934556
|
this.logger.error("CLI_VERSION is not defined");
|
|
934685
934557
|
}
|
|
934686
|
-
return "5.
|
|
934558
|
+
return "5.9.0-rc.0";
|
|
934687
934559
|
}
|
|
934688
934560
|
getCliName() {
|
|
934689
934561
|
if (false) {
|
|
@@ -937195,22 +937067,31 @@ function countResults(results) {
|
|
|
937195
937067
|
}
|
|
937196
937068
|
return { succeeded, failed, skipped };
|
|
937197
937069
|
}
|
|
937198
|
-
function
|
|
937070
|
+
function resolveGithubWorkspaceRelativePath(absolutePath) {
|
|
937199
937071
|
if (absolutePath == null) {
|
|
937200
937072
|
return null;
|
|
937201
937073
|
}
|
|
937202
|
-
const serverUrl = process.env.GITHUB_SERVER_URL;
|
|
937203
|
-
const repository = process.env.GITHUB_REPOSITORY;
|
|
937204
|
-
const refName = process.env.GITHUB_REF_NAME;
|
|
937205
937074
|
const workspace = process.env.GITHUB_WORKSPACE;
|
|
937206
|
-
if (
|
|
937075
|
+
if (workspace == null) {
|
|
937207
937076
|
return null;
|
|
937208
937077
|
}
|
|
937209
937078
|
const workspaceWithSlash = workspace.endsWith("/") ? workspace : `${workspace}/`;
|
|
937210
937079
|
if (!absolutePath.startsWith(workspaceWithSlash)) {
|
|
937211
937080
|
return null;
|
|
937212
937081
|
}
|
|
937213
|
-
|
|
937082
|
+
return absolutePath.slice(workspaceWithSlash.length);
|
|
937083
|
+
}
|
|
937084
|
+
function buildGeneratorsYmlUrl(absolutePath, lineNumber) {
|
|
937085
|
+
const relativePath = resolveGithubWorkspaceRelativePath(absolutePath);
|
|
937086
|
+
if (relativePath == null) {
|
|
937087
|
+
return null;
|
|
937088
|
+
}
|
|
937089
|
+
const serverUrl = process.env.GITHUB_SERVER_URL;
|
|
937090
|
+
const repository = process.env.GITHUB_REPOSITORY;
|
|
937091
|
+
const refName = process.env.GITHUB_REF_NAME;
|
|
937092
|
+
if (serverUrl == null || repository == null || refName == null) {
|
|
937093
|
+
return null;
|
|
937094
|
+
}
|
|
937214
937095
|
const anchor = lineNumber != null ? `#L${lineNumber}` : "";
|
|
937215
937096
|
return `${serverUrl}/${repository}/blob/${refName}/${relativePath}${anchor}`;
|
|
937216
937097
|
}
|
|
@@ -937230,7 +937111,9 @@ var GeneratorRunCollector = class {
|
|
|
937230
937111
|
errorMessage: null,
|
|
937231
937112
|
durationMs: args.durationMs,
|
|
937232
937113
|
sdkRepoUrl: args.outputRepoUrl ?? null,
|
|
937233
|
-
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
|
|
937114
|
+
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
|
|
937115
|
+
generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
|
|
937116
|
+
generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
|
|
937234
937117
|
});
|
|
937235
937118
|
}
|
|
937236
937119
|
recordFailure(args) {
|
|
@@ -937247,7 +937130,9 @@ var GeneratorRunCollector = class {
|
|
|
937247
937130
|
errorMessage: args.errorMessage,
|
|
937248
937131
|
durationMs: args.durationMs,
|
|
937249
937132
|
sdkRepoUrl: args.outputRepoUrl ?? null,
|
|
937250
|
-
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
|
|
937133
|
+
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
|
|
937134
|
+
generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
|
|
937135
|
+
generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
|
|
937251
937136
|
});
|
|
937252
937137
|
}
|
|
937253
937138
|
recordSkipped(args) {
|
|
@@ -937264,7 +937149,9 @@ var GeneratorRunCollector = class {
|
|
|
937264
937149
|
errorMessage: null,
|
|
937265
937150
|
durationMs: 0,
|
|
937266
937151
|
sdkRepoUrl: args.outputRepoUrl ?? null,
|
|
937267
|
-
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
|
|
937152
|
+
generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
|
|
937153
|
+
generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
|
|
937154
|
+
generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
|
|
937268
937155
|
});
|
|
937269
937156
|
}
|
|
937270
937157
|
results() {
|
|
@@ -937278,6 +937165,55 @@ var GeneratorRunCollector = class {
|
|
|
937278
937165
|
}
|
|
937279
937166
|
};
|
|
937280
937167
|
|
|
937168
|
+
// src/commands/automations/generate/renderGithubAnnotationsForResults.ts
|
|
937169
|
+
var GITHUB_ACTIONS_ANNOTATIONS_PER_LEVEL_CAP = 10;
|
|
937170
|
+
function renderGithubAnnotationsForResults(results) {
|
|
937171
|
+
if (!shouldEmitGithubAnnotations()) {
|
|
937172
|
+
return "";
|
|
937173
|
+
}
|
|
937174
|
+
const lines = [];
|
|
937175
|
+
let failureCount = 0;
|
|
937176
|
+
for (const result of results) {
|
|
937177
|
+
if (result.status !== "failed") {
|
|
937178
|
+
continue;
|
|
937179
|
+
}
|
|
937180
|
+
failureCount++;
|
|
937181
|
+
const annotation = renderAnnotationForFailure(result);
|
|
937182
|
+
if (annotation != null) {
|
|
937183
|
+
lines.push(annotation);
|
|
937184
|
+
}
|
|
937185
|
+
}
|
|
937186
|
+
const overflow = renderOverflowWarning(failureCount);
|
|
937187
|
+
if (overflow != null) {
|
|
937188
|
+
lines.push(overflow);
|
|
937189
|
+
}
|
|
937190
|
+
return lines.join("");
|
|
937191
|
+
}
|
|
937192
|
+
function renderAnnotationForFailure(result) {
|
|
937193
|
+
const body = result.errorMessage ?? "Generator failed";
|
|
937194
|
+
const title2 = buildTitle(result);
|
|
937195
|
+
const file4 = result.generatorsYmlWorkspaceRelativePath ?? void 0;
|
|
937196
|
+
const line = file4 != null ? result.generatorsYmlLineNumber ?? void 0 : void 0;
|
|
937197
|
+
return renderGithubAnnotation("error", body, { title: title2, file: file4, line });
|
|
937198
|
+
}
|
|
937199
|
+
function buildTitle(result) {
|
|
937200
|
+
const qualifiers = [`group=${result.groupName}`];
|
|
937201
|
+
if (result.apiName != null && result.apiName.length > 0) {
|
|
937202
|
+
qualifiers.push(`api=${result.apiName}`);
|
|
937203
|
+
}
|
|
937204
|
+
return `${result.generatorName} failed (${qualifiers.join(", ")})`;
|
|
937205
|
+
}
|
|
937206
|
+
function renderOverflowWarning(failureCount) {
|
|
937207
|
+
if (failureCount <= GITHUB_ACTIONS_ANNOTATIONS_PER_LEVEL_CAP) {
|
|
937208
|
+
return void 0;
|
|
937209
|
+
}
|
|
937210
|
+
const suppressed = failureCount - GITHUB_ACTIONS_ANNOTATIONS_PER_LEVEL_CAP;
|
|
937211
|
+
const body = `${suppressed} additional generator ${suppressed === 1 ? "failure was" : "failures were"} hidden by GitHub's per-step annotation cap. See the step summary table for the full list.`;
|
|
937212
|
+
return renderGithubAnnotation("warning", body, {
|
|
937213
|
+
title: `${failureCount} generators failed (showing first ${GITHUB_ACTIONS_ANNOTATIONS_PER_LEVEL_CAP})`
|
|
937214
|
+
});
|
|
937215
|
+
}
|
|
937216
|
+
|
|
937281
937217
|
// src/commands/automations/generate/reportGenerateResults.ts
|
|
937282
937218
|
init_lib4();
|
|
937283
937219
|
var import_fs37 = require("fs");
|
|
@@ -937518,60 +937454,72 @@ async function executeAutomationsGenerate({
|
|
|
937518
937454
|
}
|
|
937519
937455
|
outputsFlushed = true;
|
|
937520
937456
|
writeResultsSync({ results: collector.results(), jsonOutputPath });
|
|
937457
|
+
emitStructuredAnnotations(collector);
|
|
937521
937458
|
};
|
|
937522
937459
|
process.once("SIGINT", flushOnSignal);
|
|
937523
937460
|
process.once("SIGTERM", flushOnSignal);
|
|
937524
937461
|
try {
|
|
937525
|
-
await
|
|
937526
|
-
|
|
937527
|
-
|
|
937528
|
-
|
|
937529
|
-
|
|
937530
|
-
|
|
937531
|
-
|
|
937532
|
-
|
|
937533
|
-
|
|
937534
|
-
|
|
937535
|
-
|
|
937536
|
-
|
|
937537
|
-
|
|
937538
|
-
|
|
937539
|
-
|
|
937540
|
-
|
|
937541
|
-
|
|
937542
|
-
|
|
937543
|
-
|
|
937544
|
-
|
|
937545
|
-
|
|
937546
|
-
|
|
937547
|
-
|
|
937548
|
-
|
|
937549
|
-
|
|
937550
|
-
|
|
937551
|
-
|
|
937552
|
-
|
|
937553
|
-
|
|
937554
|
-
|
|
937555
|
-
|
|
937556
|
-
|
|
937462
|
+
await withSuppressedLoggerAnnotations(async () => {
|
|
937463
|
+
try {
|
|
937464
|
+
await cliContext.runTask(async () => {
|
|
937465
|
+
await generateAPIWorkspaces({
|
|
937466
|
+
project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
|
|
937467
|
+
commandLineApiWorkspace: options2.api,
|
|
937468
|
+
defaultToAllApiWorkspaces: true
|
|
937469
|
+
}),
|
|
937470
|
+
cliContext,
|
|
937471
|
+
version: options2.version,
|
|
937472
|
+
groupNames: options2.group != null ? [options2.group] : void 0,
|
|
937473
|
+
generatorName,
|
|
937474
|
+
generatorIndex,
|
|
937475
|
+
shouldLogS3Url: false,
|
|
937476
|
+
keepDocker: false,
|
|
937477
|
+
useLocalDocker: false,
|
|
937478
|
+
preview: false,
|
|
937479
|
+
mode: void 0,
|
|
937480
|
+
force: true,
|
|
937481
|
+
runner: void 0,
|
|
937482
|
+
inspect: false,
|
|
937483
|
+
lfsOverride: void 0,
|
|
937484
|
+
fernignorePath: void 0,
|
|
937485
|
+
skipFernignore: false,
|
|
937486
|
+
dynamicIrOnly: false,
|
|
937487
|
+
outputDir: void 0,
|
|
937488
|
+
noReplay: false,
|
|
937489
|
+
retryRateLimited: false,
|
|
937490
|
+
requireEnvVars: false,
|
|
937491
|
+
automationMode: true,
|
|
937492
|
+
autoMerge: options2.autoMerge,
|
|
937493
|
+
skipIfNoDiff: true,
|
|
937494
|
+
automation: { recorder: collector }
|
|
937495
|
+
});
|
|
937496
|
+
});
|
|
937497
|
+
} catch (error50) {
|
|
937498
|
+
if (!(error50 instanceof TaskAbortSignal)) {
|
|
937499
|
+
throw error50;
|
|
937500
|
+
}
|
|
937501
|
+
taskAborted = true;
|
|
937502
|
+
}
|
|
937557
937503
|
});
|
|
937558
|
-
} catch (error50) {
|
|
937559
|
-
if (!(error50 instanceof TaskAbortSignal)) {
|
|
937560
|
-
throw error50;
|
|
937561
|
-
}
|
|
937562
|
-
taskAborted = true;
|
|
937563
937504
|
} finally {
|
|
937564
937505
|
process.off("SIGINT", flushOnSignal);
|
|
937565
937506
|
process.off("SIGTERM", flushOnSignal);
|
|
937566
937507
|
if (!outputsFlushed) {
|
|
937567
937508
|
outputsFlushed = true;
|
|
937568
937509
|
await reportFinalOutputs({ collector, jsonOutputPath, taskAborted });
|
|
937510
|
+
emitStructuredAnnotations(collector);
|
|
937569
937511
|
}
|
|
937570
937512
|
if (collector.hasFailures()) {
|
|
937571
937513
|
process.exitCode = 1;
|
|
937572
937514
|
}
|
|
937573
937515
|
}
|
|
937574
937516
|
}
|
|
937517
|
+
function emitStructuredAnnotations(collector) {
|
|
937518
|
+
const annotations = renderGithubAnnotationsForResults(collector.results());
|
|
937519
|
+
if (annotations.length > 0) {
|
|
937520
|
+
process.stdout.write(annotations);
|
|
937521
|
+
}
|
|
937522
|
+
}
|
|
937575
937523
|
async function reportFinalOutputs({
|
|
937576
937524
|
collector,
|
|
937577
937525
|
jsonOutputPath,
|
package/package.json
CHANGED