@d-zero/a11y-check-core 0.4.0 → 0.5.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/import-scenarios.d.ts +1 -1
- package/dist/import-scenarios.js +3 -3
- package/dist/scenario-child-process.d.ts +2 -1
- package/dist/scenario-child-process.js +1 -1
- package/dist/scenario-main-process.d.ts +3 -2
- package/dist/scenario-main-process.js +8 -5
- package/dist/types.d.ts +1 -0
- package/package.json +6 -6
|
@@ -3,4 +3,4 @@ import type { Scenario } from './types.js';
|
|
|
3
3
|
*
|
|
4
4
|
* @param scenarios
|
|
5
5
|
*/
|
|
6
|
-
export declare function importScenarios(scenarios: readonly [
|
|
6
|
+
export declare function importScenarios(scenarios: readonly Scenario[]): Promise<Scenario[]>;
|
package/dist/import-scenarios.js
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @param scenarios
|
|
4
4
|
*/
|
|
5
5
|
export async function importScenarios(scenarios) {
|
|
6
|
-
return await Promise.all(scenarios.map(async (
|
|
7
|
-
const mod = await import(modulePath);
|
|
6
|
+
return await Promise.all(scenarios.map(async (scenario) => {
|
|
7
|
+
const mod = await import(scenario.modulePath);
|
|
8
8
|
const creator = mod.default;
|
|
9
|
-
const optionsValue =
|
|
9
|
+
const optionsValue = JSON.parse(scenario.moduleParams);
|
|
10
10
|
return creator(optionsValue);
|
|
11
11
|
}));
|
|
12
12
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { importScenarios } from '@d-zero/a11y-check-core';
|
|
2
1
|
import { createChildProcess } from '@d-zero/puppeteer-dealer';
|
|
3
2
|
import { beforePageScan, defaultSizes, pageScanListener, } from '@d-zero/puppeteer-page-scan';
|
|
4
3
|
import { Cache } from '@d-zero/shared/cache';
|
|
5
4
|
import c from 'ansi-colors';
|
|
5
|
+
import { importScenarios } from '@d-zero/a11y-check-core';
|
|
6
6
|
createChildProcess(async (param) => {
|
|
7
7
|
const { cacheDir } = param;
|
|
8
8
|
const cache = new Cache('a11y-check/run-puppeteer', cacheDir);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { CoreOptions, Result, ScenarioRunnerOptions } from './types.js';
|
|
1
|
+
import type { CoreOptions, Result, Scenario, ScenarioRunnerOptions } from './types.js';
|
|
2
|
+
import type { DealOptions } from '@d-zero/dealer';
|
|
2
3
|
/**
|
|
3
4
|
*
|
|
4
5
|
* @param urlList
|
|
@@ -8,4 +9,4 @@ import type { CoreOptions, Result, ScenarioRunnerOptions } from './types.js';
|
|
|
8
9
|
export declare function scenarioRunner<O>(urlList: readonly (string | {
|
|
9
10
|
id: string | null;
|
|
10
11
|
url: string;
|
|
11
|
-
})[], scenarios: readonly [
|
|
12
|
+
})[], scenarios: readonly Scenario[], options?: O & CoreOptions & ScenarioRunnerOptions & DealOptions): Promise<Result>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { importScenarios } from '@d-zero/a11y-check-core';
|
|
3
2
|
import { createProcess, deal } from '@d-zero/puppeteer-dealer';
|
|
4
3
|
import c from 'ansi-colors';
|
|
5
4
|
import { cleanResults } from './clean-results.js';
|
|
5
|
+
import { importScenarios } from '@d-zero/a11y-check-core';
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
8
8
|
* @param urlList
|
|
@@ -25,10 +25,13 @@ export async function scenarioRunner(urlList, scenarios, options) {
|
|
|
25
25
|
scenarios,
|
|
26
26
|
cacheDir: options?.cacheDir ?? '.a11y-check-core',
|
|
27
27
|
}, options);
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
}, {
|
|
29
|
+
...options,
|
|
30
|
+
each(result) {
|
|
31
|
+
needAnalysis.push(...result.needAnalysis);
|
|
32
|
+
passed.push(...result.passed);
|
|
33
|
+
violations.push(...result.violations);
|
|
34
|
+
},
|
|
32
35
|
});
|
|
33
36
|
const cleanedViolations = cleanResults(violations);
|
|
34
37
|
process.stdout.write(`📊 Found ${cleanedViolations.length} violations\n`);
|
package/dist/types.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export type ScenarioRunnerOptions = DealOptions & {
|
|
|
13
13
|
export type ScenarioCreator<O> = (options?: O) => Scenario;
|
|
14
14
|
export type Scenario = {
|
|
15
15
|
readonly modulePath: string;
|
|
16
|
+
readonly moduleParams: string;
|
|
16
17
|
readonly id: string;
|
|
17
18
|
readonly exec: ScenarioExecutor;
|
|
18
19
|
readonly analyze?: ScenarioAnalyzer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d-zero/a11y-check-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Accessibility Checker (Core Module)",
|
|
5
5
|
"author": "D-ZERO",
|
|
6
6
|
"license": "MIT",
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
"clean": "tsc --build --clean"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@d-zero/puppeteer-dealer": "0.
|
|
28
|
-
"@d-zero/shared": "0.
|
|
27
|
+
"@d-zero/puppeteer-dealer": "0.5.0",
|
|
28
|
+
"@d-zero/shared": "0.9.0",
|
|
29
29
|
"ansi-colors": "4.1.3",
|
|
30
30
|
"color-contrast-checker": "2.1.0",
|
|
31
|
-
"puppeteer": "24.
|
|
31
|
+
"puppeteer": "24.10.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@d-zero/dealer": "1.3.1",
|
|
35
|
-
"@d-zero/puppeteer-page-scan": "4.0.
|
|
35
|
+
"@d-zero/puppeteer-page-scan": "4.0.1"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "04c6969564182c36ee38ef41e78130936dfa4863"
|
|
38
38
|
}
|