@slidev/cli 0.49.10 → 0.49.12
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/README.md +1 -1
- package/dist/{build-I53OZ3FH.mjs → build-U63KCQIF.mjs} +6 -16
- package/dist/{chunk-SRWMA3GA.mjs → chunk-KNG6PIQ7.mjs} +517 -464
- package/dist/chunk-Z7QBEIOP.mjs +29 -0
- package/dist/cli.mjs +9 -5
- package/dist/{export-BSOHDR2A.mjs → export-IRR3JZOI.mjs} +13 -6
- package/dist/index.mjs +2 -2
- package/package.json +20 -21
- package/template.md +15 -15
- package/dist/chunk-YTSG6ZR5.mjs +0 -44
|
@@ -15,9 +15,9 @@ import {
|
|
|
15
15
|
__toESM
|
|
16
16
|
} from "./chunk-BXO7ZPPU.mjs";
|
|
17
17
|
|
|
18
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
18
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/identity.js
|
|
19
19
|
var require_identity = __commonJS({
|
|
20
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
20
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/identity.js"(exports) {
|
|
21
21
|
"use strict";
|
|
22
22
|
var ALIAS = Symbol.for("yaml.alias");
|
|
23
23
|
var DOC = Symbol.for("yaml.document");
|
|
@@ -72,9 +72,9 @@ var require_identity = __commonJS({
|
|
|
72
72
|
}
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
75
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/visit.js
|
|
76
76
|
var require_visit = __commonJS({
|
|
77
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
77
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/visit.js"(exports) {
|
|
78
78
|
"use strict";
|
|
79
79
|
var identity = require_identity();
|
|
80
80
|
var BREAK = Symbol("break visit");
|
|
@@ -230,9 +230,9 @@ var require_visit = __commonJS({
|
|
|
230
230
|
}
|
|
231
231
|
});
|
|
232
232
|
|
|
233
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
233
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/directives.js
|
|
234
234
|
var require_directives = __commonJS({
|
|
235
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
235
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/directives.js"(exports) {
|
|
236
236
|
"use strict";
|
|
237
237
|
var identity = require_identity();
|
|
238
238
|
var visit = require_visit();
|
|
@@ -401,9 +401,9 @@ var require_directives = __commonJS({
|
|
|
401
401
|
}
|
|
402
402
|
});
|
|
403
403
|
|
|
404
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
404
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/anchors.js
|
|
405
405
|
var require_anchors = __commonJS({
|
|
406
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
406
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/anchors.js"(exports) {
|
|
407
407
|
"use strict";
|
|
408
408
|
var identity = require_identity();
|
|
409
409
|
var visit = require_visit();
|
|
@@ -472,9 +472,9 @@ var require_anchors = __commonJS({
|
|
|
472
472
|
}
|
|
473
473
|
});
|
|
474
474
|
|
|
475
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
475
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/applyReviver.js
|
|
476
476
|
var require_applyReviver = __commonJS({
|
|
477
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
477
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/applyReviver.js"(exports) {
|
|
478
478
|
"use strict";
|
|
479
479
|
function applyReviver(reviver, obj, key, val) {
|
|
480
480
|
if (val && typeof val === "object") {
|
|
@@ -522,9 +522,9 @@ var require_applyReviver = __commonJS({
|
|
|
522
522
|
}
|
|
523
523
|
});
|
|
524
524
|
|
|
525
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
525
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/toJS.js
|
|
526
526
|
var require_toJS = __commonJS({
|
|
527
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
527
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/toJS.js"(exports) {
|
|
528
528
|
"use strict";
|
|
529
529
|
var identity = require_identity();
|
|
530
530
|
function toJS(value, arg, ctx) {
|
|
@@ -552,9 +552,9 @@ var require_toJS = __commonJS({
|
|
|
552
552
|
}
|
|
553
553
|
});
|
|
554
554
|
|
|
555
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
555
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Node.js
|
|
556
556
|
var require_Node = __commonJS({
|
|
557
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
557
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Node.js"(exports) {
|
|
558
558
|
"use strict";
|
|
559
559
|
var applyReviver = require_applyReviver();
|
|
560
560
|
var identity = require_identity();
|
|
@@ -593,9 +593,9 @@ var require_Node = __commonJS({
|
|
|
593
593
|
}
|
|
594
594
|
});
|
|
595
595
|
|
|
596
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
596
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Alias.js
|
|
597
597
|
var require_Alias = __commonJS({
|
|
598
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
598
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Alias.js"(exports) {
|
|
599
599
|
"use strict";
|
|
600
600
|
var anchors = require_anchors();
|
|
601
601
|
var visit = require_visit();
|
|
@@ -695,9 +695,9 @@ var require_Alias = __commonJS({
|
|
|
695
695
|
}
|
|
696
696
|
});
|
|
697
697
|
|
|
698
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
698
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Scalar.js
|
|
699
699
|
var require_Scalar = __commonJS({
|
|
700
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
700
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Scalar.js"(exports) {
|
|
701
701
|
"use strict";
|
|
702
702
|
var identity = require_identity();
|
|
703
703
|
var Node = require_Node();
|
|
@@ -725,9 +725,9 @@ var require_Scalar = __commonJS({
|
|
|
725
725
|
}
|
|
726
726
|
});
|
|
727
727
|
|
|
728
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
728
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/createNode.js
|
|
729
729
|
var require_createNode = __commonJS({
|
|
730
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
730
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/createNode.js"(exports) {
|
|
731
731
|
"use strict";
|
|
732
732
|
var Alias = require_Alias();
|
|
733
733
|
var identity = require_identity();
|
|
@@ -801,9 +801,9 @@ var require_createNode = __commonJS({
|
|
|
801
801
|
}
|
|
802
802
|
});
|
|
803
803
|
|
|
804
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
804
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Collection.js
|
|
805
805
|
var require_Collection = __commonJS({
|
|
806
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
806
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Collection.js"(exports) {
|
|
807
807
|
"use strict";
|
|
808
808
|
var createNode = require_createNode();
|
|
809
809
|
var identity = require_identity();
|
|
@@ -945,9 +945,9 @@ var require_Collection = __commonJS({
|
|
|
945
945
|
}
|
|
946
946
|
});
|
|
947
947
|
|
|
948
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
948
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyComment.js
|
|
949
949
|
var require_stringifyComment = __commonJS({
|
|
950
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
950
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyComment.js"(exports) {
|
|
951
951
|
"use strict";
|
|
952
952
|
var stringifyComment = (str) => str.replace(/^(?!$)(?: $)?/gm, "#");
|
|
953
953
|
function indentComment(comment, indent) {
|
|
@@ -962,9 +962,9 @@ var require_stringifyComment = __commonJS({
|
|
|
962
962
|
}
|
|
963
963
|
});
|
|
964
964
|
|
|
965
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
965
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/foldFlowLines.js
|
|
966
966
|
var require_foldFlowLines = __commonJS({
|
|
967
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
967
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/foldFlowLines.js"(exports) {
|
|
968
968
|
"use strict";
|
|
969
969
|
var FOLD_FLOW = "flow";
|
|
970
970
|
var FOLD_BLOCK = "block";
|
|
@@ -1096,9 +1096,9 @@ ${indent}${text.slice(fold + 1, end2)}`;
|
|
|
1096
1096
|
}
|
|
1097
1097
|
});
|
|
1098
1098
|
|
|
1099
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1099
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyString.js
|
|
1100
1100
|
var require_stringifyString = __commonJS({
|
|
1101
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1101
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyString.js"(exports) {
|
|
1102
1102
|
"use strict";
|
|
1103
1103
|
var Scalar = require_Scalar();
|
|
1104
1104
|
var foldFlowLines = require_foldFlowLines();
|
|
@@ -1371,9 +1371,9 @@ ${indent}`);
|
|
|
1371
1371
|
}
|
|
1372
1372
|
});
|
|
1373
1373
|
|
|
1374
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1374
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringify.js
|
|
1375
1375
|
var require_stringify = __commonJS({
|
|
1376
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1376
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringify.js"(exports) {
|
|
1377
1377
|
"use strict";
|
|
1378
1378
|
var anchors = require_anchors();
|
|
1379
1379
|
var identity = require_identity();
|
|
@@ -1490,9 +1490,9 @@ ${ctx.indent}${str}`;
|
|
|
1490
1490
|
}
|
|
1491
1491
|
});
|
|
1492
1492
|
|
|
1493
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1493
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyPair.js
|
|
1494
1494
|
var require_stringifyPair = __commonJS({
|
|
1495
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1495
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyPair.js"(exports) {
|
|
1496
1496
|
"use strict";
|
|
1497
1497
|
var identity = require_identity();
|
|
1498
1498
|
var Scalar = require_Scalar();
|
|
@@ -1505,7 +1505,7 @@ var require_stringifyPair = __commonJS({
|
|
|
1505
1505
|
if (keyComment) {
|
|
1506
1506
|
throw new Error("With simple keys, key nodes cannot have comments");
|
|
1507
1507
|
}
|
|
1508
|
-
if (identity.isCollection(key)) {
|
|
1508
|
+
if (identity.isCollection(key) || !identity.isNode(key) && typeof key === "object") {
|
|
1509
1509
|
const msg = "With simple keys, collection cannot be used as a key value";
|
|
1510
1510
|
throw new Error(msg);
|
|
1511
1511
|
}
|
|
@@ -1623,9 +1623,9 @@ ${ctx.indent}`;
|
|
|
1623
1623
|
}
|
|
1624
1624
|
});
|
|
1625
1625
|
|
|
1626
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1626
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/log.js
|
|
1627
1627
|
var require_log = __commonJS({
|
|
1628
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1628
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/log.js"(exports) {
|
|
1629
1629
|
"use strict";
|
|
1630
1630
|
function debug2(logLevel, ...messages) {
|
|
1631
1631
|
if (logLevel === "debug")
|
|
@@ -1644,9 +1644,9 @@ var require_log = __commonJS({
|
|
|
1644
1644
|
}
|
|
1645
1645
|
});
|
|
1646
1646
|
|
|
1647
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1647
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/addPairToJSMap.js
|
|
1648
1648
|
var require_addPairToJSMap = __commonJS({
|
|
1649
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1649
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/addPairToJSMap.js"(exports) {
|
|
1650
1650
|
"use strict";
|
|
1651
1651
|
var log = require_log();
|
|
1652
1652
|
var stringify = require_stringify();
|
|
@@ -1738,9 +1738,9 @@ var require_addPairToJSMap = __commonJS({
|
|
|
1738
1738
|
}
|
|
1739
1739
|
});
|
|
1740
1740
|
|
|
1741
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1741
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Pair.js
|
|
1742
1742
|
var require_Pair = __commonJS({
|
|
1743
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1743
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/Pair.js"(exports) {
|
|
1744
1744
|
"use strict";
|
|
1745
1745
|
var createNode = require_createNode();
|
|
1746
1746
|
var stringifyPair = require_stringifyPair();
|
|
@@ -1778,9 +1778,9 @@ var require_Pair = __commonJS({
|
|
|
1778
1778
|
}
|
|
1779
1779
|
});
|
|
1780
1780
|
|
|
1781
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1781
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
1782
1782
|
var require_stringifyCollection = __commonJS({
|
|
1783
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1783
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyCollection.js"(exports) {
|
|
1784
1784
|
"use strict";
|
|
1785
1785
|
var identity = require_identity();
|
|
1786
1786
|
var stringify = require_stringify();
|
|
@@ -1922,9 +1922,9 @@ ${indent}${end}`;
|
|
|
1922
1922
|
}
|
|
1923
1923
|
});
|
|
1924
1924
|
|
|
1925
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
1925
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/YAMLMap.js
|
|
1926
1926
|
var require_YAMLMap = __commonJS({
|
|
1927
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
1927
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/YAMLMap.js"(exports) {
|
|
1928
1928
|
"use strict";
|
|
1929
1929
|
var stringifyCollection = require_stringifyCollection();
|
|
1930
1930
|
var addPairToJSMap = require_addPairToJSMap();
|
|
@@ -2066,9 +2066,9 @@ var require_YAMLMap = __commonJS({
|
|
|
2066
2066
|
}
|
|
2067
2067
|
});
|
|
2068
2068
|
|
|
2069
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2069
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/map.js
|
|
2070
2070
|
var require_map = __commonJS({
|
|
2071
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2071
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/map.js"(exports) {
|
|
2072
2072
|
"use strict";
|
|
2073
2073
|
var identity = require_identity();
|
|
2074
2074
|
var YAMLMap = require_YAMLMap();
|
|
@@ -2088,9 +2088,9 @@ var require_map = __commonJS({
|
|
|
2088
2088
|
}
|
|
2089
2089
|
});
|
|
2090
2090
|
|
|
2091
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2091
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/YAMLSeq.js
|
|
2092
2092
|
var require_YAMLSeq = __commonJS({
|
|
2093
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2093
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/nodes/YAMLSeq.js"(exports) {
|
|
2094
2094
|
"use strict";
|
|
2095
2095
|
var createNode = require_createNode();
|
|
2096
2096
|
var stringifyCollection = require_stringifyCollection();
|
|
@@ -2204,9 +2204,9 @@ var require_YAMLSeq = __commonJS({
|
|
|
2204
2204
|
}
|
|
2205
2205
|
});
|
|
2206
2206
|
|
|
2207
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2207
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/seq.js
|
|
2208
2208
|
var require_seq = __commonJS({
|
|
2209
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2209
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/seq.js"(exports) {
|
|
2210
2210
|
"use strict";
|
|
2211
2211
|
var identity = require_identity();
|
|
2212
2212
|
var YAMLSeq = require_YAMLSeq();
|
|
@@ -2226,9 +2226,9 @@ var require_seq = __commonJS({
|
|
|
2226
2226
|
}
|
|
2227
2227
|
});
|
|
2228
2228
|
|
|
2229
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2229
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/string.js
|
|
2230
2230
|
var require_string = __commonJS({
|
|
2231
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2231
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/string.js"(exports) {
|
|
2232
2232
|
"use strict";
|
|
2233
2233
|
var stringifyString = require_stringifyString();
|
|
2234
2234
|
var string = {
|
|
@@ -2245,9 +2245,9 @@ var require_string = __commonJS({
|
|
|
2245
2245
|
}
|
|
2246
2246
|
});
|
|
2247
2247
|
|
|
2248
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2248
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/null.js
|
|
2249
2249
|
var require_null = __commonJS({
|
|
2250
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2250
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/common/null.js"(exports) {
|
|
2251
2251
|
"use strict";
|
|
2252
2252
|
var Scalar = require_Scalar();
|
|
2253
2253
|
var nullTag = {
|
|
@@ -2263,9 +2263,9 @@ var require_null = __commonJS({
|
|
|
2263
2263
|
}
|
|
2264
2264
|
});
|
|
2265
2265
|
|
|
2266
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2266
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/bool.js
|
|
2267
2267
|
var require_bool = __commonJS({
|
|
2268
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2268
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/bool.js"(exports) {
|
|
2269
2269
|
"use strict";
|
|
2270
2270
|
var Scalar = require_Scalar();
|
|
2271
2271
|
var boolTag = {
|
|
@@ -2287,9 +2287,9 @@ var require_bool = __commonJS({
|
|
|
2287
2287
|
}
|
|
2288
2288
|
});
|
|
2289
2289
|
|
|
2290
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2290
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyNumber.js
|
|
2291
2291
|
var require_stringifyNumber = __commonJS({
|
|
2292
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2292
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyNumber.js"(exports) {
|
|
2293
2293
|
"use strict";
|
|
2294
2294
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
2295
2295
|
if (typeof value === "bigint")
|
|
@@ -2314,9 +2314,9 @@ var require_stringifyNumber = __commonJS({
|
|
|
2314
2314
|
}
|
|
2315
2315
|
});
|
|
2316
2316
|
|
|
2317
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2317
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/float.js
|
|
2318
2318
|
var require_float = __commonJS({
|
|
2319
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2319
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/float.js"(exports) {
|
|
2320
2320
|
"use strict";
|
|
2321
2321
|
var Scalar = require_Scalar();
|
|
2322
2322
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2324,7 +2324,7 @@ var require_float = __commonJS({
|
|
|
2324
2324
|
identify: (value) => typeof value === "number",
|
|
2325
2325
|
default: true,
|
|
2326
2326
|
tag: "tag:yaml.org,2002:float",
|
|
2327
|
-
test: /^(?:[-+]?\.(?:inf|Inf|INF
|
|
2327
|
+
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
2328
2328
|
resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
2329
2329
|
stringify: stringifyNumber.stringifyNumber
|
|
2330
2330
|
};
|
|
@@ -2360,9 +2360,9 @@ var require_float = __commonJS({
|
|
|
2360
2360
|
}
|
|
2361
2361
|
});
|
|
2362
2362
|
|
|
2363
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2363
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/int.js
|
|
2364
2364
|
var require_int = __commonJS({
|
|
2365
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2365
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/int.js"(exports) {
|
|
2366
2366
|
"use strict";
|
|
2367
2367
|
var stringifyNumber = require_stringifyNumber();
|
|
2368
2368
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2405,9 +2405,9 @@ var require_int = __commonJS({
|
|
|
2405
2405
|
}
|
|
2406
2406
|
});
|
|
2407
2407
|
|
|
2408
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2408
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/schema.js
|
|
2409
2409
|
var require_schema = __commonJS({
|
|
2410
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2410
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/core/schema.js"(exports) {
|
|
2411
2411
|
"use strict";
|
|
2412
2412
|
var map = require_map();
|
|
2413
2413
|
var _null = require_null();
|
|
@@ -2433,9 +2433,9 @@ var require_schema = __commonJS({
|
|
|
2433
2433
|
}
|
|
2434
2434
|
});
|
|
2435
2435
|
|
|
2436
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2436
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/json/schema.js
|
|
2437
2437
|
var require_schema2 = __commonJS({
|
|
2438
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2438
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/json/schema.js"(exports) {
|
|
2439
2439
|
"use strict";
|
|
2440
2440
|
var Scalar = require_Scalar();
|
|
2441
2441
|
var map = require_map();
|
|
@@ -2500,9 +2500,9 @@ var require_schema2 = __commonJS({
|
|
|
2500
2500
|
}
|
|
2501
2501
|
});
|
|
2502
2502
|
|
|
2503
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2503
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/binary.js
|
|
2504
2504
|
var require_binary = __commonJS({
|
|
2505
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2505
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/binary.js"(exports) {
|
|
2506
2506
|
"use strict";
|
|
2507
2507
|
var Scalar = require_Scalar();
|
|
2508
2508
|
var stringifyString = require_stringifyString();
|
|
@@ -2564,9 +2564,9 @@ var require_binary = __commonJS({
|
|
|
2564
2564
|
}
|
|
2565
2565
|
});
|
|
2566
2566
|
|
|
2567
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2567
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/pairs.js
|
|
2568
2568
|
var require_pairs = __commonJS({
|
|
2569
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2569
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/pairs.js"(exports) {
|
|
2570
2570
|
"use strict";
|
|
2571
2571
|
var identity = require_identity();
|
|
2572
2572
|
var Pair = require_Pair();
|
|
@@ -2642,9 +2642,9 @@ ${cn.comment}` : item.comment;
|
|
|
2642
2642
|
}
|
|
2643
2643
|
});
|
|
2644
2644
|
|
|
2645
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2645
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/omap.js
|
|
2646
2646
|
var require_omap = __commonJS({
|
|
2647
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2647
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/omap.js"(exports) {
|
|
2648
2648
|
"use strict";
|
|
2649
2649
|
var identity = require_identity();
|
|
2650
2650
|
var toJS = require_toJS();
|
|
@@ -2720,9 +2720,9 @@ var require_omap = __commonJS({
|
|
|
2720
2720
|
}
|
|
2721
2721
|
});
|
|
2722
2722
|
|
|
2723
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2723
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/bool.js
|
|
2724
2724
|
var require_bool2 = __commonJS({
|
|
2725
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2725
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/bool.js"(exports) {
|
|
2726
2726
|
"use strict";
|
|
2727
2727
|
var Scalar = require_Scalar();
|
|
2728
2728
|
function boolStringify({ value, source }, ctx) {
|
|
@@ -2752,9 +2752,9 @@ var require_bool2 = __commonJS({
|
|
|
2752
2752
|
}
|
|
2753
2753
|
});
|
|
2754
2754
|
|
|
2755
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2755
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/float.js
|
|
2756
2756
|
var require_float2 = __commonJS({
|
|
2757
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2757
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/float.js"(exports) {
|
|
2758
2758
|
"use strict";
|
|
2759
2759
|
var Scalar = require_Scalar();
|
|
2760
2760
|
var stringifyNumber = require_stringifyNumber();
|
|
@@ -2762,7 +2762,7 @@ var require_float2 = __commonJS({
|
|
|
2762
2762
|
identify: (value) => typeof value === "number",
|
|
2763
2763
|
default: true,
|
|
2764
2764
|
tag: "tag:yaml.org,2002:float",
|
|
2765
|
-
test: /^[-+]?\.(?:inf|Inf|INF
|
|
2765
|
+
test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
|
|
2766
2766
|
resolve: (str) => str.slice(-3).toLowerCase() === "nan" ? NaN : str[0] === "-" ? Number.NEGATIVE_INFINITY : Number.POSITIVE_INFINITY,
|
|
2767
2767
|
stringify: stringifyNumber.stringifyNumber
|
|
2768
2768
|
};
|
|
@@ -2801,9 +2801,9 @@ var require_float2 = __commonJS({
|
|
|
2801
2801
|
}
|
|
2802
2802
|
});
|
|
2803
2803
|
|
|
2804
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2804
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/int.js
|
|
2805
2805
|
var require_int2 = __commonJS({
|
|
2806
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2806
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/int.js"(exports) {
|
|
2807
2807
|
"use strict";
|
|
2808
2808
|
var stringifyNumber = require_stringifyNumber();
|
|
2809
2809
|
var intIdentify = (value) => typeof value === "bigint" || Number.isInteger(value);
|
|
@@ -2880,9 +2880,9 @@ var require_int2 = __commonJS({
|
|
|
2880
2880
|
}
|
|
2881
2881
|
});
|
|
2882
2882
|
|
|
2883
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2883
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/set.js
|
|
2884
2884
|
var require_set = __commonJS({
|
|
2885
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2885
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/set.js"(exports) {
|
|
2886
2886
|
"use strict";
|
|
2887
2887
|
var identity = require_identity();
|
|
2888
2888
|
var Pair = require_Pair();
|
|
@@ -2969,9 +2969,9 @@ var require_set = __commonJS({
|
|
|
2969
2969
|
}
|
|
2970
2970
|
});
|
|
2971
2971
|
|
|
2972
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
2972
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js
|
|
2973
2973
|
var require_timestamp = __commonJS({
|
|
2974
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
2974
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/timestamp.js"(exports) {
|
|
2975
2975
|
"use strict";
|
|
2976
2976
|
var stringifyNumber = require_stringifyNumber();
|
|
2977
2977
|
function parseSexagesimal(str, asBigInt) {
|
|
@@ -3057,9 +3057,9 @@ var require_timestamp = __commonJS({
|
|
|
3057
3057
|
}
|
|
3058
3058
|
});
|
|
3059
3059
|
|
|
3060
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3060
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/schema.js
|
|
3061
3061
|
var require_schema3 = __commonJS({
|
|
3062
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3062
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/yaml-1.1/schema.js"(exports) {
|
|
3063
3063
|
"use strict";
|
|
3064
3064
|
var map = require_map();
|
|
3065
3065
|
var _null = require_null();
|
|
@@ -3099,9 +3099,9 @@ var require_schema3 = __commonJS({
|
|
|
3099
3099
|
}
|
|
3100
3100
|
});
|
|
3101
3101
|
|
|
3102
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3102
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/tags.js
|
|
3103
3103
|
var require_tags = __commonJS({
|
|
3104
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3104
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/tags.js"(exports) {
|
|
3105
3105
|
"use strict";
|
|
3106
3106
|
var map = require_map();
|
|
3107
3107
|
var _null = require_null();
|
|
@@ -3182,9 +3182,9 @@ var require_tags = __commonJS({
|
|
|
3182
3182
|
}
|
|
3183
3183
|
});
|
|
3184
3184
|
|
|
3185
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3185
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/Schema.js
|
|
3186
3186
|
var require_Schema = __commonJS({
|
|
3187
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3187
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/schema/Schema.js"(exports) {
|
|
3188
3188
|
"use strict";
|
|
3189
3189
|
var identity = require_identity();
|
|
3190
3190
|
var map = require_map();
|
|
@@ -3215,9 +3215,9 @@ var require_Schema = __commonJS({
|
|
|
3215
3215
|
}
|
|
3216
3216
|
});
|
|
3217
3217
|
|
|
3218
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3218
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
3219
3219
|
var require_stringifyDocument = __commonJS({
|
|
3220
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3220
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/stringify/stringifyDocument.js"(exports) {
|
|
3221
3221
|
"use strict";
|
|
3222
3222
|
var identity = require_identity();
|
|
3223
3223
|
var stringify = require_stringify();
|
|
@@ -3295,9 +3295,9 @@ var require_stringifyDocument = __commonJS({
|
|
|
3295
3295
|
}
|
|
3296
3296
|
});
|
|
3297
3297
|
|
|
3298
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3298
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/Document.js
|
|
3299
3299
|
var require_Document = __commonJS({
|
|
3300
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3300
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/doc/Document.js"(exports) {
|
|
3301
3301
|
"use strict";
|
|
3302
3302
|
var Alias = require_Alias();
|
|
3303
3303
|
var Collection = require_Collection();
|
|
@@ -3603,9 +3603,9 @@ var require_Document = __commonJS({
|
|
|
3603
3603
|
}
|
|
3604
3604
|
});
|
|
3605
3605
|
|
|
3606
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3606
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/errors.js
|
|
3607
3607
|
var require_errors = __commonJS({
|
|
3608
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3608
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/errors.js"(exports) {
|
|
3609
3609
|
"use strict";
|
|
3610
3610
|
var YAMLError = class extends Error {
|
|
3611
3611
|
constructor(name, pos, code, message) {
|
|
@@ -3668,11 +3668,11 @@ ${pointer}
|
|
|
3668
3668
|
}
|
|
3669
3669
|
});
|
|
3670
3670
|
|
|
3671
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3671
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-props.js
|
|
3672
3672
|
var require_resolve_props = __commonJS({
|
|
3673
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3673
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-props.js"(exports) {
|
|
3674
3674
|
"use strict";
|
|
3675
|
-
function resolveProps(tokens, { flow, indicator, next, offset, onError, startOnNewline }) {
|
|
3675
|
+
function resolveProps(tokens, { flow, indicator, next, offset, onError, parentIndent, startOnNewline }) {
|
|
3676
3676
|
let spaceBefore = false;
|
|
3677
3677
|
let atNewline = startOnNewline;
|
|
3678
3678
|
let hasSpace = startOnNewline;
|
|
@@ -3681,6 +3681,7 @@ var require_resolve_props = __commonJS({
|
|
|
3681
3681
|
let hasNewline = false;
|
|
3682
3682
|
let hasNewlineAfterProp = false;
|
|
3683
3683
|
let reqSpace = false;
|
|
3684
|
+
let tab = null;
|
|
3684
3685
|
let anchor = null;
|
|
3685
3686
|
let tag = null;
|
|
3686
3687
|
let comma = null;
|
|
@@ -3692,10 +3693,17 @@ var require_resolve_props = __commonJS({
|
|
|
3692
3693
|
onError(token.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
|
|
3693
3694
|
reqSpace = false;
|
|
3694
3695
|
}
|
|
3696
|
+
if (tab) {
|
|
3697
|
+
if (atNewline && token.type !== "comment" && token.type !== "newline") {
|
|
3698
|
+
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
|
|
3699
|
+
}
|
|
3700
|
+
tab = null;
|
|
3701
|
+
}
|
|
3695
3702
|
switch (token.type) {
|
|
3696
3703
|
case "space":
|
|
3697
|
-
if (!flow &&
|
|
3698
|
-
|
|
3704
|
+
if (!flow && (indicator !== "doc-start" || next?.type !== "flow-collection") && token.source.includes(" ")) {
|
|
3705
|
+
tab = token;
|
|
3706
|
+
}
|
|
3699
3707
|
hasSpace = true;
|
|
3700
3708
|
break;
|
|
3701
3709
|
case "comment": {
|
|
@@ -3753,7 +3761,7 @@ var require_resolve_props = __commonJS({
|
|
|
3753
3761
|
if (found)
|
|
3754
3762
|
onError(token, "UNEXPECTED_TOKEN", `Unexpected ${token.source} in ${flow ?? "collection"}`);
|
|
3755
3763
|
found = token;
|
|
3756
|
-
atNewline =
|
|
3764
|
+
atNewline = indicator === "seq-item-ind" || indicator === "explicit-key-ind";
|
|
3757
3765
|
hasSpace = false;
|
|
3758
3766
|
break;
|
|
3759
3767
|
case "comma":
|
|
@@ -3773,8 +3781,11 @@ var require_resolve_props = __commonJS({
|
|
|
3773
3781
|
}
|
|
3774
3782
|
const last = tokens[tokens.length - 1];
|
|
3775
3783
|
const end = last ? last.offset + last.source.length : offset;
|
|
3776
|
-
if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== ""))
|
|
3784
|
+
if (reqSpace && next && next.type !== "space" && next.type !== "newline" && next.type !== "comma" && (next.type !== "scalar" || next.source !== "")) {
|
|
3777
3785
|
onError(next.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space");
|
|
3786
|
+
}
|
|
3787
|
+
if (tab && (atNewline && tab.indent <= parentIndent || next?.type === "block-map" || next?.type === "block-seq"))
|
|
3788
|
+
onError(tab, "TAB_AS_INDENT", "Tabs are not allowed as indentation");
|
|
3778
3789
|
return {
|
|
3779
3790
|
comma,
|
|
3780
3791
|
found,
|
|
@@ -3792,9 +3803,9 @@ var require_resolve_props = __commonJS({
|
|
|
3792
3803
|
}
|
|
3793
3804
|
});
|
|
3794
3805
|
|
|
3795
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3806
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-contains-newline.js
|
|
3796
3807
|
var require_util_contains_newline = __commonJS({
|
|
3797
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3808
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-contains-newline.js"(exports) {
|
|
3798
3809
|
"use strict";
|
|
3799
3810
|
function containsNewline(key) {
|
|
3800
3811
|
if (!key)
|
|
@@ -3834,9 +3845,9 @@ var require_util_contains_newline = __commonJS({
|
|
|
3834
3845
|
}
|
|
3835
3846
|
});
|
|
3836
3847
|
|
|
3837
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3848
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-flow-indent-check.js
|
|
3838
3849
|
var require_util_flow_indent_check = __commonJS({
|
|
3839
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3850
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-flow-indent-check.js"(exports) {
|
|
3840
3851
|
"use strict";
|
|
3841
3852
|
var utilContainsNewline = require_util_contains_newline();
|
|
3842
3853
|
function flowIndentCheck(indent, fc, onError) {
|
|
@@ -3852,9 +3863,9 @@ var require_util_flow_indent_check = __commonJS({
|
|
|
3852
3863
|
}
|
|
3853
3864
|
});
|
|
3854
3865
|
|
|
3855
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3866
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-map-includes.js
|
|
3856
3867
|
var require_util_map_includes = __commonJS({
|
|
3857
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3868
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-map-includes.js"(exports) {
|
|
3858
3869
|
"use strict";
|
|
3859
3870
|
var identity = require_identity();
|
|
3860
3871
|
function mapIncludes(ctx, items, search) {
|
|
@@ -3868,9 +3879,9 @@ var require_util_map_includes = __commonJS({
|
|
|
3868
3879
|
}
|
|
3869
3880
|
});
|
|
3870
3881
|
|
|
3871
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3882
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-map.js
|
|
3872
3883
|
var require_resolve_block_map = __commonJS({
|
|
3873
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3884
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-map.js"(exports) {
|
|
3874
3885
|
"use strict";
|
|
3875
3886
|
var Pair = require_Pair();
|
|
3876
3887
|
var YAMLMap = require_YAMLMap();
|
|
@@ -3893,6 +3904,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
3893
3904
|
next: key ?? sep?.[0],
|
|
3894
3905
|
offset,
|
|
3895
3906
|
onError,
|
|
3907
|
+
parentIndent: bm.indent,
|
|
3896
3908
|
startOnNewline: true
|
|
3897
3909
|
});
|
|
3898
3910
|
const implicitKey = !keyProps.found;
|
|
@@ -3930,6 +3942,7 @@ var require_resolve_block_map = __commonJS({
|
|
|
3930
3942
|
next: value,
|
|
3931
3943
|
offset: keyNode.range[2],
|
|
3932
3944
|
onError,
|
|
3945
|
+
parentIndent: bm.indent,
|
|
3933
3946
|
startOnNewline: !key || key.type === "block-scalar"
|
|
3934
3947
|
});
|
|
3935
3948
|
offset = valueProps.end;
|
|
@@ -3972,9 +3985,9 @@ var require_resolve_block_map = __commonJS({
|
|
|
3972
3985
|
}
|
|
3973
3986
|
});
|
|
3974
3987
|
|
|
3975
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
3988
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-seq.js
|
|
3976
3989
|
var require_resolve_block_seq = __commonJS({
|
|
3977
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
3990
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-seq.js"(exports) {
|
|
3978
3991
|
"use strict";
|
|
3979
3992
|
var YAMLSeq = require_YAMLSeq();
|
|
3980
3993
|
var resolveProps = require_resolve_props();
|
|
@@ -3992,6 +4005,7 @@ var require_resolve_block_seq = __commonJS({
|
|
|
3992
4005
|
next: value,
|
|
3993
4006
|
offset,
|
|
3994
4007
|
onError,
|
|
4008
|
+
parentIndent: bs.indent,
|
|
3995
4009
|
startOnNewline: true
|
|
3996
4010
|
});
|
|
3997
4011
|
if (!props.found) {
|
|
@@ -4020,9 +4034,9 @@ var require_resolve_block_seq = __commonJS({
|
|
|
4020
4034
|
}
|
|
4021
4035
|
});
|
|
4022
4036
|
|
|
4023
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4037
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-end.js
|
|
4024
4038
|
var require_resolve_end = __commonJS({
|
|
4025
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4039
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-end.js"(exports) {
|
|
4026
4040
|
"use strict";
|
|
4027
4041
|
function resolveEnd(end, offset, reqSpace, onError) {
|
|
4028
4042
|
let comment = "";
|
|
@@ -4063,9 +4077,9 @@ var require_resolve_end = __commonJS({
|
|
|
4063
4077
|
}
|
|
4064
4078
|
});
|
|
4065
4079
|
|
|
4066
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4080
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-flow-collection.js
|
|
4067
4081
|
var require_resolve_flow_collection = __commonJS({
|
|
4068
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4082
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-flow-collection.js"(exports) {
|
|
4069
4083
|
"use strict";
|
|
4070
4084
|
var identity = require_identity();
|
|
4071
4085
|
var Pair = require_Pair();
|
|
@@ -4096,6 +4110,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4096
4110
|
next: key ?? sep?.[0],
|
|
4097
4111
|
offset,
|
|
4098
4112
|
onError,
|
|
4113
|
+
parentIndent: fc.indent,
|
|
4099
4114
|
startOnNewline: false
|
|
4100
4115
|
});
|
|
4101
4116
|
if (!props.found) {
|
|
@@ -4171,6 +4186,7 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4171
4186
|
next: value,
|
|
4172
4187
|
offset: keyNode.range[2],
|
|
4173
4188
|
onError,
|
|
4189
|
+
parentIndent: fc.indent,
|
|
4174
4190
|
startOnNewline: false
|
|
4175
4191
|
});
|
|
4176
4192
|
if (valueProps.found) {
|
|
@@ -4250,9 +4266,9 @@ var require_resolve_flow_collection = __commonJS({
|
|
|
4250
4266
|
}
|
|
4251
4267
|
});
|
|
4252
4268
|
|
|
4253
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4269
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-collection.js
|
|
4254
4270
|
var require_compose_collection = __commonJS({
|
|
4255
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4271
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-collection.js"(exports) {
|
|
4256
4272
|
"use strict";
|
|
4257
4273
|
var identity = require_identity();
|
|
4258
4274
|
var Scalar = require_Scalar();
|
|
@@ -4306,14 +4322,14 @@ var require_compose_collection = __commonJS({
|
|
|
4306
4322
|
}
|
|
4307
4323
|
});
|
|
4308
4324
|
|
|
4309
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4325
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-scalar.js
|
|
4310
4326
|
var require_resolve_block_scalar = __commonJS({
|
|
4311
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4327
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-block-scalar.js"(exports) {
|
|
4312
4328
|
"use strict";
|
|
4313
4329
|
var Scalar = require_Scalar();
|
|
4314
|
-
function resolveBlockScalar(
|
|
4330
|
+
function resolveBlockScalar(ctx, scalar, onError) {
|
|
4315
4331
|
const start = scalar.offset;
|
|
4316
|
-
const header = parseBlockScalarHeader(scalar, strict, onError);
|
|
4332
|
+
const header = parseBlockScalarHeader(scalar, ctx.options.strict, onError);
|
|
4317
4333
|
if (!header)
|
|
4318
4334
|
return { value: "", type: null, comment: "", range: [start, start, start] };
|
|
4319
4335
|
const type = header.mode === ">" ? Scalar.Scalar.BLOCK_FOLDED : Scalar.Scalar.BLOCK_LITERAL;
|
|
@@ -4349,6 +4365,10 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4349
4365
|
if (header.indent === 0)
|
|
4350
4366
|
trimIndent = indent.length;
|
|
4351
4367
|
contentStart = i;
|
|
4368
|
+
if (trimIndent === 0 && !ctx.atRoot) {
|
|
4369
|
+
const message = "Block scalar values in collections must be indented";
|
|
4370
|
+
onError(offset, "BAD_INDENT", message);
|
|
4371
|
+
}
|
|
4352
4372
|
break;
|
|
4353
4373
|
}
|
|
4354
4374
|
offset += indent.length + content.length + 1;
|
|
@@ -4483,9 +4503,9 @@ var require_resolve_block_scalar = __commonJS({
|
|
|
4483
4503
|
}
|
|
4484
4504
|
});
|
|
4485
4505
|
|
|
4486
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4506
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-flow-scalar.js
|
|
4487
4507
|
var require_resolve_flow_scalar = __commonJS({
|
|
4488
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4508
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/resolve-flow-scalar.js"(exports) {
|
|
4489
4509
|
"use strict";
|
|
4490
4510
|
var Scalar = require_Scalar();
|
|
4491
4511
|
var resolveEnd = require_resolve_end();
|
|
@@ -4700,16 +4720,16 @@ var require_resolve_flow_scalar = __commonJS({
|
|
|
4700
4720
|
}
|
|
4701
4721
|
});
|
|
4702
4722
|
|
|
4703
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4723
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-scalar.js
|
|
4704
4724
|
var require_compose_scalar = __commonJS({
|
|
4705
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4725
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-scalar.js"(exports) {
|
|
4706
4726
|
"use strict";
|
|
4707
4727
|
var identity = require_identity();
|
|
4708
4728
|
var Scalar = require_Scalar();
|
|
4709
4729
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
4710
4730
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
4711
4731
|
function composeScalar(ctx, token, tagToken, onError) {
|
|
4712
|
-
const { value, type, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(
|
|
4732
|
+
const { value, type, comment, range: range2 } = token.type === "block-scalar" ? resolveBlockScalar.resolveBlockScalar(ctx, token, onError) : resolveFlowScalar.resolveFlowScalar(token, ctx.options.strict, onError);
|
|
4713
4733
|
const tagName = tagToken ? ctx.directives.tagName(tagToken.source, (msg) => onError(tagToken, "TAG_RESOLVE_FAILED", msg)) : null;
|
|
4714
4734
|
const tag = tagToken && tagName ? findScalarTagByName(ctx.schema, value, tagName, tagToken, onError) : token.type === "scalar" ? findScalarTagByTest(ctx, value, token, onError) : ctx.schema[identity.SCALAR];
|
|
4715
4735
|
let scalar;
|
|
@@ -4773,9 +4793,9 @@ var require_compose_scalar = __commonJS({
|
|
|
4773
4793
|
}
|
|
4774
4794
|
});
|
|
4775
4795
|
|
|
4776
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4796
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-empty-scalar-position.js
|
|
4777
4797
|
var require_util_empty_scalar_position = __commonJS({
|
|
4778
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4798
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/util-empty-scalar-position.js"(exports) {
|
|
4779
4799
|
"use strict";
|
|
4780
4800
|
function emptyScalarPosition(offset, before, pos) {
|
|
4781
4801
|
if (before) {
|
|
@@ -4804,9 +4824,9 @@ var require_util_empty_scalar_position = __commonJS({
|
|
|
4804
4824
|
}
|
|
4805
4825
|
});
|
|
4806
4826
|
|
|
4807
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4827
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-node.js
|
|
4808
4828
|
var require_compose_node = __commonJS({
|
|
4809
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4829
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-node.js"(exports) {
|
|
4810
4830
|
"use strict";
|
|
4811
4831
|
var Alias = require_Alias();
|
|
4812
4832
|
var composeCollection = require_compose_collection();
|
|
@@ -4899,9 +4919,9 @@ var require_compose_node = __commonJS({
|
|
|
4899
4919
|
}
|
|
4900
4920
|
});
|
|
4901
4921
|
|
|
4902
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4922
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-doc.js
|
|
4903
4923
|
var require_compose_doc = __commonJS({
|
|
4904
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4924
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/compose-doc.js"(exports) {
|
|
4905
4925
|
"use strict";
|
|
4906
4926
|
var Document = require_Document();
|
|
4907
4927
|
var composeNode = require_compose_node();
|
|
@@ -4921,6 +4941,7 @@ var require_compose_doc = __commonJS({
|
|
|
4921
4941
|
next: value ?? end?.[0],
|
|
4922
4942
|
offset,
|
|
4923
4943
|
onError,
|
|
4944
|
+
parentIndent: 0,
|
|
4924
4945
|
startOnNewline: true
|
|
4925
4946
|
});
|
|
4926
4947
|
if (props.found) {
|
|
@@ -4940,9 +4961,9 @@ var require_compose_doc = __commonJS({
|
|
|
4940
4961
|
}
|
|
4941
4962
|
});
|
|
4942
4963
|
|
|
4943
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
4964
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/composer.js
|
|
4944
4965
|
var require_composer = __commonJS({
|
|
4945
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
4966
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/compose/composer.js"(exports) {
|
|
4946
4967
|
"use strict";
|
|
4947
4968
|
var directives = require_directives();
|
|
4948
4969
|
var Document = require_Document();
|
|
@@ -5145,9 +5166,9 @@ ${end.comment}` : end.comment;
|
|
|
5145
5166
|
}
|
|
5146
5167
|
});
|
|
5147
5168
|
|
|
5148
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
5169
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-scalar.js
|
|
5149
5170
|
var require_cst_scalar = __commonJS({
|
|
5150
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
5171
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-scalar.js"(exports) {
|
|
5151
5172
|
"use strict";
|
|
5152
5173
|
var resolveBlockScalar = require_resolve_block_scalar();
|
|
5153
5174
|
var resolveFlowScalar = require_resolve_flow_scalar();
|
|
@@ -5168,7 +5189,7 @@ var require_cst_scalar = __commonJS({
|
|
|
5168
5189
|
case "double-quoted-scalar":
|
|
5169
5190
|
return resolveFlowScalar.resolveFlowScalar(token, strict, _onError);
|
|
5170
5191
|
case "block-scalar":
|
|
5171
|
-
return resolveBlockScalar.resolveBlockScalar(
|
|
5192
|
+
return resolveBlockScalar.resolveBlockScalar({ options: { strict } }, token, _onError);
|
|
5172
5193
|
}
|
|
5173
5194
|
}
|
|
5174
5195
|
return null;
|
|
@@ -5330,9 +5351,9 @@ var require_cst_scalar = __commonJS({
|
|
|
5330
5351
|
}
|
|
5331
5352
|
});
|
|
5332
5353
|
|
|
5333
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
5354
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-stringify.js
|
|
5334
5355
|
var require_cst_stringify = __commonJS({
|
|
5335
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
5356
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-stringify.js"(exports) {
|
|
5336
5357
|
"use strict";
|
|
5337
5358
|
var stringify = (cst) => "type" in cst ? stringifyToken(cst) : stringifyItem(cst);
|
|
5338
5359
|
function stringifyToken(token) {
|
|
@@ -5391,9 +5412,9 @@ var require_cst_stringify = __commonJS({
|
|
|
5391
5412
|
}
|
|
5392
5413
|
});
|
|
5393
5414
|
|
|
5394
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
5415
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-visit.js
|
|
5395
5416
|
var require_cst_visit = __commonJS({
|
|
5396
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
5417
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst-visit.js"(exports) {
|
|
5397
5418
|
"use strict";
|
|
5398
5419
|
var BREAK = Symbol("break visit");
|
|
5399
5420
|
var SKIP = Symbol("skip children");
|
|
@@ -5453,9 +5474,9 @@ var require_cst_visit = __commonJS({
|
|
|
5453
5474
|
}
|
|
5454
5475
|
});
|
|
5455
5476
|
|
|
5456
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
5477
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst.js
|
|
5457
5478
|
var require_cst = __commonJS({
|
|
5458
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
5479
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/cst.js"(exports) {
|
|
5459
5480
|
"use strict";
|
|
5460
5481
|
var cstScalar = require_cst_scalar();
|
|
5461
5482
|
var cstStringify = require_cst_stringify();
|
|
@@ -5555,9 +5576,9 @@ var require_cst = __commonJS({
|
|
|
5555
5576
|
}
|
|
5556
5577
|
});
|
|
5557
5578
|
|
|
5558
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
5579
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/lexer.js
|
|
5559
5580
|
var require_lexer = __commonJS({
|
|
5560
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
5581
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/lexer.js"(exports) {
|
|
5561
5582
|
"use strict";
|
|
5562
5583
|
var cst = require_cst();
|
|
5563
5584
|
function isEmpty(ch) {
|
|
@@ -5572,11 +5593,11 @@ var require_lexer = __commonJS({
|
|
|
5572
5593
|
return false;
|
|
5573
5594
|
}
|
|
5574
5595
|
}
|
|
5575
|
-
var hexDigits = "0123456789ABCDEFabcdef"
|
|
5576
|
-
var tagChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"
|
|
5577
|
-
var
|
|
5578
|
-
var invalidAnchorChars = " ,[]{}\n\r "
|
|
5579
|
-
var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.
|
|
5596
|
+
var hexDigits = new Set("0123456789ABCDEFabcdef");
|
|
5597
|
+
var tagChars = new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()");
|
|
5598
|
+
var flowIndicatorChars = new Set(",[]{}");
|
|
5599
|
+
var invalidAnchorChars = new Set(" ,[]{}\n\r ");
|
|
5600
|
+
var isNotAnchorChar = (ch) => !ch || invalidAnchorChars.has(ch);
|
|
5580
5601
|
var Lexer = class {
|
|
5581
5602
|
constructor() {
|
|
5582
5603
|
this.atEnd = false;
|
|
@@ -5599,6 +5620,8 @@ var require_lexer = __commonJS({
|
|
|
5599
5620
|
*/
|
|
5600
5621
|
*lex(source, incomplete = false) {
|
|
5601
5622
|
if (source) {
|
|
5623
|
+
if (typeof source !== "string")
|
|
5624
|
+
throw TypeError("source is not a string");
|
|
5602
5625
|
this.buffer = this.buffer ? this.buffer + source : source;
|
|
5603
5626
|
this.lineEndPos = null;
|
|
5604
5627
|
}
|
|
@@ -5696,11 +5719,15 @@ var require_lexer = __commonJS({
|
|
|
5696
5719
|
}
|
|
5697
5720
|
if (line[0] === "%") {
|
|
5698
5721
|
let dirEnd = line.length;
|
|
5699
|
-
|
|
5700
|
-
|
|
5722
|
+
let cs = line.indexOf("#");
|
|
5723
|
+
while (cs !== -1) {
|
|
5701
5724
|
const ch = line[cs - 1];
|
|
5702
|
-
if (ch === " " || ch === " ")
|
|
5725
|
+
if (ch === " " || ch === " ") {
|
|
5703
5726
|
dirEnd = cs - 1;
|
|
5727
|
+
break;
|
|
5728
|
+
} else {
|
|
5729
|
+
cs = line.indexOf("#", cs + 1);
|
|
5730
|
+
}
|
|
5704
5731
|
}
|
|
5705
5732
|
while (true) {
|
|
5706
5733
|
const ch = line[dirEnd - 1];
|
|
@@ -5924,17 +5951,17 @@ var require_lexer = __commonJS({
|
|
|
5924
5951
|
let indent = 0;
|
|
5925
5952
|
let ch;
|
|
5926
5953
|
loop:
|
|
5927
|
-
for (let
|
|
5954
|
+
for (let i2 = this.pos; ch = this.buffer[i2]; ++i2) {
|
|
5928
5955
|
switch (ch) {
|
|
5929
5956
|
case " ":
|
|
5930
5957
|
indent += 1;
|
|
5931
5958
|
break;
|
|
5932
5959
|
case "\n":
|
|
5933
|
-
nl =
|
|
5960
|
+
nl = i2;
|
|
5934
5961
|
indent = 0;
|
|
5935
5962
|
break;
|
|
5936
5963
|
case "\r": {
|
|
5937
|
-
const next = this.buffer[
|
|
5964
|
+
const next = this.buffer[i2 + 1];
|
|
5938
5965
|
if (!next && !this.atEnd)
|
|
5939
5966
|
return this.setNext("block-scalar");
|
|
5940
5967
|
if (next === "\n")
|
|
@@ -5949,8 +5976,9 @@ var require_lexer = __commonJS({
|
|
|
5949
5976
|
if (indent >= this.indentNext) {
|
|
5950
5977
|
if (this.blockScalarIndent === -1)
|
|
5951
5978
|
this.indentNext = indent;
|
|
5952
|
-
else
|
|
5953
|
-
this.indentNext
|
|
5979
|
+
else {
|
|
5980
|
+
this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
|
|
5981
|
+
}
|
|
5954
5982
|
do {
|
|
5955
5983
|
const cs = this.continueScalar(nl + 1);
|
|
5956
5984
|
if (cs === -1)
|
|
@@ -5963,17 +5991,25 @@ var require_lexer = __commonJS({
|
|
|
5963
5991
|
nl = this.buffer.length;
|
|
5964
5992
|
}
|
|
5965
5993
|
}
|
|
5966
|
-
|
|
5994
|
+
let i = nl + 1;
|
|
5995
|
+
ch = this.buffer[i];
|
|
5996
|
+
while (ch === " ")
|
|
5997
|
+
ch = this.buffer[++i];
|
|
5998
|
+
if (ch === " ") {
|
|
5999
|
+
while (ch === " " || ch === " " || ch === "\r" || ch === "\n")
|
|
6000
|
+
ch = this.buffer[++i];
|
|
6001
|
+
nl = i - 1;
|
|
6002
|
+
} else if (!this.blockScalarKeep) {
|
|
5967
6003
|
do {
|
|
5968
|
-
let
|
|
5969
|
-
let ch2 = this.buffer[
|
|
6004
|
+
let i2 = nl - 1;
|
|
6005
|
+
let ch2 = this.buffer[i2];
|
|
5970
6006
|
if (ch2 === "\r")
|
|
5971
|
-
ch2 = this.buffer[--
|
|
5972
|
-
const lastChar =
|
|
5973
|
-
while (ch2 === " "
|
|
5974
|
-
ch2 = this.buffer[--
|
|
5975
|
-
if (ch2 === "\n" &&
|
|
5976
|
-
nl =
|
|
6007
|
+
ch2 = this.buffer[--i2];
|
|
6008
|
+
const lastChar = i2;
|
|
6009
|
+
while (ch2 === " ")
|
|
6010
|
+
ch2 = this.buffer[--i2];
|
|
6011
|
+
if (ch2 === "\n" && i2 >= this.pos && i2 + 1 + indent > lastChar)
|
|
6012
|
+
nl = i2;
|
|
5977
6013
|
else
|
|
5978
6014
|
break;
|
|
5979
6015
|
} while (true);
|
|
@@ -5990,7 +6026,7 @@ var require_lexer = __commonJS({
|
|
|
5990
6026
|
while (ch = this.buffer[++i]) {
|
|
5991
6027
|
if (ch === ":") {
|
|
5992
6028
|
const next = this.buffer[i + 1];
|
|
5993
|
-
if (isEmpty(next) || inFlow && next
|
|
6029
|
+
if (isEmpty(next) || inFlow && flowIndicatorChars.has(next))
|
|
5994
6030
|
break;
|
|
5995
6031
|
end = i;
|
|
5996
6032
|
} else if (isEmpty(ch)) {
|
|
@@ -6003,7 +6039,7 @@ var require_lexer = __commonJS({
|
|
|
6003
6039
|
} else
|
|
6004
6040
|
end = i;
|
|
6005
6041
|
}
|
|
6006
|
-
if (next === "#" || inFlow &&
|
|
6042
|
+
if (next === "#" || inFlow && flowIndicatorChars.has(next))
|
|
6007
6043
|
break;
|
|
6008
6044
|
if (ch === "\n") {
|
|
6009
6045
|
const cs = this.continueScalar(i + 1);
|
|
@@ -6012,7 +6048,7 @@ var require_lexer = __commonJS({
|
|
|
6012
6048
|
i = Math.max(i, cs - 2);
|
|
6013
6049
|
}
|
|
6014
6050
|
} else {
|
|
6015
|
-
if (inFlow &&
|
|
6051
|
+
if (inFlow && flowIndicatorChars.has(ch))
|
|
6016
6052
|
break;
|
|
6017
6053
|
end = i;
|
|
6018
6054
|
}
|
|
@@ -6052,7 +6088,7 @@ var require_lexer = __commonJS({
|
|
|
6052
6088
|
case ":": {
|
|
6053
6089
|
const inFlow = this.flowLevel > 0;
|
|
6054
6090
|
const ch1 = this.charAt(1);
|
|
6055
|
-
if (isEmpty(ch1) || inFlow &&
|
|
6091
|
+
if (isEmpty(ch1) || inFlow && flowIndicatorChars.has(ch1)) {
|
|
6056
6092
|
if (!inFlow)
|
|
6057
6093
|
this.indentNext = this.indentValue + 1;
|
|
6058
6094
|
else if (this.flowKey)
|
|
@@ -6074,9 +6110,9 @@ var require_lexer = __commonJS({
|
|
|
6074
6110
|
let i = this.pos + 1;
|
|
6075
6111
|
let ch = this.buffer[i];
|
|
6076
6112
|
while (ch) {
|
|
6077
|
-
if (tagChars.
|
|
6113
|
+
if (tagChars.has(ch))
|
|
6078
6114
|
ch = this.buffer[++i];
|
|
6079
|
-
else if (ch === "%" && hexDigits.
|
|
6115
|
+
else if (ch === "%" && hexDigits.has(this.buffer[i + 1]) && hexDigits.has(this.buffer[i + 2])) {
|
|
6080
6116
|
ch = this.buffer[i += 3];
|
|
6081
6117
|
} else
|
|
6082
6118
|
break;
|
|
@@ -6118,9 +6154,9 @@ var require_lexer = __commonJS({
|
|
|
6118
6154
|
}
|
|
6119
6155
|
});
|
|
6120
6156
|
|
|
6121
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
6157
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/line-counter.js
|
|
6122
6158
|
var require_line_counter = __commonJS({
|
|
6123
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
6159
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/line-counter.js"(exports) {
|
|
6124
6160
|
"use strict";
|
|
6125
6161
|
var LineCounter = class {
|
|
6126
6162
|
constructor() {
|
|
@@ -6149,9 +6185,9 @@ var require_line_counter = __commonJS({
|
|
|
6149
6185
|
}
|
|
6150
6186
|
});
|
|
6151
6187
|
|
|
6152
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
6188
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/parser.js
|
|
6153
6189
|
var require_parser = __commonJS({
|
|
6154
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
6190
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/parse/parser.js"(exports) {
|
|
6155
6191
|
"use strict";
|
|
6156
6192
|
var cst = require_cst();
|
|
6157
6193
|
var lexer = require_lexer();
|
|
@@ -6407,7 +6443,7 @@ var require_parser = __commonJS({
|
|
|
6407
6443
|
it.value = token;
|
|
6408
6444
|
} else {
|
|
6409
6445
|
Object.assign(it, { key: token, sep: [] });
|
|
6410
|
-
this.onKeyLine = !
|
|
6446
|
+
this.onKeyLine = !it.explicitKey;
|
|
6411
6447
|
return;
|
|
6412
6448
|
}
|
|
6413
6449
|
break;
|
|
@@ -6596,7 +6632,8 @@ var require_parser = __commonJS({
|
|
|
6596
6632
|
return;
|
|
6597
6633
|
}
|
|
6598
6634
|
if (this.indent >= map.indent) {
|
|
6599
|
-
const
|
|
6635
|
+
const atMapIndent = !this.onKeyLine && this.indent === map.indent;
|
|
6636
|
+
const atNextItem = atMapIndent && (it.sep || it.explicitKey) && this.type !== "seq-item-ind";
|
|
6600
6637
|
let start = [];
|
|
6601
6638
|
if (atNextItem && it.sep && !it.value) {
|
|
6602
6639
|
const nl = [];
|
|
@@ -6633,23 +6670,24 @@ var require_parser = __commonJS({
|
|
|
6633
6670
|
}
|
|
6634
6671
|
return;
|
|
6635
6672
|
case "explicit-key-ind":
|
|
6636
|
-
if (!it.sep && !
|
|
6673
|
+
if (!it.sep && !it.explicitKey) {
|
|
6637
6674
|
it.start.push(this.sourceToken);
|
|
6675
|
+
it.explicitKey = true;
|
|
6638
6676
|
} else if (atNextItem || it.value) {
|
|
6639
6677
|
start.push(this.sourceToken);
|
|
6640
|
-
map.items.push({ start });
|
|
6678
|
+
map.items.push({ start, explicitKey: true });
|
|
6641
6679
|
} else {
|
|
6642
6680
|
this.stack.push({
|
|
6643
6681
|
type: "block-map",
|
|
6644
6682
|
offset: this.offset,
|
|
6645
6683
|
indent: this.indent,
|
|
6646
|
-
items: [{ start: [this.sourceToken] }]
|
|
6684
|
+
items: [{ start: [this.sourceToken], explicitKey: true }]
|
|
6647
6685
|
});
|
|
6648
6686
|
}
|
|
6649
6687
|
this.onKeyLine = true;
|
|
6650
6688
|
return;
|
|
6651
6689
|
case "map-value-ind":
|
|
6652
|
-
if (
|
|
6690
|
+
if (it.explicitKey) {
|
|
6653
6691
|
if (!it.sep) {
|
|
6654
6692
|
if (includesToken(it.start, "newline")) {
|
|
6655
6693
|
Object.assign(it, { key: null, sep: [this.sourceToken] });
|
|
@@ -6725,7 +6763,7 @@ var require_parser = __commonJS({
|
|
|
6725
6763
|
default: {
|
|
6726
6764
|
const bv = this.startBlockValue(map);
|
|
6727
6765
|
if (bv) {
|
|
6728
|
-
if (
|
|
6766
|
+
if (atMapIndent && bv.type !== "block-seq") {
|
|
6729
6767
|
map.items.push({ start });
|
|
6730
6768
|
}
|
|
6731
6769
|
this.stack.push(bv);
|
|
@@ -6936,7 +6974,7 @@ var require_parser = __commonJS({
|
|
|
6936
6974
|
type: "block-map",
|
|
6937
6975
|
offset: this.offset,
|
|
6938
6976
|
indent: this.indent,
|
|
6939
|
-
items: [{ start }]
|
|
6977
|
+
items: [{ start, explicitKey: true }]
|
|
6940
6978
|
};
|
|
6941
6979
|
}
|
|
6942
6980
|
case "map-value-ind": {
|
|
@@ -6999,9 +7037,9 @@ var require_parser = __commonJS({
|
|
|
6999
7037
|
}
|
|
7000
7038
|
});
|
|
7001
7039
|
|
|
7002
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
7040
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/public-api.js
|
|
7003
7041
|
var require_public_api = __commonJS({
|
|
7004
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
7042
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/public-api.js"(exports) {
|
|
7005
7043
|
"use strict";
|
|
7006
7044
|
var composer = require_composer();
|
|
7007
7045
|
var Document = require_Document();
|
|
@@ -7093,9 +7131,9 @@ var require_public_api = __commonJS({
|
|
|
7093
7131
|
}
|
|
7094
7132
|
});
|
|
7095
7133
|
|
|
7096
|
-
// ../../node_modules/.pnpm/yaml@2.4.
|
|
7134
|
+
// ../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/index.js
|
|
7097
7135
|
var require_dist = __commonJS({
|
|
7098
|
-
"../../node_modules/.pnpm/yaml@2.4.
|
|
7136
|
+
"../../node_modules/.pnpm/yaml@2.4.5/node_modules/yaml/dist/index.js"(exports) {
|
|
7099
7137
|
"use strict";
|
|
7100
7138
|
var composer = require_composer();
|
|
7101
7139
|
var Document = require_Document();
|
|
@@ -7146,14 +7184,14 @@ var require_dist = __commonJS({
|
|
|
7146
7184
|
});
|
|
7147
7185
|
|
|
7148
7186
|
// package.json
|
|
7149
|
-
var version = "0.49.
|
|
7187
|
+
var version = "0.49.12";
|
|
7150
7188
|
|
|
7151
7189
|
// node/commands/shared.ts
|
|
7152
|
-
import { existsSync, promises as
|
|
7153
|
-
import { join } from "node:path";
|
|
7154
|
-
import { loadConfigFromFile, mergeConfig
|
|
7190
|
+
import { existsSync as existsSync6, promises as fs8 } from "node:fs";
|
|
7191
|
+
import { join as join10 } from "node:path";
|
|
7192
|
+
import { loadConfigFromFile, mergeConfig as mergeConfig2 } from "vite";
|
|
7155
7193
|
import MarkdownIt from "markdown-it";
|
|
7156
|
-
import { slash } from "@antfu/utils";
|
|
7194
|
+
import { slash as slash5 } from "@antfu/utils";
|
|
7157
7195
|
|
|
7158
7196
|
// node/syntax/markdown-it/markdown-it-link.ts
|
|
7159
7197
|
function markdownItLink(md) {
|
|
@@ -7223,183 +7261,9 @@ function updateFrontmatterPatch(slide, frontmatter) {
|
|
|
7223
7261
|
}
|
|
7224
7262
|
}
|
|
7225
7263
|
|
|
7226
|
-
// node/commands/shared.ts
|
|
7227
|
-
var sharedMd = MarkdownIt({ html: true });
|
|
7228
|
-
sharedMd.use(markdownItLink);
|
|
7229
|
-
function getSlideTitle(data) {
|
|
7230
|
-
const tokens = sharedMd.parseInline(data.config.title, {});
|
|
7231
|
-
const title = stringifyMarkdownTokens(tokens);
|
|
7232
|
-
const slideTitle = data.config.titleTemplate.replace("%s", title);
|
|
7233
|
-
return slideTitle === "Slidev - Slidev" ? "Slidev" : slideTitle;
|
|
7234
|
-
}
|
|
7235
|
-
function escapeHtml(unsafe) {
|
|
7236
|
-
return JSON.stringify(
|
|
7237
|
-
String(unsafe).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
|
|
7238
|
-
);
|
|
7239
|
-
}
|
|
7240
|
-
async function getIndexHtml({ entry, clientRoot, roots, data }) {
|
|
7241
|
-
let main = await fs.readFile(join(clientRoot, "index.html"), "utf-8");
|
|
7242
|
-
let head = "";
|
|
7243
|
-
let body = "";
|
|
7244
|
-
const { info, author, keywords } = data.headmatter;
|
|
7245
|
-
head += [
|
|
7246
|
-
`<meta name="slidev:version" content="${version}">`,
|
|
7247
|
-
`<meta charset="slidev:entry" content="${slash(entry)}">`,
|
|
7248
|
-
`<link rel="icon" href="${data.config.favicon}">`,
|
|
7249
|
-
`<title>${getSlideTitle(data)}</title>`,
|
|
7250
|
-
info && `<meta name="description" content=${escapeHtml(info)}>`,
|
|
7251
|
-
author && `<meta name="author" content=${escapeHtml(author)}>`,
|
|
7252
|
-
keywords && `<meta name="keywords" content=${escapeHtml(Array.isArray(keywords) ? keywords.join(", ") : keywords)}>`
|
|
7253
|
-
].filter(Boolean).join("\n");
|
|
7254
|
-
for (const root of roots) {
|
|
7255
|
-
const path4 = join(root, "index.html");
|
|
7256
|
-
if (!existsSync(path4))
|
|
7257
|
-
continue;
|
|
7258
|
-
const index = await fs.readFile(path4, "utf-8");
|
|
7259
|
-
head += `
|
|
7260
|
-
${(index.match(/<head>([\s\S]*?)<\/head>/i)?.[1] || "").trim()}`;
|
|
7261
|
-
body += `
|
|
7262
|
-
${(index.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
|
|
7263
|
-
}
|
|
7264
|
-
if (data.features.tweet)
|
|
7265
|
-
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
7266
|
-
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
7267
|
-
head += `
|
|
7268
|
-
<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`;
|
|
7269
|
-
main = main.replace("__ENTRY__", toAtFS(join(clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
7270
|
-
return main;
|
|
7271
|
-
}
|
|
7272
|
-
async function mergeViteConfigs({ roots, entry }, viteConfig, config, command) {
|
|
7273
|
-
const configEnv = {
|
|
7274
|
-
mode: "development",
|
|
7275
|
-
command
|
|
7276
|
-
};
|
|
7277
|
-
const files = roots.map((i) => join(i, "vite.config.ts"));
|
|
7278
|
-
for await (const file of files) {
|
|
7279
|
-
if (!existsSync(file))
|
|
7280
|
-
continue;
|
|
7281
|
-
const viteConfig2 = await loadConfigFromFile(configEnv, file);
|
|
7282
|
-
if (!viteConfig2?.config)
|
|
7283
|
-
continue;
|
|
7284
|
-
config = mergeConfig(config, viteConfig2.config);
|
|
7285
|
-
}
|
|
7286
|
-
config = mergeConfig(config, viteConfig);
|
|
7287
|
-
const localConfig = await resolveConfig({}, command, entry);
|
|
7288
|
-
config = mergeConfig(config, { slidev: localConfig.slidev || {} });
|
|
7289
|
-
return config;
|
|
7290
|
-
}
|
|
7291
|
-
|
|
7292
|
-
// node/parser.ts
|
|
7293
|
-
import * as parser from "@slidev/parser/fs";
|
|
7294
|
-
|
|
7295
|
-
// node/integrations/themes.ts
|
|
7296
|
-
import { join as join2 } from "node:path";
|
|
7297
|
-
import fs2 from "fs-extra";
|
|
7298
|
-
import { satisfies } from "semver";
|
|
7299
|
-
var officialThemes = {
|
|
7300
|
-
"none": "",
|
|
7301
|
-
"default": "@slidev/theme-default",
|
|
7302
|
-
"seriph": "@slidev/theme-seriph",
|
|
7303
|
-
"apple-basic": "@slidev/theme-apple-basic",
|
|
7304
|
-
"shibainu": "@slidev/theme-shibainu",
|
|
7305
|
-
"bricks": "@slidev/theme-bricks"
|
|
7306
|
-
};
|
|
7307
|
-
var resolveTheme = createResolver("theme", officialThemes);
|
|
7308
|
-
async function getThemeMeta(name, root) {
|
|
7309
|
-
const path4 = join2(root, "package.json");
|
|
7310
|
-
if (!fs2.existsSync(path4))
|
|
7311
|
-
return {};
|
|
7312
|
-
const { slidev = {}, engines = {} } = await fs2.readJSON(path4);
|
|
7313
|
-
if (engines.slidev && !satisfies(version, engines.slidev, { includePrerelease: true }))
|
|
7314
|
-
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7315
|
-
return slidev;
|
|
7316
|
-
}
|
|
7317
|
-
|
|
7318
|
-
// node/integrations/addons.ts
|
|
7319
|
-
import { resolve } from "node:path";
|
|
7320
|
-
import fs3 from "fs-extra";
|
|
7321
|
-
import { satisfies as satisfies2 } from "semver";
|
|
7322
|
-
async function resolveAddons(addonsInConfig) {
|
|
7323
|
-
const { userRoot, userPkgJson } = await getRoots();
|
|
7324
|
-
const resolved = [];
|
|
7325
|
-
const resolveAddonNameAndRoot = createResolver("addon", {});
|
|
7326
|
-
async function resolveAddon(name, parent) {
|
|
7327
|
-
const [, pkgRoot] = await resolveAddonNameAndRoot(name, parent);
|
|
7328
|
-
if (!pkgRoot)
|
|
7329
|
-
return;
|
|
7330
|
-
resolved.push(pkgRoot);
|
|
7331
|
-
const { slidev = {}, engines = {} } = await fs3.readJSON(resolve(pkgRoot, "package.json"));
|
|
7332
|
-
if (engines.slidev && !satisfies2(version, engines.slidev, { includePrerelease: true }))
|
|
7333
|
-
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7334
|
-
if (Array.isArray(slidev.addons))
|
|
7335
|
-
await Promise.all(slidev.addons.map((addon) => resolveAddon(addon, pkgRoot)));
|
|
7336
|
-
}
|
|
7337
|
-
if (Array.isArray(addonsInConfig))
|
|
7338
|
-
await Promise.all(addonsInConfig.map((addon) => resolveAddon(addon, userRoot)));
|
|
7339
|
-
if (Array.isArray(userPkgJson.slidev?.addons))
|
|
7340
|
-
await Promise.all(userPkgJson.slidev.addons.map((addon) => resolveAddon(addon, userRoot)));
|
|
7341
|
-
return resolved;
|
|
7342
|
-
}
|
|
7343
|
-
|
|
7344
|
-
// node/options.ts
|
|
7345
|
-
import { uniq } from "@antfu/utils";
|
|
7346
|
-
import Debug from "debug";
|
|
7347
|
-
import mm from "micromatch";
|
|
7348
|
-
var debug = Debug("slidev:options");
|
|
7349
|
-
async function resolveOptions(options, mode) {
|
|
7350
|
-
const entry = await resolveEntry(options.entry);
|
|
7351
|
-
const rootsInfo = await getRoots(entry);
|
|
7352
|
-
const loaded = await parser.load(rootsInfo.userRoot, entry, void 0, mode);
|
|
7353
|
-
let themeRaw = options.theme || loaded.headmatter.theme;
|
|
7354
|
-
themeRaw = themeRaw === null ? "none" : themeRaw || "default";
|
|
7355
|
-
const [theme, themeRoot] = await resolveTheme(themeRaw, entry);
|
|
7356
|
-
const themeRoots = themeRoot ? [themeRoot] : [];
|
|
7357
|
-
const themeMeta = themeRoot ? await getThemeMeta(theme, themeRoot) : void 0;
|
|
7358
|
-
const config = parser.resolveConfig(loaded.headmatter, themeMeta, options.entry);
|
|
7359
|
-
const addonRoots = await resolveAddons(config.addons);
|
|
7360
|
-
const roots = uniq([...themeRoots, ...addonRoots, rootsInfo.userRoot]);
|
|
7361
|
-
debug({
|
|
7362
|
-
...rootsInfo,
|
|
7363
|
-
...options,
|
|
7364
|
-
config,
|
|
7365
|
-
mode,
|
|
7366
|
-
entry,
|
|
7367
|
-
themeRaw,
|
|
7368
|
-
theme,
|
|
7369
|
-
themeRoots,
|
|
7370
|
-
addonRoots,
|
|
7371
|
-
roots
|
|
7372
|
-
});
|
|
7373
|
-
const data = {
|
|
7374
|
-
...loaded,
|
|
7375
|
-
config,
|
|
7376
|
-
themeMeta
|
|
7377
|
-
};
|
|
7378
|
-
const resolved = {
|
|
7379
|
-
...rootsInfo,
|
|
7380
|
-
...options,
|
|
7381
|
-
data,
|
|
7382
|
-
mode,
|
|
7383
|
-
entry,
|
|
7384
|
-
themeRaw,
|
|
7385
|
-
theme,
|
|
7386
|
-
themeRoots,
|
|
7387
|
-
addonRoots,
|
|
7388
|
-
roots,
|
|
7389
|
-
utils: createDataUtils(data)
|
|
7390
|
-
};
|
|
7391
|
-
return resolved;
|
|
7392
|
-
}
|
|
7393
|
-
function createDataUtils(data) {
|
|
7394
|
-
const monacoTypesIgnorePackagesMatches = (data.config.monacoTypesIgnorePackages || []).map((i) => mm.matcher(i));
|
|
7395
|
-
return {
|
|
7396
|
-
isMonacoTypesIgnored: (pkg) => monacoTypesIgnorePackagesMatches.some((i) => i(pkg))
|
|
7397
|
-
};
|
|
7398
|
-
}
|
|
7399
|
-
|
|
7400
7264
|
// node/vite/index.ts
|
|
7401
|
-
import { join as
|
|
7402
|
-
import { existsSync as
|
|
7265
|
+
import { join as join9 } from "node:path";
|
|
7266
|
+
import { existsSync as existsSync5 } from "node:fs";
|
|
7403
7267
|
import process2 from "node:process";
|
|
7404
7268
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
7405
7269
|
import Icons from "unplugin-icons/vite";
|
|
@@ -7409,18 +7273,18 @@ import ServerRef from "vite-plugin-vue-server-ref";
|
|
|
7409
7273
|
import { notNullish as notNullish2 } from "@antfu/utils";
|
|
7410
7274
|
|
|
7411
7275
|
// node/integrations/drawings.ts
|
|
7412
|
-
import { basename, dirname, join
|
|
7413
|
-
import
|
|
7276
|
+
import { basename, dirname, join, resolve } from "node:path";
|
|
7277
|
+
import fs from "fs-extra";
|
|
7414
7278
|
import fg from "fast-glob";
|
|
7415
7279
|
function resolveDrawingsDir(options) {
|
|
7416
|
-
return options.data.config.drawings.persist ?
|
|
7280
|
+
return options.data.config.drawings.persist ? resolve(
|
|
7417
7281
|
dirname(options.entry),
|
|
7418
7282
|
options.data.config.drawings.persist
|
|
7419
7283
|
) : void 0;
|
|
7420
7284
|
}
|
|
7421
7285
|
async function loadDrawings(options) {
|
|
7422
7286
|
const dir = resolveDrawingsDir(options);
|
|
7423
|
-
if (!dir || !
|
|
7287
|
+
if (!dir || !fs.existsSync(dir))
|
|
7424
7288
|
return {};
|
|
7425
7289
|
const files = await fg("*.svg", {
|
|
7426
7290
|
onlyFiles: true,
|
|
@@ -7433,7 +7297,7 @@ async function loadDrawings(options) {
|
|
|
7433
7297
|
const num = +basename(path4, ".svg");
|
|
7434
7298
|
if (Number.isNaN(num))
|
|
7435
7299
|
return;
|
|
7436
|
-
const content = await
|
|
7300
|
+
const content = await fs.readFile(path4, "utf8");
|
|
7437
7301
|
const lines = content.split(/\n/g);
|
|
7438
7302
|
obj[num.toString()] = lines.slice(1, -1).join("\n");
|
|
7439
7303
|
}));
|
|
@@ -7446,7 +7310,7 @@ async function writeDrawings(options, drawing) {
|
|
|
7446
7310
|
const width = options.data.config.canvasWidth;
|
|
7447
7311
|
const height = Math.round(width / options.data.config.aspectRatio);
|
|
7448
7312
|
const SVG_HEAD = `<svg width="${width}" height="${height}" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">`;
|
|
7449
|
-
await
|
|
7313
|
+
await fs.ensureDir(dir);
|
|
7450
7314
|
return Promise.all(
|
|
7451
7315
|
Object.entries(drawing).map(async ([key, value]) => {
|
|
7452
7316
|
if (!value)
|
|
@@ -7454,16 +7318,16 @@ async function writeDrawings(options, drawing) {
|
|
|
7454
7318
|
const svg = `${SVG_HEAD}
|
|
7455
7319
|
${value}
|
|
7456
7320
|
</svg>`;
|
|
7457
|
-
await
|
|
7321
|
+
await fs.writeFile(join(dir, `${key}.svg`), svg, "utf-8");
|
|
7458
7322
|
})
|
|
7459
7323
|
);
|
|
7460
7324
|
}
|
|
7461
7325
|
|
|
7462
7326
|
// node/vite/extendConfig.ts
|
|
7463
|
-
import { join as
|
|
7327
|
+
import { join as join2 } from "node:path";
|
|
7464
7328
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7465
|
-
import { mergeConfig
|
|
7466
|
-
import { slash
|
|
7329
|
+
import { mergeConfig } from "vite";
|
|
7330
|
+
import { slash, uniq } from "@antfu/utils";
|
|
7467
7331
|
import { createResolve } from "mlly";
|
|
7468
7332
|
var INCLUDE_GLOBAL = [
|
|
7469
7333
|
"@typescript/ata",
|
|
@@ -7474,16 +7338,7 @@ var INCLUDE_GLOBAL = [
|
|
|
7474
7338
|
"typescript",
|
|
7475
7339
|
"yaml"
|
|
7476
7340
|
];
|
|
7477
|
-
var INCLUDE_LOCAL =
|
|
7478
|
-
...INCLUDE_GLOBAL,
|
|
7479
|
-
"codemirror",
|
|
7480
|
-
"codemirror/mode/javascript/javascript",
|
|
7481
|
-
"codemirror/mode/css/css",
|
|
7482
|
-
"codemirror/mode/markdown/markdown",
|
|
7483
|
-
"codemirror/mode/xml/xml",
|
|
7484
|
-
"codemirror/mode/htmlmixed/htmlmixed",
|
|
7485
|
-
"codemirror/addon/display/placeholder"
|
|
7486
|
-
].map((i) => `@slidev/cli > @slidev/client > ${i}`);
|
|
7341
|
+
var INCLUDE_LOCAL = INCLUDE_GLOBAL.map((i) => `@slidev/cli > @slidev/client > ${i}`);
|
|
7487
7342
|
var EXCLUDE_GLOBAL = [
|
|
7488
7343
|
"@antfu/utils",
|
|
7489
7344
|
"@shikijs/monaco",
|
|
@@ -7574,16 +7429,16 @@ function createConfigPlugin(options) {
|
|
|
7574
7429
|
server: {
|
|
7575
7430
|
fs: {
|
|
7576
7431
|
strict: true,
|
|
7577
|
-
allow:
|
|
7432
|
+
allow: uniq([
|
|
7578
7433
|
options.userWorkspaceRoot,
|
|
7579
7434
|
options.clientRoot,
|
|
7580
7435
|
// Special case for PNPM global installation
|
|
7581
|
-
isInstalledGlobally.value ?
|
|
7436
|
+
isInstalledGlobally.value ? slash(options.cliRoot).replace(/\/\.pnpm\/.*$/gi, "") : options.cliRoot,
|
|
7582
7437
|
...options.roots
|
|
7583
7438
|
])
|
|
7584
7439
|
}
|
|
7585
7440
|
},
|
|
7586
|
-
publicDir:
|
|
7441
|
+
publicDir: join2(options.userRoot, "public"),
|
|
7587
7442
|
build: {
|
|
7588
7443
|
rollupOptions: {
|
|
7589
7444
|
output: {
|
|
@@ -7616,10 +7471,10 @@ function createConfigPlugin(options) {
|
|
|
7616
7471
|
return id.includes("/@slidev/") || id.includes("/slidev/packages/client/") || id.includes("/@vueuse/");
|
|
7617
7472
|
}
|
|
7618
7473
|
if (isInstalledGlobally.value) {
|
|
7619
|
-
injection.cacheDir =
|
|
7474
|
+
injection.cacheDir = join2(options.cliRoot, "node_modules/.vite");
|
|
7620
7475
|
injection.root = options.cliRoot;
|
|
7621
7476
|
}
|
|
7622
|
-
return
|
|
7477
|
+
return mergeConfig(injection, config);
|
|
7623
7478
|
},
|
|
7624
7479
|
configureServer(server) {
|
|
7625
7480
|
return () => {
|
|
@@ -7647,6 +7502,7 @@ function getDefine(options) {
|
|
|
7647
7502
|
__SLIDEV_FEATURE_RECORD__: JSON.stringify(options.data.config.record === true || options.data.config.record === options.mode),
|
|
7648
7503
|
__SLIDEV_FEATURE_PRESENTER__: JSON.stringify(options.data.config.presenter === true || options.data.config.presenter === options.mode),
|
|
7649
7504
|
__SLIDEV_FEATURE_PRINT__: JSON.stringify(options.mode === "export" || options.mode === "build" && [true, "true", "auto"].includes(options.data.config.download)),
|
|
7505
|
+
__SLIDEV_FEATURE_WAKE_LOCK__: JSON.stringify(options.data.config.wakeLock === true || options.data.config.wakeLock === options.mode),
|
|
7650
7506
|
__SLIDEV_HAS_SERVER__: options.mode !== "build" ? "true" : "false"
|
|
7651
7507
|
};
|
|
7652
7508
|
}
|
|
@@ -7701,15 +7557,15 @@ console.warn('/@slidev/titles.md is deprecated, import from #slidev/title-render
|
|
|
7701
7557
|
};
|
|
7702
7558
|
|
|
7703
7559
|
// node/virtual/global-layers.ts
|
|
7704
|
-
import { existsSync
|
|
7705
|
-
import { join as
|
|
7560
|
+
import { existsSync } from "node:fs";
|
|
7561
|
+
import { join as join3 } from "node:path";
|
|
7706
7562
|
var templateGlobalLayers = {
|
|
7707
7563
|
id: `/@slidev/global-layers`,
|
|
7708
7564
|
getContent({ roots }) {
|
|
7709
7565
|
const imports = [];
|
|
7710
7566
|
let n = 0;
|
|
7711
7567
|
function getComponent(names) {
|
|
7712
|
-
const components = roots.flatMap((root) => names.map((name) =>
|
|
7568
|
+
const components = roots.flatMap((root) => names.map((name) => join3(root, name))).filter((i) => existsSync(i));
|
|
7713
7569
|
imports.push(components.map((path4, i) => `import __n${n}_${i} from '${toAtFS(path4)}'`).join("\n"));
|
|
7714
7570
|
const render = components.map((_, i) => `h(__n${n}_${i})`).join(",");
|
|
7715
7571
|
n++;
|
|
@@ -7731,17 +7587,17 @@ var templateGlobalLayers = {
|
|
|
7731
7587
|
};
|
|
7732
7588
|
|
|
7733
7589
|
// node/virtual/nav-controls.ts
|
|
7734
|
-
import { existsSync as
|
|
7735
|
-
import { join as
|
|
7590
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
7591
|
+
import { join as join4 } from "node:path";
|
|
7736
7592
|
var templateNavControls = {
|
|
7737
7593
|
id: "/@slidev/custom-nav-controls",
|
|
7738
7594
|
getContent({ roots }) {
|
|
7739
7595
|
const components = roots.flatMap((root) => {
|
|
7740
7596
|
return [
|
|
7741
|
-
|
|
7742
|
-
|
|
7597
|
+
join4(root, "custom-nav-controls.vue"),
|
|
7598
|
+
join4(root, "CustomNavControls.vue")
|
|
7743
7599
|
];
|
|
7744
|
-
}).filter((i) =>
|
|
7600
|
+
}).filter((i) => existsSync2(i));
|
|
7745
7601
|
const imports = components.map((i, idx) => `import __n${idx} from '${toAtFS(i)}'`).join("\n");
|
|
7746
7602
|
const render = components.map((i, idx) => `h(__n${idx})`).join(",");
|
|
7747
7603
|
return `${imports}
|
|
@@ -7775,15 +7631,15 @@ ${Object.entries(layouts).map(([k, v]) => `"${k}": ${v}`).join(",\n")}
|
|
|
7775
7631
|
};
|
|
7776
7632
|
|
|
7777
7633
|
// node/virtual/monaco-deps.ts
|
|
7778
|
-
import { resolve as
|
|
7779
|
-
import { uniq as
|
|
7634
|
+
import { resolve as resolve2 } from "node:path";
|
|
7635
|
+
import { uniq as uniq2 } from "@antfu/utils";
|
|
7780
7636
|
var templateMonacoRunDeps = {
|
|
7781
7637
|
id: "/@slidev/monaco-run-deps",
|
|
7782
7638
|
getContent: async ({ userRoot, data }, _ctx, pluginCtx) => {
|
|
7783
7639
|
if (!data.features.monaco)
|
|
7784
7640
|
return "";
|
|
7785
|
-
const deps =
|
|
7786
|
-
const importerPath =
|
|
7641
|
+
const deps = uniq2(data.features.monaco.deps.concat(data.config.monacoTypesAdditionalPackages));
|
|
7642
|
+
const importerPath = resolve2(userRoot, "./snippets/__importer__.ts");
|
|
7787
7643
|
let result = "";
|
|
7788
7644
|
for (let i = 0; i < deps.length; i++) {
|
|
7789
7645
|
const specifier = deps[i];
|
|
@@ -7804,19 +7660,19 @@ var templateMonacoRunDeps = {
|
|
|
7804
7660
|
|
|
7805
7661
|
// node/virtual/monaco-types.ts
|
|
7806
7662
|
import { builtinModules } from "node:module";
|
|
7807
|
-
import { join as
|
|
7663
|
+
import { join as join5, resolve as resolve3 } from "node:path";
|
|
7808
7664
|
import fg2 from "fast-glob";
|
|
7809
|
-
import { uniq as
|
|
7665
|
+
import { uniq as uniq3 } from "@antfu/utils";
|
|
7810
7666
|
var templateMonacoTypes = {
|
|
7811
7667
|
id: "/@slidev/monaco-types",
|
|
7812
7668
|
getContent: async ({ userRoot, data, utils }) => {
|
|
7813
7669
|
if (!data.features.monaco)
|
|
7814
7670
|
return "";
|
|
7815
|
-
const typesRoot =
|
|
7671
|
+
const typesRoot = join5(userRoot, "snippets");
|
|
7816
7672
|
const files = await fg2(["**/*.ts", "**/*.mts", "**/*.cts"], { cwd: typesRoot });
|
|
7817
7673
|
let result = 'import { addFile } from "@slidev/client/setup/monaco.ts"\n';
|
|
7818
7674
|
for (const file of files) {
|
|
7819
|
-
const url = `${toAtFS(
|
|
7675
|
+
const url = `${toAtFS(resolve3(typesRoot, file))}?monaco-types&raw`;
|
|
7820
7676
|
result += `addFile(() => import(${JSON.stringify(url)}), ${JSON.stringify(file)})
|
|
7821
7677
|
`;
|
|
7822
7678
|
}
|
|
@@ -7835,7 +7691,7 @@ var templateMonacoTypes = {
|
|
|
7835
7691
|
let deps = [...data.config.monacoTypesAdditionalPackages];
|
|
7836
7692
|
if (data.config.monacoTypesSource === "local")
|
|
7837
7693
|
deps.push(...data.features.monaco.types);
|
|
7838
|
-
deps =
|
|
7694
|
+
deps = uniq3(deps.map((specifier) => {
|
|
7839
7695
|
if (specifier[0] === ".")
|
|
7840
7696
|
return "";
|
|
7841
7697
|
return mapModuleNameToModule(specifier);
|
|
@@ -7850,16 +7706,16 @@ var templateMonacoTypes = {
|
|
|
7850
7706
|
};
|
|
7851
7707
|
|
|
7852
7708
|
// node/virtual/setups.ts
|
|
7853
|
-
import { existsSync as
|
|
7854
|
-
import { join as
|
|
7709
|
+
import { existsSync as existsSync3 } from "node:fs";
|
|
7710
|
+
import { join as join6 } from "node:path";
|
|
7855
7711
|
function createSetupTemplate(name) {
|
|
7856
7712
|
return {
|
|
7857
7713
|
id: `/@slidev/setups/${name}`,
|
|
7858
7714
|
getContent({ roots }) {
|
|
7859
7715
|
const setups = roots.flatMap((i) => {
|
|
7860
|
-
const path4 =
|
|
7716
|
+
const path4 = join6(i, "setup", name);
|
|
7861
7717
|
return [".ts", ".mts", ".js", ".mjs"].map((ext) => path4 + ext);
|
|
7862
|
-
}).filter((i) =>
|
|
7718
|
+
}).filter((i) => existsSync3(i));
|
|
7863
7719
|
const imports = [];
|
|
7864
7720
|
setups.forEach((path4, idx) => {
|
|
7865
7721
|
imports.push(`import __n${idx} from '${toAtFS(path4)}'`);
|
|
@@ -7873,7 +7729,7 @@ var setupModules = ["shiki", "code-runners", "monaco", "mermaid", "main", "root"
|
|
|
7873
7729
|
var templateSetups = setupModules.map(createSetupTemplate);
|
|
7874
7730
|
|
|
7875
7731
|
// node/setups/shiki.ts
|
|
7876
|
-
import
|
|
7732
|
+
import fs2 from "node:fs/promises";
|
|
7877
7733
|
async function loadShikiSetups(clientRoot, roots) {
|
|
7878
7734
|
const result = await loadSetups(
|
|
7879
7735
|
clientRoot,
|
|
@@ -7883,7 +7739,7 @@ async function loadShikiSetups(clientRoot, roots) {
|
|
|
7883
7739
|
/** @deprecated */
|
|
7884
7740
|
async loadTheme(path4) {
|
|
7885
7741
|
console.warn("[slidev] `loadTheme` in `setup/shiki.ts` is deprecated. Pass directly the theme name it's supported by Shiki. For custom themes, load it manually via `JSON.parse(fs.readFileSync(path, 'utf-8'))` and pass the raw JSON object instead.");
|
|
7886
|
-
return JSON.parse(await
|
|
7742
|
+
return JSON.parse(await fs2.readFile(path4, "utf-8"));
|
|
7887
7743
|
}
|
|
7888
7744
|
},
|
|
7889
7745
|
{},
|
|
@@ -7911,7 +7767,7 @@ var templateShiki = {
|
|
|
7911
7767
|
id: "/@slidev/shiki",
|
|
7912
7768
|
getContent: async ({ clientRoot, roots }) => {
|
|
7913
7769
|
const options = await loadShikiSetups(clientRoot, roots);
|
|
7914
|
-
const langs = await resolveLangs(options.langs || ["javascript", "typescript", "html", "css"]);
|
|
7770
|
+
const langs = await resolveLangs(options.langs || ["markdown", "vue", "javascript", "typescript", "html", "css"]);
|
|
7915
7771
|
const resolvedThemeOptions = "themes" in options ? {
|
|
7916
7772
|
themes: Object.fromEntries(await Promise.all(
|
|
7917
7773
|
Object.entries(options.themes).map(async ([name, value]) => [name, await resolveTheme2(value)])
|
|
@@ -7939,15 +7795,28 @@ var templateShiki = {
|
|
|
7939
7795
|
const langNames = langs.flatMap((lang) => typeof lang === "string" ? lang : lang.name);
|
|
7940
7796
|
const lines = [];
|
|
7941
7797
|
lines.push(
|
|
7942
|
-
`import {
|
|
7798
|
+
`import { createHighlighterCore } from "${await resolveImportUrl("shiki/core")}"`,
|
|
7943
7799
|
`export { shikiToMonaco } from "${await resolveImportUrl("@shikijs/monaco")}"`,
|
|
7944
7800
|
`export const languages = ${JSON.stringify(langNames)}`,
|
|
7945
7801
|
`export const themes = ${JSON.stringify(themeOptionsNames.themes || themeOptionsNames.theme)}`,
|
|
7946
|
-
"export const shiki =
|
|
7802
|
+
"export const shiki = createHighlighterCore({",
|
|
7947
7803
|
` themes: [${themesInit.join(",")}],`,
|
|
7948
7804
|
` langs: [${langsInit.join(",")}],`,
|
|
7949
7805
|
` loadWasm: import('${await resolveImportUrl("shiki/wasm")}'),`,
|
|
7950
|
-
"})"
|
|
7806
|
+
"})",
|
|
7807
|
+
"let highlight",
|
|
7808
|
+
"export async function getHighlighter() {",
|
|
7809
|
+
" if (highlight) return highlight",
|
|
7810
|
+
" const highlighter = await shiki",
|
|
7811
|
+
" highlight = (code, lang, options) => highlighter.codeToHtml(code, {",
|
|
7812
|
+
" lang,",
|
|
7813
|
+
` theme: ${JSON.stringify(themeOptionsNames.theme)},`,
|
|
7814
|
+
` themes: ${JSON.stringify(themeOptionsNames.themes)},`,
|
|
7815
|
+
" defaultColor: false,",
|
|
7816
|
+
" ...options,",
|
|
7817
|
+
" })",
|
|
7818
|
+
" return highlight",
|
|
7819
|
+
"}"
|
|
7951
7820
|
);
|
|
7952
7821
|
return lines.join("\n");
|
|
7953
7822
|
}
|
|
@@ -7996,13 +7865,13 @@ ${slides.join(",\n")}
|
|
|
7996
7865
|
};
|
|
7997
7866
|
|
|
7998
7867
|
// node/virtual/styles.ts
|
|
7999
|
-
import { join as
|
|
8000
|
-
import { existsSync as
|
|
7868
|
+
import { join as join7 } from "node:path";
|
|
7869
|
+
import { existsSync as existsSync4 } from "node:fs";
|
|
8001
7870
|
var templateStyle = {
|
|
8002
7871
|
id: "/@slidev/styles",
|
|
8003
7872
|
getContent: async ({ data, clientRoot, roots }) => {
|
|
8004
7873
|
function resolveUrlOfClient(name) {
|
|
8005
|
-
return toAtFS(
|
|
7874
|
+
return toAtFS(join7(clientRoot, name));
|
|
8006
7875
|
}
|
|
8007
7876
|
const imports = [
|
|
8008
7877
|
`import "${resolveUrlOfClient("styles/vars.css")}"`,
|
|
@@ -8013,14 +7882,14 @@ var templateStyle = {
|
|
|
8013
7882
|
];
|
|
8014
7883
|
for (const root of roots) {
|
|
8015
7884
|
const styles = [
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
|
|
8019
|
-
|
|
8020
|
-
|
|
7885
|
+
join7(root, "styles", "index.ts"),
|
|
7886
|
+
join7(root, "styles", "index.js"),
|
|
7887
|
+
join7(root, "styles", "index.css"),
|
|
7888
|
+
join7(root, "styles.css"),
|
|
7889
|
+
join7(root, "style.css")
|
|
8021
7890
|
];
|
|
8022
7891
|
for (const style of styles) {
|
|
8023
|
-
if (
|
|
7892
|
+
if (existsSync4(style)) {
|
|
8024
7893
|
imports.push(`import "${toAtFS(style)}"`);
|
|
8025
7894
|
continue;
|
|
8026
7895
|
}
|
|
@@ -8094,6 +7963,116 @@ var templates = [
|
|
|
8094
7963
|
templateLegacyTitles
|
|
8095
7964
|
];
|
|
8096
7965
|
|
|
7966
|
+
// node/options.ts
|
|
7967
|
+
import { uniq as uniq4 } from "@antfu/utils";
|
|
7968
|
+
import Debug from "debug";
|
|
7969
|
+
import mm from "micromatch";
|
|
7970
|
+
|
|
7971
|
+
// node/parser.ts
|
|
7972
|
+
import * as parser from "@slidev/parser/fs";
|
|
7973
|
+
|
|
7974
|
+
// node/integrations/themes.ts
|
|
7975
|
+
import { join as join8 } from "node:path";
|
|
7976
|
+
import fs3 from "fs-extra";
|
|
7977
|
+
import { satisfies } from "semver";
|
|
7978
|
+
var officialThemes = {
|
|
7979
|
+
"none": "",
|
|
7980
|
+
"default": "@slidev/theme-default",
|
|
7981
|
+
"seriph": "@slidev/theme-seriph",
|
|
7982
|
+
"apple-basic": "@slidev/theme-apple-basic",
|
|
7983
|
+
"shibainu": "@slidev/theme-shibainu",
|
|
7984
|
+
"bricks": "@slidev/theme-bricks"
|
|
7985
|
+
};
|
|
7986
|
+
var resolveTheme = createResolver("theme", officialThemes);
|
|
7987
|
+
async function getThemeMeta(name, root) {
|
|
7988
|
+
const path4 = join8(root, "package.json");
|
|
7989
|
+
if (!fs3.existsSync(path4))
|
|
7990
|
+
return {};
|
|
7991
|
+
const { slidev = {}, engines = {} } = await fs3.readJSON(path4);
|
|
7992
|
+
if (engines.slidev && !satisfies(version, engines.slidev, { includePrerelease: true }))
|
|
7993
|
+
throw new Error(`[slidev] theme "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
7994
|
+
return slidev;
|
|
7995
|
+
}
|
|
7996
|
+
|
|
7997
|
+
// node/integrations/addons.ts
|
|
7998
|
+
import { resolve as resolve4 } from "node:path";
|
|
7999
|
+
import fs4 from "fs-extra";
|
|
8000
|
+
import { satisfies as satisfies2 } from "semver";
|
|
8001
|
+
async function resolveAddons(addonsInConfig) {
|
|
8002
|
+
const { userRoot, userPkgJson } = await getRoots();
|
|
8003
|
+
const resolved = [];
|
|
8004
|
+
const resolveAddonNameAndRoot = createResolver("addon", {});
|
|
8005
|
+
async function resolveAddon(name, parent) {
|
|
8006
|
+
const [, pkgRoot] = await resolveAddonNameAndRoot(name, parent);
|
|
8007
|
+
if (!pkgRoot)
|
|
8008
|
+
return;
|
|
8009
|
+
resolved.push(pkgRoot);
|
|
8010
|
+
const { slidev = {}, engines = {} } = await fs4.readJSON(resolve4(pkgRoot, "package.json"));
|
|
8011
|
+
if (engines.slidev && !satisfies2(version, engines.slidev, { includePrerelease: true }))
|
|
8012
|
+
throw new Error(`[slidev] addon "${name}" requires Slidev version range "${engines.slidev}" but found "${version}"`);
|
|
8013
|
+
if (Array.isArray(slidev.addons))
|
|
8014
|
+
await Promise.all(slidev.addons.map((addon) => resolveAddon(addon, pkgRoot)));
|
|
8015
|
+
}
|
|
8016
|
+
if (Array.isArray(addonsInConfig))
|
|
8017
|
+
await Promise.all(addonsInConfig.map((addon) => resolveAddon(addon, userRoot)));
|
|
8018
|
+
if (Array.isArray(userPkgJson.slidev?.addons))
|
|
8019
|
+
await Promise.all(userPkgJson.slidev.addons.map((addon) => resolveAddon(addon, userRoot)));
|
|
8020
|
+
return resolved;
|
|
8021
|
+
}
|
|
8022
|
+
|
|
8023
|
+
// node/options.ts
|
|
8024
|
+
var debug = Debug("slidev:options");
|
|
8025
|
+
async function resolveOptions(options, mode) {
|
|
8026
|
+
const entry = await resolveEntry(options.entry);
|
|
8027
|
+
const rootsInfo = await getRoots(entry);
|
|
8028
|
+
const loaded = await parser.load(rootsInfo.userRoot, entry, void 0, mode);
|
|
8029
|
+
let themeRaw = options.theme || loaded.headmatter.theme;
|
|
8030
|
+
themeRaw = themeRaw === null ? "none" : themeRaw || "default";
|
|
8031
|
+
const [theme, themeRoot] = await resolveTheme(themeRaw, entry);
|
|
8032
|
+
const themeRoots = themeRoot ? [themeRoot] : [];
|
|
8033
|
+
const themeMeta = themeRoot ? await getThemeMeta(theme, themeRoot) : void 0;
|
|
8034
|
+
const config = parser.resolveConfig(loaded.headmatter, themeMeta, options.entry);
|
|
8035
|
+
const addonRoots = await resolveAddons(config.addons);
|
|
8036
|
+
const roots = uniq4([...themeRoots, ...addonRoots, rootsInfo.userRoot]);
|
|
8037
|
+
debug({
|
|
8038
|
+
...rootsInfo,
|
|
8039
|
+
...options,
|
|
8040
|
+
config,
|
|
8041
|
+
mode,
|
|
8042
|
+
entry,
|
|
8043
|
+
themeRaw,
|
|
8044
|
+
theme,
|
|
8045
|
+
themeRoots,
|
|
8046
|
+
addonRoots,
|
|
8047
|
+
roots
|
|
8048
|
+
});
|
|
8049
|
+
const data = {
|
|
8050
|
+
...loaded,
|
|
8051
|
+
config,
|
|
8052
|
+
themeMeta
|
|
8053
|
+
};
|
|
8054
|
+
const resolved = {
|
|
8055
|
+
...rootsInfo,
|
|
8056
|
+
...options,
|
|
8057
|
+
data,
|
|
8058
|
+
mode,
|
|
8059
|
+
entry,
|
|
8060
|
+
themeRaw,
|
|
8061
|
+
theme,
|
|
8062
|
+
themeRoots,
|
|
8063
|
+
addonRoots,
|
|
8064
|
+
roots,
|
|
8065
|
+
utils: createDataUtils(data)
|
|
8066
|
+
};
|
|
8067
|
+
return resolved;
|
|
8068
|
+
}
|
|
8069
|
+
function createDataUtils(data) {
|
|
8070
|
+
const monacoTypesIgnorePackagesMatches = (data.config.monacoTypesIgnorePackages || []).map((i) => mm.matcher(i));
|
|
8071
|
+
return {
|
|
8072
|
+
isMonacoTypesIgnored: (pkg) => monacoTypesIgnorePackagesMatches.some((i) => i(pkg))
|
|
8073
|
+
};
|
|
8074
|
+
}
|
|
8075
|
+
|
|
8097
8076
|
// node/vite/loaders.ts
|
|
8098
8077
|
var regexId = /^\/@slidev\/slide\/(\d+)\.(md|json)(?:\?import)?$/;
|
|
8099
8078
|
var regexIdQuery = /(\d+)\.(md|json|frontmatter)$/;
|
|
@@ -8148,17 +8127,15 @@ function createSlidesLoader(options, pluginOptions, serverOptions) {
|
|
|
8148
8127
|
if (now - _layouts_cache_time < 2e3)
|
|
8149
8128
|
return _layouts_cache;
|
|
8150
8129
|
const layouts = {};
|
|
8151
|
-
for (const root of [...roots
|
|
8130
|
+
for (const root of [clientRoot, ...roots]) {
|
|
8152
8131
|
const layoutPaths = await fg3("layouts/**/*.{vue,ts}", {
|
|
8153
8132
|
cwd: root,
|
|
8154
8133
|
absolute: true,
|
|
8155
8134
|
suppressErrors: true
|
|
8156
8135
|
});
|
|
8157
8136
|
for (const layoutPath of layoutPaths) {
|
|
8158
|
-
const
|
|
8159
|
-
|
|
8160
|
-
continue;
|
|
8161
|
-
layouts[layout] = layoutPath;
|
|
8137
|
+
const layoutName = path.basename(layoutPath).replace(/\.\w+$/, "");
|
|
8138
|
+
layouts[layoutName] = layoutPath;
|
|
8162
8139
|
}
|
|
8163
8140
|
}
|
|
8164
8141
|
_layouts_cache_time = now;
|
|
@@ -8325,6 +8302,7 @@ function createSlidesLoader(options, pluginOptions, serverOptions) {
|
|
|
8325
8302
|
...withRenderedNote(slide),
|
|
8326
8303
|
frontmatter: void 0,
|
|
8327
8304
|
source: void 0,
|
|
8305
|
+
importChain: void 0,
|
|
8328
8306
|
// remove raw content in build, optimize the bundle size
|
|
8329
8307
|
...mode === "build" ? { raw: "", content: "", note: "" } : {}
|
|
8330
8308
|
};
|
|
@@ -8344,7 +8322,7 @@ function createSlidesLoader(options, pluginOptions, serverOptions) {
|
|
|
8344
8322
|
slide: {
|
|
8345
8323
|
...(${JSON.stringify(slideBase)}),
|
|
8346
8324
|
frontmatter,
|
|
8347
|
-
filepath: ${JSON.stringify(slide.source.filepath)},
|
|
8325
|
+
filepath: ${JSON.stringify(mode === "dev" ? slide.source.filepath : "")},
|
|
8348
8326
|
start: ${JSON.stringify(slide.source.start)},
|
|
8349
8327
|
id: ${pageNo},
|
|
8350
8328
|
no: ${no},
|
|
@@ -8512,7 +8490,7 @@ ${code}`;
|
|
|
8512
8490
|
|
|
8513
8491
|
// node/vite/markdown.ts
|
|
8514
8492
|
import Markdown from "unplugin-vue-markdown/vite";
|
|
8515
|
-
import { isTruthy, slash as
|
|
8493
|
+
import { isTruthy, slash as slash3 } from "@antfu/utils";
|
|
8516
8494
|
|
|
8517
8495
|
// ../../node_modules/.pnpm/@hedgedoc+markdown-it-plugins@2.1.4_patch_hash=tuyuxytl56b2vxulpkzt2wf4o4_markdown-it@14.1.0/node_modules/@hedgedoc/markdown-it-plugins/dist/esm/image-size/specialCharacters.js
|
|
8518
8496
|
var SpecialCharacters;
|
|
@@ -9022,7 +9000,7 @@ function transformMagicMove(shiki, shikiOptions, configLineNumbers) {
|
|
|
9022
9000
|
import lz2 from "lz-string";
|
|
9023
9001
|
function transformMermaid(ctx) {
|
|
9024
9002
|
ctx.s.replace(
|
|
9025
|
-
/^```mermaid *(\{[
|
|
9003
|
+
/^```mermaid *(\{[^\n]*\})?\n([\s\S]+?)\n```/gm,
|
|
9026
9004
|
(full, options = "", code = "") => {
|
|
9027
9005
|
code = code.trim();
|
|
9028
9006
|
options = options.trim() || "{}";
|
|
@@ -9049,11 +9027,11 @@ function transformPlantUml(ctx) {
|
|
|
9049
9027
|
// node/syntax/transform/snippet.ts
|
|
9050
9028
|
import path3 from "node:path";
|
|
9051
9029
|
import lz3 from "lz-string";
|
|
9052
|
-
import
|
|
9053
|
-
import { slash as
|
|
9030
|
+
import fs6 from "fs-extra";
|
|
9031
|
+
import { slash as slash2 } from "@antfu/utils";
|
|
9054
9032
|
|
|
9055
9033
|
// node/vite/monacoWrite.ts
|
|
9056
|
-
import
|
|
9034
|
+
import fs5 from "node:fs/promises";
|
|
9057
9035
|
import path2 from "node:path";
|
|
9058
9036
|
var monacoWriterWhitelist = /* @__PURE__ */ new Set();
|
|
9059
9037
|
function createMonacoWriter({ userRoot }) {
|
|
@@ -9077,7 +9055,7 @@ function createMonacoWriter({ userRoot }) {
|
|
|
9077
9055
|
}
|
|
9078
9056
|
const filepath = path2.join(userRoot, file);
|
|
9079
9057
|
console.log("[Slidev] Writing file:", filepath);
|
|
9080
|
-
await
|
|
9058
|
+
await fs5.writeFile(filepath, content, "utf-8");
|
|
9081
9059
|
}
|
|
9082
9060
|
});
|
|
9083
9061
|
});
|
|
@@ -9149,15 +9127,15 @@ function transformSnippet(ctx) {
|
|
|
9149
9127
|
// eslint-disable-next-line regexp/no-super-linear-backtracking
|
|
9150
9128
|
/^<<<\s*(\S.*?)(#[\w-]+)?\s*(?:\s(\S+?))?\s*(\{.*)?$/gm,
|
|
9151
9129
|
(full, filepath = "", regionName = "", lang = "", meta = "") => {
|
|
9152
|
-
const src =
|
|
9130
|
+
const src = slash2(
|
|
9153
9131
|
/^@\//.test(filepath) ? path3.resolve(options.userRoot, filepath.slice(2)) : path3.resolve(dir, filepath)
|
|
9154
9132
|
);
|
|
9155
9133
|
data.watchFiles.push(src);
|
|
9156
|
-
const isAFile =
|
|
9157
|
-
if (!
|
|
9134
|
+
const isAFile = fs6.statSync(src).isFile();
|
|
9135
|
+
if (!fs6.existsSync(src) || !isAFile) {
|
|
9158
9136
|
throw new Error(isAFile ? `Code snippet path not found: ${src}` : `Invalid code snippet option`);
|
|
9159
9137
|
}
|
|
9160
|
-
let content =
|
|
9138
|
+
let content = fs6.readFileSync(src, "utf8");
|
|
9161
9139
|
slideInfo.snippetsUsed ??= {};
|
|
9162
9140
|
slideInfo.snippetsUsed[src] = content;
|
|
9163
9141
|
if (regionName) {
|
|
@@ -9242,7 +9220,7 @@ function transformMonaco(ctx) {
|
|
|
9242
9220
|
return;
|
|
9243
9221
|
}
|
|
9244
9222
|
ctx.s.replace(
|
|
9245
|
-
/^```(\w+) *\{monaco-diff\} *(?:(\{[^\n
|
|
9223
|
+
/^```(\w+) *\{monaco-diff\} *(?:(\{[^\n]*\}) *)?\n([\s\S]+?)^~~~ *\n([\s\S]+?)^```/gm,
|
|
9246
9224
|
(full, lang = "ts", options = "{}", code, diff) => {
|
|
9247
9225
|
lang = lang.trim();
|
|
9248
9226
|
options = options.trim() || "{}";
|
|
@@ -9252,7 +9230,7 @@ function transformMonaco(ctx) {
|
|
|
9252
9230
|
}
|
|
9253
9231
|
);
|
|
9254
9232
|
ctx.s.replace(
|
|
9255
|
-
/^```(\w+) *\{monaco\} *(?:(\{[
|
|
9233
|
+
/^```(\w+) *\{monaco\} *(?:(\{[^\n]*\}) *)?\n([\s\S]+?)^```/gm,
|
|
9256
9234
|
(full, lang = "ts", options = "{}", code) => {
|
|
9257
9235
|
lang = lang.trim();
|
|
9258
9236
|
options = options.trim() || "{}";
|
|
@@ -9261,7 +9239,7 @@ function transformMonaco(ctx) {
|
|
|
9261
9239
|
}
|
|
9262
9240
|
);
|
|
9263
9241
|
ctx.s.replace(
|
|
9264
|
-
/^```(\w+) *\{monaco-run\} *(?:(\{[
|
|
9242
|
+
/^```(\w+) *\{monaco-run\} *(?:(\{[^\n]*\}) *)?\n([\s\S]+?)^```/gm,
|
|
9265
9243
|
(full, lang = "ts", options = "{}", code) => {
|
|
9266
9244
|
lang = lang.trim();
|
|
9267
9245
|
options = options.trim() || "{}";
|
|
@@ -9294,7 +9272,7 @@ $$
|
|
|
9294
9272
|
async function createMarkdownPlugin(options, { markdown: mdOptions }) {
|
|
9295
9273
|
const { data: { config }, roots, mode, entry, clientRoot } = options;
|
|
9296
9274
|
const setups = [];
|
|
9297
|
-
const entryPath =
|
|
9275
|
+
const entryPath = slash3(entry);
|
|
9298
9276
|
let shiki;
|
|
9299
9277
|
let shikiOptions;
|
|
9300
9278
|
if (config.highlighter === "shiki") {
|
|
@@ -9353,16 +9331,16 @@ async function createMarkdownPlugin(options, { markdown: mdOptions }) {
|
|
|
9353
9331
|
async function createMarkdownItShiki(clientRoot, roots, config, mode) {
|
|
9354
9332
|
const [
|
|
9355
9333
|
shikiOptions,
|
|
9356
|
-
{
|
|
9334
|
+
{ createHighlighter, bundledLanguages },
|
|
9357
9335
|
markdownItShiki,
|
|
9358
9336
|
transformerTwoslash
|
|
9359
9337
|
] = await Promise.all([
|
|
9360
9338
|
loadShikiSetups(clientRoot, roots),
|
|
9361
|
-
import("shiki").then(({
|
|
9339
|
+
import("shiki").then(({ createHighlighter: createHighlighter2, bundledLanguages: bundledLanguages2 }) => ({ bundledLanguages: bundledLanguages2, createHighlighter: createHighlighter2 })),
|
|
9362
9340
|
import("@shikijs/markdown-it/core").then(({ fromHighlighter }) => fromHighlighter),
|
|
9363
9341
|
import("@shikijs/vitepress-twoslash").then(({ transformerTwoslash: transformerTwoslash2 }) => transformerTwoslash2)
|
|
9364
9342
|
]);
|
|
9365
|
-
const shiki = await
|
|
9343
|
+
const shiki = await createHighlighter({
|
|
9366
9344
|
...shikiOptions,
|
|
9367
9345
|
langs: shikiOptions.langs ?? Object.keys(bundledLanguages),
|
|
9368
9346
|
themes: "themes" in shikiOptions ? Object.values(shikiOptions.themes) : [shikiOptions.theme]
|
|
@@ -9450,9 +9428,9 @@ function createVueCompilerFlagsPlugin(options) {
|
|
|
9450
9428
|
}
|
|
9451
9429
|
|
|
9452
9430
|
// node/vite/monacoTypes.ts
|
|
9453
|
-
import
|
|
9431
|
+
import fs7 from "node:fs/promises";
|
|
9454
9432
|
import { dirname as dirname2, resolve as resolve5 } from "node:path";
|
|
9455
|
-
import { slash as
|
|
9433
|
+
import { slash as slash4 } from "@antfu/utils";
|
|
9456
9434
|
import fg4 from "fast-glob";
|
|
9457
9435
|
import { findDepPkgJsonPath } from "vitefu";
|
|
9458
9436
|
function createMonacoTypesLoader({ userRoot, utils }) {
|
|
@@ -9474,8 +9452,8 @@ function createMonacoTypesLoader({ userRoot, utils }) {
|
|
|
9474
9452
|
const pkgJsonPath = await findDepPkgJsonPath(pkg, importer);
|
|
9475
9453
|
if (!pkgJsonPath)
|
|
9476
9454
|
throw new Error(`Package "${pkg}" not found in "${importer}"`);
|
|
9477
|
-
const root =
|
|
9478
|
-
const pkgJson = JSON.parse(await
|
|
9455
|
+
const root = slash4(dirname2(pkgJsonPath));
|
|
9456
|
+
const pkgJson = JSON.parse(await fs7.readFile(pkgJsonPath, "utf-8"));
|
|
9479
9457
|
let deps = Object.keys(pkgJson.dependencies ?? {});
|
|
9480
9458
|
deps = deps.filter((pkg2) => !utils.isMonacoTypesIgnored(pkg2));
|
|
9481
9459
|
return [
|
|
@@ -9585,7 +9563,7 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9585
9563
|
data: { config }
|
|
9586
9564
|
} = options;
|
|
9587
9565
|
const drawingData = await loadDrawings(options);
|
|
9588
|
-
const publicRoots = [...themeRoots, ...addonRoots].map((i) =>
|
|
9566
|
+
const publicRoots = [...themeRoots, ...addonRoots].map((i) => join9(i, "public")).filter(existsSync5);
|
|
9589
9567
|
const plugins = [
|
|
9590
9568
|
createMarkdownPlugin(options, pluginOptions),
|
|
9591
9569
|
createVuePlugin(options, pluginOptions),
|
|
@@ -9594,11 +9572,11 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9594
9572
|
Components({
|
|
9595
9573
|
extensions: ["vue", "md", "js", "ts", "jsx", "tsx"],
|
|
9596
9574
|
dirs: [
|
|
9597
|
-
|
|
9598
|
-
...roots.map((i) =>
|
|
9575
|
+
join9(options.clientRoot, "builtin"),
|
|
9576
|
+
...roots.map((i) => join9(i, "components")),
|
|
9599
9577
|
"src/components",
|
|
9600
9578
|
"components",
|
|
9601
|
-
|
|
9579
|
+
join9(process2.cwd(), "components")
|
|
9602
9580
|
],
|
|
9603
9581
|
include: [/\.vue$/, /\.vue\?vue/, /\.vue\?v=/, /\.md$/, /\.md\?vue/],
|
|
9604
9582
|
exclude: [],
|
|
@@ -9667,10 +9645,85 @@ async function ViteSlidevPlugin(options, pluginOptions, serverOptions = {}) {
|
|
|
9667
9645
|
return (await Promise.all(plugins)).flat().filter(notNullish2);
|
|
9668
9646
|
}
|
|
9669
9647
|
|
|
9648
|
+
// node/commands/shared.ts
|
|
9649
|
+
var sharedMd = MarkdownIt({ html: true });
|
|
9650
|
+
sharedMd.use(markdownItLink);
|
|
9651
|
+
function getSlideTitle(data) {
|
|
9652
|
+
const tokens = sharedMd.parseInline(data.config.title, {});
|
|
9653
|
+
const title = stringifyMarkdownTokens(tokens);
|
|
9654
|
+
const slideTitle = data.config.titleTemplate.replace("%s", title);
|
|
9655
|
+
return slideTitle === "Slidev - Slidev" ? "Slidev" : slideTitle;
|
|
9656
|
+
}
|
|
9657
|
+
function escapeHtml(unsafe) {
|
|
9658
|
+
return JSON.stringify(
|
|
9659
|
+
String(unsafe).replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'")
|
|
9660
|
+
);
|
|
9661
|
+
}
|
|
9662
|
+
async function getIndexHtml({ mode, entry, clientRoot, roots, data }) {
|
|
9663
|
+
let main = await fs8.readFile(join10(clientRoot, "index.html"), "utf-8");
|
|
9664
|
+
let head = "";
|
|
9665
|
+
let body = "";
|
|
9666
|
+
const { info, author, keywords } = data.headmatter;
|
|
9667
|
+
head += [
|
|
9668
|
+
`<meta name="slidev:version" content="${version}">`,
|
|
9669
|
+
mode === "dev" && `<meta charset="slidev:entry" content="${slash5(entry)}">`,
|
|
9670
|
+
`<link rel="icon" href="${data.config.favicon}">`,
|
|
9671
|
+
`<title>${getSlideTitle(data)}</title>`,
|
|
9672
|
+
info && `<meta name="description" content=${escapeHtml(info)}>`,
|
|
9673
|
+
author && `<meta name="author" content=${escapeHtml(author)}>`,
|
|
9674
|
+
keywords && `<meta name="keywords" content=${escapeHtml(Array.isArray(keywords) ? keywords.join(", ") : keywords)}>`
|
|
9675
|
+
].filter(Boolean).join("\n");
|
|
9676
|
+
for (const root of roots) {
|
|
9677
|
+
const path4 = join10(root, "index.html");
|
|
9678
|
+
if (!existsSync6(path4))
|
|
9679
|
+
continue;
|
|
9680
|
+
const index = await fs8.readFile(path4, "utf-8");
|
|
9681
|
+
head += `
|
|
9682
|
+
${(index.match(/<head>([\s\S]*?)<\/head>/i)?.[1] || "").trim()}`;
|
|
9683
|
+
body += `
|
|
9684
|
+
${(index.match(/<body>([\s\S]*?)<\/body>/i)?.[1] || "").trim()}`;
|
|
9685
|
+
}
|
|
9686
|
+
if (data.features.tweet)
|
|
9687
|
+
body += '\n<script async src="https://platform.twitter.com/widgets.js"></script>';
|
|
9688
|
+
if (data.config.fonts.webfonts.length && data.config.fonts.provider !== "none")
|
|
9689
|
+
head += `
|
|
9690
|
+
<link rel="stylesheet" href="${generateGoogleFontsUrl(data.config.fonts)}" type="text/css">`;
|
|
9691
|
+
main = main.replace("__ENTRY__", toAtFS(join10(clientRoot, "main.ts"))).replace("<!-- head -->", head).replace("<!-- body -->", body);
|
|
9692
|
+
return main;
|
|
9693
|
+
}
|
|
9694
|
+
async function resolveViteConfigs(options, baseConfig, overrideConfigs, command, serverOptions) {
|
|
9695
|
+
const configEnv = {
|
|
9696
|
+
mode: command === "build" ? "production" : "development",
|
|
9697
|
+
command
|
|
9698
|
+
};
|
|
9699
|
+
const files = options.roots.map((i) => join10(i, "vite.config.ts"));
|
|
9700
|
+
for (const file of files) {
|
|
9701
|
+
if (!existsSync6(file))
|
|
9702
|
+
continue;
|
|
9703
|
+
const viteConfig = await loadConfigFromFile(configEnv, file);
|
|
9704
|
+
if (!viteConfig?.config)
|
|
9705
|
+
continue;
|
|
9706
|
+
baseConfig = mergeConfig2(baseConfig, viteConfig.config);
|
|
9707
|
+
}
|
|
9708
|
+
baseConfig = mergeConfig2(baseConfig, overrideConfigs);
|
|
9709
|
+
baseConfig = mergeConfig2(baseConfig, {
|
|
9710
|
+
configFile: false,
|
|
9711
|
+
root: options.userRoot,
|
|
9712
|
+
plugins: [
|
|
9713
|
+
await ViteSlidevPlugin(options, baseConfig.slidev || {}, serverOptions)
|
|
9714
|
+
],
|
|
9715
|
+
define: {
|
|
9716
|
+
// Fixes Vue production mode breaking PDF Export #1245
|
|
9717
|
+
__VUE_PROD_DEVTOOLS__: false
|
|
9718
|
+
}
|
|
9719
|
+
});
|
|
9720
|
+
return baseConfig;
|
|
9721
|
+
}
|
|
9722
|
+
|
|
9670
9723
|
export {
|
|
9671
9724
|
version,
|
|
9672
9725
|
getIndexHtml,
|
|
9673
|
-
|
|
9726
|
+
resolveViteConfigs,
|
|
9674
9727
|
parser,
|
|
9675
9728
|
resolveTheme,
|
|
9676
9729
|
getThemeMeta,
|