Skip to content

Commit c516ec5

Browse files
authored
Merge branch 'main' into joaquim/always-show-modal
2 parents 0bb8138 + 6104401 commit c516ec5

File tree

28 files changed

+5676
-4438
lines changed

28 files changed

+5676
-4438
lines changed

.github/workflows/CI.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- run: pnpm test
9090

9191
- name: Code Coverage
92-
uses: codecov/codecov-action@ad3126e916f78f00edff4ed0317cf185271ccc2d # v5.4.2
92+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
9393
with:
9494
directory: packages/
9595
flags: packages

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
49+
uses: github/codeql-action/init@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
5050
with:
5151
languages: ${{ matrix.language }}
5252
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -59,7 +59,7 @@ jobs:
5959
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
6060
# If this step fails, then you should remove it and run the build manually (see below)
6161
- name: Autobuild
62-
uses: github/codeql-action/autobuild@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
62+
uses: github/codeql-action/autobuild@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18
6363

6464
# ℹ️ Command-line programs to run using the OS shell.
6565
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
@@ -72,4 +72,4 @@ jobs:
7272
# ./location_of_script_within_repo/buildscript.sh
7373

7474
- name: Perform CodeQL Analysis
75-
uses: github/codeql-action/analyze@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
75+
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3.28.18

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636

3737
- name: Create release Pull Request or publish to NPM
3838
id: changesets
39-
uses: changesets/action@746c25e23caa47dceb6a48ee85b4cbc5a9f5f293 #v1.4.0
39+
uses: changesets/action@e0145edc7d9d8679003495b11f87bd8ef63c0cba #v1.4.0
4040
with:
4141
publish: pnpm release
4242
version: pnpm version-packages

AGENTS.md

Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
🤖 Codex Agent Guidelines for thirdweb-dev/js
2+
3+
Welcome, AI copilots! This guide captures the coding standards, architectural decisions, and workflow conventions that every automated agent (and human contributor!) must follow. Unless a rule explicitly targets a sub‑project, it applies repo‑wide.
4+
5+
6+
7+
1. GitHub Workflow & Etiquette
8+
9+
- Pull‑request titles must start with the affected workspace in brackets (e.g. [SDK], [Dashboard], [Portal], [Playground]).
10+
- Begin the PR description with a one‑sentence summary, then add a checklist of changes and reference issues with Fixes #123.
11+
- Keep commits small and topical – one logical change per commit.
12+
- Branch names should follow area/brief-topic (e.g. sdk/fix-gas-estimate). Avoid personal names.
13+
- Request at least one core maintainer review. Do not self‑merge unless you are the sole owner of that package.
14+
- All CI checks (type‑check, Biome, tests) must pass before merging.
15+
16+
17+
18+
2. Formatting & Linting
19+
20+
- Biome governs formatting and linting; its rules live in biome.json.
21+
- Run pnpm biome check --apply before committing.
22+
- Avoid editor‑specific configs; rely on the shared settings.
23+
24+
25+
26+
3. TypeScript Style Guide
27+
28+
- Write idiomatic TypeScript: explicit function declarations and return types.
29+
- Limit each file to one stateless, single‑responsibility function for clarity and testability.
30+
- Re‑use shared types from @/types or local types.ts barrels.
31+
- Prefer type aliases over interface except for nominal shapes.
32+
- Avoid any and unknown unless unavoidable; narrow generics whenever possible.
33+
- Choose composition over inheritance; leverage utility types (Partial, Pick, etc.).
34+
35+
36+
37+
4. Testing Strategy
38+
39+
- Co‑locate tests: foo.ts ↔ foo.test.ts.
40+
- Use real function invocations with stub data; avoid brittle mocks.
41+
- For network interactions, use Mock Service Worker (MSW) to intercept fetch/HTTP calls, mocking only scenarios that are hard to reproduce.
42+
- Keep tests deterministic and side‑effect free; Jest is pre‑configured.
43+
44+
45+
46+
5. packages/thirdweb
47+
48+
5.1 Public API Surface
49+
50+
- Export everything via the exports/ directory, grouped by feature.
51+
- Every public symbol must have comprehensive TSDoc:
52+
- Include at least one @example block that compiles.
53+
- Tag with one custom annotation (@beta, @internal, @experimental, etc.).
54+
- Comment only ambiguous logic; avoid restating TypeScript in prose.
55+
56+
5.2 Performance
57+
58+
- Lazy‑load heavy dependencies inside async paths to keep the initial bundle lean:
59+
60+
`const { jsPDF } = await import("jspdf");`
61+
62+
63+
64+
6. apps/dashboard & apps/playground
65+
66+
6.1 Core UI Toolkit
67+
68+
- Import primitives from @/components/ui/\_ (e.g. Button, Input, Select, Tabs, Card, Sidebar, Badge, Separator).
69+
- Use NavLink for internal navigation so active states are handled automatically.
70+
- Group feature‑specific components under feature/components/\_ and expose a barrel index.ts when necessary.
71+
72+
6.2 Styling Conventions
73+
74+
- Tailwind CSS is the styling system – no inline styles or CSS modules.
75+
- Merge class names with cn() from @/lib/utils to keep conditional logic readable.
76+
- Stick to design tokens: backgrounds (bg-card), borders (border-border), muted text (text-muted-foreground), etc.
77+
- Expose a className prop on the root element of every component for overrides.
78+
79+
6.3 Component Patterns
80+
81+
- Server Components (run on the Node edge):
82+
-- Read cookies/headers with next/headers.
83+
-- Access server‑only environment variables or secrets.
84+
-- Perform heavy data fetching that should not ship to the client.
85+
-- Implement redirect logic with redirect() from next/navigation.
86+
-- Start files with import "server-only"; to prevent client bundling.
87+
- Client Components (run in the browser):
88+
-- Begin files with 'use client'; before imports.
89+
-- Handle interactive UI relying on React hooks (useState, useEffect, React Query, wallet hooks).
90+
-- Access browser APIs (localStorage, window, IntersectionObserver, etc.).
91+
-- Support fast transitions where data is prefetched on the client.
92+
93+
6.4 Data Fetching Guidelines
94+
95+
- Server Side
96+
-- Always call getAuthToken() to retrieve the JWT from cookies.
97+
-- Inject the token as an Authorization: Bearer header – never embed it in the URL.
98+
-- Return typed results (Project[], User[], …) – avoid any.
99+
- Client Side
100+
-- Wrap calls in React Query (@tanstack/react-query).
101+
-- Use descriptive, stable queryKeys for cache hits.
102+
-- Configure staleTime / cacheTime based on freshness requirements (default ≥ 60 s).
103+
-- Keep tokens secret by calling internal API routes or server actions.
104+
105+
106+
107+
7. Performance & Bundle Size
108+
109+
- Track bundle budgets via package.json#size-limit.
110+
- Lazy‑import optional features; avoid top‑level side‑effects.
111+
- De‑duplicate dependencies across packages through pnpm workspace hoisting.
112+
113+
114+
115+
8. Documentation & Developer Experience
116+
117+
- Each change in packages/\* should contain a changeset for the appropriate package, with the appropriate version bump
118+
119+
- patch for changes that don't impact the public API
120+
- minor for any new/modified public API
121+
122+
- Surface breaking changes prominently in PR descriptions.
123+
- For new UI components, add Storybook stories (\*.stories.tsx) alongside the code.

apps/dashboard/package.json

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
"ioredis": "^5.6.1",
7272
"ipaddr.js": "^2.2.0",
7373
"lucide-react": "0.503.0",
74-
"next": "15.3.1",
74+
"next": "15.3.2",
7575
"next-plausible": "^3.12.4",
7676
"next-themes": "^0.4.6",
7777
"nextjs-toploader": "^1.6.12",
@@ -110,25 +110,25 @@
110110
"devDependencies": {
111111
"@chakra-ui/cli": "^2.4.1",
112112
"@chromatic-com/storybook": "3.2.6",
113-
"@next/bundle-analyzer": "15.3.1",
114-
"@next/eslint-plugin-next": "15.3.1",
113+
"@next/bundle-analyzer": "15.3.2",
114+
"@next/eslint-plugin-next": "15.3.2",
115115
"@playwright/test": "1.52.0",
116-
"@storybook/addon-essentials": "8.6.12",
117-
"@storybook/addon-interactions": "8.6.12",
118-
"@storybook/addon-links": "8.6.12",
119-
"@storybook/addon-onboarding": "8.6.12",
120-
"@storybook/addon-viewport": "8.6.12",
121-
"@storybook/blocks": "8.6.12",
122-
"@storybook/nextjs": "8.6.12",
123-
"@storybook/react": "8.6.12",
124-
"@storybook/test": "8.6.12",
116+
"@storybook/addon-essentials": "8.6.14",
117+
"@storybook/addon-interactions": "8.6.14",
118+
"@storybook/addon-links": "8.6.14",
119+
"@storybook/addon-onboarding": "8.6.14",
120+
"@storybook/addon-viewport": "8.6.14",
121+
"@storybook/blocks": "8.6.14",
122+
"@storybook/nextjs": "8.6.14",
123+
"@storybook/react": "8.6.14",
124+
"@storybook/test": "8.6.14",
125125
"@types/color": "4.2.0",
126126
"@types/node": "22.14.1",
127-
"@types/papaparse": "^5.3.15",
127+
"@types/papaparse": "^5.3.16",
128128
"@types/pluralize": "^0.0.33",
129129
"@types/qrcode": "^1.5.5",
130-
"@types/react": "19.1.2",
131-
"@types/react-dom": "19.1.2",
130+
"@types/react": "19.1.4",
131+
"@types/react-dom": "19.1.5",
132132
"@types/react-table": "^7.7.20",
133133
"@types/spdx-correct": "^3.1.3",
134134
"@types/swagger-ui-react": "^5.18.0",
@@ -140,10 +140,10 @@
140140
"eslint-config-biome": "1.9.4",
141141
"eslint-plugin-react-compiler": "19.0.0-beta-e993439-20250405",
142142
"eslint-plugin-storybook": "0.12.0",
143-
"knip": "5.50.5",
143+
"knip": "5.56.0",
144144
"next-sitemap": "^4.2.3",
145145
"postcss": "8.5.3",
146-
"storybook": "8.6.12",
146+
"storybook": "8.6.14",
147147
"tailwindcss": "3.4.17",
148148
"typescript": "5.8.3"
149149
}

apps/dashboard/src/app/(app)/(dashboard)/(bridge)/routes/components/server/routes-table.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async function getRoutesToRender(params: SearchParams) {
5757
}
5858
}
5959
// Temporary, will update this after the /routes endpoint
60-
let routes = await getRoutes({ limit: 100_000 });
60+
let routes = await getRoutes({ limit: 500_000 });
6161

6262
const totalCount = routes.length;
6363

27.4 KB
Loading
123 KB
Loading

apps/dashboard/src/app/(app)/(dashboard)/(chain)/utils.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import alephZeroBaner from "./temp-assets/AlephZeroBanner.jpg";
88
import alephZeroCTA from "./temp-assets/AlephZeroCTA.jpg";
99
import cotiBanner from "./temp-assets/COTI_Banner.jpg";
1010
import cotiCTA from "./temp-assets/COTI_CTA.jpg";
11+
import eduBanner from "./temp-assets/EDUBanner.jpeg";
12+
import eduCTA from "./temp-assets/EDUCTA.png";
1113
import hemiSepoliaBanner from "./temp-assets/HemiBanner.png";
1214
import hemiSepoliaCTA from "./temp-assets/HemiCTA.png";
1315
import ancient8Banner from "./temp-assets/ancient8-banner.png";
@@ -376,6 +378,31 @@ const chainMetaRecord = {
376378
about:
377379
"Monetize your passion, your way. Discover the freedom to grow with our creator-focused platform.",
378380
},
381+
//EDUMainnet
382+
41923: {
383+
headerImgUrl: eduBanner.src,
384+
about:
385+
"Education On-Chain - A Layer 3 blockchain preparing students and learners for the future of work while advancing onchain education finance (EduFi).",
386+
cta: {
387+
backgroundImageUrl: eduCTA.src,
388+
title: "Education On-Chain",
389+
buttonLink: "https://educhain.xyz/",
390+
buttonText: "Learn More",
391+
},
392+
},
393+
//EDU Testnet <Open Campus Codex>
394+
656476: {
395+
headerImgUrl: eduBanner.src,
396+
about:
397+
"Education On-Chain - A Layer 3 blockchain preparing students and learners for the future of work while advancing onchain education finance (EduFi).",
398+
cta: {
399+
backgroundImageUrl: eduCTA.src,
400+
title: "Education On-Chain",
401+
buttonLink: "https://educhain.xyz/",
402+
buttonText: "Learn More",
403+
},
404+
},
405+
379406
//Etherlink Testnet
380407
128123: {
381408
headerImgUrl: etherlinkBanner.src,

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/engine/cloud/server-wallets/components/try-it-out.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function TryItOut() {
186186
const sdkExample = () => `\
187187
import { createThirdwebClient, sendTransaction, getContract, Engine } from "thirdweb";
188188
import { baseSepolia } from "thirdweb/chains";
189-
import { claimTo } from "thirdweb/extensions/1155";
189+
import { claimTo } from "thirdweb/extensions/erc1155";
190190
191191
// Create a thirdweb client
192192
const client = createThirdwebClient({
@@ -228,7 +228,7 @@ const txHash = await Engine.waitForTransactionHash({
228228
client,
229229
transactionId,
230230
});
231-
console.log("Transaction hash:", result.transactionHash);
231+
console.log("Transaction hash:", txHash);
232232
`;
233233

234234
const curlExample = () => `\

0 commit comments

Comments
 (0)