@tscircuit/cli 0.1.1398 → 0.1.1399
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/build/build.worker.js +171 -44
- package/dist/cli/main.js +1094 -333
- package/dist/cli/snapshot/snapshot.worker.js +172 -43
- package/dist/lib/index.js +174 -102
- package/package.json +3 -3
|
@@ -5487,6 +5487,9 @@ var require_data = __commonJS((exports, module) => {
|
|
|
5487
5487
|
var require_utils = __commonJS((exports, module) => {
|
|
5488
5488
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
5489
5489
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
5490
|
+
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
5491
|
+
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
5492
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
|
|
5490
5493
|
function stringArrayToHexStripped(input) {
|
|
5491
5494
|
let acc = "";
|
|
5492
5495
|
let code = 0;
|
|
@@ -5680,27 +5683,77 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
5680
5683
|
}
|
|
5681
5684
|
return output.join("");
|
|
5682
5685
|
}
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5686
|
+
var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
|
|
5687
|
+
var HOST_DELIM_RE = /[@/?#:]/g;
|
|
5688
|
+
var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
|
|
5689
|
+
function reescapeHostDelimiters(host, isIP) {
|
|
5690
|
+
const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
|
|
5691
|
+
re.lastIndex = 0;
|
|
5692
|
+
return host.replace(re, (ch) => HOST_DELIMS[ch]);
|
|
5693
|
+
}
|
|
5694
|
+
function normalizePercentEncoding(input, decodeUnreserved = false) {
|
|
5695
|
+
if (input.indexOf("%") === -1) {
|
|
5696
|
+
return input;
|
|
5693
5697
|
}
|
|
5694
|
-
|
|
5695
|
-
|
|
5698
|
+
let output = "";
|
|
5699
|
+
for (let i = 0;i < input.length; i++) {
|
|
5700
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5701
|
+
const hex = input.slice(i + 1, i + 3);
|
|
5702
|
+
if (isHexPair(hex)) {
|
|
5703
|
+
const normalizedHex = hex.toUpperCase();
|
|
5704
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
5705
|
+
if (decodeUnreserved && isUnreserved(decoded)) {
|
|
5706
|
+
output += decoded;
|
|
5707
|
+
} else {
|
|
5708
|
+
output += "%" + normalizedHex;
|
|
5709
|
+
}
|
|
5710
|
+
i += 2;
|
|
5711
|
+
continue;
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
output += input[i];
|
|
5696
5715
|
}
|
|
5697
|
-
|
|
5698
|
-
|
|
5716
|
+
return output;
|
|
5717
|
+
}
|
|
5718
|
+
function normalizePathEncoding(input) {
|
|
5719
|
+
let output = "";
|
|
5720
|
+
for (let i = 0;i < input.length; i++) {
|
|
5721
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5722
|
+
const hex = input.slice(i + 1, i + 3);
|
|
5723
|
+
if (isHexPair(hex)) {
|
|
5724
|
+
const normalizedHex = hex.toUpperCase();
|
|
5725
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
5726
|
+
if (decoded !== "." && isUnreserved(decoded)) {
|
|
5727
|
+
output += decoded;
|
|
5728
|
+
} else {
|
|
5729
|
+
output += "%" + normalizedHex;
|
|
5730
|
+
}
|
|
5731
|
+
i += 2;
|
|
5732
|
+
continue;
|
|
5733
|
+
}
|
|
5734
|
+
}
|
|
5735
|
+
if (isPathCharacter(input[i])) {
|
|
5736
|
+
output += input[i];
|
|
5737
|
+
} else {
|
|
5738
|
+
output += escape(input[i]);
|
|
5739
|
+
}
|
|
5699
5740
|
}
|
|
5700
|
-
|
|
5701
|
-
|
|
5741
|
+
return output;
|
|
5742
|
+
}
|
|
5743
|
+
function escapePreservingEscapes(input) {
|
|
5744
|
+
let output = "";
|
|
5745
|
+
for (let i = 0;i < input.length; i++) {
|
|
5746
|
+
if (input[i] === "%" && i + 2 < input.length) {
|
|
5747
|
+
const hex = input.slice(i + 1, i + 3);
|
|
5748
|
+
if (isHexPair(hex)) {
|
|
5749
|
+
output += "%" + hex.toUpperCase();
|
|
5750
|
+
i += 2;
|
|
5751
|
+
continue;
|
|
5752
|
+
}
|
|
5753
|
+
}
|
|
5754
|
+
output += escape(input[i]);
|
|
5702
5755
|
}
|
|
5703
|
-
return
|
|
5756
|
+
return output;
|
|
5704
5757
|
}
|
|
5705
5758
|
function recomposeAuthority(component) {
|
|
5706
5759
|
const uriTokens = [];
|
|
@@ -5715,7 +5768,7 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
5715
5768
|
if (ipV6res.isIPV6 === true) {
|
|
5716
5769
|
host = `[${ipV6res.escapedHost}]`;
|
|
5717
5770
|
} else {
|
|
5718
|
-
host =
|
|
5771
|
+
host = reescapeHostDelimiters(host, false);
|
|
5719
5772
|
}
|
|
5720
5773
|
}
|
|
5721
5774
|
uriTokens.push(host);
|
|
@@ -5729,7 +5782,10 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
5729
5782
|
module.exports = {
|
|
5730
5783
|
nonSimpleDomain,
|
|
5731
5784
|
recomposeAuthority,
|
|
5732
|
-
|
|
5785
|
+
reescapeHostDelimiters,
|
|
5786
|
+
normalizePercentEncoding,
|
|
5787
|
+
normalizePathEncoding,
|
|
5788
|
+
escapePreservingEscapes,
|
|
5733
5789
|
removeDotSegments,
|
|
5734
5790
|
isIPv4,
|
|
5735
5791
|
isUUID,
|
|
@@ -5914,11 +5970,11 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
5914
5970
|
|
|
5915
5971
|
// node_modules/fast-uri/index.js
|
|
5916
5972
|
var require_fast_uri = __commonJS((exports, module) => {
|
|
5917
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority,
|
|
5973
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
5918
5974
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
5919
5975
|
function normalize(uri, options) {
|
|
5920
5976
|
if (typeof uri === "string") {
|
|
5921
|
-
uri =
|
|
5977
|
+
uri = normalizeString(uri, options);
|
|
5922
5978
|
} else if (typeof uri === "object") {
|
|
5923
5979
|
uri = parse(serialize(uri, options), options);
|
|
5924
5980
|
}
|
|
@@ -5984,19 +6040,9 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
5984
6040
|
return target;
|
|
5985
6041
|
}
|
|
5986
6042
|
function equal(uriA, uriB, options) {
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
} else if (typeof uriA === "object") {
|
|
5991
|
-
uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
|
|
5992
|
-
}
|
|
5993
|
-
if (typeof uriB === "string") {
|
|
5994
|
-
uriB = unescape(uriB);
|
|
5995
|
-
uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
|
|
5996
|
-
} else if (typeof uriB === "object") {
|
|
5997
|
-
uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
|
|
5998
|
-
}
|
|
5999
|
-
return uriA.toLowerCase() === uriB.toLowerCase();
|
|
6043
|
+
const normalizedA = normalizeComparableURI(uriA, options);
|
|
6044
|
+
const normalizedB = normalizeComparableURI(uriB, options);
|
|
6045
|
+
return normalizedA !== undefined && normalizedB !== undefined && normalizedA.toLowerCase() === normalizedB.toLowerCase();
|
|
6000
6046
|
}
|
|
6001
6047
|
function serialize(cmpts, opts) {
|
|
6002
6048
|
const component = {
|
|
@@ -6022,12 +6068,12 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6022
6068
|
schemeHandler.serialize(component, options);
|
|
6023
6069
|
if (component.path !== undefined) {
|
|
6024
6070
|
if (!options.skipEscape) {
|
|
6025
|
-
component.path =
|
|
6071
|
+
component.path = escapePreservingEscapes(component.path);
|
|
6026
6072
|
if (component.scheme !== undefined) {
|
|
6027
6073
|
component.path = component.path.split("%3A").join(":");
|
|
6028
6074
|
}
|
|
6029
6075
|
} else {
|
|
6030
|
-
component.path =
|
|
6076
|
+
component.path = normalizePercentEncoding(component.path);
|
|
6031
6077
|
}
|
|
6032
6078
|
}
|
|
6033
6079
|
if (options.reference !== "suffix" && component.scheme) {
|
|
@@ -6062,7 +6108,16 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6062
6108
|
return uriTokens.join("");
|
|
6063
6109
|
}
|
|
6064
6110
|
var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
|
|
6065
|
-
function
|
|
6111
|
+
function getParseError(parsed, matches) {
|
|
6112
|
+
if (matches[2] !== undefined && parsed.path && parsed.path[0] !== "/") {
|
|
6113
|
+
return 'URI path must start with "/" when authority is present.';
|
|
6114
|
+
}
|
|
6115
|
+
if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
|
|
6116
|
+
return "URI port is malformed.";
|
|
6117
|
+
}
|
|
6118
|
+
return;
|
|
6119
|
+
}
|
|
6120
|
+
function parseWithStatus(uri, opts) {
|
|
6066
6121
|
const options = Object.assign({}, opts);
|
|
6067
6122
|
const parsed = {
|
|
6068
6123
|
scheme: undefined,
|
|
@@ -6073,6 +6128,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6073
6128
|
query: undefined,
|
|
6074
6129
|
fragment: undefined
|
|
6075
6130
|
};
|
|
6131
|
+
let malformedAuthorityOrPort = false;
|
|
6076
6132
|
let isIP = false;
|
|
6077
6133
|
if (options.reference === "suffix") {
|
|
6078
6134
|
if (options.scheme) {
|
|
@@ -6093,6 +6149,11 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6093
6149
|
if (isNaN(parsed.port)) {
|
|
6094
6150
|
parsed.port = matches[5];
|
|
6095
6151
|
}
|
|
6152
|
+
const parseError = getParseError(parsed, matches);
|
|
6153
|
+
if (parseError !== undefined) {
|
|
6154
|
+
parsed.error = parsed.error || parseError;
|
|
6155
|
+
malformedAuthorityOrPort = true;
|
|
6156
|
+
}
|
|
6096
6157
|
if (parsed.host) {
|
|
6097
6158
|
const ipv4result = isIPv4(parsed.host);
|
|
6098
6159
|
if (ipv4result === false) {
|
|
@@ -6131,14 +6192,18 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6131
6192
|
parsed.scheme = unescape(parsed.scheme);
|
|
6132
6193
|
}
|
|
6133
6194
|
if (parsed.host !== undefined) {
|
|
6134
|
-
parsed.host = unescape(parsed.host);
|
|
6195
|
+
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
6135
6196
|
}
|
|
6136
6197
|
}
|
|
6137
6198
|
if (parsed.path) {
|
|
6138
|
-
parsed.path =
|
|
6199
|
+
parsed.path = normalizePathEncoding(parsed.path);
|
|
6139
6200
|
}
|
|
6140
6201
|
if (parsed.fragment) {
|
|
6141
|
-
|
|
6202
|
+
try {
|
|
6203
|
+
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
6204
|
+
} catch {
|
|
6205
|
+
parsed.error = parsed.error || "URI malformed";
|
|
6206
|
+
}
|
|
6142
6207
|
}
|
|
6143
6208
|
}
|
|
6144
6209
|
if (schemeHandler && schemeHandler.parse) {
|
|
@@ -6147,7 +6212,29 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
6147
6212
|
} else {
|
|
6148
6213
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
6149
6214
|
}
|
|
6150
|
-
return parsed;
|
|
6215
|
+
return { parsed, malformedAuthorityOrPort };
|
|
6216
|
+
}
|
|
6217
|
+
function parse(uri, opts) {
|
|
6218
|
+
return parseWithStatus(uri, opts).parsed;
|
|
6219
|
+
}
|
|
6220
|
+
function normalizeString(uri, opts) {
|
|
6221
|
+
return normalizeStringWithStatus(uri, opts).normalized;
|
|
6222
|
+
}
|
|
6223
|
+
function normalizeStringWithStatus(uri, opts) {
|
|
6224
|
+
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
6225
|
+
return {
|
|
6226
|
+
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
6227
|
+
malformedAuthorityOrPort
|
|
6228
|
+
};
|
|
6229
|
+
}
|
|
6230
|
+
function normalizeComparableURI(uri, opts) {
|
|
6231
|
+
if (typeof uri === "string") {
|
|
6232
|
+
const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
|
|
6233
|
+
return malformedAuthorityOrPort ? undefined : normalized;
|
|
6234
|
+
}
|
|
6235
|
+
if (typeof uri === "object") {
|
|
6236
|
+
return serialize(uri, opts);
|
|
6237
|
+
}
|
|
6151
6238
|
}
|
|
6152
6239
|
var fastUri = {
|
|
6153
6240
|
SCHEMES,
|
|
@@ -6282,7 +6369,7 @@ var require_core = __commonJS((exports) => {
|
|
|
6282
6369
|
constructor(opts = {}) {
|
|
6283
6370
|
this.schemas = {};
|
|
6284
6371
|
this.refs = {};
|
|
6285
|
-
this.formats =
|
|
6372
|
+
this.formats = Object.create(null);
|
|
6286
6373
|
this._compilations = new Set;
|
|
6287
6374
|
this._loading = {};
|
|
6288
6375
|
this._cache = new Map;
|
|
@@ -10449,6 +10536,44 @@ var require_coerce = __commonJS((exports, module) => {
|
|
|
10449
10536
|
module.exports = coerce;
|
|
10450
10537
|
});
|
|
10451
10538
|
|
|
10539
|
+
// node_modules/semver/functions/truncate.js
|
|
10540
|
+
var require_truncate = __commonJS((exports, module) => {
|
|
10541
|
+
var parse = require_parse();
|
|
10542
|
+
var constants = require_constants();
|
|
10543
|
+
var SemVer = require_semver();
|
|
10544
|
+
var truncate = (version, truncation, options) => {
|
|
10545
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) {
|
|
10546
|
+
return null;
|
|
10547
|
+
}
|
|
10548
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
10549
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
10550
|
+
};
|
|
10551
|
+
var cloneInputVersion = (version, options) => {
|
|
10552
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
10553
|
+
return parse(versionStringToParse, options);
|
|
10554
|
+
};
|
|
10555
|
+
var doTruncation = (version, truncation) => {
|
|
10556
|
+
if (isPrerelease(truncation)) {
|
|
10557
|
+
return version.version;
|
|
10558
|
+
}
|
|
10559
|
+
version.prerelease = [];
|
|
10560
|
+
switch (truncation) {
|
|
10561
|
+
case "major":
|
|
10562
|
+
version.minor = 0;
|
|
10563
|
+
version.patch = 0;
|
|
10564
|
+
break;
|
|
10565
|
+
case "minor":
|
|
10566
|
+
version.patch = 0;
|
|
10567
|
+
break;
|
|
10568
|
+
}
|
|
10569
|
+
return version.format();
|
|
10570
|
+
};
|
|
10571
|
+
var isPrerelease = (type) => {
|
|
10572
|
+
return type.startsWith("pre");
|
|
10573
|
+
};
|
|
10574
|
+
module.exports = truncate;
|
|
10575
|
+
});
|
|
10576
|
+
|
|
10452
10577
|
// node_modules/semver/internal/lrucache.js
|
|
10453
10578
|
var require_lrucache = __commonJS((exports, module) => {
|
|
10454
10579
|
class LRUCache {
|
|
@@ -11436,6 +11561,7 @@ var require_semver2 = __commonJS((exports, module) => {
|
|
|
11436
11561
|
var lte = require_lte();
|
|
11437
11562
|
var cmp = require_cmp();
|
|
11438
11563
|
var coerce = require_coerce();
|
|
11564
|
+
var truncate = require_truncate();
|
|
11439
11565
|
var Comparator = require_comparator();
|
|
11440
11566
|
var Range = require_range();
|
|
11441
11567
|
var satisfies = require_satisfies();
|
|
@@ -11474,6 +11600,7 @@ var require_semver2 = __commonJS((exports, module) => {
|
|
|
11474
11600
|
lte,
|
|
11475
11601
|
cmp,
|
|
11476
11602
|
coerce,
|
|
11603
|
+
truncate,
|
|
11477
11604
|
Comparator,
|
|
11478
11605
|
Range,
|
|
11479
11606
|
satisfies,
|
|
@@ -13561,9 +13688,11 @@ function rgb_to_lab(c) {
|
|
|
13561
13688
|
// node_modules/fflate/esm/index.mjs
|
|
13562
13689
|
import { createRequire as createRequire3 } from "module";
|
|
13563
13690
|
var require2 = createRequire3("/");
|
|
13691
|
+
var _a;
|
|
13564
13692
|
var Worker;
|
|
13693
|
+
var isMarkedAsUntransferable;
|
|
13565
13694
|
try {
|
|
13566
|
-
|
|
13695
|
+
_a = require2("worker_threads"), Worker = _a.Worker, isMarkedAsUntransferable = _a.isMarkedAsUntransferable;
|
|
13567
13696
|
} catch (e) {}
|
|
13568
13697
|
var u8 = Uint8Array;
|
|
13569
13698
|
var u16 = Uint16Array;
|