Skip to content

Commit df06472

Browse files
authored
Merge pull request #1267 from cdrini/refactor/node-20
Upgrade to Node 20
2 parents c1cc674 + b2bfa99 commit df06472

6 files changed

Lines changed: 11 additions & 140 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- uses: actions/setup-node@v4
1919
with:
2020
# Keep in sync with netlify.toml
21-
node-version: 16.x
21+
node-version: 20.x
2222
- name: Cache node_modules
2323
uses: actions/cache@v3
2424
id: cache
@@ -29,7 +29,7 @@ jobs:
2929
# we don't use `npm ci` specifically to try to get faster CI flows. So caching
3030
# `node_modules` directly.
3131
path: 'node_modules'
32-
key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
32+
key: ${{ runner.os }}-node-20-${{ hashFiles('package*.json') }}
3333
- if: steps.cache.outputs.cache-hit != 'true'
3434
run: npm install
3535

@@ -40,13 +40,13 @@ jobs:
4040
- uses: actions/checkout@v4
4141
- uses: actions/setup-node@v4
4242
with:
43-
node-version: 16.x
43+
node-version: 20.x
4444
- name: Load node_modules from cache
4545
uses: actions/cache@v3
4646
with:
4747
# Use node_modules from previous jobs
4848
path: 'node_modules'
49-
key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
49+
key: ${{ runner.os }}-node-20-${{ hashFiles('package*.json') }}
5050
- name: Cache BookReader/
5151
uses: actions/cache@v3
5252
id: build-cache
@@ -64,13 +64,13 @@ jobs:
6464
- uses: actions/checkout@v4
6565
- uses: actions/setup-node@v4
6666
with:
67-
node-version: 16.x
67+
node-version: 20.x
6868
- name: Load node_modules from cache
6969
uses: actions/cache@v3
7070
with:
7171
# Use node_modules from previous jobs
7272
path: 'node_modules'
73-
key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
73+
key: ${{ runner.os }}-node-20-${{ hashFiles('package*.json') }}
7474
- run: npm run lint
7575
- run: npm run test
7676
- run: npm run codecov
@@ -82,13 +82,13 @@ jobs:
8282
- uses: actions/checkout@v4
8383
- uses: actions/setup-node@v4
8484
with:
85-
node-version: 16.x
85+
node-version: 20.x
8686
- name: Load node_modules from cache
8787
uses: actions/cache@v3
8888
with:
8989
# Use node_modules from previous jobs
9090
path: 'node_modules'
91-
key: ${{ runner.os }}-node-16-${{ hashFiles('package*.json') }}
91+
key: ${{ runner.os }}-node-20-${{ hashFiles('package*.json') }}
9292
- name: Load BookReader/ from cache
9393
uses: actions/cache@v3
9494
with:

.github/workflows/npm-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v4
1515
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 16
17+
node-version: 20
1818
- run: npm ci
1919
- run: npm test
2020

@@ -25,7 +25,7 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: actions/setup-node@v4
2727
with:
28-
node-version: 16
28+
node-version: 20
2929
registry-url: https://registry.npmjs.org/
3030
- run: npm ci
3131
- run: npm publish --tag next

netlify.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[build.environment]
22
# Keep in sync with CI in .github/workflows/node.js.yml
3-
NODE_VERSION = "16"
3+
NODE_VERSION = "20"
44

55
[[headers]]
66
# Define which paths this specific [[headers]] block will cover.

package-lock.json

Lines changed: 0 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
"jquery-ui-touch-punch": "0.2.3",
6868
"jquery.browser": "0.1.0",
6969
"live-server": "1.2.2",
70-
"node-fetch": "3.3.2",
7170
"regenerator-runtime": "0.13.11",
7271
"sass": "1.64.2",
7372
"sinon": "^17.0.0",

scripts/preversion.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@ const { version: OLD_VERSION } = require('../package.json');
22
const OLD_RELEASE_URL = `https://api.github.com/repos/internetarchive/bookreader/releases/tags/v${OLD_VERSION}`;
33

44
async function main() {
5-
// Need this because fetch is ESM-only, and we're on Node 16. Someday we should
6-
// be able to move this up to the top without renaming this file to a .mjs or whatever
7-
const {default: fetch} = await import('node-fetch');
8-
95
const {created_at} = await fetch(OLD_RELEASE_URL).then(r => r.json());
106
const today = new Date().toISOString().slice(0, -5);
117
const searchUrl = 'https://github.com/internetarchive/bookreader/pulls?' + new URLSearchParams({

0 commit comments

Comments
 (0)