Skip to content

Commit eb1eca2

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent e6b4717 commit eb1eca2

File tree

4 files changed

+2195
-1
lines changed

4 files changed

+2195
-1
lines changed

.github/LOCKFILE_NOTE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# About pnpm-lock.yaml
2+
3+
This file **MUST be committed** to the repository for:
4+
5+
1. **Reproducible builds** - Ensures everyone gets the same dependency versions
6+
2. **CI/CD** - GitHub Actions needs this file to install dependencies with `--frozen-lockfile`
7+
3. **Security** - Prevents dependency drift and supply chain attacks
8+
9+
## Common Issues
10+
11+
### "Cannot install with frozen-lockfile because pnpm-lock.yaml is absent"
12+
13+
**Cause**: The lockfile is in `.gitignore` or wasn't committed
14+
15+
**Solution**:
16+
1. Remove `pnpm-lock.yaml` from `.gitignore`
17+
2. Run `git add pnpm-lock.yaml`
18+
3. Commit and push
19+
20+
### When to regenerate the lockfile
21+
22+
Only regenerate when you:
23+
- Add/remove dependencies
24+
- Update dependency versions
25+
- Run `pnpm update`
26+
27+
**Command**: `pnpm install` will update the lockfile automatically

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,4 @@ node_modules/
1717
Thumbs.db
1818

1919
# pnpm
20-
pnpm-lock.yaml
2120
.pnpm-debug.log*

AUTOMATED_TESTING.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,28 @@ If all these pass locally, they should pass in CI.
186186
- Don't specify `version:` in the pnpm/action-setup step when `packageManager` is set in package.json
187187
- The action automatically reads the version from the `packageManager` field
188188
- Our workflows use pnpm@10.18.0 from package.json
189+
190+
### "Cannot install with frozen-lockfile because pnpm-lock.yaml is absent"
191+
192+
**Cause**: The `pnpm-lock.yaml` file is missing from the repository (was in `.gitignore`)
193+
194+
**Solution**:
195+
```bash
196+
# 1. Remove pnpm-lock.yaml from .gitignore (if present)
197+
# 2. Add the lockfile to git
198+
git add pnpm-lock.yaml
199+
200+
# 3. Commit it
201+
git commit -m "chore: add pnpm-lock.yaml for reproducible builds"
202+
203+
# 4. Push
204+
git push
205+
```
206+
207+
**Why this is important**:
208+
- Ensures reproducible builds across all environments
209+
- Required for CI/CD with `--frozen-lockfile` flag
210+
- Prevents dependency drift and security issues
211+
- Standard practice for all package managers (npm, yarn, pnpm)
212+
213+
**Note**: The `pnpm-lock.yaml` file should **always** be committed to version control, never ignored.

0 commit comments

Comments
 (0)