@histoire/plugin-a11y 0.0.0-stage → 1.0.0-beta.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/LICENSE +21 -0
- package/NOTICE +433 -0
- package/README.md +97 -2
- package/dist/build/scan.d.ts +11 -0
- package/dist/build/scan.js +85 -0
- package/dist/chunks/_histoire-a11y-axe-BL07tEuN.js +53627 -0
- package/dist/chunks/messages-KjPUArEa.js +12 -0
- package/dist/chunks/results-C0vYpcmy.js +41 -0
- package/dist/chunks/run-lct8FHuk.js +134 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +1368 -0
- package/dist/frame/highlight.d.ts +6 -0
- package/dist/frame.d.ts +2 -0
- package/dist/frame.js +211 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +44 -0
- package/dist/messages.d.ts +43 -0
- package/dist/messages.js +11 -0
- package/dist/options.d.ts +41 -0
- package/dist/options.js +22 -0
- package/dist/results.d.ts +6 -0
- package/dist/results.js +6 -0
- package/dist/scanner/policy.d.ts +11 -0
- package/dist/scanner/run.d.ts +24 -0
- package/dist/test.d.ts +13 -0
- package/dist/test.js +25 -0
- package/dist/workbench/AuditPanel.vue.d.ts +11 -0
- package/dist/workbench/FindingRow.vue.d.ts +15 -0
- package/dist/workbench/ProjectPanel.vue.d.ts +16 -0
- package/dist/workbench/VariantGroup.vue.d.ts +17 -0
- package/dist/workbench/filters.d.ts +26 -0
- package/dist/workbench/fix-summary.d.ts +33 -0
- package/dist/workbench/locate.d.ts +26 -0
- package/dist/workbench/model.d.ts +42 -0
- package/dist/workbench/project-model.d.ts +66 -0
- package/dist/workbench/project-source.d.ts +51 -0
- package/dist/workbench/sources.d.ts +40 -0
- package/dist/workbench/sources.js +62 -0
- package/package.json +170 -3
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Disposer, WorkbenchPluginApi } from '@histoire/plugin-kit';
|
|
2
|
+
import type { HistoireTarget } from '@histoire/protocol';
|
|
3
|
+
import type { AuditReport } from '../messages.js';
|
|
4
|
+
import type { NodeFinding } from './locate.js';
|
|
5
|
+
/** Observable audit state for one exact actor. */
|
|
6
|
+
export interface AuditState {
|
|
7
|
+
/** Latest successful report. */
|
|
8
|
+
report?: AuditReport;
|
|
9
|
+
/** Report owning private highlight handles. */
|
|
10
|
+
reportId?: number;
|
|
11
|
+
/** Active scan. */
|
|
12
|
+
running: boolean;
|
|
13
|
+
/** Report may no longer describe current DOM. */
|
|
14
|
+
stale: boolean;
|
|
15
|
+
/** Scan failure, without discarding prior report. */
|
|
16
|
+
error?: string;
|
|
17
|
+
/** Highlight feedback. */
|
|
18
|
+
feedback?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Maintain isolated reports, preferences and channel visits for one extension host. */
|
|
21
|
+
export declare function createAuditModel(api: WorkbenchPluginApi): {
|
|
22
|
+
autoRun: () => boolean;
|
|
23
|
+
preferences: import("@histoire/plugin-kit").PluginPreferences;
|
|
24
|
+
/** Current result belonging to exact frame key. */
|
|
25
|
+
get: (key: string) => AuditState | undefined;
|
|
26
|
+
/** Observe visit; final observer closes it and automatic scanning. */
|
|
27
|
+
watch(key: string, listener: () => void): Disposer;
|
|
28
|
+
/** Request one scan without enabling automatic work. */
|
|
29
|
+
run(key: string): void;
|
|
30
|
+
/** Highlight exact node from latest successful report. */
|
|
31
|
+
highlight(key: string, node: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Highlight an element reported elsewhere (project run, build report) in the variant's
|
|
34
|
+
* frame. Needs the inspector tab to hold that frame's visit; checks it again first when its
|
|
35
|
+
* live report is missing or outdated, then highlights the matching live element.
|
|
36
|
+
* @param target Variant of the finding.
|
|
37
|
+
* @param finding Element to highlight.
|
|
38
|
+
*/
|
|
39
|
+
locate(target: HistoireTarget, finding: NodeFinding): Promise<void>;
|
|
40
|
+
};
|
|
41
|
+
/** Model type passed directly to plugin views. */
|
|
42
|
+
export type AuditModel = ReturnType<typeof createAuditModel>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { A11yImpact } from '../options.js';
|
|
2
|
+
import type { A11yResult } from './sources.js';
|
|
3
|
+
/** One bounded rule of a report. */
|
|
4
|
+
export type AuditRule = NonNullable<A11yResult['report']>['violations'][number];
|
|
5
|
+
/** Filters shared with the inspector tab preferences. */
|
|
6
|
+
export interface ProjectFilter {
|
|
7
|
+
/** Violations or rules needing review. */
|
|
8
|
+
outcome: 'violations' | 'incomplete';
|
|
9
|
+
/** `all`, `unknown` or one axe impact. */
|
|
10
|
+
severity: string;
|
|
11
|
+
}
|
|
12
|
+
/** Display titles of one variant. */
|
|
13
|
+
export interface VariantTitles {
|
|
14
|
+
/** Story title. */
|
|
15
|
+
story: string;
|
|
16
|
+
/** Variant title. */
|
|
17
|
+
variant: string;
|
|
18
|
+
}
|
|
19
|
+
/** Variant row of the project pane. */
|
|
20
|
+
export interface ProjectGroup extends A11yResult {
|
|
21
|
+
/** Stable row key. */
|
|
22
|
+
key: string;
|
|
23
|
+
/** Story title, falling back to its id. */
|
|
24
|
+
storyTitle: string;
|
|
25
|
+
/** Variant title, falling back to its id. */
|
|
26
|
+
variantTitle: string;
|
|
27
|
+
/** Matching rules, worst impact first. */
|
|
28
|
+
findings: AuditRule[];
|
|
29
|
+
}
|
|
30
|
+
/** Totals shown in the pane summary and badge. */
|
|
31
|
+
export interface ProjectTotals {
|
|
32
|
+
/** Variants with a report. */
|
|
33
|
+
checked: number;
|
|
34
|
+
/** Checked variants with at least one violation. */
|
|
35
|
+
affected: number;
|
|
36
|
+
/** Violating rules summed over variants. */
|
|
37
|
+
violations: number;
|
|
38
|
+
/** Variants whose check failed without a report. */
|
|
39
|
+
failed: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Most severe known impact among rules, for coloring counts; `undefined` when none is known.
|
|
43
|
+
* @param rules Rules to scan.
|
|
44
|
+
*/
|
|
45
|
+
export declare function worstImpact(rules: readonly AuditRule[]): A11yImpact | undefined;
|
|
46
|
+
/**
|
|
47
|
+
* Canvas frame header badge of a report: violation count, colored by the worst impact.
|
|
48
|
+
* `null` without violations, so clean variants stay quiet.
|
|
49
|
+
* @param report Report of the variant, if any.
|
|
50
|
+
*/
|
|
51
|
+
export declare function violationBadge(report: A11yResult['report']): {
|
|
52
|
+
text: number;
|
|
53
|
+
tone: "danger" | "warning" | "neutral";
|
|
54
|
+
label: string;
|
|
55
|
+
} | null;
|
|
56
|
+
/**
|
|
57
|
+
* Builds pane rows: variants with matching findings and variants whose check failed. Failed
|
|
58
|
+
* checks come first, then variants by worst matching impact, then by title.
|
|
59
|
+
* @param results Results of the active source.
|
|
60
|
+
* @param titles Resolves display titles; `undefined` falls back to ids.
|
|
61
|
+
* @param filter Outcome and severity filter.
|
|
62
|
+
*/
|
|
63
|
+
export declare function projectGroups(results: readonly A11yResult[], titles: (target: A11yResult['target']) => VariantTitles | undefined, filter: ProjectFilter): {
|
|
64
|
+
groups: ProjectGroup[];
|
|
65
|
+
totals: ProjectTotals;
|
|
66
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { Disposer, WorkbenchPluginApi } from '@histoire/plugin-kit';
|
|
2
|
+
import type { HistoireTarget } from '@histoire/protocol';
|
|
3
|
+
import type { A11yResult } from './sources.js';
|
|
4
|
+
/** Observable state of the project pane source. */
|
|
5
|
+
export interface ProjectSourceState {
|
|
6
|
+
/** Results of the latest run or of the build report. */
|
|
7
|
+
results: readonly A11yResult[];
|
|
8
|
+
/** `tests` while the dev server runs checks, `build` for a static report, `none` otherwise. */
|
|
9
|
+
kind: 'tests' | 'build' | 'none';
|
|
10
|
+
/** A run (or the report download) is in progress. */
|
|
11
|
+
running: boolean;
|
|
12
|
+
/** Checks can start now. */
|
|
13
|
+
canRun: boolean;
|
|
14
|
+
/** Progress of the current run, when the host reports it. */
|
|
15
|
+
progress: {
|
|
16
|
+
phase: 'queued' | 'collect' | 'run';
|
|
17
|
+
completed: number;
|
|
18
|
+
total: number;
|
|
19
|
+
} | null;
|
|
20
|
+
/** ISO time of the build report. */
|
|
21
|
+
generatedAt?: string;
|
|
22
|
+
/** Report download failure, or failure of the latest run as a whole (first line). */
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Picks the pane data source: live project test runs on the dev server, else the report the
|
|
27
|
+
* `build` option embedded into the static book. Disposed with the plugin.
|
|
28
|
+
* @param api Workbench plugin API.
|
|
29
|
+
* @param options Whether the `test` and `build` options are enabled.
|
|
30
|
+
* @param options.tests Accessibility tests are registered.
|
|
31
|
+
* @param options.report The book embeds a build report.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createProjectSource(api: WorkbenchPluginApi, options: {
|
|
34
|
+
tests: boolean;
|
|
35
|
+
report: boolean;
|
|
36
|
+
}): {
|
|
37
|
+
/** Current state; replaced on every change. */
|
|
38
|
+
get: () => ProjectSourceState;
|
|
39
|
+
/** Observe state changes. */
|
|
40
|
+
subscribe(listener: () => void): Disposer;
|
|
41
|
+
/** Run accessibility checks of every variant (with the rest of the project tests). */
|
|
42
|
+
runAll(): void;
|
|
43
|
+
};
|
|
44
|
+
/** Source type passed to the pane view. */
|
|
45
|
+
export type ProjectSource = ReturnType<typeof createProjectSource>;
|
|
46
|
+
/**
|
|
47
|
+
* Report of one variant in the source's latest results. The index is rebuilt only when the
|
|
48
|
+
* results change, since frame header badges read it for every laid-out frame.
|
|
49
|
+
* @param source Project source.
|
|
50
|
+
*/
|
|
51
|
+
export declare function createReportLookup(source: ProjectSource): (target: HistoireTarget) => A11yResult['report'];
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TestsEntry } from '@histoire/plugin-kit';
|
|
2
|
+
import type { HistoireTarget } from '@histoire/protocol';
|
|
3
|
+
import type { AuditReport } from '../messages.js';
|
|
4
|
+
/** Accessibility outcome of one variant, from a test run or a build report. */
|
|
5
|
+
export interface A11yResult {
|
|
6
|
+
/** Checked variant. */
|
|
7
|
+
target: HistoireTarget & {
|
|
8
|
+
variantId: string;
|
|
9
|
+
};
|
|
10
|
+
/** Bounded findings; absent while running or after a failed check. */
|
|
11
|
+
report?: AuditReport;
|
|
12
|
+
/** Failure that kept the check from reporting. */
|
|
13
|
+
error?: string;
|
|
14
|
+
/** Sources changed since the check. */
|
|
15
|
+
stale?: boolean;
|
|
16
|
+
/** A check of the variant is in progress. */
|
|
17
|
+
running?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/** Accessibility report embedded into static books by the `build` option. */
|
|
20
|
+
export interface A11yBuildReport {
|
|
21
|
+
/** Format version. */
|
|
22
|
+
version: 1;
|
|
23
|
+
/** ISO time the build scanned the variants. */
|
|
24
|
+
generatedAt: string;
|
|
25
|
+
/** One result per scanned variant. */
|
|
26
|
+
results: A11yResult[];
|
|
27
|
+
}
|
|
28
|
+
/** Structural check of a bounded report received from a test result or a file. */
|
|
29
|
+
export declare function isAuditReport(value: unknown): value is AuditReport;
|
|
30
|
+
/**
|
|
31
|
+
* Reads accessibility results out of project test entries: only the case registered by the
|
|
32
|
+
* `test` option counts; a failed case without data reports its first error.
|
|
33
|
+
* @param entries Entries of the host tests service.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resultsFromTests(entries: readonly TestsEntry[]): A11yResult[];
|
|
36
|
+
/**
|
|
37
|
+
* Validates a build report file; malformed content reads as `undefined`.
|
|
38
|
+
* @param value Parsed JSON.
|
|
39
|
+
*/
|
|
40
|
+
export declare function parseBuildReport(value: unknown): A11yBuildReport | undefined;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { HISTOIRE_VARIANT_ERROR_TEST_NAME } from '@histoire/shared';
|
|
2
|
+
import { A11Y_TEST_DATA_KEY, A11Y_TEST_NAME } from '../results.js';
|
|
3
|
+
/** Plain object guard. */
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return !!value && typeof value === 'object' && !Array.isArray(value);
|
|
6
|
+
}
|
|
7
|
+
/** Structural check of a bounded report received from a test result or a file. */
|
|
8
|
+
export function isAuditReport(value) {
|
|
9
|
+
if (!isRecord(value) || !Array.isArray(value.violations) || !Array.isArray(value.incomplete))
|
|
10
|
+
return false;
|
|
11
|
+
if (![value.violationsCount, value.incompleteCount].every(count => Number.isSafeInteger(count)))
|
|
12
|
+
return false;
|
|
13
|
+
// Rules render id, help, impact and node selectors; anything else is optional.
|
|
14
|
+
return [...value.violations, ...value.incomplete].every(rule => isRecord(rule) && typeof rule.id === 'string' && typeof rule.help === 'string' && Array.isArray(rule.nodes));
|
|
15
|
+
}
|
|
16
|
+
/** Variant target with a concrete variant id. */
|
|
17
|
+
function isVariantTarget(value) {
|
|
18
|
+
return isRecord(value) && typeof value.storyId === 'string' && typeof value.variantId === 'string';
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Reads accessibility results out of project test entries: only the case registered by the
|
|
22
|
+
* `test` option counts; a failed case without data reports its first error.
|
|
23
|
+
* @param entries Entries of the host tests service.
|
|
24
|
+
*/
|
|
25
|
+
export function resultsFromTests(entries) {
|
|
26
|
+
const results = [];
|
|
27
|
+
for (const entry of entries) {
|
|
28
|
+
if (!isVariantTarget(entry.target))
|
|
29
|
+
continue;
|
|
30
|
+
// A variant that broke outside its test cases (import, mount) never ran the check: report that failure.
|
|
31
|
+
const test = entry.summary?.tests.find(test => test.name === A11Y_TEST_NAME)
|
|
32
|
+
?? entry.summary?.tests.find(test => test.name === HISTOIRE_VARIANT_ERROR_TEST_NAME && test.state === 'failed');
|
|
33
|
+
// Variants without the case are not checked, unless a run is about to report them. A failure of
|
|
34
|
+
// the whole run is reported once by the source, not on every variant.
|
|
35
|
+
if (!test && !entry.running)
|
|
36
|
+
continue;
|
|
37
|
+
// Read as unknown: the deep readonly JSON type is validated structurally below.
|
|
38
|
+
const data = test?.data?.[A11Y_TEST_DATA_KEY];
|
|
39
|
+
const report = isRecord(data) && isAuditReport(data.report) ? data.report : undefined;
|
|
40
|
+
const failure = test?.state === 'failed' && !report ? test.errors[0] : undefined;
|
|
41
|
+
const error = failure === undefined ? undefined : typeof failure === 'string' ? failure : failure.message;
|
|
42
|
+
results.push({ target: entry.target, report, ...(error ? { error } : {}), stale: entry.stale, running: entry.running });
|
|
43
|
+
}
|
|
44
|
+
return results;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Validates a build report file; malformed content reads as `undefined`.
|
|
48
|
+
* @param value Parsed JSON.
|
|
49
|
+
*/
|
|
50
|
+
export function parseBuildReport(value) {
|
|
51
|
+
if (!isRecord(value) || value.version !== 1 || typeof value.generatedAt !== 'string' || !Array.isArray(value.results))
|
|
52
|
+
return;
|
|
53
|
+
for (const result of value.results) {
|
|
54
|
+
if (!isRecord(result) || !isVariantTarget(result.target))
|
|
55
|
+
return;
|
|
56
|
+
if (result.report !== undefined && !isAuditReport(result.report))
|
|
57
|
+
return;
|
|
58
|
+
if (result.error !== undefined && typeof result.error !== 'string')
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
return value;
|
|
62
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,173 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@histoire/plugin-a11y",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "1.0.0-beta.2",
|
|
5
|
+
"description": "Accessibility audits for Histoire with axe-core",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/histoire-dev/histoire.git",
|
|
10
|
+
"directory": "packages/histoire-plugin-a11y"
|
|
11
|
+
},
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"histoire-plugin"
|
|
17
|
+
],
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"default": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./client": {
|
|
24
|
+
"types": "./dist/client.d.ts",
|
|
25
|
+
"default": "./dist/client.js"
|
|
26
|
+
},
|
|
27
|
+
"./frame": {
|
|
28
|
+
"types": "./dist/frame.d.ts",
|
|
29
|
+
"default": "./dist/frame.js"
|
|
30
|
+
},
|
|
31
|
+
"./test": {
|
|
32
|
+
"types": "./dist/test.d.ts",
|
|
33
|
+
"default": "./dist/test.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"NOTICE",
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=22.12.0"
|
|
43
|
+
},
|
|
44
|
+
"peerDependencies": {
|
|
45
|
+
"playwright": ">=1.40.0",
|
|
46
|
+
"vue": "^3.5.0",
|
|
47
|
+
"@histoire/controls": "^1.0.0-beta.2",
|
|
48
|
+
"histoire": "^1.0.0-beta.2"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@histoire/controls": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"playwright": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"vue": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"axe-core": "4.14.0",
|
|
63
|
+
"@histoire/plugin-kit": "^1.0.0-beta.2",
|
|
64
|
+
"@histoire/protocol": "^1.0.0-beta.2",
|
|
65
|
+
"@histoire/shared": "^1.0.0-beta.2"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^22.10.1",
|
|
69
|
+
"@vitejs/plugin-vue": "^6.0.10",
|
|
70
|
+
"concurrently": "^9.1.0",
|
|
71
|
+
"jsdom": "^27.4.0",
|
|
72
|
+
"playwright": "^1.58.2",
|
|
73
|
+
"typescript": "npm:@typescript/typescript6@6.0.2",
|
|
74
|
+
"vite": "^8.3.5",
|
|
75
|
+
"vitest": "5.1.1",
|
|
76
|
+
"vue": "^3.5.26",
|
|
77
|
+
"vue-tsc": "^3.3.13",
|
|
78
|
+
"@histoire/controls": "1.0.0-beta.2",
|
|
79
|
+
"histoire": "1.0.0-beta.2"
|
|
80
|
+
},
|
|
81
|
+
"histoire": {
|
|
82
|
+
"marketplace": {
|
|
83
|
+
"displayName": "Accessibility",
|
|
84
|
+
"summary": "axe-core audits in the inspector, project results, and optional story tests.",
|
|
85
|
+
"category": "testing",
|
|
86
|
+
"frameworks": [],
|
|
87
|
+
"monogram": "Ax",
|
|
88
|
+
"tint": "blue",
|
|
89
|
+
"adds": [
|
|
90
|
+
{
|
|
91
|
+
"kind": "inspector-tab",
|
|
92
|
+
"contribution": "accessibility",
|
|
93
|
+
"text": "Live accessibility audits"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"kind": "rail-pane",
|
|
97
|
+
"contribution": "issues",
|
|
98
|
+
"text": "Project results with story tests or build reports"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"kind": "story-tests",
|
|
102
|
+
"text": "Optional axe-core tests per variant"
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"access": [
|
|
106
|
+
"story-frames",
|
|
107
|
+
"story-dom",
|
|
108
|
+
"filesystem",
|
|
109
|
+
"child-process"
|
|
110
|
+
],
|
|
111
|
+
"config": {
|
|
112
|
+
"import": "HstA11y",
|
|
113
|
+
"options": [
|
|
114
|
+
{
|
|
115
|
+
"key": "enabled",
|
|
116
|
+
"label": "Enable audits",
|
|
117
|
+
"type": "boolean",
|
|
118
|
+
"default": true
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"key": "devOnly",
|
|
122
|
+
"label": "Development only",
|
|
123
|
+
"type": "boolean",
|
|
124
|
+
"default": false
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
"key": "autoRun",
|
|
128
|
+
"label": "Run while inspector is open",
|
|
129
|
+
"type": "boolean",
|
|
130
|
+
"default": true
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"key": "test",
|
|
134
|
+
"label": "Run as story tests",
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"default": false
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
"key": "build",
|
|
140
|
+
"label": "Include build report",
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"default": false
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"key": "exclude",
|
|
146
|
+
"label": "Excluded selectors",
|
|
147
|
+
"type": "string-list",
|
|
148
|
+
"default": []
|
|
149
|
+
}
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"recommend": [
|
|
153
|
+
{
|
|
154
|
+
"dependency": "vitest",
|
|
155
|
+
"reason": "Vitest detected"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"missing": true,
|
|
159
|
+
"reason": "Add accessibility audits"
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"requires": {
|
|
163
|
+
"histoire": "^1.0.0-beta.1"
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"scripts": {
|
|
168
|
+
"build": "rimraf dist && vite build && vue-tsc --emitDeclarationOnly && tsc -p tsconfig.node.json",
|
|
169
|
+
"watch": "concurrently -k \"vite build --watch\" \"vue-tsc --emitDeclarationOnly --watch\" \"tsc -p tsconfig.node.json --watch\"",
|
|
170
|
+
"test": "vitest run",
|
|
171
|
+
"test:browser": "vitest run --config vitest.browser.config.ts"
|
|
172
|
+
}
|
|
6
173
|
}
|