Skip to content

Commit

Permalink
workflow: switch to pnpm (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu authored Oct 7, 2021
1 parent 4d4be24 commit 49ddb1f
Show file tree
Hide file tree
Showing 9 changed files with 5,585 additions and 5,459 deletions.
32 changes: 21 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,25 @@ jobs:
matrix:
node-version: [14, 16]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- name: Checkout
uses: actions/checkout@v2

- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 6.15.1

- name: Set node version to ${{ matrix.node_version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: install and test
run: |
yarn install
yarn test
- name: build
run: |
yarn build
node-version: ${{ matrix.node_version }}
cache: "pnpm"

- name: Install deps
run: pnpm install

- name: Build
run: pnpm run build

- name: Test
run: pnpm run test
9 changes: 6 additions & 3 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
"private": true,
"name": "vitepress-example-minimal",
"scripts": {
"dev": "node ../../bin/vitepress dev",
"build": "node ../../bin/vitepress build",
"serve": "node ../../bin/vitepress serve"
"dev": "vitepress dev",
"build": "vitepress build",
"serve": "vitepress serve"
},
"devDependencies": {
"vitepress": "workspace:*"
}
}
7 changes: 7 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build.environment]
NODE_VERSION = "16"
NPM_FLAGS = "--version" # prevent Netlify npm install

[build]
publish = "docs/.vitepress/dist"
command = "npx pnpm i --store=node_modules/.pnpm-store && npm run ci-docs"
19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@
"types"
],
"scripts": {
"dev": "yarn dev-shared && yarn dev-start",
"dev": "pnpm run dev-shared && pnpm run dev-start",
"dev-start": "run-p dev-client dev-node dev-watch",
"dev-client": "tsc -w -p src/client",
"dev-node": "tsc -w -p src/node",
"dev-shared": "node scripts/copyShared",
"dev-watch": "node scripts/watchAndCopy",
"prebuild": "rimraf -rf dist && node scripts/copyShared",
"build": "run-s build-client build-node build-types",
"build": "run-s build-prepare build-client build-node build-types",
"build-prepare": "rimraf -rf dist && node scripts/copyShared",
"build-client": "tsc -p src/client && node scripts/copyClient",
"build-node": "rollup -c scripts/rollup.config.js",
"build-types": "run-s build-types-client build-types-node",
"build-types-client": "tsc -p src/client --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.client.json && rimraf dist/temp",
"build-types-node": "tsc -p src/node --declaration --emitDeclarationOnly --outDir dist/temp && api-extractor run -c api-extractor.node.json && rimraf dist/temp",
"lint": "yarn lint:js && yarn lint:ts",
"lint": "pnpm run lint:js && pnpm run lint:ts",
"lint:js": "prettier --check --write \"{bin,docs,scripts,src}/**/*.js\"",
"lint:ts": "prettier --check --write --parser typescript \"{__tests__,src,docs,types}/**/*.ts\"",
"test": "jest",
Expand All @@ -35,8 +35,9 @@
"docs": "run-p dev docs-dev",
"docs-dev": "node ./bin/vitepress dev docs",
"docs-debug": "node --inspect-brk ./bin/vitepress dev docs",
"docs-build": "yarn build && node ./bin/vitepress build docs",
"docs-serve": "node ./bin/vitepress serve docs"
"docs-build": "pnpm run build && node ./bin/vitepress build docs",
"docs-serve": "node ./bin/vitepress serve docs",
"ci-docs": "run-s build docs-build"
},
"engines": {
"node": ">=12.0.0"
Expand Down Expand Up @@ -71,9 +72,10 @@
"@docsearch/css": "^1.0.0-alpha.28",
"@docsearch/js": "^1.0.0-alpha.28",
"@vitejs/plugin-vue": "^1.9.0",
"@vue/runtime-dom": "^3.2.18",
"prismjs": "^1.23.0",
"vite": "^2.5.0",
"vue": "^3.2.13",
"prismjs": "^1.23.0"
"vue": "^3.2.13"
},
"devDependencies": {
"@microsoft/api-extractor": "^7.18.9",
Expand Down Expand Up @@ -117,6 +119,7 @@
"minimist": "^1.2.5",
"npm-run-all": "^4.1.5",
"ora": "^5.4.0",
"pnpm": "^6.15.1",
"polka": "^0.5.2",
"prettier": "^2.3.0",
"rimraf": "^3.0.2",
Expand Down
Loading

0 comments on commit 49ddb1f

Please sign in to comment.