Skip to content

Commit ce4b65d

Browse files
authored
chore: update node version (#489)
* chore: update used node version * Upgrade webpack and remove legacy dependencies * resolve linting issues * Add local env to gitignore * Use pnpm instead of yarn * upgrade dependencies & fix build * fix build issues * change sass-loader dependency * remove node version override * add polyfills for global and buffer * modernize gh workflow * fix remaining linting issues
1 parent 5f13d00 commit ce4b65d

22 files changed

Lines changed: 25781 additions & 20805 deletions

.github/workflows/build-and-test.yml

Lines changed: 48 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,67 +8,91 @@ jobs:
88
env:
99
CI: true
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v4
1212
- run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
13-
- name: Setup node 14
14-
uses: actions/setup-node@v1
13+
- name: Setup node 24
14+
uses: actions/setup-node@v4
1515
with:
16-
node-version: 14.x
17-
- run: yarn install --frozen-lockfile --check-files
18-
- uses: actions/cache@v1
16+
node-version: 24.x
17+
- name: Install pnpm
18+
uses: pnpm/action-setup@v4
19+
with:
20+
version: 9.15.0
21+
- name: Get pnpm store directory
22+
shell: bash
23+
run: |
24+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
25+
- uses: actions/cache@v4
26+
name: Setup pnpm cache
27+
with:
28+
path: ${{ env.STORE_PATH }}
29+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
30+
restore-keys: |
31+
${{ runner.os }}-pnpm-store-
32+
- run: pnpm install --frozen-lockfile
33+
- uses: actions/cache@v4
1934
id: cache-deps
2035
with:
21-
token: ${{ github.token }}
2236
path: '.'
2337
key: ${{ github.sha }}-deps
2438
lint:
2539
runs-on: ubuntu-latest
2640
needs: install-dependencies
2741
steps:
28-
- uses: actions/cache@v1
42+
- uses: actions/cache@v4
2943
id: restore-deps
3044
with:
3145
path: '.'
3246
key: ${{ github.sha }}-deps
33-
- name: Setup node 14
34-
uses: actions/setup-node@v1
47+
- name: Setup node 24
48+
uses: actions/setup-node@v4
49+
with:
50+
node-version: 24.x
51+
- name: Install pnpm
52+
uses: pnpm/action-setup@v4
3553
with:
36-
node-version: 14.x
37-
- run: yarn lint
54+
version: 9.15.0
55+
- run: pnpm lint
3856
unit-test:
3957
runs-on: ubuntu-latest
4058
needs: install-dependencies
4159
steps:
42-
- uses: actions/cache@v1
60+
- uses: actions/cache@v4
4361
id: restore-deps
4462
with:
4563
path: '.'
4664
key: ${{ github.sha }}-deps
47-
- name: Setup node 14
48-
uses: actions/setup-node@v1
65+
- name: Setup node 24
66+
uses: actions/setup-node@v4
4967
with:
50-
node-version: 14.x
51-
- run: yarn test
68+
node-version: 24.x
69+
- name: Install pnpm
70+
uses: pnpm/action-setup@v4
71+
with:
72+
version: 9.15.0
73+
- run: pnpm test
5274
build:
5375
runs-on: ubuntu-latest
5476
needs: install-dependencies
5577
strategy:
5678
matrix:
57-
node-version: [14.x]
79+
node-version: [24.x]
5880
steps:
59-
- uses: actions/cache@v1
81+
- uses: actions/cache@v4
6082
id: restore-deps
6183
with:
6284
path: '.'
6385
key: ${{ github.sha }}
6486
- name: Use Node.js ${{ matrix.node-version }}
65-
uses: actions/setup-node@v1
87+
uses: actions/setup-node@v4
6688
with:
6789
node-version: ${{ matrix.node-version }}
68-
# HACK(johnrjj) - Rebuild node-sass in case build step runs on a separate machine than the dependency install
69-
- run: npm rebuild node-sass
70-
- run: yarn build:prod
71-
- uses: actions/cache@v1
90+
- name: Install pnpm
91+
uses: pnpm/action-setup@v4
92+
with:
93+
version: 9.15.0
94+
- run: pnpm build:prod
95+
- uses: actions/cache@v4
7296
id: cache-build
7397
with:
7498
path: '.'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ mdx/tools/*
1212
.env
1313
.vercel
1414

15+
.env*.local

.npmrc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
awscli_profile=0xproject
1+
auto-install-peers=true
2+
strict-peer-dependencies=false
3+
shamefully-hoist=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v14
1+
20

package.json

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,46 @@
11
{
22
"name": "@0x/website",
33
"version": "0.0.89",
4+
"packageManager": "pnpm@9.15.0",
45
"engines": {
5-
"node": ">=14 <15"
6+
"node": "24.x"
67
},
78
"private": true,
89
"description": "Website and 0x portal dapp",
910
"scripts": {
10-
"build": "yarn build:dev",
11+
"build": "pnpm build:dev",
1112
"build:prod": "node --max_old_space_size=16384 ./node_modules/webpack/bin/webpack.js --mode production",
12-
"build:dev": "node --max-old-space-size=16384 ./node_modules/webpack/bin/webpack.js --mode development",
13+
"build:dev": "node --max_old_space_size=16384 ./node_modules/webpack/bin/webpack.js --mode development",
1314
"clean": "shx rm -rf public/bundle* mdx/tools",
1415
"typecheck": "tsc --pretty --noEmit",
1516
"test": "jest",
1617
"test:watch": "jest --watch",
1718
"eslint": "eslint 'ts/**/*.{ts,tsx}'",
1819
"lint": "tslint --format stylish --project . 'ts/**/*.ts' 'ts/**/*.tsx'",
19-
"fix": "yarn lint --fix",
20-
"pre_push": "yarn typecheck && yarn lint:prettier && yarn lint && yarn test",
21-
"dev": "node --max-old-space-size=16384 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --content-base public",
22-
"deploy_dogfood": "npm run build:prod && aws s3 sync ./public/. s3://dogfood.0xproject.com --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers && ./cdn-cache-clear.sh dogfood",
23-
"deploy_staging": "&& npm run build:prod && aws s3 sync ./public/. s3://staging-0xproject --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
20+
"fix": "pnpm lint --fix",
21+
"pre_push": "pnpm typecheck && pnpm lint:prettier && pnpm lint && pnpm test",
22+
"dev": "node --max_old_space_size=16384 ./node_modules/webpack-dev-server/bin/webpack-dev-server.js --mode development --content-base public",
23+
"deploy_dogfood": "pnpm run build:prod && aws s3 sync ./public/. s3://dogfood.0xproject.com --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers && ./cdn-cache-clear.sh dogfood",
24+
"deploy_staging": "&& pnpm run build:prod && aws s3 sync ./public/. s3://staging-0xproject --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers",
2425
"deploy_live": " DEPLOY_ROLLBAR_SOURCEMAPS=true npm run build:prod && aws s3 sync ./public/. s3://0x.org --profile $(npm config get awscli_profile) --region us-east-1 --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --exclude *.map.js && ./cdn-cache-clear.sh live",
2526
"prettier": "prettier --write \"ts/**/*.{ts,tsx,js,json,css,yml,md}\"",
2627
"lint:prettier": "prettier --check \"ts/**/*.{ts,tsx,js,json,css,yml,md}\"",
2728
"postinstall": "patch-package"
2829
},
29-
"resolutions": {
30-
"node-hid": "2.1.1",
31-
"scrypt": "github:barrysteyn/node-scrypt#fb60a8d",
32-
"websocket": "github:frozeman/WebSocket-Node#browserifyCompatible"
30+
"pnpm": {
31+
"overrides": {
32+
"node-hid": "2.1.1",
33+
"scrypt": "github:barrysteyn/node-scrypt#fb60a8d",
34+
"websocket": "github:frozeman/WebSocket-Node#browserifyCompatible",
35+
"typescript": "^4.0.0"
36+
}
3337
},
3438
"author": "Fabio Berger",
3539
"license": "Apache-2.0",
3640
"dependencies": {
3741
"@0x/asset-buyer": "6.2.0-beta.3",
38-
"@0x/contract-addresses": "^4.1.0",
39-
"@0x/contract-wrappers": "^13.18.0",
42+
"@0x/contract-addresses": "^4.12.0",
43+
"@0x/contract-wrappers": "12.2.0-beta.4",
4044
"@0x/contracts-dev-utils": "^1.0.2",
4145
"@0x/contracts-treasury": "^1.4.2",
4246
"@0x/json-schemas": "^6.4.0",
@@ -60,6 +64,7 @@
6064
"basscss": "^8.0.3",
6165
"blockies": "^0.0.2",
6266
"bowser": "^1.9.4",
67+
"buffer": "^6.0.3",
6368
"change-case": "^3.0.2",
6469
"chart.js": "^2.8.0",
6570
"color": "^3.1.2",
@@ -71,15 +76,15 @@
7176
"dotenv": "^10.0.0",
7277
"dotenv-webpack": "^7.0.3",
7378
"ethereum-types": "^3.6.0",
74-
"ethereumjs-util": "^5.1.1",
79+
"ethereumjs-util": "^5.2.1",
7580
"ethers": "^5.0.24",
7681
"find-versions": "^2.0.0",
7782
"flickity": "^2.2.2",
7883
"fuse.js": "^3.4.6",
7984
"graphql": "^15.5.1",
8085
"graphql-request": "^3.5.0",
8186
"is-mobile": "^0.2.2",
82-
"less": "^2.7.2",
87+
"less": "^4.2.0",
8388
"lodash": "^4.17.11",
8489
"lottie-web": "^5.6.2",
8590
"marked": "^2.0.0",
@@ -94,26 +99,29 @@
9499
"patch-package": "^6.4.7",
95100
"polished": "^1.9.2",
96101
"postinstall-postinstall": "^2.1.0",
102+
"process": "^0.11.10",
103+
"prop-types": "^15.7.2",
97104
"query-string": "^6.0.0",
98105
"rc-slider": "^8.6.3",
99-
"react": "^16.12.0",
106+
"rc-tooltip": "^6.4.0",
107+
"react": "^16.14.0",
100108
"react-autosuggest": "^9.4.3",
101109
"react-chartjs-2": "^2.7.6",
102110
"react-copy-to-clipboard": "^5.0.0",
103-
"react-dom": "^16.12.0",
111+
"react-dom": "^16.14.0",
104112
"react-flickity-component": "^3.6.1",
105113
"react-headroom": "2.2.2",
106114
"react-helmet": "^5.2.1",
107-
"react-highlight": "0xproject/react-highlight#react-peer-deps",
108115
"react-instantsearch-dom": "^5.7.0",
116+
"react-is": "^16.13.1",
109117
"react-markdown": "^4.0.6",
110118
"react-minimal-pie-chart": "^8.2.0",
111119
"react-popper": "^1.0.0-beta.6",
112120
"react-query": "^3.7.1",
113121
"react-redux": "^7.1.3",
114122
"react-responsive": "^6.0.1",
115123
"react-router-dom": "^5.1.2",
116-
"react-scroll": "https://github.com/0xProject/react-scroll.git#d2afc2729dc09980e4113d8c38a1b012ba180d81",
124+
"react-scroll": "^1.9.3",
117125
"react-scrollable-anchor": "^0.6.1",
118126
"react-spring": "^8.0.27",
119127
"react-spring-latest": "npm:react-spring@9.1.2",
@@ -125,7 +133,7 @@
125133
"redux": "^4.0.4",
126134
"redux-devtools-extension": "^2.13.2",
127135
"rollbar": "^2.4.7",
128-
"sass-loader": "^7.1.0",
136+
"sass-loader": "^16.0.4",
129137
"semver": "5.5.0",
130138
"semver-sort": "0.0.4",
131139
"styled-components": "^5.3.1",
@@ -163,6 +171,7 @@
163171
"@types/numeral": "^0.0.26",
164172
"@types/query-string": "^5.1.0",
165173
"@types/rc-slider": "^8.6.0",
174+
"@types/ethereumjs-util": "^5.2.0",
166175
"@types/react": "^16.9.17",
167176
"@types/react-copy-to-clipboard": "^4.2.0",
168177
"@types/react-dom": "^16.9.4",
@@ -172,39 +181,47 @@
172181
"@types/react-scroll": "1.5.3",
173182
"@types/react-syntax-highlighter": "^10.2.1",
174183
"@types/react-transition-group": "^4.2.0",
184+
"@types/rc-tooltip": "^3.7.0",
175185
"@types/redux": "^3.6.0",
176186
"@types/styled-components": "^5.1.15",
177187
"@types/valid-url": "^1.0.2",
178188
"@types/web3-provider-engine": "^14.0.0",
179189
"@types/yargs": "^11.0.0",
180190
"@typescript-eslint/parser": "^2.12.0",
191+
"assert": "^2.0.0",
181192
"awesome-typescript-loader": "^5.2.1",
182193
"babel-loader": "^8.0.6",
183-
"cache-loader": "^4.1.0",
194+
"browserify-zlib": "^0.2.0",
184195
"compare-versions": "^3.5.1",
196+
"crypto-browserify": "^3.12.0",
185197
"css-loader": "0.23.x",
186198
"eslint": "^6.7.2",
187199
"eslint-plugin-react-hooks": "^2.3.0",
188200
"extend": "^3.0.2",
189201
"glob": "^7.1.4",
202+
"https-browserify": "^1.0.0",
190203
"husky": "^3.0.5",
191204
"jest": "^24.9.0",
192205
"jest-transform-stub": "^2.0.0",
193206
"json-stringify-pretty-compact": "^2.0.0",
194-
"less-loader": "^4.1.0",
195-
"node-sass": "^4.12.0",
207+
"less-loader": "^12.3.0",
208+
"os-browserify": "^0.3.0",
209+
"path-browserify": "^1.0.1",
196210
"prettier": "^2.2.1",
197211
"raw-loader": "^0.5.1",
198212
"react-svg-loader": "^2.1.0",
199213
"remark": "^10.0.1",
200214
"remark-mdx": "^1.0.21",
201215
"remark-slug": "^5.1.2",
202216
"rollbar-sourcemap-webpack-plugin": "^2.4.0",
217+
"sass": "^1.70.0",
203218
"shx": "^0.2.2",
204219
"slugify": "^1.3.4",
205220
"source-map-loader": "^0.2.4",
221+
"stream-browserify": "^3.0.0",
222+
"stream-http": "^3.2.0",
206223
"style-loader": "0.23.x",
207-
"terser-webpack-plugin": "^1.4.1",
224+
"terser-webpack-plugin": "^5.3.16",
208225
"to-vfile": "^6.0.0",
209226
"ts-jest": "^24.2.0",
210227
"ts-loader": "^8.2.0",
@@ -217,18 +234,17 @@
217234
"unist-util-select": "^2.0.2",
218235
"unist-util-visit": "^2.0.0",
219236
"unist-util-visit-parents": "^3.0.0",
237+
"url": "^0.11.0",
220238
"vercel": "^27.0.1",
221-
"webpack": "^4.39.2",
222-
"webpack-cli": "3.3.7",
223-
"webpack-dev-server": "^3.8.0",
239+
"vm-browserify": "^1.1.2",
240+
"webpack": "^5.95.0",
241+
"webpack-cli": "^5.1.4",
242+
"webpack-dev-server": "^4.15.1",
224243
"yargs": "^10.0.3"
225244
},
226245
"husky": {
227246
"hooks": {
228-
"pre-push": "yarn pre_push"
247+
"pre-push": "pnpm pre_push"
229248
}
230-
},
231-
"volta": {
232-
"node": "14.21.2"
233249
}
234250
}

0 commit comments

Comments
 (0)