@danielx/civet 0.7.17 → 0.7.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/browser.js +34 -16
- package/dist/civet +8 -1
- package/dist/main.js +34 -16
- package/dist/main.mjs +34 -16
- package/dist/unplugin/astro.js +1 -1
- package/dist/unplugin/astro.mjs +1 -1
- package/dist/unplugin/esbuild.js +1 -1
- package/dist/unplugin/esbuild.mjs +1 -1
- package/dist/unplugin/rollup.js +1 -1
- package/dist/unplugin/rollup.mjs +1 -1
- package/dist/unplugin/unplugin.js +2 -3
- package/dist/unplugin/unplugin.mjs +2 -3
- package/dist/unplugin/vite.js +1 -1
- package/dist/unplugin/vite.mjs +1 -1
- package/dist/unplugin/webpack.js +1 -1
- package/dist/unplugin/webpack.mjs +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -16,13 +16,14 @@ The modern way to write TypeScript.
|
|
|
16
16
|
- [Civet VSCode Extension](https://marketplace.visualstudio.com/items?itemName=DanielX.civet)
|
|
17
17
|
- [Discord Server](https://discord.gg/xkrW9GebBc)
|
|
18
18
|
- Plugins for
|
|
19
|
-
[Vite, esbuild, Astro, Rollup, Webpack, Rspack](
|
|
19
|
+
[Vite, esbuild, Astro, Rollup, Webpack, Rspack](source/unplugin),
|
|
20
20
|
<!--
|
|
21
21
|
[esbuild](source/esbuild-plugin.civet),
|
|
22
22
|
[Vite](https://github.com/edemaine/vite-plugin-civet),
|
|
23
23
|
-->
|
|
24
24
|
[ESM/CJS loader](source/esm.civet),
|
|
25
25
|
[Babel](source/babel-plugin.mjs),
|
|
26
|
+
[Jest](https://github.com/DanielXMoore/Civet/blob/main/integration/jest),
|
|
26
27
|
[Gulp](integration/gulp),
|
|
27
28
|
[Bun](source/bun-civet.civet)
|
|
28
29
|
- Starter templates for [Solid](https://github.com/orenelbaum/solid-civet-template) and [Solid Start](https://github.com/orenelbaum/solid-start-civet-template)
|
package/dist/browser.js
CHANGED
|
@@ -38,9 +38,9 @@ var Civet = (() => {
|
|
|
38
38
|
));
|
|
39
39
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
40
|
|
|
41
|
-
//
|
|
41
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
42
42
|
var require_machine = __commonJS({
|
|
43
|
-
"
|
|
43
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
44
44
|
"use strict";
|
|
45
45
|
var __defProp2 = Object.defineProperty;
|
|
46
46
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -66,7 +66,7 @@ var Civet = (() => {
|
|
|
66
66
|
$EVENT: () => $EVENT2,
|
|
67
67
|
$EVENT_C: () => $EVENT_C2,
|
|
68
68
|
$EXPECT: () => $EXPECT2,
|
|
69
|
-
$L: () => $
|
|
69
|
+
$L: () => $L231,
|
|
70
70
|
$N: () => $N2,
|
|
71
71
|
$P: () => $P2,
|
|
72
72
|
$Q: () => $Q2,
|
|
@@ -91,7 +91,7 @@ var Civet = (() => {
|
|
|
91
91
|
return result;
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function $
|
|
94
|
+
function $L231(str) {
|
|
95
95
|
return function(_ctx, state2) {
|
|
96
96
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
97
97
|
if (input.substring(pos, end) === str) {
|
|
@@ -5653,6 +5653,7 @@ ${js}`
|
|
|
5653
5653
|
}
|
|
5654
5654
|
}
|
|
5655
5655
|
}
|
|
5656
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
5656
5657
|
i = len3 - 1;
|
|
5657
5658
|
while (i >= 0) {
|
|
5658
5659
|
const lastAssignment = $1[i];
|
|
@@ -5686,6 +5687,7 @@ ${js}`
|
|
|
5686
5687
|
}
|
|
5687
5688
|
} else if (m2 = lhs.type, m2 === "ObjectBindingPattern" || m2 === "ArrayBindingPattern") {
|
|
5688
5689
|
processBindingPatternLHS(lhs, tail);
|
|
5690
|
+
gatherRecursiveAll(lhs, ($5) => $5.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
5689
5691
|
}
|
|
5690
5692
|
}
|
|
5691
5693
|
i--;
|
|
@@ -5716,6 +5718,17 @@ ${js}`
|
|
|
5716
5718
|
}
|
|
5717
5719
|
i--;
|
|
5718
5720
|
}
|
|
5721
|
+
if (refsToDeclare.size) {
|
|
5722
|
+
if (exp.hoistDec) {
|
|
5723
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($6) => [",", $6]));
|
|
5724
|
+
} else {
|
|
5725
|
+
exp.hoistDec = {
|
|
5726
|
+
type: "Declaration",
|
|
5727
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
5728
|
+
names: []
|
|
5729
|
+
};
|
|
5730
|
+
}
|
|
5731
|
+
}
|
|
5719
5732
|
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
5720
5733
|
if (tail.length) {
|
|
5721
5734
|
const index = exp.children.indexOf($2);
|
|
@@ -5852,7 +5865,7 @@ ${js}`
|
|
|
5852
5865
|
});
|
|
5853
5866
|
}
|
|
5854
5867
|
function processStatementExpressions(statements) {
|
|
5855
|
-
gatherRecursiveAll(statements, ($
|
|
5868
|
+
gatherRecursiveAll(statements, ($7) => $7.type === "StatementExpression").forEach((_exp) => {
|
|
5856
5869
|
const exp = _exp;
|
|
5857
5870
|
const { statement } = exp;
|
|
5858
5871
|
let ref11;
|
|
@@ -5982,11 +5995,11 @@ ${js}`
|
|
|
5982
5995
|
function processPlaceholders(statements) {
|
|
5983
5996
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
5984
5997
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
5985
|
-
gatherRecursiveAll(statements, ($
|
|
5998
|
+
gatherRecursiveAll(statements, ($8) => $8.type === "Placeholder").forEach((_exp) => {
|
|
5986
5999
|
const exp = _exp;
|
|
5987
6000
|
let ancestor;
|
|
5988
6001
|
if (exp.subtype === ".") {
|
|
5989
|
-
({ ancestor } = findAncestor(exp, ($
|
|
6002
|
+
({ ancestor } = findAncestor(exp, ($9) => $9.type === "Call"));
|
|
5990
6003
|
ancestor = ancestor?.parent;
|
|
5991
6004
|
while (ancestor?.parent?.type === "UnaryExpression" || ancestor?.parent?.type === "NewExpression") {
|
|
5992
6005
|
ancestor = ancestor.parent;
|
|
@@ -7271,8 +7284,10 @@ ${js}`
|
|
|
7271
7284
|
var $L224 = (0, import_lib3.$L)("asserts");
|
|
7272
7285
|
var $L225 = (0, import_lib3.$L)("keyof");
|
|
7273
7286
|
var $L226 = (0, import_lib3.$L)("???");
|
|
7274
|
-
var $L227 = (0, import_lib3.$L)("
|
|
7275
|
-
var $L228 = (0, import_lib3.$L)("
|
|
7287
|
+
var $L227 = (0, import_lib3.$L)("unique");
|
|
7288
|
+
var $L228 = (0, import_lib3.$L)("symbol");
|
|
7289
|
+
var $L229 = (0, import_lib3.$L)("[]");
|
|
7290
|
+
var $L230 = (0, import_lib3.$L)("civet");
|
|
7276
7291
|
var $R0 = (0, import_lib3.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
7277
7292
|
var $R1 = (0, import_lib3.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
7278
7293
|
var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
@@ -9781,10 +9796,10 @@ ${js}`
|
|
|
9781
9796
|
block
|
|
9782
9797
|
};
|
|
9783
9798
|
});
|
|
9784
|
-
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
9785
|
-
var open = $
|
|
9786
|
-
var op = $
|
|
9787
|
-
var close = $
|
|
9799
|
+
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(ArrowFunction), OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9800
|
+
var open = $2;
|
|
9801
|
+
var op = $3;
|
|
9802
|
+
var close = $4;
|
|
9788
9803
|
if (op.special && op.call && !op.negated)
|
|
9789
9804
|
return op.call;
|
|
9790
9805
|
const refA = makeRef("a"), refB = makeRef("b"), body = processBinaryOpExpression([refA, [
|
|
@@ -16111,10 +16126,13 @@ ${js}`
|
|
|
16111
16126
|
var TypeLiteral$3 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L208, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16112
16127
|
return { type: "VoidType", $loc, token: $1 };
|
|
16113
16128
|
});
|
|
16114
|
-
var TypeLiteral$4 = (0, import_lib3.$
|
|
16129
|
+
var TypeLiteral$4 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L227, 'TypeLiteral "unique"'), _, (0, import_lib3.$EXPECT)($L228, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16130
|
+
return { type: "UniqueSymbolType", children: $0 };
|
|
16131
|
+
});
|
|
16132
|
+
var TypeLiteral$5 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L229, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
16115
16133
|
return { $loc, token: "[]" };
|
|
16116
16134
|
});
|
|
16117
|
-
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4];
|
|
16135
|
+
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
16118
16136
|
function TypeLiteral(ctx, state2) {
|
|
16119
16137
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLiteral", TypeLiteral$$);
|
|
16120
16138
|
}
|
|
@@ -16237,7 +16255,7 @@ ${js}`
|
|
|
16237
16255
|
function CivetPrologue(ctx, state2) {
|
|
16238
16256
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16239
16257
|
}
|
|
16240
|
-
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
16258
|
+
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L230, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R89, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16241
16259
|
var options = $3;
|
|
16242
16260
|
return {
|
|
16243
16261
|
type: "CivetPrologue",
|
package/dist/civet
CHANGED
|
@@ -516,10 +516,17 @@ You can override this behavior via: --civet rewriteCivetImports=.ext
|
|
|
516
516
|
options.config ??= await (0, import_config.findConfig)(process.cwd());
|
|
517
517
|
}
|
|
518
518
|
if (options.config) {
|
|
519
|
+
const parsed = await (0, import_config.loadConfig)(options.config);
|
|
519
520
|
options = {
|
|
520
|
-
...
|
|
521
|
+
...parsed,
|
|
521
522
|
...options
|
|
522
523
|
};
|
|
524
|
+
if (parsed.parseOptions && options.parseOptions) {
|
|
525
|
+
options.parseOptions = {
|
|
526
|
+
...parsed.parseOptions,
|
|
527
|
+
...options.parseOptions
|
|
528
|
+
};
|
|
529
|
+
}
|
|
523
530
|
}
|
|
524
531
|
if (options.typescript) {
|
|
525
532
|
const unpluginOptions = {
|
package/dist/main.js
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
34
34
|
var require_machine = __commonJS({
|
|
35
|
-
"
|
|
35
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports2, module2) {
|
|
36
36
|
"use strict";
|
|
37
37
|
var __defProp2 = Object.defineProperty;
|
|
38
38
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -58,7 +58,7 @@ var require_machine = __commonJS({
|
|
|
58
58
|
$EVENT: () => $EVENT2,
|
|
59
59
|
$EVENT_C: () => $EVENT_C2,
|
|
60
60
|
$EXPECT: () => $EXPECT2,
|
|
61
|
-
$L: () => $
|
|
61
|
+
$L: () => $L231,
|
|
62
62
|
$N: () => $N2,
|
|
63
63
|
$P: () => $P2,
|
|
64
64
|
$Q: () => $Q2,
|
|
@@ -83,7 +83,7 @@ var require_machine = __commonJS({
|
|
|
83
83
|
return result;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
-
function $
|
|
86
|
+
function $L231(str) {
|
|
87
87
|
return function(_ctx, state2) {
|
|
88
88
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
89
89
|
if (input.substring(pos, end) === str) {
|
|
@@ -5631,6 +5631,7 @@ function processAssignments(statements) {
|
|
|
5631
5631
|
}
|
|
5632
5632
|
}
|
|
5633
5633
|
}
|
|
5634
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
5634
5635
|
i = len3 - 1;
|
|
5635
5636
|
while (i >= 0) {
|
|
5636
5637
|
const lastAssignment = $1[i];
|
|
@@ -5664,6 +5665,7 @@ function processAssignments(statements) {
|
|
|
5664
5665
|
}
|
|
5665
5666
|
} else if (m2 = lhs.type, m2 === "ObjectBindingPattern" || m2 === "ArrayBindingPattern") {
|
|
5666
5667
|
processBindingPatternLHS(lhs, tail);
|
|
5668
|
+
gatherRecursiveAll(lhs, ($5) => $5.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
5667
5669
|
}
|
|
5668
5670
|
}
|
|
5669
5671
|
i--;
|
|
@@ -5694,6 +5696,17 @@ function processAssignments(statements) {
|
|
|
5694
5696
|
}
|
|
5695
5697
|
i--;
|
|
5696
5698
|
}
|
|
5699
|
+
if (refsToDeclare.size) {
|
|
5700
|
+
if (exp.hoistDec) {
|
|
5701
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($6) => [",", $6]));
|
|
5702
|
+
} else {
|
|
5703
|
+
exp.hoistDec = {
|
|
5704
|
+
type: "Declaration",
|
|
5705
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
5706
|
+
names: []
|
|
5707
|
+
};
|
|
5708
|
+
}
|
|
5709
|
+
}
|
|
5697
5710
|
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
5698
5711
|
if (tail.length) {
|
|
5699
5712
|
const index = exp.children.indexOf($2);
|
|
@@ -5830,7 +5843,7 @@ function processTypes(node) {
|
|
|
5830
5843
|
});
|
|
5831
5844
|
}
|
|
5832
5845
|
function processStatementExpressions(statements) {
|
|
5833
|
-
gatherRecursiveAll(statements, ($
|
|
5846
|
+
gatherRecursiveAll(statements, ($7) => $7.type === "StatementExpression").forEach((_exp) => {
|
|
5834
5847
|
const exp = _exp;
|
|
5835
5848
|
const { statement } = exp;
|
|
5836
5849
|
let ref11;
|
|
@@ -5960,11 +5973,11 @@ function populateRefs(statements) {
|
|
|
5960
5973
|
function processPlaceholders(statements) {
|
|
5961
5974
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
5962
5975
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
5963
|
-
gatherRecursiveAll(statements, ($
|
|
5976
|
+
gatherRecursiveAll(statements, ($8) => $8.type === "Placeholder").forEach((_exp) => {
|
|
5964
5977
|
const exp = _exp;
|
|
5965
5978
|
let ancestor;
|
|
5966
5979
|
if (exp.subtype === ".") {
|
|
5967
|
-
({ ancestor } = findAncestor(exp, ($
|
|
5980
|
+
({ ancestor } = findAncestor(exp, ($9) => $9.type === "Call"));
|
|
5968
5981
|
ancestor = ancestor?.parent;
|
|
5969
5982
|
while (ancestor?.parent?.type === "UnaryExpression" || ancestor?.parent?.type === "NewExpression") {
|
|
5970
5983
|
ancestor = ancestor.parent;
|
|
@@ -7249,8 +7262,10 @@ var $L223 = (0, import_lib3.$L)("namespace");
|
|
|
7249
7262
|
var $L224 = (0, import_lib3.$L)("asserts");
|
|
7250
7263
|
var $L225 = (0, import_lib3.$L)("keyof");
|
|
7251
7264
|
var $L226 = (0, import_lib3.$L)("???");
|
|
7252
|
-
var $L227 = (0, import_lib3.$L)("
|
|
7253
|
-
var $L228 = (0, import_lib3.$L)("
|
|
7265
|
+
var $L227 = (0, import_lib3.$L)("unique");
|
|
7266
|
+
var $L228 = (0, import_lib3.$L)("symbol");
|
|
7267
|
+
var $L229 = (0, import_lib3.$L)("[]");
|
|
7268
|
+
var $L230 = (0, import_lib3.$L)("civet");
|
|
7254
7269
|
var $R0 = (0, import_lib3.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
7255
7270
|
var $R1 = (0, import_lib3.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
7256
7271
|
var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
@@ -9759,10 +9774,10 @@ var FunctionExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(FunctionSign
|
|
|
9759
9774
|
block
|
|
9760
9775
|
};
|
|
9761
9776
|
});
|
|
9762
|
-
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
9763
|
-
var open = $
|
|
9764
|
-
var op = $
|
|
9765
|
-
var close = $
|
|
9777
|
+
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(ArrowFunction), OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9778
|
+
var open = $2;
|
|
9779
|
+
var op = $3;
|
|
9780
|
+
var close = $4;
|
|
9766
9781
|
if (op.special && op.call && !op.negated)
|
|
9767
9782
|
return op.call;
|
|
9768
9783
|
const refA = makeRef("a"), refB = makeRef("b"), body = processBinaryOpExpression([refA, [
|
|
@@ -16089,10 +16104,13 @@ var TypeLiteral$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EX
|
|
|
16089
16104
|
var TypeLiteral$3 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L208, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16090
16105
|
return { type: "VoidType", $loc, token: $1 };
|
|
16091
16106
|
});
|
|
16092
|
-
var TypeLiteral$4 = (0, import_lib3.$
|
|
16107
|
+
var TypeLiteral$4 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L227, 'TypeLiteral "unique"'), _, (0, import_lib3.$EXPECT)($L228, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16108
|
+
return { type: "UniqueSymbolType", children: $0 };
|
|
16109
|
+
});
|
|
16110
|
+
var TypeLiteral$5 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L229, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
16093
16111
|
return { $loc, token: "[]" };
|
|
16094
16112
|
});
|
|
16095
|
-
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4];
|
|
16113
|
+
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
16096
16114
|
function TypeLiteral(ctx, state2) {
|
|
16097
16115
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLiteral", TypeLiteral$$);
|
|
16098
16116
|
}
|
|
@@ -16215,7 +16233,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
16215
16233
|
function CivetPrologue(ctx, state2) {
|
|
16216
16234
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16217
16235
|
}
|
|
16218
|
-
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
16236
|
+
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L230, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R89, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16219
16237
|
var options = $3;
|
|
16220
16238
|
return {
|
|
16221
16239
|
type: "CivetPrologue",
|
package/dist/main.mjs
CHANGED
|
@@ -28,9 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
mod
|
|
29
29
|
));
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// node_modules/@danielx/hera/dist/machine.js
|
|
32
32
|
var require_machine = __commonJS({
|
|
33
|
-
"
|
|
33
|
+
"node_modules/@danielx/hera/dist/machine.js"(exports, module) {
|
|
34
34
|
"use strict";
|
|
35
35
|
var __defProp2 = Object.defineProperty;
|
|
36
36
|
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
@@ -56,7 +56,7 @@ var require_machine = __commonJS({
|
|
|
56
56
|
$EVENT: () => $EVENT2,
|
|
57
57
|
$EVENT_C: () => $EVENT_C2,
|
|
58
58
|
$EXPECT: () => $EXPECT2,
|
|
59
|
-
$L: () => $
|
|
59
|
+
$L: () => $L231,
|
|
60
60
|
$N: () => $N2,
|
|
61
61
|
$P: () => $P2,
|
|
62
62
|
$Q: () => $Q2,
|
|
@@ -81,7 +81,7 @@ var require_machine = __commonJS({
|
|
|
81
81
|
return result;
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
|
-
function $
|
|
84
|
+
function $L231(str) {
|
|
85
85
|
return function(_ctx, state2) {
|
|
86
86
|
const { input, pos } = state2, { length } = str, end = pos + length;
|
|
87
87
|
if (input.substring(pos, end) === str) {
|
|
@@ -5611,6 +5611,7 @@ function processAssignments(statements) {
|
|
|
5611
5611
|
}
|
|
5612
5612
|
}
|
|
5613
5613
|
}
|
|
5614
|
+
const refsToDeclare = /* @__PURE__ */ new Set();
|
|
5614
5615
|
i = len3 - 1;
|
|
5615
5616
|
while (i >= 0) {
|
|
5616
5617
|
const lastAssignment = $1[i];
|
|
@@ -5644,6 +5645,7 @@ function processAssignments(statements) {
|
|
|
5644
5645
|
}
|
|
5645
5646
|
} else if (m2 = lhs.type, m2 === "ObjectBindingPattern" || m2 === "ArrayBindingPattern") {
|
|
5646
5647
|
processBindingPatternLHS(lhs, tail);
|
|
5648
|
+
gatherRecursiveAll(lhs, ($5) => $5.type === "Ref").forEach(refsToDeclare.add.bind(refsToDeclare));
|
|
5647
5649
|
}
|
|
5648
5650
|
}
|
|
5649
5651
|
i--;
|
|
@@ -5674,6 +5676,17 @@ function processAssignments(statements) {
|
|
|
5674
5676
|
}
|
|
5675
5677
|
i--;
|
|
5676
5678
|
}
|
|
5679
|
+
if (refsToDeclare.size) {
|
|
5680
|
+
if (exp.hoistDec) {
|
|
5681
|
+
exp.hoistDec.children.push([...refsToDeclare].map(($6) => [",", $6]));
|
|
5682
|
+
} else {
|
|
5683
|
+
exp.hoistDec = {
|
|
5684
|
+
type: "Declaration",
|
|
5685
|
+
children: ["let ", [...refsToDeclare].map((r, i2) => i2 ? [",", r] : r)],
|
|
5686
|
+
names: []
|
|
5687
|
+
};
|
|
5688
|
+
}
|
|
5689
|
+
}
|
|
5677
5690
|
exp.names = $1.flatMap(([, l]) => l.names || []);
|
|
5678
5691
|
if (tail.length) {
|
|
5679
5692
|
const index = exp.children.indexOf($2);
|
|
@@ -5810,7 +5823,7 @@ function processTypes(node) {
|
|
|
5810
5823
|
});
|
|
5811
5824
|
}
|
|
5812
5825
|
function processStatementExpressions(statements) {
|
|
5813
|
-
gatherRecursiveAll(statements, ($
|
|
5826
|
+
gatherRecursiveAll(statements, ($7) => $7.type === "StatementExpression").forEach((_exp) => {
|
|
5814
5827
|
const exp = _exp;
|
|
5815
5828
|
const { statement } = exp;
|
|
5816
5829
|
let ref11;
|
|
@@ -5940,11 +5953,11 @@ function populateRefs(statements) {
|
|
|
5940
5953
|
function processPlaceholders(statements) {
|
|
5941
5954
|
const placeholderMap = /* @__PURE__ */ new Map();
|
|
5942
5955
|
const liftedIfs = /* @__PURE__ */ new Set();
|
|
5943
|
-
gatherRecursiveAll(statements, ($
|
|
5956
|
+
gatherRecursiveAll(statements, ($8) => $8.type === "Placeholder").forEach((_exp) => {
|
|
5944
5957
|
const exp = _exp;
|
|
5945
5958
|
let ancestor;
|
|
5946
5959
|
if (exp.subtype === ".") {
|
|
5947
|
-
({ ancestor } = findAncestor(exp, ($
|
|
5960
|
+
({ ancestor } = findAncestor(exp, ($9) => $9.type === "Call"));
|
|
5948
5961
|
ancestor = ancestor?.parent;
|
|
5949
5962
|
while (ancestor?.parent?.type === "UnaryExpression" || ancestor?.parent?.type === "NewExpression") {
|
|
5950
5963
|
ancestor = ancestor.parent;
|
|
@@ -7229,8 +7242,10 @@ var $L223 = (0, import_lib3.$L)("namespace");
|
|
|
7229
7242
|
var $L224 = (0, import_lib3.$L)("asserts");
|
|
7230
7243
|
var $L225 = (0, import_lib3.$L)("keyof");
|
|
7231
7244
|
var $L226 = (0, import_lib3.$L)("???");
|
|
7232
|
-
var $L227 = (0, import_lib3.$L)("
|
|
7233
|
-
var $L228 = (0, import_lib3.$L)("
|
|
7245
|
+
var $L227 = (0, import_lib3.$L)("unique");
|
|
7246
|
+
var $L228 = (0, import_lib3.$L)("symbol");
|
|
7247
|
+
var $L229 = (0, import_lib3.$L)("[]");
|
|
7248
|
+
var $L230 = (0, import_lib3.$L)("civet");
|
|
7234
7249
|
var $R0 = (0, import_lib3.$R)(new RegExp("(?=async|debugger|if|unless|comptime|do|for|loop|until|while|switch|throw|try)", "suy"));
|
|
7235
7250
|
var $R1 = (0, import_lib3.$R)(new RegExp("&(?=\\s)", "suy"));
|
|
7236
7251
|
var $R2 = (0, import_lib3.$R)(new RegExp("(as|of|satisfies|then|when|implements|xor|xnor)(?!\\p{ID_Continue}|[\\u200C\\u200D$])", "suy"));
|
|
@@ -9739,10 +9754,10 @@ var FunctionExpression$0 = (0, import_lib3.$TS)((0, import_lib3.$S)(FunctionSign
|
|
|
9739
9754
|
block
|
|
9740
9755
|
};
|
|
9741
9756
|
});
|
|
9742
|
-
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)(OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3) {
|
|
9743
|
-
var open = $
|
|
9744
|
-
var op = $
|
|
9745
|
-
var close = $
|
|
9757
|
+
var FunctionExpression$1 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$N)(ArrowFunction), OpenParen, BinaryOp, CloseParen), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
9758
|
+
var open = $2;
|
|
9759
|
+
var op = $3;
|
|
9760
|
+
var close = $4;
|
|
9746
9761
|
if (op.special && op.call && !op.negated)
|
|
9747
9762
|
return op.call;
|
|
9748
9763
|
const refA = makeRef("a"), refB = makeRef("b"), body = processBinaryOpExpression([refA, [
|
|
@@ -16069,10 +16084,13 @@ var TypeLiteral$2 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EX
|
|
|
16069
16084
|
var TypeLiteral$3 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L208, 'TypeLiteral "void"'), NonIdContinue), function($skip, $loc, $0, $1, $2) {
|
|
16070
16085
|
return { type: "VoidType", $loc, token: $1 };
|
|
16071
16086
|
});
|
|
16072
|
-
var TypeLiteral$4 = (0, import_lib3.$
|
|
16087
|
+
var TypeLiteral$4 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L227, 'TypeLiteral "unique"'), _, (0, import_lib3.$EXPECT)($L228, 'TypeLiteral "symbol"'), NonIdContinue), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16088
|
+
return { type: "UniqueSymbolType", children: $0 };
|
|
16089
|
+
});
|
|
16090
|
+
var TypeLiteral$5 = (0, import_lib3.$TV)((0, import_lib3.$EXPECT)($L229, 'TypeLiteral "[]"'), function($skip, $loc, $0, $1) {
|
|
16073
16091
|
return { $loc, token: "[]" };
|
|
16074
16092
|
});
|
|
16075
|
-
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4];
|
|
16093
|
+
var TypeLiteral$$ = [TypeLiteral$0, TypeLiteral$1, TypeLiteral$2, TypeLiteral$3, TypeLiteral$4, TypeLiteral$5];
|
|
16076
16094
|
function TypeLiteral(ctx, state2) {
|
|
16077
16095
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "TypeLiteral", TypeLiteral$$);
|
|
16078
16096
|
}
|
|
@@ -16195,7 +16213,7 @@ var CivetPrologue$$ = [CivetPrologue$0, CivetPrologue$1];
|
|
|
16195
16213
|
function CivetPrologue(ctx, state2) {
|
|
16196
16214
|
return (0, import_lib3.$EVENT_C)(ctx, state2, "CivetPrologue", CivetPrologue$$);
|
|
16197
16215
|
}
|
|
16198
|
-
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($
|
|
16216
|
+
var CivetPrologueContent$0 = (0, import_lib3.$TS)((0, import_lib3.$S)((0, import_lib3.$EXPECT)($L230, 'CivetPrologueContent "civet"'), NonIdContinue, (0, import_lib3.$Q)(CivetOption), (0, import_lib3.$EXPECT)($R89, "CivetPrologueContent /[\\s]*/")), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
16199
16217
|
var options = $3;
|
|
16200
16218
|
return {
|
|
16201
16219
|
type: "CivetPrologue",
|
package/dist/unplugin/astro.js
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/astro.civet.jsx
|
|
30
30
|
var astro_civet_exports = {};
|
|
31
31
|
__export(astro_civet_exports, {
|
|
32
32
|
default: () => astro_civet_default
|
package/dist/unplugin/astro.mjs
CHANGED
package/dist/unplugin/esbuild.js
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/esbuild.civet.jsx
|
|
30
30
|
var esbuild_civet_exports = {};
|
|
31
31
|
__export(esbuild_civet_exports, {
|
|
32
32
|
default: () => esbuild_civet_default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/esbuild.civet.jsx
|
|
2
2
|
import civetUnplugin from "./unplugin.mjs";
|
|
3
3
|
var esbuild_civet_default = civetUnplugin.esbuild;
|
|
4
4
|
export {
|
package/dist/unplugin/rollup.js
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/rollup.civet.jsx
|
|
30
30
|
var rollup_civet_exports = {};
|
|
31
31
|
__export(rollup_civet_exports, {
|
|
32
32
|
default: () => rollup_civet_default
|
package/dist/unplugin/rollup.mjs
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/unplugin.civet.jsx
|
|
30
30
|
var unplugin_civet_exports = {};
|
|
31
31
|
__export(unplugin_civet_exports, {
|
|
32
32
|
default: () => unplugin_civet_default,
|
|
@@ -46,7 +46,7 @@ var import_os = __toESM(require("os"));
|
|
|
46
46
|
// source/unplugin/constants.mjs
|
|
47
47
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
48
48
|
|
|
49
|
-
// unplugin-civet
|
|
49
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/unplugin.civet.jsx
|
|
50
50
|
var DiagnosticCategory = {};
|
|
51
51
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
52
52
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -246,7 +246,6 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
246
246
|
compilerOptions,
|
|
247
247
|
ts
|
|
248
248
|
);
|
|
249
|
-
host.compilerHost.getDirectories = system.getDirectories;
|
|
250
249
|
const program = ts.createProgram({
|
|
251
250
|
rootNames: useConfigFileNames ? configFileNames : [...fsMap.keys()],
|
|
252
251
|
options: compilerOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/unplugin.civet.jsx
|
|
2
2
|
import { createUnplugin } from "unplugin";
|
|
3
3
|
import civet, { SourceMap } from "@danielx/civet";
|
|
4
4
|
import { findInDir, loadConfig } from "@danielx/civet/config";
|
|
@@ -14,7 +14,7 @@ import os from "os";
|
|
|
14
14
|
// source/unplugin/constants.mjs
|
|
15
15
|
var DEFAULT_EXTENSIONS = [".mjs", ".js", ".mts", ".ts", ".jsx", ".tsx", ".json"];
|
|
16
16
|
|
|
17
|
-
// unplugin-civet
|
|
17
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/unplugin.civet.jsx
|
|
18
18
|
var DiagnosticCategory = {};
|
|
19
19
|
DiagnosticCategory[DiagnosticCategory["Warning"] = 0] = "Warning";
|
|
20
20
|
DiagnosticCategory[DiagnosticCategory["Error"] = 1] = "Error";
|
|
@@ -214,7 +214,6 @@ var rawPlugin = (options = {}, meta) => {
|
|
|
214
214
|
compilerOptions,
|
|
215
215
|
ts
|
|
216
216
|
);
|
|
217
|
-
host.compilerHost.getDirectories = system.getDirectories;
|
|
218
217
|
const program = ts.createProgram({
|
|
219
218
|
rootNames: useConfigFileNames ? configFileNames : [...fsMap.keys()],
|
|
220
219
|
options: compilerOptions,
|
package/dist/unplugin/vite.js
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/vite.civet.jsx
|
|
30
30
|
var vite_civet_exports = {};
|
|
31
31
|
__export(vite_civet_exports, {
|
|
32
32
|
default: () => vite_civet_default
|
package/dist/unplugin/vite.mjs
CHANGED
package/dist/unplugin/webpack.js
CHANGED
|
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
));
|
|
27
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
28
|
|
|
29
|
-
// unplugin-civet
|
|
29
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/webpack.civet.jsx
|
|
30
30
|
var webpack_civet_exports = {};
|
|
31
31
|
__export(webpack_civet_exports, {
|
|
32
32
|
default: () => webpack_civet_default
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// unplugin-civet
|
|
1
|
+
// unplugin-civet:/home/daniel/apps/civet/source/unplugin/webpack.civet.jsx
|
|
2
2
|
import civetUnplugin from "./unplugin.mjs";
|
|
3
3
|
var webpack_civet_default = civetUnplugin.webpack;
|
|
4
4
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@danielx/civet",
|
|
3
3
|
"type": "commonjs",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.19",
|
|
5
5
|
"description": "CoffeeScript style syntax for TypeScript",
|
|
6
6
|
"main": "dist/main.js",
|
|
7
7
|
"module": "dist/main.mjs",
|
|
@@ -82,12 +82,12 @@
|
|
|
82
82
|
"license": "MIT",
|
|
83
83
|
"dependencies": {
|
|
84
84
|
"@cspotcode/source-map-support": "^0.8.1",
|
|
85
|
-
"@typescript/vfs": "^1.
|
|
85
|
+
"@typescript/vfs": "^1.6.0",
|
|
86
86
|
"unplugin": "^1.6.0"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@danielx/civet": "0.7.16",
|
|
90
|
-
"@danielx/hera": "^0.8.
|
|
90
|
+
"@danielx/hera": "^0.8.16",
|
|
91
91
|
"@prettier/sync": "^0.5.2",
|
|
92
92
|
"@types/assert": "^1.5.6",
|
|
93
93
|
"@types/mocha": "^9.1.1",
|