@loadmap/cli 0.3.1 → 0.4.0
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/bin.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as USAGE, o as check, a as fmt, s as github, n as main, r as parseRecord, i as record } from "./src-
|
|
1
|
+
export { t as USAGE, o as check, a as fmt, s as github, n as main, r as parseRecord, i as record } from "./src-CKZ8ncFf.js";
|
|
@@ -1468,6 +1468,16 @@ const OVERLOAD_WHEN = {
|
|
|
1468
1468
|
scope: "ctx",
|
|
1469
1469
|
doc: "The rule applies only while this is true."
|
|
1470
1470
|
};
|
|
1471
|
+
/** The panels of `<Loadmap>` below the diagram, as its `fullScreen` prop names them. */
|
|
1472
|
+
const PANELS = [
|
|
1473
|
+
"verdict",
|
|
1474
|
+
"live",
|
|
1475
|
+
"limits",
|
|
1476
|
+
"controls",
|
|
1477
|
+
"headroom",
|
|
1478
|
+
"compare",
|
|
1479
|
+
"assumptions"
|
|
1480
|
+
];
|
|
1471
1481
|
const COLORS = [
|
|
1472
1482
|
"accent",
|
|
1473
1483
|
"alt",
|
|
@@ -1499,6 +1509,12 @@ const SCHEMA = {
|
|
|
1499
1509
|
scope: "const",
|
|
1500
1510
|
doc: "Simulated seconds per real second. Default 10."
|
|
1501
1511
|
},
|
|
1512
|
+
fullScreen: {
|
|
1513
|
+
value: "names",
|
|
1514
|
+
scope: "const",
|
|
1515
|
+
values: PANELS,
|
|
1516
|
+
doc: "The panels below the diagram in full screen, which keep their order. Default all of them."
|
|
1517
|
+
},
|
|
1502
1518
|
assume: {
|
|
1503
1519
|
value: "string",
|
|
1504
1520
|
scope: "const",
|
|
@@ -3690,6 +3706,8 @@ var Compiler = class {
|
|
|
3690
3706
|
if (speed != null) options.speed = speed;
|
|
3691
3707
|
const layout = this.prop(root, "layout");
|
|
3692
3708
|
if (layout) options.direction = this.enumValue(layout, SCHEMA[""].props.layout) === "down" ? "DOWN" : "RIGHT";
|
|
3709
|
+
const panels = this.prop(root, "fullScreen");
|
|
3710
|
+
if (panels) options.fullScreen = this.words(panels, SCHEMA[""].props.fullScreen);
|
|
3693
3711
|
for (const a of root.props.get("assume") ?? []) {
|
|
3694
3712
|
const v = this.constant(a.value, "string");
|
|
3695
3713
|
if (typeof v === "string") options.assumptions.push(v);
|
|
@@ -3979,6 +3997,20 @@ var Compiler = class {
|
|
|
3979
3997
|
if (spec.values?.includes(raw)) return raw;
|
|
3980
3998
|
this.report.error(p.value, `"${raw}" is not one of ${spec.values.join(", ")}`, didYouMean(raw, spec.values ?? []));
|
|
3981
3999
|
}
|
|
4000
|
+
words(p, spec) {
|
|
4001
|
+
const values = spec.values ?? [];
|
|
4002
|
+
if (p.value.t !== "array") {
|
|
4003
|
+
this.report.error(p.value, `a list: [${values.slice(0, 2).join(", ")}]`);
|
|
4004
|
+
return;
|
|
4005
|
+
}
|
|
4006
|
+
const out = [];
|
|
4007
|
+
for (const e of p.value.items) {
|
|
4008
|
+
const word = e.t === "str" ? e.value : e.t === "id" ? e.name : this.slice(e);
|
|
4009
|
+
if (values.includes(word)) out.push(word);
|
|
4010
|
+
else this.report.error(e, `"${word}" is not one of ${values.join(", ")}`, didYouMean(word, values));
|
|
4011
|
+
}
|
|
4012
|
+
return out;
|
|
4013
|
+
}
|
|
3982
4014
|
color(e) {
|
|
3983
4015
|
if (e.t === "id") {
|
|
3984
4016
|
if (COLORS.includes(e.name)) return e.name;
|