mcp-accessibility-scanner 1.0.4 → 1.0.6
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.
|
@@ -1,37 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -49,9 +16,8 @@ exports.scanViolations = scanViolations;
|
|
|
49
16
|
const playwright_1 = require("playwright");
|
|
50
17
|
const playwright_2 = require("@axe-core/playwright");
|
|
51
18
|
const node_path_1 = __importDefault(require("node:path"));
|
|
52
|
-
const os = __importStar(require("node:os"));
|
|
53
19
|
function scanViolations(url_1, violationsTag_1) {
|
|
54
|
-
return __awaiter(this, arguments, void 0, function* (url, violationsTag, viewport = { width: 1920, height: 1080 }, shouldRunInHeadless = true
|
|
20
|
+
return __awaiter(this, arguments, void 0, function* (url, violationsTag, viewport = { width: 1920, height: 1080 }, shouldRunInHeadless = true) {
|
|
55
21
|
var _a;
|
|
56
22
|
const browser = yield playwright_1.chromium.launch({
|
|
57
23
|
headless: shouldRunInHeadless,
|
|
@@ -170,7 +136,7 @@ function scanViolations(url_1, violationsTag_1) {
|
|
|
170
136
|
});
|
|
171
137
|
}
|
|
172
138
|
}
|
|
173
|
-
const filePath = node_path_1.default.join(
|
|
139
|
+
const filePath = node_path_1.default.join(node_path_1.default.join(__dirname, '..'), `a11y-report-${Date.now()}.png`);
|
|
174
140
|
const screenshot = yield page.screenshot({
|
|
175
141
|
path: filePath,
|
|
176
142
|
fullPage: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcp-accessibility-scanner",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "A Model Context Protocol (MCP) server for performing automated accessibility scans of web pages using Playwright and Axe-core",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@axe-core/playwright": "^4.10.1",
|
|
23
|
-
"@modelcontextprotocol/sdk": "^1.4.1"
|
|
23
|
+
"@modelcontextprotocol/sdk": "^1.4.1",
|
|
24
|
+
"@playwright/test": "^1.52.0"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@playwright/test": "^1.52.0",
|
|
27
27
|
"@types/node": "^22.10.7",
|
|
28
28
|
"ts-node": "^10.9.2",
|
|
29
29
|
"typescript": "^5.5.3"
|