Skip to content

Commit 522f104

Browse files
authored
Switch to pnpm, upgrade Node, simplify Actions (#73)
1 parent 34a1798 commit 522f104

File tree

10 files changed

+7389
-7720
lines changed

10 files changed

+7389
-7720
lines changed

.codesandbox/ci.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
{
2-
"sandboxes": ["/example"]
2+
"sandboxes": ["/example"],
3+
"node": "16"
34
}

.github/workflows/release.yml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,17 @@ jobs:
1515
# Fetch all Git history so that Changesets can generate changelogs
1616
# with the correct commits
1717
fetch-depth: 0
18-
- name: Use Node.js 12.x
18+
- name: Use Node.js 16.x
1919
uses: actions/setup-node@v1
2020
with:
21-
node-version: 12.x
22-
- name: Restore Yarn cache
23-
uses: actions/cache@v2
24-
with:
25-
path: |
26-
node_modules
27-
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
21+
node-version: 16.x
2822
- name: Install dependencies
2923
run: |
30-
yarn install --frozen-lockfile
24+
pnpm install --frozen-lockfile
3125
- name: Create release PR or publish to NPM
3226
uses: changesets/action@master
3327
with:
34-
publish: yarn release
28+
publish: pnpm release
3529
env:
3630
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3731
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -7,62 +7,23 @@ jobs:
77
name: Jest
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@master
11-
- name: Use Node.js 12.x
12-
uses: actions/setup-node@v1
13-
with:
14-
node-version: 12.x
15-
- name: Restore Yarn cache
16-
uses: actions/cache@v2
17-
with:
18-
path: |
19-
node_modules
20-
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
21-
- name: Install dependencies
22-
run: |
23-
yarn install --frozen-lockfile
10+
- name: Setup environment with pnpm
11+
uses: danoc/pnpm-setup-composite-action@v1
2412
- name: Run Jest
25-
run: |
26-
yarn run test:jest
13+
run: pnpm run test:jest
2714
tslint:
2815
name: TSLint
2916
runs-on: ubuntu-latest
3017
steps:
31-
- uses: actions/checkout@master
32-
- name: Use Node.js 12.x
33-
uses: actions/setup-node@v1
34-
with:
35-
node-version: 12.x
36-
- name: Restore Yarn cache
37-
uses: actions/cache@v2
38-
with:
39-
path: |
40-
node_modules
41-
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
42-
- name: Install dependencies
43-
run: |
44-
yarn install --frozen-lockfile
18+
- name: Setup environment with pnpm
19+
uses: danoc/pnpm-setup-composite-action@v1
4520
- name: Run TSLint
46-
run: |
47-
yarn run test:tslint
21+
run: pnpm run test:tslint
4822
prettier:
4923
name: Prettier
5024
runs-on: ubuntu-latest
5125
steps:
52-
- uses: actions/checkout@master
53-
- name: Use Node.js 12.x
54-
uses: actions/setup-node@v1
55-
with:
56-
node-version: 12.x
57-
- name: Restore Yarn cache
58-
uses: actions/cache@v2
59-
with:
60-
path: |
61-
node_modules
62-
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
63-
- name: Install dependencies
64-
run: |
65-
yarn install --frozen-lockfile
26+
- name: Setup environment with pnpm
27+
uses: danoc/pnpm-setup-composite-action@v1
6628
- name: Run Prettier
67-
run: |
68-
yarn run test:prettier
29+
run: pnpm run test:prettier

.node-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
16

.nvmrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
CHANGELOG.md
22
yarn.lock
3+
pnpm-lock.yaml
34
dist
45
.git
56
.cache

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
77
## Install
88

9-
You can install `react-use-clipboard` with NPM or Yarn.
9+
You can install `react-use-clipboard` with npm, Yarn, or pnpm.
1010

1111
```bash
1212
npm install react-use-clipboard
13-
```
14-
15-
```bash
1613
yarn add react-use-clipboard
14+
pnpm install react-use-clipboard
1715
```
1816

1917
## Usage

package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
"dist"
1414
],
1515
"scripts": {
16-
"test": "yarn test:tslint && yarn test:jest && yarn test:prettier",
16+
"test": "pnpm test:tslint && pnpm test:jest && pnpm test:prettier",
1717
"test:tslint": "tslint -c tslint.json --project tsconfig.json '**/*.{ts,tsx,js,jsx}'",
1818
"test:jest": "jest --coverage",
1919
"test:prettier": "prettier \"**/*.{ts,tsx,js,jsx,css,scss,json,md,mdx,html}\" --list-different",
2020
"format": "prettier \"**/*.{ts,tsx,js,jsx,css,scss,json,md,mdx,html}\" --write",
21-
"build": "yarn microbundle",
22-
"release": "rm -rf dist && yarn install --frozen-lockfile && yarn test && yarn build && yarn changeset publish"
21+
"build": "pnpm microbundle",
22+
"release": "rm -rf dist && pnpm install --frozen-lockfile && pnpm test && pnpm build && pnpm changeset publish"
2323
},
2424
"dependencies": {
2525
"copy-to-clipboard": "^3.3.1"
@@ -61,5 +61,6 @@
6161
"clipboard",
6262
"hooks"
6363
],
64-
"homepage": "https://github.com/danoc/react-use-clipboard#readme"
64+
"homepage": "https://github.com/danoc/react-use-clipboard#readme",
65+
"packageManager": "[email protected]"
6566
}

0 commit comments

Comments
 (0)