Skip to content

Commit d89741a

Browse files
committed
feat(plugin-axe): add plugin scaffolding
1 parent 9876d94 commit d89741a

File tree

10 files changed

+164
-0
lines changed

10 files changed

+164
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import tseslint from 'typescript-eslint';
2+
import baseConfig from '../../eslint.config.js';
3+
4+
export default tseslint.config(...baseConfig, {
5+
files: ['**/*.ts'],
6+
languageOptions: {
7+
parserOptions: {
8+
projectService: true,
9+
tsconfigRootDir: import.meta.dirname,
10+
},
11+
},
12+
});

packages/plugin-axe/package.json

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"name": "@code-pushup/axe-plugin",
3+
"version": "0.84.0",
4+
"license": "MIT",
5+
"description": "Code PushUp plugin for detecting accessibility issues using Axe 🌐",
6+
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/plugin-axe#readme",
7+
"bugs": {
8+
"url": "https://github.com/code-pushup/cli/issues?q=is%3Aissue%20state%3Aopen%20type%3ABug%20label%3A%22🧩%20axe-plugin%22"
9+
},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/code-pushup/cli.git",
13+
"directory": "packages/plugin-axe"
14+
},
15+
"keywords": [
16+
"CLI",
17+
"Code PushUp",
18+
"plugin",
19+
"axe",
20+
"axe-core",
21+
"accessibility",
22+
"a11y",
23+
"WCAG",
24+
"compliance",
25+
"testing",
26+
"quality",
27+
"automation",
28+
"runtime analysis",
29+
"audit",
30+
"score monitoring",
31+
"developer tools",
32+
"conformance",
33+
"KPI tracking",
34+
"tech debt",
35+
"automated feedback",
36+
"regression guard",
37+
"actionable feedback"
38+
],
39+
"publishConfig": {
40+
"access": "public"
41+
},
42+
"type": "module",
43+
"dependencies": {
44+
"@axe-core/playwright": "^4.11.0",
45+
"@code-pushup/models": "0.84.0",
46+
"@code-pushup/utils": "0.84.0",
47+
"axe-core": "^4.11.0",
48+
"zod": "^4.1.12"
49+
},
50+
"peerDependencies": {
51+
"playwright-core": "^1.56.1"
52+
},
53+
"files": [
54+
"src",
55+
"!**/*.tsbuildinfo"
56+
]
57+
}

packages/plugin-axe/project.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "plugin-axe",
3+
"$schema": "../../node_modules/nx/schemas/project-schema.json",
4+
"sourceRoot": "packages/plugin-axe/src",
5+
"projectType": "library",
6+
"tags": ["scope:plugin", "type:feature", "publishable"],
7+
"// targets": "to see all targets run: nx show project plugin-axe --web",
8+
"targets": {
9+
"build": {},
10+
"lint": {},
11+
"unit-test": {}
12+
}
13+
}

packages/plugin-axe/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/axe-plugin.js';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export function axePlugin(): string {
2+
return 'plugin-axe';
3+
}

packages/plugin-axe/tsconfig.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"extends": "../../tsconfig.base.json",
3+
"compilerOptions": {
4+
"module": "ESNext",
5+
"forceConsistentCasingInFileNames": true,
6+
"strict": true,
7+
"importHelpers": true,
8+
"noImplicitOverride": true,
9+
"noImplicitReturns": true,
10+
"noFallthroughCasesInSwitch": true,
11+
"noPropertyAccessFromIndexSignature": true,
12+
"types": ["vitest"]
13+
},
14+
"files": [],
15+
"include": [],
16+
"references": [
17+
{
18+
"path": "./tsconfig.lib.json"
19+
},
20+
{
21+
"path": "./tsconfig.test.json"
22+
}
23+
]
24+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"declaration": true,
6+
"types": ["node"]
7+
},
8+
"include": ["src/**/*.ts"],
9+
"exclude": ["vitest.unit.config.ts", "src/**/*.test.ts"]
10+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../dist/out-tsc",
5+
"types": [
6+
"vitest/globals",
7+
"vitest/importMeta",
8+
"vite/client",
9+
"node",
10+
"vitest"
11+
]
12+
},
13+
"include": ["vitest.unit.config.ts", "src/**/*.test.ts"]
14+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/// <reference types="vitest" />
2+
import { defineConfig } from 'vitest/config';
3+
import { tsconfigPathAliases } from '../../tools/vitest-tsconfig-path-aliases.js';
4+
5+
export default defineConfig({
6+
cacheDir: '../../node_modules/.vite/plugin-axe',
7+
test: {
8+
reporters: ['basic'],
9+
globals: true,
10+
cache: {
11+
dir: '../../node_modules/.vitest',
12+
},
13+
alias: tsconfigPathAliases(),
14+
pool: 'threads',
15+
poolOptions: { threads: { singleThread: true } },
16+
coverage: {
17+
reporter: ['text', 'lcov'],
18+
reportsDirectory: '../../coverage/plugin-axe/unit-tests',
19+
exclude: ['mocks/**', '**/types.ts'],
20+
},
21+
environment: 'node',
22+
include: ['src/**/*.unit.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
23+
globalSetup: ['../../global-setup.ts'],
24+
setupFiles: [
25+
'../../testing/test-setup/src/lib/console.mock.ts',
26+
'../../testing/test-setup/src/lib/reset.mocks.ts',
27+
],
28+
},
29+
});

tsconfig.base.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"allowSyntheticDefaultImports": true,
2121
"verbatimModuleSyntax": true,
2222
"paths": {
23+
"@code-pushup/axe-plugin": ["packages/plugin-axe/src/index.ts"],
2324
"@code-pushup/ci": ["packages/ci/src/index.ts"],
2425
"@code-pushup/cli": ["packages/cli/src/index.ts"],
2526
"@code-pushup/core": ["packages/core/src/index.ts"],

0 commit comments

Comments
 (0)