nsgm-cli 2.1.12 → 2.1.13
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/README.md +11 -20
- package/generation/README.md +0 -12
- package/generation/package.json +1 -1
- package/lib/index.js +0 -20
- package/lib/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -22,18 +22,17 @@ A full-stack development framework with code template generation capabilities, h
|
|
|
22
22
|
|
|
23
23
|
### Basic Commands
|
|
24
24
|
|
|
25
|
-
| Command
|
|
26
|
-
|
|
|
27
|
-
| `nsgm init`
|
|
28
|
-
| `nsgm upgrade`
|
|
29
|
-
| `nsgm create`
|
|
30
|
-
| `nsgm delete`
|
|
31
|
-
| `nsgm deletedb`
|
|
32
|
-
| `nsgm
|
|
33
|
-
| `nsgm
|
|
34
|
-
| `nsgm
|
|
35
|
-
| `nsgm
|
|
36
|
-
| `nsgm export` | Export static pages |
|
|
25
|
+
| Command | Description |
|
|
26
|
+
| --------------- | --------------------------------------- |
|
|
27
|
+
| `nsgm init` | Initialize project |
|
|
28
|
+
| `nsgm upgrade` | Upgrade project base files |
|
|
29
|
+
| `nsgm create` | Create template page |
|
|
30
|
+
| `nsgm delete` | Delete template page |
|
|
31
|
+
| `nsgm deletedb` | Delete template page and database table |
|
|
32
|
+
| `nsgm dev` | Development mode |
|
|
33
|
+
| `nsgm start` | Production mode |
|
|
34
|
+
| `nsgm build` | Build project |
|
|
35
|
+
| `nsgm export` | Export static pages |
|
|
37
36
|
|
|
38
37
|
### Parameter Description
|
|
39
38
|
|
|
@@ -56,11 +55,6 @@ A full-stack development framework with code template generation capabilities, h
|
|
|
56
55
|
nsgm create math test
|
|
57
56
|
```
|
|
58
57
|
|
|
59
|
-
- **password**: Used with `password` command, optional parameter
|
|
60
|
-
```
|
|
61
|
-
nsgm password yourSecurePassword
|
|
62
|
-
```
|
|
63
|
-
|
|
64
58
|
## Security Configuration
|
|
65
59
|
|
|
66
60
|
For security setup and login configuration, please refer to [SECURITY.md](./SECURITY.md).
|
|
@@ -72,9 +66,6 @@ For security setup and login configuration, please refer to [SECURITY.md](./SECU
|
|
|
72
66
|
```bash
|
|
73
67
|
# Using npm script
|
|
74
68
|
npm run generate-password yourSecurePassword
|
|
75
|
-
|
|
76
|
-
# Or using nsgm directly
|
|
77
|
-
nsgm password yourSecurePassword
|
|
78
69
|
```
|
|
79
70
|
|
|
80
71
|
2. Create `.env` file:
|
package/generation/README.md
CHANGED
|
@@ -67,15 +67,6 @@
|
|
|
67
67
|
npm run export webapp
|
|
68
68
|
```
|
|
69
69
|
|
|
70
|
-
### password
|
|
71
|
-
|
|
72
|
-
- 用于 `generate-password` 命令
|
|
73
|
-
- 可选参数
|
|
74
|
-
- 示例:
|
|
75
|
-
```
|
|
76
|
-
npm run generate-password yourSecurePassword
|
|
77
|
-
```
|
|
78
|
-
|
|
79
70
|
## 项目结构
|
|
80
71
|
|
|
81
72
|
```
|
|
@@ -163,9 +154,6 @@ module.exports = {
|
|
|
163
154
|
```bash
|
|
164
155
|
# 使用 npm 脚本
|
|
165
156
|
npm run generate-password yourSecurePassword
|
|
166
|
-
|
|
167
|
-
# 或直接使用 nsgm 命令
|
|
168
|
-
npx nsgm password yourSecurePassword
|
|
169
157
|
```
|
|
170
158
|
|
|
171
159
|
2. **创建环境变量文件**:
|
package/generation/package.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"create": "nsgm create",
|
|
14
14
|
"delete": "nsgm delete",
|
|
15
15
|
"deletedb": "nsgm deletedb",
|
|
16
|
-
"generate-password": "
|
|
16
|
+
"generate-password": "node scripts/generate-password-hash.js",
|
|
17
17
|
"postversion": "git push && git push --tags",
|
|
18
18
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
19
19
|
},
|
package/lib/index.js
CHANGED
|
@@ -291,25 +291,6 @@ switch (command) {
|
|
|
291
291
|
})
|
|
292
292
|
*/
|
|
293
293
|
process.exit(0);
|
|
294
|
-
case 'password':
|
|
295
|
-
case 'generate-password':
|
|
296
|
-
const passwordScript = path_1.default.resolve(__dirname, '../scripts/generate-password-hash.js');
|
|
297
|
-
if (fs_1.default.existsSync(passwordScript)) {
|
|
298
|
-
const password = controller || ''; // 使用controller参数作为密码
|
|
299
|
-
const cmd = `node ${passwordScript} ${password}`;
|
|
300
|
-
(0, child_process_1.exec)(cmd, {}, (err, stdout) => {
|
|
301
|
-
if (err) {
|
|
302
|
-
console.error('Error generating password hash:', err);
|
|
303
|
-
return;
|
|
304
|
-
}
|
|
305
|
-
console.log(stdout);
|
|
306
|
-
process.exit(0);
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
console.error('Password generation script not found!');
|
|
311
|
-
process.exit(1);
|
|
312
|
-
}
|
|
313
294
|
case '-h':
|
|
314
295
|
case 'help':
|
|
315
296
|
case '--help':
|
|
@@ -321,7 +302,6 @@ switch (command) {
|
|
|
321
302
|
console.log(` -u or upgrade: nsgm upgrade`);
|
|
322
303
|
console.log(` -c or create: nsgm create controller action (default action is manage)`);
|
|
323
304
|
console.log(` -d or delete: nsgm delete controller action (default action is manage)`);
|
|
324
|
-
console.log(` password or generate-password: nsgm password yourpassword (generate password hash)`);
|
|
325
305
|
console.log(` dev: nsgm dev (development mode)`);
|
|
326
306
|
console.log(` build: nsgm build (production mode)`);
|
|
327
307
|
console.log(` start: nsgm start (production mode)`);
|