@jxsuite/parser 1.5.6 → 1.6.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # `@jxsuite/parser`
2
2
 
3
- > Content & Markdown extension for Jx — file-based content collections with Markdown and CSV formats.
3
+ > Content & Markdown extension for Jx: file-based content collections with Markdown and CSV formats.
4
4
 
5
5
  ## Overview
6
6
 
@@ -23,7 +23,7 @@ Built on the [`unified`](https://unifiedjs.com/) / remark ecosystem.
23
23
  bun add @jxsuite/parser
24
24
  ```
25
25
 
26
- Registration is manifest-based — add the package to `project.json`:
26
+ Registration is manifest-based. Add the package to `project.json`:
27
27
 
28
28
  ```json
29
29
  {
@@ -31,7 +31,7 @@ Registration is manifest-based — add the package to `project.json`:
31
31
  }
32
32
  ```
33
33
 
34
- That one entry registers the `.md`/`.csv` formats, the `content` project section, and the classes: `$prototype: "ContentEntry"` (etc.) resolves by name through the project's extension registry — no `$src` or imports wiring. There are no implicit defaults: a project without the extension supports only `.json` documents.
34
+ That one entry registers the `.md`/`.csv` formats, the `content` project section, and the classes: `$prototype: "ContentEntry"` (etc.) resolves by name through the project's extension registry, with no `$src` or imports wiring. There are no implicit defaults: a project without the extension supports only `.json` documents.
35
35
 
36
36
  ## Content collections
37
37
 
@@ -79,10 +79,10 @@ Query them from any page or component:
79
79
 
80
80
  One class carries every format capability:
81
81
 
82
- - **static `parse`** — Jx Markdown source → Jx document (browser-safe; Studio opens `.md` files with it)
83
- - **static `serialize`** — Jx document → markdown, `roundtrip` (lossless, default) or `export` (lossy clean markdown)
84
- - **static `discover` / `load`** — compile-time content access: frontmatter → `data`, source preserved as `body`, parsed `$children`, and `_meta` (excerpt, toc, reading time, word count)
85
- - **instance `resolve`** — runtime on-demand access for a `$prototype: "Markdown"` state entry
82
+ - **static `parse`**: Jx Markdown source → Jx document (browser-safe; Studio opens `.md` files with it)
83
+ - **static `serialize`**: Jx document → markdown, `roundtrip` (lossless, default) or `export` (lossy clean markdown)
84
+ - **static `discover` / `load`** give compile-time content access: frontmatter → `data`, source preserved as `body`, parsed `$children`, and `_meta` (excerpt, toc, reading time, word count)
85
+ - **instance `resolve`**: runtime on-demand access for a `$prototype: "Markdown"` state entry
86
86
 
87
87
  ```json
88
88
  {
@@ -107,7 +107,7 @@ One class carries every format capability:
107
107
 
108
108
  ### Directives
109
109
 
110
- `:::name{attrs}` container syntax converts directly to Jx element nodes — `:::my-card{title="Hello"}` becomes a `my-card` element with its attributes routed to the right Jx locations (props, `$`-annotations, styles). Capitalized directives (e.g. `:::Array`) become tagName-less `$prototype` nodes. A content type's `$elements` list declares which components its entries may use.
110
+ `:::name{attrs}` container syntax converts directly to Jx element nodes. `:::my-card{title="Hello"}` becomes a `my-card` element with its attributes routed to the right Jx locations (props, `$`-annotations, styles). Capitalized directives (e.g. `:::Array`) become tagName-less `$prototype` nodes. A content type's `$elements` list declares which components its entries may use.
111
111
 
112
112
  ## `Csv`
113
113
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jxsuite/parser",
3
- "version": "1.5.6",
3
+ "version": "1.6.0",
4
4
  "description": "Jx markdown parser and external class integration",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,11 +45,11 @@
45
45
  "build:metafile": "bun build src/content.ts src/content-loader.ts src/markdown.ts src/csv.ts src/serialize.ts --outdir=dist --format=esm --target=node --metafile=metafile.json",
46
46
  "test": "bun test --isolate",
47
47
  "test:coverage": "bun test --isolate --coverage",
48
- "upgrade": "bunx npm-check-updates -u && bun install"
48
+ "upgrade": "bun update --latest && bun install"
49
49
  },
50
50
  "dependencies": {
51
- "@jxsuite/markup": "^0.4.7",
52
- "@jxsuite/schema": "^1.9.0",
51
+ "@jxsuite/markup": "^0.4.8",
52
+ "@jxsuite/schema": "^2.0.0",
53
53
  "@shikijs/langs": "^4.4.3",
54
54
  "@shikijs/themes": "^4.4.3",
55
55
  "glob": "^13.0.6",
@@ -66,8 +66,8 @@
66
66
  "yaml": "^2.9.0"
67
67
  },
68
68
  "devDependencies": {
69
- "@happy-dom/global-registrator": "^20.11.6",
70
- "@jxsuite/runtime": "^2.1.0",
69
+ "@happy-dom/global-registrator": "^20.11.8",
70
+ "@jxsuite/runtime": "^3.0.0",
71
71
  "@types/mdast": "^4.0.4",
72
72
  "ajv": "^8.20.0"
73
73
  },
package/src/serialize.ts CHANGED
@@ -4,7 +4,8 @@
4
4
  * The single Jx → markdown serializer, replacing the studio's md-convert and the
5
5
  * compiler's compile-markdown. Two modes over a shared tag map:
6
6
  *
7
- * - `roundtrip` (default) — lossless: YAML frontmatter from non-children doc keys,
7
+ * - `roundtrip` (default) — lossless for everything it can express (a `tagName` chosen at render
8
+ * time cannot be, and throws): YAML frontmatter from non-children doc keys,
8
9
  * non-markdown elements emitted as remark directives with collapsed dot-path
9
10
  * attributes. Inverse of `transpileJxMarkdown()`.
10
11
  * - `export` — lossy: strips all Jx decoration, unwraps wrapper tags, inlines custom
@@ -191,7 +192,7 @@ function codeLang(codeChild: JxElement | undefined): string | null {
191
192
  // ─── Options ────────────────────────────────────────────────────────────────
192
193
 
193
194
  export interface SerializeOptions {
194
- /** `roundtrip` (lossless, default) or `export` (lossy clean markdown). */
195
+ /** `roundtrip` (default; lossless where expressible) or `export` (lossy clean markdown). */
195
196
  mode?: "roundtrip" | "export";
196
197
  /** Export mode: component definitions for inlining custom elements. */
197
198
  componentDefs?: Map<string, JxElement>;