Skip to content

fix: add prepare script so git installs build automatically#10

Open
grigoryosifov wants to merge 3 commits into
pm990320:mainfrom
grigoryosifov:fix/prepare-script-for-git-install
Open

fix: add prepare script so git installs build automatically#10
grigoryosifov wants to merge 3 commits into
pm990320:mainfrom
grigoryosifov:fix/prepare-script-for-git-install

Conversation

@grigoryosifov
Copy link
Copy Markdown

Problem

When users install this package directly from git (e.g. npx github:pm990320/ultimate-playwright-mcp or npm install github:pm990320/ultimate-playwright-mcp), they get:

```
sh: ultimate-playwright-mcp: command not found
```

prepublishOnly only runs on npm publish — so installing from git skips the TypeScript build, dist/ is empty, and the bin entries 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 prepare script mirroring prepublishOnly. This is the standard npm convention for TS packages that ship compiled dist/: prepare runs on install from git, prepublishOnly runs on publish — they do the same thing.

Tested

  • Installing from fork HEAD with this fix produces a working dist/, ultimate-playwright-mcp binary runs, MCP responds to tools/list with all tools including browser_evaluate.
  • Regular npm publish flow unchanged (prepublishOnly still runs).

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant