@sei-js/create-sei 0.0.2 → 0.0.3
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/CHANGELOG.md +6 -0
- package/README.md +16 -25
- package/biome.json +8 -0
- package/dist/main.js +12 -11
- package/dist/templates/next-cosmos-template/.eslintrc.json +1 -1
- package/dist/templates/next-cosmos-template/next.config.mjs +9 -9
- package/dist/templates/next-cosmos-template/package.json +29 -29
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
- package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
- package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
- package/dist/templates/next-cosmos-template/src/app/components/index.ts +3 -3
- package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
- package/dist/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
- package/dist/templates/next-cosmos-template/src/app/index.css +99 -86
- package/dist/templates/next-cosmos-template/src/app/layout.tsx +12 -12
- package/dist/templates/next-cosmos-template/src/app/page.tsx +13 -13
- package/dist/templates/next-cosmos-template/tsconfig.json +24 -24
- package/dist/templates/next-wagmi-template/.eslintrc.json +1 -1
- package/dist/templates/next-wagmi-template/package.json +28 -28
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
- package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
- package/dist/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
- package/dist/templates/next-wagmi-template/src/app/components/index.ts +2 -2
- package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
- package/dist/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
- package/dist/templates/next-wagmi-template/src/app/index.css +99 -86
- package/dist/templates/next-wagmi-template/src/app/layout.tsx +12 -12
- package/dist/templates/next-wagmi-template/src/app/page.tsx +17 -17
- package/dist/templates/next-wagmi-template/tsconfig.json +24 -24
- package/dist/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
- package/dist/templates/vite-cosmos-template/package.json +33 -33
- package/dist/templates/vite-cosmos-template/src/App.tsx +11 -12
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
- package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
- package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
- package/dist/templates/vite-cosmos-template/src/components/index.ts +4 -4
- package/dist/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
- package/dist/templates/vite-cosmos-template/src/constants/index.ts +1 -1
- package/dist/templates/vite-cosmos-template/src/index.css +99 -86
- package/dist/templates/vite-cosmos-template/src/main.tsx +10 -10
- package/dist/templates/vite-cosmos-template/tsconfig.app.json +21 -23
- package/dist/templates/vite-cosmos-template/tsconfig.json +9 -9
- package/dist/templates/vite-cosmos-template/tsconfig.node.json +11 -11
- package/dist/templates/vite-cosmos-template/vite.config.ts +4 -4
- package/dist/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
- package/dist/templates/vite-wagmi-template/package.json +31 -31
- package/dist/templates/vite-wagmi-template/src/App.tsx +12 -13
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
- package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
- package/dist/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
- package/dist/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
- package/dist/templates/vite-wagmi-template/src/constants/index.ts +1 -1
- package/dist/templates/vite-wagmi-template/src/index.css +98 -85
- package/dist/templates/vite-wagmi-template/src/main.tsx +10 -10
- package/dist/templates/vite-wagmi-template/tsconfig.app.json +21 -23
- package/dist/templates/vite-wagmi-template/tsconfig.json +9 -9
- package/dist/templates/vite-wagmi-template/tsconfig.node.json +11 -11
- package/dist/templates/vite-wagmi-template/vite.config.ts +7 -7
- package/package.json +3 -2
- package/src/main.ts +31 -33
- package/templates/next-cosmos-template/.eslintrc.json +1 -1
- package/templates/next-cosmos-template/next.config.mjs +9 -9
- package/templates/next-cosmos-template/package.json +29 -29
- package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
- package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
- package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
- package/templates/next-cosmos-template/src/app/components/index.ts +3 -3
- package/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
- package/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
- package/templates/next-cosmos-template/src/app/index.css +99 -86
- package/templates/next-cosmos-template/src/app/layout.tsx +12 -12
- package/templates/next-cosmos-template/src/app/page.tsx +13 -13
- package/templates/next-cosmos-template/tsconfig.json +24 -24
- package/templates/next-wagmi-template/.eslintrc.json +1 -1
- package/templates/next-wagmi-template/package.json +28 -28
- package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
- package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
- package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
- package/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
- package/templates/next-wagmi-template/src/app/components/index.ts +2 -2
- package/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
- package/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
- package/templates/next-wagmi-template/src/app/index.css +99 -86
- package/templates/next-wagmi-template/src/app/layout.tsx +12 -12
- package/templates/next-wagmi-template/src/app/page.tsx +17 -17
- package/templates/next-wagmi-template/tsconfig.json +24 -24
- package/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
- package/templates/vite-cosmos-template/package.json +33 -33
- package/templates/vite-cosmos-template/src/App.tsx +11 -12
- package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
- package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
- package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
- package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
- package/templates/vite-cosmos-template/src/components/index.ts +4 -4
- package/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
- package/templates/vite-cosmos-template/src/constants/index.ts +1 -1
- package/templates/vite-cosmos-template/src/index.css +99 -86
- package/templates/vite-cosmos-template/src/main.tsx +10 -10
- package/templates/vite-cosmos-template/tsconfig.app.json +21 -23
- package/templates/vite-cosmos-template/tsconfig.json +9 -9
- package/templates/vite-cosmos-template/tsconfig.node.json +11 -11
- package/templates/vite-cosmos-template/vite.config.ts +4 -4
- package/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
- package/templates/vite-wagmi-template/package.json +31 -31
- package/templates/vite-wagmi-template/src/App.tsx +12 -13
- package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
- package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
- package/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
- package/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
- package/templates/vite-wagmi-template/src/constants/index.ts +1 -1
- package/templates/vite-wagmi-template/src/index.css +98 -85
- package/templates/vite-wagmi-template/src/main.tsx +10 -10
- package/templates/vite-wagmi-template/tsconfig.app.json +21 -23
- package/templates/vite-wagmi-template/tsconfig.json +9 -9
- package/templates/vite-wagmi-template/tsconfig.node.json +11 -11
- package/templates/vite-wagmi-template/vite.config.ts +7 -7
- package/tsconfig.json +24 -28
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
/*
|
|
2
2
|
1. Use a more-intuitive box-sizing model.
|
|
3
3
|
*/
|
|
4
|
-
*,
|
|
5
|
-
|
|
4
|
+
*,
|
|
5
|
+
*::before,
|
|
6
|
+
*::after {
|
|
7
|
+
box-sizing: border-box;
|
|
6
8
|
}
|
|
7
9
|
/*
|
|
8
10
|
2. Remove default margin
|
|
9
11
|
*/
|
|
10
12
|
* {
|
|
11
|
-
|
|
13
|
+
margin: 0;
|
|
12
14
|
}
|
|
13
15
|
/*
|
|
14
16
|
Typographic tweaks!
|
|
@@ -16,155 +18,166 @@
|
|
|
16
18
|
4. Improve text rendering
|
|
17
19
|
*/
|
|
18
20
|
body {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
line-height: 1.5;
|
|
22
|
+
-webkit-font-smoothing: antialiased;
|
|
21
23
|
}
|
|
22
24
|
/*
|
|
23
25
|
5. Improve media defaults
|
|
24
26
|
*/
|
|
25
|
-
img,
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
img,
|
|
28
|
+
picture,
|
|
29
|
+
video,
|
|
30
|
+
canvas,
|
|
31
|
+
svg {
|
|
32
|
+
display: block;
|
|
33
|
+
max-width: 100%;
|
|
28
34
|
}
|
|
29
35
|
/*
|
|
30
36
|
6. Remove built-in form typography styles
|
|
31
37
|
*/
|
|
32
|
-
input,
|
|
33
|
-
|
|
38
|
+
input,
|
|
39
|
+
button,
|
|
40
|
+
textarea,
|
|
41
|
+
select {
|
|
42
|
+
font: inherit;
|
|
34
43
|
}
|
|
35
44
|
/*
|
|
36
45
|
7. Avoid text overflows
|
|
37
46
|
*/
|
|
38
|
-
p,
|
|
39
|
-
|
|
40
|
-
|
|
47
|
+
p,
|
|
48
|
+
h1,
|
|
49
|
+
h2,
|
|
50
|
+
h3,
|
|
51
|
+
h4,
|
|
52
|
+
h5,
|
|
53
|
+
h6 {
|
|
54
|
+
overflow-wrap: break-word;
|
|
55
|
+
line-height: 1;
|
|
41
56
|
}
|
|
42
57
|
/*
|
|
43
58
|
8. Create a root stacking context
|
|
44
59
|
*/
|
|
45
|
-
#root,
|
|
46
|
-
|
|
60
|
+
#root,
|
|
61
|
+
#__next {
|
|
62
|
+
isolation: isolate;
|
|
47
63
|
}
|
|
48
64
|
|
|
49
|
-
|
|
50
65
|
:root {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
66
|
+
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
|
67
|
+
line-height: 1.5;
|
|
68
|
+
font-weight: 400;
|
|
54
69
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
70
|
+
color-scheme: light dark;
|
|
71
|
+
color: #000;
|
|
72
|
+
background: var(--background);
|
|
58
73
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
74
|
+
font-synthesis: none;
|
|
75
|
+
text-rendering: optimizeLegibility;
|
|
76
|
+
-webkit-font-smoothing: antialiased;
|
|
77
|
+
-moz-osx-font-smoothing: grayscale;
|
|
63
78
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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;
|
|
70
85
|
}
|
|
71
86
|
|
|
72
87
|
a {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
88
|
+
font-weight: 500;
|
|
89
|
+
color: var(--primary-color);
|
|
90
|
+
text-decoration: inherit;
|
|
76
91
|
}
|
|
77
92
|
a:hover {
|
|
78
|
-
|
|
93
|
+
color: var(--primary-color-hover);
|
|
79
94
|
}
|
|
80
95
|
|
|
81
96
|
body {
|
|
82
|
-
|
|
83
|
-
|
|
97
|
+
margin: 0;
|
|
98
|
+
padding: 0;
|
|
84
99
|
}
|
|
85
100
|
|
|
86
101
|
h1 {
|
|
87
|
-
|
|
88
|
-
|
|
102
|
+
font-size: 3.2em;
|
|
103
|
+
line-height: 1;
|
|
89
104
|
}
|
|
90
105
|
code {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
color: var(--card-foreground);
|
|
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);
|
|
98
112
|
}
|
|
99
113
|
|
|
100
114
|
button {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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;
|
|
111
125
|
}
|
|
112
126
|
button:hover {
|
|
113
|
-
|
|
127
|
+
background-color: #b5afa7;
|
|
114
128
|
}
|
|
115
129
|
|
|
116
130
|
button:disabled {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
filter: grayscale(1) opacity(0.5);
|
|
132
|
+
color: rgb(56, 55, 55);
|
|
133
|
+
pointer-events: none;
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
button.primary {
|
|
123
|
-
|
|
137
|
+
background-color: var(--primary-color);
|
|
124
138
|
}
|
|
125
139
|
button.outline {
|
|
126
|
-
|
|
127
|
-
|
|
140
|
+
background-color: transparent;
|
|
141
|
+
border: 1px solid var(--border);
|
|
128
142
|
}
|
|
129
143
|
|
|
130
144
|
button.primary:hover {
|
|
131
|
-
|
|
145
|
+
background-color: var(--primary-color-hover);
|
|
132
146
|
}
|
|
133
147
|
|
|
134
148
|
button.secondary {
|
|
135
|
-
|
|
136
|
-
|
|
149
|
+
background-color: #000;
|
|
150
|
+
color: black;
|
|
137
151
|
}
|
|
138
152
|
|
|
139
153
|
button.secondary:hover {
|
|
140
|
-
|
|
154
|
+
background-color: #2b2b2b;
|
|
141
155
|
}
|
|
142
156
|
|
|
143
157
|
button:active {
|
|
144
|
-
|
|
158
|
+
transform: translateY(1px);
|
|
145
159
|
}
|
|
146
160
|
|
|
147
161
|
button.small {
|
|
148
|
-
|
|
149
|
-
|
|
162
|
+
padding: 0.4em 0.8em;
|
|
163
|
+
font-size: 0.8em;
|
|
150
164
|
}
|
|
151
165
|
|
|
152
|
-
|
|
153
166
|
button:focus-visible {
|
|
154
|
-
|
|
155
|
-
|
|
167
|
+
outline: 4px auto -webkit-focus-ring-color;
|
|
168
|
+
outline-offset: 4px;
|
|
156
169
|
}
|
|
157
170
|
|
|
158
171
|
.header {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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;
|
|
170
183
|
}
|
|
@@ -1,12 +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'
|
|
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
5
|
|
|
6
6
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
)
|
|
7
|
+
<React.StrictMode>
|
|
8
|
+
<Web3Provider>
|
|
9
|
+
<App />
|
|
10
|
+
</Web3Provider>
|
|
11
|
+
</React.StrictMode>
|
|
12
|
+
);
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"jsx": "react-jsx",
|
|
11
|
+
"moduleResolution": "bundler",
|
|
12
|
+
"allowImportingTsExtensions": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"isolatedModules": true,
|
|
15
|
+
"moduleDetection": "force",
|
|
16
|
+
"noEmit": true,
|
|
17
|
+
"jsx": "react-jsx",
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"include": ["src"]
|
|
19
|
+
"strict": true,
|
|
20
|
+
"noUnusedLocals": true,
|
|
21
|
+
"noUnusedParameters": true,
|
|
22
|
+
"noFallthroughCasesInSwitch": true
|
|
23
|
+
},
|
|
24
|
+
"include": ["src"]
|
|
27
25
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
"files": [],
|
|
3
|
+
"references": [
|
|
4
|
+
{
|
|
5
|
+
"path": "./tsconfig.app.json"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"path": "./tsconfig.node.json"
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
11
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
9
|
"allowImportingTsExtensions": true,
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
"strict": true,
|
|
11
|
+
"noEmit": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["vite.config.ts"]
|
|
14
14
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import react from '@vitejs/plugin-react'
|
|
1
|
+
import { defineConfig } from 'vite';
|
|
2
|
+
import react from '@vitejs/plugin-react';
|
|
3
3
|
|
|
4
4
|
// https://vitejs.dev/config/
|
|
5
5
|
export default defineConfig({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
})
|
|
6
|
+
plugins: [react()],
|
|
7
|
+
optimizeDeps: {
|
|
8
|
+
exclude: ['js-big-decimal']
|
|
9
|
+
}
|
|
10
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sei-js/create-sei",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"module": "dist/main.js",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "./dist/main.js",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc && cp -r ./templates ./dist/templates",
|
|
9
|
-
"dev": "node --loader ts-node/esm src/main.ts"
|
|
9
|
+
"dev": "node --loader ts-node/esm src/main.ts",
|
|
10
|
+
"docs": "typedoc --out docs"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"boxen": "^7.1.1",
|
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,8 +23,7 @@ const printWelcomeMessage = () => {
|
|
|
23
23
|
borderColor: '#932C23'
|
|
24
24
|
})
|
|
25
25
|
);
|
|
26
|
-
}
|
|
27
|
-
|
|
26
|
+
};
|
|
28
27
|
|
|
29
28
|
enum FrontendScaffolding {
|
|
30
29
|
Vite = 'vite',
|
|
@@ -48,7 +47,7 @@ interface WizardOptions {
|
|
|
48
47
|
}
|
|
49
48
|
|
|
50
49
|
const promptFramework = async () => {
|
|
51
|
-
const {appFramework} = await inquirer.prompt([
|
|
50
|
+
const { appFramework } = await inquirer.prompt([
|
|
52
51
|
{
|
|
53
52
|
type: 'list',
|
|
54
53
|
name: 'appFramework',
|
|
@@ -58,10 +57,10 @@ const promptFramework = async () => {
|
|
|
58
57
|
]);
|
|
59
58
|
|
|
60
59
|
return appFramework;
|
|
61
|
-
}
|
|
60
|
+
};
|
|
62
61
|
|
|
63
62
|
const promptRpcIntegrations = async () => {
|
|
64
|
-
const {rpcIntegrationType} = await inquirer.prompt([
|
|
63
|
+
const { rpcIntegrationType } = await inquirer.prompt([
|
|
65
64
|
{
|
|
66
65
|
type: 'list',
|
|
67
66
|
name: 'rpcIntegrationType',
|
|
@@ -74,7 +73,7 @@ const promptRpcIntegrations = async () => {
|
|
|
74
73
|
};
|
|
75
74
|
|
|
76
75
|
const promptEVMLibrary = async () => {
|
|
77
|
-
const {evmLibrary} = await inquirer.prompt([
|
|
76
|
+
const { evmLibrary } = await inquirer.prompt([
|
|
78
77
|
{
|
|
79
78
|
type: 'list',
|
|
80
79
|
name: 'evmLibrary',
|
|
@@ -87,19 +86,20 @@ const promptEVMLibrary = async () => {
|
|
|
87
86
|
};
|
|
88
87
|
|
|
89
88
|
function isValidDirectoryName(dirName) {
|
|
90
|
-
const illegalRe = /[<>:"
|
|
89
|
+
const illegalRe = /[<>:"/\\|?*]/g;
|
|
91
90
|
const windowsReservedRe = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i;
|
|
92
91
|
const trailingRe = /[. ]+$/;
|
|
93
92
|
const validNpmPackageRe = /^(?:@[a-z0-9-*~][a-z0-9-*._~]*)?[a-z0-9-~][a-z0-9-._~]*$/;
|
|
94
|
-
|
|
93
|
+
|
|
95
94
|
if (typeof dirName !== 'string' || dirName.length === 0) {
|
|
96
|
-
|
|
95
|
+
return false;
|
|
97
96
|
}
|
|
98
|
-
|
|
97
|
+
|
|
98
|
+
// Check for illegal characters, Windows reserved names, trailing spaces/dots
|
|
99
99
|
if (illegalRe.test(dirName) || windowsReservedRe.test(dirName) || trailingRe.test(dirName) || !validNpmPackageRe.test(dirName)) {
|
|
100
|
-
|
|
100
|
+
return false;
|
|
101
101
|
}
|
|
102
|
-
|
|
102
|
+
|
|
103
103
|
return true;
|
|
104
104
|
}
|
|
105
105
|
|
|
@@ -138,20 +138,19 @@ const validateOptions = (options: WizardOptions): boolean => {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
return valid;
|
|
141
|
-
}
|
|
141
|
+
};
|
|
142
142
|
|
|
143
143
|
async function runWizard(options: WizardOptions): Promise<void> {
|
|
144
144
|
if (!validateOptions(options)) {
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
|
|
148
148
|
printWelcomeMessage();
|
|
149
149
|
|
|
150
150
|
let dAppName = '';
|
|
151
151
|
if (options.name) {
|
|
152
|
-
dAppName = options.name
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
152
|
+
dAppName = options.name;
|
|
153
|
+
} else {
|
|
155
154
|
const promptResult = await inquirer.prompt([
|
|
156
155
|
{
|
|
157
156
|
type: 'input',
|
|
@@ -163,19 +162,19 @@ async function runWizard(options: WizardOptions): Promise<void> {
|
|
|
163
162
|
}
|
|
164
163
|
]);
|
|
165
164
|
|
|
166
|
-
dAppName = promptResult.dAppName
|
|
167
|
-
}
|
|
165
|
+
dAppName = promptResult.dAppName;
|
|
166
|
+
}
|
|
168
167
|
|
|
169
|
-
const appFramework = options.framework || await promptFramework();
|
|
170
|
-
let appConnectionType = options.ecosystem || await promptRpcIntegrations();
|
|
171
|
-
if (appConnectionType
|
|
172
|
-
appConnectionType = options.library || await promptEVMLibrary();
|
|
168
|
+
const appFramework = options.framework || (await promptFramework());
|
|
169
|
+
let appConnectionType = options.ecosystem || (await promptRpcIntegrations());
|
|
170
|
+
if (appConnectionType === RPCIntegrationType.EVM) {
|
|
171
|
+
appConnectionType = options.library || (await promptEVMLibrary());
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
const templateName = `${appFramework}-${appConnectionType}-template`;
|
|
176
|
-
const templatePath = path.join(__dirname, 'templates', templateName)
|
|
177
|
-
const dst = path.join(process.cwd(), dAppName)
|
|
178
|
-
await fs.promises.cp(templatePath,
|
|
175
|
+
const templatePath = path.join(__dirname, 'templates', templateName);
|
|
176
|
+
const dst = path.join(process.cwd(), dAppName);
|
|
177
|
+
await fs.promises.cp(templatePath, dst, { recursive: true });
|
|
179
178
|
|
|
180
179
|
console.log(`Project setup complete! Using template ${templateName}\n`);
|
|
181
180
|
console.log(`To start your app, run: \n > cd ${dAppName} \n > yarn \n > yarn dev\n`);
|
|
@@ -184,7 +183,7 @@ async function runWizard(options: WizardOptions): Promise<void> {
|
|
|
184
183
|
program
|
|
185
184
|
.command('app')
|
|
186
185
|
.description('Create a new SEI dApp')
|
|
187
|
-
.option('-n, --name <name>',
|
|
186
|
+
.option('-n, --name <name>', 'Specify the name of your dApp. Name must be a valid package name.')
|
|
188
187
|
.option('-f, --framework <framework>', `Specify the app framework to use: [${Object.values(FrontendScaffolding).join(', ')}]`)
|
|
189
188
|
.option('-e, --ecosystem <ecosystem>', `Specify the ecosystem to use: [${Object.values(RPCIntegrationType).join(', ')}]`)
|
|
190
189
|
.option('-l, --library <library>', `Specify the EVM library to use: [${Object.values(EVMLibrary).join(', ')}]. Only used if ecosystem chosen is 'EVM'`)
|
|
@@ -197,4 +196,3 @@ program
|
|
|
197
196
|
});
|
|
198
197
|
|
|
199
198
|
program.parse(process.argv);
|
|
200
|
-
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** @type {import('next').NextConfig} */
|
|
2
2
|
const nextConfig = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
images: {
|
|
4
|
+
remotePatterns: [
|
|
5
|
+
{
|
|
6
|
+
protocol: 'https',
|
|
7
|
+
hostname: 'cdn.sei.io',
|
|
8
|
+
port: ''
|
|
9
|
+
}
|
|
10
|
+
]
|
|
11
|
+
}
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default nextConfig;
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
2
|
+
"name": "template-next-cosmos-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
|
+
"@cosmos-kit/react": "^2.17.0",
|
|
13
|
+
"@interchain-ui/react": "1.23.21",
|
|
14
|
+
"@interchain-ui/react-no-ssr": "^0.1.4",
|
|
15
|
+
"@sei-js/cosmjs": "^1.0.7",
|
|
16
|
+
"@tanstack/react-query": "^5.45.1",
|
|
17
|
+
"chain-registry": "^1.63.5",
|
|
18
|
+
"cosmos-kit": "^2.18.0",
|
|
19
|
+
"next": "14.2.4",
|
|
20
|
+
"pino-pretty": "^11.2.1",
|
|
21
|
+
"react": "^18",
|
|
22
|
+
"react-dom": "^18"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20",
|
|
26
|
+
"@types/react": "^18",
|
|
27
|
+
"@types/react-dom": "^18",
|
|
28
|
+
"eslint-config-next": "14.2.4",
|
|
29
|
+
"typescript": "^5"
|
|
30
|
+
}
|
|
31
31
|
}
|