How To Contribute
Thanks for the help! We welcome all contributions to it.
Project Layout
src
All 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.website
The source code for https://pcl.js.orgtests
You'll do most of your testing in here.core
Point 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
--recursive
for 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/bind
andcore/
)
Editing
- Compile PCL(C++), README
- Compile WebAssembly if C++ code is changed:
npm run dev:wasm
ornpm run build:wasm
- Package JavaScript
npm run dev:js
ornpm run build:js
Testing Your Changes
- Create the test code in the
/tests
directory (if the file does not already exist, create it with the*.test.ts
extension) - If you change the C++ code, you need to run
npm run dev:wasm
ornpm run build:wasm
- Run
npm run dev:js
ornpm run build:js
to 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 install
oryarn
- Start the project
npm run start
, for Chinese:npm run start:zh
- Build the project
npm run build
to 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:pcl
compile PCL to WebAssembly static librarynpm run dev:js
to package a debug version of JavaScript codenpm run dev:wasm
to compile PCL's WebAssembly +src/bind
to WebAssembly debug buildnpm run dev
simultaneously packages JavaScript and compiles PCL for development usenpm run build:js
to package the production version of JavaScript codenpm run build:wasm
to compile PCL's WebAssembly +src/bind
to WebAssembly production buildnpm run build
bundles JavaScript and compiles PCL at the same time, ready for production usenpm run lint
to check code stylenpm run test
to run tests. (Be sure to runnpm run dev:js
ornpm run build:js
before running tests)