@dogsbay/ssg-cli 0.2.0-beta.176 → 0.2.0-beta.178
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/THIRD-PARTY-NOTICES.txt +17 -17
- package/chunks/{build-command-NZAGB7OC.mjs → build-command-6VT3ZZKE.mjs} +2 -2
- package/chunks/{check-command-ZKMQYQNA.mjs → check-command-JHIOF55J.mjs} +3 -3
- package/chunks/{chunk-GOEZKWKJ.mjs → chunk-3O2UA2GP.mjs} +487 -73
- package/chunks/{chunk-F6VRYHSY.mjs → chunk-5APY2GH6.mjs} +91 -17
- package/chunks/{chunk-6CPA3I2A.mjs → chunk-VZBVWLWQ.mjs} +1 -1
- package/chunks/{dev-MX447VF6.mjs → dev-5FQMGMCX.mjs} +2 -2
- package/chunks/{publish-command-B5X67Y6Z.mjs → publish-command-XYUBSAQD.mjs} +2 -2
- package/chunks/{release-diff-KT7ZLBNY.mjs → release-diff-ANIJOQNZ.mjs} +3 -3
- package/chunks/{topicmap-V7FYXTVQ.mjs → topicmap-IGUURUBF.mjs} +1 -1
- package/cli.mjs +6 -6
- package/package.json +2 -2
|
@@ -513,11 +513,7 @@ function parseTemplate(template, base) {
|
|
|
513
513
|
if (setMatch) {
|
|
514
514
|
try {
|
|
515
515
|
const expr = parseExpression(setMatch[2]);
|
|
516
|
-
|
|
517
|
-
type: "set",
|
|
518
|
-
name: setMatch[1],
|
|
519
|
-
value: expr
|
|
520
|
-
});
|
|
516
|
+
add({ type: "set", name: setMatch[1], value: expr }, tagStart2, tagEnd);
|
|
521
517
|
} catch (error) {
|
|
522
518
|
errors.push(createError(`Invalid set expression: ${error.message}`));
|
|
523
519
|
}
|
|
@@ -1324,6 +1320,39 @@ function sameSpan(a, b) {
|
|
|
1324
1320
|
return false;
|
|
1325
1321
|
}
|
|
1326
1322
|
|
|
1323
|
+
// node_modules/@dogsbay/minja/dist/variable-marks.js
|
|
1324
|
+
var VAR_OPEN = "\uE020";
|
|
1325
|
+
var VAR_VALUE = "\uE021";
|
|
1326
|
+
var VAR_CLOSE = "\uE022";
|
|
1327
|
+
function placeVariables(marked, variables) {
|
|
1328
|
+
let out = "";
|
|
1329
|
+
let at = 0;
|
|
1330
|
+
for (let open = marked.indexOf(VAR_OPEN); open !== -1; open = marked.indexOf(VAR_OPEN, open + 1)) {
|
|
1331
|
+
let j = open + 1;
|
|
1332
|
+
while (j < marked.length && marked.charCodeAt(j) >= 48 && marked.charCodeAt(j) <= 57)
|
|
1333
|
+
j++;
|
|
1334
|
+
if (j === open + 1 || marked[j] !== VAR_VALUE)
|
|
1335
|
+
continue;
|
|
1336
|
+
const v = variables[Number(marked.slice(open + 1, j))];
|
|
1337
|
+
if (!v || v.from !== void 0 || v.value.includes("\n"))
|
|
1338
|
+
continue;
|
|
1339
|
+
const start = j + 1;
|
|
1340
|
+
const end = start + v.value.length;
|
|
1341
|
+
if (marked.slice(start, end) !== v.value || marked[end] !== VAR_CLOSE)
|
|
1342
|
+
continue;
|
|
1343
|
+
out += marked.slice(at, open);
|
|
1344
|
+
v.from = out.length;
|
|
1345
|
+
out += v.value;
|
|
1346
|
+
v.to = out.length;
|
|
1347
|
+
at = end + 1;
|
|
1348
|
+
open = end;
|
|
1349
|
+
}
|
|
1350
|
+
return out + marked.slice(at);
|
|
1351
|
+
}
|
|
1352
|
+
function unbracket(text) {
|
|
1353
|
+
return text.indexOf(VAR_OPEN) === -1 ? text : text.replace(/\uE020\d*\uE021|\uE022/g, "");
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1327
1356
|
// node_modules/@dogsbay/minja/dist/renderer.js
|
|
1328
1357
|
function transformHeadings(text, offset, initialFence = null, fenceOut) {
|
|
1329
1358
|
if (offset === 0) {
|
|
@@ -1391,10 +1420,26 @@ async function render(template, options = {}) {
|
|
|
1391
1420
|
}
|
|
1392
1421
|
async function renderWithSourceMap(template, options = {}) {
|
|
1393
1422
|
const trace = [];
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1423
|
+
if (!options.markVariables) {
|
|
1424
|
+
const output2 = await renderTop(template, options, trace);
|
|
1425
|
+
return { output: output2, map: piecesMap(trace) };
|
|
1426
|
+
}
|
|
1427
|
+
const marks = { variables: [], definitions: /* @__PURE__ */ new Map(), brackets: !BRACKET_CHARS.test(template), spoiled: false };
|
|
1428
|
+
const marked = await renderTop(template, options, trace, marks);
|
|
1429
|
+
if (!marks.brackets)
|
|
1430
|
+
return { output: marked, map: piecesMap(trace), variables: marks.variables };
|
|
1431
|
+
const placed = marks.variables.filter((v) => !v.value.includes("\n")).length;
|
|
1432
|
+
const count = (c) => marked.split(c).length - 1;
|
|
1433
|
+
let output = placeVariables(marked, marks.variables);
|
|
1434
|
+
if (marks.spoiled || count(VAR_OPEN) !== placed || count(VAR_VALUE) !== placed || count(VAR_CLOSE) !== placed || marks.variables.some((v) => v.from === void 0 && !v.value.includes("\n"))) {
|
|
1435
|
+
output = await renderTop(template, { ...options, onWarning: void 0 });
|
|
1436
|
+
for (const v of marks.variables)
|
|
1437
|
+
delete v.from, delete v.to;
|
|
1438
|
+
}
|
|
1439
|
+
return { output, map: piecesMap(trace), variables: marks.variables };
|
|
1440
|
+
}
|
|
1441
|
+
var BRACKET_CHARS = /[\uE020-\uE022]/;
|
|
1442
|
+
async function renderTop(template, options, trace, marks) {
|
|
1398
1443
|
const { loader = new FetchLoader(), context: initialContext = {}, basePath = "", maxIncludeDepth = 10, timeout = 5e3, hyphenToUnderscore = false, undefinedBehavior = "empty", undefinedConditions = "preserve", parseCache = sharedParseCache, maxOutput = DEFAULT_MAX_OUTPUT, onWarning } = options;
|
|
1399
1444
|
if (!(timeout >= 0))
|
|
1400
1445
|
throw new RangeError(`timeout must be a number of milliseconds, not ${timeout}`);
|
|
@@ -1431,7 +1476,8 @@ async function renderTop(template, options, trace) {
|
|
|
1431
1476
|
expanding: [],
|
|
1432
1477
|
onWarning,
|
|
1433
1478
|
where: {},
|
|
1434
|
-
trace
|
|
1479
|
+
trace,
|
|
1480
|
+
marks
|
|
1435
1481
|
});
|
|
1436
1482
|
try {
|
|
1437
1483
|
return await Promise.race([renderPromise, timeoutPromise]);
|
|
@@ -1441,6 +1487,20 @@ async function renderTop(template, options, trace) {
|
|
|
1441
1487
|
clearTimeout(timer);
|
|
1442
1488
|
}
|
|
1443
1489
|
}
|
|
1490
|
+
function markValue(options, name, value) {
|
|
1491
|
+
const marks = options.marks;
|
|
1492
|
+
if (!marks || !value)
|
|
1493
|
+
return value;
|
|
1494
|
+
if (BRACKET_CHARS.test(value))
|
|
1495
|
+
marks.spoiled = true;
|
|
1496
|
+
if (value.includes("\n") || !marks.brackets) {
|
|
1497
|
+
marks.variables.push({ name, value, definition: marks.definitions.get(name.split(".")[0]) ?? { via: "context" } });
|
|
1498
|
+
return value;
|
|
1499
|
+
}
|
|
1500
|
+
const definition = marks.definitions.get(name.split(".")[0]) ?? { via: "context" };
|
|
1501
|
+
const index = marks.variables.push({ name, value, definition }) - 1;
|
|
1502
|
+
return `${VAR_OPEN}${index}${VAR_VALUE}${value}${VAR_CLOSE}`;
|
|
1503
|
+
}
|
|
1444
1504
|
function spanOf(node, lines) {
|
|
1445
1505
|
const start = nodeStart.get(node) ?? 0;
|
|
1446
1506
|
const end = nodeEnd.get(node) ?? start + 1;
|
|
@@ -1523,7 +1583,7 @@ async function renderNodes(nodes, options) {
|
|
|
1523
1583
|
for (const node of nodes) {
|
|
1524
1584
|
let rendered = await renderNode(node, options);
|
|
1525
1585
|
if (node.type === "include" && rendered && parts.length > 0) {
|
|
1526
|
-
const indent = lineIndent(parts[parts.length - 1]);
|
|
1586
|
+
const indent = lineIndent(options.marks?.brackets ? unbracket(parts[parts.length - 1]) : parts[parts.length - 1]);
|
|
1527
1587
|
if (indent) {
|
|
1528
1588
|
let lines = 0;
|
|
1529
1589
|
for (let i = rendered.indexOf("\n"); i !== -1; i = rendered.indexOf("\n", i + 1)) {
|
|
@@ -1590,17 +1650,28 @@ async function renderNode(node, options) {
|
|
|
1590
1650
|
...options,
|
|
1591
1651
|
expanding: [...options.expanding, node.name],
|
|
1592
1652
|
where: { ...options.where, variable: node.name },
|
|
1593
|
-
trace: void 0
|
|
1653
|
+
trace: void 0,
|
|
1654
|
+
marks: void 0
|
|
1594
1655
|
});
|
|
1595
|
-
|
|
1596
|
-
|
|
1656
|
+
const out2 = markValue(options, node.name, expanded);
|
|
1657
|
+
traceExpr(options, node, out2);
|
|
1658
|
+
return out2;
|
|
1597
1659
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1660
|
+
spend(str, budget);
|
|
1661
|
+
const out = markValue(options, node.name, str);
|
|
1662
|
+
traceExpr(options, node, out);
|
|
1663
|
+
return out;
|
|
1600
1664
|
}
|
|
1601
1665
|
case "set": {
|
|
1602
1666
|
const value = evaluateExpression(node.value, context);
|
|
1603
1667
|
context.set(node.name, value);
|
|
1668
|
+
if (options.marks) {
|
|
1669
|
+
options.marks.definitions.set(node.name.split(".")[0], {
|
|
1670
|
+
via: "set",
|
|
1671
|
+
...options.file !== void 0 ? { file: options.file } : {},
|
|
1672
|
+
line: spanOf(node, options.lines).from
|
|
1673
|
+
});
|
|
1674
|
+
}
|
|
1604
1675
|
return "";
|
|
1605
1676
|
}
|
|
1606
1677
|
case "comment":
|
|
@@ -1641,6 +1712,8 @@ async function renderNode(node, options) {
|
|
|
1641
1712
|
case "include": {
|
|
1642
1713
|
try {
|
|
1643
1714
|
const includedContent = await loader.load(node.path, basePath);
|
|
1715
|
+
if (options.marks && BRACKET_CHARS.test(includedContent))
|
|
1716
|
+
options.marks.spoiled = true;
|
|
1644
1717
|
checkDeadline(budget);
|
|
1645
1718
|
let newBasePath = basePath;
|
|
1646
1719
|
if (node.path.includes("://")) {
|
|
@@ -1665,7 +1738,8 @@ async function renderNode(node, options) {
|
|
|
1665
1738
|
includeDepth: includeDepth + 1,
|
|
1666
1739
|
basePath: newBasePath,
|
|
1667
1740
|
where: { include: node.path, includes: [...options.where.includes ?? [], node.path] },
|
|
1668
|
-
trace: pieces
|
|
1741
|
+
trace: pieces,
|
|
1742
|
+
file: options.trace ? includeFile(node.path, basePath) : void 0
|
|
1669
1743
|
});
|
|
1670
1744
|
if (options.trace && pieces) {
|
|
1671
1745
|
options.trace.push({ kind: "include", pieces, file: includeFile(node.path, basePath), ...spanOf(node, options.lines) });
|
|
@@ -33,12 +33,12 @@ import {
|
|
|
33
33
|
translationTables,
|
|
34
34
|
versionsOf,
|
|
35
35
|
writeTranslationStubs
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-3O2UA2GP.mjs";
|
|
37
37
|
import {
|
|
38
38
|
contentType
|
|
39
39
|
} from "./chunk-CMGKSS45.mjs";
|
|
40
40
|
import "./chunk-KFYMG4VB.mjs";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-5APY2GH6.mjs";
|
|
42
42
|
import "./chunk-YVSP26OS.mjs";
|
|
43
43
|
import "./chunk-Z7WUDBZV.mjs";
|
|
44
44
|
import {
|
|
@@ -9,15 +9,15 @@ import {
|
|
|
9
9
|
releaseDiff,
|
|
10
10
|
releaseExitCode,
|
|
11
11
|
releaseRedirects
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-VZBVWLWQ.mjs";
|
|
13
13
|
import {
|
|
14
14
|
buildUnits,
|
|
15
15
|
parseConfig,
|
|
16
16
|
readBuildFiles,
|
|
17
17
|
versionsOf
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-3O2UA2GP.mjs";
|
|
19
19
|
import "./chunk-KFYMG4VB.mjs";
|
|
20
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-5APY2GH6.mjs";
|
|
21
21
|
import "./chunk-YVSP26OS.mjs";
|
|
22
22
|
import "./chunk-Z7WUDBZV.mjs";
|
|
23
23
|
import "./chunk-JABACD5T.mjs";
|
package/cli.mjs
CHANGED
|
@@ -37,16 +37,16 @@ async function main() {
|
|
|
37
37
|
usage(1);
|
|
38
38
|
}
|
|
39
39
|
if (wantsHelp(args)) usage(0, cmd);
|
|
40
|
-
if (cmd === "build") return (await import("./chunks/build-command-
|
|
41
|
-
if (cmd === "assemble") return (await import("./chunks/build-command-
|
|
42
|
-
if (cmd === "check") return (await import("./chunks/check-command-
|
|
43
|
-
if (cmd === "publish") return (await import("./chunks/publish-command-
|
|
40
|
+
if (cmd === "build") return (await import("./chunks/build-command-6VT3ZZKE.mjs")).runBuild(args, HIGHLIGHT_WORKER);
|
|
41
|
+
if (cmd === "assemble") return (await import("./chunks/build-command-6VT3ZZKE.mjs")).runBuild(args, HIGHLIGHT_WORKER, { assemble: true });
|
|
42
|
+
if (cmd === "check") return (await import("./chunks/check-command-JHIOF55J.mjs")).runCheck(args);
|
|
43
|
+
if (cmd === "publish") return (await import("./chunks/publish-command-XYUBSAQD.mjs")).runPublish(args);
|
|
44
44
|
if (cmd === "release-diff") {
|
|
45
45
|
const from = option(args, "--from")[0];
|
|
46
46
|
const gitFrom = option(args, "--git-from")[0];
|
|
47
47
|
const o = { from, gitFrom, json: flag(args, "--json"), write: flag(args, "--write"), candidates: flag(args, "--candidates"), strict: flag(args, "--strict") };
|
|
48
48
|
const project = resolve(positional(args, "."));
|
|
49
|
-
const { runReleaseDiff } = await import("./chunks/release-diff-
|
|
49
|
+
const { runReleaseDiff } = await import("./chunks/release-diff-ANIJOQNZ.mjs");
|
|
50
50
|
process.exitCode = await runReleaseDiff(project, o);
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -58,7 +58,7 @@ async function main() {
|
|
|
58
58
|
const llms = flag(args, "--llms");
|
|
59
59
|
const project = resolve(positional(args, "."));
|
|
60
60
|
const t0 = performance.now();
|
|
61
|
-
const { dev, readyLine, serverUrl } = await import("./chunks/dev-
|
|
61
|
+
const { dev, readyLine, serverUrl } = await import("./chunks/dev-5FQMGMCX.mjs");
|
|
62
62
|
const { server } = await dev(project, port, { diagrams: !noDiagrams, lazy, search: noSearchDev ? false : void 0, llms, token: process.env.DOGSBAY_DEV_TOKEN || void 0, listening: (s) => console.log(readyLine(s)) });
|
|
63
63
|
console.log(`dev server for ${project} at ${serverUrl(server)} (ready in ${Math.round(performance.now() - t0)} ms); watching for changes`);
|
|
64
64
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/ssg-cli",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.178",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The dogsbay-ssg command: build, check, preview and publish Dogsbay-MD documentation sites that work offline",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"NOTICE"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@dogsbay/icons": "0.2.0-beta.
|
|
21
|
+
"@dogsbay/icons": "0.2.0-beta.178",
|
|
22
22
|
"@mermanjs/web-render": "0.9.3"
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|