Skip to content

Commit f9283ea

Browse files
authored
Merge pull request #493 from shapehq/develop
Merge develop into main
2 parents 97a7356 + 3798a44 commit f9283ea

File tree

9 files changed

+6808
-12151
lines changed

9 files changed

+6808
-12151
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121
- name: Setup Environment
2222
run: cp .env.example .env.local
2323
- name: Install Dependencies

.github/workflows/run-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Setup Node.js
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version: 20
20+
node-version: 22
2121
- name: Install Dependencies
2222
run: npm install
2323
- name: Run Unit Tests

package-lock.json

Lines changed: 6744 additions & 12096 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
"version": "1.0.0",
44
"private": true,
55
"engines": {
6-
"node": "20.8.1",
7-
"npm": "10.1.0"
6+
"node": "22.13.1",
7+
"npm": "11.1.0"
88
},
99
"scripts": {
1010
"dev": "next dev",
@@ -18,28 +18,27 @@
1818
"@emotion/react": "^11.13.3",
1919
"@emotion/styled": "^11.13.0",
2020
"@fontsource/poppins": "^5.1.0",
21-
"@fortawesome/fontawesome-svg-core": "^6.7.1",
22-
"@fortawesome/free-brands-svg-icons": "^6.7.1",
23-
"@fortawesome/free-regular-svg-icons": "^6.7.1",
24-
"@fortawesome/free-solid-svg-icons": "^6.7.1",
21+
"@fortawesome/fontawesome-svg-core": "^6.7.2",
22+
"@fortawesome/free-brands-svg-icons": "^6.7.2",
23+
"@fortawesome/free-regular-svg-icons": "^6.7.2",
24+
"@fortawesome/free-solid-svg-icons": "^6.7.2",
2525
"@fortawesome/react-fontawesome": "^0.2.2",
26-
"@mui/icons-material": "^6.1.8",
26+
"@mui/icons-material": "^6.4.2",
2727
"@mui/material": "^6.0.1",
28-
"@octokit/auth-app": "^7.1.3",
29-
"@octokit/core": "^6.1.2",
30-
"@octokit/webhooks": "^13.3.0",
31-
"@stoplight/elements": "^8.4.5",
28+
"@octokit/auth-app": "^7.1.4",
29+
"@octokit/core": "^6.1.3",
30+
"@octokit/webhooks": "~13.4.3",
3231
"core-js": "^3.39.0",
3332
"encoding": "^0.1.13",
3433
"figma-squircle": "^1.1.0",
3534
"install": "^0.13.0",
3635
"ioredis": "^5.4.1",
3736
"mobx": "^6.13.5",
38-
"next": "^14.2.13",
37+
"next": "^15.1.6",
3938
"next-auth": "^5.0.0-beta.25",
4039
"npm": "^10.9.0",
4140
"nprogress": "^0.2.0",
42-
"octokit": "^4.0.2",
41+
"octokit": "^4.1.0",
4342
"react": "^18.3.1",
4443
"react-dom": "^18.3.1",
4544
"redis-semaphore": "^5.6.0",
@@ -49,7 +48,7 @@
4948
"swagger-ui-react": "^5.17.14",
5049
"swr": "^2.2.5",
5150
"usehooks-ts": "^3.1.0",
52-
"yaml": "^2.6.0",
51+
"yaml": "^2.7.0",
5352
"zod": "^3.23.8"
5453
},
5554
"devDependencies": {
@@ -61,11 +60,11 @@
6160
"@types/react": "^18.3.12",
6261
"@types/react-dom": "^18.3.0",
6362
"@types/swagger-ui-react": "^4.18.3",
64-
"@typescript-eslint/eslint-plugin": "^8.15.0",
65-
"@typescript-eslint/parser": "^8.15.0",
63+
"@typescript-eslint/eslint-plugin": "^8.22.0",
64+
"@typescript-eslint/parser": "^8.22.0",
6665
"autoprefixer": "^10.4.20",
67-
"eslint": "^8.57.1",
68-
"eslint-config-next": "^14.2.14",
66+
"eslint": "^9.19.0",
67+
"eslint-config-next": "^15.1.6",
6968
"pg": "^8.13.1",
7069
"postcss": "^8.4.41",
7170
"tailwindcss": "^3.4.13",

src/app/api/blob/[owner]/[repository]/[...path]/route.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,16 @@ interface GetBlobParams {
88
path: [string]
99
}
1010

11-
export async function GET(req: NextRequest, { params }: { params: GetBlobParams }) {
11+
export async function GET(req: NextRequest, { params }: { params: Promise<GetBlobParams> }) {
1212
const isAuthenticated = await session.getIsAuthenticated()
1313
if (!isAuthenticated) {
1414
return makeUnauthenticatedAPIErrorResponse()
1515
}
16-
const path = params.path.join("/")
16+
const { path: paramsPath, owner, repository } = await params
17+
const path = paramsPath.join("/")
1718
const item = await userGitHubClient.getRepositoryContent({
18-
repositoryOwner: params.owner,
19-
repositoryName: params.repository,
19+
repositoryOwner: owner,
20+
repositoryName: repository,
2021
path: path,
2122
ref: req.nextUrl.searchParams.get("ref") ?? undefined
2223
})

src/app/api/remotes/[encodedRemoteConfig]/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ interface RemoteSpecificationParams {
77
encodedRemoteConfig: string
88
}
99

10-
export async function GET(_req: NextRequest, { params }: { params: RemoteSpecificationParams }) {
10+
export async function GET(_req: NextRequest, { params }: { params: Promise<RemoteSpecificationParams> }) {
1111
const isAuthenticated = await session.getIsAuthenticated()
1212
if (!isAuthenticated) {
1313
return makeUnauthenticatedAPIErrorResponse()
1414
}
1515

16-
const remoteConfig = remoteConfigEncoder.decode(params.encodedRemoteConfig)
16+
const { encodedRemoteConfig } = await params
17+
const remoteConfig = remoteConfigEncoder.decode(encodedRemoteConfig)
1718

1819
let url: URL
1920
try {

src/app/documentation-viewer/page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ type SearchParams = { visualizer: string, url: string }
55
export default async function Page({
66
searchParams
77
}: {
8-
searchParams: SearchParams
8+
searchParams: Promise<SearchParams>
99
}) {
10+
const { visualizer, url } = await searchParams
1011
return (
1112
<DocumentationViewer
12-
visualizer={parseInt(searchParams.visualizer)}
13-
url={searchParams.url}
13+
visualizer={parseInt(visualizer)}
14+
url={url}
1415
/>
1516
)
1617
}

src/features/docs/view/Stoplight.tsx

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
import { useEffect, useState } from "react"
1+
import { useEffect, useState, createElement } from "react"
22
import { Box } from "@mui/material"
3-
import { API } from "@stoplight/elements"
4-
import "@stoplight/elements/styles.min.css"
53
import LoadingWrapper from "./LoadingWrapper"
64

75
const Stoplight = ({ url }: { url: string }) => {
@@ -27,7 +25,21 @@ const Stoplight = ({ url }: { url: string }) => {
2725
)
2826
}
2927

30-
const ResponsiveStoplight = ({ document }: { document: string }) => {
28+
const ResponsiveStoplight = ({ document: apiDescriptionDocument }: { document: string }) => {
29+
useEffect(() => {
30+
const script = document.createElement("script")
31+
script.src = "https://unpkg.com/@stoplight/[email protected]/web-components.min.js"
32+
script.async = true
33+
document.body.appendChild(script)
34+
const link = document.createElement("link")
35+
link.rel = "stylesheet"
36+
link.href = "https://unpkg.com/@stoplight/[email protected]/styles.min.css"
37+
document.head.appendChild(link)
38+
return () => {
39+
document.body.removeChild(script)
40+
document.head.removeChild(link)
41+
}
42+
}, [])
3143
return (
3244
<>
3345
<Box sx={{
@@ -36,25 +48,31 @@ const ResponsiveStoplight = ({ document }: { document: string }) => {
3648
height: "100%",
3749
padding: 2
3850
}}>
39-
<API
40-
apiDescriptionDocument={document}
41-
router="hash"
42-
layout="stacked"
43-
/>
51+
<ElementsAPI document={apiDescriptionDocument} layout="stacked" />
4452
</Box>
4553
<Box sx={{
4654
display: { xs: "none", sm: "block" },
4755
width: "100%",
4856
height: "100%",
4957
}}>
50-
<API
51-
apiDescriptionDocument={document}
52-
router="hash"
53-
layout="sidebar"
54-
/>
58+
<ElementsAPI document={apiDescriptionDocument} layout="sidebar" />
5559
</Box>
5660
</>
5761
)
58-
}
62+
}
63+
64+
const ElementsAPI = ({
65+
document: apiDescriptionDocument,
66+
layout
67+
}: {
68+
document: string,
69+
layout: "sidebar" | "stacked"
70+
}) => {
71+
return createElement("elements-api", {
72+
apiDescriptionDocument,
73+
router: "hash",
74+
layout: layout
75+
})
76+
}
5977

6078
export default Stoplight

types/@stoplight-elements.d.ts

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)