mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 05:38:34 +00:00
update contribution guide to pnpm
+ update root tasks
This commit is contained in:
parent
54a61dcdae
commit
d60956e82a
@ -58,23 +58,22 @@ To fix a bug that has been reported,
|
|||||||
## Write Tests
|
## Write Tests
|
||||||
|
|
||||||
There are still many tests that have not been written yet! Reading and writing tests is a great opportunity to get familiar with the codebase.
|
There are still many tests that have not been written yet! Reading and writing tests is a great opportunity to get familiar with the codebase.
|
||||||
You can find the tests in each package in the `test` folder. To run all tests, run `npm test` from the root folder.
|
You can find the tests in each package in the `test` folder. To run all tests, run `pnpm test` from the root folder.
|
||||||
|
|
||||||
## Project Setup
|
## Project Setup
|
||||||
|
|
||||||
To get the project up and running for development, make sure you have installed:
|
To get the project up and running for development, make sure you have installed:
|
||||||
|
|
||||||
- git
|
- [git](https://git-scm.com/)
|
||||||
- node, preferably v16
|
- [node](https://nodejs.org/en/) >= 18
|
||||||
|
- [pnpm](https://pnpm.io/) (`npm i pnpm -g`)
|
||||||
|
|
||||||
then, do the following:
|
then, do the following:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
git clone https://github.com/tidalcycles/strudel.git && cd strudel
|
git clone https://github.com/tidalcycles/strudel.git && cd strudel
|
||||||
npm i # install at root to symlink packages
|
pnpm i # install at root to symlink packages
|
||||||
npx lerna bootstrap # install all dependencies in packages
|
pnpm start # start repl
|
||||||
cd repl && npm i # install repl dependencies
|
|
||||||
npm run start # start repl
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Those commands might look slightly different for your OS.
|
Those commands might look slightly different for your OS.
|
||||||
@ -93,9 +92,8 @@ If you use VSCode, you can
|
|||||||
## Package Workflow
|
## Package Workflow
|
||||||
|
|
||||||
The project is split into multiple [packages](https://github.com/tidalcycles/strudel/tree/main/packages) with independent versioning.
|
The project is split into multiple [packages](https://github.com/tidalcycles/strudel/tree/main/packages) with independent versioning.
|
||||||
When you run `npm i` on the root folder, [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) will symlink all packages
|
When you run `pnpm i` on the root folder, [pnpm workspaces](https://pnpm.io/workspaces) will install all dependencies of all subpackages. This will allow any js file to import `@strudel.cycles/<package-name>` to get the local version,
|
||||||
in the `node_modules` folder. This will allow any js file to import `@strudel.cycles/<package-name>` to get the local version,
|
allowing to develop multiple packages at the same time.
|
||||||
which allows developing multiple packages at the same time
|
|
||||||
|
|
||||||
## Package Publishing
|
## Package Publishing
|
||||||
|
|
||||||
@ -106,12 +104,15 @@ npm login
|
|||||||
npx lerna publish
|
npx lerna publish
|
||||||
```
|
```
|
||||||
|
|
||||||
|
To manually publish a single package, increase the version in the `package.json`, then run `pnpm publish`.
|
||||||
|
Important: Always publish with `pnpm`, as `npm` does not support overriding main files in `publishConfig`, which is done in all the packages.
|
||||||
|
|
||||||
### New Packages
|
### New Packages
|
||||||
|
|
||||||
To add a new package, you have to publish it manually the first time, using:
|
To add a new package, you have to publish it manually the first time, using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
cd packages/<package-name> && npm publish --access public
|
cd packages/<package-name> && pnpm publish --access public
|
||||||
```
|
```
|
||||||
|
|
||||||
## Have Fun
|
## Have Fun
|
||||||
|
|||||||
@ -9,10 +9,10 @@
|
|||||||
"test": "npm run pretest && vitest run --version",
|
"test": "npm run pretest && vitest run --version",
|
||||||
"test-ui": "npm run pretest && vitest --ui",
|
"test-ui": "npm run pretest && vitest --ui",
|
||||||
"test-coverage": "npm run pretest && vitest --coverage",
|
"test-coverage": "npm run pretest && vitest --coverage",
|
||||||
"bootstrap": "lerna bootstrap",
|
"setup": "pnpm i && npm run jsdoc-json",
|
||||||
"setup": "npm i && npm run jsdoc-json && npm run bootstrap && cd website && npm i",
|
|
||||||
"snapshot": "npm run pretest && vitest run -u --silent",
|
"snapshot": "npm run pretest && vitest run -u --silent",
|
||||||
"repl": "cd website && npm run dev",
|
"repl": "cd website && npm run dev",
|
||||||
|
"start": "cd website && npm run dev",
|
||||||
"osc": "cd packages/osc && npm run server",
|
"osc": "cd packages/osc && npm run server",
|
||||||
"build": "cd website && npm run build",
|
"build": "cd website && npm run build",
|
||||||
"preview": "cd website && npm run preview",
|
"preview": "cd website && npm run preview",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user