Skip to content

Commit c545471

Browse files
committed
refactor: switch to pnpm and update dependencies
1 parent 412da1e commit c545471

27 files changed

Lines changed: 11115 additions & 14034 deletions

.github/workflows/release.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ jobs:
99
name: Release
1010
runs-on: ubuntu-latest
1111
steps:
12-
- name: Checkout
13-
uses: actions/checkout@v3
12+
- uses: actions/checkout@v3
13+
- name: Install PNPM
14+
uses: pnpm/action-setup@v2
15+
with:
16+
version: 7
1417
- name: Setup Node.js
1518
uses: actions/setup-node@v3
1619
with:
1720
node-version: 18
21+
cache: 'pnpm'
1822
- name: Install dependencies
19-
run: yarn --frozen-lockfile
23+
run: pnpm install
2024
- name: Build
21-
run: yarn build
25+
run: pnpm build
2226
- name: Release
2327
env:
2428
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/test.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v3
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 7
1518
- name: Use Node.js ${{ matrix.node-version }}
1619
uses: actions/setup-node@v3
1720
with:
1821
node-version: ${{ matrix.node-version }}
22+
cache: 'pnpm'
1923
- name: Install dependencies
20-
run: yarn --frozen-lockfile
24+
run: pnpm install
2125
- name: Lint
22-
run: yarn lint
26+
run: pnpm lint
2327
- name: Test
24-
run: yarn test
28+
run: pnpm test
2529
env:
2630
CI: true
2731
- name: Build

.npmignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,13 @@ npm-debug.log
1717
.tmp
1818
.eslintignore
1919
.flowconfig
20-
.travis.yml
21-
.babelrc
2220
.editorconfig
23-
.storybook
24-
yarn.lock
21+
storybook/.storybook
22+
pnpm-lock.yaml
2523

2624
# Project files
2725
coverage
28-
stories
26+
storybook/stories
2927
tests
3028
example
3129
jest-setup.js

.storybook/main.js

Lines changed: 0 additions & 36 deletions
This file was deleted.

.storybook/preview.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

.storybook/theme.js

Lines changed: 0 additions & 4 deletions
This file was deleted.

.storybook/utils/ignore-errors.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 React Intersection Observer authors
3+
Copyright (c) 2023 React Intersection Observer authors
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

package.json

Lines changed: 49 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,20 @@
2525
"url": "https://github.com/thebuilder/react-intersection-observer.git"
2626
},
2727
"license": "MIT",
28+
"scripts": {
29+
"prebuild": "rm -rf dist lib",
30+
"build": "run-s build:*",
31+
"build:bundle": "microbundle --name ReactIntersectionObserver --jsx React.createElement -f cjs,umd,es,modern --no-compress",
32+
"build:utils": "tsc -p tsconfig.test.json",
33+
"build:copy": "node scripts/build-copy.js",
34+
"postbuild": "size-limit",
35+
"dev": "pnpm --filter storybook dev",
36+
"lint": "eslint . --ext js,ts,tsx",
37+
"release": "np --contents dist",
38+
"version": "pnpm build",
39+
"storybook:build": "pnpm --filter storybook build",
40+
"test": "vitest"
41+
},
2842
"keywords": [
2943
"react",
3044
"component",
@@ -50,22 +64,6 @@
5064
"example/**",
5165
"webpack.config.js"
5266
],
53-
"scripts": {
54-
"prebuild": "rm -rf dist lib",
55-
"build": "run-s build:*",
56-
"build:bundle": "microbundle --name ReactIntersectionObserver --jsx React.createElement -f cjs,umd,es,modern --no-compress",
57-
"build:utils": "tsc -p tsconfig.test.json",
58-
"build:copy": "node scripts/build-copy.js",
59-
"postbuild": "size-limit",
60-
"dev": "yarn run storybook",
61-
"lint": "eslint . --ext js,ts,tsx",
62-
"release": "np --contents dist",
63-
"version": "yarn build",
64-
"pretty": "prettier '**/*.{js,ts,tsx,md,json,yml,html}' --write",
65-
"storybook": "start-storybook -p 9000",
66-
"storybook:build": "build-storybook --output-dir example",
67-
"test": "vitest"
68-
},
6967
"release": {
7068
"branches": [
7169
"main",
@@ -122,47 +120,44 @@
122120
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
123121
},
124122
"devDependencies": {
125-
"@babel/core": "^7.18.9",
126-
"@babel/preset-env": "^7.18.9",
127-
"@size-limit/preset-small-lib": "^7.0.8",
128-
"@storybook/addon-actions": "6.5.9",
129-
"@storybook/addon-controls": "6.5.9",
130-
"@storybook/addon-docs": "6.5.9",
131-
"@storybook/addon-viewport": "6.5.9",
132-
"@storybook/addons": "6.5.9",
133-
"@storybook/builder-vite": "^0.2.0",
134-
"@storybook/react": "6.5.9",
135-
"@storybook/theming": "6.5.9",
136-
"@testing-library/jest-dom": "^5.16.4",
137-
"@testing-library/react": "^13.3.0",
138-
"@types/jest": "^27.5.1",
139-
"@types/react": "^18.0.15",
140-
"@types/react-dom": "^18.0.6",
141-
"@typescript-eslint/eslint-plugin": "^5.30.7",
142-
"@typescript-eslint/parser": "^5.30.7",
143-
"autoprefixer": "^10.4.7",
144-
"eslint": "^8.20.0",
145-
"eslint-plugin-import": "^2.26.0",
146-
"eslint-plugin-jsx-a11y": "^6.6.1",
147-
"eslint-plugin-react": "^7.30.1",
123+
"@size-limit/preset-small-lib": "^8.2.4",
124+
"@testing-library/jest-dom": "^5.16.5",
125+
"@testing-library/react": "^14.0.0",
126+
"@types/jest": "^29.4.0",
127+
"@types/react": "^18.0.28",
128+
"@types/react-dom": "^18.0.11",
129+
"@typescript-eslint/eslint-plugin": "^5.54.0",
130+
"@typescript-eslint/parser": "^5.54.0",
131+
"eslint": "^8.35.0",
132+
"eslint-plugin-import": "^2.27.5",
133+
"eslint-plugin-jsx-a11y": "^6.7.1",
134+
"eslint-plugin-react": "^7.32.2",
148135
"eslint-plugin-react-hooks": "^4.6.0",
149-
"framer-motion": "^6.5.1",
150-
"intersection-observer": "^0.12.2",
151-
"jsdom": "^20.0.0",
152-
"lint-staged": "^13.0.3",
153-
"microbundle": "^0.15.0",
136+
"jsdom": "^21.1.0",
137+
"lint-staged": "^13.1.2",
138+
"microbundle": "^0.15.1",
154139
"npm-run-all": "^4.1.5",
155-
"postcss": "^8.4.14",
156-
"prettier": "^2.7.1",
157-
"prettier-plugin-pkg": "^0.16.0",
158-
"prettier-plugin-tailwindcss": "^0.1.12",
140+
"prettier": "^2.8.4",
159141
"react": "^18.2.0",
160142
"react-dom": "^18.2.0",
161-
"simple-git-hooks": "^2.8.0",
162-
"size-limit": "^7.0.8",
163-
"tailwindcss": "^3.1.6",
164-
"typescript": "^4.7.4",
165-
"vite": "^3.0.2",
166-
"vitest": "^0.18.1"
143+
"simple-git-hooks": "^2.8.1",
144+
"size-limit": "^8.2.4",
145+
"typescript": "^4.9.5",
146+
"vitest": "^0.29.2"
147+
},
148+
"pnpm": {
149+
"peerDependencyRules": {
150+
"allowedVersions": {
151+
"react": "18"
152+
}
153+
},
154+
"allowedDeprecatedVersions": {
155+
"rollup-plugin-terser": "*",
156+
"sourcemap-codec": "*",
157+
"source-map-resolve": "*",
158+
"source-map-url": "*",
159+
"stable": "*",
160+
"urix": "*"
161+
}
167162
}
168163
}

0 commit comments

Comments
 (0)