This monorepo is designed for creative coding, mainly with P5.js, but not limited to it. It uses pnpm as a package manager and Turbo Repo as a monorepo tool. Sketches are located in the /sketches
folder, while reusable packages are located in the /packages
folder.
Here are a few sketch outputs I've generated thanks to these tools:
To get started with this monorepo, you'll need to install pnpm globally:
npm install -g pnpm
Then, install the dependencies:
pnpm install
To create a new TypeScript sketch, use the following command:
pnpm generate:sketch
This will create a new sketch in the /sketches
folder, with the following structure:
/sketches
/my-new-sketch
main.ts
package.json
/public
index.html
style.css
You can then start the development server for your sketch using the following command:
turbo run serve --filter=<sketchName>
This will start a development server at http://localhost:3033
that automatically rebuilds your sketch as you make changes.
A playground sketch exists for fiddling around. To run the playground sketch, use the following command:
pnpm run playground
This will start a development server at http://localhost:3033
that allows you to experiment with different sketches and packages.
This monorepo contains several reusable packages for creative coding, located in the /packages
folder. Some of the most important packages are:
- @tronicart/cc: A collection of utilities and helpers for P5.js.
- @tronicart/p5-flow-field: A function for creating and manipulating 2D flow fields.
- @tronicart/data-structures: A collection data structures for creative coding.
- @tronicart/batch-capture: Captures screenshots of your sketch in batches.
- @tronicart/shapes: A collection of 2D shapes for creative coding.
- @tronicart/poisson-disk-sampling: function for generating 2D points that are uniformly spaced apart.
Check the /packages folder for more.
If you'd like to contribute to this monorepo, please open an issue or submit a pull request on GitHub. Contributions are always welcome!