@markuplint/html-spec 4.0.0-dev.28 → 4.0.0-rc.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/LICENSE +1 -1
- package/index.json +148 -508
- package/package.json +5 -5
- package/test/structure.spec.mjs +9 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@markuplint/html-spec",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-rc.0",
|
|
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": "4.0.0-
|
|
21
|
-
"@markuplint/test-tools": "4.0.0-
|
|
20
|
+
"@markuplint/spec-generator": "4.0.0-rc.0",
|
|
21
|
+
"@markuplint/test-tools": "4.0.0-rc.0"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@markuplint/ml-spec": "4.0.0-
|
|
24
|
+
"@markuplint/ml-spec": "4.0.0-rc.0"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "3fdeb45cb69ed52b3a215a7520cea1181601443f"
|
|
27
27
|
}
|
package/test/structure.spec.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
+
import { fileURLToPath } from 'node:url';
|
|
4
5
|
|
|
5
6
|
import { resolveNamespace, getAttrSpecsByNames } from '@markuplint/ml-spec';
|
|
6
7
|
import { glob } from '@markuplint/test-tools';
|
|
@@ -10,6 +11,9 @@ import { describe, test, expect } from 'vitest';
|
|
|
10
11
|
|
|
11
12
|
import htmlSpec from '../index.js';
|
|
12
13
|
|
|
14
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
15
|
+
const __dirname = path.dirname(__filename);
|
|
16
|
+
|
|
13
17
|
const require = createRequire(import.meta.url);
|
|
14
18
|
|
|
15
19
|
const schemas = {
|
|
@@ -41,14 +45,14 @@ const schemas = {
|
|
|
41
45
|
|
|
42
46
|
test('structure', () => {
|
|
43
47
|
// eslint-disable-next-line import/no-named-as-default-member
|
|
44
|
-
htmlSpec.specs
|
|
48
|
+
for (const el of htmlSpec.specs) {
|
|
45
49
|
const { localName, namespaceURI } = resolveNamespace(el.name);
|
|
46
50
|
try {
|
|
47
51
|
getAttrSpecsByNames(localName, namespaceURI, htmlSpec);
|
|
48
|
-
} catch
|
|
52
|
+
} catch {
|
|
49
53
|
throw el;
|
|
50
54
|
}
|
|
51
|
-
}
|
|
55
|
+
}
|
|
52
56
|
});
|
|
53
57
|
|
|
54
58
|
describe('schema', () => {
|
|
@@ -65,7 +69,7 @@ describe('schema', () => {
|
|
|
65
69
|
schemas.types,
|
|
66
70
|
],
|
|
67
71
|
}).getSchema(schemas.element.$id),
|
|
68
|
-
|
|
72
|
+
|
|
69
73
|
path.resolve(__dirname, 'spec.*.json'),
|
|
70
74
|
],
|
|
71
75
|
[
|
|
@@ -73,7 +77,7 @@ describe('schema', () => {
|
|
|
73
77
|
new Ajv({
|
|
74
78
|
schemas: [schemas.globalAttributes, schemas.attributes, schemas.types],
|
|
75
79
|
}).getSchema(schemas.globalAttributes.$id),
|
|
76
|
-
|
|
80
|
+
|
|
77
81
|
path.resolve(__dirname, 'spec-common.attributes.json'),
|
|
78
82
|
],
|
|
79
83
|
];
|