The following list describes which NPM packages Taro consists of and what each package does.
|Tool library, mainly for CLI, compile-time use|
|Tool library, mainly for compilation tools for mini program and H5|
|Tool library, mainly for runtime use|
|Expose the Taro objects needed on each end|
|Taro API independent of each platform|
|PostCSS plugin that converts |
|Mini program compiler tool, mainly used for setting up and calling Webpack|
|Mini program specific React renderer based on |
|Mini program Runtime Adapter Core|
|Wechat mini program plugin|
|Alipay mini program plugin|
|Baidu smart program plugin|
|ByteDance mini program plugin|
|QQ mini program plugin|
|Jingdong mini program plugin|
|Support for plugins that use HTML tags|
|PostCSS plugin, class name for handling HTML tags|
|Support for plugins using React DevTools|
|H5 compiler tool, mainly used for setting up and calling Webpack|
|H5 API implemented according to the WeChat mini program specification|
|H5 Component Library（Web Components version）|
|H5 Component Library (React version)|
|Babel plugin that allows the API to be used by |
|PostCSS plugin for handling the height of the |
|RN Component Library|
|RN compiler tool, mainly used to set up and call metro|
|RN style conversion tool to make RN support sass、less、stylus、postcss|
|RN Basic metro configuration|
|RN application portal and page conversion tool that allows RN to support Taro-defined app and page config|
|RN Runtime Packaging|
|The API implemented on the RN side according to the WeChat mini program specification|
|Babel plugin for jsx to support className attribute|
|Converting css to RN stylesheet|
|Mini program to Taro compiler|
|Runtime adapter for mini program to Taro|
Need to make sure your Node.js version is greater than
8 (it is recommended to install
10.5 or higher)
First fork a copy of the Taro repository to your Github, then clone the project locally and switch to the
Then run the following commands in sequence.
After running the above command, the environment is ready and you can pull a new branch for development.
.eslintrc.jsin the root directory and
tsconfig.jsonin the relevant package directory for details.
- Styles: follow the
.stylelintrcstyle in the relevant package directory.
During debugging, the npm link command is typically used to softlink the package to be debugged to a test project.
To debug compile-time code, please refer to "Single-step debugging".
Debug Runtime code, you can breakpoint debug directly.
The packages are currently equipped with unit tests for.
After modifying the above packages, developers should make sure to run
lerna run test:ci --scope [package name] to check if the test cases all pass.
Also, after developing some important features, please take time to fill in the corresponding test cases.
snapshot (snapshot of test results), and modifying these two packages or some other packages may cause these snapshots to fail, and thus fail the tests. When you modify these two packages, or if CI prompts you with a test case error for these two packages, run
lerna run updateSnapshot --scope [package name] to update the snapshot and resubmit.
When entering the
commit message, please make sure to follow the Angular Style Commit Message Conventions Specifications.
When a commit involves new features, Breaking Changes or important modifications, please add or modify the corresponding documentation.
Please read Modifying Documentation for more information about the development of documentation。
If you are not familiar with PR (Pull Request), please read 《About Pull Requests》
After completing the development and pushing it to your own Taro repository, you are ready to submit the Pull Request.
Before submitting a PR, please read the following notes.
- make sure
npm run buildcompiles successfully.
- Make sure the code passes the ESLint test.
- ensure that all test cases pass when the package in question has the
- when the related package has test cases, add the corresponding test cases to your commit code as well.
- ensure that the commit message needs to follow the Angular Style Commit Message Conventions.
- If the commit code is very large or complex, you can divide the PR into several commits together. We will squash as appropriate when merging.
- PR authors can choose to join Taro Developer WeChat group for merging PRs and technical communication.