pnpm.io
pnpm.io copied to clipboard
chore(deploy): Add some clarrification for deploy packlist generation
Closes https://github.com/pnpm/pnpm/issues//7286
The packlist generation used by pnpm deploy is significantly more complex than the docs currently suggest which resulted in a few lost hours for me figuring out why my dist directory was missing (it was .gitignored).
I believe the rules come from https://www.npmjs.com/package/npm-packlist or at least mimic the rules from that package but I couldn't follow the src in the time I had available to be honest.
Instead I made a test repo to check the behaviour described in this PR, it's over here if you want to check my work https://github.com/antiBaconMachine/pnpm-deploy-packlist-examples/tree/main.
If someone could confirm that deploy does indeed use npm-packlist then it might be better to just link straight to that more complete documentation, because there are almost certainly other cases I haven't covered here.
Thanks.
Run & review this pull request in StackBlitz Codeflow.
Someone is attempting to deploy a commit to the pnpm Team on Vercel.
A member of the Team first needs to authorize it.
A few hours of my time wasted, I hit this same problem. The documentation says
By default, all the files of the project are copied during deployment. The project's package.json may contain a "files" field to list the files and directories that should be copied.
This is wrong.
Unfortunately, if you assumed build outputs that are listed in your .gitignore would be packed, they aren't.
I don't think gitignore should be taken into account. We should fix this.
Thanks for merging this 🎉
I don't think gitignore should be taken into account. We should fix this.
Yeah agreed a .gitignore is for git not random other tools.
I did spend an hour looking into the code but it was clear it was going to take me more time then I had available to learn the codebase so I came over here to fix the docs as a compromise. If someone can point me at the interface point where deploy uses npm-packlist I can probably do something.