tego 1.3.42 → 1.3.44

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/preload.js CHANGED
@@ -23,6 +23,23 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
23
  var import_node_module = require("node:module");
24
24
  var import_globals = __toESM(require("@tachybase/globals"));
25
25
  var import_loader = require("@tachybase/loader");
26
+ var import_dayjs = __toESM(require("dayjs"));
27
+ var import_advancedFormat = __toESM(require("dayjs/plugin/advancedFormat"));
28
+ var import_calendar = __toESM(require("dayjs/plugin/calendar"));
29
+ var import_customParseFormat = __toESM(require("dayjs/plugin/customParseFormat"));
30
+ var import_isBetween = __toESM(require("dayjs/plugin/isBetween"));
31
+ var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"));
32
+ var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
33
+ var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
34
+ var import_localeData = __toESM(require("dayjs/plugin/localeData"));
35
+ var import_quarterOfYear = __toESM(require("dayjs/plugin/quarterOfYear"));
36
+ var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"));
37
+ var import_timezone = __toESM(require("dayjs/plugin/timezone"));
38
+ var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"));
39
+ var import_utc = __toESM(require("dayjs/plugin/utc"));
40
+ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
41
+ var import_weekOfYear = __toESM(require("dayjs/plugin/weekOfYear"));
42
+ var import_weekYear = __toESM(require("dayjs/plugin/weekYear"));
26
43
  var import_constants = require("./constants");
27
44
  if (!process.env.NODE_MODULES_PATH) {
28
45
  process.env.NODE_MODULES_PATH = [
@@ -71,3 +88,19 @@ const lookingPaths = [appRoot, ...import_globals.default.getInstance().get("PLUG
71
88
  import_globals.default.getInstance().set("WORKER_PATHS", lookingPaths);
72
89
  import_globals.default.getInstance().set("WORKER_MODULES", [...whitelists]);
73
90
  import_node_module.Module._load = (0, import_loader.defineLoader)(whitelists, originalLoad, lookingPaths);
91
+ import_dayjs.default.extend(import_weekday.default);
92
+ import_dayjs.default.extend(import_localeData.default);
93
+ import_dayjs.default.extend(import_timezone.default);
94
+ import_dayjs.default.extend(import_utc.default);
95
+ import_dayjs.default.extend(import_quarterOfYear.default);
96
+ import_dayjs.default.extend(import_isoWeek.default);
97
+ import_dayjs.default.extend(import_isBetween.default);
98
+ import_dayjs.default.extend(import_isSameOrAfter.default);
99
+ import_dayjs.default.extend(import_isSameOrBefore.default);
100
+ import_dayjs.default.extend(import_weekOfYear.default);
101
+ import_dayjs.default.extend(import_weekYear.default);
102
+ import_dayjs.default.extend(import_customParseFormat.default);
103
+ import_dayjs.default.extend(import_advancedFormat.default);
104
+ import_dayjs.default.extend(import_calendar.default);
105
+ import_dayjs.default.extend(import_relativeTime.default);
106
+ import_dayjs.default.extend(import_updateLocale.default);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tego",
3
- "version": "1.3.42",
3
+ "version": "1.3.44",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "tego",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@koa/cors": "5.0.0",
26
26
  "@koa/multer": "3.1.0",
27
- "@socketregistry/yocto-spinner": "1.0.19",
27
+ "@socketregistry/yocto-spinner": "1.0.20",
28
28
  "async-mutex": "0.5.0",
29
29
  "axios": "0.29.0",
30
30
  "cache-manager": "5.7.6",
@@ -39,7 +39,7 @@
39
39
  "koa-bodyparser": "4.4.1",
40
40
  "lodash": "4.17.21",
41
41
  "multer": "2.0.2",
42
- "mysql2": "3.14.1",
42
+ "mysql2": "3.14.3",
43
43
  "npm-registry-fetch": "19.0.0",
44
44
  "pg": "^8.16.3",
45
45
  "react": "18.3.1",
@@ -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.42",
53
- "@tachybase/actions": "1.3.42",
54
- "@tachybase/auth": "1.3.42",
55
- "@tachybase/cache": "1.3.42",
56
- "@tachybase/data-source": "1.3.42",
57
- "@tachybase/database": "1.3.42",
58
- "@tachybase/evaluators": "1.3.42",
59
- "@tachybase/globals": "1.3.42",
60
- "@tachybase/loader": "1.3.42",
61
- "@tachybase/logger": "1.3.42",
62
- "@tachybase/resourcer": "1.3.42",
63
- "@tachybase/schema": "1.3.42",
64
- "@tachybase/server": "1.3.42",
65
- "@tachybase/utils": "1.3.42"
52
+ "@tachybase/acl": "1.3.44",
53
+ "@tachybase/cache": "1.3.44",
54
+ "@tachybase/auth": "1.3.44",
55
+ "@tachybase/actions": "1.3.44",
56
+ "@tachybase/data-source": "1.3.44",
57
+ "@tachybase/evaluators": "1.3.44",
58
+ "@tachybase/globals": "1.3.44",
59
+ "@tachybase/loader": "1.3.44",
60
+ "@tachybase/database": "1.3.44",
61
+ "@tachybase/logger": "1.3.44",
62
+ "@tachybase/resourcer": "1.3.44",
63
+ "@tachybase/schema": "1.3.44",
64
+ "@tachybase/utils": "1.3.44",
65
+ "@tego/core": "1.3.44"
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/preload.ts CHANGED
@@ -2,6 +2,24 @@ import { Module } from 'node:module';
2
2
  import TachybaseGlobal from '@tachybase/globals';
3
3
  import { defineLoader } from '@tachybase/loader';
4
4
 
5
+ import dayjs from 'dayjs';
6
+ import advancedFormat from 'dayjs/plugin/advancedFormat';
7
+ import calendar from 'dayjs/plugin/calendar';
8
+ import customParseFormat from 'dayjs/plugin/customParseFormat';
9
+ import IsBetween from 'dayjs/plugin/isBetween';
10
+ import isoWeek from 'dayjs/plugin/isoWeek';
11
+ import IsSameOrAfter from 'dayjs/plugin/isSameOrAfter';
12
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
13
+ import localeData from 'dayjs/plugin/localeData';
14
+ import quarterOfYear from 'dayjs/plugin/quarterOfYear';
15
+ import relativeTime from 'dayjs/plugin/relativeTime';
16
+ import tz from 'dayjs/plugin/timezone';
17
+ import updateLocale from 'dayjs/plugin/updateLocale';
18
+ import utc from 'dayjs/plugin/utc';
19
+ import weekday from 'dayjs/plugin/weekday';
20
+ import weekOfYear from 'dayjs/plugin/weekOfYear';
21
+ import weekYear from 'dayjs/plugin/weekYear';
22
+
5
23
  import { DEFAULT_BUILTIN_PLUGINS_PATH, DEFAULT_DEV_PLUGINS_PATH, DEFAULT_REMOTE_PLUGINS_PATH } from './constants';
6
24
 
7
25
  // 默认 NODE_MODULES_PATH 搜索路径
@@ -73,3 +91,20 @@ TachybaseGlobal.getInstance().set('WORKER_MODULES', [...whitelists]);
73
91
 
74
92
  // 整个加载过程允许报错,保持和默认加载器一样的行为
75
93
  Module._load = defineLoader(whitelists, originalLoad, lookingPaths);
94
+
95
+ dayjs.extend(weekday);
96
+ dayjs.extend(localeData);
97
+ dayjs.extend(tz);
98
+ dayjs.extend(utc);
99
+ dayjs.extend(quarterOfYear);
100
+ dayjs.extend(isoWeek);
101
+ dayjs.extend(IsBetween);
102
+ dayjs.extend(IsSameOrAfter);
103
+ dayjs.extend(isSameOrBefore);
104
+ dayjs.extend(weekOfYear);
105
+ dayjs.extend(weekYear);
106
+ dayjs.extend(customParseFormat);
107
+ dayjs.extend(advancedFormat);
108
+ dayjs.extend(calendar);
109
+ dayjs.extend(relativeTime);
110
+ dayjs.extend(updateLocale);