## Summary
- Adds a pre-commit hook that runs prettier on staged files to catch
formatting issues before CI
- Uses `husky` for git hooks and `lint-staged` to scope prettier to only
staged files
- Preserves the existing `prepare` script behavior (`node
packages/core/scripts/prepare.js`)
## Changes
- Added `husky` and `lint-staged` as root devDependencies
- Created `.husky/pre-commit` hook that runs `pnpm exec lint-staged`
- Configured lint-staged: `{ "*": "prettier --write --ignore-unknown" }`
(respects `.prettierignore`)
## Test plan
- [x] Hook runs on commit — verified: badly formatted file auto-fixed
during commit
- [x] `pnpm install` sets up hooks correctly via `prepare` script
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
85 lines
3.2 KiB
JSON
85 lines
3.2 KiB
JSON
{
|
|
"name": "stagehand-workspace",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"description": "Stagehand monorepo workspace",
|
|
"type": "module",
|
|
"scripts": {
|
|
"build": "turbo run build",
|
|
"build:full": "turbo run build",
|
|
"build:cjs": "turbo run build:cjs",
|
|
"build:cli": "turbo run build:cli",
|
|
"build:esm": "turbo run build:esm",
|
|
"build:sea": "turbo run build:sea:esm",
|
|
"build:sea:esm": "turbo run build:sea:esm",
|
|
"build:sea:cjs": "turbo run build:sea:cjs",
|
|
"lint": "turbo run lint",
|
|
"format": "prettier --write .",
|
|
"prettier": "prettier --write .",
|
|
"eslint": "eslint .",
|
|
"test": "turbo run test:core test:e2e test:server test:evals test:cli",
|
|
"test:core": "turbo run test:core --",
|
|
"test:core:local": "STAGEHAND_BROWSER_TARGET=local pnpm run test:core --",
|
|
"test:core:bb": "STAGEHAND_BROWSER_TARGET=browserbase pnpm run test:core --",
|
|
"test:e2e": "turbo run test:e2e --",
|
|
"test:e2e:local": "STAGEHAND_BROWSER_TARGET=local pnpm run test:e2e --",
|
|
"test:e2e:bb": "STAGEHAND_BROWSER_TARGET=browserbase pnpm run test:e2e --",
|
|
"test:server": "turbo run test:server --",
|
|
"test:server:sea": "STAGEHAND_SERVER_TARGET=sea pnpm run test:server --",
|
|
"test:server:local": "STAGEHAND_SERVER_TARGET=local pnpm run test:server --",
|
|
"test:server:remote": "STAGEHAND_SERVER_TARGET=remote pnpm run test:server --",
|
|
"test:evals": "turbo run test:evals --",
|
|
"test:evals:local": "STAGEHAND_BROWSER_TARGET=local pnpm run test:evals --",
|
|
"test:evals:bb": "STAGEHAND_BROWSER_TARGET=browserbase pnpm run test:evals --",
|
|
"coverage:merge": "pnpm -w exec tsx packages/core/scripts/coverage.ts merge",
|
|
"docs": "turbo run docs",
|
|
"dev": "turbo run dev",
|
|
"example": "pnpm --filter @browserbasehq/stagehand run example --",
|
|
"cache:clear": "turbo run build --force",
|
|
"prepare": "node packages/core/scripts/prepare.js && husky",
|
|
"release": "turbo run build && changeset publish",
|
|
"release-canary": "turbo run build && changeset version --snapshot && changeset publish --tag alpha"
|
|
},
|
|
"devDependencies": {
|
|
"@changesets/changelog-github": "^0.5.0",
|
|
"@changesets/cli": "^2.27.9",
|
|
"@eslint/js": "^10.0.1",
|
|
"c8": "^10.1.3",
|
|
"dotenv": "^17.3.1",
|
|
"esbuild": "0.27.2",
|
|
"eslint": "^10.0.2",
|
|
"eslint-plugin-security": "^3.0.1",
|
|
"globals": "^15.13.0",
|
|
"husky": "^9.1.7",
|
|
"junit-to-ctrf": "^0.0.14",
|
|
"lint-staged": "^16.4.0",
|
|
"prettier": "^3.2.5",
|
|
"source-map": "^0.7.4",
|
|
"tsx": "^4.19.4",
|
|
"turbo": "^2.8.10",
|
|
"typescript": "5.8.3",
|
|
"typescript-eslint": "^8.56.1"
|
|
},
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "git+https://github.com/browserbase/stagehand.git"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/browserbase/stagehand/issues"
|
|
},
|
|
"homepage": "https://stagehand.dev",
|
|
"overrides": {
|
|
"whatwg-url": "^14.0.0",
|
|
"jwa": "^2.0.1",
|
|
"zod": "4.2.1",
|
|
"tsx": "4.19.4"
|
|
},
|
|
"engines": {
|
|
"node": "^20.19.0 || >=22.12.0"
|
|
},
|
|
"lint-staged": {
|
|
"*": "prettier --write --ignore-unknown"
|
|
},
|
|
"packageManager": "pnpm@9.15.0+sha512.76e2379760a4328ec4415815bcd6628dee727af3779aaa4c914e3944156c4299921a89f976381ee107d41f12cfa4b66681ca9c718f0668fa0831ed4c6d8ba56c"
|
|
}
|