From 3f11e09d2bcb2a0cb2c9492a28a9f9b7fc52b7a3 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 12:25:47 +0200 Subject: [PATCH 01/23] Set corrent content-type #54 --- src/routes/tracker.js | 13 +++++++++---- src/routes/ui.js | 41 +++++++++++++++++++++++++++++------------ src/utils/preload.js | 9 --------- test/utils/preload.js | 31 ------------------------------- 4 files changed, 38 insertions(+), 56 deletions(-) delete mode 100644 src/utils/preload.js delete mode 100644 test/utils/preload.js diff --git a/src/routes/tracker.js b/src/routes/tracker.js index 9a65bb92..91a6b695 100644 --- a/src/routes/tracker.js +++ b/src/routes/tracker.js @@ -2,17 +2,22 @@ const { readFile } = require('fs').promises -const preload = require('../utils/preload') const isProductionEnv = require('../utils/isProductionEnv') -const get = async () => { +const get = () => { const filePath = require.resolve('ackee-tracker') + const data = readFile(filePath, 'utf8') - return readFile(filePath, 'utf8') + return async (req, res) => { + + res.setHeader('Content-Type', 'text/javascript; charset=utf-8') + res.end(await data) + + } } module.exports = { - get: isProductionEnv === true ? preload(get) : get + get: isProductionEnv === true ? get() : (req, res) => get()(req, res) } \ No newline at end of file diff --git a/src/routes/ui.js b/src/routes/ui.js index 837e0ce5..b913e3a4 100644 --- a/src/routes/ui.js +++ b/src/routes/ui.js @@ -4,29 +4,39 @@ const { resolve } = require('path') const sass = require('rosid-handler-sass') const js = require('rosid-handler-js') -const preload = require('../utils/preload') const html = require('../ui/index') const isDemo = require('../utils/isDemo') const isProductionEnv = require('../utils/isProductionEnv') -const index = async () => { +const index = () => { - return html() + const data = html() + + return async (req, res) => { + + res.setHeader('Content-Type', 'text/html; charset=utf-8') + res.end(await data) + + } } -const styles = async () => { +const styles = () => { const filePath = resolve(__dirname, '../ui/styles/index.scss') + const data = sass(filePath, { optimize: isProductionEnv === true }) - return sass(filePath, { - optimize: isProductionEnv === true - }) + return async (req, res) => { + + res.setHeader('Content-Type', 'text/css; charset=utf-8') + res.end(await data) + + } } -const scripts = async () => { +const scripts = () => { const filePath = resolve(__dirname, '../ui/scripts/index.js') @@ -48,7 +58,7 @@ const scripts = async () => { babelrc: false } - return js(filePath, { + const data = js(filePath, { optimize: isProductionEnv === true, env: { ACKEE_DEMO: isDemo === true ? 'true' : 'false', @@ -57,10 +67,17 @@ const scripts = async () => { babel }) + return async (req, res) => { + + res.setHeader('Content-Type', 'application/javascript; charset=utf-8') + res.end(await data) + + } + } module.exports = { - index: isProductionEnv === true ? preload(index) : index, - styles: isProductionEnv === true ? preload(styles) : styles, - scripts: isProductionEnv === true ? preload(scripts) : scripts + index: isProductionEnv === true ? index() : (req, res) => index()(req, res), + styles: isProductionEnv === true ? styles() : (req, res) => styles()(req, res), + scripts: isProductionEnv === true ? scripts() : (req, res) => scripts()(req, res) } \ No newline at end of file diff --git a/src/utils/preload.js b/src/utils/preload.js deleted file mode 100644 index 5f152cd5..00000000 --- a/src/utils/preload.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict' - -module.exports = (fn) => { - - const output = fn() - - return async () => output - -} \ No newline at end of file diff --git a/test/utils/preload.js b/test/utils/preload.js deleted file mode 100644 index b5fcc861..00000000 --- a/test/utils/preload.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict' - -const test = require('ava') -const uuid = require('uuid/v4') - -const preload = require('../../src/utils/preload') - -test('return response of original function', async (t) => { - - const value = uuid() - const fn = async () => value - - const preloaded = preload(fn) - const result = await preloaded() - - t.is(result, await fn()) - -}) - -test('execute only once', async (t) => { - - t.plan(1) - - const fn = async () => t.pass() - - const preloaded = preload(fn) - - await preloaded() - await preloaded() - -}) \ No newline at end of file From 6301e3eb083bd4db02fa864f1ef7b27029c3574f Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 12:38:29 +0200 Subject: [PATCH 02/23] Adjust lint pattern --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9d81452f..c6c96666 100755 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "start": "node src/index.js", "coveralls": "nyc report --reporter=text-lcov | coveralls", "test": "nyc ava", - "lint": "eslint 'src/**/*.js'" + "lint": "eslint '{src,test}/**/*.js'" }, "eslintConfig": { "extends": "@electerious/eslint-config" From 37e0f1ac01ff6daccd2a3fc3b564faca014b4285 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 12:53:12 +0200 Subject: [PATCH 03/23] Serve favicon #38 --- src/routes/ui.js | 16 ++++++++++++++++ src/server.js | 1 + src/ui/index.js | 2 +- src/utils/layout.js | 5 ++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/routes/ui.js b/src/routes/ui.js index b913e3a4..7ded8fa2 100644 --- a/src/routes/ui.js +++ b/src/routes/ui.js @@ -1,6 +1,7 @@ 'use strict' const { resolve } = require('path') +const { readFile } = require('fs').promises const sass = require('rosid-handler-sass') const js = require('rosid-handler-js') @@ -22,6 +23,20 @@ const index = () => { } +const favicon = () => { + + const filePath = resolve(__dirname, '../ui/images/favicon.ico') + const data = readFile(filePath) + + return async (req, res) => { + + res.setHeader('Content-Type', 'image/vnd.microsoft.icon') + res.end(await data) + + } + +} + const styles = () => { const filePath = resolve(__dirname, '../ui/styles/index.scss') @@ -78,6 +93,7 @@ const scripts = () => { module.exports = { index: isProductionEnv === true ? index() : (req, res) => index()(req, res), + favicon: isProductionEnv === true ? favicon() : (req, res) => favicon()(req, res), styles: isProductionEnv === true ? styles() : (req, res) => styles()(req, res), scripts: isProductionEnv === true ? scripts() : (req, res) => scripts()(req, res) } \ No newline at end of file diff --git a/src/server.js b/src/server.js index ca64db10..71f2c2d8 100644 --- a/src/server.js +++ b/src/server.js @@ -57,6 +57,7 @@ module.exports = micro( get('/', ui.index), get('/index.html', ui.index), + get('/favicon.ico', ui.favicon), get('/index.css', ui.styles), get('/index.js', ui.scripts), diff --git a/src/ui/index.js b/src/ui/index.js index 8c29932d..54978a86 100644 --- a/src/ui/index.js +++ b/src/ui/index.js @@ -4,6 +4,6 @@ const layout = require('../utils/layout') module.exports = () => { - return layout('
', [ 'index.css' ], [ 'index.js' ]) + return layout('
', 'favicon.ico', [ 'index.css' ], [ 'index.js' ]) } \ No newline at end of file diff --git a/src/utils/layout.js b/src/utils/layout.js index db2e58cc..43430b82 100644 --- a/src/utils/layout.js +++ b/src/utils/layout.js @@ -1,6 +1,6 @@ 'use strict' -module.exports = (body, styles, scripts) => ` +module.exports = (body, favicon, styles, scripts) => ` @@ -10,6 +10,9 @@ module.exports = (body, styles, scripts) => ` + + + ${ styles.map((src) => ``).join('') } From 79473a1e3d8811d8c1e4a826ad7b395fd501f259 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 12:55:39 +0200 Subject: [PATCH 04/23] Add favicons to docs #38 --- docs/UI.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/UI.md b/docs/UI.md index f2b10ce3..e1ef36ad 100644 --- a/docs/UI.md +++ b/docs/UI.md @@ -1,6 +1,7 @@ # UI - [Index](#index) +- [Favicon](#favicon) - [Styles](#styles) - [Scripts](#scripts) - [Tracker](#tracker) @@ -31,6 +32,22 @@ Status: 200 OK … ``` +## Favicon + +Favicon of Ackee. + +### Request + +``` +GET /favicon.ico +``` + +### Response + +``` +Status: 200 OK +``` + ## Styles CSS used to display the UI of Ackee. From dfc1efc8f272360d91be4021b39707fecea42e24 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 15:07:14 +0200 Subject: [PATCH 05/23] Fix layout tests --- test/utils/layout.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/utils/layout.js b/test/utils/layout.js index 58b0cf1f..da67a292 100644 --- a/test/utils/layout.js +++ b/test/utils/layout.js @@ -8,16 +8,25 @@ const layout = require('../../src/utils/layout') test('return HTML with body', async (t) => { const body = uuid() - const result = layout(body, [], []) + const result = layout(body, '', [], []) t.true(result.includes(body)) }) +test('return HTML with favicon', async (t) => { + + const favicon = uuid() + const result = layout('', favicon, [], []) + + t.true(result.includes(favicon)) + +}) + test('return HTML with styles', async (t) => { const styles = [ uuid(), uuid() ] - const result = layout('', styles, []) + const result = layout('', '', styles, []) t.true(result.includes(styles[0])) t.true(result.includes(styles[1])) @@ -27,7 +36,7 @@ test('return HTML with styles', async (t) => { test('return HTML with scripts', async (t) => { const scripts = [ uuid(), uuid() ] - const result = layout('', [], scripts) + const result = layout('', '', [], scripts) t.true(result.includes(scripts[0])) t.true(result.includes(scripts[1])) From e907ab05fd091da845d7393428286cb1dff630c3 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 15:25:11 +0200 Subject: [PATCH 06/23] Test more routes --- test/server.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/server.js b/test/server.js index 34d5cdbe..ab2910ab 100644 --- a/test/server.js +++ b/test/server.js @@ -19,6 +19,16 @@ test('return HTML', async (t) => { }) +test('return favicon', async (t) => { + + const url = new URL('/favicon.ico', await base) + const res = await fetch(url.href) + const headers = res.headers + + t.is(headers.get('Content-Type'), 'image/vnd.microsoft.icon') + +}) + test('return JS', async (t) => { const url = new URL('/index.js', await base) @@ -39,6 +49,16 @@ test('return CSS', async (t) => { }) +test('return tracking script', async (t) => { + + const url = new URL('/tracker.js', await base) + const res = await fetch(url.href) + const result = await res.text() + + t.true(result.includes('use strict')) + +}) + test('return 404', async (t) => { const url = new URL(`/${ uuid() }`, await base) From 125b56aed7b3055b16c897342fecfd591bb7d960 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 15:41:05 +0200 Subject: [PATCH 07/23] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d90354a4..6bf4158c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fixed + +- Incorrect content type for JS files (#54) + ## [1.3.0] - 2019-10-19 ### Added From d2d39f838508ea881c42e0e5762e2fa934479ccf Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 16:42:57 +0200 Subject: [PATCH 08/23] New referrers --- src/constants/referrers.js | 2 + src/database/referrers.js | 43 +++++++++++++++++++ src/routes/referrers.js | 2 + .../components/routes/RouteReferrers.js | 2 + 4 files changed, 49 insertions(+) diff --git a/src/constants/referrers.js b/src/constants/referrers.js index ef32b61c..12b6d5dd 100644 --- a/src/constants/referrers.js +++ b/src/constants/referrers.js @@ -1,9 +1,11 @@ // Constants will be shared between client and server. // They will be used as values in the DOM and in the URL of the referrer calls. const REFERRERS_SORTING_TOP = 'top' +const REFERRERS_SORTING_NEW = 'new' const REFERRERS_SORTING_RECENT = 'recent' module.exports = { REFERRERS_SORTING_TOP, + REFERRERS_SORTING_NEW, REFERRERS_SORTING_RECENT } \ No newline at end of file diff --git a/src/database/referrers.js b/src/database/referrers.js index 2a889f67..daca8a9f 100644 --- a/src/database/referrers.js +++ b/src/database/referrers.js @@ -5,6 +5,7 @@ const dateWithOffset = require('../utils/dateWithOffset') const { REFERRERS_SORTING_TOP, + REFERRERS_SORTING_NEW, REFERRERS_SORTING_RECENT } = require('../constants/referrers') @@ -42,6 +43,47 @@ const getTop = async (id) => { } +const getNew = async (id) => { + + return Record.aggregate([ + { + $match: { + domainId: id, + siteReferrer: { + $ne: null + } + } + }, + { + $group: { + _id: '$siteReferrer', + count: { + $sum: 1 + }, + created: { + $first: '$created' + } + } + }, + { + $match: { + created: { + $gte: dateWithOffset(-6) + } + } + }, + { + $sort: { + created: -1 + } + }, + { + $limit: 25 + } + ]) + +} + const getRecent = async (id) => { return Record.aggregate([ @@ -78,6 +120,7 @@ const get = async (id, sorting) => { switch (sorting) { case REFERRERS_SORTING_TOP: return getTop(id) + case REFERRERS_SORTING_NEW: return getNew(id) case REFERRERS_SORTING_RECENT: return getRecent(id) } diff --git a/src/routes/referrers.js b/src/routes/referrers.js index 228e69c3..3ae7e6db 100644 --- a/src/routes/referrers.js +++ b/src/routes/referrers.js @@ -6,6 +6,7 @@ const referrers = require('../database/referrers') const { REFERRERS_SORTING_TOP, + REFERRERS_SORTING_NEW, REFERRERS_SORTING_RECENT } = require('../constants/referrers') @@ -32,6 +33,7 @@ const get = async (req) => { switch (sorting) { case REFERRERS_SORTING_TOP: return responses(entries) + case REFERRERS_SORTING_NEW: return responses(entries) case REFERRERS_SORTING_RECENT: return responses(entries) default: throw createError(400, 'Unknown sorting') } diff --git a/src/ui/scripts/components/routes/RouteReferrers.js b/src/ui/scripts/components/routes/RouteReferrers.js index 440e3d21..e642af79 100644 --- a/src/ui/scripts/components/routes/RouteReferrers.js +++ b/src/ui/scripts/components/routes/RouteReferrers.js @@ -2,6 +2,7 @@ import { createElement as h, Fragment, useEffect } from 'react' import { REFERRERS_SORTING_TOP, + REFERRERS_SORTING_NEW, REFERRERS_SORTING_RECENT } from '../../../../constants/referrers' @@ -36,6 +37,7 @@ const RouteReferrers = (props) => { onChange: (e) => props.setReferrersSorting(e.target.value), items: [ { value: REFERRERS_SORTING_TOP, label: 'Top referrers' }, + { value: REFERRERS_SORTING_NEW, label: 'New referrers' }, { value: REFERRERS_SORTING_RECENT, label: 'Recent referrers' } ] }) From 7dbec1c15c0890233b20837b1882de54c059fc2d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 16:48:00 +0200 Subject: [PATCH 09/23] Added new referrers to FAQ --- docs/FAQ.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/FAQ.md b/docs/FAQ.md index bb739767..96cae0a0 100644 --- a/docs/FAQ.md +++ b/docs/FAQ.md @@ -78,6 +78,10 @@ The last 25 page visits of the last 7 days. Sorted by time. The top 25 pages from which your visitors have come in the last 7 days. Sorted by popularity. +### Referrers > New referrers + +Pages from which your visitors have come in the last 7 days. Ignores old referrers. Sorted by time. + ### Referrers > Recent referrers The last 25 pages from which your visitors have come in the last 7 days. Sorted by time. From b714e251374851f8d1b482376b6a47b8d04e49f3 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 16:48:34 +0200 Subject: [PATCH 10/23] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bf4158c..58b1b8de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ## [Unreleased] +### Added + +- "New referrers" + ### Fixed - Incorrect content type for JS files (#54) From 1b3ad30c4511644a271368e7ba00eaa268f4345a Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 16:53:56 +0200 Subject: [PATCH 11/23] Adjust API docs --- docs/languages.md | 2 +- docs/pages.md | 2 +- docs/referrers.md | 41 ++++++++++++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/languages.md b/docs/languages.md index a91538af..5b2d0569 100644 --- a/docs/languages.md +++ b/docs/languages.md @@ -42,7 +42,7 @@ Status: 200 OK ## Get recent languages -Get the 25 most recent user languages ([ISO-639-1 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)). +Get the 25 most recent user languages ([ISO-639-1 codes](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)) of the last 7 days. ### Request diff --git a/docs/pages.md b/docs/pages.md index aa6979c3..8868a7bb 100644 --- a/docs/pages.md +++ b/docs/pages.md @@ -42,7 +42,7 @@ Status: 200 OK ## Get recent pages -Get the 25 most recent page views. +Get the 25 most recent page views of the last 7 days. ### Request diff --git a/docs/referrers.md b/docs/referrers.md index 27e040e9..0a6858b7 100644 --- a/docs/referrers.md +++ b/docs/referrers.md @@ -1,6 +1,7 @@ # Referrers - [Get top referrers](#get-top-referrers) +- [Get new referrers](#get-new-referrers) - [Get recent referrers](#get-recent-referrers) ## Get top referrers @@ -40,9 +41,47 @@ Status: 200 OK } ``` +## Get new referrers + +Get the 25 most recent referrers who have linked to your site for the first time in the last 7 days. + +### Request + +``` +GET /domains/:domainId/referrers?sorting=new +``` + +### Headers + +| Name | Example | +|:-----------|:------------| +| Authorization | `Authorization: Bearer :tokenId` | + +### Response + +``` +Status: 200 OK +``` + +```json +{ + "type": "referrers", + "data": [ + { + "type": "referrer", + "data": { + "id": "https://www.example.com/", + "count": 1, + "created": "2019-09-19T15:54:00.020Z" + } + } + ] +} +``` + ## Get recent referrers -Get the 25 most recent referrers. +Get the 25 most recent referrers of the last 7 days. ### Request From 2cc08d08ef140fd8d3ea6795c3d1b217b004f206 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 17:40:55 +0200 Subject: [PATCH 12/23] Move tracker to UI --- src/routes/tracker.js | 23 ----------------------- src/routes/ui.js | 17 ++++++++++++++++- src/server.js | 4 +--- 3 files changed, 17 insertions(+), 27 deletions(-) delete mode 100644 src/routes/tracker.js diff --git a/src/routes/tracker.js b/src/routes/tracker.js deleted file mode 100644 index 91a6b695..00000000 --- a/src/routes/tracker.js +++ /dev/null @@ -1,23 +0,0 @@ -'use strict' - -const { readFile } = require('fs').promises - -const isProductionEnv = require('../utils/isProductionEnv') - -const get = () => { - - const filePath = require.resolve('ackee-tracker') - const data = readFile(filePath, 'utf8') - - return async (req, res) => { - - res.setHeader('Content-Type', 'text/javascript; charset=utf-8') - res.end(await data) - - } - -} - -module.exports = { - get: isProductionEnv === true ? get() : (req, res) => get()(req, res) -} \ No newline at end of file diff --git a/src/routes/ui.js b/src/routes/ui.js index 7ded8fa2..f029ba5d 100644 --- a/src/routes/ui.js +++ b/src/routes/ui.js @@ -91,9 +91,24 @@ const scripts = () => { } +const tracker = () => { + + const filePath = require.resolve('ackee-tracker') + const data = readFile(filePath, 'utf8') + + return async (req, res) => { + + res.setHeader('Content-Type', 'text/javascript; charset=utf-8') + res.end(await data) + + } + +} + module.exports = { index: isProductionEnv === true ? index() : (req, res) => index()(req, res), favicon: isProductionEnv === true ? favicon() : (req, res) => favicon()(req, res), styles: isProductionEnv === true ? styles() : (req, res) => styles()(req, res), - scripts: isProductionEnv === true ? scripts() : (req, res) => scripts()(req, res) + scripts: isProductionEnv === true ? scripts() : (req, res) => scripts()(req, res), + tracker: isProductionEnv === true ? tracker() : (req, res) => tracker()(req, res) } \ No newline at end of file diff --git a/src/server.js b/src/server.js index 71f2c2d8..b844dced 100644 --- a/src/server.js +++ b/src/server.js @@ -9,7 +9,6 @@ const pipe = require('./utils/pipe') const requireAuth = require('./middlewares/requireAuth') const blockDemo = require('./middlewares/blockDemo') const ui = require('./routes/ui') -const tracker = require('./routes/tracker') const tokens = require('./routes/tokens') const domains = require('./routes/domains') const records = require('./routes/records') @@ -60,8 +59,7 @@ module.exports = micro( get('/favicon.ico', ui.favicon), get('/index.css', ui.styles), get('/index.js', ui.scripts), - - get('/tracker.js', tracker.get), + get('/tracker.js', ui.tracker), post('/tokens', tokens.add), del('/tokens/:tokenId', tokens.del), From 82e674034aa5dc926dfb953f1ccb5369c9a323af Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 19:21:24 +0200 Subject: [PATCH 13/23] Move isDefined to global utils --- src/ui/scripts/enhancers/enhanceState.js | 2 +- src/ui/scripts/utils/isDefined.js | 1 - src/ui/scripts/utils/mergeAverageDurations.js | 2 +- src/ui/scripts/utils/mergeViews.js | 2 +- src/utils/isDefined.js | 3 +++ test/utils/isDefined.js | 21 +++++++++++++++++++ 6 files changed, 27 insertions(+), 4 deletions(-) delete mode 100644 src/ui/scripts/utils/isDefined.js create mode 100644 src/utils/isDefined.js create mode 100644 test/utils/isDefined.js diff --git a/src/ui/scripts/enhancers/enhanceState.js b/src/ui/scripts/enhancers/enhanceState.js index 45ce76c2..27b0620c 100644 --- a/src/ui/scripts/enhancers/enhanceState.js +++ b/src/ui/scripts/enhancers/enhanceState.js @@ -1,4 +1,4 @@ -import isDefined from '../utils/isDefined' +import isDefined from '../../../utils/isDefined' export default (state) => { diff --git a/src/ui/scripts/utils/isDefined.js b/src/ui/scripts/utils/isDefined.js deleted file mode 100644 index 4438892a..00000000 --- a/src/ui/scripts/utils/isDefined.js +++ /dev/null @@ -1 +0,0 @@ -export default (_) => _ != null \ No newline at end of file diff --git a/src/ui/scripts/utils/mergeAverageDurations.js b/src/ui/scripts/utils/mergeAverageDurations.js index 24aadec4..e39745d4 100644 --- a/src/ui/scripts/utils/mergeAverageDurations.js +++ b/src/ui/scripts/utils/mergeAverageDurations.js @@ -1,5 +1,5 @@ import enhanceAverageDurations from '../enhancers/enhanceAverageDurations' -import isDefined from './isDefined' +import isDefined from '../../../utils/isDefined' // Turns the durations of multiple domains into one array of durations export default (domains, durations) => { diff --git a/src/ui/scripts/utils/mergeViews.js b/src/ui/scripts/utils/mergeViews.js index 7117dda8..b96d29e9 100644 --- a/src/ui/scripts/utils/mergeViews.js +++ b/src/ui/scripts/utils/mergeViews.js @@ -1,5 +1,5 @@ import enhanceViews from '../enhancers/enhanceViews' -import isDefined from './isDefined' +import isDefined from '../../../utils/isDefined' // Turns the views of multiple domains into one array of views export default (domains, views) => { diff --git a/src/utils/isDefined.js b/src/utils/isDefined.js new file mode 100644 index 00000000..0065e9de --- /dev/null +++ b/src/utils/isDefined.js @@ -0,0 +1,3 @@ +'use strict' + +module.exports = (_) => _ != null \ No newline at end of file diff --git a/test/utils/isDefined.js b/test/utils/isDefined.js new file mode 100644 index 00000000..2a29021a --- /dev/null +++ b/test/utils/isDefined.js @@ -0,0 +1,21 @@ +'use strict' + +const test = require('ava') + +const isDefined = require('../../src/utils/isDefined') + +test('return true when defined', async (t) => { + + const result = isDefined('defined') + + t.true(result) + +}) + +test('return true when undefined', async (t) => { + + const result = isDefined() + + t.false(result) + +}) \ No newline at end of file From 354cde13693ed8c5106f5afbf17ee8c5dcf57ba8 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 19:21:42 +0200 Subject: [PATCH 14/23] Add missing 'use strict' --- src/utils/runUpdate.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/runUpdate.js b/src/utils/runUpdate.js index 2afce7e7..841f8505 100644 --- a/src/utils/runUpdate.js +++ b/src/utils/runUpdate.js @@ -1,3 +1,5 @@ +'use strict' + module.exports = (schema, id, data = {}, props = []) => { const _set = {} From 438598d17ed5f776379f5fb7c18ae92307fcf06b Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 19:23:34 +0200 Subject: [PATCH 15/23] Custom tracker URL --- README.md | 10 ++++++ package.json | 5 ++- src/server.js | 61 ++++++++++++++++++---------------- src/utils/customTrackerUrl.js | 5 +++ test/utils/customTrackerUrl.js | 14 ++++++++ 5 files changed, 66 insertions(+), 29 deletions(-) create mode 100644 src/utils/customTrackerUrl.js create mode 100644 test/utils/customTrackerUrl.js diff --git a/README.md b/README.md index b241a872..a47a3610 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,16 @@ Specifies how long a generated token is valid. Defaults to `3600000` (1 day). ACKEE_TTL=3600000 ``` +#### Tracker + +Pick a custom name for the tracking script of Ackee to avoid getting blocked by browser extensions. The default script will always be available via `/tracker.js`. You custom script will be available via `/custom%20name.js`. Ackee will encode your custom name to a URL encoded format. + +Make sure to adjust the tracking script URL on your sites when changing this option. Sites that are using the default URL won't be affected. + +``` +ACKEE_TRACKER=custom name +``` + #### Environment Set the environment to `development` to see additional details in the console and to disable caching. diff --git a/package.json b/package.json index c6c96666..82241096 100755 --- a/package.json +++ b/package.json @@ -73,7 +73,10 @@ }, "ava": { "babel": false, - "verbose": true + "verbose": true, + "environmentVariables": { + "ACKEE_TRACKER": "custom name" + } }, "engines": { "node": ">= 10" diff --git a/src/server.js b/src/server.js index b844dced..96c46b99 100644 --- a/src/server.js +++ b/src/server.js @@ -6,6 +6,8 @@ const { router, get, post, put, patch, del } = require('microrouter') const signale = require('./utils/signale') const pipe = require('./utils/pipe') +const isDefined = require('./utils/isDefined') +const customTrackerUrl = require('./utils/customTrackerUrl') const requireAuth = require('./middlewares/requireAuth') const blockDemo = require('./middlewares/blockDemo') const ui = require('./routes/ui') @@ -50,44 +52,47 @@ const notFound = async (req) => { } -module.exports = micro( - catchError( - router( +const routes = [ + + get('/', ui.index), + get('/index.html', ui.index), + get('/favicon.ico', ui.favicon), + get('/index.css', ui.styles), + get('/index.js', ui.scripts), + get('/tracker.js', ui.tracker), + customTrackerUrl != null ? get(customTrackerUrl, ui.tracker) : undefined, - get('/', ui.index), - get('/index.html', ui.index), - get('/favicon.ico', ui.favicon), - get('/index.css', ui.styles), - get('/index.js', ui.scripts), - get('/tracker.js', ui.tracker), + post('/tokens', tokens.add), + del('/tokens/:tokenId', tokens.del), - post('/tokens', tokens.add), - del('/tokens/:tokenId', tokens.del), + post('/domains', pipe(requireAuth, blockDemo, domains.add)), + get('/domains', pipe(requireAuth, domains.all)), + put('/domains/:domainId', pipe(requireAuth, blockDemo, domains.update)), + del('/domains/:domainId', pipe(requireAuth, blockDemo, domains.del)), - post('/domains', pipe(requireAuth, blockDemo, domains.add)), - get('/domains', pipe(requireAuth, domains.all)), - put('/domains/:domainId', pipe(requireAuth, blockDemo, domains.update)), - del('/domains/:domainId', pipe(requireAuth, blockDemo, domains.del)), + post('/domains/:domainId/records', records.add), + patch('/domains/:domainId/records/:recordId', records.update), - post('/domains/:domainId/records', records.add), - patch('/domains/:domainId/records/:recordId', records.update), + get('/domains/:domainId/views', pipe(requireAuth, views.get)), - get('/domains/:domainId/views', pipe(requireAuth, views.get)), + get('/domains/:domainId/pages', pipe(requireAuth, pages.get)), - get('/domains/:domainId/pages', pipe(requireAuth, pages.get)), + get('/domains/:domainId/referrers', pipe(requireAuth, referrers.get)), - get('/domains/:domainId/referrers', pipe(requireAuth, referrers.get)), + get('/domains/:domainId/languages', pipe(requireAuth, languages.get)), - get('/domains/:domainId/languages', pipe(requireAuth, languages.get)), + get('/domains/:domainId/durations', pipe(requireAuth, durations.get)), - get('/domains/:domainId/durations', pipe(requireAuth, durations.get)), + get('/*', notFound), + post('/*', notFound), + put('/*', notFound), + patch('/*', notFound), + del('/*', notFound) - get('/*', notFound), - post('/*', notFound), - put('/*', notFound), - patch('/*', notFound), - del('/*', notFound) +].filter(isDefined) - ) +module.exports = micro( + catchError( + router(...routes) ) ) \ No newline at end of file diff --git a/src/utils/customTrackerUrl.js b/src/utils/customTrackerUrl.js new file mode 100644 index 00000000..6e409614 --- /dev/null +++ b/src/utils/customTrackerUrl.js @@ -0,0 +1,5 @@ +'use strict' + +const name = process.env.ACKEE_TRACKER + +module.exports = name != null ? `/${ encodeURIComponent(name) }.js` : undefined \ No newline at end of file diff --git a/test/utils/customTrackerUrl.js b/test/utils/customTrackerUrl.js new file mode 100644 index 00000000..0043e903 --- /dev/null +++ b/test/utils/customTrackerUrl.js @@ -0,0 +1,14 @@ +'use strict' + +const test = require('ava') + +const customTrackerUrl = require('../../src/utils/customTrackerUrl') + +test('return undefined', async (t) => { + + const result = customTrackerUrl + + // The name is specified in the package.json ava configuration + t.is(result, `/custom%20name.js`) + +}) \ No newline at end of file From c8eef09bbd118a02111b32a6f90471e7a9a4747d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 20 Oct 2019 19:24:23 +0200 Subject: [PATCH 16/23] Updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b1b8de..d9123e40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Added - "New referrers" +- Custom tracker URL (#53) ### Fixed From 35d4b055e054a07db09c3b681651ebe6c8ba8e50 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Thu, 31 Oct 2019 09:28:48 +0100 Subject: [PATCH 17/23] Fix Access-Control-Allow-Headers --- docs/CORS headers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CORS headers.md b/docs/CORS headers.md index 3ac23e82..83cddb3f 100644 --- a/docs/CORS headers.md +++ b/docs/CORS headers.md @@ -11,7 +11,7 @@ When a site wants to send data to a different domain it needs the permissions to ``` Access-Control-Allow-Origin: https://example.com Access-Control-Allow-Methods: GET, POST, PATCH, OPTIONS -Access-Control-Allow-Headers: DNT, X-CustomHeader, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type +Access-Control-Allow-Headers: Content-Type ``` ### Origin From 07b85345924b636e3cb167bdff30c3bb43c43099 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Nov 2019 16:43:37 +0100 Subject: [PATCH 18/23] Show custom URL in UI when specified --- src/routes/ui.js | 1 + src/ui/scripts/components/modals/ModalDomainEdit.js | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/ui.js b/src/routes/ui.js index f029ba5d..90a97ed2 100644 --- a/src/routes/ui.js +++ b/src/routes/ui.js @@ -76,6 +76,7 @@ const scripts = () => { const data = js(filePath, { optimize: isProductionEnv === true, env: { + ACKEE_TRACKER: process.env.ACKEE_TRACKER, ACKEE_DEMO: isDemo === true ? 'true' : 'false', NODE_ENV: isProductionEnv === true ? 'production' : 'development' }, diff --git a/src/ui/scripts/components/modals/ModalDomainEdit.js b/src/ui/scripts/components/modals/ModalDomainEdit.js index 14101a35..16edfb7a 100644 --- a/src/ui/scripts/components/modals/ModalDomainEdit.js +++ b/src/ui/scripts/components/modals/ModalDomainEdit.js @@ -2,6 +2,8 @@ import { createElement as h, useState } from 'react' import PropTypes from 'prop-types' import shortid from 'shortid' +import customTrackerUrl from '../../../../utils/customTrackerUrl' + import Input from '../Input' import Textarea from '../Textarea' import Label from '../Label' @@ -39,7 +41,8 @@ const ModalDomainEdit = (props) => { const idId = shortid.generate() const embedId = shortid.generate() - const srcUrl = (new URL('/tracker.js', location.href)).href + const trackerUrl = customTrackerUrl || '/tracker.js' + const srcUrl = (new URL(trackerUrl, location.href)).href const serverUrl = location.origin return ( From dbb4b7d85a483458f929b6abda71c6562463e812 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Nov 2019 16:43:46 +0100 Subject: [PATCH 19/23] Fix test name --- test/utils/customTrackerUrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/utils/customTrackerUrl.js b/test/utils/customTrackerUrl.js index 0043e903..7b5aa67d 100644 --- a/test/utils/customTrackerUrl.js +++ b/test/utils/customTrackerUrl.js @@ -4,7 +4,7 @@ const test = require('ava') const customTrackerUrl = require('../../src/utils/customTrackerUrl') -test('return undefined', async (t) => { +test('return custom URL', async (t) => { const result = customTrackerUrl From 3d2ca688199c108a2974049484391c498f5c968d Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Nov 2019 16:44:01 +0100 Subject: [PATCH 20/23] Ignore empty tracker URLs --- src/utils/customTrackerUrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/customTrackerUrl.js b/src/utils/customTrackerUrl.js index 6e409614..982df17a 100644 --- a/src/utils/customTrackerUrl.js +++ b/src/utils/customTrackerUrl.js @@ -1,5 +1,6 @@ 'use strict' const name = process.env.ACKEE_TRACKER +const exists = name != null && name !== '' -module.exports = name != null ? `/${ encodeURIComponent(name) }.js` : undefined \ No newline at end of file +module.exports = exists === true ? `/${ encodeURIComponent(name) }.js` : undefined \ No newline at end of file From f1d0053e5535de800bbaee4167c7eb3aa467187f Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Nov 2019 17:34:21 +0100 Subject: [PATCH 21/23] Updated ackee-tracker --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 82241096..ebfeb9aa 100755 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "dependencies": { "@babel/core": "^7.6.3", "@babel/preset-env": "^7.6.3", - "ackee-tracker": "^3.2.1", + "ackee-tracker": "^3.2.2", "classnames": "^2.2.6", "dotenv": "^8.2.0", "formbase": "^11.0.0", diff --git a/yarn.lock b/yarn.lock index fa74b3d6..84e3a75e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -813,10 +813,10 @@ abbrev@1: resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" integrity sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q== -ackee-tracker@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ackee-tracker/-/ackee-tracker-3.2.1.tgz#a5260dbe1a1971734cd522c267635e82f4207813" - integrity sha512-9uuh060YvkaC9SlyygXoaWlYNMgL+T/wpFKUvwF0xi0bVobKzQ4FwPLYcemedaDHO3xXQRXS/J1bVN20W2TjTw== +ackee-tracker@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/ackee-tracker/-/ackee-tracker-3.2.2.tgz#829ca3b5e50ba169e01232a98ab304fe0b5c9b86" + integrity sha512-ss5Lks3fJqf5tHeFTia0iM/s8DeXVovut1rgqHydBcVJuI5rf2GKWNSImgNiufBkVztmYXJNIIEgr28wkhphFw== dependencies: platform "^1.3.5" From 7bca5a4e7bd188c00b605b945720d51cc0bba4d0 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Sun, 3 Nov 2019 17:36:24 +0100 Subject: [PATCH 22/23] Updated deps --- package.json | 14 ++--- yarn.lock | 168 ++++++++++++++++++++++++++++----------------------- 2 files changed, 99 insertions(+), 83 deletions(-) diff --git a/package.json b/package.json index ebfeb9aa..3df267be 100755 --- a/package.json +++ b/package.json @@ -34,18 +34,18 @@ "classnames": "^2.2.6", "dotenv": "^8.2.0", "formbase": "^11.0.0", - "immer": "^4.0.1", + "immer": "^5.0.0", "is-url": "^1.2.4", "micro": "^9.3.4", "microrouter": "^3.1.3", - "mongoose": "^5.7.5", + "mongoose": "^5.7.7", "node-schedule": "^1.3.2", "normalize-url": "^4.5.0", "normalize.css": "^8.0.0", "permit": "^0.2.4", "prop-types": "^15.7.2", - "react": "^16.10.2", - "react-dom": "^16.10.2", + "react": "^16.11.0", + "react-dom": "^16.11.0", "react-redux": "^7.1.1", "redux": "^4.0.4", "redux-devtools-extension": "^2.13.8", @@ -62,11 +62,11 @@ "@electerious/eslint-config": "^1.3.1", "ava": "2.4.0", "coveralls": "^3.0.6", - "eslint": "^6.5.1", + "eslint": "^6.6.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-react": "^7.16.0", - "eslint-plugin-react-hooks": "^2.1.2", - "eslint-plugin-react-native": "^3.7.0", + "eslint-plugin-react-hooks": "^2.2.0", + "eslint-plugin-react-native": "^3.8.1", "node-fetch": "^2.6.0", "nyc": "^14.1.1", "test-listen": "^1.1.0" diff --git a/yarn.lock b/yarn.lock index 84e3a75e..0007f642 100644 --- a/yarn.lock +++ b/yarn.lock @@ -820,7 +820,7 @@ ackee-tracker@^3.2.2: dependencies: platform "^1.3.5" -acorn-jsx@^5.0.2: +acorn-jsx@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.1.0.tgz#294adb71b57398b0680015f0a38c563ee1db5384" integrity sha512-tMUqwBWfLFbJbizRmEcWSLw6HnFzfdJs2sOJEOwwtVPMoH/0Ay+E703oZz78VSXZiiDcZrQ5XKjPIUQixhmgVw== @@ -839,7 +839,7 @@ acorn-walk@^7.0.0: resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-7.0.0.tgz#c8ba6f0f1aac4b0a9e32d1f0af12be769528f36b" integrity sha512-7Bv1We7ZGuU79zZbb6rRqcpxo3OY+zrdtloZWoyD8fmGX+FeXRjE+iuGkZjSXLVovLzrsvMGMy0EkwA0E0umxg== -acorn@^7.0.0: +acorn@^7.0.0, acorn@^7.1.0: version "7.1.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-7.1.0.tgz#949d36f2c292535da602283586c2477c57eb2d6c" integrity sha512-kL5CuoXA/dgxlBbVrflsflzQ3PAas7RYZB52NOm/6839iVYJgKMJ3cQJD+t2i5+qFa8h3MDpEOJiS64E8JLnSQ== @@ -871,11 +871,6 @@ ansi-align@^3.0.0: dependencies: string-width "^3.0.0" -ansi-escapes@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" - integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== - ansi-escapes@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.2.1.tgz#4dccdb846c3eee10f6d64dea66273eab90c37228" @@ -2620,20 +2615,20 @@ eslint-plugin-import@^2.18.2: read-pkg-up "^2.0.0" resolve "^1.11.0" -eslint-plugin-react-hooks@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.1.2.tgz#1358d2acb2c5e02b7e90c37e611ac258a488e3a7" - integrity sha512-ZR+AyesAUGxJAyTFlF3MbzeVHAcQTFQt1fFVe5o0dzY/HFoj1dgQDMoIkiM+ltN/HhlHBYX4JpJwYonjxsyQMA== +eslint-plugin-react-hooks@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-2.2.0.tgz#078264e9e388da6929ace09d6abe92c85963aff4" + integrity sha512-jSlnBjV2cmyIeL555H/FbvuSbQ1AtpHjLMHuPrQnt1eVA6lX8yufdygh7AArI2m8ct7ChHGx2uOaCuxq2MUn6g== eslint-plugin-react-native-globals@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/eslint-plugin-react-native-globals/-/eslint-plugin-react-native-globals-0.1.2.tgz#ee1348bc2ceb912303ce6bdbd22e2f045ea86ea2" integrity sha512-9aEPf1JEpiTjcFAmmyw8eiIXmcNZOqaZyHO77wgm0/dWfT/oxC1SrIq8ET38pMxHYrcB6Uew+TzUVsBeczF88g== -eslint-plugin-react-native@^3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-react-native/-/eslint-plugin-react-native-3.7.0.tgz#7e2cc1f3cf24919c4c0ea7fac13301e7444e105f" - integrity sha512-krLtQmGih/uJDPxF8DBpnU8J3kRUsDm/Dey5yEhOO8LN1I3Wesbk4PGCg8Zah57azKFU+9YtGooFjJcDJWUs+g== +eslint-plugin-react-native@^3.8.1: + version "3.8.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-native/-/eslint-plugin-react-native-3.8.1.tgz#92811e37191ecb0d29c0f0a0c9e5c943ee573821" + integrity sha512-6Z4s4nvgFRdda/1s1+uu4a6EMZwEjjJ9Bk/1yBImv0fd9U2CsGu2cUakAtV83cZKhizbWhSouXoaK4JtlScdFg== dependencies: eslint-plugin-react-native-globals "^0.1.1" @@ -2660,22 +2655,22 @@ eslint-scope@^5.0.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-utils@^1.4.2: - version "1.4.2" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab" - integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q== +eslint-utils@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f" + integrity sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q== dependencies: - eslint-visitor-keys "^1.0.0" + eslint-visitor-keys "^1.1.0" -eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0: +eslint-visitor-keys@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2" integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A== -eslint@^6.5.1: - version "6.5.1" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.5.1.tgz#828e4c469697d43bb586144be152198b91e96ed6" - integrity sha512-32h99BoLYStT1iq1v2P9uwpyznQ4M2jRiFB6acitKz52Gqn+vPaMDUTB1bYi1WN4Nquj2w+t+bimYUG83DC55A== +eslint@^6.6.0: + version "6.6.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.6.0.tgz#4a01a2fb48d32aacef5530ee9c5a78f11a8afd04" + integrity sha512-PpEBq7b6qY/qrOmpYQ/jTMDYfuQMELR4g4WI1M/NaSDDD/bdcMb+dj4Hgks7p41kW2caXsPsEZAEAyAgjVVC0g== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -2684,9 +2679,9 @@ eslint@^6.5.1: debug "^4.0.1" doctrine "^3.0.0" eslint-scope "^5.0.0" - eslint-utils "^1.4.2" + eslint-utils "^1.4.3" eslint-visitor-keys "^1.1.0" - espree "^6.1.1" + espree "^6.1.2" esquery "^1.0.1" esutils "^2.0.2" file-entry-cache "^5.0.1" @@ -2696,7 +2691,7 @@ eslint@^6.5.1: ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^6.4.1" + inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" @@ -2730,13 +2725,13 @@ espower-location-detector@^1.0.0: source-map "^0.5.0" xtend "^4.0.0" -espree@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de" - integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ== +espree@^6.1.2: + version "6.1.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.2.tgz#6c272650932b4f91c3714e5e7b5f5e2ecf47262d" + integrity sha512-2iUPuuPP+yW1PZaMSDM9eyVf8D5P0Hi8h83YtZ5bPc/zHYjII5khoixIUTMO794NOY8F/ThF1Bo8ncZILarUTA== dependencies: - acorn "^7.0.0" - acorn-jsx "^5.0.2" + acorn "^7.1.0" + acorn-jsx "^5.1.0" eslint-visitor-keys "^1.1.0" esprima@^4.0.0: @@ -3377,10 +3372,10 @@ ignore@^5.1.1: resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== -immer@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/immer/-/immer-4.0.1.tgz#9108c1ece7fdd7efb91d21e5eb4bac26f7c3a8ba" - integrity sha512-qZFpWApnbubcJ03gvWa6zUQz2OTkDc6yINdFXI1lm2IoMYsiVVMrxvfeLDURFhUGJfsQysDUjHSXYnJfMMHAwQ== +immer@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/immer/-/immer-5.0.0.tgz#07f462b7d95f7e86c214a861ecacd766d42b8c0a" + integrity sha512-G7gRqKbi9NE025XVyqyTV98dxUOtdKvu/P1QRaVZfA55aEcXgjbxPdm+TlWdcSMNPKijlaHNz61DGPyelouRlA== import-fresh@^2.0.0: version "2.0.0" @@ -3478,22 +3473,22 @@ inline-source-map@~0.6.0: dependencies: source-map "~0.5.3" -inquirer@^6.4.1: - version "6.5.2" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" - integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== +inquirer@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.0.0.tgz#9e2b032dde77da1db5db804758b8fea3a970519a" + integrity sha512-rSdC7zelHdRQFkWnhsMu2+2SO41mpv2oF2zy4tMhmiLWkcKbOAs87fWAJhVXttKVwhdZvymvnuM95EyEXg2/tQ== dependencies: - ansi-escapes "^3.2.0" + ansi-escapes "^4.2.1" chalk "^2.4.2" - cli-cursor "^2.1.0" + cli-cursor "^3.1.0" cli-width "^2.0.0" external-editor "^3.0.3" - figures "^2.0.0" - lodash "^4.17.12" - mute-stream "0.0.7" + figures "^3.0.0" + lodash "^4.17.15" + mute-stream "0.0.8" run-async "^2.2.0" rxjs "^6.4.0" - string-width "^2.1.0" + string-width "^4.1.0" strip-ansi "^5.1.0" through "^2.3.6" @@ -4127,7 +4122,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@~4.17.10: +lodash@^4.0.0, lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@~4.17.10: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -4267,6 +4262,11 @@ mdn-data@~1.1.0: resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01" integrity sha512-FSYbp3lyKjyj3E7fMl6rYvUdX0FBXaluGqlFoYESWQlyUTq8R+wp0rkFxoYFqZlHCvsUXGjyJmLQSnXToYhOSA== +memory-pager@^1.0.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/memory-pager/-/memory-pager-1.5.0.tgz#d8751655d22d384682741c972f2c3d6dfa3e66b5" + integrity sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg== + meow@^3.7.0: version "3.7.0" resolved "https://registry.yarnpkg.com/meow/-/meow-3.7.0.tgz#72cb668b425228290abbfa856892587308a801fb" @@ -4450,28 +4450,30 @@ moment-timezone@^0.5.25: resolved "https://registry.yarnpkg.com/moment/-/moment-2.24.0.tgz#0d055d53f5052aa653c9f6eb68bb5d12bf5c2b5b" integrity sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg== -mongodb@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.3.2.tgz#ff086b5f552cf07e24ce098694210f3d42d668b2" - integrity sha512-fqJt3iywelk4yKu/lfwQg163Bjpo5zDKhXiohycvon4iQHbrfflSAz9AIlRE6496Pm/dQKQK5bMigdVo2s6gBg== +mongodb@3.3.3: + version "3.3.3" + resolved "https://registry.yarnpkg.com/mongodb/-/mongodb-3.3.3.tgz#509cad2225a1c56c65a331ed73a0d5d4ed5cbe67" + integrity sha512-MdRnoOjstmnrKJsK8PY0PjP6fyF/SBS4R8coxmhsfEU7tQ46/J6j+aSHF2n4c2/H8B+Hc/Klbfp8vggZfI0mmA== dependencies: bson "^1.1.1" require_optional "^1.0.1" safe-buffer "^5.1.2" + optionalDependencies: + saslprep "^1.0.0" mongoose-legacy-pluralize@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/mongoose-legacy-pluralize/-/mongoose-legacy-pluralize-1.0.2.tgz#3ba9f91fa507b5186d399fb40854bff18fb563e4" integrity sha512-Yo/7qQU4/EyIS8YDFSeenIvXxZN+ld7YdV9LqFVQJzTLye8unujAWPZ4NWKfFA+RNjh+wvTWKY9Z3E5XM6ZZiQ== -mongoose@^5.7.5: - version "5.7.5" - resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.7.5.tgz#b787b47216edf62036aa358c3ef0f1869c46cdc2" - integrity sha512-BZ4FxtnbTurc/wcm/hLltLdI4IDxo4nsE0D9q58YymTdZwreNzwO62CcjVtaHhmr8HmJtOInp2W/T12FZaMf8g== +mongoose@^5.7.7: + version "5.7.7" + resolved "https://registry.yarnpkg.com/mongoose/-/mongoose-5.7.7.tgz#038b47d10434ea6cc9ec9b45d88bfcf9ab401a1a" + integrity sha512-FU59waB4LKBa9KOnqBUcCcMIVRc09TFo1F8nMxrzSiIWATaJpjxxSSH5FBVUDxQfNdJLfg9uFHxaTxhhwjsZOQ== dependencies: bson "~1.1.1" kareem "2.3.1" - mongodb "3.3.2" + mongodb "3.3.3" mongoose-legacy-pluralize "1.0.2" mpath "0.6.0" mquery "3.2.2" @@ -4507,10 +4509,10 @@ ms@2.1.2, ms@^2.1.1, ms@^2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -mute-stream@0.0.7: - version "0.0.7" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" - integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= +mute-stream@0.0.8: + version "0.0.8" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" + integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== nan@^2.13.2: version "2.14.0" @@ -5634,15 +5636,15 @@ rc@^1.2.8: minimist "^1.2.0" strip-json-comments "~2.0.1" -react-dom@^16.10.2: - version "16.10.2" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.10.2.tgz#4840bce5409176bc3a1f2bd8cb10b92db452fda6" - integrity sha512-kWGDcH3ItJK4+6Pl9DZB16BXYAZyrYQItU4OMy0jAkv5aNqc+mAKb4TpFtAteI6TJZu+9ZlNhaeNQSVQDHJzkw== +react-dom@^16.11.0: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.11.0.tgz#7e7c4a5a85a569d565c2462f5d345da2dd849af5" + integrity sha512-nrRyIUE1e7j8PaXSPtyRKtz+2y9ubW/ghNgqKFHHAHaeP0fpF5uXR+sq8IMRHC+ZUxw7W9NyCDTBtwWxvkb0iA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" prop-types "^15.6.2" - scheduler "^0.16.2" + scheduler "^0.17.0" react-is@^16.7.0, react-is@^16.8.1, react-is@^16.9.0: version "16.10.2" @@ -5661,10 +5663,10 @@ react-redux@^7.1.1: prop-types "^15.7.2" react-is "^16.9.0" -react@^16.10.2: - version "16.10.2" - resolved "https://registry.yarnpkg.com/react/-/react-16.10.2.tgz#a5ede5cdd5c536f745173c8da47bda64797a4cf0" - integrity sha512-MFVIq0DpIhrHFyqLU0S3+4dIcBhhOvBE8bJ/5kHPVOVaGdo0KuiQzpcjCPsf585WvhypqtrMILyoE2th6dT+Lw== +react@^16.11.0: + version "16.11.0" + resolved "https://registry.yarnpkg.com/react/-/react-16.11.0.tgz#d294545fe62299ccee83363599bf904e4a07fdbb" + integrity sha512-M5Y8yITaLmU0ynd0r1Yvfq98Rmll6q8AxaEe88c8e7LxO8fZ2cNgmFt0aGAS9wzf1Ao32NKXtCl+/tVVtkxq6g== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -6117,6 +6119,13 @@ safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== +saslprep@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/saslprep/-/saslprep-1.0.3.tgz#4c02f946b56cf54297e347ba1093e7acac4cf226" + integrity sha512-/MY/PEMbk2SuY5sScONwhUDsV2p77Znkb/q3nSVstq/yQzYJOH/Azh29p9oJLsl3LnQwSvZDKagDGBsBwSooag== + dependencies: + sparse-bitfield "^3.0.3" + sass-graph@^2.2.4: version "2.2.4" resolved "https://registry.yarnpkg.com/sass-graph/-/sass-graph-2.2.4.tgz#13fbd63cd1caf0908b9fd93476ad43a51d1e0b49" @@ -6132,10 +6141,10 @@ sax@~1.2.4: resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== -scheduler@^0.16.2: - version "0.16.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.16.2.tgz#f74cd9d33eff6fc554edfb79864868e4819132c1" - integrity sha512-BqYVWqwz6s1wZMhjFvLfVR5WXP7ZY32M/wYPo04CcuPM7XZEbV2TBNW7Z0UkguPTl0dWMA59VbNXxK6q+pHItg== +scheduler@^0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.17.0.tgz#7c9c673e4ec781fac853927916d1c426b6f3ddfe" + integrity sha512-7rro8Io3tnCPuY4la/NuI5F2yfESpnfZyT6TtkXnSWVkcu0BCDJ+8gk5ozUaFaxpIyNuWAPXrH0yFcSi28fnDA== dependencies: loose-envify "^1.1.0" object-assign "^4.1.1" @@ -6305,6 +6314,13 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +sparse-bitfield@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz#ff4ae6e68656056ba4b3e792ab3334d38273ca11" + integrity sha1-/0rm5oZWBWuks+eSqzM004JzyhE= + dependencies: + memory-pager "^1.0.2" + spawn-wrap@^1.4.2: version "1.4.3" resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.4.3.tgz#81b7670e170cca247d80bf5faf0cfb713bdcf848" @@ -6428,7 +6444,7 @@ string-width@^1.0.1, string-width@^1.0.2: is-fullwidth-code-point "^1.0.0" strip-ansi "^3.0.0" -"string-width@^1.0.2 || 2", string-width@^2.1.0, string-width@^2.1.1: +"string-width@^1.0.2 || 2", string-width@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== From 308be253ea6171508180df8820d4f60c39b212a9 Mon Sep 17 00:00:00 2001 From: Tobias Reich Date: Tue, 5 Nov 2019 14:27:06 +0100 Subject: [PATCH 23/23] Update version --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9123e40..c5f0c113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [1.4.0] - 2019-11-05 ### Added diff --git a/package.json b/package.json index 3df267be..6ea6bdba 100755 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ackee", "private": true, - "version": "1.3.0", + "version": "1.4.0", "authors": [ "Tobias Reich " ],