tego 1.3.44 → 1.3.45
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/utils.js +9 -4
- package/package.json +15 -15
- package/src/utils.ts +9 -3
package/lib/utils.js
CHANGED
|
@@ -37,6 +37,7 @@ module.exports = __toCommonJS(utils_exports);
|
|
|
37
37
|
var import_node_crypto = require("node:crypto");
|
|
38
38
|
var import_node_fs = __toESM(require("node:fs"));
|
|
39
39
|
var import_promises = require("node:fs/promises");
|
|
40
|
+
var import_node_os = __toESM(require("node:os"));
|
|
40
41
|
var import_node_path = require("node:path");
|
|
41
42
|
var import_promises2 = require("node:stream/promises");
|
|
42
43
|
var import_globals = __toESM(require("@tachybase/globals"));
|
|
@@ -79,20 +80,21 @@ function parseEnvironment() {
|
|
|
79
80
|
DEFAULT_STORAGE_TYPE: "local",
|
|
80
81
|
RUN_MODE: "engine",
|
|
81
82
|
LOCAL_STORAGE_DEST: "storage/uploads",
|
|
82
|
-
PLUGIN_STORAGE_PATH:
|
|
83
|
+
PLUGIN_STORAGE_PATH: "storage/plugins",
|
|
83
84
|
MFSU_AD: "none",
|
|
84
85
|
WS_PATH: "/ws",
|
|
85
86
|
SOCKET_PATH: "storage/gateway.sock",
|
|
86
|
-
PM2_HOME: (0, import_node_path.resolve)(process.cwd(), "./storage/.pm2"),
|
|
87
87
|
PLUGIN_PACKAGE_PREFIX: "@tachybase/plugin-,@tachybase/module-",
|
|
88
88
|
SERVER_TSCONFIG_PATH: "./tsconfig.server.json",
|
|
89
|
-
PLAYWRIGHT_AUTH_FILE:
|
|
89
|
+
PLAYWRIGHT_AUTH_FILE: "storage/playwright/.auth/admin.json",
|
|
90
90
|
CACHE_DEFAULT_STORE: "memory",
|
|
91
91
|
CACHE_MEMORY_MAX: 2e3,
|
|
92
92
|
PLUGIN_STATICS_PATH: "/static/plugins/",
|
|
93
93
|
LOGGER_BASE_PATH: "storage/logs",
|
|
94
94
|
APP_SERVER_BASE_URL: "",
|
|
95
|
-
APP_PUBLIC_PATH: "/"
|
|
95
|
+
APP_PUBLIC_PATH: "/",
|
|
96
|
+
TEGO_HOME: (0, import_node_path.join)(import_node_os.default.homedir(), ".tego"),
|
|
97
|
+
TEGO_RUNTIME_NAME: "current"
|
|
96
98
|
};
|
|
97
99
|
(0, import_dotenv.config)({
|
|
98
100
|
path: (0, import_node_path.resolve)(process.cwd(), process.env.APP_ENV_PATH || ".env")
|
|
@@ -102,6 +104,9 @@ function parseEnvironment() {
|
|
|
102
104
|
process.env[key] = env[key];
|
|
103
105
|
}
|
|
104
106
|
}
|
|
107
|
+
if (!process.env.TEGO_RUNTIME_HOME) {
|
|
108
|
+
process.env.TEGO_RUNTIME_HOME = (0, import_node_path.join)(process.env.TEGO_HOME, process.env.TEGO_RUNTIME_NAME);
|
|
109
|
+
}
|
|
105
110
|
if (!process.env.__env_modified__ && process.env.APP_PUBLIC_PATH) {
|
|
106
111
|
const publicPath = process.env.APP_PUBLIC_PATH.replace(/\/$/g, "");
|
|
107
112
|
const keys = ["API_BASE_PATH", "WS_PATH", "PLUGIN_STATICS_PATH"];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tego",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.45",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tego",
|
|
@@ -49,20 +49,20 @@
|
|
|
49
49
|
"umzug": "3.8.2",
|
|
50
50
|
"winston": "3.17.0",
|
|
51
51
|
"winston-daily-rotate-file": "^5.0.0",
|
|
52
|
-
"@tachybase/acl": "1.3.
|
|
53
|
-
"@tachybase/
|
|
54
|
-
"@tachybase/
|
|
55
|
-
"@tachybase/
|
|
56
|
-
"@tachybase/data-source": "1.3.
|
|
57
|
-
"@tachybase/evaluators": "1.3.
|
|
58
|
-
"@tachybase/globals": "1.3.
|
|
59
|
-
"@tachybase/
|
|
60
|
-
"@tachybase/
|
|
61
|
-
"@tachybase/
|
|
62
|
-
"@tachybase/resourcer": "1.3.
|
|
63
|
-
"@tachybase/
|
|
64
|
-
"@tachybase/utils": "1.3.
|
|
65
|
-
"@tego/core": "1.3.
|
|
52
|
+
"@tachybase/acl": "1.3.45",
|
|
53
|
+
"@tachybase/auth": "1.3.45",
|
|
54
|
+
"@tachybase/actions": "1.3.45",
|
|
55
|
+
"@tachybase/cache": "1.3.45",
|
|
56
|
+
"@tachybase/data-source": "1.3.45",
|
|
57
|
+
"@tachybase/evaluators": "1.3.45",
|
|
58
|
+
"@tachybase/globals": "1.3.45",
|
|
59
|
+
"@tachybase/database": "1.3.45",
|
|
60
|
+
"@tachybase/loader": "1.3.45",
|
|
61
|
+
"@tachybase/schema": "1.3.45",
|
|
62
|
+
"@tachybase/resourcer": "1.3.45",
|
|
63
|
+
"@tachybase/logger": "1.3.45",
|
|
64
|
+
"@tachybase/utils": "1.3.45",
|
|
65
|
+
"@tego/core": "1.3.45"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/lodash": "4.17.20",
|
package/src/utils.ts
CHANGED
|
@@ -6,6 +6,7 @@ import fs, {
|
|
|
6
6
|
createWriteStream,
|
|
7
7
|
} from 'node:fs';
|
|
8
8
|
import { mkdir, unlink } from 'node:fs/promises';
|
|
9
|
+
import os from 'node:os';
|
|
9
10
|
import { dirname, join, resolve } from 'node:path';
|
|
10
11
|
import { pipeline } from 'node:stream/promises';
|
|
11
12
|
import TachybaseGlobal from '@tachybase/globals';
|
|
@@ -51,20 +52,21 @@ export function parseEnvironment() {
|
|
|
51
52
|
DEFAULT_STORAGE_TYPE: 'local',
|
|
52
53
|
RUN_MODE: 'engine',
|
|
53
54
|
LOCAL_STORAGE_DEST: 'storage/uploads',
|
|
54
|
-
PLUGIN_STORAGE_PATH:
|
|
55
|
+
PLUGIN_STORAGE_PATH: 'storage/plugins',
|
|
55
56
|
MFSU_AD: 'none',
|
|
56
57
|
WS_PATH: '/ws',
|
|
57
58
|
SOCKET_PATH: 'storage/gateway.sock',
|
|
58
|
-
PM2_HOME: resolve(process.cwd(), './storage/.pm2'),
|
|
59
59
|
PLUGIN_PACKAGE_PREFIX: '@tachybase/plugin-,@tachybase/module-',
|
|
60
60
|
SERVER_TSCONFIG_PATH: './tsconfig.server.json',
|
|
61
|
-
PLAYWRIGHT_AUTH_FILE:
|
|
61
|
+
PLAYWRIGHT_AUTH_FILE: 'storage/playwright/.auth/admin.json',
|
|
62
62
|
CACHE_DEFAULT_STORE: 'memory',
|
|
63
63
|
CACHE_MEMORY_MAX: 2000,
|
|
64
64
|
PLUGIN_STATICS_PATH: '/static/plugins/',
|
|
65
65
|
LOGGER_BASE_PATH: 'storage/logs',
|
|
66
66
|
APP_SERVER_BASE_URL: '',
|
|
67
67
|
APP_PUBLIC_PATH: '/',
|
|
68
|
+
TEGO_HOME: join(os.homedir(), '.tego'),
|
|
69
|
+
TEGO_RUNTIME_NAME: 'current',
|
|
68
70
|
};
|
|
69
71
|
|
|
70
72
|
config({
|
|
@@ -77,6 +79,10 @@ export function parseEnvironment() {
|
|
|
77
79
|
}
|
|
78
80
|
}
|
|
79
81
|
|
|
82
|
+
if (!process.env.TEGO_RUNTIME_HOME) {
|
|
83
|
+
process.env.TEGO_RUNTIME_HOME = join(process.env.TEGO_HOME!, process.env.TEGO_RUNTIME_NAME!);
|
|
84
|
+
}
|
|
85
|
+
|
|
80
86
|
if (!process.env.__env_modified__ && process.env.APP_PUBLIC_PATH) {
|
|
81
87
|
const publicPath = process.env.APP_PUBLIC_PATH.replace(/\/$/g, '');
|
|
82
88
|
const keys = ['API_BASE_PATH', 'WS_PATH', 'PLUGIN_STATICS_PATH'];
|