Skip to content

Contribute to Candy Shop

張泰瑋(Chang Tai Wei) edited this page Jan 17, 2023 · 5 revisions

Contributors

We're welcoming to receive any contribution for candy-shop! Feel free to open a PR and request LIQNFT team to review.

Following is basic set up you might need to know before building up together.

Prerequisite

Install Node (above 14.17.x), NPM, Yarn

Launch example

Installing & Building all required packages by setup.sh

Use setup.sh in root folder.

# run chmod when executing it first time
chmod 755 setup.sh

# for non-dev environment
./setup.sh

# for dev environment: Symbolic link between types, ui and sdk
# Currently, core/ui depends on the published package from core/sdk and core/types, if developing locally, we need to use symbolic link to let core/ui use the live changes from core/sdk and core/types.
./setup.sh --link-build

In root folder, hosting dist from example at localhost:1234

yarn start

How to reflect the changes after linked

Always build types first.

  1. In core/types
yarn build

then build sdk

  1. In core/sdk
yarn build
  1. In core/ui
yarn build
  1. In root folder
yarn build

If you're using yarn start in root folder while development, it will automatically detect the changes from core/ui once you performed the yarn build under the core/ui.

Clean node_modules for clean building

In root folder

yarn clean:all

We also have individual clean up scripts provided in root's package.json.

Formatting

In root folder

yarn format:fix

Branch Naming

To help reviewers differentiate the PR, define your dev branch with module name like following.

branch: module/descriptive-short-sentence (lowercase)

e.g. ui/update-button-styles, core/refactor-backend-api, etc.

Branch Type Purpose
types Changes made for files across in src/types
core Changes made for files across in src/core
sdk Changes particularly for src/core/sdk
ui Changes particularly for src/core/ui
cli Changes particularly for src/core/cli
chore Changes to the build process or auxiliary tools and libraries
doc Documentation only changes

Commit Message

e.g.

[ui] update button styles

Descriptive message to record what will change.
[sdk] update api

Descriptive message to record what will change.

Check your branch by Build CI

We have workflow that will build candy-shop with local link to make sure no build error before publish.

  1. Go Action tab
  2. Click Build workflow
  3. Seeing "Run workflow" dropdown button
  4. Select the target branch and input the Branch Type