claude-playwright
Version:
Seamless integration between Claude Code and Playwright MCP for efficient browser automation and testing
79 lines • 2.76 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.promptForOptions = promptForOptions;
exports.validateProjectName = validateProjectName;
const inquirer_1 = __importDefault(require("inquirer"));
const chalk_1 = __importDefault(require("chalk"));
const path_1 = __importDefault(require("path"));
const fs_extra_1 = __importDefault(require("fs-extra"));
async function promptForOptions() {
console.log(chalk_1.default.blue('\n<� Claude-Playwright Project Setup\n'));
const answers = await inquirer_1.default.prompt([
{
type: 'input',
name: 'name',
message: 'Project name:',
default: path_1.default.basename(process.cwd()),
validate: (input) => {
if (/^[a-z0-9-]+$/.test(input))
return true;
return 'Project name must be lowercase with hyphens only';
}
},
{
type: 'list',
name: 'template',
message: 'Select template:',
choices: [
{
name: '=� Minimal - Quick start with basic setup',
value: 'minimal'
},
{
name: '<� Enterprise - Full featured with CI/CD pipeline',
value: 'enterprise'
},
{
name: '>� Testing - Test focused with advanced utilities',
value: 'testing'
}
],
default: 'minimal'
},
{
type: 'confirm',
name: 'installDeps',
message: 'Install dependencies now?',
default: true
},
{
type: 'confirm',
name: 'configureMCP',
message: 'Configure MCP for Claude Code?',
default: true
}
]);
return answers;
}
async function validateProjectName(name) {
const projectPath = path_1.default.resolve(name);
if (await fs_extra_1.default.pathExists(projectPath)) {
const files = await fs_extra_1.default.readdir(projectPath);
if (files.length > 0) {
const { overwrite } = await inquirer_1.default.prompt([
{
type: 'confirm',
name: 'overwrite',
message: `Directory "${name}" is not empty. Continue anyway?`,
default: false
}
]);
return overwrite;
}
}
return true;
}
//# sourceMappingURL=init-interactive.js.map
;