create-antd-layout 1.1.4 β 1.1.6
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/bin/index.js +57 -23
- package/package.json +1 -1
- package/templates/antd-layout-vite-max/README.md +73 -0
- package/templates/antd-layout-vite-max/index.html +1 -1
- package/templates/antd-layout-vite-max/package-lock.json +4547 -0
- package/templates/antd-layout-vite-max/package.json +5 -7
- package/templates/antd-layout-vite-max/pnpm-lock.yaml +3151 -0
- package/templates/antd-layout-vite-max/src/components/PopoverPanel.tsx +18 -48
- package/templates/antd-layout-vite-max/src/components/ThemeButton.tsx +19 -53
- package/templates/antd-layout-vite-max/src/index.css +2 -2
- package/templates/antd-layout-vite-max/src/layouts/index.tsx +29 -33
- package/templates/antd-layout-vite-max/src/pages/login.tsx +2 -2
- package/templates/antd-layout-vite-max/src/pages/system/config.tsx +73 -0
- package/templates/antd-layout-vite-max/src/pages/system/logs.tsx +41 -0
- package/templates/antd-layout-vite-max/src/pages/transaction/order.tsx +15 -253
- package/templates/antd-layout-vite-max/src/pages/transaction/product.tsx +103 -231
- package/templates/antd-layout-vite-max/src/pages/welcome.tsx +31 -0
- package/templates/antd-layout-vite-max/src/routes.ts +11 -47
- package/templates/antd-layout-vite-max/yarn.lock +2018 -0
- package/templates/antd-layout-vite-simple/README.md +73 -0
- package/templates/antd-layout-vite-simple/package-lock.json +1379 -101
- package/templates/antd-layout-vite-simple/package.json +1 -1
- package/templates/antd-layout-vite-simple/pnpm-lock.yaml +3151 -0
- package/templates/antd-layout-vite-simple/yarn.lock +2018 -0
- package/templates/antd-layout-vite-max/src/components/AppChart.tsx +0 -121
- package/templates/antd-layout-vite-max/src/components/LanguageButton.tsx +0 -54
- package/templates/antd-layout-vite-max/src/components/WardenLogo.tsx +0 -35
- package/templates/antd-layout-vite-max/src/components/typings.ts +0 -5
- package/templates/antd-layout-vite-max/src/layouts/menuData.tsx +0 -45
- package/templates/antd-layout-vite-max/src/locales/en-US/components.ts +0 -42
- package/templates/antd-layout-vite-max/src/locales/en-US/menus.ts +0 -26
- package/templates/antd-layout-vite-max/src/locales/en-US/pages.ts +0 -161
- package/templates/antd-layout-vite-max/src/locales/en-US.ts +0 -53
- package/templates/antd-layout-vite-max/src/locales/zh-CN/components.ts +0 -42
- package/templates/antd-layout-vite-max/src/locales/zh-CN/menus.ts +0 -26
- package/templates/antd-layout-vite-max/src/locales/zh-CN/pages.ts +0 -161
- package/templates/antd-layout-vite-max/src/locales/zh-CN.ts +0 -53
- package/templates/antd-layout-vite-max/src/pages/404.tsx +0 -14
- package/templates/antd-layout-vite-max/src/pages/system/organizations/components.tsx +0 -241
- package/templates/antd-layout-vite-max/src/pages/system/organizations/dept.tsx +0 -285
- package/templates/antd-layout-vite-max/src/pages/system/organizations/user.tsx +0 -224
- package/templates/antd-layout-vite-max/src/pages/system/security/components.tsx +0 -239
- package/templates/antd-layout-vite-max/src/pages/system/security/firewall.tsx +0 -212
- package/templates/antd-layout-vite-max/src/pages/system/security/permission.tsx +0 -296
- package/templates/antd-layout-vite-max/src/pages/system/security/role.tsx +0 -213
- package/templates/antd-layout-vite-max/src/pages/system/settings.tsx +0 -133
- package/templates/antd-layout-vite-max/src/pages/transaction/components.tsx +0 -410
- package/templates/antd-layout-vite-max/src/pages/typings.ts +0 -166
- package/templates/antd-layout-vite-max/src/pages/welcome/components.tsx +0 -535
- package/templates/antd-layout-vite-max/src/pages/welcome/index.module.css +0 -92
- package/templates/antd-layout-vite-max/src/pages/welcome/index.tsx +0 -39
- package/templates/antd-layout-vite-max/src/pages/workbench/monitoring/components.tsx +0 -484
- package/templates/antd-layout-vite-max/src/pages/workbench/monitoring/index.module.css +0 -11
- package/templates/antd-layout-vite-max/src/pages/workbench/monitoring/index.tsx +0 -35
- package/templates/antd-layout-vite-max/src/pages/workbench/notifications.tsx +0 -179
- package/templates/antd-layout-vite-max/src/pages/workbench/report/components.tsx +0 -312
- package/templates/antd-layout-vite-max/src/pages/workbench/report/sales.module.css +0 -36
- package/templates/antd-layout-vite-max/src/pages/workbench/report/sales.tsx +0 -37
- package/templates/antd-layout-vite-max/src/pages/workbench/report/visit.tsx +0 -228
- package/templates/antd-layout-vite-max/src/utils/printUtil.ts +0 -71
- package/templates/antd-layout-vite-max/src/utils/stringUtil.ts +0 -46
package/bin/index.js
CHANGED
|
@@ -27,7 +27,7 @@ const TEMPLATES = [
|
|
|
27
27
|
name: "SSR + Next (Pro)",
|
|
28
28
|
value: "antd-layout-pro",
|
|
29
29
|
type: "remote",
|
|
30
|
-
repo: "
|
|
30
|
+
repo: "zhouwenqi/adminui-demo-antd-layout-max",
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
33
|
const PACKAGE_MANAGERS = [
|
|
@@ -71,6 +71,20 @@ cd ${path_1.default.basename(cwd)}
|
|
|
71
71
|
${packageManager} install`));
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
+
async function startDevServer(packageManager, cwd) {
|
|
75
|
+
console.log(chalk_1.default.green(`\nπ Starting development server...\n`));
|
|
76
|
+
try {
|
|
77
|
+
if (packageManager === 'yarn') {
|
|
78
|
+
await (0, execa_1.execa)('yarn', ['dev'], { cwd, stdio: 'inherit' });
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
await (0, execa_1.execa)(packageManager, ['run', 'dev'], { cwd, stdio: 'inherit' });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
process.exit(0);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
74
88
|
const program = new commander_1.Command();
|
|
75
89
|
program
|
|
76
90
|
.name('create-antd-layout')
|
|
@@ -140,17 +154,48 @@ program
|
|
|
140
154
|
pkg.name = projectName;
|
|
141
155
|
await fs_extra_1.default.writeJSON(pkgPath, pkg, { spaces: 2 });
|
|
142
156
|
}
|
|
157
|
+
let shouldInstall = true;
|
|
158
|
+
let packageManager;
|
|
159
|
+
if (template.type === 'local') {
|
|
160
|
+
const installAnswer = await inquirer_1.default.prompt([
|
|
161
|
+
{
|
|
162
|
+
type: 'confirm',
|
|
163
|
+
name: 'shouldInstall',
|
|
164
|
+
message: 'Do you want to install dependencies and start the app now?',
|
|
165
|
+
default: true,
|
|
166
|
+
},
|
|
167
|
+
]);
|
|
168
|
+
shouldInstall = installAnswer.shouldInstall;
|
|
169
|
+
}
|
|
170
|
+
if (!shouldInstall && template.type === 'local') {
|
|
171
|
+
console.log(chalk_1.default.green(`
|
|
172
|
+
β
Project created successfully!
|
|
173
|
+
π Location: ${targetDir}
|
|
174
|
+
`));
|
|
175
|
+
console.log(chalk_1.default.yellow(`
|
|
176
|
+
π‘ To get started manually:
|
|
177
|
+
cd ${projectDir}
|
|
178
|
+
npm install # or yarn / pnpm install
|
|
179
|
+
npm run dev # or yarn dev / pnpm dev
|
|
180
|
+
`));
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
143
183
|
const detected = await detectPackageManager();
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
184
|
+
if (template.type === 'remote') {
|
|
185
|
+
packageManager = detected;
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const pmAnswer = await inquirer_1.default.prompt([
|
|
189
|
+
{
|
|
190
|
+
type: 'list',
|
|
191
|
+
name: 'packageManager',
|
|
192
|
+
message: 'Please choose package manager:',
|
|
193
|
+
choices: PACKAGE_MANAGERS,
|
|
194
|
+
default: detected,
|
|
195
|
+
},
|
|
196
|
+
]);
|
|
197
|
+
packageManager = pmAnswer.packageManager;
|
|
198
|
+
}
|
|
154
199
|
await runInstall(packageManager, targetDir);
|
|
155
200
|
console.log(chalk_1.default.green(`
|
|
156
201
|
β
Project created successfully!`));
|
|
@@ -160,17 +205,6 @@ program
|
|
|
160
205
|
π To start:`);
|
|
161
206
|
console.log(` cd ${projectDir}`);
|
|
162
207
|
console.log(` ${packageManager === 'yarn' ? 'yarn dev' : `${packageManager} run dev`}`);
|
|
163
|
-
|
|
164
|
-
try {
|
|
165
|
-
if (packageManager === 'yarn') {
|
|
166
|
-
await (0, execa_1.execa)('yarn', ['dev'], { cwd: targetDir, stdio: 'inherit' });
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
await (0, execa_1.execa)(packageManager, ['run', 'dev'], { cwd: targetDir, stdio: 'inherit' });
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
catch (error) {
|
|
173
|
-
process.exit(0);
|
|
174
|
-
}
|
|
208
|
+
await startDevServer(packageManager, targetDir);
|
|
175
209
|
});
|
|
176
210
|
program.parse();
|
package/package.json
CHANGED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# React + TypeScript + Vite
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
|
|
4
|
+
|
|
5
|
+
Currently, two official plugins are available:
|
|
6
|
+
|
|
7
|
+
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
|
|
8
|
+
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
|
|
9
|
+
|
|
10
|
+
## React Compiler
|
|
11
|
+
|
|
12
|
+
The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
|
|
13
|
+
|
|
14
|
+
## Expanding the ESLint configuration
|
|
15
|
+
|
|
16
|
+
If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
export default defineConfig([
|
|
20
|
+
globalIgnores(['dist']),
|
|
21
|
+
{
|
|
22
|
+
files: ['**/*.{ts,tsx}'],
|
|
23
|
+
extends: [
|
|
24
|
+
// Other configs...
|
|
25
|
+
|
|
26
|
+
// Remove tseslint.configs.recommended and replace with this
|
|
27
|
+
tseslint.configs.recommendedTypeChecked,
|
|
28
|
+
// Alternatively, use this for stricter rules
|
|
29
|
+
tseslint.configs.strictTypeChecked,
|
|
30
|
+
// Optionally, add this for stylistic rules
|
|
31
|
+
tseslint.configs.stylisticTypeChecked,
|
|
32
|
+
|
|
33
|
+
// Other configs...
|
|
34
|
+
],
|
|
35
|
+
languageOptions: {
|
|
36
|
+
parserOptions: {
|
|
37
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
38
|
+
tsconfigRootDir: import.meta.dirname,
|
|
39
|
+
},
|
|
40
|
+
// other options...
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
])
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
|
|
47
|
+
|
|
48
|
+
```js
|
|
49
|
+
// eslint.config.js
|
|
50
|
+
import reactX from 'eslint-plugin-react-x'
|
|
51
|
+
import reactDom from 'eslint-plugin-react-dom'
|
|
52
|
+
|
|
53
|
+
export default defineConfig([
|
|
54
|
+
globalIgnores(['dist']),
|
|
55
|
+
{
|
|
56
|
+
files: ['**/*.{ts,tsx}'],
|
|
57
|
+
extends: [
|
|
58
|
+
// Other configs...
|
|
59
|
+
// Enable lint rules for React
|
|
60
|
+
reactX.configs['recommended-typescript'],
|
|
61
|
+
// Enable lint rules for React DOM
|
|
62
|
+
reactDom.configs.recommended,
|
|
63
|
+
],
|
|
64
|
+
languageOptions: {
|
|
65
|
+
parserOptions: {
|
|
66
|
+
project: ['./tsconfig.node.json', './tsconfig.app.json'],
|
|
67
|
+
tsconfigRootDir: import.meta.dirname,
|
|
68
|
+
},
|
|
69
|
+
// other options...
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
])
|
|
73
|
+
```
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
|
-
<link rel="icon" type="image/svg+xml" href="/
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<title>adminui-demo-antd-layout-simple</title>
|
|
8
8
|
</head>
|