nuxt-ai-ready 2.5.0 → 2.5.2
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/chunks/agent-skills.mjs +1 -1
- package/dist/chunks/prerender.mjs +1 -1
- package/dist/cli.mjs +2 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/server/db/drizzle/queries.js +0 -1
- package/dist/runtime/server/db/queries.d.ts +2 -0
- package/dist/runtime/server/db/queries.js +11 -5
- package/dist/runtime/server/db/seed.d.ts +2 -2
- package/dist/runtime/server/routes/__ai-ready/reindex.post.js +2 -0
- package/dist/runtime/server/utils/batchIndex.js +4 -2
- package/dist/runtime/server/utils/checkStale.d.ts +1 -1
- package/dist/runtime/server/utils/checkStale.js +1 -1
- package/dist/runtime/server/utils/indexPage.d.ts +8 -1
- package/dist/runtime/server/utils/indexPage.js +13 -5
- package/dist/shared/{nuxt-ai-ready.DsokNmXc.mjs → nuxt-ai-ready.CLSWou20.mjs} +2 -0
- package/node_modules/@mdream/js/LICENSE.md +9 -0
- package/node_modules/@mdream/js/README.md +792 -0
- package/node_modules/@mdream/js/bin/mdream.mjs +2 -0
- package/node_modules/@mdream/js/dist/_chunks/const.mjs +134 -0
- package/node_modules/@mdream/js/dist/_chunks/index.d.mts +9 -0
- package/node_modules/@mdream/js/dist/_chunks/markdown-processor.mjs +1968 -0
- package/node_modules/@mdream/js/dist/_chunks/minimal.d.mts +6 -0
- package/node_modules/@mdream/js/dist/_chunks/parse.mjs +2756 -0
- package/node_modules/@mdream/js/dist/_chunks/plugins.mjs +725 -0
- package/node_modules/@mdream/js/dist/_chunks/resolve-plugins.mjs +44 -0
- package/node_modules/@mdream/js/dist/_chunks/stream.mjs +37 -0
- package/node_modules/@mdream/js/dist/_chunks/types.d.mts +473 -0
- package/node_modules/@mdream/js/dist/cli.d.mts +1 -0
- package/node_modules/@mdream/js/dist/cli.mjs +32 -0
- package/node_modules/@mdream/js/dist/core.d.mts +15 -0
- package/node_modules/@mdream/js/dist/core.mjs +28 -0
- package/node_modules/@mdream/js/dist/index.d.mts +4 -0
- package/node_modules/@mdream/js/dist/index.mjs +58 -0
- package/node_modules/@mdream/js/dist/llms-txt.d.mts +86 -0
- package/node_modules/@mdream/js/dist/llms-txt.mjs +308 -0
- package/node_modules/@mdream/js/dist/negotiate.d.mts +35 -0
- package/node_modules/@mdream/js/dist/negotiate.mjs +121 -0
- package/node_modules/@mdream/js/dist/parse.d.mts +90 -0
- package/node_modules/@mdream/js/dist/parse.mjs +2 -0
- package/node_modules/@mdream/js/dist/plugins.d.mts +85 -0
- package/node_modules/@mdream/js/dist/plugins.mjs +2 -0
- package/node_modules/@mdream/js/dist/preset/minimal.d.mts +2 -0
- package/node_modules/@mdream/js/dist/preset/minimal.mjs +33 -0
- package/node_modules/@mdream/js/dist/splitter.d.mts +18 -0
- package/node_modules/@mdream/js/dist/splitter.mjs +194 -0
- package/node_modules/@mdream/js/package.json +103 -0
- package/node_modules/cac/LICENSE +21 -0
- package/node_modules/cac/README.md +492 -0
- package/node_modules/cac/dist/index.d.ts +196 -0
- package/node_modules/cac/dist/index.js +638 -0
- package/node_modules/cac/package.json +72 -0
- package/node_modules/mdream/LICENSE.md +9 -0
- package/node_modules/mdream/README.md +1091 -0
- package/node_modules/mdream/bin/mdream.mjs +46 -0
- package/node_modules/mdream/dist/browser.d.mts +105 -0
- package/node_modules/mdream/dist/browser.mjs +262 -0
- package/node_modules/mdream/dist/edge.d.mts +100 -0
- package/node_modules/mdream/dist/edge.mjs +250 -0
- package/node_modules/mdream/dist/iife.js +605 -0
- package/node_modules/mdream/dist/index.d.mts +89 -0
- package/node_modules/mdream/dist/index.mjs +184 -0
- package/node_modules/mdream/dist/wasm.d.mts +100 -0
- package/node_modules/mdream/dist/wasm.mjs +140 -0
- package/node_modules/mdream/dist/worker.d.mts +101 -0
- package/node_modules/mdream/dist/worker.mjs +217 -0
- package/node_modules/mdream/napi/index.d.mts +127 -0
- package/node_modules/mdream/napi/index.d.ts +127 -0
- package/node_modules/mdream/napi/index.mjs +725 -0
- package/node_modules/mdream/napi/rust.android-arm-eabi.node +0 -0
- package/node_modules/mdream/napi/rust.android-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-arm64.node +0 -0
- package/node_modules/mdream/napi/rust.darwin-x64.node +0 -0
- package/node_modules/mdream/napi/rust.freebsd-x64.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm-gnueabihf.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-arm64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-gnu.node +0 -0
- package/node_modules/mdream/napi/rust.linux-x64-musl.node +0 -0
- package/node_modules/mdream/napi/rust.wasi.cjs +2144 -0
- package/node_modules/mdream/napi/rust.wasm32-wasi.wasm +0 -0
- package/node_modules/mdream/napi/rust.win32-arm64-msvc.node +0 -0
- package/node_modules/mdream/napi/rust.win32-x64-msvc.node +0 -0
- package/node_modules/mdream/node_modules/@emnapi/core/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/core/README.md +1 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.d.ts +392 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.d.ts +392 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.full.js +8351 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/emnapi-core.js +7268 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/async-work.js +843 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.d.ts +4 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/index.js +3 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/threadsafe-function.js +1010 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.d.ts +5 -0
- package/node_modules/mdream/node_modules/@emnapi/core/dist/plugins/v8.js +1446 -0
- package/node_modules/mdream/node_modules/@emnapi/core/package.json +39 -0
- package/node_modules/mdream/node_modules/@emnapi/core/rollup.config.js +60 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/README.md +1 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.d.ts +833 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js +2306 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/dist/emnapi.js.map +1 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/index.cjs +63 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/package.json +39 -0
- package/node_modules/mdream/node_modules/@emnapi/runtime/rollup.config.js +25 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/README.md +203 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.d.ts +236 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/dist/wasi-threads.js +1086 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/package.json +35 -0
- package/node_modules/mdream/node_modules/@emnapi/wasi-threads/rollup.config.js +6 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.cjs +1472 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/emnapi-plugins.js +1470 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs-proxy.cjs +237 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/dist/fs.js +18260 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/fs-proxy.js +317 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/package.json +67 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.cjs +39 -0
- package/node_modules/mdream/node_modules/@napi-rs/wasm-runtime/runtime.js +36 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/LICENSE +21 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/README.md +193 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/tsdoc-metadata.json +11 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.d.ts +423 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm-bundler.js +2932 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.js +2932 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.esm.min.js +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.js +2954 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/dist/wasm-util.min.js +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/asyncify.js +158 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/index.js +13 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/jspi.js +46 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/load.js +97 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/memory.js +35 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/error.js +103 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fd.js +268 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/fs.js +3 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/index.js +192 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/path.js +316 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/preview1.js +1599 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/rights.js +141 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/types.js +220 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/wasi/util.js +128 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/cjs/webassembly.js +13 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/asyncify.mjs +153 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/index.mjs +9 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/jspi.mjs +39 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/load.mjs +89 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/memory.mjs +28 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/error.mjs +97 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fd.mjs +256 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/fs.mjs +1 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/index.mjs +186 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/path.mjs +310 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/preview1.mjs +1593 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/rights.mjs +135 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/types.mjs +216 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/wasi/util.mjs +113 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/lib/mjs/webassembly.mjs +9 -0
- package/node_modules/mdream/node_modules/@tybys/wasm-util/package.json +58 -0
- package/node_modules/mdream/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/node_modules/mdream/node_modules/tslib/LICENSE.txt +12 -0
- package/node_modules/mdream/node_modules/tslib/README.md +164 -0
- package/node_modules/mdream/node_modules/tslib/SECURITY.md +41 -0
- package/node_modules/mdream/node_modules/tslib/modules/index.d.ts +38 -0
- package/node_modules/mdream/node_modules/tslib/modules/index.js +70 -0
- package/node_modules/mdream/node_modules/tslib/modules/package.json +3 -0
- package/node_modules/mdream/node_modules/tslib/package.json +47 -0
- package/node_modules/mdream/node_modules/tslib/tslib.d.ts +460 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.html +1 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.js +402 -0
- package/node_modules/mdream/node_modules/tslib/tslib.es6.mjs +401 -0
- package/node_modules/mdream/node_modules/tslib/tslib.html +1 -0
- package/node_modules/mdream/node_modules/tslib/tslib.js +484 -0
- package/node_modules/mdream/package.json +110 -0
- package/node_modules/mdream/skills/mdream/SKILL.md +124 -0
- package/node_modules/mdream/skills/mdream/references/runtimes.md +49 -0
- package/node_modules/mdream/wasm/mdream_edge.d.ts +90 -0
- package/node_modules/mdream/wasm/mdream_edge.js +517 -0
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm/mdream_edge_bg.wasm.d.ts +20 -0
- package/node_modules/mdream/wasm/package.json +17 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge.d.ts +45 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge.js +13 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.js +413 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm +0 -0
- package/node_modules/mdream/wasm-bundler/mdream_edge_bg.wasm.d.ts +20 -0
- package/node_modules/mdream/wasm-bundler/package.json +19 -0
- package/node_modules/pathe/LICENSE +70 -0
- package/node_modules/pathe/README.md +73 -0
- package/node_modules/pathe/dist/index.cjs +39 -0
- package/node_modules/pathe/dist/index.d.cts +47 -0
- package/node_modules/pathe/dist/index.d.mts +47 -0
- package/node_modules/pathe/dist/index.d.ts +47 -0
- package/node_modules/pathe/dist/index.mjs +19 -0
- package/node_modules/pathe/dist/shared/pathe.BSlhyZSM.cjs +266 -0
- package/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs +249 -0
- package/node_modules/pathe/dist/utils.cjs +82 -0
- package/node_modules/pathe/dist/utils.d.cts +32 -0
- package/node_modules/pathe/dist/utils.d.mts +32 -0
- package/node_modules/pathe/dist/utils.d.ts +32 -0
- package/node_modules/pathe/dist/utils.mjs +77 -0
- package/node_modules/pathe/package.json +61 -0
- package/node_modules/pathe/utils.d.ts +1 -0
- package/package.json +8 -64
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { ElementNode, Node, NodeEvent, TagHandler, TransformPlugin } from "./_chunks/types.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Commit end-of-input state: flush trailing buffered text and close any open
|
|
4
|
+
* elements. The streaming parser keeps trailing text and unclosed elements
|
|
5
|
+
* pending (a later chunk might continue them); at true EOF they must be
|
|
6
|
+
* committed so trailing content is not dropped (e.g. `<p>a<p>b`).
|
|
7
|
+
*
|
|
8
|
+
* `leftover` is the residual returned by the final `parseHtmlStream`. Trailing
|
|
9
|
+
* text is emitted; a residual that is an incomplete start tag is dropped,
|
|
10
|
+
* matching the browser tokenizer's EOF-in-tag behaviour. A leading `<` alone
|
|
11
|
+
* does not make it a tag: `<3` is text. The text-buffer flags set while the
|
|
12
|
+
* trailing text was scanned persist on `state`, so `processTextBuffer` commits
|
|
13
|
+
* it as if the next tag had triggered the flush.
|
|
14
|
+
*/
|
|
15
|
+
export declare function finalizeParse(leftover: string, state: ParseState, handleEvent: (event: NodeEvent) => void): void;
|
|
16
|
+
export interface ParseOptions {
|
|
17
|
+
resolvedPlugins?: TransformPlugin[];
|
|
18
|
+
}
|
|
19
|
+
export interface ParseState {
|
|
20
|
+
/** Map of tag names to their current nesting depth - uses TypedArray for performance */
|
|
21
|
+
depthMap: Uint16Array;
|
|
22
|
+
/** Current overall nesting depth */
|
|
23
|
+
depth: number;
|
|
24
|
+
/** Root tag currently flattened beyond the rich element depth. */
|
|
25
|
+
flattenedTagName?: string;
|
|
26
|
+
/** Resolved built-in identity of the flattened root. */
|
|
27
|
+
flattenedTagId?: number;
|
|
28
|
+
/** Same-name nesting below the flattened root. */
|
|
29
|
+
flattenedTagDepth?: number;
|
|
30
|
+
/** Exact output-excluded scope nested inside the flattened subtree. */
|
|
31
|
+
flattenedOpaqueTagName?: string;
|
|
32
|
+
flattenedOpaqueDepth?: number;
|
|
33
|
+
/** Raw-text tag currently open inside the flattened subtree. */
|
|
34
|
+
flattenedRawTagName?: string;
|
|
35
|
+
/** Whether flattened raw text must be excluded from output. */
|
|
36
|
+
flattenedRawExcludesText?: boolean;
|
|
37
|
+
/** Currently processing element node */
|
|
38
|
+
currentNode?: ElementNode | null;
|
|
39
|
+
/** Whether current content contains HTML entities that need decoding */
|
|
40
|
+
hasEncodedHtmlEntity?: boolean;
|
|
41
|
+
/** Whether the last processed character was whitespace - for collapsing whitespace */
|
|
42
|
+
lastCharWasWhitespace?: boolean;
|
|
43
|
+
/** Whether the last processed buffer has whitespace - optimization flag */
|
|
44
|
+
textBufferContainsWhitespace?: boolean;
|
|
45
|
+
/** Whether the last processed buffer contains non-whitespace characters */
|
|
46
|
+
textBufferContainsNonWhitespace?: boolean;
|
|
47
|
+
/** Whether a tag was just closed - affects whitespace handling */
|
|
48
|
+
justClosedTag?: boolean;
|
|
49
|
+
/** Whether the next text node is the first in its element - for whitespace trimming */
|
|
50
|
+
isFirstTextInElement?: boolean;
|
|
51
|
+
/** Persisted HTML tokenizer state while streaming a built-in script body. */
|
|
52
|
+
scriptDataState?: number;
|
|
53
|
+
/** Consumed script chunks retained for extraction/plugin text events. */
|
|
54
|
+
scriptTextChunks?: string[];
|
|
55
|
+
/** Reference to the last processed text node - for context tracking */
|
|
56
|
+
lastTextNode?: Node;
|
|
57
|
+
/** @deprecated No longer read or written. Retained for source compatibility. */
|
|
58
|
+
inSingleQuote?: boolean;
|
|
59
|
+
/** @deprecated No longer read or written. Retained for source compatibility. */
|
|
60
|
+
inDoubleQuote?: boolean;
|
|
61
|
+
/** @deprecated No longer read or written. Retained for source compatibility. */
|
|
62
|
+
inBacktick?: boolean;
|
|
63
|
+
/** @deprecated Rawtext parsing is no longer quote-aware. Retained for source compatibility. */
|
|
64
|
+
inRawTextQuoteAware?: boolean;
|
|
65
|
+
/** @deprecated No longer read or written. Retained for source compatibility. */
|
|
66
|
+
lastCharWasBackslash?: boolean;
|
|
67
|
+
/** Resolved plugin instances for event processing */
|
|
68
|
+
resolvedPlugins?: TransformPlugin[];
|
|
69
|
+
/** Tag override handlers built from declarative tagOverrides config */
|
|
70
|
+
tagOverrideHandlers?: Map<string, TagHandler>;
|
|
71
|
+
/** Whether emitted text should skip Markdown-only escaping */
|
|
72
|
+
plainText?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ParseResult {
|
|
75
|
+
events: NodeEvent[];
|
|
76
|
+
remainingHtml: string;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Pure HTML parser that emits DOM events
|
|
80
|
+
* Completely decoupled from markdown generation
|
|
81
|
+
*/
|
|
82
|
+
export declare function parseHtml(html: string, options?: ParseOptions): ParseResult;
|
|
83
|
+
/**
|
|
84
|
+
* Streaming HTML parser - calls onEvent for each DOM event
|
|
85
|
+
*/
|
|
86
|
+
export declare function parseHtmlStream(html: string, state: ParseState, onEvent: (event: NodeEvent) => void): string;
|
|
87
|
+
/**
|
|
88
|
+
* Parse HTML attributes string into key-value object
|
|
89
|
+
*/
|
|
90
|
+
export declare function parseAttributes(attrStr: string): Record<string, string>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { ElementNode, ExtractedElement as ExtractedElement$1, MdreamRuntimeState, TransformPlugin } from "./_chunks/types.mjs";
|
|
2
|
+
import { createPlugin } from "./_chunks/index.mjs";
|
|
3
|
+
interface ExtractedElement extends ElementNode {
|
|
4
|
+
textContent: string;
|
|
5
|
+
}
|
|
6
|
+
type ExtractionCallback = (element: ExtractedElement, state: MdreamRuntimeState) => void;
|
|
7
|
+
/** Extract matching elements through the composable JavaScript plugin interface. */
|
|
8
|
+
export declare function extractionPlugin(selectors: Record<string, ExtractionCallback>): TransformPlugin;
|
|
9
|
+
/**
|
|
10
|
+
* Extraction collector for `plugins.extraction` config.
|
|
11
|
+
* Collects results during processing; callbacks are called post-conversion
|
|
12
|
+
* to match Rust engine behavior.
|
|
13
|
+
*/
|
|
14
|
+
export declare function extractionCollectorPlugin(config: Record<string, (element: ExtractedElement$1) => void>): {
|
|
15
|
+
plugin: TransformPlugin;
|
|
16
|
+
getResults: () => ExtractedElement$1[];
|
|
17
|
+
callHandlers: () => void;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Plugin that filters nodes based on CSS selectors.
|
|
21
|
+
* Allows including or excluding nodes based on selectors.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* // Include only heading elements and their children
|
|
25
|
+
* withQuerySelectorPlugin({ include: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] })
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* // Exclude navigation, sidebar, and footer
|
|
29
|
+
* withQuerySelectorPlugin({ exclude: ['nav', '#sidebar', '.footer'] })
|
|
30
|
+
*/
|
|
31
|
+
export declare function filterPlugin(options?: {
|
|
32
|
+
/** CSS selectors, tag names, or TAG_* constants for elements to include (all others will be excluded) */
|
|
33
|
+
include?: (string | number)[];
|
|
34
|
+
/** CSS selectors, tag names, or TAG_* constants for elements to exclude */
|
|
35
|
+
exclude?: (string | number)[];
|
|
36
|
+
/** Whether to also process the children of matching elements */
|
|
37
|
+
processChildren?: boolean;
|
|
38
|
+
keepAbsolute?: boolean;
|
|
39
|
+
}): TransformPlugin;
|
|
40
|
+
interface FrontmatterPluginOptions {
|
|
41
|
+
/** Additional frontmatter fields to include */
|
|
42
|
+
additionalFields?: Record<string, string>;
|
|
43
|
+
/** Meta tag names to extract (beyond the standard ones) */
|
|
44
|
+
metaFields?: string[];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A plugin that manages frontmatter generation from HTML head elements
|
|
48
|
+
* Extracts metadata from meta tags and title and generates YAML frontmatter
|
|
49
|
+
*/
|
|
50
|
+
export declare function frontmatterPlugin(options?: FrontmatterPluginOptions): TransformPlugin;
|
|
51
|
+
/**
|
|
52
|
+
* Plugin that isolates main content using the following priority order:
|
|
53
|
+
* 1. If an explicit <main> element exists (within 5 depth levels), use its content exclusively
|
|
54
|
+
* 2. Otherwise, find content between the first header tag (h1-h6) and first footer
|
|
55
|
+
* 3. If footer is within 5 levels of nesting from the header, use it as the end boundary
|
|
56
|
+
* 4. Exclude all content before the start marker and after the end marker
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```html
|
|
60
|
+
* <body>
|
|
61
|
+
* <nav>Navigation (excluded)</nav>
|
|
62
|
+
* <main>
|
|
63
|
+
* <h1>Main Title (included)</h1>
|
|
64
|
+
* <p>Main content (included)</p>
|
|
65
|
+
* </main>
|
|
66
|
+
* <footer>Footer (excluded)</footer>
|
|
67
|
+
* </body>
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```html
|
|
72
|
+
* <body>
|
|
73
|
+
* <nav>Navigation (excluded)</nav>
|
|
74
|
+
* <h1>Main Title (included)</h1>
|
|
75
|
+
* <p>Main content (included)</p>
|
|
76
|
+
* <footer>Footer (excluded)</footer>
|
|
77
|
+
* </body>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function isolateMainPlugin(): TransformPlugin;
|
|
81
|
+
/**
|
|
82
|
+
* Creates a plugin that adds Tailwind class processing
|
|
83
|
+
*/
|
|
84
|
+
export declare function tailwindPlugin(): TransformPlugin;
|
|
85
|
+
export { type ExtractedElement, createPlugin };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { createPlugin, extractionCollectorPlugin, extractionPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, tailwindPlugin } from "./_chunks/plugins.mjs";
|
|
2
|
+
export { createPlugin, extractionCollectorPlugin, extractionPlugin, filterPlugin, frontmatterPlugin, isolateMainPlugin, tailwindPlugin };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "../_chunks/const.mjs";
|
|
2
|
+
const MINIMAL_EXCLUDE = [
|
|
3
|
+
40,
|
|
4
|
+
68,
|
|
5
|
+
103,
|
|
6
|
+
58,
|
|
7
|
+
47,
|
|
8
|
+
88,
|
|
9
|
+
73,
|
|
10
|
+
59,
|
|
11
|
+
66,
|
|
12
|
+
65,
|
|
13
|
+
43,
|
|
14
|
+
41
|
|
15
|
+
];
|
|
16
|
+
function withMinimalPreset(options = {}) {
|
|
17
|
+
const filter = options.plugins?.filter;
|
|
18
|
+
return {
|
|
19
|
+
clean: options.clean !== void 0 ? options.clean : true,
|
|
20
|
+
...options,
|
|
21
|
+
plugins: {
|
|
22
|
+
frontmatter: true,
|
|
23
|
+
isolateMain: true,
|
|
24
|
+
tailwind: true,
|
|
25
|
+
...options.plugins,
|
|
26
|
+
filter: filter === false ? false : {
|
|
27
|
+
...filter,
|
|
28
|
+
exclude: [...MINIMAL_EXCLUDE, ...filter?.exclude ?? []]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export { withMinimalPreset };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MarkdownChunk, SplitterOptions } from "./_chunks/types.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Convert HTML to Markdown and split into chunks in single pass.
|
|
4
|
+
* Yields chunks during HTML event processing for better memory efficiency.
|
|
5
|
+
*
|
|
6
|
+
* **JavaScript engine only** — uses the JS engine's internal processing pipeline.
|
|
7
|
+
* Not compatible with the Rust engine.
|
|
8
|
+
*/
|
|
9
|
+
export declare function htmlToMarkdownSplitChunksStream(html: string, options?: SplitterOptions): Generator<MarkdownChunk, void, undefined>;
|
|
10
|
+
/**
|
|
11
|
+
* Convert HTML to Markdown and split into chunks in single pass.
|
|
12
|
+
* Chunks are created during HTML event processing.
|
|
13
|
+
*
|
|
14
|
+
* **JavaScript engine only** — uses the JS engine's internal processing pipeline.
|
|
15
|
+
* Not compatible with the Rust engine.
|
|
16
|
+
*/
|
|
17
|
+
export declare function htmlToMarkdownSplitChunks(html: string, options?: SplitterOptions): MarkdownChunk[];
|
|
18
|
+
export type { MarkdownChunk, SplitterOptions };
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import "./_chunks/const.mjs";
|
|
2
|
+
import { parseHtmlStream } from "./_chunks/parse.mjs";
|
|
3
|
+
import { createMarkdownProcessor, processPluginsForEvent } from "./_chunks/markdown-processor.mjs";
|
|
4
|
+
import { resolvePlugins } from "./_chunks/resolve-plugins.mjs";
|
|
5
|
+
const MARKDOWN_HEADER_LINE_RE = /^#{1,6}\s+/;
|
|
6
|
+
const NEWLINE_RE = /\n/g;
|
|
7
|
+
const DEFAULT_HEADERS_TO_SPLIT_ON = [
|
|
8
|
+
8,
|
|
9
|
+
9,
|
|
10
|
+
10,
|
|
11
|
+
11,
|
|
12
|
+
12
|
|
13
|
+
];
|
|
14
|
+
function createOptions(options) {
|
|
15
|
+
return {
|
|
16
|
+
headersToSplitOn: options.headersToSplitOn ?? DEFAULT_HEADERS_TO_SPLIT_ON,
|
|
17
|
+
returnEachLine: options.returnEachLine ?? false,
|
|
18
|
+
stripHeaders: options.stripHeaders ?? true,
|
|
19
|
+
chunkSize: options.chunkSize ?? 1e3,
|
|
20
|
+
chunkOverlap: options.chunkOverlap ?? 200,
|
|
21
|
+
lengthFunction: options.lengthFunction ?? ((text) => text.length),
|
|
22
|
+
keepSeparator: options.keepSeparator ?? false,
|
|
23
|
+
resolvedPlugins: resolvePlugins(options).plugins
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function shouldSplitOnHeader(tagId, options) {
|
|
27
|
+
return options.headersToSplitOn.includes(tagId);
|
|
28
|
+
}
|
|
29
|
+
function getCurrentMarkdown(state) {
|
|
30
|
+
return state.buffer.join("").trimStart();
|
|
31
|
+
}
|
|
32
|
+
function* htmlToMarkdownSplitChunksStream(html, options = {}) {
|
|
33
|
+
const opts = createOptions(options);
|
|
34
|
+
if (opts.chunkOverlap >= opts.chunkSize) throw new Error("chunkOverlap must be less than chunkSize");
|
|
35
|
+
let currentChunkCodeLanguage = "";
|
|
36
|
+
const processor = createMarkdownProcessor(options, opts.resolvedPlugins);
|
|
37
|
+
processor.state.onCodeFenceOpen = (language) => {
|
|
38
|
+
if (language && !currentChunkCodeLanguage) currentChunkCodeLanguage = language;
|
|
39
|
+
};
|
|
40
|
+
const headerHierarchy = /* @__PURE__ */ new Map();
|
|
41
|
+
const seenSplitHeaders = /* @__PURE__ */ new Set();
|
|
42
|
+
let collectingHeaderText = false;
|
|
43
|
+
let currentHeaderTagId = null;
|
|
44
|
+
let currentHeaderText = "";
|
|
45
|
+
let lineNumber = 1;
|
|
46
|
+
let lastChunkEndPosition = 0;
|
|
47
|
+
let lastSplitPosition = 0;
|
|
48
|
+
function* flushChunk(endPosition, applyOverlap = false) {
|
|
49
|
+
const currentMd = getCurrentMarkdown(processor.state);
|
|
50
|
+
const chunkEnd = endPosition ?? currentMd.length;
|
|
51
|
+
const originalChunkContent = currentMd.slice(lastChunkEndPosition, chunkEnd);
|
|
52
|
+
if (!originalChunkContent.trim()) {
|
|
53
|
+
lastChunkEndPosition = chunkEnd;
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
let chunkContent = originalChunkContent;
|
|
57
|
+
if (opts.stripHeaders) {
|
|
58
|
+
chunkContent = chunkContent.split("\n").filter((line) => !MARKDOWN_HEADER_LINE_RE.test(line)).join("\n").trim();
|
|
59
|
+
if (!chunkContent) {
|
|
60
|
+
lastChunkEndPosition = chunkEnd;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const chunk = {
|
|
65
|
+
content: chunkContent.trimEnd(),
|
|
66
|
+
metadata: { loc: { lines: {
|
|
67
|
+
from: lineNumber,
|
|
68
|
+
to: lineNumber + (originalChunkContent.match(NEWLINE_RE) || []).length
|
|
69
|
+
} } }
|
|
70
|
+
};
|
|
71
|
+
if (headerHierarchy.size > 0) {
|
|
72
|
+
chunk.metadata.headers = {};
|
|
73
|
+
for (const [tagId, text] of headerHierarchy.entries()) {
|
|
74
|
+
const level = `h${tagId - 7 + 1}`;
|
|
75
|
+
chunk.metadata.headers[level] = text;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (currentChunkCodeLanguage) chunk.metadata.code = currentChunkCodeLanguage;
|
|
79
|
+
yield chunk;
|
|
80
|
+
currentChunkCodeLanguage = "";
|
|
81
|
+
lastSplitPosition = chunkEnd;
|
|
82
|
+
if (applyOverlap && opts.chunkOverlap > 0) {
|
|
83
|
+
const maxOverlap = Math.max(0, originalChunkContent.length - 1);
|
|
84
|
+
lastChunkEndPosition = chunkEnd - Math.min(opts.chunkOverlap, maxOverlap);
|
|
85
|
+
} else lastChunkEndPosition = chunkEnd;
|
|
86
|
+
lineNumber += (originalChunkContent.match(NEWLINE_RE) || []).length;
|
|
87
|
+
}
|
|
88
|
+
const parseState = {
|
|
89
|
+
depthMap: processor.state.depthMap,
|
|
90
|
+
depth: 0,
|
|
91
|
+
resolvedPlugins: opts.resolvedPlugins
|
|
92
|
+
};
|
|
93
|
+
const eventBuffer = [];
|
|
94
|
+
const processResolvedEvent = opts.resolvedPlugins?.length ? (event) => processPluginsForEvent(event, opts.resolvedPlugins, processor.state, processor.processEvent) : processor.processEvent;
|
|
95
|
+
parseHtmlStream(html, parseState, (event) => {
|
|
96
|
+
eventBuffer.push(event);
|
|
97
|
+
});
|
|
98
|
+
for (const event of eventBuffer) {
|
|
99
|
+
const { type: eventType, node } = event;
|
|
100
|
+
const eventDepthMap = node.type === 1 ? node.depthMap : node.parent?.depthMap;
|
|
101
|
+
if (eventDepthMap) processor.state.depthMap.set(eventDepthMap);
|
|
102
|
+
else processor.state.depthMap.fill(0);
|
|
103
|
+
if (eventType === 1 && node.type === 1) {
|
|
104
|
+
const tagId = node.tagId;
|
|
105
|
+
if (tagId !== void 0 && tagId >= 0 && tagId < processor.state.depthMap.length) processor.state.depthMap[tagId] = Math.max(0, processor.state.depthMap[tagId] - 1);
|
|
106
|
+
}
|
|
107
|
+
if (node.type === 1) {
|
|
108
|
+
const tagId = node.tagId;
|
|
109
|
+
if (tagId && tagId >= 7 && tagId <= 12) {
|
|
110
|
+
if (eventType === 0) {
|
|
111
|
+
collectingHeaderText = true;
|
|
112
|
+
currentHeaderTagId = tagId;
|
|
113
|
+
currentHeaderText = "";
|
|
114
|
+
if (shouldSplitOnHeader(tagId, opts)) {
|
|
115
|
+
if (seenSplitHeaders.has(tagId)) {
|
|
116
|
+
yield* flushChunk();
|
|
117
|
+
for (let i = tagId; i <= 12; i++) headerHierarchy.delete(i);
|
|
118
|
+
}
|
|
119
|
+
seenSplitHeaders.add(tagId);
|
|
120
|
+
}
|
|
121
|
+
} else if (eventType === 1 && currentHeaderTagId === tagId) {
|
|
122
|
+
headerHierarchy.set(tagId, currentHeaderText.trim());
|
|
123
|
+
collectingHeaderText = false;
|
|
124
|
+
currentHeaderTagId = null;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (tagId === 13 && eventType === 0) yield* flushChunk();
|
|
128
|
+
}
|
|
129
|
+
if (collectingHeaderText && node.type === 2) currentHeaderText += node.value;
|
|
130
|
+
processResolvedEvent(event);
|
|
131
|
+
if (!opts.returnEachLine) {
|
|
132
|
+
const currentMd = getCurrentMarkdown(processor.state);
|
|
133
|
+
if (opts.lengthFunction(currentMd.slice(lastChunkEndPosition)) > opts.chunkSize) {
|
|
134
|
+
const idealSplitPos = lastChunkEndPosition + opts.chunkSize;
|
|
135
|
+
const separators = [
|
|
136
|
+
"\n\n",
|
|
137
|
+
"```\n",
|
|
138
|
+
"\n",
|
|
139
|
+
" "
|
|
140
|
+
];
|
|
141
|
+
let splitPosition = -1;
|
|
142
|
+
for (const sep of separators) {
|
|
143
|
+
const idx = currentMd.lastIndexOf(sep, idealSplitPos);
|
|
144
|
+
const candidateSplitPos = idx + sep.length;
|
|
145
|
+
if (idx >= 0) {
|
|
146
|
+
const beforeSplit = currentMd.slice(0, candidateSplitPos);
|
|
147
|
+
let backtickCount = 0;
|
|
148
|
+
let pos = beforeSplit.indexOf("```", 0);
|
|
149
|
+
while (pos !== -1) {
|
|
150
|
+
backtickCount++;
|
|
151
|
+
pos = beforeSplit.indexOf("```", pos + 3);
|
|
152
|
+
}
|
|
153
|
+
if (backtickCount % 2 === 1) continue;
|
|
154
|
+
}
|
|
155
|
+
if (idx >= 0 && candidateSplitPos > lastSplitPosition) {
|
|
156
|
+
splitPosition = candidateSplitPos;
|
|
157
|
+
break;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
if (splitPosition === -1 || splitPosition <= lastChunkEndPosition) splitPosition = currentMd.length;
|
|
161
|
+
yield* flushChunk(splitPosition, true);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
yield* flushChunk();
|
|
166
|
+
}
|
|
167
|
+
function htmlToMarkdownSplitChunks(html, options = {}) {
|
|
168
|
+
const opts = createOptions(options);
|
|
169
|
+
const chunks = [];
|
|
170
|
+
for (const chunk of htmlToMarkdownSplitChunksStream(html, options)) chunks.push(chunk);
|
|
171
|
+
if (opts.returnEachLine && chunks.length > 0) {
|
|
172
|
+
const lineChunks = [];
|
|
173
|
+
for (const chunk of chunks) {
|
|
174
|
+
const lines = chunk.content.split("\n");
|
|
175
|
+
const chunkStartLine = chunk.metadata.loc?.lines.from || 1;
|
|
176
|
+
for (let i = 0; i < lines.length; i++) {
|
|
177
|
+
const line = lines[i];
|
|
178
|
+
if (line && line.trim()) lineChunks.push({
|
|
179
|
+
content: line,
|
|
180
|
+
metadata: {
|
|
181
|
+
...chunk.metadata,
|
|
182
|
+
loc: { lines: {
|
|
183
|
+
from: chunkStartLine + i,
|
|
184
|
+
to: chunkStartLine + i
|
|
185
|
+
} }
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
return lineChunks;
|
|
191
|
+
}
|
|
192
|
+
return chunks;
|
|
193
|
+
}
|
|
194
|
+
export { htmlToMarkdownSplitChunks, htmlToMarkdownSplitChunksStream };
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mdream/js",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "2.0.0-beta.1",
|
|
5
|
+
"description": "JavaScript HTML-to-Markdown engine for mdream. Escape hatch for hooks and edge runtimes.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Harlan Wilton",
|
|
8
|
+
"email": "harlan@harlanzw.com",
|
|
9
|
+
"url": "https://harlanzw.com/"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://github.com/harlan-zw/mdream",
|
|
15
|
+
"directory": "packages/js"
|
|
16
|
+
},
|
|
17
|
+
"sideEffects": false,
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.mts",
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/index.d.mts",
|
|
23
|
+
"default": "./dist/index.mjs"
|
|
24
|
+
},
|
|
25
|
+
"default": "./dist/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"./core": {
|
|
28
|
+
"types": "./dist/core.d.mts",
|
|
29
|
+
"import": {
|
|
30
|
+
"types": "./dist/core.d.mts",
|
|
31
|
+
"default": "./dist/core.mjs"
|
|
32
|
+
},
|
|
33
|
+
"default": "./dist/core.mjs"
|
|
34
|
+
},
|
|
35
|
+
"./negotiate": {
|
|
36
|
+
"types": "./dist/negotiate.d.mts",
|
|
37
|
+
"import": {
|
|
38
|
+
"types": "./dist/negotiate.d.mts",
|
|
39
|
+
"default": "./dist/negotiate.mjs"
|
|
40
|
+
},
|
|
41
|
+
"default": "./dist/negotiate.mjs"
|
|
42
|
+
},
|
|
43
|
+
"./plugins": {
|
|
44
|
+
"types": "./dist/plugins.d.mts",
|
|
45
|
+
"import": {
|
|
46
|
+
"types": "./dist/plugins.d.mts",
|
|
47
|
+
"default": "./dist/plugins.mjs"
|
|
48
|
+
},
|
|
49
|
+
"default": "./dist/plugins.mjs"
|
|
50
|
+
},
|
|
51
|
+
"./preset/minimal": {
|
|
52
|
+
"types": "./dist/preset/minimal.d.mts",
|
|
53
|
+
"import": {
|
|
54
|
+
"types": "./dist/preset/minimal.d.mts",
|
|
55
|
+
"default": "./dist/preset/minimal.mjs"
|
|
56
|
+
},
|
|
57
|
+
"default": "./dist/preset/minimal.mjs"
|
|
58
|
+
},
|
|
59
|
+
"./splitter": {
|
|
60
|
+
"types": "./dist/splitter.d.mts",
|
|
61
|
+
"import": {
|
|
62
|
+
"types": "./dist/splitter.d.mts",
|
|
63
|
+
"default": "./dist/splitter.mjs"
|
|
64
|
+
},
|
|
65
|
+
"default": "./dist/splitter.mjs"
|
|
66
|
+
},
|
|
67
|
+
"./parse": {
|
|
68
|
+
"types": "./dist/parse.d.mts",
|
|
69
|
+
"import": {
|
|
70
|
+
"types": "./dist/parse.d.mts",
|
|
71
|
+
"default": "./dist/parse.mjs"
|
|
72
|
+
},
|
|
73
|
+
"default": "./dist/parse.mjs"
|
|
74
|
+
},
|
|
75
|
+
"./llms-txt": {
|
|
76
|
+
"types": "./dist/llms-txt.d.mts",
|
|
77
|
+
"import": {
|
|
78
|
+
"types": "./dist/llms-txt.d.mts",
|
|
79
|
+
"default": "./dist/llms-txt.mjs"
|
|
80
|
+
},
|
|
81
|
+
"default": "./dist/llms-txt.mjs"
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
"main": "./dist/index.mjs",
|
|
85
|
+
"types": "./dist/index.d.mts",
|
|
86
|
+
"bin": {
|
|
87
|
+
"mdream-js": "./bin/mdream.mjs"
|
|
88
|
+
},
|
|
89
|
+
"files": [
|
|
90
|
+
"bin",
|
|
91
|
+
"dist"
|
|
92
|
+
],
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"cac": "^7.0.0",
|
|
95
|
+
"pathe": "^2.0.3"
|
|
96
|
+
},
|
|
97
|
+
"scripts": {
|
|
98
|
+
"build": "obuild",
|
|
99
|
+
"typecheck": "tsc --noEmit",
|
|
100
|
+
"dev:prepare": "obuild --stub",
|
|
101
|
+
"test:attw": "attw --pack --profile esm-only"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) EGOIST <0x142857@gmail.com> (https://github.com/egoist)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|