tego 1.3.45 → 1.3.46

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.
@@ -1,5 +1,4 @@
1
1
  export declare const DEFAULT_DEV_PLUGINS_PATH: string;
2
2
  export declare const DEFAULT_REMOTE_PLUGINS_PATH: string;
3
3
  export declare const DEFAULT_BUILTIN_PLUGINS_PATH: string;
4
- export declare const DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH: string;
5
4
  export declare const DEFAULT_WEB_PACKAGE_NAME = "@tego/web";
package/lib/constants.js CHANGED
@@ -28,22 +28,21 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
28
28
  var constants_exports = {};
29
29
  __export(constants_exports, {
30
30
  DEFAULT_BUILTIN_PLUGINS_PATH: () => DEFAULT_BUILTIN_PLUGINS_PATH,
31
- DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH: () => DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH,
32
31
  DEFAULT_DEV_PLUGINS_PATH: () => DEFAULT_DEV_PLUGINS_PATH,
33
32
  DEFAULT_REMOTE_PLUGINS_PATH: () => DEFAULT_REMOTE_PLUGINS_PATH,
34
33
  DEFAULT_WEB_PACKAGE_NAME: () => DEFAULT_WEB_PACKAGE_NAME
35
34
  });
36
35
  module.exports = __toCommonJS(constants_exports);
37
36
  var import_node_path = __toESM(require("node:path"));
38
- const DEFAULT_DEV_PLUGINS_PATH = import_node_path.default.resolve("plugins", "dev");
39
- const DEFAULT_REMOTE_PLUGINS_PATH = import_node_path.default.resolve("plugins", "remote");
40
- const DEFAULT_BUILTIN_PLUGINS_PATH = import_node_path.default.resolve("plugins", "builtin");
41
- const DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH = import_node_path.default.join("plugins", "builtin");
37
+ var import_utils = require("./utils");
38
+ (0, import_utils.parseEnvironment)();
39
+ const DEFAULT_DEV_PLUGINS_PATH = import_node_path.default.join(process.env.TEGO_RUNTIME_HOME, "plugins", "dev");
40
+ const DEFAULT_REMOTE_PLUGINS_PATH = import_node_path.default.join(process.env.TEGO_RUNTIME_HOME, "plugins", "remote");
41
+ const DEFAULT_BUILTIN_PLUGINS_PATH = import_node_path.default.join(process.env.TEGO_RUNTIME_HOME, "plugins", "builtin");
42
42
  const DEFAULT_WEB_PACKAGE_NAME = "@tego/web";
43
43
  // Annotate the CommonJS export names for ESM import in node:
44
44
  0 && (module.exports = {
45
45
  DEFAULT_BUILTIN_PLUGINS_PATH,
46
- DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH,
47
46
  DEFAULT_DEV_PLUGINS_PATH,
48
47
  DEFAULT_REMOTE_PLUGINS_PATH,
49
48
  DEFAULT_WEB_PACKAGE_NAME
package/lib/index.js CHANGED
@@ -31,7 +31,12 @@ var import_config = require("./config");
31
31
  var import_plugin_presets = __toESM(require("./plugin-presets"));
32
32
  var import_prepare = require("./prepare");
33
33
  var import_utils2 = require("./utils");
34
- (0, import_utils2.parseEnvironment)();
34
+ if (!process.env.SERVE_PATH) {
35
+ const servePath = (0, import_utils2.guessServePath)();
36
+ if (servePath) {
37
+ process.env.SERVE_PATH = servePath;
38
+ }
39
+ }
35
40
  const program = new import_commander.Command();
36
41
  program.name("tego").version(require("../package.json").version);
37
42
  const run = /* @__PURE__ */ __name(async () => {
package/lib/prepare.js CHANGED
@@ -62,10 +62,9 @@ async function prepare({
62
62
  } catch {
63
63
  npmExist = false;
64
64
  }
65
- const prefix = import_node_path.default.join(name, import_constants.DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH);
66
65
  console.log("\u{1F680} ~ start download ~ front end files");
67
66
  const spinner = (0, import_yocto_spinner.default)({ text: `Loading ${import_constants.DEFAULT_WEB_PACKAGE_NAME}` }).start();
68
- await (0, import_utils.downloadTar)(import_constants.DEFAULT_WEB_PACKAGE_NAME, `${prefix}/${import_constants.DEFAULT_WEB_PACKAGE_NAME}`);
67
+ await (0, import_utils.downloadTar)(import_constants.DEFAULT_WEB_PACKAGE_NAME, `${import_constants.DEFAULT_BUILTIN_PLUGINS_PATH}/${import_constants.DEFAULT_WEB_PACKAGE_NAME}`);
69
68
  spinner.success();
70
69
  console.log();
71
70
  console.log("\u{1F680} ~ start download ~ required modules");
@@ -73,9 +72,9 @@ async function prepare({
73
72
  let index = 1;
74
73
  for (const moduleName of moduleNames) {
75
74
  const spinner2 = (0, import_yocto_spinner.default)({ text: `[${index++}/${moduleNames.length}] Loading ${moduleName}` }).start();
76
- await (0, import_utils.downloadTar)(moduleName, `${prefix}/${moduleName}`);
75
+ await (0, import_utils.downloadTar)(moduleName, `${import_constants.DEFAULT_BUILTIN_PLUGINS_PATH}/${moduleName}`);
77
76
  if (npmExist) {
78
- await npmInstall(`${prefix}/${moduleName}`, spinner2);
77
+ await npmInstall(`${import_constants.DEFAULT_BUILTIN_PLUGINS_PATH}/${moduleName}`, spinner2);
79
78
  }
80
79
  spinner2.success();
81
80
  }
@@ -85,9 +84,9 @@ async function prepare({
85
84
  const pluginNames = plugins.map((pluginName) => `@tachybase/plugin-${pluginName}`);
86
85
  for (const pluginName of pluginNames) {
87
86
  const spinner2 = (0, import_yocto_spinner.default)({ text: `[${index++}/${pluginNames.length}] Loading ${pluginName}` }).start();
88
- await (0, import_utils.downloadTar)(pluginName, `${prefix}/${pluginName}`);
87
+ await (0, import_utils.downloadTar)(pluginName, `${import_constants.DEFAULT_BUILTIN_PLUGINS_PATH}/${pluginName}`);
89
88
  if (npmExist) {
90
- await npmInstall(`${prefix}/${pluginName}`, spinner2);
89
+ await npmInstall(`${import_constants.DEFAULT_BUILTIN_PLUGINS_PATH}/${pluginName}`, spinner2);
91
90
  }
92
91
  spinner2.success();
93
92
  }
package/lib/utils.js CHANGED
@@ -119,12 +119,6 @@ function parseEnvironment() {
119
119
  process.env.API_BASE_URL = process.env.APP_SERVER_BASE_URL + process.env.API_BASE_PATH;
120
120
  process.env.__env_modified__ = "1";
121
121
  }
122
- if (!process.env.SERVE_PATH) {
123
- const servePath = guessServePath();
124
- if (servePath) {
125
- process.env.SERVE_PATH = servePath;
126
- }
127
- }
128
122
  }
129
123
  __name(parseEnvironment, "parseEnvironment");
130
124
  function guessServePath() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tego",
3
- "version": "1.3.45",
3
+ "version": "1.3.46",
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.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"
52
+ "@tachybase/acl": "1.3.46",
53
+ "@tachybase/auth": "1.3.46",
54
+ "@tachybase/cache": "1.3.46",
55
+ "@tachybase/database": "1.3.46",
56
+ "@tachybase/data-source": "1.3.46",
57
+ "@tachybase/evaluators": "1.3.46",
58
+ "@tachybase/globals": "1.3.46",
59
+ "@tachybase/actions": "1.3.46",
60
+ "@tachybase/loader": "1.3.46",
61
+ "@tachybase/logger": "1.3.46",
62
+ "@tachybase/resourcer": "1.3.46",
63
+ "@tachybase/schema": "1.3.46",
64
+ "@tachybase/utils": "1.3.46",
65
+ "@tego/core": "1.3.46"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/lodash": "4.17.20",
package/src/constants.ts CHANGED
@@ -1,7 +1,11 @@
1
1
  import path from 'node:path';
2
2
 
3
- export const DEFAULT_DEV_PLUGINS_PATH = path.resolve('plugins', 'dev');
4
- export const DEFAULT_REMOTE_PLUGINS_PATH = path.resolve('plugins', 'remote');
5
- export const DEFAULT_BUILTIN_PLUGINS_PATH = path.resolve('plugins', 'builtin');
6
- export const DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH = path.join('plugins', 'builtin');
3
+ import { parseEnvironment } from './utils';
4
+
5
+ // 解析环境变量
6
+ parseEnvironment();
7
+
8
+ export const DEFAULT_DEV_PLUGINS_PATH = path.join(process.env.TEGO_RUNTIME_HOME, 'plugins', 'dev');
9
+ export const DEFAULT_REMOTE_PLUGINS_PATH = path.join(process.env.TEGO_RUNTIME_HOME, 'plugins', 'remote');
10
+ export const DEFAULT_BUILTIN_PLUGINS_PATH = path.join(process.env.TEGO_RUNTIME_HOME, 'plugins', 'builtin');
7
11
  export const DEFAULT_WEB_PACKAGE_NAME = '@tego/web';
package/src/index.ts CHANGED
@@ -3,17 +3,21 @@ import './preload';
3
3
  import { performance } from 'node:perf_hooks';
4
4
  import TachybaseGlobal from '@tachybase/globals';
5
5
  import { createDevPluginsSymlink, createStoragePluginsSymlink } from '@tachybase/utils';
6
-
7
6
  import { Gateway } from '@tego/core';
7
+
8
8
  import { Command } from 'commander';
9
9
 
10
10
  import { getConfig } from './config';
11
11
  import PluginPresets from './plugin-presets';
12
12
  import { prepare } from './prepare';
13
- import { parseEnvironment } from './utils';
13
+ import { guessServePath } from './utils';
14
14
 
15
- // 解析环境变量
16
- parseEnvironment();
15
+ if (!process.env.SERVE_PATH) {
16
+ const servePath = guessServePath();
17
+ if (servePath) {
18
+ process.env.SERVE_PATH = servePath;
19
+ }
20
+ }
17
21
 
18
22
  const program = new Command();
19
23
  program.name('tego').version(require('../package.json').version);
package/src/prepare.ts CHANGED
@@ -5,7 +5,7 @@ import process from 'node:process';
5
5
  import yoctoSpinner from '@socketregistry/yocto-spinner/index.cjs';
6
6
  import execa from 'execa';
7
7
 
8
- import { DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH, DEFAULT_WEB_PACKAGE_NAME } from './constants';
8
+ import { DEFAULT_BUILTIN_PLUGINS_PATH, DEFAULT_WEB_PACKAGE_NAME } from './constants';
9
9
  import { defaultModules } from './default-modules';
10
10
  import { defaultPlugins } from './default-plugins';
11
11
  import { downloadTar, initEnvFile } from './utils';
@@ -38,11 +38,10 @@ export async function prepare({
38
38
  npmExist = false;
39
39
  }
40
40
 
41
- const prefix = path.join(name, DEFAULT_BUILTIN_PLUGINS_RELATIVE_PATH);
42
41
  // 安装前端代码
43
42
  console.log('🚀 ~ start download ~ front end files');
44
43
  const spinner = yoctoSpinner({ text: `Loading ${DEFAULT_WEB_PACKAGE_NAME}` }).start();
45
- await downloadTar(DEFAULT_WEB_PACKAGE_NAME, `${prefix}/${DEFAULT_WEB_PACKAGE_NAME}`);
44
+ await downloadTar(DEFAULT_WEB_PACKAGE_NAME, `${DEFAULT_BUILTIN_PLUGINS_PATH}/${DEFAULT_WEB_PACKAGE_NAME}`);
46
45
  spinner.success();
47
46
  console.log();
48
47
 
@@ -52,9 +51,9 @@ export async function prepare({
52
51
  let index = 1;
53
52
  for (const moduleName of moduleNames) {
54
53
  const spinner = yoctoSpinner({ text: `[${index++}/${moduleNames.length}] Loading ${moduleName}` }).start();
55
- await downloadTar(moduleName, `${prefix}/${moduleName}`);
54
+ await downloadTar(moduleName, `${DEFAULT_BUILTIN_PLUGINS_PATH}/${moduleName}`);
56
55
  if (npmExist) {
57
- await npmInstall(`${prefix}/${moduleName}`, spinner);
56
+ await npmInstall(`${DEFAULT_BUILTIN_PLUGINS_PATH}/${moduleName}`, spinner);
58
57
  }
59
58
  spinner.success();
60
59
  }
@@ -66,9 +65,9 @@ export async function prepare({
66
65
  const pluginNames = plugins.map((pluginName: string) => `@tachybase/plugin-${pluginName}`);
67
66
  for (const pluginName of pluginNames) {
68
67
  const spinner = yoctoSpinner({ text: `[${index++}/${pluginNames.length}] Loading ${pluginName}` }).start();
69
- await downloadTar(pluginName, `${prefix}/${pluginName}`);
68
+ await downloadTar(pluginName, `${DEFAULT_BUILTIN_PLUGINS_PATH}/${pluginName}`);
70
69
  if (npmExist) {
71
- await npmInstall(`${prefix}/${pluginName}`, spinner);
70
+ await npmInstall(`${DEFAULT_BUILTIN_PLUGINS_PATH}/${pluginName}`, spinner);
72
71
  }
73
72
  spinner.success();
74
73
  }
package/src/utils.ts CHANGED
@@ -96,13 +96,6 @@ export function parseEnvironment() {
96
96
  process.env.API_BASE_URL = process.env.APP_SERVER_BASE_URL + process.env.API_BASE_PATH;
97
97
  process.env.__env_modified__ = '1';
98
98
  }
99
-
100
- if (!process.env.SERVE_PATH) {
101
- const servePath = guessServePath();
102
- if (servePath) {
103
- process.env.SERVE_PATH = servePath;
104
- }
105
- }
106
99
  }
107
100
 
108
101
  export function guessServePath() {