chore: remove nextjs patch

This commit is contained in:
iCrawl
2023-11-11 19:19:14 +01:00
parent 5a4c9755c3
commit 2a25eeaf13
9 changed files with 955 additions and 822 deletions

View File

@@ -53,7 +53,7 @@
"ariakit": "2.0.0-next.44",
"cmdk": "^0.2.0",
"contentlayer": "^0.3.4",
"next": "14.0.2-canary.20",
"next": "14.0.3-canary.2",
"next-contentlayer": "^0.3.4",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -65,16 +65,16 @@
"sharp": "^0.32.6"
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.2-canary.20",
"@next/bundle-analyzer": "14.0.3-canary.2",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/html-escaper": "^3.0.2",
"@types/node": "18.18.8",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@unocss/eslint-plugin": "^0.57.2",
"@unocss/postcss": "^0.57.2",
"@unocss/reset": "^0.57.2",
"@unocss/eslint-plugin": "^0.57.3",
"@unocss/postcss": "^0.57.3",
"@unocss/reset": "^0.57.3",
"@vitejs/plugin-react": "^4.1.1",
"@vitest/coverage-v8": "^0.34.6",
"cross-env": "^7.0.3",
@@ -89,8 +89,8 @@
"prettier": "^3.0.3",
"turbo": "^1.10.17-canary.0",
"typescript": "^5.2.2",
"unocss": "^0.57.2",
"vercel": "^32.5.2",
"unocss": "^0.57.3",
"vercel": "^32.5.3",
"vitest": "^0.34.6"
},
"engines": {

View File

@@ -62,7 +62,7 @@
"class-variance-authority": "^0.7.0",
"cmdk": "^0.2.0",
"meilisearch": "^0.35.0",
"next": "14.0.2-canary.20",
"next": "14.0.3-canary.2",
"next-mdx-remote": "^4.4.1",
"next-themes": "^0.2.1",
"react": "^18.2.0",
@@ -74,15 +74,15 @@
"sharp": "^0.32.6"
},
"devDependencies": {
"@next/bundle-analyzer": "14.0.2-canary.20",
"@next/bundle-analyzer": "14.0.3-canary.2",
"@testing-library/react": "^14.1.0",
"@testing-library/user-event": "^14.5.1",
"@types/node": "18.18.8",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"@unocss/eslint-plugin": "^0.57.2",
"@unocss/postcss": "^0.57.2",
"@unocss/reset": "^0.57.2",
"@unocss/eslint-plugin": "^0.57.3",
"@unocss/postcss": "^0.57.3",
"@unocss/reset": "^0.57.3",
"@vitejs/plugin-react": "^4.1.1",
"@vitest/coverage-v8": "^0.34.6",
"cpy-cli": "^5.0.0",
@@ -95,7 +95,7 @@
"prettier": "^3.0.3",
"turbo": "^1.10.17-canary.0",
"typescript": "^5.2.2",
"vercel": "^32.5.2",
"vercel": "^32.5.3",
"vitest": "^0.34.6"
},
"engines": {

View File

@@ -120,7 +120,7 @@ export async function generateStaticParams({ params: { package: packageName, ver
const modelJSON = await fetchModelJSON(packageName, version);
if (!modelJSON) {
return [];
return [{ package: packageName, version, item: '' }];
}
const model = addPackageToModel(new ApiModel(), modelJSON);
@@ -129,10 +129,12 @@ export async function generateStaticParams({ params: { package: packageName, ver
const entry = pkg?.entryPoints[0];
if (!entry) {
return [];
return [{ package: packageName, version, item: '' }];
}
return entry.members.map((member: ApiItem) => ({
package: packageName,
version,
item: `${member.displayName}${OVERLOAD_SEPARATOR}${member.kind}`,
}));
}

View File

@@ -5,11 +5,15 @@ import { addPackageToModel } from './addPackageToModel';
import { OVERLOAD_SEPARATOR, PACKAGES } from './constants';
import { findMember, findMemberByKey } from './model';
export const fetchMember = cache(async (packageName: string, branchName: string, item: string) => {
export const fetchMember = cache(async (packageName: string, branchName: string, item?: string) => {
if (!PACKAGES.includes(packageName)) {
return null;
}
if (!item) {
return null;
}
const model = new ApiModel();
if (branchName === 'main') {