@cloudtower/parrot 0.19.0 → 0.19.2-beta.0
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/dist/esm/index.js +238 -0
- package/dist/esm/stats1.html +6177 -0
- package/dist/parrotI18n.d.ts +2 -1
- package/dist/umd/index.js +245 -0
- package/dist/umd/stats1.html +6177 -0
- package/package.json +19 -6
- package/.turbo/turbo-build.log +0 -3
- package/dist/index.js +0 -3
- package/dist/locales/en-US/common.json +0 -27
- package/dist/locales/en-US/components.json +0 -15
- package/dist/locales/en-US/index.js +0 -9
- package/dist/locales/en-US/metric.json +0 -5
- package/dist/locales/index.js +0 -7
- package/dist/locales/zh-CN/common.json +0 -27
- package/dist/locales/zh-CN/components.json +0 -15
- package/dist/locales/zh-CN/index.js +0 -9
- package/dist/locales/zh-CN/metric.json +0 -5
- package/dist/parrotI18n.js +0 -34
- package/src/index.ts +0 -3
- package/src/locales/en-US/common.json +0 -27
- package/src/locales/en-US/components.json +0 -15
- package/src/locales/en-US/index.ts +0 -11
- package/src/locales/en-US/metric.json +0 -5
- package/src/locales/index.ts +0 -9
- package/src/locales/zh-CN/common.json +0 -27
- package/src/locales/zh-CN/components.json +0 -15
- package/src/locales/zh-CN/index.ts +0 -11
- package/src/locales/zh-CN/metric.json +0 -5
- package/src/parrotI18n.ts +0 -31
- package/tools/index.mts +0 -47
- package/tools/templates/index.ejs +0 -9
- package/tsconfig.json +0 -10
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@cloudtower/parrot",
|
3
|
-
"version": "0.19.0",
|
3
|
+
"version": "0.19.2-beta.0",
|
4
4
|
"description": "i18n modules for cloudtower sparrow and eagle",
|
5
5
|
"keywords": [
|
6
6
|
"i18n",
|
@@ -8,19 +8,32 @@
|
|
8
8
|
"typescript",
|
9
9
|
"tower"
|
10
10
|
],
|
11
|
-
"main": "dist/index.js",
|
11
|
+
"main": "dist/umd/index.js",
|
12
|
+
"module": "./dist/esm/index.js",
|
12
13
|
"types": "dist/index.d.ts",
|
14
|
+
"files": [
|
15
|
+
"dist"
|
16
|
+
],
|
13
17
|
"scripts": {
|
14
18
|
"prebuild": "rm -rf dist",
|
15
|
-
"build": "
|
16
|
-
"
|
19
|
+
"build": "rollup --config rollup.config.js --bundleConfigAsCjs",
|
20
|
+
"typings": "tsc -v && tsc --emitDeclarationOnly",
|
17
21
|
"generate:reexport": "node --loader ts-node/esm tools/index.mts",
|
18
22
|
"lint": "eslint src --ext .ts --quiet"
|
19
23
|
},
|
24
|
+
"dependencies": {
|
25
|
+
"i18next": "21.10.0",
|
26
|
+
"lodash.merge": "^4.6.2"
|
27
|
+
},
|
20
28
|
"devDependencies": {
|
29
|
+
"@rollup/plugin-json": "^6.0.0",
|
30
|
+
"@types/lodash.merge": "^4.6.7",
|
21
31
|
"ejs": "^3.1.8",
|
22
|
-
"
|
32
|
+
"rollup": "^3.12.1",
|
33
|
+
"rollup-plugin-esbuild": "5.0.0",
|
34
|
+
"rollup-plugin-polyfill-node": "^0.12.0",
|
35
|
+
"rollup-plugin-visualizer": "5.9.0",
|
23
36
|
"typescript": "^4.8.4"
|
24
37
|
},
|
25
|
-
"gitHead": "
|
38
|
+
"gitHead": "ea1cbd77e199cf9a44ca57d4152319817862f76d"
|
26
39
|
}
|
package/.turbo/turbo-build.log
DELETED
package/dist/index.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"_action_": "Action",
|
3
|
-
"action": "Action",
|
4
|
-
"all": "All",
|
5
|
-
"cancel": "Cancel",
|
6
|
-
"clear_query": "Clear the filter criteria",
|
7
|
-
"close": "Close",
|
8
|
-
"contains": "Contains",
|
9
|
-
"confirm": "Confirm",
|
10
|
-
"empty": "No ",
|
11
|
-
"enable": "Enable",
|
12
|
-
"error": "Error",
|
13
|
-
"next_step": "Next",
|
14
|
-
"not_contains": "Not Contains",
|
15
|
-
"not_enable": "Not enabled",
|
16
|
-
"prev_step": "Previous",
|
17
|
-
"io": "Total I/O",
|
18
|
-
"load_failed": "Failed to load",
|
19
|
-
"param": "Parameter",
|
20
|
-
"no": "No",
|
21
|
-
"message": "Message",
|
22
|
-
"architecture": "CPU Architecture",
|
23
|
-
"calculation": "Computing",
|
24
|
-
"on": "On",
|
25
|
-
"error_message": "Error Message",
|
26
|
-
"retry": "Retry"
|
27
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"contains": "Contains",
|
3
|
-
"custom_column": "Customize Columns & Order",
|
4
|
-
"in": "belongs to",
|
5
|
-
"not": "Not",
|
6
|
-
"not_contains": "Not Contains",
|
7
|
-
"or": "or",
|
8
|
-
"previous_items": "Previous {size} items",
|
9
|
-
"next_items": "Next {size} items",
|
10
|
-
"push_to": "Jump to",
|
11
|
-
"pagination_range": "Item {range1} – {range2}",
|
12
|
-
"pagination_total": "Item {range1} – {range2}, {total} in total",
|
13
|
-
"unknow_error": "Unknown error",
|
14
|
-
"to": "to"
|
15
|
-
}
|
package/dist/locales/index.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"_action_": "操作",
|
3
|
-
"action": "操作",
|
4
|
-
"all": "全部",
|
5
|
-
"cancel": "取消",
|
6
|
-
"clear_query": "清空筛选条件",
|
7
|
-
"close": "关闭",
|
8
|
-
"contains": "包含",
|
9
|
-
"confirm": "确定",
|
10
|
-
"empty": "无",
|
11
|
-
"enable": "启用",
|
12
|
-
"error": "错误",
|
13
|
-
"next_step": "下一步",
|
14
|
-
"not_contains": "不包含",
|
15
|
-
"not_enable": "不启用",
|
16
|
-
"prev_step": "上一步",
|
17
|
-
"io": "I/O 总数",
|
18
|
-
"load_failed": "加载失败",
|
19
|
-
"param": "参数",
|
20
|
-
"no": "否",
|
21
|
-
"message": "信息",
|
22
|
-
"architecture": "CPU 架构",
|
23
|
-
"calculation": "计算中",
|
24
|
-
"on": "开启",
|
25
|
-
"error_message": "错误信息",
|
26
|
-
"retry": "重试"
|
27
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"contains": "包含",
|
3
|
-
"custom_column": "自定义列的展示和顺序",
|
4
|
-
"in": "属于",
|
5
|
-
"not": "不为",
|
6
|
-
"not_contains": "不包含",
|
7
|
-
"or": "或",
|
8
|
-
"previous_items": "前 {size} 项",
|
9
|
-
"next_items": "后 {size} 项",
|
10
|
-
"push_to": "跳转至",
|
11
|
-
"pagination_range": "第 {range1} – {range2} 项",
|
12
|
-
"pagination_total": "第 {range1} – {range2} 项,共 {total} 项",
|
13
|
-
"unknow_error": "未知错误",
|
14
|
-
"to": "至"
|
15
|
-
}
|
package/dist/parrotI18n.js
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
2
|
-
__assign = Object.assign || function(t) {
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
4
|
-
s = arguments[i];
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
6
|
-
t[p] = s[p];
|
7
|
-
}
|
8
|
-
return t;
|
9
|
-
};
|
10
|
-
return __assign.apply(this, arguments);
|
11
|
-
};
|
12
|
-
import i18next from "i18next";
|
13
|
-
import locales from "./locales";
|
14
|
-
var parrotI18n = i18next.createInstance({
|
15
|
-
lng: "zh-CN",
|
16
|
-
fallbackLng: "en-US",
|
17
|
-
debug: true,
|
18
|
-
interpolation: {
|
19
|
-
prefix: "{",
|
20
|
-
suffix: "}",
|
21
|
-
},
|
22
|
-
resources: {
|
23
|
-
"en-US": {
|
24
|
-
translation: __assign({}, locales["en-US"]),
|
25
|
-
},
|
26
|
-
"zh-CN": {
|
27
|
-
translation: __assign({}, locales["zh-CN"]),
|
28
|
-
},
|
29
|
-
},
|
30
|
-
});
|
31
|
-
export default parrotI18n;
|
32
|
-
export var initParrotI18n = function () {
|
33
|
-
parrotI18n.init({});
|
34
|
-
};
|
package/src/index.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"_action_": "Action",
|
3
|
-
"action": "Action",
|
4
|
-
"all": "All",
|
5
|
-
"cancel": "Cancel",
|
6
|
-
"clear_query": "Clear the filter criteria",
|
7
|
-
"close": "Close",
|
8
|
-
"contains": "Contains",
|
9
|
-
"confirm": "Confirm",
|
10
|
-
"empty": "No ",
|
11
|
-
"enable": "Enable",
|
12
|
-
"error": "Error",
|
13
|
-
"next_step": "Next",
|
14
|
-
"not_contains": "Not Contains",
|
15
|
-
"not_enable": "Not enabled",
|
16
|
-
"prev_step": "Previous",
|
17
|
-
"io": "Total I/O",
|
18
|
-
"load_failed": "Failed to load",
|
19
|
-
"param": "Parameter",
|
20
|
-
"no": "No",
|
21
|
-
"message": "Message",
|
22
|
-
"architecture": "CPU Architecture",
|
23
|
-
"calculation": "Computing",
|
24
|
-
"on": "On",
|
25
|
-
"error_message": "Error Message",
|
26
|
-
"retry": "Retry"
|
27
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"contains": "Contains",
|
3
|
-
"custom_column": "Customize Columns & Order",
|
4
|
-
"in": "belongs to",
|
5
|
-
"not": "Not",
|
6
|
-
"not_contains": "Not Contains",
|
7
|
-
"or": "or",
|
8
|
-
"previous_items": "Previous {size} items",
|
9
|
-
"next_items": "Next {size} items",
|
10
|
-
"push_to": "Jump to",
|
11
|
-
"pagination_range": "Item {range1} – {range2}",
|
12
|
-
"pagination_total": "Item {range1} – {range2}, {total} in total",
|
13
|
-
"unknow_error": "Unknown error",
|
14
|
-
"to": "to"
|
15
|
-
}
|
package/src/locales/index.ts
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"_action_": "操作",
|
3
|
-
"action": "操作",
|
4
|
-
"all": "全部",
|
5
|
-
"cancel": "取消",
|
6
|
-
"clear_query": "清空筛选条件",
|
7
|
-
"close": "关闭",
|
8
|
-
"contains": "包含",
|
9
|
-
"confirm": "确定",
|
10
|
-
"empty": "无",
|
11
|
-
"enable": "启用",
|
12
|
-
"error": "错误",
|
13
|
-
"next_step": "下一步",
|
14
|
-
"not_contains": "不包含",
|
15
|
-
"not_enable": "不启用",
|
16
|
-
"prev_step": "上一步",
|
17
|
-
"io": "I/O 总数",
|
18
|
-
"load_failed": "加载失败",
|
19
|
-
"param": "参数",
|
20
|
-
"no": "否",
|
21
|
-
"message": "信息",
|
22
|
-
"architecture": "CPU 架构",
|
23
|
-
"calculation": "计算中",
|
24
|
-
"on": "开启",
|
25
|
-
"error_message": "错误信息",
|
26
|
-
"retry": "重试"
|
27
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"contains": "包含",
|
3
|
-
"custom_column": "自定义列的展示和顺序",
|
4
|
-
"in": "属于",
|
5
|
-
"not": "不为",
|
6
|
-
"not_contains": "不包含",
|
7
|
-
"or": "或",
|
8
|
-
"previous_items": "前 {size} 项",
|
9
|
-
"next_items": "后 {size} 项",
|
10
|
-
"push_to": "跳转至",
|
11
|
-
"pagination_range": "第 {range1} – {range2} 项",
|
12
|
-
"pagination_total": "第 {range1} – {range2} 项,共 {total} 项",
|
13
|
-
"unknow_error": "未知错误",
|
14
|
-
"to": "至"
|
15
|
-
}
|
package/src/parrotI18n.ts
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
import i18next from "i18next";
|
2
|
-
|
3
|
-
import locales from "./locales";
|
4
|
-
|
5
|
-
const parrotI18n = i18next.createInstance({
|
6
|
-
lng: "zh-CN",
|
7
|
-
fallbackLng: "en-US",
|
8
|
-
debug: true,
|
9
|
-
interpolation: {
|
10
|
-
prefix: "{",
|
11
|
-
suffix: "}",
|
12
|
-
},
|
13
|
-
resources: {
|
14
|
-
"en-US": {
|
15
|
-
translation: {
|
16
|
-
...locales["en-US"],
|
17
|
-
},
|
18
|
-
},
|
19
|
-
"zh-CN": {
|
20
|
-
translation: {
|
21
|
-
...locales["zh-CN"],
|
22
|
-
},
|
23
|
-
},
|
24
|
-
},
|
25
|
-
});
|
26
|
-
|
27
|
-
export default parrotI18n;
|
28
|
-
|
29
|
-
export const initParrotI18n = () => {
|
30
|
-
parrotI18n.init({});
|
31
|
-
};
|
package/tools/index.mts
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
import ejs from "ejs";
|
2
|
-
import fs from "fs";
|
3
|
-
import path from "path";
|
4
|
-
import { fileURLToPath } from "url";
|
5
|
-
|
6
|
-
const __filename = fileURLToPath(import.meta.url);
|
7
|
-
const __dirname = path.dirname(__filename);
|
8
|
-
|
9
|
-
let locales = ["en-US", "zh-CN"];
|
10
|
-
|
11
|
-
const snakeToCamel = (str: string) =>
|
12
|
-
str
|
13
|
-
.toLowerCase()
|
14
|
-
.replace(/([-_][a-z])/g, (group) =>
|
15
|
-
group.toUpperCase().replace("-", "").replace("_", "")
|
16
|
-
);
|
17
|
-
|
18
|
-
Promise.allSettled(
|
19
|
-
locales.map(async (locale) => {
|
20
|
-
const relativePath = `../src/locales/${locale}`;
|
21
|
-
const fileNames = fs.readdirSync(path.resolve(__dirname, relativePath));
|
22
|
-
|
23
|
-
const names = fileNames
|
24
|
-
.filter((name) => !name.includes(".ts"))
|
25
|
-
.map((filename) => {
|
26
|
-
const name = filename.replace(".json", "");
|
27
|
-
const camelCase = snakeToCamel(name);
|
28
|
-
return {
|
29
|
-
originCase: name,
|
30
|
-
camelCase: camelCase === "enum" ? "enumObj" : camelCase,
|
31
|
-
};
|
32
|
-
});
|
33
|
-
|
34
|
-
try {
|
35
|
-
const result = await ejs.renderFile(
|
36
|
-
path.resolve(__dirname, "./templates/index.ejs"),
|
37
|
-
{ names }
|
38
|
-
);
|
39
|
-
|
40
|
-
fs.writeFileSync(
|
41
|
-
path.resolve(__dirname, `${relativePath}/index.ts`),
|
42
|
-
result
|
43
|
-
);
|
44
|
-
return;
|
45
|
-
} catch (error) {}
|
46
|
-
})
|
47
|
-
);
|