A small overview of how I interpret pnpm.
Disclaimer: This is a living document and might be wrong. Please comment on this issue and let's document it together.
Prepare environment
- Create
node_modules/.pacquet folder which is the virtual store path.
Add package
For a given package (example fastify) and a version (v1.0.0):
Variables:
$STORE=node_modules/.pacquet
$PKG=fastify
$VERSION=1.0.0
Steps:
- Install package to
$STORE/$PKG@$VERSION/node_modules/$PKG
- If there is a dependency of this package:
- Create an empty folder at path
$STORE/fastify@$VERSION/node_modules/$PKG/node_modules
- Symlink
node_modules/$PKG to STORE/$PKG@$VERSION/node_modules/$PKG
- For every dependency of
$PKG:
- Set
$PKG to dependency name
- Set
$VERSION to `dependency version
- Run installation steps from the beginning
- Update package.json with appropriate version
- If package.json is not defined, create a file with only
dependencies
- Update/create shrink file with appropriate ranges
A small overview of how I interpret
pnpm.Disclaimer: This is a living document and might be wrong. Please comment on this issue and let's document it together.
Prepare environment
node_modules/.pacquetfolder which is the virtual store path.Add package
For a given package (example fastify) and a version (v1.0.0):
Variables:
$STORE=node_modules/.pacquet$PKG=fastify$VERSION=1.0.0Steps:
$STORE/$PKG@$VERSION/node_modules/$PKG$STORE/fastify@$VERSION/node_modules/$PKG/node_modulesnode_modules/$PKGtoSTORE/$PKG@$VERSION/node_modules/$PKG$PKG:$PKGto dependency name$VERSIONto `dependency versiondependencies