tego 1.3.43 → 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/index.js CHANGED
@@ -24,8 +24,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  var import_preload = require("./preload");
25
25
  var import_node_perf_hooks = require("node:perf_hooks");
26
26
  var import_globals = __toESM(require("@tachybase/globals"));
27
- var import_server = require("@tachybase/server");
28
27
  var import_utils = require("@tachybase/utils");
28
+ var import_core = require("@tego/core");
29
29
  var import_commander = require("commander");
30
30
  var import_config = require("./config");
31
31
  var import_plugin_presets = __toESM(require("./plugin-presets"));
@@ -41,7 +41,7 @@ const run = /* @__PURE__ */ __name(async () => {
41
41
  await (0, import_utils.createDevPluginsSymlink)();
42
42
  await (0, import_utils.createStoragePluginsSymlink)();
43
43
  console.log(`Engine loaded at ${import_node_perf_hooks.performance.now().toFixed(2)} ms`);
44
- await import_server.Gateway.getInstance().run({
44
+ await import_core.Gateway.getInstance().run({
45
45
  mainAppOptions: await (0, import_config.getConfig)()
46
46
  });
47
47
  }, "run");
@@ -1,4 +1,4 @@
1
- import { Plugin } from '@tachybase/server';
1
+ import { Plugin } from '@tego/core';
2
2
  export declare class PluginPresets extends Plugin {
3
3
  splitNames(name: string): string[];
4
4
  getBuiltInPlugins(): string[];
@@ -22,8 +22,8 @@ __export(plugin_presets_exports, {
22
22
  default: () => plugin_presets_default
23
23
  });
24
24
  module.exports = __toCommonJS(plugin_presets_exports);
25
- var import_server = require("@tachybase/server");
26
- const _PluginPresets = class _PluginPresets extends import_server.Plugin {
25
+ var import_core = require("@tego/core");
26
+ const _PluginPresets = class _PluginPresets extends import_core.Plugin {
27
27
  splitNames(name) {
28
28
  return (name || "").split(",").filter(Boolean);
29
29
  }
@@ -55,11 +55,11 @@ const _PluginPresets = class _PluginPresets extends import_server.Plugin {
55
55
  async getPackageJson(name) {
56
56
  let packageName = name;
57
57
  try {
58
- packageName = await import_server.PluginManager.getPackageName(name);
58
+ packageName = await import_core.PluginManager.getPackageName(name);
59
59
  } catch (error) {
60
60
  packageName = name;
61
61
  }
62
- const packageJson = await import_server.PluginManager.getPackageJson(packageName);
62
+ const packageJson = await import_core.PluginManager.getPackageJson(packageName);
63
63
  return packageJson;
64
64
  }
65
65
  async allPlugins() {
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: (0, import_node_path.resolve)(process.cwd(), "storage/plugins"),
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: (0, import_node_path.resolve)(process.cwd(), "storage/playwright/.auth/admin.json"),
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.43",
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.43",
53
- "@tachybase/auth": "1.3.43",
54
- "@tachybase/cache": "1.3.43",
55
- "@tachybase/data-source": "1.3.43",
56
- "@tachybase/database": "1.3.43",
57
- "@tachybase/actions": "1.3.43",
58
- "@tachybase/evaluators": "1.3.43",
59
- "@tachybase/globals": "1.3.43",
60
- "@tachybase/loader": "1.3.43",
61
- "@tachybase/logger": "1.3.43",
62
- "@tachybase/server": "1.3.43",
63
- "@tachybase/schema": "1.3.43",
64
- "@tachybase/utils": "1.3.43",
65
- "@tachybase/resourcer": "1.3.43"
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/index.ts CHANGED
@@ -2,9 +2,9 @@ import './preload';
2
2
 
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import TachybaseGlobal from '@tachybase/globals';
5
- import { Gateway } from '@tachybase/server';
6
5
  import { createDevPluginsSymlink, createStoragePluginsSymlink } from '@tachybase/utils';
7
6
 
7
+ import { Gateway } from '@tego/core';
8
8
  import { Command } from 'commander';
9
9
 
10
10
  import { getConfig } from './config';
@@ -1,5 +1,4 @@
1
- import { Plugin, PluginManager } from '@tachybase/server';
2
-
1
+ import { Plugin, PluginManager } from '@tego/core';
3
2
  import _ from 'lodash';
4
3
 
5
4
  export class PluginPresets extends Plugin {
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: resolve(process.cwd(), 'storage/plugins'),
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: resolve(process.cwd(), 'storage/playwright/.auth/admin.json'),
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'];