@sei-js/create-sei 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +12 -0
- package/README.md +16 -25
- package/biome.json +8 -0
- package/dist/main.js +10 -60
- package/dist/templates/next-template/.eslintrc.json +3 -0
- package/dist/templates/next-template/package.json +30 -0
- package/dist/templates/next-template/src/app/components/Homepage/Examples.tsx +257 -0
- package/dist/templates/next-template/src/app/components/Homepage/Homepage.css +154 -0
- package/dist/templates/{next-wagmi-template → next-template}/src/app/components/Homepage/Homepage.tsx +10 -36
- package/{templates/next-wagmi-template → dist/templates/next-template}/src/app/components/Web3Provider.tsx +29 -28
- package/dist/templates/next-template/src/app/components/index.ts +2 -0
- package/dist/templates/{next-wagmi-template → next-template}/src/app/constants/chain.ts +2 -2
- package/dist/templates/next-template/src/app/constants/index.ts +1 -0
- package/dist/templates/next-template/src/app/index.css +184 -0
- package/dist/templates/next-template/src/app/layout.tsx +21 -0
- package/dist/templates/next-template/src/app/page.tsx +21 -0
- package/dist/templates/next-template/tsconfig.json +26 -0
- package/dist/templates/vite-template/.eslintrc.cjs +11 -0
- package/dist/templates/vite-template/package.json +33 -0
- package/dist/templates/vite-template/src/App.tsx +21 -0
- package/dist/templates/vite-template/src/components/Homepage/Examples.tsx +255 -0
- package/dist/templates/vite-template/src/components/Homepage/Homepage.css +154 -0
- package/dist/templates/vite-template/src/components/Homepage/Homepage.tsx +81 -0
- package/{templates/vite-wagmi-template → dist/templates/vite-template}/src/components/Web3Provider.tsx +29 -28
- package/dist/templates/{vite-wagmi-template → vite-template}/src/constants/chain.ts +1 -1
- package/dist/templates/vite-template/src/constants/index.ts +1 -0
- package/dist/templates/vite-template/src/index.css +183 -0
- package/dist/templates/vite-template/src/main.tsx +12 -0
- package/dist/templates/vite-template/tsconfig.app.json +25 -0
- package/dist/templates/vite-template/tsconfig.json +11 -0
- package/dist/templates/vite-template/tsconfig.node.json +14 -0
- package/dist/templates/vite-template/vite.config.ts +10 -0
- package/package.json +1 -1
- package/src/main.ts +26 -87
- package/templates/next-template/.eslintrc.json +3 -0
- package/templates/next-template/package.json +30 -0
- package/templates/next-template/src/app/components/Homepage/Examples.tsx +257 -0
- package/templates/next-template/src/app/components/Homepage/Homepage.css +154 -0
- package/templates/{next-wagmi-template → next-template}/src/app/components/Homepage/Homepage.tsx +10 -36
- package/{dist/templates/next-wagmi-template → templates/next-template}/src/app/components/Web3Provider.tsx +29 -28
- package/templates/next-template/src/app/components/index.ts +2 -0
- package/templates/{next-wagmi-template → next-template}/src/app/constants/chain.ts +2 -2
- package/templates/next-template/src/app/constants/index.ts +1 -0
- package/templates/next-template/src/app/index.css +184 -0
- package/templates/next-template/src/app/layout.tsx +21 -0
- package/templates/next-template/src/app/page.tsx +21 -0
- package/templates/next-template/tsconfig.json +26 -0
- package/templates/vite-template/.eslintrc.cjs +11 -0
- package/templates/vite-template/package.json +33 -0
- package/templates/vite-template/src/App.tsx +21 -0
- package/templates/vite-template/src/components/Homepage/Examples.tsx +255 -0
- package/templates/vite-template/src/components/Homepage/Homepage.css +154 -0
- package/templates/vite-template/src/components/Homepage/Homepage.tsx +81 -0
- package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/components/Web3Provider.tsx +29 -28
- package/templates/{vite-wagmi-template → vite-template}/src/constants/chain.ts +1 -1
- package/templates/vite-template/src/constants/index.ts +1 -0
- package/templates/vite-template/src/index.css +183 -0
- package/templates/vite-template/src/main.tsx +12 -0
- package/templates/vite-template/tsconfig.app.json +25 -0
- package/templates/vite-template/tsconfig.json +11 -0
- package/templates/vite-template/tsconfig.node.json +14 -0
- package/templates/vite-template/vite.config.ts +10 -0
- package/tsconfig.json +18 -28
- package/dist/templates/next-cosmos-template/.eslintrc.json +0 -3
- package/dist/templates/next-cosmos-template/README.md +0 -60
- package/dist/templates/next-cosmos-template/next.config.mjs +0 -14
- package/dist/templates/next-cosmos-template/package.json +0 -31
- package/dist/templates/next-cosmos-template/public/next.svg +0 -1
- package/dist/templates/next-cosmos-template/public/vercel.svg +0 -1
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -177
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -156
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -110
- package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -39
- package/dist/templates/next-cosmos-template/src/app/components/index.ts +0 -3
- package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
- package/dist/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
- package/dist/templates/next-cosmos-template/src/app/index.css +0 -171
- package/dist/templates/next-cosmos-template/src/app/layout.tsx +0 -21
- package/dist/templates/next-cosmos-template/src/app/page.tsx +0 -17
- package/dist/templates/next-cosmos-template/tsconfig.json +0 -26
- package/dist/templates/next-cosmos-template/yarn.lock +0 -9814
- package/dist/templates/next-wagmi-template/.eslintrc.json +0 -3
- package/dist/templates/next-wagmi-template/package.json +0 -30
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -271
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -156
- package/dist/templates/next-wagmi-template/src/app/components/index.ts +0 -2
- package/dist/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
- package/dist/templates/next-wagmi-template/src/app/index.css +0 -171
- package/dist/templates/next-wagmi-template/src/app/layout.tsx +0 -21
- package/dist/templates/next-wagmi-template/src/app/page.tsx +0 -21
- package/dist/templates/next-wagmi-template/tsconfig.json +0 -26
- package/dist/templates/vite-cosmos-template/.eslintrc.cjs +0 -18
- package/dist/templates/vite-cosmos-template/README.md +0 -72
- package/dist/templates/vite-cosmos-template/index.html +0 -16
- package/dist/templates/vite-cosmos-template/package.json +0 -35
- package/dist/templates/vite-cosmos-template/src/App.tsx +0 -16
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -177
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -156
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -102
- package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -45
- package/dist/templates/vite-cosmos-template/src/components/index.ts +0 -4
- package/dist/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
- package/dist/templates/vite-cosmos-template/src/constants/index.ts +0 -1
- package/dist/templates/vite-cosmos-template/src/index.css +0 -171
- package/dist/templates/vite-cosmos-template/src/main.tsx +0 -12
- package/dist/templates/vite-cosmos-template/tsconfig.app.json +0 -27
- package/dist/templates/vite-cosmos-template/tsconfig.json +0 -11
- package/dist/templates/vite-cosmos-template/tsconfig.node.json +0 -14
- package/dist/templates/vite-cosmos-template/vite.config.ts +0 -7
- package/dist/templates/vite-cosmos-template/yarn.lock +0 -9323
- package/dist/templates/vite-wagmi-template/.eslintrc.cjs +0 -18
- package/dist/templates/vite-wagmi-template/package.json +0 -33
- package/dist/templates/vite-wagmi-template/src/App.tsx +0 -22
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -269
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -156
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -106
- package/dist/templates/vite-wagmi-template/src/constants/index.ts +0 -1
- package/dist/templates/vite-wagmi-template/src/index.css +0 -170
- package/dist/templates/vite-wagmi-template/src/main.tsx +0 -12
- package/dist/templates/vite-wagmi-template/tsconfig.app.json +0 -27
- package/dist/templates/vite-wagmi-template/tsconfig.json +0 -11
- package/dist/templates/vite-wagmi-template/tsconfig.node.json +0 -14
- package/dist/templates/vite-wagmi-template/vite.config.ts +0 -10
- package/templates/next-cosmos-template/.eslintrc.json +0 -3
- package/templates/next-cosmos-template/README.md +0 -60
- package/templates/next-cosmos-template/next-env.d.ts +0 -5
- package/templates/next-cosmos-template/next.config.mjs +0 -14
- package/templates/next-cosmos-template/package.json +0 -31
- package/templates/next-cosmos-template/public/next.svg +0 -1
- package/templates/next-cosmos-template/public/sei-logotype.svg +0 -15
- package/templates/next-cosmos-template/public/vercel.svg +0 -1
- package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +0 -177
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +0 -156
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +0 -110
- package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +0 -39
- package/templates/next-cosmos-template/src/app/components/index.ts +0 -3
- package/templates/next-cosmos-template/src/app/constants/chain.ts +0 -16
- package/templates/next-cosmos-template/src/app/constants/index.ts +0 -1
- package/templates/next-cosmos-template/src/app/favicon.ico +0 -0
- package/templates/next-cosmos-template/src/app/index.css +0 -171
- package/templates/next-cosmos-template/src/app/layout.tsx +0 -21
- package/templates/next-cosmos-template/src/app/page.tsx +0 -17
- package/templates/next-cosmos-template/tsconfig.json +0 -26
- package/templates/next-cosmos-template/yarn.lock +0 -9814
- package/templates/next-wagmi-template/.eslintrc.json +0 -3
- package/templates/next-wagmi-template/next-env.d.ts +0 -5
- package/templates/next-wagmi-template/package.json +0 -30
- package/templates/next-wagmi-template/public/sei-logotype.svg +0 -15
- package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +0 -271
- package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +0 -156
- package/templates/next-wagmi-template/src/app/components/index.ts +0 -2
- package/templates/next-wagmi-template/src/app/constants/index.ts +0 -1
- package/templates/next-wagmi-template/src/app/favicon.ico +0 -0
- package/templates/next-wagmi-template/src/app/index.css +0 -171
- package/templates/next-wagmi-template/src/app/layout.tsx +0 -21
- package/templates/next-wagmi-template/src/app/page.tsx +0 -21
- package/templates/next-wagmi-template/tsconfig.json +0 -26
- package/templates/vite-cosmos-template/.eslintrc.cjs +0 -18
- package/templates/vite-cosmos-template/README.md +0 -72
- package/templates/vite-cosmos-template/favicon.ico +0 -0
- package/templates/vite-cosmos-template/index.html +0 -16
- package/templates/vite-cosmos-template/package.json +0 -35
- package/templates/vite-cosmos-template/public/sei-logotype.svg +0 -15
- package/templates/vite-cosmos-template/src/App.tsx +0 -16
- package/templates/vite-cosmos-template/src/assets/react.svg +0 -1
- package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +0 -177
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +0 -156
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +0 -102
- package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +0 -26
- package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +0 -45
- package/templates/vite-cosmos-template/src/components/index.ts +0 -4
- package/templates/vite-cosmos-template/src/constants/chain.ts +0 -16
- package/templates/vite-cosmos-template/src/constants/index.ts +0 -1
- package/templates/vite-cosmos-template/src/index.css +0 -171
- package/templates/vite-cosmos-template/src/main.tsx +0 -12
- package/templates/vite-cosmos-template/src/vite-env.d.ts +0 -1
- package/templates/vite-cosmos-template/tsconfig.app.json +0 -27
- package/templates/vite-cosmos-template/tsconfig.json +0 -11
- package/templates/vite-cosmos-template/tsconfig.node.json +0 -14
- package/templates/vite-cosmos-template/vite.config.ts +0 -7
- package/templates/vite-cosmos-template/yarn.lock +0 -9323
- package/templates/vite-wagmi-template/.eslintrc.cjs +0 -18
- package/templates/vite-wagmi-template/favicon.ico +0 -0
- package/templates/vite-wagmi-template/package.json +0 -33
- package/templates/vite-wagmi-template/public/sei-logotype.svg +0 -15
- package/templates/vite-wagmi-template/src/App.tsx +0 -22
- package/templates/vite-wagmi-template/src/assets/react.svg +0 -1
- package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +0 -269
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +0 -156
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +0 -106
- package/templates/vite-wagmi-template/src/constants/index.ts +0 -1
- package/templates/vite-wagmi-template/src/index.css +0 -170
- package/templates/vite-wagmi-template/src/main.tsx +0 -12
- package/templates/vite-wagmi-template/src/vite-env.d.ts +0 -1
- package/templates/vite-wagmi-template/tsconfig.app.json +0 -27
- package/templates/vite-wagmi-template/tsconfig.json +0 -11
- package/templates/vite-wagmi-template/tsconfig.node.json +0 -14
- package/templates/vite-wagmi-template/vite.config.ts +0 -10
- /package/dist/templates/{next-wagmi-template → next-template}/README.md +0 -0
- /package/dist/templates/{next-cosmos-template → next-template}/next-env.d.ts +0 -0
- /package/dist/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
- /package/dist/templates/{next-cosmos-template → next-template}/public/sei-logotype.svg +0 -0
- /package/dist/templates/{next-cosmos-template → next-template}/src/app/favicon.ico +0 -0
- /package/dist/templates/{next-wagmi-template → next-template}/yarn.lock +0 -0
- /package/dist/templates/{vite-wagmi-template → vite-template}/README.md +0 -0
- /package/dist/templates/{next-wagmi-template/src/app → vite-template}/favicon.ico +0 -0
- /package/dist/templates/{vite-wagmi-template → vite-template}/index.html +0 -0
- /package/dist/templates/{next-wagmi-template → vite-template}/public/sei-logotype.svg +0 -0
- /package/dist/templates/{vite-cosmos-template → vite-template}/src/assets/react.svg +0 -0
- /package/dist/templates/{vite-cosmos-template → vite-template}/src/vite-env.d.ts +0 -0
- /package/dist/templates/{vite-wagmi-template → vite-template}/yarn.lock +0 -0
- /package/templates/{next-wagmi-template → next-template}/README.md +0 -0
- /package/{dist/templates/next-wagmi-template → templates/next-template}/next-env.d.ts +0 -0
- /package/templates/{next-wagmi-template → next-template}/next.config.mjs +0 -0
- /package/{dist/templates/vite-cosmos-template → templates/next-template}/public/sei-logotype.svg +0 -0
- /package/{dist/templates/vite-cosmos-template → templates/next-template/src/app}/favicon.ico +0 -0
- /package/templates/{next-wagmi-template → next-template}/yarn.lock +0 -0
- /package/templates/{vite-wagmi-template → vite-template}/README.md +0 -0
- /package/{dist/templates/vite-wagmi-template → templates/vite-template}/favicon.ico +0 -0
- /package/templates/{vite-wagmi-template → vite-template}/index.html +0 -0
- /package/{dist/templates/vite-wagmi-template → templates/vite-template}/public/sei-logotype.svg +0 -0
- /package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/assets/react.svg +0 -0
- /package/{dist/templates/vite-wagmi-template → templates/vite-template}/src/vite-env.d.ts +0 -0
- /package/templates/{vite-wagmi-template → vite-template}/yarn.lock +0 -0
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
/*
|
|
2
|
+
1. Use a more-intuitive box-sizing model.
|
|
3
|
+
*/
|
|
4
|
+
*,
|
|
5
|
+
*::before,
|
|
6
|
+
*::after {
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
}
|
|
9
|
+
/*
|
|
10
|
+
2. Remove default margin
|
|
11
|
+
*/
|
|
12
|
+
* {
|
|
13
|
+
margin: 0;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
Typographic tweaks!
|
|
17
|
+
3. Add accessible line-height
|
|
18
|
+
4. Improve text rendering
|
|
19
|
+
*/
|
|
20
|
+
body {
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
23
|
+
}
|
|
24
|
+
/*
|
|
25
|
+
5. Improve media defaults
|
|
26
|
+
*/
|
|
27
|
+
img,
|
|
28
|
+
picture,
|
|
29
|
+
video,
|
|
30
|
+
canvas,
|
|
31
|
+
svg {
|
|
32
|
+
display: block;
|
|
33
|
+
max-width: 100%;
|
|
34
|
+
}
|
|
35
|
+
/*
|
|
36
|
+
6. Remove built-in form typography styles
|
|
37
|
+
*/
|
|
38
|
+
input,
|
|
39
|
+
button,
|
|
40
|
+
textarea,
|
|
41
|
+
select {
|
|
42
|
+
font: inherit;
|
|
43
|
+
}
|
|
44
|
+
/*
|
|
45
|
+
7. Avoid text overflows
|
|
46
|
+
*/
|
|
47
|
+
p,
|
|
48
|
+
h1,
|
|
49
|
+
h2,
|
|
50
|
+
h3,
|
|
51
|
+
h4,
|
|
52
|
+
h5,
|
|
53
|
+
h6 {
|
|
54
|
+
overflow-wrap: break-word;
|
|
55
|
+
line-height: 1;
|
|
56
|
+
}
|
|
57
|
+
/*
|
|
58
|
+
8. Create a root stacking context
|
|
59
|
+
*/
|
|
60
|
+
#root,
|
|
61
|
+
#__next {
|
|
62
|
+
isolation: isolate;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
:root {
|
|
66
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
67
|
+
line-height: 1.5;
|
|
68
|
+
font-weight: 400;
|
|
69
|
+
|
|
70
|
+
color-scheme: light dark;
|
|
71
|
+
color: #000;
|
|
72
|
+
background: var(--background);
|
|
73
|
+
|
|
74
|
+
font-synthesis: none;
|
|
75
|
+
text-rendering: optimizeLegibility;
|
|
76
|
+
-webkit-font-smoothing: antialiased;
|
|
77
|
+
-moz-osx-font-smoothing: grayscale;
|
|
78
|
+
|
|
79
|
+
--primary-color: #9f1239;
|
|
80
|
+
--primary-color-hover: #7f0a2e;
|
|
81
|
+
--background: linear-gradient(180deg, #f5f5f4 0%, #fff 100%);
|
|
82
|
+
--border: #d6d3d1;
|
|
83
|
+
--card: #fff;
|
|
84
|
+
--card-foreground: #242424;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
a {
|
|
88
|
+
font-weight: 500;
|
|
89
|
+
color: var(--primary-color);
|
|
90
|
+
text-decoration: inherit;
|
|
91
|
+
}
|
|
92
|
+
a:hover {
|
|
93
|
+
color: var(--primary-color-hover);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
body {
|
|
97
|
+
margin: 0;
|
|
98
|
+
padding: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
h1 {
|
|
102
|
+
font-size: 3.2em;
|
|
103
|
+
line-height: 1;
|
|
104
|
+
}
|
|
105
|
+
code {
|
|
106
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace;
|
|
107
|
+
display: inline-flex;
|
|
108
|
+
border-radius: 4px;
|
|
109
|
+
padding: 0.1rem 0.4rem;
|
|
110
|
+
background-color: #d7cccc;
|
|
111
|
+
color: var(--card-foreground);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
button {
|
|
115
|
+
border-radius: 4rem;
|
|
116
|
+
border: 1px solid transparent;
|
|
117
|
+
padding: 0.6em 1.2em;
|
|
118
|
+
font-size: 1em;
|
|
119
|
+
font-weight: 500;
|
|
120
|
+
font-family: inherit;
|
|
121
|
+
background-color: #cec9c1;
|
|
122
|
+
cursor: pointer;
|
|
123
|
+
transition: all 0.25s ease;
|
|
124
|
+
color: black;
|
|
125
|
+
}
|
|
126
|
+
button:hover {
|
|
127
|
+
background-color: #b5afa7;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
button:disabled {
|
|
131
|
+
filter: grayscale(1) opacity(0.5);
|
|
132
|
+
color: rgb(56, 55, 55);
|
|
133
|
+
pointer-events: none;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
button.primary {
|
|
137
|
+
background-color: var(--primary-color);
|
|
138
|
+
}
|
|
139
|
+
button.outline {
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
border: 1px solid var(--border);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
button.primary:hover {
|
|
145
|
+
background-color: var(--primary-color-hover);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
button.secondary {
|
|
149
|
+
background-color: #000;
|
|
150
|
+
color: black;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
button.secondary:hover {
|
|
154
|
+
background-color: #2b2b2b;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
button:active {
|
|
158
|
+
transform: translateY(1px);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
button.small {
|
|
162
|
+
padding: 0.4em 0.8em;
|
|
163
|
+
font-size: 0.8em;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
button:focus-visible {
|
|
167
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
168
|
+
outline-offset: 4px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.header {
|
|
172
|
+
width: 100%;
|
|
173
|
+
height: 4rem;
|
|
174
|
+
padding: 0 1%;
|
|
175
|
+
display: flex;
|
|
176
|
+
align-items: center;
|
|
177
|
+
justify-content: right;
|
|
178
|
+
background-color: transparent;
|
|
179
|
+
border-bottom: 1px solid var(--border);
|
|
180
|
+
position: sticky;
|
|
181
|
+
top: 0;
|
|
182
|
+
background: #f5f5f4;
|
|
183
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom/client';
|
|
3
|
+
import App from './App.tsx';
|
|
4
|
+
import Web3Provider from './components/Web3Provider.tsx';
|
|
5
|
+
|
|
6
|
+
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
|
+
<React.StrictMode>
|
|
8
|
+
<Web3Provider>
|
|
9
|
+
<App />
|
|
10
|
+
</Web3Provider>
|
|
11
|
+
</React.StrictMode>
|
|
12
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
|
5
|
+
"target": "ES2020",
|
|
6
|
+
"useDefineForClassFields": true,
|
|
7
|
+
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
|
8
|
+
"module": "ESNext",
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
18
|
+
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"composite": true,
|
|
4
|
+
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
|
|
5
|
+
"skipLibCheck": true,
|
|
6
|
+
"module": "ESNext",
|
|
7
|
+
"moduleResolution": "bundler",
|
|
8
|
+
"allowSyntheticDefaultImports": true,
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"noEmit": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["vite.config.ts"]
|
|
14
|
+
}
|
package/package.json
CHANGED
package/src/main.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import inquirer from 'inquirer';
|
|
3
2
|
import boxen from 'boxen';
|
|
3
|
+
import inquirer from 'inquirer';
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import fs from 'node:fs';
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { dirname } from 'node:path';
|
|
8
|
+
import { fileURLToPath } from 'node:url';
|
|
9
9
|
import { Command } from 'commander';
|
|
10
10
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -23,32 +23,20 @@ const printWelcomeMessage = () => {
|
|
|
23
23
|
borderColor: '#932C23'
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
};
|
|
28
27
|
|
|
29
28
|
enum FrontendScaffolding {
|
|
30
29
|
Vite = 'vite',
|
|
31
30
|
Next = 'next'
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
export enum RPCIntegrationType {
|
|
35
|
-
EVM = 'evm',
|
|
36
|
-
CosmJS = 'cosmos'
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export enum EVMLibrary {
|
|
40
|
-
Wagmi = 'wagmi'
|
|
41
|
-
}
|
|
42
|
-
|
|
43
33
|
interface WizardOptions {
|
|
44
34
|
name?: string;
|
|
45
35
|
framework?: FrontendScaffolding;
|
|
46
|
-
ecosystem?: RPCIntegrationType;
|
|
47
|
-
library?: EVMLibrary;
|
|
48
36
|
}
|
|
49
37
|
|
|
50
38
|
const promptFramework = async () => {
|
|
51
|
-
const {appFramework} = await inquirer.prompt([
|
|
39
|
+
const { appFramework } = await inquirer.prompt([
|
|
52
40
|
{
|
|
53
41
|
type: 'list',
|
|
54
42
|
name: 'appFramework',
|
|
@@ -58,48 +46,23 @@ const promptFramework = async () => {
|
|
|
58
46
|
]);
|
|
59
47
|
|
|
60
48
|
return appFramework;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
const promptRpcIntegrations = async () => {
|
|
64
|
-
const {rpcIntegrationType} = await inquirer.prompt([
|
|
65
|
-
{
|
|
66
|
-
type: 'list',
|
|
67
|
-
name: 'rpcIntegrationType',
|
|
68
|
-
message: 'Select the wallet connection type you want to include:',
|
|
69
|
-
choices: Object.values(RPCIntegrationType)
|
|
70
|
-
}
|
|
71
|
-
]);
|
|
72
|
-
|
|
73
|
-
return rpcIntegrationType;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
const promptEVMLibrary = async () => {
|
|
77
|
-
const {evmLibrary} = await inquirer.prompt([
|
|
78
|
-
{
|
|
79
|
-
type: 'list',
|
|
80
|
-
name: 'evmLibrary',
|
|
81
|
-
message: 'Choose your preferred EVM library:',
|
|
82
|
-
choices: Object.values(EVMLibrary)
|
|
83
|
-
}
|
|
84
|
-
]);
|
|
85
|
-
|
|
86
|
-
return evmLibrary;
|
|
87
49
|
};
|
|
88
50
|
|
|
89
51
|
function isValidDirectoryName(dirName) {
|
|
90
|
-
const illegalRe = /[<>:"
|
|
52
|
+
const illegalRe = /[<>:"/\\|?*]/g;
|
|
91
53
|
const windowsReservedRe = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i;
|
|
92
54
|
const trailingRe = /[. ]+$/;
|
|
93
55
|
const validNpmPackageRe = /^(?:@[a-z0-9-*~][a-z0-9-*._~]*)?[a-z0-9-~][a-z0-9-._~]*$/;
|
|
94
|
-
|
|
56
|
+
|
|
95
57
|
if (typeof dirName !== 'string' || dirName.length === 0) {
|
|
96
|
-
|
|
58
|
+
return false;
|
|
97
59
|
}
|
|
98
|
-
|
|
60
|
+
|
|
61
|
+
// Check for illegal characters, Windows reserved names, trailing spaces/dots
|
|
99
62
|
if (illegalRe.test(dirName) || windowsReservedRe.test(dirName) || trailingRe.test(dirName) || !validNpmPackageRe.test(dirName)) {
|
|
100
|
-
|
|
63
|
+
return false;
|
|
101
64
|
}
|
|
102
|
-
|
|
65
|
+
|
|
103
66
|
return true;
|
|
104
67
|
}
|
|
105
68
|
|
|
@@ -121,37 +84,20 @@ const validateOptions = (options: WizardOptions): boolean => {
|
|
|
121
84
|
}
|
|
122
85
|
}
|
|
123
86
|
|
|
124
|
-
if (options.ecosystem) {
|
|
125
|
-
const validEcosystems = Object.values(RPCIntegrationType);
|
|
126
|
-
if (!validEcosystems.includes(options.ecosystem)) {
|
|
127
|
-
console.log(`Invalid Ecosystem '${options.ecosystem}' provided. Framework must be one of: [${validEcosystems.join(', ')}]`);
|
|
128
|
-
valid = false;
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (options.library) {
|
|
133
|
-
const validEVMLibraries = Object.values(EVMLibrary);
|
|
134
|
-
if (!validEVMLibraries.includes(options.library)) {
|
|
135
|
-
console.log(`Invalid EVM Library '${options.library}' provided. Framework must be one of: [${validEVMLibraries.join(', ')}]`);
|
|
136
|
-
valid = false;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
87
|
return valid;
|
|
141
|
-
}
|
|
88
|
+
};
|
|
142
89
|
|
|
143
90
|
async function runWizard(options: WizardOptions): Promise<void> {
|
|
144
91
|
if (!validateOptions(options)) {
|
|
145
92
|
return;
|
|
146
93
|
}
|
|
147
|
-
|
|
94
|
+
|
|
148
95
|
printWelcomeMessage();
|
|
149
96
|
|
|
150
97
|
let dAppName = '';
|
|
151
98
|
if (options.name) {
|
|
152
|
-
dAppName = options.name
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
99
|
+
dAppName = options.name;
|
|
100
|
+
} else {
|
|
155
101
|
const promptResult = await inquirer.prompt([
|
|
156
102
|
{
|
|
157
103
|
type: 'input',
|
|
@@ -163,19 +109,15 @@ async function runWizard(options: WizardOptions): Promise<void> {
|
|
|
163
109
|
}
|
|
164
110
|
]);
|
|
165
111
|
|
|
166
|
-
dAppName = promptResult.dAppName
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const appFramework = options.framework || await promptFramework();
|
|
170
|
-
let appConnectionType = options.ecosystem || await promptRpcIntegrations();
|
|
171
|
-
if (appConnectionType == RPCIntegrationType.EVM) {
|
|
172
|
-
appConnectionType = options.library || await promptEVMLibrary();
|
|
112
|
+
dAppName = promptResult.dAppName;
|
|
173
113
|
}
|
|
174
114
|
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
const
|
|
178
|
-
|
|
115
|
+
const appFramework = options.framework || (await promptFramework());
|
|
116
|
+
|
|
117
|
+
const templateName = `${appFramework}-template`;
|
|
118
|
+
const templatePath = path.join(__dirname, 'templates', templateName);
|
|
119
|
+
const dst = path.join(process.cwd(), dAppName);
|
|
120
|
+
await fs.promises.cp(templatePath, dst, { recursive: true });
|
|
179
121
|
|
|
180
122
|
console.log(`Project setup complete! Using template ${templateName}\n`);
|
|
181
123
|
console.log(`To start your app, run: \n > cd ${dAppName} \n > yarn \n > yarn dev\n`);
|
|
@@ -184,10 +126,8 @@ async function runWizard(options: WizardOptions): Promise<void> {
|
|
|
184
126
|
program
|
|
185
127
|
.command('app')
|
|
186
128
|
.description('Create a new SEI dApp')
|
|
187
|
-
.option('-n, --name <name>',
|
|
129
|
+
.option('-n, --name <name>', 'Specify the name of your dApp. Name must be a valid package name.')
|
|
188
130
|
.option('-f, --framework <framework>', `Specify the app framework to use: [${Object.values(FrontendScaffolding).join(', ')}]`)
|
|
189
|
-
.option('-e, --ecosystem <ecosystem>', `Specify the ecosystem to use: [${Object.values(RPCIntegrationType).join(', ')}]`)
|
|
190
|
-
.option('-l, --library <library>', `Specify the EVM library to use: [${Object.values(EVMLibrary).join(', ')}]. Only used if ecosystem chosen is 'EVM'`)
|
|
191
131
|
.action(async (options: WizardOptions) => {
|
|
192
132
|
try {
|
|
193
133
|
await runWizard(options);
|
|
@@ -197,4 +137,3 @@ program
|
|
|
197
137
|
});
|
|
198
138
|
|
|
199
139
|
program.parse(process.argv);
|
|
200
|
-
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-next-sei-app",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start",
|
|
9
|
+
"lint": "next lint"
|
|
10
|
+
},
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"@rainbow-me/rainbowkit": "^2.1.2",
|
|
13
|
+
"@sei-js/evm": "^1.2.0",
|
|
14
|
+
"@tanstack/react-query": "^5.45.1",
|
|
15
|
+
"encoding": "^0.1.13",
|
|
16
|
+
"next": "14.2.4",
|
|
17
|
+
"pino-pretty": "^11.2.1",
|
|
18
|
+
"react": "^18",
|
|
19
|
+
"react-dom": "^18",
|
|
20
|
+
"viem": "^2.15.1",
|
|
21
|
+
"wagmi": "^2.10.2"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@types/node": "^20",
|
|
25
|
+
"@types/react": "^18",
|
|
26
|
+
"@types/react-dom": "^18",
|
|
27
|
+
"eslint-config-next": "14.2.4",
|
|
28
|
+
"typescript": "^5"
|
|
29
|
+
}
|
|
30
|
+
}
|