@markuplint/ml-core 4.4.0 → 4.4.1-dev.1
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.d.ts +9 -6
- package/lib/test/index.js +2 -2
- package/package.json +11 -11
package/lib/test/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { MLElement } from '../ml-dom/node/element.js';
|
|
2
|
+
import type { MLNode } from '../ml-dom/node/node.js';
|
|
3
|
+
import type { MLToken } from '../ml-dom/token/token.js';
|
|
4
|
+
import type { MLASTNode, MLASTToken, MLParser } from '@markuplint/ml-ast';
|
|
2
5
|
import type { Config, PlainData, RuleConfigValue } from '@markuplint/ml-config';
|
|
3
6
|
import type { ExtendedSpec, MLMLSpec } from '@markuplint/ml-spec';
|
|
4
|
-
import {
|
|
7
|
+
import { MLDocument } from '../ml-dom/node/document.js';
|
|
5
8
|
export type CreateTestOptions = {
|
|
6
9
|
readonly config?: Config;
|
|
7
10
|
readonly parser?: {
|
|
@@ -9,10 +12,10 @@ export type CreateTestOptions = {
|
|
|
9
12
|
} | Readonly<MLParser>;
|
|
10
13
|
readonly specs?: MLMLSpec;
|
|
11
14
|
};
|
|
12
|
-
export declare function createTestDocument<T extends RuleConfigValue = any, O extends PlainData = any>(sourceCode: string, options?: CreateTestOptions):
|
|
13
|
-
export declare function createTestNodeList(sourceCode: string, options?: CreateTestOptions): readonly
|
|
14
|
-
export declare function createTestTokenList(sourceCode: string, options?: CreateTestOptions): readonly
|
|
15
|
-
export declare function createTestElement(sourceCode: string, options?: CreateTestOptions):
|
|
15
|
+
export declare function createTestDocument<T extends RuleConfigValue = any, O extends PlainData = any>(sourceCode: string, options?: CreateTestOptions): MLDocument<T, O>;
|
|
16
|
+
export declare function createTestNodeList(sourceCode: string, options?: CreateTestOptions): readonly MLNode<any, any, MLASTNode>[];
|
|
17
|
+
export declare function createTestTokenList(sourceCode: string, options?: CreateTestOptions): readonly MLToken<MLASTToken>[];
|
|
18
|
+
export declare function createTestElement(sourceCode: string, options?: CreateTestOptions): MLElement<any, any>;
|
|
16
19
|
/**
|
|
17
20
|
* for test suite
|
|
18
21
|
*/
|
package/lib/test/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { parser } from '@markuplint/html-parser';
|
|
2
2
|
import spec from '@markuplint/html-spec';
|
|
3
3
|
import { convertRuleset } from '../convert-ruleset.js';
|
|
4
|
-
import {
|
|
4
|
+
import { MLDocument } from '../ml-dom/node/document.js';
|
|
5
5
|
export function createTestDocument(sourceCode, options) {
|
|
6
6
|
const ast = options?.parser
|
|
7
7
|
? 'parser' in options.parser
|
|
@@ -9,7 +9,7 @@ export function createTestDocument(sourceCode, options) {
|
|
|
9
9
|
: options.parser.parse(sourceCode, options.config?.parserOptions)
|
|
10
10
|
: parser.parse(sourceCode, options?.config?.parserOptions);
|
|
11
11
|
const ruleset = convertRuleset(options?.config);
|
|
12
|
-
const document = new
|
|
12
|
+
const document = new MLDocument(ast, ruleset, [options?.specs ?? {}, {}]);
|
|
13
13
|
return document;
|
|
14
14
|
}
|
|
15
15
|
export function createTestNodeList(sourceCode, options) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/ml-core",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1-dev.1+98cb4470a",
|
|
4
4
|
"description": "The core module of markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -28,19 +28,19 @@
|
|
|
28
28
|
"./lib/configs.js": "./lib/configs.browser.js"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@markuplint/config-presets": "4.2.
|
|
32
|
-
"@markuplint/html-parser": "4.3.
|
|
33
|
-
"@markuplint/html-spec": "4.4.
|
|
34
|
-
"@markuplint/i18n": "4.2.
|
|
35
|
-
"@markuplint/ml-ast": "4.1.
|
|
36
|
-
"@markuplint/ml-config": "4.3.
|
|
37
|
-
"@markuplint/ml-spec": "4.2.
|
|
38
|
-
"@markuplint/parser-utils": "4.3.
|
|
39
|
-
"@markuplint/selector": "4.3.
|
|
31
|
+
"@markuplint/config-presets": "4.2.1-dev.1+98cb4470a",
|
|
32
|
+
"@markuplint/html-parser": "4.3.1-dev.1+98cb4470a",
|
|
33
|
+
"@markuplint/html-spec": "4.4.1-dev.1+98cb4470a",
|
|
34
|
+
"@markuplint/i18n": "4.2.1-dev.1+98cb4470a",
|
|
35
|
+
"@markuplint/ml-ast": "4.1.1-dev.1+98cb4470a",
|
|
36
|
+
"@markuplint/ml-config": "4.3.1-dev.1+98cb4470a",
|
|
37
|
+
"@markuplint/ml-spec": "4.2.1-dev.1+98cb4470a",
|
|
38
|
+
"@markuplint/parser-utils": "4.3.1-dev.1+98cb4470a",
|
|
39
|
+
"@markuplint/selector": "4.3.1-dev.1+98cb4470a",
|
|
40
40
|
"@types/debug": "4.1.12",
|
|
41
41
|
"debug": "4.3.4",
|
|
42
42
|
"is-plain-object": "5.0.0",
|
|
43
43
|
"type-fest": "4.14.0"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "98cb4470ad994275f52b0c3919f8d27dda8c38bc"
|
|
46
46
|
}
|