@dogsbay/ssg-cli 0.0.0-stage → 0.2.0-beta.167.1
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/LICENSE +201 -0
- package/NOTICE +17 -0
- package/README.md +62 -2
- package/THIRD-PARTY-NOTICES.txt +2363 -0
- package/chunks/bash-WN2IW2MU.mjs +9 -0
- package/chunks/bat-KLYVST7G.mjs +12 -0
- package/chunks/build-command-WQJANVGR.mjs +409 -0
- package/chunks/c-NBVQ7G3X.mjs +9 -0
- package/chunks/check-command-QTJ6BUNL.mjs +215 -0
- package/chunks/chunk-4KDUWLRS.mjs +12 -0
- package/chunks/chunk-CMGKSS45.mjs +34 -0
- package/chunks/chunk-CUTL24GH.mjs +12 -0
- package/chunks/chunk-ECAZ77NS.mjs +12 -0
- package/chunks/chunk-F6VRYHSY.mjs +5048 -0
- package/chunks/chunk-FJPQZU44.mjs +12 -0
- package/chunks/chunk-G6OTOD3B.mjs +48 -0
- package/chunks/chunk-GIP2FIA6.mjs +12 -0
- package/chunks/chunk-IAR2KPZC.mjs +12 -0
- package/chunks/chunk-IZF74GZZ.mjs +7340 -0
- package/chunks/chunk-JABACD5T.mjs +93 -0
- package/chunks/chunk-JRPXZBM2.mjs +12 -0
- package/chunks/chunk-JXFQPMYJ.mjs +43806 -0
- package/chunks/chunk-JXM2XRAR.mjs +16 -0
- package/chunks/chunk-KEHZHWE6.mjs +12 -0
- package/chunks/chunk-LC74DHS3.mjs +28 -0
- package/chunks/chunk-LNWQN7K7.mjs +47 -0
- package/chunks/chunk-NJDUOQI7.mjs +12 -0
- package/chunks/chunk-OBUK53NJ.mjs +154 -0
- package/chunks/chunk-STRHO6SY.mjs +44 -0
- package/chunks/chunk-TIRB4ROQ.mjs +20 -0
- package/chunks/chunk-UKZGJ5AP.mjs +11201 -0
- package/chunks/chunk-USOBJLOJ.mjs +12 -0
- package/chunks/chunk-X4ZSG4OM.mjs +12 -0
- package/chunks/chunk-XABJJODS.mjs +16 -0
- package/chunks/chunk-XYPTZFVB.mjs +31503 -0
- package/chunks/chunk-YVSP26OS.mjs +175 -0
- package/chunks/chunk-Z7WUDBZV.mjs +5577 -0
- package/chunks/chunk-ZPII4MCC.mjs +12 -0
- package/chunks/chunk-ZW635UYF.mjs +44 -0
- package/chunks/core-Z65HALUT.mjs +5926 -0
- package/chunks/cpp-JNQSOSM7.mjs +11 -0
- package/chunks/csharp-UTVXXLBH.mjs +12 -0
- package/chunks/css-DR3MZC2R.mjs +9 -0
- package/chunks/css-build-WUW5N4IC.mjs +6290 -0
- package/chunks/dev-X3Y5P4KI.mjs +979 -0
- package/chunks/diff-GTIUNONZ.mjs +12 -0
- package/chunks/docker-2O2WO47V.mjs +12 -0
- package/chunks/go-KFRO4WHX.mjs +12 -0
- package/chunks/graphql-H4XAFKUQ.mjs +13 -0
- package/chunks/groovy-IAOB4GSA.mjs +12 -0
- package/chunks/hcl-OV4NBCSV.mjs +12 -0
- package/chunks/highlight-XB2G5VI5.mjs +16 -0
- package/chunks/html-HNUETIJT.mjs +11 -0
- package/chunks/http-POY7GQIM.mjs +33 -0
- package/chunks/ini-ZWSSZBAD.mjs +9 -0
- package/chunks/java-UNHKAALA.mjs +9 -0
- package/chunks/javascript-5I4F2MOK.mjs +9 -0
- package/chunks/json-HUSK22EN.mjs +9 -0
- package/chunks/jsonc-3FJRQVYX.mjs +12 -0
- package/chunks/jsx-MPXQICPA.mjs +9 -0
- package/chunks/katex-assets-2JWTS7KK.mjs +11 -0
- package/chunks/kotlin-44HLBZQT.mjs +12 -0
- package/chunks/makefile-MN7GTSOT.mjs +12 -0
- package/chunks/markdown-BSJW56ZV.mjs +12 -0
- package/chunks/math-VI3BIAAZ.mjs +14509 -0
- package/chunks/nginx-THNEASQW.mjs +17 -0
- package/chunks/pele-SYMSY5GD.mjs +20582 -0
- package/chunks/powershell-FLIIURPX.mjs +12 -0
- package/chunks/properties-5JRW4GXO.mjs +9 -0
- package/chunks/publish-command-J7KGJTLD.mjs +858 -0
- package/chunks/python-AMYOSLZN.mjs +12 -0
- package/chunks/release-diff-JMNCG2T7.mjs +108 -0
- package/chunks/ruby-45KKBAF3.mjs +69 -0
- package/chunks/rust-HHHRMWV3.mjs +12 -0
- package/chunks/scss-SXP65CI5.mjs +16 -0
- package/chunks/serve-CUWABTUV.mjs +66 -0
- package/chunks/shellsession-Z5NIGXRL.mjs +16 -0
- package/chunks/sql-BZT6ET7H.mjs +9 -0
- package/chunks/toml-U6LUKYDZ.mjs +12 -0
- package/chunks/topicmap-V7FYXTVQ.mjs +383 -0
- package/chunks/tsx-65AAFPTH.mjs +9 -0
- package/chunks/typescript-P7INMWMZ.mjs +9 -0
- package/chunks/xml-OWRWNCOT.mjs +10 -0
- package/chunks/xsl-CDSW6KM4.mjs +17 -0
- package/chunks/yaml-GNE6PFDT.mjs +9 -0
- package/cli.mjs +83 -0
- package/highlight-worker.mjs +20 -0
- package/package.json +25 -4
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
esc
|
|
5
|
+
} from "./chunk-G6OTOD3B.mjs";
|
|
6
|
+
|
|
7
|
+
// node_modules/@dogsbay/render-html/dist/code-markers.js
|
|
8
|
+
var MARKER = /[ \t]*(?:\/\/|#|--|<!--|\/\*|;)[ \t]*\[!code[^\]]*\](?:[ \t]*(?:-->|\*\/))?/g;
|
|
9
|
+
var BARE_MARKER = /[ \t]*\[!code[^\]]*\]/g;
|
|
10
|
+
function stripUnprocessableMarkers(code, isPlainGrammar) {
|
|
11
|
+
if (!code.includes("[!code"))
|
|
12
|
+
return code;
|
|
13
|
+
return code.split("\n").map((line) => {
|
|
14
|
+
if (isPlainGrammar)
|
|
15
|
+
return line.replace(MARKER, "").replace(BARE_MARKER, "");
|
|
16
|
+
let out = "";
|
|
17
|
+
let last = 0;
|
|
18
|
+
for (const m of line.matchAll(MARKER)) {
|
|
19
|
+
const end = m.index + m[0].length;
|
|
20
|
+
if (line.slice(end).trim() === "")
|
|
21
|
+
break;
|
|
22
|
+
out += line.slice(last, m.index);
|
|
23
|
+
last = end;
|
|
24
|
+
}
|
|
25
|
+
return out + line.slice(last);
|
|
26
|
+
}).join("\n");
|
|
27
|
+
}
|
|
28
|
+
function stripMarkersForCopy(code) {
|
|
29
|
+
return code.replace(MARKER, "").replace(BARE_MARKER, "").replace(/\s*\/\/\s*![a-z]+.*$/gm, "").trim();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// node_modules/@dogsbay/render-html/dist/code-ansi.js
|
|
33
|
+
var SEQUENCE = /(?:\x1b\[|\x9b)[0-?]*[ -/]*(?:[@-~]|$)|\x1b\][^\x07\x1b]*(?:\x07|\x1b\\|$)|\x1b[ -/]*[0-~]?/g;
|
|
34
|
+
var SGR = /^(?:\x1b\[|\x9b)[0-9;:]*m$/;
|
|
35
|
+
function stripAnsi(s) {
|
|
36
|
+
return s.replace(SEQUENCE, "");
|
|
37
|
+
}
|
|
38
|
+
function ansiColoursOnly(s) {
|
|
39
|
+
return s.replace(SEQUENCE, (m) => SGR.test(m) ? m.replace(/^\x9b/, "\x1B[") : "");
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// node_modules/@dogsbay/render-html/dist/lines.js
|
|
43
|
+
var PLAIN = /* @__PURE__ */ new Set(["", "text", "txt", "plain", "plaintext", "none", "output", "log", "code", "codeblock"]);
|
|
44
|
+
function parseLineRanges(spec) {
|
|
45
|
+
if (spec == null)
|
|
46
|
+
return [];
|
|
47
|
+
const out = [];
|
|
48
|
+
for (const part of String(spec).replace(/[{}]/g, "").split(/[,\s]+/)) {
|
|
49
|
+
const m = /^(\d+)(?:-(\d+))?$/.exec(part);
|
|
50
|
+
if (!m)
|
|
51
|
+
continue;
|
|
52
|
+
const a = Number(m[1]);
|
|
53
|
+
const b = m[2] ? Number(m[2]) : a;
|
|
54
|
+
for (let i = a; i <= Math.min(b, a + 5e3); i++)
|
|
55
|
+
out.push(i);
|
|
56
|
+
}
|
|
57
|
+
return out;
|
|
58
|
+
}
|
|
59
|
+
function lineRuns(lines) {
|
|
60
|
+
const sorted = [...new Set(lines)].filter((n) => n > 0).sort((a, b) => a - b);
|
|
61
|
+
const runs = [];
|
|
62
|
+
for (const n of sorted) {
|
|
63
|
+
const last = runs[runs.length - 1];
|
|
64
|
+
if (last && n === last[1] + 1)
|
|
65
|
+
last[1] = n;
|
|
66
|
+
else
|
|
67
|
+
runs.push([n, n]);
|
|
68
|
+
}
|
|
69
|
+
return runs;
|
|
70
|
+
}
|
|
71
|
+
function collapseLines(pre, lines, label) {
|
|
72
|
+
const open = pre.indexOf("<code>");
|
|
73
|
+
const close = pre.lastIndexOf("</code>");
|
|
74
|
+
if (open < 0 || close < open || !lines.length)
|
|
75
|
+
return pre;
|
|
76
|
+
const parts = pre.slice(open + 6, close).split("\n");
|
|
77
|
+
for (const [a, b] of lineRuns(lines).reverse()) {
|
|
78
|
+
if (a > parts.length)
|
|
79
|
+
continue;
|
|
80
|
+
const end = Math.min(b, parts.length);
|
|
81
|
+
const group = `<span class="code-collapse"><label class="code-collapse-label" data-pagefind-ignore><input type="checkbox" class="code-collapse-toggle">${label(end - a + 1)}</label><span class="code-collapse-lines">${parts.slice(a - 1, end).join("\n")}</span></span>`;
|
|
82
|
+
parts.splice(a - 1, end - a + 1, group);
|
|
83
|
+
}
|
|
84
|
+
return pre.slice(0, open + 6) + parts.join("\n") + pre.slice(close);
|
|
85
|
+
}
|
|
86
|
+
function gutterHtml(n, kind, lineNumbers, diffs) {
|
|
87
|
+
if (!lineNumbers && !diffs)
|
|
88
|
+
return "";
|
|
89
|
+
const parts = [];
|
|
90
|
+
if (lineNumbers)
|
|
91
|
+
parts.push(String(n).padStart(3));
|
|
92
|
+
if (diffs)
|
|
93
|
+
parts.push(kind === "add" ? "+" : kind === "remove" ? "\u2212" : " ");
|
|
94
|
+
return `<span class="gutter${kind ? ` ${kind}` : ""}" data-pagefind-ignore>${parts.join(" ")}</span>`;
|
|
95
|
+
}
|
|
96
|
+
function plainBlock(src, opts = {}) {
|
|
97
|
+
const marks = new Set(opts.highlights ?? []);
|
|
98
|
+
const adds = new Set(opts.diffAdd ?? []);
|
|
99
|
+
const removes = new Set(opts.diffRemove ?? []);
|
|
100
|
+
const cls = opts.lineNumbers ? " line-numbers" : "";
|
|
101
|
+
const diffs = adds.size > 0 || removes.size > 0;
|
|
102
|
+
const out = src.split("\n").map((l, i) => {
|
|
103
|
+
const n = i + 1;
|
|
104
|
+
const kind = adds.has(n) ? "add" : removes.has(n) ? "remove" : "";
|
|
105
|
+
const classes = ["line", marks.has(n) && "highlighted", kind && `diff ${kind}`].filter(Boolean).join(" ");
|
|
106
|
+
return `<span class="${classes}">${gutterHtml(n, kind, !!opts.lineNumbers, diffs)}${esc(l)}</span>`;
|
|
107
|
+
});
|
|
108
|
+
return `<pre class="shiki shiki-plain${cls}" tabindex="0"><code>${out.join("\n")}</code></pre>`;
|
|
109
|
+
}
|
|
110
|
+
var NOTATION = /[ \t]*(?:(?:\/\/|#|--|<!--|\/\*|;)[ \t]*)?\[!code (\+\+|--|highlight|hl)(?::(\d+))?\](?:[ \t]*(?:-->|\*\/))?/;
|
|
111
|
+
function applyLineNotation(code, opts = {}) {
|
|
112
|
+
if (!code.includes("[!code"))
|
|
113
|
+
return { code, opts };
|
|
114
|
+
const marks = new Set(opts.highlights ?? []);
|
|
115
|
+
const adds = new Set(opts.diffAdd ?? []);
|
|
116
|
+
const removes = new Set(opts.diffRemove ?? []);
|
|
117
|
+
const out = [];
|
|
118
|
+
let pending;
|
|
119
|
+
const mark = (n, kind) => (kind === "++" ? adds : kind === "--" ? removes : marks).add(n);
|
|
120
|
+
for (const line of code.split("\n")) {
|
|
121
|
+
const m = NOTATION.exec(line);
|
|
122
|
+
const rest = m ? line.replace(NOTATION, "") : line;
|
|
123
|
+
if (m && rest.trim() === "") {
|
|
124
|
+
pending = { kind: m[1], left: Number(m[2] ?? 1) };
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
out.push(rest);
|
|
128
|
+
const n = out.length;
|
|
129
|
+
if (pending && pending.left > 0) {
|
|
130
|
+
mark(n, pending.kind);
|
|
131
|
+
if (--pending.left === 0)
|
|
132
|
+
pending = void 0;
|
|
133
|
+
}
|
|
134
|
+
if (m) {
|
|
135
|
+
const count = Number(m[2] ?? 1);
|
|
136
|
+
mark(n, m[1]);
|
|
137
|
+
if (count > 1)
|
|
138
|
+
pending = { kind: m[1], left: count - 1 };
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return { code: out.join("\n"), opts: { ...opts, highlights: [...marks].sort((a, b) => a - b), diffAdd: [...adds].sort((a, b) => a - b), diffRemove: [...removes].sort((a, b) => a - b) } };
|
|
142
|
+
}
|
|
143
|
+
function createPlainHighlighter() {
|
|
144
|
+
const resolve = (lang) => {
|
|
145
|
+
const l = (lang ?? "").toLowerCase().trim();
|
|
146
|
+
return PLAIN.has(l) ? "text" : l;
|
|
147
|
+
};
|
|
148
|
+
const render = (code, lang, opts = {}) => {
|
|
149
|
+
const text = resolve(lang) === "ansi" ? stripAnsi(code) : code;
|
|
150
|
+
const applied = applyLineNotation(text.replace(/\n$/, ""), opts);
|
|
151
|
+
return plainBlock(stripUnprocessableMarkers(applied.code, true), applied.opts);
|
|
152
|
+
};
|
|
153
|
+
return {
|
|
154
|
+
resolve,
|
|
155
|
+
render,
|
|
156
|
+
code: render,
|
|
157
|
+
has: () => false,
|
|
158
|
+
prime: () => {
|
|
159
|
+
},
|
|
160
|
+
cacheStats: () => ({ entries: 0, chars: 0, hits: 0, misses: 0 })
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
var plainHighlighter = createPlainHighlighter();
|
|
164
|
+
|
|
165
|
+
export {
|
|
166
|
+
stripUnprocessableMarkers,
|
|
167
|
+
stripMarkersForCopy,
|
|
168
|
+
stripAnsi,
|
|
169
|
+
ansiColoursOnly,
|
|
170
|
+
PLAIN,
|
|
171
|
+
parseLineRanges,
|
|
172
|
+
collapseLines,
|
|
173
|
+
plainBlock,
|
|
174
|
+
plainHighlighter
|
|
175
|
+
};
|