@fern-api/fern-api-dev 5.8.1 → 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.
Files changed (2) hide show
  1. package/cli.cjs +233 -231
  2. 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} ${formatProperties(properties7)}::${escapeMessage(message)}
105576
+ output_1.output.write(`::${command3} ${formatProperties2(properties7)}::${escapeMessage(message)}
105577
105577
  `);
105578
105578
  }
105579
105579
  }
105580
- function formatProperties(props) {
105581
- return Object.entries(props).filter(([, v9]) => v9 !== null && v9 !== void 0).map(([k5, v9]) => `${k5}=${escapeProperty(v9)}`).join(",");
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 escapeProperty(v9) {
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 stripAnsi5 = require_strip_ansi();
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 = stripAnsi5(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 stripAnsi5 = require_strip_ansi();
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(stripAnsi5(rows[rows.length - 1]));
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 stripAnsi5 = require_strip_ansi();
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 stripAnsi5(fullPrefixText + "--" + this[TEXT]).split("\n")) {
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 stripAnsi5 = require_strip_ansi();
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(stripAnsi5(rows[rows.length - 1]));
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 stripAnsi5 = require_strip_ansi();
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: stripAnsi5,
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
@@ -574075,6 +574073,85 @@ function formatLog({ breadcrumbs = [], title: title2, subtitle }) {
574075
574073
  return lines.join("\n");
574076
574074
  }
574077
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
+
574078
574155
  // ../cli-logger/lib/logErrorMessage.js
574079
574156
  var USE_NODE_18_OR_ABOVE_MESSAGE = "The Fern CLI requires Node 18+ or above.";
574080
574157
  function logErrorMessage({ message, error: error50, logger: logger4, logLevel = LogLevel.Error }) {
@@ -574820,6 +574897,7 @@ var TtyAwareLogger = class {
574820
574897
  this.writeStdout(content5);
574821
574898
  }
574822
574899
  };
574900
+ const emitAnnotations = shouldEmitGithubAnnotations() && !areLoggerAnnotationsSuppressed();
574823
574901
  for (const log4 of logs4) {
574824
574902
  const content5 = formatLog2(log4, { includeDebugInfo });
574825
574903
  const omitOnTTY = log4.omitOnTTY ?? false;
@@ -574828,6 +574906,12 @@ var TtyAwareLogger = class {
574828
574906
  } else if (!omitOnTTY) {
574829
574907
  write3(this.clear() + content5 + this.lastPaint);
574830
574908
  }
574909
+ if (emitAnnotations) {
574910
+ const annotation = renderGithubAnnotationFromLog(log4);
574911
+ if (annotation != null) {
574912
+ this.stdout.write(annotation);
574913
+ }
574914
+ }
574831
574915
  }
574832
574916
  }
574833
574917
  repaint() {
@@ -622586,7 +622670,7 @@ var AccessTokenPosthogManager = class {
622586
622670
  properties: {
622587
622671
  ...event,
622588
622672
  ...event.properties,
622589
- version: "5.8.1",
622673
+ version: "5.9.0-rc.0",
622590
622674
  usingAccessToken: true
622591
622675
  }
622592
622676
  });
@@ -622640,7 +622724,7 @@ var UserPosthogManager = class {
622640
622724
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622641
622725
  event: "CLI",
622642
622726
  properties: {
622643
- version: "5.8.1",
622727
+ version: "5.9.0-rc.0",
622644
622728
  ...event,
622645
622729
  ...event.properties,
622646
622730
  usingAccessToken: false,
@@ -628943,13 +629027,13 @@ function command2(cli, name2, description, handler3, builder) {
628943
629027
 
628944
629028
  // ../cli-v2/lib/commands/_internal/toJsonViolation.js
628945
629029
  var ANSI_REGEX = new RegExp(`${String.fromCodePoint(27)}\\[[0-9;]*m`, "g");
628946
- function stripAnsi4(text9) {
629030
+ function stripAnsi5(text9) {
628947
629031
  return text9.replace(ANSI_REGEX, "");
628948
629032
  }
628949
629033
  function toJsonViolation(violation, options2) {
628950
629034
  const result = {
628951
629035
  severity: violation.severity,
628952
- message: stripAnsi4(violation.message)
629036
+ message: stripAnsi5(violation.message)
628953
629037
  };
628954
629038
  if (options2?.api != null) {
628955
629039
  result.api = options2.api;
@@ -819756,14 +819840,12 @@ var rules_exports = {};
819756
819840
  __export(rules_exports, {
819757
819841
  AccentColorContrastRule: () => AccentColorContrastRule,
819758
819842
  AllRolesMustBeDeclaredRule: () => AllRolesMustBeDeclaredRule,
819759
- CHANGELOG_FEED_ALLOWED_SLUGS: () => CHANGELOG_FEED_ALLOWED_SLUGS,
819760
819843
  FilepathsExistRule: () => FilepathsExistRule,
819761
819844
  MissingRedirectsRule: () => MissingRedirectsRule,
819762
819845
  NoCircularRedirectsRule: () => NoCircularRedirectsRule,
819763
819846
  OnlyVersionedNavigation: () => OnlyVersionedNavigation,
819764
819847
  TabWithHrefRule: () => TabWithHrefRule,
819765
819848
  TranslationDirectoriesExistRule: () => TranslationDirectoriesExistRule,
819766
- ValidChangelogSlugRule: () => ValidChangelogSlugRule,
819767
819849
  ValidDocsEndpoints: () => ValidDocsEndpoints,
819768
819850
  ValidFileTypes: () => ValidFileTypes,
819769
819851
  ValidFrontmatter: () => ValidFrontmatter,
@@ -819774,8 +819856,6 @@ __export(rules_exports, {
819774
819856
  ValidateProductFileRule: () => ValidateProductFileRule,
819775
819857
  ValidateVersionFileRule: () => ValidateVersionFileRule,
819776
819858
  enforceBackgroundTheme: () => enforceBackgroundTheme,
819777
- getEffectiveChangelogSlugLastSegment: () => getEffectiveChangelogSlugLastSegment,
819778
- isAllowedChangelogSlug: () => isAllowedChangelogSlug,
819779
819859
  validateTheme: () => validateTheme
819780
819860
  });
819781
819861
 
@@ -820802,148 +820882,6 @@ function buildExpectedDirectoryTree({ translationsDirExists, missingDirs, fernFo
820802
820882
  return lines.join("\n");
820803
820883
  }
820804
820884
 
820805
- // ../yaml/docs-validator/lib/rules/valid-changelog-slug/valid-changelog-slug.js
820806
- init_lodash();
820807
- var CHANGELOG_FEED_ALLOWED_SLUGS = [
820808
- "changelog",
820809
- "changelogs",
820810
- "release-notes",
820811
- "releasenotes",
820812
- "whats-new",
820813
- "whatsnew"
820814
- ];
820815
- var DEFAULT_CHANGELOG_TITLE3 = "Changelog";
820816
- function getEffectiveChangelogSlugLastSegment(config5) {
820817
- const raw = config5.slug ?? kebabCase_default(config5.title ?? DEFAULT_CHANGELOG_TITLE3);
820818
- const segments = raw.split("/").filter((s9) => s9.length > 0);
820819
- return segments[segments.length - 1] ?? "";
820820
- }
820821
- function isAllowedChangelogSlug(lastSegment) {
820822
- return CHANGELOG_FEED_ALLOWED_SLUGS.includes(lastSegment);
820823
- }
820824
- function collectChangelogLocations(items, breadcrumb) {
820825
- if (items == null) {
820826
- return [];
820827
- }
820828
- const out = [];
820829
- for (const item of items) {
820830
- if (isChangelog(item)) {
820831
- out.push({
820832
- where: `${breadcrumb} > changelog (${item.changelog})`,
820833
- slug: item.slug,
820834
- title: item.title
820835
- });
820836
- continue;
820837
- }
820838
- if (isSection3(item)) {
820839
- const next2 = `${breadcrumb} > section "${item.section}"`;
820840
- out.push(...collectChangelogLocations(item.contents, next2));
820841
- }
820842
- }
820843
- return out;
820844
- }
820845
- function collectFromTabs(tabs, breadcrumb) {
820846
- if (tabs == null) {
820847
- return [];
820848
- }
820849
- const out = [];
820850
- for (const [tabId, tab2] of Object.entries(tabs)) {
820851
- if (tab2.changelog != null) {
820852
- out.push({
820853
- where: `${breadcrumb} > tab "${tabId}" (changelog: ${tab2.changelog})`,
820854
- slug: tab2.slug,
820855
- title: tab2.displayName
820856
- });
820857
- }
820858
- }
820859
- return out;
820860
- }
820861
- function collectFromNavigation(navigation2, breadcrumb) {
820862
- if (navigation2 == null || !Array.isArray(navigation2) || navigation2.length === 0) {
820863
- return [];
820864
- }
820865
- if (isTabbedNavigation(navigation2)) {
820866
- const out = [];
820867
- for (const item of navigation2) {
820868
- const next2 = `${breadcrumb} > tab "${item.tab}"`;
820869
- if ("layout" in item && Array.isArray(item.layout)) {
820870
- out.push(...collectChangelogLocations(item.layout, next2));
820871
- }
820872
- if ("variants" in item && Array.isArray(item.variants)) {
820873
- for (const variant of item.variants) {
820874
- const variantBreadcrumb = `${next2} > variant "${variant.title}"`;
820875
- out.push(...collectChangelogLocations(variant.layout, variantBreadcrumb));
820876
- }
820877
- }
820878
- }
820879
- return out;
820880
- }
820881
- return collectChangelogLocations(navigation2, breadcrumb);
820882
- }
820883
- function violationsForLocations(locations) {
820884
- const violations = [];
820885
- for (const loc of locations) {
820886
- const lastSegment = getEffectiveChangelogSlugLastSegment(loc);
820887
- if (lastSegment === "" || isAllowedChangelogSlug(lastSegment)) {
820888
- continue;
820889
- }
820890
- const allowed = CHANGELOG_FEED_ALLOWED_SLUGS.join(", ");
820891
- const sourceField = loc.slug != null ? `slug: "${loc.slug}"` : `title: "${loc.title ?? DEFAULT_CHANGELOG_TITLE3}"`;
820892
- violations.push({
820893
- severity: "error",
820894
- 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.`
820895
- });
820896
- }
820897
- return violations;
820898
- }
820899
- var ValidChangelogSlugRule = {
820900
- name: "valid-changelog-slug",
820901
- create: () => {
820902
- return {
820903
- file: async ({ config: config5 }) => {
820904
- const locations = [
820905
- ...collectFromNavigation(config5.navigation, "navigation"),
820906
- ...collectFromTabs(config5.tabs, "tabs")
820907
- ];
820908
- return violationsForLocations(locations);
820909
- },
820910
- versionFile: async ({ path: path106, content: content5 }) => {
820911
- const parseResult = await validateVersionConfigFileSchema({ value: content5 });
820912
- if (parseResult.type !== "success") {
820913
- return [];
820914
- }
820915
- const versionConfig = parseResult.contents;
820916
- const locations = [
820917
- ...collectFromNavigation(versionConfig.navigation, `version "${path106}" navigation`),
820918
- ...collectFromTabs(versionConfig.tabs, `version "${path106}" tabs`)
820919
- ];
820920
- return violationsForLocations(locations);
820921
- },
820922
- productFile: async ({ path: path106, content: content5 }) => {
820923
- const parseResult = await validateProductConfigFileSchema({ value: content5 });
820924
- if (parseResult.type !== "success") {
820925
- return [];
820926
- }
820927
- const productConfig = parseResult.contents;
820928
- const locations = [
820929
- ...collectFromNavigation(productConfig.navigation, `product "${path106}" navigation`),
820930
- ...collectFromTabs(productConfig.tabs, `product "${path106}" tabs`)
820931
- ];
820932
- return violationsForLocations(locations);
820933
- }
820934
- };
820935
- }
820936
- };
820937
- function isChangelog(item) {
820938
- return item?.changelog != null;
820939
- }
820940
- function isSection3(item) {
820941
- return item?.section != null;
820942
- }
820943
- function isTabbedNavigation(navigation2) {
820944
- return Array.isArray(navigation2) && navigation2.length > 0 && navigation2[0]?.tab != null;
820945
- }
820946
-
820947
820885
  // ../yaml/docs-validator/lib/rules/valid-docs-endpoints/valid-docs-endpoints.js
820948
820886
  var ValidDocsEndpoints = {
820949
820887
  name: "valid-docs-endpoints",
@@ -843423,8 +843361,7 @@ var allRules = [
843423
843361
  ValidDocsEndpoints,
843424
843362
  AllRolesMustBeDeclaredRule,
843425
843363
  ValidFrontmatter,
843426
- TranslationDirectoriesExistRule,
843427
- ValidChangelogSlugRule
843364
+ TranslationDirectoriesExistRule
843428
843365
  // ValidMarkdownFileReferences
843429
843366
  ];
843430
843367
  function getAllRules3(exclusions) {
@@ -843453,8 +843390,7 @@ var CHECK_RULE_CONFIG_TO_RULE_NAME = {
843453
843390
  validLocalReferences: ValidLocalReferencesRule.name,
843454
843391
  noCircularRedirects: NoCircularRedirectsRule.name,
843455
843392
  validDocsEndpoints: ValidDocsEndpoints.name,
843456
- missingRedirects: MissingRedirectsRule.name,
843457
- validChangelogSlug: ValidChangelogSlugRule.name
843393
+ missingRedirects: MissingRedirectsRule.name
843458
843394
  };
843459
843395
  function buildSeverityOverrides(checkConfig) {
843460
843396
  const severityOverrides = /* @__PURE__ */ new Map();
@@ -847534,7 +847470,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
847534
847470
  var LOGS_FOLDER_NAME = "logs";
847535
847471
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
847536
847472
  function getCliSource() {
847537
- const version7 = "5.8.1";
847473
+ const version7 = "5.9.0-rc.0";
847538
847474
  return `cli@${version7}`;
847539
847475
  }
847540
847476
  var DebugLogger = class {
@@ -856321,16 +856257,6 @@ var definitions6 = {
856321
856257
  type: "null"
856322
856258
  }
856323
856259
  ]
856324
- },
856325
- "valid-changelog-slug": {
856326
- oneOf: [
856327
- {
856328
- $ref: "#/definitions/docs.CheckRuleSeverity"
856329
- },
856330
- {
856331
- type: "null"
856332
- }
856333
- ]
856334
856260
  }
856335
856261
  },
856336
856262
  additionalProperties: false
@@ -860187,7 +860113,7 @@ var LegacyDocsPublisher = class {
860187
860113
  previewId,
860188
860114
  disableTemplates: void 0,
860189
860115
  skipUpload,
860190
- cliVersion: "5.8.1",
860116
+ cliVersion: "5.9.0-rc.0",
860191
860117
  loginCommand: "fern auth login"
860192
860118
  });
860193
860119
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -934629,7 +934555,7 @@ var CliContext = class _CliContext {
934629
934555
  if (false) {
934630
934556
  this.logger.error("CLI_VERSION is not defined");
934631
934557
  }
934632
- return "5.8.1";
934558
+ return "5.9.0-rc.0";
934633
934559
  }
934634
934560
  getCliName() {
934635
934561
  if (false) {
@@ -937141,22 +937067,31 @@ function countResults(results) {
937141
937067
  }
937142
937068
  return { succeeded, failed, skipped };
937143
937069
  }
937144
- function buildGeneratorsYmlUrl(absolutePath, lineNumber) {
937070
+ function resolveGithubWorkspaceRelativePath(absolutePath) {
937145
937071
  if (absolutePath == null) {
937146
937072
  return null;
937147
937073
  }
937148
- const serverUrl = process.env.GITHUB_SERVER_URL;
937149
- const repository = process.env.GITHUB_REPOSITORY;
937150
- const refName = process.env.GITHUB_REF_NAME;
937151
937074
  const workspace = process.env.GITHUB_WORKSPACE;
937152
- if (serverUrl == null || repository == null || refName == null || workspace == null) {
937075
+ if (workspace == null) {
937153
937076
  return null;
937154
937077
  }
937155
937078
  const workspaceWithSlash = workspace.endsWith("/") ? workspace : `${workspace}/`;
937156
937079
  if (!absolutePath.startsWith(workspaceWithSlash)) {
937157
937080
  return null;
937158
937081
  }
937159
- const relativePath = absolutePath.slice(workspaceWithSlash.length);
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
+ }
937160
937095
  const anchor = lineNumber != null ? `#L${lineNumber}` : "";
937161
937096
  return `${serverUrl}/${repository}/blob/${refName}/${relativePath}${anchor}`;
937162
937097
  }
@@ -937176,7 +937111,9 @@ var GeneratorRunCollector = class {
937176
937111
  errorMessage: null,
937177
937112
  durationMs: args.durationMs,
937178
937113
  sdkRepoUrl: args.outputRepoUrl ?? null,
937179
- generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
937114
+ generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
937115
+ generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
937116
+ generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
937180
937117
  });
937181
937118
  }
937182
937119
  recordFailure(args) {
@@ -937193,7 +937130,9 @@ var GeneratorRunCollector = class {
937193
937130
  errorMessage: args.errorMessage,
937194
937131
  durationMs: args.durationMs,
937195
937132
  sdkRepoUrl: args.outputRepoUrl ?? null,
937196
- generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
937133
+ generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
937134
+ generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
937135
+ generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
937197
937136
  });
937198
937137
  }
937199
937138
  recordSkipped(args) {
@@ -937210,7 +937149,9 @@ var GeneratorRunCollector = class {
937210
937149
  errorMessage: null,
937211
937150
  durationMs: 0,
937212
937151
  sdkRepoUrl: args.outputRepoUrl ?? null,
937213
- generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber)
937152
+ generatorsYmlUrl: buildGeneratorsYmlUrl(args.generatorsYmlAbsolutePath, args.generatorsYmlLineNumber),
937153
+ generatorsYmlWorkspaceRelativePath: resolveGithubWorkspaceRelativePath(args.generatorsYmlAbsolutePath),
937154
+ generatorsYmlLineNumber: args.generatorsYmlLineNumber ?? null
937214
937155
  });
937215
937156
  }
937216
937157
  results() {
@@ -937224,6 +937165,55 @@ var GeneratorRunCollector = class {
937224
937165
  }
937225
937166
  };
937226
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
+
937227
937217
  // src/commands/automations/generate/reportGenerateResults.ts
937228
937218
  init_lib4();
937229
937219
  var import_fs37 = require("fs");
@@ -937464,60 +937454,72 @@ async function executeAutomationsGenerate({
937464
937454
  }
937465
937455
  outputsFlushed = true;
937466
937456
  writeResultsSync({ results: collector.results(), jsonOutputPath });
937457
+ emitStructuredAnnotations(collector);
937467
937458
  };
937468
937459
  process.once("SIGINT", flushOnSignal);
937469
937460
  process.once("SIGTERM", flushOnSignal);
937470
937461
  try {
937471
- await cliContext.runTask(async () => {
937472
- await generateAPIWorkspaces({
937473
- project: await loadProjectAndRegisterWorkspacesWithContext(cliContext, {
937474
- commandLineApiWorkspace: options2.api,
937475
- defaultToAllApiWorkspaces: true
937476
- }),
937477
- cliContext,
937478
- version: options2.version,
937479
- groupNames: options2.group != null ? [options2.group] : void 0,
937480
- generatorName,
937481
- generatorIndex,
937482
- shouldLogS3Url: false,
937483
- keepDocker: false,
937484
- useLocalDocker: false,
937485
- preview: false,
937486
- mode: void 0,
937487
- force: true,
937488
- runner: void 0,
937489
- inspect: false,
937490
- lfsOverride: void 0,
937491
- fernignorePath: void 0,
937492
- skipFernignore: false,
937493
- dynamicIrOnly: false,
937494
- outputDir: void 0,
937495
- noReplay: false,
937496
- retryRateLimited: false,
937497
- requireEnvVars: false,
937498
- automationMode: true,
937499
- autoMerge: options2.autoMerge,
937500
- skipIfNoDiff: true,
937501
- automation: { recorder: collector }
937502
- });
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
+ }
937503
937503
  });
937504
- } catch (error50) {
937505
- if (!(error50 instanceof TaskAbortSignal)) {
937506
- throw error50;
937507
- }
937508
- taskAborted = true;
937509
937504
  } finally {
937510
937505
  process.off("SIGINT", flushOnSignal);
937511
937506
  process.off("SIGTERM", flushOnSignal);
937512
937507
  if (!outputsFlushed) {
937513
937508
  outputsFlushed = true;
937514
937509
  await reportFinalOutputs({ collector, jsonOutputPath, taskAborted });
937510
+ emitStructuredAnnotations(collector);
937515
937511
  }
937516
937512
  if (collector.hasFailures()) {
937517
937513
  process.exitCode = 1;
937518
937514
  }
937519
937515
  }
937520
937516
  }
937517
+ function emitStructuredAnnotations(collector) {
937518
+ const annotations = renderGithubAnnotationsForResults(collector.results());
937519
+ if (annotations.length > 0) {
937520
+ process.stdout.write(annotations);
937521
+ }
937522
+ }
937521
937523
  async function reportFinalOutputs({
937522
937524
  collector,
937523
937525
  jsonOutputPath,
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.8.1",
2
+ "version": "5.9.0-rc.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",