Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
dsinghvi committed Jan 16, 2025
1 parent 61d61c1 commit 4bb008c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ export class ApiReferenceNavigationConverter {
overviewPageId,
noindex,
paginated:
this.paginated ??
(this.apiSection.longScrolling === false ? true : undefined),
this.paginated ?? (!this.apiSection.longScrolling ? true : undefined),
slug: slug.get(),
icon: this.apiSection.icon,
hidden: this.apiSection.hidden,
Expand All @@ -116,6 +115,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
}
Expand Down Expand Up @@ -158,6 +158,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
}
Expand All @@ -183,6 +184,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
}));
}

Expand All @@ -205,6 +207,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
}));
}

Expand Down Expand Up @@ -271,7 +274,6 @@ export class ApiReferenceNavigationConverter {
package_.subpackages.forEach((subpackageId) => {
const subpackage = this.api.subpackages[subpackageId];
if (subpackage == null) {
// eslint-disable-next-line no-console
console.error(
`Subpackage ${subpackageId} not found in ${this.apiDefinitionId}`
);
Expand Down Expand Up @@ -307,6 +309,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
}
);
Expand Down Expand Up @@ -385,14 +388,14 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
})
);
},
endpointId: (oldEndpointId) => {
const endpoint = endpoints.get(oldEndpointId.value);
if (endpoint == null) {
// eslint-disable-next-line no-console
console.error(
`Endpoint ${oldEndpointId.value} not found in ${targetSubpackageId}`
);
Expand All @@ -410,7 +413,6 @@ export class ApiReferenceNavigationConverter {
websocketId: (oldWebSocketId) => {
const webSocket = webSockets.get(oldWebSocketId.value);
if (webSocket == null) {
// eslint-disable-next-line no-console
console.error(
`WebSocket ${oldWebSocketId.value} not found in ${targetSubpackageId}`
);
Expand All @@ -428,7 +430,6 @@ export class ApiReferenceNavigationConverter {
webhookId: (oldWebhookId) => {
const webhook = webhooks.get(oldWebhookId.value);
if (webhook == null) {
// eslint-disable-next-line no-console
console.error(
`Webhook ${oldWebhookId.value} not found in ${targetSubpackageId}`
);
Expand All @@ -446,7 +447,6 @@ export class ApiReferenceNavigationConverter {
subpackage: ({ subpackageId, items, summaryPageId }) => {
const subpackage = this.api.subpackages[subpackageId];
if (subpackage == null) {
// eslint-disable-next-line no-console
console.error(
`Subpackage ${subpackageId} not found in ${targetSubpackageId}`
);
Expand Down Expand Up @@ -494,6 +494,7 @@ export class ApiReferenceNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
});
});
},
Expand Down Expand Up @@ -537,7 +538,7 @@ export class ApiReferenceNavigationConverter {

if (
existing == null ||
toRet.indexOf(existing) === -1 ||
!toRet.includes(existing) ||
existing.isResponseStream === child.isResponseStream
) {
toRet.push(child);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class ChangelogNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
}
Expand Down Expand Up @@ -102,6 +103,7 @@ export class ChangelogNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
})
),
Expand Down Expand Up @@ -129,6 +131,7 @@ export class ChangelogNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
}))
),
"month",
Expand Down Expand Up @@ -157,6 +160,7 @@ export class ChangelogNavigationConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,15 +92,14 @@ export class NavigationConfigConverter {
viewers: undefined,
orphaned: undefined,
roles: undefined,
featureFlags: undefined,
};

// tag all children of hidden nodes as hidden
FernNavigation.V1.traverseDF(toRet, (node, parents) => {
if (
FernNavigation.V1.hasMetadata(node) &&
parents.some(
(p) => FernNavigation.V1.hasMetadata(p) && p.hidden === true
)
parents.some((p) => FernNavigation.V1.hasMetadata(p) && p.hidden)
) {
node.hidden = true;
}
Expand Down Expand Up @@ -145,6 +144,7 @@ export class NavigationConfigConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
}
);
Expand Down Expand Up @@ -193,6 +193,7 @@ export class NavigationConfigConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
} else if (tab.type === "link") {
Expand All @@ -215,7 +216,7 @@ export class NavigationConfigConverter {
} else if (tab.type === "changelogV3") {
return tab.node as unknown as FernNavigation.V1.ChangelogNode;
} else {
assertNever(tab as never);
assertNever(tab);
}
}),
}),
Expand Down Expand Up @@ -252,11 +253,13 @@ export class NavigationConfigConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
}),
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
});
}
Expand Down Expand Up @@ -318,6 +321,7 @@ export class NavigationConfigConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
}),
link: (link) =>
Expand Down Expand Up @@ -368,6 +372,7 @@ export class NavigationConfigConverter {
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
};
}),
api: (apiSection) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ describe("Grouping Functions", () => {
viewers: undefined,
orphaned: undefined,
noindex: undefined,
featureFlags: undefined,
},
{
id: FernNavigation.V1.NodeId("entry-2"),
Expand All @@ -34,6 +35,7 @@ describe("Grouping Functions", () => {
viewers: undefined,
orphaned: undefined,
noindex: undefined,
featureFlags: undefined,
},
{
id: FernNavigation.V1.NodeId("entry-3"),
Expand All @@ -48,6 +50,7 @@ describe("Grouping Functions", () => {
viewers: undefined,
orphaned: undefined,
noindex: undefined,
featureFlags: undefined,
},
{
id: FernNavigation.V1.NodeId("entry-4"),
Expand All @@ -62,6 +65,7 @@ describe("Grouping Functions", () => {
viewers: undefined,
orphaned: undefined,
noindex: undefined,
featureFlags: undefined,
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export function toRootNode(
authed: undefined,
viewers: undefined,
orphaned: undefined,
featureFlags: undefined,
id: FernNavigation.V1.NodeId("root"),
pointsTo: undefined,
roles: undefined,
Expand Down

0 comments on commit 4bb008c

Please sign in to comment.