ylcwf 0.5.2 → 0.6.1
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/CHANGELOG.md +93 -20
- package/README.md +97 -126
- package/dist/index.js +1891 -868
- package/package.json +17 -108
- package/scripts/install.sh +0 -0
- package/ui-dist/assets/index-D4qqW48f.js +80 -0
- package/ui-dist/index.html +1 -1
- package/scripts/install-app-macos.sh +0 -73
- package/ui-dist/assets/index-B4CSJ3eM.js +0 -80
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from "node:events";
|
|
2
2
|
import node_child_process, { execFile, execFileSync, spawn } from "node:child_process";
|
|
3
|
-
import node_path, { basename, dirname as external_node_path_dirname, extname, isAbsolute, join as external_node_path_join, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
3
|
+
import node_path, { basename, dirname as external_node_path_dirname, extname, isAbsolute as external_node_path_isAbsolute, join as external_node_path_join, relative as external_node_path_relative, resolve as external_node_path_resolve, sep } from "node:path";
|
|
4
4
|
import node_fs, { appendFileSync, chmodSync, closeSync, copyFileSync, existsSync as external_node_fs_existsSync, mkdirSync, openSync, readFileSync, readdirSync as external_node_fs_readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
|
|
5
5
|
import node_process, { stdin as external_node_process_stdin, stdout as external_node_process_stdout } from "node:process";
|
|
6
6
|
import { stripVTControlCharacters as external_node_util_stripVTControlCharacters, styleText as external_node_util_styleText } from "node:util";
|
|
@@ -15,7 +15,7 @@ import { __webpack_require__ } from "./l.js";
|
|
|
15
15
|
import { createRequire as __rspack_createRequire } from "node:module";
|
|
16
16
|
const __rspack_createRequire_require = __rspack_createRequire(import.meta.url);
|
|
17
17
|
__webpack_require__.add({
|
|
18
|
-
"
|
|
18
|
+
"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
|
|
19
19
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
20
20
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI);
|
|
21
21
|
let formatter = (open, close, replace = open)=>(input)=>{
|
|
@@ -81,14 +81,14 @@ __webpack_require__.add({
|
|
|
81
81
|
module.exports = createColors();
|
|
82
82
|
module.exports.createColors = createColors;
|
|
83
83
|
},
|
|
84
|
-
"
|
|
85
|
-
var identity = __webpack_require__("
|
|
86
|
-
var Scalar = __webpack_require__("
|
|
87
|
-
var YAMLMap = __webpack_require__("
|
|
88
|
-
var YAMLSeq = __webpack_require__("
|
|
89
|
-
var resolveBlockMap = __webpack_require__("
|
|
90
|
-
var resolveBlockSeq = __webpack_require__("
|
|
91
|
-
var resolveFlowCollection = __webpack_require__("
|
|
84
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
85
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
86
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
87
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
88
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
89
|
+
var resolveBlockMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js");
|
|
90
|
+
var resolveBlockSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js");
|
|
91
|
+
var resolveFlowCollection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js");
|
|
92
92
|
function resolveCollection(CN, ctx, token, onError, tagName, tag) {
|
|
93
93
|
const coll = 'block-map' === token.type ? resolveBlockMap.resolveBlockMap(CN, ctx, token, onError, tag) : 'block-seq' === token.type ? resolveBlockSeq.resolveBlockSeq(CN, ctx, token, onError, tag) : resolveFlowCollection.resolveFlowCollection(CN, ctx, token, onError, tag);
|
|
94
94
|
const Coll = coll.constructor;
|
|
@@ -135,11 +135,11 @@ __webpack_require__.add({
|
|
|
135
135
|
}
|
|
136
136
|
exports.composeCollection = composeCollection;
|
|
137
137
|
},
|
|
138
|
-
"
|
|
139
|
-
var Document = __webpack_require__("
|
|
140
|
-
var composeNode = __webpack_require__("
|
|
141
|
-
var resolveEnd = __webpack_require__("
|
|
142
|
-
var resolveProps = __webpack_require__("
|
|
138
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
139
|
+
var Document = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js");
|
|
140
|
+
var composeNode = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js");
|
|
141
|
+
var resolveEnd = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js");
|
|
142
|
+
var resolveProps = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js");
|
|
143
143
|
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
144
144
|
const opts = Object.assign({
|
|
145
145
|
_directives: directives
|
|
@@ -177,13 +177,13 @@ __webpack_require__.add({
|
|
|
177
177
|
}
|
|
178
178
|
exports.composeDoc = composeDoc;
|
|
179
179
|
},
|
|
180
|
-
"
|
|
181
|
-
var Alias = __webpack_require__("
|
|
182
|
-
var identity = __webpack_require__("
|
|
183
|
-
var composeCollection = __webpack_require__("
|
|
184
|
-
var composeScalar = __webpack_require__("
|
|
185
|
-
var resolveEnd = __webpack_require__("
|
|
186
|
-
var utilEmptyScalarPosition = __webpack_require__("
|
|
180
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-node.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
181
|
+
var Alias = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js");
|
|
182
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
183
|
+
var composeCollection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-collection.js");
|
|
184
|
+
var composeScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js");
|
|
185
|
+
var resolveEnd = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js");
|
|
186
|
+
var utilEmptyScalarPosition = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js");
|
|
187
187
|
const CN = {
|
|
188
188
|
composeNode,
|
|
189
189
|
composeEmptyNode
|
|
@@ -271,11 +271,11 @@ __webpack_require__.add({
|
|
|
271
271
|
exports.composeEmptyNode = composeEmptyNode;
|
|
272
272
|
exports.composeNode = composeNode;
|
|
273
273
|
},
|
|
274
|
-
"
|
|
275
|
-
var identity = __webpack_require__("
|
|
276
|
-
var Scalar = __webpack_require__("
|
|
277
|
-
var resolveBlockScalar = __webpack_require__("
|
|
278
|
-
var resolveFlowScalar = __webpack_require__("
|
|
274
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-scalar.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
275
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
276
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
277
|
+
var resolveBlockScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js");
|
|
278
|
+
var resolveFlowScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js");
|
|
279
279
|
function composeScalar(ctx, token, tagToken, onError) {
|
|
280
280
|
const { value, type, comment, range } = 'block-scalar' === token.type ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
|
|
281
281
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg)=>onError(tagToken, 'TAG_RESOLVE_FAILED', msg)) : null;
|
|
@@ -330,14 +330,14 @@ __webpack_require__.add({
|
|
|
330
330
|
}
|
|
331
331
|
exports.composeScalar = composeScalar;
|
|
332
332
|
},
|
|
333
|
-
"
|
|
333
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
334
334
|
var node_process = __rspack_createRequire_require("process");
|
|
335
|
-
var directives = __webpack_require__("
|
|
336
|
-
var Document = __webpack_require__("
|
|
337
|
-
var errors = __webpack_require__("
|
|
338
|
-
var identity = __webpack_require__("
|
|
339
|
-
var composeDoc = __webpack_require__("
|
|
340
|
-
var resolveEnd = __webpack_require__("
|
|
335
|
+
var directives = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js");
|
|
336
|
+
var Document = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js");
|
|
337
|
+
var errors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js");
|
|
338
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
339
|
+
var composeDoc = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/compose-doc.js");
|
|
340
|
+
var resolveEnd = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js");
|
|
341
341
|
function getErrorPos(src) {
|
|
342
342
|
if ('number' == typeof src) return [
|
|
343
343
|
src,
|
|
@@ -518,13 +518,13 @@ __webpack_require__.add({
|
|
|
518
518
|
}
|
|
519
519
|
exports.Composer = Composer;
|
|
520
520
|
},
|
|
521
|
-
"
|
|
522
|
-
var Pair = __webpack_require__("
|
|
523
|
-
var YAMLMap = __webpack_require__("
|
|
524
|
-
var resolveProps = __webpack_require__("
|
|
525
|
-
var utilContainsNewline = __webpack_require__("
|
|
526
|
-
var utilFlowIndentCheck = __webpack_require__("
|
|
527
|
-
var utilMapIncludes = __webpack_require__("
|
|
521
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-map.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
522
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
523
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
524
|
+
var resolveProps = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js");
|
|
525
|
+
var utilContainsNewline = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js");
|
|
526
|
+
var utilFlowIndentCheck = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js");
|
|
527
|
+
var utilMapIncludes = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js");
|
|
528
528
|
const startColMsg = 'All mapping items must start at the same column';
|
|
529
529
|
function resolveBlockMap({ composeNode, composeEmptyNode }, ctx, bm, onError, tag) {
|
|
530
530
|
const NodeClass = tag?.nodeClass ?? YAMLMap.YAMLMap;
|
|
@@ -601,8 +601,8 @@ __webpack_require__.add({
|
|
|
601
601
|
}
|
|
602
602
|
exports.resolveBlockMap = resolveBlockMap;
|
|
603
603
|
},
|
|
604
|
-
"
|
|
605
|
-
var Scalar = __webpack_require__("
|
|
604
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
605
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
606
606
|
function resolveBlockScalar(ctx, scalar, onError) {
|
|
607
607
|
const start = scalar.offset;
|
|
608
608
|
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
@@ -797,10 +797,10 @@ __webpack_require__.add({
|
|
|
797
797
|
}
|
|
798
798
|
exports.resolveBlockScalar = resolveBlockScalar;
|
|
799
799
|
},
|
|
800
|
-
"
|
|
801
|
-
var YAMLSeq = __webpack_require__("
|
|
802
|
-
var resolveProps = __webpack_require__("
|
|
803
|
-
var utilFlowIndentCheck = __webpack_require__("
|
|
800
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-seq.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
801
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
802
|
+
var resolveProps = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js");
|
|
803
|
+
var utilFlowIndentCheck = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js");
|
|
804
804
|
function resolveBlockSeq({ composeNode, composeEmptyNode }, ctx, bs, onError, tag) {
|
|
805
805
|
const NodeClass = tag?.nodeClass ?? YAMLSeq.YAMLSeq;
|
|
806
806
|
const seq = new NodeClass(ctx.schema);
|
|
@@ -838,7 +838,7 @@ __webpack_require__.add({
|
|
|
838
838
|
}
|
|
839
839
|
exports.resolveBlockSeq = resolveBlockSeq;
|
|
840
840
|
},
|
|
841
|
-
"
|
|
841
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js" (__unused_rspack_module, exports) {
|
|
842
842
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
843
843
|
let comment = '';
|
|
844
844
|
if (end) {
|
|
@@ -876,15 +876,15 @@ __webpack_require__.add({
|
|
|
876
876
|
}
|
|
877
877
|
exports.resolveEnd = resolveEnd;
|
|
878
878
|
},
|
|
879
|
-
"
|
|
880
|
-
var identity = __webpack_require__("
|
|
881
|
-
var Pair = __webpack_require__("
|
|
882
|
-
var YAMLMap = __webpack_require__("
|
|
883
|
-
var YAMLSeq = __webpack_require__("
|
|
884
|
-
var resolveEnd = __webpack_require__("
|
|
885
|
-
var resolveProps = __webpack_require__("
|
|
886
|
-
var utilContainsNewline = __webpack_require__("
|
|
887
|
-
var utilMapIncludes = __webpack_require__("
|
|
879
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-collection.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
880
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
881
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
882
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
883
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
884
|
+
var resolveEnd = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js");
|
|
885
|
+
var resolveProps = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js");
|
|
886
|
+
var utilContainsNewline = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js");
|
|
887
|
+
var utilMapIncludes = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js");
|
|
888
888
|
const blockMsg = 'Block collections are not allowed within flow collections';
|
|
889
889
|
const isBlock = (token)=>token && ('block-map' === token.type || 'block-seq' === token.type);
|
|
890
890
|
function resolveFlowCollection({ composeNode, composeEmptyNode }, ctx, fc, onError, tag) {
|
|
@@ -1032,9 +1032,9 @@ __webpack_require__.add({
|
|
|
1032
1032
|
}
|
|
1033
1033
|
exports.resolveFlowCollection = resolveFlowCollection;
|
|
1034
1034
|
},
|
|
1035
|
-
"
|
|
1036
|
-
var Scalar = __webpack_require__("
|
|
1037
|
-
var resolveEnd = __webpack_require__("
|
|
1035
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1036
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
1037
|
+
var resolveEnd = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-end.js");
|
|
1038
1038
|
function resolveFlowScalar(scalar, strict, onError) {
|
|
1039
1039
|
const { offset, type, source, end } = scalar;
|
|
1040
1040
|
let _type;
|
|
@@ -1223,7 +1223,7 @@ __webpack_require__.add({
|
|
|
1223
1223
|
}
|
|
1224
1224
|
exports.resolveFlowScalar = resolveFlowScalar;
|
|
1225
1225
|
},
|
|
1226
|
-
"
|
|
1226
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-props.js" (__unused_rspack_module, exports) {
|
|
1227
1227
|
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
1228
1228
|
let spaceBefore = false;
|
|
1229
1229
|
let atNewline = startOnNewline;
|
|
@@ -1330,7 +1330,7 @@ __webpack_require__.add({
|
|
|
1330
1330
|
}
|
|
1331
1331
|
exports.resolveProps = resolveProps;
|
|
1332
1332
|
},
|
|
1333
|
-
"
|
|
1333
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js" (__unused_rspack_module, exports) {
|
|
1334
1334
|
function containsNewline(key) {
|
|
1335
1335
|
if (!key) return null;
|
|
1336
1336
|
switch(key.type){
|
|
@@ -1358,7 +1358,7 @@ __webpack_require__.add({
|
|
|
1358
1358
|
}
|
|
1359
1359
|
exports.containsNewline = containsNewline;
|
|
1360
1360
|
},
|
|
1361
|
-
"
|
|
1361
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-empty-scalar-position.js" (__unused_rspack_module, exports) {
|
|
1362
1362
|
function emptyScalarPosition(offset, before, pos) {
|
|
1363
1363
|
if (before) {
|
|
1364
1364
|
pos ?? (pos = before.length);
|
|
@@ -1383,8 +1383,8 @@ __webpack_require__.add({
|
|
|
1383
1383
|
}
|
|
1384
1384
|
exports.emptyScalarPosition = emptyScalarPosition;
|
|
1385
1385
|
},
|
|
1386
|
-
"
|
|
1387
|
-
var utilContainsNewline = __webpack_require__("
|
|
1386
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-flow-indent-check.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1387
|
+
var utilContainsNewline = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-contains-newline.js");
|
|
1388
1388
|
function flowIndentCheck(indent, fc, onError) {
|
|
1389
1389
|
if (fc?.type === 'flow-collection') {
|
|
1390
1390
|
const end = fc.end[0];
|
|
@@ -1396,8 +1396,8 @@ __webpack_require__.add({
|
|
|
1396
1396
|
}
|
|
1397
1397
|
exports.flowIndentCheck = flowIndentCheck;
|
|
1398
1398
|
},
|
|
1399
|
-
"
|
|
1400
|
-
var identity = __webpack_require__("
|
|
1399
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/util-map-includes.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1400
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1401
1401
|
function mapIncludes(ctx, items, search) {
|
|
1402
1402
|
const { uniqueKeys } = ctx.options;
|
|
1403
1403
|
if (false === uniqueKeys) return false;
|
|
@@ -1406,18 +1406,18 @@ __webpack_require__.add({
|
|
|
1406
1406
|
}
|
|
1407
1407
|
exports.mapIncludes = mapIncludes;
|
|
1408
1408
|
},
|
|
1409
|
-
"
|
|
1410
|
-
var Alias = __webpack_require__("
|
|
1411
|
-
var Collection = __webpack_require__("
|
|
1412
|
-
var identity = __webpack_require__("
|
|
1413
|
-
var Pair = __webpack_require__("
|
|
1414
|
-
var toJS = __webpack_require__("
|
|
1415
|
-
var Schema = __webpack_require__("
|
|
1416
|
-
var stringifyDocument = __webpack_require__("
|
|
1417
|
-
var anchors = __webpack_require__("
|
|
1418
|
-
var applyReviver = __webpack_require__("
|
|
1419
|
-
var createNode = __webpack_require__("
|
|
1420
|
-
var directives = __webpack_require__("
|
|
1409
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1410
|
+
var Alias = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js");
|
|
1411
|
+
var Collection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js");
|
|
1412
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1413
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
1414
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
1415
|
+
var Schema = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js");
|
|
1416
|
+
var stringifyDocument = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js");
|
|
1417
|
+
var anchors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js");
|
|
1418
|
+
var applyReviver = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js");
|
|
1419
|
+
var createNode = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js");
|
|
1420
|
+
var directives = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js");
|
|
1421
1421
|
class Document {
|
|
1422
1422
|
constructor(value, replacer, options){
|
|
1423
1423
|
this.commentBefore = null;
|
|
@@ -1634,9 +1634,9 @@ __webpack_require__.add({
|
|
|
1634
1634
|
}
|
|
1635
1635
|
exports.Document = Document;
|
|
1636
1636
|
},
|
|
1637
|
-
"
|
|
1638
|
-
var identity = __webpack_require__("
|
|
1639
|
-
var visit = __webpack_require__("
|
|
1637
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1638
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1639
|
+
var visit = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js");
|
|
1640
1640
|
function anchorIsValid(anchor) {
|
|
1641
1641
|
if (/[\x00-\x19\s,[\]{}]/.test(anchor)) {
|
|
1642
1642
|
const sa = JSON.stringify(anchor);
|
|
@@ -1691,7 +1691,7 @@ __webpack_require__.add({
|
|
|
1691
1691
|
exports.createNodeAnchors = createNodeAnchors;
|
|
1692
1692
|
exports.findNewAnchor = findNewAnchor;
|
|
1693
1693
|
},
|
|
1694
|
-
"
|
|
1694
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js" (__unused_rspack_module, exports) {
|
|
1695
1695
|
function applyReviver(reviver, obj, key, val) {
|
|
1696
1696
|
if (val && 'object' == typeof val) if (Array.isArray(val)) for(let i = 0, len = val.length; i < len; ++i){
|
|
1697
1697
|
const v0 = val[i];
|
|
@@ -1722,10 +1722,10 @@ __webpack_require__.add({
|
|
|
1722
1722
|
}
|
|
1723
1723
|
exports.applyReviver = applyReviver;
|
|
1724
1724
|
},
|
|
1725
|
-
"
|
|
1726
|
-
var Alias = __webpack_require__("
|
|
1727
|
-
var identity = __webpack_require__("
|
|
1728
|
-
var Scalar = __webpack_require__("
|
|
1725
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1726
|
+
var Alias = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js");
|
|
1727
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1728
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
1729
1729
|
const defaultTagPrefix = 'tag:yaml.org,2002:';
|
|
1730
1730
|
function findTagObject(value, tagName, tags) {
|
|
1731
1731
|
if (tagName) {
|
|
@@ -1783,9 +1783,9 @@ __webpack_require__.add({
|
|
|
1783
1783
|
}
|
|
1784
1784
|
exports.createNode = createNode;
|
|
1785
1785
|
},
|
|
1786
|
-
"
|
|
1787
|
-
var identity = __webpack_require__("
|
|
1788
|
-
var visit = __webpack_require__("
|
|
1786
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/directives.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1787
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1788
|
+
var visit = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js");
|
|
1789
1789
|
const escapeChars = {
|
|
1790
1790
|
'!': '%21',
|
|
1791
1791
|
',': '%2C',
|
|
@@ -1928,7 +1928,7 @@ __webpack_require__.add({
|
|
|
1928
1928
|
};
|
|
1929
1929
|
exports.Directives = Directives;
|
|
1930
1930
|
},
|
|
1931
|
-
"
|
|
1931
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js" (__unused_rspack_module, exports) {
|
|
1932
1932
|
class YAMLError extends Error {
|
|
1933
1933
|
constructor(name, pos, code, message){
|
|
1934
1934
|
super();
|
|
@@ -1979,23 +1979,23 @@ __webpack_require__.add({
|
|
|
1979
1979
|
exports.YAMLWarning = YAMLWarning;
|
|
1980
1980
|
exports.prettifyError = prettifyError;
|
|
1981
1981
|
},
|
|
1982
|
-
"
|
|
1983
|
-
var composer = __webpack_require__("
|
|
1984
|
-
var Document = __webpack_require__("
|
|
1985
|
-
var Schema = __webpack_require__("
|
|
1986
|
-
var errors = __webpack_require__("
|
|
1987
|
-
var Alias = __webpack_require__("
|
|
1988
|
-
var identity = __webpack_require__("
|
|
1989
|
-
var Pair = __webpack_require__("
|
|
1990
|
-
var Scalar = __webpack_require__("
|
|
1991
|
-
var YAMLMap = __webpack_require__("
|
|
1992
|
-
var YAMLSeq = __webpack_require__("
|
|
1993
|
-
__webpack_require__("
|
|
1994
|
-
var lexer = __webpack_require__("
|
|
1995
|
-
var lineCounter = __webpack_require__("
|
|
1996
|
-
var parser = __webpack_require__("
|
|
1997
|
-
var publicApi = __webpack_require__("
|
|
1998
|
-
var visit = __webpack_require__("
|
|
1982
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
1983
|
+
var composer = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js");
|
|
1984
|
+
var Document = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js");
|
|
1985
|
+
var Schema = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js");
|
|
1986
|
+
var errors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js");
|
|
1987
|
+
var Alias = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js");
|
|
1988
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
1989
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
1990
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
1991
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
1992
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
1993
|
+
__webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js");
|
|
1994
|
+
var lexer = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js");
|
|
1995
|
+
var lineCounter = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js");
|
|
1996
|
+
var parser = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js");
|
|
1997
|
+
var publicApi = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/public-api.js");
|
|
1998
|
+
var visit = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js");
|
|
1999
1999
|
composer.Composer;
|
|
2000
2000
|
Document.Document;
|
|
2001
2001
|
Schema.Schema;
|
|
@@ -2025,7 +2025,7 @@ __webpack_require__.add({
|
|
|
2025
2025
|
visit.visit;
|
|
2026
2026
|
visit.visitAsync;
|
|
2027
2027
|
},
|
|
2028
|
-
"
|
|
2028
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js" (__unused_rspack_module, exports) {
|
|
2029
2029
|
var node_process = __rspack_createRequire_require("process");
|
|
2030
2030
|
function debug(logLevel, ...messages) {
|
|
2031
2031
|
if ('debug' === logLevel) console.log(...messages);
|
|
@@ -2037,12 +2037,12 @@ __webpack_require__.add({
|
|
|
2037
2037
|
exports.debug = debug;
|
|
2038
2038
|
exports.warn = warn;
|
|
2039
2039
|
},
|
|
2040
|
-
"
|
|
2041
|
-
var anchors = __webpack_require__("
|
|
2042
|
-
var visit = __webpack_require__("
|
|
2043
|
-
var identity = __webpack_require__("
|
|
2044
|
-
var Node = __webpack_require__("
|
|
2045
|
-
var toJS = __webpack_require__("
|
|
2040
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Alias.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2041
|
+
var anchors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js");
|
|
2042
|
+
var visit = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js");
|
|
2043
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2044
|
+
var Node = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js");
|
|
2045
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
2046
2046
|
class Alias extends Node.NodeBase {
|
|
2047
2047
|
constructor(source){
|
|
2048
2048
|
super(identity.ALIAS);
|
|
@@ -2138,10 +2138,10 @@ __webpack_require__.add({
|
|
|
2138
2138
|
}
|
|
2139
2139
|
exports.Alias = Alias;
|
|
2140
2140
|
},
|
|
2141
|
-
"
|
|
2142
|
-
var createNode = __webpack_require__("
|
|
2143
|
-
var identity = __webpack_require__("
|
|
2144
|
-
var Node = __webpack_require__("
|
|
2141
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2142
|
+
var createNode = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js");
|
|
2143
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2144
|
+
var Node = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js");
|
|
2145
2145
|
function collectionFromPath(schema, path, value) {
|
|
2146
2146
|
let v = value;
|
|
2147
2147
|
for(let i = path.length - 1; i >= 0; --i){
|
|
@@ -2236,10 +2236,10 @@ __webpack_require__.add({
|
|
|
2236
2236
|
exports.collectionFromPath = collectionFromPath;
|
|
2237
2237
|
exports.isEmptyPath = isEmptyPath;
|
|
2238
2238
|
},
|
|
2239
|
-
"
|
|
2240
|
-
var applyReviver = __webpack_require__("
|
|
2241
|
-
var identity = __webpack_require__("
|
|
2242
|
-
var toJS = __webpack_require__("
|
|
2239
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2240
|
+
var applyReviver = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/applyReviver.js");
|
|
2241
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2242
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
2243
2243
|
class NodeBase {
|
|
2244
2244
|
constructor(type){
|
|
2245
2245
|
Object.defineProperty(this, identity.NODE_TYPE, {
|
|
@@ -2270,11 +2270,11 @@ __webpack_require__.add({
|
|
|
2270
2270
|
}
|
|
2271
2271
|
exports.NodeBase = NodeBase;
|
|
2272
2272
|
},
|
|
2273
|
-
"
|
|
2274
|
-
var createNode = __webpack_require__("
|
|
2275
|
-
var stringifyPair = __webpack_require__("
|
|
2276
|
-
var addPairToJSMap = __webpack_require__("
|
|
2277
|
-
var identity = __webpack_require__("
|
|
2273
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2274
|
+
var createNode = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js");
|
|
2275
|
+
var stringifyPair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js");
|
|
2276
|
+
var addPairToJSMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js");
|
|
2277
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2278
2278
|
function createPair(key, value, ctx) {
|
|
2279
2279
|
const k = createNode.createNode(key, void 0, ctx);
|
|
2280
2280
|
const v = createNode.createNode(value, void 0, ctx);
|
|
@@ -2305,10 +2305,10 @@ __webpack_require__.add({
|
|
|
2305
2305
|
exports.Pair = Pair;
|
|
2306
2306
|
exports.createPair = createPair;
|
|
2307
2307
|
},
|
|
2308
|
-
"
|
|
2309
|
-
var identity = __webpack_require__("
|
|
2310
|
-
var Node = __webpack_require__("
|
|
2311
|
-
var toJS = __webpack_require__("
|
|
2308
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2309
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2310
|
+
var Node = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Node.js");
|
|
2311
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
2312
2312
|
const isScalarValue = (value)=>!value || 'function' != typeof value && 'object' != typeof value;
|
|
2313
2313
|
class Scalar extends Node.NodeBase {
|
|
2314
2314
|
constructor(value){
|
|
@@ -2330,13 +2330,13 @@ __webpack_require__.add({
|
|
|
2330
2330
|
exports.Scalar = Scalar;
|
|
2331
2331
|
exports.isScalarValue = isScalarValue;
|
|
2332
2332
|
},
|
|
2333
|
-
"
|
|
2334
|
-
var stringifyCollection = __webpack_require__("
|
|
2335
|
-
var addPairToJSMap = __webpack_require__("
|
|
2336
|
-
var Collection = __webpack_require__("
|
|
2337
|
-
var identity = __webpack_require__("
|
|
2338
|
-
var Pair = __webpack_require__("
|
|
2339
|
-
var Scalar = __webpack_require__("
|
|
2333
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2334
|
+
var stringifyCollection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js");
|
|
2335
|
+
var addPairToJSMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js");
|
|
2336
|
+
var Collection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js");
|
|
2337
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2338
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
2339
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
2340
2340
|
function findPair(items, key) {
|
|
2341
2341
|
const k = identity.isScalar(key) ? key.value : key;
|
|
2342
2342
|
for (const it of items)if (identity.isPair(it)) {
|
|
@@ -2424,13 +2424,13 @@ __webpack_require__.add({
|
|
|
2424
2424
|
exports.YAMLMap = YAMLMap;
|
|
2425
2425
|
exports.findPair = findPair;
|
|
2426
2426
|
},
|
|
2427
|
-
"
|
|
2428
|
-
var createNode = __webpack_require__("
|
|
2429
|
-
var stringifyCollection = __webpack_require__("
|
|
2430
|
-
var Collection = __webpack_require__("
|
|
2431
|
-
var identity = __webpack_require__("
|
|
2432
|
-
var Scalar = __webpack_require__("
|
|
2433
|
-
var toJS = __webpack_require__("
|
|
2427
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2428
|
+
var createNode = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/createNode.js");
|
|
2429
|
+
var stringifyCollection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js");
|
|
2430
|
+
var Collection = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Collection.js");
|
|
2431
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2432
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
2433
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
2434
2434
|
class YAMLSeq extends Collection.Collection {
|
|
2435
2435
|
static get tagName() {
|
|
2436
2436
|
return 'tag:yaml.org,2002:seq';
|
|
@@ -2508,12 +2508,12 @@ __webpack_require__.add({
|
|
|
2508
2508
|
}
|
|
2509
2509
|
exports.YAMLSeq = YAMLSeq;
|
|
2510
2510
|
},
|
|
2511
|
-
"
|
|
2512
|
-
var log = __webpack_require__("
|
|
2513
|
-
var merge = __webpack_require__("
|
|
2514
|
-
var stringify = __webpack_require__("
|
|
2515
|
-
var identity = __webpack_require__("
|
|
2516
|
-
var toJS = __webpack_require__("
|
|
2511
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/addPairToJSMap.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2512
|
+
var log = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js");
|
|
2513
|
+
var merge = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js");
|
|
2514
|
+
var stringify = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js");
|
|
2515
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2516
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
2517
2517
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
2518
2518
|
if (identity.isNode(key) && key.addToJSMap) key.addToJSMap(ctx, map, value);
|
|
2519
2519
|
else if (merge.isMergeKey(ctx, key)) merge.addMergeToJSMap(ctx, map, value);
|
|
@@ -2557,7 +2557,7 @@ __webpack_require__.add({
|
|
|
2557
2557
|
}
|
|
2558
2558
|
exports.addPairToJSMap = addPairToJSMap;
|
|
2559
2559
|
},
|
|
2560
|
-
"
|
|
2560
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js" (__unused_rspack_module, exports) {
|
|
2561
2561
|
const ALIAS = Symbol.for('yaml.alias');
|
|
2562
2562
|
const DOC = Symbol.for('yaml.document');
|
|
2563
2563
|
const MAP = Symbol.for('yaml.map');
|
|
@@ -2607,8 +2607,8 @@ __webpack_require__.add({
|
|
|
2607
2607
|
exports.isScalar = isScalar;
|
|
2608
2608
|
exports.isSeq = isSeq;
|
|
2609
2609
|
},
|
|
2610
|
-
"
|
|
2611
|
-
var identity = __webpack_require__("
|
|
2610
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2611
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
2612
2612
|
function toJS(value, arg, ctx) {
|
|
2613
2613
|
if (Array.isArray(value)) return value.map((v, i)=>toJS(v, String(i), ctx));
|
|
2614
2614
|
if (value && 'function' == typeof value.toJSON) {
|
|
@@ -2632,11 +2632,11 @@ __webpack_require__.add({
|
|
|
2632
2632
|
}
|
|
2633
2633
|
exports.toJS = toJS;
|
|
2634
2634
|
},
|
|
2635
|
-
"
|
|
2636
|
-
var resolveBlockScalar = __webpack_require__("
|
|
2637
|
-
var resolveFlowScalar = __webpack_require__("
|
|
2638
|
-
var errors = __webpack_require__("
|
|
2639
|
-
var stringifyString = __webpack_require__("
|
|
2635
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
2636
|
+
var resolveBlockScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-block-scalar.js");
|
|
2637
|
+
var resolveFlowScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/resolve-flow-scalar.js");
|
|
2638
|
+
var errors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js");
|
|
2639
|
+
var stringifyString = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js");
|
|
2640
2640
|
function resolveAsScalar(token, strict = true, onError) {
|
|
2641
2641
|
if (token) {
|
|
2642
2642
|
const _onError = (pos, code, message)=>{
|
|
@@ -2894,7 +2894,7 @@ __webpack_require__.add({
|
|
|
2894
2894
|
exports.resolveAsScalar = resolveAsScalar;
|
|
2895
2895
|
exports.setScalarValue = setScalarValue;
|
|
2896
2896
|
},
|
|
2897
|
-
"
|
|
2897
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js" (__unused_rspack_module, exports) {
|
|
2898
2898
|
const stringify = (cst)=>'type' in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
2899
2899
|
function stringifyToken(token) {
|
|
2900
2900
|
switch(token.type){
|
|
@@ -2942,7 +2942,7 @@ __webpack_require__.add({
|
|
|
2942
2942
|
}
|
|
2943
2943
|
exports.stringify = stringify;
|
|
2944
2944
|
},
|
|
2945
|
-
"
|
|
2945
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js" (__unused_rspack_module, exports) {
|
|
2946
2946
|
const BREAK = Symbol('break visit');
|
|
2947
2947
|
const SKIP = Symbol('skip children');
|
|
2948
2948
|
const REMOVE = Symbol('remove item');
|
|
@@ -3002,10 +3002,10 @@ __webpack_require__.add({
|
|
|
3002
3002
|
}
|
|
3003
3003
|
exports.visit = visit;
|
|
3004
3004
|
},
|
|
3005
|
-
"
|
|
3006
|
-
var cstScalar = __webpack_require__("
|
|
3007
|
-
var cstStringify = __webpack_require__("
|
|
3008
|
-
var cstVisit = __webpack_require__("
|
|
3005
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
3006
|
+
var cstScalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-scalar.js");
|
|
3007
|
+
var cstStringify = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-stringify.js");
|
|
3008
|
+
var cstVisit = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst-visit.js");
|
|
3009
3009
|
const BOM = "\uFEFF";
|
|
3010
3010
|
const DOCUMENT = '\x02';
|
|
3011
3011
|
const FLOW_END = '\x18';
|
|
@@ -3099,8 +3099,8 @@ __webpack_require__.add({
|
|
|
3099
3099
|
exports.prettyToken = prettyToken;
|
|
3100
3100
|
exports.tokenType = tokenType;
|
|
3101
3101
|
},
|
|
3102
|
-
"
|
|
3103
|
-
var cst = __webpack_require__("
|
|
3102
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
3103
|
+
var cst = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js");
|
|
3104
3104
|
function isEmpty(ch) {
|
|
3105
3105
|
switch(ch){
|
|
3106
3106
|
case void 0:
|
|
@@ -3598,7 +3598,7 @@ __webpack_require__.add({
|
|
|
3598
3598
|
}
|
|
3599
3599
|
exports.Lexer = Lexer;
|
|
3600
3600
|
},
|
|
3601
|
-
"
|
|
3601
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js" (__unused_rspack_module, exports) {
|
|
3602
3602
|
class LineCounter {
|
|
3603
3603
|
constructor(){
|
|
3604
3604
|
this.lineStarts = [];
|
|
@@ -3629,10 +3629,10 @@ __webpack_require__.add({
|
|
|
3629
3629
|
}
|
|
3630
3630
|
exports.LineCounter = LineCounter;
|
|
3631
3631
|
},
|
|
3632
|
-
"
|
|
3632
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
3633
3633
|
var node_process = __rspack_createRequire_require("process");
|
|
3634
|
-
var cst = __webpack_require__("
|
|
3635
|
-
var lexer = __webpack_require__("
|
|
3634
|
+
var cst = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/cst.js");
|
|
3635
|
+
var lexer = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/lexer.js");
|
|
3636
3636
|
function includesToken(list, type) {
|
|
3637
3637
|
for(let i = 0; i < list.length; ++i)if (list[i].type === type) return true;
|
|
3638
3638
|
return false;
|
|
@@ -4565,14 +4565,14 @@ __webpack_require__.add({
|
|
|
4565
4565
|
}
|
|
4566
4566
|
exports.Parser = Parser;
|
|
4567
4567
|
},
|
|
4568
|
-
"
|
|
4569
|
-
var composer = __webpack_require__("
|
|
4570
|
-
var Document = __webpack_require__("
|
|
4571
|
-
var errors = __webpack_require__("
|
|
4572
|
-
var log = __webpack_require__("
|
|
4573
|
-
var identity = __webpack_require__("
|
|
4574
|
-
var lineCounter = __webpack_require__("
|
|
4575
|
-
var parser = __webpack_require__("
|
|
4568
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/public-api.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4569
|
+
var composer = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js");
|
|
4570
|
+
var Document = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/Document.js");
|
|
4571
|
+
var errors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/errors.js");
|
|
4572
|
+
var log = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js");
|
|
4573
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
4574
|
+
var lineCounter = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/line-counter.js");
|
|
4575
|
+
var parser = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/parse/parser.js");
|
|
4576
4576
|
function parseOptions(options) {
|
|
4577
4577
|
const prettyErrors = false !== options.prettyErrors;
|
|
4578
4578
|
const lineCounter$1 = options.lineCounter || prettyErrors && new lineCounter.LineCounter() || null;
|
|
@@ -4650,12 +4650,12 @@ __webpack_require__.add({
|
|
|
4650
4650
|
exports.parseDocument = parseDocument;
|
|
4651
4651
|
exports.stringify = stringify;
|
|
4652
4652
|
},
|
|
4653
|
-
"
|
|
4654
|
-
var identity = __webpack_require__("
|
|
4655
|
-
var map = __webpack_require__("
|
|
4656
|
-
var seq = __webpack_require__("
|
|
4657
|
-
var string = __webpack_require__("
|
|
4658
|
-
var tags = __webpack_require__("
|
|
4653
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/Schema.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4654
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
4655
|
+
var map = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js");
|
|
4656
|
+
var seq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js");
|
|
4657
|
+
var string = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js");
|
|
4658
|
+
var tags = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js");
|
|
4659
4659
|
const sortMapEntriesByKey = (a, b)=>a.key < b.key ? -1 : a.key > b.key ? 1 : 0;
|
|
4660
4660
|
class Schema {
|
|
4661
4661
|
constructor({ compat, customTags, merge, resolveKnownTags, schema, sortMapEntries, toStringDefaults }){
|
|
@@ -4683,9 +4683,9 @@ __webpack_require__.add({
|
|
|
4683
4683
|
}
|
|
4684
4684
|
exports.Schema = Schema;
|
|
4685
4685
|
},
|
|
4686
|
-
"
|
|
4687
|
-
var identity = __webpack_require__("
|
|
4688
|
-
var YAMLMap = __webpack_require__("
|
|
4686
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4687
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
4688
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
4689
4689
|
const map = {
|
|
4690
4690
|
collection: 'map',
|
|
4691
4691
|
default: true,
|
|
@@ -4699,8 +4699,8 @@ __webpack_require__.add({
|
|
|
4699
4699
|
};
|
|
4700
4700
|
exports.map = map;
|
|
4701
4701
|
},
|
|
4702
|
-
"
|
|
4703
|
-
var Scalar = __webpack_require__("
|
|
4702
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4703
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
4704
4704
|
const nullTag = {
|
|
4705
4705
|
identify: (value)=>null == value,
|
|
4706
4706
|
createNode: ()=>new Scalar.Scalar(null),
|
|
@@ -4712,9 +4712,9 @@ __webpack_require__.add({
|
|
|
4712
4712
|
};
|
|
4713
4713
|
exports.nullTag = nullTag;
|
|
4714
4714
|
},
|
|
4715
|
-
"
|
|
4716
|
-
var identity = __webpack_require__("
|
|
4717
|
-
var YAMLSeq = __webpack_require__("
|
|
4715
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4716
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
4717
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
4718
4718
|
const seq = {
|
|
4719
4719
|
collection: 'seq',
|
|
4720
4720
|
default: true,
|
|
@@ -4728,8 +4728,8 @@ __webpack_require__.add({
|
|
|
4728
4728
|
};
|
|
4729
4729
|
exports.seq = seq;
|
|
4730
4730
|
},
|
|
4731
|
-
"
|
|
4732
|
-
var stringifyString = __webpack_require__("
|
|
4731
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4732
|
+
var stringifyString = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js");
|
|
4733
4733
|
const string = {
|
|
4734
4734
|
identify: (value)=>'string' == typeof value,
|
|
4735
4735
|
default: true,
|
|
@@ -4744,8 +4744,8 @@ __webpack_require__.add({
|
|
|
4744
4744
|
};
|
|
4745
4745
|
exports.string = string;
|
|
4746
4746
|
},
|
|
4747
|
-
"
|
|
4748
|
-
var Scalar = __webpack_require__("
|
|
4747
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4748
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
4749
4749
|
const boolTag = {
|
|
4750
4750
|
identify: (value)=>'boolean' == typeof value,
|
|
4751
4751
|
default: true,
|
|
@@ -4762,9 +4762,9 @@ __webpack_require__.add({
|
|
|
4762
4762
|
};
|
|
4763
4763
|
exports.boolTag = boolTag;
|
|
4764
4764
|
},
|
|
4765
|
-
"
|
|
4766
|
-
var Scalar = __webpack_require__("
|
|
4767
|
-
var stringifyNumber = __webpack_require__("
|
|
4765
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4766
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
4767
|
+
var stringifyNumber = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js");
|
|
4768
4768
|
const floatNaN = {
|
|
4769
4769
|
identify: (value)=>'number' == typeof value,
|
|
4770
4770
|
default: true,
|
|
@@ -4802,8 +4802,8 @@ __webpack_require__.add({
|
|
|
4802
4802
|
exports.floatExp = floatExp;
|
|
4803
4803
|
exports.floatNaN = floatNaN;
|
|
4804
4804
|
},
|
|
4805
|
-
"
|
|
4806
|
-
var stringifyNumber = __webpack_require__("
|
|
4805
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4806
|
+
var stringifyNumber = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js");
|
|
4807
4807
|
const intIdentify = (value)=>'bigint' == typeof value || Number.isInteger(value);
|
|
4808
4808
|
const intResolve = (str, offset, radix, { intAsBigInt })=>intAsBigInt ? BigInt(str) : parseInt(str.substring(offset), radix);
|
|
4809
4809
|
function intStringify(node, radix, prefix) {
|
|
@@ -4841,14 +4841,14 @@ __webpack_require__.add({
|
|
|
4841
4841
|
exports.intHex = intHex;
|
|
4842
4842
|
exports.intOct = intOct;
|
|
4843
4843
|
},
|
|
4844
|
-
"
|
|
4845
|
-
var map = __webpack_require__("
|
|
4846
|
-
var _null = __webpack_require__("
|
|
4847
|
-
var seq = __webpack_require__("
|
|
4848
|
-
var string = __webpack_require__("
|
|
4849
|
-
var bool = __webpack_require__("
|
|
4850
|
-
var float = __webpack_require__("
|
|
4851
|
-
var int = __webpack_require__("
|
|
4844
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4845
|
+
var map = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js");
|
|
4846
|
+
var _null = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js");
|
|
4847
|
+
var seq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js");
|
|
4848
|
+
var string = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js");
|
|
4849
|
+
var bool = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js");
|
|
4850
|
+
var float = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js");
|
|
4851
|
+
var int = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js");
|
|
4852
4852
|
const schema = [
|
|
4853
4853
|
map.map,
|
|
4854
4854
|
seq.seq,
|
|
@@ -4864,10 +4864,10 @@ __webpack_require__.add({
|
|
|
4864
4864
|
];
|
|
4865
4865
|
exports.schema = schema;
|
|
4866
4866
|
},
|
|
4867
|
-
"
|
|
4868
|
-
var Scalar = __webpack_require__("
|
|
4869
|
-
var map = __webpack_require__("
|
|
4870
|
-
var seq = __webpack_require__("
|
|
4867
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4868
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
4869
|
+
var map = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js");
|
|
4870
|
+
var seq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js");
|
|
4871
4871
|
function intIdentify(value) {
|
|
4872
4872
|
return 'bigint' == typeof value || Number.isInteger(value);
|
|
4873
4873
|
}
|
|
@@ -4929,23 +4929,23 @@ __webpack_require__.add({
|
|
|
4929
4929
|
].concat(jsonScalars, jsonError);
|
|
4930
4930
|
exports.schema = schema;
|
|
4931
4931
|
},
|
|
4932
|
-
"
|
|
4933
|
-
var map = __webpack_require__("
|
|
4934
|
-
var _null = __webpack_require__("
|
|
4935
|
-
var seq = __webpack_require__("
|
|
4936
|
-
var string = __webpack_require__("
|
|
4937
|
-
var bool = __webpack_require__("
|
|
4938
|
-
var float = __webpack_require__("
|
|
4939
|
-
var int = __webpack_require__("
|
|
4940
|
-
var schema = __webpack_require__("
|
|
4941
|
-
var schema$1 = __webpack_require__("
|
|
4942
|
-
var binary = __webpack_require__("
|
|
4943
|
-
var merge = __webpack_require__("
|
|
4944
|
-
var omap = __webpack_require__("
|
|
4945
|
-
var pairs = __webpack_require__("
|
|
4946
|
-
var schema$2 = __webpack_require__("
|
|
4947
|
-
var set = __webpack_require__("
|
|
4948
|
-
var timestamp = __webpack_require__("
|
|
4932
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/tags.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
4933
|
+
var map = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js");
|
|
4934
|
+
var _null = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js");
|
|
4935
|
+
var seq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js");
|
|
4936
|
+
var string = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js");
|
|
4937
|
+
var bool = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/bool.js");
|
|
4938
|
+
var float = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/float.js");
|
|
4939
|
+
var int = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/int.js");
|
|
4940
|
+
var schema = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/core/schema.js");
|
|
4941
|
+
var schema$1 = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/json/schema.js");
|
|
4942
|
+
var binary = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js");
|
|
4943
|
+
var merge = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js");
|
|
4944
|
+
var omap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js");
|
|
4945
|
+
var pairs = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js");
|
|
4946
|
+
var schema$2 = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js");
|
|
4947
|
+
var set = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js");
|
|
4948
|
+
var timestamp = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js");
|
|
4949
4949
|
const schemas = new Map([
|
|
4950
4950
|
[
|
|
4951
4951
|
'core',
|
|
@@ -5026,10 +5026,10 @@ __webpack_require__.add({
|
|
|
5026
5026
|
exports.coreKnownTags = coreKnownTags;
|
|
5027
5027
|
exports.getTags = getTags;
|
|
5028
5028
|
},
|
|
5029
|
-
"
|
|
5029
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5030
5030
|
var node_buffer = __rspack_createRequire_require("buffer");
|
|
5031
|
-
var Scalar = __webpack_require__("
|
|
5032
|
-
var stringifyString = __webpack_require__("
|
|
5031
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5032
|
+
var stringifyString = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js");
|
|
5033
5033
|
const binary = {
|
|
5034
5034
|
identify: (value)=>value instanceof Uint8Array,
|
|
5035
5035
|
default: false,
|
|
@@ -5073,8 +5073,8 @@ __webpack_require__.add({
|
|
|
5073
5073
|
};
|
|
5074
5074
|
exports.binary = binary;
|
|
5075
5075
|
},
|
|
5076
|
-
"
|
|
5077
|
-
var Scalar = __webpack_require__("
|
|
5076
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5077
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5078
5078
|
function boolStringify({ value, source }, ctx) {
|
|
5079
5079
|
const boolObj = value ? trueTag : falseTag;
|
|
5080
5080
|
if (source && boolObj.test.test(source)) return source;
|
|
@@ -5099,9 +5099,9 @@ __webpack_require__.add({
|
|
|
5099
5099
|
exports.falseTag = falseTag;
|
|
5100
5100
|
exports.trueTag = trueTag;
|
|
5101
5101
|
},
|
|
5102
|
-
"
|
|
5103
|
-
var Scalar = __webpack_require__("
|
|
5104
|
-
var stringifyNumber = __webpack_require__("
|
|
5102
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5103
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5104
|
+
var stringifyNumber = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js");
|
|
5105
5105
|
const floatNaN = {
|
|
5106
5106
|
identify: (value)=>'number' == typeof value,
|
|
5107
5107
|
default: true,
|
|
@@ -5142,8 +5142,8 @@ __webpack_require__.add({
|
|
|
5142
5142
|
exports.floatExp = floatExp;
|
|
5143
5143
|
exports.floatNaN = floatNaN;
|
|
5144
5144
|
},
|
|
5145
|
-
"
|
|
5146
|
-
var stringifyNumber = __webpack_require__("
|
|
5145
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5146
|
+
var stringifyNumber = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js");
|
|
5147
5147
|
const intIdentify = (value)=>'bigint' == typeof value || Number.isInteger(value);
|
|
5148
5148
|
function intResolve(str, offset, radix, { intAsBigInt }) {
|
|
5149
5149
|
const sign = str[0];
|
|
@@ -5215,9 +5215,9 @@ __webpack_require__.add({
|
|
|
5215
5215
|
exports.intHex = intHex;
|
|
5216
5216
|
exports.intOct = intOct;
|
|
5217
5217
|
},
|
|
5218
|
-
"
|
|
5219
|
-
var identity = __webpack_require__("
|
|
5220
|
-
var Scalar = __webpack_require__("
|
|
5218
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5219
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5220
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5221
5221
|
const MERGE_KEY = '<<';
|
|
5222
5222
|
const merge = {
|
|
5223
5223
|
identify: (value)=>value === MERGE_KEY || 'symbol' == typeof value && value.description === MERGE_KEY,
|
|
@@ -5258,12 +5258,12 @@ __webpack_require__.add({
|
|
|
5258
5258
|
exports.isMergeKey = isMergeKey;
|
|
5259
5259
|
exports.merge = merge;
|
|
5260
5260
|
},
|
|
5261
|
-
"
|
|
5262
|
-
var identity = __webpack_require__("
|
|
5263
|
-
var toJS = __webpack_require__("
|
|
5264
|
-
var YAMLMap = __webpack_require__("
|
|
5265
|
-
var YAMLSeq = __webpack_require__("
|
|
5266
|
-
var pairs = __webpack_require__("
|
|
5261
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5262
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5263
|
+
var toJS = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/toJS.js");
|
|
5264
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
5265
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
5266
|
+
var pairs = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js");
|
|
5267
5267
|
class YAMLOMap extends YAMLSeq.YAMLSeq {
|
|
5268
5268
|
constructor(){
|
|
5269
5269
|
super();
|
|
@@ -5315,11 +5315,11 @@ __webpack_require__.add({
|
|
|
5315
5315
|
exports.YAMLOMap = YAMLOMap;
|
|
5316
5316
|
exports.omap = omap;
|
|
5317
5317
|
},
|
|
5318
|
-
"
|
|
5319
|
-
var identity = __webpack_require__("
|
|
5320
|
-
var Pair = __webpack_require__("
|
|
5321
|
-
var Scalar = __webpack_require__("
|
|
5322
|
-
var YAMLSeq = __webpack_require__("
|
|
5318
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5319
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5320
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
5321
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5322
|
+
var YAMLSeq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLSeq.js");
|
|
5323
5323
|
function resolvePairs(seq, onError) {
|
|
5324
5324
|
if (identity.isSeq(seq)) for(let i = 0; i < seq.items.length; ++i){
|
|
5325
5325
|
let item = seq.items[i];
|
|
@@ -5373,20 +5373,20 @@ __webpack_require__.add({
|
|
|
5373
5373
|
exports.pairs = pairs;
|
|
5374
5374
|
exports.resolvePairs = resolvePairs;
|
|
5375
5375
|
},
|
|
5376
|
-
"
|
|
5377
|
-
var map = __webpack_require__("
|
|
5378
|
-
var _null = __webpack_require__("
|
|
5379
|
-
var seq = __webpack_require__("
|
|
5380
|
-
var string = __webpack_require__("
|
|
5381
|
-
var binary = __webpack_require__("
|
|
5382
|
-
var bool = __webpack_require__("
|
|
5383
|
-
var float = __webpack_require__("
|
|
5384
|
-
var int = __webpack_require__("
|
|
5385
|
-
var merge = __webpack_require__("
|
|
5386
|
-
var omap = __webpack_require__("
|
|
5387
|
-
var pairs = __webpack_require__("
|
|
5388
|
-
var set = __webpack_require__("
|
|
5389
|
-
var timestamp = __webpack_require__("
|
|
5376
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/schema.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5377
|
+
var map = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/map.js");
|
|
5378
|
+
var _null = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/null.js");
|
|
5379
|
+
var seq = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/seq.js");
|
|
5380
|
+
var string = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/common/string.js");
|
|
5381
|
+
var binary = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/binary.js");
|
|
5382
|
+
var bool = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/bool.js");
|
|
5383
|
+
var float = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/float.js");
|
|
5384
|
+
var int = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/int.js");
|
|
5385
|
+
var merge = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/merge.js");
|
|
5386
|
+
var omap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/omap.js");
|
|
5387
|
+
var pairs = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/pairs.js");
|
|
5388
|
+
var set = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js");
|
|
5389
|
+
var timestamp = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js");
|
|
5390
5390
|
const schema = [
|
|
5391
5391
|
map.map,
|
|
5392
5392
|
seq.seq,
|
|
@@ -5412,10 +5412,10 @@ __webpack_require__.add({
|
|
|
5412
5412
|
];
|
|
5413
5413
|
exports.schema = schema;
|
|
5414
5414
|
},
|
|
5415
|
-
"
|
|
5416
|
-
var identity = __webpack_require__("
|
|
5417
|
-
var Pair = __webpack_require__("
|
|
5418
|
-
var YAMLMap = __webpack_require__("
|
|
5415
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/set.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5416
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5417
|
+
var Pair = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Pair.js");
|
|
5418
|
+
var YAMLMap = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/YAMLMap.js");
|
|
5419
5419
|
class YAMLSet extends YAMLMap.YAMLMap {
|
|
5420
5420
|
constructor(schema){
|
|
5421
5421
|
super(schema);
|
|
@@ -5475,8 +5475,8 @@ __webpack_require__.add({
|
|
|
5475
5475
|
exports.YAMLSet = YAMLSet;
|
|
5476
5476
|
exports.set = set;
|
|
5477
5477
|
},
|
|
5478
|
-
"
|
|
5479
|
-
var stringifyNumber = __webpack_require__("
|
|
5478
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5479
|
+
var stringifyNumber = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js");
|
|
5480
5480
|
function parseSexagesimal(str, asBigInt) {
|
|
5481
5481
|
const sign = str[0];
|
|
5482
5482
|
const parts = '-' === sign || '+' === sign ? str.substring(1) : str;
|
|
@@ -5552,7 +5552,7 @@ __webpack_require__.add({
|
|
|
5552
5552
|
exports.intTime = intTime;
|
|
5553
5553
|
exports.timestamp = timestamp;
|
|
5554
5554
|
},
|
|
5555
|
-
"
|
|
5555
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js" (__unused_rspack_module, exports) {
|
|
5556
5556
|
const FOLD_FLOW = 'flow';
|
|
5557
5557
|
const FOLD_BLOCK = 'block';
|
|
5558
5558
|
const FOLD_QUOTED = 'quoted';
|
|
@@ -5657,11 +5657,11 @@ __webpack_require__.add({
|
|
|
5657
5657
|
exports.FOLD_QUOTED = FOLD_QUOTED;
|
|
5658
5658
|
exports.foldFlowLines = foldFlowLines;
|
|
5659
5659
|
},
|
|
5660
|
-
"
|
|
5661
|
-
var anchors = __webpack_require__("
|
|
5662
|
-
var identity = __webpack_require__("
|
|
5663
|
-
var stringifyComment = __webpack_require__("
|
|
5664
|
-
var stringifyString = __webpack_require__("
|
|
5660
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5661
|
+
var anchors = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/doc/anchors.js");
|
|
5662
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5663
|
+
var stringifyComment = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js");
|
|
5664
|
+
var stringifyString = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js");
|
|
5665
5665
|
function createStringifyContext(doc, options) {
|
|
5666
5666
|
const opt = Object.assign({
|
|
5667
5667
|
blockQuote: true,
|
|
@@ -5768,10 +5768,10 @@ __webpack_require__.add({
|
|
|
5768
5768
|
exports.createStringifyContext = createStringifyContext;
|
|
5769
5769
|
exports.stringify = stringify;
|
|
5770
5770
|
},
|
|
5771
|
-
"
|
|
5772
|
-
var identity = __webpack_require__("
|
|
5773
|
-
var stringify = __webpack_require__("
|
|
5774
|
-
var stringifyComment = __webpack_require__("
|
|
5771
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyCollection.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5772
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5773
|
+
var stringify = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js");
|
|
5774
|
+
var stringifyComment = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js");
|
|
5775
5775
|
function stringifyCollection(collection, ctx, options) {
|
|
5776
5776
|
const flow = ctx.inFlow ?? collection.flow;
|
|
5777
5777
|
const stringify = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
@@ -5887,7 +5887,7 @@ __webpack_require__.add({
|
|
|
5887
5887
|
}
|
|
5888
5888
|
exports.stringifyCollection = stringifyCollection;
|
|
5889
5889
|
},
|
|
5890
|
-
"
|
|
5890
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js" (__unused_rspack_module, exports) {
|
|
5891
5891
|
const stringifyComment = (str)=>str.replace(/^(?!$)(?: $)?/gm, '#');
|
|
5892
5892
|
function indentComment(comment, indent) {
|
|
5893
5893
|
if (/^\n+$/.test(comment)) return comment.substring(1);
|
|
@@ -5898,10 +5898,10 @@ __webpack_require__.add({
|
|
|
5898
5898
|
exports.lineComment = lineComment;
|
|
5899
5899
|
exports.stringifyComment = stringifyComment;
|
|
5900
5900
|
},
|
|
5901
|
-
"
|
|
5902
|
-
var identity = __webpack_require__("
|
|
5903
|
-
var stringify = __webpack_require__("
|
|
5904
|
-
var stringifyComment = __webpack_require__("
|
|
5901
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyDocument.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5902
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5903
|
+
var stringify = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js");
|
|
5904
|
+
var stringifyComment = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js");
|
|
5905
5905
|
function stringifyDocument(doc, options) {
|
|
5906
5906
|
const lines = [];
|
|
5907
5907
|
let hasDirectives = true === options.directives;
|
|
@@ -5957,7 +5957,7 @@ __webpack_require__.add({
|
|
|
5957
5957
|
}
|
|
5958
5958
|
exports.stringifyDocument = stringifyDocument;
|
|
5959
5959
|
},
|
|
5960
|
-
"
|
|
5960
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyNumber.js" (__unused_rspack_module, exports) {
|
|
5961
5961
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
5962
5962
|
if ('bigint' == typeof value) return String(value);
|
|
5963
5963
|
const num = 'number' == typeof value ? value : Number(value);
|
|
@@ -5976,11 +5976,11 @@ __webpack_require__.add({
|
|
|
5976
5976
|
}
|
|
5977
5977
|
exports.stringifyNumber = stringifyNumber;
|
|
5978
5978
|
},
|
|
5979
|
-
"
|
|
5980
|
-
var identity = __webpack_require__("
|
|
5981
|
-
var Scalar = __webpack_require__("
|
|
5982
|
-
var stringify = __webpack_require__("
|
|
5983
|
-
var stringifyComment = __webpack_require__("
|
|
5979
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyPair.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
5980
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
5981
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
5982
|
+
var stringify = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringify.js");
|
|
5983
|
+
var stringifyComment = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyComment.js");
|
|
5984
5984
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
5985
5985
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
5986
5986
|
let keyComment = identity.isNode(key) && key.comment || null;
|
|
@@ -6073,9 +6073,9 @@ __webpack_require__.add({
|
|
|
6073
6073
|
}
|
|
6074
6074
|
exports.stringifyPair = stringifyPair;
|
|
6075
6075
|
},
|
|
6076
|
-
"
|
|
6077
|
-
var Scalar = __webpack_require__("
|
|
6078
|
-
var foldFlowLines = __webpack_require__("
|
|
6076
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/stringifyString.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
6077
|
+
var Scalar = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/Scalar.js");
|
|
6078
|
+
var foldFlowLines = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/stringify/foldFlowLines.js");
|
|
6079
6079
|
const getFoldOptions = (ctx, isBlock)=>({
|
|
6080
6080
|
indentAtStart: isBlock ? ctx.indent.length : ctx.indentAtStart,
|
|
6081
6081
|
lineWidth: ctx.options.lineWidth,
|
|
@@ -6303,8 +6303,8 @@ __webpack_require__.add({
|
|
|
6303
6303
|
}
|
|
6304
6304
|
exports.stringifyString = stringifyString;
|
|
6305
6305
|
},
|
|
6306
|
-
"
|
|
6307
|
-
var identity = __webpack_require__("
|
|
6306
|
+
"../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/visit.js" (__unused_rspack_module, exports, __webpack_require__) {
|
|
6307
|
+
var identity = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js");
|
|
6308
6308
|
const BREAK = Symbol('break visit');
|
|
6309
6309
|
const SKIP = Symbol('skip children');
|
|
6310
6310
|
const REMOVE = Symbol('remove node');
|
|
@@ -9234,9 +9234,9 @@ const CONFIG_DIR = external_node_path_join(homedir(), '.ylcwf');
|
|
|
9234
9234
|
const DEFAULT_CONFIG_PATH = external_node_path_join(CONFIG_DIR, 'config.yaml');
|
|
9235
9235
|
function paths_resolveConfigPath(explicit) {
|
|
9236
9236
|
const fromFlag = explicit?.trim();
|
|
9237
|
-
if (void 0 !== fromFlag && fromFlag.length > 0) return
|
|
9237
|
+
if (void 0 !== fromFlag && fromFlag.length > 0) return external_node_path_isAbsolute(fromFlag) ? fromFlag : external_node_path_resolve(process.cwd(), fromFlag);
|
|
9238
9238
|
const fromEnv = process.env['YLCWF_CONFIG']?.trim();
|
|
9239
|
-
if (void 0 !== fromEnv && fromEnv.length > 0) return
|
|
9239
|
+
if (void 0 !== fromEnv && fromEnv.length > 0) return external_node_path_isAbsolute(fromEnv) ? fromEnv : external_node_path_resolve(process.cwd(), fromEnv);
|
|
9240
9240
|
return DEFAULT_CONFIG_PATH;
|
|
9241
9241
|
}
|
|
9242
9242
|
function serveTokenPath() {
|
|
@@ -9248,31 +9248,97 @@ function historyPath() {
|
|
|
9248
9248
|
function backupsDir(configPath) {
|
|
9249
9249
|
return external_node_path_join(external_node_path_dirname(configPath), 'backups');
|
|
9250
9250
|
}
|
|
9251
|
-
const
|
|
9252
|
-
function
|
|
9253
|
-
return
|
|
9251
|
+
const TERMINAL_CATALOG_FILE = 'execution_terminals.json';
|
|
9252
|
+
function terminals_error(code, message, where) {
|
|
9253
|
+
return void 0 === where ? {
|
|
9254
|
+
level: 'error',
|
|
9255
|
+
code,
|
|
9256
|
+
message
|
|
9257
|
+
} : {
|
|
9258
|
+
level: 'error',
|
|
9259
|
+
code,
|
|
9260
|
+
message,
|
|
9261
|
+
where
|
|
9262
|
+
};
|
|
9254
9263
|
}
|
|
9255
|
-
function
|
|
9256
|
-
|
|
9257
|
-
|
|
9258
|
-
|
|
9259
|
-
|
|
9260
|
-
|
|
9261
|
-
|
|
9262
|
-
|
|
9263
|
-
|
|
9264
|
-
|
|
9265
|
-
|
|
9266
|
-
|
|
9267
|
-
|
|
9268
|
-
|
|
9269
|
-
|
|
9270
|
-
|
|
9271
|
-
|
|
9272
|
-
|
|
9273
|
-
|
|
9264
|
+
function terminals_isRecord(value) {
|
|
9265
|
+
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
9266
|
+
}
|
|
9267
|
+
function checkTerminalCatalog(raw) {
|
|
9268
|
+
const issues = [];
|
|
9269
|
+
if (!terminals_isRecord(raw)) return {
|
|
9270
|
+
catalog: null,
|
|
9271
|
+
issues: [
|
|
9272
|
+
terminals_error('TERMINAL_CATALOG_TYPE', `${TERMINAL_CATALOG_FILE} 必须是对象`)
|
|
9273
|
+
]
|
|
9274
|
+
};
|
|
9275
|
+
const list = raw['terminals'];
|
|
9276
|
+
if (!Array.isArray(list)) return {
|
|
9277
|
+
catalog: null,
|
|
9278
|
+
issues: [
|
|
9279
|
+
terminals_error('TERMINAL_CATALOG_INVALID', 'terminals 必须是数组', 'terminals')
|
|
9280
|
+
]
|
|
9281
|
+
};
|
|
9282
|
+
const entries = [];
|
|
9283
|
+
const seen = new Set();
|
|
9284
|
+
list.forEach((item, index)=>{
|
|
9285
|
+
const where = `terminals[${index}]`;
|
|
9286
|
+
const name = terminals_isRecord(item) ? item['name'] : item;
|
|
9287
|
+
if ('string' != typeof name || 0 === name.trim().length) return void issues.push(terminals_error('TERMINAL_CATALOG_NAME_INVALID', `${where}.name 不能为空`, `${where}.name`));
|
|
9288
|
+
const trimmed = name.trim();
|
|
9289
|
+
if (seen.has(trimmed)) return void issues.push(terminals_error('TERMINAL_CATALOG_DUPLICATED', `执行终端「${trimmed}」重复声明`, `${where}.name`));
|
|
9290
|
+
seen.add(trimmed);
|
|
9291
|
+
const descRaw = terminals_isRecord(item) ? item['desc'] : void 0;
|
|
9292
|
+
entries.push({
|
|
9293
|
+
name: trimmed,
|
|
9294
|
+
desc: 'string' == typeof descRaw && descRaw.trim().length > 0 ? descRaw.trim() : null
|
|
9295
|
+
});
|
|
9296
|
+
});
|
|
9297
|
+
if (issues.some((issue)=>'error' === issue.level)) return {
|
|
9298
|
+
catalog: null,
|
|
9299
|
+
issues
|
|
9300
|
+
};
|
|
9301
|
+
return {
|
|
9302
|
+
catalog: {
|
|
9303
|
+
terminals: entries
|
|
9304
|
+
},
|
|
9305
|
+
issues
|
|
9306
|
+
};
|
|
9307
|
+
}
|
|
9308
|
+
function loadTerminalCatalog(docsRoot) {
|
|
9309
|
+
const path = external_node_path_join(docsRoot, TERMINAL_CATALOG_FILE);
|
|
9310
|
+
let text;
|
|
9311
|
+
try {
|
|
9312
|
+
text = readFileSync(path, 'utf8');
|
|
9313
|
+
} catch {
|
|
9314
|
+
return {
|
|
9315
|
+
path,
|
|
9316
|
+
catalog: null,
|
|
9317
|
+
issues: []
|
|
9318
|
+
};
|
|
9274
9319
|
}
|
|
9275
|
-
|
|
9320
|
+
let raw;
|
|
9321
|
+
try {
|
|
9322
|
+
raw = JSON.parse(text);
|
|
9323
|
+
} catch (caught) {
|
|
9324
|
+
const detail = caught instanceof Error ? caught.message : String(caught);
|
|
9325
|
+
return {
|
|
9326
|
+
path,
|
|
9327
|
+
catalog: null,
|
|
9328
|
+
issues: [
|
|
9329
|
+
terminals_error('TERMINAL_CATALOG_JSON', `${TERMINAL_CATALOG_FILE} 不是合法 JSON:${detail}`)
|
|
9330
|
+
]
|
|
9331
|
+
};
|
|
9332
|
+
}
|
|
9333
|
+
return {
|
|
9334
|
+
path,
|
|
9335
|
+
...checkTerminalCatalog(raw)
|
|
9336
|
+
};
|
|
9337
|
+
}
|
|
9338
|
+
function catalogNames(docsRoot) {
|
|
9339
|
+
const loaded = loadTerminalCatalog(docsRoot);
|
|
9340
|
+
if (null === loaded.catalog) return [];
|
|
9341
|
+
return loaded.catalog.terminals.map((entry)=>entry.name);
|
|
9276
9342
|
}
|
|
9277
9343
|
function utils_isRecord(value) {
|
|
9278
9344
|
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
@@ -9304,6 +9370,51 @@ function isAbsolutePath(value) {
|
|
|
9304
9370
|
if (/^[\\/]{2}[^\\/]/.test(input)) return true;
|
|
9305
9371
|
return input.startsWith('/');
|
|
9306
9372
|
}
|
|
9373
|
+
function parseDotPath(input) {
|
|
9374
|
+
const parts = input.split('.').map((part)=>part.trim());
|
|
9375
|
+
if (0 === parts.length || parts.some((part)=>0 === part.length)) throw new errors_CliError(`路径不合法:${input}(应形如 docs.role)`, errors_EXIT.USAGE);
|
|
9376
|
+
return parts;
|
|
9377
|
+
}
|
|
9378
|
+
function getIn(root, path) {
|
|
9379
|
+
let current = root;
|
|
9380
|
+
for (const key of path){
|
|
9381
|
+
if (!utils_isRecord(current)) return;
|
|
9382
|
+
if (!Object.hasOwn(current, key)) return;
|
|
9383
|
+
current = current[key];
|
|
9384
|
+
}
|
|
9385
|
+
return current;
|
|
9386
|
+
}
|
|
9387
|
+
function renderScalar(value) {
|
|
9388
|
+
if ('string' == typeof value) return value;
|
|
9389
|
+
if (null === value) return 'null';
|
|
9390
|
+
return JSON.stringify(value);
|
|
9391
|
+
}
|
|
9392
|
+
const DASH_PATTERN = /[\u2010-\u2015\u2212\uFE58\uFE63\uFF0D_-]+/g;
|
|
9393
|
+
function normalizeName(input) {
|
|
9394
|
+
return input.normalize('NFKC').replace(/\s+/g, '').replace(DASH_PATTERN, '-').replace(/^-+/, '').replace(/-+$/, '').toLowerCase();
|
|
9395
|
+
}
|
|
9396
|
+
function normalize_editDistance(a, b) {
|
|
9397
|
+
if (a === b) return 0;
|
|
9398
|
+
if (0 === a.length) return b.length;
|
|
9399
|
+
if (0 === b.length) return a.length;
|
|
9400
|
+
let previous = Array.from({
|
|
9401
|
+
length: b.length + 1
|
|
9402
|
+
}, (_, index)=>index);
|
|
9403
|
+
for(let i = 1; i <= a.length; i += 1){
|
|
9404
|
+
const current = [
|
|
9405
|
+
i
|
|
9406
|
+
];
|
|
9407
|
+
for(let j = 1; j <= b.length; j += 1){
|
|
9408
|
+
const cost = a.charAt(i - 1) === b.charAt(j - 1) ? 0 : 1;
|
|
9409
|
+
const deletion = (previous[j] ?? 0) + 1;
|
|
9410
|
+
const insertion = (current[j - 1] ?? 0) + 1;
|
|
9411
|
+
const substitution = (previous[j - 1] ?? 0) + cost;
|
|
9412
|
+
current[j] = Math.min(deletion, insertion, substitution);
|
|
9413
|
+
}
|
|
9414
|
+
previous = current;
|
|
9415
|
+
}
|
|
9416
|
+
return previous[b.length] ?? 0;
|
|
9417
|
+
}
|
|
9307
9418
|
const ROLES = [
|
|
9308
9419
|
'frontend',
|
|
9309
9420
|
'backend',
|
|
@@ -9346,7 +9457,6 @@ const DEFAULT_VALIDATOR_POLICY = {
|
|
|
9346
9457
|
requireScript: true
|
|
9347
9458
|
};
|
|
9348
9459
|
const TERMINAL_KEYS = new Set([
|
|
9349
|
-
'aliases',
|
|
9350
9460
|
'repos'
|
|
9351
9461
|
]);
|
|
9352
9462
|
const REPO_KEYS = new Set(SIDES);
|
|
@@ -9374,6 +9484,27 @@ function warning(code, message, where) {
|
|
|
9374
9484
|
}
|
|
9375
9485
|
};
|
|
9376
9486
|
}
|
|
9487
|
+
const REMOVED_DOCS_KEYS = new Set([
|
|
9488
|
+
'iterationWriteYear',
|
|
9489
|
+
'iterationsRoot'
|
|
9490
|
+
]);
|
|
9491
|
+
const REMOVED_TERMINAL_KEYS = new Set([
|
|
9492
|
+
'aliases'
|
|
9493
|
+
]);
|
|
9494
|
+
function dropRemovedTerminalKeys(raw) {
|
|
9495
|
+
const copy = {
|
|
9496
|
+
...raw
|
|
9497
|
+
};
|
|
9498
|
+
for (const key of REMOVED_TERMINAL_KEYS)delete copy[key];
|
|
9499
|
+
return copy;
|
|
9500
|
+
}
|
|
9501
|
+
function dropRemovedDocsKeys(raw) {
|
|
9502
|
+
const copy = {
|
|
9503
|
+
...raw
|
|
9504
|
+
};
|
|
9505
|
+
for (const key of REMOVED_DOCS_KEYS)delete copy[key];
|
|
9506
|
+
return copy;
|
|
9507
|
+
}
|
|
9377
9508
|
function unknownKeys(value, allowed, where) {
|
|
9378
9509
|
return Object.keys(value).filter((key)=>!allowed.has(key)).map((key)=>schema_error('UNKNOWN_KEY', `未知字段「${key}」,允许的字段为:${[
|
|
9379
9510
|
...allowed
|
|
@@ -9432,11 +9563,12 @@ function parseProfile(raw, options, issues) {
|
|
|
9432
9563
|
role
|
|
9433
9564
|
};
|
|
9434
9565
|
}
|
|
9435
|
-
function parseDocs(
|
|
9436
|
-
if (!utils_isRecord(
|
|
9566
|
+
function parseDocs(rawInput, options, issues) {
|
|
9567
|
+
if (!utils_isRecord(rawInput)) {
|
|
9437
9568
|
issues.push(schema_error('DOCS_TYPE', 'docs 必须是对象', 'docs'));
|
|
9438
9569
|
return null;
|
|
9439
9570
|
}
|
|
9571
|
+
const raw = dropRemovedDocsKeys(rawInput);
|
|
9440
9572
|
issues.push(...unknownKeys(raw, DOCS_KEYS, 'docs'));
|
|
9441
9573
|
let root = '';
|
|
9442
9574
|
const rootRaw = raw['root'];
|
|
@@ -9570,45 +9702,44 @@ function parseRepos(raw, where, issues) {
|
|
|
9570
9702
|
}
|
|
9571
9703
|
return valid ? repos : null;
|
|
9572
9704
|
}
|
|
9573
|
-
function parseTerminals(raw, issues) {
|
|
9705
|
+
function parseTerminals(raw, issues, catalog = []) {
|
|
9574
9706
|
if (!utils_isRecord(raw)) {
|
|
9575
9707
|
issues.push(schema_error('TERMINALS_TYPE', 'terminals 必须是对象', 'terminals'));
|
|
9576
9708
|
return null;
|
|
9577
9709
|
}
|
|
9578
9710
|
const terminals = {};
|
|
9579
9711
|
let valid = true;
|
|
9712
|
+
const allowed = 0 === catalog.length ? null : catalog.map((name)=>normalizeName(name));
|
|
9580
9713
|
for (const [name, value] of Object.entries(raw)){
|
|
9581
9714
|
const where = `terminals.${name}`;
|
|
9715
|
+
if (null !== allowed && !allowed.includes(normalizeName(name))) {
|
|
9716
|
+
issues.push(schema_error('TERMINAL_NOT_IN_CATALOG', `执行终端「${name}」不在文档仓库 execution_terminals.json 中;可选:${catalog.join('、')}`, where));
|
|
9717
|
+
valid = false;
|
|
9718
|
+
continue;
|
|
9719
|
+
}
|
|
9582
9720
|
if (name.includes('.')) {
|
|
9583
|
-
issues.push(schema_error('TERMINAL_KEY_DOT',
|
|
9721
|
+
issues.push(schema_error('TERMINAL_KEY_DOT', `执行终端名不能包含「.」:${name}`, where));
|
|
9584
9722
|
valid = false;
|
|
9585
9723
|
continue;
|
|
9586
9724
|
}
|
|
9587
9725
|
if (0 === name.trim().length) {
|
|
9588
|
-
issues.push(schema_error('TERMINAL_KEY_EMPTY', '
|
|
9726
|
+
issues.push(schema_error('TERMINAL_KEY_EMPTY', '执行终端名不能为空', 'terminals'));
|
|
9589
9727
|
valid = false;
|
|
9590
9728
|
continue;
|
|
9591
9729
|
}
|
|
9592
9730
|
if (!utils_isRecord(value)) {
|
|
9593
|
-
issues.push(schema_error('TERMINAL_TYPE', '
|
|
9731
|
+
issues.push(schema_error('TERMINAL_TYPE', '执行终端配置必须是对象', where));
|
|
9594
9732
|
valid = false;
|
|
9595
9733
|
continue;
|
|
9596
9734
|
}
|
|
9597
|
-
|
|
9598
|
-
|
|
9599
|
-
let aliases = [];
|
|
9600
|
-
if (void 0 !== aliasesRaw) if (isStringArray(aliasesRaw)) aliases = aliasesRaw.map((alias)=>alias.trim()).filter((alias)=>alias.length > 0);
|
|
9601
|
-
else {
|
|
9602
|
-
issues.push(schema_error('ALIASES_TYPE', 'aliases 必须是字符串数组', `${where}.aliases`));
|
|
9603
|
-
valid = false;
|
|
9604
|
-
}
|
|
9735
|
+
const terminalFields = dropRemovedTerminalKeys(value);
|
|
9736
|
+
issues.push(...unknownKeys(terminalFields, TERMINAL_KEYS, where));
|
|
9605
9737
|
const repos = parseRepos(value['repos'], `${where}.repos`, issues);
|
|
9606
9738
|
if (null === repos) {
|
|
9607
9739
|
valid = false;
|
|
9608
9740
|
continue;
|
|
9609
9741
|
}
|
|
9610
9742
|
terminals[name] = {
|
|
9611
|
-
aliases,
|
|
9612
9743
|
repos
|
|
9613
9744
|
};
|
|
9614
9745
|
}
|
|
@@ -9621,19 +9752,9 @@ function checkTerminalIdentity(terminals) {
|
|
|
9621
9752
|
if (name.includes('.') || 0 === name.trim().length) continue;
|
|
9622
9753
|
const normalizedKey = normalizeName(name);
|
|
9623
9754
|
const existingKey = seen.get(normalizedKey);
|
|
9624
|
-
if (void 0 !== existingKey) issues.push(schema_error('TERMINAL_DUPLICATE',
|
|
9755
|
+
if (void 0 !== existingKey) issues.push(schema_error('TERMINAL_DUPLICATE', `执行终端名「${name}」与「${existingKey}」归一化后重复(${normalizedKey}),请改名或合并`, `terminals.${name}`));
|
|
9625
9756
|
else seen.set(normalizedKey, name);
|
|
9626
9757
|
}
|
|
9627
|
-
for (const [name, terminal] of Object.entries(terminals))for (const alias of terminal.aliases){
|
|
9628
|
-
const normalizedAlias = normalizeName(alias);
|
|
9629
|
-
if (normalizedAlias === normalizeName(name)) {
|
|
9630
|
-
issues.push(warning('ALIAS_REDUNDANT', `别名「${alias}」归一化后与终端名相同,可删除(空格/全角/大小写差异已由归一化覆盖)`, `terminals.${name}.aliases`));
|
|
9631
|
-
continue;
|
|
9632
|
-
}
|
|
9633
|
-
const existing = seen.get(normalizedAlias);
|
|
9634
|
-
if (void 0 !== existing) issues.push(schema_error('ALIAS_CONFLICT', `别名「${alias}」与「${existing}」冲突(归一化后为 ${normalizedAlias})`, `terminals.${name}.aliases`));
|
|
9635
|
-
else seen.set(normalizedAlias, `${name}(别名)`);
|
|
9636
|
-
}
|
|
9637
9758
|
return issues;
|
|
9638
9759
|
}
|
|
9639
9760
|
function checkFsOfDocs(config, issues) {
|
|
@@ -9671,7 +9792,7 @@ function checkFsOfTerminals(config, issues) {
|
|
|
9671
9792
|
pathOwners.set(`${side}:${target}`, entry);
|
|
9672
9793
|
}
|
|
9673
9794
|
}
|
|
9674
|
-
for (const entry of pathOwners.values())if (!(entry.owners.length < 2)) issues.push(warning('REPO_PATH_SHARED', `${entry.side}
|
|
9795
|
+
for (const entry of pathOwners.values())if (!(entry.owners.length < 2)) issues.push(warning('REPO_PATH_SHARED', `${entry.side} 仓库路径被多个执行终端复用:${entry.target}(${entry.owners.join('、')})`, 'terminals'));
|
|
9675
9796
|
}
|
|
9676
9797
|
function checkConfig(raw, options = {}) {
|
|
9677
9798
|
const issues = [];
|
|
@@ -9688,7 +9809,7 @@ function checkConfig(raw, options = {}) {
|
|
|
9688
9809
|
issues.push(...unknownKeys(normalized, TOP_LEVEL_KEYS, 'root'));
|
|
9689
9810
|
const profile = parseProfile(normalized['profile'], options, issues);
|
|
9690
9811
|
const docs = parseDocs(normalized['docs'], options, issues);
|
|
9691
|
-
const terminals = parseTerminals(normalized['terminals'] ?? {}, issues);
|
|
9812
|
+
const terminals = parseTerminals(normalized['terminals'] ?? {}, issues, options.terminalCatalog);
|
|
9692
9813
|
if (null === profile || null === docs || null === terminals) return {
|
|
9693
9814
|
config: null,
|
|
9694
9815
|
issues
|
|
@@ -9698,7 +9819,7 @@ function checkConfig(raw, options = {}) {
|
|
|
9698
9819
|
docs,
|
|
9699
9820
|
terminals
|
|
9700
9821
|
};
|
|
9701
|
-
if (0 === Object.keys(terminals).length) issues.push(warning('TERMINALS_EMPTY', "
|
|
9822
|
+
if (0 === Object.keys(terminals).length) issues.push(warning('TERMINALS_EMPTY', "尚未配置任何执行终端映射:ylcwf resolve、任务「所属端」与仓库归属校验、doc migrate 回填都将不可用。\n 补配置:ylcwf terminal add <执行终端名> --frontend <仓库路径>\n (后端仓库用 --backend,两端都有就同时传;每端多个仓库可重复该选项)", 'terminals'));
|
|
9702
9823
|
issues.push(...checkTerminalIdentity(terminals));
|
|
9703
9824
|
if (true === options.checkFs) {
|
|
9704
9825
|
checkFsOfDocs(config, issues);
|
|
@@ -9712,7 +9833,7 @@ function checkConfig(raw, options = {}) {
|
|
|
9712
9833
|
function hasError(issues) {
|
|
9713
9834
|
return issues.some((issue)=>'error' === issue.level);
|
|
9714
9835
|
}
|
|
9715
|
-
const picocolors = __webpack_require__("
|
|
9836
|
+
const picocolors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
|
|
9716
9837
|
var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
|
|
9717
9838
|
function formatIssue(issue) {
|
|
9718
9839
|
const tag = 'error' === issue.level ? picocolors_default().red('✗ error') : picocolors_default().yellow('! warning');
|
|
@@ -9799,7 +9920,7 @@ function withConfigLock(configPath, run, options = {}) {
|
|
|
9799
9920
|
} catch {}
|
|
9800
9921
|
}
|
|
9801
9922
|
}
|
|
9802
|
-
const dist_0 = __webpack_require__("
|
|
9923
|
+
const dist_0 = __webpack_require__("../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/index.js");
|
|
9803
9924
|
const MAX_BACKUPS = 10;
|
|
9804
9925
|
const TEMPLATE = `# ylcwf 配置
|
|
9805
9926
|
# 由 ylcwf CLI 管理;手改后请运行 \`ylcwf doctor\` 校验。
|
|
@@ -9819,7 +9940,18 @@ terminals: {}
|
|
|
9819
9940
|
function createEmptyDocument() {
|
|
9820
9941
|
return (0, dist_0.Tp)(TEMPLATE);
|
|
9821
9942
|
}
|
|
9822
|
-
function
|
|
9943
|
+
function checkConfigWithCatalog(raw, options = {}) {
|
|
9944
|
+
const docsRoot = getIn(raw, [
|
|
9945
|
+
'docs',
|
|
9946
|
+
'root'
|
|
9947
|
+
]);
|
|
9948
|
+
const catalog = 'string' == typeof docsRoot && docsRoot.trim().length > 0 ? catalogNames(docsRoot.trim()) : [];
|
|
9949
|
+
return checkConfig(raw, {
|
|
9950
|
+
...options,
|
|
9951
|
+
terminalCatalog: options.terminalCatalog ?? catalog
|
|
9952
|
+
});
|
|
9953
|
+
}
|
|
9954
|
+
function config_loadConfig(explicit) {
|
|
9823
9955
|
const path = paths_resolveConfigPath(explicit);
|
|
9824
9956
|
if (!external_node_fs_existsSync(path)) return {
|
|
9825
9957
|
path,
|
|
@@ -9836,7 +9968,7 @@ function loadConfig(explicit) {
|
|
|
9836
9968
|
throw new errors_CliError(`配置文件 YAML 语法错误:${path}\n${detail}`, errors_EXIT.INVALID);
|
|
9837
9969
|
}
|
|
9838
9970
|
const raw = doc.toJS();
|
|
9839
|
-
const checked =
|
|
9971
|
+
const checked = checkConfigWithCatalog(raw, {
|
|
9840
9972
|
allowIncomplete: true
|
|
9841
9973
|
});
|
|
9842
9974
|
return {
|
|
@@ -9849,7 +9981,7 @@ function loadConfig(explicit) {
|
|
|
9849
9981
|
};
|
|
9850
9982
|
}
|
|
9851
9983
|
function requireConfig(explicit) {
|
|
9852
|
-
const loaded =
|
|
9984
|
+
const loaded = config_loadConfig(explicit);
|
|
9853
9985
|
if (!loaded.exists || null === loaded.doc) throw new errors_CliError(`配置未初始化:${loaded.path}\n请先运行:ylcwf init`, errors_EXIT.NOT_FOUND);
|
|
9854
9986
|
if (null === loaded.config) throw new errors_CliError(`配置结构不合法:${loaded.path}\n${formatIssues(loaded.issues)}`, errors_EXIT.INVALID);
|
|
9855
9987
|
return {
|
|
@@ -9860,7 +9992,7 @@ function requireConfig(explicit) {
|
|
|
9860
9992
|
};
|
|
9861
9993
|
}
|
|
9862
9994
|
function obtainDocument(explicit) {
|
|
9863
|
-
const loaded =
|
|
9995
|
+
const loaded = config_loadConfig(explicit);
|
|
9864
9996
|
if (null !== loaded.doc) return {
|
|
9865
9997
|
path: loaded.path,
|
|
9866
9998
|
doc: loaded.doc
|
|
@@ -9872,7 +10004,7 @@ function obtainDocument(explicit) {
|
|
|
9872
10004
|
}
|
|
9873
10005
|
function assertWritable(doc, path) {
|
|
9874
10006
|
const raw = doc.toJS();
|
|
9875
|
-
const checked =
|
|
10007
|
+
const checked = checkConfigWithCatalog(raw, {
|
|
9876
10008
|
allowIncomplete: true
|
|
9877
10009
|
});
|
|
9878
10010
|
if (null === checked.config || checked.issues.some((issue)=>'error' === issue.level)) throw new errors_CliError(`配置校验失败,已取消写入:${path}\n${formatIssues(checked.issues)}`, errors_EXIT.INVALID);
|
|
@@ -9896,9 +10028,23 @@ function saveDocument(doc, target) {
|
|
|
9896
10028
|
mkdirSync(external_node_path_dirname(target), {
|
|
9897
10029
|
recursive: true
|
|
9898
10030
|
});
|
|
9899
|
-
|
|
9900
|
-
|
|
9901
|
-
|
|
10031
|
+
for (const path of [
|
|
10032
|
+
[
|
|
10033
|
+
'schemaVersion'
|
|
10034
|
+
],
|
|
10035
|
+
[
|
|
10036
|
+
'docs',
|
|
10037
|
+
'iterationWriteYear'
|
|
10038
|
+
],
|
|
10039
|
+
[
|
|
10040
|
+
'docs',
|
|
10041
|
+
'iterationsRoot'
|
|
10042
|
+
],
|
|
10043
|
+
[
|
|
10044
|
+
'docs',
|
|
10045
|
+
'remote'
|
|
10046
|
+
]
|
|
10047
|
+
])if (doc.hasIn(path)) doc.deleteIn(path);
|
|
9902
10048
|
toBlockStyle(doc.contents);
|
|
9903
10049
|
const text = doc.toString({
|
|
9904
10050
|
lineWidth: 0
|
|
@@ -9927,25 +10073,6 @@ function backup(target) {
|
|
|
9927
10073
|
const stale = files.slice(0, Math.max(0, files.length - MAX_BACKUPS));
|
|
9928
10074
|
for (const name of stale)unlinkSync(`${dir}/${name}`);
|
|
9929
10075
|
}
|
|
9930
|
-
function parseDotPath(input) {
|
|
9931
|
-
const parts = input.split('.').map((part)=>part.trim());
|
|
9932
|
-
if (0 === parts.length || parts.some((part)=>0 === part.length)) throw new errors_CliError(`路径不合法:${input}(应形如 docs.role)`, errors_EXIT.USAGE);
|
|
9933
|
-
return parts;
|
|
9934
|
-
}
|
|
9935
|
-
function getIn(root, path) {
|
|
9936
|
-
let current = root;
|
|
9937
|
-
for (const key of path){
|
|
9938
|
-
if (!utils_isRecord(current)) return;
|
|
9939
|
-
if (!Object.hasOwn(current, key)) return;
|
|
9940
|
-
current = current[key];
|
|
9941
|
-
}
|
|
9942
|
-
return current;
|
|
9943
|
-
}
|
|
9944
|
-
function renderScalar(value) {
|
|
9945
|
-
if ('string' == typeof value) return value;
|
|
9946
|
-
if (null === value) return 'null';
|
|
9947
|
-
return JSON.stringify(value);
|
|
9948
|
-
}
|
|
9949
10076
|
function bail() {
|
|
9950
10077
|
cancel('已取消');
|
|
9951
10078
|
process.exit(errors_EXIT.OK);
|
|
@@ -9971,16 +10098,13 @@ async function askConfirm(message, initialValue) {
|
|
|
9971
10098
|
function validateExistingDir(value) {
|
|
9972
10099
|
const trimmed = (value ?? '').trim();
|
|
9973
10100
|
if (0 === trimmed.length) return '不能为空';
|
|
9974
|
-
if (!
|
|
10101
|
+
if (!external_node_path_isAbsolute(trimmed)) return '必须是绝对路径';
|
|
9975
10102
|
if (!external_node_fs_existsSync(trimmed)) return '路径不存在';
|
|
9976
10103
|
if (!statSync(trimmed).isDirectory()) return '不是目录';
|
|
9977
10104
|
}
|
|
9978
10105
|
function validateDeveloper(value) {
|
|
9979
10106
|
if (!/^[a-z][a-z0-9]*$/.test((value ?? '').trim())) return '必须是小写字母开头的字母数字串(姓名小写全拼)';
|
|
9980
10107
|
}
|
|
9981
|
-
function splitAliases(value) {
|
|
9982
|
-
return value.split(',').map((item)=>item.trim()).filter((item)=>item.length > 0);
|
|
9983
|
-
}
|
|
9984
10108
|
function validatePathList(value) {
|
|
9985
10109
|
const raw = (value ?? '').trim();
|
|
9986
10110
|
if (0 === raw.length) return;
|
|
@@ -9990,9 +10114,9 @@ function validatePathList(value) {
|
|
|
9990
10114
|
}
|
|
9991
10115
|
}
|
|
9992
10116
|
async function runInit(options) {
|
|
9993
|
-
if (true !== process.stdin.isTTY) throw new errors_CliError('init
|
|
10117
|
+
if (true !== process.stdin.isTTY) throw new errors_CliError('init 需要交互式执行终端;无 TTY 时请改用:ylcwf set / ylcwf terminal add', errors_EXIT.USAGE);
|
|
9994
10118
|
const configPath = paths_resolveConfigPath(options.config);
|
|
9995
|
-
const existing =
|
|
10119
|
+
const existing = config_loadConfig(options.config);
|
|
9996
10120
|
if (existing.exists && true !== options.force) {
|
|
9997
10121
|
const proceed = await askConfirm(`配置已存在(${configPath}),继续将覆盖全部字段。是否继续?`, false);
|
|
9998
10122
|
if (!proceed) return void cancel('已取消');
|
|
@@ -10033,29 +10157,27 @@ async function runInit(options) {
|
|
|
10033
10157
|
'docs',
|
|
10034
10158
|
'root'
|
|
10035
10159
|
], root.trim());
|
|
10036
|
-
log.info('
|
|
10160
|
+
log.info('接下来逐项录入执行终端 → 本地仓库映射;执行终端名留空即结束。每端多个仓库用逗号或分号分隔。');
|
|
10037
10161
|
let index = 0;
|
|
10038
10162
|
for(;;){
|
|
10039
10163
|
index += 1;
|
|
10040
|
-
const name = await askText(
|
|
10164
|
+
const name = await askText(`执行终端 #${index}:PRD 中的执行终端名(留空结束)`, '示例执行终端-A', ()=>void 0);
|
|
10041
10165
|
const trimmedName = name.trim();
|
|
10042
10166
|
if (0 === trimmedName.length) break;
|
|
10043
10167
|
if (void 0 !== getIn(doc.toJS(), [
|
|
10044
10168
|
'terminals',
|
|
10045
10169
|
trimmedName
|
|
10046
10170
|
])) {
|
|
10047
|
-
log.warn(
|
|
10171
|
+
log.warn(`执行终端「${trimmedName}」已存在,跳过`);
|
|
10048
10172
|
index -= 1;
|
|
10049
10173
|
continue;
|
|
10050
10174
|
}
|
|
10051
|
-
const aliases = await askText('别名(逗号分隔,可留空)', '别名1, 别名2', ()=>void 0);
|
|
10052
10175
|
const frontendRaw = await askText('前端仓库绝对路径(多个用逗号或分号分隔,可留空)', '/Users/you/develop/ylc/xxx', validatePathList);
|
|
10053
10176
|
const backendRaw = await askText('后端仓库绝对路径(多个用逗号或分号分隔,可留空)', '/Users/you/develop/java/xxx', validatePathList);
|
|
10054
10177
|
doc.setIn([
|
|
10055
10178
|
'terminals',
|
|
10056
10179
|
trimmedName
|
|
10057
10180
|
], {
|
|
10058
|
-
aliases: splitAliases(aliases),
|
|
10059
10181
|
repos: {
|
|
10060
10182
|
frontend: parsePathList(frontendRaw),
|
|
10061
10183
|
backend: parsePathList(backendRaw)
|
|
@@ -10067,8 +10189,8 @@ async function runInit(options) {
|
|
|
10067
10189
|
saveDocument(doc, configPath);
|
|
10068
10190
|
const terminalCount = Object.keys(doc.toJS().terminals ?? {}).length;
|
|
10069
10191
|
if (0 === terminalCount) {
|
|
10070
|
-
log.warn('
|
|
10071
|
-
log.info('稍后补配置:ylcwf terminal add <PRD
|
|
10192
|
+
log.warn('未配置执行终端映射:ylcwf resolve、任务「所属端」与仓库归属校验、doc migrate 回填都会不可用。');
|
|
10193
|
+
log.info('稍后补配置:ylcwf terminal add <PRD 中的执行终端名> --frontend <仓库路径>');
|
|
10072
10194
|
log.info('(后端仓库用 --backend;每端多个仓库可重复传该选项)');
|
|
10073
10195
|
}
|
|
10074
10196
|
outro(`已写入 ${configPath}\n下一步:ylcwf doctor 校验,ylcwf show 查看;后续追加仓库用 ylcwf terminal repo add`);
|
|
@@ -10129,7 +10251,7 @@ const SIDE_LABEL = {
|
|
|
10129
10251
|
backend: '后端'
|
|
10130
10252
|
};
|
|
10131
10253
|
function showConfig(explicit, format) {
|
|
10132
|
-
const loaded =
|
|
10254
|
+
const loaded = config_loadConfig(explicit);
|
|
10133
10255
|
if (!loaded.exists) {
|
|
10134
10256
|
if ('json' === format) return void printJson({
|
|
10135
10257
|
configPath: loaded.path,
|
|
@@ -10142,7 +10264,7 @@ function showConfig(explicit, format) {
|
|
|
10142
10264
|
printLine('运行 `ylcwf init` 完成首次配置,或 `ylcwf set <path> <value>` 精确修改。');
|
|
10143
10265
|
return;
|
|
10144
10266
|
}
|
|
10145
|
-
const checked =
|
|
10267
|
+
const checked = checkConfigWithCatalog(loaded.raw, {
|
|
10146
10268
|
checkFs: true
|
|
10147
10269
|
});
|
|
10148
10270
|
if ('json' === format) return void printJson({
|
|
@@ -10201,21 +10323,19 @@ function renderHuman(path, config, issues) {
|
|
|
10201
10323
|
]).join('\n'));
|
|
10202
10324
|
const names = Object.keys(config.terminals);
|
|
10203
10325
|
printLine('');
|
|
10204
|
-
printLine(`PRD
|
|
10205
|
-
if (0 === names.length) printLine(picocolors_default().dim(' (空)运行 ylcwf terminal add
|
|
10326
|
+
printLine(`PRD 执行终端-本地仓库映射表(${names.length})`);
|
|
10327
|
+
if (0 === names.length) printLine(picocolors_default().dim(' (空)运行 ylcwf terminal add <执行终端名> --frontend <路径> 添加'));
|
|
10206
10328
|
else {
|
|
10207
10329
|
const rows = [];
|
|
10208
10330
|
for (const name of names){
|
|
10209
10331
|
const terminal = config.terminals[name];
|
|
10210
10332
|
if (void 0 === terminal) continue;
|
|
10211
|
-
const aliases = 0 === terminal.aliases.length ? '—' : terminal.aliases.join('、');
|
|
10212
10333
|
let printedName = false;
|
|
10213
10334
|
for (const side of SIDES){
|
|
10214
10335
|
const targets = terminal.repos[side];
|
|
10215
10336
|
if (0 === targets.length) {
|
|
10216
10337
|
rows.push([
|
|
10217
10338
|
printedName ? '' : name,
|
|
10218
|
-
printedName ? '' : aliases,
|
|
10219
10339
|
SIDE_LABEL[side],
|
|
10220
10340
|
'—',
|
|
10221
10341
|
picocolors_default().dim('未配置')
|
|
@@ -10226,7 +10346,6 @@ function renderHuman(path, config, issues) {
|
|
|
10226
10346
|
targets.forEach((target, index)=>{
|
|
10227
10347
|
rows.push([
|
|
10228
10348
|
printedName ? '' : name,
|
|
10229
|
-
printedName ? '' : aliases,
|
|
10230
10349
|
0 === index ? SIDE_LABEL[side] : '',
|
|
10231
10350
|
target,
|
|
10232
10351
|
existsMark(external_node_fs_existsSync(target))
|
|
@@ -10236,8 +10355,7 @@ function renderHuman(path, config, issues) {
|
|
|
10236
10355
|
}
|
|
10237
10356
|
}
|
|
10238
10357
|
printLine(renderTable([
|
|
10239
|
-
'
|
|
10240
|
-
'别名',
|
|
10358
|
+
'执行终端',
|
|
10241
10359
|
'端',
|
|
10242
10360
|
'本地仓库',
|
|
10243
10361
|
'状态'
|
|
@@ -10285,14 +10403,13 @@ function assertSettable(path) {
|
|
|
10285
10403
|
if (4 === path.length && 'docs' === first && 'git' === second && ('cli' === third || 'ui' === third) && ('commit' === fourth || 'push' === fourth)) return;
|
|
10286
10404
|
if (2 === path.length && 'profile' === first && ('developer' === second || 'role' === second)) return;
|
|
10287
10405
|
if (4 === path.length && 'terminals' === first && void 0 !== second && 'repos' === third && void 0 !== fourth && SIDE_SET.has(fourth)) return;
|
|
10288
|
-
|
|
10289
|
-
throw new errors_CliError(`不支持通过 set 修改该路径:${path.join('.')}\n允许:docs.root / docs.git.<cli|ui>.<commit|push> / profile.developer / profile.role / terminals.<终端>.aliases / terminals.<终端>.repos.frontend|backend\n终端的新增与删除请用:ylcwf terminal add | rm`, errors_EXIT.USAGE);
|
|
10406
|
+
throw new errors_CliError(`不支持通过 set 修改该路径:${path.join('.')}\n允许:docs.root / docs.git.<cli|ui>.<commit|push> / profile.developer / profile.role / terminals.<执行终端>.repos.frontend|backend\n执行终端的新增与删除请用:ylcwf terminal add | rm`, errors_EXIT.USAGE);
|
|
10290
10407
|
}
|
|
10291
10408
|
function coerceValue(path, raw) {
|
|
10292
10409
|
const key = path[path.length - 1];
|
|
10293
10410
|
const trimmed = raw.trim();
|
|
10294
10411
|
if ('root' === key) {
|
|
10295
|
-
if (!
|
|
10412
|
+
if (!external_node_path_isAbsolute(trimmed)) throw new errors_CliError(`文档仓库必须是绝对路径:${raw}`, errors_EXIT.USAGE);
|
|
10296
10413
|
return trimmed;
|
|
10297
10414
|
}
|
|
10298
10415
|
if ('remote' === key) {
|
|
@@ -10308,10 +10425,9 @@ function coerceValue(path, raw) {
|
|
|
10308
10425
|
if (!ROLE_SET.has(trimmed)) throw new errors_CliError(`角色必须是 ${ROLES.join(' / ')} 之一:${raw}`, errors_EXIT.USAGE);
|
|
10309
10426
|
return trimmed;
|
|
10310
10427
|
}
|
|
10311
|
-
if ('aliases' === key) return trimmed.split(',').map((item)=>item.trim()).filter((item)=>item.length > 0);
|
|
10312
10428
|
if ('frontend' === key || 'backend' === key) {
|
|
10313
10429
|
const parts = parsePathList(trimmed);
|
|
10314
|
-
for (const part of parts)if (!
|
|
10430
|
+
for (const part of parts)if (!external_node_path_isAbsolute(part)) throw new errors_CliError(`仓库路径必须是绝对路径:${part}`, errors_EXIT.USAGE);
|
|
10315
10431
|
return parts;
|
|
10316
10432
|
}
|
|
10317
10433
|
return raw;
|
|
@@ -10370,10 +10486,9 @@ const SUGGEST_DISTANCE = 3;
|
|
|
10370
10486
|
function suggest(config, target) {
|
|
10371
10487
|
if (0 === target.length) return [];
|
|
10372
10488
|
const scored = [];
|
|
10373
|
-
for (const
|
|
10489
|
+
for (const name of Object.keys(config.terminals)){
|
|
10374
10490
|
const pool = [
|
|
10375
|
-
normalizeName(name)
|
|
10376
|
-
...entry.aliases.map((alias)=>normalizeName(alias))
|
|
10491
|
+
normalizeName(name)
|
|
10377
10492
|
].filter((item)=>item.length > 0);
|
|
10378
10493
|
let best = 1 / 0;
|
|
10379
10494
|
for (const candidate of pool){
|
|
@@ -10401,11 +10516,9 @@ function resolveTerminalName(terminals, input) {
|
|
|
10401
10516
|
candidates: []
|
|
10402
10517
|
});
|
|
10403
10518
|
if (Object.hasOwn(terminals, raw)) return wrap(raw, 'exact');
|
|
10404
|
-
for (const name of names)if (terminals[name]?.aliases.includes(raw) === true) return wrap(name, 'alias');
|
|
10405
10519
|
if (target.length > 0) {
|
|
10406
10520
|
const byKey = names.find((name)=>normalizeName(name) === target);
|
|
10407
10521
|
if (void 0 !== byKey) return wrap(byKey, 'normalized');
|
|
10408
|
-
for (const name of names)if (terminals[name]?.aliases.some((alias)=>normalizeName(alias) === target) === true) return wrap(name, 'normalized');
|
|
10409
10522
|
}
|
|
10410
10523
|
return {
|
|
10411
10524
|
input: raw,
|
|
@@ -10432,7 +10545,7 @@ function resolveKey(terminals, input) {
|
|
|
10432
10545
|
const match = resolveTerminalName(terminals, input);
|
|
10433
10546
|
if (null !== match.name) return match.name;
|
|
10434
10547
|
const hint = 0 === match.candidates.length ? '' : `\n最接近:${match.candidates.join('、')}`;
|
|
10435
|
-
throw new errors_CliError(
|
|
10548
|
+
throw new errors_CliError(`执行终端不存在:${input.trim()}${hint}\n查看全部:ylcwf terminal list`, errors_EXIT.NOT_FOUND);
|
|
10436
10549
|
}
|
|
10437
10550
|
function readTerminals(doc) {
|
|
10438
10551
|
const raw = doc.toJS();
|
|
@@ -10454,7 +10567,7 @@ function terminal_collect(value, previous) {
|
|
|
10454
10567
|
function assertAbsolute(value, field) {
|
|
10455
10568
|
const trimmed = value.trim();
|
|
10456
10569
|
if (0 === trimmed.length) throw new errors_CliError(`${field} 不能为空`, errors_EXIT.USAGE);
|
|
10457
|
-
if (!
|
|
10570
|
+
if (!external_node_path_isAbsolute(trimmed)) throw new errors_CliError(`${field} 必须是绝对路径:${value}`, errors_EXIT.USAGE);
|
|
10458
10571
|
return trimmed;
|
|
10459
10572
|
}
|
|
10460
10573
|
function parseSide(value) {
|
|
@@ -10463,11 +10576,6 @@ function parseSide(value) {
|
|
|
10463
10576
|
if ('frontend' === trimmed || 'backend' === trimmed) return trimmed;
|
|
10464
10577
|
throw new errors_CliError(`--side 必须是 frontend / backend:${trimmed}`, errors_EXIT.USAGE);
|
|
10465
10578
|
}
|
|
10466
|
-
function terminal_splitAliases(value) {
|
|
10467
|
-
const trimmed = value?.trim() ?? '';
|
|
10468
|
-
if (0 === trimmed.length) return [];
|
|
10469
|
-
return trimmed.split(',').map((item)=>item.trim()).filter((item)=>item.length > 0);
|
|
10470
|
-
}
|
|
10471
10579
|
function readSideList(doc, key, side) {
|
|
10472
10580
|
const value = getIn(doc.toJS(), [
|
|
10473
10581
|
'terminals',
|
|
@@ -10486,40 +10594,49 @@ function runTerminalList(options) {
|
|
|
10486
10594
|
terminals: ready.config.terminals
|
|
10487
10595
|
});
|
|
10488
10596
|
const names = Object.keys(ready.config.terminals);
|
|
10489
|
-
if (0 === names.length) return void printLine('(空)运行 `ylcwf terminal add
|
|
10597
|
+
if (0 === names.length) return void printLine('(空)运行 `ylcwf terminal add <执行终端名> --frontend <路径>` 添加');
|
|
10490
10598
|
for (const name of names){
|
|
10491
10599
|
const terminal = ready.config.terminals[name];
|
|
10492
|
-
if (void 0
|
|
10493
|
-
|
|
10494
|
-
|
|
10495
|
-
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10600
|
+
if (void 0 !== terminal) {
|
|
10601
|
+
printLine(name);
|
|
10602
|
+
for (const side of SIDES){
|
|
10603
|
+
const targets = terminal.repos[side];
|
|
10604
|
+
if (0 === targets.length) {
|
|
10605
|
+
printLine(` ${terminal_SIDE_LABEL[side]} (未配置)`);
|
|
10606
|
+
continue;
|
|
10607
|
+
}
|
|
10608
|
+
targets.forEach((target, index)=>{
|
|
10609
|
+
const mark = external_node_fs_existsSync(target) ? picocolors_default().green(' ✓') : picocolors_default().red(' ✗');
|
|
10610
|
+
const label = 0 === index ? terminal_SIDE_LABEL[side] : ' '.repeat(terminal_SIDE_LABEL[side].length);
|
|
10611
|
+
printLine(` ${label} ${target}${mark}`);
|
|
10612
|
+
});
|
|
10500
10613
|
}
|
|
10501
|
-
targets.forEach((target, index)=>{
|
|
10502
|
-
const mark = external_node_fs_existsSync(target) ? picocolors_default().green(' ✓') : picocolors_default().red(' ✗');
|
|
10503
|
-
const label = 0 === index ? terminal_SIDE_LABEL[side] : ' '.repeat(terminal_SIDE_LABEL[side].length);
|
|
10504
|
-
printLine(` ${label} ${target}${mark}`);
|
|
10505
|
-
});
|
|
10506
10614
|
}
|
|
10507
10615
|
}
|
|
10508
10616
|
}
|
|
10617
|
+
function assertInCatalog(name, configPath) {
|
|
10618
|
+
const loaded = config_loadConfig(configPath);
|
|
10619
|
+
const docsRoot = loaded.config?.docs.root ?? '';
|
|
10620
|
+
if (0 === docsRoot.length) return;
|
|
10621
|
+
const names = catalogNames(docsRoot);
|
|
10622
|
+
if (0 === names.length) return;
|
|
10623
|
+
if (names.includes(name)) return;
|
|
10624
|
+
throw new errors_CliError(`执行终端「${name}」不在文档仓库 execution_terminals.json 中\n可选:${names.join('、')}\n新增执行终端请先修改文档仓库的 execution_terminals.json`, errors_EXIT.USAGE);
|
|
10625
|
+
}
|
|
10509
10626
|
function runTerminalAdd(key, options) {
|
|
10510
10627
|
const trimmedKey = key.trim();
|
|
10511
|
-
if (0 === trimmedKey.length) throw new errors_CliError('
|
|
10512
|
-
if (trimmedKey.includes('.')) throw new errors_CliError('
|
|
10628
|
+
if (0 === trimmedKey.length) throw new errors_CliError('执行终端名不能为空', errors_EXIT.USAGE);
|
|
10629
|
+
if (trimmedKey.includes('.')) throw new errors_CliError('执行终端名不能包含「.」(与配置路径语法冲突)', errors_EXIT.USAGE);
|
|
10513
10630
|
const { path: configPath, doc } = obtainDocument(options.config);
|
|
10631
|
+
assertInCatalog(trimmedKey, configPath);
|
|
10514
10632
|
if (void 0 !== getIn(doc.toJS(), [
|
|
10515
10633
|
'terminals',
|
|
10516
10634
|
trimmedKey
|
|
10517
|
-
])) throw new errors_CliError(
|
|
10635
|
+
])) throw new errors_CliError(`执行终端已存在:${trimmedKey}\n修改请用:ylcwf terminal repo add|rm`, errors_EXIT.USAGE);
|
|
10518
10636
|
doc.setIn([
|
|
10519
10637
|
'terminals',
|
|
10520
10638
|
trimmedKey
|
|
10521
10639
|
], {
|
|
10522
|
-
aliases: options.alias ?? [],
|
|
10523
10640
|
repos: {
|
|
10524
10641
|
frontend: (options.frontend ?? []).map((item)=>assertAbsolute(item, '--frontend')),
|
|
10525
10642
|
backend: (options.backend ?? []).map((item)=>assertAbsolute(item, '--backend'))
|
|
@@ -10527,22 +10644,7 @@ function runTerminalAdd(key, options) {
|
|
|
10527
10644
|
});
|
|
10528
10645
|
assertWritable(doc, configPath);
|
|
10529
10646
|
saveDocument(doc, configPath);
|
|
10530
|
-
printLine(
|
|
10531
|
-
printLine(`配置文件:${configPath}`);
|
|
10532
|
-
}
|
|
10533
|
-
function runTerminalSetAliases(key, options) {
|
|
10534
|
-
const trimmedKey = key.trim();
|
|
10535
|
-
const { path: configPath, doc } = obtainDocument(options.config);
|
|
10536
|
-
const resolvedKey = resolveKey(readTerminals(doc), trimmedKey);
|
|
10537
|
-
if (void 0 === options.aliases) throw new errors_CliError('需要指定 --aliases(逗号分隔,整体替换)', errors_EXIT.USAGE);
|
|
10538
|
-
doc.setIn([
|
|
10539
|
-
'terminals',
|
|
10540
|
-
resolvedKey,
|
|
10541
|
-
'aliases'
|
|
10542
|
-
], terminal_splitAliases(options.aliases));
|
|
10543
|
-
assertWritable(doc, configPath);
|
|
10544
|
-
saveDocument(doc, configPath);
|
|
10545
|
-
printLine(`已更新终端别名:${resolvedKey}`);
|
|
10647
|
+
printLine(`已添加执行终端:${trimmedKey}`);
|
|
10546
10648
|
printLine(`配置文件:${configPath}`);
|
|
10547
10649
|
}
|
|
10548
10650
|
function runTerminalRepoAdd(key, options) {
|
|
@@ -10551,7 +10653,7 @@ function runTerminalRepoAdd(key, options) {
|
|
|
10551
10653
|
const target = assertAbsolute(options.path ?? '', '--path');
|
|
10552
10654
|
const { path: configPath, doc } = obtainDocument(options.config);
|
|
10553
10655
|
const resolvedKey = resolveKey(readTerminals(doc), trimmedKey);
|
|
10554
|
-
if (resolvedKey !== trimmedKey) printLine(
|
|
10656
|
+
if (resolvedKey !== trimmedKey) printLine(`(归一化匹配到执行终端:${resolvedKey})`);
|
|
10555
10657
|
const list = readSideList(doc, resolvedKey, side);
|
|
10556
10658
|
if (list.includes(target)) throw new errors_CliError(`${side} 端已存在该仓库:${target}`, errors_EXIT.USAGE);
|
|
10557
10659
|
doc.setIn([
|
|
@@ -10574,7 +10676,7 @@ function runTerminalRepoRemove(key, options) {
|
|
|
10574
10676
|
const { path: configPath, doc } = obtainDocument(options.config);
|
|
10575
10677
|
const resolvedKey = resolveKey(readTerminals(doc), trimmedKey);
|
|
10576
10678
|
const list = readSideList(doc, resolvedKey, side);
|
|
10577
|
-
if (0 === list.length) throw new errors_CliError(
|
|
10679
|
+
if (0 === list.length) throw new errors_CliError(`执行终端「${resolvedKey}」的 ${side} 端没有仓库`, errors_EXIT.NOT_FOUND);
|
|
10578
10680
|
if (!list.includes(target)) throw new errors_CliError(`${side} 端不存在该仓库:${target}\n现有:\n${list.map((item, index)=>` ${index + 1}) ${item}`).join('\n')}`, errors_EXIT.NOT_FOUND);
|
|
10579
10681
|
const next = list.filter((item)=>item !== target);
|
|
10580
10682
|
doc.setIn([
|
|
@@ -10593,7 +10695,7 @@ function runTerminalRepoList(key, options) {
|
|
|
10593
10695
|
const ready = requireConfig(options.config);
|
|
10594
10696
|
const resolvedKey = resolveKey(ready.config.terminals, trimmedKey);
|
|
10595
10697
|
const terminal = ready.config.terminals[resolvedKey];
|
|
10596
|
-
if (void 0 === terminal) throw new errors_CliError(
|
|
10698
|
+
if (void 0 === terminal) throw new errors_CliError(`执行终端不存在:${resolvedKey}`, errors_EXIT.NOT_FOUND);
|
|
10597
10699
|
const sides = void 0 === options.side ? [
|
|
10598
10700
|
...SIDES
|
|
10599
10701
|
] : [
|
|
@@ -10624,10 +10726,10 @@ async function runTerminalRemove(key, options) {
|
|
|
10624
10726
|
const ready = requireConfig(options.config);
|
|
10625
10727
|
const resolvedKey = resolveKey(ready.config.terminals, trimmedKey);
|
|
10626
10728
|
if (true !== options.yes) {
|
|
10627
|
-
if (true !== process.stdin.isTTY) throw new errors_CliError('
|
|
10729
|
+
if (true !== process.stdin.isTTY) throw new errors_CliError('非交互环境删除执行终端需要显式加 --yes', errors_EXIT.USAGE);
|
|
10628
10730
|
const { confirm } = await Promise.resolve(prompts_dist_namespaceObject);
|
|
10629
10731
|
const answer = await confirm({
|
|
10630
|
-
message:
|
|
10732
|
+
message: `确认删除执行终端「${resolvedKey}」?`,
|
|
10631
10733
|
initialValue: false
|
|
10632
10734
|
});
|
|
10633
10735
|
if (true !== answer) return void printLine('已取消');
|
|
@@ -10638,23 +10740,20 @@ async function runTerminalRemove(key, options) {
|
|
|
10638
10740
|
]);
|
|
10639
10741
|
assertWritable(ready.doc, ready.path);
|
|
10640
10742
|
saveDocument(ready.doc, ready.path);
|
|
10641
|
-
printLine(
|
|
10743
|
+
printLine(`已删除执行终端:${resolvedKey}`);
|
|
10642
10744
|
}
|
|
10643
10745
|
function registerTerminal(program) {
|
|
10644
|
-
const terminal = program.command('terminal').description('维护 PRD
|
|
10645
|
-
terminal.command('list').description('
|
|
10746
|
+
const terminal = program.command('terminal').description('维护 PRD 执行终端 → 本地仓库映射');
|
|
10747
|
+
terminal.command('list').description('列出全部执行终端').option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').action((options)=>{
|
|
10646
10748
|
runTerminalList(options);
|
|
10647
10749
|
});
|
|
10648
|
-
terminal.command('add <key>').description('
|
|
10750
|
+
terminal.command('add <key>').description('新增执行终端(执行终端名用 PRD 中的取值,可为中文)').option('-c, --config <path>', '指定配置文件路径').option('--frontend <path>', '前端仓库绝对路径,可重复', terminal_collect, []).option('--backend <path>', '后端仓库绝对路径,可重复', terminal_collect, []).action((key, options)=>{
|
|
10649
10751
|
runTerminalAdd(key, options);
|
|
10650
10752
|
});
|
|
10651
|
-
terminal.command('
|
|
10652
|
-
runTerminalSetAliases(key, options);
|
|
10653
|
-
});
|
|
10654
|
-
terminal.command('rm <key>').description('删除终端').option('-c, --config <path>', '指定配置文件路径').option('--yes', '跳过确认').action(async (key, options)=>{
|
|
10753
|
+
terminal.command('rm <key>').description('删除执行终端').option('-c, --config <path>', '指定配置文件路径').option('--yes', '跳过确认').action(async (key, options)=>{
|
|
10655
10754
|
await runTerminalRemove(key, options);
|
|
10656
10755
|
});
|
|
10657
|
-
const repo = terminal.command('repo').description('
|
|
10756
|
+
const repo = terminal.command('repo').description('维护单个执行终端某一端的仓库列表');
|
|
10658
10757
|
repo.command('list <key>').description('列出仓库').option('-c, --config <path>', '指定配置文件路径').option('--side <side>', '限定端口:frontend | backend').option('--format <format>', '输出格式:human | json', 'human').action((key, options)=>{
|
|
10659
10758
|
runTerminalRepoList(key, options);
|
|
10660
10759
|
});
|
|
@@ -10737,6 +10836,156 @@ function aggregateViaPython(docsRoot, lists) {
|
|
|
10737
10836
|
}
|
|
10738
10837
|
return null;
|
|
10739
10838
|
}
|
|
10839
|
+
const DEFAULT_ITERATIONS_ROOT = 'iterations';
|
|
10840
|
+
const YEAR_PATTERN = /^\d{4}$/;
|
|
10841
|
+
function currentIterationYear() {
|
|
10842
|
+
return new Date().getFullYear();
|
|
10843
|
+
}
|
|
10844
|
+
function isYearDirectory(name) {
|
|
10845
|
+
return YEAR_PATTERN.test(name);
|
|
10846
|
+
}
|
|
10847
|
+
function isIterationYear(value) {
|
|
10848
|
+
return Number.isInteger(value) && YEAR_PATTERN.test(String(value));
|
|
10849
|
+
}
|
|
10850
|
+
function iterationsRootPath(docsRoot, iterationsRoot) {
|
|
10851
|
+
const base = 0 === iterationsRoot.trim().length ? DEFAULT_ITERATIONS_ROOT : iterationsRoot.trim();
|
|
10852
|
+
return external_node_path_join(docsRoot, base);
|
|
10853
|
+
}
|
|
10854
|
+
function yearDirPath(docsRoot, iterationsRoot, year) {
|
|
10855
|
+
return external_node_path_join(iterationsRootPath(docsRoot, iterationsRoot), String(year));
|
|
10856
|
+
}
|
|
10857
|
+
function iterationRelPath(year, name) {
|
|
10858
|
+
return `${year}/${name}`;
|
|
10859
|
+
}
|
|
10860
|
+
function listIterationYears(docsRoot, iterationsRoot) {
|
|
10861
|
+
const root = iterationsRootPath(docsRoot, iterationsRoot);
|
|
10862
|
+
if (!external_node_fs_existsSync(root)) return [];
|
|
10863
|
+
try {
|
|
10864
|
+
return external_node_fs_readdirSync(root, {
|
|
10865
|
+
withFileTypes: true
|
|
10866
|
+
}).filter((entry)=>entry.isDirectory() && isYearDirectory(entry.name)).map((entry)=>Number.parseInt(entry.name, 10)).sort((left, right)=>left - right);
|
|
10867
|
+
} catch {
|
|
10868
|
+
return [];
|
|
10869
|
+
}
|
|
10870
|
+
}
|
|
10871
|
+
function listIterationDirs(docsRoot, iterationsRoot) {
|
|
10872
|
+
const result = [];
|
|
10873
|
+
for (const year of listIterationYears(docsRoot, iterationsRoot)){
|
|
10874
|
+
const yearDir = yearDirPath(docsRoot, iterationsRoot, year);
|
|
10875
|
+
let entries;
|
|
10876
|
+
try {
|
|
10877
|
+
entries = external_node_fs_readdirSync(yearDir, {
|
|
10878
|
+
withFileTypes: true
|
|
10879
|
+
}).filter((entry)=>entry.isDirectory() && !entry.name.startsWith('.')).map((entry)=>entry.name);
|
|
10880
|
+
} catch {
|
|
10881
|
+
continue;
|
|
10882
|
+
}
|
|
10883
|
+
for (const name of entries.sort())result.push({
|
|
10884
|
+
name,
|
|
10885
|
+
year,
|
|
10886
|
+
dir: external_node_path_join(yearDir, name),
|
|
10887
|
+
relPath: iterationRelPath(year, name)
|
|
10888
|
+
});
|
|
10889
|
+
}
|
|
10890
|
+
return result;
|
|
10891
|
+
}
|
|
10892
|
+
function parseIterationRef(input) {
|
|
10893
|
+
const text = input.trim().replace(/^\.\//, '');
|
|
10894
|
+
const match = /^(\d{4})[/\\](.+)$/.exec(text);
|
|
10895
|
+
if (null === match) return {
|
|
10896
|
+
year: null,
|
|
10897
|
+
name: text
|
|
10898
|
+
};
|
|
10899
|
+
const year = Number.parseInt(match[1] ?? '', 10);
|
|
10900
|
+
const name = (match[2] ?? '').trim();
|
|
10901
|
+
return Number.isInteger(year) ? {
|
|
10902
|
+
year,
|
|
10903
|
+
name
|
|
10904
|
+
} : {
|
|
10905
|
+
year: null,
|
|
10906
|
+
name: text
|
|
10907
|
+
};
|
|
10908
|
+
}
|
|
10909
|
+
function ambiguous(name, pool) {
|
|
10910
|
+
const listed = pool.map((item)=>item.relPath).sort().join('、');
|
|
10911
|
+
return new errors_CliError(`迭代名在多个年份下重复:${name}(${listed})。请用「年份/迭代名」显式指定,例如 -i ${pool[0]?.relPath ?? ''}`, errors_EXIT.USAGE);
|
|
10912
|
+
}
|
|
10913
|
+
function resolveIterationDir(docsRoot, iterationsRoot, input) {
|
|
10914
|
+
const { year, name } = parseIterationRef(input);
|
|
10915
|
+
if (0 === name.length) throw new errors_CliError('必须指定迭代目录', errors_EXIT.USAGE);
|
|
10916
|
+
const all = listIterationDirs(docsRoot, iterationsRoot);
|
|
10917
|
+
const scoped = null === year ? all : all.filter((item)=>item.year === year);
|
|
10918
|
+
const exact = scoped.filter((item)=>item.name === name);
|
|
10919
|
+
if (1 === exact.length && void 0 !== exact[0]) return exact[0];
|
|
10920
|
+
if (exact.length > 1) throw ambiguous(name, exact);
|
|
10921
|
+
const folded = scoped.filter((item)=>item.name.toLowerCase() === name.toLowerCase());
|
|
10922
|
+
if (1 === folded.length && void 0 !== folded[0]) return folded[0];
|
|
10923
|
+
if (folded.length > 1) throw ambiguous(name, folded);
|
|
10924
|
+
const where = null === year ? '' : `(${year} 年)`;
|
|
10925
|
+
const years = listIterationYears(docsRoot, iterationsRoot);
|
|
10926
|
+
const hint = 0 === years.length ? `\n该文档仓库尚未建立迭代目录:${iterationsRootPath(docsRoot, iterationsRoot)}` : `\n已有年份:${years.join('、')}`;
|
|
10927
|
+
throw new errors_CliError(`迭代目录不存在${where}:${name}${hint}`, errors_EXIT.NOT_FOUND);
|
|
10928
|
+
}
|
|
10929
|
+
function newIterationDir(docsRoot, iterationsRoot, writeYear, name, options = {}) {
|
|
10930
|
+
const trimmed = name.trim();
|
|
10931
|
+
if (0 === trimmed.length) throw new errors_CliError('迭代目录名不能为空', errors_EXIT.USAGE);
|
|
10932
|
+
if (trimmed.includes('/') || trimmed.includes('\\') || trimmed.includes('..')) throw new errors_CliError(`迭代目录名不能包含路径分隔符:${name}`, errors_EXIT.USAGE);
|
|
10933
|
+
if (!isIterationYear(writeYear)) throw new errors_CliError(`写入年份必须是 4 位数字:${writeYear}`, errors_EXIT.USAGE);
|
|
10934
|
+
const dir = external_node_path_join(yearDirPath(docsRoot, iterationsRoot, writeYear), trimmed);
|
|
10935
|
+
if (false !== options.create) mkdirSync(dir, {
|
|
10936
|
+
recursive: true
|
|
10937
|
+
});
|
|
10938
|
+
return {
|
|
10939
|
+
name: trimmed,
|
|
10940
|
+
year: writeYear,
|
|
10941
|
+
dir,
|
|
10942
|
+
relPath: iterationRelPath(writeYear, trimmed)
|
|
10943
|
+
};
|
|
10944
|
+
}
|
|
10945
|
+
function requireIterationDir(docsRoot, iterationsRoot, input) {
|
|
10946
|
+
try {
|
|
10947
|
+
return resolveIterationDir(docsRoot, iterationsRoot, input);
|
|
10948
|
+
} catch (error) {
|
|
10949
|
+
if (error instanceof errors_CliError && error.exitCode === errors_EXIT.NOT_FOUND) {
|
|
10950
|
+
const { name } = parseIterationRef(input);
|
|
10951
|
+
throw new errors_CliError(`${error.message}\n新建迭代目录:ylcwf iteration create <年份>/${name}`, errors_EXIT.NOT_FOUND);
|
|
10952
|
+
}
|
|
10953
|
+
throw error;
|
|
10954
|
+
}
|
|
10955
|
+
}
|
|
10956
|
+
function createIterationDir(docsRoot, iterationsRoot, input, options = {}) {
|
|
10957
|
+
const { year: prefixYear, name } = parseIterationRef(input);
|
|
10958
|
+
const trimmed = name.trim();
|
|
10959
|
+
if (0 === trimmed.length) throw new errors_CliError('迭代目录名不能为空', errors_EXIT.USAGE);
|
|
10960
|
+
if (trimmed.includes('/') || trimmed.includes('\\') || trimmed.includes('..')) throw new errors_CliError(`迭代目录名不能包含路径分隔符:${name}`, errors_EXIT.USAGE);
|
|
10961
|
+
const year = prefixYear ?? options.year ?? currentIterationYear();
|
|
10962
|
+
if (!isIterationYear(year)) throw new errors_CliError(`年份必须是 4 位数字:${String(year)}`, errors_EXIT.USAGE);
|
|
10963
|
+
const target = newIterationDir(docsRoot, iterationsRoot, year, trimmed, {
|
|
10964
|
+
create: false
|
|
10965
|
+
});
|
|
10966
|
+
if (external_node_fs_existsSync(target.dir)) return {
|
|
10967
|
+
iteration: target,
|
|
10968
|
+
created: false
|
|
10969
|
+
};
|
|
10970
|
+
const existing = listIterationDirs(docsRoot, iterationsRoot).filter((item)=>item.name.toLowerCase() === trimmed.toLowerCase());
|
|
10971
|
+
if (null === prefixYear && existing.length > 0) {
|
|
10972
|
+
const listed = existing.map((item)=>item.relPath).join('、');
|
|
10973
|
+
throw new errors_CliError(`迭代名已存在于其他年份:${trimmed}(${listed})\n如需在新年份下再建一个同名迭代,请显式写年份:ylcwf iteration create ${year}/${trimmed}`, errors_EXIT.USAGE);
|
|
10974
|
+
}
|
|
10975
|
+
mkdirSync(target.dir, {
|
|
10976
|
+
recursive: true
|
|
10977
|
+
});
|
|
10978
|
+
return {
|
|
10979
|
+
iteration: target,
|
|
10980
|
+
created: true
|
|
10981
|
+
};
|
|
10982
|
+
}
|
|
10983
|
+
function layoutOf(config) {
|
|
10984
|
+
return {
|
|
10985
|
+
root: config?.docs.root ?? '',
|
|
10986
|
+
iterationsRoot: DEFAULT_ITERATIONS_ROOT
|
|
10987
|
+
};
|
|
10988
|
+
}
|
|
10740
10989
|
function normalizeIterationKey(value) {
|
|
10741
10990
|
return value.trim().toLowerCase().replace(/[-_.\s]+/g, '-');
|
|
10742
10991
|
}
|
|
@@ -11048,7 +11297,7 @@ function validateTaskSides(options) {
|
|
|
11048
11297
|
terminal: task.terminal,
|
|
11049
11298
|
repoSide: null,
|
|
11050
11299
|
level: 'warning',
|
|
11051
|
-
message: isKnownRepo(options.index, task.terminal) ? `任务 ${task.id}
|
|
11300
|
+
message: isKnownRepo(options.index, task.terminal) ? `任务 ${task.id} 的执行终端「${task.terminal}」在本机配置中同时对应前后端仓库,无法校验归属` : `任务 ${task.id} 的执行终端「${task.terminal}」不在本机执行终端配置中,无法校验所属端与仓库是否一致`
|
|
11052
11301
|
});
|
|
11053
11302
|
continue;
|
|
11054
11303
|
}
|
|
@@ -11059,7 +11308,7 @@ function validateTaskSides(options) {
|
|
|
11059
11308
|
terminal: task.terminal,
|
|
11060
11309
|
repoSide,
|
|
11061
11310
|
level: 'warning',
|
|
11062
|
-
message: `任务 ${task.id} 的所属端是「${task.scope}
|
|
11311
|
+
message: `任务 ${task.id} 的所属端是「${task.scope}」,但执行终端「${task.terminal}」在本机配置里是${describeSide(repoSide)}仓库,请核对`
|
|
11063
11312
|
});
|
|
11064
11313
|
}
|
|
11065
11314
|
return {
|
|
@@ -11230,7 +11479,7 @@ function validatePlanReferences(options) {
|
|
|
11230
11479
|
const knownRequirements = new Set(options.knownRequirements ?? []);
|
|
11231
11480
|
for (const task of options.plan.tasks){
|
|
11232
11481
|
if (!requirementCodes.has(task.requirement) && !knownRequirements.has(task.requirement)) docplan_fail(`任务「${task.name}」关联的需求 ${task.requirement} 既不在 requirements 中,也不在文档现有需求里`);
|
|
11233
|
-
if (knownRepos.size > 0 && !isKnownRepo(options.index, task.terminal)) process.stderr.write(`提示:任务「${task.name}
|
|
11482
|
+
if (knownRepos.size > 0 && !isKnownRepo(options.index, task.terminal)) process.stderr.write(`提示:任务「${task.name}」的执行终端「${task.terminal}」不在本机执行终端配置中,跳过归属校验\n`);
|
|
11234
11483
|
for (const dependency of task.dependsOn ?? []){
|
|
11235
11484
|
const normalized = dependency.startsWith('#') ? dependency : `#${dependency}`;
|
|
11236
11485
|
if (!options.knownTaskIds.includes(normalized)) {
|
|
@@ -11323,7 +11572,7 @@ function refreshRequirementRows(options) {
|
|
|
11323
11572
|
if (/^\|[\s:|-]+\|$/.test(trimmed)) continue;
|
|
11324
11573
|
const cells = splitRow(trimmed);
|
|
11325
11574
|
const code = cells[idIndex] ?? '';
|
|
11326
|
-
if (!codes.has(code)) continue;
|
|
11575
|
+
if (void 0 !== codes && !codes.has(code)) continue;
|
|
11327
11576
|
const statuses = statusesByCode.get(code) ?? [];
|
|
11328
11577
|
const result = aggregate(statuses);
|
|
11329
11578
|
const nextStatus = result.status;
|
|
@@ -11668,7 +11917,7 @@ const RESERVED_PREFIXES = [
|
|
|
11668
11917
|
'docs/',
|
|
11669
11918
|
'_prd/'
|
|
11670
11919
|
];
|
|
11671
|
-
const SAFE_SEGMENT = /^[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
11920
|
+
const SAFE_SEGMENT = /^(?:\d{4}\/)?[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
11672
11921
|
function git_git(docsRoot, args, timeoutMs = 15000) {
|
|
11673
11922
|
return execFileSync('git', [
|
|
11674
11923
|
'-C',
|
|
@@ -11866,7 +12115,8 @@ function getBranchInfo(docsRoot) {
|
|
|
11866
12115
|
remote: branches.split('\n').map((line)=>line.trim().replace(/^refs\/remotes\//, '')).filter((line)=>line.length > 0 && line.includes('/') && !line.endsWith('/HEAD')).sort()
|
|
11867
12116
|
};
|
|
11868
12117
|
}
|
|
11869
|
-
function listRemoteIterations(
|
|
12118
|
+
function listRemoteIterations(layout, ref) {
|
|
12119
|
+
const docsRoot = layout.root;
|
|
11870
12120
|
const listed = tryGit(docsRoot, [
|
|
11871
12121
|
'ls-tree',
|
|
11872
12122
|
'-r',
|
|
@@ -11874,13 +12124,18 @@ function listRemoteIterations(docsRoot, ref) {
|
|
|
11874
12124
|
ref.sha
|
|
11875
12125
|
]);
|
|
11876
12126
|
if (null === listed) throw new errors_CliError(`无法读取远程快照:${ref.ref}`, errors_EXIT.NOT_FOUND);
|
|
12127
|
+
const prefix = `${layout.iterationsRoot.replace(/\/+$/, '')}/`;
|
|
11877
12128
|
const groups = new Map();
|
|
11878
12129
|
for (const path of listed.split('\n')){
|
|
11879
12130
|
if (!isDocMarkdown(path)) continue;
|
|
11880
|
-
|
|
11881
|
-
|
|
11882
|
-
|
|
11883
|
-
|
|
12131
|
+
if (!path.startsWith(prefix)) continue;
|
|
12132
|
+
const segments = path.slice(prefix.length).split('/');
|
|
12133
|
+
if (3 !== segments.length) continue;
|
|
12134
|
+
const [yearText, iteration, file] = segments;
|
|
12135
|
+
if (void 0 === yearText || void 0 === iteration || void 0 === file) continue;
|
|
12136
|
+
if (!isYearDirectory(yearText)) continue;
|
|
12137
|
+
const year = Number.parseInt(yearText, 10);
|
|
12138
|
+
const relPath = `${yearText}/${iteration}`;
|
|
11884
12139
|
const sizeText = tryGit(docsRoot, [
|
|
11885
12140
|
'cat-file',
|
|
11886
12141
|
'-s',
|
|
@@ -11892,18 +12147,25 @@ function listRemoteIterations(docsRoot, ref) {
|
|
|
11892
12147
|
mtime: lastCommitIso(docsRoot, ref.sha, path),
|
|
11893
12148
|
size: Number.parseInt(sizeText, 10) || 0
|
|
11894
12149
|
};
|
|
11895
|
-
const bucket = groups.get(
|
|
11896
|
-
|
|
11897
|
-
|
|
12150
|
+
const bucket = groups.get(relPath) ?? {
|
|
12151
|
+
year,
|
|
12152
|
+
name: iteration,
|
|
12153
|
+
relPath,
|
|
12154
|
+
developers: []
|
|
12155
|
+
};
|
|
12156
|
+
bucket.developers.push(entry);
|
|
12157
|
+
groups.set(relPath, bucket);
|
|
11898
12158
|
}
|
|
11899
12159
|
const iterations = [
|
|
11900
|
-
...groups.
|
|
11901
|
-
].map((
|
|
11902
|
-
name,
|
|
11903
|
-
|
|
11904
|
-
|
|
11905
|
-
|
|
11906
|
-
|
|
12160
|
+
...groups.values()
|
|
12161
|
+
].map((group)=>({
|
|
12162
|
+
name: group.name,
|
|
12163
|
+
year: group.year,
|
|
12164
|
+
relPath: group.relPath,
|
|
12165
|
+
mtime: lastCommitIso(docsRoot, ref.sha, `${prefix}${group.relPath}`),
|
|
12166
|
+
developers: group.developers.sort((left, right)=>right.mtime.localeCompare(left.mtime)),
|
|
12167
|
+
hasPrd: listed.includes(`${prefix}${group.relPath}/_prd/meta.json`)
|
|
12168
|
+
})).sort((left, right)=>left.year === right.year ? right.mtime.localeCompare(left.mtime) : right.year - left.year);
|
|
11907
12169
|
return {
|
|
11908
12170
|
docsRoot,
|
|
11909
12171
|
source: 'remote',
|
|
@@ -11945,14 +12207,14 @@ function materializeScripts(docsRoot, ref, dir) {
|
|
|
11945
12207
|
}
|
|
11946
12208
|
}
|
|
11947
12209
|
}
|
|
11948
|
-
function exportRemoteDoc(docsRoot, ref, iteration, developer) {
|
|
12210
|
+
function exportRemoteDoc(docsRoot, ref, year, iteration, developer, iterationsRoot = 'iterations') {
|
|
11949
12211
|
const safeIteration = safeSegment(iteration, '迭代目录');
|
|
11950
12212
|
const safeDeveloper = safeSegment(developer, '开发者标识');
|
|
11951
|
-
const relative = `${safeIteration}/${safeDeveloper}.md`;
|
|
12213
|
+
const relative = `${iterationsRoot}/${year}/${safeIteration}/${safeDeveloper}.md`;
|
|
11952
12214
|
const markdown = gitShow(docsRoot, ref.sha, relative);
|
|
11953
12215
|
if (null === markdown) throw new errors_CliError(`远程快照中不存在该文档:${relative}`, errors_EXIT.NOT_FOUND);
|
|
11954
12216
|
const dir = materializeRemote(docsRoot, ref);
|
|
11955
|
-
const target = external_node_path_join(dir, safeIteration, `${safeDeveloper}.md`);
|
|
12217
|
+
const target = external_node_path_join(dir, iterationsRoot, String(year), safeIteration, `${safeDeveloper}.md`);
|
|
11956
12218
|
mkdirSync(external_node_path_dirname(target), {
|
|
11957
12219
|
recursive: true
|
|
11958
12220
|
});
|
|
@@ -11997,7 +12259,7 @@ function normalizeAcceptance(value) {
|
|
|
11997
12259
|
function bump(target, key) {
|
|
11998
12260
|
target[key] = (target[key] ?? 0) + 1;
|
|
11999
12261
|
}
|
|
12000
|
-
|
|
12262
|
+
new Set([
|
|
12001
12263
|
"_prd",
|
|
12002
12264
|
"scripts",
|
|
12003
12265
|
"skills",
|
|
@@ -12012,7 +12274,7 @@ const iterations_RESERVED_FILES = new Set([
|
|
|
12012
12274
|
"AGENTS.md",
|
|
12013
12275
|
"CLAUDE.md"
|
|
12014
12276
|
]);
|
|
12015
|
-
const iterations_SAFE_SEGMENT = /^[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
12277
|
+
const iterations_SAFE_SEGMENT = /^(?:\d{4}\/)?[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
12016
12278
|
function iterations_safeSegment(value, label) {
|
|
12017
12279
|
const trimmed = value.trim();
|
|
12018
12280
|
if (!iterations_SAFE_SEGMENT.test(trimmed) || "." === trimmed || ".." === trimmed) throw new errors_CliError(`${label} 不合法:${value}`, errors_EXIT.USAGE);
|
|
@@ -12058,7 +12320,8 @@ function accessReason(error) {
|
|
|
12058
12320
|
if (error instanceof Error) return error.message;
|
|
12059
12321
|
return String(error);
|
|
12060
12322
|
}
|
|
12061
|
-
function listIterations(
|
|
12323
|
+
function listIterations(layout, source = "local", refName) {
|
|
12324
|
+
const docsRoot = layout.root;
|
|
12062
12325
|
const base = {
|
|
12063
12326
|
docsRoot,
|
|
12064
12327
|
configured: docsRoot.trim().length > 0,
|
|
@@ -12085,7 +12348,7 @@ function listIterations(docsRoot, source = "local", refName) {
|
|
|
12085
12348
|
};
|
|
12086
12349
|
}
|
|
12087
12350
|
try {
|
|
12088
|
-
return buildIterationList(
|
|
12351
|
+
return buildIterationList(layout, source, base, refName);
|
|
12089
12352
|
} catch (error) {
|
|
12090
12353
|
return {
|
|
12091
12354
|
...base,
|
|
@@ -12093,10 +12356,11 @@ function listIterations(docsRoot, source = "local", refName) {
|
|
|
12093
12356
|
};
|
|
12094
12357
|
}
|
|
12095
12358
|
}
|
|
12096
|
-
function buildIterationList(
|
|
12359
|
+
function buildIterationList(layout, source, base, refName) {
|
|
12360
|
+
const docsRoot = layout.root;
|
|
12097
12361
|
if ("remote" === source) {
|
|
12098
12362
|
const ref = resolveRemoteRef(docsRoot, refName);
|
|
12099
|
-
const snapshot = listRemoteIterations(
|
|
12363
|
+
const snapshot = listRemoteIterations(layout, ref);
|
|
12100
12364
|
return {
|
|
12101
12365
|
...base,
|
|
12102
12366
|
accessible: true,
|
|
@@ -12108,19 +12372,18 @@ function buildIterationList(docsRoot, source, base, refName) {
|
|
|
12108
12372
|
iterations: snapshot.iterations
|
|
12109
12373
|
};
|
|
12110
12374
|
}
|
|
12111
|
-
const entries =
|
|
12112
|
-
|
|
12113
|
-
|
|
12114
|
-
const directory = external_node_path_join(docsRoot, entry.name);
|
|
12115
|
-
const developers = listMarkdownFiles(directory);
|
|
12116
|
-
const info = statSync(directory);
|
|
12375
|
+
const entries = listIterationDirs(layout.root, layout.iterationsRoot).map((item)=>{
|
|
12376
|
+
const developers = listMarkdownFiles(item.dir);
|
|
12377
|
+
const info = statSync(item.dir);
|
|
12117
12378
|
return {
|
|
12118
|
-
name:
|
|
12379
|
+
name: item.name,
|
|
12380
|
+
year: item.year,
|
|
12381
|
+
relPath: item.relPath,
|
|
12119
12382
|
mtime: info.mtime.toISOString(),
|
|
12120
12383
|
developers,
|
|
12121
|
-
hasPrd: external_node_fs_existsSync(external_node_path_join(
|
|
12384
|
+
hasPrd: external_node_fs_existsSync(external_node_path_join(item.dir, "_prd", "meta.json"))
|
|
12122
12385
|
};
|
|
12123
|
-
}).filter((entry)=>entry.developers.length > 0).sort((left, right)=>right.mtime.localeCompare(left.mtime));
|
|
12386
|
+
}).filter((entry)=>entry.developers.length > 0).sort((left, right)=>left.year === right.year ? right.mtime.localeCompare(left.mtime) : right.year - left.year);
|
|
12124
12387
|
return {
|
|
12125
12388
|
...base,
|
|
12126
12389
|
accessible: true,
|
|
@@ -12418,12 +12681,37 @@ function parseMarkdownDoc(markdown, schema) {
|
|
|
12418
12681
|
function readMarkdown(target) {
|
|
12419
12682
|
return readFileSync(target, "utf8");
|
|
12420
12683
|
}
|
|
12421
|
-
function
|
|
12684
|
+
function resolveIterationForRead(layout, iteration, source, presetRef, refName) {
|
|
12422
12685
|
const safeIteration = iterations_safeSegment(iteration, "迭代目录");
|
|
12686
|
+
if ("remote" === source) {
|
|
12687
|
+
const ref = presetRef ?? resolveRemoteRef(layout.root, refName);
|
|
12688
|
+
const snapshot = listRemoteIterations(layout, ref);
|
|
12689
|
+
const { year, name } = parseIterationRef(safeIteration);
|
|
12690
|
+
const scoped = null === year ? snapshot.iterations : snapshot.iterations.filter((item)=>item.year === year);
|
|
12691
|
+
const hits = scoped.filter((item)=>item.name === name);
|
|
12692
|
+
if (hits.length > 1) {
|
|
12693
|
+
const listed = hits.map((item)=>item.relPath).sort().join("、");
|
|
12694
|
+
throw new errors_CliError(`迭代名在多个年份下重复:${name}(${listed})。请用「年份/迭代名」显式指定`, errors_EXIT.USAGE);
|
|
12695
|
+
}
|
|
12696
|
+
const hit = hits[0];
|
|
12697
|
+
if (void 0 === hit) throw new errors_CliError(`远程快照中不存在迭代:${safeIteration}`, errors_EXIT.NOT_FOUND);
|
|
12698
|
+
return {
|
|
12699
|
+
name: hit.name,
|
|
12700
|
+
year: hit.year,
|
|
12701
|
+
dir: "",
|
|
12702
|
+
relPath: hit.relPath
|
|
12703
|
+
};
|
|
12704
|
+
}
|
|
12705
|
+
return resolveIterationDir(layout.root, layout.iterationsRoot, safeIteration);
|
|
12706
|
+
}
|
|
12707
|
+
function readIterationDoc(layout, iteration, developer, source = "local", presetRef, refName) {
|
|
12708
|
+
const docsRoot = layout.root;
|
|
12423
12709
|
const safeDeveloper = iterations_safeSegment(developer, "开发者标识");
|
|
12710
|
+
const resolved = resolveIterationForRead(layout, iteration, source, presetRef, refName);
|
|
12711
|
+
const safeIteration = resolved.name;
|
|
12424
12712
|
if ("remote" === source) {
|
|
12425
12713
|
const ref = presetRef ?? resolveRemoteRef(docsRoot, refName);
|
|
12426
|
-
const exported = exportRemoteDoc(docsRoot, ref, safeIteration, safeDeveloper);
|
|
12714
|
+
const exported = exportRemoteDoc(docsRoot, ref, resolved.year, safeIteration, safeDeveloper, layout.iterationsRoot);
|
|
12427
12715
|
const roleInferred = inferRole(exported.markdown);
|
|
12428
12716
|
const scripted = runValidator({
|
|
12429
12717
|
docsRoot: exported.dir,
|
|
@@ -12435,7 +12723,7 @@ function readIterationDoc(docsRoot, iteration, developer, source = "local", pres
|
|
|
12435
12723
|
return {
|
|
12436
12724
|
iteration: safeIteration,
|
|
12437
12725
|
developer: safeDeveloper,
|
|
12438
|
-
file: `${
|
|
12726
|
+
file: `${resolved.relPath}/${safeDeveloper}.md`,
|
|
12439
12727
|
mtime: exported.mtime,
|
|
12440
12728
|
roleInferred,
|
|
12441
12729
|
parser: null === scripted.payload ? "fallback" : "script",
|
|
@@ -12449,16 +12737,16 @@ function readIterationDoc(docsRoot, iteration, developer, source = "local", pres
|
|
|
12449
12737
|
details: splitDetails(exported.markdown)
|
|
12450
12738
|
};
|
|
12451
12739
|
}
|
|
12452
|
-
const directory =
|
|
12453
|
-
if (!external_node_fs_existsSync(directory)) throw new errors_CliError(`迭代目录不存在:${
|
|
12740
|
+
const directory = resolved.dir;
|
|
12741
|
+
if (!external_node_fs_existsSync(directory)) throw new errors_CliError(`迭代目录不存在:${resolved.relPath}`, errors_EXIT.NOT_FOUND);
|
|
12454
12742
|
const file = joinWithin(directory, `${safeDeveloper}.md`);
|
|
12455
|
-
if (!external_node_fs_existsSync(file)) throw new errors_CliError(`文档不存在:${
|
|
12743
|
+
if (!external_node_fs_existsSync(file)) throw new errors_CliError(`文档不存在:${resolved.relPath}/${safeDeveloper}.md`, errors_EXIT.NOT_FOUND);
|
|
12456
12744
|
const markdown = readMarkdown(file);
|
|
12457
12745
|
const roleInferred = inferRole(markdown);
|
|
12458
12746
|
const scripted = runValidator({
|
|
12459
12747
|
docsRoot,
|
|
12460
12748
|
scriptPath: external_node_path_join(docsRoot, "scripts", "validate_task_doc.py"),
|
|
12461
|
-
iteration:
|
|
12749
|
+
iteration: resolved.relPath,
|
|
12462
12750
|
developer: safeDeveloper,
|
|
12463
12751
|
role: roleInferred
|
|
12464
12752
|
});
|
|
@@ -12478,24 +12766,26 @@ function readIterationDoc(docsRoot, iteration, developer, source = "local", pres
|
|
|
12478
12766
|
details: splitDetails(markdown)
|
|
12479
12767
|
};
|
|
12480
12768
|
}
|
|
12481
|
-
function readIterationSummary(
|
|
12482
|
-
const
|
|
12769
|
+
function readIterationSummary(layout, iteration, source = "local", refName) {
|
|
12770
|
+
const docsRoot = layout.root;
|
|
12483
12771
|
const remoteRef = "remote" === source ? resolveRemoteRef(docsRoot, refName) : null;
|
|
12772
|
+
const resolved = resolveIterationForRead(layout, iteration, source, remoteRef ?? void 0, refName);
|
|
12773
|
+
const safeIteration = resolved.name;
|
|
12484
12774
|
let developers;
|
|
12485
12775
|
if (null === remoteRef) {
|
|
12486
|
-
const directory =
|
|
12487
|
-
if (!external_node_fs_existsSync(directory)) throw new errors_CliError(`迭代目录不存在:${
|
|
12776
|
+
const directory = resolved.dir;
|
|
12777
|
+
if (!external_node_fs_existsSync(directory)) throw new errors_CliError(`迭代目录不存在:${resolved.relPath}`, errors_EXIT.NOT_FOUND);
|
|
12488
12778
|
developers = listMarkdownFiles(directory);
|
|
12489
12779
|
} else {
|
|
12490
|
-
const snapshot = listRemoteIterations(
|
|
12491
|
-
const found = snapshot.iterations.find((item)=>item.name === safeIteration);
|
|
12492
|
-
if (void 0 === found) throw new errors_CliError(`远程快照中不存在迭代:${
|
|
12780
|
+
const snapshot = listRemoteIterations(layout, remoteRef);
|
|
12781
|
+
const found = snapshot.iterations.find((item)=>item.year === resolved.year && item.name === safeIteration);
|
|
12782
|
+
if (void 0 === found) throw new errors_CliError(`远程快照中不存在迭代:${resolved.relPath}`, errors_EXIT.NOT_FOUND);
|
|
12493
12783
|
developers = found.developers;
|
|
12494
12784
|
}
|
|
12495
12785
|
const summaries = [];
|
|
12496
12786
|
const blocked = [];
|
|
12497
12787
|
for (const entry of developers){
|
|
12498
|
-
const doc = readIterationDoc(
|
|
12788
|
+
const doc = readIterationDoc(layout, resolved.relPath, entry.id, source, remoteRef ?? void 0);
|
|
12499
12789
|
const statusCounts = {};
|
|
12500
12790
|
const selfTestCounts = {};
|
|
12501
12791
|
const acceptanceCounts = {};
|
|
@@ -12583,8 +12873,9 @@ function readIterationSummary(docsRoot, iteration, source = "local", refName) {
|
|
|
12583
12873
|
};
|
|
12584
12874
|
}
|
|
12585
12875
|
function checkDocTaskSides(options) {
|
|
12586
|
-
const
|
|
12587
|
-
|
|
12876
|
+
const resolved = resolveIterationDir(options.docsRoot, options.iterationsRoot, options.iteration);
|
|
12877
|
+
const file = external_node_path_join(resolved.dir, `${options.developer}.md`);
|
|
12878
|
+
if (!external_node_fs_existsSync(file)) throw new errors_CliError(`文档不存在:${resolved.relPath}/${options.developer}.md`, errors_EXIT.NOT_FOUND);
|
|
12588
12879
|
const markdown = readFileSync(file, 'utf8');
|
|
12589
12880
|
const schema = loadDocSchema(options.docsRoot);
|
|
12590
12881
|
const payload = parseMarkdownDoc(markdown, schema);
|
|
@@ -12597,7 +12888,7 @@ function checkDocTaskSides(options) {
|
|
|
12597
12888
|
}))
|
|
12598
12889
|
});
|
|
12599
12890
|
}
|
|
12600
|
-
const taskdoc_SAFE_SEGMENT = /^[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
12891
|
+
const taskdoc_SAFE_SEGMENT = /^(?:\d{4}\/)?[A-Za-z0-9._\-\u4e00-\u9fa5]+$/;
|
|
12601
12892
|
function taskdoc_safeSegment(value, label) {
|
|
12602
12893
|
const trimmed = value.trim();
|
|
12603
12894
|
if (!taskdoc_SAFE_SEGMENT.test(trimmed) || '.' === trimmed || '..' === trimmed) throw new errors_CliError(`${label} 不合法:${value}`, errors_EXIT.USAGE);
|
|
@@ -12681,7 +12972,7 @@ function commitInDocsRepo(docsRoot, file, message, push) {
|
|
|
12681
12972
|
realFile = realpathSync(item);
|
|
12682
12973
|
} catch {}
|
|
12683
12974
|
const relativePath = external_node_path_relative(realRoot, realFile);
|
|
12684
|
-
if (relativePath.startsWith('..') ||
|
|
12975
|
+
if (relativePath.startsWith('..') || external_node_path_isAbsolute(relativePath)) return {
|
|
12685
12976
|
committed: false,
|
|
12686
12977
|
pushed: false,
|
|
12687
12978
|
message: '目标文件不在文档仓库内,已跳过提交'
|
|
@@ -12904,19 +13195,24 @@ function updateDetailBlock(lines, taskId, updates) {
|
|
|
12904
13195
|
}
|
|
12905
13196
|
return next;
|
|
12906
13197
|
}
|
|
12907
|
-
function
|
|
12908
|
-
|
|
12909
|
-
|
|
12910
|
-
|
|
12911
|
-
}
|
|
12912
|
-
return iteration;
|
|
12913
|
-
}
|
|
13198
|
+
function toLayout(locator) {
|
|
13199
|
+
return {
|
|
13200
|
+
root: locator.docsRoot,
|
|
13201
|
+
iterationsRoot: locator.iterationsRoot
|
|
13202
|
+
};
|
|
12914
13203
|
}
|
|
12915
|
-
function
|
|
12916
|
-
const
|
|
13204
|
+
function locateForWrite(locator, iterationRaw) {
|
|
13205
|
+
const resolved = requireIterationDir(locator.docsRoot, locator.iterationsRoot, taskdoc_safeSegment(iterationRaw, '迭代目录'));
|
|
13206
|
+
return {
|
|
13207
|
+
dir: resolved.dir,
|
|
13208
|
+
relPath: resolved.relPath
|
|
13209
|
+
};
|
|
13210
|
+
}
|
|
13211
|
+
function loadDoc(locator, iterationRaw, developerRaw) {
|
|
13212
|
+
const { dir, relPath } = locateForWrite(locator, iterationRaw);
|
|
12917
13213
|
const developer = taskdoc_safeSegment(developerRaw, '开发者标识');
|
|
12918
|
-
const file = external_node_path_join(
|
|
12919
|
-
if (!external_node_fs_existsSync(file)) throw new errors_CliError(`文档不存在:${
|
|
13214
|
+
const file = external_node_path_join(dir, `${developer}.md`);
|
|
13215
|
+
if (!external_node_fs_existsSync(file)) throw new errors_CliError(`文档不存在:${relPath}/${developer}.md`, errors_EXIT.NOT_FOUND);
|
|
12920
13216
|
const mtime = statSync(file).mtimeMs;
|
|
12921
13217
|
const original = readFileSync(file, 'utf8');
|
|
12922
13218
|
return {
|
|
@@ -12985,8 +13281,46 @@ function computeUpdate(lines, taskId, action, keys, docsRoot) {
|
|
|
12985
13281
|
changes
|
|
12986
13282
|
};
|
|
12987
13283
|
}
|
|
12988
|
-
function
|
|
13284
|
+
function syncRequirementAggregates(docsRoot, lines, keys, stamp) {
|
|
13285
|
+
try {
|
|
13286
|
+
const schema = loadDocSchema(docsRoot);
|
|
13287
|
+
const { rows } = parseTaskRows(lines, keys);
|
|
13288
|
+
const statusesByCode = new Map();
|
|
13289
|
+
for (const row of rows){
|
|
13290
|
+
const list = statusesByCode.get(row.requirementId) ?? [];
|
|
13291
|
+
statusesByCode.set(row.requirementId, [
|
|
13292
|
+
...list,
|
|
13293
|
+
row.status
|
|
13294
|
+
]);
|
|
13295
|
+
}
|
|
13296
|
+
const aggregates = resolveAggregates(docsRoot, statusesByCode);
|
|
13297
|
+
const byStatuses = new Map();
|
|
13298
|
+
for (const [code, statuses] of statusesByCode){
|
|
13299
|
+
const value = aggregates.get(code);
|
|
13300
|
+
if (void 0 !== value) byStatuses.set(statuses.join('\u0000'), value);
|
|
13301
|
+
}
|
|
13302
|
+
return refreshRequirementRows({
|
|
13303
|
+
lines,
|
|
13304
|
+
schema,
|
|
13305
|
+
statusesByCode,
|
|
13306
|
+
stamp,
|
|
13307
|
+
aggregate: (statuses)=>byStatuses.get(statuses.join('\u0000')) ?? aggregateRequirement(statuses)
|
|
13308
|
+
});
|
|
13309
|
+
} catch {
|
|
13310
|
+
return {
|
|
13311
|
+
lines,
|
|
13312
|
+
changes: []
|
|
13313
|
+
};
|
|
13314
|
+
}
|
|
13315
|
+
}
|
|
13316
|
+
function commit(context, lines, changes, message, iteration, developer, action, taskIds, options) {
|
|
12989
13317
|
if (statSync(context.file).mtimeMs !== context.mtime) throw new errors_CliError('文件已被外部修改,请刷新后重试', errors_EXIT.INVALID);
|
|
13318
|
+
const synced = syncRequirementAggregates(options.docsRoot, lines, buildKeys(loadDocSchema(options.docsRoot)), nowStamp());
|
|
13319
|
+
lines = synced.lines;
|
|
13320
|
+
changes = [
|
|
13321
|
+
...changes,
|
|
13322
|
+
...synced.changes
|
|
13323
|
+
];
|
|
12990
13324
|
const output = lines.join('\n');
|
|
12991
13325
|
if (output === context.original) return {
|
|
12992
13326
|
ok: true,
|
|
@@ -12995,7 +13329,7 @@ function commit(context, lines, changes, message, iteration, developer, action,
|
|
|
12995
13329
|
file: context.file
|
|
12996
13330
|
};
|
|
12997
13331
|
writeFileSync(context.file, output, 'utf8');
|
|
12998
|
-
const outcome = validateAfterWrite(options
|
|
13332
|
+
const outcome = validateAfterWrite(toLayout(options), iteration, developer);
|
|
12999
13333
|
if ('violation' === outcome.kind) {
|
|
13000
13334
|
writeFileSync(context.file, context.original, 'utf8');
|
|
13001
13335
|
throw new errors_CliError(`写入被校验器拒绝,已回滚:${outcome.message}`, errors_EXIT.INVALID);
|
|
@@ -13064,7 +13398,7 @@ function applyTaskDetail(options) {
|
|
|
13064
13398
|
assertWritableBranch(options.docsRoot);
|
|
13065
13399
|
const schema = loadDocSchema(options.docsRoot);
|
|
13066
13400
|
const keys = buildKeys(schema);
|
|
13067
|
-
const context = loadDoc(options
|
|
13401
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13068
13402
|
const { header, rows } = parseTaskRows(context.lines, keys);
|
|
13069
13403
|
const target = rows.find((row)=>row.taskId === options.taskId);
|
|
13070
13404
|
if (void 0 === target) throw new errors_CliError(`任务清单中未找到 ${options.taskId}`, errors_EXIT.NOT_FOUND);
|
|
@@ -13127,6 +13461,7 @@ function applyTaskDetail(options) {
|
|
|
13127
13461
|
options.taskId
|
|
13128
13462
|
], {
|
|
13129
13463
|
docsRoot: options.docsRoot,
|
|
13464
|
+
iterationsRoot: options.iterationsRoot,
|
|
13130
13465
|
policy: options.policy,
|
|
13131
13466
|
commitMessage: `docs(${options.iteration}): 更新任务详情 ${options.taskId}(${touched.join('、')})`
|
|
13132
13467
|
});
|
|
@@ -13135,7 +13470,7 @@ function applySelfTest(options) {
|
|
|
13135
13470
|
assertWritableBranch(options.docsRoot);
|
|
13136
13471
|
const schema = loadDocSchema(options.docsRoot);
|
|
13137
13472
|
const keys = buildKeys(schema);
|
|
13138
|
-
const context = loadDoc(options
|
|
13473
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13139
13474
|
const { header, rows } = parseTaskRows(context.lines, keys);
|
|
13140
13475
|
const target = rows.find((row)=>row.taskId === options.taskId);
|
|
13141
13476
|
if (void 0 === target) throw new errors_CliError(`任务清单中未找到 ${options.taskId}`, errors_EXIT.NOT_FOUND);
|
|
@@ -13174,6 +13509,7 @@ function applySelfTest(options) {
|
|
|
13174
13509
|
options.taskId
|
|
13175
13510
|
], {
|
|
13176
13511
|
docsRoot: options.docsRoot,
|
|
13512
|
+
iterationsRoot: options.iterationsRoot,
|
|
13177
13513
|
policy: options.policy,
|
|
13178
13514
|
commitMessage: `docs(${options.iteration}): 记录自测 ${options.taskId}(${value})`
|
|
13179
13515
|
});
|
|
@@ -13182,7 +13518,7 @@ function applyBatchAction(options) {
|
|
|
13182
13518
|
if (0 === options.taskIds.length) throw new errors_CliError('未选择任务', errors_EXIT.USAGE);
|
|
13183
13519
|
assertWritableBranch(options.docsRoot);
|
|
13184
13520
|
const keys = buildKeys(loadDocSchema(options.docsRoot));
|
|
13185
|
-
const context = loadDoc(options
|
|
13521
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13186
13522
|
let lines = context.lines;
|
|
13187
13523
|
const changes = [];
|
|
13188
13524
|
for (const taskId of options.taskIds){
|
|
@@ -13192,6 +13528,7 @@ function applyBatchAction(options) {
|
|
|
13192
13528
|
}
|
|
13193
13529
|
return commit(context, lines, changes, `已对 ${options.taskIds.length} 个任务执行「${ACTION_META[options.action].label}」`, taskdoc_safeSegment(options.iteration, '迭代目录'), taskdoc_safeSegment(options.developer, '开发者标识'), options.action, options.taskIds, {
|
|
13194
13530
|
docsRoot: options.docsRoot,
|
|
13531
|
+
iterationsRoot: options.iterationsRoot,
|
|
13195
13532
|
policy: options.policy,
|
|
13196
13533
|
commitMessage: buildCommitMessage(options.iteration, options.action, options.taskIds, options.action)
|
|
13197
13534
|
});
|
|
@@ -13199,25 +13536,28 @@ function applyBatchAction(options) {
|
|
|
13199
13536
|
function applyTaskAction(options) {
|
|
13200
13537
|
assertWritableBranch(options.docsRoot);
|
|
13201
13538
|
const keys = buildKeys(loadDocSchema(options.docsRoot));
|
|
13202
|
-
const context = loadDoc(options
|
|
13539
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13203
13540
|
const result = computeUpdate(context.lines, options.taskId, options.action, keys, options.docsRoot);
|
|
13204
13541
|
return commit(context, result.lines, result.changes, `已执行「${ACTION_META[options.action].label}」`, taskdoc_safeSegment(options.iteration, '迭代目录'), taskdoc_safeSegment(options.developer, '开发者标识'), options.action, [
|
|
13205
13542
|
options.taskId
|
|
13206
13543
|
], {
|
|
13207
13544
|
docsRoot: options.docsRoot,
|
|
13545
|
+
iterationsRoot: options.iterationsRoot,
|
|
13208
13546
|
policy: options.policy,
|
|
13209
13547
|
commitMessage: buildCommitMessage(options.iteration, options.action, [
|
|
13210
13548
|
options.taskId
|
|
13211
13549
|
], options.action)
|
|
13212
13550
|
});
|
|
13213
13551
|
}
|
|
13214
|
-
function validateAfterWrite(
|
|
13552
|
+
function validateAfterWrite(layout, iteration, developer) {
|
|
13553
|
+
const docsRoot = layout.root;
|
|
13215
13554
|
const script = external_node_path_join(docsRoot, "scripts", 'validate_task_doc.py');
|
|
13216
13555
|
if (!external_node_fs_existsSync(script)) return {
|
|
13217
13556
|
kind: 'unavailable',
|
|
13218
13557
|
reason: `文档仓库缺少校验脚本 ${script}`
|
|
13219
13558
|
};
|
|
13220
|
-
const
|
|
13559
|
+
const resolved = resolveIterationDir(docsRoot, layout.iterationsRoot, iteration);
|
|
13560
|
+
const targetFile = external_node_path_join(resolved.dir, `${developer}.md`);
|
|
13221
13561
|
let role = 'frontend';
|
|
13222
13562
|
if (external_node_fs_existsSync(targetFile)) try {
|
|
13223
13563
|
role = inferRole(readFileSync(targetFile, 'utf8'));
|
|
@@ -13229,7 +13569,7 @@ function validateAfterWrite(docsRoot, iteration, developer) {
|
|
|
13229
13569
|
'--docs-root',
|
|
13230
13570
|
docsRoot,
|
|
13231
13571
|
'--iteration',
|
|
13232
|
-
|
|
13572
|
+
resolved.relPath,
|
|
13233
13573
|
'--developer',
|
|
13234
13574
|
developer,
|
|
13235
13575
|
'--role',
|
|
@@ -13295,7 +13635,7 @@ function validateAfterWrite(docsRoot, iteration, developer) {
|
|
|
13295
13635
|
}
|
|
13296
13636
|
function requireValidatorScript() {
|
|
13297
13637
|
try {
|
|
13298
|
-
const config =
|
|
13638
|
+
const config = config_loadConfig().config;
|
|
13299
13639
|
if (null === config) return true;
|
|
13300
13640
|
return config.docs.validator.requireScript;
|
|
13301
13641
|
} catch {
|
|
@@ -13305,7 +13645,7 @@ function requireValidatorScript() {
|
|
|
13305
13645
|
function applyRequirementNote(options) {
|
|
13306
13646
|
assertWritableBranch(options.docsRoot);
|
|
13307
13647
|
const keys = buildKeys(loadDocSchema(options.docsRoot));
|
|
13308
|
-
const context = loadDoc(options
|
|
13648
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13309
13649
|
const requirementId = options.requirementId.trim().replace(/^#?/, '#');
|
|
13310
13650
|
const requirementParse = parseRequirementRows(context.lines, keys);
|
|
13311
13651
|
const target = requirementParse.rows.find((row)=>row.id === requirementId);
|
|
@@ -13336,6 +13676,7 @@ function applyRequirementNote(options) {
|
|
|
13336
13676
|
requirementId
|
|
13337
13677
|
], {
|
|
13338
13678
|
docsRoot: options.docsRoot,
|
|
13679
|
+
iterationsRoot: options.iterationsRoot,
|
|
13339
13680
|
policy: options.policy,
|
|
13340
13681
|
commitMessage: `docs(${options.iteration}): 更新需求备注 ${requirementId}`
|
|
13341
13682
|
});
|
|
@@ -13343,7 +13684,7 @@ function applyRequirementNote(options) {
|
|
|
13343
13684
|
function recalcRequirements(options) {
|
|
13344
13685
|
assertWritableBranch(options.docsRoot);
|
|
13345
13686
|
const keys = buildKeys(loadDocSchema(options.docsRoot));
|
|
13346
|
-
const context = loadDoc(options
|
|
13687
|
+
const context = loadDoc(options, options.iteration, options.developer);
|
|
13347
13688
|
const { rows: taskRows } = parseTaskRows(context.lines, keys);
|
|
13348
13689
|
const requirementParse = parseRequirementRows(context.lines, keys);
|
|
13349
13690
|
const lines = [
|
|
@@ -13382,6 +13723,7 @@ function recalcRequirements(options) {
|
|
|
13382
13723
|
changes,
|
|
13383
13724
|
file: commit(context, lines, changes, `已重算 ${requirementParse.rows.length} 个需求的状态与进度`, taskdoc_safeSegment(options.iteration, '迭代目录'), taskdoc_safeSegment(options.developer, '开发者标识'), 'start', [], {
|
|
13384
13725
|
docsRoot: options.docsRoot,
|
|
13726
|
+
iterationsRoot: options.iterationsRoot,
|
|
13385
13727
|
policy: {
|
|
13386
13728
|
commit: false,
|
|
13387
13729
|
push: false
|
|
@@ -13391,9 +13733,14 @@ function recalcRequirements(options) {
|
|
|
13391
13733
|
};
|
|
13392
13734
|
}
|
|
13393
13735
|
function availableActions(options) {
|
|
13394
|
-
const iteration = taskdoc_safeSegment(options.iteration, '迭代目录');
|
|
13395
13736
|
const developer = taskdoc_safeSegment(options.developer, '开发者标识');
|
|
13396
|
-
|
|
13737
|
+
let dir;
|
|
13738
|
+
try {
|
|
13739
|
+
dir = resolveIterationDir(options.docsRoot, options.iterationsRoot, taskdoc_safeSegment(options.iteration, '迭代目录')).dir;
|
|
13740
|
+
} catch {
|
|
13741
|
+
return {};
|
|
13742
|
+
}
|
|
13743
|
+
const file = external_node_path_join(dir, `${developer}.md`);
|
|
13397
13744
|
if (!external_node_fs_existsSync(file)) return {};
|
|
13398
13745
|
const lines = readFileSync(file, 'utf8').split('\n');
|
|
13399
13746
|
const { rows } = parseTaskRows(lines, buildKeys(loadDocSchema(options.docsRoot)));
|
|
@@ -13518,7 +13865,7 @@ function migrateTaskTable(options) {
|
|
|
13518
13865
|
let added = 0;
|
|
13519
13866
|
const idIndex = header.indexOf('任务编号');
|
|
13520
13867
|
const typeIndex = header.indexOf('任务类型');
|
|
13521
|
-
const terminalIndex = header.indexOf('
|
|
13868
|
+
const terminalIndex = header.indexOf('执行终端');
|
|
13522
13869
|
for(let index = headerIndex + 2; index < table.end; index += 1){
|
|
13523
13870
|
const cells = doc_migrate_splitRow(options.lines[index] ?? '');
|
|
13524
13871
|
if (null === cells || isSeparator(cells)) continue;
|
|
@@ -13642,10 +13989,11 @@ function makeTerminalResolver(terminals) {
|
|
|
13642
13989
|
}
|
|
13643
13990
|
function runDocMigrate(options) {
|
|
13644
13991
|
const format = parseFormat(options.format);
|
|
13645
|
-
const loaded =
|
|
13992
|
+
const loaded = config_loadConfig(options.config);
|
|
13646
13993
|
if (!loaded.exists || null === loaded.config) throw new errors_CliError(`配置未初始化:${loaded.path}\n请先运行:ylcwf init`, errors_EXIT.NOT_FOUND);
|
|
13647
13994
|
const config = loaded.config;
|
|
13648
13995
|
const docsRoot = config.docs.root;
|
|
13996
|
+
const layout = layoutOf(config);
|
|
13649
13997
|
if (true !== options.dryRun) assertWritableBranch(docsRoot);
|
|
13650
13998
|
const schema = loadDocSchema(docsRoot);
|
|
13651
13999
|
const resolveScopeFromTerminal = makeTerminalResolver(config.terminals);
|
|
@@ -13690,7 +14038,7 @@ function runDocMigrate(options) {
|
|
|
13690
14038
|
changedFiles.push(target);
|
|
13691
14039
|
if (migrated.unresolved.length > 0) continue;
|
|
13692
14040
|
const developer = basename(name, '.md');
|
|
13693
|
-
const outcome = validateAfterWrite(
|
|
14041
|
+
const outcome = validateAfterWrite(layout, iteration, developer);
|
|
13694
14042
|
if ('passed' !== outcome.kind) {
|
|
13695
14043
|
writeFileSync(target, original, 'utf8');
|
|
13696
14044
|
const reason = 'violation' === outcome.kind ? outcome.message : outcome.reason;
|
|
@@ -13719,7 +14067,7 @@ function runDocMigrate(options) {
|
|
|
13719
14067
|
printLine(` · ${item.file} ${parts.join(' + ')}${extra}`);
|
|
13720
14068
|
}
|
|
13721
14069
|
if (totalUnresolved.length > 0) {
|
|
13722
|
-
printLine('\n
|
|
14070
|
+
printLine('\n以下任务的「所属端」无法自动判定(执行终端未配置或类型两端通用),请手工补齐:');
|
|
13723
14071
|
printLine(` ${totalUnresolved.join('、')}`);
|
|
13724
14072
|
printLine('补齐后运行校验:');
|
|
13725
14073
|
printLine(" python3 <文档仓库>/scripts/validate_task_doc.py --docs-root <文档仓库> \\");
|
|
@@ -13771,24 +14119,22 @@ function readPlanFile(path) {
|
|
|
13771
14119
|
throw new errors_CliError(`plan 文件不是合法 JSON:${error instanceof Error ? error.message : String(error)}`, errors_EXIT.INVALID);
|
|
13772
14120
|
}
|
|
13773
14121
|
}
|
|
13774
|
-
function doc_realIterationName(docsRoot, iteration) {
|
|
13775
|
-
const direct = external_node_path_join(docsRoot, iteration);
|
|
13776
|
-
external_node_fs_existsSync(direct);
|
|
13777
|
-
return iteration;
|
|
13778
|
-
}
|
|
13779
14122
|
function runDocApply(options, mode = 'apply') {
|
|
13780
14123
|
const format = parseFormat(options.format);
|
|
13781
|
-
const loaded =
|
|
14124
|
+
const loaded = config_loadConfig(options.config);
|
|
13782
14125
|
if (!loaded.exists || null === loaded.config) throw new errors_CliError(`配置未初始化:${loaded.path}\n请先运行:ylcwf init`, errors_EXIT.NOT_FOUND);
|
|
13783
14126
|
const config = loaded.config;
|
|
13784
14127
|
const docsRoot = config.docs.root;
|
|
14128
|
+
const layout = layoutOf(config);
|
|
13785
14129
|
const developer = config.profile.developer;
|
|
13786
14130
|
const role = config.profile.role;
|
|
13787
|
-
const
|
|
13788
|
-
if (0 ===
|
|
14131
|
+
const requested = options.iteration.trim();
|
|
14132
|
+
if (0 === requested.length) throw new errors_CliError('必须指定迭代目录:--iteration <迭代>', errors_EXIT.USAGE);
|
|
14133
|
+
const resolvedIteration = requireIterationDir(docsRoot, layout.iterationsRoot, requested);
|
|
14134
|
+
const iteration = resolvedIteration.name;
|
|
13789
14135
|
const schema = loadDocSchema(docsRoot);
|
|
13790
14136
|
const plan = parseDocPlan(readPlanFile(options.input), schema, role);
|
|
13791
|
-
const targetDir =
|
|
14137
|
+
const targetDir = resolvedIteration.dir;
|
|
13792
14138
|
const targetFile = external_node_path_join(targetDir, `${developer}.md`);
|
|
13793
14139
|
const exists = external_node_fs_existsSync(targetFile);
|
|
13794
14140
|
const original = exists ? readFileSync(targetFile, 'utf8') : null;
|
|
@@ -13853,8 +14199,8 @@ function runDocApply(options, mode = 'apply') {
|
|
|
13853
14199
|
})
|
|
13854
14200
|
});
|
|
13855
14201
|
const conflicts = sideReport.issues.filter((issue)=>'error' === issue.level);
|
|
13856
|
-
if (conflicts.length > 0) throw new errors_CliError(
|
|
13857
|
-
const sideSkippedNote = sideReport.skipped > 0 ?
|
|
14202
|
+
if (conflicts.length > 0) throw new errors_CliError(`任务类型与执行终端归属不一致,已中止:\n${conflicts.map((issue)=>` · ${issue.message}`).join('\n')}`, errors_EXIT.INVALID);
|
|
14203
|
+
const sideSkippedNote = sideReport.skipped > 0 ? `本机执行终端配置未覆盖 ${sideReport.skipped} 个任务,其「所属端 vs 仓库」未校验` + (0 === Object.keys(config.terminals).length ? '(terminals 为空)' : '') : null;
|
|
13858
14204
|
if (0 === rendered.assigned.length && rendered.markdown === original) {
|
|
13859
14205
|
if ('json' === format) printJson({
|
|
13860
14206
|
ok: true,
|
|
@@ -13890,7 +14236,7 @@ function runDocApply(options, mode = 'apply') {
|
|
|
13890
14236
|
recursive: true
|
|
13891
14237
|
});
|
|
13892
14238
|
writeFileSync(targetFile, rendered.markdown, 'utf8');
|
|
13893
|
-
const outcome = validateAfterWrite(
|
|
14239
|
+
const outcome = validateAfterWrite(layout, iteration, developer);
|
|
13894
14240
|
const rollback = (message)=>{
|
|
13895
14241
|
if (null === original) unlinkSync(targetFile);
|
|
13896
14242
|
else writeFileSync(targetFile, original, 'utf8');
|
|
@@ -13903,6 +14249,7 @@ function runDocApply(options, mode = 'apply') {
|
|
|
13903
14249
|
}
|
|
13904
14250
|
const remainingReport = checkDocTaskSides({
|
|
13905
14251
|
docsRoot,
|
|
14252
|
+
iterationsRoot: layout.iterationsRoot,
|
|
13906
14253
|
iteration,
|
|
13907
14254
|
developer,
|
|
13908
14255
|
role,
|
|
@@ -13930,7 +14277,7 @@ function runDocApply(options, mode = 'apply') {
|
|
|
13930
14277
|
for (const change of rendered.changes)printLine(` · ${change}`);
|
|
13931
14278
|
if (null !== sideSkippedNote) printLine(`\n! ${sideSkippedNote}`);
|
|
13932
14279
|
if (remaining.length > 0) {
|
|
13933
|
-
printLine('\n
|
|
14280
|
+
printLine('\n注意:以下任务的类型与执行终端归属不一致(请核对):');
|
|
13934
14281
|
for (const issue of remaining)printLine(` · ${issue.message}`);
|
|
13935
14282
|
}
|
|
13936
14283
|
if (void 0 !== git) printLine(`\n${git.message}`);
|
|
@@ -13967,6 +14314,7 @@ function requireWriteContext(options) {
|
|
|
13967
14314
|
if (policy.push) policy.commit = true;
|
|
13968
14315
|
return {
|
|
13969
14316
|
docsRoot: config.docs.root,
|
|
14317
|
+
layout: layoutOf(config),
|
|
13970
14318
|
developer: resolveDeveloper(options, config.profile.developer),
|
|
13971
14319
|
policy
|
|
13972
14320
|
};
|
|
@@ -13979,42 +14327,56 @@ function requireQueryContext(options) {
|
|
|
13979
14327
|
if (0 === docsRoot.length) throw new errors_CliError('未配置文档仓库:请先设置 docs.root', errors_EXIT.NOT_FOUND);
|
|
13980
14328
|
return {
|
|
13981
14329
|
config: ready.config,
|
|
14330
|
+
layout: layoutOf(ready.config),
|
|
13982
14331
|
docsRoot,
|
|
13983
14332
|
developer: ready.config.profile.developer,
|
|
13984
14333
|
format
|
|
13985
14334
|
};
|
|
13986
14335
|
}
|
|
13987
|
-
function resolveIteration(options,
|
|
14336
|
+
function resolveIteration(options, layout, available, hints = {}) {
|
|
14337
|
+
const docsRoot = layout.root;
|
|
13988
14338
|
const explicit = options.iteration?.trim();
|
|
13989
14339
|
if (void 0 !== explicit && explicit.length > 0) {
|
|
13990
|
-
const
|
|
14340
|
+
const match = (item)=>item.relPath.toLowerCase() === explicit.toLowerCase();
|
|
14341
|
+
const exact = available.find((item)=>item.name === explicit) ?? available.find(match);
|
|
13991
14342
|
if (void 0 !== exact) return {
|
|
13992
14343
|
name: exact.name,
|
|
14344
|
+
relPath: exact.relPath,
|
|
13993
14345
|
source: 'explicit'
|
|
13994
14346
|
};
|
|
13995
14347
|
const loose = available.find((item)=>item.name.toLowerCase() === explicit.toLowerCase());
|
|
13996
14348
|
if (void 0 !== loose) return {
|
|
13997
14349
|
name: loose.name,
|
|
14350
|
+
relPath: loose.relPath,
|
|
13998
14351
|
source: 'explicit'
|
|
13999
14352
|
};
|
|
14000
|
-
|
|
14353
|
+
const listed = available.map((item)=>item.relPath).join('、') || '(无)';
|
|
14354
|
+
throw new errors_CliError(`迭代不存在:${explicit}\n可用迭代:${listed}`, errors_EXIT.NOT_FOUND);
|
|
14001
14355
|
}
|
|
14002
14356
|
const key = hints.taskId ?? hints.requirementId;
|
|
14003
14357
|
if (void 0 !== key) {
|
|
14004
|
-
const found = findIterationById(
|
|
14005
|
-
if (null !== found)
|
|
14006
|
-
name
|
|
14007
|
-
|
|
14008
|
-
|
|
14009
|
-
|
|
14358
|
+
const found = findIterationById(layout, available, key);
|
|
14359
|
+
if (null !== found) {
|
|
14360
|
+
const entry = available.find((item)=>item.name === found);
|
|
14361
|
+
return {
|
|
14362
|
+
name: found,
|
|
14363
|
+
relPath: entry?.relPath ?? found,
|
|
14364
|
+
source: 'id'
|
|
14365
|
+
};
|
|
14366
|
+
}
|
|
14367
|
+
const list = available.map((item)=>item.relPath).join('、') || '(无)';
|
|
14010
14368
|
throw new errors_CliError(`在所有迭代中都未找到 ${key}\n已检索:${list}\n请确认编号是否正确,或用 -i 指定迭代`, errors_EXIT.NOT_FOUND);
|
|
14011
14369
|
}
|
|
14012
14370
|
const byBranch = resolveIterationFromBranch(docsRoot, available.map((item)=>item.name));
|
|
14013
|
-
if (null !== byBranch.iteration)
|
|
14014
|
-
name
|
|
14015
|
-
|
|
14016
|
-
|
|
14017
|
-
|
|
14371
|
+
if (null !== byBranch.iteration) {
|
|
14372
|
+
const entry = available.find((item)=>item.name === byBranch.iteration);
|
|
14373
|
+
return {
|
|
14374
|
+
name: byBranch.iteration,
|
|
14375
|
+
relPath: entry?.relPath ?? byBranch.iteration,
|
|
14376
|
+
source: 'branch',
|
|
14377
|
+
branch: byBranch.branch ?? void 0
|
|
14378
|
+
};
|
|
14379
|
+
}
|
|
14018
14380
|
const cwd = process.cwd();
|
|
14019
14381
|
if (cwd.startsWith(docsRoot)) {
|
|
14020
14382
|
const first = cwd.slice(docsRoot.length).split('/').filter((item)=>item.length > 0)[0];
|
|
@@ -14022,24 +14384,25 @@ function resolveIteration(options, docsRoot, available, hints = {}) {
|
|
|
14022
14384
|
const hit = available.find((item)=>item.name.toLowerCase() === first.toLowerCase());
|
|
14023
14385
|
if (void 0 !== hit) return {
|
|
14024
14386
|
name: hit.name,
|
|
14387
|
+
relPath: hit.relPath,
|
|
14025
14388
|
source: 'cwd'
|
|
14026
14389
|
};
|
|
14027
14390
|
}
|
|
14028
14391
|
}
|
|
14029
|
-
const list = available.map((item)=>item.
|
|
14392
|
+
const list = available.map((item)=>item.relPath).join('、') || '(无)';
|
|
14030
14393
|
const branchHint = byBranch.candidates.length > 0 ? `\n当前分支 ${byBranch.branch ?? ''} 同时匹配多个迭代:${byBranch.candidates.join('、')}` : null !== byBranch.branch ? `\n当前分支 ${byBranch.branch} 未匹配到任何迭代` : '';
|
|
14031
14394
|
throw new errors_CliError(`无法确定迭代目录,请用 -i 指定。${branchHint}\n可用迭代:${list}`, errors_EXIT.NOT_FOUND);
|
|
14032
14395
|
}
|
|
14033
|
-
function resolveIterationName(options,
|
|
14034
|
-
return resolveIteration(options,
|
|
14396
|
+
function resolveIterationName(options, layout, available, hints = {}) {
|
|
14397
|
+
return resolveIteration(options, layout, available, hints).name;
|
|
14035
14398
|
}
|
|
14036
|
-
function findIterationById(
|
|
14399
|
+
function findIterationById(layout, available, id) {
|
|
14037
14400
|
const normalized = id.trim();
|
|
14038
14401
|
if (0 === normalized.length) return null;
|
|
14039
14402
|
const pattern = new RegExp(`^\\|\\s*${normalized.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\s*\\|`, 'm');
|
|
14040
14403
|
const hits = [];
|
|
14041
14404
|
for (const entry of available)for (const developer of entry.developers){
|
|
14042
|
-
const target = external_node_path_resolve(
|
|
14405
|
+
const target = external_node_path_resolve(layout.root, layout.iterationsRoot, entry.relPath, developer.file);
|
|
14043
14406
|
try {
|
|
14044
14407
|
if (pattern.test(readFileSync(target, 'utf8'))) {
|
|
14045
14408
|
hits.push(entry.name);
|
|
@@ -14053,17 +14416,18 @@ function findIterationById(docsRoot, available, id) {
|
|
|
14053
14416
|
if (1 === hits.length) return hits[0] ?? null;
|
|
14054
14417
|
throw new errors_CliError(`编号 ${normalized} 在多个迭代中出现:${hits.join('、')}\n请用 -i 明确指定`, errors_EXIT.USAGE);
|
|
14055
14418
|
}
|
|
14056
|
-
function loadIterations(
|
|
14057
|
-
const listed = listIterations(
|
|
14419
|
+
function loadIterations(layout) {
|
|
14420
|
+
const listed = listIterations(layout, 'local');
|
|
14058
14421
|
if (!listed.accessible) throw new errors_CliError(listed.reason ?? '无法读取文档仓库', errors_EXIT.NOT_FOUND);
|
|
14059
14422
|
return listed.iterations;
|
|
14060
14423
|
}
|
|
14061
|
-
function loadDeveloperDocs(
|
|
14062
|
-
const
|
|
14424
|
+
function loadDeveloperDocs(layout, iteration) {
|
|
14425
|
+
const key = iteration.toLowerCase();
|
|
14426
|
+
const entry = loadIterations(layout).find((item)=>item.name.toLowerCase() === key || item.relPath.toLowerCase() === key);
|
|
14063
14427
|
if (void 0 === entry) throw new errors_CliError(`迭代不存在:${iteration}`, errors_EXIT.NOT_FOUND);
|
|
14064
14428
|
return entry.developers.map((item)=>({
|
|
14065
14429
|
developer: item.id,
|
|
14066
|
-
doc: readIterationDoc(
|
|
14430
|
+
doc: readIterationDoc(layout, entry.relPath, item.id, 'local')
|
|
14067
14431
|
}));
|
|
14068
14432
|
}
|
|
14069
14433
|
function describeIterationSource(resolved) {
|
|
@@ -14199,6 +14563,7 @@ function collectSideIssues(options) {
|
|
|
14199
14563
|
const loaded = requireConfig(options.config);
|
|
14200
14564
|
return checkDocTaskSides({
|
|
14201
14565
|
docsRoot: options.docsRoot,
|
|
14566
|
+
iterationsRoot: options.iterationsRoot,
|
|
14202
14567
|
iteration: options.iteration,
|
|
14203
14568
|
developer: options.developer,
|
|
14204
14569
|
role: loaded.config.profile.role,
|
|
@@ -14209,14 +14574,15 @@ function collectSideIssues(options) {
|
|
|
14209
14574
|
}
|
|
14210
14575
|
}
|
|
14211
14576
|
function runAction(action, taskId, options) {
|
|
14212
|
-
const { docsRoot, developer, policy } = requireWriteContext(options);
|
|
14213
|
-
const iteration = options.iteration?.trim() ? resolveIterationName(options,
|
|
14577
|
+
const { docsRoot, layout, developer, policy } = requireWriteContext(options);
|
|
14578
|
+
const iteration = options.iteration?.trim() ? resolveIterationName(options, layout, loadIterations(layout)) : resolveIterationName(options, layout, loadIterations(layout), {
|
|
14214
14579
|
taskId: taskId.trim().replace(/^#?/, '#')
|
|
14215
14580
|
});
|
|
14216
14581
|
const format = parseFormat(options.format);
|
|
14217
14582
|
if (true === options.dryRun) {
|
|
14218
14583
|
const actions = availableActions({
|
|
14219
14584
|
docsRoot,
|
|
14585
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14220
14586
|
iteration,
|
|
14221
14587
|
developer
|
|
14222
14588
|
});
|
|
@@ -14235,6 +14601,7 @@ function runAction(action, taskId, options) {
|
|
|
14235
14601
|
}
|
|
14236
14602
|
const result = applyTaskAction({
|
|
14237
14603
|
docsRoot,
|
|
14604
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14238
14605
|
iteration,
|
|
14239
14606
|
developer,
|
|
14240
14607
|
taskId,
|
|
@@ -14243,6 +14610,7 @@ function runAction(action, taskId, options) {
|
|
|
14243
14610
|
});
|
|
14244
14611
|
const sideIssues = collectSideIssues({
|
|
14245
14612
|
docsRoot,
|
|
14613
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14246
14614
|
iteration,
|
|
14247
14615
|
developer,
|
|
14248
14616
|
config: options.config
|
|
@@ -14256,7 +14624,7 @@ function runAction(action, taskId, options) {
|
|
|
14256
14624
|
printLine(`文档:${result.file}`);
|
|
14257
14625
|
if (void 0 !== result.git) printLine(`git:${result.git.message}`);
|
|
14258
14626
|
if (sideIssues.length > 0) {
|
|
14259
|
-
printLine('\n
|
|
14627
|
+
printLine('\n注意:该文档存在任务类型与执行终端归属不一致(可用 ylcwf doctor --docs 复查):');
|
|
14260
14628
|
for (const message of sideIssues)printLine(` · ${message}`);
|
|
14261
14629
|
}
|
|
14262
14630
|
}
|
|
@@ -14281,14 +14649,15 @@ function parseDetailUpdates(sets, appends) {
|
|
|
14281
14649
|
return updates;
|
|
14282
14650
|
}
|
|
14283
14651
|
function runDetail(taskId, options) {
|
|
14284
|
-
const { docsRoot, developer, policy } = requireWriteContext(options);
|
|
14285
|
-
const iteration = options.iteration?.trim() ? resolveIterationName(options,
|
|
14652
|
+
const { docsRoot, layout, developer, policy } = requireWriteContext(options);
|
|
14653
|
+
const iteration = options.iteration?.trim() ? resolveIterationName(options, layout, loadIterations(layout)) : resolveIterationName(options, layout, loadIterations(layout), {
|
|
14286
14654
|
taskId: taskId.trim().replace(/^#?/, '#')
|
|
14287
14655
|
});
|
|
14288
14656
|
const format = parseFormat(options.format);
|
|
14289
14657
|
const updates = parseDetailUpdates(options.set, options.append);
|
|
14290
14658
|
const applied = applyTaskDetail({
|
|
14291
14659
|
docsRoot,
|
|
14660
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14292
14661
|
iteration,
|
|
14293
14662
|
developer,
|
|
14294
14663
|
taskId: taskId.trim().replace(/^#?/, '#'),
|
|
@@ -14305,14 +14674,15 @@ function runDetail(taskId, options) {
|
|
|
14305
14674
|
if (void 0 !== applied.git) printLine(`git:${applied.git.message}`);
|
|
14306
14675
|
}
|
|
14307
14676
|
function runSelfTest(taskId, options) {
|
|
14308
|
-
const { docsRoot, developer, policy } = requireWriteContext(options);
|
|
14309
|
-
const iteration = options.iteration?.trim() ? resolveIterationName(options,
|
|
14677
|
+
const { docsRoot, layout, developer, policy } = requireWriteContext(options);
|
|
14678
|
+
const iteration = options.iteration?.trim() ? resolveIterationName(options, layout, loadIterations(layout)) : resolveIterationName(options, layout, loadIterations(layout), {
|
|
14310
14679
|
taskId: taskId.trim().replace(/^#?/, '#')
|
|
14311
14680
|
});
|
|
14312
14681
|
const format = parseFormat(options.format);
|
|
14313
14682
|
const result = options.result.trim();
|
|
14314
14683
|
const applied = applySelfTest({
|
|
14315
14684
|
docsRoot,
|
|
14685
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14316
14686
|
iteration,
|
|
14317
14687
|
developer,
|
|
14318
14688
|
taskId: taskId.trim().replace(/^#?/, '#'),
|
|
@@ -14330,10 +14700,11 @@ function runSelfTest(taskId, options) {
|
|
|
14330
14700
|
if (void 0 !== applied.git) printLine(`git:${applied.git.message}`);
|
|
14331
14701
|
}
|
|
14332
14702
|
function runActions(options) {
|
|
14333
|
-
const { docsRoot, developer } = requireWriteContext(options);
|
|
14334
|
-
const iteration = resolveIterationName(options,
|
|
14703
|
+
const { docsRoot, layout, developer } = requireWriteContext(options);
|
|
14704
|
+
const iteration = resolveIterationName(options, layout, loadIterations(layout));
|
|
14335
14705
|
const actions = availableActions({
|
|
14336
14706
|
docsRoot,
|
|
14707
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14337
14708
|
iteration,
|
|
14338
14709
|
developer
|
|
14339
14710
|
});
|
|
@@ -14351,11 +14722,12 @@ function runActions(options) {
|
|
|
14351
14722
|
}
|
|
14352
14723
|
}
|
|
14353
14724
|
function runBatch(action, taskIds, options) {
|
|
14354
|
-
const { docsRoot, developer, policy } = requireWriteContext(options);
|
|
14355
|
-
const iteration = resolveIterationName(options,
|
|
14725
|
+
const { docsRoot, layout, developer, policy } = requireWriteContext(options);
|
|
14726
|
+
const iteration = resolveIterationName(options, layout, loadIterations(layout));
|
|
14356
14727
|
const format = parseFormat(options.format);
|
|
14357
14728
|
const result = applyBatchAction({
|
|
14358
14729
|
docsRoot,
|
|
14730
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14359
14731
|
iteration,
|
|
14360
14732
|
developer,
|
|
14361
14733
|
taskIds,
|
|
@@ -14368,8 +14740,8 @@ function runBatch(action, taskIds, options) {
|
|
|
14368
14740
|
if (void 0 !== result.git) printLine(`git:${result.git.message}`);
|
|
14369
14741
|
}
|
|
14370
14742
|
function runHistory(taskId, options) {
|
|
14371
|
-
const {
|
|
14372
|
-
const iteration = resolveIterationName(options,
|
|
14743
|
+
const { layout, developer } = requireWriteContext(options);
|
|
14744
|
+
const iteration = resolveIterationName(options, layout, loadIterations(layout));
|
|
14373
14745
|
const entries = readTaskHistory({
|
|
14374
14746
|
iteration,
|
|
14375
14747
|
developer,
|
|
@@ -14386,9 +14758,9 @@ function runHistory(taskId, options) {
|
|
|
14386
14758
|
}
|
|
14387
14759
|
function runList(options) {
|
|
14388
14760
|
const ctx = requireQueryContext(options);
|
|
14389
|
-
const resolved = resolveIteration(options, ctx.
|
|
14761
|
+
const resolved = resolveIteration(options, ctx.layout, loadIterations(ctx.layout));
|
|
14390
14762
|
const iteration = resolved.name;
|
|
14391
|
-
const docs = loadDeveloperDocs(ctx.
|
|
14763
|
+
const docs = loadDeveloperDocs(ctx.layout, iteration);
|
|
14392
14764
|
const developerFilter = options.developer?.trim();
|
|
14393
14765
|
const statusFilter = options.status?.trim();
|
|
14394
14766
|
const tasks = buildTaskRows(filterDocs(docs, developerFilter)).filter((task)=>void 0 === statusFilter ? true : task.status === statusFilter);
|
|
@@ -14422,11 +14794,11 @@ function runList(options) {
|
|
|
14422
14794
|
}
|
|
14423
14795
|
function runShow(taskId, options) {
|
|
14424
14796
|
const ctx = requireQueryContext(options);
|
|
14425
|
-
const iteration = resolveIterationName(options, ctx.
|
|
14797
|
+
const iteration = resolveIterationName(options, ctx.layout, loadIterations(ctx.layout), {
|
|
14426
14798
|
taskId: taskId.trim().replace(/^#?/, '#')
|
|
14427
14799
|
});
|
|
14428
14800
|
const target = taskId.trim().replace(/^#?/, '#');
|
|
14429
|
-
const docs = loadDeveloperDocs(ctx.
|
|
14801
|
+
const docs = loadDeveloperDocs(ctx.layout, iteration);
|
|
14430
14802
|
for (const { developer, doc } of docs){
|
|
14431
14803
|
const task = doc.validation.tasks.find((item)=>item.id === target);
|
|
14432
14804
|
if (void 0 === task) continue;
|
|
@@ -14454,7 +14826,7 @@ function runShow(taskId, options) {
|
|
|
14454
14826
|
markdown: detail?.markdown ?? null
|
|
14455
14827
|
});
|
|
14456
14828
|
printLine(`${task.id} ${task.name}`);
|
|
14457
|
-
printLine(`成员:${developer} 类型:${task.type}
|
|
14829
|
+
printLine(`成员:${developer} 类型:${task.type} 执行终端:${task.terminal}`);
|
|
14458
14830
|
printLine(`状态:${task.status} 自测:${task.selfTest} 验收:${task.acceptance}`);
|
|
14459
14831
|
printLine(`所属需求:${task.requirementId}${void 0 === requirement ? '' : ` ${requirement.title}`}`);
|
|
14460
14832
|
printLine(`依赖:${0 === task.dependencies.length ? '—' : task.dependencies.join('、')} 最后更新:${task.updatedAt}`);
|
|
@@ -14488,11 +14860,13 @@ function registerTask(program) {
|
|
|
14488
14860
|
}
|
|
14489
14861
|
function iteration_runList(options) {
|
|
14490
14862
|
const ctx = requireQueryContext(options);
|
|
14491
|
-
const iterations = loadIterations(ctx.
|
|
14863
|
+
const iterations = loadIterations(ctx.layout);
|
|
14492
14864
|
if ('json' === ctx.format) return void printJson({
|
|
14493
14865
|
docsRoot: ctx.docsRoot,
|
|
14494
14866
|
iterations: iterations.map((item)=>({
|
|
14495
14867
|
name: item.name,
|
|
14868
|
+
year: item.year,
|
|
14869
|
+
relPath: item.relPath,
|
|
14496
14870
|
developers: item.developers.map((dev)=>dev.id),
|
|
14497
14871
|
hasPrd: item.hasPrd,
|
|
14498
14872
|
updatedAt: item.mtime
|
|
@@ -14500,7 +14874,7 @@ function iteration_runList(options) {
|
|
|
14500
14874
|
});
|
|
14501
14875
|
if (0 === iterations.length) return void printLine(`文档仓库中没有迭代目录:${ctx.docsRoot}`);
|
|
14502
14876
|
const rows = iterations.map((item)=>[
|
|
14503
|
-
item.
|
|
14877
|
+
item.relPath,
|
|
14504
14878
|
String(item.developers.length),
|
|
14505
14879
|
item.developers.map((dev)=>dev.id).join('、'),
|
|
14506
14880
|
item.mtime.slice(0, 16).replace('T', ' ')
|
|
@@ -14514,12 +14888,12 @@ function iteration_runList(options) {
|
|
|
14514
14888
|
}
|
|
14515
14889
|
function iteration_runShow(name, options) {
|
|
14516
14890
|
const ctx = requireQueryContext(options);
|
|
14517
|
-
const iterations = loadIterations(ctx.
|
|
14891
|
+
const iterations = loadIterations(ctx.layout);
|
|
14518
14892
|
const iteration = resolveIterationName({
|
|
14519
14893
|
...options,
|
|
14520
14894
|
iteration: name ?? options.iteration
|
|
14521
|
-
}, ctx.
|
|
14522
|
-
const summary = readIterationSummary(ctx.
|
|
14895
|
+
}, ctx.layout, iterations);
|
|
14896
|
+
const summary = readIterationSummary(ctx.layout, iteration, 'local');
|
|
14523
14897
|
if ('json' === ctx.format) return void printJson({
|
|
14524
14898
|
iteration: summary.iteration,
|
|
14525
14899
|
totals: summary.totals,
|
|
@@ -14575,7 +14949,7 @@ function iteration_runShow(name, options) {
|
|
|
14575
14949
|
function runCurrent(options) {
|
|
14576
14950
|
const format = parseFormat(options.format);
|
|
14577
14951
|
const ctx = requireQueryContext(options);
|
|
14578
|
-
const iterations = loadIterations(ctx.
|
|
14952
|
+
const iterations = loadIterations(ctx.layout).map((item)=>item.name);
|
|
14579
14953
|
const result = resolveIterationFromBranch(ctx.docsRoot, iterations);
|
|
14580
14954
|
if ('json' === format) return void printJson({
|
|
14581
14955
|
ok: true,
|
|
@@ -14588,19 +14962,41 @@ function runCurrent(options) {
|
|
|
14588
14962
|
printLine('迭代:未从分支名识别出迭代目录');
|
|
14589
14963
|
if (iterations.length > 0) printLine(`可用迭代:${iterations.join('、')}`);
|
|
14590
14964
|
}
|
|
14965
|
+
function runCreate(name, options) {
|
|
14966
|
+
const ctx = requireQueryContext(options);
|
|
14967
|
+
const layout = ctx.layout;
|
|
14968
|
+
let year;
|
|
14969
|
+
if (void 0 !== options.year) {
|
|
14970
|
+
const parsed = Number.parseInt(options.year.trim(), 10);
|
|
14971
|
+
if (!Number.isInteger(parsed)) throw new Error(`--year 必须是 4 位数字年份:${options.year}`);
|
|
14972
|
+
year = parsed;
|
|
14973
|
+
}
|
|
14974
|
+
const result = createIterationDir(layout.root, layout.iterationsRoot, name, {
|
|
14975
|
+
year
|
|
14976
|
+
});
|
|
14977
|
+
const { relPath, dir } = result.iteration;
|
|
14978
|
+
if ('json' === ctx.format) return void printJson({
|
|
14979
|
+
...result.iteration,
|
|
14980
|
+
created: result.created
|
|
14981
|
+
});
|
|
14982
|
+
printLine(result.created ? `已创建迭代目录:${relPath}` : `迭代目录已存在:${relPath}`);
|
|
14983
|
+
printLine(`路径:${dir}`);
|
|
14984
|
+
result.created ? printLine(`下一步:ylcwf doc apply -i ${relPath} --input <plan.json>`) : printLine('(未做任何写入)');
|
|
14985
|
+
}
|
|
14591
14986
|
function registerIteration(program) {
|
|
14592
14987
|
const iteration = program.command('iteration').description('查看文档仓库中的迭代');
|
|
14593
14988
|
iteration.command('list').description('列出全部迭代(目录名即迭代名)').option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').action((options)=>iteration_runList(options));
|
|
14594
14989
|
iteration.command('current').description('从文档仓库当前分支推导迭代名(团队约定:一迭代一分支)').option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').action((options)=>runCurrent(options));
|
|
14990
|
+
iteration.command('create <name>').description('新建迭代目录:{迭代根}/{年份}/{迭代名},年份按「名称前缀 > --year > 当前年」').option('-c, --config <path>', '指定配置文件路径').option('-y, --year <year>', `年份(4 位数字,默认当前年 ${currentIterationYear()})`).option('--format <format>', '输出格式:human | json', 'human').action((name, options)=>runCreate(name, options));
|
|
14595
14991
|
iteration.command('show [name]').description('查看迭代汇总:成员进度与阻塞任务').option('-c, --config <path>', '指定配置文件路径').option('-i, --iteration <name>', '迭代目录名(也可作为位置参数)').option('--format <format>', '输出格式:human | json', 'human').action((name, options)=>iteration_runShow(name, options));
|
|
14596
14992
|
}
|
|
14597
14993
|
function runContext(options) {
|
|
14598
14994
|
const ctx = requireQueryContext(options);
|
|
14599
|
-
const iterations = loadIterations(ctx.
|
|
14600
|
-
const iteration = resolveIterationName(options, ctx.
|
|
14995
|
+
const iterations = loadIterations(ctx.layout);
|
|
14996
|
+
const iteration = resolveIterationName(options, ctx.layout, iterations, {
|
|
14601
14997
|
taskId: options.task?.trim()
|
|
14602
14998
|
});
|
|
14603
|
-
const docs = loadDeveloperDocs(ctx.
|
|
14999
|
+
const docs = loadDeveloperDocs(ctx.layout, iteration);
|
|
14604
15000
|
const developerFilter = true === options.all ? void 0 : options.developer?.trim() || ctx.developer;
|
|
14605
15001
|
const selected = filterDocs(docs, developerFilter);
|
|
14606
15002
|
if (0 === selected.length) throw new errors_CliError(`迭代 ${iteration} 中没有成员文档${void 0 === developerFilter ? '' : `(${developerFilter})`}`, errors_EXIT.NOT_FOUND);
|
|
@@ -14641,8 +15037,8 @@ function runContext(options) {
|
|
|
14641
15037
|
function registerContext(program) {
|
|
14642
15038
|
program.command('context').description('一次拿全迭代上下文:需求、任务、可执行任务与阻塞关系').option('-c, --config <path>', '指定配置文件路径').option('-i, --iteration <name>', '迭代目录名(可省略:在迭代目录内执行时自动推断)').option('-d, --developer <name>', '指定成员(默认取配置身份)').option('--all', '合并全部成员').option('--task <taskId>', '已知任务编号时可用于反查迭代').option('--format <format>', '输出格式:human | json', 'human').action((options)=>runContext(options));
|
|
14643
15039
|
}
|
|
14644
|
-
function collectRequirements(
|
|
14645
|
-
const docs = loadDeveloperDocs(
|
|
15040
|
+
function collectRequirements(layout, iteration, developer) {
|
|
15041
|
+
const docs = loadDeveloperDocs(layout, iteration);
|
|
14646
15042
|
const filtered = void 0 === developer ? docs : docs.filter((item)=>item.developer === developer);
|
|
14647
15043
|
if (0 === filtered.length) throw new errors_CliError(`迭代 ${iteration} 中没有成员文档${void 0 === developer ? '' : `(${developer})`}`, errors_EXIT.NOT_FOUND);
|
|
14648
15044
|
const map = new Map();
|
|
@@ -14668,8 +15064,8 @@ function collectRequirements(docsRoot, iteration, developer) {
|
|
|
14668
15064
|
}
|
|
14669
15065
|
function requirement_runList(options) {
|
|
14670
15066
|
const ctx = requireQueryContext(options);
|
|
14671
|
-
const iteration = resolveIterationName(options, ctx.
|
|
14672
|
-
const requirements = collectRequirements(ctx.
|
|
15067
|
+
const iteration = resolveIterationName(options, ctx.layout, loadIterations(ctx.layout));
|
|
15068
|
+
const requirements = collectRequirements(ctx.layout, iteration, options.developer?.trim() || void 0);
|
|
14673
15069
|
if ('json' === ctx.format) return void printJson({
|
|
14674
15070
|
iteration,
|
|
14675
15071
|
requirements
|
|
@@ -14688,7 +15084,7 @@ function requirement_runList(options) {
|
|
|
14688
15084
|
for (const line of renderTable([
|
|
14689
15085
|
'编号',
|
|
14690
15086
|
'需求名称',
|
|
14691
|
-
'
|
|
15087
|
+
'执行终端',
|
|
14692
15088
|
'状态',
|
|
14693
15089
|
'进度',
|
|
14694
15090
|
'任务',
|
|
@@ -14698,13 +15094,13 @@ function requirement_runList(options) {
|
|
|
14698
15094
|
}
|
|
14699
15095
|
function requirement_runShow(id, options) {
|
|
14700
15096
|
const ctx = requireQueryContext(options);
|
|
14701
|
-
const iteration = resolveIterationName(options, ctx.
|
|
15097
|
+
const iteration = resolveIterationName(options, ctx.layout, loadIterations(ctx.layout), {
|
|
14702
15098
|
requirementId: id.trim().replace(/^#?/, '#')
|
|
14703
15099
|
});
|
|
14704
15100
|
const target = id.trim().replace(/^#?/, '#');
|
|
14705
|
-
const requirement = collectRequirements(ctx.
|
|
15101
|
+
const requirement = collectRequirements(ctx.layout, iteration, options.developer?.trim() || void 0).find((item)=>item.id === target);
|
|
14706
15102
|
if (void 0 === requirement) throw new errors_CliError(`迭代 ${iteration} 中没有需求 ${target}`, errors_EXIT.NOT_FOUND);
|
|
14707
|
-
const docs = loadDeveloperDocs(ctx.
|
|
15103
|
+
const docs = loadDeveloperDocs(ctx.layout, iteration);
|
|
14708
15104
|
const tasks = docs.flatMap(({ developer: owner, doc })=>doc.validation.tasks.filter((task)=>requirement.taskIds.includes(task.id)).map((task)=>({
|
|
14709
15105
|
id: task.id,
|
|
14710
15106
|
name: task.name,
|
|
@@ -14722,7 +15118,7 @@ function requirement_runShow(id, options) {
|
|
|
14722
15118
|
tasks
|
|
14723
15119
|
});
|
|
14724
15120
|
printLine(`${requirement.id} ${requirement.title}`);
|
|
14725
|
-
printLine(
|
|
15121
|
+
printLine(`执行终端:${requirement.terminal} 状态:${requirement.status} 进度:${requirement.progress}%`);
|
|
14726
15122
|
printLine(`成员:${requirement.developers.join('、')} 最后更新:${requirement.updatedAt}`);
|
|
14727
15123
|
if (requirement.note.length > 0) printLine(`备注:${requirement.note}`);
|
|
14728
15124
|
printLine('');
|
|
@@ -14747,10 +15143,11 @@ function requirement_runShow(id, options) {
|
|
|
14747
15143
|
}
|
|
14748
15144
|
function runRecalc(options) {
|
|
14749
15145
|
const ctx = requireQueryContext(options);
|
|
14750
|
-
const iteration = resolveIterationName(options, ctx.
|
|
15146
|
+
const iteration = resolveIterationName(options, ctx.layout, loadIterations(ctx.layout));
|
|
14751
15147
|
const developer = options.developer?.trim() || ctx.developer;
|
|
14752
15148
|
const result = recalcRequirements({
|
|
14753
15149
|
docsRoot: ctx.docsRoot,
|
|
15150
|
+
iterationsRoot: ctx.layout.iterationsRoot,
|
|
14754
15151
|
iteration,
|
|
14755
15152
|
developer,
|
|
14756
15153
|
dryRun: true === options.dryRun
|
|
@@ -14765,14 +15162,15 @@ function runRecalc(options) {
|
|
|
14765
15162
|
if (true !== options.dryRun) printLine(`文档:${result.file}`);
|
|
14766
15163
|
}
|
|
14767
15164
|
function runNote(requirementId, options) {
|
|
14768
|
-
const { docsRoot, developer, policy } = requireWriteContext(options);
|
|
14769
|
-
const iteration = options.iteration?.trim() ? resolveIterationName(options,
|
|
15165
|
+
const { docsRoot, layout, developer, policy } = requireWriteContext(options);
|
|
15166
|
+
const iteration = options.iteration?.trim() ? resolveIterationName(options, layout, loadIterations(layout)) : resolveIterationName(options, layout, loadIterations(layout), {
|
|
14770
15167
|
requirementId: requirementId.trim().replace(/^#?/, '#')
|
|
14771
15168
|
});
|
|
14772
15169
|
const note = (options.set ?? '').trim();
|
|
14773
15170
|
if (0 === note.length) throw new errors_CliError('请用 --set 提供备注内容', errors_EXIT.USAGE);
|
|
14774
15171
|
const applied = applyRequirementNote({
|
|
14775
15172
|
docsRoot,
|
|
15173
|
+
iterationsRoot: layout.iterationsRoot,
|
|
14776
15174
|
iteration,
|
|
14777
15175
|
developer,
|
|
14778
15176
|
requirementId,
|
|
@@ -14817,9 +15215,9 @@ async function fetchManifest(url) {
|
|
|
14817
15215
|
const payload = await response.json();
|
|
14818
15216
|
if ('string' != typeof payload.version || 0 === payload.version.length) return null;
|
|
14819
15217
|
return {
|
|
14820
|
-
current: "0.
|
|
15218
|
+
current: "0.6.1",
|
|
14821
15219
|
latest: payload.version,
|
|
14822
|
-
hasUpdate: isNewer(payload.version, "0.
|
|
15220
|
+
hasUpdate: isNewer(payload.version, "0.6.1"),
|
|
14823
15221
|
downloadUrl: 'string' == typeof payload.downloadUrl ? payload.downloadUrl : null,
|
|
14824
15222
|
source: 'manifest',
|
|
14825
15223
|
checkedAt: new Date().toISOString(),
|
|
@@ -14831,7 +15229,7 @@ async function fetchManifest(url) {
|
|
|
14831
15229
|
}
|
|
14832
15230
|
async function fetchNpm() {
|
|
14833
15231
|
const base = {
|
|
14834
|
-
current: "0.
|
|
15232
|
+
current: "0.6.1",
|
|
14835
15233
|
latest: null,
|
|
14836
15234
|
hasUpdate: false,
|
|
14837
15235
|
downloadUrl: null,
|
|
@@ -14858,7 +15256,7 @@ async function fetchNpm() {
|
|
|
14858
15256
|
return {
|
|
14859
15257
|
...base,
|
|
14860
15258
|
latest,
|
|
14861
|
-
hasUpdate: isNewer(latest, "0.
|
|
15259
|
+
hasUpdate: isNewer(latest, "0.6.1"),
|
|
14862
15260
|
downloadUrl: null
|
|
14863
15261
|
};
|
|
14864
15262
|
} catch (error) {
|
|
@@ -14949,7 +15347,7 @@ async function runUpgrade(options) {
|
|
|
14949
15347
|
const kind = detectInstallKind();
|
|
14950
15348
|
const result = await checkUpdate(true);
|
|
14951
15349
|
const target = options.to?.trim() ?? result.latest;
|
|
14952
|
-
printLine("当前版本:0.
|
|
15350
|
+
printLine("当前版本:0.6.1");
|
|
14953
15351
|
if (null !== result.error) printLine(`版本查询失败:${result.error}`);
|
|
14954
15352
|
else if (null !== result.latest) printLine(`最新版本:${result.latest}(来源:${result.source})`);
|
|
14955
15353
|
if (null === target) throw new errors_CliError('无法确定目标版本,请稍后重试或用 --to 指定', errors_EXIT.NOT_FOUND);
|
|
@@ -15013,7 +15411,7 @@ function pickRepo(items, pick) {
|
|
|
15013
15411
|
throw new errors_CliError(`--pick 未匹配到仓库:${pick}\n候选:\n${formatCandidates(items)}`, errors_EXIT.NOT_FOUND);
|
|
15014
15412
|
}
|
|
15015
15413
|
function selectRepos(items, terminal, side, pick, all) {
|
|
15016
|
-
if (0 === items.length) throw new errors_CliError(
|
|
15414
|
+
if (0 === items.length) throw new errors_CliError(`执行终端「${terminal}」未配置 ${side} 仓库`, errors_EXIT.NOT_FOUND);
|
|
15017
15415
|
if (all) return [
|
|
15018
15416
|
...items
|
|
15019
15417
|
];
|
|
@@ -15023,15 +15421,15 @@ function selectRepos(items, terminal, side, pick, all) {
|
|
|
15023
15421
|
if (1 === items.length) return [
|
|
15024
15422
|
items[0]
|
|
15025
15423
|
].filter((item)=>void 0 !== item);
|
|
15026
|
-
throw new errors_CliError(
|
|
15424
|
+
throw new errors_CliError(`执行终端「${terminal}」的 ${side} 端存在多个仓库,必须显式指定(--pick)或询问开发者:\n${formatCandidates(items)}`, errors_EXIT.NOT_FOUND);
|
|
15027
15425
|
}
|
|
15028
15426
|
function runResolve(name, options) {
|
|
15029
15427
|
const format = parseFormat(options.format);
|
|
15030
15428
|
const ready = requireConfig(options.config);
|
|
15031
15429
|
const result = resolveTerminal(ready.config, name);
|
|
15032
15430
|
if (!result.matched || null === result.terminal || null === result.entry) {
|
|
15033
|
-
const hint = 0 === result.candidates.length ? '\n
|
|
15034
|
-
throw new errors_CliError(
|
|
15431
|
+
const hint = 0 === result.candidates.length ? '\n请确认执行终端名,或先运行:ylcwf terminal add' : `\n候选(需人工确认,禁止自动采用):${result.candidates.join('、')}`;
|
|
15432
|
+
throw new errors_CliError(`未找到执行终端:${name}${hint}`, errors_EXIT.NOT_FOUND);
|
|
15035
15433
|
}
|
|
15036
15434
|
const rawSide = options.side?.trim();
|
|
15037
15435
|
if (void 0 !== rawSide && rawSide.length > 0 && !isSide(rawSide)) throw new errors_CliError(`--side 必须是 frontend / backend:${rawSide}`, errors_EXIT.USAGE);
|
|
@@ -15086,7 +15484,7 @@ function runResolve(name, options) {
|
|
|
15086
15484
|
terminal,
|
|
15087
15485
|
repos
|
|
15088
15486
|
});
|
|
15089
|
-
printLine(
|
|
15487
|
+
printLine(`执行终端:${terminal}(匹配方式:${result.matchedBy ?? 'exact'})`);
|
|
15090
15488
|
for (const item of SIDES){
|
|
15091
15489
|
const list = repos[item];
|
|
15092
15490
|
if (0 === list.length) {
|
|
@@ -15100,26 +15498,218 @@ function runResolve(name, options) {
|
|
|
15100
15498
|
}
|
|
15101
15499
|
}
|
|
15102
15500
|
function registerResolve(program) {
|
|
15103
|
-
program.command('resolve <name>').description('
|
|
15501
|
+
program.command('resolve <name>').description('把执行终端名(支持中文)解析为本地仓库路径').option('-c, --config <path>', '指定配置文件路径').option('--side <side>', '限定端口:frontend | backend').option('--field <field>', '输出字段:path | exists | terminal | repos', 'repos').option('--pick <repo>', '该端存在多个仓库时显式指定:序号(1 起)、完整路径或目录名').option('--all', '输出该端全部仓库').option('--format <format>', '输出格式:human | json', 'human').action((name, options)=>{
|
|
15104
15502
|
runResolve(name, options);
|
|
15105
15503
|
});
|
|
15106
15504
|
}
|
|
15505
|
+
const YAPI_PLATFORM_FILE = 'yapi_platform.json';
|
|
15506
|
+
function yapi_error(code, message, where) {
|
|
15507
|
+
return void 0 === where ? {
|
|
15508
|
+
level: 'error',
|
|
15509
|
+
code,
|
|
15510
|
+
message
|
|
15511
|
+
} : {
|
|
15512
|
+
level: 'error',
|
|
15513
|
+
code,
|
|
15514
|
+
message,
|
|
15515
|
+
where
|
|
15516
|
+
};
|
|
15517
|
+
}
|
|
15518
|
+
function yapi_warning(code, message, where) {
|
|
15519
|
+
return void 0 === where ? {
|
|
15520
|
+
level: 'warning',
|
|
15521
|
+
code,
|
|
15522
|
+
message
|
|
15523
|
+
} : {
|
|
15524
|
+
level: 'warning',
|
|
15525
|
+
code,
|
|
15526
|
+
message,
|
|
15527
|
+
where
|
|
15528
|
+
};
|
|
15529
|
+
}
|
|
15530
|
+
function yapi_isRecord(value) {
|
|
15531
|
+
return 'object' == typeof value && null !== value && !Array.isArray(value);
|
|
15532
|
+
}
|
|
15533
|
+
function yapi_isPositiveInteger(value) {
|
|
15534
|
+
return 'number' == typeof value && Number.isInteger(value) && value > 0;
|
|
15535
|
+
}
|
|
15536
|
+
function checkYapiCatalog(raw) {
|
|
15537
|
+
const issues = [];
|
|
15538
|
+
if (!yapi_isRecord(raw)) return {
|
|
15539
|
+
catalog: null,
|
|
15540
|
+
issues: [
|
|
15541
|
+
yapi_error('YAPI_TYPE', 'yapi_platform.json 必须是对象')
|
|
15542
|
+
]
|
|
15543
|
+
};
|
|
15544
|
+
const groups = [];
|
|
15545
|
+
const groupsRaw = raw['groups'];
|
|
15546
|
+
if (Array.isArray(groupsRaw)) groupsRaw.forEach((item, index)=>{
|
|
15547
|
+
const where = `groups[${index}]`;
|
|
15548
|
+
if (!yapi_isRecord(item)) return void issues.push(yapi_error('YAPI_GROUP_INVALID', `${where} 必须是对象`, where));
|
|
15549
|
+
const groupId = item['groupId'];
|
|
15550
|
+
const name = item['name'];
|
|
15551
|
+
if (!yapi_isPositiveInteger(groupId)) return void issues.push(yapi_error('YAPI_GROUP_ID_INVALID', `${where}.groupId 必须是正整数`, `${where}.groupId`));
|
|
15552
|
+
if ('string' != typeof name || 0 === name.trim().length) return void issues.push(yapi_error('YAPI_GROUP_NAME_INVALID', `${where}.name 不能为空`, `${where}.name`));
|
|
15553
|
+
groups.push({
|
|
15554
|
+
groupId,
|
|
15555
|
+
name: name.trim()
|
|
15556
|
+
});
|
|
15557
|
+
});
|
|
15558
|
+
else issues.push(yapi_error('YAPI_GROUPS_INVALID', 'groups 必须是数组', 'groups'));
|
|
15559
|
+
const knownGroupIds = new Set(groups.map((group)=>group.groupId));
|
|
15560
|
+
const platforms = [];
|
|
15561
|
+
const seenTerminals = new Map();
|
|
15562
|
+
const platformsRaw = raw['platforms'];
|
|
15563
|
+
if (Array.isArray(platformsRaw)) platformsRaw.forEach((item, index)=>{
|
|
15564
|
+
const where = `platforms[${index}]`;
|
|
15565
|
+
if (!yapi_isRecord(item)) return void issues.push(yapi_error('YAPI_PLATFORM_INVALID', `${where} 必须是对象`, where));
|
|
15566
|
+
const terminal = item['terminal'];
|
|
15567
|
+
const groupId = item['groupId'];
|
|
15568
|
+
const projectIds = item['projectIds'];
|
|
15569
|
+
const platformRaw = item['platform'];
|
|
15570
|
+
if ('string' != typeof terminal || 0 === terminal.trim().length) return void issues.push(yapi_error('YAPI_TERMINAL_REQUIRED', `${where}.terminal 不能为空`, `${where}.terminal`));
|
|
15571
|
+
if (!yapi_isPositiveInteger(groupId)) return void issues.push(yapi_error('YAPI_GROUP_ID_INVALID', `${where}.groupId 必须是正整数`, `${where}.groupId`));
|
|
15572
|
+
if (!knownGroupIds.has(groupId)) issues.push(yapi_error('YAPI_GROUP_UNKNOWN', `${where}.groupId ${groupId} 未在 groups 中声明`, `${where}.groupId`));
|
|
15573
|
+
if (!Array.isArray(projectIds) || 0 === projectIds.length) return void issues.push(yapi_error('YAPI_PROJECT_IDS_INVALID', `${where}.projectIds 必须是非空数组`, `${where}.projectIds`));
|
|
15574
|
+
const invalidProject = projectIds.find((id)=>!yapi_isPositiveInteger(id));
|
|
15575
|
+
if (void 0 !== invalidProject) return void issues.push(yapi_error('YAPI_PROJECT_IDS_INVALID', `${where}.projectIds 只能包含正整数:${String(invalidProject)}`, `${where}.projectIds`));
|
|
15576
|
+
const key = normalizeName(terminal);
|
|
15577
|
+
const duplicate = seenTerminals.get(key);
|
|
15578
|
+
if (void 0 !== duplicate) issues.push(yapi_error('YAPI_TERMINAL_DUPLICATED', `执行终端「${terminal.trim()}」重复声明(另见「${duplicate}」),按归一化比较重复`, `${where}.terminal`));
|
|
15579
|
+
else seenTerminals.set(key, terminal.trim());
|
|
15580
|
+
platforms.push({
|
|
15581
|
+
platform: 'string' == typeof platformRaw && platformRaw.trim().length > 0 ? platformRaw.trim() : null,
|
|
15582
|
+
terminal: terminal.trim(),
|
|
15583
|
+
groupId,
|
|
15584
|
+
projectIds: [
|
|
15585
|
+
...projectIds
|
|
15586
|
+
].sort((left, right)=>left - right)
|
|
15587
|
+
});
|
|
15588
|
+
});
|
|
15589
|
+
else issues.push(yapi_error('YAPI_PLATFORMS_INVALID', 'platforms 必须是数组', 'platforms'));
|
|
15590
|
+
if (issues.some((issue)=>'error' === issue.level)) return {
|
|
15591
|
+
catalog: null,
|
|
15592
|
+
issues
|
|
15593
|
+
};
|
|
15594
|
+
return {
|
|
15595
|
+
catalog: {
|
|
15596
|
+
groups,
|
|
15597
|
+
platforms
|
|
15598
|
+
},
|
|
15599
|
+
issues
|
|
15600
|
+
};
|
|
15601
|
+
}
|
|
15602
|
+
function loadYapiCatalog(docsRoot) {
|
|
15603
|
+
const path = external_node_path_join(docsRoot, YAPI_PLATFORM_FILE);
|
|
15604
|
+
let text;
|
|
15605
|
+
try {
|
|
15606
|
+
text = readFileSync(path, 'utf8');
|
|
15607
|
+
} catch {
|
|
15608
|
+
return {
|
|
15609
|
+
path,
|
|
15610
|
+
catalog: null,
|
|
15611
|
+
issues: []
|
|
15612
|
+
};
|
|
15613
|
+
}
|
|
15614
|
+
let raw;
|
|
15615
|
+
try {
|
|
15616
|
+
raw = JSON.parse(text);
|
|
15617
|
+
} catch (caught) {
|
|
15618
|
+
const detail = caught instanceof Error ? caught.message : String(caught);
|
|
15619
|
+
return {
|
|
15620
|
+
path,
|
|
15621
|
+
catalog: null,
|
|
15622
|
+
issues: [
|
|
15623
|
+
yapi_error('YAPI_JSON_INVALID', `${YAPI_PLATFORM_FILE} 不是合法 JSON:${detail}`)
|
|
15624
|
+
]
|
|
15625
|
+
};
|
|
15626
|
+
}
|
|
15627
|
+
return {
|
|
15628
|
+
path,
|
|
15629
|
+
...checkYapiCatalog(raw)
|
|
15630
|
+
};
|
|
15631
|
+
}
|
|
15632
|
+
function terminalNameByRepo(terminals, input) {
|
|
15633
|
+
const target = normalizeName(input);
|
|
15634
|
+
const hits = [];
|
|
15635
|
+
for (const [name, terminal] of Object.entries(terminals)){
|
|
15636
|
+
const repos = [
|
|
15637
|
+
...terminal.repos.frontend,
|
|
15638
|
+
...terminal.repos.backend
|
|
15639
|
+
];
|
|
15640
|
+
if (repos.some((repo)=>normalizeName(basename(repo)) === target)) hits.push(name);
|
|
15641
|
+
}
|
|
15642
|
+
return 1 === hits.length ? hits[0] ?? null : null;
|
|
15643
|
+
}
|
|
15644
|
+
function resolveConfigTerminal(terminals, input) {
|
|
15645
|
+
const target = normalizeName(input);
|
|
15646
|
+
for (const name of Object.keys(terminals))if (normalizeName(name) === target) return {
|
|
15647
|
+
terminalName: name,
|
|
15648
|
+
matchedBy: 'terminal'
|
|
15649
|
+
};
|
|
15650
|
+
const byRepo = terminalNameByRepo(terminals, input);
|
|
15651
|
+
if (null !== byRepo) return {
|
|
15652
|
+
terminalName: byRepo,
|
|
15653
|
+
matchedBy: 'repo'
|
|
15654
|
+
};
|
|
15655
|
+
return {
|
|
15656
|
+
terminalName: null,
|
|
15657
|
+
matchedBy: null
|
|
15658
|
+
};
|
|
15659
|
+
}
|
|
15660
|
+
function describePlatform(item) {
|
|
15661
|
+
return null === item.platform ? item.terminal : `${item.terminal}(${item.platform})`;
|
|
15662
|
+
}
|
|
15663
|
+
function matchYapiPlatform(options) {
|
|
15664
|
+
const { catalog, terminals, input } = options;
|
|
15665
|
+
const trimmed = input.trim();
|
|
15666
|
+
const empty = {
|
|
15667
|
+
matched: false,
|
|
15668
|
+
terminalName: null,
|
|
15669
|
+
matchedBy: null,
|
|
15670
|
+
platform: null,
|
|
15671
|
+
group: null,
|
|
15672
|
+
candidates: catalog.platforms.map(describePlatform)
|
|
15673
|
+
};
|
|
15674
|
+
if (0 === trimmed.length) return empty;
|
|
15675
|
+
const resolved = resolveConfigTerminal(terminals, trimmed);
|
|
15676
|
+
const target = normalizeName(resolved.terminalName ?? trimmed);
|
|
15677
|
+
const byTerminal = catalog.platforms.filter((item)=>normalizeName(item.terminal) === target);
|
|
15678
|
+
if (1 === byTerminal.length && void 0 !== byTerminal[0]) return buildMatch(byTerminal[0], resolved.terminalName, resolved.matchedBy ?? 'terminal', catalog);
|
|
15679
|
+
if (byTerminal.length > 1) return {
|
|
15680
|
+
...empty,
|
|
15681
|
+
terminalName: resolved.terminalName,
|
|
15682
|
+
candidates: byTerminal.map(describePlatform)
|
|
15683
|
+
};
|
|
15684
|
+
return {
|
|
15685
|
+
...empty,
|
|
15686
|
+
terminalName: resolved.terminalName
|
|
15687
|
+
};
|
|
15688
|
+
}
|
|
15689
|
+
function buildMatch(item, terminalName, matchedBy, catalog) {
|
|
15690
|
+
return {
|
|
15691
|
+
matched: true,
|
|
15692
|
+
terminalName,
|
|
15693
|
+
matchedBy,
|
|
15694
|
+
platform: item,
|
|
15695
|
+
group: catalog.groups.find((group)=>group.groupId === item.groupId) ?? null,
|
|
15696
|
+
candidates: []
|
|
15697
|
+
};
|
|
15698
|
+
}
|
|
15699
|
+
function checkYapiAgainstTerminalCatalog(catalog, terminalNames) {
|
|
15700
|
+
if (0 === terminalNames.length) return [];
|
|
15701
|
+
const allowed = terminalNames.map((name)=>normalizeName(name));
|
|
15702
|
+
const issues = [];
|
|
15703
|
+
for (const item of catalog.platforms)if (!allowed.includes(normalizeName(item.terminal))) issues.push(yapi_warning('YAPI_TERMINAL_NOT_IN_CATALOG', `${YAPI_PLATFORM_FILE} 中的执行终端「${item.terminal}」不在 execution_terminals.json 里;可选:${terminalNames.join('、')}(以清单为准,请改 yapi 文件)`, `platforms.${item.terminal}`));
|
|
15704
|
+
return issues;
|
|
15705
|
+
}
|
|
15107
15706
|
function checkDocsSides(config) {
|
|
15108
15707
|
const messages = [];
|
|
15109
15708
|
const root = config.docs.root;
|
|
15709
|
+
const iterationsRoot = DEFAULT_ITERATIONS_ROOT;
|
|
15110
15710
|
let iterations;
|
|
15111
15711
|
try {
|
|
15112
|
-
iterations =
|
|
15113
|
-
"scripts",
|
|
15114
|
-
'skills',
|
|
15115
|
-
'_prd'
|
|
15116
|
-
].includes(name)).filter((name)=>{
|
|
15117
|
-
try {
|
|
15118
|
-
return statSync(external_node_path_join(root, name)).isDirectory();
|
|
15119
|
-
} catch {
|
|
15120
|
-
return false;
|
|
15121
|
-
}
|
|
15122
|
-
});
|
|
15712
|
+
iterations = listIterationDirs(root, iterationsRoot);
|
|
15123
15713
|
} catch {
|
|
15124
15714
|
return [
|
|
15125
15715
|
{
|
|
@@ -15128,9 +15718,10 @@ function checkDocsSides(config) {
|
|
|
15128
15718
|
}
|
|
15129
15719
|
];
|
|
15130
15720
|
}
|
|
15131
|
-
for (const iteration of iterations)try {
|
|
15721
|
+
for (const { relPath: iteration } of iterations)try {
|
|
15132
15722
|
const report = checkDocTaskSides({
|
|
15133
15723
|
docsRoot: root,
|
|
15724
|
+
iterationsRoot,
|
|
15134
15725
|
iteration,
|
|
15135
15726
|
developer: config.profile.developer,
|
|
15136
15727
|
role: config.profile.role,
|
|
@@ -15142,22 +15733,48 @@ function checkDocsSides(config) {
|
|
|
15142
15733
|
});
|
|
15143
15734
|
if (report.skipped > 0) messages.push({
|
|
15144
15735
|
level: 'warning',
|
|
15145
|
-
message: `[${iteration}] ${report.checked} 个任务完成归属校验,${report.skipped}
|
|
15736
|
+
message: `[${iteration}] ${report.checked} 个任务完成归属校验,${report.skipped} 个因执行终端未配置/歧义被跳过(跳过≠通过)`
|
|
15146
15737
|
});
|
|
15147
15738
|
} catch {}
|
|
15148
15739
|
return messages;
|
|
15149
15740
|
}
|
|
15741
|
+
function doctor_checkTerminalCatalog(config) {
|
|
15742
|
+
const root = config.docs.root;
|
|
15743
|
+
if (0 === root.trim().length) return [];
|
|
15744
|
+
const loaded = loadTerminalCatalog(root);
|
|
15745
|
+
const issues = loaded.issues.map((issue)=>({
|
|
15746
|
+
level: issue.level,
|
|
15747
|
+
message: issue.message
|
|
15748
|
+
}));
|
|
15749
|
+
const names = loaded.catalog?.terminals.map((entry)=>entry.name) ?? [];
|
|
15750
|
+
if (null === loaded.catalog && 0 === loaded.issues.length) {
|
|
15751
|
+
issues.push({
|
|
15752
|
+
level: 'warning',
|
|
15753
|
+
message: `文档仓库缺少 ${TERMINAL_CATALOG_FILE}:本次不限制执行终端名。需要统一命名为合法值请补该文件`
|
|
15754
|
+
});
|
|
15755
|
+
return issues;
|
|
15756
|
+
}
|
|
15757
|
+
const yapi = loadYapiCatalog(root);
|
|
15758
|
+
if (null !== yapi.catalog) issues.push(...checkYapiAgainstTerminalCatalog(yapi.catalog, names).map((issue)=>({
|
|
15759
|
+
level: issue.level,
|
|
15760
|
+
message: issue.message
|
|
15761
|
+
})));
|
|
15762
|
+
return issues;
|
|
15763
|
+
}
|
|
15150
15764
|
function runDoctor(options) {
|
|
15151
15765
|
const format = parseFormat(options.format);
|
|
15152
|
-
const loaded =
|
|
15766
|
+
const loaded = config_loadConfig(options.config);
|
|
15153
15767
|
if (!loaded.exists) throw new errors_CliError(`配置未初始化:${loaded.path}\n请先运行:ylcwf init`, errors_EXIT.NOT_FOUND);
|
|
15154
|
-
const checked =
|
|
15768
|
+
const checked = checkConfigWithCatalog(loaded.raw, {
|
|
15155
15769
|
checkFs: true
|
|
15156
15770
|
});
|
|
15157
15771
|
const errors = countIssues(checked.issues).errors;
|
|
15158
15772
|
const ok = !hasError(checked.issues);
|
|
15159
15773
|
const sideIssues = [];
|
|
15160
|
-
if (true === options.docs && null !== checked.config && ok)
|
|
15774
|
+
if (true === options.docs && null !== checked.config && ok) {
|
|
15775
|
+
sideIssues.push(...doctor_checkTerminalCatalog(checked.config));
|
|
15776
|
+
sideIssues.push(...checkDocsSides(checked.config));
|
|
15777
|
+
}
|
|
15161
15778
|
const sideErrors = sideIssues.filter((item)=>'error' === item.level).length;
|
|
15162
15779
|
const allOk = ok && 0 === sideErrors;
|
|
15163
15780
|
if ('json' === format) printJson({
|
|
@@ -15180,7 +15797,7 @@ function runDoctor(options) {
|
|
|
15180
15797
|
if (!allOk) process.exitCode = errors_EXIT.INVALID;
|
|
15181
15798
|
}
|
|
15182
15799
|
function registerDoctor(program) {
|
|
15183
|
-
program.command('doctor').description('严格校验配置(schema
|
|
15800
|
+
program.command('doctor').description('严格校验配置(schema、路径存在性、执行终端唯一性)').option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').option('--docs', '同时体检文档:检查任务类型与执行终端归属是否一致').action((options)=>{
|
|
15184
15801
|
runDoctor(options);
|
|
15185
15802
|
});
|
|
15186
15803
|
}
|
|
@@ -15228,6 +15845,13 @@ function syncDocument(doc, next) {
|
|
|
15228
15845
|
'docs',
|
|
15229
15846
|
'root'
|
|
15230
15847
|
], next.docs.root);
|
|
15848
|
+
if (doc.hasIn([
|
|
15849
|
+
'docs',
|
|
15850
|
+
'iterationsRoot'
|
|
15851
|
+
])) doc.deleteIn([
|
|
15852
|
+
'docs',
|
|
15853
|
+
'iterationsRoot'
|
|
15854
|
+
]);
|
|
15231
15855
|
for (const side of [
|
|
15232
15856
|
'cli',
|
|
15233
15857
|
'ui'
|
|
@@ -15257,11 +15881,15 @@ function syncDocument(doc, next) {
|
|
|
15257
15881
|
key
|
|
15258
15882
|
]);
|
|
15259
15883
|
for (const [key, terminal] of Object.entries(next.terminals)){
|
|
15260
|
-
doc.
|
|
15884
|
+
if (doc.hasIn([
|
|
15885
|
+
'terminals',
|
|
15886
|
+
key,
|
|
15887
|
+
'aliases'
|
|
15888
|
+
])) doc.deleteIn([
|
|
15261
15889
|
'terminals',
|
|
15262
15890
|
key,
|
|
15263
15891
|
'aliases'
|
|
15264
|
-
]
|
|
15892
|
+
]);
|
|
15265
15893
|
doc.setIn([
|
|
15266
15894
|
'terminals',
|
|
15267
15895
|
key,
|
|
@@ -15334,8 +15962,8 @@ function repoView(path) {
|
|
|
15334
15962
|
}
|
|
15335
15963
|
function readState(explicitPath) {
|
|
15336
15964
|
const configPath = paths_resolveConfigPath(explicitPath);
|
|
15337
|
-
const loaded =
|
|
15338
|
-
const checked = loaded.exists ?
|
|
15965
|
+
const loaded = config_loadConfig(explicitPath);
|
|
15966
|
+
const checked = loaded.exists ? checkConfigWithCatalog(loaded.raw, {
|
|
15339
15967
|
checkFs: true
|
|
15340
15968
|
}) : {
|
|
15341
15969
|
config: null,
|
|
@@ -15348,14 +15976,14 @@ function readState(explicitPath) {
|
|
|
15348
15976
|
issues: checked.issues,
|
|
15349
15977
|
backups: listBackups(explicitPath),
|
|
15350
15978
|
meta: {
|
|
15351
|
-
version: "0.
|
|
15979
|
+
version: "0.6.1",
|
|
15352
15980
|
features: SERVER_FEATURES
|
|
15353
15981
|
}
|
|
15354
15982
|
};
|
|
15355
15983
|
}
|
|
15356
15984
|
function saveConfig(raw, explicitPath) {
|
|
15357
15985
|
const configPath = paths_resolveConfigPath(explicitPath);
|
|
15358
|
-
const structural =
|
|
15986
|
+
const structural = checkConfigWithCatalog(raw, {
|
|
15359
15987
|
allowIncomplete: false,
|
|
15360
15988
|
checkFs: false
|
|
15361
15989
|
});
|
|
@@ -15363,7 +15991,7 @@ function saveConfig(raw, explicitPath) {
|
|
|
15363
15991
|
const detail = structural.issues.filter((issue)=>'error' === issue.level).map((issue)=>`- ${issue.message}`).join('\n');
|
|
15364
15992
|
throw new errors_CliError(`配置校验未通过,已取消保存:\n${detail}`, errors_EXIT.INVALID);
|
|
15365
15993
|
}
|
|
15366
|
-
const loaded =
|
|
15994
|
+
const loaded = config_loadConfig(explicitPath);
|
|
15367
15995
|
const doc = loaded.doc ?? createEmptyDocument();
|
|
15368
15996
|
syncDocument(doc, structural.config);
|
|
15369
15997
|
assertWritable(doc, configPath);
|
|
@@ -15397,12 +16025,12 @@ function restoreBackup(name, explicitPath) {
|
|
|
15397
16025
|
copyFileSync(configPath, external_node_path_join(dir, `config-${stamp}-before-restore.yaml`));
|
|
15398
16026
|
}
|
|
15399
16027
|
copyFileSync(source, configPath);
|
|
15400
|
-
const loaded =
|
|
16028
|
+
const loaded = config_loadConfig(explicitPath);
|
|
15401
16029
|
if (null === loaded.config) throw new errors_CliError(`备份内容不合法,已写入但需要人工修复:${configPath}`, errors_EXIT.INVALID);
|
|
15402
16030
|
return readState(explicitPath);
|
|
15403
16031
|
}
|
|
15404
16032
|
function resolveRequest(name, side, explicitPath) {
|
|
15405
|
-
const loaded =
|
|
16033
|
+
const loaded = config_loadConfig(explicitPath);
|
|
15406
16034
|
if (null === loaded.config) throw new errors_CliError(`配置未初始化或不合法:${loaded.path}`, errors_EXIT.NOT_FOUND);
|
|
15407
16035
|
const result = resolveTerminal(loaded.config, name);
|
|
15408
16036
|
const repos = {
|
|
@@ -15432,13 +16060,15 @@ function resetConfig(explicitPath) {
|
|
|
15432
16060
|
}
|
|
15433
16061
|
function inspectPath(target) {
|
|
15434
16062
|
const view = repoView(target);
|
|
16063
|
+
const hasDocsSkill = view.exists && external_node_fs_existsSync(external_node_path_join(target, 'skills', 'iteration-task-docs', 'SKILL.md'));
|
|
15435
16064
|
return {
|
|
15436
16065
|
...view,
|
|
15437
|
-
hasDocsSkill
|
|
16066
|
+
hasDocsSkill,
|
|
16067
|
+
iterationYears: view.exists ? listIterationYears(target, DEFAULT_ITERATIONS_ROOT) : []
|
|
15438
16068
|
};
|
|
15439
16069
|
}
|
|
15440
16070
|
function inspectOnboarding(configPath) {
|
|
15441
|
-
const loaded =
|
|
16071
|
+
const loaded = config_loadConfig(configPath);
|
|
15442
16072
|
const config = loaded.config;
|
|
15443
16073
|
const role = config?.profile.role ?? 'frontend';
|
|
15444
16074
|
const root = config?.docs.root ?? '';
|
|
@@ -15469,7 +16099,7 @@ function inspectOnboarding(configPath) {
|
|
|
15469
16099
|
nextStep: 'set-docs-root',
|
|
15470
16100
|
reason: '尚未选择本地文档仓库'
|
|
15471
16101
|
};
|
|
15472
|
-
const listed = listIterations(
|
|
16102
|
+
const listed = listIterations(layoutOf(config), 'local');
|
|
15473
16103
|
if (listed.accessible) return {
|
|
15474
16104
|
...base,
|
|
15475
16105
|
docsAccessible: true,
|
|
@@ -15483,7 +16113,7 @@ function inspectOnboarding(configPath) {
|
|
|
15483
16113
|
};
|
|
15484
16114
|
}
|
|
15485
16115
|
function completeOnboarding(draftRaw, configPath) {
|
|
15486
|
-
const structural =
|
|
16116
|
+
const structural = checkConfigWithCatalog(draftRaw, {
|
|
15487
16117
|
allowIncomplete: true,
|
|
15488
16118
|
checkFs: false
|
|
15489
16119
|
});
|
|
@@ -15498,7 +16128,7 @@ function completeOnboarding(draftRaw, configPath) {
|
|
|
15498
16128
|
return inspectOnboarding(configPath);
|
|
15499
16129
|
}
|
|
15500
16130
|
function assertDirectory(target) {
|
|
15501
|
-
const absolute =
|
|
16131
|
+
const absolute = external_node_path_isAbsolute(target) ? external_node_path_resolve(target) : external_node_path_resolve(homedir(), target);
|
|
15502
16132
|
if (!external_node_fs_existsSync(absolute)) throw new errors_CliError(`目录不存在:${absolute}`, errors_EXIT.NOT_FOUND);
|
|
15503
16133
|
if (!statSync(absolute).isDirectory()) throw new errors_CliError(`不是目录:${absolute}`, errors_EXIT.USAGE);
|
|
15504
16134
|
return absolute;
|
|
@@ -15743,23 +16373,456 @@ async function pickDirectoryNatively(options) {
|
|
|
15743
16373
|
if ('win32' === process.platform) return pickOnWindows(prompt, initial);
|
|
15744
16374
|
return pickOnLinux(prompt, initial);
|
|
15745
16375
|
}
|
|
16376
|
+
class OperationError extends errors_CliError {
|
|
16377
|
+
status;
|
|
16378
|
+
constructor(message, status = 400){
|
|
16379
|
+
super(message, 404 === status ? errors_EXIT.NOT_FOUND : errors_EXIT.INVALID);
|
|
16380
|
+
this.name = 'OperationError';
|
|
16381
|
+
this.status = status;
|
|
16382
|
+
}
|
|
16383
|
+
}
|
|
16384
|
+
function requireLayout(configPath) {
|
|
16385
|
+
const loaded = config_loadConfig(configPath);
|
|
16386
|
+
const layout = layoutOf(loaded.config);
|
|
16387
|
+
if (0 === layout.root.length) throw new OperationError('未配置文档仓库:请先在「文档仓库」页填写 docs.root 并保存', 404);
|
|
16388
|
+
return layout;
|
|
16389
|
+
}
|
|
15746
16390
|
function requireDocsRoot(configPath) {
|
|
15747
|
-
|
|
15748
|
-
const root = loaded.config?.docs.root ?? '';
|
|
15749
|
-
if (0 === root.length) throw new errors_CliError('未配置文档仓库:请先在「文档仓库」页填写 docs.root 并保存', errors_EXIT.NOT_FOUND);
|
|
15750
|
-
return root;
|
|
16391
|
+
return requireLayout(configPath).root;
|
|
15751
16392
|
}
|
|
15752
16393
|
function parseSource(value) {
|
|
15753
16394
|
return 'remote' === value ? 'remote' : 'local';
|
|
15754
16395
|
}
|
|
15755
|
-
function
|
|
15756
|
-
|
|
15757
|
-
|
|
15758
|
-
|
|
16396
|
+
function requireOwnDeveloper(input, configPath, options = {}) {
|
|
16397
|
+
const loaded = config_loadConfig(configPath);
|
|
16398
|
+
if (null === loaded.config) throw new OperationError('配置未初始化', 400);
|
|
16399
|
+
const developer = input.text('developer');
|
|
16400
|
+
if (developer !== loaded.config.profile.developer) throw new OperationError('只能修改自己的任务文档', options.forbidStatus ?? 403);
|
|
16401
|
+
return {
|
|
16402
|
+
developer,
|
|
16403
|
+
policy: loaded.config.docs.git?.ui ?? {
|
|
16404
|
+
commit: true,
|
|
16405
|
+
push: false
|
|
16406
|
+
}
|
|
16407
|
+
};
|
|
15759
16408
|
}
|
|
15760
|
-
function
|
|
15761
|
-
const
|
|
15762
|
-
|
|
16409
|
+
function requireAction(input) {
|
|
16410
|
+
const action = input.text('action');
|
|
16411
|
+
if (!(action in ACTION_META)) throw new OperationError(`未知动作:${action}`, 400);
|
|
16412
|
+
return action;
|
|
16413
|
+
}
|
|
16414
|
+
const OPERATIONS = [
|
|
16415
|
+
{
|
|
16416
|
+
name: 'state',
|
|
16417
|
+
http: {
|
|
16418
|
+
method: 'GET',
|
|
16419
|
+
path: '/api/state'
|
|
16420
|
+
},
|
|
16421
|
+
ipc: 'ylcwf:getState',
|
|
16422
|
+
ipcParams: [],
|
|
16423
|
+
run: (_input, context)=>readState(context.configPath)
|
|
16424
|
+
},
|
|
16425
|
+
{
|
|
16426
|
+
name: 'save-config',
|
|
16427
|
+
http: {
|
|
16428
|
+
method: 'PUT',
|
|
16429
|
+
path: '/api/config'
|
|
16430
|
+
},
|
|
16431
|
+
ipc: 'ylcwf:saveConfig',
|
|
16432
|
+
ipcParams: [
|
|
16433
|
+
'config'
|
|
16434
|
+
],
|
|
16435
|
+
run: (input, context)=>saveConfig(input.object('config'), context.configPath)
|
|
16436
|
+
},
|
|
16437
|
+
{
|
|
16438
|
+
name: 'resolve',
|
|
16439
|
+
http: {
|
|
16440
|
+
method: 'POST',
|
|
16441
|
+
path: '/api/resolve'
|
|
16442
|
+
},
|
|
16443
|
+
ipc: 'ylcwf:resolve',
|
|
16444
|
+
ipcParams: [
|
|
16445
|
+
'name',
|
|
16446
|
+
'side'
|
|
16447
|
+
],
|
|
16448
|
+
run: (input, context)=>{
|
|
16449
|
+
const side = input.text('side');
|
|
16450
|
+
const resolved = 'frontend' === side || 'backend' === side ? side : void 0;
|
|
16451
|
+
return resolveRequest(input.text('name'), resolved, context.configPath);
|
|
16452
|
+
}
|
|
16453
|
+
},
|
|
16454
|
+
{
|
|
16455
|
+
name: 'inspect',
|
|
16456
|
+
http: {
|
|
16457
|
+
method: 'GET',
|
|
16458
|
+
path: '/api/inspect'
|
|
16459
|
+
},
|
|
16460
|
+
ipc: 'ylcwf:inspect',
|
|
16461
|
+
ipcParams: [
|
|
16462
|
+
'path'
|
|
16463
|
+
],
|
|
16464
|
+
run: (input)=>inspectPath(input.text('path'))
|
|
16465
|
+
},
|
|
16466
|
+
{
|
|
16467
|
+
name: 'terminal-catalog',
|
|
16468
|
+
http: {
|
|
16469
|
+
method: 'GET',
|
|
16470
|
+
path: '/api/terminal-catalog'
|
|
16471
|
+
},
|
|
16472
|
+
ipc: 'ylcwf:terminalCatalog',
|
|
16473
|
+
ipcParams: [],
|
|
16474
|
+
run: (_input, context)=>{
|
|
16475
|
+
const loaded = config_loadConfig(context.configPath);
|
|
16476
|
+
const layout = layoutOf(loaded.config);
|
|
16477
|
+
if (0 === layout.root.length) return {
|
|
16478
|
+
path: null,
|
|
16479
|
+
terminals: [],
|
|
16480
|
+
issues: []
|
|
16481
|
+
};
|
|
16482
|
+
const loadedCatalog = loadTerminalCatalog(layout.root);
|
|
16483
|
+
return {
|
|
16484
|
+
path: loadedCatalog.path,
|
|
16485
|
+
terminals: loadedCatalog.catalog?.terminals ?? [],
|
|
16486
|
+
issues: loadedCatalog.issues
|
|
16487
|
+
};
|
|
16488
|
+
}
|
|
16489
|
+
},
|
|
16490
|
+
{
|
|
16491
|
+
name: 'onboarding',
|
|
16492
|
+
http: {
|
|
16493
|
+
method: 'GET',
|
|
16494
|
+
path: '/api/onboarding'
|
|
16495
|
+
},
|
|
16496
|
+
ipc: 'ylcwf:onboarding',
|
|
16497
|
+
ipcParams: [],
|
|
16498
|
+
run: (_input, context)=>inspectOnboarding(context.configPath)
|
|
16499
|
+
},
|
|
16500
|
+
{
|
|
16501
|
+
name: 'reset',
|
|
16502
|
+
http: {
|
|
16503
|
+
method: 'POST',
|
|
16504
|
+
path: '/api/reset'
|
|
16505
|
+
},
|
|
16506
|
+
ipc: 'ylcwf:reset',
|
|
16507
|
+
ipcParams: [],
|
|
16508
|
+
run: (_input, context)=>resetConfig(context.configPath)
|
|
16509
|
+
},
|
|
16510
|
+
{
|
|
16511
|
+
name: 'onboarding-complete',
|
|
16512
|
+
http: {
|
|
16513
|
+
method: 'POST',
|
|
16514
|
+
path: '/api/onboarding/complete'
|
|
16515
|
+
},
|
|
16516
|
+
ipc: 'ylcwf:completeOnboarding',
|
|
16517
|
+
ipcParams: [
|
|
16518
|
+
'config'
|
|
16519
|
+
],
|
|
16520
|
+
run: (input, context)=>completeOnboarding(input.object('config'), context.configPath)
|
|
16521
|
+
},
|
|
16522
|
+
{
|
|
16523
|
+
name: 'fs-list',
|
|
16524
|
+
http: {
|
|
16525
|
+
method: 'GET',
|
|
16526
|
+
path: '/api/fs/list'
|
|
16527
|
+
},
|
|
16528
|
+
ipc: 'ylcwf:fsList',
|
|
16529
|
+
ipcParams: [
|
|
16530
|
+
'path'
|
|
16531
|
+
],
|
|
16532
|
+
run: (input)=>listDirectories(input.optionalText('path'))
|
|
16533
|
+
},
|
|
16534
|
+
{
|
|
16535
|
+
name: 'fs-open',
|
|
16536
|
+
http: {
|
|
16537
|
+
method: 'POST',
|
|
16538
|
+
path: '/api/fs/open'
|
|
16539
|
+
},
|
|
16540
|
+
ipc: 'ylcwf:fsOpen',
|
|
16541
|
+
ipcParams: [
|
|
16542
|
+
'path'
|
|
16543
|
+
],
|
|
16544
|
+
run: (input)=>openInFileManager(input.text('path'))
|
|
16545
|
+
},
|
|
16546
|
+
{
|
|
16547
|
+
name: 'fs-pick',
|
|
16548
|
+
http: {
|
|
16549
|
+
method: 'POST',
|
|
16550
|
+
path: '/api/fs/pick'
|
|
16551
|
+
},
|
|
16552
|
+
ipc: 'ylcwf:pickDirectory',
|
|
16553
|
+
ipcParams: [
|
|
16554
|
+
'options'
|
|
16555
|
+
],
|
|
16556
|
+
run: async (input, context)=>{
|
|
16557
|
+
const options = input.object('options');
|
|
16558
|
+
const title = 'object' == typeof options && null !== options && 'string' == typeof Reflect.get(options, 'title') ? String(Reflect.get(options, 'title')).trim() : '';
|
|
16559
|
+
const rawDefault = 'object' == typeof options && null !== options ? Reflect.get(options, 'defaultPath') : void 0;
|
|
16560
|
+
const defaultPath = 'string' == typeof rawDefault && rawDefault.length > 0 ? rawDefault : null;
|
|
16561
|
+
const payload = {
|
|
16562
|
+
title: title.length > 0 ? title : void 0,
|
|
16563
|
+
defaultPath
|
|
16564
|
+
};
|
|
16565
|
+
const pick = context.pickDirectory ?? pickDirectoryNatively;
|
|
16566
|
+
return pick(payload);
|
|
16567
|
+
}
|
|
16568
|
+
},
|
|
16569
|
+
{
|
|
16570
|
+
name: 'reveal-config',
|
|
16571
|
+
http: {
|
|
16572
|
+
method: 'POST',
|
|
16573
|
+
path: '/api/reveal'
|
|
16574
|
+
},
|
|
16575
|
+
ipc: 'ylcwf:revealConfig',
|
|
16576
|
+
ipcParams: [],
|
|
16577
|
+
run: async (_input, context)=>{
|
|
16578
|
+
if (void 0 !== context.revealConfig) return context.revealConfig();
|
|
16579
|
+
return openInFileManager(external_node_path_dirname(paths_resolveConfigPath(context.configPath)));
|
|
16580
|
+
}
|
|
16581
|
+
},
|
|
16582
|
+
{
|
|
16583
|
+
name: 'task-actions',
|
|
16584
|
+
http: {
|
|
16585
|
+
method: 'GET',
|
|
16586
|
+
path: '/api/task-actions'
|
|
16587
|
+
},
|
|
16588
|
+
ipc: 'ylcwf:taskActions',
|
|
16589
|
+
ipcParams: [
|
|
16590
|
+
'iteration',
|
|
16591
|
+
'developer'
|
|
16592
|
+
],
|
|
16593
|
+
run: (input, context)=>{
|
|
16594
|
+
const loaded = config_loadConfig(context.configPath);
|
|
16595
|
+
const developer = input.text('developer');
|
|
16596
|
+
if (null === loaded.config || developer !== loaded.config.profile.developer) return {
|
|
16597
|
+
actions: {},
|
|
16598
|
+
editable: false
|
|
16599
|
+
};
|
|
16600
|
+
const layout = requireLayout(context.configPath);
|
|
16601
|
+
return {
|
|
16602
|
+
editable: true,
|
|
16603
|
+
actions: availableActions({
|
|
16604
|
+
docsRoot: layout.root,
|
|
16605
|
+
iterationsRoot: layout.iterationsRoot,
|
|
16606
|
+
iteration: input.text('iteration'),
|
|
16607
|
+
developer
|
|
16608
|
+
})
|
|
16609
|
+
};
|
|
16610
|
+
}
|
|
16611
|
+
},
|
|
16612
|
+
{
|
|
16613
|
+
name: 'task-action',
|
|
16614
|
+
http: {
|
|
16615
|
+
method: 'POST',
|
|
16616
|
+
path: '/api/task-action'
|
|
16617
|
+
},
|
|
16618
|
+
ipc: 'ylcwf:taskAction',
|
|
16619
|
+
ipcParams: [
|
|
16620
|
+
'iteration',
|
|
16621
|
+
'developer',
|
|
16622
|
+
'taskId',
|
|
16623
|
+
'action'
|
|
16624
|
+
],
|
|
16625
|
+
run: (input, context)=>{
|
|
16626
|
+
const { developer, policy } = requireOwnDeveloper(input, context.configPath);
|
|
16627
|
+
const layout = requireLayout(context.configPath);
|
|
16628
|
+
return applyTaskAction({
|
|
16629
|
+
docsRoot: layout.root,
|
|
16630
|
+
iterationsRoot: layout.iterationsRoot,
|
|
16631
|
+
iteration: input.text('iteration'),
|
|
16632
|
+
developer,
|
|
16633
|
+
taskId: input.text('taskId'),
|
|
16634
|
+
action: requireAction(input),
|
|
16635
|
+
policy
|
|
16636
|
+
});
|
|
16637
|
+
}
|
|
16638
|
+
},
|
|
16639
|
+
{
|
|
16640
|
+
name: 'task-batch',
|
|
16641
|
+
http: {
|
|
16642
|
+
method: 'POST',
|
|
16643
|
+
path: '/api/task-batch'
|
|
16644
|
+
},
|
|
16645
|
+
ipc: 'ylcwf:taskBatch',
|
|
16646
|
+
ipcParams: [
|
|
16647
|
+
'iteration',
|
|
16648
|
+
'developer',
|
|
16649
|
+
'taskIds',
|
|
16650
|
+
'action'
|
|
16651
|
+
],
|
|
16652
|
+
run: (input, context)=>{
|
|
16653
|
+
const { developer, policy } = requireOwnDeveloper(input, context.configPath);
|
|
16654
|
+
const layout = requireLayout(context.configPath);
|
|
16655
|
+
return applyBatchAction({
|
|
16656
|
+
docsRoot: layout.root,
|
|
16657
|
+
iterationsRoot: layout.iterationsRoot,
|
|
16658
|
+
iteration: input.text('iteration'),
|
|
16659
|
+
developer,
|
|
16660
|
+
taskIds: input.textList('taskIds'),
|
|
16661
|
+
action: requireAction(input),
|
|
16662
|
+
policy
|
|
16663
|
+
});
|
|
16664
|
+
}
|
|
16665
|
+
},
|
|
16666
|
+
{
|
|
16667
|
+
name: 'task-history',
|
|
16668
|
+
http: {
|
|
16669
|
+
method: 'GET',
|
|
16670
|
+
path: '/api/task-history'
|
|
16671
|
+
},
|
|
16672
|
+
ipc: 'ylcwf:taskHistory',
|
|
16673
|
+
ipcParams: [
|
|
16674
|
+
'iteration',
|
|
16675
|
+
'developer',
|
|
16676
|
+
'taskId'
|
|
16677
|
+
],
|
|
16678
|
+
run: (input)=>readTaskHistory({
|
|
16679
|
+
iteration: input.text('iteration'),
|
|
16680
|
+
developer: input.text('developer'),
|
|
16681
|
+
taskId: input.optionalText('taskId'),
|
|
16682
|
+
limit: 5
|
|
16683
|
+
})
|
|
16684
|
+
},
|
|
16685
|
+
{
|
|
16686
|
+
name: 'update-check',
|
|
16687
|
+
http: {
|
|
16688
|
+
method: 'GET',
|
|
16689
|
+
path: '/api/update/check'
|
|
16690
|
+
},
|
|
16691
|
+
ipc: 'ylcwf:updateCheck',
|
|
16692
|
+
ipcParams: [
|
|
16693
|
+
'force'
|
|
16694
|
+
],
|
|
16695
|
+
run: (input)=>checkUpdate(input.bool('force'))
|
|
16696
|
+
},
|
|
16697
|
+
{
|
|
16698
|
+
name: 'git-branches',
|
|
16699
|
+
http: {
|
|
16700
|
+
method: 'GET',
|
|
16701
|
+
path: '/api/git/branches'
|
|
16702
|
+
},
|
|
16703
|
+
ipc: 'ylcwf:gitBranches',
|
|
16704
|
+
ipcParams: [],
|
|
16705
|
+
run: (_input, context)=>getBranchInfo(requireDocsRoot(context.configPath))
|
|
16706
|
+
},
|
|
16707
|
+
{
|
|
16708
|
+
name: 'git-status',
|
|
16709
|
+
http: {
|
|
16710
|
+
method: 'GET',
|
|
16711
|
+
path: '/api/git/status'
|
|
16712
|
+
},
|
|
16713
|
+
ipc: 'ylcwf:gitStatus',
|
|
16714
|
+
ipcParams: [],
|
|
16715
|
+
run: (_input, context)=>getGitStatus(requireDocsRoot(context.configPath))
|
|
16716
|
+
},
|
|
16717
|
+
{
|
|
16718
|
+
name: 'git-fetch',
|
|
16719
|
+
http: {
|
|
16720
|
+
method: 'POST',
|
|
16721
|
+
path: '/api/git/fetch'
|
|
16722
|
+
},
|
|
16723
|
+
ipc: 'ylcwf:gitFetch',
|
|
16724
|
+
ipcParams: [],
|
|
16725
|
+
run: (_input, context)=>fetchRemote(requireDocsRoot(context.configPath))
|
|
16726
|
+
},
|
|
16727
|
+
{
|
|
16728
|
+
name: 'iterations',
|
|
16729
|
+
http: {
|
|
16730
|
+
method: 'GET',
|
|
16731
|
+
path: '/api/iterations'
|
|
16732
|
+
},
|
|
16733
|
+
ipc: 'ylcwf:iterations',
|
|
16734
|
+
ipcParams: [
|
|
16735
|
+
'source',
|
|
16736
|
+
'ref'
|
|
16737
|
+
],
|
|
16738
|
+
run: (input, context)=>{
|
|
16739
|
+
const loaded = config_loadConfig(context.configPath);
|
|
16740
|
+
return listIterations(layoutOf(loaded.config), parseSource(input.text('source')), input.optionalText('ref'));
|
|
16741
|
+
}
|
|
16742
|
+
},
|
|
16743
|
+
{
|
|
16744
|
+
name: 'iteration-summary',
|
|
16745
|
+
http: {
|
|
16746
|
+
method: 'POST',
|
|
16747
|
+
path: '/api/iteration-summary'
|
|
16748
|
+
},
|
|
16749
|
+
ipc: 'ylcwf:iterationSummary',
|
|
16750
|
+
ipcParams: [
|
|
16751
|
+
'iteration',
|
|
16752
|
+
'source',
|
|
16753
|
+
'ref'
|
|
16754
|
+
],
|
|
16755
|
+
run: (input, context)=>readIterationSummary(requireLayout(context.configPath), input.text('iteration'), parseSource(input.text('source')), input.optionalText('ref'))
|
|
16756
|
+
},
|
|
16757
|
+
{
|
|
16758
|
+
name: 'iteration-doc',
|
|
16759
|
+
http: {
|
|
16760
|
+
method: 'POST',
|
|
16761
|
+
path: '/api/iteration-doc'
|
|
16762
|
+
},
|
|
16763
|
+
ipc: 'ylcwf:iterationDoc',
|
|
16764
|
+
ipcParams: [
|
|
16765
|
+
'iteration',
|
|
16766
|
+
'developer',
|
|
16767
|
+
'source',
|
|
16768
|
+
'ref'
|
|
16769
|
+
],
|
|
16770
|
+
run: (input, context)=>readIterationDoc(requireLayout(context.configPath), input.text('iteration'), input.text('developer'), parseSource(input.text('source')), void 0, input.optionalText('ref'))
|
|
16771
|
+
},
|
|
16772
|
+
{
|
|
16773
|
+
name: 'backups-restore',
|
|
16774
|
+
http: {
|
|
16775
|
+
method: 'POST',
|
|
16776
|
+
path: '/api/backups/restore'
|
|
16777
|
+
},
|
|
16778
|
+
ipc: 'ylcwf:restore',
|
|
16779
|
+
ipcParams: [
|
|
16780
|
+
'name'
|
|
16781
|
+
],
|
|
16782
|
+
run: (input, context)=>restoreBackup(input.text('name'), context.configPath)
|
|
16783
|
+
}
|
|
16784
|
+
];
|
|
16785
|
+
const HTTP_INDEX = new Map(OPERATIONS.map((operation)=>[
|
|
16786
|
+
`${operation.http.method} ${operation.http.path}`,
|
|
16787
|
+
operation
|
|
16788
|
+
]));
|
|
16789
|
+
function findHttpOperation(method, pathname) {
|
|
16790
|
+
if ('GET' !== method && 'POST' !== method && 'PUT' !== method) return null;
|
|
16791
|
+
return HTTP_INDEX.get(`${method} ${pathname}`) ?? null;
|
|
16792
|
+
}
|
|
16793
|
+
function httpInput(query, body) {
|
|
16794
|
+
const fromBody = (name)=>{
|
|
16795
|
+
if ('object' != typeof body || null === body) return;
|
|
16796
|
+
return Reflect.get(body, name);
|
|
16797
|
+
};
|
|
16798
|
+
return {
|
|
16799
|
+
text (name) {
|
|
16800
|
+
const value = fromBody(name);
|
|
16801
|
+
if ('string' == typeof value) return value;
|
|
16802
|
+
if ('number' == typeof value || 'boolean' == typeof value) return String(value);
|
|
16803
|
+
return query.get(name) ?? '';
|
|
16804
|
+
},
|
|
16805
|
+
optionalText (name) {
|
|
16806
|
+
const text = this.text(name).trim();
|
|
16807
|
+
return 0 === text.length ? void 0 : text;
|
|
16808
|
+
},
|
|
16809
|
+
bool (name) {
|
|
16810
|
+
const value = fromBody(name);
|
|
16811
|
+
if (true === value) return true;
|
|
16812
|
+
const text = 'string' == typeof value ? value : query.get(name);
|
|
16813
|
+
return '1' === text || 'true' === text;
|
|
16814
|
+
},
|
|
16815
|
+
textList (name) {
|
|
16816
|
+
const value = fromBody(name);
|
|
16817
|
+
if (!Array.isArray(value)) return [];
|
|
16818
|
+
return value.filter((item)=>'string' == typeof item);
|
|
16819
|
+
},
|
|
16820
|
+
object (name) {
|
|
16821
|
+
const value = fromBody(name);
|
|
16822
|
+
if (void 0 !== value) return value;
|
|
16823
|
+
return body;
|
|
16824
|
+
}
|
|
16825
|
+
};
|
|
15763
16826
|
}
|
|
15764
16827
|
const MIME = {
|
|
15765
16828
|
'.html': 'text/html; charset=utf-8',
|
|
@@ -15785,6 +16848,12 @@ function sendJson(response, status, payload) {
|
|
|
15785
16848
|
response.end(body);
|
|
15786
16849
|
}
|
|
15787
16850
|
function sendError(response, error) {
|
|
16851
|
+
if (error instanceof OperationError) return void sendJson(response, error.status, {
|
|
16852
|
+
error: {
|
|
16853
|
+
code: error.status,
|
|
16854
|
+
message: error.message
|
|
16855
|
+
}
|
|
16856
|
+
});
|
|
15788
16857
|
if (error instanceof errors_CliError) return void sendJson(response, error.exitCode === errors_EXIT.NOT_FOUND ? 404 : 400, {
|
|
15789
16858
|
error: {
|
|
15790
16859
|
code: error.exitCode,
|
|
@@ -15840,6 +16909,9 @@ function serveStatic(response, uiDir, pathname) {
|
|
|
15840
16909
|
async function startServer(options) {
|
|
15841
16910
|
const host = options.host ?? '127.0.0.1';
|
|
15842
16911
|
const token = options.token;
|
|
16912
|
+
const context = {
|
|
16913
|
+
configPath: options.configPath
|
|
16914
|
+
};
|
|
15843
16915
|
const server = external_node_http_createServer((request, response)=>{
|
|
15844
16916
|
(async ()=>{
|
|
15845
16917
|
try {
|
|
@@ -15859,190 +16931,16 @@ async function startServer(options) {
|
|
|
15859
16931
|
message: '令牌无效,请从启动时打开的地址访问'
|
|
15860
16932
|
}
|
|
15861
16933
|
});
|
|
15862
|
-
|
|
15863
|
-
if (
|
|
15864
|
-
const body = await readJsonBody(request);
|
|
15865
|
-
const raw = null !== body && 'object' == typeof body && 'config' in body ? body.config : body;
|
|
15866
|
-
sendJson(response, 200, saveConfig(raw, options.configPath));
|
|
15867
|
-
return;
|
|
15868
|
-
}
|
|
15869
|
-
if ('POST' === request.method && '/api/resolve' === url.pathname) {
|
|
15870
|
-
const body = await readJsonBody(request);
|
|
15871
|
-
const payload = body ?? {};
|
|
15872
|
-
const name = 'string' == typeof payload.name ? payload.name : '';
|
|
15873
|
-
const side = 'frontend' === payload.side || 'backend' === payload.side ? payload.side : void 0;
|
|
15874
|
-
sendJson(response, 200, resolveRequest(name, side, options.configPath));
|
|
15875
|
-
return;
|
|
15876
|
-
}
|
|
15877
|
-
if ('GET' === request.method && '/api/inspect' === url.pathname) {
|
|
15878
|
-
const target = url.searchParams.get('path') ?? '';
|
|
15879
|
-
sendJson(response, 200, inspectPath(target));
|
|
15880
|
-
return;
|
|
15881
|
-
}
|
|
15882
|
-
if ('GET' === request.method && '/api/onboarding' === url.pathname) return void sendJson(response, 200, inspectOnboarding(options.configPath));
|
|
15883
|
-
if ('POST' === request.method && '/api/reset' === url.pathname) {
|
|
15884
|
-
const body = await readJsonBody(request);
|
|
15885
|
-
'object' == typeof body && null !== body && Reflect.get(body, 'all');
|
|
15886
|
-
sendJson(response, 200, resetConfig(options.configPath));
|
|
15887
|
-
return;
|
|
15888
|
-
}
|
|
15889
|
-
if ('POST' === request.method && '/api/onboarding/complete' === url.pathname) {
|
|
15890
|
-
const body = await readJsonBody(request);
|
|
15891
|
-
const payload = body ?? {};
|
|
15892
|
-
sendJson(response, 200, completeOnboarding(payload.config, options.configPath));
|
|
15893
|
-
return;
|
|
15894
|
-
}
|
|
15895
|
-
if ('GET' === request.method && '/api/fs/list' === url.pathname) return void sendJson(response, 200, listDirectories(url.searchParams.get('path') ?? void 0));
|
|
15896
|
-
if ('POST' === request.method && '/api/fs/open' === url.pathname) {
|
|
15897
|
-
const body = await readJsonBody(request);
|
|
15898
|
-
sendJson(response, 200, await openInFileManager(pickString(body, 'path')));
|
|
15899
|
-
return;
|
|
15900
|
-
}
|
|
15901
|
-
if ('POST' === request.method && '/api/fs/pick' === url.pathname) {
|
|
15902
|
-
const body = await readJsonBody(request);
|
|
15903
|
-
const title = pickString(body, 'title');
|
|
15904
|
-
const defaultPath = pickString(body, 'defaultPath');
|
|
15905
|
-
sendJson(response, 200, await pickDirectoryNatively({
|
|
15906
|
-
title: title.length > 0 ? title : void 0,
|
|
15907
|
-
defaultPath: defaultPath.length > 0 ? defaultPath : null
|
|
15908
|
-
}));
|
|
15909
|
-
return;
|
|
15910
|
-
}
|
|
15911
|
-
if ('POST' === request.method && '/api/reveal' === url.pathname) return void sendJson(response, 200, await openInFileManager(external_node_path_dirname(paths_resolveConfigPath(options.configPath))));
|
|
15912
|
-
if ('GET' === request.method && '/api/task-actions' === url.pathname) {
|
|
15913
|
-
const loaded = loadConfig(options.configPath);
|
|
15914
|
-
const developer = url.searchParams.get('developer') ?? '';
|
|
15915
|
-
if (null === loaded.config || developer !== loaded.config.profile.developer) return void sendJson(response, 200, {
|
|
15916
|
-
actions: {},
|
|
15917
|
-
editable: false
|
|
15918
|
-
});
|
|
15919
|
-
const root = requireDocsRoot(options.configPath);
|
|
15920
|
-
sendJson(response, 200, {
|
|
15921
|
-
editable: true,
|
|
15922
|
-
actions: availableActions({
|
|
15923
|
-
docsRoot: root,
|
|
15924
|
-
iteration: url.searchParams.get('iteration') ?? '',
|
|
15925
|
-
developer
|
|
15926
|
-
})
|
|
15927
|
-
});
|
|
15928
|
-
return;
|
|
15929
|
-
}
|
|
15930
|
-
if ('POST' === request.method && '/api/task-action' === url.pathname) {
|
|
15931
|
-
const body = await readJsonBody(request);
|
|
15932
|
-
const loaded = loadConfig(options.configPath);
|
|
15933
|
-
if (null === loaded.config) return void sendJson(response, 400, {
|
|
15934
|
-
error: {
|
|
15935
|
-
code: 400,
|
|
15936
|
-
message: '配置未初始化'
|
|
15937
|
-
}
|
|
15938
|
-
});
|
|
15939
|
-
const developer = pickString(body, 'developer');
|
|
15940
|
-
if (developer !== loaded.config.profile.developer) return void sendJson(response, 403, {
|
|
15941
|
-
error: {
|
|
15942
|
-
code: 403,
|
|
15943
|
-
message: '只能修改自己的任务文档'
|
|
15944
|
-
}
|
|
15945
|
-
});
|
|
15946
|
-
const action = pickString(body, 'action');
|
|
15947
|
-
if (!(action in ACTION_META)) return void sendJson(response, 400, {
|
|
15948
|
-
error: {
|
|
15949
|
-
code: 400,
|
|
15950
|
-
message: `未知动作:${action}`
|
|
15951
|
-
}
|
|
15952
|
-
});
|
|
15953
|
-
const root = requireDocsRoot(options.configPath);
|
|
15954
|
-
sendJson(response, 200, applyTaskAction({
|
|
15955
|
-
docsRoot: root,
|
|
15956
|
-
iteration: pickString(body, 'iteration'),
|
|
15957
|
-
developer,
|
|
15958
|
-
taskId: pickString(body, 'taskId'),
|
|
15959
|
-
action: action,
|
|
15960
|
-
policy: loaded.config.docs.git?.ui ?? {
|
|
15961
|
-
commit: true,
|
|
15962
|
-
push: false
|
|
15963
|
-
}
|
|
15964
|
-
}));
|
|
15965
|
-
return;
|
|
15966
|
-
}
|
|
15967
|
-
if ('POST' === request.method && '/api/task-batch' === url.pathname) {
|
|
15968
|
-
const body = await readJsonBody(request);
|
|
15969
|
-
const loaded = loadConfig(options.configPath);
|
|
15970
|
-
if (null === loaded.config) return void sendJson(response, 400, {
|
|
15971
|
-
error: {
|
|
15972
|
-
code: 400,
|
|
15973
|
-
message: '配置未初始化'
|
|
15974
|
-
}
|
|
15975
|
-
});
|
|
15976
|
-
const developer = pickString(body, 'developer');
|
|
15977
|
-
if (developer !== loaded.config.profile.developer) return void sendJson(response, 403, {
|
|
15978
|
-
error: {
|
|
15979
|
-
code: 403,
|
|
15980
|
-
message: '只能修改自己的任务文档'
|
|
15981
|
-
}
|
|
15982
|
-
});
|
|
15983
|
-
const action = pickString(body, 'action');
|
|
15984
|
-
if (!(action in ACTION_META)) return void sendJson(response, 400, {
|
|
15985
|
-
error: {
|
|
15986
|
-
code: 400,
|
|
15987
|
-
message: `未知动作:${action}`
|
|
15988
|
-
}
|
|
15989
|
-
});
|
|
15990
|
-
const payload = body ?? {};
|
|
15991
|
-
const taskIds = Array.isArray(payload.taskIds) ? payload.taskIds.filter((item)=>'string' == typeof item) : [];
|
|
15992
|
-
sendJson(response, 200, applyBatchAction({
|
|
15993
|
-
docsRoot: requireDocsRoot(options.configPath),
|
|
15994
|
-
iteration: pickString(body, 'iteration'),
|
|
15995
|
-
developer,
|
|
15996
|
-
taskIds,
|
|
15997
|
-
action: action,
|
|
15998
|
-
policy: loaded.config.docs.git?.ui ?? {
|
|
15999
|
-
commit: true,
|
|
16000
|
-
push: false
|
|
16001
|
-
}
|
|
16002
|
-
}));
|
|
16003
|
-
return;
|
|
16004
|
-
}
|
|
16005
|
-
if ('GET' === request.method && '/api/task-history' === url.pathname) return void sendJson(response, 200, readTaskHistory({
|
|
16006
|
-
iteration: url.searchParams.get('iteration') ?? '',
|
|
16007
|
-
developer: url.searchParams.get('developer') ?? '',
|
|
16008
|
-
taskId: url.searchParams.get('taskId') ?? void 0,
|
|
16009
|
-
limit: 5
|
|
16010
|
-
}));
|
|
16011
|
-
if ('GET' === request.method && '/api/update/check' === url.pathname) return void sendJson(response, 200, await checkUpdate('1' === url.searchParams.get('force')));
|
|
16012
|
-
if ('GET' === request.method && '/api/git/branches' === url.pathname) return void sendJson(response, 200, getBranchInfo(requireDocsRoot(options.configPath)));
|
|
16013
|
-
if ('GET' === request.method && '/api/git/status' === url.pathname) return void sendJson(response, 200, getGitStatus(requireDocsRoot(options.configPath)));
|
|
16014
|
-
if ('POST' === request.method && '/api/git/fetch' === url.pathname) return void sendJson(response, 200, fetchRemote(requireDocsRoot(options.configPath)));
|
|
16015
|
-
if ('GET' === request.method && '/api/iterations' === url.pathname) {
|
|
16016
|
-
const source = parseSource(url.searchParams.get('source'));
|
|
16017
|
-
const loaded = loadConfig(options.configPath);
|
|
16018
|
-
const ref = url.searchParams.get('ref') ?? void 0;
|
|
16019
|
-
sendJson(response, 200, listIterations(loaded.config?.docs.root ?? '', source, ref));
|
|
16020
|
-
return;
|
|
16021
|
-
}
|
|
16022
|
-
if ('POST' === request.method && '/api/iteration-summary' === url.pathname) {
|
|
16023
|
-
const body = await readJsonBody(request);
|
|
16024
|
-
const root = requireDocsRoot(options.configPath);
|
|
16025
|
-
sendJson(response, 200, readIterationSummary(root, pickString(body, 'iteration'), parseSource(pickString(body, 'source')), pickOptionalString(body, 'ref')));
|
|
16026
|
-
return;
|
|
16027
|
-
}
|
|
16028
|
-
if ('POST' === request.method && '/api/iteration-doc' === url.pathname) {
|
|
16029
|
-
const body = await readJsonBody(request);
|
|
16030
|
-
const root = requireDocsRoot(options.configPath);
|
|
16031
|
-
sendJson(response, 200, readIterationDoc(root, pickString(body, 'iteration'), pickString(body, 'developer'), parseSource(pickString(body, 'source')), void 0, pickOptionalString(body, 'ref')));
|
|
16032
|
-
return;
|
|
16033
|
-
}
|
|
16034
|
-
if ('POST' === request.method && '/api/backups/restore' === url.pathname) {
|
|
16035
|
-
const body = await readJsonBody(request);
|
|
16036
|
-
const payload = body ?? {};
|
|
16037
|
-
sendJson(response, 200, restoreBackup(String(payload.name ?? ''), options.configPath));
|
|
16038
|
-
return;
|
|
16039
|
-
}
|
|
16040
|
-
sendJson(response, 404, {
|
|
16934
|
+
const operation = findHttpOperation(request.method, url.pathname);
|
|
16935
|
+
if (null === operation) return void sendJson(response, 404, {
|
|
16041
16936
|
error: {
|
|
16042
16937
|
code: 404,
|
|
16043
16938
|
message: `未知接口:${url.pathname}`
|
|
16044
16939
|
}
|
|
16045
16940
|
});
|
|
16941
|
+
const body = 'GET' === operation.http.method ? void 0 : await readJsonBody(request);
|
|
16942
|
+
const result = await operation.run(httpInput(url.searchParams, body), context);
|
|
16943
|
+
sendJson(response, 200, result);
|
|
16046
16944
|
} catch (error) {
|
|
16047
16945
|
sendError(response, error);
|
|
16048
16946
|
}
|
|
@@ -16158,6 +17056,130 @@ function registerServe(program) {
|
|
|
16158
17056
|
await runServe(options);
|
|
16159
17057
|
});
|
|
16160
17058
|
}
|
|
17059
|
+
function requireCatalog(docsRoot) {
|
|
17060
|
+
const loaded = loadYapiCatalog(docsRoot);
|
|
17061
|
+
if (null !== loaded.catalog) return loaded.catalog;
|
|
17062
|
+
if (0 === loaded.issues.length) throw new errors_CliError(`文档仓库缺少 ${YAPI_PLATFORM_FILE}:${loaded.path}\n该文件用于把执行终端映射到 YAPI 的 groupId / projectIds;如暂不需要此能力可忽略本提示`, errors_EXIT.NOT_FOUND);
|
|
17063
|
+
const detail = loaded.issues.map((issue)=>`- ${issue.message}`).join('\n');
|
|
17064
|
+
throw new errors_CliError(`${YAPI_PLATFORM_FILE} 结构不合法:${loaded.path}\n${detail}`, errors_EXIT.INVALID);
|
|
17065
|
+
}
|
|
17066
|
+
function failUnmatched(match, input, format) {
|
|
17067
|
+
const candidates = 0 === match.candidates.length ? '(无)' : match.candidates.join('、');
|
|
17068
|
+
throw new errors_CliError(`${YAPI_PLATFORM_FILE} 中没有执行终端「${input}」的记录\n可选执行终端:${candidates}\n如命名不一致,请把 json 的 terminal 改成 ylcwf 配置里的执行终端名`, errors_EXIT.NOT_FOUND);
|
|
17069
|
+
}
|
|
17070
|
+
function printMatch(match) {
|
|
17071
|
+
printLine(`执行终端 ${match.platform?.terminal ?? ''}${null === match.terminalName ? '' : `(配置:${match.terminalName})`}`);
|
|
17072
|
+
printLine(`命中方式 ${match.matchedBy ?? ''}`);
|
|
17073
|
+
printLine(`平台 ${match.platform?.platform ?? '—'}`);
|
|
17074
|
+
printLine(`groupId ${match.platform?.groupId ?? ''}${null === match.group ? '' : `(${match.group.name})`}`);
|
|
17075
|
+
printLine(`projectIds ${(match.platform?.projectIds ?? []).join(', ')}`);
|
|
17076
|
+
}
|
|
17077
|
+
function findSubject(layout, iteration, options) {
|
|
17078
|
+
const docs = loadDeveloperDocs(layout, iteration);
|
|
17079
|
+
if (void 0 !== options.taskId) {
|
|
17080
|
+
const wanted = options.taskId.trim().replace(/^#?/, '#');
|
|
17081
|
+
for (const { doc } of docs){
|
|
17082
|
+
const task = doc.validation.tasks.find((item)=>item.id === wanted);
|
|
17083
|
+
if (void 0 !== task) return {
|
|
17084
|
+
terminal: task.terminal,
|
|
17085
|
+
side: 0 === task.scope.length ? null : task.scope,
|
|
17086
|
+
label: task.id
|
|
17087
|
+
};
|
|
17088
|
+
}
|
|
17089
|
+
throw new errors_CliError(`迭代 ${iteration} 中未找到任务:${wanted}`, errors_EXIT.NOT_FOUND);
|
|
17090
|
+
}
|
|
17091
|
+
const wanted = (options.requirementId ?? '').trim().replace(/^#?/, '#');
|
|
17092
|
+
for (const { doc } of docs){
|
|
17093
|
+
const requirement = doc.validation.requirements.find((item)=>item.id === wanted);
|
|
17094
|
+
if (void 0 !== requirement) return {
|
|
17095
|
+
terminal: requirement.terminal,
|
|
17096
|
+
side: null,
|
|
17097
|
+
label: requirement.id
|
|
17098
|
+
};
|
|
17099
|
+
}
|
|
17100
|
+
throw new errors_CliError(`迭代 ${iteration} 中未找到需求:${wanted}`, errors_EXIT.NOT_FOUND);
|
|
17101
|
+
}
|
|
17102
|
+
function yapi_runList(options) {
|
|
17103
|
+
const ctx = requireQueryContext(options);
|
|
17104
|
+
const catalog = requireCatalog(ctx.layout.root);
|
|
17105
|
+
if ('json' === ctx.format) return void printJson(catalog);
|
|
17106
|
+
const rows = catalog.platforms.map((item)=>[
|
|
17107
|
+
item.terminal,
|
|
17108
|
+
item.platform ?? '—',
|
|
17109
|
+
`${item.groupId}(${catalog.groups.find((group)=>group.groupId === item.groupId)?.name ?? '未知分组'})`,
|
|
17110
|
+
item.projectIds.join(', ')
|
|
17111
|
+
]);
|
|
17112
|
+
for (const line of renderTable([
|
|
17113
|
+
'执行终端',
|
|
17114
|
+
'平台',
|
|
17115
|
+
'groupId',
|
|
17116
|
+
'projectIds'
|
|
17117
|
+
], rows))printLine(line);
|
|
17118
|
+
printLine('');
|
|
17119
|
+
printLine('提示:terminal 必须与 ylcwf 配置的 terminals 键完全一致(仅忽略空格/全角/大小写),否则会未命中');
|
|
17120
|
+
}
|
|
17121
|
+
function yapi_runShow(input, options) {
|
|
17122
|
+
const ctx = requireQueryContext(options);
|
|
17123
|
+
const catalog = requireCatalog(ctx.layout.root);
|
|
17124
|
+
const match = matchYapiPlatform({
|
|
17125
|
+
catalog,
|
|
17126
|
+
terminals: ctx.config.terminals,
|
|
17127
|
+
input
|
|
17128
|
+
});
|
|
17129
|
+
if ('json' === ctx.format) {
|
|
17130
|
+
if (!match.matched) failUnmatched(match, input, ctx.format);
|
|
17131
|
+
printJson({
|
|
17132
|
+
input,
|
|
17133
|
+
...match
|
|
17134
|
+
});
|
|
17135
|
+
return;
|
|
17136
|
+
}
|
|
17137
|
+
if (!match.matched) failUnmatched(match, input, ctx.format);
|
|
17138
|
+
printLine(`输入 ${input}`);
|
|
17139
|
+
printMatch(match);
|
|
17140
|
+
}
|
|
17141
|
+
function runFromDoc(kind, id, options) {
|
|
17142
|
+
const ctx = requireQueryContext(options);
|
|
17143
|
+
const catalog = requireCatalog(ctx.layout.root);
|
|
17144
|
+
const iterations = loadIterations(ctx.layout);
|
|
17145
|
+
const iteration = resolveIterationName(options, ctx.layout, iterations, 'task' === kind ? {
|
|
17146
|
+
taskId: id.trim().replace(/^#?/, '#')
|
|
17147
|
+
} : {
|
|
17148
|
+
requirementId: id.trim().replace(/^#?/, '#')
|
|
17149
|
+
});
|
|
17150
|
+
const subject = findSubject(ctx.layout, iteration, 'task' === kind ? {
|
|
17151
|
+
taskId: id
|
|
17152
|
+
} : {
|
|
17153
|
+
requirementId: id
|
|
17154
|
+
});
|
|
17155
|
+
const match = matchYapiPlatform({
|
|
17156
|
+
catalog,
|
|
17157
|
+
terminals: ctx.config.terminals,
|
|
17158
|
+
input: subject.terminal
|
|
17159
|
+
});
|
|
17160
|
+
if ('json' === ctx.format) {
|
|
17161
|
+
if (!match.matched) failUnmatched(match, subject.terminal, ctx.format);
|
|
17162
|
+
printJson({
|
|
17163
|
+
['task' === kind ? 'taskId' : 'requirementId']: subject.label,
|
|
17164
|
+
iteration,
|
|
17165
|
+
terminalRepo: subject.terminal,
|
|
17166
|
+
side: subject.side,
|
|
17167
|
+
...match
|
|
17168
|
+
});
|
|
17169
|
+
return;
|
|
17170
|
+
}
|
|
17171
|
+
printLine(`${'task' === kind ? '任务' : '需求'} ${subject.label}(迭代 ${iteration})`);
|
|
17172
|
+
printLine(`文档执行终端 ${subject.terminal}${null === subject.side ? '' : `(所属端:${subject.side})`}`);
|
|
17173
|
+
if (!match.matched) failUnmatched(match, subject.terminal, ctx.format);
|
|
17174
|
+
printMatch(match);
|
|
17175
|
+
}
|
|
17176
|
+
function registerYapi(program) {
|
|
17177
|
+
const yapi = program.command('yapi').description('按执行终端查询接口文档平台(YAPI)的 groupId 与 projectIds');
|
|
17178
|
+
yapi.command('list').description(`列出文档仓库 ${YAPI_PLATFORM_FILE} 中的全部映射`).option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').action((options)=>yapi_runList(options));
|
|
17179
|
+
yapi.command('show <terminal>').description('执行终端名 / 仓库名 → groupId 与 projectIds').option('-c, --config <path>', '指定配置文件路径').option('--format <format>', '输出格式:human | json', 'human').action((terminal, options)=>yapi_runShow(terminal, options));
|
|
17180
|
+
yapi.command('task <taskId>').description('按任务编号解析:读文档的「执行终端」列再查 YAPI 映射').option('-c, --config <path>', '指定配置文件路径').option('-i, --iteration <name>', '迭代目录名(可省略)').option('--format <format>', '输出格式:human | json', 'human').action((taskId, options)=>runFromDoc('task', taskId, options));
|
|
17181
|
+
yapi.command('requirement <requirementId>').description('按需求编号解析:读文档的「执行终端」列再查 YAPI 映射').option('-c, --config <path>', '指定配置文件路径').option('-i, --iteration <name>', '迭代目录名(可省略)').option('--format <format>', '输出格式:human | json', 'human').action((requirementId, options)=>runFromDoc('requirement', requirementId, options));
|
|
17182
|
+
}
|
|
16161
17183
|
async function runReset(options) {
|
|
16162
17184
|
const configPath = paths_resolveConfigPath(options.config);
|
|
16163
17185
|
const targets = collectResetTargets(configPath);
|
|
@@ -16183,7 +17205,7 @@ function registerReset(program) {
|
|
|
16183
17205
|
}
|
|
16184
17206
|
function buildProgram() {
|
|
16185
17207
|
const program = new command_Command();
|
|
16186
|
-
program.name('ylcwf').description('YLC
|
|
17208
|
+
program.name('ylcwf').description('YLC 研发工作流配置:文档仓库、开发者标识、默认角色与执行终端仓库映射').version("0.6.1", '-v, --version', '显示版本号').showHelpAfterError();
|
|
16187
17209
|
registerInit(program);
|
|
16188
17210
|
registerShow(program);
|
|
16189
17211
|
registerGet(program);
|
|
@@ -16199,6 +17221,7 @@ function buildProgram() {
|
|
|
16199
17221
|
registerDoctor(program);
|
|
16200
17222
|
registerPath(program);
|
|
16201
17223
|
registerServe(program);
|
|
17224
|
+
registerYapi(program);
|
|
16202
17225
|
registerReset(program);
|
|
16203
17226
|
return program;
|
|
16204
17227
|
}
|