@nocobase/plugin-client 0.14.0-alpha.3 → 0.14.0-alpha.4

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.
@@ -0,0 +1,42 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { defineConfig } from '@nocobase/build';
4
+
5
+ const existsSync = require('fs').existsSync;
6
+
7
+ const client = path.dirname(require.resolve('@nocobase/client/package.json'));
8
+ const antd = require.resolve('antd');
9
+
10
+ export default defineConfig({
11
+ afterBuild: async (log) => {
12
+ const localeDir = path.resolve(__dirname, './dist/locale');
13
+ if (existsSync(localeDir)) {
14
+ await fs.rm(localeDir, { recursive: true });
15
+ }
16
+
17
+ log('coping client locale');
18
+ await fs.cp(path.resolve(client, 'lib', 'locale'), localeDir, {
19
+ recursive: true,
20
+ force: true,
21
+ });
22
+
23
+ log('coping antd locale');
24
+ const files = await fs.readdir(path.resolve(path.dirname(antd), 'locale'));
25
+ await fs.mkdir(path.resolve(localeDir, 'antd'), { recursive: true });
26
+ for (const file of files) {
27
+ if (path.extname(file) !== '.js') {
28
+ continue;
29
+ }
30
+ const content = require(path.resolve(path.dirname(antd), 'locale', file)).default;
31
+ try {
32
+ await fs.writeFile(
33
+ path.resolve(localeDir, 'antd', file),
34
+ `module.exports = ${JSON.stringify(content)}`,
35
+ 'utf-8',
36
+ );
37
+ } catch (error) {
38
+ log(`skip ${file}`);
39
+ }
40
+ }
41
+ },
42
+ });
@@ -1,6 +1,6 @@
1
1
  module.exports = {
2
- "@nocobase/client": "0.14.0-alpha.3",
3
- "@nocobase/utils": "0.14.0-alpha.3",
4
- "@nocobase/server": "0.14.0-alpha.3",
5
- "@nocobase/database": "0.14.0-alpha.3"
2
+ "@nocobase/client": "0.14.0-alpha.4",
3
+ "@nocobase/utils": "0.14.0-alpha.4",
4
+ "@nocobase/server": "0.14.0-alpha.4",
5
+ "@nocobase/database": "0.14.0-alpha.4"
6
6
  };
@@ -1 +1 @@
1
- {"name":"cronstrue","title":"cRonstrue","version":"2.27.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":"2023-09-13T10:39:45.315Z"}
1
+ {"name":"cronstrue","title":"cRonstrue","version":"2.27.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":"2023-09-21T15:35:07.272Z"}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "displayName.zh-CN": "WEB 客户端",
5
5
  "description": "Provides a client interface for the NocoBase server",
6
6
  "description.zh-CN": "为 NocoBase 服务端提供客户端界面",
7
- "version": "0.14.0-alpha.3",
7
+ "version": "0.14.0-alpha.4",
8
8
  "main": "./dist/server/index.js",
9
9
  "license": "AGPL-3.0",
10
10
  "devDependencies": {
@@ -20,5 +20,5 @@
20
20
  "@nocobase/test": "0.x",
21
21
  "@nocobase/utils": "0.x"
22
22
  },
23
- "gitHead": "535a8c83d37e488a52bd1ad3c75726101081177c"
23
+ "gitHead": "e2aab7863bbdfd76afc7164272b275e868ac59c0"
24
24
  }
package/build.js DELETED
@@ -1,41 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- const fs = require('fs/promises');
4
- const path = require('path');
5
- const existsSync = require('fs').existsSync;
6
-
7
- const client = require.resolve('@nocobase/client');
8
- const antd = require.resolve('antd');
9
-
10
- exports.run = async (log) => {
11
- const localeDir = path.resolve(__dirname, './dist/locale');
12
- if (existsSync(localeDir)) {
13
- await fs.rmdir(localeDir, { force: true, recursive: true });
14
- }
15
-
16
- log('coping client locale');
17
- await fs.cp(path.resolve(path.dirname(client), 'locale'), localeDir, {
18
- recursive: true,
19
- force: true,
20
- });
21
-
22
- log('coping antd locale');
23
- const files = await fs.readdir(path.resolve(path.dirname(antd), 'locale'));
24
- await fs.mkdir(path.resolve(localeDir, 'antd'), { force: true, recursive: true });
25
- for (const file of files) {
26
- if (path.extname(file) !== '.js') {
27
- continue;
28
- }
29
- const content = require(path.resolve(path.dirname(antd), 'locale', file)).default;
30
- try {
31
- await fs.writeFile(
32
- path.resolve(localeDir, 'antd', file),
33
- `module.exports = ${JSON.stringify(content)}`,
34
- 'utf-8',
35
- {},
36
- );
37
- } catch (error) {
38
- log(`skip ${file}`);
39
- }
40
- }
41
- };