Skip to content

Commit 695fe21

Browse files
committed
chore: migrate to pnpm
1 parent 65f0d01 commit 695fe21

File tree

17 files changed

+8940
-11655
lines changed

17 files changed

+8940
-11655
lines changed

.github/workflows/beta-release.yml

+47-20
Original file line numberDiff line numberDiff line change
@@ -8,58 +8,85 @@ jobs:
88
name: Build and release
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- name: Clone repository
12+
uses: actions/checkout@v4
1213
with:
1314
fetch-depth: 0 # fetch full history, so changelog can be generated
14-
- uses: actions/setup-node@v2
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
- name: Get pnpm store directory
24+
shell: bash
25+
run: |
26+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27+
- name: Setup pnpm cache
28+
uses: actions/cache@v4
1529
with:
16-
node-version: '14'
30+
path: ${{ env.STORE_PATH }}
31+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
32+
restore-keys: |
33+
${{ runner.os }}-pnpm-store-
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Build
39+
run: pnpm build
1740

18-
- run: yarn install --immutable
41+
- name: Lint
42+
run: pnpm lint
1943

20-
- run: yarn run build
44+
- name: Unit tests
45+
run: pnpm test
2146

22-
- run: yarn run lint
23-
- run: yarn run test
24-
- run: yarn run test-types
47+
- name: Types tests
48+
run: pnpm test-types
2549

26-
- name: git config
50+
- name: Configure Git user
2751
run: |
2852
git config user.name github-actions[bot]
2953
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
3054
31-
- name: Create release
55+
- name: Create beta release
3256
id: create_release
3357
run: |
34-
yarn run release --prerelease beta
58+
pnpm release --prerelease beta
3559
echo ::set-output name=tag_name::$(git describe HEAD --abbrev=0)
3660
37-
- name: copy README and LICENSE to packages
61+
- name: Copy README and LICENSE to packages
3862
run: |
3963
cp README.md packages/aws-sdk-client-mock/README.md
4064
cp LICENSE packages/aws-sdk-client-mock/
4165
cp LICENSE packages/aws-sdk-client-mock-jest/
4266
43-
- name: run e2e tests
67+
- name: E2E tests
4468
run: |
45-
yarn run verdaccio &
46-
yarn run local-publish
47-
yarn run test-e2e
69+
pnpm verdaccio &
70+
pnpm local-publish
71+
pnpm test-e2e
4872
49-
- run: yarn run publish --tag beta
73+
- name: Set publishing config
74+
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
5075
env:
51-
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
76+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
77+
- name: Publish beta to npm
78+
run: pnpm publish --tag beta
5279

5380
- uses: ad-m/github-push-action@master
5481
with:
5582
github_token: ${{ secrets.GITHUB_TOKEN }}
5683
tags: true
5784

5885
- name: Generate Release body
59-
run: npx extract-changelog-release > RELEASE_BODY.md
86+
run: pnpm extract-changelog-release > RELEASE_BODY.md
6087

6188
- name: Create GitHub Release
62-
uses: softprops/action-gh-release@v1
89+
uses: softprops/action-gh-release@v2
6390
with:
6491
token: ${{ secrets.GITHUB_TOKEN }}
6592
tag_name: ${{ steps.create_release.outputs.tag_name }}

.github/workflows/ci.yml

+35-21
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,48 @@ jobs:
1111
name: Test and build
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
15-
- uses: actions/setup-node@v2
14+
- name: Clone repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node
18+
uses: actions/setup-node@v4
1619
with:
17-
node-version: '14'
20+
node-version: '20'
1821

19-
- name: Get yarn cache directory path
20-
id: yarn-cache-dir-path
21-
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
22-
- uses: actions/cache@v3
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
- name: Get pnpm store directory
25+
shell: bash
26+
run: |
27+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
28+
- name: Setup pnpm cache
29+
uses: actions/cache@v4
2330
with:
24-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
25-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31+
path: ${{ env.STORE_PATH }}
32+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
2633
restore-keys: |
27-
${{ runner.os }}-yarn-
34+
${{ runner.os }}-pnpm-store-
35+
36+
- name: Install dependencies
37+
run: pnpm install --frozen-lockfile
38+
39+
- name: Build
40+
run: pnpm build
2841

29-
- run: yarn install --immutable
42+
- name: Lint
43+
run: pnpm lint
3044

31-
- run: yarn run build
45+
- name: Unit tests
46+
run: pnpm test
3247

33-
- run: yarn run lint
34-
- run: yarn run test
35-
- run: yarn run test-types
48+
- name: Types tests
49+
run: pnpm test-types
3650

37-
- name: bump version
38-
run: yarn run release --skip.commit --skip.tag
51+
- name: Bump version
52+
run: pnpm release --skip.commit --skip.tag
3953

40-
- name: run e2e tests
54+
- name: E2E tests
4155
run: |
42-
yarn run verdaccio &
43-
yarn run local-publish
44-
yarn run test-e2e
56+
pnpm verdaccio &
57+
pnpm local-publish
58+
pnpm test-e2e

.github/workflows/pr.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ on:
77
- edited
88
- synchronize
99

10+
permissions:
11+
pull-requests: read
12+
1013
jobs:
1114
lint_pr:
1215
name: Lint PR
1316
runs-on: ubuntu-latest
1417
steps:
15-
- uses: amannn/action-semantic-pull-request@v3.4.0
18+
- uses: amannn/action-semantic-pull-request@v5.5.2
1619
env:
1720
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18-
with:
19-
validateSingleCommit: true

.github/workflows/release.yml

+49-21
Original file line numberDiff line numberDiff line change
@@ -8,64 +8,92 @@ jobs:
88
name: Build and release
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- name: Clone repository
12+
uses: actions/checkout@v4
1213
with:
1314
fetch-depth: 0 # fetch full history, so changelog can be generated
14-
- uses: actions/setup-node@v2
15+
16+
- name: Setup Node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
- name: Get pnpm store directory
24+
shell: bash
25+
run: |
26+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
27+
- name: Setup pnpm cache
28+
uses: actions/cache@v4
1529
with:
16-
node-version: '14'
30+
path: ${{ env.STORE_PATH }}
31+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
32+
restore-keys: |
33+
${{ runner.os }}-pnpm-store-
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Build
39+
run: pnpm build
1740

18-
- run: yarn install --immutable
41+
- name: Lint
42+
run: pnpm lint
1943

20-
- run: yarn run build
44+
- name: Unit tests
45+
run: pnpm test
2146

22-
- run: yarn run lint
23-
- run: yarn run test
24-
- run: yarn run test-types
47+
- name: Types tests
48+
run: pnpm test-types
2549

26-
- name: git config
50+
- name: Configure Git user
2751
run: |
2852
git config user.name github-actions[bot]
2953
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
3054
3155
- name: Create release
3256
id: create_release
3357
run: |
34-
yarn run release
58+
pnpm release
3559
echo ::set-output name=tag_name::$(git describe HEAD --abbrev=0)
3660
37-
- run: yarn run docs
38-
- name: commit docs website
61+
- name: Generate docs website
62+
run: pnpm docs
63+
- name: Commit docs website
3964
run: |
4065
git add docs
4166
git diff-index --quiet HEAD || git commit -m 'docs: update docs website'
4267
43-
- name: copy README and LICENSE to packages
68+
- name: Copy README and LICENSE to packages
4469
run: |
4570
cp README.md packages/aws-sdk-client-mock/README.md
4671
cp LICENSE packages/aws-sdk-client-mock/
4772
cp LICENSE packages/aws-sdk-client-mock-jest/
4873
49-
- name: run e2e tests
74+
- name: E2E tests
5075
run: |
51-
yarn run verdaccio &
52-
yarn run local-publish
53-
yarn run test-e2e
76+
pnpm verdaccio &
77+
pnpm local-publish
78+
pnpm test-e2e
5479
55-
- run: yarn run publish
80+
- name: Set publishing config
81+
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}"
5682
env:
57-
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
83+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
84+
- name: Publish to npm
85+
run: pnpm publish
5886

5987
- uses: ad-m/github-push-action@master
6088
with:
6189
github_token: ${{ secrets.GITHUB_TOKEN }}
6290
tags: true
6391

6492
- name: Generate Release body
65-
run: npx extract-changelog-release > RELEASE_BODY.md
93+
run: pnpm extract-changelog-release > RELEASE_BODY.md
6694

6795
- name: Create GitHub Release
68-
uses: softprops/action-gh-release@v1
96+
uses: softprops/action-gh-release@v2
6997
with:
7098
token: ${{ secrets.GITHUB_TOKEN }}
7199
tag_name: ${{ steps.create_release.outputs.tag_name }}

.gitignore

-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
.idea/
22

3-
.yarn/*
4-
!.yarn/patches
5-
!.yarn/plugins
6-
!.yarn/releases
7-
83
node_modules/
94
dist/
105
coverage/

.husky/commit-msg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn commitlint --edit $1
4+
pnpm commitlint --edit $1

.husky/pre-push

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn run lint-staged
4+
pnpm lint-staged

0 commit comments

Comments
 (0)