@markuplint/ml-core 5.1.1 → 5.3.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/lib/test/index.js CHANGED
@@ -13,13 +13,22 @@ import { MLDocument } from '../ml-dom/node/document.js';
13
13
  * @returns A parsed MLDocument instance
14
14
  */
15
15
  export function createTestDocument(sourceCode, options) {
16
- const ast = options?.parser
17
- ? 'parser' in options.parser
18
- ? options.parser.parser.parse(sourceCode, options.config?.parserOptions)
19
- : options.parser.parse(sourceCode, options.config?.parserOptions)
20
- : parser.parse(sourceCode, options?.config?.parserOptions);
16
+ const usedParser = options?.parser ? ('parser' in options.parser ? options.parser.parser : options.parser) : parser;
17
+ const ast = usedParser.parse(sourceCode, options?.config?.parserOptions);
21
18
  const ruleset = convertRuleset(options?.config);
22
- const document = new MLDocument(ast, ruleset, [options?.specs ?? spec, {}], { ariaVersion: ARIA_RECOMMENDED_VERSION }, options?.pretenders ? { pretenders: options.pretenders } : undefined);
19
+ const document = new MLDocument(ast, ruleset, [options?.specs ?? spec, {}], { ariaVersion: ARIA_RECOMMENDED_VERSION }, {
20
+ // The settings of the language are what the parser says, as `MLCore` hands them to the document
21
+ endTag: usedParser.endTag,
22
+ booleanish: usedParser.booleanish,
23
+ tagNameCaseSensitive: usedParser.tagNameCaseSensitive,
24
+ componentNameVariants: usedParser.componentNameVariants,
25
+ isComponentName: usedParser.isComponentName?.bind(usedParser),
26
+ // Only a parser with a list of its own (Vue) has it, as against `isComponentName` that the base class has
27
+ isNativeTag: 'isNativeTag' in usedParser ? usedParser.isNativeTag?.bind(usedParser) : undefined,
28
+ attrNameCaseSensitive: usedParser.attrNameCaseSensitive,
29
+ attrNameRoute: usedParser.attrNameRoute,
30
+ ...(options?.pretenders ? { pretenders: options.pretenders } : {}),
31
+ });
23
32
  return document;
24
33
  }
25
34
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/ml-core",
3
- "version": "5.1.1",
3
+ "version": "5.3.0",
4
4
  "description": "The core module of markuplint",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,8 +15,8 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "import": "./lib/index.js",
19
- "types": "./lib/index.d.ts"
18
+ "types": "./lib/index.d.ts",
19
+ "default": "./lib/index.js"
20
20
  }
21
21
  },
22
22
  "publishConfig": {
@@ -34,20 +34,20 @@
34
34
  "./lib/configs.js": "./lib/configs.browser.js"
35
35
  },
36
36
  "dependencies": {
37
- "@markuplint/config-presets": "5.1.1",
38
- "@markuplint/html-parser": "5.1.1",
39
- "@markuplint/html-spec": "5.1.1",
40
- "@markuplint/i18n": "5.1.1",
41
- "@markuplint/ml-ast": "5.1.1",
42
- "@markuplint/ml-config": "5.1.1",
43
- "@markuplint/ml-spec": "5.1.1",
44
- "@markuplint/parser-utils": "5.1.1",
45
- "@markuplint/selector": "5.1.1",
46
- "@markuplint/shared": "5.1.1",
47
- "@types/debug": "4.1.13",
48
- "debug": "4.4.3",
49
- "is-plain-object": "5.0.0",
50
- "type-fest": "5.6.0"
51
- },
52
- "gitHead": "a940c8526e971d590d97395ce924910221208820"
37
+ "@markuplint/config-presets": "5.3.0",
38
+ "@markuplint/html-parser": "5.3.0",
39
+ "@markuplint/html-spec": "5.3.0",
40
+ "@markuplint/i18n": "5.3.0",
41
+ "@markuplint/ml-ast": "5.3.0",
42
+ "@markuplint/ml-config": "5.3.0",
43
+ "@markuplint/ml-spec": "5.3.0",
44
+ "@markuplint/parser-utils": "5.3.0",
45
+ "@markuplint/selector": "5.3.0",
46
+ "@markuplint/shared": "5.3.0",
47
+ "@types/debug": "^4.1.13",
48
+ "debug": "^4.4.3",
49
+ "is-plain-object": "^5.1.0",
50
+ "type-fest": "^5.10.0"
51
+ },
52
+ "gitHead": "f587cf0206c8426e57369a48d6d5fb22306eafde"
53
53
  }