html-validate 8.26.0 → 8.27.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.
@@ -9,10 +9,10 @@ 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';
12
13
  import '@html-validate/stylish';
13
14
  import 'semver';
14
15
  import './core-nodejs.js';
15
- import 'node:fs';
16
16
  import 'node:module';
17
17
  import 'glob';
18
18
  import 'prompts';
package/dist/es/index.js CHANGED
@@ -10,9 +10,9 @@ import 'ajv';
10
10
  import './elements.js';
11
11
  import '@sidvind/better-ajv-errors';
12
12
  import './utils/natural-join.js';
13
- import 'fs';
14
13
  import '@html-validate/stylish';
15
14
  import 'semver';
15
+ import 'fs';
16
16
  import 'glob';
17
17
  import 'prompts';
18
18
  //# sourceMappingURL=index.js.map
package/dist/es/jest.js CHANGED
@@ -8,12 +8,11 @@ import './elements.js';
8
8
  import './meta-helper.js';
9
9
  import './utils/natural-join.js';
10
10
  import '@sidvind/better-ajv-errors';
11
- import 'fs';
11
+ import 'node:fs';
12
12
  import 'kleur';
13
13
  import '@html-validate/stylish';
14
14
  import 'semver';
15
15
  import './core-nodejs.js';
16
- import 'node:fs';
17
16
  import 'node:path';
18
17
  import 'node:module';
19
18
  import 'jest-snapshot';
@@ -1 +1 @@
1
- {"version":3,"file":"jest.js","sources":["../../src/jest/jest.ts"],"sourcesContent":["import \"./augmentation\";\n\nimport {\n\ttoBeValid,\n\ttoBeInvalid,\n\ttoHTMLValidate,\n\ttoHaveError,\n\ttoHaveErrors,\n\ttoMatchCodeframe,\n\ttoMatchInlineCodeframe,\n} from \"./matchers\";\nimport { diff } from \"./utils\";\n\nexpect.extend({\n\ttoBeValid: toBeValid(),\n\ttoBeInvalid: toBeInvalid(),\n\ttoHTMLValidate: toHTMLValidate(expect, diff),\n\ttoHaveError: toHaveError(expect, diff),\n\ttoHaveErrors: toHaveErrors(expect, diff),\n\ttoMatchCodeframe: toMatchCodeframe(),\n\ttoMatchInlineCodeframe: toMatchInlineCodeframe(),\n});\n"],"names":["toBeValid","toBeInvalid","toHTMLValidate","toHaveError","toHaveErrors","toMatchCodeframe","toMatchInlineCodeframe"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAaA,MAAA,CAAO,MAAO,CAAA;AAAA,EACb,WAAWA,aAAU,EAAA;AAAA,EACrB,aAAaC,eAAY,EAAA;AAAA,EACzB,cAAA,EAAgBC,eAAe,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EAC3C,WAAA,EAAaC,eAAY,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EACrC,YAAA,EAAcC,eAAa,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EACvC,kBAAkBC,eAAiB,EAAA;AAAA,EACnC,wBAAwBC,eAAuB;AAChD,CAAC,CAAA"}
1
+ {"version":3,"file":"jest.js","sources":["../../src/jest/jest.ts"],"sourcesContent":["import \"./augmentation\";\n\nimport {\n\ttoBeValid,\n\ttoBeInvalid,\n\ttoHTMLValidate,\n\ttoHaveError,\n\ttoHaveErrors,\n\ttoMatchCodeframe,\n\ttoMatchInlineCodeframe,\n} from \"./matchers\";\nimport { diff } from \"./utils\";\n\nexpect.extend({\n\ttoBeValid: toBeValid(),\n\ttoBeInvalid: toBeInvalid(),\n\ttoHTMLValidate: toHTMLValidate(expect, diff),\n\ttoHaveError: toHaveError(expect, diff),\n\ttoHaveErrors: toHaveErrors(expect, diff),\n\ttoMatchCodeframe: toMatchCodeframe(),\n\ttoMatchInlineCodeframe: toMatchInlineCodeframe(),\n});\n"],"names":["toBeValid","toBeInvalid","toHTMLValidate","toHaveError","toHaveErrors","toMatchCodeframe","toMatchInlineCodeframe"],"mappings":";;;;;;;;;;;;;;;;;;;;AAaA,MAAA,CAAO,MAAO,CAAA;AAAA,EACb,WAAWA,aAAU,EAAA;AAAA,EACrB,aAAaC,eAAY,EAAA;AAAA,EACzB,cAAA,EAAgBC,eAAe,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EAC3C,WAAA,EAAaC,eAAY,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EACrC,YAAA,EAAcC,eAAa,CAAA,MAAA,EAAQ,IAAI,CAAA;AAAA,EACvC,kBAAkBC,eAAiB,EAAA;AAAA,EACnC,wBAAwBC,eAAuB;AAChD,CAAC,CAAA"}
package/dist/es/vitest.js CHANGED
@@ -7,12 +7,11 @@ import './elements.js';
7
7
  import './meta-helper.js';
8
8
  import './utils/natural-join.js';
9
9
  import '@sidvind/better-ajv-errors';
10
- import 'fs';
10
+ import 'node:fs';
11
11
  import 'kleur';
12
12
  import '@html-validate/stylish';
13
13
  import 'semver';
14
14
  import './core-nodejs.js';
15
- import 'node:fs';
16
15
  import 'node:path';
17
16
  import 'node:module';
18
17
 
@@ -1 +1 @@
1
- {"version":3,"file":"vitest.js","sources":["../../src/vitest/vitest.ts"],"sourcesContent":["import \"./augmentation\";\n\nimport { expect } from \"vitest\";\nimport {\n\ttoBeValid,\n\ttoBeInvalid,\n\ttoHTMLValidate,\n\ttoHaveError,\n\ttoHaveErrors,\n} from \"../jest/matchers\";\n\nexpect.extend({\n\ttoBeValid: toBeValid(),\n\ttoBeInvalid: toBeInvalid(),\n\ttoHTMLValidate: toHTMLValidate(expect, undefined),\n\ttoHaveError: toHaveError(expect, undefined),\n\ttoHaveErrors: toHaveErrors(expect, undefined),\n});\n"],"names":["toBeValid","toBeInvalid","toHTMLValidate","toHaveError","toHaveErrors"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,MAAA,CAAO,MAAO,CAAA;AAAA,EACb,WAAWA,aAAU,EAAA;AAAA,EACrB,aAAaC,eAAY,EAAA;AAAA,EACzB,cAAA,EAAgBC,eAAe,CAAA,MAAA,EAAQ,KAAS,CAAA,CAAA;AAAA,EAChD,WAAA,EAAaC,eAAY,CAAA,MAAA,EAAQ,KAAS,CAAA,CAAA;AAAA,EAC1C,YAAA,EAAcC,eAAa,CAAA,MAAA,EAAQ,KAAS,CAAA;AAC7C,CAAC,CAAA"}
1
+ {"version":3,"file":"vitest.js","sources":["../../src/vitest/vitest.ts"],"sourcesContent":["import \"./augmentation\";\n\nimport { expect } from \"vitest\";\nimport {\n\ttoBeValid,\n\ttoBeInvalid,\n\ttoHTMLValidate,\n\ttoHaveError,\n\ttoHaveErrors,\n} from \"../jest/matchers\";\n\nexpect.extend({\n\ttoBeValid: toBeValid(),\n\ttoBeInvalid: toBeInvalid(),\n\ttoHTMLValidate: toHTMLValidate(expect, undefined),\n\ttoHaveError: toHaveError(expect, undefined),\n\ttoHaveErrors: toHaveErrors(expect, undefined),\n});\n"],"names":["toBeValid","toBeInvalid","toHTMLValidate","toHaveError","toHaveErrors"],"mappings":";;;;;;;;;;;;;;;;;AAWA,MAAA,CAAO,MAAO,CAAA;AAAA,EACb,WAAWA,aAAU,EAAA;AAAA,EACrB,aAAaC,eAAY,EAAA;AAAA,EACzB,cAAA,EAAgBC,eAAe,CAAA,MAAA,EAAQ,KAAS,CAAA,CAAA;AAAA,EAChD,WAAA,EAAaC,eAAY,CAAA,MAAA,EAAQ,KAAS,CAAA,CAAA;AAAA,EAC1C,YAAA,EAAcC,eAAa,CAAA,MAAA,EAAQ,KAAS,CAAA;AAC7C,CAAC,CAAA"}
@@ -184,7 +184,6 @@ export declare interface ConditionalEvent extends Event_2 {
184
184
  export declare class Config {
185
185
  private config;
186
186
  private configurations;
187
- private initialized;
188
187
  private resolvers;
189
188
  private metaTable;
190
189
  private plugins;
@@ -206,12 +205,8 @@ export declare class Config {
206
205
  /* Excluded from this release type: create */
207
206
  /* Excluded from this release type: __constructor */
208
207
  /**
209
- * Initialize plugins, transforms etc.
210
- *
211
- * Must be called before trying to use config. Can safely be called multiple
212
- * times.
213
- *
214
208
  * @public
209
+ * @deprecated Not needed any longer, this is a dummy noop method.
215
210
  */
216
211
  init(): void;
217
212
  /**
@@ -232,6 +227,7 @@ export declare class Config {
232
227
  /* Excluded from this release type: getRules */
233
228
  private static getRulesObject;
234
229
  /* Excluded from this release type: getPlugins */
230
+ /* Excluded from this release type: getTransformers */
235
231
  private loadPlugins;
236
232
  private loadConfigurations;
237
233
  private extendMeta;
@@ -245,31 +241,6 @@ export declare class Config {
245
241
  */
246
242
  resolve(): ResolvedConfig;
247
243
  /* Excluded from this release type: resolveData */
248
- private precompileTransformers;
249
- /**
250
- * Get transformation function requested by configuration.
251
- *
252
- * Searches:
253
- *
254
- * - Named transformers from plugins.
255
- * - Unnamed transformer from plugin.
256
- * - Standalone modules (local or node_modules)
257
- *
258
- * @param name - Key from configuration
259
- */
260
- private getTransformFunction;
261
- /**
262
- * @param name - Original name from configuration
263
- * @param pluginName - Name of plugin
264
- * @param key - Name of transform (from plugin)
265
- */
266
- private getNamedTransformerFromPlugin;
267
- /**
268
- * @param name - Original name from configuration
269
- * @param plugin - Plugin instance
270
- */
271
- private getUnnamedTransformerFromPlugin;
272
- private getTransformerFromModule;
273
244
  }
274
245
 
275
246
  /**
@@ -365,6 +336,7 @@ export declare abstract class ConfigLoader {
365
336
  * @param configOverride - Optional configuration to merge final results with.
366
337
  */
367
338
  abstract getConfigFor(handle: string, configOverride?: ConfigData): ResolvedConfig;
339
+ /* Excluded from this release type: getResolvers */
368
340
  /**
369
341
  * Flush configuration cache.
370
342
  *
@@ -2055,6 +2027,7 @@ export declare class ResolvedConfig {
2055
2027
  private plugins;
2056
2028
  private rules;
2057
2029
  private transformers;
2030
+ private cache;
2058
2031
  /** The original data this resolved configuration was created from */
2059
2032
  private original;
2060
2033
  /* Excluded from this release type: __constructor */
@@ -2066,28 +2039,12 @@ export declare class ResolvedConfig {
2066
2039
  getMetaTable(): MetaTable;
2067
2040
  getPlugins(): Plugin_2[];
2068
2041
  getRules(): Map<string, [Severity, RuleOptions]>;
2069
- /**
2070
- * Transform a source.
2071
- *
2072
- * When transforming zero or more new sources will be generated.
2073
- *
2074
- * @param source - Current source to transform.
2075
- * @param filename - If set it is the filename used to match
2076
- * transformer. Default is to use filename from source.
2077
- * @returns A list of transformed sources ready for validation.
2078
- */
2079
- transformSource(source: Source, filename?: string): Source[];
2080
- /**
2081
- * Wrapper around [[transformSource]] which reads a file before passing it
2082
- * as-is to transformSource.
2083
- *
2084
- * @param filename - Filename to transform (according to configured
2085
- * transformations)
2086
- * @returns A list of transformed sources ready for validation.
2087
- */
2088
- transformFilename(filename: string): Source[];
2042
+ /* Excluded from this release type: transformSource */
2043
+ /* Excluded from this release type: transformFilename */
2089
2044
  /**
2090
2045
  * Returns true if a transformer matches given filename.
2046
+ *
2047
+ * @public
2091
2048
  */
2092
2049
  canTransform(filename: string): boolean;
2093
2050
  private findTransformer;
@@ -2736,7 +2693,6 @@ export { Transformer_2 as Transformer }
2736
2693
  export declare interface TransformerEntry {
2737
2694
  pattern: RegExp;
2738
2695
  name: string;
2739
- fn: Transformer_2;
2740
2696
  }
2741
2697
 
2742
2698
  /**
@@ -282,7 +282,6 @@ export declare interface ConditionalEvent extends Event_2 {
282
282
  export declare class Config {
283
283
  private config;
284
284
  private configurations;
285
- private initialized;
286
285
  private resolvers;
287
286
  private metaTable;
288
287
  private plugins;
@@ -304,12 +303,8 @@ export declare class Config {
304
303
  /* Excluded from this release type: create */
305
304
  /* Excluded from this release type: __constructor */
306
305
  /**
307
- * Initialize plugins, transforms etc.
308
- *
309
- * Must be called before trying to use config. Can safely be called multiple
310
- * times.
311
- *
312
306
  * @public
307
+ * @deprecated Not needed any longer, this is a dummy noop method.
313
308
  */
314
309
  init(): void;
315
310
  /**
@@ -330,6 +325,7 @@ export declare class Config {
330
325
  /* Excluded from this release type: getRules */
331
326
  private static getRulesObject;
332
327
  /* Excluded from this release type: getPlugins */
328
+ /* Excluded from this release type: getTransformers */
333
329
  private loadPlugins;
334
330
  private loadConfigurations;
335
331
  private extendMeta;
@@ -343,31 +339,6 @@ export declare class Config {
343
339
  */
344
340
  resolve(): ResolvedConfig;
345
341
  /* Excluded from this release type: resolveData */
346
- private precompileTransformers;
347
- /**
348
- * Get transformation function requested by configuration.
349
- *
350
- * Searches:
351
- *
352
- * - Named transformers from plugins.
353
- * - Unnamed transformer from plugin.
354
- * - Standalone modules (local or node_modules)
355
- *
356
- * @param name - Key from configuration
357
- */
358
- private getTransformFunction;
359
- /**
360
- * @param name - Original name from configuration
361
- * @param pluginName - Name of plugin
362
- * @param key - Name of transform (from plugin)
363
- */
364
- private getNamedTransformerFromPlugin;
365
- /**
366
- * @param name - Original name from configuration
367
- * @param plugin - Plugin instance
368
- */
369
- private getUnnamedTransformerFromPlugin;
370
- private getTransformerFromModule;
371
342
  }
372
343
 
373
344
  /**
@@ -463,6 +434,7 @@ export declare abstract class ConfigLoader {
463
434
  * @param configOverride - Optional configuration to merge final results with.
464
435
  */
465
436
  abstract getConfigFor(handle: string, configOverride?: ConfigData): ResolvedConfig;
437
+ /* Excluded from this release type: getResolvers */
466
438
  /**
467
439
  * Flush configuration cache.
468
440
  *
@@ -2307,6 +2279,7 @@ export declare class ResolvedConfig {
2307
2279
  private plugins;
2308
2280
  private rules;
2309
2281
  private transformers;
2282
+ private cache;
2310
2283
  /** The original data this resolved configuration was created from */
2311
2284
  private original;
2312
2285
  /* Excluded from this release type: __constructor */
@@ -2318,28 +2291,12 @@ export declare class ResolvedConfig {
2318
2291
  getMetaTable(): MetaTable;
2319
2292
  getPlugins(): Plugin_2[];
2320
2293
  getRules(): Map<string, [Severity, RuleOptions]>;
2321
- /**
2322
- * Transform a source.
2323
- *
2324
- * When transforming zero or more new sources will be generated.
2325
- *
2326
- * @param source - Current source to transform.
2327
- * @param filename - If set it is the filename used to match
2328
- * transformer. Default is to use filename from source.
2329
- * @returns A list of transformed sources ready for validation.
2330
- */
2331
- transformSource(source: Source, filename?: string): Source[];
2332
- /**
2333
- * Wrapper around [[transformSource]] which reads a file before passing it
2334
- * as-is to transformSource.
2335
- *
2336
- * @param filename - Filename to transform (according to configured
2337
- * transformations)
2338
- * @returns A list of transformed sources ready for validation.
2339
- */
2340
- transformFilename(filename: string): Source[];
2294
+ /* Excluded from this release type: transformSource */
2295
+ /* Excluded from this release type: transformFilename */
2341
2296
  /**
2342
2297
  * Returns true if a transformer matches given filename.
2298
+ *
2299
+ * @public
2343
2300
  */
2344
2301
  canTransform(filename: string): boolean;
2345
2302
  private findTransformer;
@@ -2988,7 +2945,6 @@ export { Transformer_2 as Transformer }
2988
2945
  export declare interface TransformerEntry {
2989
2946
  pattern: RegExp;
2990
2947
  name: string;
2991
- fn: Transformer_2;
2992
2948
  }
2993
2949
 
2994
2950
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "html-validate",
3
- "version": "8.26.0",
3
+ "version": "8.27.0",
4
4
  "description": "Offline html5 validator",
5
5
  "keywords": [
6
6
  "html",