diff --git a/fern/apis/fdr/definition/docs/v1/db/__package__.yml b/fern/apis/fdr/definition/docs/v1/db/__package__.yml index 3168c6d3d9..035166ba24 100644 --- a/fern/apis/fdr/definition/docs/v1/db/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/db/__package__.yml @@ -134,6 +134,7 @@ types: group: NavigationTabGroup link: docsReadV1.NavigationTabLink changelog: docsReadV1.ChangelogSection + changelogV3: docsReadV1.ChangelogSectionV3 NavigationTabGroup: properties: @@ -166,8 +167,10 @@ types: section: DocsSection link: docsReadV1.LinkMetadata changelog: docsReadV1.ChangelogSection + changelogV3: docsReadV1.ChangelogSectionV3 ApiSection: + availability: deprecated properties: title: string icon: optional diff --git a/fern/apis/fdr/definition/docs/v1/read/__package__.yml b/fern/apis/fdr/definition/docs/v1/read/__package__.yml index a25dfa4787..cc95c56c9a 100644 --- a/fern/apis/fdr/definition/docs/v1/read/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/read/__package__.yml @@ -171,26 +171,11 @@ types: tabs: list NavigationTab: - discriminated: false union: - - NavigationTabGroupV1 - - NavigationTabLinkV1 - - ChangelogSectionV1 - - NavigationTabGroupV1: - extends: NavigationTabGroup - properties: - type: optional> - - NavigationTabLinkV1: - extends: NavigationTabLink - properties: - type: literal<"link"> - - ChangelogSectionV1: - extends: ChangelogSection - properties: - type: literal<"changelog"> + group: NavigationTabGroup + link: NavigationTabLink + changelog: ChangelogSection + changelogV3: ChangelogSectionV3 NavigationTabGroup: extends: NavigationNodeMetadata @@ -273,6 +258,7 @@ types: section: DocsSection link: LinkMetadata changelog: ChangelogSection + changelogV3: ChangelogSectionV3 PageMetadata: extends: NavigationNodeMetadata @@ -294,6 +280,7 @@ types: url: string ApiSection: + availability: deprecated extends: NavigationNodeMetadata properties: title: string @@ -342,6 +329,10 @@ types: pageId: optional items: list + ChangelogSectionV3: + properties: + node: navigation.ChangelogNode + ChangelogItem: properties: date: date diff --git a/fern/apis/fdr/definition/docs/v1/write/__package__.yml b/fern/apis/fdr/definition/docs/v1/write/__package__.yml index 03a3045219..ce823996b5 100644 --- a/fern/apis/fdr/definition/docs/v1/write/__package__.yml +++ b/fern/apis/fdr/definition/docs/v1/write/__package__.yml @@ -175,6 +175,7 @@ types: group: NavigationTabGroup link: NavigationTabLink changelog: ChangelogSectionV2 + changelogV3: ChangelogSectionV3 NavigationTabGroup: extends: NavigationNodeMetadata @@ -257,6 +258,7 @@ types: section: DocsSection link: LinkMetadata changelog: ChangelogSectionV2 + changelogV3: ChangelogSectionV3 PageMetadata: extends: NavigationNodeMetadata @@ -286,6 +288,7 @@ types: url: string ApiSection: + availability: deprecated extends: NavigationNodeMetadata properties: title: string @@ -357,6 +360,10 @@ types: pageId: optional items: list + ChangelogSectionV3: + properties: + node: navigation.ChangelogNode + ChangelogItem: properties: date: date diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationItem.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationItem.ts index a143734235..21a22948e9 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationItem.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationItem.ts @@ -10,7 +10,8 @@ export type NavigationItem = | FernRegistry.docs.v1.db.NavigationItem.ApiV2 | FernRegistry.docs.v1.db.NavigationItem.Section | FernRegistry.docs.v1.db.NavigationItem.Link - | FernRegistry.docs.v1.db.NavigationItem.Changelog; + | FernRegistry.docs.v1.db.NavigationItem.Changelog + | FernRegistry.docs.v1.db.NavigationItem.ChangelogV3; export declare namespace NavigationItem { interface Page extends FernRegistry.docs.v1.read.PageMetadata { @@ -36,4 +37,8 @@ export declare namespace NavigationItem { interface Changelog extends FernRegistry.docs.v1.read.ChangelogSection { type: "changelog"; } + + interface ChangelogV3 extends FernRegistry.docs.v1.read.ChangelogSectionV3 { + type: "changelogV3"; + } } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationTabV2.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationTabV2.ts index 5d248c64f6..a79fcbc1c2 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationTabV2.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/db/types/NavigationTabV2.ts @@ -7,7 +7,8 @@ import * as FernRegistry from "../../../../../../../index"; export type NavigationTabV2 = | FernRegistry.docs.v1.db.NavigationTabV2.Group | FernRegistry.docs.v1.db.NavigationTabV2.Link - | FernRegistry.docs.v1.db.NavigationTabV2.Changelog; + | FernRegistry.docs.v1.db.NavigationTabV2.Changelog + | FernRegistry.docs.v1.db.NavigationTabV2.ChangelogV3; export declare namespace NavigationTabV2 { interface Group extends FernRegistry.docs.v1.db.NavigationTabGroup { @@ -21,4 +22,8 @@ export declare namespace NavigationTabV2 { interface Changelog extends FernRegistry.docs.v1.read.ChangelogSection { type: "changelog"; } + + interface ChangelogV3 extends FernRegistry.docs.v1.read.ChangelogSectionV3 { + type: "changelogV3"; + } } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabLinkV1.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV3.ts similarity index 55% rename from packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabLinkV1.ts rename to packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV3.ts index 12094c7292..29d0070f9d 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabLinkV1.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV3.ts @@ -4,6 +4,6 @@ import * as FernRegistry from "../../../../../../../index"; -export interface NavigationTabLinkV1 extends FernRegistry.docs.v1.read.NavigationTabLink { - type: "link"; +export interface ChangelogSectionV3 { + node: FernRegistry.navigation.ChangelogNode; } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationItem.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationItem.ts index f431d51e56..08f4b7ae0a 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationItem.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationItem.ts @@ -10,7 +10,8 @@ export type NavigationItem = | FernRegistry.docs.v1.read.NavigationItem.ApiV2 | FernRegistry.docs.v1.read.NavigationItem.Section | FernRegistry.docs.v1.read.NavigationItem.Link - | FernRegistry.docs.v1.read.NavigationItem.Changelog; + | FernRegistry.docs.v1.read.NavigationItem.Changelog + | FernRegistry.docs.v1.read.NavigationItem.ChangelogV3; export declare namespace NavigationItem { interface Page extends FernRegistry.docs.v1.read.PageMetadata { @@ -36,4 +37,8 @@ export declare namespace NavigationItem { interface Changelog extends FernRegistry.docs.v1.read.ChangelogSection { type: "changelog"; } + + interface ChangelogV3 extends FernRegistry.docs.v1.read.ChangelogSectionV3 { + type: "changelogV3"; + } } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTab.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTab.ts index 5535845c1a..728313949b 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTab.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTab.ts @@ -5,6 +5,25 @@ import * as FernRegistry from "../../../../../../../index"; export type NavigationTab = - | FernRegistry.docs.v1.read.NavigationTabGroupV1 - | FernRegistry.docs.v1.read.NavigationTabLinkV1 - | FernRegistry.docs.v1.read.ChangelogSectionV1; + | FernRegistry.docs.v1.read.NavigationTab.Group + | FernRegistry.docs.v1.read.NavigationTab.Link + | FernRegistry.docs.v1.read.NavigationTab.Changelog + | FernRegistry.docs.v1.read.NavigationTab.ChangelogV3; + +export declare namespace NavigationTab { + interface Group extends FernRegistry.docs.v1.read.NavigationTabGroup { + type: "group"; + } + + interface Link extends FernRegistry.docs.v1.read.NavigationTabLink { + type: "link"; + } + + interface Changelog extends FernRegistry.docs.v1.read.ChangelogSection { + type: "changelog"; + } + + interface ChangelogV3 extends FernRegistry.docs.v1.read.ChangelogSectionV3 { + type: "changelogV3"; + } +} diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabGroupV1.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabGroupV1.ts deleted file mode 100644 index cfb4855627..0000000000 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/NavigationTabGroupV1.ts +++ /dev/null @@ -1,9 +0,0 @@ -/** - * This file was auto-generated by Fern from our API Definition. - */ - -import * as FernRegistry from "../../../../../../../index"; - -export interface NavigationTabGroupV1 extends FernRegistry.docs.v1.read.NavigationTabGroup { - type?: "group"; -} diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/index.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/index.ts index 873b5954a3..33aac8b44d 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/index.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/index.ts @@ -14,9 +14,6 @@ export * from "./NavigationConfig"; export * from "./UnversionedNavigationConfig"; export * from "./UnversionedTabbedNavigationConfig"; export * from "./NavigationTab"; -export * from "./NavigationTabGroupV1"; -export * from "./NavigationTabLinkV1"; -export * from "./ChangelogSectionV1"; export * from "./NavigationTabGroup"; export * from "./NavigationTabLink"; export * from "./UnversionedUntabbedNavigationConfig"; @@ -39,6 +36,7 @@ export * from "./ApiNavigationConfigRoot"; export * from "./ApiNavigationConfigItem"; export * from "./ApiNavigationConfigSubpackage"; export * from "./ChangelogSection"; +export * from "./ChangelogSectionV3"; export * from "./ChangelogItem"; export * from "./DocsSection"; export * from "./ApiArtifacts"; diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV1.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/ChangelogSectionV3.ts similarity index 55% rename from packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV1.ts rename to packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/ChangelogSectionV3.ts index 962eba324d..29d0070f9d 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/read/types/ChangelogSectionV1.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/ChangelogSectionV3.ts @@ -4,6 +4,6 @@ import * as FernRegistry from "../../../../../../../index"; -export interface ChangelogSectionV1 extends FernRegistry.docs.v1.read.ChangelogSection { - type: "changelog"; +export interface ChangelogSectionV3 { + node: FernRegistry.navigation.ChangelogNode; } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationItem.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationItem.ts index c3a57078c9..f9625b7b17 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationItem.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationItem.ts @@ -10,7 +10,8 @@ export type NavigationItem = | FernRegistry.docs.v1.write.NavigationItem.ApiV2 | FernRegistry.docs.v1.write.NavigationItem.Section | FernRegistry.docs.v1.write.NavigationItem.Link - | FernRegistry.docs.v1.write.NavigationItem.Changelog; + | FernRegistry.docs.v1.write.NavigationItem.Changelog + | FernRegistry.docs.v1.write.NavigationItem.ChangelogV3; export declare namespace NavigationItem { interface Page extends FernRegistry.docs.v1.write.PageMetadata { @@ -36,4 +37,8 @@ export declare namespace NavigationItem { interface Changelog extends FernRegistry.docs.v1.write.ChangelogSectionV2 { type: "changelog"; } + + interface ChangelogV3 extends FernRegistry.docs.v1.write.ChangelogSectionV3 { + type: "changelogV3"; + } } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationTabV2.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationTabV2.ts index deb9dbacc6..8ec00151aa 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationTabV2.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/NavigationTabV2.ts @@ -7,7 +7,8 @@ import * as FernRegistry from "../../../../../../../index"; export type NavigationTabV2 = | FernRegistry.docs.v1.write.NavigationTabV2.Group | FernRegistry.docs.v1.write.NavigationTabV2.Link - | FernRegistry.docs.v1.write.NavigationTabV2.Changelog; + | FernRegistry.docs.v1.write.NavigationTabV2.Changelog + | FernRegistry.docs.v1.write.NavigationTabV2.ChangelogV3; export declare namespace NavigationTabV2 { interface Group extends FernRegistry.docs.v1.write.NavigationTabGroup { @@ -21,4 +22,8 @@ export declare namespace NavigationTabV2 { interface Changelog extends FernRegistry.docs.v1.write.ChangelogSectionV2 { type: "changelog"; } + + interface ChangelogV3 extends FernRegistry.docs.v1.write.ChangelogSectionV3 { + type: "changelogV3"; + } } diff --git a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/index.ts b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/index.ts index cd55106763..3388583a7e 100644 --- a/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/index.ts +++ b/packages/fdr-sdk/src/client/generated/api/resources/docs/resources/v1/resources/write/types/index.ts @@ -37,6 +37,7 @@ export * from "./ApiNavigationConfigItem"; export * from "./ApiNavigationConfigSubpackage"; export * from "./ChangelogSection"; export * from "./ChangelogSectionV2"; +export * from "./ChangelogSectionV3"; export * from "./ChangelogItem"; export * from "./DocsSection"; export * from "./ApiArtifacts"; diff --git a/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts b/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts index ed770d65fd..63f0524af1 100644 --- a/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts +++ b/packages/fdr-sdk/src/converters/db/convertDocsDefinitionToDb.ts @@ -180,6 +180,9 @@ function transformNavigationTabV2ForDb(writeShape: DocsV1Write.NavigationTabV2): case "changelog": { return { type: "changelog", ...toChangelogDb(writeShape) }; } + case "changelogV3": { + return writeShape; + } } } @@ -259,6 +262,8 @@ export function transformNavigationItemForDb( return { type: "changelog", ...toChangelogDb(writeShape) }; case "apiV2": return writeShape; + case "changelogV3": + return writeShape; default: assertNever(writeShape); } @@ -315,6 +320,8 @@ function getReferencedApiDefinitionIdFromItem(item: DocsV1Db.NavigationItem): Fd return []; case "apiV2": return [item.node.apiDefinitionId]; + case "changelogV3": + return []; default: assertNever(item); } diff --git a/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts b/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts index 8d4707f45c..b10b586519 100644 --- a/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts +++ b/packages/fdr-sdk/src/converters/read/convertDbDocsConfigToRead.ts @@ -163,6 +163,7 @@ export function transformNavigationTabV2ForDb(dbShape: DocsV1Db.NavigationTabV2) fullSlug: undefined, }; case "changelog": + case "changelogV3": return dbShape; default: assertNever(dbShape); @@ -180,17 +181,16 @@ export function transformNavigationItemForDb(dbShape: DocsV1Db.NavigationItem): ...dbShape, showErrors: dbShape.showErrors ?? false, }; - case "page": - case "link": - return dbShape; case "section": return { ...dbShape, items: dbShape.items.map((item) => transformNavigationItemForDb(item)), }; + case "page": + case "link": case "changelog": - return dbShape; case "apiV2": + case "changelogV3": return dbShape; default: assertNever(dbShape); diff --git a/packages/fdr-sdk/src/navigation/NodeCollector.ts b/packages/fdr-sdk/src/navigation/NodeCollector.ts index 1d97f6abaa..6ad1342d4c 100644 --- a/packages/fdr-sdk/src/navigation/NodeCollector.ts +++ b/packages/fdr-sdk/src/navigation/NodeCollector.ts @@ -81,9 +81,11 @@ export class NodeCollector { this.#lastNeighboringNode = undefined; } - if (!hasMetadata(node)) { + // there's currently no visitable page for changelog months and years + if (!hasMetadata(node) || node.type === "changelogMonth" || node.type === "changelogYear") { return; } + const existing = this.slugToNode[node.slug]; if (existing == null) { this.#setNode(node.slug, node, parents); diff --git a/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugs.json b/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugs.json index c58935c4ba..d632a3b822 100644 --- a/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugs.json +++ b/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugs.json @@ -40,10 +40,7 @@ "docs/api/platform-api-reference/workspace/update-workspace", "docs/api/platform-api-reference/workspace/delete-workspace", "docs/api/platform-api-reference/changelog", - "docs/api/platform-api-reference/changelog/2024", - "docs/api/platform-api-reference/changelog/2024/5", "docs/api/platform-api-reference/changelog/2024/5/15", - "docs/api/platform-api-reference/changelog/2024/4", "docs/api/platform-api-reference/changelog/2024/4/23", "docs/api/platform-api-reference/changelog/2024/4/12", "docs/api/iam-api-reference", @@ -82,7 +79,5 @@ "docs/api/iam-api-reference/user/get-user", "docs/api/iam-api-reference/user/update-user-roles", "docs/api/iam-api-reference/changelog", - "docs/api/iam-api-reference/changelog/2024", - "docs/api/iam-api-reference/changelog/2024/4", "docs/api/iam-api-reference/changelog/2024/4/12" ] \ No newline at end of file diff --git a/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugsWithContent.json b/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugsWithContent.json index 4240d77ed1..73b5aa8c4d 100644 --- a/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugsWithContent.json +++ b/packages/fdr-sdk/src/navigation/__test__/output/astronomer/slugsWithContent.json @@ -31,10 +31,7 @@ "docs/api/platform-api-reference/workspace/update-workspace", "docs/api/platform-api-reference/workspace/delete-workspace", "docs/api/platform-api-reference/changelog", - "docs/api/platform-api-reference/changelog/2024", - "docs/api/platform-api-reference/changelog/2024/5", "docs/api/platform-api-reference/changelog/2024/5/15", - "docs/api/platform-api-reference/changelog/2024/4", "docs/api/platform-api-reference/changelog/2024/4/23", "docs/api/platform-api-reference/changelog/2024/4/12", "docs/api/iam-api-reference/authorization/list-permission-groups", @@ -66,7 +63,5 @@ "docs/api/iam-api-reference/user/get-user", "docs/api/iam-api-reference/user/update-user-roles", "docs/api/iam-api-reference/changelog", - "docs/api/iam-api-reference/changelog/2024", - "docs/api/iam-api-reference/changelog/2024/4", "docs/api/iam-api-reference/changelog/2024/4/12" ] \ No newline at end of file diff --git a/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugs.json b/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugs.json index df76ee2d9d..bbf1e763f1 100644 --- a/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugs.json +++ b/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugs.json @@ -137,8 +137,6 @@ "docs/api-reference/sessions/create", "docs/api-reference/sessions/get", "docs/api-reference/changelog", - "docs/api-reference/changelog/2024", - "docs/api-reference/changelog/2024/4", "docs/api-reference/changelog/2024/4/30", "docs/api-reference/changelog/2024/4/26", "docs/api-reference/changelog/2024/4/23", @@ -146,32 +144,26 @@ "docs/api-reference/changelog/2024/4/16", "docs/api-reference/changelog/2024/4/13", "docs/api-reference/changelog/2024/4/5", - "docs/api-reference/changelog/2024/3", "docs/api-reference/changelog/2024/3/25", "docs/api-reference/changelog/2024/3/18", "docs/api-reference/changelog/2024/3/7", "docs/api-reference/changelog/2024/3/6", - "docs/api-reference/changelog/2024/2", "docs/api-reference/changelog/2024/2/26", "docs/api-reference/changelog/2024/2/14", "docs/api-reference/changelog/2024/2/13", "docs/api-reference/changelog/2024/2/9", "docs/api-reference/changelog/2024/2/8", "docs/api-reference/changelog/2024/2/2", - "docs/api-reference/changelog/2024/1", "docs/api-reference/changelog/2024/1/30", "docs/api-reference/changelog/2024/1/19", "docs/api-reference/changelog/2024/1/12", "docs/api-reference/changelog/2024/1/11", - "docs/api-reference/changelog/2023", - "docs/api-reference/changelog/2023/12", "docs/api-reference/changelog/2023/12/22", "docs/api-reference/changelog/2023/12/21", "docs/api-reference/changelog/2023/12/13", "docs/api-reference/changelog/2023/12/12", "docs/api-reference/changelog/2023/12/5", "docs/api-reference/changelog/2023/12/4", - "docs/api-reference/changelog/2023/11", "docs/api-reference/changelog/2023/11/28", "docs/api-reference/changelog/2023/11/22", "docs/api-reference/changelog/2023/11/21", @@ -181,20 +173,16 @@ "docs/api-reference/changelog/2023/11/9", "docs/api-reference/changelog/2023/11/8", "docs/api-reference/changelog/2023/11/1", - "docs/api-reference/changelog/2023/10", "docs/api-reference/changelog/2023/10/30", "docs/api-reference/changelog/2023/10/17", "docs/api-reference/changelog/2023/10/16", "docs/api-reference/changelog/2023/10/10", - "docs/api-reference/changelog/2023/9", "docs/api-reference/changelog/2023/9/15", "docs/api-reference/changelog/2023/9/13", - "docs/api-reference/changelog/2023/8", "docs/api-reference/changelog/2023/8/31", "docs/api-reference/changelog/2023/8/21", "docs/api-reference/changelog/2023/8/15", "docs/api-reference/changelog/2023/8/14", - "docs/api-reference/changelog/2023/7", "docs/api-reference/changelog/2023/7/30", "docs/api-reference/changelog/2023/7/25", "docs/api-reference/changelog/2023/7/24", @@ -202,19 +190,14 @@ "docs/api-reference/changelog/2023/7/7", "docs/api-reference/changelog/2023/7/5", "docs/api-reference/changelog/2023/7/3", - "docs/api-reference/changelog/2023/6", "docs/api-reference/changelog/2023/6/27", "docs/api-reference/changelog/2023/6/20", "docs/api-reference/changelog/2023/6/13", - "docs/api-reference/changelog/2023/5", "docs/api-reference/changelog/2023/5/23", "docs/api-reference/changelog/2023/5/17", - "docs/api-reference/changelog/2023/4", "docs/api-reference/changelog/2023/4/3", - "docs/api-reference/changelog/2023/3", "docs/api-reference/changelog/2023/3/30", "docs/api-reference/changelog/2023/3/2", - "docs/api-reference/changelog/2023/2", "docs/api-reference/changelog/2023/2/20", "v4", "v4/docs", @@ -354,8 +337,6 @@ "v4/docs/api-reference/sessions/create", "v4/docs/api-reference/sessions/get", "v4/docs/api-reference/changelog", - "v4/docs/api-reference/changelog/2024", - "v4/docs/api-reference/changelog/2024/4", "v4/docs/api-reference/changelog/2024/4/30", "v4/docs/api-reference/changelog/2024/4/26", "v4/docs/api-reference/changelog/2024/4/23", @@ -363,32 +344,26 @@ "v4/docs/api-reference/changelog/2024/4/16", "v4/docs/api-reference/changelog/2024/4/13", "v4/docs/api-reference/changelog/2024/4/5", - "v4/docs/api-reference/changelog/2024/3", "v4/docs/api-reference/changelog/2024/3/25", "v4/docs/api-reference/changelog/2024/3/18", "v4/docs/api-reference/changelog/2024/3/7", "v4/docs/api-reference/changelog/2024/3/6", - "v4/docs/api-reference/changelog/2024/2", "v4/docs/api-reference/changelog/2024/2/26", "v4/docs/api-reference/changelog/2024/2/14", "v4/docs/api-reference/changelog/2024/2/13", "v4/docs/api-reference/changelog/2024/2/9", "v4/docs/api-reference/changelog/2024/2/8", "v4/docs/api-reference/changelog/2024/2/2", - "v4/docs/api-reference/changelog/2024/1", "v4/docs/api-reference/changelog/2024/1/30", "v4/docs/api-reference/changelog/2024/1/19", "v4/docs/api-reference/changelog/2024/1/12", "v4/docs/api-reference/changelog/2024/1/11", - "v4/docs/api-reference/changelog/2023", - "v4/docs/api-reference/changelog/2023/12", "v4/docs/api-reference/changelog/2023/12/22", "v4/docs/api-reference/changelog/2023/12/21", "v4/docs/api-reference/changelog/2023/12/13", "v4/docs/api-reference/changelog/2023/12/12", "v4/docs/api-reference/changelog/2023/12/5", "v4/docs/api-reference/changelog/2023/12/4", - "v4/docs/api-reference/changelog/2023/11", "v4/docs/api-reference/changelog/2023/11/28", "v4/docs/api-reference/changelog/2023/11/22", "v4/docs/api-reference/changelog/2023/11/21", @@ -398,20 +373,16 @@ "v4/docs/api-reference/changelog/2023/11/9", "v4/docs/api-reference/changelog/2023/11/8", "v4/docs/api-reference/changelog/2023/11/1", - "v4/docs/api-reference/changelog/2023/10", "v4/docs/api-reference/changelog/2023/10/30", "v4/docs/api-reference/changelog/2023/10/17", "v4/docs/api-reference/changelog/2023/10/16", "v4/docs/api-reference/changelog/2023/10/10", - "v4/docs/api-reference/changelog/2023/9", "v4/docs/api-reference/changelog/2023/9/15", "v4/docs/api-reference/changelog/2023/9/13", - "v4/docs/api-reference/changelog/2023/8", "v4/docs/api-reference/changelog/2023/8/31", "v4/docs/api-reference/changelog/2023/8/21", "v4/docs/api-reference/changelog/2023/8/15", "v4/docs/api-reference/changelog/2023/8/14", - "v4/docs/api-reference/changelog/2023/7", "v4/docs/api-reference/changelog/2023/7/30", "v4/docs/api-reference/changelog/2023/7/25", "v4/docs/api-reference/changelog/2023/7/24", @@ -419,18 +390,13 @@ "v4/docs/api-reference/changelog/2023/7/7", "v4/docs/api-reference/changelog/2023/7/5", "v4/docs/api-reference/changelog/2023/7/3", - "v4/docs/api-reference/changelog/2023/6", "v4/docs/api-reference/changelog/2023/6/27", "v4/docs/api-reference/changelog/2023/6/20", "v4/docs/api-reference/changelog/2023/6/13", - "v4/docs/api-reference/changelog/2023/5", "v4/docs/api-reference/changelog/2023/5/23", "v4/docs/api-reference/changelog/2023/5/17", - "v4/docs/api-reference/changelog/2023/4", "v4/docs/api-reference/changelog/2023/4/3", - "v4/docs/api-reference/changelog/2023/3", "v4/docs/api-reference/changelog/2023/3/30", "v4/docs/api-reference/changelog/2023/3/2", - "v4/docs/api-reference/changelog/2023/2", "v4/docs/api-reference/changelog/2023/2/20" ] \ No newline at end of file diff --git a/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugsWithContent.json b/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugsWithContent.json index 7cc5237240..083eebc62a 100644 --- a/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugsWithContent.json +++ b/packages/fdr-sdk/src/navigation/__test__/output/humanloop/slugsWithContent.json @@ -120,8 +120,6 @@ "docs/api-reference/sessions/create", "docs/api-reference/sessions/get", "docs/api-reference/changelog", - "docs/api-reference/changelog/2024", - "docs/api-reference/changelog/2024/4", "docs/api-reference/changelog/2024/4/30", "docs/api-reference/changelog/2024/4/26", "docs/api-reference/changelog/2024/4/23", @@ -129,32 +127,26 @@ "docs/api-reference/changelog/2024/4/16", "docs/api-reference/changelog/2024/4/13", "docs/api-reference/changelog/2024/4/5", - "docs/api-reference/changelog/2024/3", "docs/api-reference/changelog/2024/3/25", "docs/api-reference/changelog/2024/3/18", "docs/api-reference/changelog/2024/3/7", "docs/api-reference/changelog/2024/3/6", - "docs/api-reference/changelog/2024/2", "docs/api-reference/changelog/2024/2/26", "docs/api-reference/changelog/2024/2/14", "docs/api-reference/changelog/2024/2/13", "docs/api-reference/changelog/2024/2/9", "docs/api-reference/changelog/2024/2/8", "docs/api-reference/changelog/2024/2/2", - "docs/api-reference/changelog/2024/1", "docs/api-reference/changelog/2024/1/30", "docs/api-reference/changelog/2024/1/19", "docs/api-reference/changelog/2024/1/12", "docs/api-reference/changelog/2024/1/11", - "docs/api-reference/changelog/2023", - "docs/api-reference/changelog/2023/12", "docs/api-reference/changelog/2023/12/22", "docs/api-reference/changelog/2023/12/21", "docs/api-reference/changelog/2023/12/13", "docs/api-reference/changelog/2023/12/12", "docs/api-reference/changelog/2023/12/5", "docs/api-reference/changelog/2023/12/4", - "docs/api-reference/changelog/2023/11", "docs/api-reference/changelog/2023/11/28", "docs/api-reference/changelog/2023/11/22", "docs/api-reference/changelog/2023/11/21", @@ -164,20 +156,16 @@ "docs/api-reference/changelog/2023/11/9", "docs/api-reference/changelog/2023/11/8", "docs/api-reference/changelog/2023/11/1", - "docs/api-reference/changelog/2023/10", "docs/api-reference/changelog/2023/10/30", "docs/api-reference/changelog/2023/10/17", "docs/api-reference/changelog/2023/10/16", "docs/api-reference/changelog/2023/10/10", - "docs/api-reference/changelog/2023/9", "docs/api-reference/changelog/2023/9/15", "docs/api-reference/changelog/2023/9/13", - "docs/api-reference/changelog/2023/8", "docs/api-reference/changelog/2023/8/31", "docs/api-reference/changelog/2023/8/21", "docs/api-reference/changelog/2023/8/15", "docs/api-reference/changelog/2023/8/14", - "docs/api-reference/changelog/2023/7", "docs/api-reference/changelog/2023/7/30", "docs/api-reference/changelog/2023/7/25", "docs/api-reference/changelog/2023/7/24", @@ -185,19 +173,14 @@ "docs/api-reference/changelog/2023/7/7", "docs/api-reference/changelog/2023/7/5", "docs/api-reference/changelog/2023/7/3", - "docs/api-reference/changelog/2023/6", "docs/api-reference/changelog/2023/6/27", "docs/api-reference/changelog/2023/6/20", "docs/api-reference/changelog/2023/6/13", - "docs/api-reference/changelog/2023/5", "docs/api-reference/changelog/2023/5/23", "docs/api-reference/changelog/2023/5/17", - "docs/api-reference/changelog/2023/4", "docs/api-reference/changelog/2023/4/3", - "docs/api-reference/changelog/2023/3", "docs/api-reference/changelog/2023/3/30", "docs/api-reference/changelog/2023/3/2", - "docs/api-reference/changelog/2023/2", "docs/api-reference/changelog/2023/2/20", "v4/docs/overview", "v4/docs/why-humanloop", @@ -320,8 +303,6 @@ "v4/docs/api-reference/sessions/create", "v4/docs/api-reference/sessions/get", "v4/docs/api-reference/changelog", - "v4/docs/api-reference/changelog/2024", - "v4/docs/api-reference/changelog/2024/4", "v4/docs/api-reference/changelog/2024/4/30", "v4/docs/api-reference/changelog/2024/4/26", "v4/docs/api-reference/changelog/2024/4/23", @@ -329,32 +310,26 @@ "v4/docs/api-reference/changelog/2024/4/16", "v4/docs/api-reference/changelog/2024/4/13", "v4/docs/api-reference/changelog/2024/4/5", - "v4/docs/api-reference/changelog/2024/3", "v4/docs/api-reference/changelog/2024/3/25", "v4/docs/api-reference/changelog/2024/3/18", "v4/docs/api-reference/changelog/2024/3/7", "v4/docs/api-reference/changelog/2024/3/6", - "v4/docs/api-reference/changelog/2024/2", "v4/docs/api-reference/changelog/2024/2/26", "v4/docs/api-reference/changelog/2024/2/14", "v4/docs/api-reference/changelog/2024/2/13", "v4/docs/api-reference/changelog/2024/2/9", "v4/docs/api-reference/changelog/2024/2/8", "v4/docs/api-reference/changelog/2024/2/2", - "v4/docs/api-reference/changelog/2024/1", "v4/docs/api-reference/changelog/2024/1/30", "v4/docs/api-reference/changelog/2024/1/19", "v4/docs/api-reference/changelog/2024/1/12", "v4/docs/api-reference/changelog/2024/1/11", - "v4/docs/api-reference/changelog/2023", - "v4/docs/api-reference/changelog/2023/12", "v4/docs/api-reference/changelog/2023/12/22", "v4/docs/api-reference/changelog/2023/12/21", "v4/docs/api-reference/changelog/2023/12/13", "v4/docs/api-reference/changelog/2023/12/12", "v4/docs/api-reference/changelog/2023/12/5", "v4/docs/api-reference/changelog/2023/12/4", - "v4/docs/api-reference/changelog/2023/11", "v4/docs/api-reference/changelog/2023/11/28", "v4/docs/api-reference/changelog/2023/11/22", "v4/docs/api-reference/changelog/2023/11/21", @@ -364,20 +339,16 @@ "v4/docs/api-reference/changelog/2023/11/9", "v4/docs/api-reference/changelog/2023/11/8", "v4/docs/api-reference/changelog/2023/11/1", - "v4/docs/api-reference/changelog/2023/10", "v4/docs/api-reference/changelog/2023/10/30", "v4/docs/api-reference/changelog/2023/10/17", "v4/docs/api-reference/changelog/2023/10/16", "v4/docs/api-reference/changelog/2023/10/10", - "v4/docs/api-reference/changelog/2023/9", "v4/docs/api-reference/changelog/2023/9/15", "v4/docs/api-reference/changelog/2023/9/13", - "v4/docs/api-reference/changelog/2023/8", "v4/docs/api-reference/changelog/2023/8/31", "v4/docs/api-reference/changelog/2023/8/21", "v4/docs/api-reference/changelog/2023/8/15", "v4/docs/api-reference/changelog/2023/8/14", - "v4/docs/api-reference/changelog/2023/7", "v4/docs/api-reference/changelog/2023/7/30", "v4/docs/api-reference/changelog/2023/7/25", "v4/docs/api-reference/changelog/2023/7/24", @@ -385,18 +356,13 @@ "v4/docs/api-reference/changelog/2023/7/7", "v4/docs/api-reference/changelog/2023/7/5", "v4/docs/api-reference/changelog/2023/7/3", - "v4/docs/api-reference/changelog/2023/6", "v4/docs/api-reference/changelog/2023/6/27", "v4/docs/api-reference/changelog/2023/6/20", "v4/docs/api-reference/changelog/2023/6/13", - "v4/docs/api-reference/changelog/2023/5", "v4/docs/api-reference/changelog/2023/5/23", "v4/docs/api-reference/changelog/2023/5/17", - "v4/docs/api-reference/changelog/2023/4", "v4/docs/api-reference/changelog/2023/4/3", - "v4/docs/api-reference/changelog/2023/3", "v4/docs/api-reference/changelog/2023/3/30", "v4/docs/api-reference/changelog/2023/3/2", - "v4/docs/api-reference/changelog/2023/2", "v4/docs/api-reference/changelog/2023/2/20" ] \ No newline at end of file diff --git a/packages/fdr-sdk/src/navigation/converters/NavigationConfigConverter.ts b/packages/fdr-sdk/src/navigation/converters/NavigationConfigConverter.ts index e52dca7e9b..fa4336b3b6 100644 --- a/packages/fdr-sdk/src/navigation/converters/NavigationConfigConverter.ts +++ b/packages/fdr-sdk/src/navigation/converters/NavigationConfigConverter.ts @@ -97,7 +97,7 @@ export class NavigationConfigConverter { id, type: "tabbed", children: tabbed.tabs.map((tab): FernNavigation.TabChild => { - if (tab.type === "group" || (tab.type == null && Array.isArray(tab.items))) { + if (tab.type === "group" || tab.type == null) { return this.#idgen.with(tab.urlSlug, (id) => { const slug = parentSlug.apply(tab); const child: FernNavigation.SidebarRootNode = this.#idgen.with(tab.urlSlug, (id) => ({ @@ -130,6 +130,8 @@ export class NavigationConfigConverter { } else if (tab.type === "changelog") { const slug = parentSlug.apply(tab); return ChangelogNavigationConverter.convert(tab, slug, this.#idgen); + } else if (tab.type === "changelogV3") { + return tab.node as unknown as FernNavigation.ChangelogNode; } else { assertNever(tab as never); } @@ -235,6 +237,7 @@ export class NavigationConfigConverter { changelog: (changelog) => ChangelogNavigationConverter.convert(changelog, parentSlug, this.#idgen), // Note: apiSection.node is imported from `navigation`, and is guaranteed to be a FernNavigation.ApiReferenceNode apiV2: (apiSection) => apiSection.node as unknown as FernNavigation.ApiReferenceNode, + changelogV3: (changelog) => changelog.node as unknown as FernNavigation.ChangelogNode, _other: (value) => assertNever(value as never), }); } diff --git a/packages/fdr-sdk/src/navigation/utils/findNode.ts b/packages/fdr-sdk/src/navigation/utils/findNode.ts index 9c28ffc692..6057be7f5e 100644 --- a/packages/fdr-sdk/src/navigation/utils/findNode.ts +++ b/packages/fdr-sdk/src/navigation/utils/findNode.ts @@ -12,6 +12,7 @@ export declare namespace Node { interface Found { type: "found"; node: NavigationNodePage; + parents: NavigationNode[]; breadcrumb: string[]; root: FernNavigation.RootNode; versions: FernNavigation.VersionNode[]; @@ -60,6 +61,7 @@ export function findNode(root: FernNavigation.RootNode, slug: string[]): Node { type: "found", node: found.node, breadcrumb: createBreadcrumb(found.parents), + parents: found.parents, root, // this is used to render the version switcher versions: collector.getVersionNodes().map((node) => { diff --git a/packages/ui/app/src/components/BottomNavigationButtons.tsx b/packages/ui/app/src/components/BottomNavigationButtons.tsx index 5766dee413..8c794726b9 100644 --- a/packages/ui/app/src/components/BottomNavigationButtons.tsx +++ b/packages/ui/app/src/components/BottomNavigationButtons.tsx @@ -4,6 +4,10 @@ import { BottomNavigationButton } from "./BottomNavigationButton"; export const BottomNavigationButtons: FC<{ showPrev?: boolean }> = ({ showPrev = false }) => { const { resolvedPath } = useNavigationContext(); + if (resolvedPath.type === "changelog") { + return null; + } + const { prev: leftNeighbor, next: rightNeighbor } = resolvedPath.neighbors; if (leftNeighbor == null && rightNeighbor == null) { diff --git a/packages/ui/app/src/docs/ChangelogEntryPage.tsx b/packages/ui/app/src/docs/ChangelogEntryPage.tsx new file mode 100644 index 0000000000..278a55b81b --- /dev/null +++ b/packages/ui/app/src/docs/ChangelogEntryPage.tsx @@ -0,0 +1,55 @@ +import { ReactElement } from "react"; +import { BottomNavigationButtons } from "../components/BottomNavigationButtons"; +import { FernLink } from "../components/FernLink"; +import { MdxContent } from "../mdx/MdxContent"; +import { ResolvedPath } from "../resolver/ResolvedPath"; + +export function ChangelogEntryPage({ resolvedPath }: { resolvedPath: ResolvedPath.ChangelogEntryPage }): ReactElement { + const page = resolvedPath.pages[resolvedPath.node.pageId]; + const title = typeof page !== "string" ? page?.frontmatter.title : undefined; + const excerpt = typeof page !== "string" ? page?.frontmatter.subtitle ?? page.frontmatter.excerpt : undefined; + return ( +
+
+
+
+
+
+
+
+ + + {resolvedPath.changelogTitle} + + +
+ +

+ {title ?? resolvedPath.node.title} +

+
+ + {excerpt != null && ( +
+ +
+ )} +
+ +
+
+ {/* + {resolvedPath.node.title} + */} +
+
+ +
+ +
+
+
+
+
+ ); +} diff --git a/packages/ui/app/src/docs/ChangelogPage.tsx b/packages/ui/app/src/docs/ChangelogPage.tsx index 9290871a52..c83124c39d 100644 --- a/packages/ui/app/src/docs/ChangelogPage.tsx +++ b/packages/ui/app/src/docs/ChangelogPage.tsx @@ -1,64 +1,58 @@ -import { ReactElement } from "react"; -import { BottomNavigationButtons } from "../components/BottomNavigationButtons"; +import { Fragment, ReactElement } from "react"; +import { FernLink } from "../components/FernLink"; import { CustomDocsPageHeader } from "../custom-docs-page/CustomDocsPage"; import { MdxContent } from "../mdx/MdxContent"; import { ResolvedPath } from "../resolver/ResolvedPath"; export function ChangelogPage({ resolvedPath }: { resolvedPath: ResolvedPath.ChangelogPage }): ReactElement { + const overview = + resolvedPath.node.overviewPageId != null ? resolvedPath.pages[resolvedPath.node.overviewPageId] : undefined; return (
- {resolvedPath.markdown != null && ( -
- -
+ {overview != null && ( +
+
)}
- {resolvedPath.items - .sort( - (initial, previous) => new Date(previous.date).getTime() - new Date(initial.date).getTime(), - ) - .map((item) => ( -
-
-
-
-
-
-
- { -

- {(typeof item.markdown !== "string" - ? item.markdown.frontmatter.title - : undefined) ?? item.dateString} -

- } - -
-
-
- {item.dateString} -
-
- ))} + {resolvedPath.node.children.flatMap((year) => + year.children.flatMap((month) => + month.children.map((entry) => { + const page = resolvedPath.pages[entry.pageId]; + const title = typeof page !== "string" ? page?.frontmatter.title : undefined; + return ( + +
+
+
+ {title != null &&

{title}

} + +
+
+ + {entry.title} + +
+
+
+ ); + }), + ), + )} -
+ {/*
-
-
+
*/} +
diff --git a/packages/ui/app/src/docs/Docs.tsx b/packages/ui/app/src/docs/Docs.tsx index aa59131cce..abcca30e99 100644 --- a/packages/ui/app/src/docs/Docs.tsx +++ b/packages/ui/app/src/docs/Docs.tsx @@ -1,12 +1,14 @@ import { DocsV1Read } from "@fern-api/fdr-sdk"; import { PLATFORM } from "@fern-ui/core-utils"; import { useKeyboardCommand, useKeyboardPress } from "@fern-ui/react-commons"; +import clsx from "clsx"; import dynamic from "next/dynamic"; import { memo } from "react"; import { PlaygroundContextProvider } from "../api-playground/PlaygroundContext"; import { useFeatureFlags } from "../contexts/FeatureFlagContext"; import { useDocsContext } from "../contexts/docs-context/useDocsContext"; import { useLayoutBreakpoint } from "../contexts/layout-breakpoint/useLayoutBreakpoint"; +import { useNavigationContext } from "../contexts/navigation-context"; import { FeedbackPopover } from "../custom-docs-page/FeedbackPopover"; import { useCreateSearchService } from "../services/useSearchService"; import { BuiltWithFern } from "../sidebar/BuiltWithFern"; @@ -29,6 +31,7 @@ export const Docs: React.FC = memo(function UnmemoizedDocs const { layout, colors, currentVersionId } = useDocsContext(); const openSearchDialog = useOpenSearchDialog(); const { isInlineFeedbackEnabled } = useFeatureFlags(); + const { resolvedPath } = useNavigationContext(); // set up message handler to listen for messages from custom scripts useMessageHandler(); @@ -78,11 +81,14 @@ export const Docs: React.FC = memo(function UnmemoizedDocs `}