@iyulab/m3l-napi 0.10.1 → 0.12.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.
Files changed (3) hide show
  1. package/index.d.ts +22 -0
  2. package/index.js +6 -5
  3. package/package.json +5 -5
package/index.d.ts CHANGED
@@ -25,3 +25,25 @@ export function parseMulti(filesJson: string): string;
25
25
  * @returns JSON string with `{ success: boolean, data?: ValidateResult, error?: string }`
26
26
  */
27
27
  export function validate(content: string, optionsJson: string): string;
28
+
29
+ /**
30
+ * Validate a multi-file M3L model and return diagnostics as JSON.
31
+ *
32
+ * The validation counterpart of `parseMulti`: cross-file constructs (inheritance, interface
33
+ * references, a custom `::attribute` registered in another file) only resolve when the whole
34
+ * file set is validated as one unit. Each diagnostic carries its own `file`.
35
+ *
36
+ * @param filesJson - JSON array of `{ content: string, filename: string }` objects
37
+ * @param optionsJson - JSON options `{ strict?: boolean }`
38
+ * @returns JSON string with `{ success: boolean, data?: ValidateResult, error?: string }`
39
+ */
40
+ export function validateMulti(filesJson: string, optionsJson: string): string;
41
+
42
+ /**
43
+ * Lint M3L content and return diagnostics as JSON.
44
+ *
45
+ * @param content - M3L markdown text
46
+ * @param configJson - JSON config `{ rules?: Record<string, "off"|"warn"|"error"> }`
47
+ * @returns JSON string with `{ success: boolean, data?: LintResult, error?: string }`
48
+ */
49
+ export function lint(content: string, configJson: string): string;
package/index.js CHANGED
@@ -116,8 +116,9 @@ if (!nativeBinding) {
116
116
  throw new Error('Failed to load native binding');
117
117
  }
118
118
 
119
- const { parse, parseMulti, validate } = nativeBinding;
120
-
121
- module.exports.parse = parse;
122
- module.exports.parseMulti = parseMulti;
123
- module.exports.validate = validate;
119
+ // Re-exported wholesale rather than named one by one. This file says it is generated, but it
120
+ // is checked in and maintained by hand, and the enumerated tail fell behind the addon twice:
121
+ // `lint` was never reachable from npm at all, and `validateMulti` shipped in the binary with
122
+ // no way to call it. The binary's export table is the contract; restating it here could only
123
+ // ever lose entries, never gain them.
124
+ module.exports = nativeBinding;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iyulab/m3l-napi",
3
- "version": "0.10.1",
3
+ "version": "0.12.0",
4
4
  "description": "M3L parser Node.js native addon via napi-rs",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -19,10 +19,10 @@
19
19
  "index.d.ts"
20
20
  ],
21
21
  "optionalDependencies": {
22
- "@iyulab/m3l-napi-win32-x64-msvc": "0.9.0",
23
- "@iyulab/m3l-napi-linux-x64-gnu": "0.9.0",
24
- "@iyulab/m3l-napi-darwin-x64": "0.9.0",
25
- "@iyulab/m3l-napi-darwin-arm64": "0.9.0"
22
+ "@iyulab/m3l-napi-win32-x64-msvc": "0.12.0",
23
+ "@iyulab/m3l-napi-linux-x64-gnu": "0.12.0",
24
+ "@iyulab/m3l-napi-darwin-x64": "0.12.0",
25
+ "@iyulab/m3l-napi-darwin-arm64": "0.12.0"
26
26
  },
27
27
  "repository": {
28
28
  "type": "git",