tutuca 0.9.108 → 0.9.109
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/tutuca-cli.js +11 -8
- package/dist/tutuca-dev.ext.js +11 -8
- package/dist/tutuca-dev.js +11 -8
- package/dist/tutuca-dev.min.js +1 -1
- package/package.json +1 -1
package/dist/tutuca-cli.js
CHANGED
|
@@ -9341,12 +9341,12 @@ function checkEventHandlersHaveImpls(lx, Comp, referencedInputs) {
|
|
|
9341
9341
|
function reportUnknownName(lx, code, name, candidates, info) {
|
|
9342
9342
|
lx.error(code, { ...info, name }, replaceNameSuggestion(name, candidates));
|
|
9343
9343
|
}
|
|
9344
|
-
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null) {
|
|
9344
|
+
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null, isRoot = true) {
|
|
9345
9345
|
const check = ATTR_VAL_CHECKERS[val?.constructor.name];
|
|
9346
9346
|
if (check === undefined)
|
|
9347
9347
|
return;
|
|
9348
|
-
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx);
|
|
9349
|
-
check({ lx, val, env, errCtx, skipNameVal, recurse });
|
|
9348
|
+
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx, false);
|
|
9349
|
+
check({ lx, val, env, errCtx, skipNameVal, recurse, isRoot });
|
|
9350
9350
|
}
|
|
9351
9351
|
function nodeCtxForNode(nodeKind) {
|
|
9352
9352
|
return NODE_KIND_TO_CTX[nodeKind] ?? null;
|
|
@@ -9774,8 +9774,8 @@ var init_lint_check = __esm(() => {
|
|
|
9774
9774
|
]);
|
|
9775
9775
|
BOOL_CONDITION_ORIGINS = new Set(["@show", "@hide", "<x show>", "<x hide>"]);
|
|
9776
9776
|
ATTR_VAL_CHECKERS = {
|
|
9777
|
-
ConstVal({ lx, val, errCtx }) {
|
|
9778
|
-
if (isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
9777
|
+
ConstVal({ lx, val, errCtx, isRoot }) {
|
|
9778
|
+
if (isRoot && isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
9779
9779
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
9780
9780
|
},
|
|
9781
9781
|
FieldVal({ lx, val, env, errCtx }) {
|
|
@@ -9813,11 +9813,11 @@ var init_lint_check = __esm(() => {
|
|
|
9813
9813
|
if (!skipNameVal && !isKnownHandlerName(val.name))
|
|
9814
9814
|
reportUnknownName(lx, UNKNOWN_HANDLER_ARG_NAME, val.name, KNOWN_HANDLER_NAMES, errCtx);
|
|
9815
9815
|
},
|
|
9816
|
-
StrTplVal({ lx, val, errCtx, recurse }) {
|
|
9816
|
+
StrTplVal({ lx, val, errCtx, recurse, isRoot }) {
|
|
9817
9817
|
const vs = val.vals;
|
|
9818
9818
|
const literal = val.toLiteralSource();
|
|
9819
9819
|
if (literal !== null) {
|
|
9820
|
-
if (isBoolConditionCtx(errCtx))
|
|
9820
|
+
if (isRoot && isBoolConditionCtx(errCtx))
|
|
9821
9821
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal });
|
|
9822
9822
|
else
|
|
9823
9823
|
lx.hint(PLACEHOLDERLESS_TEMPLATE_STRING, { ...errCtx, literal }, fixTo(`$${literal}`, literal));
|
|
@@ -9834,7 +9834,10 @@ var init_lint_check = __esm(() => {
|
|
|
9834
9834
|
if (env.alter[val.name] === undefined)
|
|
9835
9835
|
reportUnknownName(lx, ALT_HANDLER_NOT_DEFINED, val.name, Object.keys(env.alter), errCtx);
|
|
9836
9836
|
},
|
|
9837
|
-
PredicateVal({ val, recurse }) {
|
|
9837
|
+
PredicateVal({ lx, val, errCtx, recurse }) {
|
|
9838
|
+
const isConstArg = (a) => a.constructor.name === "ConstVal" || a.constructor.name === "StrTplVal" && a.toLiteralSource() !== null;
|
|
9839
|
+
if (isBoolConditionCtx(errCtx) && val.args.every(isConstArg))
|
|
9840
|
+
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
9838
9841
|
for (const arg of val.args)
|
|
9839
9842
|
recurse(arg);
|
|
9840
9843
|
},
|
package/dist/tutuca-dev.ext.js
CHANGED
|
@@ -5515,8 +5515,8 @@ function reportUnknownName(lx, code, name, candidates, info) {
|
|
|
5515
5515
|
var BOOL_CONDITION_ORIGINS = new Set(["@show", "@hide", "<x show>", "<x hide>"]);
|
|
5516
5516
|
var isBoolConditionCtx = (errCtx) => errCtx != null && (BOOL_CONDITION_ORIGINS.has(errCtx.originAttr) || errCtx.branch === "@if");
|
|
5517
5517
|
var ATTR_VAL_CHECKERS = {
|
|
5518
|
-
ConstVal({ lx, val, errCtx }) {
|
|
5519
|
-
if (isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
5518
|
+
ConstVal({ lx, val, errCtx, isRoot }) {
|
|
5519
|
+
if (isRoot && isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
5520
5520
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
5521
5521
|
},
|
|
5522
5522
|
FieldVal({ lx, val, env, errCtx }) {
|
|
@@ -5554,11 +5554,11 @@ var ATTR_VAL_CHECKERS = {
|
|
|
5554
5554
|
if (!skipNameVal && !isKnownHandlerName(val.name))
|
|
5555
5555
|
reportUnknownName(lx, UNKNOWN_HANDLER_ARG_NAME, val.name, KNOWN_HANDLER_NAMES, errCtx);
|
|
5556
5556
|
},
|
|
5557
|
-
StrTplVal({ lx, val, errCtx, recurse }) {
|
|
5557
|
+
StrTplVal({ lx, val, errCtx, recurse, isRoot }) {
|
|
5558
5558
|
const vs = val.vals;
|
|
5559
5559
|
const literal = val.toLiteralSource();
|
|
5560
5560
|
if (literal !== null) {
|
|
5561
|
-
if (isBoolConditionCtx(errCtx))
|
|
5561
|
+
if (isRoot && isBoolConditionCtx(errCtx))
|
|
5562
5562
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal });
|
|
5563
5563
|
else
|
|
5564
5564
|
lx.hint(PLACEHOLDERLESS_TEMPLATE_STRING, { ...errCtx, literal }, fixTo(`$${literal}`, literal));
|
|
@@ -5575,7 +5575,10 @@ var ATTR_VAL_CHECKERS = {
|
|
|
5575
5575
|
if (env.alter[val.name] === undefined)
|
|
5576
5576
|
reportUnknownName(lx, ALT_HANDLER_NOT_DEFINED, val.name, Object.keys(env.alter), errCtx);
|
|
5577
5577
|
},
|
|
5578
|
-
PredicateVal({ val, recurse }) {
|
|
5578
|
+
PredicateVal({ lx, val, errCtx, recurse }) {
|
|
5579
|
+
const isConstArg = (a) => a.constructor.name === "ConstVal" || a.constructor.name === "StrTplVal" && a.toLiteralSource() !== null;
|
|
5580
|
+
if (isBoolConditionCtx(errCtx) && val.args.every(isConstArg))
|
|
5581
|
+
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
5579
5582
|
for (const arg of val.args)
|
|
5580
5583
|
recurse(arg);
|
|
5581
5584
|
},
|
|
@@ -5585,12 +5588,12 @@ var ATTR_VAL_CHECKERS = {
|
|
|
5585
5588
|
reportUnknownName(lx, DYN_VAL_NOT_DEFINED, val.name, Object.keys(env.dynamicMap), errCtx);
|
|
5586
5589
|
}
|
|
5587
5590
|
};
|
|
5588
|
-
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null) {
|
|
5591
|
+
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null, isRoot = true) {
|
|
5589
5592
|
const check = ATTR_VAL_CHECKERS[val?.constructor.name];
|
|
5590
5593
|
if (check === undefined)
|
|
5591
5594
|
return;
|
|
5592
|
-
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx);
|
|
5593
|
-
check({ lx, val, env, errCtx, skipNameVal, recurse });
|
|
5595
|
+
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx, false);
|
|
5596
|
+
check({ lx, val, env, errCtx, skipNameVal, recurse, isRoot });
|
|
5594
5597
|
}
|
|
5595
5598
|
var NODE_KIND_TO_CTX = {
|
|
5596
5599
|
RenderTextNode: { originAttr: "<x text>" },
|
package/dist/tutuca-dev.js
CHANGED
|
@@ -13164,8 +13164,8 @@ function reportUnknownName(lx, code, name, candidates, info) {
|
|
|
13164
13164
|
var BOOL_CONDITION_ORIGINS = new Set(["@show", "@hide", "<x show>", "<x hide>"]);
|
|
13165
13165
|
var isBoolConditionCtx = (errCtx) => errCtx != null && (BOOL_CONDITION_ORIGINS.has(errCtx.originAttr) || errCtx.branch === "@if");
|
|
13166
13166
|
var ATTR_VAL_CHECKERS = {
|
|
13167
|
-
ConstVal({ lx, val, errCtx }) {
|
|
13168
|
-
if (isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
13167
|
+
ConstVal({ lx, val, errCtx, isRoot }) {
|
|
13168
|
+
if (isRoot && isBoolConditionCtx(errCtx) && typeof val.val !== "boolean")
|
|
13169
13169
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
13170
13170
|
},
|
|
13171
13171
|
FieldVal({ lx, val, env, errCtx }) {
|
|
@@ -13203,11 +13203,11 @@ var ATTR_VAL_CHECKERS = {
|
|
|
13203
13203
|
if (!skipNameVal && !isKnownHandlerName(val.name))
|
|
13204
13204
|
reportUnknownName(lx, UNKNOWN_HANDLER_ARG_NAME, val.name, KNOWN_HANDLER_NAMES, errCtx);
|
|
13205
13205
|
},
|
|
13206
|
-
StrTplVal({ lx, val, errCtx, recurse }) {
|
|
13206
|
+
StrTplVal({ lx, val, errCtx, recurse, isRoot }) {
|
|
13207
13207
|
const vs = val.vals;
|
|
13208
13208
|
const literal = val.toLiteralSource();
|
|
13209
13209
|
if (literal !== null) {
|
|
13210
|
-
if (isBoolConditionCtx(errCtx))
|
|
13210
|
+
if (isRoot && isBoolConditionCtx(errCtx))
|
|
13211
13211
|
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal });
|
|
13212
13212
|
else
|
|
13213
13213
|
lx.hint(PLACEHOLDERLESS_TEMPLATE_STRING, { ...errCtx, literal }, fixTo(`$${literal}`, literal));
|
|
@@ -13224,7 +13224,10 @@ var ATTR_VAL_CHECKERS = {
|
|
|
13224
13224
|
if (env.alter[val.name] === undefined)
|
|
13225
13225
|
reportUnknownName(lx, ALT_HANDLER_NOT_DEFINED, val.name, Object.keys(env.alter), errCtx);
|
|
13226
13226
|
},
|
|
13227
|
-
PredicateVal({ val, recurse }) {
|
|
13227
|
+
PredicateVal({ lx, val, errCtx, recurse }) {
|
|
13228
|
+
const isConstArg = (a) => a.constructor.name === "ConstVal" || a.constructor.name === "StrTplVal" && a.toLiteralSource() !== null;
|
|
13229
|
+
if (isBoolConditionCtx(errCtx) && val.args.every(isConstArg))
|
|
13230
|
+
lx.warn(CONSTANT_CONDITION, { ...errCtx, literal: String(val) });
|
|
13228
13231
|
for (const arg of val.args)
|
|
13229
13232
|
recurse(arg);
|
|
13230
13233
|
},
|
|
@@ -13234,12 +13237,12 @@ var ATTR_VAL_CHECKERS = {
|
|
|
13234
13237
|
reportUnknownName(lx, DYN_VAL_NOT_DEFINED, val.name, Object.keys(env.dynamicMap), errCtx);
|
|
13235
13238
|
}
|
|
13236
13239
|
};
|
|
13237
|
-
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null) {
|
|
13240
|
+
function checkConsistentAttrVal(lx, val, env, skipNameVal = false, errCtx = null, isRoot = true) {
|
|
13238
13241
|
const check = ATTR_VAL_CHECKERS[val?.constructor.name];
|
|
13239
13242
|
if (check === undefined)
|
|
13240
13243
|
return;
|
|
13241
|
-
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx);
|
|
13242
|
-
check({ lx, val, env, errCtx, skipNameVal, recurse });
|
|
13244
|
+
const recurse = (sub) => checkConsistentAttrVal(lx, sub, env, skipNameVal, errCtx, false);
|
|
13245
|
+
check({ lx, val, env, errCtx, skipNameVal, recurse, isRoot });
|
|
13243
13246
|
}
|
|
13244
13247
|
var NODE_KIND_TO_CTX = {
|
|
13245
13248
|
RenderTextNode: { originAttr: "<x text>" },
|