html-validate 9.3.0 → 9.4.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/dist/cjs/browser.js +1 -2
- package/dist/cjs/browser.js.map +1 -1
- package/dist/cjs/cli.js +1 -1
- package/dist/cjs/cli.js.map +1 -1
- package/dist/cjs/core-browser.js +417 -0
- package/dist/cjs/core-browser.js.map +1 -1
- package/dist/cjs/core-nodejs.js +423 -3
- package/dist/cjs/core-nodejs.js.map +1 -1
- package/dist/cjs/core.js +248 -658
- package/dist/cjs/core.js.map +1 -1
- package/dist/cjs/html-validate.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/jest-worker.js +6 -6
- package/dist/cjs/jest-worker.js.map +1 -1
- package/dist/cjs/jest.js +1 -1
- package/dist/cjs/vitest.js +2 -2
- package/dist/es/browser.js +2 -3
- package/dist/es/browser.js.map +1 -1
- package/dist/es/cli.js +2 -2
- package/dist/es/core-browser.js +418 -2
- package/dist/es/core-browser.js.map +1 -1
- package/dist/es/core-nodejs.js +422 -3
- package/dist/es/core-nodejs.js.map +1 -1
- package/dist/es/core.js +242 -657
- package/dist/es/core.js.map +1 -1
- package/dist/es/html-validate.js +2 -2
- package/dist/es/index.js +3 -3
- package/dist/es/jest-worker.js +6 -6
- package/dist/es/jest.js +1 -1
- package/dist/es/matchers-jestonly.js +1 -1
- package/dist/es/matchers.js +1 -1
- package/dist/es/vitest.js +2 -2
- package/dist/types/browser.d.ts +25 -4
- package/dist/types/index.d.ts +25 -4
- package/package.json +1 -1
package/dist/es/html-validate.js
CHANGED
|
@@ -2,17 +2,17 @@ import fs from 'fs';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import kleur from 'kleur';
|
|
4
4
|
import minimist from 'minimist';
|
|
5
|
-
import {
|
|
5
|
+
import { a2 as name, v as version, n as SchemaValidationError, o as isUserError, a3 as bugs } from './core.js';
|
|
6
6
|
import { M as Mode, m as modeToFlag, C as CLI, h as haveImportMetaResolve, I as ImportResolveMissingError, l as lint, i as init, p as printConfig, d as dump, a as handleSchemaValidationError } from './cli.js';
|
|
7
7
|
import 'ajv';
|
|
8
8
|
import './elements.js';
|
|
9
9
|
import './meta-helper.js';
|
|
10
10
|
import './utils/natural-join.js';
|
|
11
11
|
import '@sidvind/better-ajv-errors';
|
|
12
|
-
import 'node:fs';
|
|
13
12
|
import '@html-validate/stylish';
|
|
14
13
|
import 'semver';
|
|
15
14
|
import './core-nodejs.js';
|
|
15
|
+
import 'node:fs';
|
|
16
16
|
import 'node:fs/promises';
|
|
17
17
|
import 'node:module';
|
|
18
18
|
import 'node:path/posix';
|
package/dist/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { F as FileSystemConfigLoader, c as cjsResolver, a as compatibilityCheck, e as esmResolver, n as nodejsResolver } from './core-nodejs.js';
|
|
2
|
-
export { A as Attribute, C as Config, a as ConfigError, b as ConfigLoader, D as DOMNode, h as DOMTokenList, j as DOMTree, k as DynamicValue,
|
|
1
|
+
export { F as FileSystemConfigLoader, H as HtmlValidate, c as cjsResolver, a as compatibilityCheck, e as esmResolver, n as nodejsResolver } from './core-nodejs.js';
|
|
2
|
+
export { A as Attribute, C as Config, a as ConfigError, b as ConfigLoader, D as DOMNode, h as DOMTokenList, j as DOMTree, k as DynamicValue, I as EventHandler, H as HtmlElement, M as MetaCopyableProperty, q as MetaTable, m as NestedError, N as NodeClosed, l as NodeType, P as Parser, B as Reporter, R as ResolvedConfig, t as Rule, n as SchemaValidationError, S as Severity, f as StaticConfigLoader, w as TextClassification, r as TextContent, T as TextNode, U as UserError, V as Validator, W as WrappedError, u as ariaNaming, x as classifyNodeText, p as configPresets, c as defineConfig, E as definePlugin, g as formatterFactory, o as isUserError, y as keywordPatternMatcher, F as ruleExists, z as sliceLocation, s as staticResolver, v as version, G as walk } from './core.js';
|
|
3
3
|
export { C as CLI } from './cli.js';
|
|
4
4
|
export { d as defineMetadata, m as metadataHelper } from './meta-helper.js';
|
|
5
|
-
import 'node:path';
|
|
6
5
|
import 'node:fs';
|
|
6
|
+
import 'node:path';
|
|
7
7
|
import 'node:fs/promises';
|
|
8
8
|
import 'node:module';
|
|
9
9
|
import 'kleur';
|
package/dist/es/jest-worker.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { workerData, parentPort } from 'node:worker_threads';
|
|
2
|
-
import { F as FileSystemConfigLoader } from './core-nodejs.js';
|
|
3
|
-
import { H as HtmlValidate } from './core.js';
|
|
4
|
-
import 'node:path';
|
|
2
|
+
import { F as FileSystemConfigLoader, H as HtmlValidate } from './core-nodejs.js';
|
|
5
3
|
import 'node:fs';
|
|
6
|
-
import '
|
|
7
|
-
import 'node:module';
|
|
8
|
-
import 'kleur';
|
|
4
|
+
import './core.js';
|
|
9
5
|
import 'ajv';
|
|
10
6
|
import './elements.js';
|
|
11
7
|
import './meta-helper.js';
|
|
12
8
|
import './utils/natural-join.js';
|
|
13
9
|
import '@sidvind/better-ajv-errors';
|
|
10
|
+
import 'kleur';
|
|
14
11
|
import '@html-validate/stylish';
|
|
15
12
|
import 'semver';
|
|
13
|
+
import 'node:path';
|
|
14
|
+
import 'node:fs/promises';
|
|
15
|
+
import 'node:module';
|
|
16
16
|
|
|
17
17
|
function runAsWorker(fn) {
|
|
18
18
|
if (!workerData) {
|
package/dist/es/jest.js
CHANGED
|
@@ -9,12 +9,12 @@ import './elements.js';
|
|
|
9
9
|
import './meta-helper.js';
|
|
10
10
|
import './utils/natural-join.js';
|
|
11
11
|
import '@sidvind/better-ajv-errors';
|
|
12
|
-
import 'node:fs';
|
|
13
12
|
import '@html-validate/stylish';
|
|
14
13
|
import 'semver';
|
|
15
14
|
import './matcher-utils.js';
|
|
16
15
|
import 'node:worker_threads';
|
|
17
16
|
import './core-nodejs.js';
|
|
17
|
+
import 'node:fs';
|
|
18
18
|
import 'node:path';
|
|
19
19
|
import 'node:fs/promises';
|
|
20
20
|
import 'node:module';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import kleur from 'kleur';
|
|
2
2
|
import { toMatchSnapshot, toMatchInlineSnapshot } from 'jest-snapshot';
|
|
3
|
-
import {
|
|
3
|
+
import { a1 as codeframe } from './core.js';
|
|
4
4
|
import { g as getResults } from './matchers.js';
|
|
5
5
|
import { d as diverge, i as isThenable } from './matcher-utils.js';
|
|
6
6
|
|
package/dist/es/matchers.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { d as diverge, c as createSyncFn, f as flattenMessages } from './matcher-utils.js';
|
|
2
|
-
import { d as deepmerge,
|
|
2
|
+
import { d as deepmerge, a0 as workerPath } from './core.js';
|
|
3
3
|
|
|
4
4
|
function createMatcher$4() {
|
|
5
5
|
function toBeValid(report) {
|
package/dist/es/vitest.js
CHANGED
|
@@ -3,17 +3,17 @@ import { c as createMatcher, a as createMatcher$1, b as createMatcher$2, d as cr
|
|
|
3
3
|
import './matcher-utils.js';
|
|
4
4
|
import 'node:worker_threads';
|
|
5
5
|
import './core-nodejs.js';
|
|
6
|
-
import 'node:
|
|
6
|
+
import 'node:fs';
|
|
7
7
|
import './core.js';
|
|
8
8
|
import 'ajv';
|
|
9
9
|
import './elements.js';
|
|
10
10
|
import './meta-helper.js';
|
|
11
11
|
import './utils/natural-join.js';
|
|
12
12
|
import '@sidvind/better-ajv-errors';
|
|
13
|
-
import 'node:fs';
|
|
14
13
|
import 'kleur';
|
|
15
14
|
import '@html-validate/stylish';
|
|
16
15
|
import 'semver';
|
|
16
|
+
import 'node:path';
|
|
17
17
|
import 'node:fs/promises';
|
|
18
18
|
import 'node:module';
|
|
19
19
|
|
package/dist/types/browser.d.ts
CHANGED
|
@@ -1073,7 +1073,7 @@ export declare class HtmlValidate {
|
|
|
1073
1073
|
* @param filename - Filename to read and parse.
|
|
1074
1074
|
* @returns Report output.
|
|
1075
1075
|
*/
|
|
1076
|
-
validateFile(filename: string): Promise<Report_2>;
|
|
1076
|
+
validateFile(filename: string, fs: TransformFS): Promise<Report_2>;
|
|
1077
1077
|
/**
|
|
1078
1078
|
* Parse and validate HTML from file.
|
|
1079
1079
|
*
|
|
@@ -1081,7 +1081,7 @@ export declare class HtmlValidate {
|
|
|
1081
1081
|
* @param filename - Filename to read and parse.
|
|
1082
1082
|
* @returns Report output.
|
|
1083
1083
|
*/
|
|
1084
|
-
validateFileSync(filename: string): Report_2;
|
|
1084
|
+
validateFileSync(filename: string, fs: TransformFS): Report_2;
|
|
1085
1085
|
/**
|
|
1086
1086
|
* Parse and validate HTML from multiple files. Result is merged together to a
|
|
1087
1087
|
* single report.
|
|
@@ -1089,7 +1089,7 @@ export declare class HtmlValidate {
|
|
|
1089
1089
|
* @param filenames - Filenames to read and parse.
|
|
1090
1090
|
* @returns Report output.
|
|
1091
1091
|
*/
|
|
1092
|
-
validateMultipleFiles(filenames: string[]): Promise<Report_2>;
|
|
1092
|
+
validateMultipleFiles(filenames: string[], fs: TransformFS): Promise<Report_2>;
|
|
1093
1093
|
/**
|
|
1094
1094
|
* Parse and validate HTML from multiple files. Result is merged together to a
|
|
1095
1095
|
* single report.
|
|
@@ -1097,7 +1097,7 @@ export declare class HtmlValidate {
|
|
|
1097
1097
|
* @param filenames - Filenames to read and parse.
|
|
1098
1098
|
* @returns Report output.
|
|
1099
1099
|
*/
|
|
1100
|
-
validateMultipleFilesSync(filenames: string[]): Report_2;
|
|
1100
|
+
validateMultipleFilesSync(filenames: string[], fs: TransformFS): Report_2;
|
|
1101
1101
|
/**
|
|
1102
1102
|
* Returns true if the given filename can be validated.
|
|
1103
1103
|
*
|
|
@@ -2741,6 +2741,27 @@ export declare type TransformerEntry = {
|
|
|
2741
2741
|
*/
|
|
2742
2742
|
export declare type TransformerResult = Source | Iterable<Source | Promise<Source>> | Promise<Source> | Promise<Source | Iterable<Source | Promise<Source>>>;
|
|
2743
2743
|
|
|
2744
|
+
/**
|
|
2745
|
+
* File system API required by transform functions.
|
|
2746
|
+
*
|
|
2747
|
+
* Compatible with:
|
|
2748
|
+
*
|
|
2749
|
+
* - `node:fs`
|
|
2750
|
+
* - `memfs`
|
|
2751
|
+
* - and probably more.
|
|
2752
|
+
*
|
|
2753
|
+
* @public
|
|
2754
|
+
* @since 9.4.0
|
|
2755
|
+
*/
|
|
2756
|
+
export declare interface TransformFS {
|
|
2757
|
+
/** read file from filesystem */
|
|
2758
|
+
readFileSync(this: void, path: string | number, options: {
|
|
2759
|
+
encoding: "utf8";
|
|
2760
|
+
}): {
|
|
2761
|
+
toString(encoding: "utf8"): string;
|
|
2762
|
+
} | string;
|
|
2763
|
+
}
|
|
2764
|
+
|
|
2744
2765
|
/**
|
|
2745
2766
|
* @public
|
|
2746
2767
|
*/
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1306,7 +1306,7 @@ export declare class HtmlValidate {
|
|
|
1306
1306
|
* @param filename - Filename to read and parse.
|
|
1307
1307
|
* @returns Report output.
|
|
1308
1308
|
*/
|
|
1309
|
-
validateFile(filename: string): Promise<Report_2>;
|
|
1309
|
+
validateFile(filename: string, fs?: TransformFS): Promise<Report_2>;
|
|
1310
1310
|
/**
|
|
1311
1311
|
* Parse and validate HTML from file.
|
|
1312
1312
|
*
|
|
@@ -1314,7 +1314,7 @@ export declare class HtmlValidate {
|
|
|
1314
1314
|
* @param filename - Filename to read and parse.
|
|
1315
1315
|
* @returns Report output.
|
|
1316
1316
|
*/
|
|
1317
|
-
validateFileSync(filename: string): Report_2;
|
|
1317
|
+
validateFileSync(filename: string, fs?: TransformFS): Report_2;
|
|
1318
1318
|
/**
|
|
1319
1319
|
* Parse and validate HTML from multiple files. Result is merged together to a
|
|
1320
1320
|
* single report.
|
|
@@ -1322,7 +1322,7 @@ export declare class HtmlValidate {
|
|
|
1322
1322
|
* @param filenames - Filenames to read and parse.
|
|
1323
1323
|
* @returns Report output.
|
|
1324
1324
|
*/
|
|
1325
|
-
validateMultipleFiles(filenames: string[]): Promise<Report_2>;
|
|
1325
|
+
validateMultipleFiles(filenames: string[], fs?: TransformFS): Promise<Report_2>;
|
|
1326
1326
|
/**
|
|
1327
1327
|
* Parse and validate HTML from multiple files. Result is merged together to a
|
|
1328
1328
|
* single report.
|
|
@@ -1330,7 +1330,7 @@ export declare class HtmlValidate {
|
|
|
1330
1330
|
* @param filenames - Filenames to read and parse.
|
|
1331
1331
|
* @returns Report output.
|
|
1332
1332
|
*/
|
|
1333
|
-
validateMultipleFilesSync(filenames: string[]): Report_2;
|
|
1333
|
+
validateMultipleFilesSync(filenames: string[], fs?: TransformFS): Report_2;
|
|
1334
1334
|
/**
|
|
1335
1335
|
* Returns true if the given filename can be validated.
|
|
1336
1336
|
*
|
|
@@ -3006,6 +3006,27 @@ export declare type TransformerEntry = {
|
|
|
3006
3006
|
*/
|
|
3007
3007
|
export declare type TransformerResult = Source | Iterable<Source | Promise<Source>> | Promise<Source> | Promise<Source | Iterable<Source | Promise<Source>>>;
|
|
3008
3008
|
|
|
3009
|
+
/**
|
|
3010
|
+
* File system API required by transform functions.
|
|
3011
|
+
*
|
|
3012
|
+
* Compatible with:
|
|
3013
|
+
*
|
|
3014
|
+
* - `node:fs`
|
|
3015
|
+
* - `memfs`
|
|
3016
|
+
* - and probably more.
|
|
3017
|
+
*
|
|
3018
|
+
* @public
|
|
3019
|
+
* @since 9.4.0
|
|
3020
|
+
*/
|
|
3021
|
+
export declare interface TransformFS {
|
|
3022
|
+
/** read file from filesystem */
|
|
3023
|
+
readFileSync(this: void, path: string | number, options: {
|
|
3024
|
+
encoding: "utf8";
|
|
3025
|
+
}): {
|
|
3026
|
+
toString(encoding: "utf8"): string;
|
|
3027
|
+
} | string;
|
|
3028
|
+
}
|
|
3029
|
+
|
|
3009
3030
|
/**
|
|
3010
3031
|
* @public
|
|
3011
3032
|
*/
|