a11y-devkit-deploy 0.9.5 → 0.9.7
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/config/settings.json +8 -1
- package/package.json +1 -1
- package/src/cli.js +115 -52
- package/src/paths.js +1 -0
package/config/settings.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"skillsFolder": "a11y",
|
|
3
3
|
"readmeTemplate": "deploy-README.md",
|
|
4
|
+
"supportLocalMcpInstallation": false,
|
|
4
5
|
"skills": [
|
|
5
6
|
{
|
|
6
7
|
"name": "A11y Base Web Skill",
|
|
@@ -50,13 +51,15 @@
|
|
|
50
51
|
"id": "claude",
|
|
51
52
|
"displayName": "Claude Code",
|
|
52
53
|
"mcpServerKey": "servers",
|
|
54
|
+
"globalMcpServerKey": "mcpServers",
|
|
53
55
|
"skillsFolder": ".claude/skills",
|
|
54
|
-
"mcpConfigFile": ".claude
|
|
56
|
+
"mcpConfigFile": ".claude.json"
|
|
55
57
|
},
|
|
56
58
|
{
|
|
57
59
|
"id": "cursor",
|
|
58
60
|
"displayName": "Cursor",
|
|
59
61
|
"mcpServerKey": "mcpServers",
|
|
62
|
+
"globalMcpServerKey": "mcpServers",
|
|
60
63
|
"skillsFolder": ".cursor/skills",
|
|
61
64
|
"mcpConfigFile": ".cursor/mcp.json"
|
|
62
65
|
},
|
|
@@ -64,6 +67,7 @@
|
|
|
64
67
|
"id": "codex",
|
|
65
68
|
"displayName": "Codex",
|
|
66
69
|
"mcpServerKey": "mcp_servers",
|
|
70
|
+
"globalMcpServerKey": "mcp_servers",
|
|
67
71
|
"skillsFolder": ".codex/skills",
|
|
68
72
|
"mcpConfigFile": ".codex/config.toml"
|
|
69
73
|
},
|
|
@@ -71,6 +75,7 @@
|
|
|
71
75
|
"id": "vscode",
|
|
72
76
|
"displayName": "VSCode",
|
|
73
77
|
"mcpServerKey": "servers",
|
|
78
|
+
"globalMcpServerKey": "servers",
|
|
74
79
|
"skillsFolder": ".github/skills",
|
|
75
80
|
"mcpConfigFile": ".github/mcp.json",
|
|
76
81
|
"globalMcpConfigFile": "Code/User/mcp.json"
|
|
@@ -79,6 +84,7 @@
|
|
|
79
84
|
"id": "windsurf",
|
|
80
85
|
"displayName": "Windsurf",
|
|
81
86
|
"mcpServerKey": "servers",
|
|
87
|
+
"globalMcpServerKey": "servers",
|
|
82
88
|
"skillsFolder": ".codeium/windsurf/skills",
|
|
83
89
|
"mcpConfigFile": ".codeium/windsurf/mcp_config.json"
|
|
84
90
|
},
|
|
@@ -86,6 +92,7 @@
|
|
|
86
92
|
"id": "factory",
|
|
87
93
|
"displayName": "Factory",
|
|
88
94
|
"mcpServerKey": "mcpServers",
|
|
95
|
+
"globalMcpServerKey": "mcpServers",
|
|
89
96
|
"skillsFolder": ".factory/skills",
|
|
90
97
|
"mcpConfigFile": ".factory/mcp.json"
|
|
91
98
|
}
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -8,7 +8,7 @@ import kleur from "kleur";
|
|
|
8
8
|
// Use gray with italics (ANSI 90 for gray, 3 for italic, 23 to reset italic)
|
|
9
9
|
// This matches the subtitle color but with italic styling
|
|
10
10
|
const grayItalic = (text) => {
|
|
11
|
-
if (typeof text ===
|
|
11
|
+
if (typeof text === "string") {
|
|
12
12
|
return `\x1b[3m\x1b[90m${text}\x1b[39m\x1b[23m`;
|
|
13
13
|
}
|
|
14
14
|
// Return a function that applies both italic and gray
|
|
@@ -16,16 +16,27 @@ const grayItalic = (text) => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
// Replace gray with italic gray for helper text
|
|
19
|
-
Object.defineProperty(kleur,
|
|
20
|
-
get() {
|
|
21
|
-
|
|
19
|
+
Object.defineProperty(kleur, "gray", {
|
|
20
|
+
get() {
|
|
21
|
+
return grayItalic;
|
|
22
|
+
},
|
|
23
|
+
configurable: true,
|
|
22
24
|
});
|
|
23
25
|
|
|
24
26
|
import prompts from "prompts";
|
|
25
27
|
|
|
26
28
|
import { header, info, warn, success, startSpinner, formatPath } from "./ui.js";
|
|
27
|
-
import {
|
|
28
|
-
|
|
29
|
+
import {
|
|
30
|
+
getPlatform,
|
|
31
|
+
getHostApplicationPaths,
|
|
32
|
+
getTempDir,
|
|
33
|
+
getMcpRepoDir,
|
|
34
|
+
} from "./paths.js";
|
|
35
|
+
import {
|
|
36
|
+
installSkillsFromNpm,
|
|
37
|
+
uninstallSkillsFromTargets,
|
|
38
|
+
cleanupTemp,
|
|
39
|
+
} from "./installers/skills.js";
|
|
29
40
|
import { installMcpConfig, removeMcpConfig } from "./installers/mcp.js";
|
|
30
41
|
import { getGitMcpPrompts, parseArgsString } from "./prompts/git-mcp.js";
|
|
31
42
|
import { installGitMcp } from "./installers/git-mcp.js";
|
|
@@ -74,7 +85,11 @@ async function run() {
|
|
|
74
85
|
const platformInfo = getPlatform();
|
|
75
86
|
const config = await loadConfig();
|
|
76
87
|
const pkg = await loadPackageJson();
|
|
77
|
-
const hostPaths = getHostApplicationPaths(
|
|
88
|
+
const hostPaths = getHostApplicationPaths(
|
|
89
|
+
projectRoot,
|
|
90
|
+
platformInfo,
|
|
91
|
+
config.hostApplications,
|
|
92
|
+
);
|
|
78
93
|
const args = parseArgs(process.argv);
|
|
79
94
|
|
|
80
95
|
header(
|
|
@@ -99,7 +114,13 @@ async function run() {
|
|
|
99
114
|
|
|
100
115
|
// Branch to Git MCP installation flow
|
|
101
116
|
if (args.gitMcp) {
|
|
102
|
-
await runGitMcpInstallation(
|
|
117
|
+
await runGitMcpInstallation(
|
|
118
|
+
projectRoot,
|
|
119
|
+
platformInfo,
|
|
120
|
+
config,
|
|
121
|
+
hostPaths,
|
|
122
|
+
args,
|
|
123
|
+
);
|
|
103
124
|
return;
|
|
104
125
|
}
|
|
105
126
|
|
|
@@ -132,12 +153,15 @@ async function run() {
|
|
|
132
153
|
},
|
|
133
154
|
);
|
|
134
155
|
|
|
135
|
-
selectedProfile = config.profiles.find(
|
|
156
|
+
selectedProfile = config.profiles.find(
|
|
157
|
+
(p) => p.id === profileResponse.profile,
|
|
158
|
+
);
|
|
136
159
|
|
|
137
160
|
if (selectedProfile) {
|
|
138
161
|
// Filter skills based on profile
|
|
139
162
|
skillsToInstall = config.skills.filter((skill) => {
|
|
140
|
-
const skillNpmName =
|
|
163
|
+
const skillNpmName =
|
|
164
|
+
typeof skill === "string" ? skill : skill.npmName;
|
|
141
165
|
return selectedProfile.skills.includes(skillNpmName);
|
|
142
166
|
});
|
|
143
167
|
|
|
@@ -168,7 +192,7 @@ async function run() {
|
|
|
168
192
|
console.log(` ${description}`);
|
|
169
193
|
});
|
|
170
194
|
|
|
171
|
-
console.log("\nMCP Servers to install:");
|
|
195
|
+
console.log("\nMCP Servers to install: [will install globally]");
|
|
172
196
|
mcpServersToInstall.forEach((server) => {
|
|
173
197
|
const description = server.description || "No description";
|
|
174
198
|
console.log(` • ${server.name}`);
|
|
@@ -227,7 +251,7 @@ async function run() {
|
|
|
227
251
|
initial: 0,
|
|
228
252
|
},
|
|
229
253
|
{
|
|
230
|
-
type: "select",
|
|
254
|
+
type: config.supportLocalMcpInstallation ? "select" : null,
|
|
231
255
|
name: "mcpScope",
|
|
232
256
|
message: "Install MCP configs locally or globally?",
|
|
233
257
|
choices: [
|
|
@@ -240,7 +264,8 @@ async function run() {
|
|
|
240
264
|
{
|
|
241
265
|
title: "Global for this user",
|
|
242
266
|
value: "global",
|
|
243
|
-
description:
|
|
267
|
+
description:
|
|
268
|
+
"Write to user-level host application config folders",
|
|
244
269
|
},
|
|
245
270
|
],
|
|
246
271
|
initial: 0,
|
|
@@ -262,7 +287,9 @@ async function run() {
|
|
|
262
287
|
);
|
|
263
288
|
|
|
264
289
|
scope = scope || response.scope;
|
|
265
|
-
mcpScope =
|
|
290
|
+
mcpScope =
|
|
291
|
+
response.mcpScope ||
|
|
292
|
+
(config.supportLocalMcpInstallation ? "local" : "global");
|
|
266
293
|
hostSelection = response.hosts || hostSelection;
|
|
267
294
|
}
|
|
268
295
|
|
|
@@ -270,11 +297,13 @@ async function run() {
|
|
|
270
297
|
scope = "local";
|
|
271
298
|
}
|
|
272
299
|
if (!mcpScope) {
|
|
273
|
-
mcpScope = "local";
|
|
300
|
+
mcpScope = config.supportLocalMcpInstallation ? "local" : "global";
|
|
274
301
|
}
|
|
275
302
|
|
|
276
303
|
if (!hostSelection.length) {
|
|
277
|
-
warn(
|
|
304
|
+
warn(
|
|
305
|
+
"No host applications selected. MCP installation requires at least one host application.",
|
|
306
|
+
);
|
|
278
307
|
process.exit(1);
|
|
279
308
|
}
|
|
280
309
|
|
|
@@ -318,10 +347,13 @@ async function run() {
|
|
|
318
347
|
|
|
319
348
|
for (let i = 0; i < hostSelection.length; i++) {
|
|
320
349
|
const host = hostSelection[i];
|
|
350
|
+
const serverKey = mcpScope === "global"
|
|
351
|
+
? hostPaths[host].globalMcpServerKey
|
|
352
|
+
: hostPaths[host].mcpServerKey;
|
|
321
353
|
await installMcpConfig(
|
|
322
354
|
mcpConfigPaths[i],
|
|
323
355
|
mcpServersToInstall,
|
|
324
|
-
|
|
356
|
+
serverKey,
|
|
325
357
|
);
|
|
326
358
|
}
|
|
327
359
|
mcpSpinner.succeed(
|
|
@@ -353,7 +385,13 @@ async function run() {
|
|
|
353
385
|
info("Documentation: https://github.com/joe-watkins/a11y-devkit#readme");
|
|
354
386
|
}
|
|
355
387
|
|
|
356
|
-
async function runUninstall(
|
|
388
|
+
async function runUninstall(
|
|
389
|
+
projectRoot,
|
|
390
|
+
platformInfo,
|
|
391
|
+
config,
|
|
392
|
+
hostPaths,
|
|
393
|
+
args,
|
|
394
|
+
) {
|
|
357
395
|
console.log("\n");
|
|
358
396
|
info("Removing skills and MCP servers installed by this tool");
|
|
359
397
|
console.log("");
|
|
@@ -418,7 +456,7 @@ async function runUninstall(projectRoot, platformInfo, config, hostPaths, args)
|
|
|
418
456
|
});
|
|
419
457
|
}
|
|
420
458
|
|
|
421
|
-
if (removeMcp) {
|
|
459
|
+
if (removeMcp && config.supportLocalMcpInstallation) {
|
|
422
460
|
questions.push({
|
|
423
461
|
type: "select",
|
|
424
462
|
name: "mcpScope",
|
|
@@ -433,7 +471,8 @@ async function runUninstall(projectRoot, platformInfo, config, hostPaths, args)
|
|
|
433
471
|
{
|
|
434
472
|
title: "Global for this user",
|
|
435
473
|
value: "global",
|
|
436
|
-
description:
|
|
474
|
+
description:
|
|
475
|
+
"Remove from user-level host application config folders",
|
|
437
476
|
},
|
|
438
477
|
],
|
|
439
478
|
initial: 0,
|
|
@@ -465,11 +504,13 @@ async function runUninstall(projectRoot, platformInfo, config, hostPaths, args)
|
|
|
465
504
|
}
|
|
466
505
|
|
|
467
506
|
if (removeMcp && !mcpScope) {
|
|
468
|
-
mcpScope = "local";
|
|
507
|
+
mcpScope = config.supportLocalMcpInstallation ? "local" : "global";
|
|
469
508
|
}
|
|
470
509
|
|
|
471
510
|
if (!hostSelection.length) {
|
|
472
|
-
warn(
|
|
511
|
+
warn(
|
|
512
|
+
"No host applications selected. Uninstall requires at least one host application.",
|
|
513
|
+
);
|
|
473
514
|
process.exit(1);
|
|
474
515
|
}
|
|
475
516
|
|
|
@@ -518,10 +559,13 @@ async function runUninstall(projectRoot, platformInfo, config, hostPaths, args)
|
|
|
518
559
|
|
|
519
560
|
for (let i = 0; i < hostSelection.length; i++) {
|
|
520
561
|
const host = hostSelection[i];
|
|
562
|
+
const serverKey = mcpScope === "global"
|
|
563
|
+
? hostPaths[host].globalMcpServerKey
|
|
564
|
+
: hostPaths[host].mcpServerKey;
|
|
521
565
|
const result = await removeMcpConfig(
|
|
522
566
|
mcpConfigPaths[i],
|
|
523
567
|
serverNames,
|
|
524
|
-
|
|
568
|
+
serverKey,
|
|
525
569
|
);
|
|
526
570
|
removedCount += result.removed;
|
|
527
571
|
}
|
|
@@ -538,7 +582,13 @@ async function runUninstall(projectRoot, platformInfo, config, hostPaths, args)
|
|
|
538
582
|
success("Uninstall complete.");
|
|
539
583
|
}
|
|
540
584
|
|
|
541
|
-
async function runGitMcpInstallation(
|
|
585
|
+
async function runGitMcpInstallation(
|
|
586
|
+
projectRoot,
|
|
587
|
+
platformInfo,
|
|
588
|
+
config,
|
|
589
|
+
hostPaths,
|
|
590
|
+
args,
|
|
591
|
+
) {
|
|
542
592
|
// Check if --yes flag is used with --git-mcp
|
|
543
593
|
if (args.autoYes) {
|
|
544
594
|
warn("--yes flag not supported for Git MCP installation");
|
|
@@ -591,32 +641,39 @@ async function runGitMcpInstallation(projectRoot, platformInfo, config, hostPath
|
|
|
591
641
|
);
|
|
592
642
|
|
|
593
643
|
// Prompt for MCP Config Scope (where to write MCP configurations)
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
644
|
+
// Skip if local MCP installation is not supported
|
|
645
|
+
let mcpScopeResponse = {
|
|
646
|
+
mcpScope: config.supportLocalMcpInstallation ? null : "global",
|
|
647
|
+
};
|
|
648
|
+
|
|
649
|
+
if (config.supportLocalMcpInstallation) {
|
|
650
|
+
mcpScopeResponse = await prompts(
|
|
651
|
+
{
|
|
652
|
+
type: "select",
|
|
653
|
+
name: "mcpScope",
|
|
654
|
+
message: "Where to write MCP configurations?",
|
|
655
|
+
choices: [
|
|
656
|
+
{
|
|
657
|
+
title: `Local to this project (${formatPath(projectRoot)})`,
|
|
658
|
+
value: "local",
|
|
659
|
+
description: "Write to project-level IDE config folders",
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
title: "Global for this user",
|
|
663
|
+
value: "global",
|
|
664
|
+
description: "Write to user-level IDE config folders",
|
|
665
|
+
},
|
|
666
|
+
],
|
|
667
|
+
initial: 0,
|
|
668
|
+
},
|
|
669
|
+
{
|
|
670
|
+
onCancel: () => {
|
|
671
|
+
warn("Git MCP installation cancelled.");
|
|
672
|
+
process.exit(0);
|
|
609
673
|
},
|
|
610
|
-
],
|
|
611
|
-
initial: 0,
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
onCancel: () => {
|
|
615
|
-
warn("Git MCP installation cancelled.");
|
|
616
|
-
process.exit(0);
|
|
617
674
|
},
|
|
618
|
-
|
|
619
|
-
|
|
675
|
+
);
|
|
676
|
+
}
|
|
620
677
|
|
|
621
678
|
// Prompt for host application selection
|
|
622
679
|
const hostChoices = config.hostApplications.map((host) => ({
|
|
@@ -643,7 +700,9 @@ async function runGitMcpInstallation(projectRoot, platformInfo, config, hostPath
|
|
|
643
700
|
const hostSelection = hostResponse.hosts || [];
|
|
644
701
|
|
|
645
702
|
if (!hostSelection.length) {
|
|
646
|
-
warn(
|
|
703
|
+
warn(
|
|
704
|
+
"No host applications selected. MCP installation requires at least one host application.",
|
|
705
|
+
);
|
|
647
706
|
process.exit(1);
|
|
648
707
|
}
|
|
649
708
|
|
|
@@ -710,10 +769,13 @@ async function runGitMcpInstallation(projectRoot, platformInfo, config, hostPath
|
|
|
710
769
|
|
|
711
770
|
for (let i = 0; i < hostSelection.length; i++) {
|
|
712
771
|
const host = hostSelection[i];
|
|
772
|
+
const serverKey = mcpScope === "global"
|
|
773
|
+
? hostPaths[host].globalMcpServerKey
|
|
774
|
+
: hostPaths[host].mcpServerKey;
|
|
713
775
|
await installMcpConfig(
|
|
714
776
|
mcpConfigPaths[i],
|
|
715
777
|
[mcpServerConfig],
|
|
716
|
-
|
|
778
|
+
serverKey,
|
|
717
779
|
);
|
|
718
780
|
}
|
|
719
781
|
|
|
@@ -724,7 +786,9 @@ async function runGitMcpInstallation(projectRoot, platformInfo, config, hostPath
|
|
|
724
786
|
// Display success message
|
|
725
787
|
success("Git MCP installation complete!");
|
|
726
788
|
info(`Repository location: ${mcpServer.repoPath}`);
|
|
727
|
-
info(
|
|
789
|
+
info(
|
|
790
|
+
`MCP server '${mcpServer.name}' configured in ${hostSelection.length} host application(s)`,
|
|
791
|
+
);
|
|
728
792
|
console.log("");
|
|
729
793
|
success("Next Steps:");
|
|
730
794
|
info("Restart your host application to load the new MCP server");
|
|
@@ -733,4 +797,3 @@ async function runGitMcpInstallation(projectRoot, platformInfo, config, hostPath
|
|
|
733
797
|
}
|
|
734
798
|
|
|
735
799
|
export { run };
|
|
736
|
-
|
package/src/paths.js
CHANGED
|
@@ -57,6 +57,7 @@ function getHostApplicationPaths(projectRoot, platformInfo = getPlatform(), host
|
|
|
57
57
|
mcpConfig: globalMcpConfig,
|
|
58
58
|
localMcpConfig: path.join(projectRoot, mcpConfigFile),
|
|
59
59
|
mcpServerKey: host.mcpServerKey,
|
|
60
|
+
globalMcpServerKey: host.globalMcpServerKey || host.mcpServerKey,
|
|
60
61
|
skillsDir: globalSkillsDir,
|
|
61
62
|
localSkillsDir: path.join(projectRoot, skillsFolder)
|
|
62
63
|
};
|