create-antd-layout 1.1.5 ā 1.1.7
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 +22 -57
- 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 +4585 -0
- package/templates/antd-layout-vite-max/package.json +1 -1
- package/templates/antd-layout-vite-max/pnpm-lock.yaml +3186 -0
- package/templates/antd-layout-vite-max/src/pages/workbench/logs/login.tsx +255 -0
- package/templates/antd-layout-vite-max/src/pages/workbench/logs/operation.tsx +184 -0
- package/templates/antd-layout-vite-max/yarn.lock +2044 -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/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: "zhouwenqi/adminui-demo-antd-layout-max",
|
|
30
|
+
repo: "https://github.com/zhouwenqi/adminui-demo-antd-layout-max.git",
|
|
31
31
|
},
|
|
32
32
|
];
|
|
33
33
|
const PACKAGE_MANAGERS = [
|
|
@@ -71,20 +71,6 @@ 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
|
-
}
|
|
88
74
|
const program = new commander_1.Command();
|
|
89
75
|
program
|
|
90
76
|
.name('create-antd-layout')
|
|
@@ -154,48 +140,17 @@ program
|
|
|
154
140
|
pkg.name = projectName;
|
|
155
141
|
await fs_extra_1.default.writeJSON(pkgPath, pkg, { spaces: 2 });
|
|
156
142
|
}
|
|
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
|
-
}
|
|
183
143
|
const detected = await detectPackageManager();
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
default: detected,
|
|
195
|
-
},
|
|
196
|
-
]);
|
|
197
|
-
packageManager = pmAnswer.packageManager;
|
|
198
|
-
}
|
|
144
|
+
const pmAnswer = await inquirer_1.default.prompt([
|
|
145
|
+
{
|
|
146
|
+
type: 'list',
|
|
147
|
+
name: 'packageManager',
|
|
148
|
+
message: 'Please choose package manager:',
|
|
149
|
+
choices: PACKAGE_MANAGERS,
|
|
150
|
+
default: detected,
|
|
151
|
+
},
|
|
152
|
+
]);
|
|
153
|
+
const packageManager = pmAnswer.packageManager;
|
|
199
154
|
await runInstall(packageManager, targetDir);
|
|
200
155
|
console.log(chalk_1.default.green(`
|
|
201
156
|
ā
Project created successfully!`));
|
|
@@ -205,6 +160,16 @@ program
|
|
|
205
160
|
š To start:`);
|
|
206
161
|
console.log(` cd ${projectDir}`);
|
|
207
162
|
console.log(` ${packageManager === 'yarn' ? 'yarn dev' : `${packageManager} run dev`}`);
|
|
208
|
-
|
|
163
|
+
try {
|
|
164
|
+
if (packageManager === 'yarn') {
|
|
165
|
+
await (0, execa_1.execa)('yarn', ['dev'], { cwd: targetDir, stdio: 'inherit' });
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
await (0, execa_1.execa)(packageManager, ['run', 'dev'], { cwd: targetDir, stdio: 'inherit' });
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
catch (error) {
|
|
172
|
+
process.exit(0);
|
|
173
|
+
}
|
|
209
174
|
});
|
|
210
175
|
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
|
+
```
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
-
<title>adminui-demo-antd-layout-
|
|
7
|
+
<title>adminui-demo-antd-layout-max</title>
|
|
8
8
|
</head>
|
|
9
9
|
<body>
|
|
10
10
|
<div id="root"></div>
|