About pnpm¶
As the website of pnpm mentions:
Quote
Fast, disk space efficient package manager.
Fast pnpm is up to 2x faster than the alternatives.
Efficient Files inside node_modules
are cloned or hard linked from a single content-addressable storage.
Supports monorepos pnpm has built-in support for multiple packages in a repository.
Strict pnpm creates a non-flat node_modules
by default, so code has no access to arbitrary packages.
How and why do we use pnpm¶
We use pnpm to manage our monorepo applications and packages as well as our dependencies.
We chose pnpm because it has built-in support for monorepos and it is fast and disk space efficient.
Documentation¶
package.json
structure¶
We tend to uniformize the package.json
files so all commands are mostly the same across the workspace. Here is an example of a package.json
file.
- The name of the Node project in the form of
@beescreens/<application/package name>[-<application service name>]
. - The version of the Node project.
- The description of the Node project.
- The license of the Node project (usually AGPL-3.0).
- The main author(s) of the Node project. If made my multiple people, usually the author becomes "BeeScreens contributors".
- Link to the homepage of the Node project.
- Ensure that the project is installed with pnpm.
- Copy the default environment variables its own
.env
file. - Check if the environment variables are valid.
- Check if the environment variables are valid after a merge with the help of Husky.
- Check if the code is formatted correctly.
- Fix the code formatting.
- Check if the code is linted correctly.
- Fix the code linting.
- Run the unit tests.
- Run the unit tests in watch mode.
- Run the integration tests.
- Run the integration tests in watch mode.
- Run the unit and integration tests.
- Run the application in development mode.
- Build the application/package.
- Run the application in production mode.
- Bundle the application/package for release.
- Dependencies of the project used in production.
- Dependencies of the project used during development.
Resources and alternatives¶
These resources and alternatives are related to the current item (in alphabetical order).