@nocobase/cli 0.7.0-alpha.57 → 0.7.0-alpha.60
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 +3 -3
- package/src/commands/dev.js +6 -2
- package/src/commands/start.js +5 -1
- package/src/commands/test.js +9 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "0.7.0-alpha.
|
|
3
|
+
"version": "0.7.0-alpha.60",
|
|
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.
|
|
26
|
+
"@nocobase/devtools": "0.7.0-alpha.60"
|
|
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": "
|
|
33
|
+
"gitHead": "f0d0afbb19dbd90ac3cf4155748fa084c67f54ee"
|
|
34
34
|
}
|
package/src/commands/dev.js
CHANGED
|
@@ -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
|
|
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 = [
|
package/src/commands/start.js
CHANGED
|
@@ -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', '
|
|
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
|
};
|
package/src/commands/test.js
CHANGED
|
@@ -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');
|