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

+5-1
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

+11-3
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

+33
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

+6-5
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

+21-41
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

-2
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

+1-1
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

+1-1
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

+1
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"

apps/portal/src/app/cli/install/page.mdx

-10
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ npx thirdweb install <projectpath> [options]
1616

1717
This command will automatically detect the type of project you are working on and install or update the appropriate thirdweb dependencies.
1818

19-
**Dependencies installed:**
20-
21-
- **JS/TS**
22-
- **Smart contract projects**: [`@thirdweb/contracts`](/typescript/latest)
23-
- **App projects:**
24-
- **React**: [`@thirdweb/react`](/react/latest), [`@thirdweb/sdk`](/typescript/latest) and [`ethers` v5](https://docs.ethers.org/v5/)
25-
- **React Native**: [`@thirdweb/react-native`](/react-native/latest), [`@thirdweb/react-native-compat`](/react-native/latest) and [`ethers` v5](https://docs.ethers.org/v5/)
26-
- **Other**: [`@thirdweb/sdk`](/typescript/latest) and [`ethers` v5](https://docs.ethers.org/v5/)
27-
28-
If any thirdweb package _(or Ethers)_ is already installed, they are updated to the latest compatible version.
2919

3020
## Options
3121

apps/portal/src/app/connect/account-abstraction/get-started/page.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ string address = await sdk.wallet.Connect(connection);
183183
</Step>
184184
<Step title="Executing Transactions with Smart Accounts">
185185

186-
Once setup, you can use the Connect [TypeScript](/typescript/latest), [React](/react/latest) and [Unity SDKs](/unity) to deploy contracts, perform transactions, and manipulate smart accounts like any other wallet.
186+
Once setup, you can use the Connect [TypeScript](/typescript/v5), [React](/react/v5) and [Unity SDKs](/unity) to deploy contracts, perform transactions, and manipulate smart accounts like any other wallet.
187187

188188
<Tabs defaultValue="react">
189189

apps/portal/src/app/connect/account-abstraction/guides/react/page.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const metadata = createMetadata({
1414

1515
# Using Account Abstraction in React
1616

17-
By using the [wallet SDK](/references/wallets/latest) alongside the [React SDK](/react/latest), you can use smart accounts in your front-end applications easily.
17+
By using the [TypeScript SDK](/typescript/v5), you can use smart accounts in your front-end applications easily.
1818

1919
<Steps>
2020

apps/portal/src/app/connect/account-abstraction/guides/typescript/page.mdx

+8-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const metadata = createMetadata({
1414

1515
# Using Account abstraction in Typescript
1616

17-
By using the [wallet SDK](/references/wallets/latest) alongside the [TypeScript SDK](/typescript/latest), you can use smart accounts in your applications easily.
17+
By using the [TypeScript SDK](/typescript/v5), you can use smart accounts in your applications easily.
1818

1919
## Example Use Cases
2020

@@ -80,15 +80,18 @@ console.log("Personal account address:", personalAccount.address);
8080
</Step>
8181
<Step title="Creating the Smart account">
8282

83-
Now, let's create a smart account using the SmartWallet class from the `@thirdweb-dev/wallets` package.
84-
To do this, we need to pass a `SmartWalletConfig` object to the constructor. This object contains the following properties:
83+
Now, let's create a smart account using `smartWallet` from `thirdweb/wallets` package.
84+
To do this, we need to pass an object of type [SmartWalletOptions](/references/typescript/v5/SmartWalletOptions) to the function.
85+
86+
Some of the important properties in this object are:
8587

8688
- `chain`: the chain that the smart account will be deployed on.
8789
- `sponsorGas`: whether the smart account should have sponsored transactions or not.
8890

89-
Once we have created the config and instantiated the `SmartWallet` class, we can connect the personal wallet to the smart account using the `connect` method.
90-
91+
Once we have created the smart wallet interface, we can connect the personal wallet to the smart account using the `connect` method.
9192
```typescript
93+
import { smartWallet } from "thirdweb/wallets";
94+
9295
// Configure the smart wallet
9396
const wallet = smartWallet({
9497
chain: sepolia,

apps/portal/src/app/connect/account-abstraction/permissions/page.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { Tabs, TabsList, TabsTrigger, TabsContent } from "@/components/ui/tabs";
22
import { createMetadata } from "@doc";
3-
import { V4SDKbanner } from "@/components/others/V4SDKBanner";
43

54
export const metadata = createMetadata({
65
image: {

apps/portal/src/app/connect/auth/frameworks/next/page.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
TabsTrigger,
1212
} from "@doc";
1313
import { GraduationCap } from "lucide-react";
14-
import { V4SDKbanner } from "@/components/others/V4SDKBanner";
1514

1615
export const metadata = createMetadata({
1716
image: {

apps/portal/src/app/connect/auth/frameworks/react-express/page.mdx

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ import {
1111
TabsTrigger,
1212
} from "@doc";
1313
import { GraduationCap } from "lucide-react";
14-
import { V4SDKbanner } from "@/components/others/V4SDKBanner";
1514

1615
export const metadata = createMetadata({
1716
image: {

apps/portal/src/app/engine/guides/airdrop-nfts/page.mdx

+7-5
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,27 @@ Engine makes it effortless for any developer to airdrop NFTs at scale. You spons
3131

3232
## Frontend: Add Connect Wallet and Claim buttons
3333

34-
Use [`<ConnectWallet>`](/react/latest/components/ConnectWallet) to prompt the user for their wallet. The **Claim** button calls `POST /api/claim`.
34+
Use [`ConnectButton`](/references/typescript/v5/ConnectButton) component to prompt the user for their wallet. The **Claim** button calls `POST /api/claim`.
3535

3636
```tsx
37+
import { useActiveAccount } from "thirdweb/react";
3738
function ClaimPage() {
38-
const userWalletAddress = useAddress();
39+
const account = useActiveAccount();
40+
const address = account?.address;
3941

4042
const onClick = async () => {
4143
await fetch("/api/claim", {
4244
method: "POST",
43-
body: JSON.stringify({ userWalletAddress }),
45+
body: JSON.stringify({ address }),
4446
});
45-
alert(`🎉 A reward has been sent to your wallet: ${userWalletAddress}`);
47+
alert(`🎉 A reward has been sent to your wallet: ${address}`);
4648
};
4749

4850
return (
4951
<main>
5052
<h2>Thank you for being a superfan! ❤️</h2>
5153
<ConnectWallet />
52-
{userWalletAddress && <button onClick={onClick}>Claim my reward</button>}
54+
{address && <button onClick={onClick}>Claim my reward</button>}
5355
</main>
5456
);
5557
}

apps/portal/src/app/engine/guides/nft-checkout/page.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ The buyer receives the NFT without requiring wallet signatures or gas funds.
3333

3434
## Frontend: Add Connect Wallet and credit card form
3535

36-
Use [`<ConnectWallet>`](/react/latest/components/ConnectWallet) to prompt the buyer for their wallet address. The buyer provides their credit card details and selects **Pay now** to send payment details directly to Stripe.
36+
Use [`<ConnectButton>`](/references/typescript/v5/ConnectButton) to prompt the buyer for their wallet address. The buyer provides their credit card details and selects **Pay now** to send payment details directly to Stripe.
3737

3838
```tsx
3939
function Home() {
4040
return (
41-
<ThirdwebProvider activeChain="<chain_id>" clientId="<thirdweb_client_id>">
41+
<ThirdwebProvider>
4242
<PurchasePage />
4343
</ThirdwebProvider>
4444
);

apps/portal/src/app/glossary/composability/page.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Composability refers to the ability for different protocols and smart contracts
44
It allows for the creation of new products and services without having to build everything from scratch.
55

66
Thirdweb is completely composable. Each product can be used independently or in combination with other products.
7-
For example, you can use the [SDKs](/typescript/latest) or [Dashboard](https://thirdweb.com/team) with **any** contract. Similarly, you can use the [Solidity SDK](/contracts/build/overview)
8-
without using the [Dashboard](https://thirdweb.com/team) or [TypeScript/JavaScript SDK](/typescript/latest).
7+
For example, you can use the [SDKs](/connect) or [Dashboard](https://thirdweb.com/team) with **any** contract. Similarly, you can use the [Solidity SDK](/contracts/build/overview)
8+
without using the [Dashboard](https://thirdweb.com/team) or [TypeScript/JavaScript SDK](/typescript/v5).
99

1010
So, if you already have your own workflow which works for you, you can pick and choose which products you want to use.

0 commit comments

Comments
 (0)