Skip to content

Commit 11223f7

Browse files
committed
ci: using pnpm workspace
1 parent 53cc2dd commit 11223f7

File tree

13 files changed

+15148
-14426
lines changed

13 files changed

+15148
-14426
lines changed

.github/CONTRIBUTING.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
## Development Setup
22

3-
This project uses a monorepo setup that requires using [Yarn](https://yarnpkg.com) because it relies on [Yarn workspaces](https://yarnpkg.com/blog/2017/08/02/introducing-workspaces/).
3+
This project uses a monorepo setup that requires using [pnpm](https://pnpm.io/) because it relies on [pnpm workspaces](https://pnpm.io/workspaces).
44

55
``` sh
6-
# Install all dependencies.
7-
yarn
6+
# Install all dependencies, i.e. pnpm install --prefer-offline
7+
npm run bootstrap
88

99
# Serves VuePress' own docs with itself.
10-
yarn dev
10+
npm run dev
1111

1212
# Build VuePress' own docs with itself.
13-
yarn build
13+
npm run build
1414

1515
# Clean dependencies.
16-
yarn clean
16+
npm run clean
1717

1818
# Useful when creating new a package.
19-
yarn boot
19+
npm run boot
2020
```
2121

2222
## Testing Setup
@@ -25,10 +25,10 @@ VuePress leverages [jest](https://jestjs.io/) for its tests, testing process dep
2525

2626
```bash
2727
# Execute all the test suites.
28-
yarn test
28+
npm run test
2929

3030
# Execute tests under specfic package.
31-
yarn test -p=core ## OR --package=core
31+
npm run test -p=core ## OR --package=core
3232
```
3333

3434
## Core Packages

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ about: Create a report to help us improve
2424

2525
<!-- If you are reporting a bug that can ONLY be reproduced on your repository, PLEASE provide this repo link. That takes guessing work out of the way and saves us time. -->
2626

27-
<!-- If your repo isn't public, you can use `codesandbox` or `yarn create vuepress` to create a minimal reproduction -->
27+
<!-- If your repo isn't public, you can use `codesandbox` or `npm create vuepress` to create a minimal reproduction -->
2828

2929
#### What is expected?
3030

.github/workflows/pull-request-ci.yml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,34 @@ jobs:
1111
- uses: actions/setup-node@v1
1212
with:
1313
node-version: '12'
14-
- name: Get yarn cache directory path
15-
id: yarn-cache-dir-path
16-
run: echo "::set-output name=dir::$(yarn cache dir)"
17-
- uses: actions/cache@v1
14+
15+
- name: Cache pnpm modules
16+
uses: actions/cache@v2
1817
with:
19-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
20-
key: ${{ runner.os }}-node-modules-${{ hashFiles('yarn.lock') }}
18+
path: ~/.pnpm-store
19+
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
2120
restore-keys: |
22-
${{ runner.os }}-node-modules-
2321
${{ runner.os }}-
2422
23+
- uses: pnpm/action-setup@v2.0.1
24+
with:
25+
version: 6.0.2
26+
run_install: true
27+
2528
- name: Install dependencies
26-
if: steps.yarn-cache.outputs.cache-hit != 'true'
27-
run: yarn
29+
run: pnpm run bootstrap
2830

2931
- name: Run tsc
30-
run: yarn tsc
32+
run: pnpm run tsc
3133

3234
- name: Run unit tests
33-
run: yarn test
35+
run: pnpm run test
3436

3537
- name: Check linter
36-
run: yarn lint
38+
run: pnpm run lint
3739

3840
- name: Check markdown linter
39-
run: yarn workspace docs lint-md
41+
run: pnpm run workspace docs lint-md
4042

4143
- name: Build vuepress
42-
run: yarn build
44+
run: pnpm run build

.gitpod.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ ports:
22
- port: 8080
33
onOpen: open-preview
44
tasks:
5-
- init: yarn
6-
command: yarn dev
5+
- init: npm run bootstrap
6+
command: npm run dev

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ Check out our docs at https://vuepress.vuejs.org/.
2929
Want to contribute? Check our [Contributing Guide](.github/CONTRIBUTING.md) and [issues for beginners](https://github.com/vuejs/vuepress/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)!
3030

3131
```bash
32-
yarn install # install all dependencies
33-
yarn dev # serves VuePress' own docs with itself
34-
yarn test # make sure your code change pass the test
32+
npm run bootstrap # install all dependencies
33+
npm run dev # serves VuePress' own docs with itself
34+
npm run test # make sure your code change pass the test
3535
```
3636

3737
If you don't have a local checkout, you can also open [VuePress in Gitpod](https://gitpod.io/#https://github.com/vuejs/vuepress/blob/master/packages/docs/docs/README.md), a free online IDE for GitHub.

lerna.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
2-
"npmClient": "yarn",
3-
"useWorkspaces": true,
42
"version": "1.8.2",
3+
"packages": [
4+
"packages/@vuepress/*",
5+
"packages/vuepress",
6+
"packages/docs"
7+
],
58
"command": {
69
"version": {
710
"allowBranch": "master",

package.json

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,28 @@
11
{
22
"private": true,
33
"description": "Minimalistic doc generator with Vue component based layout system",
4-
"workspaces": [
5-
"packages/@vuepress/*",
6-
"packages/vuepress",
7-
"packages/docs"
8-
],
94
"scripts": {
105
"boot": "node scripts/bootstrap.js",
11-
"build": "yarn tsc && yarn build:docs",
12-
"build:docs": "yarn workspace docs build",
6+
"bootstrap": "pnpm install --prefer-offline",
7+
"build": "npm run tsc && npm run build:docs",
8+
"build:docs": "lerna exec --scope=docs -- npm run build",
139
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 2",
14-
"clean": "lerna clean && rm -rf node_modules",
15-
"dev": "yarn tsc && yarn dev:docs",
16-
"dev:docs": "yarn workspace docs dev",
10+
"clean": "lerna clean --yes && rm -rf node_modules",
11+
"dev": "npm run tsc && npm run dev:docs",
12+
"dev:docs": "lerna exec --scope=docs -- npm run dev",
1713
"lint": "eslint packages --ext .js,.ts,.vue",
1814
"packages:changed": "lerna changed",
1915
"packages:diff": "lerna diff",
2016
"packages:list": "lerna ls -l",
21-
"register-vuepress": "lerna exec --scope vuepress -- yarn link",
22-
"release": "yarn lint && yarn build && yarn test && node scripts/release.js",
17+
"register-vuepress": "lerna exec --scope vuepress -- npm run link",
18+
"release": "npm run lint && npm run build && npm run test && node scripts/release.js",
2319
"remote-version": "node scripts/remote-version.js",
24-
"show-help": "yarn workspace docs show-help",
20+
"show-help": "lerna exec --scope=docs -- npm run show-help",
2521
"test": "node scripts/test.js",
26-
"tsc": "yarn workspace @vuepress/shared-utils tsc",
27-
"unregister-vuepress": "lerna exec --scope vuepress -- yarn unlink",
22+
"tsc": "lerna exec --scope @vuepress/shared-utils -- npm run tsc",
23+
"unregister-vuepress": "lerna exec --scope vuepress -- npm run unlink",
2824
"update-core-team": "all-contributors generate",
29-
"view-info": "yarn tsc && yarn workspace docs view-info"
25+
"view-info": "npm run tsc && lerna exec --scope docs -- npm run view-info"
3026
},
3127
"husky": {
3228
"hooks": {

packages/@vuepress/shared-utils/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
},
2020
"license": "MIT",
2121
"author": "ULIVZ <chl814@foxmail.com>",
22+
"main": "lib/index.js",
23+
"types": "types/index.d.ts",
2224
"files": [
2325
"lib",
2426
"types"
2527
],
26-
"main": "lib/index.js",
27-
"types": "types/index.d.ts",
2828
"scripts": {
2929
"tsc": "tsc",
3030
"update-index": "node scripts/update-index.js"
@@ -36,6 +36,7 @@
3636
"globby": "^9.2.0",
3737
"gray-matter": "^4.0.1",
3838
"hash-sum": "^1.0.2",
39+
"markdown-it-emoji": "^1.4.0",
3940
"semver": "^6.0.0",
4041
"toml": "^3.0.0",
4142
"upath": "^1.1.0"

packages/docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"scripts": {
2222
"build": "vuepress build docs --temp .temp",
2323
"dev": "vuepress dev docs --temp .temp",
24-
"lint-md": "yarn lint-md:style && yarn lint-md:wording",
24+
"lint-md": "npm run lint-md:style && npm run lint-md:wording",
2525
"lint-md:style": "remark --quiet --frail .",
2626
"lint-md:wording": "textlint ./docs/**/*.md",
2727
"show-help": "vuepress --help",

packages/vuepress/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ The docs are available at <https://vuepress.vuejs.org>
3232
Want to contribute? Check our [issues for beginners](https://github.com/vuejs/vuepress/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)!
3333

3434
```bash
35-
yarn # Install and link dependencies for this monorepo
36-
yarn dev # serves VuePress' own docs with itself
37-
yarn test # make sure your code change pass the test
35+
npm run bootstrap # Install and link dependencies for this monorepo
36+
npm run dev # serves VuePress' own docs with itself
37+
npm run test # make sure your code change pass the test
3838
```
3939

4040
If you don't have a local checkout, you can also open [VuePress in Gitpod](https://gitpod.io/#https://github.com/vuejs/vuepress/blob/master/packages/docs/docs/README.md), a free online IDE for GitHub.

0 commit comments

Comments
 (0)