@keroway/tdsl-wasm 1.14.0 → 1.15.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
@@ -45,7 +45,9 @@ const svg = render_svg_from_source(source, 0);
45
45
  // Render to a standalone HTML document.
46
46
  const html = render_html_from_source(source);
47
47
 
48
- // Lint / diagnostics: returns a JSON array [{severity, message, line, col}] (0-indexed).
48
+ // Lint / diagnostics: returns a JSON array [{severity, message, line, col}].
49
+ // line/col are 1-based when a source position is available; diagnostics without
50
+ // a position (e.g. unknown-lane lowering errors) report line: 0, col: 0.
49
51
  const diagnostics = JSON.parse(check_source(source));
50
52
 
51
53
  // Re-emit normalized source (2-space indent). Comments are not preserved.
@@ -60,7 +62,7 @@ const formatted = format_source(source);
60
62
  | `compile_to_ir` | `(source: string) => string` | Compile to JSON IR. Throws on compile error. |
61
63
  | `render_svg_from_source` | `(source: string, scale: number) => string` | Render SVG. `scale` = pixels-per-year; pass `0` for auto. |
62
64
  | `render_html_from_source` | `(source: string) => string` | Render a standalone HTML document. |
63
- | `check_source` | `(source: string) => string` | Diagnostics as a JSON array `[{severity, message, line, col}]`. |
65
+ | `check_source` | `(source: string) => string` | Diagnostics as a JSON array `[{severity, message, line, col}]`. `line`/`col` are 1-based when a position is available, else `0`. |
64
66
  | `format_source` | `(source: string) => string` | Re-emit normalized source from the AST. |
65
67
 
66
68
  Full TypeScript definitions ship with the package (`tdsl_wasm.d.ts`).
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@keroway/tdsl-wasm",
3
3
  "type": "module",
4
4
  "description": "WebAssembly bindings for the Timeline DSL compiler (static compile + SVG/HTML render)",
5
- "version": "1.14.0",
5
+ "version": "1.15.0",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
package/tdsl_wasm.d.ts CHANGED
@@ -5,7 +5,13 @@
5
5
  * Check TDSL source and return diagnostics as JSON.
6
6
  *
7
7
  * Returns a JSON array of diagnostic objects: `[{severity, message, line, col}]`.
8
- * `severity` is `"error"` or `"warning"`. `line`/`col` are 0-indexed.
8
+ * `severity` is `"error"` or `"warning"`.
9
+ *
10
+ * `line`/`col` are **1-based** when a source position is available (parse errors via
11
+ * `ParseError::source_location`, validation warnings via the item's `source_span`),
12
+ * matching the IR `SourceSpan` numbering used by `render_svg_from_source`'s `data-line`
13
+ * attributes. Diagnostics that carry no position (lowering errors such as unknown-lane
14
+ * references) report `line: 0, col: 0`; the WebUI treats a `0` line as non-clickable.
9
15
  *
10
16
  * **Note on `import` blocks**: `import wikidata` blocks are not resolved in the browser
11
17
  * (no network access). Unresolved imports are **silently skipped** — they produce no
package/tdsl_wasm.js CHANGED
@@ -4,7 +4,13 @@
4
4
  * Check TDSL source and return diagnostics as JSON.
5
5
  *
6
6
  * Returns a JSON array of diagnostic objects: `[{severity, message, line, col}]`.
7
- * `severity` is `"error"` or `"warning"`. `line`/`col` are 0-indexed.
7
+ * `severity` is `"error"` or `"warning"`.
8
+ *
9
+ * `line`/`col` are **1-based** when a source position is available (parse errors via
10
+ * `ParseError::source_location`, validation warnings via the item's `source_span`),
11
+ * matching the IR `SourceSpan` numbering used by `render_svg_from_source`'s `data-line`
12
+ * attributes. Diagnostics that carry no position (lowering errors such as unknown-lane
13
+ * references) report `line: 0, col: 0`; the WebUI treats a `0` line as non-clickable.
8
14
  *
9
15
  * **Note on `import` blocks**: `import wikidata` blocks are not resolved in the browser
10
16
  * (no network access). Unresolved imports are **silently skipped** — they produce no
package/tdsl_wasm_bg.wasm CHANGED
Binary file