17 Development
vagusX edited this page 2024-07-28 19:09:49 +08:00
This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Folders

├── components    # react source code and demos
├── docs          # documentation in markdown
├── scripts       # 
├── site          # website layout and code
└── package.json

Local development

Fork and git clone.

$ npm install
$ npm start

// change start theme
$ DEV_THEME=dark npm start

Then visit http://127.0.0.1:8001


Test Case and Lint

lint source code

$ npm run lint

Run all test cases

$ npm test

Run test cases for one file

$ npm test components/button/__tests__/index.test.js

Update snapshot files

$ npm test -u

Publish site to gh-pages

$ npm update && npm run deploy

npm publish tip for Administrators轮值规则和版本发布流程

Run Visual-Regression Diff locally

Warning

ImageSnapshots from target branch should named as imageSnapshots-{targetBranch} in projectRoot, like imageSnapshots-master.

Tip

You can download imageSnapshots from target branch or run npm run test-image locally on target branch to generate imageSnapshots

npm run test-image
# --base-ref should be the target branch you want to compare
LOCAL=1 npm run test:visual-regression -- --base-ref=master --pr-id=anything