@markuplint/html-spec 3.12.0 → 4.0.0-alpha.2

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
@@ -1,4 +1,4 @@
1
- import { Cites, ElementSpec, SpecDefs } from '@markuplint/ml-spec';
1
+ import type { Cites, ElementSpec, SpecDefs } from '@markuplint/ml-spec';
2
2
 
3
3
  export { Attribute } from '@markuplint/ml-spec';
4
4
 
package/index.json CHANGED
@@ -36662,7 +36662,7 @@
36662
36662
  {
36663
36663
  "name": "dialog",
36664
36664
  "cite": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog",
36665
- "description": "The <dialog> HTML element represents a dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.",
36665
+ "description": "The <dialog> HTML element represents a modal or non-modal dialog box or other interactive component, such as a dismissible alert, inspector, or subwindow.",
36666
36666
  "categories": ["#flow"],
36667
36667
  "contentModel": {
36668
36668
  "contents": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@markuplint/html-spec",
3
- "version": "3.12.0",
3
+ "version": "4.0.0-alpha.2",
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": "3.12.0",
21
- "@markuplint/test-tools": "3.6.1"
20
+ "@markuplint/spec-generator": "4.0.0-alpha.2",
21
+ "@markuplint/test-tools": "4.0.0-alpha.2"
22
22
  },
23
23
  "dependencies": {
24
- "@markuplint/ml-spec": "3.12.0"
24
+ "@markuplint/ml-spec": "4.0.0-alpha.2"
25
25
  },
26
- "gitHead": "ef31aef8f2fff319d0f692feead332ec5fc5c7cf"
26
+ "gitHead": "51ad52c760435641f9bff8685707d8178b0787eb"
27
27
  }
@@ -1,33 +1,37 @@
1
- const { readFile } = require('node:fs/promises');
2
- const path = require('node:path');
1
+ import { readFile } from 'node:fs/promises';
2
+ import { createRequire } from 'node:module';
3
+ import path from 'node:path';
3
4
 
4
- const { resolveNamespace, getAttrSpecsByNames } = require('@markuplint/ml-spec');
5
- const { glob } = require('@markuplint/test-tools');
6
- const Ajv = require('ajv');
7
- const strip = require('strip-json-comments');
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
- const htmlSpec = require('../index');
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('@markuplint/ml-spec/schemas/element.schema.json'),
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('@markuplint/ml-spec/schemas/aria.schema.json'),
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('@markuplint/ml-spec/schemas/content-models.schema.json'),
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('@markuplint/ml-spec/schemas/global-attributes.schema.json'),
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('@markuplint/ml-spec/schemas/attributes.schema.json'),
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
  ];