create-nocobase-app 1.6.21 → 1.6.22
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/cli.js +1 -1
- package/lib/generator.js +6 -25
- package/package.json +3 -3
- package/src/cli.js +1 -1
- package/src/generator.js +7 -26
- package/templates/app/package.json.tpl +4 -2
package/lib/cli.js
CHANGED
|
@@ -14,7 +14,7 @@ const { AppGenerator } = require("./generator");
|
|
|
14
14
|
const { concat } = require("./util");
|
|
15
15
|
const packageJson = require("../package.json");
|
|
16
16
|
const cli = new Command("create-nocobase");
|
|
17
|
-
cli.arguments("<name>", "directory of new NocoBase app").option("--quickstart", "quickstart app creation").option("--skip-dev-dependencies").option("-a, --all-db-dialect", "install all database dialect dependencies").option("-d, --db-dialect <dbDialect>", "database dialect, current support
|
|
17
|
+
cli.arguments("<name>", "directory of new NocoBase app").option("--quickstart", "quickstart app creation").option("--skip-dev-dependencies").option("-a, --all-db-dialect", "install all database dialect dependencies").option("-d, --db-dialect <dbDialect>", "database dialect, current support mysql/postgres", "postgres").option("-e, --env <env>", "environment variables write into .env file", concat, []).description("create a new application").action(async (name, options) => {
|
|
18
18
|
if (options.quickstart) {
|
|
19
19
|
console.log(`\u26A0\uFE0F ${chalk.yellow("quickstart option is deprecated")}`);
|
|
20
20
|
}
|
package/lib/generator.js
CHANGED
|
@@ -58,7 +58,7 @@ const _AppGenerator = class _AppGenerator extends Generator {
|
|
|
58
58
|
}
|
|
59
59
|
checkDialect() {
|
|
60
60
|
const dialect = this.args.dbDialect;
|
|
61
|
-
const supportDialects = ["mysql", "mariadb", "
|
|
61
|
+
const supportDialects = ["mysql", "mariadb", "postgres"];
|
|
62
62
|
if (!supportDialects.includes(dialect)) {
|
|
63
63
|
console.log(
|
|
64
64
|
`dialect ${chalk.red(dialect)} is not supported, currently supported dialects are ${chalk.green(
|
|
@@ -72,25 +72,13 @@ const _AppGenerator = class _AppGenerator extends Generator {
|
|
|
72
72
|
const env = this.env;
|
|
73
73
|
const envs = [];
|
|
74
74
|
const dependencies = [];
|
|
75
|
-
const { dbDialect
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
81
|
-
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
82
|
-
}
|
|
75
|
+
const { dbDialect } = this.args;
|
|
76
|
+
dependencies.push(`"mysql2": "^3.14.0"`);
|
|
77
|
+
dependencies.push(`"mariadb": "^3.4.1"`);
|
|
78
|
+
dependencies.push(`"pg": "^8.14.1"`);
|
|
79
|
+
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
83
80
|
switch (dbDialect) {
|
|
84
|
-
case "sqlite":
|
|
85
|
-
if (!allDbDialect) {
|
|
86
|
-
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
87
|
-
}
|
|
88
|
-
envs.push(`DB_STORAGE=${env.DB_STORAGE || "storage/db/nocobase.sqlite"}`);
|
|
89
|
-
break;
|
|
90
81
|
case "mysql":
|
|
91
|
-
if (!allDbDialect) {
|
|
92
|
-
dependencies.push(`"mysql2": "^3.11.0"`);
|
|
93
|
-
}
|
|
94
82
|
envs.push(`DB_HOST=${env.DB_HOST || "localhost"}`);
|
|
95
83
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
|
96
84
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ""}`);
|
|
@@ -98,9 +86,6 @@ const _AppGenerator = class _AppGenerator extends Generator {
|
|
|
98
86
|
envs.push(`DB_PASSWORD=${env.DB_PASSWORD || ""}`);
|
|
99
87
|
break;
|
|
100
88
|
case "mariadb":
|
|
101
|
-
if (!allDbDialect) {
|
|
102
|
-
dependencies.push(`"mariadb": "^2.5.6"`);
|
|
103
|
-
}
|
|
104
89
|
envs.push(`DB_HOST=${env.DB_HOST || "localhost"}`);
|
|
105
90
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
|
106
91
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ""}`);
|
|
@@ -109,10 +94,6 @@ const _AppGenerator = class _AppGenerator extends Generator {
|
|
|
109
94
|
break;
|
|
110
95
|
case "kingbase":
|
|
111
96
|
case "postgres":
|
|
112
|
-
if (!allDbDialect) {
|
|
113
|
-
dependencies.push(`"pg": "^8.7.3"`);
|
|
114
|
-
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
115
|
-
}
|
|
116
97
|
envs.push(`DB_HOST=${env.DB_HOST || "localhost"}`);
|
|
117
98
|
envs.push(`DB_PORT=${env.DB_PORT || 5432}`);
|
|
118
99
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ""}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nocobase-app",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.22",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"license": "AGPL-3.0",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"chalk": "^4.1.1",
|
|
10
10
|
"commander": "^9.2.0",
|
|
11
11
|
"fs-extra": "^11.3.0",
|
|
12
|
-
"tar": "
|
|
12
|
+
"tar": "^7.4.3"
|
|
13
13
|
},
|
|
14
14
|
"bin": {
|
|
15
15
|
"create-nocobase-app": "./bin/index.js"
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url": "git+https://github.com/nocobase/nocobase.git",
|
|
20
20
|
"directory": "packages/core/create-nocobase-app"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "321c0effa18670c0c3edfa09c79d535351ef2b0d"
|
|
23
23
|
}
|
package/src/cli.js
CHANGED
|
@@ -21,7 +21,7 @@ cli
|
|
|
21
21
|
.option('--quickstart', 'quickstart app creation')
|
|
22
22
|
.option('--skip-dev-dependencies')
|
|
23
23
|
.option('-a, --all-db-dialect', 'install all database dialect dependencies')
|
|
24
|
-
.option('-d, --db-dialect <dbDialect>', 'database dialect, current support
|
|
24
|
+
.option('-d, --db-dialect <dbDialect>', 'database dialect, current support mysql/postgres', 'postgres')
|
|
25
25
|
.option('-e, --env <env>', 'environment variables write into .env file', concat, [])
|
|
26
26
|
.description('create a new application')
|
|
27
27
|
.action(async (name, options) => {
|
package/src/generator.js
CHANGED
|
@@ -61,7 +61,7 @@ class AppGenerator extends Generator {
|
|
|
61
61
|
|
|
62
62
|
checkDialect() {
|
|
63
63
|
const dialect = this.args.dbDialect;
|
|
64
|
-
const supportDialects = ['mysql', 'mariadb', '
|
|
64
|
+
const supportDialects = ['mysql', 'mariadb', 'postgres'];
|
|
65
65
|
if (!supportDialects.includes(dialect)) {
|
|
66
66
|
console.log(
|
|
67
67
|
`dialect ${chalk.red(dialect)} is not supported, currently supported dialects are ${chalk.green(
|
|
@@ -76,27 +76,15 @@ class AppGenerator extends Generator {
|
|
|
76
76
|
const env = this.env;
|
|
77
77
|
const envs = [];
|
|
78
78
|
const dependencies = [];
|
|
79
|
-
const { dbDialect
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
86
|
-
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
87
|
-
}
|
|
79
|
+
const { dbDialect } = this.args;
|
|
80
|
+
|
|
81
|
+
dependencies.push(`"mysql2": "^3.14.0"`);
|
|
82
|
+
dependencies.push(`"mariadb": "^3.4.1"`);
|
|
83
|
+
dependencies.push(`"pg": "^8.14.1"`);
|
|
84
|
+
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
88
85
|
|
|
89
86
|
switch (dbDialect) {
|
|
90
|
-
case 'sqlite':
|
|
91
|
-
if (!allDbDialect) {
|
|
92
|
-
dependencies.push(`"sqlite3": "^5.0.8"`);
|
|
93
|
-
}
|
|
94
|
-
envs.push(`DB_STORAGE=${env.DB_STORAGE || 'storage/db/nocobase.sqlite'}`);
|
|
95
|
-
break;
|
|
96
87
|
case 'mysql':
|
|
97
|
-
if (!allDbDialect) {
|
|
98
|
-
dependencies.push(`"mysql2": "^3.11.0"`);
|
|
99
|
-
}
|
|
100
88
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
|
101
89
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
|
102
90
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
|
@@ -104,9 +92,6 @@ class AppGenerator extends Generator {
|
|
|
104
92
|
envs.push(`DB_PASSWORD=${env.DB_PASSWORD || ''}`);
|
|
105
93
|
break;
|
|
106
94
|
case 'mariadb':
|
|
107
|
-
if (!allDbDialect) {
|
|
108
|
-
dependencies.push(`"mariadb": "^2.5.6"`);
|
|
109
|
-
}
|
|
110
95
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
|
111
96
|
envs.push(`DB_PORT=${env.DB_PORT || 3306}`);
|
|
112
97
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
|
@@ -115,10 +100,6 @@ class AppGenerator extends Generator {
|
|
|
115
100
|
break;
|
|
116
101
|
case 'kingbase':
|
|
117
102
|
case 'postgres':
|
|
118
|
-
if (!allDbDialect) {
|
|
119
|
-
dependencies.push(`"pg": "^8.7.3"`);
|
|
120
|
-
dependencies.push(`"pg-hstore": "^2.3.4"`);
|
|
121
|
-
}
|
|
122
103
|
envs.push(`DB_HOST=${env.DB_HOST || 'localhost'}`);
|
|
123
104
|
envs.push(`DB_PORT=${env.DB_PORT || 5432}`);
|
|
124
105
|
envs.push(`DB_DATABASE=${env.DB_DATABASE || ''}`);
|
|
@@ -28,12 +28,14 @@
|
|
|
28
28
|
"@types/react-dom": "^18.0.0",
|
|
29
29
|
"react-router-dom": "6.28.1",
|
|
30
30
|
"react-router": "6.28.1",
|
|
31
|
-
"async": "3.2.6",
|
|
31
|
+
"async": "^3.2.6",
|
|
32
32
|
"antd": "5.12.8",
|
|
33
|
-
"rollup": "4.24.0"
|
|
33
|
+
"rollup": "4.24.0",
|
|
34
|
+
"semver": "^7.7.1"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|
|
36
37
|
"@nocobase/cli": "{{{version}}}",
|
|
38
|
+
"pm2": "^6.0.5",
|
|
37
39
|
{{{dependencies}}}
|
|
38
40
|
},
|
|
39
41
|
"devDependencies": {
|