@nocobase/cli 0.7.0-alpha.56 → 0.7.0-alpha.59

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "0.7.0-alpha.56",
3
+ "version": "0.7.0-alpha.59",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "licenses": [
@@ -23,12 +23,12 @@
23
23
  "serve": "^13.0.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@nocobase/devtools": "0.7.0-alpha.56"
26
+ "@nocobase/devtools": "0.7.0-alpha.59"
27
27
  },
28
28
  "repository": {
29
29
  "type": "git",
30
30
  "url": "git+https://github.com/nocobase/nocobase.git",
31
31
  "directory": "packages/core/cli"
32
32
  },
33
- "gitHead": "9a8c05e8fb26029f1d1ba68408a8bddac0e67a76"
33
+ "gitHead": "c90e5aee4c8257a3ab7ff492e69cb568cccff8b5"
34
34
  }
@@ -1,6 +1,6 @@
1
1
  const chalk = require('chalk');
2
2
  const { Command } = require('commander');
3
- const { runInstall, run, postCheck, nodeCheck, promptForTs } = require('../util');
3
+ const { runAppCommand, runInstall, run, postCheck, nodeCheck, promptForTs } = require('../util');
4
4
  const { getPortPromise } = require('portfinder');
5
5
 
6
6
  /**
@@ -14,6 +14,7 @@ module.exports = (cli) => {
14
14
  .option('-p, --port [port]')
15
15
  .option('--client')
16
16
  .option('--server')
17
+ .option('--db-sync')
17
18
  .allowUnknownOption()
18
19
  .action(async (opts) => {
19
20
  promptForTs();
@@ -44,7 +45,10 @@ module.exports = (cli) => {
44
45
  port: 1 * clientPost + 1,
45
46
  });
46
47
  }
47
- await runInstall();
48
+ await runAppCommand('install', ['--silent']);
49
+ if (opts.dbSync) {
50
+ await runAppCommand('db:sync');
51
+ }
48
52
  if (server || !client) {
49
53
  console.log('starting server', serverPost);
50
54
  const argv = [
@@ -13,6 +13,7 @@ module.exports = (cli) => {
13
13
  cli
14
14
  .command('start')
15
15
  .option('-p, --port [port]')
16
+ .option('--db-sync')
16
17
  .allowUnknownOption()
17
18
  .action(async (opts) => {
18
19
  if (opts.port) {
@@ -38,7 +39,10 @@ module.exports = (cli) => {
38
39
  return;
39
40
  }
40
41
  await postCheck(opts);
41
- await run('node', [`./packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, 'install', '-s']);
42
+ await run('node', [`./packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, 'install', '--silent']);
43
+ if (opts.dbSync) {
44
+ await run('node', [`./packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, 'db:sync']);
45
+ }
42
46
  run('pm2-runtime', ['start', `packages/${APP_PACKAGE_ROOT}/server/lib/index.js`, '--', ...process.argv.slice(2)]);
43
47
  });
44
48
  };
@@ -14,7 +14,15 @@ module.exports = (cli) => {
14
14
  nodeCheck();
15
15
  if (options.dbClean) {
16
16
  promptForTs();
17
- await runAppCommand('db:clean', '-y');
17
+ await runAppCommand('db:clean', ['-y']);
18
+ }
19
+ let index = process.argv.indexOf('-c');
20
+ if (index > 0) {
21
+ process.argv.splice(index, 1);
22
+ }
23
+ index = process.argv.indexOf('--db-clean');
24
+ if (index > 0) {
25
+ process.argv.splice(index, 1);
18
26
  }
19
27
  process.argv.splice(2, 1, '-i');
20
28
  require('jest-cli/bin/jest');