@tachybase/module-web 0.23.8 → 0.23.16

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,16 +1,16 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "0.23.8",
3
+ "@tachybase/client": "0.23.16",
4
4
  "react-router-dom": "6.28.1",
5
5
  "@ant-design/icons": "5.3.7",
6
6
  "antd": "5.22.5",
7
- "@tachybase/utils": "0.23.8",
8
- "@tachybase/actions": "0.23.8",
9
- "@tachybase/server": "0.23.8",
7
+ "@tachybase/utils": "0.23.16",
8
+ "@tachybase/actions": "0.23.16",
9
+ "@tachybase/server": "0.23.16",
10
10
  "react-i18next": "15.1.4",
11
- "@tachybase/database": "0.23.8",
12
- "@tachybase/schema": "0.23.8",
11
+ "@tachybase/database": "0.23.16",
12
+ "@tachybase/schema": "0.23.16",
13
13
  "ahooks": "3.8.4",
14
14
  "lodash": "4.17.21",
15
- "@tachybase/components": "0.23.8"
15
+ "@tachybase/components": "0.23.16"
16
16
  };
@@ -1 +1 @@
1
- {"name":"cronstrue","title":"cRonstrue","version":"2.52.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2024-12-22T16:01:02.585Z"}
1
+ {"name":"cronstrue","title":"cRonstrue","version":"2.52.0","description":"Convert cron expressions into human readable descriptions","author":"Brady Holt","license":"MIT","bugs":{"url":"https://github.com/bradymholt/cronstrue/issues"},"homepage":"https://github.com/bradymholt/cronstrue","keywords":["cron","cronjob","crontab","schedule","parser","cron expression","cron description","pretty cron","cron for humans","cron translated","cron english","cron schedule","cron english","cron schedule"],"main":"dist/cronstrue.js","bin":{"cronstrue":"bin/cli.js"},"typings":"dist/cronstrue.d.ts","files":["dist/","locales/","i18n.js","i18n.d.ts"],"repository":{"type":"git","url":"git+https://github.com/bradymholt/cronstrue.git"},"publishConfig":{"access":"public"},"prettier":{"printWidth":120},"devDependencies":{"@types/chai":"^4.2.11","@types/mocha":"^8.0.0","chai":"^4.2.0","handlebars":"^4.7.6","marked":"^4.0.10","mocha":"^10.1.0","pixl-xml":"^1.0.13","prettier":"^2.1.1","terser-webpack-plugin":"^5.3.1","ts-loader":"^9.2.6","ts-node":"^10.5.0","typescript":"^4.6.2","webpack":"^5.69.1","webpack-cli":"^4.9.2","xml2js":"^0.5.0"},"scripts":{"start":"npm run build","build":"npx tsc -p ./src --emitDeclarationOnly","test":"npx mocha --reporter spec --require ts-node/register \"./test/**/*.ts\"","prepublishOnly":"rm -rf ./dist && ./node_modules/webpack-cli/bin/cli.js && git add -A"},"dependencies":{},"_lastModified":"2024-12-26T07:37:05.203Z"}
@@ -122,7 +122,18 @@ class ModuleWeb extends import_server.Plugin {
122
122
  },
123
123
  async getLang(ctx, next) {
124
124
  const lang = await getLang(ctx);
125
- const resources = await ctx.app.localeManager.get(lang);
125
+ const app = ctx.app;
126
+ const eTag = await app.localeManager.getETag(lang);
127
+ const resources = await app.localeManager.get(lang);
128
+ const requestETag = ctx.get("If-None-Match");
129
+ if (eTag && eTag === requestETag.substring(0, 36)) {
130
+ ctx.status = 304;
131
+ ctx.set("ETag", requestETag);
132
+ } else {
133
+ const newTag = `${eTag}-${requestETag.substring(36 + 1)}`;
134
+ ctx.set("ETag", newTag);
135
+ console.log(ctx.get("ETag"));
136
+ }
126
137
  ctx.body = {
127
138
  lang,
128
139
  ...resources
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@tachybase/module-web",
3
3
  "displayName": "WEB client",
4
- "version": "0.23.8",
4
+ "version": "0.23.16",
5
5
  "description": "Provides a client interface for the TachyBase server",
6
6
  "license": "Apache-2.0",
7
7
  "main": "./dist/server/index.js",
8
+ "dependencies": {},
8
9
  "devDependencies": {
9
10
  "@ant-design/icons": "~5.3.7",
10
11
  "@types/react": "~18.3.18",
@@ -21,16 +22,16 @@
21
22
  "react-dom": "~18.3.1",
22
23
  "react-i18next": "~15.1.4",
23
24
  "react-router-dom": "6.28.1",
24
- "@tachybase/schema": "0.23.8",
25
- "@tachybase/components": "0.23.8"
25
+ "@tachybase/components": "0.23.16",
26
+ "@tachybase/schema": "0.23.16"
26
27
  },
27
28
  "peerDependencies": {
28
- "@tachybase/database": "0.23.8",
29
- "@tachybase/server": "0.23.8",
30
- "@tachybase/test": "0.23.8",
31
- "@tachybase/actions": "0.23.8",
32
- "@tachybase/client": "0.23.8",
33
- "@tachybase/utils": "0.23.8"
29
+ "@tachybase/actions": "0.23.16",
30
+ "@tachybase/client": "0.23.16",
31
+ "@tachybase/server": "0.23.16",
32
+ "@tachybase/database": "0.23.16",
33
+ "@tachybase/test": "0.23.16",
34
+ "@tachybase/utils": "0.23.16"
34
35
  },
35
36
  "description.zh-CN": "为 TachyBase 服务端提供客户端界面",
36
37
  "displayName.zh-CN": "WEB 客户端",
@@ -1,41 +0,0 @@
1
-
2
- 
3
- > @tachybase/module-web@0.23.2 build /Users/seal/Documents/projects/tachybase/packages/module-web
4
- > tachybase-build --no-dts @tachybase/module-web
5
-
6
- The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
7
- @tachybase/module-web: module-web build start
8
- @tachybase/module-web: build plugin client
9
- @tachybase/module-web: build plugin server source
10
- @tachybase/module-web: delete server files
11
- @tachybase/module-web: build plugin server dependencies
12
- @tachybase/module-web: These packages cronstrue will be bundled to dist/node_modules. These packages @tachybase/utils, @tachybase/actions, @tachybase/server, @tachybase/database will be exclude.
13
- @tachybase/module-web: write external version
14
- @tachybase/module-web: afterBuild
15
- @tachybase/module-web: coping client locale
16
- ❌ build errors:
17
- 🐛 Error: ENOENT: no such file or directory, lstat '/Users/seal/Documents/projects/tachybase/packages/client/lib/locale'
18
-  at async lstat (node:internal/fs/promises:1021:18)
19
- at async Promise.all (index 0)
20
-  at async checkPaths (node:internal/fs/cp/cp:76:39)
21
-  at async cpFn (node:internal/fs/cp/cp:65:17)
22
- at async Object.afterBuild (/Users/seal/Documents/projects/tachybase/packages/module-web/build.config.ts:18:5)
23
- at async buildPackage (/Users/seal/Documents/projects/tachybase/apps/build/lib/build.js:141:5)
24
- at async buildPackages (/Users/seal/Documents/projects/tachybase/apps/build/lib/build.js:102:7)
25
- at async build (/Users/seal/Documents/projects/tachybase/apps/build/lib/build.js:80:3) {
26
- errno: -2,
27
- code: 'ENOENT',
28
- syscall: 'lstat',
29
- path: '/Users/seal/Documents/projects/tachybase/packages/client/lib/locale'
30
- }
31
- /Users/seal/Documents/projects/tachybase/apps/build/lib/build.js:88
32
- throw new Error("build error.");
33
- ^
34
-
35
- Error: build error.
36
- at Timeout._onTimeout (/Users/seal/Documents/projects/tachybase/apps/build/lib/build.js:88:13)
37
-  at listOnTimeout (node:internal/timers:581:17)
38
-  at process.processTimers (node:internal/timers:519:7)
39
-
40
- Node.js v20.18.0
41
-  ELIFECYCLE  Command failed with exit code 1.