Skip to content

Commit

Permalink
Merge pull request #355 from tyn1998/docs/gh-257
Browse files Browse the repository at this point in the history
chore: node version locked
  • Loading branch information
pomelo-nwu committed Jun 14, 2023
2 parents d98480c + 8b7fb34 commit 280adce
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 14 deletions.
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ G6VP 产品中包含了很多的惊喜功能,大家可以前往「开放市场

## 02. 开发 G6VP

G6VP 采用 pnpm 管理仓库,根据 pnpm 的官方[兼容性说明](https://pnpm.io/installation#compatibility),请提前使用 nvm 切换 Node.js 版本到 14 及其以上
G6VP 采用 pnpm 包管理工具,并使用 Node 16 进行开发。Node 版本过高在安装依赖和运行 NPM 脚本时可能存在问题,建议使用 [nvm](https://github.com/nvm-sh/nvm) 管理 Node 版本

### 2.1 安装依赖

Expand Down
12 changes: 2 additions & 10 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,7 @@
| packages/gi-portal | `-` | G6VP 首页 |
| packages/gi-httpservice | `@antv/gi-httpservices` | G6VP BFF 服务 |

### 02 进入到每个子包中启动,遇到依赖找不到的问题

注意 ⚠️: cd 到每个子包的目录时候,一定要注意查看 node 的版本,比如我的默认 node 版本是 12, 切换到 16 装完所有依赖,此时进入到每个子包中, node 的版本自动切换到 12,执行命令是找不到安装的依赖的,所以得重新 `nvm use 16`,这样就可以了,如果想一劳永逸,可以在 zsh terminal 中设置

```bash
nvm alias default v16.17.0
```

### 03 如何发布版本
### 02 如何发布版本

G6VP 采用 [changesets](https://pnpm.io/using-changesets) 来进行包版本管理和发布,因此不需要手动维护版本号,只需要在提交代码时,使用`pnpm run changeset`来生成对应的版本号即可。

Expand Down Expand Up @@ -88,6 +80,6 @@ cd packages/gi-site
npm run deploy
```

### 04 如何打包 gi-httpservice
### 03 如何打包 gi-httpservice

- 在根目录下执行 `npm run tar:gi-httpservice`
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"engines": {
"node": ">=14.0.0"
"node": "^16"
},
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down
4 changes: 2 additions & 2 deletions packages/gi-site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
"main": "dist/app.js",
"scripts": {
"analyse": "ANALYZE=1 NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build": "node scripts/pre-build.mjs && NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build": "node --experimental-json-modules scripts/pre-build.mjs && NODE_OPTIONS=--max_old_space_size=4096 umi build",
"build:docker": "cd ../../ && npm run build:all:umd && cd packages/gi-site/ && BUILD_MODE=docker node scripts/pre-build.mjs && node scripts/copy-assets.mjs && BUILD_MODE=docker NODE_OPTIONS=--max_old_space_size=4096 umi build",
"deploy": "node ./scripts/deploy.js",
"start": "node scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev"
"start": "node --experimental-json-modules scripts/pre-build.mjs && cross-env NODE_OPTIONS=--max_old_space_size=4096 cross-env PORT=8000 umi dev"
},
"dependencies": {
"@ant-design/charts": "^1.0.21",
Expand Down

0 comments on commit 280adce

Please sign in to comment.