Skip to content

Conversation

@rafaeelaudibert
Copy link
Member

@rafaeelaudibert rafaeelaudibert commented Nov 24, 2025

Let's migrate to pnpm to allow us to choose what scripts are run on pre/postinstall and also add our new minimumReleaseAge to avoid installing very recent packages

@vercel
Copy link

vercel bot commented Nov 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
posthog Ready Ready Preview Nov 25, 2025 9:34pm

These are a security risk, let's not run them if not needed

This might not work because yarn 1 doesn't let us choose what dependencies are allowed to run postinstall scripts. We'll need to migrate to pnpm if we fail to build the app with these changes.
yarn is very hard to make it safe after today's supply chain attack, let's use pnpm - same as our main repo
This worked when using yarn because a dependency installed this, but this stopped working when using pnpm because it installs files in different places
We were previously using yarn and on yarn you can require transitive dependencies because files are installed like this

```
node_modules
  | node
  | posthog-js
  | posthog-js-dependency-i-can-require
```

on pnpm, on the other hand, they're nested, which means we cannot require dependencies we didn't install - which is much saner

This meant we had to install more packages than before to get this to work
@rafaeelaudibert rafaeelaudibert merged commit a6f565a into master Nov 26, 2025
12 checks passed
@rafaeelaudibert rafaeelaudibert deleted the harden-posthog-com-no-postscript-installs branch November 26, 2025 01:13
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.

3 participants