@nocobase/cli 0.7.0-alpha.80 → 0.7.0-alpha.83
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/bin/index.js +5 -0
- package/package.json +3 -3
- package/src/commands/dev.js +11 -11
package/bin/index.js
CHANGED
|
@@ -11,10 +11,15 @@ const env = {
|
|
|
11
11
|
API_BASE_PATH: '/api/',
|
|
12
12
|
DB_DIALECT: 'sqlite',
|
|
13
13
|
DB_STORAGE: 'storage/db/nocobase.sqlite',
|
|
14
|
+
DB_TIMEZONE: '+00:00',
|
|
14
15
|
DEFAULT_STORAGE_TYPE: 'local',
|
|
15
16
|
LOCAL_STORAGE_DEST: 'storage/uploads',
|
|
16
17
|
};
|
|
17
18
|
|
|
19
|
+
if ('v18' === process.version.split('.').shift()) {
|
|
20
|
+
process.env.NODE_OPTIONS = '--openssl-legacy-provider';
|
|
21
|
+
}
|
|
22
|
+
|
|
18
23
|
dotenv.config({
|
|
19
24
|
path: resolve(process.cwd(), process.env.APP_ENV_PATH || '.env'),
|
|
20
25
|
});
|
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.83",
|
|
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.83"
|
|
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": "838f4f18dcd9ed4fe2ae2660a4918e2a5bd3a869"
|
|
34
34
|
}
|
package/src/commands/dev.js
CHANGED
|
@@ -34,15 +34,15 @@ module.exports = (cli) => {
|
|
|
34
34
|
process.env.APP_PORT = opts.port;
|
|
35
35
|
}
|
|
36
36
|
const { APP_PORT } = process.env;
|
|
37
|
-
let
|
|
38
|
-
let
|
|
37
|
+
let clientPort = APP_PORT;
|
|
38
|
+
let serverPort;
|
|
39
39
|
nodeCheck();
|
|
40
40
|
await postCheck(opts);
|
|
41
41
|
if (server) {
|
|
42
|
-
|
|
42
|
+
serverPort = APP_PORT;
|
|
43
43
|
} else if (!server && !client) {
|
|
44
|
-
|
|
45
|
-
port: 1 *
|
|
44
|
+
serverPort = await getPortPromise({
|
|
45
|
+
port: 1 * clientPort + 1,
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
await runAppCommand('install', ['--silent']);
|
|
@@ -50,7 +50,7 @@ module.exports = (cli) => {
|
|
|
50
50
|
await runAppCommand('db:sync');
|
|
51
51
|
}
|
|
52
52
|
if (server || !client) {
|
|
53
|
-
console.log('starting server',
|
|
53
|
+
console.log('starting server', serverPort);
|
|
54
54
|
const argv = [
|
|
55
55
|
'-P',
|
|
56
56
|
'./tsconfig.server.json',
|
|
@@ -59,21 +59,21 @@ module.exports = (cli) => {
|
|
|
59
59
|
`./packages/${APP_PACKAGE_ROOT}/server/src/index.ts`,
|
|
60
60
|
'start',
|
|
61
61
|
...process.argv.slice(3),
|
|
62
|
-
`--port=${
|
|
62
|
+
`--port=${serverPort}`,
|
|
63
63
|
];
|
|
64
64
|
run('ts-node-dev', argv, {
|
|
65
65
|
env: {
|
|
66
|
-
APP_PORT:
|
|
66
|
+
APP_PORT: serverPort,
|
|
67
67
|
},
|
|
68
68
|
});
|
|
69
69
|
}
|
|
70
70
|
if (client || !server) {
|
|
71
|
-
console.log('starting client', 1 *
|
|
71
|
+
console.log('starting client', 1 * clientPort);
|
|
72
72
|
run('umi', ['dev'], {
|
|
73
73
|
env: {
|
|
74
|
-
PORT:
|
|
74
|
+
PORT: clientPort,
|
|
75
75
|
APP_ROOT: `packages/${APP_PACKAGE_ROOT}/client`,
|
|
76
|
-
PROXY_TARGET_URL:
|
|
76
|
+
PROXY_TARGET_URL: serverPort ? `http://127.0.0.1:${serverPort}` : undefined,
|
|
77
77
|
},
|
|
78
78
|
});
|
|
79
79
|
}
|