chore: change package manager to pnpm

This commit is contained in:
mutoe 2022-12-01 21:28:32 +08:00
parent 2028366292
commit d1e94c1efa
No known key found for this signature in database
GPG Key ID: 7197231B847AE2EE
8 changed files with 4127 additions and 3751 deletions

View File

@ -13,27 +13,22 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
with:
version: 7
run_install: false
# https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18.x
cache: 'pnpm'
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
run: pnpm install
- name: E2E test
run: yarn test:e2e:prod
run: pnpm test:e2e:prod

View File

@ -17,33 +17,27 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
# https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v2.2.4
with:
node-version: 16.x
version: 7
run_install: false
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18.x
cache: 'pnpm'
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
run: pnpm install
- name: TypeScript check
run: yarn lint:tsc
run: pnpm lint:tsc
- name: Eslint check
run: yarn lint:script
run: pnpm lint:script
unit_test:
name: Unit test
@ -53,30 +47,24 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
# https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v2.2.4
with:
node-version: 16.x
version: 7
run_install: false
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18.x
cache: 'pnpm'
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
run: pnpm install
- name: Unit test
run: yarn test:unit:ci
run: pnpm test:unit:ci
- name: Update coverage report
uses: codecov/codecov-action@v1
@ -91,27 +79,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
# https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- uses: pnpm/action-setup@v2.2.4
with:
node-version: 16.x
version: 7
run_install: false
- name: Get yarn cache
id: yarn-cache
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v1
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
path: ${{ steps.yarn-cache.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
node-version: 18.x
cache: 'pnpm'
- name: Install dependencies
run: yarn install --skip-integrity-check --non-interactive --no-progress
run: pnpm install --skip-integrity-check --non-interactive --no-progress
- name: E2E test
run: yarn test:e2e:ci
run: pnpm test:e2e:ci

View File

@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn lint-staged
npm exec lint-staged

View File

@ -1,5 +1,5 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
yarn lint
yarn build
npm run lint
npm run build

View File

@ -32,21 +32,21 @@ For more information on how to this works with other frontends/backends, head ov
# Getting started
```shell script
yarn install
pnpm install
# Development
yarn dev
pnpm dev
# Build dist
yarn build
pnpm build
# Run unit tests
yarn test:unit
yarn test:unit:ci
pnpm test:unit
pnpm test:unit:ci
# Run E2E tests
yarn test:e2e
yarn test:e2e:ci
pnpm test:e2e
pnpm test:e2e:ci
```
# Contributors

View File

@ -9,13 +9,13 @@
"serve": "vite preview --port 4137",
"lint:script": "eslint \"{src/**/*.{ts,vue},cypress/**/*.ts}\"",
"lint:tsc": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
"lint": "concurrently \"yarn lint:tsc\" \"yarn lint:script\"",
"lint": "concurrently \"npm run lint:tsc\" \"npm run lint:script\"",
"test:unit": "cypress open --component",
"test:unit:ci": "cypress run --component --quiet --reporter spec",
"test:e2e": "yarn build && concurrently -rk -s first \"yarn serve\" \"cypress open --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e:ci": "yarn build && concurrently -rk -s first \"yarn serve\" \"cypress run --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e": "npm run build && concurrently -rk -s first \"npm run serve\" \"cypress open --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e:ci": "npm run build && concurrently -rk -s first \"npm run serve\" \"cypress run --e2e -c baseUrl=http://localhost:4137\"",
"test:e2e:prod": "cypress run --e2e -c baseUrl=https://vue3-realworld-example-app-mutoe.vercel.app",
"test": "yarn test:unit:ci && yarn test:e2e:ci",
"test": "npm run test:unit:ci && npm run test:e2e:ci",
"generate:api": "sta -p https://raw.githubusercontent.com/gothinkster/realworld/main/api/openapi.yml -o ./src/services -n api.ts"
},
"dependencies": {

4070
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

3671
yarn.lock

File diff suppressed because it is too large Load Diff