@csark0812/skeleton 1.5.7 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -8
- package/dist/cli.js +1749 -701
- package/dist/hooks/customize-on-skill-read.js +961 -223
- package/dist/plugin-types.d.ts +19 -3
- package/package.json +3 -6
- package/schemas/config.schema.json +57 -9
- package/templates/skeleton-init/config.yaml +5 -4
- package/templates/skeleton-init/skeleton.toml +37 -0
- package/templates/skeleton-init/registry.md +0 -10
|
@@ -3028,7 +3028,6 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3028
3028
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
3029
3029
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
3030
3030
|
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
3031
|
-
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/?]$/iu);
|
|
3032
3031
|
function stringArrayToHexStripped(input) {
|
|
3033
3032
|
let acc = "";
|
|
3034
3033
|
let code = 0;
|
|
@@ -3172,7 +3171,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3172
3171
|
continue;
|
|
3173
3172
|
}
|
|
3174
3173
|
} else if (input[0] === "/") {
|
|
3175
|
-
if (input[1] === ".") {
|
|
3174
|
+
if (input[1] === "." || input[1] === "/") {
|
|
3176
3175
|
output.push("/");
|
|
3177
3176
|
break;
|
|
3178
3177
|
}
|
|
@@ -3254,30 +3253,10 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3254
3253
|
}
|
|
3255
3254
|
return output;
|
|
3256
3255
|
}
|
|
3257
|
-
var BYTE_HEX = new Array(256);
|
|
3258
|
-
{
|
|
3259
|
-
const HEX_DIGITS = "0123456789ABCDEF";
|
|
3260
|
-
for (let i = 0;i < 256; i++) {
|
|
3261
|
-
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
3262
|
-
}
|
|
3263
|
-
}
|
|
3264
|
-
function isEscapeSafe(cp) {
|
|
3265
|
-
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
3266
|
-
}
|
|
3267
|
-
function percentEncodeNonAscii(cp) {
|
|
3268
|
-
if (cp < 2048) {
|
|
3269
|
-
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
3270
|
-
}
|
|
3271
|
-
if (cp < 65536) {
|
|
3272
|
-
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
3273
|
-
}
|
|
3274
|
-
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
3275
|
-
}
|
|
3276
3256
|
function normalizePathEncoding(input) {
|
|
3277
3257
|
let output = "";
|
|
3278
3258
|
for (let i = 0;i < input.length; i++) {
|
|
3279
|
-
|
|
3280
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
3259
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
3281
3260
|
const hex = input.slice(i + 1, i + 3);
|
|
3282
3261
|
if (isHexPair(hex)) {
|
|
3283
3262
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -3291,66 +3270,10 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3291
3270
|
continue;
|
|
3292
3271
|
}
|
|
3293
3272
|
}
|
|
3294
|
-
if (isPathCharacter(
|
|
3295
|
-
output +=
|
|
3296
|
-
} else {
|
|
3297
|
-
const code = input.charCodeAt(i);
|
|
3298
|
-
if (code < 128) {
|
|
3299
|
-
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
3300
|
-
} else if (code < 55296 || code > 57343) {
|
|
3301
|
-
output += percentEncodeNonAscii(code);
|
|
3302
|
-
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3303
|
-
const low = input.charCodeAt(i + 1);
|
|
3304
|
-
if (low >= 56320 && low <= 57343) {
|
|
3305
|
-
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3306
|
-
i++;
|
|
3307
|
-
} else {
|
|
3308
|
-
output += percentEncodeNonAscii(65533);
|
|
3309
|
-
}
|
|
3310
|
-
} else {
|
|
3311
|
-
output += percentEncodeNonAscii(65533);
|
|
3312
|
-
}
|
|
3313
|
-
}
|
|
3314
|
-
}
|
|
3315
|
-
return output;
|
|
3316
|
-
}
|
|
3317
|
-
function normalizeQueryFragmentEncoding(input) {
|
|
3318
|
-
let output = "";
|
|
3319
|
-
for (let i = 0;i < input.length; i++) {
|
|
3320
|
-
const ch = input[i];
|
|
3321
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
3322
|
-
const hex = input.slice(i + 1, i + 3);
|
|
3323
|
-
if (isHexPair(hex)) {
|
|
3324
|
-
const normalizedHex = hex.toUpperCase();
|
|
3325
|
-
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
3326
|
-
if (isUnreserved(decoded)) {
|
|
3327
|
-
output += decoded;
|
|
3328
|
-
} else {
|
|
3329
|
-
output += "%" + normalizedHex;
|
|
3330
|
-
}
|
|
3331
|
-
i += 2;
|
|
3332
|
-
continue;
|
|
3333
|
-
}
|
|
3334
|
-
}
|
|
3335
|
-
if (isQueryFragmentCharacter(ch)) {
|
|
3336
|
-
output += ch;
|
|
3273
|
+
if (isPathCharacter(input[i])) {
|
|
3274
|
+
output += input[i];
|
|
3337
3275
|
} else {
|
|
3338
|
-
|
|
3339
|
-
if (code < 128) {
|
|
3340
|
-
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
3341
|
-
} else if (code < 55296 || code > 57343) {
|
|
3342
|
-
output += percentEncodeNonAscii(code);
|
|
3343
|
-
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3344
|
-
const low = input.charCodeAt(i + 1);
|
|
3345
|
-
if (low >= 56320 && low <= 57343) {
|
|
3346
|
-
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3347
|
-
i++;
|
|
3348
|
-
} else {
|
|
3349
|
-
output += percentEncodeNonAscii(65533);
|
|
3350
|
-
}
|
|
3351
|
-
} else {
|
|
3352
|
-
output += percentEncodeNonAscii(65533);
|
|
3353
|
-
}
|
|
3276
|
+
output += escape(input[i]);
|
|
3354
3277
|
}
|
|
3355
3278
|
}
|
|
3356
3279
|
return output;
|
|
@@ -3358,8 +3281,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3358
3281
|
function escapePreservingEscapes(input) {
|
|
3359
3282
|
let output = "";
|
|
3360
3283
|
for (let i = 0;i < input.length; i++) {
|
|
3361
|
-
|
|
3362
|
-
if (ch === "%" && i + 2 < input.length) {
|
|
3284
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
3363
3285
|
const hex = input.slice(i + 1, i + 3);
|
|
3364
3286
|
if (isHexPair(hex)) {
|
|
3365
3287
|
output += "%" + hex.toUpperCase();
|
|
@@ -3367,22 +3289,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3367
3289
|
continue;
|
|
3368
3290
|
}
|
|
3369
3291
|
}
|
|
3370
|
-
|
|
3371
|
-
if (code < 128) {
|
|
3372
|
-
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
3373
|
-
} else if (code < 55296 || code > 57343) {
|
|
3374
|
-
output += percentEncodeNonAscii(code);
|
|
3375
|
-
} else if (code <= 56319 && i + 1 < input.length) {
|
|
3376
|
-
const low = input.charCodeAt(i + 1);
|
|
3377
|
-
if (low >= 56320 && low <= 57343) {
|
|
3378
|
-
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
3379
|
-
i++;
|
|
3380
|
-
} else {
|
|
3381
|
-
output += percentEncodeNonAscii(65533);
|
|
3382
|
-
}
|
|
3383
|
-
} else {
|
|
3384
|
-
output += percentEncodeNonAscii(65533);
|
|
3385
|
-
}
|
|
3292
|
+
output += escape(input[i]);
|
|
3386
3293
|
}
|
|
3387
3294
|
return output;
|
|
3388
3295
|
}
|
|
@@ -3416,7 +3323,6 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
3416
3323
|
reescapeHostDelimiters,
|
|
3417
3324
|
normalizePercentEncoding,
|
|
3418
3325
|
normalizePathEncoding,
|
|
3419
|
-
normalizeQueryFragmentEncoding,
|
|
3420
3326
|
escapePreservingEscapes,
|
|
3421
3327
|
removeDotSegments,
|
|
3422
3328
|
isIPv4,
|
|
@@ -3602,7 +3508,7 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
3602
3508
|
|
|
3603
3509
|
// node_modules/fast-uri/index.js
|
|
3604
3510
|
var require_fast_uri = __commonJS((exports, module) => {
|
|
3605
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
3511
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
3606
3512
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
3607
3513
|
function normalize(uri, options) {
|
|
3608
3514
|
if (typeof uri === "string") {
|
|
@@ -3614,12 +3520,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
3614
3520
|
}
|
|
3615
3521
|
function resolve(baseURI, relativeURI, options) {
|
|
3616
3522
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
3617
|
-
const
|
|
3618
|
-
const { parsed: relativeParsed, malformedAuthorityOrPort: relativeMalformed } = parseWithStatus(relativeURI, schemelessOptions);
|
|
3619
|
-
if (baseMalformed || relativeMalformed) {
|
|
3620
|
-
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
3621
|
-
}
|
|
3622
|
-
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
3523
|
+
const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
3623
3524
|
schemelessOptions.skipEscape = true;
|
|
3624
3525
|
return serialize(resolved, schemelessOptions);
|
|
3625
3526
|
}
|
|
@@ -3745,8 +3646,6 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
3745
3646
|
return uriTokens.join("");
|
|
3746
3647
|
}
|
|
3747
3648
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
3748
|
-
var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
|
|
3749
|
-
var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
|
|
3750
3649
|
function getParseError(parsed, matches) {
|
|
3751
3650
|
if (matches[2] !== undefined && parsed.path && parsed.path[0] !== "/") {
|
|
3752
3651
|
return 'URI path must start with "/" when authority is present.';
|
|
@@ -3776,28 +3675,9 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
3776
3675
|
uri = "//" + uri;
|
|
3777
3676
|
}
|
|
3778
3677
|
}
|
|
3779
|
-
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
3780
|
-
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
3781
|
-
parsed.error = "URI authority must not contain a literal backslash.";
|
|
3782
|
-
malformedAuthorityOrPort = true;
|
|
3783
|
-
}
|
|
3784
|
-
const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
|
|
3785
|
-
if (introducerMatch !== null) {
|
|
3786
|
-
const region = introducerMatch[1];
|
|
3787
|
-
const normalizedRegion = region.replace(/[\t\n\r]/g, "");
|
|
3788
|
-
if (normalizedRegion.length >= 2) {
|
|
3789
|
-
if (normalizedRegion.slice(0, 2) !== "//") {
|
|
3790
|
-
parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
|
|
3791
|
-
malformedAuthorityOrPort = true;
|
|
3792
|
-
} else if (region.length !== normalizedRegion.length) {
|
|
3793
|
-
parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
|
|
3794
|
-
malformedAuthorityOrPort = true;
|
|
3795
|
-
}
|
|
3796
|
-
}
|
|
3797
|
-
}
|
|
3798
3678
|
const matches = uri.match(URI_PARSE);
|
|
3799
3679
|
if (matches) {
|
|
3800
|
-
parsed.scheme = matches[1]
|
|
3680
|
+
parsed.scheme = matches[1];
|
|
3801
3681
|
parsed.userinfo = matches[3];
|
|
3802
3682
|
parsed.host = matches[4];
|
|
3803
3683
|
parsed.port = parseInt(matches[5], 10);
|
|
@@ -3856,11 +3736,12 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
3856
3736
|
if (parsed.path) {
|
|
3857
3737
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
3858
3738
|
}
|
|
3859
|
-
if (parsed.query) {
|
|
3860
|
-
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
3861
|
-
}
|
|
3862
3739
|
if (parsed.fragment) {
|
|
3863
|
-
|
|
3740
|
+
try {
|
|
3741
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
3742
|
+
} catch {
|
|
3743
|
+
parsed.error = parsed.error || "URI malformed";
|
|
3744
|
+
}
|
|
3864
3745
|
}
|
|
3865
3746
|
}
|
|
3866
3747
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -7812,7 +7693,7 @@ var require_stringify = __commonJS((exports) => {
|
|
|
7812
7693
|
props.push(doc.directives.tagString(tag));
|
|
7813
7694
|
return props.join(" ");
|
|
7814
7695
|
}
|
|
7815
|
-
function
|
|
7696
|
+
function stringify2(item, ctx, onComment, onChompKeep) {
|
|
7816
7697
|
if (identity.isPair(item))
|
|
7817
7698
|
return item.toString(ctx, onComment, onChompKeep);
|
|
7818
7699
|
if (identity.isAlias(item)) {
|
|
@@ -7841,14 +7722,14 @@ var require_stringify = __commonJS((exports) => {
|
|
|
7841
7722
|
${ctx.indent}${str}`;
|
|
7842
7723
|
}
|
|
7843
7724
|
exports.createStringifyContext = createStringifyContext;
|
|
7844
|
-
exports.stringify =
|
|
7725
|
+
exports.stringify = stringify2;
|
|
7845
7726
|
});
|
|
7846
7727
|
|
|
7847
7728
|
// node_modules/yaml/dist/stringify/stringifyPair.js
|
|
7848
7729
|
var require_stringifyPair = __commonJS((exports) => {
|
|
7849
7730
|
var identity = require_identity();
|
|
7850
7731
|
var Scalar = require_Scalar();
|
|
7851
|
-
var
|
|
7732
|
+
var stringify2 = require_stringify();
|
|
7852
7733
|
var stringifyComment = require_stringifyComment();
|
|
7853
7734
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
7854
7735
|
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
@@ -7870,7 +7751,7 @@ var require_stringifyPair = __commonJS((exports) => {
|
|
|
7870
7751
|
});
|
|
7871
7752
|
let keyCommentDone = false;
|
|
7872
7753
|
let chompKeep = false;
|
|
7873
|
-
let str =
|
|
7754
|
+
let str = stringify2.stringify(key, ctx, () => keyCommentDone = true, () => chompKeep = true);
|
|
7874
7755
|
if (!explicitKey && !ctx.inFlow && str.length > 1024) {
|
|
7875
7756
|
if (simpleKeys)
|
|
7876
7757
|
throw new Error("With simple keys, single line scalar must not span more than 1024 characters");
|
|
@@ -7922,7 +7803,7 @@ ${indent}:`;
|
|
|
7922
7803
|
ctx.indent = ctx.indent.substring(2);
|
|
7923
7804
|
}
|
|
7924
7805
|
let valueCommentDone = false;
|
|
7925
|
-
const valueStr =
|
|
7806
|
+
const valueStr = stringify2.stringify(value, ctx, () => valueCommentDone = true, () => chompKeep = true);
|
|
7926
7807
|
let ws = " ";
|
|
7927
7808
|
if (keyComment || vsb || vcb) {
|
|
7928
7809
|
ws = vsb ? `
|
|
@@ -8060,7 +7941,7 @@ var require_merge = __commonJS((exports) => {
|
|
|
8060
7941
|
var require_addPairToJSMap = __commonJS((exports) => {
|
|
8061
7942
|
var log = require_log();
|
|
8062
7943
|
var merge = require_merge();
|
|
8063
|
-
var
|
|
7944
|
+
var stringify2 = require_stringify();
|
|
8064
7945
|
var identity = require_identity();
|
|
8065
7946
|
var toJS = require_toJS();
|
|
8066
7947
|
function addPairToJSMap(ctx, map, { key, value }) {
|
|
@@ -8096,7 +7977,7 @@ var require_addPairToJSMap = __commonJS((exports) => {
|
|
|
8096
7977
|
if (typeof jsKey !== "object")
|
|
8097
7978
|
return String(jsKey);
|
|
8098
7979
|
if (identity.isNode(key) && ctx?.doc) {
|
|
8099
|
-
const strCtx =
|
|
7980
|
+
const strCtx = stringify2.createStringifyContext(ctx.doc, {});
|
|
8100
7981
|
strCtx.anchors = new Set;
|
|
8101
7982
|
for (const node of ctx.anchors.keys())
|
|
8102
7983
|
strCtx.anchors.add(node.anchor);
|
|
@@ -8158,12 +8039,12 @@ var require_Pair = __commonJS((exports) => {
|
|
|
8158
8039
|
// node_modules/yaml/dist/stringify/stringifyCollection.js
|
|
8159
8040
|
var require_stringifyCollection = __commonJS((exports) => {
|
|
8160
8041
|
var identity = require_identity();
|
|
8161
|
-
var
|
|
8042
|
+
var stringify2 = require_stringify();
|
|
8162
8043
|
var stringifyComment = require_stringifyComment();
|
|
8163
8044
|
function stringifyCollection(collection, ctx, options) {
|
|
8164
8045
|
const flow = ctx.inFlow ?? collection.flow;
|
|
8165
|
-
const
|
|
8166
|
-
return
|
|
8046
|
+
const stringify3 = flow ? stringifyFlowCollection : stringifyBlockCollection;
|
|
8047
|
+
return stringify3(collection, ctx, options);
|
|
8167
8048
|
}
|
|
8168
8049
|
function stringifyBlockCollection({ comment, items }, ctx, { blockItemPrefix, flowChars, itemIndent, onChompKeep, onComment }) {
|
|
8169
8050
|
const { indent, options: { commentString } } = ctx;
|
|
@@ -8188,7 +8069,7 @@ var require_stringifyCollection = __commonJS((exports) => {
|
|
|
8188
8069
|
}
|
|
8189
8070
|
}
|
|
8190
8071
|
chompKeep = false;
|
|
8191
|
-
let str2 =
|
|
8072
|
+
let str2 = stringify2.stringify(item, itemCtx, () => comment2 = null, () => chompKeep = true);
|
|
8192
8073
|
if (comment2)
|
|
8193
8074
|
str2 += stringifyComment.lineComment(str2, itemIndent, commentString(comment2));
|
|
8194
8075
|
if (chompKeep && comment2)
|
|
@@ -8257,7 +8138,7 @@ ${indent}${line}` : `
|
|
|
8257
8138
|
}
|
|
8258
8139
|
if (comment)
|
|
8259
8140
|
reqNewline = true;
|
|
8260
|
-
let str =
|
|
8141
|
+
let str = stringify2.stringify(item, itemCtx, () => comment = null);
|
|
8261
8142
|
reqNewline || (reqNewline = lines.length > linesAtValue || str.includes(`
|
|
8262
8143
|
`));
|
|
8263
8144
|
if (i < items.length - 1) {
|
|
@@ -9498,7 +9379,7 @@ var require_Schema = __commonJS((exports) => {
|
|
|
9498
9379
|
// node_modules/yaml/dist/stringify/stringifyDocument.js
|
|
9499
9380
|
var require_stringifyDocument = __commonJS((exports) => {
|
|
9500
9381
|
var identity = require_identity();
|
|
9501
|
-
var
|
|
9382
|
+
var stringify2 = require_stringify();
|
|
9502
9383
|
var stringifyComment = require_stringifyComment();
|
|
9503
9384
|
function stringifyDocument(doc, options) {
|
|
9504
9385
|
const lines = [];
|
|
@@ -9513,7 +9394,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
9513
9394
|
}
|
|
9514
9395
|
if (hasDirectives)
|
|
9515
9396
|
lines.push("---");
|
|
9516
|
-
const ctx =
|
|
9397
|
+
const ctx = stringify2.createStringifyContext(doc, options);
|
|
9517
9398
|
const { commentString } = ctx.options;
|
|
9518
9399
|
if (doc.commentBefore) {
|
|
9519
9400
|
if (lines.length !== 1)
|
|
@@ -9535,7 +9416,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
9535
9416
|
contentComment = doc.contents.comment;
|
|
9536
9417
|
}
|
|
9537
9418
|
const onChompKeep = contentComment ? undefined : () => chompKeep = true;
|
|
9538
|
-
let body =
|
|
9419
|
+
let body = stringify2.stringify(doc.contents, ctx, () => contentComment = null, onChompKeep);
|
|
9539
9420
|
if (contentComment)
|
|
9540
9421
|
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
9541
9422
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
@@ -9543,7 +9424,7 @@ var require_stringifyDocument = __commonJS((exports) => {
|
|
|
9543
9424
|
} else
|
|
9544
9425
|
lines.push(body);
|
|
9545
9426
|
} else {
|
|
9546
|
-
lines.push(
|
|
9427
|
+
lines.push(stringify2.stringify(doc.contents, ctx));
|
|
9547
9428
|
}
|
|
9548
9429
|
if (doc.directives?.docEnd) {
|
|
9549
9430
|
if (doc.comment) {
|
|
@@ -11562,7 +11443,7 @@ var require_cst_scalar = __commonJS((exports) => {
|
|
|
11562
11443
|
|
|
11563
11444
|
// node_modules/yaml/dist/parse/cst-stringify.js
|
|
11564
11445
|
var require_cst_stringify = __commonJS((exports) => {
|
|
11565
|
-
var
|
|
11446
|
+
var stringify2 = (cst) => ("type" in cst) ? stringifyToken(cst) : stringifyItem(cst);
|
|
11566
11447
|
function stringifyToken(token) {
|
|
11567
11448
|
switch (token.type) {
|
|
11568
11449
|
case "block-scalar": {
|
|
@@ -11615,7 +11496,7 @@ var require_cst_stringify = __commonJS((exports) => {
|
|
|
11615
11496
|
res += stringifyToken(value);
|
|
11616
11497
|
return res;
|
|
11617
11498
|
}
|
|
11618
|
-
exports.stringify =
|
|
11499
|
+
exports.stringify = stringify2;
|
|
11619
11500
|
});
|
|
11620
11501
|
|
|
11621
11502
|
// node_modules/yaml/dist/parse/cst-visit.js
|
|
@@ -13306,7 +13187,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
13306
13187
|
}
|
|
13307
13188
|
return doc;
|
|
13308
13189
|
}
|
|
13309
|
-
function
|
|
13190
|
+
function parse2(src, reviver, options) {
|
|
13310
13191
|
let _reviver = undefined;
|
|
13311
13192
|
if (typeof reviver === "function") {
|
|
13312
13193
|
_reviver = reviver;
|
|
@@ -13325,7 +13206,7 @@ var require_public_api = __commonJS((exports) => {
|
|
|
13325
13206
|
}
|
|
13326
13207
|
return doc.toJS(Object.assign({ reviver: _reviver }, options));
|
|
13327
13208
|
}
|
|
13328
|
-
function
|
|
13209
|
+
function stringify2(value, replacer, options) {
|
|
13329
13210
|
let _replacer = null;
|
|
13330
13211
|
if (typeof replacer === "function" || Array.isArray(replacer)) {
|
|
13331
13212
|
_replacer = replacer;
|
|
@@ -13347,21 +13228,20 @@ var require_public_api = __commonJS((exports) => {
|
|
|
13347
13228
|
return value.toString(options);
|
|
13348
13229
|
return new Document.Document(value, _replacer, options).toString(options);
|
|
13349
13230
|
}
|
|
13350
|
-
exports.parse =
|
|
13231
|
+
exports.parse = parse2;
|
|
13351
13232
|
exports.parseAllDocuments = parseAllDocuments;
|
|
13352
13233
|
exports.parseDocument = parseDocument;
|
|
13353
|
-
exports.stringify =
|
|
13234
|
+
exports.stringify = stringify2;
|
|
13354
13235
|
});
|
|
13355
13236
|
|
|
13356
13237
|
// src/hooks/customize-on-skill-read.ts
|
|
13357
|
-
import { readFileSync as
|
|
13238
|
+
import { readFileSync as readFileSync3 } from "node:fs";
|
|
13358
13239
|
import process3 from "node:process";
|
|
13359
13240
|
|
|
13360
13241
|
// src/hooks/run.ts
|
|
13361
13242
|
import process2 from "node:process";
|
|
13362
13243
|
|
|
13363
13244
|
// src/audit/core/shared.ts
|
|
13364
|
-
var REGISTRY_REL_PATH = ".skeleton/registry.md";
|
|
13365
13245
|
var REGISTRY_DIR_REL = ".skeleton";
|
|
13366
13246
|
function normalizeRelPath(p) {
|
|
13367
13247
|
let out = p.replace(/\\/g, "/");
|
|
@@ -13428,8 +13308,8 @@ function slugFromPath(filePath, workspaceRoot) {
|
|
|
13428
13308
|
}
|
|
13429
13309
|
|
|
13430
13310
|
// src/customize/resolve.ts
|
|
13431
|
-
import { existsSync as
|
|
13432
|
-
import { basename, join as
|
|
13311
|
+
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
13312
|
+
import { basename, join as join3, relative as relative2 } from "node:path";
|
|
13433
13313
|
|
|
13434
13314
|
// src/audit/config/load.ts
|
|
13435
13315
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
@@ -13438,6 +13318,883 @@ import { dirname, join as join2 } from "node:path";
|
|
|
13438
13318
|
import process from "node:process";
|
|
13439
13319
|
import { fileURLToPath } from "node:url";
|
|
13440
13320
|
|
|
13321
|
+
// node_modules/smol-toml/dist/date.js
|
|
13322
|
+
/*!
|
|
13323
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13324
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13325
|
+
*
|
|
13326
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13327
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13328
|
+
*
|
|
13329
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13330
|
+
* list of conditions and the following disclaimer.
|
|
13331
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13332
|
+
* this list of conditions and the following disclaimer in the
|
|
13333
|
+
* documentation and/or other materials provided with the distribution.
|
|
13334
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13335
|
+
* may be used to endorse or promote products derived from this software without
|
|
13336
|
+
* specific prior written permission.
|
|
13337
|
+
*
|
|
13338
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13339
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13340
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13341
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13342
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13343
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13344
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13345
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13346
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13347
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13348
|
+
*/
|
|
13349
|
+
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
13350
|
+
|
|
13351
|
+
class TomlDate extends Date {
|
|
13352
|
+
#hasDate = false;
|
|
13353
|
+
#hasTime = false;
|
|
13354
|
+
#offset = null;
|
|
13355
|
+
constructor(date) {
|
|
13356
|
+
let hasDate = true;
|
|
13357
|
+
let hasTime = true;
|
|
13358
|
+
let offset = "Z";
|
|
13359
|
+
if (typeof date === "string") {
|
|
13360
|
+
let match = date.match(DATE_TIME_RE);
|
|
13361
|
+
if (match) {
|
|
13362
|
+
if (!match[1]) {
|
|
13363
|
+
hasDate = false;
|
|
13364
|
+
date = `0000-01-01T${date}`;
|
|
13365
|
+
}
|
|
13366
|
+
hasTime = !!match[2];
|
|
13367
|
+
hasTime && date[10] === " " && (date = date.replace(" ", "T"));
|
|
13368
|
+
if (match[2] && +match[2] > 23) {
|
|
13369
|
+
date = "";
|
|
13370
|
+
} else {
|
|
13371
|
+
offset = match[3] || null;
|
|
13372
|
+
date = date.toUpperCase();
|
|
13373
|
+
if (!offset && hasTime)
|
|
13374
|
+
date += "Z";
|
|
13375
|
+
}
|
|
13376
|
+
} else {
|
|
13377
|
+
date = "";
|
|
13378
|
+
}
|
|
13379
|
+
}
|
|
13380
|
+
super(date);
|
|
13381
|
+
if (!isNaN(this.getTime())) {
|
|
13382
|
+
this.#hasDate = hasDate;
|
|
13383
|
+
this.#hasTime = hasTime;
|
|
13384
|
+
this.#offset = offset;
|
|
13385
|
+
}
|
|
13386
|
+
}
|
|
13387
|
+
isDateTime() {
|
|
13388
|
+
return this.#hasDate && this.#hasTime;
|
|
13389
|
+
}
|
|
13390
|
+
isLocal() {
|
|
13391
|
+
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
13392
|
+
}
|
|
13393
|
+
isDate() {
|
|
13394
|
+
return this.#hasDate && !this.#hasTime;
|
|
13395
|
+
}
|
|
13396
|
+
isTime() {
|
|
13397
|
+
return this.#hasTime && !this.#hasDate;
|
|
13398
|
+
}
|
|
13399
|
+
isValid() {
|
|
13400
|
+
return this.#hasDate || this.#hasTime;
|
|
13401
|
+
}
|
|
13402
|
+
toISOString() {
|
|
13403
|
+
let iso = super.toISOString();
|
|
13404
|
+
if (this.isDate())
|
|
13405
|
+
return iso.slice(0, 10);
|
|
13406
|
+
if (this.isTime())
|
|
13407
|
+
return iso.slice(11, 23);
|
|
13408
|
+
if (this.#offset === null)
|
|
13409
|
+
return iso.slice(0, -1);
|
|
13410
|
+
if (this.#offset === "Z")
|
|
13411
|
+
return iso;
|
|
13412
|
+
let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
|
|
13413
|
+
offset = this.#offset[0] === "-" ? offset : -offset;
|
|
13414
|
+
let offsetDate = new Date(this.getTime() - offset * 60000);
|
|
13415
|
+
return offsetDate.toISOString().slice(0, -1) + this.#offset;
|
|
13416
|
+
}
|
|
13417
|
+
static wrapAsOffsetDateTime(jsDate, offset = "Z") {
|
|
13418
|
+
let date = new TomlDate(jsDate);
|
|
13419
|
+
date.#offset = offset;
|
|
13420
|
+
return date;
|
|
13421
|
+
}
|
|
13422
|
+
static wrapAsLocalDateTime(jsDate) {
|
|
13423
|
+
let date = new TomlDate(jsDate);
|
|
13424
|
+
date.#offset = null;
|
|
13425
|
+
return date;
|
|
13426
|
+
}
|
|
13427
|
+
static wrapAsLocalDate(jsDate) {
|
|
13428
|
+
let date = new TomlDate(jsDate);
|
|
13429
|
+
date.#hasTime = false;
|
|
13430
|
+
date.#offset = null;
|
|
13431
|
+
return date;
|
|
13432
|
+
}
|
|
13433
|
+
static wrapAsLocalTime(jsDate) {
|
|
13434
|
+
let date = new TomlDate(jsDate);
|
|
13435
|
+
date.#hasDate = false;
|
|
13436
|
+
date.#offset = null;
|
|
13437
|
+
return date;
|
|
13438
|
+
}
|
|
13439
|
+
}
|
|
13440
|
+
|
|
13441
|
+
// node_modules/smol-toml/dist/error.js
|
|
13442
|
+
/*!
|
|
13443
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13444
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13445
|
+
*
|
|
13446
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13447
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13448
|
+
*
|
|
13449
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13450
|
+
* list of conditions and the following disclaimer.
|
|
13451
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13452
|
+
* this list of conditions and the following disclaimer in the
|
|
13453
|
+
* documentation and/or other materials provided with the distribution.
|
|
13454
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13455
|
+
* may be used to endorse or promote products derived from this software without
|
|
13456
|
+
* specific prior written permission.
|
|
13457
|
+
*
|
|
13458
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13459
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13460
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13461
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13462
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13463
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13464
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13465
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13466
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13467
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13468
|
+
*/
|
|
13469
|
+
function getLineColFromPtr(string, ptr) {
|
|
13470
|
+
let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
13471
|
+
return [lines.length, lines.pop().length + 1];
|
|
13472
|
+
}
|
|
13473
|
+
function makeCodeBlock(string, line, column) {
|
|
13474
|
+
let lines = string.split(/\r\n|\n|\r/g);
|
|
13475
|
+
let codeblock = "";
|
|
13476
|
+
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
13477
|
+
for (let i = line - 1;i <= line + 1; i++) {
|
|
13478
|
+
let l = lines[i - 1];
|
|
13479
|
+
if (!l)
|
|
13480
|
+
continue;
|
|
13481
|
+
codeblock += i.toString().padEnd(numberLen, " ");
|
|
13482
|
+
codeblock += ": ";
|
|
13483
|
+
codeblock += l;
|
|
13484
|
+
codeblock += `
|
|
13485
|
+
`;
|
|
13486
|
+
if (i === line) {
|
|
13487
|
+
codeblock += " ".repeat(numberLen + column + 2);
|
|
13488
|
+
codeblock += `^
|
|
13489
|
+
`;
|
|
13490
|
+
}
|
|
13491
|
+
}
|
|
13492
|
+
return codeblock;
|
|
13493
|
+
}
|
|
13494
|
+
|
|
13495
|
+
class TomlError extends Error {
|
|
13496
|
+
line;
|
|
13497
|
+
column;
|
|
13498
|
+
codeblock;
|
|
13499
|
+
constructor(message, options) {
|
|
13500
|
+
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
13501
|
+
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
13502
|
+
super(`Invalid TOML document: ${message}
|
|
13503
|
+
|
|
13504
|
+
${codeblock}`, options);
|
|
13505
|
+
this.line = line;
|
|
13506
|
+
this.column = column;
|
|
13507
|
+
this.codeblock = codeblock;
|
|
13508
|
+
}
|
|
13509
|
+
}
|
|
13510
|
+
|
|
13511
|
+
// node_modules/smol-toml/dist/util.js
|
|
13512
|
+
/*!
|
|
13513
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13514
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13515
|
+
*
|
|
13516
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13517
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13518
|
+
*
|
|
13519
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13520
|
+
* list of conditions and the following disclaimer.
|
|
13521
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13522
|
+
* this list of conditions and the following disclaimer in the
|
|
13523
|
+
* documentation and/or other materials provided with the distribution.
|
|
13524
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13525
|
+
* may be used to endorse or promote products derived from this software without
|
|
13526
|
+
* specific prior written permission.
|
|
13527
|
+
*
|
|
13528
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13529
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13530
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13531
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13532
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13533
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13534
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13535
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13536
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13537
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13538
|
+
*/
|
|
13539
|
+
function indexOfNewline(str, start = 0) {
|
|
13540
|
+
let idx = str.indexOf(`
|
|
13541
|
+
`, start);
|
|
13542
|
+
if (str.charCodeAt(idx - 1) === 13)
|
|
13543
|
+
idx--;
|
|
13544
|
+
return idx;
|
|
13545
|
+
}
|
|
13546
|
+
function skipComment(ctx) {
|
|
13547
|
+
for (;ctx.p < ctx.s.length; ctx.p++) {
|
|
13548
|
+
let c = ctx.s.charCodeAt(ctx.p);
|
|
13549
|
+
if (c === 10)
|
|
13550
|
+
break;
|
|
13551
|
+
if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10) {
|
|
13552
|
+
ctx.p++;
|
|
13553
|
+
break;
|
|
13554
|
+
}
|
|
13555
|
+
if (c < 32 && c !== 9 || c === 127) {
|
|
13556
|
+
throw new TomlError("control characters are not allowed in comments", {
|
|
13557
|
+
toml: ctx.s,
|
|
13558
|
+
ptr: ctx.p
|
|
13559
|
+
});
|
|
13560
|
+
}
|
|
13561
|
+
}
|
|
13562
|
+
}
|
|
13563
|
+
function skipVoid(ctx, banNewLines, banComments) {
|
|
13564
|
+
let c;
|
|
13565
|
+
while (true) {
|
|
13566
|
+
while ((c = ctx.s.charCodeAt(ctx.p)) === 32 || c === 9 || !banNewLines && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10))
|
|
13567
|
+
ctx.p++;
|
|
13568
|
+
if (banComments || c !== 35)
|
|
13569
|
+
break;
|
|
13570
|
+
skipComment(ctx);
|
|
13571
|
+
}
|
|
13572
|
+
}
|
|
13573
|
+
function skipUntil(ctx, sep, end) {
|
|
13574
|
+
let ptr = ctx.p;
|
|
13575
|
+
if (!end) {
|
|
13576
|
+
ptr = indexOfNewline(ctx.s, ptr);
|
|
13577
|
+
ctx.p = ptr < 0 ? ctx.s.length : ptr;
|
|
13578
|
+
return;
|
|
13579
|
+
}
|
|
13580
|
+
for (;ctx.p < ctx.s.length; ctx.p++) {
|
|
13581
|
+
let c = ctx.s.charCodeAt(ctx.p);
|
|
13582
|
+
if (c === 35) {
|
|
13583
|
+
skipComment(ctx);
|
|
13584
|
+
} else if (c === end || c === sep) {
|
|
13585
|
+
return;
|
|
13586
|
+
}
|
|
13587
|
+
}
|
|
13588
|
+
throw new TomlError("cannot find end of structure", {
|
|
13589
|
+
toml: ctx.s,
|
|
13590
|
+
ptr
|
|
13591
|
+
});
|
|
13592
|
+
}
|
|
13593
|
+
|
|
13594
|
+
// node_modules/smol-toml/dist/primitive.js
|
|
13595
|
+
/*!
|
|
13596
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13597
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13598
|
+
*
|
|
13599
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13600
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13601
|
+
*
|
|
13602
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13603
|
+
* list of conditions and the following disclaimer.
|
|
13604
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13605
|
+
* this list of conditions and the following disclaimer in the
|
|
13606
|
+
* documentation and/or other materials provided with the distribution.
|
|
13607
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13608
|
+
* may be used to endorse or promote products derived from this software without
|
|
13609
|
+
* specific prior written permission.
|
|
13610
|
+
*
|
|
13611
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13612
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13613
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13614
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13615
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13616
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13617
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13618
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13619
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13620
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13621
|
+
*/
|
|
13622
|
+
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
13623
|
+
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
13624
|
+
var LEADING_ZERO = /^[+-]?0[0-9_]/;
|
|
13625
|
+
function parseString(ctx) {
|
|
13626
|
+
let start = ctx.p;
|
|
13627
|
+
let c = ctx.s.charCodeAt(ctx.p++);
|
|
13628
|
+
let first = c;
|
|
13629
|
+
let isLiteral = c === 39;
|
|
13630
|
+
let isMultiline = c === ctx.s.charCodeAt(ctx.p) && c === ctx.s.charCodeAt(ctx.p + 1);
|
|
13631
|
+
if (isMultiline) {
|
|
13632
|
+
if ((c = ctx.s.charCodeAt(ctx.p += 2)) === 10)
|
|
13633
|
+
ctx.p++;
|
|
13634
|
+
else if (c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)
|
|
13635
|
+
ctx.p += 2;
|
|
13636
|
+
}
|
|
13637
|
+
let parsed = "";
|
|
13638
|
+
let sliceStart = ctx.p;
|
|
13639
|
+
let state = 0;
|
|
13640
|
+
for (;ctx.p < ctx.s.length; ctx.p++) {
|
|
13641
|
+
c = ctx.s.charCodeAt(ctx.p);
|
|
13642
|
+
if (isMultiline && (c === 10 || c === 13 && ctx.s.charCodeAt(ctx.p + 1) === 10)) {
|
|
13643
|
+
state = state && 3;
|
|
13644
|
+
} else if (c < 32 && c !== 9 || c === 127) {
|
|
13645
|
+
throw new TomlError("control characters are not allowed in strings", {
|
|
13646
|
+
toml: ctx.s,
|
|
13647
|
+
ptr: ctx.p
|
|
13648
|
+
});
|
|
13649
|
+
} else if ((!state || state === 3) && c === first && (!isMultiline || ctx.s.charCodeAt(ctx.p + 1) === first && ctx.s.charCodeAt(ctx.p + 2) === first)) {
|
|
13650
|
+
if (isMultiline) {
|
|
13651
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first)
|
|
13652
|
+
ctx.p++;
|
|
13653
|
+
if (ctx.s.charCodeAt(ctx.p + 3) === first)
|
|
13654
|
+
ctx.p++;
|
|
13655
|
+
}
|
|
13656
|
+
if (!state)
|
|
13657
|
+
parsed += ctx.s.slice(sliceStart, ctx.p);
|
|
13658
|
+
ctx.p += isMultiline ? 3 : 1;
|
|
13659
|
+
return parsed;
|
|
13660
|
+
} else if (!state) {
|
|
13661
|
+
if (!isLiteral && c === 92) {
|
|
13662
|
+
parsed += ctx.s.slice(sliceStart, sliceStart = ctx.p);
|
|
13663
|
+
state = 1;
|
|
13664
|
+
}
|
|
13665
|
+
} else if (state === 1) {
|
|
13666
|
+
if (c === 120 || c === 117 || c === 85) {
|
|
13667
|
+
let value = 0;
|
|
13668
|
+
let len = c === 120 ? 2 : c === 117 ? 4 : 8;
|
|
13669
|
+
for (let j = 0;j < len; j++, ctx.p++) {
|
|
13670
|
+
let hex = ctx.s.charCodeAt(ctx.p + 1);
|
|
13671
|
+
let digit = hex >= 48 && hex <= 57 ? hex - 48 : hex >= 65 && hex <= 70 ? hex - 65 + 10 : hex >= 97 && hex <= 102 ? hex - 97 + 10 : -1;
|
|
13672
|
+
if (digit < 0)
|
|
13673
|
+
throw new TomlError("invalid non-hex character in unicode escape", { toml: ctx.s, ptr: ctx.p + 1 });
|
|
13674
|
+
value = value << 4 | digit;
|
|
13675
|
+
}
|
|
13676
|
+
if (value < 0 || value > 1114111 || value >= 55296 && value <= 57343) {
|
|
13677
|
+
throw new TomlError("invalid unicode escape", { toml: ctx.s, ptr: ctx.p });
|
|
13678
|
+
}
|
|
13679
|
+
parsed += String.fromCodePoint(value);
|
|
13680
|
+
sliceStart = ctx.p + 1;
|
|
13681
|
+
state = 0;
|
|
13682
|
+
} else if (c === 32 || c === 9) {
|
|
13683
|
+
state = 2;
|
|
13684
|
+
} else {
|
|
13685
|
+
if (c === 98)
|
|
13686
|
+
parsed += "\b";
|
|
13687
|
+
else if (c === 116)
|
|
13688
|
+
parsed += "\t";
|
|
13689
|
+
else if (c === 110)
|
|
13690
|
+
parsed += `
|
|
13691
|
+
`;
|
|
13692
|
+
else if (c === 102)
|
|
13693
|
+
parsed += "\f";
|
|
13694
|
+
else if (c === 114)
|
|
13695
|
+
parsed += "\r";
|
|
13696
|
+
else if (c === 101)
|
|
13697
|
+
parsed += "\x1B";
|
|
13698
|
+
else if (c === 34)
|
|
13699
|
+
parsed += '"';
|
|
13700
|
+
else if (c === 92)
|
|
13701
|
+
parsed += "\\";
|
|
13702
|
+
else
|
|
13703
|
+
throw new TomlError("unrecognized escape sequence", { toml: ctx.s, ptr: ctx.p });
|
|
13704
|
+
sliceStart = ctx.p + 1;
|
|
13705
|
+
state = 0;
|
|
13706
|
+
}
|
|
13707
|
+
} else if (c !== 32 && c !== 9) {
|
|
13708
|
+
if (state === 2) {
|
|
13709
|
+
throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
|
|
13710
|
+
toml: ctx.s,
|
|
13711
|
+
ptr: sliceStart
|
|
13712
|
+
});
|
|
13713
|
+
}
|
|
13714
|
+
state = !isLiteral && c === 92 ? 1 : 0;
|
|
13715
|
+
sliceStart = ctx.p;
|
|
13716
|
+
}
|
|
13717
|
+
}
|
|
13718
|
+
throw new TomlError("unfinished string", { toml: ctx.s, ptr: start });
|
|
13719
|
+
}
|
|
13720
|
+
function sliceAndTrimEndOf(ctx, start, end) {
|
|
13721
|
+
let value = ctx.s.slice(start, end);
|
|
13722
|
+
let commentIdx = value.indexOf("#");
|
|
13723
|
+
if (commentIdx > 0) {
|
|
13724
|
+
skipComment({ s: value, p: commentIdx, d: 0 });
|
|
13725
|
+
value = value.slice(0, commentIdx);
|
|
13726
|
+
}
|
|
13727
|
+
return value.trimEnd();
|
|
13728
|
+
}
|
|
13729
|
+
function parseValue(ctx, integersAsBigInt, end) {
|
|
13730
|
+
let ptr = ctx.p;
|
|
13731
|
+
let err = { toml: ctx.s, ptr };
|
|
13732
|
+
skipUntil(ctx, 44, end);
|
|
13733
|
+
let value = sliceAndTrimEndOf(ctx, ptr, ctx.p);
|
|
13734
|
+
if (!value)
|
|
13735
|
+
throw new TomlError("incomplete declaration: value expected", err);
|
|
13736
|
+
if (value === "-inf")
|
|
13737
|
+
return -Infinity;
|
|
13738
|
+
if (value === "inf" || value === "+inf")
|
|
13739
|
+
return Infinity;
|
|
13740
|
+
if (value === "nan" || value === "+nan" || value === "-nan")
|
|
13741
|
+
return NaN;
|
|
13742
|
+
if (value === "-0")
|
|
13743
|
+
return integersAsBigInt ? 0n : 0;
|
|
13744
|
+
let isInt = INT_REGEX.test(value);
|
|
13745
|
+
if (isInt || FLOAT_REGEX.test(value)) {
|
|
13746
|
+
if (LEADING_ZERO.test(value)) {
|
|
13747
|
+
throw new TomlError("leading zeroes are not allowed", err);
|
|
13748
|
+
}
|
|
13749
|
+
value = value.replace(/_/g, "");
|
|
13750
|
+
let numeric = +value;
|
|
13751
|
+
if (isNaN(numeric)) {
|
|
13752
|
+
throw new TomlError("invalid number", err);
|
|
13753
|
+
}
|
|
13754
|
+
if (isInt) {
|
|
13755
|
+
if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
|
|
13756
|
+
throw new TomlError("integer value cannot be represented losslessly", err);
|
|
13757
|
+
}
|
|
13758
|
+
if (isInt || integersAsBigInt === true)
|
|
13759
|
+
numeric = BigInt(value);
|
|
13760
|
+
}
|
|
13761
|
+
return numeric;
|
|
13762
|
+
}
|
|
13763
|
+
const date = new TomlDate(value);
|
|
13764
|
+
if (!date.isValid())
|
|
13765
|
+
throw new TomlError("invalid value", err);
|
|
13766
|
+
return date;
|
|
13767
|
+
}
|
|
13768
|
+
|
|
13769
|
+
// node_modules/smol-toml/dist/extract.js
|
|
13770
|
+
/*!
|
|
13771
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13772
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13773
|
+
*
|
|
13774
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13775
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13776
|
+
*
|
|
13777
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13778
|
+
* list of conditions and the following disclaimer.
|
|
13779
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13780
|
+
* this list of conditions and the following disclaimer in the
|
|
13781
|
+
* documentation and/or other materials provided with the distribution.
|
|
13782
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13783
|
+
* may be used to endorse or promote products derived from this software without
|
|
13784
|
+
* specific prior written permission.
|
|
13785
|
+
*
|
|
13786
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13787
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13788
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13789
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13790
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13791
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13792
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13793
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13794
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13795
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13796
|
+
*/
|
|
13797
|
+
function extractValue(ctx, end, integersAsBigInt) {
|
|
13798
|
+
let ptr = ctx.p;
|
|
13799
|
+
let c = ctx.s.charCodeAt(ptr);
|
|
13800
|
+
if (c === 91 || c === 123) {
|
|
13801
|
+
if (!ctx.d--) {
|
|
13802
|
+
throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
13803
|
+
toml: ctx.s,
|
|
13804
|
+
ptr
|
|
13805
|
+
});
|
|
13806
|
+
}
|
|
13807
|
+
let value = c === 91 ? parseArray(ctx, integersAsBigInt) : parseInlineTable(ctx, integersAsBigInt);
|
|
13808
|
+
ctx.d++;
|
|
13809
|
+
return value;
|
|
13810
|
+
}
|
|
13811
|
+
if (c === 34 || c === 39) {
|
|
13812
|
+
return parseString(ctx);
|
|
13813
|
+
}
|
|
13814
|
+
if (c === 116) {
|
|
13815
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 114 || ctx.s.charCodeAt(++ctx.p) !== 117 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
13816
|
+
throw new TomlError("invalid value", { toml: ctx.s, ptr });
|
|
13817
|
+
ctx.p++;
|
|
13818
|
+
return true;
|
|
13819
|
+
}
|
|
13820
|
+
if (c === 102) {
|
|
13821
|
+
if (ctx.s.charCodeAt(++ctx.p) !== 97 || ctx.s.charCodeAt(++ctx.p) !== 108 || ctx.s.charCodeAt(++ctx.p) !== 115 || ctx.s.charCodeAt(++ctx.p) !== 101)
|
|
13822
|
+
throw new TomlError("invalid value", { toml: ctx.s, ptr });
|
|
13823
|
+
ctx.p++;
|
|
13824
|
+
return false;
|
|
13825
|
+
}
|
|
13826
|
+
return parseValue(ctx, integersAsBigInt, end);
|
|
13827
|
+
}
|
|
13828
|
+
|
|
13829
|
+
// node_modules/smol-toml/dist/struct.js
|
|
13830
|
+
/*!
|
|
13831
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
13832
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
13833
|
+
*
|
|
13834
|
+
* Redistribution and use in source and binary forms, with or without
|
|
13835
|
+
* modification, are permitted provided that the following conditions are met:
|
|
13836
|
+
*
|
|
13837
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
13838
|
+
* list of conditions and the following disclaimer.
|
|
13839
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13840
|
+
* this list of conditions and the following disclaimer in the
|
|
13841
|
+
* documentation and/or other materials provided with the distribution.
|
|
13842
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
13843
|
+
* may be used to endorse or promote products derived from this software without
|
|
13844
|
+
* specific prior written permission.
|
|
13845
|
+
*
|
|
13846
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
13847
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
13848
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
13849
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
13850
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
13851
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
13852
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
13853
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
13854
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
13855
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
13856
|
+
*/
|
|
13857
|
+
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
13858
|
+
function parseKey(ctx, end = "=") {
|
|
13859
|
+
let start = ctx.p;
|
|
13860
|
+
let dot = start - 1;
|
|
13861
|
+
let parsed = [];
|
|
13862
|
+
let endPtr = ctx.s.indexOf(end, start);
|
|
13863
|
+
if (endPtr < 0) {
|
|
13864
|
+
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
13865
|
+
toml: ctx.s,
|
|
13866
|
+
ptr: start
|
|
13867
|
+
});
|
|
13868
|
+
}
|
|
13869
|
+
do {
|
|
13870
|
+
let c = ctx.s.charCodeAt(ctx.p = ++dot);
|
|
13871
|
+
if (c !== 32 && c !== 9) {
|
|
13872
|
+
if (c === 34 || c === 39) {
|
|
13873
|
+
if (c === ctx.s.charCodeAt(ctx.p + 1) && c === ctx.s.charCodeAt(ctx.p + 2)) {
|
|
13874
|
+
throw new TomlError("multiline strings are not allowed in keys", {
|
|
13875
|
+
toml: ctx.s,
|
|
13876
|
+
ptr: ctx.p
|
|
13877
|
+
});
|
|
13878
|
+
}
|
|
13879
|
+
let part = parseString(ctx);
|
|
13880
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
13881
|
+
let strEnd = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
13882
|
+
let newLine = indexOfNewline(strEnd);
|
|
13883
|
+
if (newLine > -1) {
|
|
13884
|
+
throw new TomlError("newlines are not allowed in keys", {
|
|
13885
|
+
toml: ctx.s,
|
|
13886
|
+
ptr: newLine
|
|
13887
|
+
});
|
|
13888
|
+
}
|
|
13889
|
+
if (strEnd.trimStart()) {
|
|
13890
|
+
throw new TomlError("found extra tokens after the string part", {
|
|
13891
|
+
toml: ctx.s,
|
|
13892
|
+
ptr: ctx.p
|
|
13893
|
+
});
|
|
13894
|
+
}
|
|
13895
|
+
if (endPtr < ctx.p) {
|
|
13896
|
+
endPtr = ctx.s.indexOf(end, ctx.p);
|
|
13897
|
+
if (endPtr < 0) {
|
|
13898
|
+
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
13899
|
+
toml: ctx.s,
|
|
13900
|
+
ptr: start
|
|
13901
|
+
});
|
|
13902
|
+
}
|
|
13903
|
+
}
|
|
13904
|
+
parsed.push(part);
|
|
13905
|
+
} else {
|
|
13906
|
+
dot = ctx.s.indexOf(".", ctx.p);
|
|
13907
|
+
let part = ctx.s.slice(ctx.p, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
13908
|
+
if (!KEY_PART_RE.test(part)) {
|
|
13909
|
+
throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
13910
|
+
toml: ctx.s,
|
|
13911
|
+
ptr: ctx.p
|
|
13912
|
+
});
|
|
13913
|
+
}
|
|
13914
|
+
parsed.push(part.trimEnd());
|
|
13915
|
+
}
|
|
13916
|
+
}
|
|
13917
|
+
} while (dot + 1 && dot < endPtr);
|
|
13918
|
+
ctx.p = endPtr + 1;
|
|
13919
|
+
skipVoid(ctx, true, true);
|
|
13920
|
+
return parsed;
|
|
13921
|
+
}
|
|
13922
|
+
function parseInlineTable(ctx, integersAsBigInt) {
|
|
13923
|
+
let res = {};
|
|
13924
|
+
let seen = new Set;
|
|
13925
|
+
let c;
|
|
13926
|
+
ctx.p++;
|
|
13927
|
+
while (ctx.p < ctx.s.length) {
|
|
13928
|
+
skipVoid(ctx);
|
|
13929
|
+
if ((c = ctx.s.charCodeAt(ctx.p)) === 125) {
|
|
13930
|
+
ctx.p++;
|
|
13931
|
+
return res;
|
|
13932
|
+
}
|
|
13933
|
+
let k;
|
|
13934
|
+
let t = res;
|
|
13935
|
+
let hasOwn = false;
|
|
13936
|
+
let p = ctx.p;
|
|
13937
|
+
let key = parseKey(ctx);
|
|
13938
|
+
for (let i = 0;i < key.length; i++) {
|
|
13939
|
+
if (i)
|
|
13940
|
+
t = hasOwn ? t[k] : t[k] = {};
|
|
13941
|
+
k = key[i];
|
|
13942
|
+
if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) {
|
|
13943
|
+
throw new TomlError("trying to redefine an already defined value", {
|
|
13944
|
+
toml: ctx.s,
|
|
13945
|
+
ptr: p
|
|
13946
|
+
});
|
|
13947
|
+
}
|
|
13948
|
+
if (!hasOwn && k === "__proto__") {
|
|
13949
|
+
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
|
|
13950
|
+
}
|
|
13951
|
+
}
|
|
13952
|
+
if (hasOwn) {
|
|
13953
|
+
throw new TomlError("trying to redefine an already defined value", {
|
|
13954
|
+
toml: ctx.s,
|
|
13955
|
+
ptr: ctx.p
|
|
13956
|
+
});
|
|
13957
|
+
}
|
|
13958
|
+
let value = extractValue(ctx, 125, integersAsBigInt);
|
|
13959
|
+
seen.add(t[k] = value);
|
|
13960
|
+
skipVoid(ctx);
|
|
13961
|
+
if ((c = ctx.s.charCodeAt(ctx.p++)) === 125) {
|
|
13962
|
+
return res;
|
|
13963
|
+
}
|
|
13964
|
+
if (c !== 44) {
|
|
13965
|
+
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
|
|
13966
|
+
}
|
|
13967
|
+
}
|
|
13968
|
+
throw new TomlError("unfinished table encountered", {
|
|
13969
|
+
toml: ctx.s,
|
|
13970
|
+
ptr: ctx.p
|
|
13971
|
+
});
|
|
13972
|
+
}
|
|
13973
|
+
function parseArray(ctx, integersAsBigInt) {
|
|
13974
|
+
let res = [];
|
|
13975
|
+
let c;
|
|
13976
|
+
ctx.p++;
|
|
13977
|
+
while (ctx.p < ctx.s.length) {
|
|
13978
|
+
skipVoid(ctx);
|
|
13979
|
+
if ((c = ctx.s.charCodeAt(ctx.p)) === 93) {
|
|
13980
|
+
ctx.p++;
|
|
13981
|
+
return res;
|
|
13982
|
+
}
|
|
13983
|
+
res.push(extractValue(ctx, 93, integersAsBigInt));
|
|
13984
|
+
skipVoid(ctx);
|
|
13985
|
+
if ((c = ctx.s.charCodeAt(ctx.p++)) === 93) {
|
|
13986
|
+
return res;
|
|
13987
|
+
}
|
|
13988
|
+
if (c !== 44) {
|
|
13989
|
+
throw new TomlError("expected comma or end of structure", { toml: ctx.s, ptr: ctx.p - 1 });
|
|
13990
|
+
}
|
|
13991
|
+
}
|
|
13992
|
+
throw new TomlError("unfinished array encountered", {
|
|
13993
|
+
toml: ctx.s,
|
|
13994
|
+
ptr: ctx.p
|
|
13995
|
+
});
|
|
13996
|
+
}
|
|
13997
|
+
|
|
13998
|
+
// node_modules/smol-toml/dist/parse.js
|
|
13999
|
+
/*!
|
|
14000
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
14001
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
14002
|
+
*
|
|
14003
|
+
* Redistribution and use in source and binary forms, with or without
|
|
14004
|
+
* modification, are permitted provided that the following conditions are met:
|
|
14005
|
+
*
|
|
14006
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
14007
|
+
* list of conditions and the following disclaimer.
|
|
14008
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14009
|
+
* this list of conditions and the following disclaimer in the
|
|
14010
|
+
* documentation and/or other materials provided with the distribution.
|
|
14011
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14012
|
+
* may be used to endorse or promote products derived from this software without
|
|
14013
|
+
* specific prior written permission.
|
|
14014
|
+
*
|
|
14015
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14016
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
14017
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
14018
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
14019
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
14020
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
14021
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
14022
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
14023
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
14024
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
14025
|
+
*/
|
|
14026
|
+
function peekTable(key, table, meta, type) {
|
|
14027
|
+
let t = table;
|
|
14028
|
+
let m = meta;
|
|
14029
|
+
let k;
|
|
14030
|
+
let hasOwn = false;
|
|
14031
|
+
let state;
|
|
14032
|
+
for (let i = 0;i < key.length; i++) {
|
|
14033
|
+
if (i) {
|
|
14034
|
+
t = hasOwn ? t[k] : t[k] = {};
|
|
14035
|
+
m = (state = m[k]).c;
|
|
14036
|
+
if (type === 0 && (state.t === 1 || state.t === 2)) {
|
|
14037
|
+
return null;
|
|
14038
|
+
}
|
|
14039
|
+
if (state.t === 2) {
|
|
14040
|
+
let l = t.length - 1;
|
|
14041
|
+
t = t[l];
|
|
14042
|
+
m = m[l].c;
|
|
14043
|
+
}
|
|
14044
|
+
}
|
|
14045
|
+
k = key[i];
|
|
14046
|
+
if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) {
|
|
14047
|
+
return null;
|
|
14048
|
+
}
|
|
14049
|
+
if (!hasOwn) {
|
|
14050
|
+
if (k === "__proto__") {
|
|
14051
|
+
Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true });
|
|
14052
|
+
Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true });
|
|
14053
|
+
}
|
|
14054
|
+
m[k] = {
|
|
14055
|
+
t: i < key.length - 1 && type === 2 ? 3 : type,
|
|
14056
|
+
d: false,
|
|
14057
|
+
i: 0,
|
|
14058
|
+
c: {}
|
|
14059
|
+
};
|
|
14060
|
+
}
|
|
14061
|
+
}
|
|
14062
|
+
state = m[k];
|
|
14063
|
+
if (state.t !== type && !(type === 1 && state.t === 3)) {
|
|
14064
|
+
return null;
|
|
14065
|
+
}
|
|
14066
|
+
if (type === 2) {
|
|
14067
|
+
if (!state.d) {
|
|
14068
|
+
state.d = true;
|
|
14069
|
+
t[k] = [];
|
|
14070
|
+
}
|
|
14071
|
+
t[k].push(t = {});
|
|
14072
|
+
state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };
|
|
14073
|
+
}
|
|
14074
|
+
if (state.d) {
|
|
14075
|
+
return null;
|
|
14076
|
+
}
|
|
14077
|
+
state.d = true;
|
|
14078
|
+
if (type === 1) {
|
|
14079
|
+
t = hasOwn ? t[k] : t[k] = {};
|
|
14080
|
+
} else if (type === 0 && hasOwn) {
|
|
14081
|
+
return null;
|
|
14082
|
+
}
|
|
14083
|
+
return [k, t, state.c];
|
|
14084
|
+
}
|
|
14085
|
+
function parse(toml, { maxDepth = 1000, integersAsBigInt } = {}) {
|
|
14086
|
+
let ctx = { s: toml, p: 0, d: maxDepth };
|
|
14087
|
+
let res = {};
|
|
14088
|
+
let meta = {};
|
|
14089
|
+
let tmp;
|
|
14090
|
+
let tbl = res;
|
|
14091
|
+
let m = meta;
|
|
14092
|
+
skipVoid(ctx);
|
|
14093
|
+
while (ctx.p < toml.length) {
|
|
14094
|
+
if (toml.charCodeAt(ctx.p) === 91) {
|
|
14095
|
+
let isTableArray = toml.charCodeAt(++ctx.p) === 91;
|
|
14096
|
+
tmp = ctx.p += +isTableArray;
|
|
14097
|
+
let k = parseKey(ctx, "]");
|
|
14098
|
+
if (isTableArray) {
|
|
14099
|
+
if (toml.charCodeAt(ctx.p - 1) !== 93) {
|
|
14100
|
+
throw new TomlError("expected end of table declaration", {
|
|
14101
|
+
toml,
|
|
14102
|
+
ptr: ctx.p - 1
|
|
14103
|
+
});
|
|
14104
|
+
}
|
|
14105
|
+
ctx.p++;
|
|
14106
|
+
}
|
|
14107
|
+
let p = peekTable(k, res, meta, isTableArray ? 2 : 1);
|
|
14108
|
+
if (!p) {
|
|
14109
|
+
throw new TomlError("trying to redefine an already defined table or value", {
|
|
14110
|
+
toml,
|
|
14111
|
+
ptr: tmp
|
|
14112
|
+
});
|
|
14113
|
+
}
|
|
14114
|
+
m = p[2];
|
|
14115
|
+
tbl = p[1];
|
|
14116
|
+
} else {
|
|
14117
|
+
tmp = ctx.p;
|
|
14118
|
+
let k = parseKey(ctx);
|
|
14119
|
+
let p = peekTable(k, tbl, m, 0);
|
|
14120
|
+
if (!p) {
|
|
14121
|
+
throw new TomlError("trying to redefine an already defined table or value", {
|
|
14122
|
+
toml,
|
|
14123
|
+
ptr: tmp
|
|
14124
|
+
});
|
|
14125
|
+
}
|
|
14126
|
+
p[1][p[0]] = extractValue(ctx, undefined, integersAsBigInt);
|
|
14127
|
+
}
|
|
14128
|
+
skipVoid(ctx, true);
|
|
14129
|
+
if (ctx.p < toml.length && (tmp = toml.charCodeAt(ctx.p)) !== 10 && tmp !== 13) {
|
|
14130
|
+
throw new TomlError("each key-value declaration must be followed by an end-of-line", {
|
|
14131
|
+
toml,
|
|
14132
|
+
ptr: ctx.p
|
|
14133
|
+
});
|
|
14134
|
+
}
|
|
14135
|
+
skipVoid(ctx);
|
|
14136
|
+
}
|
|
14137
|
+
return res;
|
|
14138
|
+
}
|
|
14139
|
+
|
|
14140
|
+
// node_modules/smol-toml/dist/stringify.js
|
|
14141
|
+
/*!
|
|
14142
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
14143
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
14144
|
+
*
|
|
14145
|
+
* Redistribution and use in source and binary forms, with or without
|
|
14146
|
+
* modification, are permitted provided that the following conditions are met:
|
|
14147
|
+
*
|
|
14148
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
14149
|
+
* list of conditions and the following disclaimer.
|
|
14150
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14151
|
+
* this list of conditions and the following disclaimer in the
|
|
14152
|
+
* documentation and/or other materials provided with the distribution.
|
|
14153
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14154
|
+
* may be used to endorse or promote products derived from this software without
|
|
14155
|
+
* specific prior written permission.
|
|
14156
|
+
*
|
|
14157
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14158
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
14159
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
14160
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
14161
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
14162
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
14163
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
14164
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
14165
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
14166
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
14167
|
+
*/
|
|
14168
|
+
|
|
14169
|
+
// node_modules/smol-toml/dist/index.js
|
|
14170
|
+
/*!
|
|
14171
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
14172
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
14173
|
+
*
|
|
14174
|
+
* Redistribution and use in source and binary forms, with or without
|
|
14175
|
+
* modification, are permitted provided that the following conditions are met:
|
|
14176
|
+
*
|
|
14177
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
14178
|
+
* list of conditions and the following disclaimer.
|
|
14179
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
14180
|
+
* this list of conditions and the following disclaimer in the
|
|
14181
|
+
* documentation and/or other materials provided with the distribution.
|
|
14182
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14183
|
+
* may be used to endorse or promote products derived from this software without
|
|
14184
|
+
* specific prior written permission.
|
|
14185
|
+
*
|
|
14186
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
14187
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
14188
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
14189
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
14190
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
14191
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
14192
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
14193
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
14194
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
14195
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
14196
|
+
*/
|
|
14197
|
+
|
|
13441
14198
|
// node_modules/yaml/dist/index.js
|
|
13442
14199
|
var composer = require_composer();
|
|
13443
14200
|
var Document = require_Document();
|
|
@@ -13507,6 +14264,8 @@ var SCHEMA_CANDIDATES = [
|
|
|
13507
14264
|
join2(dirname(fileURLToPath(import.meta.url)), "../schemas/config.schema.json"),
|
|
13508
14265
|
join2(dirname(fileURLToPath(import.meta.url)), "../../schemas/config.schema.json")
|
|
13509
14266
|
];
|
|
14267
|
+
var ROOT_CONFIG_TOML = "skeleton.toml";
|
|
14268
|
+
var LEGACY_CONFIG_YAML = join2(".skeleton", "config.yaml");
|
|
13510
14269
|
function resolveSchemaPath() {
|
|
13511
14270
|
for (const candidate of SCHEMA_CANDIDATES) {
|
|
13512
14271
|
if (existsSync2(candidate))
|
|
@@ -13521,96 +14280,75 @@ var COVERAGE_BUILTIN_EXCLUDES = [
|
|
|
13521
14280
|
"**/fixtures/**",
|
|
13522
14281
|
"templates/**"
|
|
13523
14282
|
];
|
|
14283
|
+
function hasConfigMarker(dir) {
|
|
14284
|
+
return existsSync2(join2(dir, ROOT_CONFIG_TOML)) || existsSync2(join2(dir, LEGACY_CONFIG_YAML));
|
|
14285
|
+
}
|
|
13524
14286
|
function findRepoRoot(startDir = process.cwd()) {
|
|
13525
14287
|
let dir = startDir;
|
|
13526
14288
|
while (true) {
|
|
13527
|
-
if (
|
|
14289
|
+
if (hasConfigMarker(dir))
|
|
13528
14290
|
return dir;
|
|
13529
14291
|
const parent = dirname(dir);
|
|
13530
14292
|
if (parent === dir) {
|
|
13531
|
-
throw new Error(
|
|
14293
|
+
throw new Error(`No ${ROOT_CONFIG_TOML} or ${LEGACY_CONFIG_YAML} found — run skeleton init or create config manually`);
|
|
13532
14294
|
}
|
|
13533
14295
|
dir = parent;
|
|
13534
14296
|
}
|
|
13535
14297
|
}
|
|
13536
|
-
function validateConfig(raw) {
|
|
14298
|
+
function validateConfig(raw, sourceLabel) {
|
|
13537
14299
|
const schema = JSON.parse(readFileSync(resolveSchemaPath(), "utf8"));
|
|
13538
14300
|
const ajv = new import_ajv.default({ allErrors: true, strict: false });
|
|
13539
14301
|
const validate = ajv.compile(schema);
|
|
13540
14302
|
if (!validate(raw)) {
|
|
13541
14303
|
const detail = validate.errors?.map((e) => `${e.instancePath || "/"} ${e.message}`).join("; ");
|
|
13542
|
-
throw new Error(`Invalid
|
|
14304
|
+
throw new Error(`Invalid ${sourceLabel}: ${detail ?? "schema validation failed"}`);
|
|
13543
14305
|
}
|
|
13544
14306
|
const config = raw;
|
|
13545
14307
|
validateDraftPathPrefixes(config.draftPathPrefixes);
|
|
13546
14308
|
return config;
|
|
13547
14309
|
}
|
|
13548
|
-
function
|
|
13549
|
-
const
|
|
13550
|
-
|
|
13551
|
-
|
|
14310
|
+
function loadConfigDetailed(root) {
|
|
14311
|
+
const tomlPath = join2(root, ROOT_CONFIG_TOML);
|
|
14312
|
+
const yamlPath = join2(root, LEGACY_CONFIG_YAML);
|
|
14313
|
+
const hasToml = existsSync2(tomlPath);
|
|
14314
|
+
const hasYaml = existsSync2(yamlPath);
|
|
14315
|
+
if (!(hasToml || hasYaml)) {
|
|
14316
|
+
throw new Error(`Missing ${ROOT_CONFIG_TOML} (or legacy ${LEGACY_CONFIG_YAML})`);
|
|
14317
|
+
}
|
|
14318
|
+
if (hasToml && hasYaml) {
|
|
14319
|
+
console.error(`warning: both ${ROOT_CONFIG_TOML} and ${LEGACY_CONFIG_YAML} exist — using ${ROOT_CONFIG_TOML}; legacy YAML is ignored`);
|
|
14320
|
+
}
|
|
14321
|
+
if (hasToml) {
|
|
14322
|
+
const raw2 = parse(readFileSync(tomlPath, "utf8"));
|
|
14323
|
+
return {
|
|
14324
|
+
config: validateConfig(raw2, ROOT_CONFIG_TOML),
|
|
14325
|
+
source: "toml",
|
|
14326
|
+
warnedDual: hasToml && hasYaml
|
|
14327
|
+
};
|
|
13552
14328
|
}
|
|
13553
|
-
const raw = $parse(readFileSync(
|
|
13554
|
-
return
|
|
14329
|
+
const raw = $parse(readFileSync(yamlPath, "utf8"));
|
|
14330
|
+
return {
|
|
14331
|
+
config: validateConfig(raw, LEGACY_CONFIG_YAML),
|
|
14332
|
+
source: "yaml"
|
|
14333
|
+
};
|
|
13555
14334
|
}
|
|
13556
|
-
|
|
13557
|
-
|
|
13558
|
-
import { existsSync as existsSync3, readFileSync as readFileSync2 } from "node:fs";
|
|
13559
|
-
import { join as join3, relative as relative2, resolve } from "node:path";
|
|
13560
|
-
var REGISTRY_TABLE_ROW_RE = /^\|\s*[^|]+\|\s*\[[^\]]*\]\(([^)]+)\)\s*\|/;
|
|
13561
|
-
var REGISTRY_TABLE_HEADER_RE = /\|\s*Topic\s*\|\s*Canonical file\s*\|/i;
|
|
13562
|
-
function parseRegistry(root) {
|
|
13563
|
-
const abs = join3(root, REGISTRY_REL_PATH);
|
|
13564
|
-
if (!existsSync3(abs)) {
|
|
13565
|
-
return { paths: [], hasTableHeader: false };
|
|
13566
|
-
}
|
|
13567
|
-
const content = readFileSync2(abs, "utf8");
|
|
13568
|
-
const hasTableHeader = REGISTRY_TABLE_HEADER_RE.test(content);
|
|
13569
|
-
const paths = [];
|
|
13570
|
-
for (const line of content.split(`
|
|
13571
|
-
`)) {
|
|
13572
|
-
const match = REGISTRY_TABLE_ROW_RE.exec(line);
|
|
13573
|
-
if (!match?.[1])
|
|
13574
|
-
continue;
|
|
13575
|
-
const linkTarget = match[1].trim();
|
|
13576
|
-
if (linkTarget.startsWith("#"))
|
|
13577
|
-
continue;
|
|
13578
|
-
const resolved = resolve(join3(root, REGISTRY_DIR_REL), linkTarget);
|
|
13579
|
-
paths.push(normalizeRelPath(relative2(root, resolved)));
|
|
13580
|
-
}
|
|
13581
|
-
return { paths: [...new Set(paths)], hasTableHeader };
|
|
14335
|
+
function loadConfig(root) {
|
|
14336
|
+
return loadConfigDetailed(root).config;
|
|
13582
14337
|
}
|
|
13583
14338
|
|
|
13584
14339
|
// src/customize/resolve.ts
|
|
13585
14340
|
function customizeDir(root) {
|
|
13586
|
-
return
|
|
14341
|
+
return join3(root, REGISTRY_DIR_REL, "customize");
|
|
13587
14342
|
}
|
|
13588
14343
|
function customizePathForSlug(root, slug) {
|
|
13589
|
-
return
|
|
13590
|
-
}
|
|
13591
|
-
function findCustomizeViaRegistry(root, slug) {
|
|
13592
|
-
for (const rel of parseRegistry(root).paths) {
|
|
13593
|
-
const expected = `${REGISTRY_DIR_REL}/customize/${slug}.md`;
|
|
13594
|
-
if (normalizeRelPath(rel) === expected && existsSync4(join4(root, rel))) {
|
|
13595
|
-
return rel;
|
|
13596
|
-
}
|
|
13597
|
-
}
|
|
13598
|
-
return null;
|
|
14344
|
+
return join3(customizeDir(root), `${slug}.md`);
|
|
13599
14345
|
}
|
|
13600
14346
|
function resolveSlugFile(root, slug) {
|
|
13601
14347
|
const direct = customizePathForSlug(root, slug);
|
|
13602
|
-
if (
|
|
13603
|
-
return {
|
|
13604
|
-
content: readFileSync3(direct, "utf8"),
|
|
13605
|
-
path: normalizeRelPath(relative3(root, direct))
|
|
13606
|
-
};
|
|
13607
|
-
}
|
|
13608
|
-
const registryPath = findCustomizeViaRegistry(root, slug);
|
|
13609
|
-
if (registryPath) {
|
|
13610
|
-
const abs = join4(root, registryPath);
|
|
14348
|
+
if (existsSync3(direct)) {
|
|
13611
14349
|
return {
|
|
13612
|
-
content:
|
|
13613
|
-
path:
|
|
14350
|
+
content: readFileSync2(direct, "utf8"),
|
|
14351
|
+
path: normalizeRelPath(relative2(root, direct))
|
|
13614
14352
|
};
|
|
13615
14353
|
}
|
|
13616
14354
|
return { content: null, path: null };
|
|
@@ -13631,11 +14369,11 @@ function readAlwaysInclude(root, basenames, skipBasename) {
|
|
|
13631
14369
|
const file = basename(name);
|
|
13632
14370
|
if (skipBasename && file === skipBasename)
|
|
13633
14371
|
continue;
|
|
13634
|
-
const abs =
|
|
13635
|
-
if (!
|
|
14372
|
+
const abs = join3(dir, file);
|
|
14373
|
+
if (!existsSync3(abs))
|
|
13636
14374
|
continue;
|
|
13637
|
-
parts.push(
|
|
13638
|
-
paths.push(normalizeRelPath(
|
|
14375
|
+
parts.push(readFileSync2(abs, "utf8").trimEnd());
|
|
14376
|
+
paths.push(normalizeRelPath(relative2(root, abs)));
|
|
13639
14377
|
}
|
|
13640
14378
|
return { parts, paths };
|
|
13641
14379
|
}
|
|
@@ -13756,4 +14494,4 @@ Customize override for /${slug} (from ${from}):
|
|
|
13756
14494
|
}
|
|
13757
14495
|
|
|
13758
14496
|
// src/hooks/customize-on-skill-read.ts
|
|
13759
|
-
process3.stdout.write(runCustomizeHook(
|
|
14497
|
+
process3.stdout.write(runCustomizeHook(readFileSync3(0, "utf8")));
|