@nekosu/maa-checker 1.0.9 → 1.1.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/main.js +68 -19
- package/dist/main.js.map +4 -4
- package/package.json +2 -2
package/dist/main.js
CHANGED
|
@@ -20856,6 +20856,8 @@ var locale_en_default = {
|
|
|
20856
20856
|
"maa.pipeline.error.unknown-anchor": "Unknown anchor {0}",
|
|
20857
20857
|
"maa.pipeline.error.unknown-attr": "Unknown attribute {0}",
|
|
20858
20858
|
"maa.pipeline.error.duplicate-next": "Duplicate route {0}",
|
|
20859
|
+
"maa.pipeline.error.unknown-locale": "Unknown locale key {0}",
|
|
20860
|
+
"maa.pipeline.error.missing-locale": "Locale key {0} missing translations for {1}",
|
|
20859
20861
|
"maa.pipeline.error.conflict-controller": "Conflict controller {0}, previous defined in {1}",
|
|
20860
20862
|
"maa.pipeline.error.unknown-controller": "Unknown controller {0}",
|
|
20861
20863
|
"maa.pipeline.error.conflict-resource": "Conflict resource {0}, previous defined in {1}",
|
|
@@ -20954,7 +20956,7 @@ var locale_zh_cn_default = {
|
|
|
20954
20956
|
"maa.pipeline.codelens.language-switch": "\u5207\u6362",
|
|
20955
20957
|
"maa.pipeline.codelens.language-activated": "\u5DF2\u6FC0\u6D3B",
|
|
20956
20958
|
"maa.pipeline.codeaction.extract-locale": "\u63D0\u53D6\u56FD\u9645\u5316\u6587\u6848",
|
|
20957
|
-
"maa.pipeline.codeaction.input-key": "\u8F93\u5165\u56FD\u9645\
|
|
20959
|
+
"maa.pipeline.codeaction.input-key": "\u8F93\u5165\u56FD\u9645\u5316\u952E",
|
|
20958
20960
|
"maa.pipeline.codeaction.key-exists": "\u5DF2\u5B58\u5728",
|
|
20959
20961
|
"maa.pipeline.codeaction.switch-to-v1": "\u5207\u6362\u5230 V1",
|
|
20960
20962
|
"maa.pipeline.codeaction.switch-to-v2": "\u5207\u6362\u5230 V2",
|
|
@@ -20966,6 +20968,8 @@ var locale_zh_cn_default = {
|
|
|
20966
20968
|
"maa.pipeline.error.unknown-anchor": "\u672A\u77E5Anchor {0}",
|
|
20967
20969
|
"maa.pipeline.error.unknown-attr": "\u672A\u77E5\u5C5E\u6027 {0}",
|
|
20968
20970
|
"maa.pipeline.error.duplicate-next": "\u91CD\u590D\u8DEF\u7531 {0}",
|
|
20971
|
+
"maa.pipeline.error.unknown-locale": "\u672A\u77E5\u56FD\u9645\u5316\u952E {0}",
|
|
20972
|
+
"maa.pipeline.error.missing-locale": "\u56FD\u9645\u5316\u952E {0} \u7F3A\u5C11\u8BED\u8A00 {1} \u7684\u7FFB\u8BD1",
|
|
20969
20973
|
"maa.pipeline.error.conflict-controller": "\u51B2\u7A81\u63A7\u5236\u5668 {0}, \u4E0A\u4E00\u4E2A\u5B9A\u4E49\u5728 {1}",
|
|
20970
20974
|
"maa.pipeline.error.unknown-controller": "\u672A\u77E5\u63A7\u5236\u5668 {0}",
|
|
20971
20975
|
"maa.pipeline.error.conflict-resource": "\u51B2\u7A81\u8D44\u6E90 {0}, \u4E0A\u4E00\u4E2A\u5B9A\u4E49\u5728 {1}",
|
|
@@ -25817,20 +25821,7 @@ var FsContentWatcher = class {
|
|
|
25817
25821
|
}
|
|
25818
25822
|
};
|
|
25819
25823
|
|
|
25820
|
-
// pkgs/pipeline-manager/src/
|
|
25821
|
-
function extractTaskRef(r) {
|
|
25822
|
-
if (r.type === "task.target" || r.type === "task.entry") {
|
|
25823
|
-
return r.target;
|
|
25824
|
-
} else if (r.type === "task.next") {
|
|
25825
|
-
return !r.anchor ? r.target : null;
|
|
25826
|
-
} else if (r.type === "task.roi") {
|
|
25827
|
-
return r.prevRef ? null : r.target;
|
|
25828
|
-
} else {
|
|
25829
|
-
return null;
|
|
25830
|
-
}
|
|
25831
|
-
}
|
|
25832
|
-
|
|
25833
|
-
// pkgs/pipeline-manager/src/diagnostic/diagnostic.ts
|
|
25824
|
+
// pkgs/pipeline-manager/src/diagnostic/interface.ts
|
|
25834
25825
|
function checkInterface(bundle) {
|
|
25835
25826
|
const result = [];
|
|
25836
25827
|
const layer = bundle.topLayer;
|
|
@@ -26059,7 +26050,22 @@ function checkInterface(bundle) {
|
|
|
26059
26050
|
}
|
|
26060
26051
|
return result;
|
|
26061
26052
|
}
|
|
26062
|
-
|
|
26053
|
+
|
|
26054
|
+
// pkgs/pipeline-manager/src/utils/helper.ts
|
|
26055
|
+
function extractTaskRef(r) {
|
|
26056
|
+
if (r.type === "task.target" || r.type === "task.entry") {
|
|
26057
|
+
return r.target;
|
|
26058
|
+
} else if (r.type === "task.next") {
|
|
26059
|
+
return !r.anchor ? r.target : null;
|
|
26060
|
+
} else if (r.type === "task.roi") {
|
|
26061
|
+
return r.prevRef ? null : r.target;
|
|
26062
|
+
} else {
|
|
26063
|
+
return null;
|
|
26064
|
+
}
|
|
26065
|
+
}
|
|
26066
|
+
|
|
26067
|
+
// pkgs/pipeline-manager/src/diagnostic/task.ts
|
|
26068
|
+
function checkTask(bundle) {
|
|
26063
26069
|
const result = [];
|
|
26064
26070
|
for (const layer of bundle.allLayers) {
|
|
26065
26071
|
for (const [name, taskInfos] of Object.entries(layer.tasks)) {
|
|
@@ -26202,6 +26208,36 @@ function performDiagnostic(bundle) {
|
|
|
26202
26208
|
anchor: ref.target
|
|
26203
26209
|
});
|
|
26204
26210
|
}
|
|
26211
|
+
} else if (ref.type === "task.locale") {
|
|
26212
|
+
const infos = bundle.langBundle.queryKey(ref.target);
|
|
26213
|
+
if (!infos.find((info2) => !!info2)) {
|
|
26214
|
+
result.push({
|
|
26215
|
+
level: "error",
|
|
26216
|
+
file: ref.file,
|
|
26217
|
+
offset: ref.location.offset,
|
|
26218
|
+
length: ref.location.length,
|
|
26219
|
+
type: "unknown-locale",
|
|
26220
|
+
locale: ref.target
|
|
26221
|
+
});
|
|
26222
|
+
} else {
|
|
26223
|
+
const missingLangs = [];
|
|
26224
|
+
for (const [idx, info2] of infos.entries()) {
|
|
26225
|
+
if (!info2) {
|
|
26226
|
+
missingLangs.push(bundle.langBundle.langs[idx].name);
|
|
26227
|
+
}
|
|
26228
|
+
}
|
|
26229
|
+
if (missingLangs.length > 0) {
|
|
26230
|
+
result.push({
|
|
26231
|
+
level: "error",
|
|
26232
|
+
file: ref.file,
|
|
26233
|
+
offset: ref.location.offset,
|
|
26234
|
+
length: ref.location.length,
|
|
26235
|
+
type: "missing-locale",
|
|
26236
|
+
locale: ref.target,
|
|
26237
|
+
langs: missingLangs
|
|
26238
|
+
});
|
|
26239
|
+
}
|
|
26240
|
+
}
|
|
26205
26241
|
}
|
|
26206
26242
|
if (ref.type === "task.next" && ref.unknown && ref.unknown.length > 0) {
|
|
26207
26243
|
for (const [attr, offset, length] of ref.unknown) {
|
|
@@ -26217,9 +26253,10 @@ function performDiagnostic(bundle) {
|
|
|
26217
26253
|
}
|
|
26218
26254
|
}
|
|
26219
26255
|
}
|
|
26220
|
-
result.push(...checkInterface(bundle));
|
|
26221
26256
|
return result;
|
|
26222
26257
|
}
|
|
26258
|
+
|
|
26259
|
+
// pkgs/pipeline-manager/src/diagnostic/message.ts
|
|
26223
26260
|
async function buildDiagnosticMessage(root, diag, evalPos) {
|
|
26224
26261
|
const buildPos = async (loc) => {
|
|
26225
26262
|
const [line, column] = await evalPos(loc.file, loc.offset);
|
|
@@ -26249,6 +26286,10 @@ async function buildDiagnosticMessage(root, diag, evalPos) {
|
|
|
26249
26286
|
return t("maa.pipeline.error.unknown-anchor", diag.anchor);
|
|
26250
26287
|
case "unknown-attr":
|
|
26251
26288
|
return t("maa.pipeline.error.unknown-attr", diag.attr);
|
|
26289
|
+
case "unknown-locale":
|
|
26290
|
+
return t("maa.pipeline.error.unknown-locale", diag.locale);
|
|
26291
|
+
case "missing-locale":
|
|
26292
|
+
return t("maa.pipeline.error.missing-locale", diag.locale, diag.langs.join(", "));
|
|
26252
26293
|
case "int-conflict-controller":
|
|
26253
26294
|
return t("maa.pipeline.error.conflict-controller", diag.ctrl, await buildPos(diag.previous));
|
|
26254
26295
|
case "int-unknown-controller":
|
|
@@ -26292,6 +26333,14 @@ async function buildDiagnosticMessage(root, diag, evalPos) {
|
|
|
26292
26333
|
return [start, end, await buildBrief()];
|
|
26293
26334
|
}
|
|
26294
26335
|
|
|
26336
|
+
// pkgs/pipeline-manager/src/diagnostic/diagnostic.ts
|
|
26337
|
+
function performDiagnostic(bundle) {
|
|
26338
|
+
const result = [];
|
|
26339
|
+
result.push(...checkTask(bundle));
|
|
26340
|
+
result.push(...checkInterface(bundle));
|
|
26341
|
+
return result;
|
|
26342
|
+
}
|
|
26343
|
+
|
|
26295
26344
|
// pkgs/pipeline-manager/src/interface/interface.ts
|
|
26296
26345
|
var import_node_events4 = __toESM(require("node:events"));
|
|
26297
26346
|
var path9 = __toESM(require("node:path"));
|
|
@@ -27193,7 +27242,6 @@ var InterfaceBundle = class extends import_node_events4.default {
|
|
|
27193
27242
|
// pkgs/maa-checker/package.json
|
|
27194
27243
|
var package_default = {
|
|
27195
27244
|
name: "@nekosu/maa-checker",
|
|
27196
|
-
version: "1.0.9",
|
|
27197
27245
|
bin: {
|
|
27198
27246
|
"maa-checker": "bin/maa-checker"
|
|
27199
27247
|
},
|
|
@@ -27212,7 +27260,8 @@ var package_default = {
|
|
|
27212
27260
|
"@types/source-map-support": "^0.5.10",
|
|
27213
27261
|
"source-map-support": "^0.5.21",
|
|
27214
27262
|
typescript: "^5.9.3"
|
|
27215
|
-
}
|
|
27263
|
+
},
|
|
27264
|
+
version: "1.1.0"
|
|
27216
27265
|
};
|
|
27217
27266
|
|
|
27218
27267
|
// pkgs/maa-checker/src/main.ts
|