Skip to content

Commit 9168186

Browse files
authored
feat(template): modernize runtime and tooling defaults (#309)
* feat(template): modernize runtime and tooling defaults * Update next-template defaults & Biome config Improve runtime defaults for create-sei's Next.js template and update Biome settings. Add a .changeset for a patch release. Changes include: - .env.example: clarify default chain behavior and example override (testnet). - biome.json: include *.json and *.md in includes and add ignore patterns (node_modules, dist, .next, .yarn). - Template adjustments: add a prebuild Biome check and include Biome in devDependencies; configure Next.js to allow Sei CDN images and skip ESLint during builds; update provider/shell setup and template docs/configs (README, Tailwind v4 config). These updates align the template with current defaults and improve developer/runtime experience.
1 parent 2d59021 commit 9168186

12 files changed

Lines changed: 124 additions & 89 deletions

File tree

.changeset/some-bags-tie.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
"@sei-js/create-sei": patch
3+
---
4+
5+
Improve the `next-template` runtime defaults generated by `create-sei`.
6+
7+
- Add a `prebuild` Biome check and include Biome in template dev dependencies.
8+
- Configure Next.js to allow Sei CDN images and skip ESLint during builds.
9+
- Update provider and shell setup for improved chain/image handling.
10+
- Align template config/docs with current defaults (`.env.example`, `README`, Biome, Tailwind v4 config).

packages/create-sei/.rsyncignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ node_modules/
22
.next/
33
dist/
44
build/
5-
.yarn/
6-
yarn.lock
75
package-lock.json
86
.git/
97
.DS_Store

packages/create-sei/templates/next-template/.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Chain configuration
22
# Options: mainnet, testnet, devnet
3-
# Defaults to testnet (atlantic-2) if not set
3+
# Defaults to mainnet if not set; this example overrides it to testnet
44
NEXT_PUBLIC_CHAIN=testnet
55

66
# WalletConnect Project ID (optional)
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
{
2-
"extends": "next/core-web-vitals"
3-
}
1+
{}

packages/create-sei/templates/next-template/README.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,13 @@ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next
44

55
Install dependencies by running
66
```bash
7-
npm install
8-
#or
9-
yarn
7+
bun install
108
```
119

1210
Then, run the development server:
1311

1412
```bash
15-
npm run dev
16-
# or
17-
yarn dev
13+
bun run dev
1814
```
1915

2016
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

packages/create-sei/templates/next-template/biome.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3-
"organizeImports": {
4-
"enabled": true
2+
"$schema": "https://biomejs.dev/schemas/2.4.5/schema.json",
3+
"root": true,
4+
"assist": {
5+
"actions": {
6+
"source": {
7+
"organizeImports": "on"
8+
}
9+
}
510
},
611
"linter": {
712
"enabled": true,
@@ -20,8 +25,7 @@
2025
"formatWithErrors": false,
2126
"indentStyle": "tab",
2227
"lineEnding": "lf",
23-
"lineWidth": 160,
24-
"attributePosition": "auto"
28+
"lineWidth": 160
2529
},
2630
"javascript": {
2731
"formatter": {
@@ -32,8 +36,12 @@
3236
"arrowParentheses": "always",
3337
"bracketSpacing": true,
3438
"bracketSameLine": false,
35-
"quoteStyle": "single",
36-
"attributePosition": "auto"
39+
"quoteStyle": "double"
40+
}
41+
},
42+
"css": {
43+
"parser": {
44+
"tailwindDirectives": true
3745
}
3846
},
3947
"json": {
@@ -42,7 +50,7 @@
4250
}
4351
},
4452
"files": {
45-
"include": ["src/**/*.ts", "src/**/*.tsx", "*.json", "*.md"],
53+
"includes": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.css", "*.json", "*.md"],
4654
"ignore": ["node_modules/**", "dist/**", ".next/**", ".yarn/**"]
4755
}
4856
}
Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,17 @@
11
/** @type {import('next').NextConfig} */
2-
const nextConfig = {};
2+
const nextConfig = {
3+
eslint: {
4+
// Linting is handled by Biome — skip ESLint during builds.
5+
ignoreDuringBuilds: true,
6+
},
7+
images: {
8+
remotePatterns: [
9+
{
10+
protocol: "https",
11+
hostname: "cdn.sei.io",
12+
},
13+
],
14+
},
15+
};
316

417
export default nextConfig;

packages/create-sei/templates/next-template/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"scripts": {
66
"dev": "next dev",
7+
"prebuild": "biome check .",
78
"build": "next build",
89
"start": "next start",
910
"lint": "biome lint .",
@@ -35,6 +36,7 @@
3536
"wagmi": "^2.16.4"
3637
},
3738
"devDependencies": {
39+
"@biomejs/biome": "^2.4.5",
3840
"@types/node": "^24.3.0",
3941
"@types/react": "^19.1.10",
4042
"@types/react-dom": "^19.1.7",
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
@import "tailwindcss";
12

2-
@tailwind base;
3-
@tailwind components;
4-
@tailwind utilities;
3+
@theme {
4+
--color-sei-red: #9e1f19;
5+
--color-sei-dark: #1a1a1a;
6+
}
57

68
@layer base {
7-
html {
8-
@apply h-full;
9-
}
10-
11-
body {
12-
@apply h-full bg-gray-50 text-gray-900 antialiased;
13-
}
9+
html {
10+
@apply h-full;
11+
}
12+
13+
body {
14+
@apply h-full bg-gray-50 text-gray-900 antialiased;
15+
}
1416
}

packages/create-sei/templates/next-template/src/components/providers/providers.tsx

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,47 @@
1-
'use client';
1+
"use client";
22

3-
import { MantineProvider } from '@mantine/core';
4-
import { Notifications } from '@mantine/notifications';
5-
import { RainbowKitProvider, connectorsForWallets, lightTheme } from '@rainbow-me/rainbowkit';
6-
import { metaMaskWallet } from '@rainbow-me/rainbowkit/wallets';
7-
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
8-
import { type ReactNode, useMemo } from 'react';
9-
import { http, WagmiProvider, createConfig } from 'wagmi';
3+
import { MantineProvider } from "@mantine/core";
4+
import { Notifications } from "@mantine/notifications";
5+
import { connectorsForWallets, lightTheme, RainbowKitProvider } from "@rainbow-me/rainbowkit";
6+
import { metaMaskWallet } from "@rainbow-me/rainbowkit/wallets";
7+
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
8+
import { type ReactNode, useMemo } from "react";
9+
import { createConfig, http, WagmiProvider } from "wagmi";
1010

11-
import '@rainbow-me/rainbowkit/styles.css';
12-
import { sei, seiDevnet, seiTestnet } from 'viem/chains';
11+
import "@rainbow-me/rainbowkit/styles.css";
12+
import { defineChain } from "viem";
13+
import { sei, seiTestnet } from "viem/chains";
14+
15+
const seiDevnet = defineChain({
16+
id: 713715,
17+
name: "Sei Devnet",
18+
nativeCurrency: { name: "Sei", symbol: "SEI", decimals: 18 },
19+
rpcUrls: {
20+
default: {
21+
http: ["https://evm-rpc-arctic-1.sei-apis.com"],
22+
},
23+
},
24+
blockExplorers: {
25+
default: {
26+
name: "Seitrace",
27+
url: "https://seitrace.com",
28+
},
29+
},
30+
testnet: true,
31+
});
1332

1433
const queryClient = new QueryClient();
1534

1635
const connectors = connectorsForWallets(
1736
[
1837
{
19-
groupName: 'Recommended',
38+
groupName: "Recommended",
2039
wallets: [metaMaskWallet],
2140
},
2241
],
2342
{
24-
appName: 'Sei dApp',
25-
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || 'your-project-id',
43+
appName: "Sei dApp",
44+
projectId: process.env.NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID || "your-project-id",
2645
}
2746
);
2847

@@ -33,11 +52,11 @@ interface ProvidersProps {
3352
export default function Providers({ children }: ProvidersProps) {
3453
// Chain selection via environment variable, defaults to sei mainnet
3554
const getSelectedChain = () => {
36-
const chainName = process.env.NEXT_PUBLIC_CHAIN || 'mainnet';
55+
const chainName = process.env.NEXT_PUBLIC_CHAIN || "mainnet";
3756
switch (chainName.toLowerCase()) {
38-
case 'testnet':
57+
case "testnet":
3958
return seiTestnet;
40-
case 'devnet':
59+
case "devnet":
4160
return seiDevnet;
4261
default:
4362
return sei;
@@ -68,14 +87,14 @@ export default function Providers({ children }: ProvidersProps) {
6887
<Notifications />
6988
<RainbowKitProvider
7089
theme={lightTheme({
71-
accentColor: '#9E1F19',
72-
accentColorForeground: 'white',
73-
borderRadius: 'medium',
74-
fontStack: 'system',
90+
accentColor: "#9E1F19",
91+
accentColorForeground: "white",
92+
borderRadius: "medium",
93+
fontStack: "system",
7594
})}
7695
appInfo={{
77-
appName: 'Sei dApp',
78-
learnMoreUrl: 'https://docs.sei.io/learn/wallets',
96+
appName: "Sei dApp",
97+
learnMoreUrl: "https://docs.sei.io/learn/wallets",
7998
}}
8099
modalSize="compact"
81100
initialChain={chain.id}

0 commit comments

Comments
 (0)