valent-pipeline 0.2.13 → 0.2.15
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/package.json +1 -1
- package/src/commands/init.js +4 -23
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -113,32 +113,13 @@ export async function init(options = {}) {
|
|
|
113
113
|
? uiProjectTypes.includes(config.project?.type || 'fullstack-web')
|
|
114
114
|
: config.install_browser_mcp;
|
|
115
115
|
if (shouldInstallMcp) {
|
|
116
|
-
|
|
117
|
-
const mcpPackage = '@playwright/mcp';
|
|
118
|
-
console.log(` Installing ${mcpPackage}...`);
|
|
116
|
+
console.log(' Registering playwright MCP server...');
|
|
119
117
|
const { execSync } = await import('child_process');
|
|
120
118
|
try {
|
|
121
|
-
execSync(
|
|
122
|
-
console.log(
|
|
119
|
+
execSync('claude mcp add --scope project playwright -- npx -y @playwright/mcp', { cwd: projectRoot, stdio: 'pipe' });
|
|
120
|
+
console.log(' Registered playwright MCP server (project scope)');
|
|
123
121
|
} catch (err) {
|
|
124
|
-
console.warn(
|
|
125
|
-
}
|
|
126
|
-
// Register in .claude/settings.json mcpServers
|
|
127
|
-
const mcpSettingsPath = join(projectRoot, '.claude', 'settings.json');
|
|
128
|
-
let mcpSettings = {};
|
|
129
|
-
if (fileExists(mcpSettingsPath)) {
|
|
130
|
-
try {
|
|
131
|
-
mcpSettings = JSON.parse(readFileSync(mcpSettingsPath, 'utf-8'));
|
|
132
|
-
} catch { /* start fresh if parse fails */ }
|
|
133
|
-
}
|
|
134
|
-
if (!mcpSettings.mcpServers) mcpSettings.mcpServers = {};
|
|
135
|
-
if (!mcpSettings.mcpServers[mcpName]) {
|
|
136
|
-
mcpSettings.mcpServers[mcpName] = {
|
|
137
|
-
command: 'npx',
|
|
138
|
-
args: [mcpPackage]
|
|
139
|
-
};
|
|
140
|
-
writeFileSafe(mcpSettingsPath, JSON.stringify(mcpSettings, null, 2) + '\n');
|
|
141
|
-
console.log(` Registered ${mcpName} in .claude/settings.json`);
|
|
122
|
+
console.warn(' Warning: Failed to register playwright MCP. Run "claude mcp add --scope project playwright -- npx -y @playwright/mcp" manually.');
|
|
142
123
|
}
|
|
143
124
|
}
|
|
144
125
|
|