create-cloudflare 2.54.5 → 2.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1107 -2202
- package/package.json +8 -8
- package/templates/hello-world-durable-object/py/src/entry.py +7 -7
- package/templates/hello-world-durable-object-with-assets/py/src/entry.py +7 -7
- package/templates/hello-world-with-assets/py/src/entry.py +1 -1
- package/templates/tanstack-start/c3.ts +1 -1
package/dist/cli.js
CHANGED
|
@@ -1426,7 +1426,7 @@ var require_semver = __commonJS({
|
|
|
1426
1426
|
var require_parse = __commonJS({
|
|
1427
1427
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
1428
1428
|
var SemVer = require_semver();
|
|
1429
|
-
var
|
|
1429
|
+
var parse7 = (version3, options, throwErrors = false) => {
|
|
1430
1430
|
if (version3 instanceof SemVer) {
|
|
1431
1431
|
return version3;
|
|
1432
1432
|
}
|
|
@@ -1439,16 +1439,16 @@ var require_parse = __commonJS({
|
|
|
1439
1439
|
throw er;
|
|
1440
1440
|
}
|
|
1441
1441
|
};
|
|
1442
|
-
module2.exports =
|
|
1442
|
+
module2.exports = parse7;
|
|
1443
1443
|
}
|
|
1444
1444
|
});
|
|
1445
1445
|
|
|
1446
1446
|
// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js
|
|
1447
1447
|
var require_valid = __commonJS({
|
|
1448
1448
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
1449
|
-
var
|
|
1449
|
+
var parse7 = require_parse();
|
|
1450
1450
|
var valid = (version3, options) => {
|
|
1451
|
-
const v2 =
|
|
1451
|
+
const v2 = parse7(version3, options);
|
|
1452
1452
|
return v2 ? v2.version : null;
|
|
1453
1453
|
};
|
|
1454
1454
|
module2.exports = valid;
|
|
@@ -1458,9 +1458,9 @@ var require_valid = __commonJS({
|
|
|
1458
1458
|
// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js
|
|
1459
1459
|
var require_clean = __commonJS({
|
|
1460
1460
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
1461
|
-
var
|
|
1461
|
+
var parse7 = require_parse();
|
|
1462
1462
|
var clean = (version3, options) => {
|
|
1463
|
-
const s =
|
|
1463
|
+
const s = parse7(version3.trim().replace(/^[=v]+/, ""), options);
|
|
1464
1464
|
return s ? s.version : null;
|
|
1465
1465
|
};
|
|
1466
1466
|
module2.exports = clean;
|
|
@@ -1493,10 +1493,10 @@ var require_inc = __commonJS({
|
|
|
1493
1493
|
// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js
|
|
1494
1494
|
var require_diff = __commonJS({
|
|
1495
1495
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
1496
|
-
var
|
|
1496
|
+
var parse7 = require_parse();
|
|
1497
1497
|
var diff = (version1, version22) => {
|
|
1498
|
-
const v1 =
|
|
1499
|
-
const v2 =
|
|
1498
|
+
const v1 = parse7(version1, null, true);
|
|
1499
|
+
const v2 = parse7(version22, null, true);
|
|
1500
1500
|
const comparison = v1.compare(v2);
|
|
1501
1501
|
if (comparison === 0) {
|
|
1502
1502
|
return null;
|
|
@@ -1563,9 +1563,9 @@ var require_patch = __commonJS({
|
|
|
1563
1563
|
// ../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js
|
|
1564
1564
|
var require_prerelease = __commonJS({
|
|
1565
1565
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
1566
|
-
var
|
|
1566
|
+
var parse7 = require_parse();
|
|
1567
1567
|
var prerelease = (version3, options) => {
|
|
1568
|
-
const parsed =
|
|
1568
|
+
const parsed = parse7(version3, options);
|
|
1569
1569
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
1570
1570
|
};
|
|
1571
1571
|
module2.exports = prerelease;
|
|
@@ -1737,7 +1737,7 @@ var require_cmp = __commonJS({
|
|
|
1737
1737
|
var require_coerce = __commonJS({
|
|
1738
1738
|
"../../node_modules/.pnpm/semver@7.7.1/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
1739
1739
|
var SemVer = require_semver();
|
|
1740
|
-
var
|
|
1740
|
+
var parse7 = require_parse();
|
|
1741
1741
|
var { safeRe: re, t: t2 } = require_re();
|
|
1742
1742
|
var coerce = (version3, options) => {
|
|
1743
1743
|
if (version3 instanceof SemVer) {
|
|
@@ -1772,7 +1772,7 @@ var require_coerce = __commonJS({
|
|
|
1772
1772
|
const patch = match[4] || "0";
|
|
1773
1773
|
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
1774
1774
|
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
1775
|
-
return
|
|
1775
|
+
return parse7(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
1776
1776
|
};
|
|
1777
1777
|
module2.exports = coerce;
|
|
1778
1778
|
}
|
|
@@ -2772,7 +2772,7 @@ var require_semver2 = __commonJS({
|
|
|
2772
2772
|
var constants = require_constants();
|
|
2773
2773
|
var SemVer = require_semver();
|
|
2774
2774
|
var identifiers = require_identifiers();
|
|
2775
|
-
var
|
|
2775
|
+
var parse7 = require_parse();
|
|
2776
2776
|
var valid = require_valid();
|
|
2777
2777
|
var clean = require_clean();
|
|
2778
2778
|
var inc = require_inc();
|
|
@@ -2810,7 +2810,7 @@ var require_semver2 = __commonJS({
|
|
|
2810
2810
|
var simplifyRange = require_simplify();
|
|
2811
2811
|
var subset = require_subset();
|
|
2812
2812
|
module2.exports = {
|
|
2813
|
-
parse:
|
|
2813
|
+
parse: parse7,
|
|
2814
2814
|
valid,
|
|
2815
2815
|
clean,
|
|
2816
2816
|
inc,
|
|
@@ -3278,7 +3278,7 @@ var require_parse2 = __commonJS({
|
|
|
3278
3278
|
}
|
|
3279
3279
|
return parsed;
|
|
3280
3280
|
}
|
|
3281
|
-
function
|
|
3281
|
+
function parse7(command2, args, options) {
|
|
3282
3282
|
if (args && !Array.isArray(args)) {
|
|
3283
3283
|
options = args;
|
|
3284
3284
|
args = null;
|
|
@@ -3297,7 +3297,7 @@ var require_parse2 = __commonJS({
|
|
|
3297
3297
|
};
|
|
3298
3298
|
return options.shell ? parsed : parseNonShell(parsed);
|
|
3299
3299
|
}
|
|
3300
|
-
module2.exports =
|
|
3300
|
+
module2.exports = parse7;
|
|
3301
3301
|
}
|
|
3302
3302
|
});
|
|
3303
3303
|
|
|
@@ -3356,16 +3356,16 @@ var require_cross_spawn = __commonJS({
|
|
|
3356
3356
|
"../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js"(exports2, module2) {
|
|
3357
3357
|
"use strict";
|
|
3358
3358
|
var cp3 = require("child_process");
|
|
3359
|
-
var
|
|
3359
|
+
var parse7 = require_parse2();
|
|
3360
3360
|
var enoent = require_enoent();
|
|
3361
3361
|
function spawn2(command2, args, options) {
|
|
3362
|
-
const parsed =
|
|
3362
|
+
const parsed = parse7(command2, args, options);
|
|
3363
3363
|
const spawned = cp3.spawn(parsed.command, parsed.args, parsed.options);
|
|
3364
3364
|
enoent.hookChildProcess(spawned, parsed);
|
|
3365
3365
|
return spawned;
|
|
3366
3366
|
}
|
|
3367
3367
|
function spawnSync(command2, args, options) {
|
|
3368
|
-
const parsed =
|
|
3368
|
+
const parsed = parse7(command2, args, options);
|
|
3369
3369
|
const result = cp3.spawnSync(parsed.command, parsed.args, parsed.options);
|
|
3370
3370
|
result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
|
|
3371
3371
|
return result;
|
|
@@ -3373,7 +3373,7 @@ var require_cross_spawn = __commonJS({
|
|
|
3373
3373
|
module2.exports = spawn2;
|
|
3374
3374
|
module2.exports.spawn = spawn2;
|
|
3375
3375
|
module2.exports.sync = spawnSync;
|
|
3376
|
-
module2.exports._parse =
|
|
3376
|
+
module2.exports._parse = parse7;
|
|
3377
3377
|
module2.exports._enoent = enoent;
|
|
3378
3378
|
}
|
|
3379
3379
|
});
|
|
@@ -4185,7 +4185,7 @@ var require_util = __commonJS({
|
|
|
4185
4185
|
var { IncomingMessage } = require("node:http");
|
|
4186
4186
|
var stream = require("node:stream");
|
|
4187
4187
|
var net = require("node:net");
|
|
4188
|
-
var { stringify:
|
|
4188
|
+
var { stringify: stringify4 } = require("node:querystring");
|
|
4189
4189
|
var { EventEmitter: EE } = require("node:events");
|
|
4190
4190
|
var timers = require_timers();
|
|
4191
4191
|
var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
|
|
@@ -4246,7 +4246,7 @@ var require_util = __commonJS({
|
|
|
4246
4246
|
if (url.includes("?") || url.includes("#")) {
|
|
4247
4247
|
throw new Error('Query params cannot be passed when url already contains "?" or "#".');
|
|
4248
4248
|
}
|
|
4249
|
-
const stringified =
|
|
4249
|
+
const stringified = stringify4(queryParams);
|
|
4250
4250
|
if (stringified) {
|
|
4251
4251
|
url += "?" + stringified;
|
|
4252
4252
|
}
|
|
@@ -6847,7 +6847,7 @@ var require_data_url = __commonJS({
|
|
|
6847
6847
|
const buffer = Buffer.from(data, "base64");
|
|
6848
6848
|
return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
6849
6849
|
}
|
|
6850
|
-
function collectAnHTTPQuotedString(input, position,
|
|
6850
|
+
function collectAnHTTPQuotedString(input, position, extractValue2 = false) {
|
|
6851
6851
|
const positionStart = position.position;
|
|
6852
6852
|
let value = "";
|
|
6853
6853
|
assert5(input[position.position] === '"');
|
|
@@ -6875,7 +6875,7 @@ var require_data_url = __commonJS({
|
|
|
6875
6875
|
break;
|
|
6876
6876
|
}
|
|
6877
6877
|
}
|
|
6878
|
-
if (
|
|
6878
|
+
if (extractValue2) {
|
|
6879
6879
|
return value;
|
|
6880
6880
|
}
|
|
6881
6881
|
return input.slice(positionStart, position.position);
|
|
@@ -7035,8 +7035,8 @@ var require_webidl = __commonJS({
|
|
|
7035
7035
|
throw err;
|
|
7036
7036
|
}
|
|
7037
7037
|
};
|
|
7038
|
-
webidl.brandCheckMultiple = function(
|
|
7039
|
-
const prototypes =
|
|
7038
|
+
webidl.brandCheckMultiple = function(List) {
|
|
7039
|
+
const prototypes = List.map((c2) => webidl.util.MakeTypeAssertion(c2));
|
|
7040
7040
|
return (V2) => {
|
|
7041
7041
|
if (prototypes.every((typeCheck) => !typeCheck(V2))) {
|
|
7042
7042
|
const err = new TypeError("Illegal invocation");
|
|
@@ -15093,7 +15093,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
15093
15093
|
"use strict";
|
|
15094
15094
|
var { writeFile: writeFile4, readFile: readFile3, mkdir } = require("node:fs/promises");
|
|
15095
15095
|
var { dirname: dirname5, resolve: resolve12 } = require("node:path");
|
|
15096
|
-
var { setTimeout:
|
|
15096
|
+
var { setTimeout: setTimeout5, clearTimeout: clearTimeout2 } = require("node:timers");
|
|
15097
15097
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
15098
15098
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
15099
15099
|
function formatRequestKey(opts, headerFilters, matchOptions = {}) {
|
|
@@ -15420,7 +15420,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
15420
15420
|
* Schedules a flush (debounced to avoid excessive writes)
|
|
15421
15421
|
*/
|
|
15422
15422
|
#scheduleFlush() {
|
|
15423
|
-
this.#flushTimeout =
|
|
15423
|
+
this.#flushTimeout = setTimeout5(() => {
|
|
15424
15424
|
this.saveSnapshots().catch(() => {
|
|
15425
15425
|
});
|
|
15426
15426
|
if (this.#autoFlush) {
|
|
@@ -21664,7 +21664,7 @@ var require_util4 = __commonJS({
|
|
|
21664
21664
|
throw new Error("Invalid cookie max-age");
|
|
21665
21665
|
}
|
|
21666
21666
|
}
|
|
21667
|
-
function
|
|
21667
|
+
function stringify4(cookie) {
|
|
21668
21668
|
if (cookie.name.length === 0) {
|
|
21669
21669
|
return null;
|
|
21670
21670
|
}
|
|
@@ -21718,7 +21718,7 @@ var require_util4 = __commonJS({
|
|
|
21718
21718
|
validateCookiePath,
|
|
21719
21719
|
validateCookieValue,
|
|
21720
21720
|
toIMFDate,
|
|
21721
|
-
stringify:
|
|
21721
|
+
stringify: stringify4
|
|
21722
21722
|
};
|
|
21723
21723
|
}
|
|
21724
21724
|
});
|
|
@@ -21869,7 +21869,7 @@ var require_cookies = __commonJS({
|
|
|
21869
21869
|
"../../node_modules/.pnpm/undici@7.14.0/node_modules/undici/lib/web/cookies/index.js"(exports2, module2) {
|
|
21870
21870
|
"use strict";
|
|
21871
21871
|
var { parseSetCookie } = require_parse3();
|
|
21872
|
-
var { stringify:
|
|
21872
|
+
var { stringify: stringify4 } = require_util4();
|
|
21873
21873
|
var { webidl } = require_webidl();
|
|
21874
21874
|
var { Headers } = require_headers();
|
|
21875
21875
|
var brandChecks = webidl.brandCheckMultiple([Headers, globalThis.Headers].filter(Boolean));
|
|
@@ -21917,7 +21917,7 @@ var require_cookies = __commonJS({
|
|
|
21917
21917
|
webidl.argumentLengthCheck(arguments, 2, "setCookie");
|
|
21918
21918
|
brandChecks(headers);
|
|
21919
21919
|
cookie = webidl.converters.Cookie(cookie);
|
|
21920
|
-
const str =
|
|
21920
|
+
const str = stringify4(cookie);
|
|
21921
21921
|
if (str) {
|
|
21922
21922
|
headers.append("set-cookie", str, true);
|
|
21923
21923
|
}
|
|
@@ -28152,12 +28152,12 @@ var require_index_688c5d50 = __commonJS({
|
|
|
28152
28152
|
}
|
|
28153
28153
|
};
|
|
28154
28154
|
var listFile = (opt, cb) => {
|
|
28155
|
-
const
|
|
28155
|
+
const parse8 = new parse$4(opt);
|
|
28156
28156
|
const readSize = opt.maxReadSize || 16 * 1024 * 1024;
|
|
28157
28157
|
const file = opt.file;
|
|
28158
28158
|
const p2 = new Promise((resolve13, reject) => {
|
|
28159
|
-
|
|
28160
|
-
|
|
28159
|
+
parse8.on("error", reject);
|
|
28160
|
+
parse8.on("end", resolve13);
|
|
28161
28161
|
fs__default["default"].stat(file, (er, stat) => {
|
|
28162
28162
|
if (er)
|
|
28163
28163
|
reject(er);
|
|
@@ -28167,7 +28167,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
28167
28167
|
size: stat.size
|
|
28168
28168
|
});
|
|
28169
28169
|
stream.on("error", reject);
|
|
28170
|
-
stream.pipe(
|
|
28170
|
+
stream.pipe(parse8);
|
|
28171
28171
|
}
|
|
28172
28172
|
});
|
|
28173
28173
|
});
|
|
@@ -30792,7 +30792,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
30792
30792
|
var TEMPLATE_REGEX2 = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
30793
30793
|
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
30794
30794
|
var STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
30795
|
-
var
|
|
30795
|
+
var ESCAPE_REGEX2 = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
30796
30796
|
var ESCAPES4 = /* @__PURE__ */ new Map([
|
|
30797
30797
|
["n", "\n"],
|
|
30798
30798
|
["r", "\r"],
|
|
@@ -30825,7 +30825,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
30825
30825
|
if (!Number.isNaN(number)) {
|
|
30826
30826
|
results.push(number);
|
|
30827
30827
|
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
30828
|
-
results.push(matches[2].replace(
|
|
30828
|
+
results.push(matches[2].replace(ESCAPE_REGEX2, (m3, escape, character) => escape ? unescape(escape) : character));
|
|
30829
30829
|
} else {
|
|
30830
30830
|
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name3}')`);
|
|
30831
30831
|
}
|
|
@@ -35404,7 +35404,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
35404
35404
|
this.force = opts.force;
|
|
35405
35405
|
this.verbose = opts.verbose;
|
|
35406
35406
|
this.proxy = process.env.https_proxy;
|
|
35407
|
-
this.repo =
|
|
35407
|
+
this.repo = parse7(src2);
|
|
35408
35408
|
this.mode = opts.mode || this.repo.mode;
|
|
35409
35409
|
if (!validModes.has(this.mode)) {
|
|
35410
35410
|
throw new Error(`Valid modes are ${Array.from(validModes).join(", ")}`);
|
|
@@ -35640,7 +35640,7 @@ var require_index_688c5d50 = __commonJS({
|
|
|
35640
35640
|
}
|
|
35641
35641
|
};
|
|
35642
35642
|
var supported = /* @__PURE__ */ new Set(["github", "gitlab", "bitbucket", "git.sr.ht"]);
|
|
35643
|
-
function
|
|
35643
|
+
function parse7(src2) {
|
|
35644
35644
|
const match2 = /^(?:(?:https:\/\/)?([^:/]+\.[^:/]+)\/|git@([^:/]+)[:/]|([^/]+):)?([^/\s]+)\/([^/\s#]+)(?:((?:\/[^/\s#]+)+))?(?:\/)?(?:#(.+))?/.exec(
|
|
35645
35645
|
src2
|
|
35646
35646
|
);
|
|
@@ -35779,9 +35779,9 @@ var require_dist = __commonJS({
|
|
|
35779
35779
|
// ../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js
|
|
35780
35780
|
var require_stringify = __commonJS({
|
|
35781
35781
|
"../../node_modules/.pnpm/json-stringify-safe@5.0.1/node_modules/json-stringify-safe/stringify.js"(exports2, module2) {
|
|
35782
|
-
exports2 = module2.exports =
|
|
35782
|
+
exports2 = module2.exports = stringify4;
|
|
35783
35783
|
exports2.getSerialize = serializer;
|
|
35784
|
-
function
|
|
35784
|
+
function stringify4(obj, replacer, spaces, cycleReplacer) {
|
|
35785
35785
|
return JSON.stringify(obj, serializer(replacer, cycleReplacer), spaces);
|
|
35786
35786
|
}
|
|
35787
35787
|
function serializer(replacer, cycleReplacer) {
|
|
@@ -35807,7 +35807,7 @@ var require_stringify = __commonJS({
|
|
|
35807
35807
|
var require_random_seed = __commonJS({
|
|
35808
35808
|
"../../node_modules/.pnpm/random-seed@0.3.0/node_modules/random-seed/index.js"(exports2, module2) {
|
|
35809
35809
|
"use strict";
|
|
35810
|
-
var
|
|
35810
|
+
var stringify4 = require_stringify();
|
|
35811
35811
|
var Mash = function() {
|
|
35812
35812
|
var n = 4022871197;
|
|
35813
35813
|
var mash = function(data) {
|
|
@@ -35896,7 +35896,7 @@ var require_random_seed = __commonJS({
|
|
|
35896
35896
|
seed2 = Math.random();
|
|
35897
35897
|
}
|
|
35898
35898
|
if (typeof seed2 !== "string") {
|
|
35899
|
-
seed2 =
|
|
35899
|
+
seed2 = stringify4(seed2, function(key, value) {
|
|
35900
35900
|
if (typeof value === "function") {
|
|
35901
35901
|
return value.toString();
|
|
35902
35902
|
}
|
|
@@ -36147,11 +36147,11 @@ var require_dist_web = __commonJS({
|
|
|
36147
36147
|
}
|
|
36148
36148
|
function _defineProperties(target, props) {
|
|
36149
36149
|
for (var i = 0; i < props.length; i++) {
|
|
36150
|
-
var
|
|
36151
|
-
|
|
36152
|
-
|
|
36153
|
-
if ("value" in
|
|
36154
|
-
Object.defineProperty(target,
|
|
36150
|
+
var descriptor = props[i];
|
|
36151
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
36152
|
+
descriptor.configurable = true;
|
|
36153
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
36154
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
|
36155
36155
|
}
|
|
36156
36156
|
}
|
|
36157
36157
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -36215,2020 +36215,6 @@ var require_dist_web = __commonJS({
|
|
|
36215
36215
|
}
|
|
36216
36216
|
});
|
|
36217
36217
|
|
|
36218
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js
|
|
36219
|
-
var require_parser = __commonJS({
|
|
36220
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/parser.js"(exports2, module2) {
|
|
36221
|
-
"use strict";
|
|
36222
|
-
var ParserEND = 1114112;
|
|
36223
|
-
var ParserError = class _ParserError extends Error {
|
|
36224
|
-
/* istanbul ignore next */
|
|
36225
|
-
constructor(msg, filename, linenumber) {
|
|
36226
|
-
super("[ParserError] " + msg, filename, linenumber);
|
|
36227
|
-
this.name = "ParserError";
|
|
36228
|
-
this.code = "ParserError";
|
|
36229
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, _ParserError);
|
|
36230
|
-
}
|
|
36231
|
-
};
|
|
36232
|
-
var State = class {
|
|
36233
|
-
constructor(parser2) {
|
|
36234
|
-
this.parser = parser2;
|
|
36235
|
-
this.buf = "";
|
|
36236
|
-
this.returned = null;
|
|
36237
|
-
this.result = null;
|
|
36238
|
-
this.resultTable = null;
|
|
36239
|
-
this.resultArr = null;
|
|
36240
|
-
}
|
|
36241
|
-
};
|
|
36242
|
-
var Parser2 = class {
|
|
36243
|
-
constructor() {
|
|
36244
|
-
this.pos = 0;
|
|
36245
|
-
this.col = 0;
|
|
36246
|
-
this.line = 0;
|
|
36247
|
-
this.obj = {};
|
|
36248
|
-
this.ctx = this.obj;
|
|
36249
|
-
this.stack = [];
|
|
36250
|
-
this._buf = "";
|
|
36251
|
-
this.char = null;
|
|
36252
|
-
this.ii = 0;
|
|
36253
|
-
this.state = new State(this.parseStart);
|
|
36254
|
-
}
|
|
36255
|
-
parse(str) {
|
|
36256
|
-
if (str.length === 0 || str.length == null) return;
|
|
36257
|
-
this._buf = String(str);
|
|
36258
|
-
this.ii = -1;
|
|
36259
|
-
this.char = -1;
|
|
36260
|
-
let getNext;
|
|
36261
|
-
while (getNext === false || this.nextChar()) {
|
|
36262
|
-
getNext = this.runOne();
|
|
36263
|
-
}
|
|
36264
|
-
this._buf = null;
|
|
36265
|
-
}
|
|
36266
|
-
nextChar() {
|
|
36267
|
-
if (this.char === 10) {
|
|
36268
|
-
++this.line;
|
|
36269
|
-
this.col = -1;
|
|
36270
|
-
}
|
|
36271
|
-
++this.ii;
|
|
36272
|
-
this.char = this._buf.codePointAt(this.ii);
|
|
36273
|
-
++this.pos;
|
|
36274
|
-
++this.col;
|
|
36275
|
-
return this.haveBuffer();
|
|
36276
|
-
}
|
|
36277
|
-
haveBuffer() {
|
|
36278
|
-
return this.ii < this._buf.length;
|
|
36279
|
-
}
|
|
36280
|
-
runOne() {
|
|
36281
|
-
return this.state.parser.call(this, this.state.returned);
|
|
36282
|
-
}
|
|
36283
|
-
finish() {
|
|
36284
|
-
this.char = ParserEND;
|
|
36285
|
-
let last;
|
|
36286
|
-
do {
|
|
36287
|
-
last = this.state.parser;
|
|
36288
|
-
this.runOne();
|
|
36289
|
-
} while (this.state.parser !== last);
|
|
36290
|
-
this.ctx = null;
|
|
36291
|
-
this.state = null;
|
|
36292
|
-
this._buf = null;
|
|
36293
|
-
return this.obj;
|
|
36294
|
-
}
|
|
36295
|
-
next(fn) {
|
|
36296
|
-
if (typeof fn !== "function") throw new ParserError("Tried to set state to non-existent state: " + JSON.stringify(fn));
|
|
36297
|
-
this.state.parser = fn;
|
|
36298
|
-
}
|
|
36299
|
-
goto(fn) {
|
|
36300
|
-
this.next(fn);
|
|
36301
|
-
return this.runOne();
|
|
36302
|
-
}
|
|
36303
|
-
call(fn, returnWith) {
|
|
36304
|
-
if (returnWith) this.next(returnWith);
|
|
36305
|
-
this.stack.push(this.state);
|
|
36306
|
-
this.state = new State(fn);
|
|
36307
|
-
}
|
|
36308
|
-
callNow(fn, returnWith) {
|
|
36309
|
-
this.call(fn, returnWith);
|
|
36310
|
-
return this.runOne();
|
|
36311
|
-
}
|
|
36312
|
-
return(value) {
|
|
36313
|
-
if (this.stack.length === 0) throw this.error(new ParserError("Stack underflow"));
|
|
36314
|
-
if (value === void 0) value = this.state.buf;
|
|
36315
|
-
this.state = this.stack.pop();
|
|
36316
|
-
this.state.returned = value;
|
|
36317
|
-
}
|
|
36318
|
-
returnNow(value) {
|
|
36319
|
-
this.return(value);
|
|
36320
|
-
return this.runOne();
|
|
36321
|
-
}
|
|
36322
|
-
consume() {
|
|
36323
|
-
if (this.char === ParserEND) throw this.error(new ParserError("Unexpected end-of-buffer"));
|
|
36324
|
-
this.state.buf += this._buf[this.ii];
|
|
36325
|
-
}
|
|
36326
|
-
error(err) {
|
|
36327
|
-
err.line = this.line;
|
|
36328
|
-
err.col = this.col;
|
|
36329
|
-
err.pos = this.pos;
|
|
36330
|
-
return err;
|
|
36331
|
-
}
|
|
36332
|
-
/* istanbul ignore next */
|
|
36333
|
-
parseStart() {
|
|
36334
|
-
throw new ParserError("Must declare a parseStart method");
|
|
36335
|
-
}
|
|
36336
|
-
};
|
|
36337
|
-
Parser2.END = ParserEND;
|
|
36338
|
-
Parser2.Error = ParserError;
|
|
36339
|
-
module2.exports = Parser2;
|
|
36340
|
-
}
|
|
36341
|
-
});
|
|
36342
|
-
|
|
36343
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js
|
|
36344
|
-
var require_create_datetime = __commonJS({
|
|
36345
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime.js"(exports2, module2) {
|
|
36346
|
-
"use strict";
|
|
36347
|
-
module2.exports = (value) => {
|
|
36348
|
-
const date = new Date(value);
|
|
36349
|
-
if (isNaN(date)) {
|
|
36350
|
-
throw new TypeError("Invalid Datetime");
|
|
36351
|
-
} else {
|
|
36352
|
-
return date;
|
|
36353
|
-
}
|
|
36354
|
-
};
|
|
36355
|
-
}
|
|
36356
|
-
});
|
|
36357
|
-
|
|
36358
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js
|
|
36359
|
-
var require_format_num = __commonJS({
|
|
36360
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/format-num.js"(exports2, module2) {
|
|
36361
|
-
"use strict";
|
|
36362
|
-
module2.exports = (d2, num) => {
|
|
36363
|
-
num = String(num);
|
|
36364
|
-
while (num.length < d2) num = "0" + num;
|
|
36365
|
-
return num;
|
|
36366
|
-
};
|
|
36367
|
-
}
|
|
36368
|
-
});
|
|
36369
|
-
|
|
36370
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js
|
|
36371
|
-
var require_create_datetime_float = __commonJS({
|
|
36372
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-datetime-float.js"(exports2, module2) {
|
|
36373
|
-
"use strict";
|
|
36374
|
-
var f = require_format_num();
|
|
36375
|
-
var FloatingDateTime = class extends Date {
|
|
36376
|
-
constructor(value) {
|
|
36377
|
-
super(value + "Z");
|
|
36378
|
-
this.isFloating = true;
|
|
36379
|
-
}
|
|
36380
|
-
toISOString() {
|
|
36381
|
-
const date = `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
|
|
36382
|
-
const time = `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
|
|
36383
|
-
return `${date}T${time}`;
|
|
36384
|
-
}
|
|
36385
|
-
};
|
|
36386
|
-
module2.exports = (value) => {
|
|
36387
|
-
const date = new FloatingDateTime(value);
|
|
36388
|
-
if (isNaN(date)) {
|
|
36389
|
-
throw new TypeError("Invalid Datetime");
|
|
36390
|
-
} else {
|
|
36391
|
-
return date;
|
|
36392
|
-
}
|
|
36393
|
-
};
|
|
36394
|
-
}
|
|
36395
|
-
});
|
|
36396
|
-
|
|
36397
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js
|
|
36398
|
-
var require_create_date = __commonJS({
|
|
36399
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-date.js"(exports2, module2) {
|
|
36400
|
-
"use strict";
|
|
36401
|
-
var f = require_format_num();
|
|
36402
|
-
var DateTime = global.Date;
|
|
36403
|
-
var Date2 = class extends DateTime {
|
|
36404
|
-
constructor(value) {
|
|
36405
|
-
super(value);
|
|
36406
|
-
this.isDate = true;
|
|
36407
|
-
}
|
|
36408
|
-
toISOString() {
|
|
36409
|
-
return `${this.getUTCFullYear()}-${f(2, this.getUTCMonth() + 1)}-${f(2, this.getUTCDate())}`;
|
|
36410
|
-
}
|
|
36411
|
-
};
|
|
36412
|
-
module2.exports = (value) => {
|
|
36413
|
-
const date = new Date2(value);
|
|
36414
|
-
if (isNaN(date)) {
|
|
36415
|
-
throw new TypeError("Invalid Datetime");
|
|
36416
|
-
} else {
|
|
36417
|
-
return date;
|
|
36418
|
-
}
|
|
36419
|
-
};
|
|
36420
|
-
}
|
|
36421
|
-
});
|
|
36422
|
-
|
|
36423
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js
|
|
36424
|
-
var require_create_time = __commonJS({
|
|
36425
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/create-time.js"(exports2, module2) {
|
|
36426
|
-
"use strict";
|
|
36427
|
-
var f = require_format_num();
|
|
36428
|
-
var Time = class extends Date {
|
|
36429
|
-
constructor(value) {
|
|
36430
|
-
super(`0000-01-01T${value}Z`);
|
|
36431
|
-
this.isTime = true;
|
|
36432
|
-
}
|
|
36433
|
-
toISOString() {
|
|
36434
|
-
return `${f(2, this.getUTCHours())}:${f(2, this.getUTCMinutes())}:${f(2, this.getUTCSeconds())}.${f(3, this.getUTCMilliseconds())}`;
|
|
36435
|
-
}
|
|
36436
|
-
};
|
|
36437
|
-
module2.exports = (value) => {
|
|
36438
|
-
const date = new Time(value);
|
|
36439
|
-
if (isNaN(date)) {
|
|
36440
|
-
throw new TypeError("Invalid Datetime");
|
|
36441
|
-
} else {
|
|
36442
|
-
return date;
|
|
36443
|
-
}
|
|
36444
|
-
};
|
|
36445
|
-
}
|
|
36446
|
-
});
|
|
36447
|
-
|
|
36448
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js
|
|
36449
|
-
var require_toml_parser = __commonJS({
|
|
36450
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/lib/toml-parser.js"(exports, module) {
|
|
36451
|
-
"use strict";
|
|
36452
|
-
module.exports = makeParserClass(require_parser());
|
|
36453
|
-
module.exports.makeParserClass = makeParserClass;
|
|
36454
|
-
var TomlError = class _TomlError extends Error {
|
|
36455
|
-
constructor(msg) {
|
|
36456
|
-
super(msg);
|
|
36457
|
-
this.name = "TomlError";
|
|
36458
|
-
if (Error.captureStackTrace) Error.captureStackTrace(this, _TomlError);
|
|
36459
|
-
this.fromTOML = true;
|
|
36460
|
-
this.wrapped = null;
|
|
36461
|
-
}
|
|
36462
|
-
};
|
|
36463
|
-
TomlError.wrap = (err) => {
|
|
36464
|
-
const terr = new TomlError(err.message);
|
|
36465
|
-
terr.code = err.code;
|
|
36466
|
-
terr.wrapped = err;
|
|
36467
|
-
return terr;
|
|
36468
|
-
};
|
|
36469
|
-
module.exports.TomlError = TomlError;
|
|
36470
|
-
var createDateTime = require_create_datetime();
|
|
36471
|
-
var createDateTimeFloat = require_create_datetime_float();
|
|
36472
|
-
var createDate = require_create_date();
|
|
36473
|
-
var createTime = require_create_time();
|
|
36474
|
-
var CTRL_I = 9;
|
|
36475
|
-
var CTRL_J = 10;
|
|
36476
|
-
var CTRL_M = 13;
|
|
36477
|
-
var CTRL_CHAR_BOUNDARY = 31;
|
|
36478
|
-
var CHAR_SP = 32;
|
|
36479
|
-
var CHAR_QUOT = 34;
|
|
36480
|
-
var CHAR_NUM = 35;
|
|
36481
|
-
var CHAR_APOS = 39;
|
|
36482
|
-
var CHAR_PLUS = 43;
|
|
36483
|
-
var CHAR_COMMA = 44;
|
|
36484
|
-
var CHAR_HYPHEN = 45;
|
|
36485
|
-
var CHAR_PERIOD = 46;
|
|
36486
|
-
var CHAR_0 = 48;
|
|
36487
|
-
var CHAR_1 = 49;
|
|
36488
|
-
var CHAR_7 = 55;
|
|
36489
|
-
var CHAR_9 = 57;
|
|
36490
|
-
var CHAR_COLON = 58;
|
|
36491
|
-
var CHAR_EQUALS = 61;
|
|
36492
|
-
var CHAR_A = 65;
|
|
36493
|
-
var CHAR_E = 69;
|
|
36494
|
-
var CHAR_F = 70;
|
|
36495
|
-
var CHAR_T = 84;
|
|
36496
|
-
var CHAR_U = 85;
|
|
36497
|
-
var CHAR_Z = 90;
|
|
36498
|
-
var CHAR_LOWBAR = 95;
|
|
36499
|
-
var CHAR_a = 97;
|
|
36500
|
-
var CHAR_b = 98;
|
|
36501
|
-
var CHAR_e = 101;
|
|
36502
|
-
var CHAR_f = 102;
|
|
36503
|
-
var CHAR_i = 105;
|
|
36504
|
-
var CHAR_l = 108;
|
|
36505
|
-
var CHAR_n = 110;
|
|
36506
|
-
var CHAR_o = 111;
|
|
36507
|
-
var CHAR_r = 114;
|
|
36508
|
-
var CHAR_s = 115;
|
|
36509
|
-
var CHAR_t = 116;
|
|
36510
|
-
var CHAR_u = 117;
|
|
36511
|
-
var CHAR_x = 120;
|
|
36512
|
-
var CHAR_z = 122;
|
|
36513
|
-
var CHAR_LCUB = 123;
|
|
36514
|
-
var CHAR_RCUB = 125;
|
|
36515
|
-
var CHAR_LSQB = 91;
|
|
36516
|
-
var CHAR_BSOL = 92;
|
|
36517
|
-
var CHAR_RSQB = 93;
|
|
36518
|
-
var CHAR_DEL = 127;
|
|
36519
|
-
var SURROGATE_FIRST = 55296;
|
|
36520
|
-
var SURROGATE_LAST = 57343;
|
|
36521
|
-
var escapes = {
|
|
36522
|
-
[CHAR_b]: "\b",
|
|
36523
|
-
[CHAR_t]: " ",
|
|
36524
|
-
[CHAR_n]: "\n",
|
|
36525
|
-
[CHAR_f]: "\f",
|
|
36526
|
-
[CHAR_r]: "\r",
|
|
36527
|
-
[CHAR_QUOT]: '"',
|
|
36528
|
-
[CHAR_BSOL]: "\\"
|
|
36529
|
-
};
|
|
36530
|
-
function isDigit(cp3) {
|
|
36531
|
-
return cp3 >= CHAR_0 && cp3 <= CHAR_9;
|
|
36532
|
-
}
|
|
36533
|
-
function isHexit(cp3) {
|
|
36534
|
-
return cp3 >= CHAR_A && cp3 <= CHAR_F || cp3 >= CHAR_a && cp3 <= CHAR_f || cp3 >= CHAR_0 && cp3 <= CHAR_9;
|
|
36535
|
-
}
|
|
36536
|
-
function isBit(cp3) {
|
|
36537
|
-
return cp3 === CHAR_1 || cp3 === CHAR_0;
|
|
36538
|
-
}
|
|
36539
|
-
function isOctit(cp3) {
|
|
36540
|
-
return cp3 >= CHAR_0 && cp3 <= CHAR_7;
|
|
36541
|
-
}
|
|
36542
|
-
function isAlphaNumQuoteHyphen(cp3) {
|
|
36543
|
-
return cp3 >= CHAR_A && cp3 <= CHAR_Z || cp3 >= CHAR_a && cp3 <= CHAR_z || cp3 >= CHAR_0 && cp3 <= CHAR_9 || cp3 === CHAR_APOS || cp3 === CHAR_QUOT || cp3 === CHAR_LOWBAR || cp3 === CHAR_HYPHEN;
|
|
36544
|
-
}
|
|
36545
|
-
function isAlphaNumHyphen(cp3) {
|
|
36546
|
-
return cp3 >= CHAR_A && cp3 <= CHAR_Z || cp3 >= CHAR_a && cp3 <= CHAR_z || cp3 >= CHAR_0 && cp3 <= CHAR_9 || cp3 === CHAR_LOWBAR || cp3 === CHAR_HYPHEN;
|
|
36547
|
-
}
|
|
36548
|
-
var _type = Symbol("type");
|
|
36549
|
-
var _declared = Symbol("declared");
|
|
36550
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
36551
|
-
var defineProperty = Object.defineProperty;
|
|
36552
|
-
var descriptor = { configurable: true, enumerable: true, writable: true, value: void 0 };
|
|
36553
|
-
function hasKey(obj, key) {
|
|
36554
|
-
if (hasOwnProperty.call(obj, key)) return true;
|
|
36555
|
-
if (key === "__proto__") defineProperty(obj, "__proto__", descriptor);
|
|
36556
|
-
return false;
|
|
36557
|
-
}
|
|
36558
|
-
var INLINE_TABLE = Symbol("inline-table");
|
|
36559
|
-
function InlineTable() {
|
|
36560
|
-
return Object.defineProperties({}, {
|
|
36561
|
-
[_type]: { value: INLINE_TABLE }
|
|
36562
|
-
});
|
|
36563
|
-
}
|
|
36564
|
-
function isInlineTable(obj) {
|
|
36565
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36566
|
-
return obj[_type] === INLINE_TABLE;
|
|
36567
|
-
}
|
|
36568
|
-
var TABLE = Symbol("table");
|
|
36569
|
-
function Table() {
|
|
36570
|
-
return Object.defineProperties({}, {
|
|
36571
|
-
[_type]: { value: TABLE },
|
|
36572
|
-
[_declared]: { value: false, writable: true }
|
|
36573
|
-
});
|
|
36574
|
-
}
|
|
36575
|
-
function isTable(obj) {
|
|
36576
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36577
|
-
return obj[_type] === TABLE;
|
|
36578
|
-
}
|
|
36579
|
-
var _contentType = Symbol("content-type");
|
|
36580
|
-
var INLINE_LIST = Symbol("inline-list");
|
|
36581
|
-
function InlineList(type) {
|
|
36582
|
-
return Object.defineProperties([], {
|
|
36583
|
-
[_type]: { value: INLINE_LIST },
|
|
36584
|
-
[_contentType]: { value: type }
|
|
36585
|
-
});
|
|
36586
|
-
}
|
|
36587
|
-
function isInlineList(obj) {
|
|
36588
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36589
|
-
return obj[_type] === INLINE_LIST;
|
|
36590
|
-
}
|
|
36591
|
-
var LIST = Symbol("list");
|
|
36592
|
-
function List() {
|
|
36593
|
-
return Object.defineProperties([], {
|
|
36594
|
-
[_type]: { value: LIST }
|
|
36595
|
-
});
|
|
36596
|
-
}
|
|
36597
|
-
function isList(obj) {
|
|
36598
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36599
|
-
return obj[_type] === LIST;
|
|
36600
|
-
}
|
|
36601
|
-
var _custom;
|
|
36602
|
-
try {
|
|
36603
|
-
const utilInspect = eval("require('util').inspect");
|
|
36604
|
-
_custom = utilInspect.custom;
|
|
36605
|
-
} catch (_3) {
|
|
36606
|
-
}
|
|
36607
|
-
var _inspect = _custom || "inspect";
|
|
36608
|
-
var BoxedBigInt = class {
|
|
36609
|
-
constructor(value) {
|
|
36610
|
-
try {
|
|
36611
|
-
this.value = global.BigInt.asIntN(64, value);
|
|
36612
|
-
} catch (_3) {
|
|
36613
|
-
this.value = null;
|
|
36614
|
-
}
|
|
36615
|
-
Object.defineProperty(this, _type, { value: INTEGER });
|
|
36616
|
-
}
|
|
36617
|
-
isNaN() {
|
|
36618
|
-
return this.value === null;
|
|
36619
|
-
}
|
|
36620
|
-
/* istanbul ignore next */
|
|
36621
|
-
toString() {
|
|
36622
|
-
return String(this.value);
|
|
36623
|
-
}
|
|
36624
|
-
/* istanbul ignore next */
|
|
36625
|
-
[_inspect]() {
|
|
36626
|
-
return `[BigInt: ${this.toString()}]}`;
|
|
36627
|
-
}
|
|
36628
|
-
valueOf() {
|
|
36629
|
-
return this.value;
|
|
36630
|
-
}
|
|
36631
|
-
};
|
|
36632
|
-
var INTEGER = Symbol("integer");
|
|
36633
|
-
function Integer(value) {
|
|
36634
|
-
let num = Number(value);
|
|
36635
|
-
if (Object.is(num, -0)) num = 0;
|
|
36636
|
-
if (global.BigInt && !Number.isSafeInteger(num)) {
|
|
36637
|
-
return new BoxedBigInt(value);
|
|
36638
|
-
} else {
|
|
36639
|
-
return Object.defineProperties(new Number(num), {
|
|
36640
|
-
isNaN: { value: function() {
|
|
36641
|
-
return isNaN(this);
|
|
36642
|
-
} },
|
|
36643
|
-
[_type]: { value: INTEGER },
|
|
36644
|
-
[_inspect]: { value: () => `[Integer: ${value}]` }
|
|
36645
|
-
});
|
|
36646
|
-
}
|
|
36647
|
-
}
|
|
36648
|
-
function isInteger(obj) {
|
|
36649
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36650
|
-
return obj[_type] === INTEGER;
|
|
36651
|
-
}
|
|
36652
|
-
var FLOAT = Symbol("float");
|
|
36653
|
-
function Float(value) {
|
|
36654
|
-
return Object.defineProperties(new Number(value), {
|
|
36655
|
-
[_type]: { value: FLOAT },
|
|
36656
|
-
[_inspect]: { value: () => `[Float: ${value}]` }
|
|
36657
|
-
});
|
|
36658
|
-
}
|
|
36659
|
-
function isFloat(obj) {
|
|
36660
|
-
if (obj === null || typeof obj !== "object") return false;
|
|
36661
|
-
return obj[_type] === FLOAT;
|
|
36662
|
-
}
|
|
36663
|
-
function tomlType(value) {
|
|
36664
|
-
const type = typeof value;
|
|
36665
|
-
if (type === "object") {
|
|
36666
|
-
if (value === null) return "null";
|
|
36667
|
-
if (value instanceof Date) return "datetime";
|
|
36668
|
-
if (_type in value) {
|
|
36669
|
-
switch (value[_type]) {
|
|
36670
|
-
case INLINE_TABLE:
|
|
36671
|
-
return "inline-table";
|
|
36672
|
-
case INLINE_LIST:
|
|
36673
|
-
return "inline-list";
|
|
36674
|
-
/* istanbul ignore next */
|
|
36675
|
-
case TABLE:
|
|
36676
|
-
return "table";
|
|
36677
|
-
/* istanbul ignore next */
|
|
36678
|
-
case LIST:
|
|
36679
|
-
return "list";
|
|
36680
|
-
case FLOAT:
|
|
36681
|
-
return "float";
|
|
36682
|
-
case INTEGER:
|
|
36683
|
-
return "integer";
|
|
36684
|
-
}
|
|
36685
|
-
}
|
|
36686
|
-
}
|
|
36687
|
-
return type;
|
|
36688
|
-
}
|
|
36689
|
-
function makeParserClass(Parser2) {
|
|
36690
|
-
class TOMLParser extends Parser2 {
|
|
36691
|
-
constructor() {
|
|
36692
|
-
super();
|
|
36693
|
-
this.ctx = this.obj = Table();
|
|
36694
|
-
}
|
|
36695
|
-
/* MATCH HELPER */
|
|
36696
|
-
atEndOfWord() {
|
|
36697
|
-
return this.char === CHAR_NUM || this.char === CTRL_I || this.char === CHAR_SP || this.atEndOfLine();
|
|
36698
|
-
}
|
|
36699
|
-
atEndOfLine() {
|
|
36700
|
-
return this.char === Parser2.END || this.char === CTRL_J || this.char === CTRL_M;
|
|
36701
|
-
}
|
|
36702
|
-
parseStart() {
|
|
36703
|
-
if (this.char === Parser2.END) {
|
|
36704
|
-
return null;
|
|
36705
|
-
} else if (this.char === CHAR_LSQB) {
|
|
36706
|
-
return this.call(this.parseTableOrList);
|
|
36707
|
-
} else if (this.char === CHAR_NUM) {
|
|
36708
|
-
return this.call(this.parseComment);
|
|
36709
|
-
} else if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
|
|
36710
|
-
return null;
|
|
36711
|
-
} else if (isAlphaNumQuoteHyphen(this.char)) {
|
|
36712
|
-
return this.callNow(this.parseAssignStatement);
|
|
36713
|
-
} else {
|
|
36714
|
-
throw this.error(new TomlError(`Unknown character "${this.char}"`));
|
|
36715
|
-
}
|
|
36716
|
-
}
|
|
36717
|
-
// HELPER, this strips any whitespace and comments to the end of the line
|
|
36718
|
-
// then RETURNS. Last state in a production.
|
|
36719
|
-
parseWhitespaceToEOL() {
|
|
36720
|
-
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
|
|
36721
|
-
return null;
|
|
36722
|
-
} else if (this.char === CHAR_NUM) {
|
|
36723
|
-
return this.goto(this.parseComment);
|
|
36724
|
-
} else if (this.char === Parser2.END || this.char === CTRL_J) {
|
|
36725
|
-
return this.return();
|
|
36726
|
-
} else {
|
|
36727
|
-
throw this.error(new TomlError("Unexpected character, expected only whitespace or comments till end of line"));
|
|
36728
|
-
}
|
|
36729
|
-
}
|
|
36730
|
-
/* ASSIGNMENT: key = value */
|
|
36731
|
-
parseAssignStatement() {
|
|
36732
|
-
return this.callNow(this.parseAssign, this.recordAssignStatement);
|
|
36733
|
-
}
|
|
36734
|
-
recordAssignStatement(kv) {
|
|
36735
|
-
let target = this.ctx;
|
|
36736
|
-
let finalKey = kv.key.pop();
|
|
36737
|
-
for (let kw of kv.key) {
|
|
36738
|
-
if (hasKey(target, kw) && !isTable(target[kw])) {
|
|
36739
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
36740
|
-
}
|
|
36741
|
-
target = target[kw] = target[kw] || Table();
|
|
36742
|
-
}
|
|
36743
|
-
if (hasKey(target, finalKey)) {
|
|
36744
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
36745
|
-
}
|
|
36746
|
-
target[_declared] = true;
|
|
36747
|
-
if (isInteger(kv.value) || isFloat(kv.value)) {
|
|
36748
|
-
target[finalKey] = kv.value.valueOf();
|
|
36749
|
-
} else {
|
|
36750
|
-
target[finalKey] = kv.value;
|
|
36751
|
-
}
|
|
36752
|
-
return this.goto(this.parseWhitespaceToEOL);
|
|
36753
|
-
}
|
|
36754
|
-
/* ASSSIGNMENT expression, key = value possibly inside an inline table */
|
|
36755
|
-
parseAssign() {
|
|
36756
|
-
return this.callNow(this.parseKeyword, this.recordAssignKeyword);
|
|
36757
|
-
}
|
|
36758
|
-
recordAssignKeyword(key) {
|
|
36759
|
-
if (this.state.resultTable) {
|
|
36760
|
-
this.state.resultTable.push(key);
|
|
36761
|
-
} else {
|
|
36762
|
-
this.state.resultTable = [key];
|
|
36763
|
-
}
|
|
36764
|
-
return this.goto(this.parseAssignKeywordPreDot);
|
|
36765
|
-
}
|
|
36766
|
-
parseAssignKeywordPreDot() {
|
|
36767
|
-
if (this.char === CHAR_PERIOD) {
|
|
36768
|
-
return this.next(this.parseAssignKeywordPostDot);
|
|
36769
|
-
} else if (this.char !== CHAR_SP && this.char !== CTRL_I) {
|
|
36770
|
-
return this.goto(this.parseAssignEqual);
|
|
36771
|
-
}
|
|
36772
|
-
}
|
|
36773
|
-
parseAssignKeywordPostDot() {
|
|
36774
|
-
if (this.char !== CHAR_SP && this.char !== CTRL_I) {
|
|
36775
|
-
return this.callNow(this.parseKeyword, this.recordAssignKeyword);
|
|
36776
|
-
}
|
|
36777
|
-
}
|
|
36778
|
-
parseAssignEqual() {
|
|
36779
|
-
if (this.char === CHAR_EQUALS) {
|
|
36780
|
-
return this.next(this.parseAssignPreValue);
|
|
36781
|
-
} else {
|
|
36782
|
-
throw this.error(new TomlError('Invalid character, expected "="'));
|
|
36783
|
-
}
|
|
36784
|
-
}
|
|
36785
|
-
parseAssignPreValue() {
|
|
36786
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
36787
|
-
return null;
|
|
36788
|
-
} else {
|
|
36789
|
-
return this.callNow(this.parseValue, this.recordAssignValue);
|
|
36790
|
-
}
|
|
36791
|
-
}
|
|
36792
|
-
recordAssignValue(value) {
|
|
36793
|
-
return this.returnNow({ key: this.state.resultTable, value });
|
|
36794
|
-
}
|
|
36795
|
-
/* COMMENTS: #...eol */
|
|
36796
|
-
parseComment() {
|
|
36797
|
-
do {
|
|
36798
|
-
if (this.char === Parser2.END || this.char === CTRL_J) {
|
|
36799
|
-
return this.return();
|
|
36800
|
-
} else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
|
|
36801
|
-
throw this.errorControlCharIn("comments");
|
|
36802
|
-
}
|
|
36803
|
-
} while (this.nextChar());
|
|
36804
|
-
}
|
|
36805
|
-
/* TABLES AND LISTS, [foo] and [[foo]] */
|
|
36806
|
-
parseTableOrList() {
|
|
36807
|
-
if (this.char === CHAR_LSQB) {
|
|
36808
|
-
this.next(this.parseList);
|
|
36809
|
-
} else {
|
|
36810
|
-
return this.goto(this.parseTable);
|
|
36811
|
-
}
|
|
36812
|
-
}
|
|
36813
|
-
/* TABLE [foo.bar.baz] */
|
|
36814
|
-
parseTable() {
|
|
36815
|
-
this.ctx = this.obj;
|
|
36816
|
-
return this.goto(this.parseTableNext);
|
|
36817
|
-
}
|
|
36818
|
-
parseTableNext() {
|
|
36819
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
36820
|
-
return null;
|
|
36821
|
-
} else {
|
|
36822
|
-
return this.callNow(this.parseKeyword, this.parseTableMore);
|
|
36823
|
-
}
|
|
36824
|
-
}
|
|
36825
|
-
parseTableMore(keyword) {
|
|
36826
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
36827
|
-
return null;
|
|
36828
|
-
} else if (this.char === CHAR_RSQB) {
|
|
36829
|
-
if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
|
|
36830
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
36831
|
-
} else {
|
|
36832
|
-
this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
|
|
36833
|
-
this.ctx[_declared] = true;
|
|
36834
|
-
}
|
|
36835
|
-
return this.next(this.parseWhitespaceToEOL);
|
|
36836
|
-
} else if (this.char === CHAR_PERIOD) {
|
|
36837
|
-
if (!hasKey(this.ctx, keyword)) {
|
|
36838
|
-
this.ctx = this.ctx[keyword] = Table();
|
|
36839
|
-
} else if (isTable(this.ctx[keyword])) {
|
|
36840
|
-
this.ctx = this.ctx[keyword];
|
|
36841
|
-
} else if (isList(this.ctx[keyword])) {
|
|
36842
|
-
this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
|
|
36843
|
-
} else {
|
|
36844
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
36845
|
-
}
|
|
36846
|
-
return this.next(this.parseTableNext);
|
|
36847
|
-
} else {
|
|
36848
|
-
throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
36849
|
-
}
|
|
36850
|
-
}
|
|
36851
|
-
/* LIST [[a.b.c]] */
|
|
36852
|
-
parseList() {
|
|
36853
|
-
this.ctx = this.obj;
|
|
36854
|
-
return this.goto(this.parseListNext);
|
|
36855
|
-
}
|
|
36856
|
-
parseListNext() {
|
|
36857
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
36858
|
-
return null;
|
|
36859
|
-
} else {
|
|
36860
|
-
return this.callNow(this.parseKeyword, this.parseListMore);
|
|
36861
|
-
}
|
|
36862
|
-
}
|
|
36863
|
-
parseListMore(keyword) {
|
|
36864
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
36865
|
-
return null;
|
|
36866
|
-
} else if (this.char === CHAR_RSQB) {
|
|
36867
|
-
if (!hasKey(this.ctx, keyword)) {
|
|
36868
|
-
this.ctx[keyword] = List();
|
|
36869
|
-
}
|
|
36870
|
-
if (isInlineList(this.ctx[keyword])) {
|
|
36871
|
-
throw this.error(new TomlError("Can't extend an inline array"));
|
|
36872
|
-
} else if (isList(this.ctx[keyword])) {
|
|
36873
|
-
const next = Table();
|
|
36874
|
-
this.ctx[keyword].push(next);
|
|
36875
|
-
this.ctx = next;
|
|
36876
|
-
} else {
|
|
36877
|
-
throw this.error(new TomlError("Can't redefine an existing key"));
|
|
36878
|
-
}
|
|
36879
|
-
return this.next(this.parseListEnd);
|
|
36880
|
-
} else if (this.char === CHAR_PERIOD) {
|
|
36881
|
-
if (!hasKey(this.ctx, keyword)) {
|
|
36882
|
-
this.ctx = this.ctx[keyword] = Table();
|
|
36883
|
-
} else if (isInlineList(this.ctx[keyword])) {
|
|
36884
|
-
throw this.error(new TomlError("Can't extend an inline array"));
|
|
36885
|
-
} else if (isInlineTable(this.ctx[keyword])) {
|
|
36886
|
-
throw this.error(new TomlError("Can't extend an inline table"));
|
|
36887
|
-
} else if (isList(this.ctx[keyword])) {
|
|
36888
|
-
this.ctx = this.ctx[keyword][this.ctx[keyword].length - 1];
|
|
36889
|
-
} else if (isTable(this.ctx[keyword])) {
|
|
36890
|
-
this.ctx = this.ctx[keyword];
|
|
36891
|
-
} else {
|
|
36892
|
-
throw this.error(new TomlError("Can't redefine an existing key"));
|
|
36893
|
-
}
|
|
36894
|
-
return this.next(this.parseListNext);
|
|
36895
|
-
} else {
|
|
36896
|
-
throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
36897
|
-
}
|
|
36898
|
-
}
|
|
36899
|
-
parseListEnd(keyword) {
|
|
36900
|
-
if (this.char === CHAR_RSQB) {
|
|
36901
|
-
return this.next(this.parseWhitespaceToEOL);
|
|
36902
|
-
} else {
|
|
36903
|
-
throw this.error(new TomlError("Unexpected character, expected whitespace, . or ]"));
|
|
36904
|
-
}
|
|
36905
|
-
}
|
|
36906
|
-
/* VALUE string, number, boolean, inline list, inline object */
|
|
36907
|
-
parseValue() {
|
|
36908
|
-
if (this.char === Parser2.END) {
|
|
36909
|
-
throw this.error(new TomlError("Key without value"));
|
|
36910
|
-
} else if (this.char === CHAR_QUOT) {
|
|
36911
|
-
return this.next(this.parseDoubleString);
|
|
36912
|
-
}
|
|
36913
|
-
if (this.char === CHAR_APOS) {
|
|
36914
|
-
return this.next(this.parseSingleString);
|
|
36915
|
-
} else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
|
|
36916
|
-
return this.goto(this.parseNumberSign);
|
|
36917
|
-
} else if (this.char === CHAR_i) {
|
|
36918
|
-
return this.next(this.parseInf);
|
|
36919
|
-
} else if (this.char === CHAR_n) {
|
|
36920
|
-
return this.next(this.parseNan);
|
|
36921
|
-
} else if (isDigit(this.char)) {
|
|
36922
|
-
return this.goto(this.parseNumberOrDateTime);
|
|
36923
|
-
} else if (this.char === CHAR_t || this.char === CHAR_f) {
|
|
36924
|
-
return this.goto(this.parseBoolean);
|
|
36925
|
-
} else if (this.char === CHAR_LSQB) {
|
|
36926
|
-
return this.call(this.parseInlineList, this.recordValue);
|
|
36927
|
-
} else if (this.char === CHAR_LCUB) {
|
|
36928
|
-
return this.call(this.parseInlineTable, this.recordValue);
|
|
36929
|
-
} else {
|
|
36930
|
-
throw this.error(new TomlError("Unexpected character, expecting string, number, datetime, boolean, inline array or inline table"));
|
|
36931
|
-
}
|
|
36932
|
-
}
|
|
36933
|
-
recordValue(value) {
|
|
36934
|
-
return this.returnNow(value);
|
|
36935
|
-
}
|
|
36936
|
-
parseInf() {
|
|
36937
|
-
if (this.char === CHAR_n) {
|
|
36938
|
-
return this.next(this.parseInf2);
|
|
36939
|
-
} else {
|
|
36940
|
-
throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
|
|
36941
|
-
}
|
|
36942
|
-
}
|
|
36943
|
-
parseInf2() {
|
|
36944
|
-
if (this.char === CHAR_f) {
|
|
36945
|
-
if (this.state.buf === "-") {
|
|
36946
|
-
return this.return(-Infinity);
|
|
36947
|
-
} else {
|
|
36948
|
-
return this.return(Infinity);
|
|
36949
|
-
}
|
|
36950
|
-
} else {
|
|
36951
|
-
throw this.error(new TomlError('Unexpected character, expected "inf", "+inf" or "-inf"'));
|
|
36952
|
-
}
|
|
36953
|
-
}
|
|
36954
|
-
parseNan() {
|
|
36955
|
-
if (this.char === CHAR_a) {
|
|
36956
|
-
return this.next(this.parseNan2);
|
|
36957
|
-
} else {
|
|
36958
|
-
throw this.error(new TomlError('Unexpected character, expected "nan"'));
|
|
36959
|
-
}
|
|
36960
|
-
}
|
|
36961
|
-
parseNan2() {
|
|
36962
|
-
if (this.char === CHAR_n) {
|
|
36963
|
-
return this.return(NaN);
|
|
36964
|
-
} else {
|
|
36965
|
-
throw this.error(new TomlError('Unexpected character, expected "nan"'));
|
|
36966
|
-
}
|
|
36967
|
-
}
|
|
36968
|
-
/* KEYS, barewords or basic, literal, or dotted */
|
|
36969
|
-
parseKeyword() {
|
|
36970
|
-
if (this.char === CHAR_QUOT) {
|
|
36971
|
-
return this.next(this.parseBasicString);
|
|
36972
|
-
} else if (this.char === CHAR_APOS) {
|
|
36973
|
-
return this.next(this.parseLiteralString);
|
|
36974
|
-
} else {
|
|
36975
|
-
return this.goto(this.parseBareKey);
|
|
36976
|
-
}
|
|
36977
|
-
}
|
|
36978
|
-
/* KEYS: barewords */
|
|
36979
|
-
parseBareKey() {
|
|
36980
|
-
do {
|
|
36981
|
-
if (this.char === Parser2.END) {
|
|
36982
|
-
throw this.error(new TomlError("Key ended without value"));
|
|
36983
|
-
} else if (isAlphaNumHyphen(this.char)) {
|
|
36984
|
-
this.consume();
|
|
36985
|
-
} else if (this.state.buf.length === 0) {
|
|
36986
|
-
throw this.error(new TomlError("Empty bare keys are not allowed"));
|
|
36987
|
-
} else {
|
|
36988
|
-
return this.returnNow();
|
|
36989
|
-
}
|
|
36990
|
-
} while (this.nextChar());
|
|
36991
|
-
}
|
|
36992
|
-
/* STRINGS, single quoted (literal) */
|
|
36993
|
-
parseSingleString() {
|
|
36994
|
-
if (this.char === CHAR_APOS) {
|
|
36995
|
-
return this.next(this.parseLiteralMultiStringMaybe);
|
|
36996
|
-
} else {
|
|
36997
|
-
return this.goto(this.parseLiteralString);
|
|
36998
|
-
}
|
|
36999
|
-
}
|
|
37000
|
-
parseLiteralString() {
|
|
37001
|
-
do {
|
|
37002
|
-
if (this.char === CHAR_APOS) {
|
|
37003
|
-
return this.return();
|
|
37004
|
-
} else if (this.atEndOfLine()) {
|
|
37005
|
-
throw this.error(new TomlError("Unterminated string"));
|
|
37006
|
-
} else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
|
|
37007
|
-
throw this.errorControlCharIn("strings");
|
|
37008
|
-
} else {
|
|
37009
|
-
this.consume();
|
|
37010
|
-
}
|
|
37011
|
-
} while (this.nextChar());
|
|
37012
|
-
}
|
|
37013
|
-
parseLiteralMultiStringMaybe() {
|
|
37014
|
-
if (this.char === CHAR_APOS) {
|
|
37015
|
-
return this.next(this.parseLiteralMultiString);
|
|
37016
|
-
} else {
|
|
37017
|
-
return this.returnNow();
|
|
37018
|
-
}
|
|
37019
|
-
}
|
|
37020
|
-
parseLiteralMultiString() {
|
|
37021
|
-
if (this.char === CTRL_M) {
|
|
37022
|
-
return null;
|
|
37023
|
-
} else if (this.char === CTRL_J) {
|
|
37024
|
-
return this.next(this.parseLiteralMultiStringContent);
|
|
37025
|
-
} else {
|
|
37026
|
-
return this.goto(this.parseLiteralMultiStringContent);
|
|
37027
|
-
}
|
|
37028
|
-
}
|
|
37029
|
-
parseLiteralMultiStringContent() {
|
|
37030
|
-
do {
|
|
37031
|
-
if (this.char === CHAR_APOS) {
|
|
37032
|
-
return this.next(this.parseLiteralMultiEnd);
|
|
37033
|
-
} else if (this.char === Parser2.END) {
|
|
37034
|
-
throw this.error(new TomlError("Unterminated multi-line string"));
|
|
37035
|
-
} else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
|
|
37036
|
-
throw this.errorControlCharIn("strings");
|
|
37037
|
-
} else {
|
|
37038
|
-
this.consume();
|
|
37039
|
-
}
|
|
37040
|
-
} while (this.nextChar());
|
|
37041
|
-
}
|
|
37042
|
-
parseLiteralMultiEnd() {
|
|
37043
|
-
if (this.char === CHAR_APOS) {
|
|
37044
|
-
return this.next(this.parseLiteralMultiEnd2);
|
|
37045
|
-
} else {
|
|
37046
|
-
this.state.buf += "'";
|
|
37047
|
-
return this.goto(this.parseLiteralMultiStringContent);
|
|
37048
|
-
}
|
|
37049
|
-
}
|
|
37050
|
-
parseLiteralMultiEnd2() {
|
|
37051
|
-
if (this.char === CHAR_APOS) {
|
|
37052
|
-
return this.next(this.parseLiteralMultiEnd3);
|
|
37053
|
-
} else {
|
|
37054
|
-
this.state.buf += "''";
|
|
37055
|
-
return this.goto(this.parseLiteralMultiStringContent);
|
|
37056
|
-
}
|
|
37057
|
-
}
|
|
37058
|
-
parseLiteralMultiEnd3() {
|
|
37059
|
-
if (this.char === CHAR_APOS) {
|
|
37060
|
-
this.state.buf += "'";
|
|
37061
|
-
return this.next(this.parseLiteralMultiEnd4);
|
|
37062
|
-
} else {
|
|
37063
|
-
return this.returnNow();
|
|
37064
|
-
}
|
|
37065
|
-
}
|
|
37066
|
-
parseLiteralMultiEnd4() {
|
|
37067
|
-
if (this.char === CHAR_APOS) {
|
|
37068
|
-
this.state.buf += "'";
|
|
37069
|
-
return this.return();
|
|
37070
|
-
} else {
|
|
37071
|
-
return this.returnNow();
|
|
37072
|
-
}
|
|
37073
|
-
}
|
|
37074
|
-
/* STRINGS double quoted */
|
|
37075
|
-
parseDoubleString() {
|
|
37076
|
-
if (this.char === CHAR_QUOT) {
|
|
37077
|
-
return this.next(this.parseMultiStringMaybe);
|
|
37078
|
-
} else {
|
|
37079
|
-
return this.goto(this.parseBasicString);
|
|
37080
|
-
}
|
|
37081
|
-
}
|
|
37082
|
-
parseBasicString() {
|
|
37083
|
-
do {
|
|
37084
|
-
if (this.char === CHAR_BSOL) {
|
|
37085
|
-
return this.call(this.parseEscape, this.recordEscapeReplacement);
|
|
37086
|
-
} else if (this.char === CHAR_QUOT) {
|
|
37087
|
-
return this.return();
|
|
37088
|
-
} else if (this.atEndOfLine()) {
|
|
37089
|
-
throw this.error(new TomlError("Unterminated string"));
|
|
37090
|
-
} else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I) {
|
|
37091
|
-
throw this.errorControlCharIn("strings");
|
|
37092
|
-
} else {
|
|
37093
|
-
this.consume();
|
|
37094
|
-
}
|
|
37095
|
-
} while (this.nextChar());
|
|
37096
|
-
}
|
|
37097
|
-
recordEscapeReplacement(replacement) {
|
|
37098
|
-
this.state.buf += replacement;
|
|
37099
|
-
return this.goto(this.parseBasicString);
|
|
37100
|
-
}
|
|
37101
|
-
parseMultiStringMaybe() {
|
|
37102
|
-
if (this.char === CHAR_QUOT) {
|
|
37103
|
-
return this.next(this.parseMultiString);
|
|
37104
|
-
} else {
|
|
37105
|
-
return this.returnNow();
|
|
37106
|
-
}
|
|
37107
|
-
}
|
|
37108
|
-
parseMultiString() {
|
|
37109
|
-
if (this.char === CTRL_M) {
|
|
37110
|
-
return null;
|
|
37111
|
-
} else if (this.char === CTRL_J) {
|
|
37112
|
-
return this.next(this.parseMultiStringContent);
|
|
37113
|
-
} else {
|
|
37114
|
-
return this.goto(this.parseMultiStringContent);
|
|
37115
|
-
}
|
|
37116
|
-
}
|
|
37117
|
-
parseMultiStringContent() {
|
|
37118
|
-
do {
|
|
37119
|
-
if (this.char === CHAR_BSOL) {
|
|
37120
|
-
return this.call(this.parseMultiEscape, this.recordMultiEscapeReplacement);
|
|
37121
|
-
} else if (this.char === CHAR_QUOT) {
|
|
37122
|
-
return this.next(this.parseMultiEnd);
|
|
37123
|
-
} else if (this.char === Parser2.END) {
|
|
37124
|
-
throw this.error(new TomlError("Unterminated multi-line string"));
|
|
37125
|
-
} else if (this.char === CHAR_DEL || this.char <= CTRL_CHAR_BOUNDARY && this.char !== CTRL_I && this.char !== CTRL_J && this.char !== CTRL_M) {
|
|
37126
|
-
throw this.errorControlCharIn("strings");
|
|
37127
|
-
} else {
|
|
37128
|
-
this.consume();
|
|
37129
|
-
}
|
|
37130
|
-
} while (this.nextChar());
|
|
37131
|
-
}
|
|
37132
|
-
errorControlCharIn(type) {
|
|
37133
|
-
let displayCode = "\\u00";
|
|
37134
|
-
if (this.char < 16) {
|
|
37135
|
-
displayCode += "0";
|
|
37136
|
-
}
|
|
37137
|
-
displayCode += this.char.toString(16);
|
|
37138
|
-
return this.error(new TomlError(`Control characters (codes < 0x1f and 0x7f) are not allowed in ${type}, use ${displayCode} instead`));
|
|
37139
|
-
}
|
|
37140
|
-
recordMultiEscapeReplacement(replacement) {
|
|
37141
|
-
this.state.buf += replacement;
|
|
37142
|
-
return this.goto(this.parseMultiStringContent);
|
|
37143
|
-
}
|
|
37144
|
-
parseMultiEnd() {
|
|
37145
|
-
if (this.char === CHAR_QUOT) {
|
|
37146
|
-
return this.next(this.parseMultiEnd2);
|
|
37147
|
-
} else {
|
|
37148
|
-
this.state.buf += '"';
|
|
37149
|
-
return this.goto(this.parseMultiStringContent);
|
|
37150
|
-
}
|
|
37151
|
-
}
|
|
37152
|
-
parseMultiEnd2() {
|
|
37153
|
-
if (this.char === CHAR_QUOT) {
|
|
37154
|
-
return this.next(this.parseMultiEnd3);
|
|
37155
|
-
} else {
|
|
37156
|
-
this.state.buf += '""';
|
|
37157
|
-
return this.goto(this.parseMultiStringContent);
|
|
37158
|
-
}
|
|
37159
|
-
}
|
|
37160
|
-
parseMultiEnd3() {
|
|
37161
|
-
if (this.char === CHAR_QUOT) {
|
|
37162
|
-
this.state.buf += '"';
|
|
37163
|
-
return this.next(this.parseMultiEnd4);
|
|
37164
|
-
} else {
|
|
37165
|
-
return this.returnNow();
|
|
37166
|
-
}
|
|
37167
|
-
}
|
|
37168
|
-
parseMultiEnd4() {
|
|
37169
|
-
if (this.char === CHAR_QUOT) {
|
|
37170
|
-
this.state.buf += '"';
|
|
37171
|
-
return this.return();
|
|
37172
|
-
} else {
|
|
37173
|
-
return this.returnNow();
|
|
37174
|
-
}
|
|
37175
|
-
}
|
|
37176
|
-
parseMultiEscape() {
|
|
37177
|
-
if (this.char === CTRL_M || this.char === CTRL_J) {
|
|
37178
|
-
return this.next(this.parseMultiTrim);
|
|
37179
|
-
} else if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
37180
|
-
return this.next(this.parsePreMultiTrim);
|
|
37181
|
-
} else {
|
|
37182
|
-
return this.goto(this.parseEscape);
|
|
37183
|
-
}
|
|
37184
|
-
}
|
|
37185
|
-
parsePreMultiTrim() {
|
|
37186
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
37187
|
-
return null;
|
|
37188
|
-
} else if (this.char === CTRL_M || this.char === CTRL_J) {
|
|
37189
|
-
return this.next(this.parseMultiTrim);
|
|
37190
|
-
} else {
|
|
37191
|
-
throw this.error(new TomlError("Can't escape whitespace"));
|
|
37192
|
-
}
|
|
37193
|
-
}
|
|
37194
|
-
parseMultiTrim() {
|
|
37195
|
-
if (this.char === CTRL_J || this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M) {
|
|
37196
|
-
return null;
|
|
37197
|
-
} else {
|
|
37198
|
-
return this.returnNow();
|
|
37199
|
-
}
|
|
37200
|
-
}
|
|
37201
|
-
parseEscape() {
|
|
37202
|
-
if (this.char in escapes) {
|
|
37203
|
-
return this.return(escapes[this.char]);
|
|
37204
|
-
} else if (this.char === CHAR_u) {
|
|
37205
|
-
return this.call(this.parseSmallUnicode, this.parseUnicodeReturn);
|
|
37206
|
-
} else if (this.char === CHAR_U) {
|
|
37207
|
-
return this.call(this.parseLargeUnicode, this.parseUnicodeReturn);
|
|
37208
|
-
} else {
|
|
37209
|
-
throw this.error(new TomlError("Unknown escape character: " + this.char));
|
|
37210
|
-
}
|
|
37211
|
-
}
|
|
37212
|
-
parseUnicodeReturn(char) {
|
|
37213
|
-
try {
|
|
37214
|
-
const codePoint = parseInt(char, 16);
|
|
37215
|
-
if (codePoint >= SURROGATE_FIRST && codePoint <= SURROGATE_LAST) {
|
|
37216
|
-
throw this.error(new TomlError("Invalid unicode, character in range 0xD800 - 0xDFFF is reserved"));
|
|
37217
|
-
}
|
|
37218
|
-
return this.returnNow(String.fromCodePoint(codePoint));
|
|
37219
|
-
} catch (err) {
|
|
37220
|
-
throw this.error(TomlError.wrap(err));
|
|
37221
|
-
}
|
|
37222
|
-
}
|
|
37223
|
-
parseSmallUnicode() {
|
|
37224
|
-
if (!isHexit(this.char)) {
|
|
37225
|
-
throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
|
|
37226
|
-
} else {
|
|
37227
|
-
this.consume();
|
|
37228
|
-
if (this.state.buf.length >= 4) return this.return();
|
|
37229
|
-
}
|
|
37230
|
-
}
|
|
37231
|
-
parseLargeUnicode() {
|
|
37232
|
-
if (!isHexit(this.char)) {
|
|
37233
|
-
throw this.error(new TomlError("Invalid character in unicode sequence, expected hex"));
|
|
37234
|
-
} else {
|
|
37235
|
-
this.consume();
|
|
37236
|
-
if (this.state.buf.length >= 8) return this.return();
|
|
37237
|
-
}
|
|
37238
|
-
}
|
|
37239
|
-
/* NUMBERS */
|
|
37240
|
-
parseNumberSign() {
|
|
37241
|
-
this.consume();
|
|
37242
|
-
return this.next(this.parseMaybeSignedInfOrNan);
|
|
37243
|
-
}
|
|
37244
|
-
parseMaybeSignedInfOrNan() {
|
|
37245
|
-
if (this.char === CHAR_i) {
|
|
37246
|
-
return this.next(this.parseInf);
|
|
37247
|
-
} else if (this.char === CHAR_n) {
|
|
37248
|
-
return this.next(this.parseNan);
|
|
37249
|
-
} else {
|
|
37250
|
-
return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart);
|
|
37251
|
-
}
|
|
37252
|
-
}
|
|
37253
|
-
parseNumberIntegerStart() {
|
|
37254
|
-
if (this.char === CHAR_0) {
|
|
37255
|
-
this.consume();
|
|
37256
|
-
return this.next(this.parseNumberIntegerExponentOrDecimal);
|
|
37257
|
-
} else {
|
|
37258
|
-
return this.goto(this.parseNumberInteger);
|
|
37259
|
-
}
|
|
37260
|
-
}
|
|
37261
|
-
parseNumberIntegerExponentOrDecimal() {
|
|
37262
|
-
if (this.char === CHAR_PERIOD) {
|
|
37263
|
-
this.consume();
|
|
37264
|
-
return this.call(this.parseNoUnder, this.parseNumberFloat);
|
|
37265
|
-
} else if (this.char === CHAR_E || this.char === CHAR_e) {
|
|
37266
|
-
this.consume();
|
|
37267
|
-
return this.next(this.parseNumberExponentSign);
|
|
37268
|
-
} else {
|
|
37269
|
-
return this.returnNow(Integer(this.state.buf));
|
|
37270
|
-
}
|
|
37271
|
-
}
|
|
37272
|
-
parseNumberInteger() {
|
|
37273
|
-
if (isDigit(this.char)) {
|
|
37274
|
-
this.consume();
|
|
37275
|
-
} else if (this.char === CHAR_LOWBAR) {
|
|
37276
|
-
return this.call(this.parseNoUnder);
|
|
37277
|
-
} else if (this.char === CHAR_E || this.char === CHAR_e) {
|
|
37278
|
-
this.consume();
|
|
37279
|
-
return this.next(this.parseNumberExponentSign);
|
|
37280
|
-
} else if (this.char === CHAR_PERIOD) {
|
|
37281
|
-
this.consume();
|
|
37282
|
-
return this.call(this.parseNoUnder, this.parseNumberFloat);
|
|
37283
|
-
} else {
|
|
37284
|
-
const result = Integer(this.state.buf);
|
|
37285
|
-
if (result.isNaN()) {
|
|
37286
|
-
throw this.error(new TomlError("Invalid number"));
|
|
37287
|
-
} else {
|
|
37288
|
-
return this.returnNow(result);
|
|
37289
|
-
}
|
|
37290
|
-
}
|
|
37291
|
-
}
|
|
37292
|
-
parseNoUnder() {
|
|
37293
|
-
if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {
|
|
37294
|
-
throw this.error(new TomlError("Unexpected character, expected digit"));
|
|
37295
|
-
} else if (this.atEndOfWord()) {
|
|
37296
|
-
throw this.error(new TomlError("Incomplete number"));
|
|
37297
|
-
}
|
|
37298
|
-
return this.returnNow();
|
|
37299
|
-
}
|
|
37300
|
-
parseNoUnderHexOctBinLiteral() {
|
|
37301
|
-
if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD) {
|
|
37302
|
-
throw this.error(new TomlError("Unexpected character, expected digit"));
|
|
37303
|
-
} else if (this.atEndOfWord()) {
|
|
37304
|
-
throw this.error(new TomlError("Incomplete number"));
|
|
37305
|
-
}
|
|
37306
|
-
return this.returnNow();
|
|
37307
|
-
}
|
|
37308
|
-
parseNumberFloat() {
|
|
37309
|
-
if (this.char === CHAR_LOWBAR) {
|
|
37310
|
-
return this.call(this.parseNoUnder, this.parseNumberFloat);
|
|
37311
|
-
} else if (isDigit(this.char)) {
|
|
37312
|
-
this.consume();
|
|
37313
|
-
} else if (this.char === CHAR_E || this.char === CHAR_e) {
|
|
37314
|
-
this.consume();
|
|
37315
|
-
return this.next(this.parseNumberExponentSign);
|
|
37316
|
-
} else {
|
|
37317
|
-
return this.returnNow(Float(this.state.buf));
|
|
37318
|
-
}
|
|
37319
|
-
}
|
|
37320
|
-
parseNumberExponentSign() {
|
|
37321
|
-
if (isDigit(this.char)) {
|
|
37322
|
-
return this.goto(this.parseNumberExponent);
|
|
37323
|
-
} else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
|
|
37324
|
-
this.consume();
|
|
37325
|
-
this.call(this.parseNoUnder, this.parseNumberExponent);
|
|
37326
|
-
} else {
|
|
37327
|
-
throw this.error(new TomlError("Unexpected character, expected -, + or digit"));
|
|
37328
|
-
}
|
|
37329
|
-
}
|
|
37330
|
-
parseNumberExponent() {
|
|
37331
|
-
if (isDigit(this.char)) {
|
|
37332
|
-
this.consume();
|
|
37333
|
-
} else if (this.char === CHAR_LOWBAR) {
|
|
37334
|
-
return this.call(this.parseNoUnder);
|
|
37335
|
-
} else {
|
|
37336
|
-
return this.returnNow(Float(this.state.buf));
|
|
37337
|
-
}
|
|
37338
|
-
}
|
|
37339
|
-
/* NUMBERS or DATETIMES */
|
|
37340
|
-
parseNumberOrDateTime() {
|
|
37341
|
-
if (this.char === CHAR_0) {
|
|
37342
|
-
this.consume();
|
|
37343
|
-
return this.next(this.parseNumberBaseOrDateTime);
|
|
37344
|
-
} else {
|
|
37345
|
-
return this.goto(this.parseNumberOrDateTimeOnly);
|
|
37346
|
-
}
|
|
37347
|
-
}
|
|
37348
|
-
parseNumberOrDateTimeOnly() {
|
|
37349
|
-
if (this.char === CHAR_LOWBAR) {
|
|
37350
|
-
return this.call(this.parseNoUnder, this.parseNumberInteger);
|
|
37351
|
-
} else if (isDigit(this.char)) {
|
|
37352
|
-
this.consume();
|
|
37353
|
-
if (this.state.buf.length > 4) this.next(this.parseNumberInteger);
|
|
37354
|
-
} else if (this.char === CHAR_E || this.char === CHAR_e) {
|
|
37355
|
-
this.consume();
|
|
37356
|
-
return this.next(this.parseNumberExponentSign);
|
|
37357
|
-
} else if (this.char === CHAR_PERIOD) {
|
|
37358
|
-
this.consume();
|
|
37359
|
-
return this.call(this.parseNoUnder, this.parseNumberFloat);
|
|
37360
|
-
} else if (this.char === CHAR_HYPHEN) {
|
|
37361
|
-
return this.goto(this.parseDateTime);
|
|
37362
|
-
} else if (this.char === CHAR_COLON) {
|
|
37363
|
-
return this.goto(this.parseOnlyTimeHour);
|
|
37364
|
-
} else {
|
|
37365
|
-
return this.returnNow(Integer(this.state.buf));
|
|
37366
|
-
}
|
|
37367
|
-
}
|
|
37368
|
-
parseDateTimeOnly() {
|
|
37369
|
-
if (this.state.buf.length < 4) {
|
|
37370
|
-
if (isDigit(this.char)) {
|
|
37371
|
-
return this.consume();
|
|
37372
|
-
} else if (this.char === CHAR_COLON) {
|
|
37373
|
-
return this.goto(this.parseOnlyTimeHour);
|
|
37374
|
-
} else {
|
|
37375
|
-
throw this.error(new TomlError("Expected digit while parsing year part of a date"));
|
|
37376
|
-
}
|
|
37377
|
-
} else {
|
|
37378
|
-
if (this.char === CHAR_HYPHEN) {
|
|
37379
|
-
return this.goto(this.parseDateTime);
|
|
37380
|
-
} else {
|
|
37381
|
-
throw this.error(new TomlError("Expected hyphen (-) while parsing year part of date"));
|
|
37382
|
-
}
|
|
37383
|
-
}
|
|
37384
|
-
}
|
|
37385
|
-
parseNumberBaseOrDateTime() {
|
|
37386
|
-
if (this.char === CHAR_b) {
|
|
37387
|
-
this.consume();
|
|
37388
|
-
return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerBin);
|
|
37389
|
-
} else if (this.char === CHAR_o) {
|
|
37390
|
-
this.consume();
|
|
37391
|
-
return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerOct);
|
|
37392
|
-
} else if (this.char === CHAR_x) {
|
|
37393
|
-
this.consume();
|
|
37394
|
-
return this.call(this.parseNoUnderHexOctBinLiteral, this.parseIntegerHex);
|
|
37395
|
-
} else if (this.char === CHAR_PERIOD) {
|
|
37396
|
-
return this.goto(this.parseNumberInteger);
|
|
37397
|
-
} else if (isDigit(this.char)) {
|
|
37398
|
-
return this.goto(this.parseDateTimeOnly);
|
|
37399
|
-
} else {
|
|
37400
|
-
return this.returnNow(Integer(this.state.buf));
|
|
37401
|
-
}
|
|
37402
|
-
}
|
|
37403
|
-
parseIntegerHex() {
|
|
37404
|
-
if (isHexit(this.char)) {
|
|
37405
|
-
this.consume();
|
|
37406
|
-
} else if (this.char === CHAR_LOWBAR) {
|
|
37407
|
-
return this.call(this.parseNoUnderHexOctBinLiteral);
|
|
37408
|
-
} else {
|
|
37409
|
-
const result = Integer(this.state.buf);
|
|
37410
|
-
if (result.isNaN()) {
|
|
37411
|
-
throw this.error(new TomlError("Invalid number"));
|
|
37412
|
-
} else {
|
|
37413
|
-
return this.returnNow(result);
|
|
37414
|
-
}
|
|
37415
|
-
}
|
|
37416
|
-
}
|
|
37417
|
-
parseIntegerOct() {
|
|
37418
|
-
if (isOctit(this.char)) {
|
|
37419
|
-
this.consume();
|
|
37420
|
-
} else if (this.char === CHAR_LOWBAR) {
|
|
37421
|
-
return this.call(this.parseNoUnderHexOctBinLiteral);
|
|
37422
|
-
} else {
|
|
37423
|
-
const result = Integer(this.state.buf);
|
|
37424
|
-
if (result.isNaN()) {
|
|
37425
|
-
throw this.error(new TomlError("Invalid number"));
|
|
37426
|
-
} else {
|
|
37427
|
-
return this.returnNow(result);
|
|
37428
|
-
}
|
|
37429
|
-
}
|
|
37430
|
-
}
|
|
37431
|
-
parseIntegerBin() {
|
|
37432
|
-
if (isBit(this.char)) {
|
|
37433
|
-
this.consume();
|
|
37434
|
-
} else if (this.char === CHAR_LOWBAR) {
|
|
37435
|
-
return this.call(this.parseNoUnderHexOctBinLiteral);
|
|
37436
|
-
} else {
|
|
37437
|
-
const result = Integer(this.state.buf);
|
|
37438
|
-
if (result.isNaN()) {
|
|
37439
|
-
throw this.error(new TomlError("Invalid number"));
|
|
37440
|
-
} else {
|
|
37441
|
-
return this.returnNow(result);
|
|
37442
|
-
}
|
|
37443
|
-
}
|
|
37444
|
-
}
|
|
37445
|
-
/* DATETIME */
|
|
37446
|
-
parseDateTime() {
|
|
37447
|
-
if (this.state.buf.length < 4) {
|
|
37448
|
-
throw this.error(new TomlError("Years less than 1000 must be zero padded to four characters"));
|
|
37449
|
-
}
|
|
37450
|
-
this.state.result = this.state.buf;
|
|
37451
|
-
this.state.buf = "";
|
|
37452
|
-
return this.next(this.parseDateMonth);
|
|
37453
|
-
}
|
|
37454
|
-
parseDateMonth() {
|
|
37455
|
-
if (this.char === CHAR_HYPHEN) {
|
|
37456
|
-
if (this.state.buf.length < 2) {
|
|
37457
|
-
throw this.error(new TomlError("Months less than 10 must be zero padded to two characters"));
|
|
37458
|
-
}
|
|
37459
|
-
this.state.result += "-" + this.state.buf;
|
|
37460
|
-
this.state.buf = "";
|
|
37461
|
-
return this.next(this.parseDateDay);
|
|
37462
|
-
} else if (isDigit(this.char)) {
|
|
37463
|
-
this.consume();
|
|
37464
|
-
} else {
|
|
37465
|
-
throw this.error(new TomlError("Incomplete datetime"));
|
|
37466
|
-
}
|
|
37467
|
-
}
|
|
37468
|
-
parseDateDay() {
|
|
37469
|
-
if (this.char === CHAR_T || this.char === CHAR_SP) {
|
|
37470
|
-
if (this.state.buf.length < 2) {
|
|
37471
|
-
throw this.error(new TomlError("Days less than 10 must be zero padded to two characters"));
|
|
37472
|
-
}
|
|
37473
|
-
this.state.result += "-" + this.state.buf;
|
|
37474
|
-
this.state.buf = "";
|
|
37475
|
-
return this.next(this.parseStartTimeHour);
|
|
37476
|
-
} else if (this.atEndOfWord()) {
|
|
37477
|
-
return this.returnNow(createDate(this.state.result + "-" + this.state.buf));
|
|
37478
|
-
} else if (isDigit(this.char)) {
|
|
37479
|
-
this.consume();
|
|
37480
|
-
} else {
|
|
37481
|
-
throw this.error(new TomlError("Incomplete datetime"));
|
|
37482
|
-
}
|
|
37483
|
-
}
|
|
37484
|
-
parseStartTimeHour() {
|
|
37485
|
-
if (this.atEndOfWord()) {
|
|
37486
|
-
return this.returnNow(createDate(this.state.result));
|
|
37487
|
-
} else {
|
|
37488
|
-
return this.goto(this.parseTimeHour);
|
|
37489
|
-
}
|
|
37490
|
-
}
|
|
37491
|
-
parseTimeHour() {
|
|
37492
|
-
if (this.char === CHAR_COLON) {
|
|
37493
|
-
if (this.state.buf.length < 2) {
|
|
37494
|
-
throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
|
|
37495
|
-
}
|
|
37496
|
-
this.state.result += "T" + this.state.buf;
|
|
37497
|
-
this.state.buf = "";
|
|
37498
|
-
return this.next(this.parseTimeMin);
|
|
37499
|
-
} else if (isDigit(this.char)) {
|
|
37500
|
-
this.consume();
|
|
37501
|
-
} else {
|
|
37502
|
-
throw this.error(new TomlError("Incomplete datetime"));
|
|
37503
|
-
}
|
|
37504
|
-
}
|
|
37505
|
-
parseTimeMin() {
|
|
37506
|
-
if (this.state.buf.length < 2 && isDigit(this.char)) {
|
|
37507
|
-
this.consume();
|
|
37508
|
-
} else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
|
|
37509
|
-
this.state.result += ":" + this.state.buf;
|
|
37510
|
-
this.state.buf = "";
|
|
37511
|
-
return this.next(this.parseTimeSec);
|
|
37512
|
-
} else {
|
|
37513
|
-
throw this.error(new TomlError("Incomplete datetime"));
|
|
37514
|
-
}
|
|
37515
|
-
}
|
|
37516
|
-
parseTimeSec() {
|
|
37517
|
-
if (isDigit(this.char)) {
|
|
37518
|
-
this.consume();
|
|
37519
|
-
if (this.state.buf.length === 2) {
|
|
37520
|
-
this.state.result += ":" + this.state.buf;
|
|
37521
|
-
this.state.buf = "";
|
|
37522
|
-
return this.next(this.parseTimeZoneOrFraction);
|
|
37523
|
-
}
|
|
37524
|
-
} else {
|
|
37525
|
-
throw this.error(new TomlError("Incomplete datetime"));
|
|
37526
|
-
}
|
|
37527
|
-
}
|
|
37528
|
-
parseOnlyTimeHour() {
|
|
37529
|
-
if (this.char === CHAR_COLON) {
|
|
37530
|
-
if (this.state.buf.length < 2) {
|
|
37531
|
-
throw this.error(new TomlError("Hours less than 10 must be zero padded to two characters"));
|
|
37532
|
-
}
|
|
37533
|
-
this.state.result = this.state.buf;
|
|
37534
|
-
this.state.buf = "";
|
|
37535
|
-
return this.next(this.parseOnlyTimeMin);
|
|
37536
|
-
} else {
|
|
37537
|
-
throw this.error(new TomlError("Incomplete time"));
|
|
37538
|
-
}
|
|
37539
|
-
}
|
|
37540
|
-
parseOnlyTimeMin() {
|
|
37541
|
-
if (this.state.buf.length < 2 && isDigit(this.char)) {
|
|
37542
|
-
this.consume();
|
|
37543
|
-
} else if (this.state.buf.length === 2 && this.char === CHAR_COLON) {
|
|
37544
|
-
this.state.result += ":" + this.state.buf;
|
|
37545
|
-
this.state.buf = "";
|
|
37546
|
-
return this.next(this.parseOnlyTimeSec);
|
|
37547
|
-
} else {
|
|
37548
|
-
throw this.error(new TomlError("Incomplete time"));
|
|
37549
|
-
}
|
|
37550
|
-
}
|
|
37551
|
-
parseOnlyTimeSec() {
|
|
37552
|
-
if (isDigit(this.char)) {
|
|
37553
|
-
this.consume();
|
|
37554
|
-
if (this.state.buf.length === 2) {
|
|
37555
|
-
return this.next(this.parseOnlyTimeFractionMaybe);
|
|
37556
|
-
}
|
|
37557
|
-
} else {
|
|
37558
|
-
throw this.error(new TomlError("Incomplete time"));
|
|
37559
|
-
}
|
|
37560
|
-
}
|
|
37561
|
-
parseOnlyTimeFractionMaybe() {
|
|
37562
|
-
this.state.result += ":" + this.state.buf;
|
|
37563
|
-
if (this.char === CHAR_PERIOD) {
|
|
37564
|
-
this.state.buf = "";
|
|
37565
|
-
this.next(this.parseOnlyTimeFraction);
|
|
37566
|
-
} else {
|
|
37567
|
-
return this.return(createTime(this.state.result));
|
|
37568
|
-
}
|
|
37569
|
-
}
|
|
37570
|
-
parseOnlyTimeFraction() {
|
|
37571
|
-
if (isDigit(this.char)) {
|
|
37572
|
-
this.consume();
|
|
37573
|
-
} else if (this.atEndOfWord()) {
|
|
37574
|
-
if (this.state.buf.length === 0) throw this.error(new TomlError("Expected digit in milliseconds"));
|
|
37575
|
-
return this.returnNow(createTime(this.state.result + "." + this.state.buf));
|
|
37576
|
-
} else {
|
|
37577
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
|
|
37578
|
-
}
|
|
37579
|
-
}
|
|
37580
|
-
parseTimeZoneOrFraction() {
|
|
37581
|
-
if (this.char === CHAR_PERIOD) {
|
|
37582
|
-
this.consume();
|
|
37583
|
-
this.next(this.parseDateTimeFraction);
|
|
37584
|
-
} else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
|
|
37585
|
-
this.consume();
|
|
37586
|
-
this.next(this.parseTimeZoneHour);
|
|
37587
|
-
} else if (this.char === CHAR_Z) {
|
|
37588
|
-
this.consume();
|
|
37589
|
-
return this.return(createDateTime(this.state.result + this.state.buf));
|
|
37590
|
-
} else if (this.atEndOfWord()) {
|
|
37591
|
-
return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
|
|
37592
|
-
} else {
|
|
37593
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
|
|
37594
|
-
}
|
|
37595
|
-
}
|
|
37596
|
-
parseDateTimeFraction() {
|
|
37597
|
-
if (isDigit(this.char)) {
|
|
37598
|
-
this.consume();
|
|
37599
|
-
} else if (this.state.buf.length === 1) {
|
|
37600
|
-
throw this.error(new TomlError("Expected digit in milliseconds"));
|
|
37601
|
-
} else if (this.char === CHAR_HYPHEN || this.char === CHAR_PLUS) {
|
|
37602
|
-
this.consume();
|
|
37603
|
-
this.next(this.parseTimeZoneHour);
|
|
37604
|
-
} else if (this.char === CHAR_Z) {
|
|
37605
|
-
this.consume();
|
|
37606
|
-
return this.return(createDateTime(this.state.result + this.state.buf));
|
|
37607
|
-
} else if (this.atEndOfWord()) {
|
|
37608
|
-
return this.returnNow(createDateTimeFloat(this.state.result + this.state.buf));
|
|
37609
|
-
} else {
|
|
37610
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected period (.), minus (-), plus (+) or Z"));
|
|
37611
|
-
}
|
|
37612
|
-
}
|
|
37613
|
-
parseTimeZoneHour() {
|
|
37614
|
-
if (isDigit(this.char)) {
|
|
37615
|
-
this.consume();
|
|
37616
|
-
if (/\d\d$/.test(this.state.buf)) return this.next(this.parseTimeZoneSep);
|
|
37617
|
-
} else {
|
|
37618
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
|
|
37619
|
-
}
|
|
37620
|
-
}
|
|
37621
|
-
parseTimeZoneSep() {
|
|
37622
|
-
if (this.char === CHAR_COLON) {
|
|
37623
|
-
this.consume();
|
|
37624
|
-
this.next(this.parseTimeZoneMin);
|
|
37625
|
-
} else {
|
|
37626
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected colon"));
|
|
37627
|
-
}
|
|
37628
|
-
}
|
|
37629
|
-
parseTimeZoneMin() {
|
|
37630
|
-
if (isDigit(this.char)) {
|
|
37631
|
-
this.consume();
|
|
37632
|
-
if (/\d\d$/.test(this.state.buf)) return this.return(createDateTime(this.state.result + this.state.buf));
|
|
37633
|
-
} else {
|
|
37634
|
-
throw this.error(new TomlError("Unexpected character in datetime, expected digit"));
|
|
37635
|
-
}
|
|
37636
|
-
}
|
|
37637
|
-
/* BOOLEAN */
|
|
37638
|
-
parseBoolean() {
|
|
37639
|
-
if (this.char === CHAR_t) {
|
|
37640
|
-
this.consume();
|
|
37641
|
-
return this.next(this.parseTrue_r);
|
|
37642
|
-
} else if (this.char === CHAR_f) {
|
|
37643
|
-
this.consume();
|
|
37644
|
-
return this.next(this.parseFalse_a);
|
|
37645
|
-
}
|
|
37646
|
-
}
|
|
37647
|
-
parseTrue_r() {
|
|
37648
|
-
if (this.char === CHAR_r) {
|
|
37649
|
-
this.consume();
|
|
37650
|
-
return this.next(this.parseTrue_u);
|
|
37651
|
-
} else {
|
|
37652
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37653
|
-
}
|
|
37654
|
-
}
|
|
37655
|
-
parseTrue_u() {
|
|
37656
|
-
if (this.char === CHAR_u) {
|
|
37657
|
-
this.consume();
|
|
37658
|
-
return this.next(this.parseTrue_e);
|
|
37659
|
-
} else {
|
|
37660
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37661
|
-
}
|
|
37662
|
-
}
|
|
37663
|
-
parseTrue_e() {
|
|
37664
|
-
if (this.char === CHAR_e) {
|
|
37665
|
-
return this.return(true);
|
|
37666
|
-
} else {
|
|
37667
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37668
|
-
}
|
|
37669
|
-
}
|
|
37670
|
-
parseFalse_a() {
|
|
37671
|
-
if (this.char === CHAR_a) {
|
|
37672
|
-
this.consume();
|
|
37673
|
-
return this.next(this.parseFalse_l);
|
|
37674
|
-
} else {
|
|
37675
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37676
|
-
}
|
|
37677
|
-
}
|
|
37678
|
-
parseFalse_l() {
|
|
37679
|
-
if (this.char === CHAR_l) {
|
|
37680
|
-
this.consume();
|
|
37681
|
-
return this.next(this.parseFalse_s);
|
|
37682
|
-
} else {
|
|
37683
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37684
|
-
}
|
|
37685
|
-
}
|
|
37686
|
-
parseFalse_s() {
|
|
37687
|
-
if (this.char === CHAR_s) {
|
|
37688
|
-
this.consume();
|
|
37689
|
-
return this.next(this.parseFalse_e);
|
|
37690
|
-
} else {
|
|
37691
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37692
|
-
}
|
|
37693
|
-
}
|
|
37694
|
-
parseFalse_e() {
|
|
37695
|
-
if (this.char === CHAR_e) {
|
|
37696
|
-
return this.return(false);
|
|
37697
|
-
} else {
|
|
37698
|
-
throw this.error(new TomlError("Invalid boolean, expected true or false"));
|
|
37699
|
-
}
|
|
37700
|
-
}
|
|
37701
|
-
/* INLINE LISTS */
|
|
37702
|
-
parseInlineList() {
|
|
37703
|
-
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
|
|
37704
|
-
return null;
|
|
37705
|
-
} else if (this.char === Parser2.END) {
|
|
37706
|
-
throw this.error(new TomlError("Unterminated inline array"));
|
|
37707
|
-
} else if (this.char === CHAR_NUM) {
|
|
37708
|
-
return this.call(this.parseComment);
|
|
37709
|
-
} else if (this.char === CHAR_RSQB) {
|
|
37710
|
-
return this.return(this.state.resultArr || InlineList());
|
|
37711
|
-
} else {
|
|
37712
|
-
return this.callNow(this.parseValue, this.recordInlineListValue);
|
|
37713
|
-
}
|
|
37714
|
-
}
|
|
37715
|
-
recordInlineListValue(value) {
|
|
37716
|
-
if (!this.state.resultArr) {
|
|
37717
|
-
this.state.resultArr = InlineList(tomlType(value));
|
|
37718
|
-
}
|
|
37719
|
-
if (isFloat(value) || isInteger(value)) {
|
|
37720
|
-
this.state.resultArr.push(value.valueOf());
|
|
37721
|
-
} else {
|
|
37722
|
-
this.state.resultArr.push(value);
|
|
37723
|
-
}
|
|
37724
|
-
return this.goto(this.parseInlineListNext);
|
|
37725
|
-
}
|
|
37726
|
-
parseInlineListNext() {
|
|
37727
|
-
if (this.char === CHAR_SP || this.char === CTRL_I || this.char === CTRL_M || this.char === CTRL_J) {
|
|
37728
|
-
return null;
|
|
37729
|
-
} else if (this.char === CHAR_NUM) {
|
|
37730
|
-
return this.call(this.parseComment);
|
|
37731
|
-
} else if (this.char === CHAR_COMMA) {
|
|
37732
|
-
return this.next(this.parseInlineList);
|
|
37733
|
-
} else if (this.char === CHAR_RSQB) {
|
|
37734
|
-
return this.goto(this.parseInlineList);
|
|
37735
|
-
} else {
|
|
37736
|
-
throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
|
|
37737
|
-
}
|
|
37738
|
-
}
|
|
37739
|
-
/* INLINE TABLE */
|
|
37740
|
-
parseInlineTable() {
|
|
37741
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
37742
|
-
return null;
|
|
37743
|
-
} else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
|
|
37744
|
-
throw this.error(new TomlError("Unterminated inline array"));
|
|
37745
|
-
} else if (this.char === CHAR_RCUB) {
|
|
37746
|
-
return this.return(this.state.resultTable || InlineTable());
|
|
37747
|
-
} else {
|
|
37748
|
-
if (!this.state.resultTable) this.state.resultTable = InlineTable();
|
|
37749
|
-
return this.callNow(this.parseAssign, this.recordInlineTableValue);
|
|
37750
|
-
}
|
|
37751
|
-
}
|
|
37752
|
-
recordInlineTableValue(kv) {
|
|
37753
|
-
let target = this.state.resultTable;
|
|
37754
|
-
let finalKey = kv.key.pop();
|
|
37755
|
-
for (let kw of kv.key) {
|
|
37756
|
-
if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
|
|
37757
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
37758
|
-
}
|
|
37759
|
-
target = target[kw] = target[kw] || Table();
|
|
37760
|
-
}
|
|
37761
|
-
if (hasKey(target, finalKey)) {
|
|
37762
|
-
throw this.error(new TomlError("Can't redefine existing key"));
|
|
37763
|
-
}
|
|
37764
|
-
if (isInteger(kv.value) || isFloat(kv.value)) {
|
|
37765
|
-
target[finalKey] = kv.value.valueOf();
|
|
37766
|
-
} else {
|
|
37767
|
-
target[finalKey] = kv.value;
|
|
37768
|
-
}
|
|
37769
|
-
return this.goto(this.parseInlineTableNext);
|
|
37770
|
-
}
|
|
37771
|
-
parseInlineTableNext() {
|
|
37772
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
37773
|
-
return null;
|
|
37774
|
-
} else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
|
|
37775
|
-
throw this.error(new TomlError("Unterminated inline array"));
|
|
37776
|
-
} else if (this.char === CHAR_COMMA) {
|
|
37777
|
-
return this.next(this.parseInlineTablePostComma);
|
|
37778
|
-
} else if (this.char === CHAR_RCUB) {
|
|
37779
|
-
return this.goto(this.parseInlineTable);
|
|
37780
|
-
} else {
|
|
37781
|
-
throw this.error(new TomlError("Invalid character, expected whitespace, comma (,) or close bracket (])"));
|
|
37782
|
-
}
|
|
37783
|
-
}
|
|
37784
|
-
parseInlineTablePostComma() {
|
|
37785
|
-
if (this.char === CHAR_SP || this.char === CTRL_I) {
|
|
37786
|
-
return null;
|
|
37787
|
-
} else if (this.char === Parser2.END || this.char === CHAR_NUM || this.char === CTRL_J || this.char === CTRL_M) {
|
|
37788
|
-
throw this.error(new TomlError("Unterminated inline array"));
|
|
37789
|
-
} else if (this.char === CHAR_COMMA) {
|
|
37790
|
-
throw this.error(new TomlError("Empty elements in inline tables are not permitted"));
|
|
37791
|
-
} else if (this.char === CHAR_RCUB) {
|
|
37792
|
-
throw this.error(new TomlError("Trailing commas in inline tables are not permitted"));
|
|
37793
|
-
} else {
|
|
37794
|
-
return this.goto(this.parseInlineTable);
|
|
37795
|
-
}
|
|
37796
|
-
}
|
|
37797
|
-
}
|
|
37798
|
-
return TOMLParser;
|
|
37799
|
-
}
|
|
37800
|
-
}
|
|
37801
|
-
});
|
|
37802
|
-
|
|
37803
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js
|
|
37804
|
-
var require_parse_pretty_error = __commonJS({
|
|
37805
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-pretty-error.js"(exports2, module2) {
|
|
37806
|
-
"use strict";
|
|
37807
|
-
module2.exports = prettyError;
|
|
37808
|
-
function prettyError(err, buf) {
|
|
37809
|
-
if (err.pos == null || err.line == null) return err;
|
|
37810
|
-
let msg = err.message;
|
|
37811
|
-
msg += ` at row ${err.line + 1}, col ${err.col + 1}, pos ${err.pos}:
|
|
37812
|
-
`;
|
|
37813
|
-
if (buf && buf.split) {
|
|
37814
|
-
const lines = buf.split(/\n/);
|
|
37815
|
-
const lineNumWidth = String(Math.min(lines.length, err.line + 3)).length;
|
|
37816
|
-
let linePadding = " ";
|
|
37817
|
-
while (linePadding.length < lineNumWidth) linePadding += " ";
|
|
37818
|
-
for (let ii = Math.max(0, err.line - 1); ii < Math.min(lines.length, err.line + 2); ++ii) {
|
|
37819
|
-
let lineNum = String(ii + 1);
|
|
37820
|
-
if (lineNum.length < lineNumWidth) lineNum = " " + lineNum;
|
|
37821
|
-
if (err.line === ii) {
|
|
37822
|
-
msg += lineNum + "> " + lines[ii] + "\n";
|
|
37823
|
-
msg += linePadding + " ";
|
|
37824
|
-
for (let hh = 0; hh < err.col; ++hh) {
|
|
37825
|
-
msg += " ";
|
|
37826
|
-
}
|
|
37827
|
-
msg += "^\n";
|
|
37828
|
-
} else {
|
|
37829
|
-
msg += lineNum + ": " + lines[ii] + "\n";
|
|
37830
|
-
}
|
|
37831
|
-
}
|
|
37832
|
-
}
|
|
37833
|
-
err.message = msg + "\n";
|
|
37834
|
-
return err;
|
|
37835
|
-
}
|
|
37836
|
-
}
|
|
37837
|
-
});
|
|
37838
|
-
|
|
37839
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js
|
|
37840
|
-
var require_parse_string = __commonJS({
|
|
37841
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-string.js"(exports2, module2) {
|
|
37842
|
-
"use strict";
|
|
37843
|
-
module2.exports = parseString;
|
|
37844
|
-
var TOMLParser = require_toml_parser();
|
|
37845
|
-
var prettyError = require_parse_pretty_error();
|
|
37846
|
-
function parseString(str) {
|
|
37847
|
-
if (global.Buffer && global.Buffer.isBuffer(str)) {
|
|
37848
|
-
str = str.toString("utf8");
|
|
37849
|
-
}
|
|
37850
|
-
const parser2 = new TOMLParser();
|
|
37851
|
-
try {
|
|
37852
|
-
parser2.parse(str);
|
|
37853
|
-
return parser2.finish();
|
|
37854
|
-
} catch (err) {
|
|
37855
|
-
throw prettyError(err, str);
|
|
37856
|
-
}
|
|
37857
|
-
}
|
|
37858
|
-
}
|
|
37859
|
-
});
|
|
37860
|
-
|
|
37861
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js
|
|
37862
|
-
var require_parse_async = __commonJS({
|
|
37863
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-async.js"(exports2, module2) {
|
|
37864
|
-
"use strict";
|
|
37865
|
-
module2.exports = parseAsync;
|
|
37866
|
-
var TOMLParser = require_toml_parser();
|
|
37867
|
-
var prettyError = require_parse_pretty_error();
|
|
37868
|
-
function parseAsync(str, opts) {
|
|
37869
|
-
if (!opts) opts = {};
|
|
37870
|
-
const index = 0;
|
|
37871
|
-
const blocksize = opts.blocksize || 40960;
|
|
37872
|
-
const parser2 = new TOMLParser();
|
|
37873
|
-
return new Promise((resolve12, reject) => {
|
|
37874
|
-
setImmediate(parseAsyncNext, index, blocksize, resolve12, reject);
|
|
37875
|
-
});
|
|
37876
|
-
function parseAsyncNext(index2, blocksize2, resolve12, reject) {
|
|
37877
|
-
if (index2 >= str.length) {
|
|
37878
|
-
try {
|
|
37879
|
-
return resolve12(parser2.finish());
|
|
37880
|
-
} catch (err) {
|
|
37881
|
-
return reject(prettyError(err, str));
|
|
37882
|
-
}
|
|
37883
|
-
}
|
|
37884
|
-
try {
|
|
37885
|
-
parser2.parse(str.slice(index2, index2 + blocksize2));
|
|
37886
|
-
setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve12, reject);
|
|
37887
|
-
} catch (err) {
|
|
37888
|
-
reject(prettyError(err, str));
|
|
37889
|
-
}
|
|
37890
|
-
}
|
|
37891
|
-
}
|
|
37892
|
-
}
|
|
37893
|
-
});
|
|
37894
|
-
|
|
37895
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js
|
|
37896
|
-
var require_parse_stream = __commonJS({
|
|
37897
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse-stream.js"(exports2, module2) {
|
|
37898
|
-
"use strict";
|
|
37899
|
-
module2.exports = parseStream;
|
|
37900
|
-
var stream = require("stream");
|
|
37901
|
-
var TOMLParser = require_toml_parser();
|
|
37902
|
-
function parseStream(stm) {
|
|
37903
|
-
if (stm) {
|
|
37904
|
-
return parseReadable(stm);
|
|
37905
|
-
} else {
|
|
37906
|
-
return parseTransform(stm);
|
|
37907
|
-
}
|
|
37908
|
-
}
|
|
37909
|
-
function parseReadable(stm) {
|
|
37910
|
-
const parser2 = new TOMLParser();
|
|
37911
|
-
stm.setEncoding("utf8");
|
|
37912
|
-
return new Promise((resolve12, reject) => {
|
|
37913
|
-
let readable;
|
|
37914
|
-
let ended = false;
|
|
37915
|
-
let errored = false;
|
|
37916
|
-
function finish() {
|
|
37917
|
-
ended = true;
|
|
37918
|
-
if (readable) return;
|
|
37919
|
-
try {
|
|
37920
|
-
resolve12(parser2.finish());
|
|
37921
|
-
} catch (err) {
|
|
37922
|
-
reject(err);
|
|
37923
|
-
}
|
|
37924
|
-
}
|
|
37925
|
-
function error2(err) {
|
|
37926
|
-
errored = true;
|
|
37927
|
-
reject(err);
|
|
37928
|
-
}
|
|
37929
|
-
stm.once("end", finish);
|
|
37930
|
-
stm.once("error", error2);
|
|
37931
|
-
readNext();
|
|
37932
|
-
function readNext() {
|
|
37933
|
-
readable = true;
|
|
37934
|
-
let data;
|
|
37935
|
-
while ((data = stm.read()) !== null) {
|
|
37936
|
-
try {
|
|
37937
|
-
parser2.parse(data);
|
|
37938
|
-
} catch (err) {
|
|
37939
|
-
return error2(err);
|
|
37940
|
-
}
|
|
37941
|
-
}
|
|
37942
|
-
readable = false;
|
|
37943
|
-
if (ended) return finish();
|
|
37944
|
-
if (errored) return;
|
|
37945
|
-
stm.once("readable", readNext);
|
|
37946
|
-
}
|
|
37947
|
-
});
|
|
37948
|
-
}
|
|
37949
|
-
function parseTransform() {
|
|
37950
|
-
const parser2 = new TOMLParser();
|
|
37951
|
-
return new stream.Transform({
|
|
37952
|
-
objectMode: true,
|
|
37953
|
-
transform(chunk, encoding, cb) {
|
|
37954
|
-
try {
|
|
37955
|
-
parser2.parse(chunk.toString(encoding));
|
|
37956
|
-
} catch (err) {
|
|
37957
|
-
this.emit("error", err);
|
|
37958
|
-
}
|
|
37959
|
-
cb();
|
|
37960
|
-
},
|
|
37961
|
-
flush(cb) {
|
|
37962
|
-
try {
|
|
37963
|
-
this.push(parser2.finish());
|
|
37964
|
-
} catch (err) {
|
|
37965
|
-
this.emit("error", err);
|
|
37966
|
-
}
|
|
37967
|
-
cb();
|
|
37968
|
-
}
|
|
37969
|
-
});
|
|
37970
|
-
}
|
|
37971
|
-
}
|
|
37972
|
-
});
|
|
37973
|
-
|
|
37974
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js
|
|
37975
|
-
var require_parse4 = __commonJS({
|
|
37976
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/parse.js"(exports2, module2) {
|
|
37977
|
-
"use strict";
|
|
37978
|
-
module2.exports = require_parse_string();
|
|
37979
|
-
module2.exports.async = require_parse_async();
|
|
37980
|
-
module2.exports.stream = require_parse_stream();
|
|
37981
|
-
module2.exports.prettyError = require_parse_pretty_error();
|
|
37982
|
-
}
|
|
37983
|
-
});
|
|
37984
|
-
|
|
37985
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js
|
|
37986
|
-
var require_stringify2 = __commonJS({
|
|
37987
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/stringify.js"(exports2, module2) {
|
|
37988
|
-
"use strict";
|
|
37989
|
-
module2.exports = stringify3;
|
|
37990
|
-
module2.exports.value = stringifyInline;
|
|
37991
|
-
function stringify3(obj) {
|
|
37992
|
-
if (obj === null) throw typeError("null");
|
|
37993
|
-
if (obj === void 0) throw typeError("undefined");
|
|
37994
|
-
if (typeof obj !== "object") throw typeError(typeof obj);
|
|
37995
|
-
if (typeof obj.toJSON === "function") obj = obj.toJSON();
|
|
37996
|
-
if (obj == null) return null;
|
|
37997
|
-
const type = tomlType2(obj);
|
|
37998
|
-
if (type !== "table") throw typeError(type);
|
|
37999
|
-
return stringifyObject("", "", obj);
|
|
38000
|
-
}
|
|
38001
|
-
function typeError(type) {
|
|
38002
|
-
return new Error("Can only stringify objects, not " + type);
|
|
38003
|
-
}
|
|
38004
|
-
function getInlineKeys(obj) {
|
|
38005
|
-
return Object.keys(obj).filter((key) => isInline(obj[key]));
|
|
38006
|
-
}
|
|
38007
|
-
function getComplexKeys(obj) {
|
|
38008
|
-
return Object.keys(obj).filter((key) => !isInline(obj[key]));
|
|
38009
|
-
}
|
|
38010
|
-
function toJSON(obj) {
|
|
38011
|
-
let nobj = Array.isArray(obj) ? [] : Object.prototype.hasOwnProperty.call(obj, "__proto__") ? { ["__proto__"]: void 0 } : {};
|
|
38012
|
-
for (let prop of Object.keys(obj)) {
|
|
38013
|
-
if (obj[prop] && typeof obj[prop].toJSON === "function" && !("toISOString" in obj[prop])) {
|
|
38014
|
-
nobj[prop] = obj[prop].toJSON();
|
|
38015
|
-
} else {
|
|
38016
|
-
nobj[prop] = obj[prop];
|
|
38017
|
-
}
|
|
38018
|
-
}
|
|
38019
|
-
return nobj;
|
|
38020
|
-
}
|
|
38021
|
-
function stringifyObject(prefix, indent2, obj) {
|
|
38022
|
-
obj = toJSON(obj);
|
|
38023
|
-
let inlineKeys;
|
|
38024
|
-
let complexKeys;
|
|
38025
|
-
inlineKeys = getInlineKeys(obj);
|
|
38026
|
-
complexKeys = getComplexKeys(obj);
|
|
38027
|
-
const result = [];
|
|
38028
|
-
const inlineIndent = indent2 || "";
|
|
38029
|
-
inlineKeys.forEach((key) => {
|
|
38030
|
-
var type = tomlType2(obj[key]);
|
|
38031
|
-
if (type !== "undefined" && type !== "null") {
|
|
38032
|
-
result.push(inlineIndent + stringifyKey(key) + " = " + stringifyAnyInline(obj[key], true));
|
|
38033
|
-
}
|
|
38034
|
-
});
|
|
38035
|
-
if (result.length > 0) result.push("");
|
|
38036
|
-
const complexIndent = prefix && inlineKeys.length > 0 ? indent2 + " " : "";
|
|
38037
|
-
complexKeys.forEach((key) => {
|
|
38038
|
-
result.push(stringifyComplex(prefix, complexIndent, key, obj[key]));
|
|
38039
|
-
});
|
|
38040
|
-
return result.join("\n");
|
|
38041
|
-
}
|
|
38042
|
-
function isInline(value) {
|
|
38043
|
-
switch (tomlType2(value)) {
|
|
38044
|
-
case "undefined":
|
|
38045
|
-
case "null":
|
|
38046
|
-
case "integer":
|
|
38047
|
-
case "nan":
|
|
38048
|
-
case "float":
|
|
38049
|
-
case "boolean":
|
|
38050
|
-
case "string":
|
|
38051
|
-
case "datetime":
|
|
38052
|
-
return true;
|
|
38053
|
-
case "array":
|
|
38054
|
-
return value.length === 0 || tomlType2(value[0]) !== "table";
|
|
38055
|
-
case "table":
|
|
38056
|
-
return Object.keys(value).length === 0;
|
|
38057
|
-
/* istanbul ignore next */
|
|
38058
|
-
default:
|
|
38059
|
-
return false;
|
|
38060
|
-
}
|
|
38061
|
-
}
|
|
38062
|
-
function tomlType2(value) {
|
|
38063
|
-
if (value === void 0) {
|
|
38064
|
-
return "undefined";
|
|
38065
|
-
} else if (value === null) {
|
|
38066
|
-
return "null";
|
|
38067
|
-
} else if (typeof value === "bigint" || Number.isInteger(value) && !Object.is(value, -0)) {
|
|
38068
|
-
return "integer";
|
|
38069
|
-
} else if (typeof value === "number") {
|
|
38070
|
-
return "float";
|
|
38071
|
-
} else if (typeof value === "boolean") {
|
|
38072
|
-
return "boolean";
|
|
38073
|
-
} else if (typeof value === "string") {
|
|
38074
|
-
return "string";
|
|
38075
|
-
} else if ("toISOString" in value) {
|
|
38076
|
-
return isNaN(value) ? "undefined" : "datetime";
|
|
38077
|
-
} else if (Array.isArray(value)) {
|
|
38078
|
-
return "array";
|
|
38079
|
-
} else {
|
|
38080
|
-
return "table";
|
|
38081
|
-
}
|
|
38082
|
-
}
|
|
38083
|
-
function stringifyKey(key) {
|
|
38084
|
-
const keyStr = String(key);
|
|
38085
|
-
if (/^[-A-Za-z0-9_]+$/.test(keyStr)) {
|
|
38086
|
-
return keyStr;
|
|
38087
|
-
} else {
|
|
38088
|
-
return stringifyBasicString(keyStr);
|
|
38089
|
-
}
|
|
38090
|
-
}
|
|
38091
|
-
function stringifyBasicString(str) {
|
|
38092
|
-
return '"' + escapeString(str).replace(/"/g, '\\"') + '"';
|
|
38093
|
-
}
|
|
38094
|
-
function stringifyLiteralString(str) {
|
|
38095
|
-
return "'" + str + "'";
|
|
38096
|
-
}
|
|
38097
|
-
function numpad(num, str) {
|
|
38098
|
-
while (str.length < num) str = "0" + str;
|
|
38099
|
-
return str;
|
|
38100
|
-
}
|
|
38101
|
-
function escapeString(str) {
|
|
38102
|
-
return str.replace(/\\/g, "\\\\").replace(/[\b]/g, "\\b").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\f/g, "\\f").replace(/\r/g, "\\r").replace(/([\u0000-\u001f\u007f])/, (c2) => "\\u" + numpad(4, c2.codePointAt(0).toString(16)));
|
|
38103
|
-
}
|
|
38104
|
-
function stringifyMultilineString(str) {
|
|
38105
|
-
let escaped = str.split(/\n/).map((str2) => {
|
|
38106
|
-
return escapeString(str2).replace(/"(?="")/g, '\\"');
|
|
38107
|
-
}).join("\n");
|
|
38108
|
-
if (escaped.slice(-1) === '"') escaped += "\\\n";
|
|
38109
|
-
return '"""\n' + escaped + '"""';
|
|
38110
|
-
}
|
|
38111
|
-
function stringifyAnyInline(value, multilineOk) {
|
|
38112
|
-
let type = tomlType2(value);
|
|
38113
|
-
if (type === "string") {
|
|
38114
|
-
if (multilineOk && /\n/.test(value)) {
|
|
38115
|
-
type = "string-multiline";
|
|
38116
|
-
} else if (!/[\b\t\n\f\r']/.test(value) && /"/.test(value)) {
|
|
38117
|
-
type = "string-literal";
|
|
38118
|
-
}
|
|
38119
|
-
}
|
|
38120
|
-
return stringifyInline(value, type);
|
|
38121
|
-
}
|
|
38122
|
-
function stringifyInline(value, type) {
|
|
38123
|
-
if (!type) type = tomlType2(value);
|
|
38124
|
-
switch (type) {
|
|
38125
|
-
case "string-multiline":
|
|
38126
|
-
return stringifyMultilineString(value);
|
|
38127
|
-
case "string":
|
|
38128
|
-
return stringifyBasicString(value);
|
|
38129
|
-
case "string-literal":
|
|
38130
|
-
return stringifyLiteralString(value);
|
|
38131
|
-
case "integer":
|
|
38132
|
-
return stringifyInteger(value);
|
|
38133
|
-
case "float":
|
|
38134
|
-
return stringifyFloat(value);
|
|
38135
|
-
case "boolean":
|
|
38136
|
-
return stringifyBoolean(value);
|
|
38137
|
-
case "datetime":
|
|
38138
|
-
return stringifyDatetime(value);
|
|
38139
|
-
case "array":
|
|
38140
|
-
return stringifyInlineArray(value.filter((_3) => tomlType2(_3) !== "null" && tomlType2(_3) !== "undefined" && tomlType2(_3) !== "nan"));
|
|
38141
|
-
case "table":
|
|
38142
|
-
return stringifyInlineTable(value);
|
|
38143
|
-
/* istanbul ignore next */
|
|
38144
|
-
default:
|
|
38145
|
-
throw typeError(type);
|
|
38146
|
-
}
|
|
38147
|
-
}
|
|
38148
|
-
function stringifyInteger(value) {
|
|
38149
|
-
return String(value).replace(/\B(?=(\d{3})+(?!\d))/g, "_");
|
|
38150
|
-
}
|
|
38151
|
-
function stringifyFloat(value) {
|
|
38152
|
-
if (value === Infinity) {
|
|
38153
|
-
return "inf";
|
|
38154
|
-
} else if (value === -Infinity) {
|
|
38155
|
-
return "-inf";
|
|
38156
|
-
} else if (Object.is(value, NaN)) {
|
|
38157
|
-
return "nan";
|
|
38158
|
-
} else if (Object.is(value, -0)) {
|
|
38159
|
-
return "-0.0";
|
|
38160
|
-
}
|
|
38161
|
-
const [int, dec] = String(value).split(".");
|
|
38162
|
-
return stringifyInteger(int) + "." + dec;
|
|
38163
|
-
}
|
|
38164
|
-
function stringifyBoolean(value) {
|
|
38165
|
-
return String(value);
|
|
38166
|
-
}
|
|
38167
|
-
function stringifyDatetime(value) {
|
|
38168
|
-
return value.toISOString();
|
|
38169
|
-
}
|
|
38170
|
-
function stringifyInlineArray(values) {
|
|
38171
|
-
values = toJSON(values);
|
|
38172
|
-
let result = "[";
|
|
38173
|
-
const stringified = values.map((_3) => stringifyInline(_3));
|
|
38174
|
-
if (stringified.join(", ").length > 60 || /\n/.test(stringified)) {
|
|
38175
|
-
result += "\n " + stringified.join(",\n ") + "\n";
|
|
38176
|
-
} else {
|
|
38177
|
-
result += " " + stringified.join(", ") + (stringified.length > 0 ? " " : "");
|
|
38178
|
-
}
|
|
38179
|
-
return result + "]";
|
|
38180
|
-
}
|
|
38181
|
-
function stringifyInlineTable(value) {
|
|
38182
|
-
value = toJSON(value);
|
|
38183
|
-
const result = [];
|
|
38184
|
-
Object.keys(value).forEach((key) => {
|
|
38185
|
-
result.push(stringifyKey(key) + " = " + stringifyAnyInline(value[key], false));
|
|
38186
|
-
});
|
|
38187
|
-
return "{ " + result.join(", ") + (result.length > 0 ? " " : "") + "}";
|
|
38188
|
-
}
|
|
38189
|
-
function stringifyComplex(prefix, indent2, key, value) {
|
|
38190
|
-
const valueType = tomlType2(value);
|
|
38191
|
-
if (valueType === "array") {
|
|
38192
|
-
return stringifyArrayOfTables(prefix, indent2, key, value);
|
|
38193
|
-
} else if (valueType === "table") {
|
|
38194
|
-
return stringifyComplexTable(prefix, indent2, key, value);
|
|
38195
|
-
} else {
|
|
38196
|
-
throw typeError(valueType);
|
|
38197
|
-
}
|
|
38198
|
-
}
|
|
38199
|
-
function stringifyArrayOfTables(prefix, indent2, key, values) {
|
|
38200
|
-
values = toJSON(values);
|
|
38201
|
-
const firstValueType = tomlType2(values[0]);
|
|
38202
|
-
if (firstValueType !== "table") throw typeError(firstValueType);
|
|
38203
|
-
const fullKey = prefix + stringifyKey(key);
|
|
38204
|
-
let result = "";
|
|
38205
|
-
values.forEach((table) => {
|
|
38206
|
-
if (result.length > 0) result += "\n";
|
|
38207
|
-
result += indent2 + "[[" + fullKey + "]]\n";
|
|
38208
|
-
result += stringifyObject(fullKey + ".", indent2, table);
|
|
38209
|
-
});
|
|
38210
|
-
return result;
|
|
38211
|
-
}
|
|
38212
|
-
function stringifyComplexTable(prefix, indent2, key, value) {
|
|
38213
|
-
const fullKey = prefix + stringifyKey(key);
|
|
38214
|
-
let result = "";
|
|
38215
|
-
if (getInlineKeys(value).length > 0) {
|
|
38216
|
-
result += indent2 + "[" + fullKey + "]\n";
|
|
38217
|
-
}
|
|
38218
|
-
return result + stringifyObject(fullKey + ".", indent2, value);
|
|
38219
|
-
}
|
|
38220
|
-
}
|
|
38221
|
-
});
|
|
38222
|
-
|
|
38223
|
-
// ../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js
|
|
38224
|
-
var require_toml = __commonJS({
|
|
38225
|
-
"../../node_modules/.pnpm/@iarna+toml@3.0.0/node_modules/@iarna/toml/toml.js"(exports2) {
|
|
38226
|
-
"use strict";
|
|
38227
|
-
exports2.parse = require_parse4();
|
|
38228
|
-
exports2.stringify = require_stringify2();
|
|
38229
|
-
}
|
|
38230
|
-
});
|
|
38231
|
-
|
|
38232
36218
|
// ../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js
|
|
38233
36219
|
var require_esprima = __commonJS({
|
|
38234
36220
|
"../../node_modules/.pnpm/esprima@4.0.1/node_modules/esprima/dist/esprima.js"(exports2, module2) {
|
|
@@ -38276,7 +36262,7 @@ var require_esprima = __commonJS({
|
|
|
38276
36262
|
var jsx_parser_1 = __webpack_require__(3);
|
|
38277
36263
|
var parser_1 = __webpack_require__(8);
|
|
38278
36264
|
var tokenizer_1 = __webpack_require__(15);
|
|
38279
|
-
function
|
|
36265
|
+
function parse7(code, options, delegate) {
|
|
38280
36266
|
var commentHandler = null;
|
|
38281
36267
|
var proxyDelegate = function(node, metadata) {
|
|
38282
36268
|
if (delegate) {
|
|
@@ -38321,17 +36307,17 @@ var require_esprima = __commonJS({
|
|
|
38321
36307
|
}
|
|
38322
36308
|
return ast;
|
|
38323
36309
|
}
|
|
38324
|
-
exports3.parse =
|
|
36310
|
+
exports3.parse = parse7;
|
|
38325
36311
|
function parseModule(code, options, delegate) {
|
|
38326
36312
|
var parsingOptions = options || {};
|
|
38327
36313
|
parsingOptions.sourceType = "module";
|
|
38328
|
-
return
|
|
36314
|
+
return parse7(code, parsingOptions, delegate);
|
|
38329
36315
|
}
|
|
38330
36316
|
exports3.parseModule = parseModule;
|
|
38331
36317
|
function parseScript(code, options, delegate) {
|
|
38332
36318
|
var parsingOptions = options || {};
|
|
38333
36319
|
parsingOptions.sourceType = "script";
|
|
38334
|
-
return
|
|
36320
|
+
return parse7(code, parsingOptions, delegate);
|
|
38335
36321
|
}
|
|
38336
36322
|
exports3.parseScript = parseScript;
|
|
38337
36323
|
function tokenize(code, options, delegate) {
|
|
@@ -45575,7 +43561,7 @@ var require_array = __commonJS({
|
|
|
45575
43561
|
});
|
|
45576
43562
|
|
|
45577
43563
|
// ../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/parse.js
|
|
45578
|
-
var
|
|
43564
|
+
var require_parse4 = __commonJS({
|
|
45579
43565
|
"../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/parse.js"(exports2, module2) {
|
|
45580
43566
|
var esprima = require_esprima();
|
|
45581
43567
|
var {
|
|
@@ -45839,7 +43825,7 @@ var require_parse5 = __commonJS({
|
|
|
45839
43825
|
}
|
|
45840
43826
|
}
|
|
45841
43827
|
var isObject = (subject) => Object(subject) === subject;
|
|
45842
|
-
var
|
|
43828
|
+
var parse7 = (code, rev, no_comments) => {
|
|
45843
43829
|
clean();
|
|
45844
43830
|
tokens = tokenize(code);
|
|
45845
43831
|
reviver = rev;
|
|
@@ -45868,7 +43854,7 @@ var require_parse5 = __commonJS({
|
|
|
45868
43854
|
return result;
|
|
45869
43855
|
};
|
|
45870
43856
|
module2.exports = {
|
|
45871
|
-
parse:
|
|
43857
|
+
parse: parse7,
|
|
45872
43858
|
tokenize
|
|
45873
43859
|
};
|
|
45874
43860
|
}
|
|
@@ -45909,7 +43895,7 @@ var require_repeat_string = __commonJS({
|
|
|
45909
43895
|
});
|
|
45910
43896
|
|
|
45911
43897
|
// ../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/stringify.js
|
|
45912
|
-
var
|
|
43898
|
+
var require_stringify2 = __commonJS({
|
|
45913
43899
|
"../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/stringify.js"(exports2, module2) {
|
|
45914
43900
|
var {
|
|
45915
43901
|
isArray,
|
|
@@ -46010,7 +43996,7 @@ var require_stringify3 = __commonJS({
|
|
|
46010
43996
|
deeper_gap
|
|
46011
43997
|
);
|
|
46012
43998
|
inside += before || LF + deeper_gap;
|
|
46013
|
-
inside +=
|
|
43999
|
+
inside += stringify4(i, value, deeper_gap) || STR_NULL;
|
|
46014
44000
|
inside += process_comments(value, AFTER_VALUE(i), deeper_gap);
|
|
46015
44001
|
after_comma = process_comments(value, AFTER(i), deeper_gap);
|
|
46016
44002
|
}
|
|
@@ -46031,7 +44017,7 @@ var require_stringify3 = __commonJS({
|
|
|
46031
44017
|
let first = true;
|
|
46032
44018
|
const keys = isArray(replacer) ? replacer : Object.keys(value);
|
|
46033
44019
|
const iteratee = (key) => {
|
|
46034
|
-
const sv =
|
|
44020
|
+
const sv = stringify4(key, value, deeper_gap);
|
|
46035
44021
|
if (sv === UNDEFINED) {
|
|
46036
44022
|
return;
|
|
46037
44023
|
}
|
|
@@ -46056,7 +44042,7 @@ var require_stringify3 = __commonJS({
|
|
|
46056
44042
|
);
|
|
46057
44043
|
return CURLY_BRACKET_OPEN + join_content(inside, value, gap) + CURLY_BRACKET_CLOSE;
|
|
46058
44044
|
};
|
|
46059
|
-
function
|
|
44045
|
+
function stringify4(key, holder, gap) {
|
|
46060
44046
|
let value = holder[key];
|
|
46061
44047
|
if (isObject(value) && isFunction2(value.toJSON)) {
|
|
46062
44048
|
value = value.toJSON(key);
|
|
@@ -46104,7 +44090,7 @@ var require_stringify3 = __commonJS({
|
|
|
46104
44090
|
}
|
|
46105
44091
|
replacer = replacer_;
|
|
46106
44092
|
indent2 = indent_;
|
|
46107
|
-
const str = is_primitive_object(value) ? JSON.stringify(value) :
|
|
44093
|
+
const str = is_primitive_object(value) ? JSON.stringify(value) : stringify4("", { "": value }, EMPTY);
|
|
46108
44094
|
clean();
|
|
46109
44095
|
return isObject(value) ? process_comments(value, PREFIX_BEFORE_ALL, EMPTY, true).trimLeft() + str + process_comments(value, PREFIX_AFTER_ALL, EMPTY).trimRight() : str;
|
|
46110
44096
|
};
|
|
@@ -46114,13 +44100,13 @@ var require_stringify3 = __commonJS({
|
|
|
46114
44100
|
// ../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/index.js
|
|
46115
44101
|
var require_src3 = __commonJS({
|
|
46116
44102
|
"../../node_modules/.pnpm/comment-json@4.2.5_patch_hash=hbbonhdeq6rxrctdf7euss7qte/node_modules/comment-json/src/index.js"(exports2, module2) {
|
|
46117
|
-
var { parse:
|
|
46118
|
-
var
|
|
44103
|
+
var { parse: parse7, tokenize } = require_parse4();
|
|
44104
|
+
var stringify4 = require_stringify2();
|
|
46119
44105
|
var { CommentArray } = require_array();
|
|
46120
44106
|
var { assign: assign2 } = require_common();
|
|
46121
44107
|
module2.exports = {
|
|
46122
|
-
parse:
|
|
46123
|
-
stringify:
|
|
44108
|
+
parse: parse7,
|
|
44109
|
+
stringify: stringify4,
|
|
46124
44110
|
tokenize,
|
|
46125
44111
|
CommentArray,
|
|
46126
44112
|
assign: assign2
|
|
@@ -46527,7 +44513,7 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
46527
44513
|
}
|
|
46528
44514
|
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
46529
44515
|
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
46530
|
-
var
|
|
44516
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
46531
44517
|
var _3, done = false;
|
|
46532
44518
|
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
46533
44519
|
var context = {};
|
|
@@ -46537,19 +44523,19 @@ function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, e
|
|
|
46537
44523
|
if (done) throw new TypeError("Cannot add initializers after decoration has completed");
|
|
46538
44524
|
extraInitializers.push(accept(f || null));
|
|
46539
44525
|
};
|
|
46540
|
-
var result = (0, decorators[i])(kind === "accessor" ? { get:
|
|
44526
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
46541
44527
|
if (kind === "accessor") {
|
|
46542
44528
|
if (result === void 0) continue;
|
|
46543
44529
|
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
46544
|
-
if (_3 = accept(result.get))
|
|
46545
|
-
if (_3 = accept(result.set))
|
|
44530
|
+
if (_3 = accept(result.get)) descriptor.get = _3;
|
|
44531
|
+
if (_3 = accept(result.set)) descriptor.set = _3;
|
|
46546
44532
|
if (_3 = accept(result.init)) initializers.unshift(_3);
|
|
46547
44533
|
} else if (_3 = accept(result)) {
|
|
46548
44534
|
if (kind === "field") initializers.unshift(_3);
|
|
46549
|
-
else
|
|
44535
|
+
else descriptor[key] = _3;
|
|
46550
44536
|
}
|
|
46551
44537
|
}
|
|
46552
|
-
if (target) Object.defineProperty(target, contextIn.name,
|
|
44538
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
46553
44539
|
done = true;
|
|
46554
44540
|
}
|
|
46555
44541
|
function __runInitializers(thisArg, initializers, value) {
|
|
@@ -52359,7 +50345,7 @@ var require_esprima3 = __commonJS({
|
|
|
52359
50345
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
52360
50346
|
exports2.parse = void 0;
|
|
52361
50347
|
var util_1 = require_util9();
|
|
52362
|
-
function
|
|
50348
|
+
function parse7(source, options) {
|
|
52363
50349
|
var comments = [];
|
|
52364
50350
|
var ast = require_esprima().parse(source, {
|
|
52365
50351
|
loc: true,
|
|
@@ -52377,7 +50363,7 @@ var require_esprima3 = __commonJS({
|
|
|
52377
50363
|
}
|
|
52378
50364
|
return ast;
|
|
52379
50365
|
}
|
|
52380
|
-
exports2.parse =
|
|
50366
|
+
exports2.parse = parse7;
|
|
52381
50367
|
}
|
|
52382
50368
|
});
|
|
52383
50369
|
|
|
@@ -53500,7 +51486,7 @@ var require_comments = __commonJS({
|
|
|
53500
51486
|
});
|
|
53501
51487
|
|
|
53502
51488
|
// ../../node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/parser.js
|
|
53503
|
-
var
|
|
51489
|
+
var require_parser = __commonJS({
|
|
53504
51490
|
"../../node_modules/.pnpm/recast@0.22.0/node_modules/recast/lib/parser.js"(exports2) {
|
|
53505
51491
|
"use strict";
|
|
53506
51492
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -53515,7 +51501,7 @@ var require_parser2 = __commonJS({
|
|
|
53515
51501
|
var lines_1 = require_lines();
|
|
53516
51502
|
var comments_1 = require_comments();
|
|
53517
51503
|
var util = tslib_1.__importStar(require_util9());
|
|
53518
|
-
function
|
|
51504
|
+
function parse7(source, options) {
|
|
53519
51505
|
options = options_1.normalize(options);
|
|
53520
51506
|
var lines = lines_1.fromString(source, options);
|
|
53521
51507
|
var sourceWithoutTabs = lines.toString({
|
|
@@ -53587,7 +51573,7 @@ var require_parser2 = __commonJS({
|
|
|
53587
51573
|
comments_1.attach(comments, program.body.length ? file.program : file, lines);
|
|
53588
51574
|
return new TreeCopier(lines, tokens).copy(file);
|
|
53589
51575
|
}
|
|
53590
|
-
exports2.parse =
|
|
51576
|
+
exports2.parse = parse7;
|
|
53591
51577
|
var TreeCopier = function TreeCopier2(lines, tokens) {
|
|
53592
51578
|
assert_1.default.ok(this instanceof TreeCopier2);
|
|
53593
51579
|
this.lines = lines;
|
|
@@ -56625,7 +54611,7 @@ var require_main2 = __commonJS({
|
|
|
56625
54611
|
var fs_1 = tslib_1.__importDefault(require("fs"));
|
|
56626
54612
|
var types12 = tslib_1.__importStar(require_main());
|
|
56627
54613
|
exports2.types = types12;
|
|
56628
|
-
var parser_1 =
|
|
54614
|
+
var parser_1 = require_parser();
|
|
56629
54615
|
Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
|
|
56630
54616
|
return parser_1.parse;
|
|
56631
54617
|
} });
|
|
@@ -57151,11 +55137,11 @@ var require_lib = __commonJS({
|
|
|
57151
55137
|
}
|
|
57152
55138
|
var Errors = Object.assign({}, ParseErrorEnum(ModuleErrors), ParseErrorEnum(StandardErrors), ParseErrorEnum(StrictModeErrors), ParseErrorEnum`pipelineOperator`(PipelineOperatorErrors));
|
|
57153
55139
|
var {
|
|
57154
|
-
defineProperty
|
|
55140
|
+
defineProperty
|
|
57155
55141
|
} = Object;
|
|
57156
55142
|
var toUnenumerable = (object, key) => {
|
|
57157
55143
|
if (object) {
|
|
57158
|
-
|
|
55144
|
+
defineProperty(object, key, {
|
|
57159
55145
|
enumerable: false,
|
|
57160
55146
|
value: object[key]
|
|
57161
55147
|
});
|
|
@@ -58750,7 +56736,7 @@ var require_lib = __commonJS({
|
|
|
58750
56736
|
return state;
|
|
58751
56737
|
}
|
|
58752
56738
|
};
|
|
58753
|
-
var _isDigit = function
|
|
56739
|
+
var _isDigit = function isDigit2(code2) {
|
|
58754
56740
|
return code2 >= 48 && code2 <= 57;
|
|
58755
56741
|
};
|
|
58756
56742
|
var forbiddenNumericSeparatorSiblings = {
|
|
@@ -59818,7 +57804,7 @@ var require_lib = __commonJS({
|
|
|
59818
57804
|
readNumber(startsWithDot) {
|
|
59819
57805
|
const start = this.state.pos;
|
|
59820
57806
|
const startLoc = this.state.curPosition();
|
|
59821
|
-
let
|
|
57807
|
+
let isFloat = false;
|
|
59822
57808
|
let isBigInt = false;
|
|
59823
57809
|
let hasExponent = false;
|
|
59824
57810
|
let isOctal = false;
|
|
@@ -59841,7 +57827,7 @@ var require_lib = __commonJS({
|
|
|
59841
57827
|
if (next === 46 && !isOctal) {
|
|
59842
57828
|
++this.state.pos;
|
|
59843
57829
|
this.readInt(10);
|
|
59844
|
-
|
|
57830
|
+
isFloat = true;
|
|
59845
57831
|
next = this.input.charCodeAt(this.state.pos);
|
|
59846
57832
|
}
|
|
59847
57833
|
if ((next === 69 || next === 101) && !isOctal) {
|
|
@@ -59852,12 +57838,12 @@ var require_lib = __commonJS({
|
|
|
59852
57838
|
if (this.readInt(10) === null) {
|
|
59853
57839
|
this.raise(Errors.InvalidOrMissingExponent, startLoc);
|
|
59854
57840
|
}
|
|
59855
|
-
|
|
57841
|
+
isFloat = true;
|
|
59856
57842
|
hasExponent = true;
|
|
59857
57843
|
next = this.input.charCodeAt(this.state.pos);
|
|
59858
57844
|
}
|
|
59859
57845
|
if (next === 110) {
|
|
59860
|
-
if (
|
|
57846
|
+
if (isFloat || hasLeadingZero) {
|
|
59861
57847
|
this.raise(Errors.InvalidBigIntLiteral, startLoc);
|
|
59862
57848
|
}
|
|
59863
57849
|
++this.state.pos;
|
|
@@ -61932,14 +59918,14 @@ var require_lib = __commonJS({
|
|
|
61932
59918
|
super.checkParams(node, false, true);
|
|
61933
59919
|
this.scope.exit();
|
|
61934
59920
|
}
|
|
61935
|
-
forwardNoArrowParamsConversionAt(node,
|
|
59921
|
+
forwardNoArrowParamsConversionAt(node, parse8) {
|
|
61936
59922
|
let result;
|
|
61937
59923
|
if (this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(node.start))) {
|
|
61938
59924
|
this.state.noArrowParamsConversionAt.push(this.state.start);
|
|
61939
|
-
result =
|
|
59925
|
+
result = parse8();
|
|
61940
59926
|
this.state.noArrowParamsConversionAt.pop();
|
|
61941
59927
|
} else {
|
|
61942
|
-
result =
|
|
59928
|
+
result = parse8();
|
|
61943
59929
|
}
|
|
61944
59930
|
return result;
|
|
61945
59931
|
}
|
|
@@ -70638,7 +68624,7 @@ var require_lib = __commonJS({
|
|
|
70638
68624
|
return file;
|
|
70639
68625
|
}
|
|
70640
68626
|
};
|
|
70641
|
-
function
|
|
68627
|
+
function parse7(input, options) {
|
|
70642
68628
|
var _options;
|
|
70643
68629
|
if (((_options = options) == null ? void 0 : _options.sourceType) === "unambiguous") {
|
|
70644
68630
|
options = Object.assign({}, options);
|
|
@@ -70725,7 +68711,7 @@ var require_lib = __commonJS({
|
|
|
70725
68711
|
}
|
|
70726
68712
|
return cls;
|
|
70727
68713
|
}
|
|
70728
|
-
exports2.parse =
|
|
68714
|
+
exports2.parse = parse7;
|
|
70729
68715
|
exports2.parseExpression = parseExpression;
|
|
70730
68716
|
exports2.tokTypes = tokTypes;
|
|
70731
68717
|
}
|
|
@@ -70750,12 +68736,12 @@ var require_babel2 = __commonJS({
|
|
|
70750
68736
|
}
|
|
70751
68737
|
}
|
|
70752
68738
|
}();
|
|
70753
|
-
function
|
|
68739
|
+
function parse7(source, options) {
|
|
70754
68740
|
var babelOptions = _babel_options_1.default(options);
|
|
70755
68741
|
babelOptions.plugins.push("jsx", "flow");
|
|
70756
68742
|
return exports2.parser.parse(source, babelOptions);
|
|
70757
68743
|
}
|
|
70758
|
-
exports2.parse =
|
|
68744
|
+
exports2.parse = parse7;
|
|
70759
68745
|
}
|
|
70760
68746
|
});
|
|
70761
68747
|
|
|
@@ -70768,12 +68754,12 @@ var require_typescript2 = __commonJS({
|
|
|
70768
68754
|
var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
|
|
70769
68755
|
var babel_1 = require_babel2();
|
|
70770
68756
|
var _babel_options_1 = tslib_1.__importDefault(require_babel_options());
|
|
70771
|
-
function
|
|
68757
|
+
function parse7(source, options) {
|
|
70772
68758
|
var babelOptions = _babel_options_1.default(options);
|
|
70773
68759
|
babelOptions.plugins.push("typescript");
|
|
70774
68760
|
return babel_1.parser.parse(source, babelOptions);
|
|
70775
68761
|
}
|
|
70776
|
-
exports2.parse =
|
|
68762
|
+
exports2.parse = parse7;
|
|
70777
68763
|
}
|
|
70778
68764
|
});
|
|
70779
68765
|
|
|
@@ -75170,7 +73156,7 @@ var YargsParser = class {
|
|
|
75170
73156
|
if (configuration["set-placeholder-key"])
|
|
75171
73157
|
setPlaceholderKeys(argv);
|
|
75172
73158
|
Object.keys(flags.counts).forEach(function(key) {
|
|
75173
|
-
if (!
|
|
73159
|
+
if (!hasKey(argv, key.split(".")))
|
|
75174
73160
|
setArg(key, 0);
|
|
75175
73161
|
});
|
|
75176
73162
|
if (notFlagsOption && notFlags.length)
|
|
@@ -75393,7 +73379,7 @@ var YargsParser = class {
|
|
|
75393
73379
|
if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
|
|
75394
73380
|
setConfigObject(value, fullKey);
|
|
75395
73381
|
} else {
|
|
75396
|
-
if (!
|
|
73382
|
+
if (!hasKey(argv, fullKey.split(".")) || checkAllAliases(fullKey, flags.arrays) && configuration["combine-arrays"]) {
|
|
75397
73383
|
setArg(fullKey, value);
|
|
75398
73384
|
}
|
|
75399
73385
|
}
|
|
@@ -75419,7 +73405,7 @@ var YargsParser = class {
|
|
|
75419
73405
|
}
|
|
75420
73406
|
return camelCase(key);
|
|
75421
73407
|
});
|
|
75422
|
-
if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !
|
|
73408
|
+
if ((configOnly && flags.configs[keys.join(".")] || !configOnly) && !hasKey(argv2, keys)) {
|
|
75423
73409
|
setArg(keys.join("."), env3[envVar]);
|
|
75424
73410
|
}
|
|
75425
73411
|
}
|
|
@@ -75456,19 +73442,19 @@ var YargsParser = class {
|
|
|
75456
73442
|
}
|
|
75457
73443
|
function applyDefaultsAndAliases(obj, aliases2, defaults2, canLog = false) {
|
|
75458
73444
|
Object.keys(defaults2).forEach(function(key) {
|
|
75459
|
-
if (!
|
|
73445
|
+
if (!hasKey(obj, key.split("."))) {
|
|
75460
73446
|
setKey(obj, key.split("."), defaults2[key]);
|
|
75461
73447
|
if (canLog)
|
|
75462
73448
|
defaulted[key] = true;
|
|
75463
73449
|
(aliases2[key] || []).forEach(function(x2) {
|
|
75464
|
-
if (
|
|
73450
|
+
if (hasKey(obj, x2.split(".")))
|
|
75465
73451
|
return;
|
|
75466
73452
|
setKey(obj, x2.split("."), defaults2[key]);
|
|
75467
73453
|
});
|
|
75468
73454
|
}
|
|
75469
73455
|
});
|
|
75470
73456
|
}
|
|
75471
|
-
function
|
|
73457
|
+
function hasKey(obj, keys) {
|
|
75472
73458
|
let o = obj;
|
|
75473
73459
|
if (!configuration["dot-notation"])
|
|
75474
73460
|
keys = [keys.join(".")];
|
|
@@ -78308,9 +76294,9 @@ var YargsInstance = class {
|
|
|
78308
76294
|
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
78309
76295
|
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
78310
76296
|
if (!this.parsed) {
|
|
78311
|
-
const
|
|
78312
|
-
if (isPromise(
|
|
78313
|
-
return
|
|
76297
|
+
const parse7 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
|
|
76298
|
+
if (isPromise(parse7)) {
|
|
76299
|
+
return parse7.then(() => {
|
|
78314
76300
|
return __classPrivateFieldGet(this, _YargsInstance_usage, "f").help();
|
|
78315
76301
|
});
|
|
78316
76302
|
}
|
|
@@ -78654,9 +76640,9 @@ var YargsInstance = class {
|
|
|
78654
76640
|
__classPrivateFieldSet(this, _YargsInstance_hasOutput, true, "f");
|
|
78655
76641
|
if (!__classPrivateFieldGet(this, _YargsInstance_usage, "f").hasCachedHelpMessage()) {
|
|
78656
76642
|
if (!this.parsed) {
|
|
78657
|
-
const
|
|
78658
|
-
if (isPromise(
|
|
78659
|
-
|
|
76643
|
+
const parse7 = this[kRunYargsParserAndExecuteCommands](__classPrivateFieldGet(this, _YargsInstance_processArgs, "f"), void 0, void 0, 0, true);
|
|
76644
|
+
if (isPromise(parse7)) {
|
|
76645
|
+
parse7.then(() => {
|
|
78660
76646
|
__classPrivateFieldGet(this, _YargsInstance_usage, "f").showHelp(level);
|
|
78661
76647
|
});
|
|
78662
76648
|
return this;
|
|
@@ -79316,7 +77302,7 @@ var Yargs = YargsFactory(esm_default);
|
|
|
79316
77302
|
var yargs_default = Yargs;
|
|
79317
77303
|
|
|
79318
77304
|
// package.json
|
|
79319
|
-
var version = "2.
|
|
77305
|
+
var version = "2.55.1";
|
|
79320
77306
|
|
|
79321
77307
|
// src/metrics.ts
|
|
79322
77308
|
var import_node_async_hooks = require("node:async_hooks");
|
|
@@ -79437,11 +77423,12 @@ var runCommand = async (command2, opts = {}) => {
|
|
|
79437
77423
|
promise() {
|
|
79438
77424
|
const [executable, ...args] = command2;
|
|
79439
77425
|
if (args[0] === "wrangler") {
|
|
77426
|
+
opts.env ??= {};
|
|
79440
77427
|
const metrics = readMetricsConfig();
|
|
79441
77428
|
if (metrics.c3permission?.enabled === false) {
|
|
79442
|
-
opts.env ??= {};
|
|
79443
77429
|
opts.env["WRANGLER_SEND_METRICS"] = "false";
|
|
79444
77430
|
}
|
|
77431
|
+
opts.env["WRANGLER_HIDE_BANNER"] = "true";
|
|
79445
77432
|
}
|
|
79446
77433
|
const abortController = new AbortController();
|
|
79447
77434
|
const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
|
|
@@ -79896,8 +77883,854 @@ var import_undici2 = __toESM(require_undici());
|
|
|
79896
77883
|
// src/helpers/files.ts
|
|
79897
77884
|
var import_fs6 = __toESM(require("fs"));
|
|
79898
77885
|
var import_path6 = require("path");
|
|
79899
|
-
var import_toml = __toESM(require_toml());
|
|
79900
77886
|
var import_comment_json = __toESM(require_src3());
|
|
77887
|
+
|
|
77888
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/error.js
|
|
77889
|
+
function getLineColFromPtr(string, ptr) {
|
|
77890
|
+
let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g);
|
|
77891
|
+
return [lines.length, lines.pop().length + 1];
|
|
77892
|
+
}
|
|
77893
|
+
function makeCodeBlock(string, line, column) {
|
|
77894
|
+
let lines = string.split(/\r\n|\n|\r/g);
|
|
77895
|
+
let codeblock = "";
|
|
77896
|
+
let numberLen = (Math.log10(line + 1) | 0) + 1;
|
|
77897
|
+
for (let i = line - 1; i <= line + 1; i++) {
|
|
77898
|
+
let l2 = lines[i - 1];
|
|
77899
|
+
if (!l2)
|
|
77900
|
+
continue;
|
|
77901
|
+
codeblock += i.toString().padEnd(numberLen, " ");
|
|
77902
|
+
codeblock += ": ";
|
|
77903
|
+
codeblock += l2;
|
|
77904
|
+
codeblock += "\n";
|
|
77905
|
+
if (i === line) {
|
|
77906
|
+
codeblock += " ".repeat(numberLen + column + 2);
|
|
77907
|
+
codeblock += "^\n";
|
|
77908
|
+
}
|
|
77909
|
+
}
|
|
77910
|
+
return codeblock;
|
|
77911
|
+
}
|
|
77912
|
+
var TomlError = class extends Error {
|
|
77913
|
+
line;
|
|
77914
|
+
column;
|
|
77915
|
+
codeblock;
|
|
77916
|
+
constructor(message, options) {
|
|
77917
|
+
const [line, column] = getLineColFromPtr(options.toml, options.ptr);
|
|
77918
|
+
const codeblock = makeCodeBlock(options.toml, line, column);
|
|
77919
|
+
super(`Invalid TOML document: ${message}
|
|
77920
|
+
|
|
77921
|
+
${codeblock}`, options);
|
|
77922
|
+
this.line = line;
|
|
77923
|
+
this.column = column;
|
|
77924
|
+
this.codeblock = codeblock;
|
|
77925
|
+
}
|
|
77926
|
+
};
|
|
77927
|
+
|
|
77928
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/util.js
|
|
77929
|
+
function isEscaped(str, ptr) {
|
|
77930
|
+
let i = 0;
|
|
77931
|
+
while (str[ptr - ++i] === "\\")
|
|
77932
|
+
;
|
|
77933
|
+
return --i && i % 2;
|
|
77934
|
+
}
|
|
77935
|
+
function indexOfNewline(str, start = 0, end = str.length) {
|
|
77936
|
+
let idx = str.indexOf("\n", start);
|
|
77937
|
+
if (str[idx - 1] === "\r")
|
|
77938
|
+
idx--;
|
|
77939
|
+
return idx <= end ? idx : -1;
|
|
77940
|
+
}
|
|
77941
|
+
function skipComment(str, ptr) {
|
|
77942
|
+
for (let i = ptr; i < str.length; i++) {
|
|
77943
|
+
let c2 = str[i];
|
|
77944
|
+
if (c2 === "\n")
|
|
77945
|
+
return i;
|
|
77946
|
+
if (c2 === "\r" && str[i + 1] === "\n")
|
|
77947
|
+
return i + 1;
|
|
77948
|
+
if (c2 < " " && c2 !== " " || c2 === "\x7F") {
|
|
77949
|
+
throw new TomlError("control characters are not allowed in comments", {
|
|
77950
|
+
toml: str,
|
|
77951
|
+
ptr
|
|
77952
|
+
});
|
|
77953
|
+
}
|
|
77954
|
+
}
|
|
77955
|
+
return str.length;
|
|
77956
|
+
}
|
|
77957
|
+
function skipVoid(str, ptr, banNewLines, banComments) {
|
|
77958
|
+
let c2;
|
|
77959
|
+
while ((c2 = str[ptr]) === " " || c2 === " " || !banNewLines && (c2 === "\n" || c2 === "\r" && str[ptr + 1] === "\n"))
|
|
77960
|
+
ptr++;
|
|
77961
|
+
return banComments || c2 !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines);
|
|
77962
|
+
}
|
|
77963
|
+
function skipUntil(str, ptr, sep, end, banNewLines = false) {
|
|
77964
|
+
if (!end) {
|
|
77965
|
+
ptr = indexOfNewline(str, ptr);
|
|
77966
|
+
return ptr < 0 ? str.length : ptr;
|
|
77967
|
+
}
|
|
77968
|
+
for (let i = ptr; i < str.length; i++) {
|
|
77969
|
+
let c2 = str[i];
|
|
77970
|
+
if (c2 === "#") {
|
|
77971
|
+
i = indexOfNewline(str, i);
|
|
77972
|
+
} else if (c2 === sep) {
|
|
77973
|
+
return i + 1;
|
|
77974
|
+
} else if (c2 === end || banNewLines && (c2 === "\n" || c2 === "\r" && str[i + 1] === "\n")) {
|
|
77975
|
+
return i;
|
|
77976
|
+
}
|
|
77977
|
+
}
|
|
77978
|
+
throw new TomlError("cannot find end of structure", {
|
|
77979
|
+
toml: str,
|
|
77980
|
+
ptr
|
|
77981
|
+
});
|
|
77982
|
+
}
|
|
77983
|
+
function getStringEnd(str, seek) {
|
|
77984
|
+
let first = str[seek];
|
|
77985
|
+
let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first;
|
|
77986
|
+
seek += target.length - 1;
|
|
77987
|
+
do
|
|
77988
|
+
seek = str.indexOf(target, ++seek);
|
|
77989
|
+
while (seek > -1 && first !== "'" && isEscaped(str, seek));
|
|
77990
|
+
if (seek > -1) {
|
|
77991
|
+
seek += target.length;
|
|
77992
|
+
if (target.length > 1) {
|
|
77993
|
+
if (str[seek] === first)
|
|
77994
|
+
seek++;
|
|
77995
|
+
if (str[seek] === first)
|
|
77996
|
+
seek++;
|
|
77997
|
+
}
|
|
77998
|
+
}
|
|
77999
|
+
return seek;
|
|
78000
|
+
}
|
|
78001
|
+
|
|
78002
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/date.js
|
|
78003
|
+
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}:\d{2}(?:\.\d+)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
78004
|
+
var TomlDate = class _TomlDate extends Date {
|
|
78005
|
+
#hasDate = false;
|
|
78006
|
+
#hasTime = false;
|
|
78007
|
+
#offset = null;
|
|
78008
|
+
constructor(date) {
|
|
78009
|
+
let hasDate = true;
|
|
78010
|
+
let hasTime = true;
|
|
78011
|
+
let offset = "Z";
|
|
78012
|
+
if (typeof date === "string") {
|
|
78013
|
+
let match = date.match(DATE_TIME_RE);
|
|
78014
|
+
if (match) {
|
|
78015
|
+
if (!match[1]) {
|
|
78016
|
+
hasDate = false;
|
|
78017
|
+
date = `0000-01-01T${date}`;
|
|
78018
|
+
}
|
|
78019
|
+
hasTime = !!match[2];
|
|
78020
|
+
hasTime && date[10] === " " && (date = date.replace(" ", "T"));
|
|
78021
|
+
if (match[2] && +match[2] > 23) {
|
|
78022
|
+
date = "";
|
|
78023
|
+
} else {
|
|
78024
|
+
offset = match[3] || null;
|
|
78025
|
+
date = date.toUpperCase();
|
|
78026
|
+
if (!offset && hasTime)
|
|
78027
|
+
date += "Z";
|
|
78028
|
+
}
|
|
78029
|
+
} else {
|
|
78030
|
+
date = "";
|
|
78031
|
+
}
|
|
78032
|
+
}
|
|
78033
|
+
super(date);
|
|
78034
|
+
if (!isNaN(this.getTime())) {
|
|
78035
|
+
this.#hasDate = hasDate;
|
|
78036
|
+
this.#hasTime = hasTime;
|
|
78037
|
+
this.#offset = offset;
|
|
78038
|
+
}
|
|
78039
|
+
}
|
|
78040
|
+
isDateTime() {
|
|
78041
|
+
return this.#hasDate && this.#hasTime;
|
|
78042
|
+
}
|
|
78043
|
+
isLocal() {
|
|
78044
|
+
return !this.#hasDate || !this.#hasTime || !this.#offset;
|
|
78045
|
+
}
|
|
78046
|
+
isDate() {
|
|
78047
|
+
return this.#hasDate && !this.#hasTime;
|
|
78048
|
+
}
|
|
78049
|
+
isTime() {
|
|
78050
|
+
return this.#hasTime && !this.#hasDate;
|
|
78051
|
+
}
|
|
78052
|
+
isValid() {
|
|
78053
|
+
return this.#hasDate || this.#hasTime;
|
|
78054
|
+
}
|
|
78055
|
+
toISOString() {
|
|
78056
|
+
let iso = super.toISOString();
|
|
78057
|
+
if (this.isDate())
|
|
78058
|
+
return iso.slice(0, 10);
|
|
78059
|
+
if (this.isTime())
|
|
78060
|
+
return iso.slice(11, 23);
|
|
78061
|
+
if (this.#offset === null)
|
|
78062
|
+
return iso.slice(0, -1);
|
|
78063
|
+
if (this.#offset === "Z")
|
|
78064
|
+
return iso;
|
|
78065
|
+
let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6);
|
|
78066
|
+
offset = this.#offset[0] === "-" ? offset : -offset;
|
|
78067
|
+
let offsetDate = new Date(this.getTime() - offset * 6e4);
|
|
78068
|
+
return offsetDate.toISOString().slice(0, -1) + this.#offset;
|
|
78069
|
+
}
|
|
78070
|
+
static wrapAsOffsetDateTime(jsDate, offset = "Z") {
|
|
78071
|
+
let date = new _TomlDate(jsDate);
|
|
78072
|
+
date.#offset = offset;
|
|
78073
|
+
return date;
|
|
78074
|
+
}
|
|
78075
|
+
static wrapAsLocalDateTime(jsDate) {
|
|
78076
|
+
let date = new _TomlDate(jsDate);
|
|
78077
|
+
date.#offset = null;
|
|
78078
|
+
return date;
|
|
78079
|
+
}
|
|
78080
|
+
static wrapAsLocalDate(jsDate) {
|
|
78081
|
+
let date = new _TomlDate(jsDate);
|
|
78082
|
+
date.#hasTime = false;
|
|
78083
|
+
date.#offset = null;
|
|
78084
|
+
return date;
|
|
78085
|
+
}
|
|
78086
|
+
static wrapAsLocalTime(jsDate) {
|
|
78087
|
+
let date = new _TomlDate(jsDate);
|
|
78088
|
+
date.#hasDate = false;
|
|
78089
|
+
date.#offset = null;
|
|
78090
|
+
return date;
|
|
78091
|
+
}
|
|
78092
|
+
};
|
|
78093
|
+
|
|
78094
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/primitive.js
|
|
78095
|
+
var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
78096
|
+
var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
78097
|
+
var LEADING_ZERO = /^[+-]?0[0-9_]/;
|
|
78098
|
+
var ESCAPE_REGEX = /^[0-9a-f]{4,8}$/i;
|
|
78099
|
+
var ESC_MAP = {
|
|
78100
|
+
b: "\b",
|
|
78101
|
+
t: " ",
|
|
78102
|
+
n: "\n",
|
|
78103
|
+
f: "\f",
|
|
78104
|
+
r: "\r",
|
|
78105
|
+
'"': '"',
|
|
78106
|
+
"\\": "\\"
|
|
78107
|
+
};
|
|
78108
|
+
function parseString(str, ptr = 0, endPtr = str.length) {
|
|
78109
|
+
let isLiteral = str[ptr] === "'";
|
|
78110
|
+
let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1];
|
|
78111
|
+
if (isMultiline) {
|
|
78112
|
+
endPtr -= 2;
|
|
78113
|
+
if (str[ptr += 2] === "\r")
|
|
78114
|
+
ptr++;
|
|
78115
|
+
if (str[ptr] === "\n")
|
|
78116
|
+
ptr++;
|
|
78117
|
+
}
|
|
78118
|
+
let tmp = 0;
|
|
78119
|
+
let isEscape;
|
|
78120
|
+
let parsed = "";
|
|
78121
|
+
let sliceStart = ptr;
|
|
78122
|
+
while (ptr < endPtr - 1) {
|
|
78123
|
+
let c2 = str[ptr++];
|
|
78124
|
+
if (c2 === "\n" || c2 === "\r" && str[ptr] === "\n") {
|
|
78125
|
+
if (!isMultiline) {
|
|
78126
|
+
throw new TomlError("newlines are not allowed in strings", {
|
|
78127
|
+
toml: str,
|
|
78128
|
+
ptr: ptr - 1
|
|
78129
|
+
});
|
|
78130
|
+
}
|
|
78131
|
+
} else if (c2 < " " && c2 !== " " || c2 === "\x7F") {
|
|
78132
|
+
throw new TomlError("control characters are not allowed in strings", {
|
|
78133
|
+
toml: str,
|
|
78134
|
+
ptr: ptr - 1
|
|
78135
|
+
});
|
|
78136
|
+
}
|
|
78137
|
+
if (isEscape) {
|
|
78138
|
+
isEscape = false;
|
|
78139
|
+
if (c2 === "u" || c2 === "U") {
|
|
78140
|
+
let code = str.slice(ptr, ptr += c2 === "u" ? 4 : 8);
|
|
78141
|
+
if (!ESCAPE_REGEX.test(code)) {
|
|
78142
|
+
throw new TomlError("invalid unicode escape", {
|
|
78143
|
+
toml: str,
|
|
78144
|
+
ptr: tmp
|
|
78145
|
+
});
|
|
78146
|
+
}
|
|
78147
|
+
try {
|
|
78148
|
+
parsed += String.fromCodePoint(parseInt(code, 16));
|
|
78149
|
+
} catch {
|
|
78150
|
+
throw new TomlError("invalid unicode escape", {
|
|
78151
|
+
toml: str,
|
|
78152
|
+
ptr: tmp
|
|
78153
|
+
});
|
|
78154
|
+
}
|
|
78155
|
+
} else if (isMultiline && (c2 === "\n" || c2 === " " || c2 === " " || c2 === "\r")) {
|
|
78156
|
+
ptr = skipVoid(str, ptr - 1, true);
|
|
78157
|
+
if (str[ptr] !== "\n" && str[ptr] !== "\r") {
|
|
78158
|
+
throw new TomlError("invalid escape: only line-ending whitespace may be escaped", {
|
|
78159
|
+
toml: str,
|
|
78160
|
+
ptr: tmp
|
|
78161
|
+
});
|
|
78162
|
+
}
|
|
78163
|
+
ptr = skipVoid(str, ptr);
|
|
78164
|
+
} else if (c2 in ESC_MAP) {
|
|
78165
|
+
parsed += ESC_MAP[c2];
|
|
78166
|
+
} else {
|
|
78167
|
+
throw new TomlError("unrecognized escape sequence", {
|
|
78168
|
+
toml: str,
|
|
78169
|
+
ptr: tmp
|
|
78170
|
+
});
|
|
78171
|
+
}
|
|
78172
|
+
sliceStart = ptr;
|
|
78173
|
+
} else if (!isLiteral && c2 === "\\") {
|
|
78174
|
+
tmp = ptr - 1;
|
|
78175
|
+
isEscape = true;
|
|
78176
|
+
parsed += str.slice(sliceStart, tmp);
|
|
78177
|
+
}
|
|
78178
|
+
}
|
|
78179
|
+
return parsed + str.slice(sliceStart, endPtr - 1);
|
|
78180
|
+
}
|
|
78181
|
+
function parseValue(value, toml, ptr, integersAsBigInt) {
|
|
78182
|
+
if (value === "true")
|
|
78183
|
+
return true;
|
|
78184
|
+
if (value === "false")
|
|
78185
|
+
return false;
|
|
78186
|
+
if (value === "-inf")
|
|
78187
|
+
return -Infinity;
|
|
78188
|
+
if (value === "inf" || value === "+inf")
|
|
78189
|
+
return Infinity;
|
|
78190
|
+
if (value === "nan" || value === "+nan" || value === "-nan")
|
|
78191
|
+
return NaN;
|
|
78192
|
+
if (value === "-0")
|
|
78193
|
+
return integersAsBigInt ? 0n : 0;
|
|
78194
|
+
let isInt = INT_REGEX.test(value);
|
|
78195
|
+
if (isInt || FLOAT_REGEX.test(value)) {
|
|
78196
|
+
if (LEADING_ZERO.test(value)) {
|
|
78197
|
+
throw new TomlError("leading zeroes are not allowed", {
|
|
78198
|
+
toml,
|
|
78199
|
+
ptr
|
|
78200
|
+
});
|
|
78201
|
+
}
|
|
78202
|
+
value = value.replace(/_/g, "");
|
|
78203
|
+
let numeric = +value;
|
|
78204
|
+
if (isNaN(numeric)) {
|
|
78205
|
+
throw new TomlError("invalid number", {
|
|
78206
|
+
toml,
|
|
78207
|
+
ptr
|
|
78208
|
+
});
|
|
78209
|
+
}
|
|
78210
|
+
if (isInt) {
|
|
78211
|
+
if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) {
|
|
78212
|
+
throw new TomlError("integer value cannot be represented losslessly", {
|
|
78213
|
+
toml,
|
|
78214
|
+
ptr
|
|
78215
|
+
});
|
|
78216
|
+
}
|
|
78217
|
+
if (isInt || integersAsBigInt === true)
|
|
78218
|
+
numeric = BigInt(value);
|
|
78219
|
+
}
|
|
78220
|
+
return numeric;
|
|
78221
|
+
}
|
|
78222
|
+
const date = new TomlDate(value);
|
|
78223
|
+
if (!date.isValid()) {
|
|
78224
|
+
throw new TomlError("invalid value", {
|
|
78225
|
+
toml,
|
|
78226
|
+
ptr
|
|
78227
|
+
});
|
|
78228
|
+
}
|
|
78229
|
+
return date;
|
|
78230
|
+
}
|
|
78231
|
+
|
|
78232
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/extract.js
|
|
78233
|
+
function sliceAndTrimEndOf(str, startPtr, endPtr, allowNewLines) {
|
|
78234
|
+
let value = str.slice(startPtr, endPtr);
|
|
78235
|
+
let commentIdx = value.indexOf("#");
|
|
78236
|
+
if (commentIdx > -1) {
|
|
78237
|
+
skipComment(str, commentIdx);
|
|
78238
|
+
value = value.slice(0, commentIdx);
|
|
78239
|
+
}
|
|
78240
|
+
let trimmed = value.trimEnd();
|
|
78241
|
+
if (!allowNewLines) {
|
|
78242
|
+
let newlineIdx = value.indexOf("\n", trimmed.length);
|
|
78243
|
+
if (newlineIdx > -1) {
|
|
78244
|
+
throw new TomlError("newlines are not allowed in inline tables", {
|
|
78245
|
+
toml: str,
|
|
78246
|
+
ptr: startPtr + newlineIdx
|
|
78247
|
+
});
|
|
78248
|
+
}
|
|
78249
|
+
}
|
|
78250
|
+
return [trimmed, commentIdx];
|
|
78251
|
+
}
|
|
78252
|
+
function extractValue(str, ptr, end, depth, integersAsBigInt) {
|
|
78253
|
+
if (depth === 0) {
|
|
78254
|
+
throw new TomlError("document contains excessively nested structures. aborting.", {
|
|
78255
|
+
toml: str,
|
|
78256
|
+
ptr
|
|
78257
|
+
});
|
|
78258
|
+
}
|
|
78259
|
+
let c2 = str[ptr];
|
|
78260
|
+
if (c2 === "[" || c2 === "{") {
|
|
78261
|
+
let [value, endPtr2] = c2 === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt);
|
|
78262
|
+
let newPtr = end ? skipUntil(str, endPtr2, ",", end) : endPtr2;
|
|
78263
|
+
if (endPtr2 - newPtr && end === "}") {
|
|
78264
|
+
let nextNewLine = indexOfNewline(str, endPtr2, newPtr);
|
|
78265
|
+
if (nextNewLine > -1) {
|
|
78266
|
+
throw new TomlError("newlines are not allowed in inline tables", {
|
|
78267
|
+
toml: str,
|
|
78268
|
+
ptr: nextNewLine
|
|
78269
|
+
});
|
|
78270
|
+
}
|
|
78271
|
+
}
|
|
78272
|
+
return [value, newPtr];
|
|
78273
|
+
}
|
|
78274
|
+
let endPtr;
|
|
78275
|
+
if (c2 === '"' || c2 === "'") {
|
|
78276
|
+
endPtr = getStringEnd(str, ptr);
|
|
78277
|
+
let parsed = parseString(str, ptr, endPtr);
|
|
78278
|
+
if (end) {
|
|
78279
|
+
endPtr = skipVoid(str, endPtr, end !== "]");
|
|
78280
|
+
if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") {
|
|
78281
|
+
throw new TomlError("unexpected character encountered", {
|
|
78282
|
+
toml: str,
|
|
78283
|
+
ptr: endPtr
|
|
78284
|
+
});
|
|
78285
|
+
}
|
|
78286
|
+
endPtr += +(str[endPtr] === ",");
|
|
78287
|
+
}
|
|
78288
|
+
return [parsed, endPtr];
|
|
78289
|
+
}
|
|
78290
|
+
endPtr = skipUntil(str, ptr, ",", end);
|
|
78291
|
+
let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ","), end === "]");
|
|
78292
|
+
if (!slice[0]) {
|
|
78293
|
+
throw new TomlError("incomplete key-value declaration: no value specified", {
|
|
78294
|
+
toml: str,
|
|
78295
|
+
ptr
|
|
78296
|
+
});
|
|
78297
|
+
}
|
|
78298
|
+
if (end && slice[1] > -1) {
|
|
78299
|
+
endPtr = skipVoid(str, ptr + slice[1]);
|
|
78300
|
+
endPtr += +(str[endPtr] === ",");
|
|
78301
|
+
}
|
|
78302
|
+
return [
|
|
78303
|
+
parseValue(slice[0], str, ptr, integersAsBigInt),
|
|
78304
|
+
endPtr
|
|
78305
|
+
];
|
|
78306
|
+
}
|
|
78307
|
+
|
|
78308
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/struct.js
|
|
78309
|
+
var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
78310
|
+
function parseKey(str, ptr, end = "=") {
|
|
78311
|
+
let dot = ptr - 1;
|
|
78312
|
+
let parsed = [];
|
|
78313
|
+
let endPtr = str.indexOf(end, ptr);
|
|
78314
|
+
if (endPtr < 0) {
|
|
78315
|
+
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
78316
|
+
toml: str,
|
|
78317
|
+
ptr
|
|
78318
|
+
});
|
|
78319
|
+
}
|
|
78320
|
+
do {
|
|
78321
|
+
let c2 = str[ptr = ++dot];
|
|
78322
|
+
if (c2 !== " " && c2 !== " ") {
|
|
78323
|
+
if (c2 === '"' || c2 === "'") {
|
|
78324
|
+
if (c2 === str[ptr + 1] && c2 === str[ptr + 2]) {
|
|
78325
|
+
throw new TomlError("multiline strings are not allowed in keys", {
|
|
78326
|
+
toml: str,
|
|
78327
|
+
ptr
|
|
78328
|
+
});
|
|
78329
|
+
}
|
|
78330
|
+
let eos = getStringEnd(str, ptr);
|
|
78331
|
+
if (eos < 0) {
|
|
78332
|
+
throw new TomlError("unfinished string encountered", {
|
|
78333
|
+
toml: str,
|
|
78334
|
+
ptr
|
|
78335
|
+
});
|
|
78336
|
+
}
|
|
78337
|
+
dot = str.indexOf(".", eos);
|
|
78338
|
+
let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
78339
|
+
let newLine = indexOfNewline(strEnd);
|
|
78340
|
+
if (newLine > -1) {
|
|
78341
|
+
throw new TomlError("newlines are not allowed in keys", {
|
|
78342
|
+
toml: str,
|
|
78343
|
+
ptr: ptr + dot + newLine
|
|
78344
|
+
});
|
|
78345
|
+
}
|
|
78346
|
+
if (strEnd.trimStart()) {
|
|
78347
|
+
throw new TomlError("found extra tokens after the string part", {
|
|
78348
|
+
toml: str,
|
|
78349
|
+
ptr: eos
|
|
78350
|
+
});
|
|
78351
|
+
}
|
|
78352
|
+
if (endPtr < eos) {
|
|
78353
|
+
endPtr = str.indexOf(end, eos);
|
|
78354
|
+
if (endPtr < 0) {
|
|
78355
|
+
throw new TomlError("incomplete key-value: cannot find end of key", {
|
|
78356
|
+
toml: str,
|
|
78357
|
+
ptr
|
|
78358
|
+
});
|
|
78359
|
+
}
|
|
78360
|
+
}
|
|
78361
|
+
parsed.push(parseString(str, ptr, eos));
|
|
78362
|
+
} else {
|
|
78363
|
+
dot = str.indexOf(".", ptr);
|
|
78364
|
+
let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot);
|
|
78365
|
+
if (!KEY_PART_RE.test(part)) {
|
|
78366
|
+
throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", {
|
|
78367
|
+
toml: str,
|
|
78368
|
+
ptr
|
|
78369
|
+
});
|
|
78370
|
+
}
|
|
78371
|
+
parsed.push(part.trimEnd());
|
|
78372
|
+
}
|
|
78373
|
+
}
|
|
78374
|
+
} while (dot + 1 && dot < endPtr);
|
|
78375
|
+
return [parsed, skipVoid(str, endPtr + 1, true, true)];
|
|
78376
|
+
}
|
|
78377
|
+
function parseInlineTable(str, ptr, depth, integersAsBigInt) {
|
|
78378
|
+
let res = {};
|
|
78379
|
+
let seen = /* @__PURE__ */ new Set();
|
|
78380
|
+
let c2;
|
|
78381
|
+
let comma = 0;
|
|
78382
|
+
ptr++;
|
|
78383
|
+
while ((c2 = str[ptr++]) !== "}" && c2) {
|
|
78384
|
+
let err = { toml: str, ptr: ptr - 1 };
|
|
78385
|
+
if (c2 === "\n") {
|
|
78386
|
+
throw new TomlError("newlines are not allowed in inline tables", err);
|
|
78387
|
+
} else if (c2 === "#") {
|
|
78388
|
+
throw new TomlError("inline tables cannot contain comments", err);
|
|
78389
|
+
} else if (c2 === ",") {
|
|
78390
|
+
throw new TomlError("expected key-value, found comma", err);
|
|
78391
|
+
} else if (c2 !== " " && c2 !== " ") {
|
|
78392
|
+
let k2;
|
|
78393
|
+
let t2 = res;
|
|
78394
|
+
let hasOwn = false;
|
|
78395
|
+
let [key, keyEndPtr] = parseKey(str, ptr - 1);
|
|
78396
|
+
for (let i = 0; i < key.length; i++) {
|
|
78397
|
+
if (i)
|
|
78398
|
+
t2 = hasOwn ? t2[k2] : t2[k2] = {};
|
|
78399
|
+
k2 = key[i];
|
|
78400
|
+
if ((hasOwn = Object.hasOwn(t2, k2)) && (typeof t2[k2] !== "object" || seen.has(t2[k2]))) {
|
|
78401
|
+
throw new TomlError("trying to redefine an already defined value", {
|
|
78402
|
+
toml: str,
|
|
78403
|
+
ptr
|
|
78404
|
+
});
|
|
78405
|
+
}
|
|
78406
|
+
if (!hasOwn && k2 === "__proto__") {
|
|
78407
|
+
Object.defineProperty(t2, k2, { enumerable: true, configurable: true, writable: true });
|
|
78408
|
+
}
|
|
78409
|
+
}
|
|
78410
|
+
if (hasOwn) {
|
|
78411
|
+
throw new TomlError("trying to redefine an already defined value", {
|
|
78412
|
+
toml: str,
|
|
78413
|
+
ptr
|
|
78414
|
+
});
|
|
78415
|
+
}
|
|
78416
|
+
let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt);
|
|
78417
|
+
seen.add(value);
|
|
78418
|
+
t2[k2] = value;
|
|
78419
|
+
ptr = valueEndPtr;
|
|
78420
|
+
comma = str[ptr - 1] === "," ? ptr - 1 : 0;
|
|
78421
|
+
}
|
|
78422
|
+
}
|
|
78423
|
+
if (comma) {
|
|
78424
|
+
throw new TomlError("trailing commas are not allowed in inline tables", {
|
|
78425
|
+
toml: str,
|
|
78426
|
+
ptr: comma
|
|
78427
|
+
});
|
|
78428
|
+
}
|
|
78429
|
+
if (!c2) {
|
|
78430
|
+
throw new TomlError("unfinished table encountered", {
|
|
78431
|
+
toml: str,
|
|
78432
|
+
ptr
|
|
78433
|
+
});
|
|
78434
|
+
}
|
|
78435
|
+
return [res, ptr];
|
|
78436
|
+
}
|
|
78437
|
+
function parseArray(str, ptr, depth, integersAsBigInt) {
|
|
78438
|
+
let res = [];
|
|
78439
|
+
let c2;
|
|
78440
|
+
ptr++;
|
|
78441
|
+
while ((c2 = str[ptr++]) !== "]" && c2) {
|
|
78442
|
+
if (c2 === ",") {
|
|
78443
|
+
throw new TomlError("expected value, found comma", {
|
|
78444
|
+
toml: str,
|
|
78445
|
+
ptr: ptr - 1
|
|
78446
|
+
});
|
|
78447
|
+
} else if (c2 === "#")
|
|
78448
|
+
ptr = skipComment(str, ptr);
|
|
78449
|
+
else if (c2 !== " " && c2 !== " " && c2 !== "\n" && c2 !== "\r") {
|
|
78450
|
+
let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt);
|
|
78451
|
+
res.push(e[0]);
|
|
78452
|
+
ptr = e[1];
|
|
78453
|
+
}
|
|
78454
|
+
}
|
|
78455
|
+
if (!c2) {
|
|
78456
|
+
throw new TomlError("unfinished array encountered", {
|
|
78457
|
+
toml: str,
|
|
78458
|
+
ptr
|
|
78459
|
+
});
|
|
78460
|
+
}
|
|
78461
|
+
return [res, ptr];
|
|
78462
|
+
}
|
|
78463
|
+
|
|
78464
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/parse.js
|
|
78465
|
+
function peekTable(key, table, meta, type) {
|
|
78466
|
+
let t2 = table;
|
|
78467
|
+
let m2 = meta;
|
|
78468
|
+
let k2;
|
|
78469
|
+
let hasOwn = false;
|
|
78470
|
+
let state;
|
|
78471
|
+
for (let i = 0; i < key.length; i++) {
|
|
78472
|
+
if (i) {
|
|
78473
|
+
t2 = hasOwn ? t2[k2] : t2[k2] = {};
|
|
78474
|
+
m2 = (state = m2[k2]).c;
|
|
78475
|
+
if (type === 0 && (state.t === 1 || state.t === 2)) {
|
|
78476
|
+
return null;
|
|
78477
|
+
}
|
|
78478
|
+
if (state.t === 2) {
|
|
78479
|
+
let l2 = t2.length - 1;
|
|
78480
|
+
t2 = t2[l2];
|
|
78481
|
+
m2 = m2[l2].c;
|
|
78482
|
+
}
|
|
78483
|
+
}
|
|
78484
|
+
k2 = key[i];
|
|
78485
|
+
if ((hasOwn = Object.hasOwn(t2, k2)) && m2[k2]?.t === 0 && m2[k2]?.d) {
|
|
78486
|
+
return null;
|
|
78487
|
+
}
|
|
78488
|
+
if (!hasOwn) {
|
|
78489
|
+
if (k2 === "__proto__") {
|
|
78490
|
+
Object.defineProperty(t2, k2, { enumerable: true, configurable: true, writable: true });
|
|
78491
|
+
Object.defineProperty(m2, k2, { enumerable: true, configurable: true, writable: true });
|
|
78492
|
+
}
|
|
78493
|
+
m2[k2] = {
|
|
78494
|
+
t: i < key.length - 1 && type === 2 ? 3 : type,
|
|
78495
|
+
d: false,
|
|
78496
|
+
i: 0,
|
|
78497
|
+
c: {}
|
|
78498
|
+
};
|
|
78499
|
+
}
|
|
78500
|
+
}
|
|
78501
|
+
state = m2[k2];
|
|
78502
|
+
if (state.t !== type && !(type === 1 && state.t === 3)) {
|
|
78503
|
+
return null;
|
|
78504
|
+
}
|
|
78505
|
+
if (type === 2) {
|
|
78506
|
+
if (!state.d) {
|
|
78507
|
+
state.d = true;
|
|
78508
|
+
t2[k2] = [];
|
|
78509
|
+
}
|
|
78510
|
+
t2[k2].push(t2 = {});
|
|
78511
|
+
state.c[state.i++] = state = { t: 1, d: false, i: 0, c: {} };
|
|
78512
|
+
}
|
|
78513
|
+
if (state.d) {
|
|
78514
|
+
return null;
|
|
78515
|
+
}
|
|
78516
|
+
state.d = true;
|
|
78517
|
+
if (type === 1) {
|
|
78518
|
+
t2 = hasOwn ? t2[k2] : t2[k2] = {};
|
|
78519
|
+
} else if (type === 0 && hasOwn) {
|
|
78520
|
+
return null;
|
|
78521
|
+
}
|
|
78522
|
+
return [k2, t2, state.c];
|
|
78523
|
+
}
|
|
78524
|
+
function parse(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
78525
|
+
let res = {};
|
|
78526
|
+
let meta = {};
|
|
78527
|
+
let tbl = res;
|
|
78528
|
+
let m2 = meta;
|
|
78529
|
+
for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) {
|
|
78530
|
+
if (toml[ptr] === "[") {
|
|
78531
|
+
let isTableArray = toml[++ptr] === "[";
|
|
78532
|
+
let k2 = parseKey(toml, ptr += +isTableArray, "]");
|
|
78533
|
+
if (isTableArray) {
|
|
78534
|
+
if (toml[k2[1] - 1] !== "]") {
|
|
78535
|
+
throw new TomlError("expected end of table declaration", {
|
|
78536
|
+
toml,
|
|
78537
|
+
ptr: k2[1] - 1
|
|
78538
|
+
});
|
|
78539
|
+
}
|
|
78540
|
+
k2[1]++;
|
|
78541
|
+
}
|
|
78542
|
+
let p2 = peekTable(
|
|
78543
|
+
k2[0],
|
|
78544
|
+
res,
|
|
78545
|
+
meta,
|
|
78546
|
+
isTableArray ? 2 : 1
|
|
78547
|
+
/* Type.EXPLICIT */
|
|
78548
|
+
);
|
|
78549
|
+
if (!p2) {
|
|
78550
|
+
throw new TomlError("trying to redefine an already defined table or value", {
|
|
78551
|
+
toml,
|
|
78552
|
+
ptr
|
|
78553
|
+
});
|
|
78554
|
+
}
|
|
78555
|
+
m2 = p2[2];
|
|
78556
|
+
tbl = p2[1];
|
|
78557
|
+
ptr = k2[1];
|
|
78558
|
+
} else {
|
|
78559
|
+
let k2 = parseKey(toml, ptr);
|
|
78560
|
+
let p2 = peekTable(
|
|
78561
|
+
k2[0],
|
|
78562
|
+
tbl,
|
|
78563
|
+
m2,
|
|
78564
|
+
0
|
|
78565
|
+
/* Type.DOTTED */
|
|
78566
|
+
);
|
|
78567
|
+
if (!p2) {
|
|
78568
|
+
throw new TomlError("trying to redefine an already defined table or value", {
|
|
78569
|
+
toml,
|
|
78570
|
+
ptr
|
|
78571
|
+
});
|
|
78572
|
+
}
|
|
78573
|
+
let v2 = extractValue(toml, k2[1], void 0, maxDepth, integersAsBigInt);
|
|
78574
|
+
p2[1][p2[0]] = v2[0];
|
|
78575
|
+
ptr = v2[1];
|
|
78576
|
+
}
|
|
78577
|
+
ptr = skipVoid(toml, ptr, true);
|
|
78578
|
+
if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") {
|
|
78579
|
+
throw new TomlError("each key-value declaration must be followed by an end-of-line", {
|
|
78580
|
+
toml,
|
|
78581
|
+
ptr
|
|
78582
|
+
});
|
|
78583
|
+
}
|
|
78584
|
+
ptr = skipVoid(toml, ptr);
|
|
78585
|
+
}
|
|
78586
|
+
return res;
|
|
78587
|
+
}
|
|
78588
|
+
|
|
78589
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/stringify.js
|
|
78590
|
+
var BARE_KEY = /^[a-z0-9-_]+$/i;
|
|
78591
|
+
function extendedTypeOf(obj) {
|
|
78592
|
+
let type = typeof obj;
|
|
78593
|
+
if (type === "object") {
|
|
78594
|
+
if (Array.isArray(obj))
|
|
78595
|
+
return "array";
|
|
78596
|
+
if (obj instanceof Date)
|
|
78597
|
+
return "date";
|
|
78598
|
+
}
|
|
78599
|
+
return type;
|
|
78600
|
+
}
|
|
78601
|
+
function isArrayOfTables(obj) {
|
|
78602
|
+
for (let i = 0; i < obj.length; i++) {
|
|
78603
|
+
if (extendedTypeOf(obj[i]) !== "object")
|
|
78604
|
+
return false;
|
|
78605
|
+
}
|
|
78606
|
+
return obj.length != 0;
|
|
78607
|
+
}
|
|
78608
|
+
function formatString(s) {
|
|
78609
|
+
return JSON.stringify(s).replace(/\x7f/g, "\\u007f");
|
|
78610
|
+
}
|
|
78611
|
+
function stringifyValue(val, type, depth, numberAsFloat) {
|
|
78612
|
+
if (depth === 0) {
|
|
78613
|
+
throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
78614
|
+
}
|
|
78615
|
+
if (type === "number") {
|
|
78616
|
+
if (isNaN(val))
|
|
78617
|
+
return "nan";
|
|
78618
|
+
if (val === Infinity)
|
|
78619
|
+
return "inf";
|
|
78620
|
+
if (val === -Infinity)
|
|
78621
|
+
return "-inf";
|
|
78622
|
+
if (numberAsFloat && Number.isInteger(val))
|
|
78623
|
+
return val.toFixed(1);
|
|
78624
|
+
return val.toString();
|
|
78625
|
+
}
|
|
78626
|
+
if (type === "bigint" || type === "boolean") {
|
|
78627
|
+
return val.toString();
|
|
78628
|
+
}
|
|
78629
|
+
if (type === "string") {
|
|
78630
|
+
return formatString(val);
|
|
78631
|
+
}
|
|
78632
|
+
if (type === "date") {
|
|
78633
|
+
if (isNaN(val.getTime())) {
|
|
78634
|
+
throw new TypeError("cannot serialize invalid date");
|
|
78635
|
+
}
|
|
78636
|
+
return val.toISOString();
|
|
78637
|
+
}
|
|
78638
|
+
if (type === "object") {
|
|
78639
|
+
return stringifyInlineTable(val, depth, numberAsFloat);
|
|
78640
|
+
}
|
|
78641
|
+
if (type === "array") {
|
|
78642
|
+
return stringifyArray(val, depth, numberAsFloat);
|
|
78643
|
+
}
|
|
78644
|
+
}
|
|
78645
|
+
function stringifyInlineTable(obj, depth, numberAsFloat) {
|
|
78646
|
+
let keys = Object.keys(obj);
|
|
78647
|
+
if (keys.length === 0)
|
|
78648
|
+
return "{}";
|
|
78649
|
+
let res = "{ ";
|
|
78650
|
+
for (let i = 0; i < keys.length; i++) {
|
|
78651
|
+
let k2 = keys[i];
|
|
78652
|
+
if (i)
|
|
78653
|
+
res += ", ";
|
|
78654
|
+
res += BARE_KEY.test(k2) ? k2 : formatString(k2);
|
|
78655
|
+
res += " = ";
|
|
78656
|
+
res += stringifyValue(obj[k2], extendedTypeOf(obj[k2]), depth - 1, numberAsFloat);
|
|
78657
|
+
}
|
|
78658
|
+
return res + " }";
|
|
78659
|
+
}
|
|
78660
|
+
function stringifyArray(array, depth, numberAsFloat) {
|
|
78661
|
+
if (array.length === 0)
|
|
78662
|
+
return "[]";
|
|
78663
|
+
let res = "[ ";
|
|
78664
|
+
for (let i = 0; i < array.length; i++) {
|
|
78665
|
+
if (i)
|
|
78666
|
+
res += ", ";
|
|
78667
|
+
if (array[i] === null || array[i] === void 0) {
|
|
78668
|
+
throw new TypeError("arrays cannot contain null or undefined values");
|
|
78669
|
+
}
|
|
78670
|
+
res += stringifyValue(array[i], extendedTypeOf(array[i]), depth - 1, numberAsFloat);
|
|
78671
|
+
}
|
|
78672
|
+
return res + " ]";
|
|
78673
|
+
}
|
|
78674
|
+
function stringifyArrayTable(array, key, depth, numberAsFloat) {
|
|
78675
|
+
if (depth === 0) {
|
|
78676
|
+
throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
78677
|
+
}
|
|
78678
|
+
let res = "";
|
|
78679
|
+
for (let i = 0; i < array.length; i++) {
|
|
78680
|
+
res += `${res && "\n"}[[${key}]]
|
|
78681
|
+
`;
|
|
78682
|
+
res += stringifyTable(0, array[i], key, depth, numberAsFloat);
|
|
78683
|
+
}
|
|
78684
|
+
return res;
|
|
78685
|
+
}
|
|
78686
|
+
function stringifyTable(tableKey, obj, prefix, depth, numberAsFloat) {
|
|
78687
|
+
if (depth === 0) {
|
|
78688
|
+
throw new Error("Could not stringify the object: maximum object depth exceeded");
|
|
78689
|
+
}
|
|
78690
|
+
let preamble = "";
|
|
78691
|
+
let tables = "";
|
|
78692
|
+
let keys = Object.keys(obj);
|
|
78693
|
+
for (let i = 0; i < keys.length; i++) {
|
|
78694
|
+
let k2 = keys[i];
|
|
78695
|
+
if (obj[k2] !== null && obj[k2] !== void 0) {
|
|
78696
|
+
let type = extendedTypeOf(obj[k2]);
|
|
78697
|
+
if (type === "symbol" || type === "function") {
|
|
78698
|
+
throw new TypeError(`cannot serialize values of type '${type}'`);
|
|
78699
|
+
}
|
|
78700
|
+
let key = BARE_KEY.test(k2) ? k2 : formatString(k2);
|
|
78701
|
+
if (type === "array" && isArrayOfTables(obj[k2])) {
|
|
78702
|
+
tables += (tables && "\n") + stringifyArrayTable(obj[k2], prefix ? `${prefix}.${key}` : key, depth - 1, numberAsFloat);
|
|
78703
|
+
} else if (type === "object") {
|
|
78704
|
+
let tblKey = prefix ? `${prefix}.${key}` : key;
|
|
78705
|
+
tables += (tables && "\n") + stringifyTable(tblKey, obj[k2], tblKey, depth - 1, numberAsFloat);
|
|
78706
|
+
} else {
|
|
78707
|
+
preamble += key;
|
|
78708
|
+
preamble += " = ";
|
|
78709
|
+
preamble += stringifyValue(obj[k2], type, depth, numberAsFloat);
|
|
78710
|
+
preamble += "\n";
|
|
78711
|
+
}
|
|
78712
|
+
}
|
|
78713
|
+
}
|
|
78714
|
+
if (tableKey && (preamble || !tables))
|
|
78715
|
+
preamble = preamble ? `[${tableKey}]
|
|
78716
|
+
${preamble}` : `[${tableKey}]`;
|
|
78717
|
+
return preamble && tables ? `${preamble}
|
|
78718
|
+
${tables}` : preamble || tables;
|
|
78719
|
+
}
|
|
78720
|
+
function stringify(obj, { maxDepth = 1e3, numbersAsFloat = false } = {}) {
|
|
78721
|
+
if (extendedTypeOf(obj) !== "object") {
|
|
78722
|
+
throw new TypeError("stringify can only be called with an object");
|
|
78723
|
+
}
|
|
78724
|
+
let str = stringifyTable(0, obj, "", maxDepth, numbersAsFloat);
|
|
78725
|
+
if (str[str.length - 1] !== "\n")
|
|
78726
|
+
return str + "\n";
|
|
78727
|
+
return str;
|
|
78728
|
+
}
|
|
78729
|
+
|
|
78730
|
+
// ../../node_modules/.pnpm/smol-toml@1.5.2/node_modules/smol-toml/dist/index.js
|
|
78731
|
+
var dist_default = { parse, stringify, TomlDate, TomlError };
|
|
78732
|
+
|
|
78733
|
+
// src/helpers/files.ts
|
|
79901
78734
|
var writeFile2 = (path6, content) => {
|
|
79902
78735
|
try {
|
|
79903
78736
|
import_fs6.default.writeFileSync(path6, content);
|
|
@@ -80100,20 +78933,20 @@ var package_default = {
|
|
|
80100
78933
|
dependencies: {
|
|
80101
78934
|
"create-astro": "4.13.2",
|
|
80102
78935
|
"create-analog": "1.8.1",
|
|
80103
|
-
"@angular/create": "20.3.
|
|
80104
|
-
"create-docusaurus": "3.9.
|
|
78936
|
+
"@angular/create": "20.3.10",
|
|
78937
|
+
"create-docusaurus": "3.9.2",
|
|
80105
78938
|
"create-hono": "0.19.3",
|
|
80106
78939
|
"create-next-app": "15.5.6",
|
|
80107
78940
|
"create-qwik": "1.17.2",
|
|
80108
78941
|
"create-vite": "7.1.1",
|
|
80109
|
-
"create-react-router": "7.9.
|
|
78942
|
+
"create-react-router": "7.9.6",
|
|
80110
78943
|
"create-solid": "0.6.11",
|
|
80111
78944
|
"create-vue": "3.18.2",
|
|
80112
78945
|
"create-waku": "0.12.5-0.27.0-0",
|
|
80113
|
-
"@tanstack/create-start": "0.
|
|
78946
|
+
"@tanstack/create-start": "0.36.2",
|
|
80114
78947
|
gatsby: "5.15.0",
|
|
80115
|
-
sv: "0.9.
|
|
80116
|
-
nuxi: "3.
|
|
78948
|
+
sv: "0.9.14",
|
|
78949
|
+
nuxi: "3.30.0"
|
|
80117
78950
|
}
|
|
80118
78951
|
};
|
|
80119
78952
|
|
|
@@ -82365,7 +81198,7 @@ var { npm: npm18 } = detectPackageManager();
|
|
|
82365
81198
|
var generate23 = async (ctx) => {
|
|
82366
81199
|
await runFrameworkGenerator(ctx, [
|
|
82367
81200
|
ctx.project.name,
|
|
82368
|
-
"--
|
|
81201
|
+
"--deployment",
|
|
82369
81202
|
"cloudflare",
|
|
82370
81203
|
"--framework",
|
|
82371
81204
|
"react",
|
|
@@ -82538,7 +81371,7 @@ var c3_default47 = config44;
|
|
|
82538
81371
|
var import_node_assert2 = __toESM(require("node:assert"));
|
|
82539
81372
|
|
|
82540
81373
|
// ../wrangler/package.json
|
|
82541
|
-
var version2 = "4.
|
|
81374
|
+
var version2 = "4.50.0";
|
|
82542
81375
|
|
|
82543
81376
|
// src/git.ts
|
|
82544
81377
|
var offerGit = async (ctx) => {
|
|
@@ -82796,10 +81629,35 @@ var isAllowedExistingFile = (file) => {
|
|
|
82796
81629
|
var defaultSelectVariant = async (ctx) => {
|
|
82797
81630
|
return ctx.args.lang;
|
|
82798
81631
|
};
|
|
81632
|
+
var templateSupportsLanguage = (config45, lang) => {
|
|
81633
|
+
const { copyFiles } = config45;
|
|
81634
|
+
if (!copyFiles || isVariantInfo(copyFiles)) {
|
|
81635
|
+
return false;
|
|
81636
|
+
}
|
|
81637
|
+
if (copyFiles.variants && !copyFiles.variants[lang]) {
|
|
81638
|
+
return false;
|
|
81639
|
+
}
|
|
81640
|
+
return true;
|
|
81641
|
+
};
|
|
81642
|
+
var filterTemplatesByLanguage = (templates, lang) => {
|
|
81643
|
+
if (!lang) {
|
|
81644
|
+
return templates;
|
|
81645
|
+
}
|
|
81646
|
+
return Object.fromEntries(
|
|
81647
|
+
Object.entries(templates).filter(([, config45]) => {
|
|
81648
|
+
if ("platformVariants" in config45) {
|
|
81649
|
+
return templateSupportsLanguage(config45.platformVariants.pages, lang) || templateSupportsLanguage(config45.platformVariants.workers, lang);
|
|
81650
|
+
}
|
|
81651
|
+
return templateSupportsLanguage(config45, lang);
|
|
81652
|
+
})
|
|
81653
|
+
);
|
|
81654
|
+
};
|
|
82799
81655
|
function getFrameworkMap({ experimental = false }) {
|
|
82800
81656
|
if (experimental) {
|
|
82801
81657
|
return {
|
|
82802
|
-
|
|
81658
|
+
gatsby: c3_default14,
|
|
81659
|
+
svelte: c3_default42,
|
|
81660
|
+
docusaurus: c3_default11
|
|
82803
81661
|
};
|
|
82804
81662
|
} else {
|
|
82805
81663
|
return {
|
|
@@ -82916,11 +81774,20 @@ var deriveCorrelatedArgs = (args) => {
|
|
|
82916
81774
|
var createContext = async (args, prevArgs) => {
|
|
82917
81775
|
deriveCorrelatedArgs(args);
|
|
82918
81776
|
const experimental = args.experimental;
|
|
82919
|
-
const frameworkMap =
|
|
82920
|
-
|
|
82921
|
-
|
|
82922
|
-
|
|
82923
|
-
const
|
|
81777
|
+
const frameworkMap = filterTemplatesByLanguage(
|
|
81778
|
+
getFrameworkMap({ experimental }),
|
|
81779
|
+
args.lang
|
|
81780
|
+
);
|
|
81781
|
+
const helloWorldTemplateMap = filterTemplatesByLanguage(
|
|
81782
|
+
getHelloWorldTemplateMap({
|
|
81783
|
+
experimental
|
|
81784
|
+
}),
|
|
81785
|
+
args.lang
|
|
81786
|
+
);
|
|
81787
|
+
const otherTemplateMap = filterTemplatesByLanguage(
|
|
81788
|
+
getOtherTemplateMap({ experimental }),
|
|
81789
|
+
args.lang
|
|
81790
|
+
);
|
|
82924
81791
|
let linesPrinted = 0;
|
|
82925
81792
|
const goBack = async (from) => {
|
|
82926
81793
|
const currentArgs = { ...args };
|
|
@@ -83098,6 +81965,11 @@ var createContext = async (args, prevArgs) => {
|
|
|
83098
81965
|
};
|
|
83099
81966
|
}
|
|
83100
81967
|
);
|
|
81968
|
+
if (args.lang && templateOptions.length === 0) {
|
|
81969
|
+
throw new Error(
|
|
81970
|
+
`No templates available for language "${args.lang}" in the "${category}" category.`
|
|
81971
|
+
);
|
|
81972
|
+
}
|
|
83101
81973
|
const type = await processArgument(args, "type", {
|
|
83102
81974
|
type: "select",
|
|
83103
81975
|
question: "Which template would you like to use?",
|
|
@@ -83406,7 +82278,7 @@ var addWranglerToGitIgnore = (ctx) => {
|
|
|
83406
82278
|
// src/helpers/args.ts
|
|
83407
82279
|
var cliDefinition = {
|
|
83408
82280
|
intro: `
|
|
83409
|
-
The create-cloudflare
|
|
82281
|
+
The create-cloudflare CLI (also known as C3) is a command-line tool designed to help you set up and deploy new applications to Cloudflare. In addition to speed, it leverages officially developed templates for Workers and framework-specific setup guides to ensure each new application that you set up follows Cloudflare and any third-party best practices for deployment on the Cloudflare network.
|
|
83410
82282
|
`,
|
|
83411
82283
|
positionals: [
|
|
83412
82284
|
{
|
|
@@ -83741,29 +82613,22 @@ var processArgument = async (args, key, promptConfig) => {
|
|
|
83741
82613
|
};
|
|
83742
82614
|
|
|
83743
82615
|
// src/deploy.ts
|
|
83744
|
-
var
|
|
82616
|
+
var import_promises6 = require("node:fs/promises");
|
|
83745
82617
|
var import_node_os4 = require("node:os");
|
|
83746
82618
|
var import_node_path6 = require("node:path");
|
|
83747
|
-
var import_toml3 = __toESM(require_toml());
|
|
83748
82619
|
|
|
83749
82620
|
// src/helpers/poll.ts
|
|
82621
|
+
var import_promises5 = require("node:timers/promises");
|
|
83750
82622
|
var import_dns2 = __toESM(require_dns22());
|
|
83751
82623
|
var import_undici3 = __toESM(require_undici());
|
|
83752
|
-
|
|
83753
|
-
|
|
83754
|
-
async function sleep(ms) {
|
|
83755
|
-
return new Promise((res) => setTimeout(res, ms));
|
|
83756
|
-
}
|
|
83757
|
-
|
|
83758
|
-
// src/helpers/poll.ts
|
|
83759
|
-
var TIMEOUT = 1e3 * 60 * 5;
|
|
83760
|
-
var POLL_INTERVAL = 1e3;
|
|
82624
|
+
var TIMEOUT_MS = 1e3 * 60 * 5;
|
|
82625
|
+
var POLL_INTERVAL_MS = 1e3;
|
|
83761
82626
|
var poll = async (url) => {
|
|
83762
82627
|
const start = Date.now();
|
|
83763
82628
|
const domain = new URL(url).host;
|
|
83764
82629
|
const s = spinner();
|
|
83765
82630
|
s.start("Waiting for DNS to propagate. This might take a few minutes.");
|
|
83766
|
-
await
|
|
82631
|
+
await (0, import_promises5.setTimeout)(1e4);
|
|
83767
82632
|
await pollDns(domain, start, s);
|
|
83768
82633
|
if (await pollHttp(url, start, s)) {
|
|
83769
82634
|
return true;
|
|
@@ -83776,7 +82641,7 @@ var poll = async (url) => {
|
|
|
83776
82641
|
return false;
|
|
83777
82642
|
};
|
|
83778
82643
|
var pollDns = async (domain, start, s) => {
|
|
83779
|
-
while (Date.now() - start <
|
|
82644
|
+
while (Date.now() - start < TIMEOUT_MS) {
|
|
83780
82645
|
s.update(
|
|
83781
82646
|
`Waiting for DNS to propagate. This might take a few minutes. (${secondsSince(start)}s)`
|
|
83782
82647
|
);
|
|
@@ -83784,12 +82649,12 @@ var pollDns = async (domain, start, s) => {
|
|
|
83784
82649
|
s.stop(`${brandColor("DNS propagation")} ${dim("complete")}.`);
|
|
83785
82650
|
return;
|
|
83786
82651
|
}
|
|
83787
|
-
await
|
|
82652
|
+
await (0, import_promises5.setTimeout)(POLL_INTERVAL_MS);
|
|
83788
82653
|
}
|
|
83789
82654
|
};
|
|
83790
82655
|
var pollHttp = async (url, start, s) => {
|
|
83791
82656
|
s.start("Waiting for deployment to become available");
|
|
83792
|
-
while (Date.now() - start <
|
|
82657
|
+
while (Date.now() - start < TIMEOUT_MS) {
|
|
83793
82658
|
s.update(
|
|
83794
82659
|
`Waiting for deployment to become available (${secondsSince(start)}s)`
|
|
83795
82660
|
);
|
|
@@ -83809,7 +82674,7 @@ var pollHttp = async (url, start, s) => {
|
|
|
83809
82674
|
throw e;
|
|
83810
82675
|
}
|
|
83811
82676
|
}
|
|
83812
|
-
await
|
|
82677
|
+
await (0, import_promises5.setTimeout)(POLL_INTERVAL_MS);
|
|
83813
82678
|
}
|
|
83814
82679
|
};
|
|
83815
82680
|
var isDomainResolvable = async (domain) => {
|
|
@@ -83844,7 +82709,6 @@ function secondsSince(start) {
|
|
|
83844
82709
|
// src/wrangler/config.ts
|
|
83845
82710
|
var import_fs13 = require("fs");
|
|
83846
82711
|
var import_path13 = require("path");
|
|
83847
|
-
var import_toml2 = __toESM(require_toml());
|
|
83848
82712
|
|
|
83849
82713
|
// src/helpers/json.ts
|
|
83850
82714
|
var import_comment_json2 = __toESM(require_src3());
|
|
@@ -83857,11 +82721,11 @@ function writeJSONWithComments(jsonFilePath, jsonObject) {
|
|
|
83857
82721
|
const jsonStr = (0, import_comment_json2.stringify)(jsonObject, null, " ");
|
|
83858
82722
|
writeFile2(jsonFilePath, jsonStr);
|
|
83859
82723
|
}
|
|
83860
|
-
function addJSONComment(jsonObject,
|
|
82724
|
+
function addJSONComment(jsonObject, descriptor, comment) {
|
|
83861
82725
|
if (!Array.isArray(comment)) {
|
|
83862
82726
|
comment = [comment];
|
|
83863
82727
|
}
|
|
83864
|
-
const commentHolder = jsonObject[Symbol.for(
|
|
82728
|
+
const commentHolder = jsonObject[Symbol.for(descriptor)] ?? [];
|
|
83865
82729
|
for (let c2 of comment) {
|
|
83866
82730
|
if (typeof c2 === "string") {
|
|
83867
82731
|
c2 = { value: c2 };
|
|
@@ -83874,7 +82738,7 @@ function addJSONComment(jsonObject, descriptor2, comment) {
|
|
|
83874
82738
|
...c2
|
|
83875
82739
|
});
|
|
83876
82740
|
}
|
|
83877
|
-
jsonObject[Symbol.for(
|
|
82741
|
+
jsonObject[Symbol.for(descriptor)] = commentHolder;
|
|
83878
82742
|
}
|
|
83879
82743
|
function appendJSONProperty(jsonObject, property, value) {
|
|
83880
82744
|
return (0, import_comment_json2.assign)(jsonObject, { [property]: value });
|
|
@@ -83934,7 +82798,7 @@ var updateWranglerConfig = async (ctx) => {
|
|
|
83934
82798
|
addVscodeConfig(ctx);
|
|
83935
82799
|
} else if (wranglerTomlExists(ctx)) {
|
|
83936
82800
|
const wranglerTomlStr = readWranglerToml(ctx);
|
|
83937
|
-
const parsed =
|
|
82801
|
+
const parsed = dist_default.parse(wranglerTomlStr);
|
|
83938
82802
|
parsed.name = ctx.project.name;
|
|
83939
82803
|
parsed["compatibility_date"] = await getCompatibilityDate(parsed);
|
|
83940
82804
|
parsed["observability"] ??= { enabled: true };
|
|
@@ -83942,7 +82806,7 @@ var updateWranglerConfig = async (ctx) => {
|
|
|
83942
82806
|
# For more details on how to configure Wrangler, refer to:
|
|
83943
82807
|
# https://developers.cloudflare.com/workers/wrangler/configuration/
|
|
83944
82808
|
`;
|
|
83945
|
-
const stringified = comment +
|
|
82809
|
+
const stringified = comment + dist_default.stringify(parsed);
|
|
83946
82810
|
writeWranglerToml(
|
|
83947
82811
|
ctx,
|
|
83948
82812
|
stringified + `
|
|
@@ -84089,7 +82953,7 @@ var readWranglerConfig = (ctx) => {
|
|
|
84089
82953
|
return readWranglerJson(ctx);
|
|
84090
82954
|
}
|
|
84091
82955
|
const wranglerTomlStr = readWranglerToml(ctx);
|
|
84092
|
-
return
|
|
82956
|
+
return dist_default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
|
|
84093
82957
|
};
|
|
84094
82958
|
var runDeploy = async (ctx) => {
|
|
84095
82959
|
const { npm: npm23, name: pm4 } = detectPackageManager();
|
|
@@ -84108,7 +82972,7 @@ var runDeploy = async (ctx) => {
|
|
|
84108
82972
|
] : []
|
|
84109
82973
|
];
|
|
84110
82974
|
const outputFile = (0, import_node_path6.join)(
|
|
84111
|
-
await (0,
|
|
82975
|
+
await (0, import_promises6.mkdtemp)((0, import_node_path6.join)((0, import_node_os4.tmpdir)(), "c3-wrangler-deploy-")),
|
|
84112
82976
|
"output.json"
|
|
84113
82977
|
);
|
|
84114
82978
|
await runCommand(deployCmd, {
|
|
@@ -84213,11 +83077,6 @@ var printSummary = (ctx) => {
|
|
|
84213
83077
|
const relativePath = (0, import_path14.relative)(ctx.originalCWD, ctx.project.path);
|
|
84214
83078
|
const cdCommand = relativePath ? `cd ${relativePath}` : null;
|
|
84215
83079
|
const { npm: npm23 } = detectPackageManager();
|
|
84216
|
-
const devServerCommand = quoteShellArgs([
|
|
84217
|
-
npm23,
|
|
84218
|
-
"run",
|
|
84219
|
-
ctx.template.devScript ?? "start"
|
|
84220
|
-
]);
|
|
84221
83080
|
const deployCommand = quoteShellArgs([
|
|
84222
83081
|
npm23,
|
|
84223
83082
|
"run",
|
|
@@ -84241,7 +83100,6 @@ var printSummary = (ctx) => {
|
|
|
84241
83100
|
lines.push(
|
|
84242
83101
|
`\u{1F4BB} Continue Developing`,
|
|
84243
83102
|
...cdCommand ? [`${gray("Change directories:")} ${blue(cdCommand)}`] : [],
|
|
84244
|
-
`${gray("Start dev server:")} ${blue(devServerCommand)}`,
|
|
84245
83103
|
`${gray(ctx.deployment.url ? `Deploy again:` : "Deploy:")} ${blue(deployCommand)}`,
|
|
84246
83104
|
``,
|
|
84247
83105
|
`\u{1F4D6} Explore Documentation`,
|
|
@@ -84587,6 +83445,7 @@ var renderValues = (values) => {
|
|
|
84587
83445
|
};
|
|
84588
83446
|
|
|
84589
83447
|
// src/helpers/retry.ts
|
|
83448
|
+
var import_promises7 = require("node:timers/promises");
|
|
84590
83449
|
var retry = async (config45, fn) => {
|
|
84591
83450
|
let { times } = config45;
|
|
84592
83451
|
let error2 = null;
|
|
@@ -84599,7 +83458,7 @@ var retry = async (config45, fn) => {
|
|
|
84599
83458
|
if (config45.exitCondition?.(e)) {
|
|
84600
83459
|
break;
|
|
84601
83460
|
}
|
|
84602
|
-
await
|
|
83461
|
+
await (0, import_promises7.setTimeout)(config45.sleepMs ?? 1e3);
|
|
84603
83462
|
}
|
|
84604
83463
|
}
|
|
84605
83464
|
throw error2;
|
|
@@ -84688,7 +83547,6 @@ var createProject = async (ctx) => {
|
|
|
84688
83547
|
// src/workers.ts
|
|
84689
83548
|
var import_fs14 = require("fs");
|
|
84690
83549
|
var import_path15 = require("path");
|
|
84691
|
-
var import_toml4 = __toESM(require_toml());
|
|
84692
83550
|
|
|
84693
83551
|
// ../../node_modules/.pnpm/jsonc-parser@3.2.0/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
84694
83552
|
function createScanner(text, ignoreTrivia = false) {
|
|
@@ -84729,15 +83587,15 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
84729
83587
|
pos++;
|
|
84730
83588
|
} else {
|
|
84731
83589
|
pos++;
|
|
84732
|
-
while (pos < text.length &&
|
|
83590
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
84733
83591
|
pos++;
|
|
84734
83592
|
}
|
|
84735
83593
|
}
|
|
84736
83594
|
if (pos < text.length && text.charCodeAt(pos) === 46) {
|
|
84737
83595
|
pos++;
|
|
84738
|
-
if (pos < text.length &&
|
|
83596
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
84739
83597
|
pos++;
|
|
84740
|
-
while (pos < text.length &&
|
|
83598
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
84741
83599
|
pos++;
|
|
84742
83600
|
}
|
|
84743
83601
|
} else {
|
|
@@ -84751,9 +83609,9 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
84751
83609
|
if (pos < text.length && text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45) {
|
|
84752
83610
|
pos++;
|
|
84753
83611
|
}
|
|
84754
|
-
if (pos < text.length &&
|
|
83612
|
+
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
84755
83613
|
pos++;
|
|
84756
|
-
while (pos < text.length &&
|
|
83614
|
+
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
84757
83615
|
pos++;
|
|
84758
83616
|
}
|
|
84759
83617
|
end = pos;
|
|
@@ -84940,7 +83798,7 @@ function createScanner(text, ignoreTrivia = false) {
|
|
|
84940
83798
|
case 45:
|
|
84941
83799
|
value += String.fromCharCode(code);
|
|
84942
83800
|
pos++;
|
|
84943
|
-
if (pos === len || !
|
|
83801
|
+
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
84944
83802
|
return token = 16;
|
|
84945
83803
|
}
|
|
84946
83804
|
// found a minus, followed by a number so
|
|
@@ -85024,7 +83882,7 @@ function isWhiteSpace(ch) {
|
|
|
85024
83882
|
function isLineBreak(ch) {
|
|
85025
83883
|
return ch === 10 || ch === 13;
|
|
85026
83884
|
}
|
|
85027
|
-
function
|
|
83885
|
+
function isDigit(ch) {
|
|
85028
83886
|
return ch >= 48 && ch <= 57;
|
|
85029
83887
|
}
|
|
85030
83888
|
var CharacterCodes;
|
|
@@ -85346,7 +84204,7 @@ var ParseOptions;
|
|
|
85346
84204
|
allowTrailingComma: false
|
|
85347
84205
|
};
|
|
85348
84206
|
})(ParseOptions || (ParseOptions = {}));
|
|
85349
|
-
function
|
|
84207
|
+
function parse5(text, errors = [], options = ParseOptions.DEFAULT) {
|
|
85350
84208
|
let currentProperty = null;
|
|
85351
84209
|
let currentParent = [];
|
|
85352
84210
|
const previousParents = [];
|
|
@@ -85565,22 +84423,22 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85565
84423
|
}
|
|
85566
84424
|
}
|
|
85567
84425
|
}
|
|
85568
|
-
function handleError(error2, skipUntilAfter = [],
|
|
84426
|
+
function handleError(error2, skipUntilAfter = [], skipUntil2 = []) {
|
|
85569
84427
|
onError(error2);
|
|
85570
|
-
if (skipUntilAfter.length +
|
|
84428
|
+
if (skipUntilAfter.length + skipUntil2.length > 0) {
|
|
85571
84429
|
let token = _scanner.getToken();
|
|
85572
84430
|
while (token !== 17) {
|
|
85573
84431
|
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
85574
84432
|
scanNext();
|
|
85575
84433
|
break;
|
|
85576
|
-
} else if (
|
|
84434
|
+
} else if (skipUntil2.indexOf(token) !== -1) {
|
|
85577
84435
|
break;
|
|
85578
84436
|
}
|
|
85579
84437
|
token = scanNext();
|
|
85580
84438
|
}
|
|
85581
84439
|
}
|
|
85582
84440
|
}
|
|
85583
|
-
function
|
|
84441
|
+
function parseString2(isValue) {
|
|
85584
84442
|
const value = _scanner.getTokenValue();
|
|
85585
84443
|
if (isValue) {
|
|
85586
84444
|
onLiteralValue(value);
|
|
@@ -85629,11 +84487,11 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85629
84487
|
]);
|
|
85630
84488
|
return false;
|
|
85631
84489
|
}
|
|
85632
|
-
|
|
84490
|
+
parseString2(false);
|
|
85633
84491
|
if (_scanner.getToken() === 6) {
|
|
85634
84492
|
onSeparator(":");
|
|
85635
84493
|
scanNext();
|
|
85636
|
-
if (!
|
|
84494
|
+
if (!parseValue2()) {
|
|
85637
84495
|
handleError(4, [], [
|
|
85638
84496
|
2,
|
|
85639
84497
|
5
|
|
@@ -85687,7 +84545,7 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85687
84545
|
}
|
|
85688
84546
|
return true;
|
|
85689
84547
|
}
|
|
85690
|
-
function
|
|
84548
|
+
function parseArray2() {
|
|
85691
84549
|
onArrayBegin();
|
|
85692
84550
|
scanNext();
|
|
85693
84551
|
let isFirstElement = true;
|
|
@@ -85711,7 +84569,7 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85711
84569
|
} else {
|
|
85712
84570
|
_jsonPath[_jsonPath.length - 1]++;
|
|
85713
84571
|
}
|
|
85714
|
-
if (!
|
|
84572
|
+
if (!parseValue2()) {
|
|
85715
84573
|
handleError(4, [], [
|
|
85716
84574
|
4,
|
|
85717
84575
|
5
|
|
@@ -85734,14 +84592,14 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85734
84592
|
}
|
|
85735
84593
|
return true;
|
|
85736
84594
|
}
|
|
85737
|
-
function
|
|
84595
|
+
function parseValue2() {
|
|
85738
84596
|
switch (_scanner.getToken()) {
|
|
85739
84597
|
case 3:
|
|
85740
|
-
return
|
|
84598
|
+
return parseArray2();
|
|
85741
84599
|
case 1:
|
|
85742
84600
|
return parseObject();
|
|
85743
84601
|
case 10:
|
|
85744
|
-
return
|
|
84602
|
+
return parseString2(true);
|
|
85745
84603
|
default:
|
|
85746
84604
|
return parseLiteral();
|
|
85747
84605
|
}
|
|
@@ -85754,7 +84612,7 @@ function visit2(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
85754
84612
|
handleError(4, [], []);
|
|
85755
84613
|
return false;
|
|
85756
84614
|
}
|
|
85757
|
-
if (!
|
|
84615
|
+
if (!parseValue2()) {
|
|
85758
84616
|
handleError(4, [], []);
|
|
85759
84617
|
return false;
|
|
85760
84618
|
}
|
|
@@ -85959,7 +84817,7 @@ var SyntaxKind;
|
|
|
85959
84817
|
SyntaxKind2[SyntaxKind2["Unknown"] = 16] = "Unknown";
|
|
85960
84818
|
SyntaxKind2[SyntaxKind2["EOF"] = 17] = "EOF";
|
|
85961
84819
|
})(SyntaxKind || (SyntaxKind = {}));
|
|
85962
|
-
var
|
|
84820
|
+
var parse6 = parse5;
|
|
85963
84821
|
var ParseErrorCode;
|
|
85964
84822
|
(function(ParseErrorCode2) {
|
|
85965
84823
|
ParseErrorCode2[ParseErrorCode2["InvalidSymbol"] = 1] = "InvalidSymbol";
|
|
@@ -86044,7 +84902,7 @@ var maybeInstallNodeTypes = async (ctx, npm23) => {
|
|
|
86044
84902
|
parsedConfig = readWranglerJson(ctx);
|
|
86045
84903
|
} else if (wranglerTomlExists(ctx)) {
|
|
86046
84904
|
const wranglerTomlStr = readWranglerToml(ctx);
|
|
86047
|
-
parsedConfig =
|
|
84905
|
+
parsedConfig = dist_default.parse(wranglerTomlStr);
|
|
86048
84906
|
}
|
|
86049
84907
|
const compatibilityFlags = Array.isArray(parsedConfig["compatibility_flags"]) ? parsedConfig["compatibility_flags"] : [];
|
|
86050
84908
|
if (compatibilityFlags.includes("nodejs_compat") || compatibilityFlags.includes("nodejs_compat_v2")) {
|
|
@@ -86064,7 +84922,7 @@ async function updateTsConfig(ctx, { usesNodeCompat }) {
|
|
|
86064
84922
|
}
|
|
86065
84923
|
const tsconfig = readFile(tsconfigPath);
|
|
86066
84924
|
try {
|
|
86067
|
-
const config45 =
|
|
84925
|
+
const config45 = parse6(tsconfig);
|
|
86068
84926
|
const currentTypes = config45.compilerOptions?.types ?? [];
|
|
86069
84927
|
let newTypes = [...currentTypes];
|
|
86070
84928
|
if (ctx.template.workersTypes === "installed") {
|
|
@@ -86192,7 +85050,9 @@ var create = async (ctx) => {
|
|
|
86192
85050
|
if (template.generate) {
|
|
86193
85051
|
await template.generate(ctx);
|
|
86194
85052
|
}
|
|
86195
|
-
|
|
85053
|
+
if (!ctx.args.experimental) {
|
|
85054
|
+
await copyTemplateFiles(ctx);
|
|
85055
|
+
}
|
|
86196
85056
|
await updatePackageName(ctx);
|
|
86197
85057
|
(0, import_process2.chdir)(ctx.project.path);
|
|
86198
85058
|
await npmInstall(ctx);
|
|
@@ -86200,16 +85060,24 @@ var create = async (ctx) => {
|
|
|
86200
85060
|
endSection(`Application created`);
|
|
86201
85061
|
};
|
|
86202
85062
|
var configure15 = async (ctx) => {
|
|
86203
|
-
startSection(
|
|
85063
|
+
startSection(
|
|
85064
|
+
"Configuring your application for Cloudflare via `wrangler setup`",
|
|
85065
|
+
"Step 2 of 3"
|
|
85066
|
+
);
|
|
86204
85067
|
await installWrangler();
|
|
86205
|
-
|
|
86206
|
-
|
|
86207
|
-
|
|
86208
|
-
|
|
85068
|
+
if (ctx.args.experimental) {
|
|
85069
|
+
const { npx: npx6 } = detectPackageManager();
|
|
85070
|
+
await runCommand([npx6, "wrangler", "setup", "--yes"]);
|
|
85071
|
+
} else {
|
|
85072
|
+
await updateWranglerConfig(ctx);
|
|
85073
|
+
const { template } = ctx;
|
|
85074
|
+
if (template.configure) {
|
|
85075
|
+
await template.configure({ ...ctx });
|
|
85076
|
+
}
|
|
85077
|
+
addWranglerToGitIgnore(ctx);
|
|
85078
|
+
await updatePackageScripts(ctx);
|
|
85079
|
+
await addTypes(ctx);
|
|
86209
85080
|
}
|
|
86210
|
-
addWranglerToGitIgnore(ctx);
|
|
86211
|
-
await updatePackageScripts(ctx);
|
|
86212
|
-
await addTypes(ctx);
|
|
86213
85081
|
await offerGit(ctx);
|
|
86214
85082
|
await gitCommit(ctx);
|
|
86215
85083
|
endSection(`Application configured`);
|
|
@@ -86278,4 +85146,41 @@ yargs-parser/build/lib/index.js:
|
|
|
86278
85146
|
* Copyright (c) 2016, Contributors
|
|
86279
85147
|
* SPDX-License-Identifier: ISC
|
|
86280
85148
|
*)
|
|
85149
|
+
|
|
85150
|
+
smol-toml/dist/error.js:
|
|
85151
|
+
smol-toml/dist/util.js:
|
|
85152
|
+
smol-toml/dist/date.js:
|
|
85153
|
+
smol-toml/dist/primitive.js:
|
|
85154
|
+
smol-toml/dist/extract.js:
|
|
85155
|
+
smol-toml/dist/struct.js:
|
|
85156
|
+
smol-toml/dist/parse.js:
|
|
85157
|
+
smol-toml/dist/stringify.js:
|
|
85158
|
+
smol-toml/dist/index.js:
|
|
85159
|
+
(*!
|
|
85160
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
85161
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
85162
|
+
*
|
|
85163
|
+
* Redistribution and use in source and binary forms, with or without
|
|
85164
|
+
* modification, are permitted provided that the following conditions are met:
|
|
85165
|
+
*
|
|
85166
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
85167
|
+
* list of conditions and the following disclaimer.
|
|
85168
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
85169
|
+
* this list of conditions and the following disclaimer in the
|
|
85170
|
+
* documentation and/or other materials provided with the distribution.
|
|
85171
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
85172
|
+
* may be used to endorse or promote products derived from this software without
|
|
85173
|
+
* specific prior written permission.
|
|
85174
|
+
*
|
|
85175
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
85176
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
85177
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
85178
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
85179
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
85180
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
85181
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
85182
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
85183
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
85184
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
85185
|
+
*)
|
|
86281
85186
|
*/
|