@danielx/civet 0.6.67 → 0.6.68
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/browser.js +83 -25
- package/dist/civet +1 -1
- package/dist/config.js +4 -4
- package/dist/esbuild-plugin.js +0 -2
- package/dist/main.js +804 -746
- package/dist/main.mjs +82 -24
- package/package.json +3 -3
package/dist/browser.js
CHANGED
|
@@ -6,13 +6,12 @@ var Civet = (() => {
|
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
10
9
|
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
11
10
|
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
12
11
|
}) : x)(function(x) {
|
|
13
12
|
if (typeof require !== "undefined")
|
|
14
13
|
return require.apply(this, arguments);
|
|
15
|
-
throw
|
|
14
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
16
15
|
});
|
|
17
16
|
var __esm = (fn, res) => function __init() {
|
|
18
17
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
@@ -41,10 +40,6 @@ var Civet = (() => {
|
|
|
41
40
|
mod
|
|
42
41
|
));
|
|
43
42
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
44
|
-
var __publicField = (obj, key, value) => {
|
|
45
|
-
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
46
|
-
return value;
|
|
47
|
-
};
|
|
48
43
|
|
|
49
44
|
// source/lib.civet
|
|
50
45
|
var lib_exports = {};
|
|
@@ -652,7 +647,7 @@ var Civet = (() => {
|
|
|
652
647
|
if (i === 0) {
|
|
653
648
|
let s;
|
|
654
649
|
[c, s] = handleThisPrivateShorthands(c);
|
|
655
|
-
suppressPrefix
|
|
650
|
+
suppressPrefix ||= s;
|
|
656
651
|
}
|
|
657
652
|
return c;
|
|
658
653
|
})
|
|
@@ -3163,7 +3158,7 @@ var Civet = (() => {
|
|
|
3163
3158
|
isFunction
|
|
3164
3159
|
);
|
|
3165
3160
|
if (ancestor) {
|
|
3166
|
-
return declaration
|
|
3161
|
+
return declaration ??= child;
|
|
3167
3162
|
}
|
|
3168
3163
|
;
|
|
3169
3164
|
return;
|
|
@@ -3334,6 +3329,9 @@ var Civet = (() => {
|
|
|
3334
3329
|
}
|
|
3335
3330
|
];
|
|
3336
3331
|
}
|
|
3332
|
+
if (rest.delim?.at(-1)?.token === ",") {
|
|
3333
|
+
rest.delim.pop();
|
|
3334
|
+
}
|
|
3337
3335
|
const children = [...props, ...after, rest];
|
|
3338
3336
|
return {
|
|
3339
3337
|
children,
|
|
@@ -4185,6 +4183,7 @@ ${input.slice(result.pos)}
|
|
|
4185
4183
|
BareNestedBlock,
|
|
4186
4184
|
BareBlock,
|
|
4187
4185
|
ThenClause,
|
|
4186
|
+
BracedThenClause,
|
|
4188
4187
|
BracedOrEmptyBlock,
|
|
4189
4188
|
NoCommaBracedOrEmptyBlock,
|
|
4190
4189
|
NoPostfixBracedOrEmptyBlock,
|
|
@@ -5244,7 +5243,7 @@ ${input.slice(result.pos)}
|
|
|
5244
5243
|
return $0;
|
|
5245
5244
|
return $skip;
|
|
5246
5245
|
});
|
|
5247
|
-
var ForbiddenImplicitCalls$5 = $TS($S(
|
|
5246
|
+
var ForbiddenImplicitCalls$5 = $TS($S(OmittedNegation, $E(_), Identifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
5248
5247
|
var id = $3;
|
|
5249
5248
|
if (module.operators.has(id.name))
|
|
5250
5249
|
return $0;
|
|
@@ -5769,11 +5768,29 @@ ${input.slice(result.pos)}
|
|
|
5769
5768
|
function ParenthesizedExpression(ctx, state) {
|
|
5770
5769
|
return $EVENT(ctx, state, "ParenthesizedExpression", ParenthesizedExpression$0);
|
|
5771
5770
|
}
|
|
5772
|
-
var ClassDeclaration$0 = ClassExpression
|
|
5771
|
+
var ClassDeclaration$0 = $TS($S(ClassExpression), function($skip, $loc, $0, $1) {
|
|
5772
|
+
if ($1.binding)
|
|
5773
|
+
return $1;
|
|
5774
|
+
return makeLeftHandSideExpression($1);
|
|
5775
|
+
});
|
|
5773
5776
|
function ClassDeclaration(ctx, state) {
|
|
5774
5777
|
return $EVENT(ctx, state, "ClassDeclaration", ClassDeclaration$0);
|
|
5775
5778
|
}
|
|
5776
|
-
var ClassExpression$0 = $S($E(Decorators), $E($S(Abstract, __)), Class, $N($EXPECT($L13, 'ClassExpression ":"')), $E(ClassBinding), $E(ClassHeritage), ClassBody)
|
|
5779
|
+
var ClassExpression$0 = $TS($S($E(Decorators), $E($S(Abstract, __)), Class, $N($EXPECT($L13, 'ClassExpression ":"')), $E(ClassBinding), $E(ClassHeritage), ClassBody), function($skip, $loc, $0, $1, $2, $3, $4, $5, $6, $7) {
|
|
5780
|
+
var decorators = $1;
|
|
5781
|
+
var abstract = $2;
|
|
5782
|
+
var binding = $5;
|
|
5783
|
+
var heritage = $6;
|
|
5784
|
+
var body = $7;
|
|
5785
|
+
return {
|
|
5786
|
+
decorators,
|
|
5787
|
+
abstract,
|
|
5788
|
+
binding,
|
|
5789
|
+
heritage,
|
|
5790
|
+
body,
|
|
5791
|
+
children: $0
|
|
5792
|
+
};
|
|
5793
|
+
});
|
|
5777
5794
|
function ClassExpression(ctx, state) {
|
|
5778
5795
|
return $EVENT(ctx, state, "ClassExpression", ClassExpression$0);
|
|
5779
5796
|
}
|
|
@@ -7473,6 +7490,21 @@ ${input.slice(result.pos)}
|
|
|
7473
7490
|
function ThenClause(ctx, state) {
|
|
7474
7491
|
return $EVENT(ctx, state, "ThenClause", ThenClause$0);
|
|
7475
7492
|
}
|
|
7493
|
+
var BracedThenClause$0 = $TS($S($Y(Then), InsertOpenBrace, ThenClause, InsertCloseBrace), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
7494
|
+
var open = $2;
|
|
7495
|
+
var exp = $3;
|
|
7496
|
+
var close = $4;
|
|
7497
|
+
const expressions = [exp];
|
|
7498
|
+
return {
|
|
7499
|
+
type: "BlockStatement",
|
|
7500
|
+
expressions,
|
|
7501
|
+
children: [open, expressions, " ", close],
|
|
7502
|
+
bare: false
|
|
7503
|
+
};
|
|
7504
|
+
});
|
|
7505
|
+
function BracedThenClause(ctx, state) {
|
|
7506
|
+
return $EVENT(ctx, state, "BracedThenClause", BracedThenClause$0);
|
|
7507
|
+
}
|
|
7476
7508
|
var BracedOrEmptyBlock$0 = BracedBlock;
|
|
7477
7509
|
var BracedOrEmptyBlock$1 = EmptyBlock;
|
|
7478
7510
|
var BracedOrEmptyBlock$$ = [BracedOrEmptyBlock$0, BracedOrEmptyBlock$1];
|
|
@@ -8758,7 +8790,7 @@ ${input.slice(result.pos)}
|
|
|
8758
8790
|
special: true
|
|
8759
8791
|
};
|
|
8760
8792
|
});
|
|
8761
|
-
var _BinaryOp$2 = $TS($S(
|
|
8793
|
+
var _BinaryOp$2 = $TS($S(OmittedNegation, __, Identifier), function($skip, $loc, $0, $1, $2, $3) {
|
|
8762
8794
|
var id = $3;
|
|
8763
8795
|
if (!module.operators.has(id.name))
|
|
8764
8796
|
return $skip;
|
|
@@ -8895,7 +8927,7 @@ ${input.slice(result.pos)}
|
|
|
8895
8927
|
var op = value[1];
|
|
8896
8928
|
return op;
|
|
8897
8929
|
});
|
|
8898
|
-
var BinaryOpSymbol$41 = $TS($S(
|
|
8930
|
+
var BinaryOpSymbol$41 = $TS($S(OmittedNegation, __, NotOp), function($skip, $loc, $0, $1, $2, $3) {
|
|
8899
8931
|
var op = $3;
|
|
8900
8932
|
return { ...op, $loc };
|
|
8901
8933
|
});
|
|
@@ -8922,7 +8954,7 @@ ${input.slice(result.pos)}
|
|
|
8922
8954
|
negated: true
|
|
8923
8955
|
};
|
|
8924
8956
|
});
|
|
8925
|
-
var BinaryOpSymbol$45 = $TV($C($S(Is, __,
|
|
8957
|
+
var BinaryOpSymbol$45 = $TV($C($S(Is, __, OmittedNegation, __, In), $EXPECT($L99, 'BinaryOpSymbol "\u2209"')), function($skip, $loc, $0, $1) {
|
|
8926
8958
|
return {
|
|
8927
8959
|
method: "includes",
|
|
8928
8960
|
relational: true,
|
|
@@ -8974,7 +9006,7 @@ ${input.slice(result.pos)}
|
|
|
8974
9006
|
special: true
|
|
8975
9007
|
};
|
|
8976
9008
|
});
|
|
8977
|
-
var CoffeeOfOp$2 = $TS($S(
|
|
9009
|
+
var CoffeeOfOp$2 = $TS($S(OmittedNegation, __, Of, NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
8978
9010
|
return {
|
|
8979
9011
|
$loc,
|
|
8980
9012
|
token: "in",
|
|
@@ -8982,7 +9014,7 @@ ${input.slice(result.pos)}
|
|
|
8982
9014
|
negated: true
|
|
8983
9015
|
};
|
|
8984
9016
|
});
|
|
8985
|
-
var CoffeeOfOp$3 = $TS($S(
|
|
9017
|
+
var CoffeeOfOp$3 = $TS($S(OmittedNegation, __, In), function($skip, $loc, $0, $1, $2, $3) {
|
|
8986
9018
|
return {
|
|
8987
9019
|
call: [module.getRef("indexOf"), ".call"],
|
|
8988
9020
|
relational: true,
|
|
@@ -9995,7 +10027,7 @@ ${input.slice(result.pos)}
|
|
|
9995
10027
|
function TryExpression(ctx, state) {
|
|
9996
10028
|
return $EVENT(ctx, state, "TryExpression", TryExpression$0);
|
|
9997
10029
|
}
|
|
9998
|
-
var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(
|
|
10030
|
+
var CatchClause$0 = $TS($S($C(Nested, _), Catch, $E(CatchBind), $C(BracedThenClause, BracedOrEmptyBlock)), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9999
10031
|
var block = $4;
|
|
10000
10032
|
return {
|
|
10001
10033
|
type: "CatchClause",
|
|
@@ -10012,7 +10044,7 @@ ${input.slice(result.pos)}
|
|
|
10012
10044
|
function CatchBind(ctx, state) {
|
|
10013
10045
|
return $EVENT_C(ctx, state, "CatchBind", CatchBind$$);
|
|
10014
10046
|
}
|
|
10015
|
-
var FinallyClause$0 = $S($C(Nested, _), Finally, $C(
|
|
10047
|
+
var FinallyClause$0 = $S($C(Nested, _), Finally, $C(BracedThenClause, BracedOrEmptyBlock));
|
|
10016
10048
|
function FinallyClause(ctx, state) {
|
|
10017
10049
|
return $EVENT(ctx, state, "FinallyClause", FinallyClause$0);
|
|
10018
10050
|
}
|
|
@@ -12012,7 +12044,13 @@ ${input.slice(result.pos)}
|
|
|
12012
12044
|
classValue = ["{[", ...exprs, '].filter(Boolean).join(" ")}'];
|
|
12013
12045
|
}
|
|
12014
12046
|
} else {
|
|
12015
|
-
|
|
12047
|
+
if (!stringPart.includes("&") && !stringPart.includes('"')) {
|
|
12048
|
+
classValue = `"${stringPart}"`;
|
|
12049
|
+
} else if (!stringPart.includes("&") && !stringPart.includes("'")) {
|
|
12050
|
+
classValue = `'${stringPart}'`;
|
|
12051
|
+
} else {
|
|
12052
|
+
classValue = `{${JSON.stringify(stringPart)}}`;
|
|
12053
|
+
}
|
|
12016
12054
|
}
|
|
12017
12055
|
attrs.splice(0, 0, [" ", [className, ["=", classValue]]]);
|
|
12018
12056
|
}
|
|
@@ -12920,8 +12958,29 @@ ${input.slice(result.pos)}
|
|
|
12920
12958
|
return $EVENT_C(ctx, state, "TypeUnaryOp", TypeUnaryOp$$);
|
|
12921
12959
|
}
|
|
12922
12960
|
var TypeIndexedAccess$0 = $S(OpenBracket, $E(Type), __, CloseBracket);
|
|
12961
|
+
var TypeIndexedAccess$1 = $TS($S(Dot, $C(TemplateLiteral, StringLiteral, IntegerLiteral)), function($skip, $loc, $0, $1, $2) {
|
|
12962
|
+
var dot = $1;
|
|
12963
|
+
var literal = $2;
|
|
12964
|
+
const open = { ...dot, token: "[" };
|
|
12965
|
+
return [
|
|
12966
|
+
open,
|
|
12967
|
+
literal,
|
|
12968
|
+
"]"
|
|
12969
|
+
];
|
|
12970
|
+
});
|
|
12971
|
+
var TypeIndexedAccess$2 = $TS($S(CoffeePrototypeEnabled, DoubleColon, $E(IdentifierName)), function($skip, $loc, $0, $1, $2, $3) {
|
|
12972
|
+
var p = $2;
|
|
12973
|
+
var id = $3;
|
|
12974
|
+
const open = { ...p, token: '["' };
|
|
12975
|
+
return [
|
|
12976
|
+
open,
|
|
12977
|
+
id,
|
|
12978
|
+
'"]'
|
|
12979
|
+
];
|
|
12980
|
+
});
|
|
12981
|
+
var TypeIndexedAccess$$ = [TypeIndexedAccess$0, TypeIndexedAccess$1, TypeIndexedAccess$2];
|
|
12923
12982
|
function TypeIndexedAccess(ctx, state) {
|
|
12924
|
-
return $
|
|
12983
|
+
return $EVENT_C(ctx, state, "TypeIndexedAccess", TypeIndexedAccess$$);
|
|
12925
12984
|
}
|
|
12926
12985
|
var UnknownAlias$0 = $TV($EXPECT($L211, 'UnknownAlias "???"'), function($skip, $loc, $0, $1) {
|
|
12927
12986
|
return { $loc, token: "unknown" };
|
|
@@ -14138,6 +14197,7 @@ ${input.slice(result.pos)}
|
|
|
14138
14197
|
exports.BareNestedBlock = BareNestedBlock;
|
|
14139
14198
|
exports.BareBlock = BareBlock;
|
|
14140
14199
|
exports.ThenClause = ThenClause;
|
|
14200
|
+
exports.BracedThenClause = BracedThenClause;
|
|
14141
14201
|
exports.BracedOrEmptyBlock = BracedOrEmptyBlock;
|
|
14142
14202
|
exports.NoCommaBracedOrEmptyBlock = NoCommaBracedOrEmptyBlock;
|
|
14143
14203
|
exports.NoPostfixBracedOrEmptyBlock = NoPostfixBracedOrEmptyBlock;
|
|
@@ -14728,7 +14788,7 @@ ${input.slice(result.pos)}
|
|
|
14728
14788
|
return "";
|
|
14729
14789
|
}
|
|
14730
14790
|
if (node.type === "Error") {
|
|
14731
|
-
options.errors
|
|
14791
|
+
options.errors ??= [];
|
|
14732
14792
|
options.errors.push(node);
|
|
14733
14793
|
return "";
|
|
14734
14794
|
}
|
|
@@ -15125,9 +15185,7 @@ ${input.slice(result.pos)}
|
|
|
15125
15185
|
|
|
15126
15186
|
// source/state-cache.civet
|
|
15127
15187
|
var StateCache = class {
|
|
15128
|
-
|
|
15129
|
-
__publicField(this, "cache", /* @__PURE__ */ new Map());
|
|
15130
|
-
}
|
|
15188
|
+
cache = /* @__PURE__ */ new Map();
|
|
15131
15189
|
get(key) {
|
|
15132
15190
|
return this.cache.get(key[0])?.get(key[1])?.get(key[2])?.get(key[3]);
|
|
15133
15191
|
}
|
|
@@ -15213,7 +15271,7 @@ ${input.slice(result.pos)}
|
|
|
15213
15271
|
} else {
|
|
15214
15272
|
options = { ...options };
|
|
15215
15273
|
}
|
|
15216
|
-
options.parseOptions
|
|
15274
|
+
options.parseOptions ??= {};
|
|
15217
15275
|
const filename = options.filename || "unknown";
|
|
15218
15276
|
if (filename.endsWith(".coffee") && !/^(#![^\r\n]*(\r\n|\n|\r))?\s*['"]civet/.test(src)) {
|
|
15219
15277
|
options.parseOptions.coffeeCompat = true;
|
package/dist/civet
CHANGED
|
@@ -310,7 +310,7 @@ cli = async function() {
|
|
|
310
310
|
argv = process.argv;
|
|
311
311
|
({ filenames, scriptArgs, options } = parseArgs(argv.slice(2)));
|
|
312
312
|
if (options.config !== false) {
|
|
313
|
-
options.config
|
|
313
|
+
options.config ??= await (0, import_config.findConfig)(process.cwd());
|
|
314
314
|
}
|
|
315
315
|
if (options.config) {
|
|
316
316
|
options = {
|
package/dist/config.js
CHANGED
|
@@ -82,16 +82,16 @@ async function loadConfig(path2) {
|
|
|
82
82
|
return JSON.parse(config);
|
|
83
83
|
} else {
|
|
84
84
|
const js = (0, import_main.compile)(config, { js: true });
|
|
85
|
-
let
|
|
85
|
+
let exports2;
|
|
86
86
|
try {
|
|
87
|
-
|
|
87
|
+
exports2 = await import(`data:text/javascript,${encodeURIComponent(js)}`);
|
|
88
88
|
} catch (e) {
|
|
89
89
|
console.error("Error loading config file", path2, e);
|
|
90
90
|
}
|
|
91
|
-
if (typeof
|
|
91
|
+
if (typeof exports2.default !== "object" || exports2.default === null) {
|
|
92
92
|
throw new Error("civet config file must export an object");
|
|
93
93
|
}
|
|
94
|
-
return
|
|
94
|
+
return exports2.default;
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
// Annotate the CommonJS export names for ESM import in node:
|
package/dist/esbuild-plugin.js
CHANGED
|
@@ -128,6 +128,4 @@ function civet(options = {}) {
|
|
|
128
128
|
var defaultPlugin = civet();
|
|
129
129
|
civet.setup = defaultPlugin.setup;
|
|
130
130
|
var esbuild_plugin_default = civet;
|
|
131
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
132
|
-
0 && (module.exports = {});
|
|
133
131
|
module.exports = module.exports.default;
|