You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,37 @@ If your work depends on unreleased features or changes, base your work directly
47
47
48
48
## Code Contributions
49
49
50
+
### 🚨 Dependency & Lockfile Policy (Read Before PR!)
51
+
52
+
**When to Commit `package-lock.json`**
53
+
54
+
-**You MUST commit `package-lock.json` if:**
55
+
- You add, remove, or upgrade a dependency in `package.json` (for example, when your new tool needs a new npm package).
56
+
- You intentionally update any package version in `package.json`.
57
+
- After such changes, always run `npm install` and commit both `package.json` and `package-lock.json` together.
58
+
59
+
-**You MUST NOT commit `package-lock.json` if:**
60
+
- You are only editing, adding, or refactoring tool components, UI, or logic, and did not touch `package.json`.
61
+
- You ran `npm install` after pulling latest develop, but did not change dependencies. If the lockfile changes, discard it (`git checkout -- package-lock.json`).
62
+
63
+
-**Dependency/toolchain upgrades (Next.js, ESLint, etc.) must be in a separate PR, never mixed with feature/tool PRs.**
64
+
65
+
**For Adding a New Tool:**
66
+
67
+
- If your tool needs a new npm package:
68
+
1. Add the dependency to `package.json`.
69
+
2. Run `npm install` (this updates `package-lock.json`).
70
+
3. Commit both files in your PR.
71
+
- If your tool does NOT need a new dependency, do NOT touch or commit `package-lock.json`.
72
+
73
+
**Why?**
74
+
75
+
- Our CI uses `npm ci`, which requires the lockfile to match `package.json` exactly.
76
+
- Random lockfile churn (from different npm versions or accidental upgrades) causes huge, noisy diffs and can break builds.
77
+
- Only the canonical lockfile in `develop` is valid.
78
+
79
+
---
80
+
50
81
Please ensure your pull request adheres to the following guidelines:
51
82
52
83
- Search [open pull requests](https://github.com/betterbugs/dev-tools/pulls) to ensure your change hasn't already been submitted
0 commit comments