@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.
Files changed (127) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +16 -25
  3. package/biome.json +8 -0
  4. package/dist/main.js +12 -11
  5. package/dist/templates/next-cosmos-template/.eslintrc.json +1 -1
  6. package/dist/templates/next-cosmos-template/next.config.mjs +9 -9
  7. package/dist/templates/next-cosmos-template/package.json +29 -29
  8. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
  9. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
  10. package/dist/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
  11. package/dist/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  12. package/dist/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
  13. package/dist/templates/next-cosmos-template/src/app/components/index.ts +3 -3
  14. package/dist/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
  15. package/dist/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
  16. package/dist/templates/next-cosmos-template/src/app/index.css +99 -86
  17. package/dist/templates/next-cosmos-template/src/app/layout.tsx +12 -12
  18. package/dist/templates/next-cosmos-template/src/app/page.tsx +13 -13
  19. package/dist/templates/next-cosmos-template/tsconfig.json +24 -24
  20. package/dist/templates/next-wagmi-template/.eslintrc.json +1 -1
  21. package/dist/templates/next-wagmi-template/package.json +28 -28
  22. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
  23. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
  24. package/dist/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
  25. package/dist/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
  26. package/dist/templates/next-wagmi-template/src/app/components/index.ts +2 -2
  27. package/dist/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
  28. package/dist/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
  29. package/dist/templates/next-wagmi-template/src/app/index.css +99 -86
  30. package/dist/templates/next-wagmi-template/src/app/layout.tsx +12 -12
  31. package/dist/templates/next-wagmi-template/src/app/page.tsx +17 -17
  32. package/dist/templates/next-wagmi-template/tsconfig.json +24 -24
  33. package/dist/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
  34. package/dist/templates/vite-cosmos-template/package.json +33 -33
  35. package/dist/templates/vite-cosmos-template/src/App.tsx +11 -12
  36. package/dist/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
  37. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
  38. package/dist/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
  39. package/dist/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  40. package/dist/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
  41. package/dist/templates/vite-cosmos-template/src/components/index.ts +4 -4
  42. package/dist/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
  43. package/dist/templates/vite-cosmos-template/src/constants/index.ts +1 -1
  44. package/dist/templates/vite-cosmos-template/src/index.css +99 -86
  45. package/dist/templates/vite-cosmos-template/src/main.tsx +10 -10
  46. package/dist/templates/vite-cosmos-template/tsconfig.app.json +21 -23
  47. package/dist/templates/vite-cosmos-template/tsconfig.json +9 -9
  48. package/dist/templates/vite-cosmos-template/tsconfig.node.json +11 -11
  49. package/dist/templates/vite-cosmos-template/vite.config.ts +4 -4
  50. package/dist/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
  51. package/dist/templates/vite-wagmi-template/package.json +31 -31
  52. package/dist/templates/vite-wagmi-template/src/App.tsx +12 -13
  53. package/dist/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
  54. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
  55. package/dist/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
  56. package/dist/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
  57. package/dist/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
  58. package/dist/templates/vite-wagmi-template/src/constants/index.ts +1 -1
  59. package/dist/templates/vite-wagmi-template/src/index.css +98 -85
  60. package/dist/templates/vite-wagmi-template/src/main.tsx +10 -10
  61. package/dist/templates/vite-wagmi-template/tsconfig.app.json +21 -23
  62. package/dist/templates/vite-wagmi-template/tsconfig.json +9 -9
  63. package/dist/templates/vite-wagmi-template/tsconfig.node.json +11 -11
  64. package/dist/templates/vite-wagmi-template/vite.config.ts +7 -7
  65. package/package.json +3 -2
  66. package/src/main.ts +31 -33
  67. package/templates/next-cosmos-template/.eslintrc.json +1 -1
  68. package/templates/next-cosmos-template/next.config.mjs +9 -9
  69. package/templates/next-cosmos-template/package.json +29 -29
  70. package/templates/next-cosmos-template/src/app/components/Homepage/Examples.tsx +162 -171
  71. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.css +92 -94
  72. package/templates/next-cosmos-template/src/app/components/Homepage/Homepage.tsx +22 -49
  73. package/templates/next-cosmos-template/src/app/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  74. package/templates/next-cosmos-template/src/app/components/Web3Provider.tsx +13 -17
  75. package/templates/next-cosmos-template/src/app/components/index.ts +3 -3
  76. package/templates/next-cosmos-template/src/app/constants/chain.ts +9 -9
  77. package/templates/next-cosmos-template/src/app/constants/index.ts +1 -1
  78. package/templates/next-cosmos-template/src/app/index.css +99 -86
  79. package/templates/next-cosmos-template/src/app/layout.tsx +12 -12
  80. package/templates/next-cosmos-template/src/app/page.tsx +13 -13
  81. package/templates/next-cosmos-template/tsconfig.json +24 -24
  82. package/templates/next-wagmi-template/.eslintrc.json +1 -1
  83. package/templates/next-wagmi-template/package.json +28 -28
  84. package/templates/next-wagmi-template/src/app/components/Homepage/Examples.tsx +223 -237
  85. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.css +92 -94
  86. package/templates/next-wagmi-template/src/app/components/Homepage/Homepage.tsx +10 -36
  87. package/templates/next-wagmi-template/src/app/components/Web3Provider.tsx +29 -28
  88. package/templates/next-wagmi-template/src/app/components/index.ts +2 -2
  89. package/templates/next-wagmi-template/src/app/constants/chain.ts +2 -2
  90. package/templates/next-wagmi-template/src/app/constants/index.ts +1 -1
  91. package/templates/next-wagmi-template/src/app/index.css +99 -86
  92. package/templates/next-wagmi-template/src/app/layout.tsx +12 -12
  93. package/templates/next-wagmi-template/src/app/page.tsx +17 -17
  94. package/templates/next-wagmi-template/tsconfig.json +24 -24
  95. package/templates/vite-cosmos-template/.eslintrc.cjs +10 -17
  96. package/templates/vite-cosmos-template/package.json +33 -33
  97. package/templates/vite-cosmos-template/src/App.tsx +11 -12
  98. package/templates/vite-cosmos-template/src/components/Homepage/Examples.tsx +162 -171
  99. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.css +92 -94
  100. package/templates/vite-cosmos-template/src/components/Homepage/Homepage.tsx +20 -45
  101. package/templates/vite-cosmos-template/src/components/WalletConnectButton/WalletConnectButton.tsx +11 -19
  102. package/templates/vite-cosmos-template/src/components/Web3Provider.tsx +14 -18
  103. package/templates/vite-cosmos-template/src/components/index.ts +4 -4
  104. package/templates/vite-cosmos-template/src/constants/chain.ts +9 -9
  105. package/templates/vite-cosmos-template/src/constants/index.ts +1 -1
  106. package/templates/vite-cosmos-template/src/index.css +99 -86
  107. package/templates/vite-cosmos-template/src/main.tsx +10 -10
  108. package/templates/vite-cosmos-template/tsconfig.app.json +21 -23
  109. package/templates/vite-cosmos-template/tsconfig.json +9 -9
  110. package/templates/vite-cosmos-template/tsconfig.node.json +11 -11
  111. package/templates/vite-cosmos-template/vite.config.ts +4 -4
  112. package/templates/vite-wagmi-template/.eslintrc.cjs +10 -17
  113. package/templates/vite-wagmi-template/package.json +31 -31
  114. package/templates/vite-wagmi-template/src/App.tsx +12 -13
  115. package/templates/vite-wagmi-template/src/components/Homepage/Examples.tsx +225 -239
  116. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.css +92 -94
  117. package/templates/vite-wagmi-template/src/components/Homepage/Homepage.tsx +28 -53
  118. package/templates/vite-wagmi-template/src/components/Web3Provider.tsx +29 -28
  119. package/templates/vite-wagmi-template/src/constants/chain.ts +1 -1
  120. package/templates/vite-wagmi-template/src/constants/index.ts +1 -1
  121. package/templates/vite-wagmi-template/src/index.css +98 -85
  122. package/templates/vite-wagmi-template/src/main.tsx +10 -10
  123. package/templates/vite-wagmi-template/tsconfig.app.json +21 -23
  124. package/templates/vite-wagmi-template/tsconfig.json +9 -9
  125. package/templates/vite-wagmi-template/tsconfig.node.json +11 -11
  126. package/templates/vite-wagmi-template/vite.config.ts +7 -7
  127. package/tsconfig.json +24 -28
@@ -1,14 +1,16 @@
1
1
  /*
2
2
  1. Use a more-intuitive box-sizing model.
3
3
  */
4
- *, *::before, *::after {
5
- box-sizing: border-box;
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
- margin: 0;
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
- line-height: 1.5;
20
- -webkit-font-smoothing: antialiased;
21
+ line-height: 1.5;
22
+ -webkit-font-smoothing: antialiased;
21
23
  }
22
24
  /*
23
25
  5. Improve media defaults
24
26
  */
25
- img, picture, video, canvas, svg {
26
- display: block;
27
- max-width: 100%;
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, button, textarea, select {
33
- font: inherit;
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, h1, h2, h3, h4, h5, h6 {
39
- overflow-wrap: break-word;
40
- line-height: 1;
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, #__next {
46
- isolation: isolate;
60
+ #root,
61
+ #__next {
62
+ isolation: isolate;
47
63
  }
48
64
 
49
-
50
65
  :root {
51
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
52
- line-height: 1.5;
53
- font-weight: 400;
66
+ font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
67
+ line-height: 1.5;
68
+ font-weight: 400;
54
69
 
55
- color-scheme: light dark;
56
- color:#000;
57
- background: var(--background);
70
+ color-scheme: light dark;
71
+ color: #000;
72
+ background: var(--background);
58
73
 
59
- font-synthesis: none;
60
- text-rendering: optimizeLegibility;
61
- -webkit-font-smoothing: antialiased;
62
- -moz-osx-font-smoothing: grayscale;
74
+ font-synthesis: none;
75
+ text-rendering: optimizeLegibility;
76
+ -webkit-font-smoothing: antialiased;
77
+ -moz-osx-font-smoothing: grayscale;
63
78
 
64
- --primary-color: #9F1239;
65
- --primary-color-hover: #7F0A2E;
66
- --background: linear-gradient(180deg, #F5F5F4 0%, #FFF 100%);
67
- --border: #D6D3D1;
68
- --card: #FFF;
69
- --card-foreground: #242424;
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
- font-weight: 500;
74
- color: var(--primary-color);
75
- text-decoration: inherit;
88
+ font-weight: 500;
89
+ color: var(--primary-color);
90
+ text-decoration: inherit;
76
91
  }
77
92
  a:hover {
78
- color: var(--primary-color-hover)
93
+ color: var(--primary-color-hover);
79
94
  }
80
95
 
81
96
  body {
82
- margin: 0;
83
- padding: 0;
97
+ margin: 0;
98
+ padding: 0;
84
99
  }
85
100
 
86
101
  h1 {
87
- font-size: 3.2em;
88
- line-height: 1;
102
+ font-size: 3.2em;
103
+ line-height: 1;
89
104
  }
90
105
  code {
91
- font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
92
- monospace;
93
- display: inline-flex;
94
- border-radius: 4px;
95
- padding: 0.1rem 0.4rem;
96
- background-color: #d7cccc;
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
- border-radius: 4rem;
102
- border: 1px solid transparent;
103
- padding: 0.6em 1.2em;
104
- font-size: 1em;
105
- font-weight: 500;
106
- font-family: inherit;
107
- background-color: #cec9c1;
108
- cursor: pointer;
109
- transition: all 0.25s ease;
110
- color: black
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
- background-color: #b5afa7;
127
+ background-color: #b5afa7;
114
128
  }
115
129
 
116
130
  button:disabled {
117
- filter:grayscale(1) opacity(0.5);
118
- color: rgb(56, 55, 55);
119
- pointer-events: none;
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
- background-color: var(--primary-color);
137
+ background-color: var(--primary-color);
124
138
  }
125
139
  button.outline {
126
- background-color: transparent;
127
- border: 1px solid var(--border);
140
+ background-color: transparent;
141
+ border: 1px solid var(--border);
128
142
  }
129
143
 
130
144
  button.primary:hover {
131
- background-color: var(--primary-color-hover);
145
+ background-color: var(--primary-color-hover);
132
146
  }
133
147
 
134
148
  button.secondary {
135
- background-color: #000;
136
- color: black;
149
+ background-color: #000;
150
+ color: black;
137
151
  }
138
152
 
139
153
  button.secondary:hover {
140
- background-color: #2b2b2b;
154
+ background-color: #2b2b2b;
141
155
  }
142
156
 
143
157
  button:active {
144
- transform: translateY(1px);
158
+ transform: translateY(1px);
145
159
  }
146
160
 
147
161
  button.small {
148
- padding: 0.4em 0.8em;
149
- font-size: 0.8em;
162
+ padding: 0.4em 0.8em;
163
+ font-size: 0.8em;
150
164
  }
151
165
 
152
-
153
166
  button:focus-visible {
154
- outline: 4px auto -webkit-focus-ring-color;
155
- outline-offset: 4px;
167
+ outline: 4px auto -webkit-focus-ring-color;
168
+ outline-offset: 4px;
156
169
  }
157
170
 
158
171
  .header {
159
- width: 100%;
160
- height: 4rem;
161
- padding: 0 1%;
162
- display: flex;
163
- align-items: center;
164
- justify-content: right;
165
- background-color: transparent;
166
- border-bottom: 1px solid var(--border);
167
- position: sticky;
168
- top: 0;
169
- background: #F5F5F4;
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
- <React.StrictMode>
8
- <Web3Provider>
9
- <App />
10
- </Web3Provider>
11
- </React.StrictMode>,
12
- )
7
+ <React.StrictMode>
8
+ <Web3Provider>
9
+ <App />
10
+ </Web3Provider>
11
+ </React.StrictMode>
12
+ );
@@ -1,27 +1,25 @@
1
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,
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
- /* Bundler mode */
12
- "moduleResolution": "bundler",
13
- "allowImportingTsExtensions": true,
14
- "resolveJsonModule": true,
15
- "isolatedModules": true,
16
- "moduleDetection": "force",
17
- "noEmit": true,
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
- /* Linting */
21
- "strict": true,
22
- "noUnusedLocals": true,
23
- "noUnusedParameters": true,
24
- "noFallthroughCasesInSwitch": true
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
- "files": [],
3
- "references": [
4
- {
5
- "path": "./tsconfig.app.json"
6
- },
7
- {
8
- "path": "./tsconfig.node.json"
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
- "compilerOptions": {
3
- "composite": true,
4
- "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
- "skipLibCheck": true,
6
- "module": "ESNext",
7
- "moduleResolution": "bundler",
8
- "allowSyntheticDefaultImports": true,
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
- "strict": true,
11
- "noEmit": true
12
- },
13
- "include": ["vite.config.ts"]
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
- plugins: [react()],
7
- optimizeDeps: {
8
- exclude: ['js-big-decimal']
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.2",
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 path from 'path';
6
- import fs from 'fs';
7
- import { fileURLToPath } from 'url';
8
- import { dirname } from 'path';
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 = /[<>:"/\\|?*\x00-\x1F]/g;
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
- return false;
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
- return false;
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 == RPCIntegrationType.EVM) {
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, dst, {recursive: true})
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>', `Specify the name of your dApp. Name must be a valid package 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,3 +1,3 @@
1
1
  {
2
- "extends": "next/core-web-vitals"
2
+ "extends": "next/core-web-vitals"
3
3
  }
@@ -1,14 +1,14 @@
1
1
  /** @type {import('next').NextConfig} */
2
2
  const nextConfig = {
3
- images: {
4
- remotePatterns: [
5
- {
6
- protocol: 'https',
7
- hostname: 'cdn.sei.io',
8
- port: '',
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
- "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
- }
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
  }