Skip to content

Commit 96d6139

Browse files
authored
Update to node 18 and 20 with package upgrades (#59)
* Update to node 18 with package upgrades * Use the node-based image, since circle doesn't have 18 * Add submodule update command for new node-pre-gyp * Use correct git submodule incantation * Fix up manual ./test.sh run * Update s2 code and prepare for 0.0.5 * Revert submodule updates for this version * Support node 20 * Use the node 20 image * Bump README * Add DLC
1 parent 43a5e26 commit 96d6139

20 files changed

+9221
-621
lines changed

.circleci/config.yml

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,43 @@ version: 2
33
dockerbuild: &dockerbuild
44
steps:
55
- checkout
6+
- setup_remote_docker:
7+
docker_layer_caching: true
68
- run:
79
name: "Pull submodules"
810
command: |
911
git submodule init
10-
git submodule update --remote
12+
git submodule sync
13+
git submodule update
1114
- run:
1215
name: Install dependencies
13-
command: npm install
16+
command: |
17+
npm install
1418
when: on_success
1519
- run:
1620
name: Test
1721
command: npm run test
1822
when: on_success
1923

2024
jobs:
21-
"node-10":
22-
<<: *dockerbuild
23-
docker:
24-
- image: circleci/node:10.16.2
25-
"node-12":
25+
"node-16":
2626
<<: *dockerbuild
2727
docker:
28-
- image: circleci/node:12.8.0
29-
"node-14":
28+
- image: circleci/node:16.5.0
29+
"node-18":
3030
<<: *dockerbuild
3131
docker:
32-
- image: circleci/node:14.15.4
33-
"node-16":
32+
- image: node:18.12.1
33+
"node-20":
3434
<<: *dockerbuild
3535
docker:
36-
- image: circleci/node:16.5.0
36+
- image: node:20.0.0
3737

3838
workflows:
3939
version: 2
4040
build:
4141
jobs:
42-
- "node-10"
43-
- "node-12"
44-
- "node-14"
4542
- "node-16"
43+
- "node-18"
44+
- "node-20"
4645

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
## Version 0.0.5
22

3+
- Support Node 18 & 20, minimum tested version is now 16
4+
- Update node-pre-gyp, node-addon-api, and node-gyp
5+
36
## Version 0.0.4
47

58
- Added CellId.rangeMin & CellId.rangeMax (thanks to @mast)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Other JavaScript projects available on GitHub appear unmaintained.
1717
The project has been built against Node's N-API, meaning that it's compatible across Node.js versions that support BigInt.
1818
This means that Node.js version 9 and below are unsupported.
1919

20-
As of today, the library is built and tested against Node.js 10-12. The library has been in production use at [Radar](https://radar.io) and has been built against OS X and Linux. Feel free to open an issue or PR if you'd like other platform support.
20+
As of today, the library is built and tested against Node.js 16, 18 and 20. The library has been in production use at [Radar](https://radar.io) and has been built against OS X and Linux. Feel free to open an issue or PR if you'd like other platform support.
2121

2222
See [test.sh](https://github.com/radarlabs/s2/blob/master/test.sh) for more details.
2323

docker/Dockerfile.node10.test

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

docker/Dockerfile.node12.test

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

docker/Dockerfile.node18.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
FROM node:18.12.1
2+
3+
WORKDIR /app
4+
COPY . /app
5+
6+
RUN npm install
7+
RUN JOBS=max PATH=$(npm bin):$PATH node-pre-gyp rebuild
8+
CMD npm run test
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14.15.0
1+
FROM node:20.0.0
22

33
WORKDIR /app
44
COPY . /app

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// magic incantation from step 3 @ https://github.com/mapbox/node-pre-gyp#readme
2-
const binary = require('node-pre-gyp');
2+
const binary = require('@mapbox/node-pre-gyp');
33
const path = require('path');
44
var binding_path = binary.find(path.resolve(path.join(__dirname,'./package.json')));
55
const s2 = require(binding_path);

manual-publish.sh

Lines changed: 11 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,20 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
# this script is mainly for running on macs to publish binaries
44
# for linux, we use a circleci/docker build
55
#
66
# per the node-gyp-pre docs, you can use any of the standard ways
7-
# to specify AWS keys from the javascript aws-sdk, or the env vars
7+
# to specify AWS keys from the javascript aws-sdk, or the env vars
88
# node_pre_gyp_accessKeyId and node_pre_gyp_secretAccessKey
99

1010
set -e
1111

12-
export NVM_DIR="$HOME/.nvm"
13-
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
14-
15-
nvm install v10
16-
nvm use v10
17-
rm -rf node_modules
18-
npm install
19-
JOBS=max npx node-pre-gyp rebuild package unpublish publish
20-
21-
nvm install v11
22-
nvm use v11
23-
rm -rf node_modules
24-
npm install
25-
JOBS=max npx node-pre-gyp rebuild package unpublish publish
26-
27-
nvm install v12
28-
nvm use v12
29-
rm -rf node_modules
30-
npm install
31-
JOBS=max npx node-pre-gyp rebuild package unpublish publish
32-
33-
nvm install v13
34-
nvm use v13
35-
rm -rf node_modules
36-
npm install
37-
JOBS=max npx node-pre-gyp rebuild package unpublish publish
38-
39-
nvm install v14
40-
nvm use v14
41-
rm -rf node_modules
42-
npm install
43-
JOBS=max npx node-pre-gyp rebuild package unpublish publish
12+
# loop through node LTS versions 16 - 20, unpublish and publish them
13+
for node in v16 v18 v20
14+
do
15+
nvm install $node
16+
nvm use $node
17+
rm -rf node_modules
18+
npm install
19+
JOBS=max npx node-pre-gyp rebuild package unpublish publish
20+
done

0 commit comments

Comments
 (0)