threepipe
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

CONTRIBUTING.md 3.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Contributing to Threepipe
  2. We welcome contributions to Threepipe. Please read the following guidelines to start working on the code and creating pull request.
  3. ## Setting up the project
  4. 1. Clone the repository
  5. 2. Run `npm install`
  6. ## Development
  7. 1. If changing the `src/` folder - Run `npm run dev` to start the development in watch mode
  8. 2. If changing the `plugins/` folder - `cd` to the plugin directory and run `npm run dev` to start the development in watch mode for the package.
  9. 3. Run `npm run dev-examples` to start the examples build in watch mode
  10. 4. Run `npm run serve` to start the development server
  11. 5. Navigate to `http://localhost:9229/index.html` to see the examples and pick the one you are working on.
  12. For website(vitepress) development -
  13. - Run `npm run website:dev` to start the website server.
  14. Some examples requires env variables.
  15. - Run `cp examples/sample.env examples/.env` and set the required tokens/keys in the `examples/.env` file.
  16. ## Testing
  17. TBD
  18. ## Building
  19. 1. Run `npm run build` to build the project, or in a specific package directory to build the package
  20. 2. Run `npm run build-examples` to build the examples
  21. 3. Run `npm run website:build` to build the website
  22. 4. Run `npm run docs` to build only the API docs
  23. 5. Run `npm run prepare` to build the project, examples and plugins
  24. 6. Run `npm run docs-all` to build API docs and website
  25. ## Publishing
  26. For core and for each package -
  27. - Update the package version in `package.json` and run `npm run new:publish` to publish the package to npm.
  28. - Add tag like `v0.0.1` or `plugin-name-0.0.1` to the git repository.
  29. - Push/Merge to `master` on github.
  30. ## Creating a Core Plugin
  31. Checklist
  32. - Create a class in a subfolder at `./src/plugins`
  33. - Inherit from `AViewerPluginSync`
  34. - Set a unique `PluginType`
  35. - Write plugin
  36. - Add jsdoc comments to the class
  37. - Export classes, functions in `./src/plugins/index.ts`
  38. - Optionally, use plugin in `./examples/tweakpane-editor/script.ts`
  39. - Optionally, use plugin in `./examples/model-viewer/script.ts`
  40. - Optionally, use plugin in `threepipe-blueprint-editor`
  41. - Create an example in `./examples` by duplicating any existing one
  42. - Add example to `./examples/index.html`
  43. - Add example and any other tests to `tests/`
  44. - Add info to `README.md`
  45. - Add info to `./website/guide/core-plugins.md`
  46. - Add info to `./website/plugin/PluginName.md`
  47. ## Creating a Package/Plugin package
  48. Checklist
  49. - Duplicate a template plugin from `plugins/` folder - `plugin-template-vite`
  50. - Change `name`, `description`, `repository.directory`, `dependencies` and any other relevant fields in `package.json`
  51. - Change `name` in `typedoc.json`
  52. - Check `globals` in `vite.config.js`
  53. - Write plugin/package
  54. - Add jsdoc comments to the classes
  55. - Export classes, functions in `index.ts`
  56. - Optionally, use plugin in `./examples/tweakpane-editor/script.ts`
  57. - Optionally, use plugin in `./examples/model-viewer/script.ts`
  58. - Optionally, use plugin in `threepipe-blueprint-editor`
  59. - Create an example in `./examples` by duplicating any existing one. Ideally one example for each exported plugin/utility.
  60. - Add example to `./examples/index.html`
  61. - Add example and any other tests to `tests/`
  62. - Add info to `README.md`
  63. - Add info to `./website/guide/threepipe-packages.md`
  64. - Add info to `./website/packages/PluginName.md`
  65. - `npm run build` and test with example
  66. - Publish package with `npm run new:publish`. Add tag to git like `plugin-name-v0.0.1`