@dooc-dev/dooc 0.0.5 → 0.0.7
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 +162 -67
- package/dist/code-worker.global.js +152 -0
- package/dist/code.global.js +101 -101
- package/dist/compiler/bundle-urls.js +2 -0
- package/dist/compiler/check.js +2 -0
- package/dist/compiler/compile.js +13 -3
- package/dist/compiler/dxf.d.ts +1 -0
- package/dist/compiler/dxf.js +81 -0
- package/dist/compiler/export.js +22 -15
- package/dist/compiler/figures.js +39 -10
- package/dist/compiler/files.js +2 -0
- package/dist/compiler/ignored-files.d.ts +2 -0
- package/dist/compiler/ignored-files.js +30 -0
- package/dist/compiler/ops.js +1 -1
- package/dist/compiler/subformat-schema.d.ts +14 -0
- package/dist/compiler/subformat-schema.js +92 -0
- package/dist/compiler/subformats.d.ts +5 -7
- package/dist/compiler/subformats.js +115 -75
- 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 +2 -1
- package/dist/core/content-metadata.js +7 -2
- package/dist/core/content-types.d.ts +1 -1
- package/dist/core/escape-html.d.ts +1 -0
- package/dist/core/escape-html.js +1 -0
- package/dist/core/figure-frame.js +1 -1
- package/dist/core/file-embed.js +7 -3
- package/dist/core/html.d.ts +4 -1
- package/dist/core/html.js +8 -7
- 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/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/toc-ui.js +1 -1
- package/dist/edit.global.js +266 -285
- package/dist/flow.global.js +1031 -1057
- package/dist/graph/abnfDiagram-S7VZAUFO-GAGCW2J5.js +1 -0
- package/dist/graph/architecture-WOLXFQ4H-AWAC3VBS.js +1 -0
- package/dist/graph/architectureDiagram-YGSQEFNW-WQ7QKSUJ.js +36 -0
- package/dist/graph/blockDiagram-APKKGZFW-H7ZNJMOM.js +140 -0
- package/dist/graph/bpmnIcons-APHXDYXF-EAVPNTFE.js +1 -0
- package/dist/graph/c4Diagram-KJ2TOQU5-3IYS34YL.js +38 -0
- package/dist/graph/chunk-3CJU2RDX.js +1 -0
- package/dist/graph/chunk-3LU66YMI.js +1 -0
- package/dist/graph/chunk-3Y2PDVDE.js +1 -0
- package/dist/graph/chunk-4KILFWYV.js +339 -0
- package/dist/graph/chunk-4QDE4SUK.js +1 -0
- package/dist/graph/chunk-5N2X2DXU.js +1 -0
- package/dist/graph/chunk-5OO6DATX.js +1 -0
- package/dist/graph/chunk-67BPVAXC.js +1 -0
- package/dist/graph/chunk-6CDZONCA.js +1 -0
- package/dist/graph/chunk-7ASYMKN2.js +1 -0
- package/dist/graph/chunk-7JQUFVT4.js +10 -0
- package/dist/graph/chunk-7LSMJ4VU.js +72 -0
- package/dist/graph/chunk-7UKJADAE.js +213 -0
- package/dist/graph/chunk-AARGNXTW.js +32 -0
- package/dist/graph/chunk-ARAJTKOH.js +2 -0
- package/dist/graph/chunk-BOXAA5AP.js +62 -0
- package/dist/graph/chunk-BTMPKSGF.js +1 -0
- package/dist/graph/chunk-BVXT562I.js +1 -0
- package/dist/graph/chunk-DIDARDST.js +1 -0
- package/dist/graph/chunk-EWYECPNJ.js +1 -0
- package/dist/graph/chunk-FD7ZFC7R.js +3 -0
- package/dist/graph/chunk-GF4TOPUK.js +1 -0
- package/dist/graph/chunk-GWYODWCE.js +1 -0
- package/dist/graph/chunk-HKRJKXEE.js +1 -0
- package/dist/graph/chunk-I5LEUF24.js +1 -0
- package/dist/graph/chunk-ICJPOOXG.js +1 -0
- package/dist/graph/chunk-IVZHB6RS.js +135 -0
- package/dist/graph/chunk-JSHWCPFJ.js +1 -0
- package/dist/graph/chunk-JZGXHT3J.js +1 -0
- package/dist/graph/chunk-K4I76XBX.js +14 -0
- package/dist/graph/chunk-LSRL537V.js +88 -0
- package/dist/graph/chunk-LT6LXKCR.js +136 -0
- package/dist/graph/chunk-MPR575IN.js +1 -0
- package/dist/graph/chunk-N44XPVUD.js +15 -0
- package/dist/graph/chunk-NDAMZVXQ.js +1 -0
- package/dist/graph/chunk-O656ZI37.js +1 -0
- package/dist/graph/chunk-PDH25ALM.js +2 -0
- package/dist/graph/chunk-QLS7NIYR.js +2 -0
- package/dist/graph/chunk-QQIGL7OP.js +1 -0
- package/dist/graph/chunk-QYAXYFNI.js +1 -0
- package/dist/graph/chunk-QYTM6GY3.js +1 -0
- package/dist/graph/chunk-RJFVWYCA.js +1 -0
- package/dist/graph/chunk-SCEY3ZPT.js +1 -0
- package/dist/graph/chunk-SQE76S5B.js +1 -0
- package/dist/graph/chunk-WQHTQAFY.js +1 -0
- package/dist/graph/chunk-XQS73SBQ.js +1 -0
- package/dist/graph/chunk-Z4FIZ7CR.js +1 -0
- package/dist/graph/chunk-ZSZXN4BT.js +2 -0
- package/dist/graph/classDiagram-v2-L25IHNXF-HNTCDTNK.js +217 -0
- package/dist/graph/cose-bilkent-JH36ORCC-2GVA7XKO.js +1 -0
- package/dist/graph/cynefin-EF2NZ3EQ-TCI65RAQ.js +1 -0
- package/dist/graph/cynefinDiagram-L36ESFBY-OKQ5BLVF.js +62 -0
- package/dist/graph/dagre-SPEB5RXH-KZEBD52K.js +4 -0
- package/dist/graph/diagram-3B7GL73J-ESCBJM3O.js +200 -0
- package/dist/graph/diagram-DNEMPZML-ZIBUSQZI.js +24 -0
- package/dist/graph/diagram-L3MUGCDN-IGK62IPN.js +41 -0
- package/dist/graph/diagram-LA4NIPWU-2KZCOFJ5.js +24 -0
- package/dist/graph/diagram-MHCOC4E2-EYAAB236.js +3 -0
- package/dist/graph/diagram-XPFHEONP-OZ5ARGMG.js +30 -0
- package/dist/graph/ebnfDiagram-UZSYDL2S-M3XJHARD.js +1 -0
- package/dist/graph/erDiagram-EYBAPDEH-Y7KUBH7A.js +99 -0
- package/dist/graph/eventmodeling-K75KTNOO-ROLYRDEP.js +1 -0
- package/dist/graph/flowDiagram-MALGAFMO-AAUEIPCR.js +1 -0
- package/dist/graph/ganttDiagram-23REXITY-JSBTFSSJ.js +292 -0
- package/dist/graph/gitGraph-VSP46ZUC-ZCBCDVNF.js +1 -0
- package/dist/graph/gitGraphDiagram-STJD7YCW-3ZA5FT3G.js +106 -0
- package/dist/graph/info-OHQRW6UA-JKJGOQNY.js +1 -0
- package/dist/graph/infoDiagram-KBXO4MBG-6LFMPP2O.js +2 -0
- package/dist/graph/ishikawaDiagram-M35NCXHK-YLEU44DY.js +70 -0
- package/dist/graph/journeyDiagram-OPLOXDXO-ZHJV66ZT.js +139 -0
- package/dist/graph/kanban-definition-BZKZHSQY-SDU25WUM.js +89 -0
- package/dist/graph/katex-WSLZOTY7.js +257 -0
- package/dist/graph/mindmap-definition-I2QAS2VK-XQNBCYHN.js +98 -0
- package/dist/graph/packet-JDAUHWVQ-Y3H77ERD.js +1 -0
- package/dist/graph/pegDiagram-FD4XPPHP-YO4VWH6V.js +1 -0
- package/dist/graph/pie-XZMESJXO-PRER4XL5.js +1 -0
- package/dist/graph/pieDiagram-J4AKIIQI-TJ5WOOSV.js +39 -0
- package/dist/graph/quadrantDiagram-XTYBLID2-G6MSSZLW.js +7 -0
- package/dist/graph/radar-ABXABTNO-M6MV34GM.js +1 -0
- package/dist/graph/railroad-I3PHUGI6-YIWPGN6Q.js +1 -0
- package/dist/graph/railroad-abnf-LNEFI6M7-7JHLZ2R7.js +1 -0
- package/dist/graph/railroad-ebnf-DWYD2UWJ-V55BXEWY.js +1 -0
- package/dist/graph/railroad-peg-JR7BVNR7-XCGKDRMK.js +1 -0
- package/dist/graph/railroadDiagram-MRQ6NCDL-RACSFXC4.js +1 -0
- package/dist/graph/requirementDiagram-Y7LWUY3S-4LQIQWHQ.js +84 -0
- package/dist/graph/sankeyDiagram-WGJFYUXA-K3RXG5FB.js +40 -0
- package/dist/graph/schema-graph-global.js +639 -0
- package/dist/graph/sequenceDiagram-5NDRBG5M-Y6RBHRS3.js +169 -0
- package/dist/graph/sizeCapture-INFHLROL-TJW3VUGH.js +1 -0
- package/dist/graph/stateDiagram-v2-FJ4FJNEA-4M5WZORG.js +291 -0
- package/dist/graph/swimlanes-UMQ2AFYF-O4W6U4RO.js +1 -0
- package/dist/graph/swimlanesDiagram-OMPLPG4O-HZAKM45N.js +8 -0
- package/dist/graph/timeline-definition-SEUHKTQE-IHISQ4Q7.js +120 -0
- package/dist/graph/treeView-D4JQ5SDB-EVGY4VYS.js +1 -0
- package/dist/graph/treemap-SAJKECNS-LN3SMFRX.js +1 -0
- package/dist/graph/usecaseDiagram-AFA6YXN4-B645A3J6.js +370 -0
- package/dist/graph/vennDiagram-NNMJR3RB-K3HWMON6.js +34 -0
- package/dist/graph/wardley-7MLQ67FV-RRWOELC6.js +1 -0
- package/dist/graph/wardleyDiagram-S7YFUSEH-DMMWKJEK.js +78 -0
- package/dist/graph/xychartDiagram-GGNKY7IX-K6MUQVXR.js +7 -0
- package/dist/mcp.js +5 -4
- package/dist/plugins.global.js +71 -104
- package/dist/subformats.global.js +6 -112
- package/dist/ui.global.js +75 -108
- package/dist/viewer/build.d.ts +2 -0
- package/dist/viewer/build.js +22 -8
- package/dist/viewer/code-file.js +7 -2
- package/dist/viewer/figure-preview.d.ts +4 -0
- package/dist/viewer/figure-preview.js +54 -0
- package/dist/viewer/hmr.js +4 -3
- package/dist/viewer/lazy-preview.d.ts +2 -0
- package/dist/viewer/lazy-preview.js +43 -0
- package/dist/viewer/locales/eng.json +26 -3
- package/dist/viewer/locales/jpn.json +26 -3
- package/dist/viewer/locales/zho.json +26 -3
- package/dist/viewer/plugin-blocks.js +1 -1
- package/dist/viewer/plugins.js +1 -1
- package/dist/viewer/resource-library.d.ts +1 -1
- package/dist/viewer/resource-library.js +5 -4
- package/dist/viewer/serve.d.ts +2 -1
- package/dist/viewer/serve.js +148 -41
- package/dist/viewer/textfile.d.ts +2 -0
- package/dist/viewer/textfile.js +20 -5
- package/package.json +14 -4
- package/dist/viewer/lazy-graph.d.ts +0 -2
- package/dist/viewer/lazy-graph.js +0 -30
package/dist/cli.js
CHANGED
|
@@ -4,31 +4,40 @@ import { mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
|
4
4
|
import { basename, dirname, join, resolve } from "node:path";
|
|
5
5
|
import { parseArgs } from "node:util";
|
|
6
6
|
import { projectRoot } from "./compiler/manifest.js";
|
|
7
|
+
import { MANIFEST_FILE, serializeManifest } from "./core/content-metadata.js";
|
|
7
8
|
import { prebuilt } from "./viewer/assets.js";
|
|
8
9
|
process.env.NODE_ENV = prebuilt ? "production" : "development";
|
|
9
10
|
const USAGE = `usage: dooc <command>
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
commands:
|
|
13
|
+
├─ init create dooc.yaml in the current directory
|
|
14
|
+
├─ edit [dooc.yaml] [port] open dooc in edit mode
|
|
15
|
+
│ └─ --viewer-plugins <module> inject an external viewer plugin module
|
|
16
|
+
├─ view [dooc.yaml] [port] open dooc in view mode
|
|
17
|
+
│ └─ --viewer-plugins <module> inject an external viewer plugin module
|
|
18
|
+
├─ build build the selected bundle (default <project>/dist)
|
|
19
|
+
│ ├─ html [dooc.yaml] [out-dir] build bundle.html
|
|
20
|
+
│ │ ├─ --mode static|live HTML snapshot or runtime plugin API
|
|
21
|
+
│ │ ├─ --auth external host supplies live HTML authentication and transport
|
|
22
|
+
│ │ └─ --source-url <url> source directory URL for card copy links
|
|
23
|
+
│ ├─ zip [dooc.yaml] [out-dir] build bundle.zip
|
|
24
|
+
│ ├─ --url_preview embed|network URL handling for either format (default: embed)
|
|
25
|
+
│ └─ --viewer-plugins <module> inject an external build plugin module
|
|
26
|
+
├─ export [dooc.yaml] [out-dir] collect source dependencies into bundle.zip
|
|
27
|
+
├─ check [dooc.yaml] [options] JSON consistency report (check --help for options)
|
|
28
|
+
├─ plugin manage local plugins
|
|
29
|
+
│ ├─ pack <built-dir> [zip] package bundled JS and assets as a plugin ZIP
|
|
30
|
+
│ ├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
|
|
31
|
+
│ └─ login <id> [dooc.yaml] [port] open a local login flow for an installed plugin
|
|
32
|
+
├─ font manage project fonts (.dooc/fonts/)
|
|
33
|
+
│ ├─ add <file> [dooc.yaml] register a font in the project
|
|
34
|
+
│ ├─ list [dooc.yaml] list registered project fonts
|
|
35
|
+
│ └─ remove <name> [dooc.yaml] remove a registered project font
|
|
36
|
+
├─ mcp [dooc.yaml] stdio MCP server (all read / write operations)
|
|
37
|
+
│ └─ --git-origin <module> inject gitOrigin from an external viewer plugin module
|
|
38
|
+
└─ help, --help, -h show this help
|
|
31
39
|
|
|
40
|
+
Details: dooc <command> --help (init, build, check, plugin, font, mcp).
|
|
32
41
|
Default manifest: ./dooc.yaml. Paths and .dooc/ are relative to its directory.`;
|
|
33
42
|
const fail = (message) => {
|
|
34
43
|
console.error(message);
|
|
@@ -40,6 +49,38 @@ const writeOut = (out, data) => {
|
|
|
40
49
|
};
|
|
41
50
|
const [command, ...args] = process.argv.slice(2);
|
|
42
51
|
switch (command) {
|
|
52
|
+
case "init": {
|
|
53
|
+
try {
|
|
54
|
+
const { positionals, values } = parseArgs({
|
|
55
|
+
args,
|
|
56
|
+
allowPositionals: true,
|
|
57
|
+
options: { help: { type: "boolean", short: "h" } },
|
|
58
|
+
});
|
|
59
|
+
if (values.help) {
|
|
60
|
+
console.log(`usage: dooc init
|
|
61
|
+
|
|
62
|
+
Create dooc.yaml in the current directory. Existing files are never overwritten.
|
|
63
|
+
Run dooc edit to add your first document.
|
|
64
|
+
|
|
65
|
+
options:
|
|
66
|
+
--help, -h show this help`);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
if (positionals.length)
|
|
70
|
+
throw new Error("init does not accept positional arguments");
|
|
71
|
+
const file = resolve(MANIFEST_FILE);
|
|
72
|
+
writeFileSync(file, serializeManifest([], { format: "nested" }), { flag: "wx" });
|
|
73
|
+
console.log(`Created ${file}\nRun dooc edit to add your first document.`);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
fail(error instanceof Error && "code" in error && error.code === "EEXIST"
|
|
77
|
+
? `${MANIFEST_FILE} already exists; nothing was overwritten.`
|
|
78
|
+
: error instanceof Error
|
|
79
|
+
? error.message
|
|
80
|
+
: String(error));
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
43
84
|
case "plugin": {
|
|
44
85
|
try {
|
|
45
86
|
const { positionals, values } = parseArgs({
|
|
@@ -49,17 +90,27 @@ switch (command) {
|
|
|
49
90
|
});
|
|
50
91
|
const [action, value, rootArg, portArg] = positionals;
|
|
51
92
|
if (values.help) {
|
|
52
|
-
console.log(`usage: dooc plugin
|
|
53
|
-
|
|
54
|
-
|
|
93
|
+
console.log(`usage: dooc plugin <command>
|
|
94
|
+
|
|
95
|
+
commands:
|
|
96
|
+
├─ pack <built-dir> [output.zip] package bundled JS and assets as a plugin ZIP
|
|
97
|
+
├─ add <zip> [dooc.yaml] [port] install a local plugin and print login links
|
|
98
|
+
└─ login <plugin-id> [dooc.yaml] [port] open a local login flow for an installed plugin
|
|
99
|
+
|
|
100
|
+
options:
|
|
101
|
+
--help, -h show this help
|
|
55
102
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
103
|
+
Package:
|
|
104
|
+
ZIP root: package.json with name, version, type: module and main pointing to bundled .js/.mjs.
|
|
105
|
+
Optional icon: path to a bundled SVG asset up to 64 KiB.
|
|
106
|
+
Include relative assets (SVG, JSON, etc.); dependencies must already be bundled.
|
|
107
|
+
Limit: 16 MiB / 256 files. Default output: <built-dir>.zip.
|
|
108
|
+
|
|
109
|
+
Storage and login:
|
|
110
|
+
Installed ZIPs: <project>/.dooc/plugins/.
|
|
111
|
+
Personal logins and plugin approvals: ~/.dooc/plugins/ (override with DOOC_USER_DIR).
|
|
112
|
+
Add/login starts a local editor and prints browser login links. Keep it running while signing in.
|
|
113
|
+
Tokens stay on this computer and never enter exported documents.`);
|
|
63
114
|
break;
|
|
64
115
|
}
|
|
65
116
|
if (action === "pack" && value && positionals.length <= 3) {
|
|
@@ -113,7 +164,20 @@ Tokens stay on this computer and never enter exported documents.`);
|
|
|
113
164
|
options: { help: { type: "boolean", short: "h" } },
|
|
114
165
|
});
|
|
115
166
|
if (values.help) {
|
|
116
|
-
console.log(
|
|
167
|
+
console.log(`usage: dooc font <command>
|
|
168
|
+
|
|
169
|
+
commands:
|
|
170
|
+
├─ add <file> [dooc.yaml] register a font in the project
|
|
171
|
+
├─ list [dooc.yaml] list registered project fonts
|
|
172
|
+
└─ remove <name> [dooc.yaml] remove a registered project font
|
|
173
|
+
|
|
174
|
+
options:
|
|
175
|
+
--help, -h show this help
|
|
176
|
+
|
|
177
|
+
Fonts:
|
|
178
|
+
Fonts are copied to <project>/.dooc/fonts/ and included in ZIP and HTML bundles.
|
|
179
|
+
Supported formats: TTF, OTF, WOFF, WOFF2. Existing names are never overwritten.
|
|
180
|
+
Reload the viewer after changing registered fonts. Default manifest: ./dooc.yaml.`);
|
|
117
181
|
break;
|
|
118
182
|
}
|
|
119
183
|
const [action, value, rootArg] = positionals;
|
|
@@ -152,27 +216,31 @@ Tokens stay on this computer and never enter exported documents.`);
|
|
|
152
216
|
if (values.help) {
|
|
153
217
|
console.log(`usage: dooc check [dooc.yaml] [options]
|
|
154
218
|
|
|
219
|
+
options:
|
|
155
220
|
--only render,languages,themes select checks (default: all three)
|
|
156
221
|
manifest validity is always checked
|
|
157
|
-
--allow-shared-svg
|
|
158
|
-
--warnings-as-errors
|
|
159
|
-
--help, -h
|
|
222
|
+
--allow-shared-svg allow identical SVG bytes across themes (missing variants still fail)
|
|
223
|
+
--warnings-as-errors fail on warnings as well as errors
|
|
224
|
+
--help, -h show this help
|
|
160
225
|
|
|
161
226
|
dooc.yaml example:
|
|
162
227
|
defaultLang: jpn
|
|
163
228
|
languages: [jpn, eng]
|
|
164
229
|
themes: [light, dark]
|
|
165
230
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
Site declarations determine the expected languages and themes, never CLI overrides.
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
231
|
+
Checks:
|
|
232
|
+
render uses the viewer compiler
|
|
233
|
+
languages checks availability and prose; translations: locales/<ISO 639-3>/<source path>
|
|
234
|
+
themes checks variants: themes/<theme>/<asset path>
|
|
235
|
+
Site declarations determine the expected languages and themes, never CLI overrides.
|
|
236
|
+
|
|
237
|
+
Report:
|
|
238
|
+
stdout: one JSON CheckReport with schemaVersion=1, checks, diagnostics, summary and exitCode.
|
|
239
|
+
Diagnostic codes, relative file paths, sourceFile, language, theme and one-based lines are
|
|
240
|
+
machine-readable; message text is for humans. Prose detection is heuristic and offline.
|
|
241
|
+
Short text, unsupported formats and remote content are reported as unchecked/inconclusive.
|
|
242
|
+
Exit codes: 0 passed; 1 errors (or warnings with --warnings-as-errors); 2 invocation/execution failure.
|
|
243
|
+
Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
|
|
176
244
|
break;
|
|
177
245
|
}
|
|
178
246
|
if (positionals.length > 1)
|
|
@@ -260,31 +328,45 @@ Node API: import { checkSite } from "@dooc-dev/dooc/check".`);
|
|
|
260
328
|
},
|
|
261
329
|
});
|
|
262
330
|
if (values.help) {
|
|
263
|
-
console.log(`usage: dooc build html [dooc.yaml] [out-dir] [
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
331
|
+
console.log(`usage: dooc build <html|zip> [dooc.yaml] [out-dir] [options]
|
|
332
|
+
|
|
333
|
+
commands:
|
|
334
|
+
├─ html [dooc.yaml] [out-dir] build bundle.html
|
|
335
|
+
│ ├─ --mode static|live HTML snapshot or runtime plugin API
|
|
336
|
+
│ ├─ --auth external host supplies live HTML authentication and transport
|
|
337
|
+
│ └─ --source-url <url> HTTP(S) directory URL for card copy links
|
|
338
|
+
│ paths are relative to dooc.yaml; overrides GitHub origin/HEAD
|
|
339
|
+
└─ zip [dooc.yaml] [out-dir] build bundle.zip
|
|
340
|
+
|
|
341
|
+
options (html and zip):
|
|
342
|
+
--url_preview embed|network URL handling (default: embed; live HTML: network)
|
|
343
|
+
embed snapshot URL content and assets into the selected artifact
|
|
344
|
+
network preserve URL references without downloading them at build time
|
|
345
|
+
--viewer-plugins <module> inject trusted build plugins
|
|
346
|
+
--help, -h show this help
|
|
267
347
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
Use --viewer-plugins <module> to inject trusted build plugins; installed, enabled packages are discovered automatically.
|
|
273
|
-
Use dooc export for source dependencies without plugin execution or remote downloads.
|
|
274
|
-
--source-url <url> inject an HTTP(S) directory URL for card copy links (HTML only)
|
|
275
|
-
paths are relative to dooc.yaml; overrides GitHub origin/HEAD discovery
|
|
276
|
-
--url_preview embed snapshot URL content and assets into the selected artifact (default)
|
|
277
|
-
--url_preview network preserve URL references without downloading them at build time
|
|
348
|
+
Output:
|
|
349
|
+
A bundle is dooc.yaml and its managed content. Builds only the selected format.
|
|
350
|
+
Default output directory: <project>/dist. Source files are never rewritten.
|
|
351
|
+
Use dooc export for source dependencies without plugin execution or remote downloads.
|
|
278
352
|
|
|
279
|
-
HTML
|
|
280
|
-
|
|
353
|
+
HTML modes:
|
|
354
|
+
static resolve enabled local plugins using build-time credentials and embed their views
|
|
355
|
+
installed, enabled packages are discovered automatically
|
|
356
|
+
live expose window.dooc.setPluginTransport(request), without a login UI or credentials
|
|
357
|
+
Examples:
|
|
358
|
+
dooc build html --mode static
|
|
359
|
+
dooc build html --mode live --auth external
|
|
281
360
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
361
|
+
URL handling:
|
|
362
|
+
HTML embed: no network when opened. HTML network: fetch URLs when opened (text requires CORS).
|
|
363
|
+
ZIP embed: save URL content and rewrite references. ZIP network: keep the original URLs.
|
|
364
|
+
Only embedded references such as  are downloaded; ordinary hyperlinks remain links.
|
|
365
|
+
Snapshots use public HTTPS without credentials or redirects. Static HTML captures the server's
|
|
366
|
+
HTML and declarative assets; it does not execute the source site's JavaScript or perform login.
|
|
367
|
+
Remote files are limited to 2 MiB each and 64 MiB / 256 assets total.
|
|
368
|
+
A failed download or invalid source stops the build before replacing the selected artifact.
|
|
369
|
+
Use --url_preview network with either format to build without downloading URL content.`);
|
|
288
370
|
break;
|
|
289
371
|
}
|
|
290
372
|
const [format, rootArg, outArg] = positionals;
|
|
@@ -325,7 +407,20 @@ Use --url_preview network with either format to build without downloading URL co
|
|
|
325
407
|
},
|
|
326
408
|
});
|
|
327
409
|
if (values.help) {
|
|
328
|
-
console.log(
|
|
410
|
+
console.log(`usage: dooc mcp [dooc.yaml] [options]
|
|
411
|
+
|
|
412
|
+
options:
|
|
413
|
+
--git-origin <module> inject gitOrigin from an external viewer plugin module
|
|
414
|
+
--help, -h show this help
|
|
415
|
+
|
|
416
|
+
Server:
|
|
417
|
+
Exposes docs, files, Statics, fonts, check, build and Git over stdio.
|
|
418
|
+
Build accepts format=html|zip and url_preview=embed|network (default embed).
|
|
419
|
+
|
|
420
|
+
Git origin:
|
|
421
|
+
The external module's default export must contain gitOrigin (the same provider used by edit/view).
|
|
422
|
+
Only gitOrigin is used; viewer setup and data plugins are not started.
|
|
423
|
+
Authentication stays in the provider.`);
|
|
329
424
|
break;
|
|
330
425
|
}
|
|
331
426
|
if (positionals.length > 1)
|