@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.
- package/dist/cli.js +157 -58
- package/dist/code-worker.global.js +152 -0
- package/dist/code.global.js +101 -101
- package/dist/compiler/asset-references.d.ts +4 -0
- package/dist/compiler/asset-references.js +117 -0
- package/dist/compiler/bundle-urls.d.ts +1 -1
- package/dist/compiler/bundle-urls.js +17 -5
- package/dist/compiler/check.js +10 -5
- package/dist/compiler/code-languages.js +7 -2
- package/dist/compiler/compile.d.ts +5 -0
- package/dist/compiler/compile.js +117 -12
- package/dist/compiler/config.js +2 -1
- package/dist/compiler/dxf.d.ts +1 -0
- package/dist/compiler/dxf.js +81 -0
- package/dist/compiler/export.d.ts +4 -0
- package/dist/compiler/export.js +147 -0
- package/dist/compiler/figures.js +43 -10
- package/dist/compiler/files.js +82 -41
- package/dist/compiler/fonts.js +4 -1
- package/dist/compiler/icons.d.ts +1 -1
- package/dist/compiler/icons.js +11 -2
- package/dist/compiler/ignored-files.d.ts +5 -0
- package/dist/compiler/ignored-files.js +98 -0
- package/dist/compiler/locales.js +13 -8
- package/dist/compiler/ops.d.ts +6 -0
- package/dist/compiler/ops.js +99 -8
- package/dist/compiler/subformat-schema.d.ts +14 -0
- package/dist/compiler/subformat-schema.js +92 -0
- package/dist/compiler/subformats.d.ts +22 -0
- package/dist/compiler/subformats.js +339 -0
- package/dist/compiler/textfile.js +3 -0
- package/dist/compiler/theme-variants.js +5 -2
- package/dist/core/code-file.js +7 -5
- package/dist/core/code-grammars.d.ts +5 -0
- package/dist/core/code-grammars.js +34 -0
- package/dist/core/content-metadata.d.ts +16 -6
- package/dist/core/content-metadata.js +283 -17
- package/dist/core/content-types.d.ts +4 -2
- package/dist/core/escape-html.d.ts +1 -0
- package/dist/core/escape-html.js +1 -0
- package/dist/core/figure-frame.js +20 -2
- package/dist/core/file-embed.js +7 -3
- package/dist/core/files.d.ts +2 -1
- package/dist/core/files.js +6 -8
- package/dist/core/flow-base-css.generated.js +1 -1
- package/dist/core/html.d.ts +4 -1
- package/dist/core/html.js +11 -10
- package/dist/core/icons.d.ts +3 -0
- package/dist/core/icons.js +3 -0
- package/dist/core/json-tools.d.ts +1 -0
- package/dist/core/json-tools.js +12 -0
- package/dist/core/language.js +5 -2
- package/dist/core/markdown.js +3 -1
- package/dist/core/previewers.d.ts +8 -0
- package/dist/core/previewers.js +2 -0
- package/dist/core/routing.d.ts +5 -2
- package/dist/core/routing.js +17 -5
- package/dist/core/schema-fields.d.ts +13 -0
- package/dist/core/schema-fields.js +175 -0
- package/dist/core/schema-graph-mount.js +26 -3
- package/dist/core/schema-refs.d.ts +8 -0
- package/dist/core/schema-refs.js +82 -0
- package/dist/core/subformat-record.d.ts +3 -0
- package/dist/core/subformat-record.js +131 -0
- package/dist/core/subformats.d.ts +43 -0
- package/dist/core/subformats.js +81 -0
- package/dist/core/toc-ui.js +26 -24
- package/dist/edit.global.js +326 -118
- package/dist/flow.global.js +3 -3
- package/dist/graph/abnfDiagram-S7VZAUFO-ASBULSKE.js +1 -0
- package/dist/graph/architecture-WOLXFQ4H-V57EDXXY.js +1 -0
- package/dist/graph/architectureDiagram-YGSQEFNW-GIMP347N.js +36 -0
- package/dist/graph/blockDiagram-APKKGZFW-RDL2T4JW.js +140 -0
- package/dist/graph/bpmnIcons-APHXDYXF-TWOSQNUQ.js +1 -0
- package/dist/graph/c4Diagram-KJ2TOQU5-75LIUC4F.js +38 -0
- package/dist/graph/chunk-26TUJSYJ.js +1 -0
- package/dist/graph/chunk-3LU66YMI.js +1 -0
- package/dist/graph/chunk-3RNHDNP5.js +1 -0
- package/dist/graph/chunk-3Y2PDVDE.js +1 -0
- package/dist/graph/chunk-3YJHMOOA.js +3 -0
- package/dist/graph/chunk-4KILFWYV.js +339 -0
- package/dist/graph/chunk-4QDE4SUK.js +1 -0
- package/dist/graph/chunk-5OO6DATX.js +1 -0
- package/dist/graph/chunk-5UUEAHTN.js +1 -0
- package/dist/graph/chunk-6T55RVVR.js +1 -0
- package/dist/graph/chunk-ARAJTKOH.js +2 -0
- package/dist/graph/chunk-BBD5CEDC.js +72 -0
- package/dist/graph/chunk-BVXT562I.js +1 -0
- package/dist/graph/chunk-BZAMCJ6B.js +32 -0
- package/dist/graph/chunk-C6J4A356.js +15 -0
- package/dist/graph/chunk-EG5UVNOC.js +213 -0
- package/dist/graph/chunk-GF4TOPUK.js +1 -0
- package/dist/graph/chunk-GYT4IYBZ.js +1 -0
- package/dist/graph/chunk-HJG2HUYJ.js +88 -0
- package/dist/graph/chunk-HOPPTA6H.js +62 -0
- package/dist/graph/chunk-I3DMZIHV.js +1 -0
- package/dist/graph/chunk-IC23EEF6.js +1 -0
- package/dist/graph/chunk-ISO77HML.js +1 -0
- package/dist/graph/chunk-JD7ZBJD2.js +1 -0
- package/dist/graph/chunk-JRSH5GNS.js +1 -0
- package/dist/graph/chunk-JSHWCPFJ.js +1 -0
- package/dist/graph/chunk-K2KLZU7M.js +10 -0
- package/dist/graph/chunk-K4I76XBX.js +14 -0
- package/dist/graph/chunk-KT4VPQD5.js +135 -0
- package/dist/graph/chunk-KU6GTEMS.js +1 -0
- package/dist/graph/chunk-LT6LXKCR.js +136 -0
- package/dist/graph/chunk-MPR575IN.js +1 -0
- package/dist/graph/chunk-N3OHKGRZ.js +1 -0
- package/dist/graph/chunk-O656ZI37.js +1 -0
- package/dist/graph/chunk-OFZLK5G4.js +1 -0
- package/dist/graph/chunk-PDH25ALM.js +2 -0
- package/dist/graph/chunk-PW2RGZ3O.js +1 -0
- package/dist/graph/chunk-QCJUF4YA.js +1 -0
- package/dist/graph/chunk-QEEA3KYY.js +2 -0
- package/dist/graph/chunk-QYAXYFNI.js +1 -0
- package/dist/graph/chunk-QYTM6GY3.js +1 -0
- package/dist/graph/chunk-R63JUMUK.js +1 -0
- package/dist/graph/chunk-SCEY3ZPT.js +1 -0
- package/dist/graph/chunk-VM2H7G2R.js +1 -0
- package/dist/graph/chunk-XQS73SBQ.js +1 -0
- package/dist/graph/chunk-YCRLJT2S.js +1 -0
- package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
- package/dist/graph/chunk-ZMCB7VP2.js +1 -0
- package/dist/graph/chunk-ZSZXN4BT.js +2 -0
- package/dist/graph/classDiagram-v2-L25IHNXF-JL7LVDZH.js +217 -0
- package/dist/graph/cose-bilkent-JH36ORCC-PNM3EYPB.js +1 -0
- package/dist/graph/cynefin-EF2NZ3EQ-PSXP3DXL.js +1 -0
- package/dist/graph/cynefinDiagram-L36ESFBY-QVY54CXO.js +62 -0
- package/dist/graph/dagre-SPEB5RXH-HPGQXBZJ.js +4 -0
- package/dist/graph/diagram-3B7GL73J-DWH5WS2P.js +200 -0
- package/dist/graph/diagram-DNEMPZML-TEGH2U5I.js +24 -0
- package/dist/graph/diagram-L3MUGCDN-X4MREUWR.js +41 -0
- package/dist/graph/diagram-LA4NIPWU-NXT746HG.js +24 -0
- package/dist/graph/diagram-MHCOC4E2-JGHXSAGS.js +3 -0
- package/dist/graph/diagram-XPFHEONP-ZHZPBLT4.js +30 -0
- package/dist/graph/ebnfDiagram-UZSYDL2S-SMF6KJ43.js +1 -0
- package/dist/graph/elk-XV6XMXQE-AZ4HLCWI.js +27 -0
- package/dist/graph/erDiagram-EYBAPDEH-B3JNJ357.js +99 -0
- package/dist/graph/eventmodeling-K75KTNOO-WG6DDYMC.js +1 -0
- package/dist/graph/flowDiagram-MALGAFMO-2R7EYAQI.js +1 -0
- package/dist/graph/ganttDiagram-23REXITY-YXBYWFOJ.js +292 -0
- package/dist/graph/gitGraph-VSP46ZUC-VBFWJBBT.js +1 -0
- package/dist/graph/gitGraphDiagram-STJD7YCW-4FZDCFGV.js +106 -0
- package/dist/graph/info-OHQRW6UA-ALVDUVYV.js +1 -0
- package/dist/graph/infoDiagram-KBXO4MBG-7EHX2GQG.js +2 -0
- package/dist/graph/ishikawaDiagram-M35NCXHK-FRZD2PWQ.js +70 -0
- package/dist/graph/journeyDiagram-OPLOXDXO-7Z66JCPR.js +139 -0
- package/dist/graph/kanban-definition-BZKZHSQY-NN5AIKTE.js +89 -0
- package/dist/graph/katex-DXDNVO6V.js +257 -0
- package/dist/graph/mindmap-definition-I2QAS2VK-HDPCABN2.js +98 -0
- package/dist/graph/packet-JDAUHWVQ-5MQIBWAH.js +1 -0
- package/dist/graph/pegDiagram-FD4XPPHP-H2BFNCKT.js +1 -0
- package/dist/graph/pie-XZMESJXO-T5VRKHVT.js +1 -0
- package/dist/graph/pieDiagram-J4AKIIQI-O3NJSVD3.js +39 -0
- package/dist/graph/quadrantDiagram-XTYBLID2-TMTZJI3P.js +7 -0
- package/dist/graph/radar-ABXABTNO-C6FXIBYW.js +1 -0
- package/dist/graph/railroad-I3PHUGI6-ZSO5JXB3.js +1 -0
- package/dist/graph/railroad-abnf-LNEFI6M7-CI4GQRHB.js +1 -0
- package/dist/graph/railroad-ebnf-DWYD2UWJ-MUENNCGK.js +1 -0
- package/dist/graph/railroad-peg-JR7BVNR7-N3X5GGIX.js +1 -0
- package/dist/graph/railroadDiagram-MRQ6NCDL-JHWS23UO.js +1 -0
- package/dist/graph/requirementDiagram-Y7LWUY3S-7DVLPO4B.js +84 -0
- package/dist/graph/sankeyDiagram-WGJFYUXA-Z5L4R5TR.js +40 -0
- package/dist/graph/schema-graph-global.js +639 -0
- package/dist/graph/sequenceDiagram-5NDRBG5M-RCTU25NT.js +169 -0
- package/dist/graph/sizeCapture-INFHLROL-RROY32P5.js +1 -0
- package/dist/graph/stateDiagram-v2-FJ4FJNEA-BXUSPWDK.js +291 -0
- package/dist/graph/swimlanes-UMQ2AFYF-LDD74Q2S.js +1 -0
- package/dist/graph/swimlanesDiagram-OMPLPG4O-ZYULLJSU.js +8 -0
- package/dist/graph/timeline-definition-SEUHKTQE-ZQSMIVAS.js +120 -0
- package/dist/graph/treeView-D4JQ5SDB-42S7U73N.js +1 -0
- package/dist/graph/treemap-SAJKECNS-RUBYQ7XF.js +1 -0
- package/dist/graph/usecaseDiagram-AFA6YXN4-57RDRYXF.js +370 -0
- package/dist/graph/vennDiagram-NNMJR3RB-5C3LVAV6.js +34 -0
- package/dist/graph/wardley-7MLQ67FV-NV5HXTTC.js +1 -0
- package/dist/graph/wardleyDiagram-S7YFUSEH-6D5BKXHM.js +78 -0
- package/dist/graph/xychartDiagram-GGNKY7IX-6ET3ZM67.js +7 -0
- package/dist/mcp.js +54 -12
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/transport.d.ts +22 -0
- package/dist/plugins/transport.js +1 -0
- package/dist/plugins.global.js +95 -0
- package/dist/subformats.global.js +21 -0
- package/dist/ui.global.js +80 -60
- package/dist/viewer/build-plugins.d.ts +7 -0
- package/dist/viewer/build-plugins.js +70 -0
- package/dist/viewer/build.d.ts +11 -0
- package/dist/viewer/build.js +52 -11
- package/dist/viewer/code-file.js +7 -2
- package/dist/viewer/editor-tools.d.ts +7 -7
- package/dist/viewer/editor-tools.js +36 -5
- package/dist/viewer/figure-preview.d.ts +4 -0
- package/dist/viewer/figure-preview.js +54 -0
- package/dist/viewer/font-picker.js +5 -1
- package/dist/viewer/git-diff.d.ts +3 -0
- package/dist/viewer/git-diff.js +47 -0
- package/dist/viewer/hmr.js +8 -4
- package/dist/viewer/i18n.js +7 -5
- package/dist/viewer/language-picker.d.ts +2 -2
- package/dist/viewer/language-picker.js +26 -9
- package/dist/viewer/lazy-preview.d.ts +2 -0
- package/dist/viewer/lazy-preview.js +43 -0
- package/dist/viewer/locales/eng.json +95 -10
- package/dist/viewer/locales/jpn.json +96 -11
- package/dist/viewer/locales/zho.json +96 -11
- package/dist/viewer/nav-focus.js +8 -1
- package/dist/viewer/nav-update.d.ts +2 -0
- package/dist/viewer/nav-update.js +117 -0
- package/dist/viewer/plugin-blocks.js +1 -1
- package/dist/viewer/plugin-style.d.ts +1 -0
- package/dist/viewer/plugin-style.js +82 -0
- package/dist/viewer/plugins.js +1 -1
- package/dist/viewer/resize.d.ts +0 -2
- package/dist/viewer/resize.js +2 -98
- package/dist/viewer/resource-library.d.ts +11 -9
- package/dist/viewer/resource-library.js +181 -31
- package/dist/viewer/search.d.ts +4 -2
- package/dist/viewer/search.js +252 -53
- package/dist/viewer/serve.d.ts +11 -5
- package/dist/viewer/serve.js +913 -295
- package/dist/viewer/site-icon.js +13 -6
- package/dist/viewer/site-title.js +15 -2
- package/dist/viewer/textfile.d.ts +5 -0
- package/dist/viewer/textfile.js +34 -2
- package/dist/viewer/theme-picker.d.ts +2 -0
- package/dist/viewer/theme-picker.js +24 -8
- package/dist/viewer/workspace.d.ts +2 -0
- package/dist/viewer/workspace.js +46 -1
- package/package.json +27 -10
- package/dist/compiler/bundle.d.ts +0 -2
- 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
|
-
|
|
12
|
-
|
|
13
|
-
--viewer-plugins <module>
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
|
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
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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(
|
|
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
|
|
154
|
-
--warnings-as-errors
|
|
155
|
-
--help, -h
|
|
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
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
Site declarations determine the expected languages and themes, never CLI overrides.
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
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"
|
|
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] [
|
|
241
|
-
|
|
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
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
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
|
-
|
|
249
|
-
|
|
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
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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  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, {
|
|
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(
|
|
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)
|