From 5dc024eb51482bf83ad1ca1c33daa98ba6214ca5 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Thu, 14 Feb 2019 14:02:30 +0100 Subject: [PATCH 1/6] Upgrade dependencies and fix security audits --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1dab7ca..fbc300f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@mapbox/sphericalmercator": "~1.0.5", "@mapbox/mapbox-file-sniff": "~1.0.0", "srs": "~1.2.0", - "mapnik": "~3.7.0", + "mapnik": "~4.2.1", "gdal": "~0.9.3", "queue-async": "~1.2.0" }, From 2951ee48b2c2e94ab901857e28dd42171fb5f320 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Thu, 14 Feb 2019 14:02:49 +0100 Subject: [PATCH 2/6] Fixes to make tests pass with upgraded deps --- test/fixtures/metadata_contours.json | 6 +++--- test/index.test.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fixtures/metadata_contours.json b/test/fixtures/metadata_contours.json index 697d045..e1d1495 100644 --- a/test/fixtures/metadata_contours.json +++ b/test/fixtures/metadata_contours.json @@ -5,12 +5,12 @@ "filesize": 24576628, "center": [ -122.31742219942615, - 37.87235316048361 + 37.87235316048363 ], "extent": [ -122.31849442745843, - 37.871487370753606, - -122.31634997139385, + 37.871487370753634, + -122.31634997139386, 37.87321895021363 ], "minzoom": 19, diff --git a/test/index.test.js b/test/index.test.js index 0203deb..d23ec19 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -93,7 +93,7 @@ tape('[GeoJson] digest function should return expected metadata', function(asser tape('[GeoJson] digest function should error and return sanitized message', function(assert) { var fixture = path.resolve(__dirname, 'fixtures', 'parse.error.json'); - var expectedError = 'Invalid geojson: does not contain any features'; + var expectedError = 'Error creating Mapnik Datasource: Invalid geojson'; mapnik_omnivore.digest(fixture, function(err) { assert.ok(err, 'expected error'); assert.deepEqual(err.message, expectedError, 'expected error message'); From fdf8c58ecbd22c4129683f2c8420fb3a02fc3d39 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Thu, 14 Feb 2019 14:07:56 +0100 Subject: [PATCH 3/6] Upgrade deps except jscs --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index fbc300f..1ee9bd1 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,12 @@ "url": "https://github.com/mapbox/mapnik-omnivore" }, "devDependencies": { - "coveralls": "~2.11.1", + "coveralls": "^3.0.2", "istanbul": "~0.3.0", "jscs": "^1.10.0", "jshint": "^2.6.0", "mapnik-test-data": "https://mapbox-npm.s3.amazonaws.com/package/mapnik-test-data-2.0.5-c84800ed20a6a9bc2143dd11b1b2a3190b9ae698.tgz", - "tape": "3.0.x" + "tape": "^4.10.1" }, "scripts": { "test": "jshint index.js test lib && jscs index.js test lib && tape test/*.js", From 0d72dd6250a002af5d65bb739ceec42f93922e9c Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Thu, 14 Feb 2019 14:44:53 +0100 Subject: [PATCH 4/6] Replace jscs with eslint Ignore any rule that forces us to update the current code. --- .eslintrc.json | 6 ++++++ package.json | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..c7e587f --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "extends": "eslint:recommended", + "env": { + "node": true + } +} diff --git a/package.json b/package.json index 1ee9bd1..4e55948 100644 --- a/package.json +++ b/package.json @@ -22,14 +22,15 @@ }, "devDependencies": { "coveralls": "^3.0.2", - "istanbul": "~0.3.0", - "jscs": "^1.10.0", - "jshint": "^2.6.0", + "eslint": "^5.13.0", + "eslint-config-airbnb-base": "^13.1.0", + "eslint-plugin-import": "^2.16.0", + "istanbul": "^0.4.5", "mapnik-test-data": "https://mapbox-npm.s3.amazonaws.com/package/mapnik-test-data-2.0.5-c84800ed20a6a9bc2143dd11b1b2a3190b9ae698.tgz", "tape": "^4.10.1" }, "scripts": { - "test": "jshint index.js test lib && jscs index.js test lib && tape test/*.js", + "test": "eslint index.js test lib && tape test/*.js", "coverage": "istanbul cover tape test/*.test.js && coveralls < ./coverage/lcov.info" }, "bin": { From 288b2c4316167e377ef715f6223ad35d02854d82 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Wed, 27 Mar 2019 08:52:50 +0100 Subject: [PATCH 5/6] Replace instanbul with nyc --- package.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 4e55948..b5e4669 100644 --- a/package.json +++ b/package.json @@ -9,12 +9,12 @@ "geodata" ], "dependencies": { - "@mapbox/sphericalmercator": "~1.0.5", "@mapbox/mapbox-file-sniff": "~1.0.0", - "srs": "~1.2.0", - "mapnik": "~4.2.1", + "@mapbox/sphericalmercator": "~1.0.5", "gdal": "~0.9.3", - "queue-async": "~1.2.0" + "mapnik": "~4.2.1", + "queue-async": "~1.2.0", + "srs": "~1.2.0" }, "repository": { "type": "git", @@ -22,16 +22,16 @@ }, "devDependencies": { "coveralls": "^3.0.2", + "nyc": "^13.3.0", "eslint": "^5.13.0", "eslint-config-airbnb-base": "^13.1.0", "eslint-plugin-import": "^2.16.0", - "istanbul": "^0.4.5", "mapnik-test-data": "https://mapbox-npm.s3.amazonaws.com/package/mapnik-test-data-2.0.5-c84800ed20a6a9bc2143dd11b1b2a3190b9ae698.tgz", "tape": "^4.10.1" }, "scripts": { "test": "eslint index.js test lib && tape test/*.js", - "coverage": "istanbul cover tape test/*.test.js && coveralls < ./coverage/lcov.info" + "coverage": "nyc npm test && nyc report --reporter=text-lcov | coveralls" }, "bin": { "digest": "bin/digest" From e0b4f246e1aef8d50826f2ac88eeeea2c0321b77 Mon Sep 17 00:00:00 2001 From: Per Liedman Date: Wed, 27 Mar 2019 10:40:29 +0100 Subject: [PATCH 6/6] Build for Node 8 and 10 --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4986d24..7def279 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,13 +12,13 @@ addons: matrix: include: - os: linux - env: NODE_VERSION="4" COVERAGE=true + env: NODE_VERSION="8" - os: linux - env: NODE_VERSION="6" + env: NODE_VERSION="10" COVERAGE=true - os: osx - env: NODE_VERSION="4" + env: NODE_VERSION="8" - os: osx - env: NODE_VERSION="6" + env: NODE_VERSION="10" before_install: - rm -rf ~/.nvm/ && git clone --depth 1 https://github.com/creationix/nvm.git ~/.nvm