@dooc-dev/dooc 0.0.4 → 0.0.6

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 (231) hide show
  1. package/dist/cli.js +157 -58
  2. package/dist/code-worker.global.js +152 -0
  3. package/dist/code.global.js +101 -101
  4. package/dist/compiler/asset-references.d.ts +4 -0
  5. package/dist/compiler/asset-references.js +117 -0
  6. package/dist/compiler/bundle-urls.d.ts +1 -1
  7. package/dist/compiler/bundle-urls.js +17 -5
  8. package/dist/compiler/check.js +10 -5
  9. package/dist/compiler/code-languages.js +7 -2
  10. package/dist/compiler/compile.d.ts +5 -0
  11. package/dist/compiler/compile.js +117 -12
  12. package/dist/compiler/config.js +2 -1
  13. package/dist/compiler/dxf.d.ts +1 -0
  14. package/dist/compiler/dxf.js +81 -0
  15. package/dist/compiler/export.d.ts +4 -0
  16. package/dist/compiler/export.js +147 -0
  17. package/dist/compiler/figures.js +43 -10
  18. package/dist/compiler/files.js +82 -41
  19. package/dist/compiler/fonts.js +4 -1
  20. package/dist/compiler/icons.d.ts +1 -1
  21. package/dist/compiler/icons.js +11 -2
  22. package/dist/compiler/ignored-files.d.ts +5 -0
  23. package/dist/compiler/ignored-files.js +98 -0
  24. package/dist/compiler/locales.js +13 -8
  25. package/dist/compiler/ops.d.ts +6 -0
  26. package/dist/compiler/ops.js +99 -8
  27. package/dist/compiler/subformat-schema.d.ts +14 -0
  28. package/dist/compiler/subformat-schema.js +92 -0
  29. package/dist/compiler/subformats.d.ts +22 -0
  30. package/dist/compiler/subformats.js +339 -0
  31. package/dist/compiler/textfile.js +3 -0
  32. package/dist/compiler/theme-variants.js +5 -2
  33. package/dist/core/code-file.js +7 -5
  34. package/dist/core/code-grammars.d.ts +5 -0
  35. package/dist/core/code-grammars.js +34 -0
  36. package/dist/core/content-metadata.d.ts +16 -6
  37. package/dist/core/content-metadata.js +283 -17
  38. package/dist/core/content-types.d.ts +4 -2
  39. package/dist/core/escape-html.d.ts +1 -0
  40. package/dist/core/escape-html.js +1 -0
  41. package/dist/core/figure-frame.js +20 -2
  42. package/dist/core/file-embed.js +7 -3
  43. package/dist/core/files.d.ts +2 -1
  44. package/dist/core/files.js +6 -8
  45. package/dist/core/flow-base-css.generated.js +1 -1
  46. package/dist/core/html.d.ts +4 -1
  47. package/dist/core/html.js +11 -10
  48. package/dist/core/icons.d.ts +3 -0
  49. package/dist/core/icons.js +3 -0
  50. package/dist/core/json-tools.d.ts +1 -0
  51. package/dist/core/json-tools.js +12 -0
  52. package/dist/core/language.js +5 -2
  53. package/dist/core/markdown.js +3 -1
  54. package/dist/core/previewers.d.ts +8 -0
  55. package/dist/core/previewers.js +2 -0
  56. package/dist/core/routing.d.ts +5 -2
  57. package/dist/core/routing.js +17 -5
  58. package/dist/core/schema-fields.d.ts +13 -0
  59. package/dist/core/schema-fields.js +175 -0
  60. package/dist/core/schema-graph-mount.js +26 -3
  61. package/dist/core/schema-refs.d.ts +8 -0
  62. package/dist/core/schema-refs.js +82 -0
  63. package/dist/core/subformat-record.d.ts +3 -0
  64. package/dist/core/subformat-record.js +131 -0
  65. package/dist/core/subformats.d.ts +43 -0
  66. package/dist/core/subformats.js +81 -0
  67. package/dist/core/toc-ui.js +26 -24
  68. package/dist/edit.global.js +326 -118
  69. package/dist/flow.global.js +3 -3
  70. package/dist/graph/abnfDiagram-S7VZAUFO-ASBULSKE.js +1 -0
  71. package/dist/graph/architecture-WOLXFQ4H-V57EDXXY.js +1 -0
  72. package/dist/graph/architectureDiagram-YGSQEFNW-GIMP347N.js +36 -0
  73. package/dist/graph/blockDiagram-APKKGZFW-RDL2T4JW.js +140 -0
  74. package/dist/graph/bpmnIcons-APHXDYXF-TWOSQNUQ.js +1 -0
  75. package/dist/graph/c4Diagram-KJ2TOQU5-75LIUC4F.js +38 -0
  76. package/dist/graph/chunk-26TUJSYJ.js +1 -0
  77. package/dist/graph/chunk-3LU66YMI.js +1 -0
  78. package/dist/graph/chunk-3RNHDNP5.js +1 -0
  79. package/dist/graph/chunk-3Y2PDVDE.js +1 -0
  80. package/dist/graph/chunk-3YJHMOOA.js +3 -0
  81. package/dist/graph/chunk-4KILFWYV.js +339 -0
  82. package/dist/graph/chunk-4QDE4SUK.js +1 -0
  83. package/dist/graph/chunk-5OO6DATX.js +1 -0
  84. package/dist/graph/chunk-5UUEAHTN.js +1 -0
  85. package/dist/graph/chunk-6T55RVVR.js +1 -0
  86. package/dist/graph/chunk-ARAJTKOH.js +2 -0
  87. package/dist/graph/chunk-BBD5CEDC.js +72 -0
  88. package/dist/graph/chunk-BVXT562I.js +1 -0
  89. package/dist/graph/chunk-BZAMCJ6B.js +32 -0
  90. package/dist/graph/chunk-C6J4A356.js +15 -0
  91. package/dist/graph/chunk-EG5UVNOC.js +213 -0
  92. package/dist/graph/chunk-GF4TOPUK.js +1 -0
  93. package/dist/graph/chunk-GYT4IYBZ.js +1 -0
  94. package/dist/graph/chunk-HJG2HUYJ.js +88 -0
  95. package/dist/graph/chunk-HOPPTA6H.js +62 -0
  96. package/dist/graph/chunk-I3DMZIHV.js +1 -0
  97. package/dist/graph/chunk-IC23EEF6.js +1 -0
  98. package/dist/graph/chunk-ISO77HML.js +1 -0
  99. package/dist/graph/chunk-JD7ZBJD2.js +1 -0
  100. package/dist/graph/chunk-JRSH5GNS.js +1 -0
  101. package/dist/graph/chunk-JSHWCPFJ.js +1 -0
  102. package/dist/graph/chunk-K2KLZU7M.js +10 -0
  103. package/dist/graph/chunk-K4I76XBX.js +14 -0
  104. package/dist/graph/chunk-KT4VPQD5.js +135 -0
  105. package/dist/graph/chunk-KU6GTEMS.js +1 -0
  106. package/dist/graph/chunk-LT6LXKCR.js +136 -0
  107. package/dist/graph/chunk-MPR575IN.js +1 -0
  108. package/dist/graph/chunk-N3OHKGRZ.js +1 -0
  109. package/dist/graph/chunk-O656ZI37.js +1 -0
  110. package/dist/graph/chunk-OFZLK5G4.js +1 -0
  111. package/dist/graph/chunk-PDH25ALM.js +2 -0
  112. package/dist/graph/chunk-PW2RGZ3O.js +1 -0
  113. package/dist/graph/chunk-QCJUF4YA.js +1 -0
  114. package/dist/graph/chunk-QEEA3KYY.js +2 -0
  115. package/dist/graph/chunk-QYAXYFNI.js +1 -0
  116. package/dist/graph/chunk-QYTM6GY3.js +1 -0
  117. package/dist/graph/chunk-R63JUMUK.js +1 -0
  118. package/dist/graph/chunk-SCEY3ZPT.js +1 -0
  119. package/dist/graph/chunk-VM2H7G2R.js +1 -0
  120. package/dist/graph/chunk-XQS73SBQ.js +1 -0
  121. package/dist/graph/chunk-YCRLJT2S.js +1 -0
  122. package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
  123. package/dist/graph/chunk-ZMCB7VP2.js +1 -0
  124. package/dist/graph/chunk-ZSZXN4BT.js +2 -0
  125. package/dist/graph/classDiagram-v2-L25IHNXF-JL7LVDZH.js +217 -0
  126. package/dist/graph/cose-bilkent-JH36ORCC-PNM3EYPB.js +1 -0
  127. package/dist/graph/cynefin-EF2NZ3EQ-PSXP3DXL.js +1 -0
  128. package/dist/graph/cynefinDiagram-L36ESFBY-QVY54CXO.js +62 -0
  129. package/dist/graph/dagre-SPEB5RXH-HPGQXBZJ.js +4 -0
  130. package/dist/graph/diagram-3B7GL73J-DWH5WS2P.js +200 -0
  131. package/dist/graph/diagram-DNEMPZML-TEGH2U5I.js +24 -0
  132. package/dist/graph/diagram-L3MUGCDN-X4MREUWR.js +41 -0
  133. package/dist/graph/diagram-LA4NIPWU-NXT746HG.js +24 -0
  134. package/dist/graph/diagram-MHCOC4E2-JGHXSAGS.js +3 -0
  135. package/dist/graph/diagram-XPFHEONP-ZHZPBLT4.js +30 -0
  136. package/dist/graph/ebnfDiagram-UZSYDL2S-SMF6KJ43.js +1 -0
  137. package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +27 -0
  138. package/dist/graph/erDiagram-EYBAPDEH-B3JNJ357.js +99 -0
  139. package/dist/graph/eventmodeling-K75KTNOO-WG6DDYMC.js +1 -0
  140. package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +1 -0
  141. package/dist/graph/ganttDiagram-23REXITY-YXBYWFOJ.js +292 -0
  142. package/dist/graph/gitGraph-VSP46ZUC-VBFWJBBT.js +1 -0
  143. package/dist/graph/gitGraphDiagram-STJD7YCW-4FZDCFGV.js +106 -0
  144. package/dist/graph/info-OHQRW6UA-ALVDUVYV.js +1 -0
  145. package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +2 -0
  146. package/dist/graph/ishikawaDiagram-M35NCXHK-FRZD2PWQ.js +70 -0
  147. package/dist/graph/journeyDiagram-OPLOXDXO-7Z66JCPR.js +139 -0
  148. package/dist/graph/kanban-definition-BZKZHSQY-NN5AIKTE.js +89 -0
  149. package/dist/graph/katex-DXDNVO6V.js +257 -0
  150. package/dist/graph/mindmap-definition-I2QAS2VK-HDPCABN2.js +98 -0
  151. package/dist/graph/packet-JDAUHWVQ-5MQIBWAH.js +1 -0
  152. package/dist/graph/pegDiagram-FD4XPPHP-H2BFNCKT.js +1 -0
  153. package/dist/graph/pie-XZMESJXO-T5VRKHVT.js +1 -0
  154. package/dist/graph/pieDiagram-J4AKIIQI-O3NJSVD3.js +39 -0
  155. package/dist/graph/quadrantDiagram-XTYBLID2-TMTZJI3P.js +7 -0
  156. package/dist/graph/radar-ABXABTNO-C6FXIBYW.js +1 -0
  157. package/dist/graph/railroad-I3PHUGI6-ZSO5JXB3.js +1 -0
  158. package/dist/graph/railroad-abnf-LNEFI6M7-CI4GQRHB.js +1 -0
  159. package/dist/graph/railroad-ebnf-DWYD2UWJ-MUENNCGK.js +1 -0
  160. package/dist/graph/railroad-peg-JR7BVNR7-N3X5GGIX.js +1 -0
  161. package/dist/graph/railroadDiagram-MRQ6NCDL-JHWS23UO.js +1 -0
  162. package/dist/graph/requirementDiagram-Y7LWUY3S-7DVLPO4B.js +84 -0
  163. package/dist/graph/sankeyDiagram-WGJFYUXA-Z5L4R5TR.js +40 -0
  164. package/dist/graph/schema-graph-global.js +639 -0
  165. package/dist/graph/sequenceDiagram-5NDRBG5M-RCTU25NT.js +169 -0
  166. package/dist/graph/sizeCapture-INFHLROL-RROY32P5.js +1 -0
  167. package/dist/graph/stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js +291 -0
  168. package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +1 -0
  169. package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +8 -0
  170. package/dist/graph/timeline-definition-SEUHKTQE-ZQSMIVAS.js +120 -0
  171. package/dist/graph/treeView-D4JQ5SDB-42S7U73N.js +1 -0
  172. package/dist/graph/treemap-SAJKECNS-RUBYQ7XF.js +1 -0
  173. package/dist/graph/usecaseDiagram-AFA6YXN4-57RDRYXF.js +370 -0
  174. package/dist/graph/vennDiagram-NNMJR3RB-5C3LVAV6.js +34 -0
  175. package/dist/graph/wardley-7MLQ67FV-NV5HXTTC.js +1 -0
  176. package/dist/graph/wardleyDiagram-S7YFUSEH-6D5BKXHM.js +78 -0
  177. package/dist/graph/xychartDiagram-GGNKY7IX-6ET3ZM67.js +7 -0
  178. package/dist/mcp.js +54 -12
  179. package/dist/plugins/index.d.ts +1 -0
  180. package/dist/plugins/transport.d.ts +22 -0
  181. package/dist/plugins/transport.js +1 -0
  182. package/dist/plugins.global.js +95 -0
  183. package/dist/subformats.global.js +21 -0
  184. package/dist/ui.global.js +80 -60
  185. package/dist/viewer/build-plugins.d.ts +7 -0
  186. package/dist/viewer/build-plugins.js +70 -0
  187. package/dist/viewer/build.d.ts +11 -0
  188. package/dist/viewer/build.js +52 -11
  189. package/dist/viewer/code-file.js +7 -2
  190. package/dist/viewer/editor-tools.d.ts +7 -7
  191. package/dist/viewer/editor-tools.js +36 -5
  192. package/dist/viewer/figure-preview.d.ts +4 -0
  193. package/dist/viewer/figure-preview.js +54 -0
  194. package/dist/viewer/font-picker.js +5 -1
  195. package/dist/viewer/git-diff.d.ts +3 -0
  196. package/dist/viewer/git-diff.js +47 -0
  197. package/dist/viewer/hmr.js +8 -4
  198. package/dist/viewer/i18n.js +7 -5
  199. package/dist/viewer/language-picker.d.ts +2 -2
  200. package/dist/viewer/language-picker.js +26 -9
  201. package/dist/viewer/lazy-preview.d.ts +2 -0
  202. package/dist/viewer/lazy-preview.js +43 -0
  203. package/dist/viewer/locales/eng.json +95 -10
  204. package/dist/viewer/locales/jpn.json +96 -11
  205. package/dist/viewer/locales/zho.json +96 -11
  206. package/dist/viewer/nav-focus.js +8 -1
  207. package/dist/viewer/nav-update.d.ts +2 -0
  208. package/dist/viewer/nav-update.js +117 -0
  209. package/dist/viewer/plugin-blocks.js +1 -1
  210. package/dist/viewer/plugin-style.d.ts +1 -0
  211. package/dist/viewer/plugin-style.js +82 -0
  212. package/dist/viewer/plugins.js +1 -1
  213. package/dist/viewer/resize.d.ts +0 -2
  214. package/dist/viewer/resize.js +2 -98
  215. package/dist/viewer/resource-library.d.ts +11 -9
  216. package/dist/viewer/resource-library.js +181 -31
  217. package/dist/viewer/search.d.ts +4 -2
  218. package/dist/viewer/search.js +252 -53
  219. package/dist/viewer/serve.d.ts +11 -5
  220. package/dist/viewer/serve.js +913 -295
  221. package/dist/viewer/site-icon.js +13 -6
  222. package/dist/viewer/site-title.js +15 -2
  223. package/dist/viewer/textfile.d.ts +5 -0
  224. package/dist/viewer/textfile.js +34 -2
  225. package/dist/viewer/theme-picker.d.ts +2 -0
  226. package/dist/viewer/theme-picker.js +24 -8
  227. package/dist/viewer/workspace.d.ts +2 -0
  228. package/dist/viewer/workspace.js +46 -1
  229. package/package.json +27 -10
  230. package/dist/compiler/bundle.d.ts +0 -2
  231. package/dist/compiler/bundle.js +0 -100
package/dist/cli.js CHANGED
@@ -8,23 +8,34 @@ import { prebuilt } from "./viewer/assets.js";
8
8
  process.env.NODE_ENV = prebuilt ? "production" : "development";
9
9
  const USAGE = `usage: dooc <command>
10
10
 
11
- edit [dooc.yaml] [port] open dooc in edit mode
12
- view [dooc.yaml] [port] open dooc in view mode
13
- --viewer-plugins <module> inject an external viewer plugin module
14
- build html [dooc.yaml] [out-dir] build bundle.html (default <project>/dist)
15
- build zip [dooc.yaml] [out-dir] build bundle.zip (default <project>/dist)
16
- --url_preview embed|network URL handling for either format (default: embed)
17
- check [dooc.yaml] [options] JSON consistency report (check --help for options)
18
- plugin pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
19
- plugin add <zip> [dooc.yaml] [port] install a local plugin and print login links
20
- plugin login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
21
- font add <file> [dooc.yaml] register a font in the project (.dooc/fonts/)
22
- font list [dooc.yaml] list registered project fonts
23
- font remove <name> [dooc.yaml] remove a registered project font
24
- mcp [dooc.yaml] stdio MCP server (all read / write operations)
25
- --git-origin <module> inject gitOrigin from an external viewer plugin module
26
- help, --help, -h show this help
11
+ commands:
12
+ ├─ edit [dooc.yaml] [port] open dooc in edit mode
13
+ │ └─ --viewer-plugins <module> inject an external viewer plugin module
14
+ ├─ view [dooc.yaml] [port] open dooc in view mode
15
+ │ └─ --viewer-plugins <module> inject an external viewer plugin module
16
+ ├─ build build the selected bundle (default <project>/dist)
17
+ │ ├─ html [dooc.yaml] [out-dir] build bundle.html
18
+ │ │ ├─ --mode static|live HTML snapshot or runtime plugin API
19
+ │ │ ├─ --auth external host supplies live HTML authentication and transport
20
+ │ │ └─ --source-url <url> source directory URL for card copy links
21
+ │ ├─ zip [dooc.yaml] [out-dir] build bundle.zip
22
+ │ ├─ --url_preview embed|network URL handling for either format (default: embed)
23
+ │ └─ --viewer-plugins <module> inject an external build plugin module
24
+ ├─ export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
25
+ ├─ check [dooc.yaml] [options] JSON consistency report (check --help for options)
26
+ ├─ plugin manage local plugins
27
+ │ ├─ pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
28
+ │ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
29
+ │ └─ login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
30
+ ├─ font manage project fonts (.dooc/fonts/)
31
+ │ ├─ add <file> [dooc.yaml] register a font in the project
32
+ │ ├─ list [dooc.yaml] list registered project fonts
33
+ │ └─ remove <name> [dooc.yaml] remove a registered project font
34
+ ├─ mcp [dooc.yaml] stdio MCP server (all read / write operations)
35
+ │ └─ --git-origin <module> inject gitOrigin from an external viewer plugin module
36
+ └─ help, --help, -h show this help
27
37
 
38
+ Details: dooc <command> --help (build, check, plugin, font, mcp).
28
39
  Default manifest: ./dooc.yaml. Paths and .dooc/ are relative to its directory.`;
29
40
  const fail = (message) => {
30
41
  console.error(message);
@@ -45,17 +56,27 @@ switch (command) {
45
56
  });
46
57
  const [action, value, rootArg, portArg] = positionals;
47
58
  if (values.help) {
48
- console.log(`usage: dooc plugin pack <built-dir> [output.zip]
49
- dooc plugin add <zip> [dooc.yaml] [port]
50
- dooc plugin login <plugin-id> [dooc.yaml] [port]
59
+ console.log(`usage: dooc plugin <command>
51
60
 
52
- ZIP root: package.json with name, version, type: module and main pointing to bundled .js/.mjs.
53
- Optional icon: path to a bundled SVG asset up to 64 KiB.
54
- Include relative assets (SVG, JSON, etc.); dependencies must already be bundled. Limit: 16 MiB / 256 files.
55
- Default output: <built-dir>.zip. Installed ZIPs: <project>/.dooc/plugins/.
56
- Personal logins and plugin approvals: ~/.dooc/plugins/ (override with DOOC_USER_DIR).
57
- Add/login starts a local editor and prints browser login links. Keep it running while signing in.
58
- Tokens stay on this computer and never enter exported documents.`);
61
+ commands:
62
+ ├─ pack <built-dir> [output.zip] package bundled JS and assets as a plugin ZIP
63
+ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
64
+ └─ login <plugin-id> [dooc.yaml] [port] open a local login flow for an installed plugin
65
+
66
+ options:
67
+ --help, -h show this help
68
+
69
+ Package:
70
+ ZIP root: package.json with name, version, type: module and main pointing to bundled .js/.mjs.
71
+ Optional icon: path to a bundled SVG asset up to 64 KiB.
72
+ Include relative assets (SVG, JSON, etc.); dependencies must already be bundled.
73
+ Limit: 16 MiB / 256 files. Default output: <built-dir>.zip.
74
+
75
+ Storage and login:
76
+ Installed ZIPs: <project>/.dooc/plugins/.
77
+ Personal logins and plugin approvals: ~/.dooc/plugins/ (override with DOOC_USER_DIR).
78
+ Add/login starts a local editor and prints browser login links. Keep it running while signing in.
79
+ Tokens stay on this computer and never enter exported documents.`);
59
80
  break;
60
81
  }
61
82
  if (action === "pack" && value && positionals.length <= 3) {
@@ -109,7 +130,20 @@ Tokens stay on this computer and never enter exported documents.`);
109
130
  options: { help: { type: "boolean", short: "h" } },
110
131
  });
111
132
  if (values.help) {
112
- console.log("usage: dooc font add <file> [dooc.yaml] | list [dooc.yaml] | remove <name> [dooc.yaml]\n\nFonts are copied to <project>/.dooc/fonts/ and included in ZIP and HTML bundles.\nSupported formats: TTF, OTF, WOFF, WOFF2. Existing names are never overwritten.\nReload the viewer after changing registered fonts. Default manifest: ./dooc.yaml.");
133
+ console.log(`usage: dooc font <command>
134
+
135
+ commands:
136
+ ├─ add <file> [dooc.yaml] register a font in the project
137
+ ├─ list [dooc.yaml] list registered project fonts
138
+ └─ remove <name> [dooc.yaml] remove a registered project font
139
+
140
+ options:
141
+ --help, -h show this help
142
+
143
+ Fonts:
144
+ Fonts are copied to <project>/.dooc/fonts/ and included in ZIP and HTML bundles.
145
+ Supported formats: TTF, OTF, WOFF, WOFF2. Existing names are never overwritten.
146
+ Reload the viewer after changing registered fonts. Default manifest: ./dooc.yaml.`);
113
147
  break;
114
148
  }
115
149
  const [action, value, rootArg] = positionals;
@@ -148,27 +182,31 @@ Tokens stay on this computer and never enter exported documents.`);
148
182
  if (values.help) {
149
183
  console.log(`usage: dooc check [dooc.yaml] [options]
150
184
 
185
+ options:
151
186
  --only render,languages,themes select checks (default: all three)
152
187
  manifest validity is always checked
153
- --allow-shared-svg allow identical SVG bytes across themes (missing variants still fail)
154
- --warnings-as-errors fail on warnings as well as errors
155
- --help, -h show this help
188
+ --allow-shared-svg allow identical SVG bytes across themes (missing variants still fail)
189
+ --warnings-as-errors fail on warnings as well as errors
190
+ --help, -h show this help
156
191
 
157
192
  dooc.yaml example:
158
193
  defaultLang: jpn
159
194
  languages: [jpn, eng]
160
195
  themes: [light, dark]
161
196
 
162
- Translations: locales/<ISO 639-3>/<source path>.
163
- Theme variants: themes/<theme>/<asset path>.
164
- stdout: one JSON CheckReport with schemaVersion=1, checks, diagnostics, summary and exitCode.
165
- render uses the viewer compiler; languages checks availability and prose; themes checks variants.
166
- Site declarations determine the expected languages and themes, never CLI overrides.
167
- Diagnostic codes, relative file paths, sourceFile, language, theme and one-based lines are
168
- machine-readable; message text is for humans. Prose detection is heuristic and offline.
169
- Short text, unsupported formats and remote content are reported as unchecked/inconclusive.
170
- Exit codes: 0 passed; 1 errors (or warnings with --warnings-as-errors); 2 invocation/execution failure.
171
- Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
197
+ Checks:
198
+ render uses the viewer compiler
199
+ languages checks availability and prose; translations: locales/<ISO 639-3>/<source path>
200
+ themes checks variants: themes/<theme>/<asset path>
201
+ Site declarations determine the expected languages and themes, never CLI overrides.
202
+
203
+ Report:
204
+ stdout: one JSON CheckReport with schemaVersion=1, checks, diagnostics, summary and exitCode.
205
+ Diagnostic codes, relative file paths, sourceFile, language, theme and one-based lines are
206
+ machine-readable; message text is for humans. Prose detection is heuristic and offline.
207
+ Short text, unsupported formats and remote content are reported as unchecked/inconclusive.
208
+ Exit codes: 0 passed; 1 errors (or warnings with --warnings-as-errors); 2 invocation/execution failure.
209
+ Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
172
210
  break;
173
211
  }
174
212
  if (positionals.length > 1)
@@ -226,34 +264,75 @@ Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
226
264
  }
227
265
  break;
228
266
  }
267
+ case "export": {
268
+ try {
269
+ if (args.length > 2)
270
+ throw new Error("export accepts a dooc.yaml path and an output directory");
271
+ const root = projectRoot(args[0]);
272
+ const out = join(resolve(args[1] ?? join(root, "dist")), "bundle.zip");
273
+ const { exportBundle } = await import("./compiler/export.js");
274
+ writeOut(out, exportBundle(root));
275
+ console.log(out);
276
+ }
277
+ catch (error) {
278
+ fail(error instanceof Error ? error.message : String(error));
279
+ }
280
+ break;
281
+ }
229
282
  case "build": {
230
283
  try {
231
284
  const { positionals, values } = parseArgs({
232
285
  args,
233
286
  allowPositionals: true,
234
287
  options: {
235
- url_preview: { type: "string", default: "embed" },
288
+ url_preview: { type: "string" },
289
+ mode: { type: "string" },
290
+ auth: { type: "string" },
291
+ "viewer-plugins": { type: "string" },
292
+ "source-url": { type: "string" },
236
293
  help: { type: "boolean", short: "h" },
237
294
  },
238
295
  });
239
296
  if (values.help) {
240
- console.log(`usage: dooc build html [dooc.yaml] [out-dir] [--url_preview embed|network]
241
- dooc build zip [dooc.yaml] [out-dir] [--url_preview embed|network]
297
+ console.log(`usage: dooc build <html|zip> [dooc.yaml] [out-dir] [options]
298
+
299
+ commands:
300
+ ├─ html [dooc.yaml] [out-dir] build bundle.html
301
+ │ ├─ --mode static|live HTML snapshot or runtime plugin API
302
+ │ ├─ --auth external host supplies live HTML authentication and transport
303
+ │ └─ --source-url <url> HTTP(S) directory URL for card copy links
304
+ │ paths are relative to dooc.yaml; overrides GitHub origin/HEAD
305
+ └─ zip [dooc.yaml] [out-dir] build bundle.zip
242
306
 
243
- A bundle is dooc.yaml and its managed content. Builds only the selected format.
244
- Default output directory: <project>/dist. Source files are never rewritten.
245
- --url_preview embed snapshot URL content and assets into the selected artifact (default)
246
- --url_preview network preserve URL references without downloading them at build time
307
+ options (html and zip):
308
+ --url_preview embed|network URL handling (default: embed; live HTML: network)
309
+ embed snapshot URL content and assets into the selected artifact
310
+ network preserve URL references without downloading them at build time
311
+ --viewer-plugins <module> inject trusted build plugins
312
+ --help, -h show this help
247
313
 
248
- HTML embed: no network when opened. HTML network: fetch URLs when opened (text requires CORS).
249
- ZIP embed: save URL content and rewrite references. ZIP network: keep the original URLs.
314
+ Output:
315
+ A bundle is dooc.yaml and its managed content. Builds only the selected format.
316
+ Default output directory: <project>/dist. Source files are never rewritten.
317
+ Use dooc export for source dependencies without plugin execution or remote downloads.
250
318
 
251
- Only embedded references such as ![](url) are downloaded; ordinary hyperlinks remain links.
252
- Snapshots use public HTTPS without credentials or redirects. Static HTML captures the server's
253
- HTML and declarative assets; it does not execute the source site's JavaScript or perform login.
254
- Remote files are limited to 2 MiB each and 64 MiB / 256 assets total.
255
- A failed download or invalid source stops the build before replacing the selected artifact.
256
- Use --url_preview network with either format to build without downloading URL content.`);
319
+ HTML modes:
320
+ static resolve enabled local plugins using build-time credentials and embed their views
321
+ installed, enabled packages are discovered automatically
322
+ live expose window.dooc.setPluginTransport(request), without a login UI or credentials
323
+ Examples:
324
+ dooc build html --mode static
325
+ dooc build html --mode live --auth external
326
+
327
+ URL handling:
328
+ HTML embed: no network when opened. HTML network: fetch URLs when opened (text requires CORS).
329
+ ZIP embed: save URL content and rewrite references. ZIP network: keep the original URLs.
330
+ Only embedded references such as ![](url) are downloaded; ordinary hyperlinks remain links.
331
+ Snapshots use public HTTPS without credentials or redirects. Static HTML captures the server's
332
+ HTML and declarative assets; it does not execute the source site's JavaScript or perform login.
333
+ Remote files are limited to 2 MiB each and 64 MiB / 256 assets total.
334
+ A failed download or invalid source stops the build before replacing the selected artifact.
335
+ Use --url_preview network with either format to build without downloading URL content.`);
257
336
  break;
258
337
  }
259
338
  const [format, rootArg, outArg] = positionals;
@@ -261,13 +340,20 @@ Use --url_preview network with either format to build without downloading URL co
261
340
  throw new Error("build format must be html | zip");
262
341
  if (positionals.length > 3)
263
342
  throw new Error(`build ${format} accepts a dooc.yaml path and an output directory`);
264
- const urlPreview = values.url_preview;
343
+ const urlPreview = values.url_preview ?? (values.mode === "live" ? "network" : "embed");
265
344
  if (urlPreview !== "embed" && urlPreview !== "network")
266
345
  throw new Error("--url_preview must be embed | network");
267
346
  const root = projectRoot(rootArg);
268
347
  const out = join(resolve(outArg ?? join(root, "dist")), `bundle.${format}`);
269
348
  const { buildBundle } = await import("./viewer/build.js");
270
- const bundle = await buildBundle(root, { format, urlPreview });
349
+ const bundle = await buildBundle(root, {
350
+ format,
351
+ urlPreview,
352
+ mode: values.mode,
353
+ auth: values.auth,
354
+ pluginModule: values["viewer-plugins"],
355
+ sourceUrl: values["source-url"],
356
+ });
271
357
  writeOut(out, bundle.data);
272
358
  console.log(`${out} — ${bundle.docs} docs (url_preview=${urlPreview})`);
273
359
  }
@@ -287,7 +373,20 @@ Use --url_preview network with either format to build without downloading URL co
287
373
  },
288
374
  });
289
375
  if (values.help) {
290
- console.log("usage: dooc mcp [dooc.yaml] [--git-origin <module>]\n\nExposes docs, files, Statics, fonts, check, build and Git over stdio.\nBuild accepts format=html|zip and url_preview=embed|network (default embed).\nThe external module's default export must contain gitOrigin (the same provider used by edit/view).\nOnly gitOrigin is used; viewer setup and data plugins are not started. Authentication stays in the provider.");
376
+ console.log(`usage: dooc mcp [dooc.yaml] [options]
377
+
378
+ options:
379
+ --git-origin <module> inject gitOrigin from an external viewer plugin module
380
+ --help, -h show this help
381
+
382
+ Server:
383
+ Exposes docs, files, Statics, fonts, check, build and Git over stdio.
384
+ Build accepts format=html|zip and url_preview=embed|network (default embed).
385
+
386
+ Git origin:
387
+ The external module's default export must contain gitOrigin (the same provider used by edit/view).
388
+ Only gitOrigin is used; viewer setup and data plugins are not started.
389
+ Authentication stays in the provider.`);
291
390
  break;
292
391
  }
293
392
  if (positionals.length > 1)