Skip to content

enforce pnpm usage and prevent npm installs#2624

Open
Gurkiratcodemaster wants to merge 1 commit intoOWASP:masterfrom
Gurkiratcodemaster:enforce-pnpm
Open

enforce pnpm usage and prevent npm installs#2624
Gurkiratcodemaster wants to merge 1 commit intoOWASP:masterfrom
Gurkiratcodemaster:enforce-pnpm

Conversation

@Gurkiratcodemaster
Copy link

Description

This PR prevents mixing npm and pnpm in the project.

Changes

  • Added "packageManager": "pnpm@10.32.1" to package.json
  • Added a preinstall script using only-allow to prevent installs with npm or yarn.
  • Updated documentation to consistently use pnpm commands

Mixing npm and pnpm can create conflicting lock files and inconsistent dependency structures.

Closes #2623

Copilot AI review requested due to automatic review settings March 13, 2026 22:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to enforce pnpm usage in the cornucopia.owasp.org Svelte/TypeScript project to avoid lockfile and dependency-tree inconsistencies caused by mixing package managers (closes #2623).

Changes:

  • Pin pnpm via packageManager and add an install-time guard to discourage npm/yarn installs.
  • Update cornucopia.owasp.org documentation to use pnpm commands.
  • Bump versions of several pre-commit hooks.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.

File Description
package-lock.json Introduces an npm lockfile at repo root (conflicts with pnpm-enforcement goal).
cornucopia.owasp.org/package.json Adds pnpm pinning and a preinstall guard intended to block other package managers.
cornucopia.owasp.org/README.md Updates developer docs to use pnpm commands and adds pnpm guidance.
.pre-commit-config.yaml Updates hook versions (change not mentioned in PR description).

@@ -1,9 +1,11 @@
{
"name": "cornucopia-website",
"packageManager": "pnpm@10.32.1",
Comment on lines +5 to +9
## Development server

This project uses **pnpm** for dependency management.
Please do **not use npm or yarn**, as mixing package managers can cause dependency conflicts.

Comment on lines 10 to 12
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
"private": true,
"scripts": {
"dev": "vite dev",
"preinstall": "npx only-allow pnpm",
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.

Prevent mixing npm and pnpm in the project

2 participants