@gadmin2n/cli 0.0.151 → 0.0.152
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/actions/prisma.action.js
CHANGED
|
@@ -186,8 +186,36 @@ class PrismaAction extends abstract_action_1.AbstractAction {
|
|
|
186
186
|
shell.sed('-i', new RegExp('bigint', 'g'), 'number', 'web/src/generated/types/prisma.types.d.ts');
|
|
187
187
|
fs.copyFileSync('config/.types.d.ts', 'web/src/generated/types/config.types.d.ts');
|
|
188
188
|
}
|
|
189
|
+
// 分发全部完成后,若 server/package.json 定义了 postgadminGenerate,
|
|
190
|
+
// 触发它。项目侧可用来做 dev server 通知、缓存清理等自定义收尾。
|
|
191
|
+
// 通过 env 传递本次生成模式,脚本可根据模式决定跳过后端或前端。
|
|
192
|
+
this.runProjectPostHook({ webOnly, serverOnly });
|
|
189
193
|
process.exit(0);
|
|
190
194
|
});
|
|
191
195
|
}
|
|
196
|
+
runProjectPostHook({ webOnly, serverOnly, }) {
|
|
197
|
+
var _a;
|
|
198
|
+
const pkgPath = 'server/package.json';
|
|
199
|
+
let pkg;
|
|
200
|
+
try {
|
|
201
|
+
pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
|
|
202
|
+
}
|
|
203
|
+
catch (_b) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (!((_a = pkg === null || pkg === void 0 ? void 0 : pkg.scripts) === null || _a === void 0 ? void 0 : _a.postgadminGenerate))
|
|
207
|
+
return;
|
|
208
|
+
const mode = webOnly ? 'web' : serverOnly ? 'server' : 'full';
|
|
209
|
+
console.log(chalk.gray(`Running postgadminGenerate hook (mode=${mode}) ...`));
|
|
210
|
+
const { code } = shell
|
|
211
|
+
.cd('server/')
|
|
212
|
+
.exec('npm run --silent postgadminGenerate', {
|
|
213
|
+
env: Object.assign(Object.assign({}, process.env), { GADMIN_MODE: mode }),
|
|
214
|
+
});
|
|
215
|
+
shell.cd('../');
|
|
216
|
+
if (code !== 0) {
|
|
217
|
+
console.log(chalk.yellow(`postgadminGenerate exited with code ${code}; ignoring (non-fatal).`));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
192
220
|
}
|
|
193
221
|
exports.PrismaAction = PrismaAction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gadmin2n/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.152",
|
|
4
4
|
"description": "Gadmin - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@angular-devkit/core": "13.3.2",
|
|
48
48
|
"@angular-devkit/schematics": "13.3.2",
|
|
49
49
|
"@angular-devkit/schematics-cli": "13.3.2",
|
|
50
|
-
"@gadmin2n/schematics": "^0.0.
|
|
50
|
+
"@gadmin2n/schematics": "^0.0.122",
|
|
51
51
|
"abc": "^0.6.1",
|
|
52
52
|
"chalk": "3.0.0",
|
|
53
53
|
"chokidar": "3.5.3",
|