Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/ws-8.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dubwub authored Oct 25, 2024
2 parents 64e9d86 + 2cfc5a5 commit 51545a5
Show file tree
Hide file tree
Showing 58 changed files with 3,159,812 additions and 4,187 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:

jobs:
playwright:
runs-on: ubuntu-latest
runs-on: macos-latest
permissions: write-all # required for the playwright-report-summary action
if: inputs.deployment_url != ''
steps:
Expand All @@ -46,12 +46,19 @@ jobs:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}

- name: Run Playwright tests
run: pnpm exec playwright test playwright --workers 6 --reporter json
run: pnpm exec playwright test playwright --workers 6 --reporter json,html
env:
PLAYWRIGHT_JSON_OUTPUT_NAME: results.json
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
DEPLOYMENT_URL: ${{ inputs.deployment_url }}

- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

- uses: daun/playwright-report-summary@v3
if: always()
with:
Expand Down
5 changes: 0 additions & 5 deletions fern/apis/fdr/definition/docs/v1/commons/commons.yml
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,6 @@ types:
- fallback
- optional

# Playground
PlaygroundConfig:
properties:
oauth: optional<boolean>

# Deprecated

ThemedFileId:
Expand Down
3 changes: 0 additions & 3 deletions fern/apis/fdr/definition/docs/v1/db/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ types:
css: optional<commons.CssConfig>
js: optional<commons.JsConfig>

# playground
playground: optional<commons.PlaygroundConfig>

# deprecated
logo:
type: optional<rootCommons.FileId>
Expand Down
3 changes: 0 additions & 3 deletions fern/apis/fdr/definition/docs/v1/read/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ types:
css: optional<commons.CssConfig>
js: optional<commons.JsConfig>

# playground
playground: optional<commons.PlaygroundConfig>

# deprecated
# backgroundImage:
# type: optional<rootCommons.FileId>
Expand Down
3 changes: 0 additions & 3 deletions fern/apis/fdr/definition/docs/v1/write/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,6 @@ types:
css: optional<commons.CssConfig>
js: optional<commons.JsConfig>

# playground
playground: optional<commons.PlaygroundConfig>

# deprecated
backgroundImage: optional<rootCommons.FileId>
logoV2: optional<commons.ThemedFileId>
Expand Down
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/navigation/latest/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ types:
A list of environment IDs that are allowed to be used in the playground.
If not provided, all environments are allowed. And if the provided list is empty, the playground should be disabled.
button: optional<PlaygroundButtonSettings>
limit-websocket-messages-per-connection: optional<integer>

PlaygroundButtonSettings:
properties:
Expand Down
1 change: 1 addition & 0 deletions fern/apis/fdr/definition/navigation/v1/__package__.yml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ types:
A list of environment IDs that are allowed to be used in the playground.
If not provided, all environments are allowed. And if the provided list is empty, the playground should be disabled.
button: optional<PlaygroundButtonSettings>
limit-websocket-messages-per-connection: optional<integer>

PlaygroundButtonSettings:
properties:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export class DefinitionObjectFactory {
integrations: undefined,
css: undefined,
js: undefined,
playground: undefined,
},
search: {
type: "singleAlgoliaIndex",
Expand Down

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export function convertDocsDefinitionToDb({
defaultLanguage: writeShape.config.defaultLanguage,
analyticsConfig: writeShape.config.analyticsConfig,
announcement: writeShape.config.announcement,
playground: writeShape.config.playground,
},
pages: writeShape.pages,
jsFiles: writeShape.jsFiles,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export function convertDbDocsConfigToRead({ dbShape }: { dbShape: DocsV1Db.DocsD
defaultLanguage: dbShape.defaultLanguage,
analyticsConfig: dbShape.analyticsConfig,
announcement: dbShape.announcement,
playground: dbShape.playground,
};
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { APIV1Read } from "@fern-api/fdr-sdk/client/types";
import { CopyToClipboardButton } from "@fern-ui/components";
import * as Accordion from "@radix-ui/react-accordion";
import cn from "clsx";
import { ArrowDown, ArrowUp, NavArrowDown } from "iconoir-react";
import { FC } from "react";
import { FernSyntaxHighlighter } from "../../syntax-highlighting/FernSyntaxHighlighter";
import { WebSocketMessage } from "./WebSocketMessages";

export interface WebSocketMessageAccordionItemProps {
message: WebSocketMessage;
index: number;
messagesLength: number;
}

export const WebsocketMessageAccordionItem: FC<WebSocketMessageAccordionItemProps> = ({
message,
index,
messagesLength,
}) => {
return (
<Accordion.Item value={index.toString()} key={index} className={cn("group relative")}>
<Accordion.Trigger
className={cn("fern-web-socket-trigger", {
"data-[state=open]:bg-tag-success": message.origin === APIV1Read.WebSocketMessageOrigin.Client,
"data-[state=open]:bg-tag-primary": message.origin === APIV1Read.WebSocketMessageOrigin.Server,
"data-[state=open]:bg-tag-default": message.origin == null,
})}
>
{message.origin === APIV1Read.WebSocketMessageOrigin.Client ? (
<span className="fern-web-socket-client">
<ArrowUp className="size-icon" />
</span>
) : message.origin === APIV1Read.WebSocketMessageOrigin.Server ? (
<span className="fern-web-socket-server">
<ArrowDown className="size-icon" />
</span>
) : null}
<span className="fern-web-socket-trigger-data">{JSON.stringify(message.data)}</span>
{message.displayName != null || message.type != null ? (
<span className="fern-web-socket-type">
<span className="fern-web-socket-badge">{message.displayName ?? message.type}</span>
</span>
) : null}

<CopyToClipboardButton
className="fern-web-socket-copy"
content={() => JSON.stringify(message.data, null, 2)}
onClick={(e) => e.stopPropagation()}
/>

<NavArrowDown className="fern-web-socket-chevron group-data-[state=open]:rotate-180" aria-hidden />
</Accordion.Trigger>
<Accordion.Content className="fern-web-socket-content">
<div className="group/cb-container relative">
<FernSyntaxHighlighter
className="w-0 min-w-full overflow-y-auto"
code={JSON.stringify(message.data, null, 2)}
language="json"
fontSize="sm"
/>
</div>
</Accordion.Content>
<div
className={cn(
"mx-px group-focus-within:ring-1 ring-transparent ring-inset absolute inset-0 pointer-events-none z-auto rounded-[inherit]",
{
"group-focus-within:ring-border-success":
message.origin === APIV1Read.WebSocketMessageOrigin.Client,
"group-focus-within:ring-border-primary":
message.origin === APIV1Read.WebSocketMessageOrigin.Server,
"group-focus-within:ring-default": message.origin == null,
"mb-px rounded-b-xl": index === messagesLength,
},
)}
/>
</Accordion.Item>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
@apply sticky top-0 z-10 backdrop-blur;

.fern-web-socket-client,
.fern-web-socket-server {
.fern-web-socket-server,
.fern-web-socket-end-sample {
@apply inline-block shrink-0 rounded-full p-0.5;
}

Expand All @@ -16,6 +17,10 @@
@apply t-accent-aaa bg-tag-primary;
}

.fern-web-socket-end-sample {
@apply t-danger bg-tag-danger;
}

.fern-web-socket-type {
@apply flex-1 inline-flex justify-end;

Expand Down
Loading

0 comments on commit 51545a5

Please sign in to comment.