@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.
Files changed (88) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +17 -0
  3. package/README.md +62 -2
  4. package/THIRD-PARTY-NOTICES.txt +2363 -0
  5. package/chunks/bash-WN2IW2MU.mjs +9 -0
  6. package/chunks/bat-KLYVST7G.mjs +12 -0
  7. package/chunks/build-command-WQJANVGR.mjs +409 -0
  8. package/chunks/c-NBVQ7G3X.mjs +9 -0
  9. package/chunks/check-command-QTJ6BUNL.mjs +215 -0
  10. package/chunks/chunk-4KDUWLRS.mjs +12 -0
  11. package/chunks/chunk-CMGKSS45.mjs +34 -0
  12. package/chunks/chunk-CUTL24GH.mjs +12 -0
  13. package/chunks/chunk-ECAZ77NS.mjs +12 -0
  14. package/chunks/chunk-F6VRYHSY.mjs +5048 -0
  15. package/chunks/chunk-FJPQZU44.mjs +12 -0
  16. package/chunks/chunk-G6OTOD3B.mjs +48 -0
  17. package/chunks/chunk-GIP2FIA6.mjs +12 -0
  18. package/chunks/chunk-IAR2KPZC.mjs +12 -0
  19. package/chunks/chunk-IZF74GZZ.mjs +7340 -0
  20. package/chunks/chunk-JABACD5T.mjs +93 -0
  21. package/chunks/chunk-JRPXZBM2.mjs +12 -0
  22. package/chunks/chunk-JXFQPMYJ.mjs +43806 -0
  23. package/chunks/chunk-JXM2XRAR.mjs +16 -0
  24. package/chunks/chunk-KEHZHWE6.mjs +12 -0
  25. package/chunks/chunk-LC74DHS3.mjs +28 -0
  26. package/chunks/chunk-LNWQN7K7.mjs +47 -0
  27. package/chunks/chunk-NJDUOQI7.mjs +12 -0
  28. package/chunks/chunk-OBUK53NJ.mjs +154 -0
  29. package/chunks/chunk-STRHO6SY.mjs +44 -0
  30. package/chunks/chunk-TIRB4ROQ.mjs +20 -0
  31. package/chunks/chunk-UKZGJ5AP.mjs +11201 -0
  32. package/chunks/chunk-USOBJLOJ.mjs +12 -0
  33. package/chunks/chunk-X4ZSG4OM.mjs +12 -0
  34. package/chunks/chunk-XABJJODS.mjs +16 -0
  35. package/chunks/chunk-XYPTZFVB.mjs +31503 -0
  36. package/chunks/chunk-YVSP26OS.mjs +175 -0
  37. package/chunks/chunk-Z7WUDBZV.mjs +5577 -0
  38. package/chunks/chunk-ZPII4MCC.mjs +12 -0
  39. package/chunks/chunk-ZW635UYF.mjs +44 -0
  40. package/chunks/core-Z65HALUT.mjs +5926 -0
  41. package/chunks/cpp-JNQSOSM7.mjs +11 -0
  42. package/chunks/csharp-UTVXXLBH.mjs +12 -0
  43. package/chunks/css-DR3MZC2R.mjs +9 -0
  44. package/chunks/css-build-WUW5N4IC.mjs +6290 -0
  45. package/chunks/dev-X3Y5P4KI.mjs +979 -0
  46. package/chunks/diff-GTIUNONZ.mjs +12 -0
  47. package/chunks/docker-2O2WO47V.mjs +12 -0
  48. package/chunks/go-KFRO4WHX.mjs +12 -0
  49. package/chunks/graphql-H4XAFKUQ.mjs +13 -0
  50. package/chunks/groovy-IAOB4GSA.mjs +12 -0
  51. package/chunks/hcl-OV4NBCSV.mjs +12 -0
  52. package/chunks/highlight-XB2G5VI5.mjs +16 -0
  53. package/chunks/html-HNUETIJT.mjs +11 -0
  54. package/chunks/http-POY7GQIM.mjs +33 -0
  55. package/chunks/ini-ZWSSZBAD.mjs +9 -0
  56. package/chunks/java-UNHKAALA.mjs +9 -0
  57. package/chunks/javascript-5I4F2MOK.mjs +9 -0
  58. package/chunks/json-HUSK22EN.mjs +9 -0
  59. package/chunks/jsonc-3FJRQVYX.mjs +12 -0
  60. package/chunks/jsx-MPXQICPA.mjs +9 -0
  61. package/chunks/katex-assets-2JWTS7KK.mjs +11 -0
  62. package/chunks/kotlin-44HLBZQT.mjs +12 -0
  63. package/chunks/makefile-MN7GTSOT.mjs +12 -0
  64. package/chunks/markdown-BSJW56ZV.mjs +12 -0
  65. package/chunks/math-VI3BIAAZ.mjs +14509 -0
  66. package/chunks/nginx-THNEASQW.mjs +17 -0
  67. package/chunks/pele-SYMSY5GD.mjs +20582 -0
  68. package/chunks/powershell-FLIIURPX.mjs +12 -0
  69. package/chunks/properties-5JRW4GXO.mjs +9 -0
  70. package/chunks/publish-command-J7KGJTLD.mjs +858 -0
  71. package/chunks/python-AMYOSLZN.mjs +12 -0
  72. package/chunks/release-diff-JMNCG2T7.mjs +108 -0
  73. package/chunks/ruby-45KKBAF3.mjs +69 -0
  74. package/chunks/rust-HHHRMWV3.mjs +12 -0
  75. package/chunks/scss-SXP65CI5.mjs +16 -0
  76. package/chunks/serve-CUWABTUV.mjs +66 -0
  77. package/chunks/shellsession-Z5NIGXRL.mjs +16 -0
  78. package/chunks/sql-BZT6ET7H.mjs +9 -0
  79. package/chunks/toml-U6LUKYDZ.mjs +12 -0
  80. package/chunks/topicmap-V7FYXTVQ.mjs +383 -0
  81. package/chunks/tsx-65AAFPTH.mjs +9 -0
  82. package/chunks/typescript-P7INMWMZ.mjs +9 -0
  83. package/chunks/xml-OWRWNCOT.mjs +10 -0
  84. package/chunks/xsl-CDSW6KM4.mjs +17 -0
  85. package/chunks/yaml-GNE6PFDT.mjs +9 -0
  86. package/cli.mjs +83 -0
  87. package/highlight-worker.mjs +20 -0
  88. package/package.json +25 -4
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
+ import {
4
+ shellscript_default
5
+ } from "./chunk-NJDUOQI7.mjs";
6
+ import "./chunk-STRHO6SY.mjs";
7
+ export {
8
+ shellscript_default as default
9
+ };
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
+ import "./chunk-STRHO6SY.mjs";
4
+
5
+ // node_modules/@shikijs/langs/dist/bat.mjs
6
+ var lang = Object.freeze(JSON.parse('{"displayName":"Batch File","injections":{"L:meta.block.repeat.batchfile":{"patterns":[{"include":"#repeatParameter"}]}},"name":"bat","patterns":[{"include":"#commands"},{"include":"#comments"},{"include":"#constants"},{"include":"#controls"},{"include":"#escaped_characters"},{"include":"#labels"},{"include":"#numbers"},{"include":"#operators"},{"include":"#parens"},{"include":"#strings"},{"include":"#variables"}],"repository":{"command_set":{"patterns":[{"begin":"(?<=^|[@\\\\s])(?i:SET)(?=$|\\\\s)","beginCaptures":{"0":{"name":"keyword.command.batchfile"}},"end":"(?=$\\\\n|[\\\\&)<>|])","patterns":[{"include":"#command_set_inside"}]}]},"command_set_group":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.group.begin.batchfile"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.batchfile"}},"patterns":[{"include":"#command_set_inside_arithmetic"}]}]},"command_set_inside":{"patterns":[{"include":"#escaped_characters"},{"include":"#variables"},{"include":"#numbers"},{"include":"#parens"},{"include":"#command_set_strings"},{"include":"#strings"},{"begin":"([^ ][^=]*)(=)","beginCaptures":{"1":{"name":"variable.other.readwrite.batchfile"},"2":{"name":"keyword.operator.assignment.batchfile"}},"end":"(?=$\\\\n|[\\\\&)<>|])","patterns":[{"include":"#escaped_characters"},{"include":"#variables"},{"include":"#numbers"},{"include":"#parens"},{"include":"#strings"}]},{"begin":"\\\\s+/[Aa]\\\\s+","end":"(?=$\\\\n|[\\\\&)<>|])","name":"meta.expression.set.batchfile","patterns":[{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.batchfile"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.batchfile"}},"name":"string.quoted.double.batchfile","patterns":[{"include":"#command_set_inside_arithmetic"},{"include":"#command_set_group"},{"include":"#variables"}]},{"include":"#command_set_inside_arithmetic"},{"include":"#command_set_group"}]},{"begin":"\\\\s+/[Pp]\\\\s+","end":"(?=$\\\\n|[\\\\&)<>|])","patterns":[{"include":"#command_set_strings"},{"begin":"([^ ][^=]*)(=)","beginCaptures":{"1":{"name":"variable.other.readwrite.batchfile"},"2":{"name":"keyword.operator.assignment.batchfile"}},"end":"(?=$\\\\n|[\\\\&)<>|])","name":"meta.prompt.set.batchfile","patterns":[{"include":"#strings"}]}]}]},"command_set_inside_arithmetic":{"patterns":[{"include":"#command_set_operators"},{"include":"#numbers"},{"match":",","name":"punctuation.separator.batchfile"}]},"command_set_operators":{"patterns":[{"captures":{"1":{"name":"variable.other.readwrite.batchfile"},"2":{"name":"keyword.operator.assignment.augmented.batchfile"}},"match":"([^ ]*)((?:[-*+/]|%%|[\\\\&^|]|<<|>>)=)"},{"match":"[-*+/]|%%|[\\\\&^|]|<<|>>|~","name":"keyword.operator.arithmetic.batchfile"},{"match":"!","name":"keyword.operator.logical.batchfile"},{"captures":{"1":{"name":"variable.other.readwrite.batchfile"},"2":{"name":"keyword.operator.assignment.batchfile"}},"match":"([^ =]*)(=)"}]},"command_set_strings":{"patterns":[{"begin":"(\\")\\\\s*([^ ][^=]*)(=)","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.batchfile"},"2":{"name":"variable.other.readwrite.batchfile"},"3":{"name":"keyword.operator.assignment.batchfile"}},"end":"\\"","endCaptures":{"0":{"name":"punctuation.definition.string.end.batchfile"}},"name":"string.quoted.double.batchfile","patterns":[{"include":"#variables"},{"include":"#numbers"},{"include":"#escaped_characters"}]}]},"commands":{"patterns":[{"match":"(?<=^|[@\\\\s])(?i:adprep|append|arp|assoc|at|atmadm|attrib|auditpol|autochk|autoconv|autofmt|bcdboot|bcdedit|bdehdcfg|bitsadmin|bootcfg|brea|cacls|cd|certreq|certutil|change|chcp|chdir|chglogon|chgport|chgusr|chkdsk|chkntfs|choice|cipher|clip|cls|clscluadmin|cluster|cmd|cmdkey|cmstp|color|comp|compact|convert|copy|cprofile|cscript|csvde|date|dcdiag|dcgpofix|dcpromo|defra|del|dfscmd|dfsdiag|dfsrmig|diantz|dir|dirquota|diskcomp|diskcopy|diskpart|diskperf|diskraid|diskshadow|dispdiag|doin|dnscmd|doskey|driverquery|dsacls|dsadd|dsamain|dsdbutil|dsget|dsmgmt|dsmod|dsmove|dsquery|dsrm|edit|endlocal|eraseesentutl|eventcreate|eventquery|eventtriggers|evntcmd|expand|extract|fc|filescrn|find|findstr|finger|flattemp|fonde|forfiles|format|freedisk|fsutil|ftp|ftype|fveupdate|getmac|gettype|gpfixup|gpresult|gpupdate|graftabl|hashgen|hep|helpctr|hostname|icacls|iisreset|inuse|ipconfig|ipxroute|irftp|ismserv|jetpack|klist|ksetup|ktmutil|ktpass|label|ldifd|ldp|lodctr|logman|logoff|lpq|lpr|macfile|makecab|manage-bde|mapadmin|md|mkdir|mklink|mmc|mode|more|mount|mountvol|move|mqbup|mqsvc|mqtgsvc|msdt|msg|msiexec|msinfo32|mstsc|nbtstat|net computer|net group|net localgroup|net print|net session|net share|net start|net stop|net user??|net view|net|netcfg|netdiag|netdom|netsh|netstat|nfsadmin|nfsshare|nfsstat|nlb|nlbmgr|nltest|nslookup|ntackup|ntcmdprompt|ntdsutil|ntfrsutl|openfiles|pagefileconfig|path|pathping|pause|pbadmin|pentnt|perfmon|ping|pnpunatten|pnputil|popd|powercfg|powershell|powershell_ise|print|prncnfg|prndrvr|prnjobs|prnmngr|prnport|prnqctl|prompt|pubprn|pushd|pushprinterconnections|pwlauncher|qappsrv|qprocess|query|quser|qwinsta|rasdial|rcp|rd|rdpsign|regentc|recover|redircmp|redirusr|reg|regini|regsvr32|relog|ren|rename|rendom|repadmin|repair-bde|replace|reset session|rxec|risetup|rmdir|robocopy|route|rpcinfo|rpcping|rsh|runas|rundll32|rwinsta|sc|schtasks|scp|scwcmd|secedit|serverceipoptin|servrmanagercmd|serverweroptin|setspn|setx|sfc|sftp|shadow|shift|showmount|shutdown|sort|ssh|ssh-add|ssh-agent|ssh-keygen|ssh-keyscan|start|storrept|subst|sxstrace|ysocmgr|systeminfo|takeown|tapicfg|taskkill|tasklist|tcmsetup|telnet|tftp|time|timeout|title|tlntadmn|tpmvscmgr|tacerpt|tracert|tree|tscon|tsdiscon|tsecimp|tskill|tsprof|type|typeperf|tzutil|uddiconfig|umount|unlodctr|ver|verifier|verif|vol|vssadmin|w32tm|waitfor|wbadmin|wdsutil|wecutil|wevtutil|where|whoami|winnt|winnt32|winpop|winrm|winrs|winsat|wlbs|wmic|wscript|wsl|xcopy)(?=$|\\\\s)","name":"keyword.command.batchfile"},{"begin":"(?i)(?<=^|[@\\\\s])(echo)(?:(?=$|[.:])|\\\\s+(?:(o(?:n|ff))(?=\\\\s*$))?)","beginCaptures":{"1":{"name":"keyword.command.batchfile"},"2":{"name":"keyword.other.special-method.batchfile"}},"end":"(?=$\\\\n|[\\\\&)<>|])","patterns":[{"include":"#escaped_characters"},{"include":"#variables"},{"include":"#numbers"},{"include":"#strings"}]},{"captures":{"1":{"name":"keyword.command.batchfile"},"2":{"name":"keyword.other.special-method.batchfile"}},"match":"(?i)(?<=^|[@\\\\s])(setlocal)(?:\\\\s*$|\\\\s+((?:En|Dis)able(?:Extensions|DelayedExpansion))(?=\\\\s*$))"},{"include":"#command_set"}]},"comments":{"patterns":[{"begin":"(?:^|(&))\\\\s*(?=(:[ +,:;=]))","beginCaptures":{"1":{"name":"keyword.operator.conditional.batchfile"}},"end":"\\\\n","patterns":[{"begin":"(:[ +,:;=])","beginCaptures":{"1":{"name":"punctuation.definition.comment.batchfile"}},"end":"(?=\\\\n)","name":"comment.line.colon.batchfile"}]},{"begin":"(?<=^|[@\\\\s])(?i)(REM)(\\\\.)","beginCaptures":{"1":{"name":"keyword.command.rem.batchfile"},"2":{"name":"punctuation.separator.batchfile"}},"end":"(?=$\\\\n|[\\\\&)<>|])","name":"comment.line.rem.batchfile"},{"begin":"(?<=^|[@\\\\s])(?i:rem)\\\\b","beginCaptures":{"0":{"name":"keyword.command.rem.batchfile"}},"end":"\\\\n","name":"comment.line.rem.batchfile","patterns":[{"match":"[<>|]","name":"invalid.illegal.unexpected-character.batchfile"}]}]},"constants":{"patterns":[{"match":"\\\\b(?i:NUL)\\\\b","name":"constant.language.batchfile"}]},"controls":{"patterns":[{"match":"(?i)(?<=^|\\\\s)(?:call|exit(?=$|\\\\s)|goto(?=$|[:\\\\s]))","name":"keyword.control.statement.batchfile"},{"captures":{"1":{"name":"keyword.control.conditional.batchfile"},"2":{"name":"keyword.operator.logical.batchfile"},"3":{"name":"keyword.other.special-method.batchfile"}},"match":"(?<=^|\\\\s)(?i)(if)\\\\s+(?:(not)\\\\s+)?(exist|defined|errorlevel|cmdextversion)(?=\\\\s)"},{"match":"(?<=^|\\\\s)(?i)(?:if|else)(?=$|\\\\s)","name":"keyword.control.conditional.batchfile"},{"begin":"(?<=^|[\\\\&(^\\\\s])(?i)for(?=\\\\s)","beginCaptures":{"0":{"name":"keyword.control.repeat.batchfile"}},"end":"\\\\n","name":"meta.block.repeat.batchfile","patterns":[{"begin":"(?<=[\\\\^\\\\s])(?i)in(?=\\\\s)","beginCaptures":{"0":{"name":"keyword.control.repeat.in.batchfile"}},"end":"(?<=[)^\\\\s])(?i)do(?=\\\\s)|\\\\n","endCaptures":{"0":{"name":"keyword.control.repeat.do.batchfile"}},"patterns":[{"include":"$self"}]},{"include":"$self"}]}]},"escaped_characters":{"patterns":[{"match":"%%|\\\\^\\\\^!|\\\\^(?=.)|\\\\^\\\\n","name":"constant.character.escape.batchfile"}]},"labels":{"patterns":[{"captures":{"1":{"name":"punctuation.separator.batchfile"},"2":{"name":"keyword.other.special-method.batchfile"}},"match":"(?i)(?:^\\\\s*|(?<=call|goto)\\\\s*)(:)([^+,:;=\\\\s]\\\\S*)"}]},"numbers":{"patterns":[{"match":"(?<=^|[=\\\\s])(0[Xx]\\\\h*|[-+]?\\\\d+)(?=$|[<>\\\\s])","name":"constant.numeric.batchfile"}]},"operators":{"patterns":[{"match":"@(?=\\\\S)","name":"keyword.operator.at.batchfile"},{"match":"(?<=\\\\s)(?i:EQU|NEQ|LSS|LEQ|GTR|GEQ)(?=\\\\s)|==","name":"keyword.operator.comparison.batchfile"},{"match":"(?<=\\\\s)(?i)(NOT)(?=\\\\s)","name":"keyword.operator.logical.batchfile"},{"match":"(?<!\\\\^)&&?|\\\\|\\\\|","name":"keyword.operator.conditional.batchfile"},{"match":"(?<!\\\\^)\\\\|","name":"keyword.operator.pipe.batchfile"},{"match":"<&?|>[\\\\&>]?","name":"keyword.operator.redirection.batchfile"}]},"parens":{"patterns":[{"begin":"\\\\(","beginCaptures":{"0":{"name":"punctuation.section.group.begin.batchfile"}},"end":"\\\\)","endCaptures":{"0":{"name":"punctuation.section.group.end.batchfile"}},"name":"meta.group.batchfile","patterns":[{"match":"[,;]","name":"punctuation.separator.batchfile"},{"include":"$self"}]}]},"repeatParameter":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.batchfile"}},"match":"(%%)(?i:~[adfnpstxz]*(?:\\\\$PATH:)?)?[A-Za-z]","name":"variable.parameter.repeat.batchfile"}]},"strings":{"patterns":[{"begin":"\\"","beginCaptures":{"0":{"name":"punctuation.definition.string.begin.batchfile"}},"end":"(\\")|(\\\\n)","endCaptures":{"1":{"name":"punctuation.definition.string.end.batchfile"},"2":{"name":"invalid.illegal.newline.batchfile"}},"name":"string.quoted.double.batchfile","patterns":[{"match":"%%","name":"constant.character.escape.batchfile"},{"include":"#variables"}]}]},"variable":{"patterns":[{"begin":"%(?=[^%]+%)","beginCaptures":{"0":{"name":"punctuation.definition.variable.begin.batchfile"}},"end":"(%)|\\\\n","endCaptures":{"1":{"name":"punctuation.definition.variable.end.batchfile"}},"name":"variable.other.readwrite.batchfile","patterns":[{"begin":":~","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n%])","name":"meta.variable.substring.batchfile","patterns":[{"include":"#variable_substring"}]},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n%])","name":"meta.variable.substitution.batchfile","patterns":[{"include":"#variable_replace"},{"begin":"=","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n%])","patterns":[{"include":"#variable_delayed_expansion"},{"match":"[^%]+","name":"string.unquoted.batchfile"}]}]}]}]},"variable_delayed_expansion":{"patterns":[{"begin":"!(?=[^!]+!)","beginCaptures":{"0":{"name":"punctuation.definition.variable.begin.batchfile"}},"end":"(!)|\\\\n","endCaptures":{"1":{"name":"punctuation.definition.variable.end.batchfile"}},"name":"variable.other.readwrite.batchfile","patterns":[{"begin":":~","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n!])","name":"meta.variable.substring.batchfile","patterns":[{"include":"#variable_substring"}]},{"begin":":","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n!])","name":"meta.variable.substitution.batchfile","patterns":[{"include":"#escaped_characters"},{"include":"#variable_replace"},{"include":"#variable"},{"begin":"=","beginCaptures":{"0":{"name":"punctuation.separator.batchfile"}},"end":"(?=[\\\\n!])","patterns":[{"include":"#variable"},{"match":"[^!]+","name":"string.unquoted.batchfile"}]}]}]}]},"variable_replace":{"patterns":[{"match":"[^\\\\n!%=]+","name":"string.unquoted.batchfile"}]},"variable_substring":{"patterns":[{"captures":{"1":{"name":"constant.numeric.batchfile"},"2":{"name":"punctuation.separator.batchfile"},"3":{"name":"constant.numeric.batchfile"}},"match":"([-+]?\\\\d+)(?:(,)([-+]?\\\\d+))?"}]},"variables":{"patterns":[{"captures":{"1":{"name":"punctuation.definition.variable.batchfile"}},"match":"(%)(?:(?i:~[adfnpstxz]*(?:\\\\$PATH:)?)?\\\\d|\\\\*)","name":"variable.parameter.batchfile"},{"include":"#variable"},{"include":"#variable_delayed_expansion"}]}},"scopeName":"source.batchfile","aliases":["batch"]}'));
7
+ var bat_default = [
8
+ lang
9
+ ];
10
+ export {
11
+ bat_default as default
12
+ };
@@ -0,0 +1,409 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
+ import {
4
+ cliMemorySettings,
5
+ diagramRenderers,
6
+ iconResolver
7
+ } from "./chunk-OBUK53NJ.mjs";
8
+ import {
9
+ UNTRUSTED_DATA_LIMITS,
10
+ build,
11
+ buildUnits,
12
+ fileSink,
13
+ parseConfig,
14
+ prepareOut,
15
+ projectRoots,
16
+ readBuildFiles,
17
+ readManifests,
18
+ removeStaleUnitFiles,
19
+ selectUnits,
20
+ unitFilesOf
21
+ } from "./chunk-XYPTZFVB.mjs";
22
+ import "./chunk-F6VRYHSY.mjs";
23
+ import {
24
+ FAILING_CODES,
25
+ UsageError,
26
+ dataProblemLines,
27
+ flag,
28
+ option,
29
+ positional
30
+ } from "./chunk-LNWQN7K7.mjs";
31
+ import "./chunk-YVSP26OS.mjs";
32
+ import "./chunk-Z7WUDBZV.mjs";
33
+ import "./chunk-JABACD5T.mjs";
34
+ import "./chunk-G6OTOD3B.mjs";
35
+ import {
36
+ __require
37
+ } from "./chunk-STRHO6SY.mjs";
38
+
39
+ // src/node/build-command.ts
40
+ import { existsSync as existsSync2, readFileSync as readFileSync2 } from "node:fs";
41
+ import { join as join3, resolve as resolve2, sep } from "node:path";
42
+
43
+ // src/node/highlight-pool.ts
44
+ import { availableParallelism } from "node:os";
45
+ import { Worker } from "node:worker_threads";
46
+ function highlightThreads(env = process.env.DOGSBAY_HIGHLIGHT_THREADS) {
47
+ if (env !== void 0 && env !== "") {
48
+ const n = Number(env);
49
+ if (Number.isInteger(n) && n >= 0) return n;
50
+ console.warn(`warn DOGSBAY_HIGHLIGHT_THREADS="${env}" is not a whole number; using the default`);
51
+ }
52
+ return availableParallelism() >= 3 ? 2 : 0;
53
+ }
54
+ function highlightPool(threads, workerUrl = new URL("./highlight-worker.mjs", import.meta.url)) {
55
+ const pending = /* @__PURE__ */ new Map();
56
+ const load = [];
57
+ let nextId = 0;
58
+ let dead = 0;
59
+ let closing = false;
60
+ const workers = Array.from({ length: threads }, (_, w) => {
61
+ load.push(0);
62
+ const worker = new Worker(workerUrl);
63
+ worker.on("message", (m) => {
64
+ const p = pending.get(m.id);
65
+ if (!p) return;
66
+ pending.delete(m.id);
67
+ load[w]--;
68
+ if (m.html) p.resolve(m.html);
69
+ else p.reject(new Error(m.error ?? "highlight worker failed"));
70
+ });
71
+ const die = (e) => {
72
+ if (load[w] === Number.POSITIVE_INFINITY) return;
73
+ load[w] = Number.POSITIVE_INFINITY;
74
+ dead++;
75
+ for (const [id, p] of pending) {
76
+ if (p.worker !== w) continue;
77
+ pending.delete(id);
78
+ p.reject(e);
79
+ }
80
+ };
81
+ worker.on("error", die);
82
+ worker.on("messageerror", die);
83
+ worker.on("exit", (code) => {
84
+ if (!closing) die(new Error(`highlight worker exited (code ${code})`));
85
+ });
86
+ return worker;
87
+ });
88
+ return {
89
+ threads,
90
+ dead: () => dead,
91
+ render(blocks) {
92
+ let w = 0;
93
+ for (let i = 1; i < load.length; i++) if (load[i] < load[w]) w = i;
94
+ if (!Number.isFinite(load[w])) return Promise.reject(new Error("no highlight worker left"));
95
+ const id = nextId++;
96
+ load[w]++;
97
+ return new Promise((resolve3, reject) => {
98
+ pending.set(id, { resolve: resolve3, reject, worker: w });
99
+ workers[w].postMessage({ id, blocks });
100
+ });
101
+ },
102
+ async close() {
103
+ closing = true;
104
+ await Promise.all(workers.map((w) => w.terminate()));
105
+ }
106
+ };
107
+ }
108
+
109
+ // src/node/pagefind.ts
110
+ import { existsSync, readFileSync } from "node:fs";
111
+ import { dirname, join, resolve } from "node:path";
112
+ import { pathToFileURL } from "node:url";
113
+ function findPagefind(dir) {
114
+ for (let d = resolve(dir); ; d = dirname(d)) {
115
+ const pkg = join(d, "node_modules", "pagefind");
116
+ if (existsSync(join(pkg, "package.json"))) return pkg;
117
+ if (dirname(d) === d) return void 0;
118
+ }
119
+ }
120
+ async function loadPagefind(from) {
121
+ try {
122
+ return await import("pagefind");
123
+ } catch {
124
+ for (const dir of from) {
125
+ const pkg = findPagefind(dir);
126
+ if (!pkg) continue;
127
+ const meta = JSON.parse(readFileSync(join(pkg, "package.json"), "utf8"));
128
+ return await import(pathToFileURL(join(pkg, meta.exports?.["."]?.import ?? meta.main ?? "index.js")).href);
129
+ }
130
+ return void 0;
131
+ }
132
+ }
133
+ async function pagefindIndexer(cfg, only, from = [process.cwd()]) {
134
+ const pagefind = await loadPagefind(from);
135
+ if (!pagefind) throw new Error(`ssg.search: ${cfg.searchEngine} needs the pagefind package: npm install pagefind`);
136
+ const prefixes = selectUnits(buildUnits(cfg), only?.length ? only : void 0).map((u) => u.prefix).sort((a, b) => b.length - a.length);
137
+ const indexes = /* @__PURE__ */ new Map();
138
+ for (const p of prefixes) {
139
+ const { index, errors } = await pagefind.createIndex();
140
+ if (!index || errors.length) throw new Error(`pagefind: ${errors.join("; ") || "could not create an index"}`);
141
+ indexes.set(p, index);
142
+ }
143
+ let pages = 0;
144
+ return {
145
+ /** Wrap a sink: every HTML page also goes to its unit's index. Pages without data-pagefind-body (404, redirects) are skipped by Pagefind. */
146
+ wrap(sink) {
147
+ return async (p, c) => {
148
+ await sink(p, c);
149
+ if (!p.endsWith(".html") || typeof c !== "string") return;
150
+ const prefix = prefixes.find((x) => x === "" || p.startsWith(`${x}/`));
151
+ if (prefix === void 0) return;
152
+ const { errors } = await indexes.get(prefix).addHTMLFile({ url: `/${prefix ? p.slice(prefix.length + 1) : p}`, content: c });
153
+ if (errors.length) throw new Error(`pagefind: ${p}: ${errors.join("; ")}`);
154
+ pages++;
155
+ };
156
+ },
157
+ async finish(out) {
158
+ for (const [prefix, index] of indexes) {
159
+ const { errors } = await index.writeFiles({ outputPath: join(out, prefix, "pagefind") });
160
+ if (errors.length) throw new Error(`pagefind: ${errors.join("; ")}`);
161
+ }
162
+ await pagefind.close();
163
+ return { pages, units: indexes.size };
164
+ }
165
+ };
166
+ }
167
+
168
+ // src/node/build-command.ts
169
+ import { createHash as createHash2 } from "node:crypto";
170
+
171
+ // src/core/worker-settings.ts
172
+ var WORKER_BUILD_SETTINGS = {
173
+ // Projects come from anyone with the token, and every site shares the Worker's origin: raw HTML
174
+ // is sanitized unless the project sets content.html: keep (plans/html-safety.md), which a
175
+ // published site cannot (untrusted).
176
+ defaultHtml: "sanitize",
177
+ diagramCacheChars: 2e6,
178
+ // Its 128 MB also holds the build: the highlight cache stays at the size it had before the LRU.
179
+ highlightCacheChars: 4e6,
180
+ // One embedded spec's page, within the isolate's 128 MB (the page, its Markdown copy and the tree are all held at once).
181
+ openApiChars: 5e5,
182
+ diagramPinChars: 24e6,
183
+ // Data files from anyone with the token: the untrusted limits (1 MB a file, 8 MB per version or
184
+ // language, 4 MB read by one page's directives), and their parses kept in 12 MB, not the CLI's 32:
185
+ // a 1 MB CSV weighs about 5.4 MB in the cache (its parse and its text in the key), so less keeps none.
186
+ dataLimits: UNTRUSTED_DATA_LIMITS,
187
+ dataCacheBytes: 12e6,
188
+ // Included templates' parses: 4 MB keeps 97% of what the 8 MB default reuses on OpenShift.
189
+ parseCacheBytes: 4e6,
190
+ // Include sources: 2M characters, not the 8M default; on OpenShift that holds 8 MB less (docs-dev/performance.md, "What the rest of the heap is").
191
+ textCacheChars: 2e6,
192
+ // Pages prepared ahead of rendering while their blocks are highlighted: 8, not the CLI's 24 (each holds its tree),
193
+ // and past the next page at most 4M characters of their source and the HTML delivered for them (8 to 17 times the code).
194
+ highlightAhead: { pages: 8, chars: 4e6 }
195
+ };
196
+ var PUBLISHED_TEMPLATE_MS = { renderMs: 1e4, buildMs: 24e4 };
197
+
198
+ // src/node/tree-store.ts
199
+ import { createHash } from "node:crypto";
200
+ import { mkdirSync, readdirSync, rmSync } from "node:fs";
201
+ import { readFile, rename, rm, writeFile } from "node:fs/promises";
202
+ import { join as join2 } from "node:path";
203
+ import { promisify } from "node:util";
204
+ import { gunzip, gzip } from "node:zlib";
205
+ var gzipAsync = promisify(gzip);
206
+ var gunzipAsync = promisify(gunzip);
207
+ var MAX_NAME = 120;
208
+ function groupFile(key) {
209
+ let name = "";
210
+ for (const b of new TextEncoder().encode(key)) {
211
+ const c = String.fromCharCode(b);
212
+ name += /[a-z0-9_-]/.test(c) ? c : "%" + b.toString(16).toUpperCase().padStart(2, "0");
213
+ }
214
+ if (name.length > MAX_NAME) name = "~" + createHash("sha256").update(key).digest("hex");
215
+ return name + ".gz";
216
+ }
217
+ var tmpN = 0;
218
+ function diskTreeStore(cacheDir) {
219
+ const dir = join2(cacheDir, "trees");
220
+ mkdirSync(dir, { recursive: true });
221
+ const used = /* @__PURE__ */ new Set();
222
+ return {
223
+ store: {
224
+ async get(key) {
225
+ const f = groupFile(key);
226
+ used.add(f);
227
+ let gz;
228
+ try {
229
+ gz = await readFile(join2(dir, f));
230
+ } catch {
231
+ return null;
232
+ }
233
+ try {
234
+ return (await gunzipAsync(gz)).toString("utf8");
235
+ } catch {
236
+ return null;
237
+ }
238
+ },
239
+ async put(key, text) {
240
+ const f = groupFile(key);
241
+ used.add(f);
242
+ const tmp = join2(dir, `.${f}.${process.pid}.${++tmpN}.tmp`);
243
+ try {
244
+ await writeFile(tmp, await gzipAsync(Buffer.from(text, "utf8")));
245
+ await rename(tmp, join2(dir, f));
246
+ } catch (e) {
247
+ await rm(tmp, { force: true });
248
+ throw e;
249
+ }
250
+ }
251
+ },
252
+ removeUnused() {
253
+ let n = 0;
254
+ for (const f of readdirSync(dir)) {
255
+ if (f.startsWith(".") && f.endsWith(".tmp") && !f.includes(`.${process.pid}.`)) {
256
+ rmSync(join2(dir, f), { force: true });
257
+ continue;
258
+ }
259
+ if (!f.endsWith(".gz") || f.startsWith(".") || used.has(f)) continue;
260
+ rmSync(join2(dir, f), { force: true });
261
+ n++;
262
+ }
263
+ return n;
264
+ }
265
+ };
266
+ }
267
+
268
+ // src/node/build-command.ts
269
+ var threadCpuMs = () => {
270
+ const u = process.threadCpuUsage();
271
+ return (u.user + u.system) / 1e3;
272
+ };
273
+ var within = (a, b) => a === b || a.startsWith(b.endsWith(sep) ? b : b + sep);
274
+ function checkCacheDir(cacheDir, out, project, cfg, untrusted) {
275
+ if (within(cacheDir, out) || within(out, cacheDir)) throw new UsageError(`--cache ${cacheDir}: not the output folder, inside it or around it (each build replaces ${out})`);
276
+ for (const root of projectRoots(cfg)) {
277
+ const r = resolve2(project, root);
278
+ if (within(r, cacheDir)) throw new UsageError(`--cache ${cacheDir}: holds ${r}, which the build reads; give a folder of its own`);
279
+ }
280
+ if (untrusted && within(cacheDir, project)) throw new UsageError(`--cache ${cacheDir}: an untrusted build keeps its cache outside the project, which could bring its own`);
281
+ }
282
+ async function runBuild(args, highlightWorker, mode = {}) {
283
+ const outOpt = option(args, "-o", "--out")[0];
284
+ const pretty = flag(args, "--pretty");
285
+ const noSearch = flag(args, "--no-search");
286
+ const noDiagrams = flag(args, "--no-diagrams");
287
+ const searchOpt = option(args, "--search");
288
+ const engine = searchOpt[0];
289
+ if (searchOpt.length && (!engine || !["builtin", "pagefind", "both"].includes(engine))) throw new UsageError("--search takes builtin, pagefind or both");
290
+ const force = flag(args, "--force");
291
+ const quiet = flag(args, "--quiet", "-q");
292
+ const allWarnings = flag(args, "--all-warnings");
293
+ if (mode.assemble && (option(args, "--unit").length || flag(args, "--update"))) throw new UsageError("assemble builds no unit: it takes neither --unit nor --update (use build --unit X --update)");
294
+ const units = mode.assemble ? [] : option(args, "--unit");
295
+ const update = mode.assemble || flag(args, "--update");
296
+ if (update && !mode.assemble && !units.length) throw new UsageError("--update needs --unit: it rebuilds those units in a built site (assemble rewrites the site-wide files alone)");
297
+ const includeDrafts = flag(args, "--include-drafts");
298
+ const cacheOpt = option(args, "--cache");
299
+ if (cacheOpt.length && !cacheOpt[0]) throw new UsageError("--cache takes a folder (e.g. --cache .dogsbay-cache)");
300
+ const asWorker = flag(args, "--as-worker");
301
+ if (asWorker && typeof process.threadCpuUsage !== "function") throw new UsageError(`--as-worker times the main thread's CPU, which needs Node 22.19 or later (this is ${process.version})`);
302
+ if (asWorker && flag(args, "--low-memory")) throw new UsageError("--as-worker uses the Worker's memory settings: drop --low-memory");
303
+ const untrusted = flag(args, "--untrusted") || asWorker;
304
+ const memory = asWorker ? { ...WORKER_BUILD_SETTINGS, templateMs: PUBLISHED_TEMPLATE_MS } : cliMemorySettings(flag(args, "--low-memory"));
305
+ const project = resolve2(positional(args, "."));
306
+ const cfgPath = ["dogsbay.config.yml", "dogsbay.config.yaml"].map((f) => join3(project, f)).find(existsSync2);
307
+ const cfgText = cfgPath ? readFileSync2(cfgPath, "utf8") : void 0;
308
+ const cfg = parseConfig(cfgText, {
309
+ ...pretty ? { linkStyle: "pretty" } : {},
310
+ ...noSearch ? { search: false } : {},
311
+ // --search turns search on with that engine, whatever the config says (--no-search still wins).
312
+ ...engine && !noSearch ? { search: true, searchEngine: engine } : {}
313
+ });
314
+ if (!cfgPath && !existsSync2(join3(project, "content"))) cfg.sources = [{ path: "." }];
315
+ const t0 = performance.now();
316
+ const out = resolve2(outOpt ?? join3(project, "out"));
317
+ const cacheDir = cacheOpt[0] ? resolve2(cacheOpt[0]) : void 0;
318
+ if (cacheDir) checkCacheDir(cacheDir, out, project, cfg, untrusted);
319
+ const { files } = await readBuildFiles(project, cfg, cacheDir ? [out, cacheDir] : [out], untrusted);
320
+ const tRead = performance.now() - t0;
321
+ if (process.env.DOGSBAY_MEM) {
322
+ globalThis.gc?.();
323
+ let chars = 0;
324
+ let bytes = 0;
325
+ let refs = 0;
326
+ for (const c of files.values()) typeof c === "string" ? chars += c.length : c instanceof Uint8Array ? bytes += c.byteLength : refs++;
327
+ console.error(`read ${files.size} files: ${(chars / 1048576).toFixed(1)} M chars text, ${(bytes / 1048576).toFixed(1)} MB binary in memory, ${refs} left on disk; heap ${Math.round(process.memoryUsage().heapUsed / 1048576)} MB, external ${Math.round(process.memoryUsage().external / 1048576)} MB`);
328
+ }
329
+ let previous;
330
+ if (update) {
331
+ if (!existsSync2(join3(out, "_dogsbay"))) throw new Error(`${out} is not a dogsbay-ssg build to update; build the whole site there first`);
332
+ previous = readManifests(out);
333
+ if (!previous.length) throw new Error(`${out} has no unit manifests (_dogsbay/units/): a site of two or more units writes them when it is built whole; build it there first (a site of one unit needs no --update)`);
334
+ } else prepareOut(out, force);
335
+ const previousFiles = previous && new Map(previous.map((m) => [m.path, unitFilesOf(m.text)]));
336
+ const written = /* @__PURE__ */ new Set();
337
+ const sink = fileSink(out);
338
+ const recording = (p, c) => {
339
+ written.add(p);
340
+ if (asWorker && (typeof c === "string" || c instanceof Uint8Array)) createHash2("md5").update(c).digest("hex");
341
+ return sink(p, c);
342
+ };
343
+ const pf = cfg.search && cfg.searchEngine !== "builtin" && !mode.assemble ? await pagefindIndexer(cfg, units, [project, process.cwd()]) : void 0;
344
+ const threads = highlightThreads();
345
+ const pool = threads >= 2 ? highlightPool(threads, highlightWorker) : void 0;
346
+ if (pool && asWorker) pool.wholePages = true;
347
+ if (asWorker && !pool) console.warn("warn --as-worker without highlight threads (DOGSBAY_HIGHLIGHT_THREADS below 2): code is highlighted on the main thread, which the Worker does not do");
348
+ const trees = cacheDir ? diskTreeStore(cacheDir) : void 0;
349
+ const cpu0 = threadCpuMs();
350
+ const result = await build({
351
+ files,
352
+ config: cfg,
353
+ ...memory,
354
+ highlightPool: pool,
355
+ treeStore: trees?.store,
356
+ units: units.length || mode.assemble ? units : void 0,
357
+ manifests: previous,
358
+ includeDrafts,
359
+ untrusted,
360
+ diagrams: noDiagrams ? void 0 : diagramRenderers(),
361
+ icons: await iconResolver(),
362
+ sink: pf ? pf.wrap(recording) : recording,
363
+ ...asWorker ? { clock: threadCpuMs } : {},
364
+ onPage: process.env.DOGSBAY_TRACE ? (d) => console.log(`page ${d}`) : process.env.DOGSBAY_SNAPSHOT ? (d) => {
365
+ if (process.env.DOGSBAY_SNAPSHOT.split(",").map(Number).includes(d)) {
366
+ const file = __require("node:v8").writeHeapSnapshot(`dogsbay-heap-${d}.heapsnapshot`);
367
+ console.error(`snapshot ${file}`);
368
+ }
369
+ } : process.env.DOGSBAY_MEM ? (d, n) => d % 100 === 0 && (globalThis.gc?.(), console.error(`${d}/${n} heap ${Math.round(process.memoryUsage().heapUsed / 1048576)} MB`)) : quiet ? void 0 : (d, n, u) => d % 250 === 0 && process.stderr.write(` ${u}: ${d}/${n}\r`)
370
+ });
371
+ const cpuMs = threadCpuMs() - cpu0;
372
+ const threadsDead = pool?.dead() ?? 0;
373
+ await pool?.close();
374
+ if (pool && threadsDead) console.warn(`warn ${threadsDead} of ${pool.threads} highlight threads failed; their blocks were highlighted on the main thread`);
375
+ const pfStats = await pf?.finish(out);
376
+ const removed = previousFiles ? removeStaleUnitFiles(out, previousFiles, written) : 0;
377
+ const treesRemoved = trees && !units.length && !mode.assemble ? trees.removeUnused() : 0;
378
+ const errors = dataProblemLines(result.problems);
379
+ const warnings = result.warnings.filter((_, i) => !FAILING_CODES.has(result.problems[i].code));
380
+ const shown = quiet ? 0 : allWarnings ? warnings.length : 50;
381
+ for (const w of warnings.slice(0, shown)) console.warn(`warn ${w}`);
382
+ if (warnings.length > shown && !quiet) console.warn(`\u2026 ${warnings.length - shown} more warnings (--all-warnings to list them)`);
383
+ for (const e of errors) console.error(`error ${e}`);
384
+ if (!quiet) for (const n of result.notes) console.log(`note ${n}`);
385
+ const s = result.stats;
386
+ console.log(
387
+ (mode.assemble ? `assembled the site-wide files of ${out} from ${previousFiles.size} unit manifest(s)
388
+ ` : `built ${s.pages} pages, ${s.assets} assets, ${s.units} unit(s) \u2192 ${out}
389
+ `) + (removed ? ` removed ${removed} file(s) the rebuilt units no longer write
390
+ ` : "") + (pfStats ? ` pagefind: ${pfStats.pages} pages in ${pfStats.units} index(es)
391
+ ` : "") + (asWorker ? ` read ${Math.round(tRead)} ms \xB7 as the Worker: ${Math.round(cpuMs)} ms of main-thread CPU (${(cpuMs / Math.max(1, s.pages)).toFixed(2)} ms/page)
392
+ phases (main-thread CPU, ms; they overlap, as pages are prepared ahead while one is written, so they add up to more than the total): ${Object.entries(s.msByPhase).map(([k, v]) => `${k} ${v}`).join(", ")}
393
+ for exclusive times, profile it: node --cpu-prof \u2026 build --as-worker, then scripts/profile-summary.mjs` + (noDiagrams ? "" : `
394
+ diagrams are drawn on the main thread here; the Worker sends them to the diagram Worker`) : ` read ${Math.round(tRead)} ms \xB7 build and write ${s.ms} ms (${(s.ms / Math.max(1, s.pages)).toFixed(2)} ms/page)
395
+ phases: ${Object.entries(s.msByPhase).map(([k, v]) => `${k} ${v}`).join(", ")}`) + (pool ? `
396
+ highlighting: ${pool.dead() < pool.threads ? `${pool.threads - pool.dead()} threads` : "on the main thread (the highlight threads failed to start)"}` : "") + (s.highlightCache ? `
397
+ highlight cache: ${s.highlightCache.hits} hits, ${s.highlightCache.misses} misses, ${s.highlightCache.entries} blocks, ${(s.highlightCache.chars / 1e6).toFixed(1)}M characters` : "") + (s.treeCache ? `
398
+ tree cache: ${s.treeCache.hits} pages not parsed again, ${s.treeCache.misses} parsed (${s.treeCache.groupsRead} groups read, ${s.treeCache.groupsWritten} written${treesRemoved ? `, ${treesRemoved} unused removed` : ""})` : "") + (s.parseCache ? `
399
+ template parse cache: ${s.parseCache.hits} hits, ${s.parseCache.misses} misses, ${s.parseCache.entries} includes, ${(s.parseCache.bytes / 1e6).toFixed(1)} of ${(s.parseCache.maxBytes / 1e6).toFixed(1)} MB` : "")
400
+ );
401
+ if (errors.length) {
402
+ const examples = result.problems.filter((p) => p.code === "example").length;
403
+ console.error(`build failed: ${[errors.length - examples ? `${errors.length - examples} data problem(s)` : "", examples ? `${examples} example problem(s)` : ""].filter(Boolean).join(", ")}`);
404
+ process.exitCode = 1;
405
+ }
406
+ }
407
+ export {
408
+ runBuild
409
+ };
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire as __cr } from 'node:module'; const require = __cr(import.meta.url);
3
+ import {
4
+ c_default
5
+ } from "./chunk-USOBJLOJ.mjs";
6
+ import "./chunk-STRHO6SY.mjs";
7
+ export {
8
+ c_default as default
9
+ };