Skip to content

Latest commit

 

History

History
67 lines (42 loc) · 1.8 KB

CONTRIBUTING.md

File metadata and controls

67 lines (42 loc) · 1.8 KB

Contributing to kindle-ui

Want to contribute to kindle-ui? There are a few things you need to know.

Start development

git clone https://github.com/rivertwilight/kindle-ui.git

It's recommended to use vscode workspace to open this project. You can do this by cliking the kindle-ui.codespace file.

Then, run this commands in root folder with Yarn 1.x.

yarn
yarn run dev

Open https://localhost:3000 at your browser and start hacking!.

How does it work?
We use yarn's workspace to manage the dependency, which is enabled in package.json by:

```json
"workspaces": [
    "packages/*"
]
```

In the [docs](./packages/docs/) folder, we'll link '@kindle-ui/core' to local version instead of the online so we can test the component locally.

```json
"dependencies": {
    "@kindle-ui/core": "workspace:*",
}
```

Publish the package

  1. Change the version number in package.json of the package you want to update (e.g. @kindle-ui/core)

  2. Run these command at the package directory

npm publish

常见问题

I. 抛出“Can't resolve 'kindle-ui'...”之类的错误

请尝试以下三种解决方案:

  1. 检查dist文件夹是否为空,如果是,运行npm run build构建生产包,然后运行npm run dev

  2. 检查playground/node_modules/kindle-ui是否存在并链接到根目录。 如果没有,你可能需要在 playgrpund 文件夹中手动运行 npm i ../ -save

  3. 如果 1 和 2 都不起作用,打开两个终端,在第一个终端运行npm run build-watch,在另一个终端运行npm run start-playground

Reference