@nocobase/plugin-multi-app-manager 1.3.50-beta → 1.3.51
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/dist/externalVersion.js
CHANGED
|
@@ -8,18 +8,18 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "1.3.
|
|
11
|
+
"@nocobase/client": "1.3.51",
|
|
12
12
|
"antd": "5.12.8",
|
|
13
13
|
"react": "18.2.0",
|
|
14
14
|
"@formily/react": "2.3.0",
|
|
15
15
|
"antd-style": "3.7.1",
|
|
16
16
|
"react-router-dom": "6.21.0",
|
|
17
17
|
"react-i18next": "11.18.6",
|
|
18
|
-
"@nocobase/database": "1.3.
|
|
19
|
-
"@nocobase/server": "1.3.
|
|
18
|
+
"@nocobase/database": "1.3.51",
|
|
19
|
+
"@nocobase/server": "1.3.51",
|
|
20
20
|
"lodash": "4.17.21",
|
|
21
21
|
"mysql2": "3.11.0",
|
|
22
22
|
"pg": "8.11.3",
|
|
23
|
-
"@nocobase/utils": "1.3.
|
|
23
|
+
"@nocobase/utils": "1.3.51",
|
|
24
24
|
"@formily/shared": "2.3.2"
|
|
25
25
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2024-11-
|
|
1
|
+
{"name":"mariadb","version":"2.5.6","description":"fast mariadb/mysql connector.","main":"promise.js","types":"types/index.d.ts","directories":{"lib":"lib","test":"test"},"private":false,"scripts":{"test":"npm run test:types-prettier && npm run test:prettier && npm run test:types && npm run test:lint && npm run test:base","test:base":"mocha --no-parallel --timeout 5000 \"test/**/*.js\" ","test:lint":"eslint \"{lib,test}/**/*.js\" ","test:types":"eslint \"types/*.ts\" ","test:types-prettier":"prettier --write \"types/*.ts\"","test:prettier":"prettier --write \"{tools,lib,test,benchmarks}/**/*.js\"","coverage":"npm run coverage:test && npm run coverage:report","coverage:test":"nyc mocha --no-parallel --timeout 5000 \"test/**/*.js\"","coverage:report":"nyc report --reporter=text-lcov > coverage.lcov && codecov","benchmark":"node ./benchmarks/benchmarks.js","generate":"node ./tools/generate-mariadb.js"},"repository":{"type":"git","url":"git+https://github.com/mariadb-corporation/mariadb-connector-nodejs.git"},"keywords":["mariadb","mysql","client","driver","connector"],"files":["lib","types/index.d.ts","promise.js","callback.js"],"engines":{"node":">= 10.13"},"author":"Diego Dupin <diego.dupin@mariadb.com>","license":"LGPL-2.1-or-later","dependencies":{"@types/geojson":"^7946.0.8","@types/node":"^17.0.10","denque":"^2.0.1","iconv-lite":"^0.6.3","long":"^5.2.0","moment-timezone":"^0.5.34","please-upgrade-node":"^3.2.0"},"devDependencies":{"@typescript-eslint/eslint-plugin":"^5.10.0","@typescript-eslint/parser":"^5.10.0","benchmark":"^2.1.4","chai":"^4.3.4","codecov":"^3.8.2","chalk":"^4.1.2","dom-parser":"^0.1.6","error-stack-parser":"^2.0.6","eslint":"^8.7.0","eslint-config-prettier":"^8.3.0","eslint-plugin-markdown":"^2.2.1","eslint-plugin-prettier":"^4.0.0","mocha":"^9.2.0","mocha-lcov-reporter":"^1.3.0","nyc":"^15.1.0","prettier":"^2.5.1","typescript":"^4.5.5"},"bugs":{"url":"https://jira.mariadb.org/projects/CONJS/"},"homepage":"https://github.com/mariadb-corporation/mariadb-connector-nodejs#readme","_lastModified":"2024-11-19T12:35:43.019Z"}
|
package/dist/server/server.d.ts
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { IDatabaseOptions, Transactionable } from '@nocobase/database';
|
|
10
10
|
import Application, { Plugin } from '@nocobase/server';
|
|
11
|
+
import { ApplicationModel } from '../server';
|
|
11
12
|
export type AppDbCreator = (app: Application, options?: Transactionable & {
|
|
12
13
|
context?: any;
|
|
14
|
+
applicationModel?: ApplicationModel;
|
|
13
15
|
}) => Promise<void>;
|
|
14
16
|
export type AppOptionsFactory = (appName: string, mainApp: Application) => any;
|
|
15
17
|
export type SubAppUpgradeHandler = (mainApp: Application) => Promise<void>;
|
package/dist/server/server.js
CHANGED
|
@@ -78,7 +78,7 @@ const defaultSubAppUpgradeHandle = async (mainApp) => {
|
|
|
78
78
|
};
|
|
79
79
|
const defaultDbCreator = async (app) => {
|
|
80
80
|
const databaseOptions = app.options.database;
|
|
81
|
-
const { host, port, username, password, dialect, database } = databaseOptions;
|
|
81
|
+
const { host, port, username, password, dialect, database, schema } = databaseOptions;
|
|
82
82
|
if (dialect === "mysql") {
|
|
83
83
|
const mysql = require("mysql2/promise");
|
|
84
84
|
const connection = await mysql.createConnection({ host, port, user: username, password });
|
|
@@ -91,18 +91,22 @@ const defaultDbCreator = async (app) => {
|
|
|
91
91
|
await connection.query(`CREATE DATABASE IF NOT EXISTS \`${database}\`;`);
|
|
92
92
|
await connection.end();
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
94
|
+
if (["postgres", "kingbase"].includes(dialect)) {
|
|
95
95
|
const { Client } = require("pg");
|
|
96
96
|
const client = new Client({
|
|
97
97
|
host,
|
|
98
98
|
port,
|
|
99
99
|
user: username,
|
|
100
100
|
password,
|
|
101
|
-
database:
|
|
101
|
+
database: dialect
|
|
102
102
|
});
|
|
103
103
|
await client.connect();
|
|
104
104
|
try {
|
|
105
|
-
|
|
105
|
+
if (process.env.USE_DB_SCHEMA_IN_SUBAPP === "true") {
|
|
106
|
+
await client.query(`CREATE SCHEMA IF NOT EXISTS ${schema}`);
|
|
107
|
+
} else {
|
|
108
|
+
await client.query(`CREATE DATABASE "${database}"`);
|
|
109
|
+
}
|
|
106
110
|
} catch (e) {
|
|
107
111
|
console.log(e);
|
|
108
112
|
}
|
|
@@ -117,6 +121,8 @@ const defaultAppOptionsFactory = (appName, mainApp) => {
|
|
|
117
121
|
const mainStorageDir = import_path.default.dirname(mainAppStorage);
|
|
118
122
|
rawDatabaseOptions.storage = import_path.default.join(mainStorageDir, `${appName}.sqlite`);
|
|
119
123
|
}
|
|
124
|
+
} else if (process.env.USE_DB_SCHEMA_IN_SUBAPP === "true" && ["postgres", "kingbase"].includes(rawDatabaseOptions.dialect)) {
|
|
125
|
+
rawDatabaseOptions.schema = appName;
|
|
120
126
|
} else {
|
|
121
127
|
rawDatabaseOptions.database = appName;
|
|
122
128
|
}
|
|
@@ -170,11 +176,15 @@ class PluginMultiAppManagerServer extends import_server.Plugin {
|
|
|
170
176
|
const subApp = model.registerToSupervisor(this.app, {
|
|
171
177
|
appOptionsFactory: this.appOptionsFactory
|
|
172
178
|
});
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
179
|
+
const quickstart = async () => {
|
|
180
|
+
await this.appDbCreator(subApp, {
|
|
181
|
+
transaction,
|
|
182
|
+
applicationModel: model,
|
|
183
|
+
context: options.context
|
|
184
|
+
});
|
|
185
|
+
await subApp.runCommand("start", "--quickstart");
|
|
186
|
+
};
|
|
187
|
+
const startPromise = quickstart();
|
|
178
188
|
if ((_a = options == null ? void 0 : options.context) == null ? void 0 : _a.waitSubAppInstall) {
|
|
179
189
|
await startPromise;
|
|
180
190
|
}
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "多应用管理器",
|
|
5
5
|
"description": "Dynamically create multiple apps without separate deployments.",
|
|
6
6
|
"description.zh-CN": "无需单独部署即可动态创建多个应用。",
|
|
7
|
-
"version": "1.3.
|
|
7
|
+
"version": "1.3.51",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/multi-app-manager",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@nocobase/test": "1.x",
|
|
29
29
|
"@nocobase/utils": "1.x"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "01f2b933a0681d99c5928d91d41f3f0c0ecae988",
|
|
32
32
|
"keywords": [
|
|
33
33
|
"system"
|
|
34
34
|
]
|
|
File without changes
|
|
File without changes
|