We welcome contributions to Threepipe. Please read the following guidelines to start working on the code and creating pull request.
- Clone the repository
- Run
npm install
- Run
npm run viteto run vite dev server and navigate to http://localhost:5173/examples/index.html - Test the examples and pick the one you are working on.
OR
- If changing the
src/folder - Runnpm run devto start the development in watch mode - If changing the
plugins/folder -cdto the plugin directory and runnpm run devto start the development in watch mode for the package. - Run
npm run dev-examplesto start the examples build in watch mode and runnpm run serveto start the development server, and navigate to http://localhost:9229/index.html
For website(vitepress) development -
- Run
npm run website:devto start the website server.
Note: If you see Cannot access 'X' before initialization errors after adding or moving source files, delete the .vite/ cache folder and reload. Vite's transform cache can become stale when the module graph changes.
Some examples requires env variables.
- Run
cp examples/sample.env examples/.envand set the required tokens/keys in theexamples/.envfile, and build the examples again.
TBD
- Run
npm run buildto build the project, or in a specific package directory to build the package - Run
npm run build-examplesto build the examples - Run
npm run website:buildto build the website - Run
npm run docsto build only the API docs - Run
npm run prepareto build the project, examples and plugins - Run
npm run docs-allto build API docs and website
For core and for each package -
- Update the package version in
package.jsonand runnpm run new:publishto publish the package to npm. - Add tag like
v0.0.1or@threepipe/plugin-name-0.0.1to the git repository. - Push/Merge to
masteron github.
Checklist
- Create a class in a subfolder at
./src/plugins - Inherit from
AViewerPluginSync - Set a unique
PluginType - Write plugin
- Add jsdoc comments to the class
- Export classes, functions in
./src/plugins/index.ts - Optionally, use plugin in
./examples/tweakpane-editor/script.ts - Optionally, use plugin in
./examples/model-viewer/script.ts - Optionally, use plugin in
threepipe-blueprint-editor - Create an example in
./examplesby duplicating any existing one - Add example to
./examples/index.html - Add example and any other tests to
tests/ - Add info to
README.md - Add info to
./website/guide/core-plugins.md - Add info to
./website/plugin/PluginName.md - Add entry to sidebar in
./website/.vitepress/config.ts - Update CHANGELOG.md
Checklist
- Duplicate a template plugin from
plugins/folder -plugin-template-vite - Change
name,description,repository.directory,dependenciesand any other relevant fields inpackage.json - Change
nameintypedoc.json - Update link in plugin's
CHANGELOG.mdandREADME.md - Check
globalsinvite.config.js - Write plugin/package
- Add jsdoc comments to the classes
- Export classes, functions in
index.ts - Optionally, use plugin in
./examples/tweakpane-editor/script.ts - Optionally, use plugin in
./examples/model-viewer/script.ts - Optionally, use plugin in
threepipe-blueprint-editor - Create an example in
./examplesby duplicating any existing one. Ideally one example for each exported plugin/utility. - Add example to
./examples/index.html - Add example and any other tests to
tests/ - Add info to
README.md - Add info to
./website/guide/threepipe-packages.md - Add info to
./website/package/plugin-name.md - Add entry to sidebar in
./website/.vitepress/config.ts npm run buildand test with example- Publish package with
npm run new:publish. Check that tag is added to git likeplugin-name-v0.0.1 - Update core CHANGELOG.md with link to new package.