How To Contribute
Thanks for the help! We welcome all contributions to it.
Project Layout
srcAll the source code for pcl.js, if you want to edit a api or just see how it works this is where you'll find it.websiteThe source code for https://pcljs.orgtestsYou'll do most of your testing in here.corePoint Cloud Library (PCL) project source code.
Download and Setup
- fork this repository to your Github, then clone to your local device (If you want to change C++ code, use 
--recursivefor cloning submodules) or use Gitpod, a free online dev environment for GitHub. 
git clone https://github.com/luoxuhai/pcl.js --recursive
Or discard most branches and history to clone faster:
git clone https://github.com/luoxuhai/pcl.js --recursive --depth 1 --single-branch --branch master
- Install Node LTS
 - Install the Emscripten SDK (No need to install if you don't change C++ code, such as files under 
src/bindandcore/) 
Editing
- Compile PCL(C++), README
 - Compile WebAssembly if C++ code is changed: 
npm run dev:wasmornpm run build:wasm - Package JavaScript 
npm run dev:jsornpm run build:js 
Testing Your Changes
- Create the test code in the 
/testsdirectory (if the file does not already exist, create it with the*.test.tsextension) - If you change the C++ code, you need to run 
npm run dev:wasmornpm run build:wasm - Run 
npm run dev:jsornpm run build:jsto build the test run code - Run 
npm run test 
Updating Documentation
Our documentation is made with Docusaurus. They are located in the website/docs/ directory.
- Open the 
website/directory,cd website - Install dependencies 
npm installoryarn - Start the project 
npm run start, for Chinese:npm run start:zh - Build the project 
npm run buildto check locally for errors 
Writing a Commit Message
Before you create a Pull Request, please check whether your commits comply with the commit conventions used in this repository.
When you create a commit we kindly ask you to follow the convention
category(scope or module): message in your commit message while using one of
the following categories:
feat: all changes that introduce completely new code or new featuresfix: changes that fix a bug (ideally you will additionally reference an issue if present)refactor: any code related change that is not a fix nor a featureperf: Code changes to improve performancedocs: changing existing or creating new documentation (i.e. README, docs for usage of a lib or cli usage)build: all changes regarding the build of the software, changes to dependencies or the addition of new dependenciestest: all changes regarding tests (adding new tests or changing existing ones)style: Changes that do not affect the meaning of the code (whitespace, formatting, missing semicolons, etc.)chore: all changes to the repository that do not fit into any of the above categories
If you are interested in the detailed specification you can visit Conventional Commits or check out the Angular Commit Message Guidelines.
Command introduction
npm run build:pclcompile PCL to WebAssembly static librarynpm run dev:jsto package a debug version of JavaScript codenpm run dev:wasmto compile PCL's WebAssembly +src/bindto WebAssembly debug buildnpm run devsimultaneously packages JavaScript and compiles PCL for development usenpm run build:jsto package the production version of JavaScript codenpm run build:wasmto compile PCL's WebAssembly +src/bindto WebAssembly production buildnpm run buildbundles JavaScript and compiles PCL at the same time, ready for production usenpm run lintto check code stylenpm run testto run tests. (Be sure to runnpm run dev:jsornpm run build:jsbefore running tests)