From de25a54a4098e92dd2dfbbf3d97a1a8bae8ca989 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Tue, 30 Dec 2025 13:37:35 +0100 Subject: [PATCH] import examples from src --- playwriter/package.json | 2 +- playwriter/src/mcp.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/playwriter/package.json b/playwriter/package.json index 78a40c7..580fc23 100644 --- a/playwriter/package.json +++ b/playwriter/package.json @@ -7,7 +7,7 @@ "types": "dist/index.d.ts", "repository": "https://github.com/remorses/playwriter", "scripts": { - "build": "rm -rf dist *.tsbuildinfo && mkdir dist && cp src/resource.md src/prompt.md src/debugger-examples.ts dist/ && bun scripts/build-selector-generator.ts && bun scripts/build-bippy.ts && tsc", + "build": "rm -rf dist *.tsbuildinfo && mkdir dist && bun scripts/build-selector-generator.ts && bun scripts/build-bippy.ts && tsc", "prepublishOnly": "pnpm build", "watch": "tsc -w", "typecheck": "tsc --noEmit", diff --git a/playwriter/src/mcp.ts b/playwriter/src/mcp.ts index fa1f856..fe0ea20 100644 --- a/playwriter/src/mcp.ts +++ b/playwriter/src/mcp.ts @@ -433,13 +433,13 @@ const promptContent = server.resource('debugger-api', 'playwriter://debugger-api', { mimeType: 'text/plain' }, async () => { const packageJsonPath = require.resolve('playwriter/package.json') - const distDir = path.join(path.dirname(packageJsonPath), 'dist') + const packageDir = path.dirname(packageJsonPath) const debuggerTypes = fs - .readFileSync(path.join(distDir, 'debugger.d.ts'), 'utf-8') + .readFileSync(path.join(packageDir, 'dist', 'debugger.d.ts'), 'utf-8') .replace(/\/\/# sourceMappingURL=.*$/gm, '') .trim() - const debuggerExamples = fs.readFileSync(path.join(distDir, 'debugger-examples.ts'), 'utf-8') + const debuggerExamples = fs.readFileSync(path.join(packageDir, 'src', 'debugger-examples.ts'), 'utf-8') return { contents: [ @@ -468,13 +468,13 @@ server.resource('debugger-api', 'playwriter://debugger-api', { mimeType: 'text/p server.resource('editor-api', 'playwriter://editor-api', { mimeType: 'text/plain' }, async () => { const packageJsonPath = require.resolve('playwriter/package.json') - const distDir = path.join(path.dirname(packageJsonPath), 'dist') + const packageDir = path.dirname(packageJsonPath) const editorTypes = fs - .readFileSync(path.join(distDir, 'editor.d.ts'), 'utf-8') + .readFileSync(path.join(packageDir, 'dist', 'editor.d.ts'), 'utf-8') .replace(/\/\/# sourceMappingURL=.*$/gm, '') .trim() - const editorExamples = fs.readFileSync(path.join(distDir, 'editor-examples.ts'), 'utf-8') + const editorExamples = fs.readFileSync(path.join(packageDir, 'src', 'editor-examples.ts'), 'utf-8') return { contents: [ @@ -505,13 +505,13 @@ server.resource('editor-api', 'playwriter://editor-api', { mimeType: 'text/plain server.resource('styles-api', 'playwriter://styles-api', { mimeType: 'text/plain' }, async () => { const packageJsonPath = require.resolve('playwriter/package.json') - const distDir = path.join(path.dirname(packageJsonPath), 'dist') + const packageDir = path.dirname(packageJsonPath) const stylesTypes = fs - .readFileSync(path.join(distDir, 'styles.d.ts'), 'utf-8') + .readFileSync(path.join(packageDir, 'dist', 'styles.d.ts'), 'utf-8') .replace(/\/\/# sourceMappingURL=.*$/gm, '') .trim() - const stylesExamples = fs.readFileSync(path.join(distDir, 'styles-examples.ts'), 'utf-8') + const stylesExamples = fs.readFileSync(path.join(packageDir, 'src', 'styles-examples.ts'), 'utf-8') return { contents: [