@fern-api/fern-api-dev 5.8.0 → 5.8.1-2-ge6734bb534a

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 +169 -9
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -511686,7 +511686,8 @@ 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()
511689
+ "missing-redirects": CheckRuleSeverity.optional(),
511690
+ "valid-changelog-slug": CheckRuleSeverity.optional()
511690
511691
  });
511691
511692
  var CheckConfig = external_exports.object({
511692
511693
  rules: CheckRulesConfig.optional()
@@ -514649,7 +514650,8 @@ var CheckRulesConfig2 = schemas_exports6.object({
514649
514650
  validLocalReferences: schemas_exports6.property("valid-local-references", CheckRuleSeverity3.optional()),
514650
514651
  noCircularRedirects: schemas_exports6.property("no-circular-redirects", CheckRuleSeverity3.optional()),
514651
514652
  validDocsEndpoints: schemas_exports6.property("valid-docs-endpoints", CheckRuleSeverity3.optional()),
514652
- missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional())
514653
+ missingRedirects: schemas_exports6.property("missing-redirects", CheckRuleSeverity3.optional()),
514654
+ validChangelogSlug: schemas_exports6.property("valid-changelog-slug", CheckRuleSeverity3.optional())
514653
514655
  });
514654
514656
 
514655
514657
  // ../configuration/lib/docs-yml/schemas/sdk/serialization/resources/docs/types/CheckConfig.js
@@ -622584,7 +622586,7 @@ var AccessTokenPosthogManager = class {
622584
622586
  properties: {
622585
622587
  ...event,
622586
622588
  ...event.properties,
622587
- version: "5.8.0",
622589
+ version: "5.8.1-2-ge6734bb534a",
622588
622590
  usingAccessToken: true
622589
622591
  }
622590
622592
  });
@@ -622638,7 +622640,7 @@ var UserPosthogManager = class {
622638
622640
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
622639
622641
  event: "CLI",
622640
622642
  properties: {
622641
- version: "5.8.0",
622643
+ version: "5.8.1-2-ge6734bb534a",
622642
622644
  ...event,
622643
622645
  ...event.properties,
622644
622646
  usingAccessToken: false,
@@ -819754,12 +819756,14 @@ var rules_exports = {};
819754
819756
  __export(rules_exports, {
819755
819757
  AccentColorContrastRule: () => AccentColorContrastRule,
819756
819758
  AllRolesMustBeDeclaredRule: () => AllRolesMustBeDeclaredRule,
819759
+ CHANGELOG_FEED_ALLOWED_SLUGS: () => CHANGELOG_FEED_ALLOWED_SLUGS,
819757
819760
  FilepathsExistRule: () => FilepathsExistRule,
819758
819761
  MissingRedirectsRule: () => MissingRedirectsRule,
819759
819762
  NoCircularRedirectsRule: () => NoCircularRedirectsRule,
819760
819763
  OnlyVersionedNavigation: () => OnlyVersionedNavigation,
819761
819764
  TabWithHrefRule: () => TabWithHrefRule,
819762
819765
  TranslationDirectoriesExistRule: () => TranslationDirectoriesExistRule,
819766
+ ValidChangelogSlugRule: () => ValidChangelogSlugRule,
819763
819767
  ValidDocsEndpoints: () => ValidDocsEndpoints,
819764
819768
  ValidFileTypes: () => ValidFileTypes,
819765
819769
  ValidFrontmatter: () => ValidFrontmatter,
@@ -819770,6 +819774,8 @@ __export(rules_exports, {
819770
819774
  ValidateProductFileRule: () => ValidateProductFileRule,
819771
819775
  ValidateVersionFileRule: () => ValidateVersionFileRule,
819772
819776
  enforceBackgroundTheme: () => enforceBackgroundTheme,
819777
+ getEffectiveChangelogSlugLastSegment: () => getEffectiveChangelogSlugLastSegment,
819778
+ isAllowedChangelogSlug: () => isAllowedChangelogSlug,
819773
819779
  validateTheme: () => validateTheme
819774
819780
  });
819775
819781
 
@@ -820796,6 +820802,148 @@ function buildExpectedDirectoryTree({ translationsDirExists, missingDirs, fernFo
820796
820802
  return lines.join("\n");
820797
820803
  }
820798
820804
 
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
+
820799
820947
  // ../yaml/docs-validator/lib/rules/valid-docs-endpoints/valid-docs-endpoints.js
820800
820948
  var ValidDocsEndpoints = {
820801
820949
  name: "valid-docs-endpoints",
@@ -843275,7 +843423,8 @@ var allRules = [
843275
843423
  ValidDocsEndpoints,
843276
843424
  AllRolesMustBeDeclaredRule,
843277
843425
  ValidFrontmatter,
843278
- TranslationDirectoriesExistRule
843426
+ TranslationDirectoriesExistRule,
843427
+ ValidChangelogSlugRule
843279
843428
  // ValidMarkdownFileReferences
843280
843429
  ];
843281
843430
  function getAllRules3(exclusions) {
@@ -843304,7 +843453,8 @@ var CHECK_RULE_CONFIG_TO_RULE_NAME = {
843304
843453
  validLocalReferences: ValidLocalReferencesRule.name,
843305
843454
  noCircularRedirects: NoCircularRedirectsRule.name,
843306
843455
  validDocsEndpoints: ValidDocsEndpoints.name,
843307
- missingRedirects: MissingRedirectsRule.name
843456
+ missingRedirects: MissingRedirectsRule.name,
843457
+ validChangelogSlug: ValidChangelogSlugRule.name
843308
843458
  };
843309
843459
  function buildSeverityOverrides(checkConfig) {
843310
843460
  const severityOverrides = /* @__PURE__ */ new Map();
@@ -847384,7 +847534,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
847384
847534
  var LOGS_FOLDER_NAME = "logs";
847385
847535
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
847386
847536
  function getCliSource() {
847387
- const version7 = "5.8.0";
847537
+ const version7 = "5.8.1-2-ge6734bb534a";
847388
847538
  return `cli@${version7}`;
847389
847539
  }
847390
847540
  var DebugLogger = class {
@@ -856171,6 +856321,16 @@ var definitions6 = {
856171
856321
  type: "null"
856172
856322
  }
856173
856323
  ]
856324
+ },
856325
+ "valid-changelog-slug": {
856326
+ oneOf: [
856327
+ {
856328
+ $ref: "#/definitions/docs.CheckRuleSeverity"
856329
+ },
856330
+ {
856331
+ type: "null"
856332
+ }
856333
+ ]
856174
856334
  }
856175
856335
  },
856176
856336
  additionalProperties: false
@@ -860027,7 +860187,7 @@ var LegacyDocsPublisher = class {
860027
860187
  previewId,
860028
860188
  disableTemplates: void 0,
860029
860189
  skipUpload,
860030
- cliVersion: "5.8.0",
860190
+ cliVersion: "5.8.1-2-ge6734bb534a",
860031
860191
  loginCommand: "fern auth login"
860032
860192
  });
860033
860193
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -934469,7 +934629,7 @@ var CliContext = class _CliContext {
934469
934629
  if (false) {
934470
934630
  this.logger.error("CLI_VERSION is not defined");
934471
934631
  }
934472
- return "5.8.0";
934632
+ return "5.8.1-2-ge6734bb534a";
934473
934633
  }
934474
934634
  getCliName() {
934475
934635
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.8.0",
2
+ "version": "5.8.1-2-ge6734bb534a",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",