@nocobase/plugin-client 0.14.0-alpha.2 → 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.
- package/build.config.ts +42 -0
- package/dist/externalVersion.js +4 -4
- package/dist/node_modules/cronstrue/package.json +1 -1
- package/dist/server/server.js +0 -23
- package/package.json +2 -2
- package/build.js +0 -41
package/build.config.ts
ADDED
|
@@ -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
|
+
});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
"@nocobase/client": "0.14.0-alpha.
|
|
3
|
-
"@nocobase/utils": "0.14.0-alpha.
|
|
4
|
-
"@nocobase/server": "0.14.0-alpha.
|
|
5
|
-
"@nocobase/database": "0.14.0-alpha.
|
|
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-
|
|
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/dist/server/server.js
CHANGED
|
@@ -93,7 +93,6 @@ class ClientPlugin extends import_server.Plugin {
|
|
|
93
93
|
});
|
|
94
94
|
this.app.acl.allow("app", "getLang");
|
|
95
95
|
this.app.acl.allow("app", "getInfo");
|
|
96
|
-
this.app.acl.allow("app", "getPlugins");
|
|
97
96
|
this.app.acl.allow("plugins", "*", "public");
|
|
98
97
|
this.app.acl.registerSnippet({
|
|
99
98
|
name: "app",
|
|
@@ -139,28 +138,6 @@ class ClientPlugin extends import_server.Plugin {
|
|
|
139
138
|
};
|
|
140
139
|
await next();
|
|
141
140
|
},
|
|
142
|
-
async getPlugins(ctx, next) {
|
|
143
|
-
const pm = ctx.db.getRepository("applicationPlugins");
|
|
144
|
-
const PLUGIN_CLIENT_ENTRY_FILE = "dist/client/index.js";
|
|
145
|
-
const items = await pm.find({
|
|
146
|
-
filter: {
|
|
147
|
-
enabled: true
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
ctx.body = items.map((item) => {
|
|
151
|
-
try {
|
|
152
|
-
const packageName = import_server.PluginManager.getPackageName(item.name);
|
|
153
|
-
return {
|
|
154
|
-
...item.toJSON(),
|
|
155
|
-
packageName,
|
|
156
|
-
url: (0, import_server.getExposeUrl)(packageName, PLUGIN_CLIENT_ENTRY_FILE)
|
|
157
|
-
};
|
|
158
|
-
} catch {
|
|
159
|
-
return false;
|
|
160
|
-
}
|
|
161
|
-
}).filter(Boolean);
|
|
162
|
-
await next();
|
|
163
|
-
},
|
|
164
141
|
async clearCache(ctx, next) {
|
|
165
142
|
await ctx.cache.reset();
|
|
166
143
|
await next();
|
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.
|
|
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": "
|
|
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
|
-
};
|