@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,93 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
FOREIGN_END,
|
|
5
|
+
FOREIGN_START,
|
|
6
|
+
unesc
|
|
7
|
+
} from "./chunk-G6OTOD3B.mjs";
|
|
8
|
+
|
|
9
|
+
// src/core/detach.ts
|
|
10
|
+
function detach(s) {
|
|
11
|
+
return JSON.parse(JSON.stringify(s));
|
|
12
|
+
}
|
|
13
|
+
function isRef(c) {
|
|
14
|
+
return typeof c === "object" && c !== null && c.ref === true;
|
|
15
|
+
}
|
|
16
|
+
function isLazyText(c) {
|
|
17
|
+
return typeof c === "object" && c !== null && c.lazyText === true;
|
|
18
|
+
}
|
|
19
|
+
function isStream(c) {
|
|
20
|
+
return typeof c === "object" && c !== null && c.stream === true;
|
|
21
|
+
}
|
|
22
|
+
async function joinStream(s) {
|
|
23
|
+
let out = "";
|
|
24
|
+
for await (const c of s.chunks()) out += c;
|
|
25
|
+
return out;
|
|
26
|
+
}
|
|
27
|
+
var TextCache = class {
|
|
28
|
+
constructor(maxChars) {
|
|
29
|
+
this.maxChars = maxChars;
|
|
30
|
+
}
|
|
31
|
+
m = /* @__PURE__ */ new Map();
|
|
32
|
+
size = 0;
|
|
33
|
+
get(key) {
|
|
34
|
+
const v = this.m.get(key);
|
|
35
|
+
if (v !== void 0) {
|
|
36
|
+
this.m.delete(key);
|
|
37
|
+
this.m.set(key, v);
|
|
38
|
+
}
|
|
39
|
+
return v;
|
|
40
|
+
}
|
|
41
|
+
set(key, value) {
|
|
42
|
+
if (value.length > this.maxChars / 4 || this.m.has(key)) return;
|
|
43
|
+
this.m.set(key, value);
|
|
44
|
+
this.size += value.length;
|
|
45
|
+
while (this.size > this.maxChars) {
|
|
46
|
+
const [k, v] = this.m.entries().next().value;
|
|
47
|
+
this.m.delete(k);
|
|
48
|
+
this.size -= v.length;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/** Forget one entry (a file that changed on disk). */
|
|
52
|
+
delete(key) {
|
|
53
|
+
const v = this.m.get(key);
|
|
54
|
+
if (v === void 0) return;
|
|
55
|
+
this.m.delete(key);
|
|
56
|
+
this.size -= v.length;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
var TEXT_FILE = /\.(md|markdown|ya?ml|json|txt|html?|css|js|mjs|svg|xml|csv|ditaval|properties)$/i;
|
|
60
|
+
|
|
61
|
+
// src/theme/classes.ts
|
|
62
|
+
var FOREIGN_BLOCK = new RegExp(`${FOREIGN_START}[\\s\\S]*?${FOREIGN_END}`, "g");
|
|
63
|
+
var seenValues = /* @__PURE__ */ new WeakMap();
|
|
64
|
+
var SEEN_MAX_CHARS = 1e6;
|
|
65
|
+
function collectClasses(html, into) {
|
|
66
|
+
if (html.includes(FOREIGN_START)) html = html.replace(FOREIGN_BLOCK, "");
|
|
67
|
+
let seen = seenValues.get(into);
|
|
68
|
+
if (!seen) seenValues.set(into, seen = { values: /* @__PURE__ */ new Set(), chars: 0 });
|
|
69
|
+
for (const m of html.matchAll(/\sclass\s*=\s*(?:"([^"]*)"|'([^']*)')/g)) {
|
|
70
|
+
const value = m[1] ?? m[2];
|
|
71
|
+
if (seen.values.has(value)) continue;
|
|
72
|
+
if (seen.chars + value.length <= SEEN_MAX_CHARS) {
|
|
73
|
+
seen.values.add(detach(value));
|
|
74
|
+
seen.chars += value.length;
|
|
75
|
+
}
|
|
76
|
+
for (const tok of value.split(/\s+/)) {
|
|
77
|
+
if (!tok) continue;
|
|
78
|
+
const name = unesc(tok);
|
|
79
|
+
if (!into.has(name)) into.add(detach(name));
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
detach,
|
|
86
|
+
isRef,
|
|
87
|
+
isLazyText,
|
|
88
|
+
isStream,
|
|
89
|
+
joinStream,
|
|
90
|
+
TextCache,
|
|
91
|
+
TEXT_FILE,
|
|
92
|
+
collectClasses
|
|
93
|
+
};
|