Skip to content

Commit

Permalink
chore: upgrade to pnpm8 (#2605)
Browse files Browse the repository at this point in the history
* upgrade pnpm to 8

* chore: upgrade codesandbox build env to node18

* chore: upgrade codesandbox build env to node18

* chore: use react/jsx-runtime

* chore: format code

* chore: upgrade playwright image version

* fix failed test

* chore: fix install problem

* chore: update lockfile
  • Loading branch information
promer94 authored May 18, 2023
1 parent 8e291a9 commit 5b5efcd
Show file tree
Hide file tree
Showing 34 changed files with 1,414 additions and 1,298 deletions.
2 changes: 1 addition & 1 deletion .codesandbox/ci.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sandboxes": ["swr-basic-p7dg6", "swr-states-4une7", "swr-infinite-jb5bm", "swr-ssr-j9b2y"],
"node": "16",
"node": "18",
"installCommand": "csb:install",
"buildCommand": "csb:build"
}
3 changes: 3 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ To run SWR locally, you can start it with any example in the `examples` folder.
First of all, build SWR assets

```sh
corepack enable
corepack pnpm install

pnpm watch
```

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/install/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@ runs:
shell: bash
run: |
corepack enable
node -v
pnpm -v
pnpm install
2 changes: 1 addition & 1 deletion .github/workflows/test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
e2e:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.30.0-focal
image: mcr.microsoft.com/playwright:v1.33.0-focal
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# prevent sub-packages from installing peer-deps (multiple react versions)
auto-install-peers=false
15 changes: 15 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"transform": {
"react": {
"runtime": "automatic"
}
}
}
}
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = {
'^swr/_internal$': '<rootDir>/_internal/index.ts'
},
transform: {
'^.+\\.(t|j)sx?$': '@swc/jest'
'^.+\\.(t|j)sx?$': ['@swc/jest']
},
coveragePathIgnorePatterns: ['/node_modules/', '/dist/', '/test/'],
coverageReporters: ['text', 'html'],
Expand Down
42 changes: 21 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"cache",
"fetch"
],
"packageManager": "pnpm@7.26.1",
"packageManager": "pnpm@8.4.0",
"main": "./core/dist/index.js",
"module": "./core/dist/index.esm.js",
"types": "./core/dist/index.d.ts",
Expand Down Expand Up @@ -72,7 +72,7 @@
"license": "MIT",
"scripts": {
"prepare": "husky install",
"csb:install": "pnpm install",
"csb:install": "corepack enable && corepack pnpm i",
"csb:build": "pnpm build",
"clean": "pnpm -r run clean && rimraf playwright-report test-result",
"watch": "pnpm -r run watch",
Expand All @@ -99,36 +99,36 @@
]
},
"devDependencies": {
"@playwright/test": "^1.30.0",
"@swc/core": "^1.3.29",
"@swc/jest": "0.2.24",
"@playwright/test": "^1.33.0",
"@swc/core": "^1.3.56",
"@swc/jest": "0.2.26",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^14.0.0",
"@type-challenges/utils": "0.1.1",
"@types/jest": "^29.4.0",
"@types/node": "^18.11.18",
"@types/react": "^18.0.38",
"@types/jest": "^29.5.1",
"@types/node": "^18.16.3",
"@types/react": "^18.2.5",
"@types/use-sync-external-store": "^0.0.3",
"@typescript-eslint/eslint-plugin": "5.49.0",
"@typescript-eslint/parser": "5.49.0",
"@typescript-eslint/eslint-plugin": "5.59.2",
"@typescript-eslint/parser": "5.59.2",
"bunchee": "3.1.1",
"eslint": "8.32.0",
"eslint-config-prettier": "8.6.0",
"eslint": "8.39.0",
"eslint-config-prettier": "8.8.0",
"eslint-plugin-jest-dom": "4.0.3",
"eslint-plugin-react": "7.32.1",
"eslint-plugin-react": "7.32.2",
"eslint-plugin-react-hooks": "4.6.0",
"eslint-plugin-testing-library": "5.10.0",
"eslint-plugin-testing-library": "5.10.3",
"husky": "8.0.3",
"jest": "29.4.1",
"jest-environment-jsdom": "29.4.1",
"lint-staged": "13.1.0",
"next": "^13.1.6",
"prettier": "2.8.3",
"jest": "29.5.0",
"jest-environment-jsdom": "29.5.0",
"lint-staged": "13.2.2",
"next": "^13.3.4",
"prettier": "2.8.8",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rimraf": "4.1.2",
"rimraf": "5.0.0",
"swr": "workspace:*",
"typescript": "4.9.4"
"typescript": "5.0.4"
},
"peerDependencies": {
"react": "^16.11.0 || ^17.0.0 || ^18.0.0"
Expand Down
Loading

0 comments on commit 5b5efcd

Please sign in to comment.