@dogsbay/ssg-cli 0.2.0-beta.183 → 0.2.0-beta.188

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.
Files changed (29) hide show
  1. package/AGENTS.md +168 -0
  2. package/README.md +3 -1
  3. package/THIRD-PARTY-NOTICES.txt +23 -17
  4. package/chunks/{build-command-QLNZ5BNK.mjs → build-command-NJATVOUY.mjs} +37 -26
  5. package/chunks/check-command-FL5O3AXB.mjs +577 -0
  6. package/chunks/chunk-2EM7IEQT.mjs +95 -0
  7. package/chunks/{chunk-JABACD5T.mjs → chunk-5A2QPRCV.mjs} +1 -30
  8. package/chunks/chunk-5NQOUB5I.mjs +4534 -0
  9. package/chunks/chunk-CYJ6GFVM.mjs +77 -0
  10. package/chunks/{chunk-KE6N5RFA.mjs → chunk-FFIXBXHD.mjs} +63 -234
  11. package/chunks/chunk-GFG5I7WI.mjs +807 -0
  12. package/chunks/chunk-GZ3E45TE.mjs +2290 -0
  13. package/chunks/chunk-IAAKV7V2.mjs +37 -0
  14. package/chunks/{chunk-IERF2DNL.mjs → chunk-VJ6AESSJ.mjs} +8072 -8555
  15. package/chunks/chunk-X3UPCLX5.mjs +503 -0
  16. package/chunks/{chunk-QDXUP47M.mjs → chunk-ZDH4JRVX.mjs} +1203 -4035
  17. package/chunks/{chunk-LNWQN7K7.mjs → chunk-ZRGJHNES.mjs} +7 -1
  18. package/chunks/compare-W4DJYVHT.mjs +239 -0
  19. package/chunks/compare-command-U36H55IE.mjs +144 -0
  20. package/chunks/{css-build-VKKTSP6P.mjs → css-build-MKIHYHCX.mjs} +2 -1
  21. package/chunks/{dev-HXLVZ7MF.mjs → dev-X3PKN4G3.mjs} +77 -25
  22. package/chunks/{menu-N2AZSZKS.mjs → menu-J3CLVADF.mjs} +9 -5
  23. package/chunks/{publish-command-UFHG6PJN.mjs → publish-command-SAPICGGM.mjs} +15 -7
  24. package/chunks/{release-diff-LFDQIFEF.mjs → release-diff-Y7X63MT3.mjs} +13 -6
  25. package/chunks/{serve-WGWRM7JQ.mjs → serve-7DR4WSYA.mjs} +3 -1
  26. package/cli.mjs +17 -10
  27. package/package.json +4 -3
  28. package/chunks/check-command-5U7VSMDO.mjs +0 -218
  29. package/chunks/chunk-KFYMG4VB.mjs +0 -45
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
+ import {
4
+ detach
5
+ } from "./chunk-5A2QPRCV.mjs";
6
+ import {
7
+ FOREIGN_END,
8
+ FOREIGN_START,
9
+ unesc
10
+ } from "./chunk-G6OTOD3B.mjs";
11
+
12
+ // src/theme/classes.ts
13
+ var FOREIGN_BLOCK = new RegExp(`${FOREIGN_START}[\\s\\S]*?${FOREIGN_END}`, "g");
14
+ var seenValues = /* @__PURE__ */ new WeakMap();
15
+ var SEEN_MAX_CHARS = 1e6;
16
+ function collectClasses(html, into) {
17
+ if (html.includes(FOREIGN_START)) html = html.replace(FOREIGN_BLOCK, "");
18
+ let seen = seenValues.get(into);
19
+ if (!seen) seenValues.set(into, seen = { values: /* @__PURE__ */ new Set(), chars: 0 });
20
+ for (const m of html.matchAll(/\sclass\s*=\s*(?:"([^"]*)"|'([^']*)')/g)) {
21
+ const value = m[1] ?? m[2];
22
+ if (seen.values.has(value)) continue;
23
+ if (seen.chars + value.length <= SEEN_MAX_CHARS) {
24
+ seen.values.add(detach(value));
25
+ seen.chars += value.length;
26
+ }
27
+ for (const tok of value.split(/\s+/)) {
28
+ if (!tok) continue;
29
+ const name = unesc(tok);
30
+ if (!into.has(name)) into.add(detach(name));
31
+ }
32
+ }
33
+ }
34
+
35
+ export {
36
+ collectClasses
37
+ };