@markuplint/html-spec 3.11.0 → 4.0.0-alpha.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/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/html-spec",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0-alpha.1",
|
|
4
4
|
"description": "A specification of HTML Living Standard for markuplint",
|
|
5
5
|
"repository": "git@github.com:markuplint/markuplint.git",
|
|
6
6
|
"author": "Yusuke Hirao <yusukehirao@me.com>",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
"gen:prettier": "prettier --write index.json"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"@markuplint/spec-generator": "
|
|
21
|
-
"@markuplint/test-tools": "
|
|
20
|
+
"@markuplint/spec-generator": "4.0.0-alpha.1",
|
|
21
|
+
"@markuplint/test-tools": "4.0.0-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@markuplint/ml-spec": "
|
|
24
|
+
"@markuplint/ml-spec": "4.0.0-alpha.1"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "22502ee22a378ae766033d687dbc0443e5ed35dc"
|
|
27
27
|
}
|
|
@@ -1,33 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import path from 'node:path';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
import { resolveNamespace, getAttrSpecsByNames } from '@markuplint/ml-spec';
|
|
6
|
+
import { glob } from '@markuplint/test-tools';
|
|
7
|
+
import Ajv from 'ajv';
|
|
8
|
+
import strip from 'strip-json-comments';
|
|
9
|
+
import { describe, test, expect } from 'vitest';
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
import htmlSpec from '../index.js';
|
|
12
|
+
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
10
14
|
|
|
11
15
|
const schemas = {
|
|
12
16
|
element: {
|
|
13
17
|
$id: '@markuplint/ml-spec/schemas/element.schema.json',
|
|
14
|
-
...require('
|
|
18
|
+
...require('../../ml-spec/schemas/element.schema.json'),
|
|
15
19
|
},
|
|
16
20
|
aria: {
|
|
17
21
|
$id: '@markuplint/ml-spec/schemas/aria.schema.json',
|
|
18
|
-
...require('
|
|
22
|
+
...require('../../ml-spec/schemas/aria.schema.json'),
|
|
19
23
|
},
|
|
20
24
|
contentModels: {
|
|
21
25
|
$id: '@markuplint/ml-spec/schemas/content-models.schema.json',
|
|
22
|
-
...require('
|
|
26
|
+
...require('../../ml-spec/schemas/content-models.schema.json'),
|
|
23
27
|
},
|
|
24
28
|
globalAttributes: {
|
|
25
29
|
$id: '@markuplint/ml-spec/schemas/global-attributes.schema.json',
|
|
26
|
-
...require('
|
|
30
|
+
...require('../../ml-spec/schemas/global-attributes.schema.json'),
|
|
27
31
|
},
|
|
28
32
|
attributes: {
|
|
29
33
|
$id: '@markuplint/ml-spec/schemas/attributes.schema.json',
|
|
30
|
-
...require('
|
|
34
|
+
...require('../../ml-spec/schemas/attributes.schema.json'),
|
|
31
35
|
},
|
|
32
36
|
types: {
|
|
33
37
|
$id: '@markuplint/types/types.schema.json',
|
|
@@ -36,6 +40,7 @@ const schemas = {
|
|
|
36
40
|
};
|
|
37
41
|
|
|
38
42
|
test('structure', () => {
|
|
43
|
+
// eslint-disable-next-line import/no-named-as-default-member
|
|
39
44
|
htmlSpec.specs.forEach(el => {
|
|
40
45
|
const { localName, namespaceURI } = resolveNamespace(el.name);
|
|
41
46
|
try {
|
|
@@ -60,6 +65,7 @@ describe('schema', () => {
|
|
|
60
65
|
schemas.types,
|
|
61
66
|
],
|
|
62
67
|
}).getSchema(schemas.element.$id),
|
|
68
|
+
// eslint-disable-next-line no-restricted-globals
|
|
63
69
|
path.resolve(__dirname, 'spec.*.json'),
|
|
64
70
|
],
|
|
65
71
|
[
|
|
@@ -67,6 +73,7 @@ describe('schema', () => {
|
|
|
67
73
|
new Ajv({
|
|
68
74
|
schemas: [schemas.globalAttributes, schemas.attributes, schemas.types],
|
|
69
75
|
}).getSchema(schemas.globalAttributes.$id),
|
|
76
|
+
// eslint-disable-next-line no-restricted-globals
|
|
70
77
|
path.resolve(__dirname, 'spec-common.attributes.json'),
|
|
71
78
|
],
|
|
72
79
|
];
|