This project uses Volta to ensure that all the contributors share the same version of Node
and Npm
for development. If you are considering making frequent contributions to this project, we recommend installing this tool as well. Otherwise, check the volta
field in package.json
to see which versions to use.
The project was provided with Vscode and then contains some configuration to deal with NPM's workspaces.
We could find some configuration to run the Vscode's jest plugin and jest-runner plugin, eslint plugin, typescript, to use their debugger mode, coverage, build, etc...
Ensure to have these plugins and you will have for free the same env with everything configured
The project uses the NPM's workspaces. It means you have to use the NPM's command to deal with workspaces
If you need to create the new package, run the following command at the rood of the project:
npm init -w ./packages/a
The new package will be declared with the same project's version, will be declared in the package-lock.json
file, etc...
If this package needs jest
, ensure in the vscode.settings.json
to update the config:
"jest.virtualFolders": [{ "name": "core", "rootPath": "packages/core" }]
if you need to remove package, here the process:
- First, remove the folder, e.g.
rm -rf packages/b
- Second, cleanup if needed vscode files
- Next, run
npm install
- Then update the
package-lock.json
file to remove your package
For the last, it seems there is an issue when we remove a package and the lock seems to be cleaned. There is a pending PR but notyet approved.
If you need to add a common dependency, please on the root of the project:
npm install --save-dev mydep
If you need a public package on another one, please run on the root of the project:
npm install --save @npmversion/core --workspace=packages/cli
If you need a private package on another one, please edit in the target package's package.json
file the peerDependencies
like so:
"peerDependencies": {
"@npmversion/jest-utils": "*"
},
"peerDependenciesMeta": {
"@npmversion/jest-utils": {
"optional": true
}
}