/** * project-scaffolder.ts * * Creates a complete, production-standard Playwright JavaScript (Node.js) project * from scratch when Playwright Pilot AI detects an empty or uninitialised target folder. * * What "production standard" means here: * - Plain JavaScript (CommonJS) — no TypeScript compilation step required * - Multi-browser Playwright config (Chromium / Firefox / WebKit) * - HTML + JSON CI reporters * - GitHub Actions workflow for headless CI runs * - ESLint with recommended JavaScript rules * - A .gitignore that covers Playwright, Node, and PlayGen artefacts * - Fully wired page-object and test directory structure * - Pre-configured .env.example for BASE_URL * - A project README that documents the Playwright Pilot AI workflow * * Role in the overall flow: * pwpilot_save_test detects isNewCodebase=true → calls scaffoldProject() * → writes all boilerplate files → save-test continues writing POM + spec * * Files written only when they do NOT already exist, so re-running save-test * on an existing project is always safe. */ /** Summary of what the scaffolder created. */ export interface ScaffoldResult { /** Absolute path to the project root that was scaffolded. */ projectRoot: string; /** List of files that were newly written (existing files were skipped). */ filesCreated: string[]; /** Human-readable next steps to show the user after scaffolding. */ nextSteps: string[]; } /** * Scaffold a production-standard Playwright TypeScript project at `projectRoot`. * * Each file is only written if it does not already exist, making the operation * fully idempotent — safe to call on both empty directories and existing projects. * * @param projectRoot - Absolute path to the target project directory. * @param baseUrl - The BASE_URL to embed in .env.example and playwright.config.ts. * @returns A ScaffoldResult listing which files were created and what the user * should do next (e.g. `npm install`, `npx playwright install`). */ export declare function scaffoldProject(projectRoot: string, baseUrl: string): Promise; /** * Check whether a directory is considered "empty" or "new" for the purposes * of scaffolding. Returns true when the folder either does not exist or * contains no `.ts` / `.js` source files. * * @param dir - Absolute path to the directory to check. */ export declare function isEmptyProject(dir: string): Promise; //# sourceMappingURL=project-scaffolder.d.ts.map