@jayfong/x-server 2.106.4 → 2.106.5
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/lib/_cjs/cli/cli.js +3 -2
- package/lib/cli/cli.js +3 -2
- package/package.json +1 -1
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -301,11 +301,12 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
301
301
|
const schemaDir = _nodePath.default.join(process.cwd(), 'src/db/schema');
|
|
302
302
|
const isMultipleFiles = await _fsExtra.default.pathExists(schemaDir);
|
|
303
303
|
const schemaArg = isMultipleFiles ? 'src/db' : 'src/db/schema.prisma';
|
|
304
|
-
|
|
304
|
+
const prismaArgs = argv._.slice(1);
|
|
305
|
+
await (0, _execa.default)('tnpx', ['prisma', ...prismaArgs, '--schema', schemaArg], {
|
|
305
306
|
cwd: process.cwd(),
|
|
306
307
|
stdio: 'inherit'
|
|
307
308
|
});
|
|
308
|
-
if (!argv.production) {
|
|
309
|
+
if (!argv.production && prismaArgs[0] === 'generate') {
|
|
309
310
|
await _template_util.TemplateUtil.initModels(process.cwd());
|
|
310
311
|
}
|
|
311
312
|
}
|
package/lib/cli/cli.js
CHANGED
|
@@ -297,11 +297,12 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
297
297
|
const schemaDir = path.join(process.cwd(), 'src/db/schema');
|
|
298
298
|
const isMultipleFiles = await fs.pathExists(schemaDir);
|
|
299
299
|
const schemaArg = isMultipleFiles ? 'src/db' : 'src/db/schema.prisma';
|
|
300
|
-
|
|
300
|
+
const prismaArgs = argv._.slice(1);
|
|
301
|
+
await execa('tnpx', ['prisma', ...prismaArgs, '--schema', schemaArg], {
|
|
301
302
|
cwd: process.cwd(),
|
|
302
303
|
stdio: 'inherit'
|
|
303
304
|
});
|
|
304
|
-
if (!argv.production) {
|
|
305
|
+
if (!argv.production && prismaArgs[0] === 'generate') {
|
|
305
306
|
await TemplateUtil.initModels(process.cwd());
|
|
306
307
|
}
|
|
307
308
|
}
|