From eee3e8b63c8523f916c64b6d494381bd5c3fb2bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 22 Nov 2019 19:47:00 +0100 Subject: [PATCH 01/45] Draft: added script to setup and tear down tests --- package.json | 4 +- test/index.js | 138 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 test/index.js diff --git a/package.json b/package.json index d3643a4d..c39f2c8d 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,9 @@ "lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"", "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", "preinstall": "make pre-install", - "test": "make test-all", + "pretest": "NODE_ENV=test node test setup", + "test": "mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", + "posttest": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", "docker-test": "./docker-test.sh", "docker-bash": "./docker-bash.sh" diff --git a/test/index.js b/test/index.js new file mode 100644 index 00000000..17a5dca1 --- /dev/null +++ b/test/index.js @@ -0,0 +1,138 @@ +'use strict'; + +const util = require('util'); +const path = require('path'); +const exec = util.promisify(require('child_process').exec); + +if (!process.env.NODE_ENV) { + console.error('Please set "NODE_ENV" variable, e.g.: "NODE_ENV=test"'); + process.exit(1); +} + +const environment = require(`../config/environments/${process.env.NODE_ENV}.js`); +const REDIS_PORT = environment.redis.port; +const REDIS_CELL_PATH = path.resolve( + process.platform === 'darwin' + ? './test/support/libredis_cell.dylib' + : './test/support/libredis_cell.so' +); + +const TEST_USER_ID = 1; +const TEST_USER = environment.postgres_auth_user.replace('<%= user_id %>', TEST_USER_ID); +const TEST_PASSWORD = environment.postgres_auth_pass.replace('<%= user_id %>', TEST_USER_ID); +const PUBLIC_USER = environment.postgres.user; +const PUBLIC_USER_PASSWORD = environment.postgres.password; +const TEST_DB = `${TEST_USER}_db`; + +async function startRedis () { + await exec(`redis-server --port ${REDIS_PORT} --loadmodule ${REDIS_CELL_PATH} --logfile ${__dirname}/redis-server.log --daemonize yes`); +} + +async function stopRedis () { + await exec(`redis-cli -p ${REDIS_PORT} shutdown`); +} + +async function dropDatabase () { + await exec(`dropdb --if-exists ${TEST_DB}`, { + env: { + PGUSER: 'postgres' + } + }); +} + +async function createDatabase () { + await exec(`createdb -T template_postgis -EUTF8 "${TEST_DB}"`, { + env: { + PGUSER: 'postgres' + } + }); +} + +async function createDatabaseExtension () { + await exec(`psql -c "CREATE EXTENSION IF NOT EXISTS cartodb CASCADE;" ${TEST_DB}`, { + env: { + PGUSER: 'postgres' + } + }); +} + +async function populateDatabase () { + const filenames = [ + 'analysis_catalog', + 'windshaft.test', + 'gadm4', + 'countries_null_values', + 'ported/populated_places_simple_reduced', + 'cdb_analysis_check', + 'cdb_invalidate_varnish' + ]; + + for (const filename of filenames) { + const populateDatabaseCmd = ` + cat ${__dirname}/support/sql/${filename}.sql | + sed -e "s/:PUBLICUSER/${PUBLIC_USER}/g" | + sed -e "s/:PUBLICPASS/${PUBLIC_USER_PASSWORD}/g" | + sed -e "s/:TESTUSER/${TEST_USER}/g" | + sed -e "s/:TESTPASS/${TEST_PASSWORD}/g" | + PGOPTIONS='--client-min-messages=WARNING' psql -q -v ON_ERROR_STOP=1 ${TEST_DB} + `; + + await exec(populateDatabaseCmd, { + env: { + PGUSER: 'postgres' + } + }); + } +} + +async function populateRedis () { + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET rails:users:localhost id ${TEST_USER_ID} database_name "${TEST_DB}" database_host localhost map_key 1234`); + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET rails:users:cartodb250user id ${TEST_USER_ID} database_name "${TEST_DB}" database_host "localhost" database_password "${TEST_PASSWORD}" map_key 4321`); + await exec(`redis-cli -p ${REDIS_PORT} -n 0 HSET rails:${TEST_DB}:my_table infowindow "this, that, the other"`); + await exec(`redis-cli -p ${REDIS_PORT} -n 0 HSET rails:${TEST_DB}:test_table_private_1 privacy "0"`); + // API keys + // User localhost + // API Key Master + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:1234 user "localhost" type "master" grants_sql "true" grants_maps "true" database_role "${TEST_USER}" database_password "${TEST_PASSWORD}"`); + // API Key Default public + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:default_public user "localhost" type "default" grants_sql "true" grants_maps "true" database_role "test_windshaft_publicuser" database_password "public"`); + // API Key Regular + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:regular1 user "localhost" type "regular" grants_sql "true" grants_maps "true" database_role "test_windshaft_regular1" database_password "regular1"`); + // API Key Regular 2 no Maps API access, only to check grants permissions to the API + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:regular2 user "localhost" type "regular" grants_sql "true" grants_maps "false" database_role "test_windshaft_publicuser" database_password "public"`); + + // User cartodb250user + // API Key Master + await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:cartodb250user:4321 user "localhost" type "master" grants_sql "true" grants_maps "true" database_role "${TEST_USER}" database_password "${TEST_PASSWORD}"`); + // API Key Default + await exec(`cat < Date: Tue, 26 Nov 2019 15:46:56 +0100 Subject: [PATCH 02/45] missing middleware --- lib/api/middlewares/custom-profile.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/api/middlewares/custom-profile.js diff --git a/lib/api/middlewares/custom-profile.js b/lib/api/middlewares/custom-profile.js new file mode 100644 index 00000000..16ce6f9f --- /dev/null +++ b/lib/api/middlewares/custom-profile.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = function customProfile () { + return function customProfileMiddleware (req, res, next) { + const layergroupid = res.get('X-Layergroup-Id') || req.params.token; + + if (layergroupid) { + req.profiler.add({ layergroupid }); + } + + next(); + }; +}; From f29704420368b09aa4f5fca1b9f747b94af0765b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 17:30:06 +0100 Subject: [PATCH 03/45] Exec redis comands in batches --- test/index.js | 82 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 63 insertions(+), 19 deletions(-) diff --git a/test/index.js b/test/index.js index 17a5dca1..892b6fed 100644 --- a/test/index.js +++ b/test/index.js @@ -86,26 +86,70 @@ async function populateDatabase () { } async function populateRedis () { - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET rails:users:localhost id ${TEST_USER_ID} database_name "${TEST_DB}" database_host localhost map_key 1234`); - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET rails:users:cartodb250user id ${TEST_USER_ID} database_name "${TEST_DB}" database_host "localhost" database_password "${TEST_PASSWORD}" map_key 4321`); - await exec(`redis-cli -p ${REDIS_PORT} -n 0 HSET rails:${TEST_DB}:my_table infowindow "this, that, the other"`); - await exec(`redis-cli -p ${REDIS_PORT} -n 0 HSET rails:${TEST_DB}:test_table_private_1 privacy "0"`); - // API keys - // User localhost - // API Key Master - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:1234 user "localhost" type "master" grants_sql "true" grants_maps "true" database_role "${TEST_USER}" database_password "${TEST_PASSWORD}"`); - // API Key Default public - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:default_public user "localhost" type "default" grants_sql "true" grants_maps "true" database_role "test_windshaft_publicuser" database_password "public"`); - // API Key Regular - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:regular1 user "localhost" type "regular" grants_sql "true" grants_maps "true" database_role "test_windshaft_regular1" database_password "regular1"`); - // API Key Regular 2 no Maps API access, only to check grants permissions to the API - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:localhost:regular2 user "localhost" type "regular" grants_sql "true" grants_maps "false" database_role "test_windshaft_publicuser" database_password "public"`); + const commands = ` + HMSET rails:users:localhost \ + id ${TEST_USER_ID} \ + database_name "${TEST_DB}" \ + database_host localhost \ + map_key 1234 - // User cartodb250user - // API Key Master - await exec(`redis-cli -p ${REDIS_PORT} -n 5 HMSET api_keys:cartodb250user:4321 user "localhost" type "master" grants_sql "true" grants_maps "true" database_role "${TEST_USER}" database_password "${TEST_PASSWORD}"`); - // API Key Default - await exec(`cat < Date: Thu, 28 Nov 2019 17:30:29 +0100 Subject: [PATCH 04/45] Set node env for test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c39f2c8d..7cc4292a 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", "preinstall": "make pre-install", "pretest": "NODE_ENV=test node test setup", - "test": "mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", + "test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", "posttest": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", "docker-test": "./docker-test.sh", From 3498fceb6a746a977fbd7ca42b6edf302330b269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:07:25 +0100 Subject: [PATCH 05/45] Improve npm script hooks --- package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7cc4292a..2e90e5f0 100644 --- a/package.json +++ b/package.json @@ -71,9 +71,12 @@ "lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"", "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", "preinstall": "make pre-install", - "pretest": "NODE_ENV=test node test setup", + "pretest:setup": "npm run lint", + "test:setup": "NODE_ENV=test node test setup", + "pretest": "npm run test:setup", "test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", - "posttest": "NODE_ENV=test node test teardown", + "posttest": "npm run test:teardown", + "test:teardown": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", "docker-test": "./docker-test.sh", "docker-bash": "./docker-bash.sh" From ab66ad83fd5211ef9ae0a3f5585ae0d4984ec4ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:07:44 +0100 Subject: [PATCH 06/45] Exec psql commands in batches --- test/index.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/test/index.js b/test/index.js index 892b6fed..f0e8c2c8 100644 --- a/test/index.js +++ b/test/index.js @@ -65,24 +65,22 @@ async function populateDatabase () { 'ported/populated_places_simple_reduced', 'cdb_analysis_check', 'cdb_invalidate_varnish' - ]; + ].map(filename => `${__dirname}/support/sql/${filename}.sql`); - for (const filename of filenames) { - const populateDatabaseCmd = ` - cat ${__dirname}/support/sql/${filename}.sql | - sed -e "s/:PUBLICUSER/${PUBLIC_USER}/g" | - sed -e "s/:PUBLICPASS/${PUBLIC_USER_PASSWORD}/g" | - sed -e "s/:TESTUSER/${TEST_USER}/g" | - sed -e "s/:TESTPASS/${TEST_PASSWORD}/g" | - PGOPTIONS='--client-min-messages=WARNING' psql -q -v ON_ERROR_STOP=1 ${TEST_DB} - `; + const populateDatabaseCmd = ` + cat ${filenames.join(' ')} | + sed -e "s/:PUBLICUSER/${PUBLIC_USER}/g" | + sed -e "s/:PUBLICPASS/${PUBLIC_USER_PASSWORD}/g" | + sed -e "s/:TESTUSER/${TEST_USER}/g" | + sed -e "s/:TESTPASS/${TEST_PASSWORD}/g" | + PGOPTIONS='--client-min-messages=WARNING' psql -q -v ON_ERROR_STOP=1 ${TEST_DB} + `; - await exec(populateDatabaseCmd, { - env: { - PGUSER: 'postgres' - } - }); - } + await exec(populateDatabaseCmd, { + env: { + PGUSER: 'postgres' + } + }); } async function populateRedis () { From d9c05a9333c131106e0bf29748aa7bfb58269780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:28:01 +0100 Subject: [PATCH 07/45] Don't use bash script to run ci test --- .travis.yml | 2 +- package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 14d56ff1..9fac3468 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ env: services: - docker before_install: docker pull ${DOCKER_IMAGE} -script: npm run docker-test -- ${DOCKER_IMAGE} ${NODE_VERSION} +script: npm run ci:test diff --git a/package.json b/package.json index 2e90e5f0..d0e808de 100644 --- a/package.json +++ b/package.json @@ -78,8 +78,8 @@ "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", - "docker-test": "./docker-test.sh", - "docker-bash": "./docker-bash.sh" + "ci:test": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash run_tests_docker.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", + "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" }, "engines": { "node": "^10.15.1", From 60db55b1229b5e0498fe766b6a7714cad8f81051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:42:04 +0100 Subject: [PATCH 08/45] Missin configuration file in CI --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d0e808de..b76e827f 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,8 @@ "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", - "ci:test": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash run_tests_docker.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", + "pretest:ci": "cp config/environments/test.js.example config/environments/test.js", + "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash run_tests_docker.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" }, "engines": { From 5f900a3b3cf7433b8e993bf64e80f4a12b6ff12d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:45:05 +0100 Subject: [PATCH 09/45] Update command --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9fac3468..fc6ef253 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ env: services: - docker before_install: docker pull ${DOCKER_IMAGE} -script: npm run ci:test +script: npm run test:ci From f21f89f561b8014a53260e24b57b651163d88ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 18:52:22 +0100 Subject: [PATCH 10/45] Move script to docker folder --- docker/scripts/test-setup.sh | 22 ++++++++++++++++++++++ package.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docker/scripts/test-setup.sh diff --git a/docker/scripts/test-setup.sh b/docker/scripts/test-setup.sh new file mode 100644 index 00000000..f30a39d3 --- /dev/null +++ b/docker/scripts/test-setup.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +/etc/init.d/postgresql start + +source /src/nodejs-install.sh + +# Install cartodb-postgresql extension +git clone https://github.com/CartoDB/cartodb-postgresql.git +cd cartodb-postgresql && make && make install && cd .. + +echo "Node.js version: " +node -v + +echo "npm version: " +npm -v + +echo "Clean install: " +npm ci +npm ls + +# run tests +npm test diff --git a/package.json b/package.json index b76e827f..1e573a06 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ "test:teardown": "NODE_ENV=test node test teardown", "update-internal-deps": "rm -rf node_modules && npm install", "pretest:ci": "cp config/environments/test.js.example config/environments/test.js", - "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash run_tests_docker.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", + "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" }, "engines": { From 60c01e583febc1c5708a4089cd1f9424b59ed8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 19:46:02 +0100 Subject: [PATCH 11/45] Remove deprecated coverage dep. Use nyc instead --- .gitignore | 1 + package-lock.json | 1042 ++++++++++++++++++++++++++++++++++++++++----- package.json | 4 +- 3 files changed, 938 insertions(+), 109 deletions(-) diff --git a/.gitignore b/.gitignore index ddeef2ef..08adc10c 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ redis.pid *.log coverage/ .DS_Store +.nyc_output diff --git a/package-lock.json b/package-lock.json index e27deb70..e2f45788 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,47 @@ "@babel/highlight": "^7.0.0" } }, + "@babel/generator": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.7.4.tgz", + "integrity": "sha512-m5qo2WgdOJeyYngKImbkyQrnUN1mPceaG5BV+G0E3gWsa4l/jCSryWJdM2x8OuGAOyh+3d5pVYfZWCiNFtynxg==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.7.4.tgz", + "integrity": "sha512-AnkGIdiBhEuiwdoMnKm7jfPfqItZhgRaZfMg1XX3bS25INOnLPjPG1Ppnajh8eqgt5kPJnfqrRHqFqmjKDZLzQ==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.7.4", + "@babel/template": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.7.4.tgz", + "integrity": "sha512-QTGKEdCkjgzgfJ3bAyRwF4yyT3pg+vDgan8DSivq1eS0gwi+KGKE5x8kRcbeFTb/673mkO5SN1IZfmCfA5o+EA==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.7.4.tgz", + "integrity": "sha512-guAg1SXFcVr04Guk9eq0S4/rWS++sbmyqosJzVs8+1fH5NI+ZcmkaSkc7dmtAFbHFva6yRJnjW3yAcGxjueDug==", + "dev": true, + "requires": { + "@babel/types": "^7.7.4" + } + }, "@babel/highlight": { "version": "7.5.0", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", @@ -61,6 +102,68 @@ } } }, + "@babel/parser": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.7.4.tgz", + "integrity": "sha512-jIwvLO0zCL+O/LmEJQjWA75MQTWwx3c3u2JOTDK5D3/9egrWRRA0/0hk9XXywYnXZVVpzrBYeIQTmhwUaePI9g==", + "dev": true + }, + "@babel/template": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.7.4.tgz", + "integrity": "sha512-qUzihgVPguAzXCK7WXw8pqs6cEwi54s3E+HrejlkuWO6ivMKx9hZl3Y2fSXp9i5HgyWmj7RKP+ulaYnKM4yYxw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4" + } + }, + "@babel/traverse": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.7.4.tgz", + "integrity": "sha512-P1L58hQyupn8+ezVA2z5KBm4/Zr4lCC8dwKCMYzsa5jFMDMQAzaBNy9W5VjB+KAmBjb40U7a/H6ao+Xo+9saIw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.7.4", + "@babel/helper-function-name": "^7.7.4", + "@babel/helper-split-export-declaration": "^7.7.4", + "@babel/parser": "^7.7.4", + "@babel/types": "^7.7.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.7.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.7.4.tgz", + "integrity": "sha512-cz5Ji23KCi4T+YIE/BolWosrJuSmoZeN1EFnRtBwF+KKLi8GG/Z2c2hOJJeCXPk4mwk4QFvTmwIodJowXgttRA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, "@carto/cartonik": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/@carto/cartonik/-/cartonik-0.7.0.tgz", @@ -94,7 +197,7 @@ "resolved": "https://registry.npmjs.org/@carto/mapnik/-/mapnik-3.6.2-carto.16.tgz", "integrity": "sha512-RX8ov5EpEheToESVKiKnV5yMPLA2KxaX2ANAs9W4856oKFPdbGmB2buDz54mLhwBDfler9GVo0Bzr2ayRVLO2A==", "requires": { - "mapnik-vector-tile": "github:cartodb/mapnik-vector-tile#e7ca5471f9e5de81243e6035e70444321fc0a82f", + "mapnik-vector-tile": "github:cartodb/mapnik-vector-tile#v1.6.1-carto.2", "nan": "2.14.0", "node-pre-gyp": "0.13.0" } @@ -141,13 +244,6 @@ "json-schema-traverse": "^0.3.0" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true, - "optional": true - }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -164,11 +260,26 @@ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" }, + "append-transform": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", + "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "dev": true, + "requires": { + "default-require-extensions": "^2.0.0" + } + }, "aproba": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, + "archy": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", + "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=", + "dev": true + }, "are-we-there-yet": { "version": "1.1.5", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", @@ -375,6 +486,18 @@ "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg=" }, + "caching-transform": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.2.tgz", + "integrity": "sha512-Mtgcv3lh3U0zRii/6qVgQODdPA4G3zhG+jtbCWj39RXuUFTMzH0vcdMtaJS1jPowd+It2Pqr6y3NJMQqOqCE2w==", + "dev": true, + "requires": { + "hasha": "^3.0.0", + "make-dir": "^2.0.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.4.2" + } + }, "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", @@ -519,7 +642,7 @@ "integrity": "sha512-myLV2xo3q9oTT8m8M+c+UTD/ziDN7hrYtZ9yY00KvMnu2NsVeRQsTe8Yxq1GVS8vF9iYfcelwjVEGObPUdLtHw==", "requires": { "debug": "^3.1.0", - "pg": "github:cartodb/node-postgres#5417d7b29b7272ca2e71bb396899ab3f177a9ae6", + "pg": "github:cartodb/node-postgres#6.4.2-cdb2", "underscore": "~1.6.0" } }, @@ -672,12 +795,18 @@ } }, "commander": { - "version": "2.20.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", - "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -704,6 +833,15 @@ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, "cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", @@ -719,6 +857,27 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cp-file": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/cp-file/-/cp-file-6.2.0.tgz", + "integrity": "sha512-fmvV4caBnofhPe8kOcitBwSn2f39QLjnAnGq3gO9dfd75mUytzKNZB1hde6QHunW2Rt+OwuBOMc3i1tNElbszA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "make-dir": "^2.0.0", + "nested-error-stacks": "^2.0.0", + "pify": "^4.0.1", + "safe-buffer": "^5.0.1" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, "cross-spawn": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", @@ -812,6 +971,23 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "default-require-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", + "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "dev": true, + "requires": { + "strip-bom": "^3.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -942,6 +1118,12 @@ "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "es6-promise": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-3.1.2.tgz", @@ -957,37 +1139,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "escodegen": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", - "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", - "dev": true, - "requires": { - "esprima": "^2.7.1", - "estraverse": "^1.9.1", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.2.0" - }, - "dependencies": { - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "source-map": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", - "integrity": "sha1-2rc/vPwrqBm03gO9b26qSBZLP50=", - "dev": true, - "optional": true, - "requires": { - "amdefine": ">=0.0.4" - } - } - } - }, "eslint": { "version": "6.5.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.5.1.tgz", @@ -1449,12 +1600,6 @@ } } }, - "estraverse": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", - "integrity": "sha1-r2fy3JIlgkFZUJJgkaQAXSnJu0Q=", - "dev": true - }, "esutils": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", @@ -1701,6 +1846,77 @@ } } }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.1.0.tgz", + "integrity": "sha512-Tq6PixE0w/VMFfCgbONnkiQIVol/JJL7nRMi20fqzA4NRs9AfeqMGeRdPi3wIhYkxjeBaWh2rxwapn5Tu3IqOQ==", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", + "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, "find-up": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", @@ -1752,6 +1968,28 @@ "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==", "dev": true }, + "foreground-child": { + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", + "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "dev": true, + "requires": { + "cross-spawn": "^4", + "signal-exit": "^3.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", + "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "which": "^1.2.9" + } + } + } + }, "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", @@ -2722,7 +2960,7 @@ "carto": "0.16.3", "debug": "~3.1.0", "generic-pool": "~2.2.0", - "millstone": "github:cartodb/millstone#eeeb308fba4586343bb848fbf8ae0d180192627d", + "millstone": "github:cartodb/millstone#v0.6.17-carto.3", "postcss": "~5.2.8", "postcss-scss": "0.4.0", "postcss-strip-inline-comments": "0.1.5", @@ -2817,9 +3055,9 @@ "dev": true }, "handlebars": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", - "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "version": "4.5.3", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.5.3.tgz", + "integrity": "sha512-3yPecJoJHK/4c6aZhSvxOyG4vJKDshV36VHp0iVCDVh7o9w2vwi3NSnL2MMPj3YdduqaBcu7cGbggJQM0br9xA==", "dev": true, "requires": { "neo-async": "^2.6.0", @@ -2883,6 +3121,15 @@ "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=" }, + "hasha": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", + "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "dev": true, + "requires": { + "is-stream": "^1.0.1" + } + }, "hawk": { "version": "6.0.2", "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", @@ -3214,76 +3461,140 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, - "istanbul": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.4.5.tgz", - "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", + "istanbul-lib-coverage": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.7.tgz", + "integrity": "sha512-vrRztU9VRRFDyC+aklfLoeXyNdTfga2EI3udDGn4cZ6fpSXpHLV9X6CHvfoMCPtggg8zvDDmC4b9xfu0z6/llA==", "dev": true, "requires": { - "abbrev": "1.0.x", - "async": "1.x", - "escodegen": "1.8.x", - "esprima": "2.7.x", - "glob": "^5.0.15", - "handlebars": "^4.0.1", - "js-yaml": "3.x", - "mkdirp": "0.5.x", - "nopt": "3.x", - "once": "1.x", - "resolve": "1.1.x", - "supports-color": "^3.1.0", - "which": "^1.1.1", - "wordwrap": "^1.0.0" + "append-transform": "^1.0.0" + } + }, + "istanbul-lib-instrument": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" }, "dependencies": { - "abbrev": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", - "integrity": "sha1-kbR5JYinc4wl813W9jdSovh3YTU=", + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", "dev": true }, - "esprima": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", - "integrity": "sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE=", - "dev": true - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", + "supports-color": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", + "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", "dev": true, "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "2 || 3", + "minimatch": "^3.0.4", "once": "^1.3.0", "path-is-absolute": "^1.0.0" } }, - "nopt": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", - "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", "dev": true, "requires": { - "abbrev": "1" + "glob": "^7.1.3" } }, - "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true - }, - "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } }, + "istanbul-reports": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", + "dev": true, + "requires": { + "handlebars": "^4.1.2" + } + }, "js-base64": { "version": "2.5.1", "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.5.1.tgz", @@ -3314,6 +3625,18 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -3402,6 +3725,12 @@ "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=" }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "log4js": { "version": "github:cartodb/log4js-node#145d5f91e35e7fb14a6278cbf7a711ced6603727", "from": "github:cartodb/log4js-node#cdb", @@ -3443,6 +3772,30 @@ "resolved": "https://registry.npmjs.org/lzma/-/lzma-2.3.2.tgz", "integrity": "sha1-N4OySFi5wOdHoN88vx+1/KqSxEE=" }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true + } + } + }, "mapnik-reference": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/mapnik-reference/-/mapnik-reference-6.0.5.tgz", @@ -3470,6 +3823,23 @@ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, + "merge-source-map": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", + "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "dev": true, + "requires": { + "source-map": "^0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -3702,6 +4072,12 @@ "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", "dev": true }, + "nested-error-stacks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/nested-error-stacks/-/nested-error-stacks-2.1.0.tgz", + "integrity": "sha512-AO81vsIO1k1sM4Zrd6Hu7regmJN1NSiAja10gc4bX3F0wd+9rQmcuHQaHVQCYIEC8iFXnE+mavh23GOt7wBgug==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", @@ -3828,6 +4204,234 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, + "nyc": { + "version": "14.1.1", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-14.1.1.tgz", + "integrity": "sha512-OI0vm6ZGUnoGZv/tLdZ2esSVzDwUC88SNs+6JoSOMVxA+gKMB8Tk7jBwgemLx4O40lhhvZCVw1C+OYLOBOPXWw==", + "dev": true, + "requires": { + "archy": "^1.0.0", + "caching-transform": "^3.0.2", + "convert-source-map": "^1.6.0", + "cp-file": "^6.2.0", + "find-cache-dir": "^2.1.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.5", + "istanbul-lib-hook": "^2.0.7", + "istanbul-lib-instrument": "^3.3.0", + "istanbul-lib-report": "^2.0.8", + "istanbul-lib-source-maps": "^3.0.6", + "istanbul-reports": "^2.2.4", + "js-yaml": "^3.13.1", + "make-dir": "^2.1.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.2.3", + "uuid": "^3.3.2", + "yargs": "^13.2.2", + "yargs-parser": "^13.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "cliui": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "dev": true, + "requires": { + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + } + }, + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "wrap-ansi": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + } + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "dev": true + }, + "yargs": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.0.tgz", + "integrity": "sha512-2eehun/8ALW8TLoIl7MVaRUrg+yCnenu8B4kBlRxj3GJGDKU1Og7sMXPNm1BYyM1DOJmTZ4YeN/Nwxv+8XJsUA==", + "dev": true, + "requires": { + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.1" + } + }, + "yargs-parser": { + "version": "13.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "oauth-sign": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", @@ -3976,6 +4580,18 @@ "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" }, + "package-hash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", + "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, "packet-reader": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/packet-reader/-/packet-reader-0.3.1.tgz", @@ -4377,6 +4993,15 @@ "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "request": { "version": "2.87.0", "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", @@ -4641,6 +5266,45 @@ "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" }, + "spawn-wrap": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.3.tgz", + "integrity": "sha512-IgB8md0QW/+tWqcavuFgKYR/qIRvJkRLPJDFaoXtLLUaVcCDK0+HeFTkmQHj3eprcYhc+gOl0aEA1w7qZlYezw==", + "dev": true, + "requires": { + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" + }, + "dependencies": { + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + } + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", @@ -4910,6 +5574,153 @@ } } }, + "test-exclude": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", + "dev": true, + "requires": { + "glob": "^7.1.3", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", + "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" + } + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + } + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -4930,12 +5741,18 @@ "os-tmpdir": "~1.0.2" } }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, "torque.js": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/torque.js/-/torque.js-3.1.1.tgz", "integrity": "sha512-kfIrmI7TGqJT/J9DH8Mgvd9VEwcvAtnvyYyqymSN6WZ5L4BaVQEQ+zu5FgLChNAqCaRkqGc7bKp0Hj9A0rempA==", "requires": { - "carto": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "carto": "github:cartodb/carto#master", "d3": "3.5.17", "turbo-carto": "^0.21.1", "turf-jenks": "~1.0.1" @@ -5030,13 +5847,13 @@ } }, "uglify-js": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", - "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.7.0.tgz", + "integrity": "sha512-PC/ee458NEMITe1OufAjal65i6lB58R1HWMRcxwvdz1UopW0DYqlRL3xdu3IcTvTXsB02CRHykidkTRL+A3hQA==", "dev": true, "optional": true, "requires": { - "commander": "~2.20.0", + "commander": "~2.20.3", "source-map": "~0.6.1" }, "dependencies": { @@ -5155,7 +5972,7 @@ "@carto/cartonik": "^0.7.0", "@carto/mapnik": "3.6.2-carto.16", "canvas": "^2.4.1", - "carto": "github:cartodb/carto#85881d99dd7fcf2c4e16478b04db67108d27a50c", + "carto": "github:cartodb/carto#0.15.1-cdb5", "cartodb-psql": "^0.14.0", "cartodb-query-tables": "^0.6.1", "debug": "3.1.0", @@ -5204,6 +6021,17 @@ "mkdirp": "^0.5.1" } }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + }, "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 1e573a06..67101497 100644 --- a/package.json +++ b/package.json @@ -59,10 +59,10 @@ "eslint-plugin-node": "^10.0.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "istanbul": "0.4.5", "mocha": "5.2.0", "moment": "2.22.1", "nock": "9.2.6", + "nyc": "^14.1.1", "redis": "2.8.0", "step": "1.0.0", "strftime": "0.10.0" @@ -77,7 +77,7 @@ "test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", - "update-internal-deps": "rm -rf node_modules && npm install", + "test:coverage": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown", "pretest:ci": "cp config/environments/test.js.example config/environments/test.js", "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" From 8f99886d62416d84b64beedb1a243984e396d5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 19:46:22 +0100 Subject: [PATCH 12/45] Clean script --- docker/scripts/test-setup.sh | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/docker/scripts/test-setup.sh b/docker/scripts/test-setup.sh index f30a39d3..876285b7 100644 --- a/docker/scripts/test-setup.sh +++ b/docker/scripts/test-setup.sh @@ -8,15 +8,5 @@ source /src/nodejs-install.sh git clone https://github.com/CartoDB/cartodb-postgresql.git cd cartodb-postgresql && make && make install && cd .. -echo "Node.js version: " -node -v - -echo "npm version: " -npm -v - -echo "Clean install: " npm ci -npm ls - -# run tests npm test From 42d0c4c040e83fe512f3985d8a71825cbdfd2d67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Thu, 28 Nov 2019 19:56:49 +0100 Subject: [PATCH 13/45] Remove unused makefile scripts --- Makefile | 53 ---------------- configure | 81 ------------------------ docker-bash.sh | 13 ---- docker-test.sh | 4 -- package.json | 2 +- run_tests.sh | 149 -------------------------------------------- run_tests_docker.sh | 22 ------- 7 files changed, 1 insertion(+), 323 deletions(-) delete mode 100644 Makefile delete mode 100755 configure delete mode 100755 docker-bash.sh delete mode 100755 docker-test.sh delete mode 100755 run_tests.sh delete mode 100644 run_tests_docker.sh diff --git a/Makefile b/Makefile deleted file mode 100644 index 23554888..00000000 --- a/Makefile +++ /dev/null @@ -1,53 +0,0 @@ -SHELL=/bin/bash - -pre-install: - @$(SHELL) ./scripts/check-node-canvas.sh - -all: - @$(SHELL) ./scripts/install.sh - -clean: - rm -rf node_modules/ - -distclean: clean - rm config.status* - -config.status--test: - ./configure --environment=test - -config/environments/test.js: config.status--test - ./config.status--test - -TEST_SUITE := $(shell find test/{acceptance,integration,unit} -name "*.js") -TEST_SUITE_UNIT := $(shell find test/unit -name "*.js") -TEST_SUITE_INTEGRATION := $(shell find test/integration -name "*.js") -TEST_SUITE_ACCEPTANCE := $(shell find test/acceptance -name "*.js") - -test: config/environments/test.js - @echo "***tests***" - @$(SHELL) ./run_tests.sh ${RUNTESTFLAGS} $(TEST_SUITE) - -test-unit: config/environments/test.js - @echo "***tests***" - @$(SHELL) ./run_tests.sh ${RUNTESTFLAGS} $(TEST_SUITE_UNIT) - -test-integration: config/environments/test.js - @echo "***tests***" - @$(SHELL) ./run_tests.sh ${RUNTESTFLAGS} $(TEST_SUITE_INTEGRATION) - -test-acceptance: config/environments/test.js - @echo "***tests***" - @$(SHELL) ./run_tests.sh ${RUNTESTFLAGS} $(TEST_SUITE_ACCEPTANCE) - -lint: - @echo "***eslint***" - @./node_modules/.bin/eslint app.js "lib/**/*.js" "test/**/*.js" - -test-all: test lint - -coverage: - @RUNTESTFLAGS=--with-coverage make test - -check: test - -.PHONY: pre-install test lint coverage diff --git a/configure b/configure deleted file mode 100755 index c234f6f4..00000000 --- a/configure +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/sh - -# -# This script creates config/environments/*.js files using -# config/environments/*.js.example files as input and performing -# settings substitutions. -# -# It relies on a known format of the .js.example files which haven't -# been made easier to parse to still let humans copy them manually and -# do further editing or leave them as such to get the same setup as before -# the introduction of this script. -# -# The script is a work in progress. Available switches are printed -# by invoking with the --help switch. More switches will be added -# as the need/request for them arises. -# -# --strk(2012-07-23) -# - -ENVDIR=config/environments - -PGPORT= -MAPNIK_VERSION= -ENVIRONMENT=development - -STATUS="$0 $*" - -usage() { - echo "Usage: $0 [OPTION]" - echo - echo "Configuration:" - echo " --help display this help and exit" - echo " --with-pgport=NUM access PostgreSQL server on TCP port NUM [$PGPORT]" - echo " --with-mapnik-version=STRING set mapnik version string [$MAPNIK_VERSION]" - echo " --environment=STRING set output environment name [$ENVIRONMENT]" -} - -while test -n "$1"; do - case "$1" in - --help|-h) - usage - exit 0 - ;; - --with-pgport=*) - PGPORT=`echo "$1" | cut -d= -f2` - ;; - --with-mapnik-version=*) - MAPNIK_VERSION=`echo "$1" | cut -d= -f2` - ;; - --environment=*) - ENVIRONMENT=`echo "$1" | cut -d= -f2` - ;; - *) - echo "Unused option '$1'" >&2 - ;; - esac - shift -done - -ENVEX=./${ENVDIR}/${ENVIRONMENT}.js.example - -if [ -z "$PGPORT" ]; then - PGPORT=`node -e "console.log(require('${ENVEX}').postgres.port)"` -fi - -echo "PGPORT: $PGPORT" -echo "MAPNIK_VERSION: $MAPNIK_VERSION" -echo "ENVIRONMENT: $ENVIRONMENT" - -o=`dirname "${ENVEX}"`/`basename "${ENVEX}" .example` -echo "Writing $o" - -# See http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/ -sed -n "1h;1!H;\${;g;s/\(,postgres: {[^}]*port: *'\?\)[^',]*\('\?,\)/\1$PGPORT\2/;p;}" < "${ENVEX}" \ - | sed "s/mapnik_version:.*/mapnik_version: '$MAPNIK_VERSION'/" \ - > "$o" - -STATUSFILE=config.status--${ENVIRONMENT} -echo "Writing ${STATUSFILE}" -echo ${STATUS} > ${STATUSFILE} && chmod +x ${STATUSFILE} - diff --git a/docker-bash.sh b/docker-bash.sh deleted file mode 100755 index 5666ea1d..00000000 --- a/docker-bash.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -echo "*********************" -echo "To install Node.js, run:" -echo "/src/nodejs-install.sh" -echo "Use NODEJS_VERSION env var to select the Node.js version" -echo " " -echo "To start postgres, run:" -echo "/etc/init.d/postgresql start" -echo "*********************" -echo " " - -docker run -it -v `pwd`:/srv carto/nodejs-xenial-pg101:latest bash diff --git a/docker-test.sh b/docker-test.sh deleted file mode 100755 index bca2c5db..00000000 --- a/docker-test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -docker run -e "NODEJS_VERSION=${2}" -v `pwd`:/srv ${1} bash run_tests_docker.sh && \ - docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v diff --git a/package.json b/package.json index 67101497..ce9a08bd 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "scripts": { "lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"", "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", - "preinstall": "make pre-install", + "preinstall": "./scripts/check-node-canvas.sh", "pretest:setup": "npm run lint", "test:setup": "NODE_ENV=test node test setup", "pretest": "npm run test:setup", diff --git a/run_tests.sh b/run_tests.sh deleted file mode 100755 index 9686687f..00000000 --- a/run_tests.sh +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash - -OPT_CREATE_REDIS=yes # create the redis test environment -OPT_CREATE_PGSQL=yes # create the PostgreSQL test environment -OPT_DROP_REDIS=yes # drop the redis test environment -OPT_DROP_PGSQL=yes # drop the PostgreSQL test environment -OPT_COVERAGE=no # run tests with coverage -OPT_REDIS_CELL=yes # download redis cell - -export PGAPPNAME=cartodb_tiler_tester - -cd $(dirname $0) -BASEDIR=$(pwd) -cd - - -REDIS_PORT=`node -e "console.log(require('${BASEDIR}/config/environments/test.js').redis.port)"` -export REDIS_PORT - -cleanup() { - if test x"$OPT_DROP_REDIS" = xyes; then - if test x"$PID_REDIS" = x; then - PID_REDIS=$(cat ${BASEDIR}/redis.pid) - if test x"$PID_REDIS" = x; then - echo "Could not find a test redis pid to kill it" - return; - fi - fi - redis-cli -p ${REDIS_PORT} info stats - redis-cli -p ${REDIS_PORT} info keyspace - echo "Killing test redis pid ${PID_REDIS}" - #kill ${PID_REDIS_MONITOR} - kill ${PID_REDIS} - fi - if test x"$OPT_DROP_PGSQL" = xyes; then - # TODO: drop postgresql ? - echo "Dropping PostgreSQL test database isn't implemented yet" - fi -} - -cleanup_and_exit() { - cleanup - exit -} - -die() { - msg=$1 - echo "${msg}" >&2 - cleanup - exit 1 -} - -trap 'cleanup_and_exit' 1 2 3 5 9 13 - -while [ -n "$1" ]; do - # This is kept for backward compatibility - if test "$1" = "--nodrop"; then - OPT_DROP_REDIS=no - OPT_DROP_PGSQL=no - shift - continue - elif test "$1" = "--nodrop-pg"; then - OPT_DROP_PGSQL=no - shift - continue - elif test "$1" = "--nodrop-redis"; then - OPT_DROP_REDIS=no - shift - continue - elif test "$1" = "--nocreate-pg"; then - OPT_CREATE_PGSQL=no - shift - continue - elif test "$1" = "--nocreate-redis"; then - OPT_CREATE_REDIS=no - shift - continue - elif test "$1" = "--with-coverage"; then - OPT_COVERAGE=yes - shift - continue - # This is kept for backward compatibility - elif test "$1" = "--nocreate"; then - OPT_CREATE_REDIS=no - OPT_CREATE_PGSQL=no - shift - continue - elif test "$1" = "--norediscell"; then - OPT_REDIS_CELL=no - shift - continue - else - break - fi -done - -if [ -z "$1" ]; then - echo "Usage: $0 [] []" >&2 - echo "Options:" >&2 - echo " --nocreate do not create the test environment on start" >&2 - echo " --nodrop do not drop the test environment on exit" >&2 - echo " --with-coverage use istanbul to determine code coverage" >&2 - echo " --norediscell do not download redis-cell" >&2 - exit 1 -fi - -TESTS=$@ - -if test x"$OPT_CREATE_REDIS" = xyes; then - echo "Starting redis on port ${REDIS_PORT}" - REDIS_CELL_PATH="${BASEDIR}/test/support/libredis_cell.so" - if [[ "$OSTYPE" == "darwin"* ]]; then - REDIS_CELL_PATH="${BASEDIR}/test/support/libredis_cell.dylib" - fi - - echo "port ${REDIS_PORT}" | redis-server - --loadmodule ${REDIS_CELL_PATH} > ${BASEDIR}/test.log & - PID_REDIS=$! - echo ${PID_REDIS} > ${BASEDIR}/redis.pid -fi - -PREPARE_DB_OPTS= -if test x"$OPT_CREATE_PGSQL" != xyes; then - PREPARE_DB_OPTS="$PREPARE_DB_OPTS --skip-pg" -fi -if test x"$OPT_CREATE_REDIS" != xyes; then - PREPARE_DB_OPTS="$PREPARE_DB_OPTS --skip-redis" -fi - -echo "Preparing the environment" -cd ${BASEDIR}/test/support -source prepare_db.sh "${PREPARE_DB_OPTS}" || die "database preparation failure" -cd - - -PATH=node_modules/.bin/:$PATH - -#redis-cli -p ${REDIS_PORT} monitor > /tmp/windshaft-cartodb.redis.log & -#PID_REDIS_MONITOR=$! - -if test x"$OPT_COVERAGE" = xyes; then - echo "Running tests with coverage" - ./node_modules/.bin/istanbul cover node_modules/.bin/_mocha -- -u tdd -t 5000 --exit ${TESTS} -else - echo "Running tests" - ./node_modules/.bin/_mocha -c -u tdd -t 5000 --exit ${TESTS} -fi -ret=$? - -cleanup - -exit $ret diff --git a/run_tests_docker.sh b/run_tests_docker.sh deleted file mode 100644 index f30a39d3..00000000 --- a/run_tests_docker.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -/etc/init.d/postgresql start - -source /src/nodejs-install.sh - -# Install cartodb-postgresql extension -git clone https://github.com/CartoDB/cartodb-postgresql.git -cd cartodb-postgresql && make && make install && cd .. - -echo "Node.js version: " -node -v - -echo "npm version: " -npm -v - -echo "Clean install: " -npm ci -npm ls - -# run tests -npm test From bbc9c9fb9bf54aa726790e13ba9e528fb2bf1e1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 11:18:25 +0100 Subject: [PATCH 14/45] Merge documents into README --- CONTRIBUTING.md | 11 ----- INSTALL.md | 41 ------------------- README.md | 107 ++++++++++++++++++++++++++---------------------- 3 files changed, 57 insertions(+), 102 deletions(-) delete mode 100644 CONTRIBUTING.md delete mode 100644 INSTALL.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 6c4e4161..00000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,11 +0,0 @@ -Contributing ---- - -The issue tracker is at [github.com/CartoDB/Windshaft-cartodb](https://github.com/CartoDB/Windshaft-cartodb). - -We love pull requests from everyone, see [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). - - -## Submitting Contributions - -* You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index f5102f3b..00000000 --- a/INSTALL.md +++ /dev/null @@ -1,41 +0,0 @@ -# Installing Windshaft-CartoDB - -## Requirements - -Make sure that you have the requirements needed. These are: - -- Node 10.x -- npm 6.x -- PostgreSQL >= 10.0 -- PostGIS >= 2.4 -- CARTO Postgres Extension >= 0.24.1 -- Redis >= 4 -- libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support -- C++11 (to build internal dependencies if needed) - -### Optional - -- Varnish (http://www.varnish-cache.org) - -## PostGIS setup - -A `template_postgis` database is expected. One can be set up with - -```shell -createdb --owner postgres --template template0 template_postgis -psql -d template_postgis -c 'CREATE EXTENSION postgis;' -``` - -## Build/install - -To fetch and build all node-based dependencies, run: - -```shell -npm install -``` - -Note that the ```npm``` step will populate the node_modules/ -directory with modules, some of which being compiled on demand. If you -happen to have startup errors you may need to force rebuilding those -modules. At any time just wipe out the node_modules/ directory and run -```npm``` again. diff --git a/README.md b/README.md index f6f0bdde..26a8db71 100644 --- a/README.md +++ b/README.md @@ -1,80 +1,87 @@ -Windshaft-CartoDB -================== +# Windshaft-CartoDB [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) -This is the [CartoDB Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends -[Windshaft](https://github.com/CartoDB/Windshaft) with some extra functionality and custom filters for authentication. +This is the [CartoDB Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [Windshaft](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: -* reads dbname from subdomain and cartodb redis for pretty tile urls -* configures windshaft to publish `cartodb_id` as the interactivity layer -* gets the default geometry type from the cartodb redis store -* allows tiles to be styled individually -* provides a link to varnish high speed cache -* provides a [template maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Template-maps.md) +* Intantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) defined through CARTO's map configuration ([MapConfig](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). +* Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizables templates. +* Get map previews through [`Static Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/05-static-maps-API.md) API. +* Render maps with large amount of data faster using [`Tile Aggregation`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/06-tile-aggregation.md). +* Build advanced maps with enriched data through [`Analyses Extension`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/09-MapConfig-analyses-extension.md). +* Fetch tabular data from analysis nodes with [`Dataviews`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/10-MapConfig-dataviews-extension.md) -Install -------- -See [INSTALL.md](INSTALL.md) for detailed installation instructions. +## Install -Configure ---------- +### Requirements -Create the config/environments/.js files (there are .example files -to start from). You can optionally use the ./configure script for this, -see ```./configure --help``` to see available options. +* Node 10.x +* npm 6.x +* PostgreSQL >= 10.0 +* PostGIS >= 2.4 +* CARTO Postgres Extension >= 0.24.1 +* Redis >= 4 +* libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support +* C++11 (to build internal dependencies if needed) -Look at lib/cartodb/server-options.js for more on config +### Optional -Upgrading ---------- +* [Varnish](http://www.varnish-cache.org) -Checkout your commit/branch. If you need to reinstall dependencies (you can check [NEWS](NEWS.md)) do the following: +### PostGIS setup -```sh -$ rm -rf node_modules -$ npm install +A `template_postgis` database is expected. One can be set up with + +```shell +createdb --owner postgres --template template0 template_postgis +psql -d template_postgis -c 'CREATE EXTENSION postgis;' ``` +### Build + +To fetch and build all node-based dependencies, run: + +```shell +npm ci ``` + +### Run + +Create the `./config/environments/.js` file (there are `.example` files to start from). Look at `./lib/cartodb/server-options.js` for more on config. + +```shell node app.js ``` -Where is the name of a configuration file under config/environments/. +Where `` is the name of a configuration file under `./config/environments/`. -Note that caches are kept in redis. If you're not seeing what you expect -there may be out-of-sync records in there. -Take a look: http://redis.io/commands +## Documentation +The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: +The [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) defined the endpoints and their expected parameters and outputs. -Documentation -------------- - -The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation -resources, from higher level to more detailed ones: -The [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) defined the endpoints and their -expected parameters and outputs. - - -Examples --------- +### Examples [CartoDB's Map Gallery](http://cartodb.com/gallery/) showcases several examples of visualisations built on top of this. -Contributing ---- +## Contributing -See [CONTRIBUTING.md](CONTRIBUTING.md). +The issue tracker: [github](https://github.com/CartoDB/Windshaft-cartodb/issues). + +We love pull requests from everyone, see [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). + +### Submitting Contributions + +* You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). ### Developing with a custom windshaft version -If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is -to use `npm link`. You can read more about it at [npm-link: Symlink a package folder](https://docs.npmjs.com/cli/link.html). - -**Quick start**: +If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at [npm-link: Symlink a package folder](https://docs.npmjs.com/cli/link.html). ```shell -~/windshaft-directory $ npm install -~/windshaft-directory $ npm link -~/windshaft-cartodb-directory $ npm link windshaft +$ cd /path/to/windshaft/directory/ +/path/to/windshaft/directory$ npm install +/path/to/windshaft/directory/$ npm link +$ cd /path/to/windshaft-cartodb/directory/ +/path/to/windshaft-cartodb/directory$ npm link windshaft ``` From 6c72d3adbe956e9baaf497c25f93ea77f1846097 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 11:22:32 +0100 Subject: [PATCH 15/45] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 26a8db71..68ab842b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) -This is the [CartoDB Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [Windshaft](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: +This is the [CARTO Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [Windshaft](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: * Intantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) defined through CARTO's map configuration ([MapConfig](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). * Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizables templates. From 16e80424e0319176d4b51d1f9c52ca3eb5a0c98a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 11:23:42 +0100 Subject: [PATCH 16/45] Typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 68ab842b..31448b3a 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is the [CARTO Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [Windshaft](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: -* Intantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) defined through CARTO's map configuration ([MapConfig](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). +* Intantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) through CARTO's map configuration ([MapConfig](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). * Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizables templates. * Get map previews through [`Static Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/05-static-maps-API.md) API. * Render maps with large amount of data faster using [`Tile Aggregation`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/06-tile-aggregation.md). From a6ca48021038c5b160efb2a058db1adfdf952efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 11:27:11 +0100 Subject: [PATCH 17/45] Improve section --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 31448b3a..d1346deb 100644 --- a/README.md +++ b/README.md @@ -79,9 +79,9 @@ We love pull requests from everyone, see [Contributing to Open Source on GitHub] If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at [npm-link: Symlink a package folder](https://docs.npmjs.com/cli/link.html). ```shell -$ cd /path/to/windshaft/directory/ -/path/to/windshaft/directory$ npm install -/path/to/windshaft/directory/$ npm link -$ cd /path/to/windshaft-cartodb/directory/ -/path/to/windshaft-cartodb/directory$ npm link windshaft +$ cd /path/to/Windshaft +$ npm install +$ npm link +$ cd /path/to/Windshaft-cartodb +$ npm link windshaft ``` From 52d887f3b4ee355b397e1349206409d7408e922d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:27:15 +0100 Subject: [PATCH 18/45] typos --- README.md | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index d1346deb..92302371 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) -This is the [CARTO Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [Windshaft](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: +This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: -* Intantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) through CARTO's map configuration ([MapConfig](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). +* Instantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) through CARTO's map configuration ([`MapConfig`](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). * Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizables templates. * Get map previews through [`Static Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/05-static-maps-API.md) API. * Render maps with large amount of data faster using [`Tile Aggregation`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/06-tile-aggregation.md). @@ -26,15 +26,15 @@ This is the [CARTO Maps API](http://docs.cartodb.com/cartodb-platform/maps-api.h ### Optional -* [Varnish](http://www.varnish-cache.org) +* [`Varnish`](http://www.varnish-cache.org) ### PostGIS setup A `template_postgis` database is expected. One can be set up with ```shell -createdb --owner postgres --template template0 template_postgis -psql -d template_postgis -c 'CREATE EXTENSION postgis;' +$ createdb --owner postgres --template template0 template_postgis +$ psql -d template_postgis -c 'CREATE EXTENSION postgis;' ``` ### Build @@ -42,7 +42,7 @@ psql -d template_postgis -c 'CREATE EXTENSION postgis;' To fetch and build all node-based dependencies, run: ```shell -npm ci +$ npm ci ``` ### Run @@ -50,25 +50,24 @@ npm ci Create the `./config/environments/.js` file (there are `.example` files to start from). Look at `./lib/cartodb/server-options.js` for more on config. ```shell -node app.js +$ node app.js ``` Where `` is the name of a configuration file under `./config/environments/`. ## Documentation -The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: -The [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) defined the endpoints and their expected parameters and outputs. +The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: the [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) document defines the endpoints and their expected parameters and outputs. ### Examples -[CartoDB's Map Gallery](http://cartodb.com/gallery/) showcases several examples of visualisations built on top of this. +[CartoDB's Map Gallery](https://carto.com/platform/solutions-visualization/) showcases several examples of visualisations built on top of this. ## Contributing -The issue tracker: [github](https://github.com/CartoDB/Windshaft-cartodb/issues). +The issue tracker: [`Github`](https://github.com/CartoDB/Windshaft-cartodb/issues). -We love pull requests from everyone, see [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). +We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). ### Submitting Contributions @@ -76,7 +75,7 @@ We love pull requests from everyone, see [Contributing to Open Source on GitHub] ### Developing with a custom windshaft version -If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at [npm-link: Symlink a package folder](https://docs.npmjs.com/cli/link.html). +If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at `npm-link`: [symlink a package folder](https://docs.npmjs.com/cli/link.html). ```shell $ cd /path/to/Windshaft From b3739655103a1c4d41f1820f8b7ebd4ac1b14a20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:30:56 +0100 Subject: [PATCH 19/45] Improve format contributing section --- README.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 92302371..de834b39 100644 --- a/README.md +++ b/README.md @@ -59,19 +59,11 @@ Where `` is the name of a configuration file under `./config/environments/` The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: the [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) document defines the endpoints and their expected parameters and outputs. -### Examples - -[CartoDB's Map Gallery](https://carto.com/platform/solutions-visualization/) showcases several examples of visualisations built on top of this. - ## Contributing -The issue tracker: [`Github`](https://github.com/CartoDB/Windshaft-cartodb/issues). - -We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). - -### Submitting Contributions - -* You will need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). +* The issue tracker: [`Github`](https://github.com/CartoDB/Windshaft-cartodb/issues). +* We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). +* You'll need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). ### Developing with a custom windshaft version From dfedb45254caf31639fecbc0d1639e358343096a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:37:33 +0100 Subject: [PATCH 20/45] Update description and keywords --- package.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ce9a08bd..c0e29c18 100644 --- a/package.json +++ b/package.json @@ -2,9 +2,17 @@ "private": true, "name": "windshaft-cartodb", "version": "8.0.1", - "description": "A map tile server for CartoDB", + "description": "CARTO Maps API tiler", "keywords": [ - "cartodb" + "carto", + "tiler", + "maps", + "anonymous maps", + "named maps", + "static maps", + "smart aggregations", + "analysis", + "dataviews" ], "url": "https://github.com/CartoDB/Windshaft-cartodb", "license": "BSD-3-Clause", From 06c0b28d371a91c7f8575f9c68e6cc5c571e45a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:44:31 +0100 Subject: [PATCH 21/45] Add versioning and license sections --- README.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de834b39..3b091271 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,4 @@ -# Windshaft-CartoDB - -[![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) +# Windshaft-CartoDB [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: @@ -76,3 +74,11 @@ $ npm link $ cd /path/to/Windshaft-cartodb $ npm link windshaft ``` + +## Versioning + +We follow [`SemVer`](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Windshaft-cartodb/cartonik/tags). + +## License + +This project is licensed under the BSD 3-clause "New" or "Revised" License - see the [LICENSE](LICENSE) file for details. From 67d8919f8ab7c229075a7494d3e406675d65e2d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:48:00 +0100 Subject: [PATCH 22/45] Typos --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3b091271..cd9ae086 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api * Build advanced maps with enriched data through [`Analyses Extension`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/09-MapConfig-analyses-extension.md). * Fetch tabular data from analysis nodes with [`Dataviews`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/10-MapConfig-dataviews-extension.md) -## Install +## Build ### Requirements @@ -35,7 +35,7 @@ $ createdb --owner postgres --template template0 template_postgis $ psql -d template_postgis -c 'CREATE EXTENSION postgis;' ``` -### Build +### Install To fetch and build all node-based dependencies, run: @@ -63,7 +63,7 @@ The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/do * We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). * You'll need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). -### Developing with a custom windshaft version +## Developing with a custom windshaft version If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at `npm-link`: [symlink a package folder](https://docs.npmjs.com/cli/link.html). From 3c92e186d6ca5f573637c7ef3d6362d788d37fc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:51:12 +0100 Subject: [PATCH 23/45] Missing optional requirement --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cd9ae086..4934db33 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api ## Build -### Requirements +Requirements: * Node 10.x * npm 6.x @@ -22,9 +22,10 @@ This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api * libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support * C++11 (to build internal dependencies if needed) -### Optional +Optional: * [`Varnish`](http://www.varnish-cache.org) +* [`Statsd`](https://github.com/statsd/statsd) ### PostGIS setup From c7bd132e2f5e7f48b06d8a872b0ffafe455d3078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 12:58:16 +0100 Subject: [PATCH 24/45] Add developers center link --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 4934db33..dbcf82e5 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,8 @@ Where `` is the name of a configuration file under `./config/environments/` The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: the [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) document defines the endpoints and their expected parameters and outputs. +You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). + ## Contributing * The issue tracker: [`Github`](https://github.com/CartoDB/Windshaft-cartodb/issues). From 283baa4a3fb8189f9ebf3d6a55892a8cd0711626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:00:54 +0100 Subject: [PATCH 25/45] remove death link --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index dbcf82e5..1e390795 100644 --- a/README.md +++ b/README.md @@ -56,9 +56,7 @@ Where `` is the name of a configuration file under `./config/environments/` ## Documentation -The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones: the [Maps API](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/Map-API.md) document defines the endpoints and their expected parameters and outputs. - -You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). +You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones. ## Contributing From 63ccfac59973970dd245d14fcbb1b1e47a3c00ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:11:19 +0100 Subject: [PATCH 26/45] Add links --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1e390795..c278b00c 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,11 @@ This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api Requirements: -* Node 10.x -* npm 6.x -* PostgreSQL >= 10.0 -* PostGIS >= 2.4 -* CARTO Postgres Extension >= 0.24.1 -* Redis >= 4 +* [`Node 10.x (npm 6.x)`](https://nodejs.org/dist/latest-v10.x/) +* [`PostgreSQL >= 10.0`](https://www.postgresql.org/download/) +* [`PostGIS >= 2.4`](https://postgis.net/install/) +* [`CARTO Postgres Extension >= 0.24.1`](https://github.com/CartoDB/cartodb-postgresql) +* [`Redis >= 4`](https://redis.io/download) * libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support * C++11 (to build internal dependencies if needed) From 8523f835dcae216648574c59776fb91709318528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:13:31 +0100 Subject: [PATCH 27/45] Format --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c278b00c..9ef51d20 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,8 @@ Requirements: * [`PostGIS >= 2.4`](https://postgis.net/install/) * [`CARTO Postgres Extension >= 0.24.1`](https://github.com/CartoDB/cartodb-postgresql) * [`Redis >= 4`](https://redis.io/download) -* libcairo2-dev, libpango1.0-dev, libjpeg8-dev and libgif-dev for server side canvas support -* C++11 (to build internal dependencies if needed) +* `libcairo2-dev`, `libpango1.0-dev`, `libjpeg8-dev` and `libgif-dev` for server side canvas support +* `C++11` to build internal dependencies. When there's no pre-built binaries for your OS/architecture distribution. Optional: From d3f0c52474fb37d4363cab81041a93efa973894a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:19:47 +0100 Subject: [PATCH 28/45] Add test and coverage sections --- README.md | 12 ++++++++++++ package.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ef51d20..d0d58848 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,18 @@ $ node app.js Where `` is the name of a configuration file under `./config/environments/`. +### Test + +```shell +$ npm test +``` + +### Coverage + +```shell +$ npm run cover +``` + ## Documentation You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones. diff --git a/package.json b/package.json index c0e29c18..9daa48bd 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", - "test:coverage": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown", + "cover": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown", "pretest:ci": "cp config/environments/test.js.example config/environments/test.js", "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" From 11e5726ea93ad9d0f509e99117dc5ac0557e5e14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:24:12 +0100 Subject: [PATCH 29/45] Improve coverage section --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d0d58848..73a0d5f3 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,8 @@ $ npm test $ npm run cover ``` +Open `./coverage/lcov-report/index.html`. + ## Documentation You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones. From 7d7ca0de4a7004b2b219c5a290ab9d98a535df78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:32:05 +0100 Subject: [PATCH 30/45] Add run perms to pre-install script --- scripts/check-node-canvas.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 scripts/check-node-canvas.sh diff --git a/scripts/check-node-canvas.sh b/scripts/check-node-canvas.sh old mode 100644 new mode 100755 From 525d41e63cfdb867196ada49708b7115e79e258a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:41:18 +0100 Subject: [PATCH 31/45] Merge pre-install scripts --- package.json | 2 +- scripts/check-node-canvas.sh | 24 ------------------------ scripts/install.sh | 7 ------- 3 files changed, 1 insertion(+), 32 deletions(-) delete mode 100755 scripts/check-node-canvas.sh delete mode 100644 scripts/install.sh diff --git a/package.json b/package.json index 9daa48bd..696d26c7 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "scripts": { "lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"", "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", - "preinstall": "./scripts/check-node-canvas.sh", + "preinstall": "./scripts/darwin-pre-install.sh", "pretest:setup": "npm run lint", "test:setup": "NODE_ENV=test node test setup", "pretest": "npm run test:setup", diff --git a/scripts/check-node-canvas.sh b/scripts/check-node-canvas.sh deleted file mode 100755 index a698e412..00000000 --- a/scripts/check-node-canvas.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -if [[ "$OSTYPE" == "darwin"* ]]; then - CAIRO_PKG_CONFIG=`pkg-config cairo --cflags-only-I 2> /dev/null` - RESULT=$? - - if [[ ${RESULT} -ne 0 ]]; then - echo "###################################################################################" - echo "# PREINSTALL HOOK ERROR #" - echo "#---------------------------------------------------------------------------------#" - echo "# #" - echo "# node-canvas install error: some packages required by 'cairo' are not found #" - echo "# #" - echo -e "# Use '\033[1mmake all\033[0m', it will take care of common/known issues #" - echo "# #" - echo "# As an alternative try: #" - echo "# Try to 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig' #" - echo "# #" - echo "# If problems persist visit: https://github.com/Automattic/node-canvas/wiki #" - echo "# #" - echo "###################################################################################" - exit 1 - fi -fi diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100644 index f596aa12..00000000 --- a/scripts/install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [[ "$OSTYPE" == "darwin"* ]]; then - export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig -fi - -npm install From dcf765efda5907887c973cce959120f6b5416d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:43:05 +0100 Subject: [PATCH 32/45] Merge pre-install scripts --- package.json | 2 +- scripts/darwin-pre-install.sh | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100755 scripts/darwin-pre-install.sh diff --git a/package.json b/package.json index 696d26c7..e4e62a55 100644 --- a/package.json +++ b/package.json @@ -78,7 +78,7 @@ "scripts": { "lint:fix": "eslint --fix app.js \"lib/**/*.js\" \"test/**/*.js\"", "lint": "eslint app.js \"lib/**/*.js\" \"test/**/*.js\"", - "preinstall": "./scripts/darwin-pre-install.sh", + "preinstall": "scripts/darwin-pre-install.sh", "pretest:setup": "npm run lint", "test:setup": "NODE_ENV=test node test setup", "pretest": "npm run test:setup", diff --git a/scripts/darwin-pre-install.sh b/scripts/darwin-pre-install.sh new file mode 100755 index 00000000..5cecb996 --- /dev/null +++ b/scripts/darwin-pre-install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +if [[ "$OSTYPE" == "darwin"* ]]; then + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig + CAIRO_PKG_CONFIG=`pkg-config cairo --cflags-only-I 2> /dev/null` + RESULT=$? + + if [[ ${RESULT} -ne 0 ]]; then + echo "###################################################################################" + echo "# PREINSTALL HOOK ERROR #" + echo "#---------------------------------------------------------------------------------#" + echo "# #" + echo "# node-canvas install error: some packages required by 'cairo' are not found #" + echo "# #" + echo -e "# Use '\033[1mmake all\033[0m', it will take care of common/known issues #" + echo "# #" + echo "# As an alternative try: #" + echo "# Try to 'export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig' #" + echo "# #" + echo "# If problems persist visit: https://github.com/Automattic/node-canvas/wiki #" + echo "# #" + echo "###################################################################################" + exit 1 + fi +fi From 57512ba48b49e845636dd49571faa0c0482655e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:47:38 +0100 Subject: [PATCH 33/45] Format --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73a0d5f3..79109a46 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,7 @@ You can find an overview, guides, full reference, and support in [`CARTO's devel * We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). * You'll need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). -## Developing with a custom windshaft version +## Developing with a custom `Windshaft` version If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at `npm-link`: [symlink a package folder](https://docs.npmjs.com/cli/link.html). From c0717467688bf84d19c36fc7c194c877e13b0941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 13:51:09 +0100 Subject: [PATCH 34/45] npm install --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 79109a46..4011401b 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ $ psql -d template_postgis -c 'CREATE EXTENSION postgis;' To fetch and build all node-based dependencies, run: ```shell -$ npm ci +$ npm install ``` ### Run From 38a556b7d6b51d12f4be1e1109707b4c573f5bcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 15:55:41 +0100 Subject: [PATCH 35/45] Improve spelling in documentation --- .travis.yml | 2 +- README.md | 39 ++++++++++++++++++++++++++++++--------- package.json | 4 ++-- 3 files changed, 33 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index fc6ef253..72424902 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ env: services: - docker before_install: docker pull ${DOCKER_IMAGE} -script: npm run test:ci +script: npm run test:docker diff --git a/README.md b/README.md index 4011401b..3451fe59 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Windshaft-CartoDB [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) -This is the [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: +The [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: * Instantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) through CARTO's map configuration ([`MapConfig`](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). -* Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizables templates. +* Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizable templates. * Get map previews through [`Static Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/05-static-maps-API.md) API. -* Render maps with large amount of data faster using [`Tile Aggregation`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/06-tile-aggregation.md). +* Render maps with a large amount of data faster using [`Tile Aggregation`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/06-tile-aggregation.md). * Build advanced maps with enriched data through [`Analyses Extension`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/09-MapConfig-analyses-extension.md). * Fetch tabular data from analysis nodes with [`Dataviews`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/10-MapConfig-dataviews-extension.md) @@ -67,19 +67,40 @@ $ npm run cover Open `./coverage/lcov-report/index.html`. +### Docker support + +We provide docker images just for testing and continuous integration purposes: + +* [`nodejs-xenial-pg1121`](https://hub.docker.com/r/carto/nodejs-xenial-pg1121/tags) +* [`nodejs-xenial-pg101`](https://hub.docker.com/r/carto/nodejs-xenial-pg101/tags) + +And useful `npm` scripts: + +* Run test in a docker image with a specific Node.js version: + +```shell +$ DOCKER_IMAGE=carto/nodejs-xenial-pg1121:latest NODE_VERSION=10.15.1 npm run test:docker +``` + +* In case you need to debug: + +```shell +$ DOCKER_IMAGE=carto/nodejs-xenial-pg1121:latest npm run docker:bash +``` + ## Documentation -You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from higher level to more detailed ones. +You can find an overview, guides, full reference, and support in [`CARTO's developer center`](https://carto.com/developers/maps-api/). The [docs directory](https://github.com/CartoDB/Windshaft-cartodb/tree/master/docs) contains different documentation resources, from a higher level to more detailed ones. ## Contributing * The issue tracker: [`Github`](https://github.com/CartoDB/Windshaft-cartodb/issues). -* We love pull requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). -* You'll need to sign a Contributor License Agreement (CLA) before making a submission. [Learn more here](https://carto.com/contributions). +* We love Pull Requests from everyone, see [contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/#contributing). +* You'll need to sign a Contributor License Agreement (CLA) before submitting a Pull Request. [Learn more here](https://carto.com/contributions). ## Developing with a custom `Windshaft` version -If you plan or want to use a custom / not released yet version of windshaft (or any other dependency) the best option is to use `npm link`. You can read more about it at `npm-link`: [symlink a package folder](https://docs.npmjs.com/cli/link.html). +If you plan or want to use a custom / not released yet version of windshaft (or any other dependency), the best option is to use `npm link`. You can read more about it at `npm-link`: [symlink a package folder](https://docs.npmjs.com/cli/link.html). ```shell $ cd /path/to/Windshaft @@ -91,8 +112,8 @@ $ npm link windshaft ## Versioning -We follow [`SemVer`](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/Windshaft-cartodb/cartonik/tags). +We follow [`SemVer`](http://semver.org/) for versioning. For available versions, see the [tags on this repository](https://github.com/Windshaft-cartodb/cartonik/tags). ## License -This project is licensed under the BSD 3-clause "New" or "Revised" License - see the [LICENSE](LICENSE) file for details. +This project is licensed under the BSD 3-clause "New" or "Revised" License. See the [LICENSE](LICENSE) file for details. diff --git a/package.json b/package.json index e4e62a55..fe685cf3 100644 --- a/package.json +++ b/package.json @@ -86,8 +86,8 @@ "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", "cover": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown", - "pretest:ci": "cp config/environments/test.js.example config/environments/test.js", - "test:ci": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", + "pretest:docker": "cp config/environments/test.js.example config/environments/test.js", + "test:docker": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" }, "engines": { From ef201e6fcf8ac4e2084eafeee5427ed7d47787f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 16:30:48 +0100 Subject: [PATCH 36/45] Improve docker section in docs --- README.md | 17 ++++++++++++----- docker/reference.md | 38 ++++++++++++++++++++++++-------------- 2 files changed, 36 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 3451fe59..a3dc81cb 100644 --- a/README.md +++ b/README.md @@ -74,18 +74,25 @@ We provide docker images just for testing and continuous integration purposes: * [`nodejs-xenial-pg1121`](https://hub.docker.com/r/carto/nodejs-xenial-pg1121/tags) * [`nodejs-xenial-pg101`](https://hub.docker.com/r/carto/nodejs-xenial-pg101/tags) -And useful `npm` scripts: +You can find instructions to install Docker, download, and update images [here](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docker/reference.md). -* Run test in a docker image with a specific Node.js version: +### Useful `npm` scripts + +Run test in a docker image with a specific Node.js version: ```shell -$ DOCKER_IMAGE=carto/nodejs-xenial-pg1121:latest NODE_VERSION=10.15.1 npm run test:docker +$ DOCKER_IMAGE= NODE_VERSION= npm run test:docker ``` -* In case you need to debug: +Where: + +* ``: the tag of required docker image, e.g. `carto/nodejs-xenial-pg1121:latest` +* ``: the Node.js version, e.g. `10.15.1` + +In case you need to debug: ```shell -$ DOCKER_IMAGE=carto/nodejs-xenial-pg1121:latest npm run docker:bash +$ DOCKER_IMAGE= npm run docker:bash ``` ## Documentation diff --git a/docker/reference.md b/docker/reference.md index 31dd26cb..601afe17 100644 --- a/docker/reference.md +++ b/docker/reference.md @@ -1,23 +1,33 @@ -After running the tests with docker, you will need Docker installed and the docker image downloaded. +# Testing with Docker + +Before running the tests with docker, you'll need Docker installed and the docker image downloaded. ## Install docker -`sudo apt install docker.io && sudo usermod -aG docker $(whoami)` + +```shell +$ sudo apt install docker.io && sudo usermod -aG docker $(whoami) +``` ## Download image -`docker pull carto/IMAGE` + +```shell +docker pull carto/IMAGE +``` ## Carto account -https://hub.docker.com/r/carto/ + +* `https://hub.docker.com/r/carto/` ## Update image -- Edit the docker image file with your desired changes -- Build image: - - `docker build -t carto/IMAGE -f docker/DOCKER_FILE docker/` -- Upload to docker hub: - - Login into docker hub: - - `docker login` - - Create tag: - - `docker tag carto/IMAGE carto/IMAGE` - - Upload: - - `docker push carto/IMAGE` +* Edit the docker image file with your desired changes +* Build image: + * `docker build -t carto/IMAGE -f docker/DOCKER_FILE docker/` + +* Upload to docker hub: + * Login into docker hub: + * `docker login` + * Create tag: + * `docker tag carto/IMAGE carto/IMAGE` + * Upload: + * `docker push carto/IMAGE` From eca75d1365fc07be6f3a4ce25bc895c372644dc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 16:33:47 +0100 Subject: [PATCH 37/45] Removed unused docker files --- ...file-nodejs10-xenial-pg101:postgis-2.4.4.5 | 88 ------------------ docker/Dockerfile-nodejs6-xenial-pg101:latest | 89 ------------------- ...ockerfile-nodejs6-xenial-pg101:postgis-2.4 | 89 ------------------- ...rfile-nodejs6-xenial-pg101:postgis-2.4.4.5 | 88 ------------------ 4 files changed, 354 deletions(-) delete mode 100644 docker/Dockerfile-nodejs10-xenial-pg101:postgis-2.4.4.5 delete mode 100644 docker/Dockerfile-nodejs6-xenial-pg101:latest delete mode 100644 docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4 delete mode 100644 docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4.4.5 diff --git a/docker/Dockerfile-nodejs10-xenial-pg101:postgis-2.4.4.5 b/docker/Dockerfile-nodejs10-xenial-pg101:postgis-2.4.4.5 deleted file mode 100644 index f0c3f738..00000000 --- a/docker/Dockerfile-nodejs10-xenial-pg101:postgis-2.4.4.5 +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubuntu:xenial - -# Use UTF8 to avoid encoding problems with pgsql -ENV LANG C.UTF-8 -ENV NPROCS 1 -ENV JOBS 1 -ENV CXX g++-4.9 -ENV PGUSER postgres - -# Add external repos -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - curl \ - software-properties-common \ - locales \ - && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ - && add-apt-repository -y ppa:cartodb/postgresql-10 \ - && add-apt-repository -y ppa:cartodb/gis \ - && curl -sL https://deb.nodesource.com/setup_10.x | bash \ - && locale-gen en_US.UTF-8 \ - && update-locale LANG=en_US.UTF-8 - -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - g++-4.9 \ - gcc-4.9 \ - git \ - libcairo2-dev \ - libgdal-dev \ - libgdal1i \ - libgdal20 \ - libgeos-dev \ - libgif-dev \ - libjpeg8-dev \ - libjson-c-dev \ - libpango1.0-dev \ - libpixman-1-dev \ - libproj-dev \ - libprotobuf-c-dev \ - libxml2-dev \ - gdal-bin \ - make \ - nodejs \ - protobuf-c-compiler \ - pkg-config \ - wget \ - zip \ - postgresql-10 \ - postgresql-10-plproxy \ - postgis=2.4.4.5+carto-1 \ - postgresql-10-postgis-2.4=2.4.4.5+carto-1 \ - postgresql-10-postgis-2.4-scripts=2.4.4.5+carto-1 \ - postgresql-10-postgis-scripts=2.4.4.5+carto-1 \ - postgresql-client-10 \ - postgresql-client-common \ - postgresql-common \ - postgresql-contrib \ - postgresql-plpython-10 \ - postgresql-server-dev-10 \ - && wget http://download.redis.io/releases/redis-4.0.8.tar.gz \ - && tar xvzf redis-4.0.8.tar.gz \ - && cd redis-4.0.8 \ - && make \ - && make install \ - && cd .. \ - && rm redis-4.0.8.tar.gz \ - && rm -R redis-4.0.8 \ - && apt-get purge -y wget protobuf-c-compiler \ - && apt-get autoremove -y - -# Configure PostgreSQL -RUN set -ex \ - && echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf \ - && echo "local all all trust" > /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all ::1/128 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && /etc/init.d/postgresql start \ - && createdb template_postgis \ - && createuser publicuser \ - && psql -c "CREATE EXTENSION postgis" template_postgis \ - && /etc/init.d/postgresql stop - -WORKDIR /srv -EXPOSE 5858 - -CMD /etc/init.d/postgresql start diff --git a/docker/Dockerfile-nodejs6-xenial-pg101:latest b/docker/Dockerfile-nodejs6-xenial-pg101:latest deleted file mode 100644 index d1d70589..00000000 --- a/docker/Dockerfile-nodejs6-xenial-pg101:latest +++ /dev/null @@ -1,89 +0,0 @@ -FROM ubuntu:xenial - -# Use UTF8 to avoid encoding problems with pgsql -ENV LANG C.UTF-8 -ENV NPROCS 1 -ENV JOBS 1 -ENV CXX g++-4.9 -ENV PGUSER postgres - -# Add external repos -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - curl \ - software-properties-common \ - locales \ - && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ - && add-apt-repository -y ppa:cartodb/postgresql-10 \ - && add-apt-repository -y ppa:cartodb/gis \ - && curl -sL https://deb.nodesource.com/setup_6.x | bash \ - && locale-gen en_US.UTF-8 \ - && update-locale LANG=en_US.UTF-8 - -# Install dependencies and PostGIS 2.4 from sources -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - g++-4.9 \ - gcc-4.9 \ - git \ - libcairo2-dev \ - libgdal-dev \ - libgdal1i \ - libgdal20 \ - libgeos-dev \ - libgif-dev \ - libjpeg8-dev \ - libjson-c-dev \ - libpango1.0-dev \ - libpixman-1-dev \ - libproj-dev \ - libprotobuf-c-dev \ - libxml2-dev \ - gdal-bin \ - make \ - nodejs \ - protobuf-c-compiler \ - pkg-config \ - wget \ - zip \ - postgresql-10 \ - postgresql-10-plproxy \ - postgresql-10-postgis-2.4 \ - postgresql-10-postgis-2.4-scripts \ - postgresql-10-postgis-scripts \ - postgresql-client-10 \ - postgresql-client-common \ - postgresql-common \ - postgresql-contrib \ - postgresql-plpython-10 \ - postgresql-server-dev-10 \ - postgis \ - && wget http://download.redis.io/releases/redis-4.0.8.tar.gz \ - && tar xvzf redis-4.0.8.tar.gz \ - && cd redis-4.0.8 \ - && make \ - && make install \ - && cd .. \ - && rm redis-4.0.8.tar.gz \ - && rm -R redis-4.0.8 \ - && apt-get purge -y wget protobuf-c-compiler \ - && apt-get autoremove -y - -# Configure PostgreSQL -RUN set -ex \ - && echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf \ - && echo "local all all trust" > /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all ::1/128 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && /etc/init.d/postgresql start \ - && createdb template_postgis \ - && createuser publicuser \ - && psql -c "CREATE EXTENSION postgis" template_postgis \ - && /etc/init.d/postgresql stop - -WORKDIR /srv -EXPOSE 5858 - -CMD /etc/init.d/postgresql start diff --git a/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4 b/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4 deleted file mode 100644 index d1d70589..00000000 --- a/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4 +++ /dev/null @@ -1,89 +0,0 @@ -FROM ubuntu:xenial - -# Use UTF8 to avoid encoding problems with pgsql -ENV LANG C.UTF-8 -ENV NPROCS 1 -ENV JOBS 1 -ENV CXX g++-4.9 -ENV PGUSER postgres - -# Add external repos -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - curl \ - software-properties-common \ - locales \ - && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ - && add-apt-repository -y ppa:cartodb/postgresql-10 \ - && add-apt-repository -y ppa:cartodb/gis \ - && curl -sL https://deb.nodesource.com/setup_6.x | bash \ - && locale-gen en_US.UTF-8 \ - && update-locale LANG=en_US.UTF-8 - -# Install dependencies and PostGIS 2.4 from sources -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - g++-4.9 \ - gcc-4.9 \ - git \ - libcairo2-dev \ - libgdal-dev \ - libgdal1i \ - libgdal20 \ - libgeos-dev \ - libgif-dev \ - libjpeg8-dev \ - libjson-c-dev \ - libpango1.0-dev \ - libpixman-1-dev \ - libproj-dev \ - libprotobuf-c-dev \ - libxml2-dev \ - gdal-bin \ - make \ - nodejs \ - protobuf-c-compiler \ - pkg-config \ - wget \ - zip \ - postgresql-10 \ - postgresql-10-plproxy \ - postgresql-10-postgis-2.4 \ - postgresql-10-postgis-2.4-scripts \ - postgresql-10-postgis-scripts \ - postgresql-client-10 \ - postgresql-client-common \ - postgresql-common \ - postgresql-contrib \ - postgresql-plpython-10 \ - postgresql-server-dev-10 \ - postgis \ - && wget http://download.redis.io/releases/redis-4.0.8.tar.gz \ - && tar xvzf redis-4.0.8.tar.gz \ - && cd redis-4.0.8 \ - && make \ - && make install \ - && cd .. \ - && rm redis-4.0.8.tar.gz \ - && rm -R redis-4.0.8 \ - && apt-get purge -y wget protobuf-c-compiler \ - && apt-get autoremove -y - -# Configure PostgreSQL -RUN set -ex \ - && echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf \ - && echo "local all all trust" > /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all ::1/128 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && /etc/init.d/postgresql start \ - && createdb template_postgis \ - && createuser publicuser \ - && psql -c "CREATE EXTENSION postgis" template_postgis \ - && /etc/init.d/postgresql stop - -WORKDIR /srv -EXPOSE 5858 - -CMD /etc/init.d/postgresql start diff --git a/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4.4.5 b/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4.4.5 deleted file mode 100644 index c4d7b091..00000000 --- a/docker/Dockerfile-nodejs6-xenial-pg101:postgis-2.4.4.5 +++ /dev/null @@ -1,88 +0,0 @@ -FROM ubuntu:xenial - -# Use UTF8 to avoid encoding problems with pgsql -ENV LANG C.UTF-8 -ENV NPROCS 1 -ENV JOBS 1 -ENV CXX g++-4.9 -ENV PGUSER postgres - -# Add external repos -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - curl \ - software-properties-common \ - locales \ - && add-apt-repository -y ppa:ubuntu-toolchain-r/test \ - && add-apt-repository -y ppa:cartodb/postgresql-10 \ - && add-apt-repository -y ppa:cartodb/gis \ - && curl -sL https://deb.nodesource.com/setup_6.x | bash \ - && locale-gen en_US.UTF-8 \ - && update-locale LANG=en_US.UTF-8 - -RUN set -ex \ - && apt-get update \ - && apt-get install -y \ - g++-4.9 \ - gcc-4.9 \ - git \ - libcairo2-dev \ - libgdal-dev \ - libgdal1i \ - libgdal20 \ - libgeos-dev \ - libgif-dev \ - libjpeg8-dev \ - libjson-c-dev \ - libpango1.0-dev \ - libpixman-1-dev \ - libproj-dev \ - libprotobuf-c-dev \ - libxml2-dev \ - gdal-bin \ - make \ - nodejs \ - protobuf-c-compiler \ - pkg-config \ - wget \ - zip \ - postgresql-10 \ - postgresql-10-plproxy \ - postgis=2.4.4.5+carto-1 \ - postgresql-10-postgis-2.4=2.4.4.5+carto-1 \ - postgresql-10-postgis-2.4-scripts=2.4.4.5+carto-1 \ - postgresql-10-postgis-scripts=2.4.4.5+carto-1 \ - postgresql-client-10 \ - postgresql-client-common \ - postgresql-common \ - postgresql-contrib \ - postgresql-plpython-10 \ - postgresql-server-dev-10 \ - && wget http://download.redis.io/releases/redis-4.0.8.tar.gz \ - && tar xvzf redis-4.0.8.tar.gz \ - && cd redis-4.0.8 \ - && make \ - && make install \ - && cd .. \ - && rm redis-4.0.8.tar.gz \ - && rm -R redis-4.0.8 \ - && apt-get purge -y wget protobuf-c-compiler \ - && apt-get autoremove -y - -# Configure PostgreSQL -RUN set -ex \ - && echo "listen_addresses='*'" >> /etc/postgresql/10/main/postgresql.conf \ - && echo "local all all trust" > /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && echo "host all all ::1/128 trust" >> /etc/postgresql/10/main/pg_hba.conf \ - && /etc/init.d/postgresql start \ - && createdb template_postgis \ - && createuser publicuser \ - && psql -c "CREATE EXTENSION postgis" template_postgis \ - && /etc/init.d/postgresql stop - -WORKDIR /srv -EXPOSE 5858 - -CMD /etc/init.d/postgresql start From f8c86f3b72edf8cc03538c2c9f0b95886d901b20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Fri, 29 Nov 2019 17:23:27 +0100 Subject: [PATCH 38/45] Don't be bombastic --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a3dc81cb..a0cd75cd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Windshaft-CartoDB [![Build Status](https://travis-ci.org/CartoDB/Windshaft-cartodb.svg?branch=master)](https://travis-ci.org/CartoDB/Windshaft-cartodb) -The [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a complete web service with extra functionality: +The [`CARTO Maps API`](http://docs.cartodb.com/cartodb-platform/maps-api.html) tiler. It extends [`Windshaft`](https://github.com/CartoDB/Windshaft) and exposes a web service with extra functionality: * Instantiate [`Anonymous Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/03-anonymous-maps.md) through CARTO's map configuration ([`MapConfig`](https://github.com/CartoDB/Windshaft/blob/master/doc/MapConfig-specification.md)). * Create [`Named Maps`](https://github.com/CartoDB/Windshaft-cartodb/blob/master/docs/guides/04-named-maps.md) based on customizable templates. From 33143ea28e6ebd69c4eed48814cc2dff5d597601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 1 Dec 2019 13:04:31 +0100 Subject: [PATCH 39/45] Update doc --- docker/reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/reference.md b/docker/reference.md index 601afe17..ff8435bc 100644 --- a/docker/reference.md +++ b/docker/reference.md @@ -20,7 +20,7 @@ docker pull carto/IMAGE ## Update image -* Edit the docker image file with your desired changes +* Edit the docker image file * Build image: * `docker build -t carto/IMAGE -f docker/DOCKER_FILE docker/` From 7081a7ec3c6418dfcc10036aa2624f9ade6d7330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 1 Dec 2019 13:04:56 +0100 Subject: [PATCH 40/45] Better script organization --- docker/scripts/test-setup.sh | 2 ++ package.json | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/docker/scripts/test-setup.sh b/docker/scripts/test-setup.sh index 876285b7..9d735d9a 100644 --- a/docker/scripts/test-setup.sh +++ b/docker/scripts/test-setup.sh @@ -8,5 +8,7 @@ source /src/nodejs-install.sh git clone https://github.com/CartoDB/cartodb-postgresql.git cd cartodb-postgresql && make && make install && cd .. +cp config/environments/test.js.example config/environments/test.js + npm ci npm test diff --git a/package.json b/package.json index d2057269..7a44b133 100644 --- a/package.json +++ b/package.json @@ -82,11 +82,16 @@ "pretest:setup": "npm run lint", "test:setup": "NODE_ENV=test node test setup", "pretest": "npm run test:setup", - "test": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit", + "test": "npm run test:all", + "test:all": "npm run test:unit && npm run test:integration && npm run test:acceptance", + "test:acceptance": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance", + "test:integration": "NODE_ENV=test mocha -t 5000 --exit --recursive test/integration", + "test:unit": "NODE_ENV=test mocha -t 5000 --exit --recursive test/unit", "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", - "cover": "npm run test:setup && nyc --reporter=lcov mocha -t 5000 --exit --recursive test/acceptance test/integration test/unit && npm run test:teardown", - "pretest:docker": "cp config/environments/test.js.example config/environments/test.js", + "precover": "npm run test:setup", + "cover": "NODE_ENV=test nyc --reporter=lcov npm run test:all", + "postcover": "npm run test:teardown", "test:docker": "docker run -e \"NODEJS_VERSION=$NODE_VERSION\" -v `pwd`:/srv $DOCKER_IMAGE bash docker/scripts/test-setup.sh && docker ps --filter status=dead --filter status=exited -aq | xargs docker rm -v", "docker:bash": "docker run -it -v `pwd`:/srv $DOCKER_IMAGE bash" }, From 413a1685aad75b5632fd53d81b2b02e8f0b551fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 1 Dec 2019 14:20:01 +0100 Subject: [PATCH 41/45] Set default timeout --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 7a44b133..e85461a3 100644 --- a/package.json +++ b/package.json @@ -85,8 +85,8 @@ "test": "npm run test:all", "test:all": "npm run test:unit && npm run test:integration && npm run test:acceptance", "test:acceptance": "NODE_ENV=test mocha -t 5000 --exit --recursive test/acceptance", - "test:integration": "NODE_ENV=test mocha -t 5000 --exit --recursive test/integration", - "test:unit": "NODE_ENV=test mocha -t 5000 --exit --recursive test/unit", + "test:integration": "NODE_ENV=test mocha --exit --recursive test/integration", + "test:unit": "NODE_ENV=test mocha --exit --recursive test/unit", "posttest": "npm run test:teardown", "test:teardown": "NODE_ENV=test node test teardown", "precover": "npm run test:setup", From 5dcca3e08868275cf60e3d5ec7921cc71fe3706b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 1 Dec 2019 19:00:27 +0100 Subject: [PATCH 42/45] Update 'how to release' document --- HOWTO_RELEASE | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 HOWTO_RELEASE diff --git a/HOWTO_RELEASE b/HOWTO_RELEASE deleted file mode 100644 index 0a398d01..00000000 --- a/HOWTO_RELEASE +++ /dev/null @@ -1,18 +0,0 @@ -1. Test (make clean all check), fix if broken before proceeding -2. Ensure proper version in package.json and package-lock.json -3. Ensure NEWS section exists for the new version, review it, add release date -4. If there are modified dependencies in package.json, update them with `npm upgrade {{package_name}}@{{version}}` -5. Commit package.json, package-lock.json, NEWS -6. git tag -a Major.Minor.Patch # use NEWS section as content -7. Stub NEWS/package for next version - -Versions: - -Bugfix releases increment Patch component of version. -Feature releases increment Minor and set Patch to zero. -If backward compatibility is broken, increment Major and -set to zero Minor and Patch. - -Branches named 'b.' are kept for any critical -fix that might need to be shipped before next feature release -is ready. From a88c0852788eaea080672d69b6358e3af4ad9846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Sun, 1 Dec 2019 19:03:47 +0100 Subject: [PATCH 43/45] Update 'how to release' document --- HOW_TO_RELEASE.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 HOW_TO_RELEASE.md diff --git a/HOW_TO_RELEASE.md b/HOW_TO_RELEASE.md new file mode 100644 index 00000000..df017f17 --- /dev/null +++ b/HOW_TO_RELEASE.md @@ -0,0 +1,16 @@ +How to release: + +1. Test (npm test), fix if broken before proceeding. +2. Ensure proper version in `package.json` and `package-lock.json`. +3. Ensure NEWS section exists for the new version, review it, add release date. +4. If there are modified dependencies in `package.json`, update them with `npm upgrade {{package_name}}@{{version}}`. +5. Commit `package.json`, `package-lock.json`, NEWS. +6. Run `git tag -a Major.Minor.Patch`. Use NEWS section as content. +7. Stub NEWS/package for next version. + +Versions: + +* Bugfix releases increment Patch component of version. +* Feature releases increment Minor and set Patch to zero. +* If backward compatibility is broken, increment Major and set to zero Minor and Patch. +* Branches named 'b.' are kept for any critical fix that might need to be shipped before next feature release is ready. From 2d09a214ae2f2784381a583649f983aa1fd5fb3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 2 Dec 2019 11:02:35 +0100 Subject: [PATCH 44/45] Leftovers from other PR --- lib/api/middlewares/custom-profile.js | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 lib/api/middlewares/custom-profile.js diff --git a/lib/api/middlewares/custom-profile.js b/lib/api/middlewares/custom-profile.js deleted file mode 100644 index 16ce6f9f..00000000 --- a/lib/api/middlewares/custom-profile.js +++ /dev/null @@ -1,13 +0,0 @@ -'use strict'; - -module.exports = function customProfile () { - return function customProfileMiddleware (req, res, next) { - const layergroupid = res.get('X-Layergroup-Id') || req.params.token; - - if (layergroupid) { - req.profiler.add({ layergroupid }); - } - - next(); - }; -}; From 2912e4fea68dbb2a678b6241cb74674f1c5aa3b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Garc=C3=ADa=20Aubert?= Date: Mon, 2 Dec 2019 12:30:19 +0100 Subject: [PATCH 45/45] Update NEWS and Release version --- NEWS.md | 13 ++++++++++++- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 138a4c66..fb37082e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,11 +1,22 @@ # Changelog -## 8.0.1 +## 8.1.0 Released 2019-mm-dd Announcements: - Removed `jshint` as linter in favour of `eslint` to check syntax, find problems, and enforce code style. - Upgrade `camshaft` to [`0.65.0`](https://github.com/CartoDB/camshaft/blob/9e8e5cd09dbfc6886c40f3f4a356fb7f235e82be/CHANGELOG.md#0650): Use quoted identifiers for column names. +- Stop using two different tools for package management, testing, and any other developer workflow. + - Removes Makefile and related bash scripts + - Use npm scripts as the only tool for testing, CI and linting. + - Simplified CI configuration. +- Improved documentation: + - Centralized several documents into README.md + - Remove outdated sections + - Update old sections + - Added missing sections. +- Remove deprecated coverage tool istanbul, using nyc instead. +- Removed unused dockerfiles ## 8.0.0 Released 2019-11-13 diff --git a/package-lock.json b/package-lock.json index 54094b23..d351c84d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "windshaft-cartodb", - "version": "8.0.1", + "version": "8.1.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index e85461a3..56ae78d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "windshaft-cartodb", - "version": "8.0.1", + "version": "8.1.0", "description": "CARTO Maps API tiler", "keywords": [ "carto",