Skip to content

Development

vagusX edited this page Dec 15, 2023 · 16 revisions

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 visual-regression -- --base-ref=master --pr-id=anything