Skip to content

Visualize Your Ideas With Code

docs: add instructions for local installation (#867)

Jacob3b2f22e0991c
diff --git a/README.md b/README.md
index 84d88b56..fbcd713f 100644
--- a/README.md
+++ b/README.md
@@ -38,12 +38,13 @@ The project is maintained as one monorepo containing the following packages:
| Name | Description |
| ------------- | -------------------------------------------------------------- |
-| `core` | All logic related to running and rendering animations. |
| `2d` | The default renderer for 2D motion graphics |
+| `core` | All logic related to running and rendering animations. |
| `create` | A package for bootstrapping new projects. |
| `docs` | [Our documentation website.][docs] |
| `e2e` | End-to-end tests. |
| `examples` | Animation examples used in documentation. |
+| `internal` | Internal helpers used for building the packages. |
| `player` | A custom element for displaying animations in a browser. |
| `template` | A template project included for developer's convenience. |
| `ui` | The user interface used for editing. |
@@ -55,22 +56,55 @@ packages.
### Developing Core & 2D
-When developing the core, start both `core:dev` and `template:dev`.
+When developing the core, execute both `npm run core:dev` and
+`npm run template:dev`.
This will pick up any changes you make to the core package, automatically
rebuild the `template` project and refresh the page.
-Similarly, when developing the 2D package, start `2d:dev` and `template:dev`.
+Similarly, when developing the 2D package, execute `npm run 2d:dev` and
+`npm run template:dev`.
### Developing UI
If you want to develop the UI, first build the template project by running:
-`template:build`. Next, start `ui:dev`.
+`npm run template:build`. Then execute `npm run ui:dev`.
### Developing Player
-Like with UI, to develop the player, first build the template: `template:build`.
-Then, start `player:dev`.
+Like with UI, to develop the player, first build the template:
+`npm run template:build`. Then, start `npm run player:dev`.
+
+## Installing a local version of Motion Canvas in a project
+
+It can be useful to install a local version of Motion Canvas in a standalone
+project. For example, when you want to use your own fork with some custom-made
+features to create your animations.
+
+Let's assume the following project structure:
+
+```
+projects/
+├── motion-canvas/ <- your local monorepo
+└── my-project/ <- a bootstrapped project
+ └── package.json
+```
+
+You can link the local packages from the monorepo by updating the `package.json`
+of your project. Simply replace the version with a `file:` followed by a
+relative path to the package you want to link:
+
+```diff
+ "dependencies": {
+- "@motion-canvas/core": "^3.11.0",
++ "@motion-canvas/core": "file:../motion-canvas/packages/core",
+ // ...
+ },
+```
+
+Then run `npm install` in to apply the changes and that's it.
+
+You can use the same technique to test out any custom package you're working on.
## Contributing