Skip to content

Commit

Permalink
chore: update packageManager version and contribution guide
Browse files Browse the repository at this point in the history
Signed-off-by: Artea <[email protected]>
  • Loading branch information
Sepush committed Jan 7, 2025
1 parent c96427d commit 8af71be
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
17 changes: 16 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
- For new features & bug fixes, please create pull request to `main` branch.
- For documentation, please create pull request to `docs` branch.

## Recommend Tool

- [fnm](https://github.com/Schniz/fnm) to manage node version
- [corepack](https://github.com/nodejs/corepack) to manage packageManager version

```bash
# set node version to 22 or above
fnm use v22
# prepreck package manager
corepack enable&&corepack prepare
```

## Useful Commands

```bash
# open the dev server, please note that hot module reload doesn't work well
# if you find anything doesn't work, just refresh the page
# if you aren't able to open the page at the first time, try to refresh a couple of times
# pnpm version 7.0.0 and above is required
# The version of the package manager must match the version specified in the packageManager field of package.json.
pnpm run dev

# testing
Expand All @@ -30,6 +42,9 @@ pnpm run lint:type
# lint code & type
pnpm run lint

# lint auto fix
pnpm lint:fix

# build site (if vercel preview failed, you might need to run `git clean -fdx` first)
pnpm run build:site
```
Expand Down
17 changes: 16 additions & 1 deletion CONTRIBUTING.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,25 @@
- 对于新特性和 bug fix,请对 `main` 分支提交 Pull Request
- 对于文档更新,请对 `docs` 分支提交 Pull Request

## 推荐工具

- [fnm](https://github.com/Schniz/fnm) 管理 node 版本
- [corepack](https://github.com/nodejs/corepack) 管理包管理器版本

```bash
# 设置 node 版本
fnm use v22
# 准备对应版本的包管理器
corepack enable&&corepack prepare
```

## 有用的指令

```bash
# 开启开发服务器,注意热更新不是很好用
# 如果你觉得哪里有问题,刷新页面即可
# 第一次运行打不开时,你可以试试刷新几次浏览器
# 需要 pnpm 在 7.0.0 及以上版本
# 需要 pnpm 版本和 package.json 的 packageManager 字段一致
pnpm run dev

# 测试
Expand All @@ -30,6 +42,9 @@ pnpm run lint:type
# 上面俩个都检查
pnpm run lint

# 自动修复以上 lint 错误
pnpm lint:fix

# 构建文档网站(如果 vercel 的预览挂掉了,你可能需要先运行一下 `git clean -fdx`)
pnpm run build:site
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "naive-ui",
"version": "2.41.0",
"packageManager": "pnpm@9.5.0",
"packageManager": "pnpm@10.0.0",
"description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
"author": "07akioni",
"license": "MIT",
Expand Down

0 comments on commit 8af71be

Please sign in to comment.