@dooc-dev/dooc 0.0.27 → 0.0.28
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/edit.global.js +68 -68
- package/dist/engine/compiler/format-collections.js +8 -2
- package/dist/engine/core/html.js +1 -1
- package/dist/frontend/document-application.js +25 -17
- package/dist/manifest.global.js +51 -51
- package/dist/server/build.js +11 -8
- package/dist/server/cli.js +6 -1
- package/dist/subformats.global.js +19 -19
- package/dist/ui.global.js +15 -15
- package/dist/workspace-worker.global.js +6 -4
- package/package.json +1 -1
package/dist/server/build.js
CHANGED
|
@@ -17,7 +17,6 @@ import { walkBlocks } from "../engine/core/blocks.js";
|
|
|
17
17
|
import { selectCodeGrammars } from "../engine/core/code-grammars.js";
|
|
18
18
|
import { parseVersionConfig } from "../engine/core/document-version.js";
|
|
19
19
|
import { isSkillFile } from "../engine/core/files.js";
|
|
20
|
-
import { FORMAT_TRAITS } from "../engine/core/format-collections.js";
|
|
21
20
|
import { fenceFormat } from "../engine/core/formats.js";
|
|
22
21
|
import { parsePreviewSettings } from "../engine/core/previewers.js";
|
|
23
22
|
import { loadBuildPlugins, pluginSnapshot } from "./build-plugins.js";
|
|
@@ -161,10 +160,14 @@ export const buildBundle = async (root, options) => {
|
|
|
161
160
|
name,
|
|
162
161
|
`data:application/octet-stream;base64,${(downloadSources?.get(name) ?? data).toString("base64")}`,
|
|
163
162
|
]));
|
|
164
|
-
const formats = new Set(compiled.docs.flatMap((doc) => (doc.format ? [doc.format
|
|
165
|
-
const
|
|
163
|
+
const formats = new Set(compiled.docs.flatMap((doc) => (doc.format ? [doc.format] : [])));
|
|
164
|
+
const registered = new Set(compiled.subformats?.map(({ ext }) => ext));
|
|
165
|
+
const recordFormats = [...formats]
|
|
166
|
+
.flatMap((format) => [format, fenceFormat(format)])
|
|
167
|
+
.filter((format) => registered.has(format));
|
|
168
|
+
const collected = recordFormats.length
|
|
166
169
|
? resourceIndex(root, [...linkable])
|
|
167
|
-
.codeblocks.filter((item) =>
|
|
170
|
+
.codeblocks.filter((item) => recordFormats.includes(item.format))
|
|
168
171
|
.flatMap((item) => parseContentSource(item.language, item.content, item.source.file)?.blocks ?? [
|
|
169
172
|
{
|
|
170
173
|
type: "code",
|
|
@@ -173,13 +176,13 @@ export const buildBundle = async (root, options) => {
|
|
|
173
176
|
},
|
|
174
177
|
])
|
|
175
178
|
: [];
|
|
176
|
-
const
|
|
177
|
-
|
|
178
|
-
|
|
179
|
+
const formatBlocks = [...formats]
|
|
180
|
+
.filter((selector) => !registered.has(selector))
|
|
181
|
+
.flatMap((selector) => readFormatCollection(root, selector).records.flatMap((record) => record.preview ?? []));
|
|
179
182
|
const blocks = walkBlocks([
|
|
180
183
|
...site.entries.flatMap((entry) => entry.blocks),
|
|
181
184
|
...collected,
|
|
182
|
-
...
|
|
185
|
+
...formatBlocks,
|
|
183
186
|
]);
|
|
184
187
|
const code = blocks.flatMap((block) => block.type === "code" && block.lang !== "mermaid" && !block.unavailable && !block.subformat
|
|
185
188
|
? [block]
|
package/dist/server/cli.js
CHANGED
|
@@ -6,7 +6,7 @@ import { parseArgs } from "node:util";
|
|
|
6
6
|
import { setDownloadProgressListener } from "../engine/compiler/download-progress.js";
|
|
7
7
|
import { projectRoot } from "../engine/compiler/manifest.js";
|
|
8
8
|
import { isManifestFile, MANIFEST_FILE, serializeManifest, } from "../engine/core/content-metadata.js";
|
|
9
|
-
import { prebuilt } from "./assets.js";
|
|
9
|
+
import { packageVersion, prebuilt } from "./assets.js";
|
|
10
10
|
import { outputFile, writeBuildOutput } from "./build-output.js";
|
|
11
11
|
import { terminal } from "./terminal.js";
|
|
12
12
|
process.env.NODE_ENV = prebuilt ? "production" : "development";
|
|
@@ -57,6 +57,7 @@ commands:
|
|
|
57
57
|
docs download GitHub docs and open the local reader
|
|
58
58
|
relay browser MCP relay (relay --help for options)
|
|
59
59
|
--stdio connect a Desktop MCP host to a browser workspace
|
|
60
|
+
--version, -v print the installed dooc version
|
|
60
61
|
help, --help, -h show this help`;
|
|
61
62
|
const fail = (message) => {
|
|
62
63
|
terminal.close();
|
|
@@ -566,6 +567,10 @@ URL handling:
|
|
|
566
567
|
case "mcp":
|
|
567
568
|
fail("dooc mcp has moved: use dooc editor run node --mcp --mcp-transport stdio (or reader for read-only access). Browser relays use dooc relay.");
|
|
568
569
|
break;
|
|
570
|
+
case "--version":
|
|
571
|
+
case "-v":
|
|
572
|
+
console.log(packageVersion);
|
|
573
|
+
break;
|
|
569
574
|
case undefined:
|
|
570
575
|
case "help":
|
|
571
576
|
case "--help":
|