Skip to content

Commit

Permalink
fix bundle build
Browse files Browse the repository at this point in the history
  • Loading branch information
RohinBhargava committed Dec 20, 2024
1 parent e80d2fd commit c41cf92
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions packages/fern-docs/bundle/src/server/getMarkdownForPath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ export function endpointDefinitionToMarkdown(
[
"```http",
`${endpoint.method} ${endpoint.environments?.find((env) => env.id === endpoint.defaultEnvironment)?.baseUrl ?? endpoint.environments?.[0]?.baseUrl ?? ""}${ApiDefinition.toCurlyBraceEndpointPathLiteral(endpoint.path)}`,
endpoint.request != null
? `Content-Type: ${endpoint.request.contentType}`
endpoint.requests?.[0] != null
? `Content-Type: ${endpoint.requests[0].contentType}`
: undefined,
"```",
]
Expand Down Expand Up @@ -162,12 +162,12 @@ export function endpointDefinitionToMarkdown(
`- ${pascalCaseHeaderKey(param.key)}${getShorthand(param.valueShape, types, param.description)}`
)
.join("\n"),
endpoint.request != null ? "## Request Body" : undefined,
typeof endpoint.request?.description === "string"
? endpoint.request?.description
endpoint.requests?.[0] != null ? "## Request Body" : undefined,
typeof endpoint.requests?.[0]?.description === "string"
? endpoint.requests?.[0]?.description
: undefined,
endpoint.request != null
? `\`\`\`json\n${JSON.stringify(endpoint.request.body)}\n\`\`\``
endpoint.requests?.[0] != null
? `\`\`\`json\n${JSON.stringify(endpoint.requests[0].body)}\n\`\`\``
: undefined,
endpoint.responseHeaders?.length ? "## Response Headers" : undefined,
endpoint.responseHeaders
Expand All @@ -176,13 +176,13 @@ export function endpointDefinitionToMarkdown(
`- ${pascalCaseHeaderKey(header.key)}${getShorthand(header.valueShape, types, header.description)}`
)
.join("\n"),
endpoint.response != null || endpoint.errors?.length
endpoint.responses?.[0] != null || endpoint.errors?.length
? "## Response Body"
: undefined,
endpoint.response != null || endpoint.errors?.length
endpoint.responses?.[0] != null || endpoint.errors?.length
? [
typeof endpoint.response?.description === "string"
? `- ${endpoint.response.statusCode}: ${endpoint.response?.description}`
typeof endpoint.responses?.[0]?.description === "string"
? `- ${endpoint.responses?.[0]?.statusCode}: ${endpoint.responses?.[0]?.description}`
: undefined,
...(endpoint.errors
?.filter((error) => typeof error.description === "string")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function MaybeEnvironmentDropdown({
// TODO: clean up this component
useEffect(() => {
if (
// eslint-disable-next-line @typescript-eslint/prefer-optional-chain
url &&

Check failure on line 68 in packages/fern-docs/ui/src/components/MaybeEnvironmentDropdown.tsx

View workflow job for this annotation

GitHub Actions / lint

Prefer using an optional chain expression instead, as it's more concise and easier to read
url.host &&
url.host !== "" &&
Expand Down

0 comments on commit c41cf92

Please sign in to comment.