Skip to content

Commit 1ef9bc6

Browse files
committed
feat: switch to pnpm package manager
switch to pnpm package manager from yarn BREAKING CHANGE: starting from this release only pnpm will be allowed as package manager resolves #277
1 parent 4851686 commit 1ef9bc6

8 files changed

Lines changed: 6080 additions & 7352 deletions

File tree

.circleci/config.yml

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,29 @@ jobs:
88
parallelism: 10
99

1010
environment:
11-
NODE_ENV: production
11+
# NODE_ENV: production
1212
PLAYWRIGHT_BROWSERS_PATH: 0
1313

1414
steps:
1515
- checkout
1616
- restore_cache:
17-
name: Restore Yarn Package Cache
17+
name: Restore pnpm Package Cache
1818
keys:
19-
- yarn-packages-{{ checksum "yarn.lock" }}
19+
- pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
20+
- run:
21+
name: Install pnpm package manager
22+
command: |
23+
curl -L https://pnpm.js.org/pnpm.js | node - add --global pnpm@7
2024
- run:
2125
name: Install Dependencies
2226
command: |
23-
yarn install --production=false
24-
yarn run playwright install chromium
27+
pnpm install
28+
pnpm playwright install chromium
2529
- save_cache:
26-
name: Save Yarn Package Cache
27-
key: yarn-packages-{{ checksum "yarn.lock" }}
30+
name: Save pnpm Package Cache
31+
key: pnpm-packages-{{ checksum "pnpm-lock.yaml" }}
2832
paths:
29-
- .yarn/cache
30-
- .yarn/unplugged
33+
- node_modules
3134
# Step disabled until Adyen is allowing host with http protocol
3235
# - run:
3336
# name: Add E2E_BASE_URL to /etc/hosts
@@ -36,13 +39,13 @@ jobs:
3639
- run:
3740
name: Export and serve
3841
command: |
39-
yarn export
42+
pnpm run export
4043
- run:
4144
name: Run tests
4245
command: |
43-
yarn serve &
46+
pnpm run serve &
4447
TESTFILES=$(circleci tests glob "specs/e2e/**/*.spec.ts" | circleci tests split --split-by=timings)
45-
yarn run playwright test --config=playwright.config.ci.ts ${TESTFILES}
48+
pnpm playwright test --config=playwright.config.ci.ts ${TESTFILES}
4649
4750
workflows:
4851
tests:

.github/workflows/release.yml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,27 @@ jobs:
88
release:
99
name: Release
1010
environment: staging
11-
runs-on: ubuntu-18.04
11+
runs-on: ubuntu-20.04
12+
strategy:
13+
matrix:
14+
node-version: [18]
1215
steps:
1316
- name: Checkout
14-
uses: actions/checkout@v1
15-
- name: Setup Node.js
17+
uses: actions/checkout@v2
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v2.2.2
20+
with:
21+
version: 7
22+
- name: Use Node.js ${{ matrix.node-version }}
1623
uses: actions/setup-node@v1
1724
with:
18-
node-version: 16
25+
node-version: ${{ matrix.node-version }}
26+
cache: "pnpm"
27+
1928
- name: Install dependencies
20-
run: yarn install
29+
run: pnpm install
2130
- name: Run package
22-
run: yarn build
31+
run: pnpm build
2332
- name: Release
2433
env:
2534
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.node-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.13.2
1+
18.8.0

package.json

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
"name": "commercelayer-react-checkout",
33
"version": "1.10.0",
44
"engines": {
5-
"node": ">=14.x",
6-
"yarn": "1.x"
5+
"node": ">=18.x"
76
},
87
"private": true,
98
"scripts": {
9+
"preinstall": "npx only-allow pnpm",
1010
"dev": "NODE_OPTIONS='--inspect' next dev",
1111
"build": "next build",
1212
"export": "next build && next export",
@@ -71,20 +71,35 @@
7171
],
7272
"dependencies": {
7373
"@commercelayer/react-components": "^3.15.0",
74+
"@commercelayer/sdk": "^4.15.1",
7475
"@headlessui/react": "^1.6.6",
7576
"@rollbar/react": "^0.11.1",
77+
"@tailwindcss/forms": "^0.5.2",
78+
"@tailwindcss/line-clamp": "^0.4.0",
79+
"@types/node": "^17.0.40",
80+
"@types/react": "^17.0.49",
81+
"@types/styled-components": "^5.1.25",
82+
"@types/async-retry": "1.4.3",
83+
"@types/react-gtm-module": "^2.0.1",
84+
"autoprefixer": "^10.4.8",
7685
"async-retry": "^1.3.3",
7786
"classnames": "^2.3.1",
87+
"i18next": "^21.9.1",
7888
"jwt-decode": "^3.1.2",
7989
"next": "^12.2.4",
8090
"next-i18next": "^11.3.0",
91+
"postcss": "^8.4.16",
8192
"react": "^17.0.2",
8293
"react-dom": "^17.0.2",
8394
"react-gtm-module": "^2.0.11",
95+
"react-i18next": "^11.18.5",
8496
"react-router-dom": "6",
8597
"rollbar": "^2.25.1",
8698
"styled-components": "^5.3.5",
87-
"twin.macro": "2.8.2"
99+
"twin.macro": "2.8.2",
100+
"tailwindcss": "^3.1.8",
101+
"typescript": "^4.7.4"
102+
88103
},
89104
"devDependencies": {
90105
"@commercelayer/js-auth": "^2.3.0",
@@ -98,16 +113,8 @@
98113
"@semantic-release/github": "^8.0.5",
99114
"@semantic-release/npm": "^9.0.1",
100115
"@semantic-release/release-notes-generator": "^10.0.3",
101-
"@tailwindcss/forms": "^0.5.2",
102-
"@tailwindcss/line-clamp": "^0.4.0",
103-
"@types/async-retry": "1.4.3",
104-
"@types/node": "^17.0.40",
105-
"@types/react": "^17.0.45",
106-
"@types/react-gtm-module": "^2.0.1",
107-
"@types/styled-components": "^5.1.25",
108116
"@typescript-eslint/eslint-plugin": "^5.32.0",
109117
"@typescript-eslint/parser": "^5.32.0",
110-
"autoprefixer": "^10.4.8",
111118
"dotenv": "^16.0.1",
112119
"eslint": "^8.21.0",
113120
"eslint-config-next": "^12.2.4",
@@ -119,17 +126,14 @@
119126
"eslint-plugin-promise": "^6.0.0",
120127
"eslint-plugin-react": "^7.30.1",
121128
"eslint-plugin-tailwind": "^0.2.1",
122-
"postcss": "^8.4.16",
123129
"prettier": "^2.7.1",
124130
"serve": "^14.0.1",
125131
"stylelint": "^14.9.1",
126-
"stylelint-config-standard": "^26.0.0",
127-
"tailwindcss": "^3.1.8",
128-
"typescript": "^4.7.4"
132+
"stylelint-config-standard": "^26.0.0"
129133
},
130134
"resolutions": {
131-
"@types/react": "17.0.45",
132-
"npm": "^8.16.0",
135+
"@types/react": "17.0.49",
136+
"npm": "^8.18.0",
133137
"dset": "^3.1.2"
134138
},
135139
"babelMacros": {

playwright.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const config: PlaywrightTestConfig = {
2121
// Run your local dev server before starting the tests:
2222
// https://playwright.dev/docs/test-advanced#launching-a-development-web-server-during-the-tests
2323
webServer: {
24-
command: "yarn dev",
24+
command: "pnpm run dev",
2525
port: 3000,
2626
timeout: 120 * 1000,
2727
reuseExistingServer: !process.env.CI,

0 commit comments

Comments
 (0)