Skip to content

Commit b81d7a1

Browse files
authored
[TOOL-3207] Portal: Delete V4 SDK pages, Setup knip lint, Fix lint config (#6039)
1 parent 21cc45a commit b81d7a1

File tree

375 files changed

+372
-737101
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

375 files changed

+372
-737101
lines changed

.vscode/settings.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@
2727
},
2828
"[css]": {
2929
"editor.defaultFormatter": "biomejs.biome"
30-
}
30+
},
31+
"eslint.workingDirectories": [
32+
{ "pattern": "./packages/*/" },
33+
{ "pattern": "./apps/*/" }
34+
]
3135
}

apps/portal/.eslintrc.json

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@
55
"eslint:recommended",
66
"plugin:@typescript-eslint/recommended",
77
"plugin:@next/next/recommended",
8-
"plugin:storybook/recommended"
8+
"plugin:mdx/recommended",
9+
"plugin:tailwindcss/recommended"
910
],
1011
"rules": {
1112
"no-unused-vars": "off",
1213
"@typescript-eslint/no-unused-vars": "error",
1314
"@typescript-eslint/no-explicit-any": "off",
14-
"svg-jsx/camel-case-dash": "error"
15-
}
15+
"svg-jsx/camel-case-dash": "error",
16+
"tailwindcss/classnames-order": "off"
17+
},
18+
"overrides": [
19+
{
20+
"files": ["*.ts", "*.js", "*.tsx", "*.jsx"],
21+
"extends": ["biome"]
22+
}
23+
]
1624
}

apps/portal/knip.json

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"$schema": "https://unpkg.com/knip@5/schema.json",
3+
"next": true,
4+
"project": ["src/**"],
5+
"ignoreBinaries": ["only-allow", "biome"],
6+
"ignore": ["src/components/ui/**"],
7+
"ignoreDependencies": [
8+
"@thirdweb-dev/chains",
9+
"@thirdweb-dev/wallets",
10+
"thirdweb",
11+
"@types/mdx"
12+
],
13+
"entry": [
14+
"next.config.{js,ts,cjs,mjs}",
15+
"{instrumentation,middleware}.{js,ts}",
16+
"app/global-error.{js,jsx,ts,tsx}",
17+
"app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx,mdx}",
18+
"app/**/route.{js,jsx,ts,tsx}",
19+
"app/{manifest,sitemap,robots}.{js,ts}",
20+
"app/**/{icon,apple-icon}.{js,jsx,ts,tsx}",
21+
"app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}",
22+
"pages/**/*.{js,jsx,ts,tsx}",
23+
"src/{instrumentation,middleware}.{js,ts}",
24+
"src/app/global-error.{js,jsx,ts,tsx}",
25+
"src/app/**/{error,layout,loading,not-found,page,template,default}.{js,jsx,ts,tsx,mdx}",
26+
"src/app/**/route.{js,jsx,ts,tsx}",
27+
"src/app/{manifest,sitemap,robots}.{js,ts}",
28+
"src/app/**/{icon,apple-icon}.{js,jsx,ts,tsx}",
29+
"src/app/**/{opengraph,twitter}-image.{js,jsx,ts,tsx}",
30+
"src/pages/**/*.{js,jsx,ts,tsx}",
31+
"scripts/*.ts"
32+
]
33+
}

apps/portal/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@
1010
"build": "next build",
1111
"postbuild": "pnpm run extract-search-data && pnpm next-sitemap",
1212
"start": "next start",
13-
"lint": "biome check ./src && eslint ./src",
13+
"lint": "biome check ./src && knip && eslint ./src",
1414
"fix": "biome check ./src --fix && eslint ./src --fix",
1515
"create-index": "pnpm tsx scripts/createEmptySearchIndex.ts",
16-
"extract-search-data": "pnpm tsx scripts/extractSearchData.ts"
16+
"extract-search-data": "pnpm tsx scripts/extractSearchData.ts",
17+
"typecheck": "tsc --noEmit",
18+
"knip": "knip"
1719
},
1820
"dependencies": {
1921
"@dirtycajunrice/klee": "^1.0.6",
@@ -30,7 +32,6 @@
3032
"class-variance-authority": "^0.7.1",
3133
"clsx": "^2.1.1",
3234
"date-fns": "4.1.0",
33-
"escape-string-regexp": "^5.0.0",
3435
"flexsearch": "^0.7.43",
3536
"github-slugger": "^2.0.0",
3637
"lucide-react": "0.468.0",
@@ -43,7 +44,6 @@
4344
"react-dom": "19.0.0",
4445
"react-html-parser": "2.0.2",
4546
"remark-gfm": "3.0.1",
46-
"semver": "^7.6.0",
4747
"server-only": "^0.0.1",
4848
"shiki": "1.27.0",
4949
"tailwind-merge": "^2.6.0",
@@ -53,6 +53,7 @@
5353
"typedoc-better-json": "0.9.4"
5454
},
5555
"devDependencies": {
56+
"@next/eslint-plugin-next": "15.1.3",
5657
"@types/flexsearch": "^0.7.6",
5758
"@types/mdx": "^2.0.13",
5859
"@types/node": "22.10.2",
@@ -65,10 +66,10 @@
6566
"autoprefixer": "^10.4.19",
6667
"eslint": "8.57.0",
6768
"eslint-config-biome": "1.9.4",
68-
"eslint-config-next": "15.1.4",
6969
"eslint-plugin-mdx": "^3.1.5",
7070
"eslint-plugin-svg-jsx": "^1.2.4",
7171
"eslint-plugin-tailwindcss": "^3.17.5",
72+
"knip": "5.41.0",
7273
"next-sitemap": "^4.2.3",
7374
"postcss": "8.4.49",
7475
"tailwindcss": "3.4.17",

apps/portal/redirects.mjs

Lines changed: 21 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// @ts-check
22

3-
import { unrealEngineRedirects } from "./src/app/unreal-engine/redirects.mjs";
3+
const unrealEngineRedirects = {
4+
"/unreal/:path*": "/unreal-engine/:path*",
5+
"/unreal-engine/cpp/wallet-handle": "/unreal-engine/cpp/wallet-handles",
6+
"/unreal-engine/blueprints/private-key-wallet":
7+
"unreal-engine/blueprints/in-app-wallet",
8+
};
49

510
const reactRedirects = {
611
"/react": "/react/v4",
@@ -981,6 +986,20 @@ const v5RestructuredRedirects = {
981986
"/typescript/v5/react-native/:path*": "/react-native/v5/:path*",
982987
};
983988

989+
const v4ToV5Redirects = {
990+
"/typescript/v4": "/typescript/v5",
991+
"/typescript/v4/:path*": "/typescript/v5",
992+
"/react/v4": "/react/v5",
993+
"/react/v4/:path*": "/react/v5",
994+
"/react-native/v0": "/react-native/v5",
995+
"/react-native/v0/:path*": "/react-native/v5",
996+
"/wallet-sdk/:path*": "/connect",
997+
"/storage-sdk/v2": "/typescript/v5/storage",
998+
"/storage-sdk/v2/:path*": "/typescript/v5/storage",
999+
"/unity/v4": "/unity/v5",
1000+
"/unity/v4/:path*": "/unity/v5",
1001+
};
1002+
9841003
/**
9851004
* @type {import('next').NextConfig['redirects']}
9861005
*/
@@ -999,18 +1018,7 @@ export const redirects = async () => {
9991018
...createRedirects(otherRedirects),
10001019
...createRedirects(v5RestructuredRedirects),
10011020
...createRedirects(unrealEngineRedirects),
1002-
// references docs
1003-
latestReference("react", "v4"),
1004-
latestReference("react-native", "v0"),
1005-
latestReference("typescript", "v5"),
1006-
latestReference("wallets", "v2"),
1007-
latestReference("storage", "v2"),
1008-
// sdk docs
1009-
latestSDK("react", "v4"),
1010-
latestSDK("react-native", "v0"),
1011-
latestSDK("typescript", "v5"),
1012-
latestSDK("wallet-sdk", "v2"),
1013-
latestSDK("storage-sdk", "v2"),
1021+
...createRedirects(v4ToV5Redirects),
10141022
];
10151023
};
10161024

@@ -1026,31 +1034,3 @@ function createRedirects(linkMap, permanent = true) {
10261034
}
10271035
return redirects;
10281036
}
1029-
1030-
/**
1031-
*
1032-
* @param {string} pkg
1033-
* @param {string} latestVersion
1034-
* @returns
1035-
*/
1036-
function latestReference(pkg, latestVersion) {
1037-
return {
1038-
source: `/references/${pkg}/latest/:path*`,
1039-
destination: `/references/${pkg}/${latestVersion}/:path*`,
1040-
permanent: false,
1041-
};
1042-
}
1043-
1044-
/**
1045-
*
1046-
* @param {string} pkg
1047-
* @param {string} latestVersion
1048-
* @returns
1049-
*/
1050-
function latestSDK(pkg, latestVersion) {
1051-
return {
1052-
source: `/${pkg}/latest/:path*`,
1053-
destination: `/${pkg}/${latestVersion}/:path*`,
1054-
permanent: false,
1055-
};
1056-
}

apps/portal/src/app/api/search/extraction/settings.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,3 @@ export const ignoreHeadings = new Set(
1919
"example",
2020
].map((t) => t.toLowerCase()),
2121
);
22-
23-
export const minimumParagraphlength = 20;

apps/portal/src/app/api/search/indexing/createIndex.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import path from "node:path";
33
import FlexSearch from "flexsearch";
44
import type { PageData, PageTitleIndex, SectionIndex } from "../types";
55

6-
export type Indexes = {
6+
type Indexes = {
77
sectionIndex: SectionIndex;
88
websiteData: PageData[];
99
pageTitleIndex: PageTitleIndex;

apps/portal/src/app/app.zip

-1.58 MB
Binary file not shown.

apps/portal/src/app/changelog/ghost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { PostsOrPages } from "@tryghost/content-api";
22
import "./[slug]/styles.css";
33

4-
export const GHOST_THIRDWEB_BLOG_KEY = "49c62b5137df1c17ab6b9e46e3";
4+
const GHOST_THIRDWEB_BLOG_KEY = "49c62b5137df1c17ab6b9e46e3";
55

66
export async function fetchChangeLogs() {
77
const queryParamsString = Object.entries({

apps/portal/src/app/changelog/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ async function PageContent() {
7272
<div>
7373
<Heading
7474
level={2}
75+
// eslint-disable-next-line tailwindcss/no-custom-classname
7576
className="changelog-title"
7677
id={slugger.slug(post.title || "")}
7778
anchorClassName="[&>a]:hidden m-0 border-b pb-5 mb-5"

0 commit comments

Comments
 (0)