html-validate 7.14.0 → 7.15.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.
Files changed (58) hide show
  1. package/browser.d.ts +1 -0
  2. package/browser.js +1 -0
  3. package/dist/cjs/browser.d.ts +1 -4
  4. package/dist/cjs/browser.js +13 -1
  5. package/dist/cjs/browser.js.map +1 -1
  6. package/dist/cjs/cli.js +5 -5
  7. package/dist/cjs/cli.js.map +1 -1
  8. package/dist/cjs/core.js +159 -117
  9. package/dist/cjs/core.js.map +1 -1
  10. package/dist/cjs/elements.js +1 -1
  11. package/dist/cjs/html-validate.js +1 -1
  12. package/dist/cjs/index.d.ts +1 -89
  13. package/dist/cjs/index.js +13 -1
  14. package/dist/cjs/index.js.map +1 -1
  15. package/dist/cjs/jest-lib.js +17 -12
  16. package/dist/cjs/jest-lib.js.map +1 -1
  17. package/dist/cjs/jest.d.ts +1 -42
  18. package/dist/cjs/jest.js.map +1 -1
  19. package/dist/cjs/meta-helper.js +3 -0
  20. package/dist/cjs/meta-helper.js.map +1 -1
  21. package/dist/cjs/rules-helper.js +3 -3
  22. package/dist/cjs/rules-helper.js.map +1 -1
  23. package/dist/cjs/test-utils.d.ts +1 -30
  24. package/dist/cjs/test-utils.js +3 -0
  25. package/dist/cjs/test-utils.js.map +1 -1
  26. package/dist/cjs/tsdoc-metadata.json +11 -0
  27. package/dist/es/browser.d.ts +1 -4
  28. package/dist/es/browser.js +2 -2
  29. package/dist/es/cli.js +4 -4
  30. package/dist/es/cli.js.map +1 -1
  31. package/dist/es/core.js +138 -100
  32. package/dist/es/core.js.map +1 -1
  33. package/dist/es/elements.js +1 -1
  34. package/dist/es/html-validate.js +2 -2
  35. package/dist/es/index.d.ts +1 -89
  36. package/dist/es/index.js +2 -2
  37. package/dist/es/jest-lib.js +18 -13
  38. package/dist/es/jest-lib.js.map +1 -1
  39. package/dist/es/jest.d.ts +1 -42
  40. package/dist/es/jest.js.map +1 -1
  41. package/dist/es/meta-helper.js +3 -0
  42. package/dist/es/meta-helper.js.map +1 -1
  43. package/dist/es/rules-helper.js +4 -4
  44. package/dist/es/rules-helper.js.map +1 -1
  45. package/dist/es/test-utils.d.ts +1 -30
  46. package/dist/es/test-utils.js +3 -0
  47. package/dist/es/test-utils.js.map +1 -1
  48. package/dist/{es/core.d.ts → types/browser.d.ts} +2312 -2615
  49. package/dist/{cjs/core.d.ts → types/index.d.ts} +2505 -2615
  50. package/dist/types/jest.d.ts +44 -0
  51. package/dist/types/test-utils.d.ts +817 -0
  52. package/jest.d.ts +1 -2
  53. package/package.json +33 -27
  54. package/test-utils.d.ts +1 -2
  55. package/dist/cjs/meta-helper.d.ts +0 -28
  56. package/dist/cjs/rules-helper.d.ts +0 -54
  57. package/dist/es/meta-helper.d.ts +0 -28
  58. package/dist/es/rules-helper.d.ts +0 -54
package/jest.d.ts CHANGED
@@ -1,2 +1 @@
1
- /* eslint-disable-next-line import/export, import/no-unresolved */
2
- export * from "./dist/cjs/jest";
1
+ export * from "./dist/types/jest";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-validate",
3
- "version": "7.14.0",
3
+ "version": "7.15.0",
4
4
  "description": "Offline html5 validator",
5
5
  "keywords": [
6
6
  "html",
@@ -25,19 +25,29 @@
25
25
  "exports": {
26
26
  ".": {
27
27
  "require": "./dist/cjs/index.js",
28
- "import": "./dist/es/index.js"
28
+ "import": "./dist/es/index.js",
29
+ "types": "./dist/types/index.d.ts"
29
30
  },
30
31
  "./browser": {
31
32
  "require": "./dist/cjs/browser.js",
32
- "import": "./dist/es/browser.js"
33
+ "import": "./dist/es/browser.js",
34
+ "types": "./dist/types/browser.d.ts"
33
35
  },
34
36
  "./dist/cjs/*": "./dist/cjs/*",
35
37
  "./dist/es/*": "./dist/es/*",
36
38
  "./dist/schema/*": "./dist/schema/*",
37
39
  "./elements/*": "./elements/*",
38
- "./jest": "./jest.js",
40
+ "./jest": {
41
+ "require": "./dist/cjs/jest.js",
42
+ "import": "./dist/es/jest.js",
43
+ "types": "./dist/types/jest.d.ts"
44
+ },
39
45
  "./package.json": "./package.json",
40
- "./test-utils": "./test-utils.js"
46
+ "./test-utils": {
47
+ "require": "./dist/cjs/test-utils.js",
48
+ "import": "./dist/es/test-utils.js",
49
+ "types": "./dist/types/test-utils.d.ts"
50
+ }
41
51
  },
42
52
  "main": "dist/cjs/index.js",
43
53
  "module": "dist/es/index.js",
@@ -51,23 +61,19 @@
51
61
  "elements",
52
62
  "browser.{js,d.ts}",
53
63
  "jest.{js,d.ts}",
54
- "test-utils.{js,d.ts}",
55
- "!dist/types/**",
56
- "!tsconfig.json",
57
- "!**/*.snap",
58
- "!**/*.spec.{js,ts,d.ts}"
64
+ "test-utils.{js,d.ts}"
59
65
  ],
60
66
  "workspaces": [
61
67
  "docs"
62
68
  ],
63
69
  "scripts": {
64
70
  "prebuild": "run-s codegen prebuild:*",
65
- "build": "run-s build:*",
71
+ "build": "run-s build:cjs build:esm build:script",
66
72
  "postbuild": "bash scripts/pkg",
67
73
  "prebuild:tsc": "tsc",
68
74
  "build:cjs": "rollup --config rollup.cjs.config.mjs",
69
- "build:dts": "rollup --config rollup.dts.config.mjs",
70
75
  "build:esm": "rollup --config rollup.esm.config.mjs",
76
+ "build:script": "node build.mjs",
71
77
  "clean": "rm -rf dist public",
72
78
  "codegen": "node scripts/codegen",
73
79
  "compatibility": "scripts/compatibility.sh",
@@ -165,43 +171,43 @@
165
171
  "semver": "^7.0.0"
166
172
  },
167
173
  "devDependencies": {
168
- "@html-validate/commitlint-config": "3.0.12",
169
- "@html-validate/eslint-config": "5.6.0",
170
- "@html-validate/eslint-config-jest": "5.6.0",
171
- "@html-validate/eslint-config-typescript": "5.6.0",
172
- "@html-validate/eslint-config-typescript-typeinfo": "5.6.0",
174
+ "@html-validate/commitlint-config": "3.0.13",
175
+ "@html-validate/eslint-config": "5.7.3",
176
+ "@html-validate/eslint-config-jest": "5.7.0",
177
+ "@html-validate/eslint-config-typescript": "5.7.3",
178
+ "@html-validate/eslint-config-typescript-typeinfo": "5.7.0",
173
179
  "@html-validate/jest-config": "3.6.3",
174
- "@html-validate/prettier-config": "2.3.8",
180
+ "@html-validate/prettier-config": "2.3.9",
175
181
  "@html-validate/release-scripts": "4.0.6",
182
+ "@microsoft/api-extractor": "7.34.4",
176
183
  "@rollup/plugin-json": "6.0.0",
177
- "@rollup/plugin-node-resolve": "15.0.1",
184
+ "@rollup/plugin-node-resolve": "15.0.2",
178
185
  "@rollup/plugin-replace": "5.0.2",
179
- "@rollup/plugin-typescript": "11.0.0",
186
+ "@rollup/plugin-typescript": "11.1.0",
180
187
  "@rollup/plugin-virtual": "3.0.1",
181
188
  "@types/babar": "0.2.1",
182
189
  "@types/babel__code-frame": "7.0.3",
183
190
  "@types/estree": "1.0.0",
184
191
  "@types/jest": "29.5.0",
185
192
  "@types/minimist": "1.2.2",
186
- "@types/node": "14.18.40",
187
- "@types/prompts": "2.4.3",
193
+ "@types/node": "14.18.42",
194
+ "@types/prompts": "2.4.4",
188
195
  "@types/semver": "7.3.13",
189
196
  "@types/stream-buffers": "3.0.4",
190
197
  "babar": "0.2.3",
191
198
  "husky": "8.0.3",
199
+ "is-ci": "3.0.1",
192
200
  "jest": "29.5.0",
193
201
  "jest-diff": "29.5.0",
194
202
  "jest-environment-jsdom": "29.5.0",
195
203
  "jest-snapshot": "29.5.0",
196
- "memfs": "3.4.13",
204
+ "memfs": "3.5.0",
197
205
  "npm-pkg-lint": "1.11.2",
198
206
  "npm-run-all": "4.1.5",
199
207
  "rollup": "3.20.2",
200
- "rollup-plugin-copy": "3.4.0",
201
- "rollup-plugin-dts": "5.3.0",
202
208
  "stream-buffers": "3.0.2",
203
- "ts-jest": "29.0.5",
204
- "typescript": "5.0.2"
209
+ "ts-jest": "29.1.0",
210
+ "typescript": "5.0.4"
205
211
  },
206
212
  "peerDependencies": {
207
213
  "jest": "^25.1 || ^26 || ^27.1 || ^28.1.3 || ^29.0.3",
package/test-utils.d.ts CHANGED
@@ -1,2 +1 @@
1
- /* eslint-disable-next-line import/export, import/no-unresolved */
2
- export * from "./dist/cjs/test-utils";
1
+ export * from "./dist/types/test-utils";
@@ -1,28 +0,0 @@
1
- import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
2
- import './rules-helper.js';
3
-
4
- /**
5
- * Helper function to assist IDE with completion and type-checking.
6
- *
7
- * @public
8
- */
9
- declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
10
-
11
- /**
12
- * Helpers when writing element metadata.
13
- *
14
- * @public
15
- */
16
- interface MetadataHelper {
17
- /** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
18
- allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
19
- /** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
20
- allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
21
- /** Returns an error if another attribute does not have one of the listed values */
22
- allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
23
- defaultValue?: string | null;
24
- }): MetaAttributeAllowedCallback;
25
- }
26
- declare const metadataHelper: MetadataHelper;
27
-
28
- export { defineMetadata as d, metadataHelper as m };
@@ -1,54 +0,0 @@
1
- import { f as HtmlElement } from './core.js';
2
-
3
- interface IncludeExcludeOptions {
4
- include: string[] | null;
5
- exclude: string[] | null;
6
- }
7
- /**
8
- * @public
9
- */
10
- declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
11
-
12
- declare const HTML_CACHE_KEY: unique symbol;
13
- declare const A11Y_CACHE_KEY: unique symbol;
14
- declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
15
- declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
16
- /**
17
- * @public
18
- */
19
- declare enum TextClassification {
20
- EMPTY_TEXT = 0,
21
- DYNAMIC_TEXT = 1,
22
- STATIC_TEXT = 2
23
- }
24
- /**
25
- * @public
26
- */
27
- interface TextClassificationOptions {
28
- /** If `true` only accessible text is considered (default false) */
29
- accessible?: boolean;
30
- /** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
31
- * (and parents) elements (default false) */
32
- ignoreHiddenRoot?: boolean;
33
- }
34
- declare module "../../dom/cache" {
35
- interface DOMNodeCache {
36
- [HTML_CACHE_KEY]: TextClassification;
37
- [A11Y_CACHE_KEY]: TextClassification;
38
- [IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
39
- [IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
40
- }
41
- }
42
- /**
43
- * Checks text content of an element.
44
- *
45
- * Any text is considered including text from descendant elements. Whitespace is
46
- * ignored.
47
- *
48
- * If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
49
- *
50
- * @public
51
- */
52
- declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
53
-
54
- export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };
@@ -1,28 +0,0 @@
1
- import { k as MetaDataTable, n as MetaAttributeAllowedCallback } from './core.js';
2
- import './rules-helper.js';
3
-
4
- /**
5
- * Helper function to assist IDE with completion and type-checking.
6
- *
7
- * @public
8
- */
9
- declare function defineMetadata(metatable: MetaDataTable): MetaDataTable;
10
-
11
- /**
12
- * Helpers when writing element metadata.
13
- *
14
- * @public
15
- */
16
- interface MetadataHelper {
17
- /** Returns an error if another attribute is omitted, i.e. it requires another attribute to be present to pass. */
18
- allowedIfAttributeIsPresent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
19
- /** Returns an error if another attribute is present, i.e. it requires another attribute to be omitted to pass. */
20
- allowedIfAttributeIsAbsent(this: void, ...attr: string[]): MetaAttributeAllowedCallback;
21
- /** Returns an error if another attribute does not have one of the listed values */
22
- allowedIfAttributeHasValue(this: void, attr: string, value: string[], options?: {
23
- defaultValue?: string | null;
24
- }): MetaAttributeAllowedCallback;
25
- }
26
- declare const metadataHelper: MetadataHelper;
27
-
28
- export { defineMetadata as d, metadataHelper as m };
@@ -1,54 +0,0 @@
1
- import { f as HtmlElement } from './core.js';
2
-
3
- interface IncludeExcludeOptions {
4
- include: string[] | null;
5
- exclude: string[] | null;
6
- }
7
- /**
8
- * @public
9
- */
10
- declare function keywordPatternMatcher(list: string[], keyword: string): boolean;
11
-
12
- declare const HTML_CACHE_KEY: unique symbol;
13
- declare const A11Y_CACHE_KEY: unique symbol;
14
- declare const IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY: unique symbol;
15
- declare const IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY: unique symbol;
16
- /**
17
- * @public
18
- */
19
- declare enum TextClassification {
20
- EMPTY_TEXT = 0,
21
- DYNAMIC_TEXT = 1,
22
- STATIC_TEXT = 2
23
- }
24
- /**
25
- * @public
26
- */
27
- interface TextClassificationOptions {
28
- /** If `true` only accessible text is considered (default false) */
29
- accessible?: boolean;
30
- /** If `true` the `hidden` and `aria-hidden` attribute is ignored on the root
31
- * (and parents) elements (default false) */
32
- ignoreHiddenRoot?: boolean;
33
- }
34
- declare module "../../dom/cache" {
35
- interface DOMNodeCache {
36
- [HTML_CACHE_KEY]: TextClassification;
37
- [A11Y_CACHE_KEY]: TextClassification;
38
- [IGNORE_HIDDEN_ROOT_HTML_CACHE_KEY]: TextClassification;
39
- [IGNORE_HIDDEN_ROOT_A11Y_CACHE_KEY]: TextClassification;
40
- }
41
- }
42
- /**
43
- * Checks text content of an element.
44
- *
45
- * Any text is considered including text from descendant elements. Whitespace is
46
- * ignored.
47
- *
48
- * If any text is dynamic `TextClassification.DYNAMIC_TEXT` is returned.
49
- *
50
- * @public
51
- */
52
- declare function classifyNodeText(node: HtmlElement, options?: TextClassificationOptions): TextClassification;
53
-
54
- export { IncludeExcludeOptions as I, TextClassification as T, classifyNodeText as c, keywordPatternMatcher as k };