fix: add prepare script so git installs build automatically#10
Open
grigoryosifov wants to merge 3 commits into
Open
fix: add prepare script so git installs build automatically#10grigoryosifov wants to merge 3 commits into
grigoryosifov wants to merge 3 commits into
Conversation
When npx installs this package from a GitHub URL (e.g. 'npx github:pm990320/ultimate-playwright-mcp'), it doesn't run 'prepublishOnly' — that only runs on npm publish. Without a 'prepare' script, the TypeScript doesn't get compiled, dist/ stays empty, and the bin entries point to non-existent files. Adding 'prepare': 'npm run build' makes the package installable directly from git while the next npm release is pending. This is the standard pattern for TS packages that publish compiled dist/.
playwright-checkpoint@^0.3.0 (added as runtime dependency in the checkpoint feature) requires @playwright/test at runtime via 'playwright-checkpoint-runtime.cjs'. With it in devDependencies, git installs (which skip dev deps) crash at startup with MODULE_NOT_FOUND for '@playwright/test'. This doesn't affect npm-published installs (0.2.1 predates the checkpoint feature), but any future release that ships checkpoint would hit this too. Moving @playwright/test to dependencies fixes both cases.
…cies Follow-up to bb8aa14 — package-lock.json reflects the dep move but wasn't included in that commit. This keeps npm ci reproducible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When users install this package directly from git (e.g.
npx github:pm990320/ultimate-playwright-mcpornpm install github:pm990320/ultimate-playwright-mcp), they get:```
sh: ultimate-playwright-mcp: command not found
```
prepublishOnlyonly runs onnpm publish— so installing from git skips the TypeScript build,dist/is empty, and thebinentries point at non-existent files.Motivation for git installs
The main branch has valuable features not yet in the npm 0.2.1 release (browser_evaluate, checkpoint tools, lazy-start daemon, downloads, tab-grouper extension). While waiting for a release cut, users — including agent frameworks like Claude Code that bake MCP configs into project setup — want to pin to HEAD.
Fix
One-line add of a
preparescript mirroringprepublishOnly. This is the standard npm convention for TS packages that ship compileddist/:prepareruns on install from git,prepublishOnlyruns on publish — they do the same thing.Tested
dist/,ultimate-playwright-mcpbinary runs, MCP responds totools/listwith all tools includingbrowser_evaluate.npm publishflow unchanged (prepublishOnlystill runs).