From 4dfd7bc9baabc83f4c9449e5905c6a7b18046d44 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:14:58 +0100 Subject: [PATCH 01/29] move build as a prerequisite of test jobs --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6d43d3b0..eab00187 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -104,19 +104,19 @@ workflows: - nodefetch1: <<: *triggerable-by-tag requires: - - checkout_code + - build - nodefetch2: <<: *triggerable-by-tag requires: - - checkout_code + - build - node6: <<: *triggerable-by-tag requires: - - checkout_code + - build - chrome: <<: *triggerable-by-tag requires: - - checkout_code + - build # firefox version too old for sw, so postpone cross browser tests till updated in circleci # - firefox: # requires: From dc3998311f416a0f148aa431de34d3712000d21a Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:18:15 +0100 Subject: [PATCH 02/29] separate test job prior to running in deifferent environments --- .circleci/config.yml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index eab00187..15184c49 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: key: npm-cache-{{ checksum "package-lock.json" }} - run: make lint-ci - nodefetch2: + test: <<: *env steps: - checkout @@ -42,6 +42,15 @@ jobs: key: npm-cache-{{ checksum "package-lock.json" }} - run: make coverage-report + + nodefetch2: + <<: *env + steps: + - checkout + - restore_cache: + key: npm-cache-{{ checksum "package-lock.json" }} + - run: make test-unit + nodefetch1: <<: *env steps: @@ -101,6 +110,10 @@ workflows: checkout_and_test: jobs: - checkout_code: *triggerable-by-tag + - test: + <<: *triggerable-by-tag + requires: + - checkout_code - nodefetch1: <<: *triggerable-by-tag requires: @@ -128,7 +141,8 @@ workflows: - build: <<: *triggerable-by-tag requires: - - checkout_code + - lint + - test - deploy: context: wheresrhys-npm-publish requires: @@ -137,7 +151,6 @@ workflows: - node6 - chrome # - firefox - - lint - build filters: branches: From eea58a2284a94a22b201c63fc00619024f1446bc Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:19:17 +0100 Subject: [PATCH 03/29] rename pipeline --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 15184c49..ba572d68 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,7 +107,7 @@ jobs: workflows: version: 2 - checkout_and_test: + fetch-mock-ci-cd: jobs: - checkout_code: *triggerable-by-tag - test: From cb55678a4bfbb933727c0a9b960980002712afbd Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:22:42 +0100 Subject: [PATCH 04/29] test cjs build --- .circleci/config.yml | 4 ++-- test/server.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ba572d68..d5f2c73b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -49,7 +49,7 @@ jobs: - checkout - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - - run: make test-unit + - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit nodefetch1: <<: *env @@ -58,7 +58,7 @@ jobs: - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install node-fetch@1 - - run: make test-unit + - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit node6: docker: diff --git a/test/server.js b/test/server.js index 618ca5bc..988eb276 100644 --- a/test/server.js +++ b/test/server.js @@ -1,4 +1,4 @@ -const fetchMock = require('../src/server.js'); +const fetchMock = require(process.env.FETCH_MOCK_SRC || '../src/server.js'); const expect = require('chai').expect; const http = require('http'); const sinon = require('sinon'); From b66cc0cb14eedafcf726835c695e6ab509ea9748 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:25:48 +0100 Subject: [PATCH 05/29] split out typecheck --- .circleci/config.yml | 11 +++++++++++ Makefile | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d5f2c73b..295013cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,6 +34,13 @@ jobs: key: npm-cache-{{ checksum "package-lock.json" }} - run: make lint-ci + typecheck: + steps: + - checkout + - restore_cache: + key: npm-cache-{{ checksum "package-lock.json" }} + - run: make typecheck + test: <<: *env steps: @@ -134,6 +141,9 @@ workflows: # - firefox: # requires: # - checkout_code + - typecheck: + <<: *triggerable-by-tag + - checkout_code - lint: <<: *triggerable-by-tag requires: @@ -152,6 +162,7 @@ workflows: - chrome # - firefox - build + - typecheck filters: branches: ignore: /.*/ diff --git a/Makefile b/Makefile index 568b309e..eb7ce952 100644 --- a/Makefile +++ b/Makefile @@ -20,7 +20,7 @@ test-node6: transpile typecheck: dtslint --expectOnly types -lint-ci: typecheck +lint-ci: eslint --ignore-pattern test/fixtures/* src test prettier *.md docs/*.md docs/**/*.md From d906470db32573554251e694a2c4412ce8ccc67a Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:26:31 +0100 Subject: [PATCH 06/29] fix circle config --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 295013cd..6b991f62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -143,6 +143,7 @@ workflows: # - checkout_code - typecheck: <<: *triggerable-by-tag + requires: - checkout_code - lint: <<: *triggerable-by-tag From 3ee566da593f2acd0d021ee94c0b7bd8f11fd7a1 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:27:33 +0100 Subject: [PATCH 07/29] env -> container --- .circleci/config.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6b991f62..807e7ebf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,16 +6,16 @@ references: filters: tags: only: /.*/ - env: &env + container: &container docker: - image: circleci/node:10.20.1 - env-browsers: &env-browsers + container-browsers: &container-browsers docker: - image: circleci/node:10.20.1-browsers jobs: checkout_code: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -27,7 +27,7 @@ jobs: - node_modules lint: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -35,6 +35,7 @@ jobs: - run: make lint-ci typecheck: + <<: *container steps: - checkout - restore_cache: @@ -42,7 +43,7 @@ jobs: - run: make typecheck test: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -51,7 +52,7 @@ jobs: nodefetch2: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -59,7 +60,7 @@ jobs: - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit nodefetch1: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -78,7 +79,7 @@ jobs: - run: make test-node6 chrome: - <<: *env-browsers + <<: *container-browsers steps: - checkout - restore_cache: @@ -86,7 +87,7 @@ jobs: - run: make test-chrome firefox: - <<: *env-browsers + <<: *container-browsers steps: - checkout - restore_cache: @@ -95,7 +96,7 @@ jobs: - run: make test-firefox build: - <<: *env + <<: *container steps: - checkout - restore_cache: @@ -103,7 +104,7 @@ jobs: - run: make build deploy: - <<: *env + <<: *container steps: - checkout - restore_cache: From 432aa78ddb43155d25a2767af0dd463914b337b9 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:32:55 +0100 Subject: [PATCH 08/29] use workspace effectively --- .circleci/config.yml | 42 ++++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 807e7ebf..ec4a954d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,14 @@ references: container-browsers: &container-browsers docker: - image: circleci/node:10.20.1-browsers + workspace: &workspace + workspace: + at: ~/project + persist: &persist + persist_to_workspace: + root: . + paths: + - . jobs: checkout_code: @@ -25,11 +33,20 @@ jobs: key: npm-cache-{{ checksum "package-lock.json" }} paths: - node_modules + - *persist + build: + <<: *container + steps: + - *workspace + - restore_cache: + key: npm-cache-{{ checksum "package-lock.json" }} + - run: make build + - *persist lint: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: make lint-ci @@ -37,7 +54,7 @@ jobs: typecheck: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: make typecheck @@ -45,7 +62,7 @@ jobs: test: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: make coverage-report @@ -54,7 +71,7 @@ jobs: nodefetch2: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit @@ -62,7 +79,7 @@ jobs: nodefetch1: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install node-fetch@1 @@ -72,7 +89,7 @@ jobs: docker: - image: circleci/node:6.13.0 steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: npm rebuild @@ -81,7 +98,7 @@ jobs: chrome: <<: *container-browsers steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: make test-chrome @@ -89,24 +106,17 @@ jobs: firefox: <<: *container-browsers steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install karma-firefox-launcher - run: make test-firefox - build: - <<: *container - steps: - - checkout - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - - run: make build deploy: <<: *container steps: - - checkout + - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc' From b14910734aeaf01ec00d3c51ffe4fb50e936ffbd Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:36:18 +0100 Subject: [PATCH 09/29] fix attaching workspace --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ec4a954d..572815c4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ references: docker: - image: circleci/node:10.20.1-browsers workspace: &workspace - workspace: + attach_workspace: at: ~/project persist: &persist persist_to_workspace: From c69d2aa7bdbf40f1f951b689967a7dbd0560677e Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 12:42:42 +0100 Subject: [PATCH 10/29] fix path to cjs build --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 572815c4..051124cf 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -74,7 +74,7 @@ jobs: - *workspace - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit + - run: FETCH_MOCK_SRC=../cjs/server.js make test-unit nodefetch1: <<: *container @@ -83,7 +83,7 @@ jobs: - restore_cache: key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install node-fetch@1 - - run: FETCH_MOCK_SRC=./cjs/server.js make test-unit + - run: FETCH_MOCK_SRC=../cjs/server.js make test-unit node6: docker: From a0f3f0e6eb25fc4bd9a7e1f68f92716ca40c223e Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:24:04 +0100 Subject: [PATCH 11/29] refactored test runner to allow for being run as esm --- Makefile | 3 ++ test/client.js | 85 +----------------------------- test/client.mjs | 6 +++ test/server.js | 37 +------------ test/server.mjs | 31 +++++++++++ test/specs/client-only.test.js | 94 ++++++++++++++++++++++++++++++++++ test/specs/server-only.test.js | 46 +++++++++++++++++ 7 files changed, 182 insertions(+), 120 deletions(-) create mode 100644 test/client.mjs create mode 100644 test/server.mjs create mode 100644 test/specs/client-only.test.js create mode 100644 test/specs/server-only.test.js diff --git a/Makefile b/Makefile index eb7ce952..7d42f87e 100644 --- a/Makefile +++ b/Makefile @@ -11,12 +11,15 @@ test-chrome: test-firefox: karma start --single-run --browsers=Firefox + test-unit: mocha test/server.js test-node6: transpile node test/node6.js +test: test-unit + typecheck: dtslint --expectOnly types diff --git a/test/client.js b/test/client.js index 63445bd7..157f5d50 100644 --- a/test/client.js +++ b/test/client.js @@ -1,89 +1,6 @@ const fetchMock = require('../src/client.js'); const expect = require('chai').expect; -describe('native fetch behaviour', function () { - it('should not throw when passing unmatched calls through to native fetch', function () { - fetchMock.mock(/a/, 200); - expect(function () { - fetch('http://www.example.com'); - }).not.to.throw(); - fetchMock.restore(); - }); - - // this is because we read the body once when normalising the request and - // want to make sure fetch can still use the sullied request - it('can still POST a body successfully when spying', async () => { - fetchMock.spy(); - const req = new fetchMock.config.Request( - 'http://localhost:9876/dummy-file.txt', - { method: 'post', body: JSON.stringify({ prop: 'val' }) } - ); - expect(() => fetch(req)).not.to.throw(); - fetchMock.restore(); - }); -}); - -describe('request types that only work in the browser', function () { - it('respond with blob', function (done) { - const blob = new Blob(); - fetchMock.mock('http://it.at.there/', blob, { sendAsJson: false }); - fetch('http://it.at.there/').then(function (res) { - expect(res.status).to.equal(200); - res.blob().then(function (blobData) { - expect(blobData).to.eql(blob); - fetchMock.restore(); - done(); - }); - }); - }); -}); +require('./specs/client-only.test.js')(fetchMock) require('./runner')(fetchMock, window, window.fetch, window.AbortController); - -describe('no real fetch', function () { - it('should cope when there is no global fetch defined', function () { - const fetchCache = window.fetch; - delete window.fetch; - const realFetchCache = fetchMock.realFetch; - delete fetchMock.realFetch; - fetchMock.mock(/a/, 200); - expect(function () { - fetch('http://www.example.com'); - }).not.to.throw(); - - expect(function () { - fetchMock.calls(); - }).not.to.throw(); - fetchMock.restore(); - fetchMock.realFetch = realFetchCache; - window.fetch = fetchCache; - }); -}); - -describe('service worker', () => { - it('should work within a service worker', () => { - return ( - navigator.serviceWorker && - navigator.serviceWorker.register('__sw.js').then((registration) => { - return new Promise((resolve, reject) => { - if (registration.installing) { - registration.installing.onstatechange = function () { - if (this.state === 'activated') { - resolve(); - } - }; - } else { - reject('No idea what happened'); - } - }).then(() => { - expect(true).to.be.true; - return navigator.serviceWorker - .getRegistration() - .then((registration) => - registration ? registration.unregister() : false - ); - }); - }) - ); - }); -}); diff --git a/test/client.mjs b/test/client.mjs new file mode 100644 index 00000000..d43146b6 --- /dev/null +++ b/test/client.mjs @@ -0,0 +1,6 @@ +import fetchMock from '../esm/client.js'; +import {expect} from 'chai'; +import runner from './runner.js'; +import clientOnly from './specs/client-only.test.js'; +clientOnly(fetchMock) +runner(fetchMock, window, window.fetch, window.AbortController); diff --git a/test/server.js b/test/server.js index 988eb276..1d061977 100644 --- a/test/server.js +++ b/test/server.js @@ -24,40 +24,5 @@ describe('nodejs tests', () => { require('node-fetch'), require('abort-controller') ); - - describe('support for nodejs body types', () => { - afterEach(() => fetchMock.reset()); - it('can respond with a buffer', () => { - fetchMock.mock(/a/, new Buffer('buffer'), { sendAsJson: false }); - return fetchMock - .fetchHandler('http://a.com') - .then((res) => res.text()) - .then((txt) => { - expect(txt).to.equal('buffer'); - }); - }); - - it('can respond with a readable stream', (done) => { - const { Readable, Writable } = require('stream'); - const readable = new Readable(); - const write = sinon.stub().callsFake((chunk, enc, cb) => { - cb(); - }); - const writable = new Writable({ - write, - }); - readable.push('response string'); - readable.push(null); - - fetchMock.mock(/a/, readable, { sendAsJson: false }); - fetchMock.fetchHandler('http://a.com').then((res) => { - res.body.pipe(writable); - }); - - writable.on('finish', () => { - expect(write.args[0][0].toString('utf8')).to.equal('response string'); - done(); - }); - }); - }); + require('./specs/server-only.test.js')(fetchMock) }); diff --git a/test/server.mjs b/test/server.mjs new file mode 100644 index 00000000..ba1cb851 --- /dev/null +++ b/test/server.mjs @@ -0,0 +1,31 @@ +import fetchMock from '../esm/server.js'; +import {expect} from 'chai'; +import http from 'http'; +import sinon from 'sinon'; +import { promisify } from 'util'; +import runner from './runner.js'; +import fetch from 'node-fetch'; +import AbortController from 'abort-controller'; +import serverOnly from './specs/server-only.test.js'; + +describe('nodejs tests', () => { + let server; + before(() => { + server = http.createServer((req, res) => { + res.writeHead(200); + res.end(); + }); + return promisify(server.listen.bind(server))(9876); + }); + after(() => { + server.close(); + }); + + runner( + fetchMock, + global, + fetch, + AbortController + ); + serverOnly(fetchMock) +}); diff --git a/test/specs/client-only.test.js b/test/specs/client-only.test.js new file mode 100644 index 00000000..5275feda --- /dev/null +++ b/test/specs/client-only.test.js @@ -0,0 +1,94 @@ +const chai = require('chai'); +chai.use(require('sinon-chai')); +const expect = chai.expect; +const sinon = require('sinon'); + +module.exports = (fetchMock) => { +describe('client-side only tests', () => { + +describe('native fetch behaviour', function () { + it('should not throw when passing unmatched calls through to native fetch', function () { + fetchMock.mock(/a/, 200); + expect(function () { + fetch('http://www.example.com'); + }).not.to.throw(); + fetchMock.restore(); + }); + + // this is because we read the body once when normalising the request and + // want to make sure fetch can still use the sullied request + it('can still POST a body successfully when spying', async () => { + fetchMock.spy(); + const req = new fetchMock.config.Request( + 'http://localhost:9876/dummy-file.txt', + { method: 'post', body: JSON.stringify({ prop: 'val' }) } + ); + expect(() => fetch(req)).not.to.throw(); + fetchMock.restore(); + }); +}); + +describe('request types that only work in the browser', function () { + it('respond with blob', function (done) { + const blob = new Blob(); + fetchMock.mock('http://it.at.there/', blob, { sendAsJson: false }); + fetch('http://it.at.there/').then(function (res) { + expect(res.status).to.equal(200); + res.blob().then(function (blobData) { + expect(blobData).to.eql(blob); + fetchMock.restore(); + done(); + }); + }); + }); +}); + +describe('no real fetch', function () { + it('should cope when there is no global fetch defined', function () { + const fetchCache = window.fetch; + delete window.fetch; + const realFetchCache = fetchMock.realFetch; + delete fetchMock.realFetch; + fetchMock.mock(/a/, 200); + expect(function () { + fetch('http://www.example.com'); + }).not.to.throw(); + + expect(function () { + fetchMock.calls(); + }).not.to.throw(); + fetchMock.restore(); + fetchMock.realFetch = realFetchCache; + window.fetch = fetchCache; + }); +}); + +describe('service worker', () => { + it('should work within a service worker', () => { + return ( + navigator.serviceWorker && + navigator.serviceWorker.register('__sw.js').then((registration) => { + return new Promise((resolve, reject) => { + if (registration.installing) { + registration.installing.onstatechange = function () { + if (this.state === 'activated') { + resolve(); + } + }; + } else { + reject('No idea what happened'); + } + }).then(() => { + expect(true).to.be.true; + return navigator.serviceWorker + .getRegistration() + .then((registration) => + registration ? registration.unregister() : false + ); + }); + }) + ); + }); +}); +}) +} diff --git a/test/specs/server-only.test.js b/test/specs/server-only.test.js new file mode 100644 index 00000000..ca51d194 --- /dev/null +++ b/test/specs/server-only.test.js @@ -0,0 +1,46 @@ +const chai = require('chai'); +chai.use(require('sinon-chai')); +const expect = chai.expect; +const sinon = require('sinon'); + +module.exports = (fetchMock) => { + describe('nodejs only tests', () => { + + + describe('support for nodejs body types', () => { + afterEach(() => fetchMock.reset()); + it('can respond with a buffer', () => { + fetchMock.mock(/a/, new Buffer('buffer'), { sendAsJson: false }); + return fetchMock + .fetchHandler('http://a.com') + .then((res) => res.text()) + .then((txt) => { + expect(txt).to.equal('buffer'); + }); + }); + + it('can respond with a readable stream', (done) => { + const { Readable, Writable } = require('stream'); + const readable = new Readable(); + const write = sinon.stub().callsFake((chunk, enc, cb) => { + cb(); + }); + const writable = new Writable({ + write, + }); + readable.push('response string'); + readable.push(null); + + fetchMock.mock(/a/, readable, { sendAsJson: false }); + fetchMock.fetchHandler('http://a.com').then((res) => { + res.body.pipe(writable); + }); + + writable.on('finish', () => { + expect(write.args[0][0].toString('utf8')).to.equal('response string'); + done(); + }); + }); + }); + }) +} From 448b22196b1113e32b708e673f1123fda462ead1 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:35:10 +0100 Subject: [PATCH 12/29] streamlined test runner tasks in makefile --- Makefile | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 7d42f87e..40bc9fe9 100644 --- a/Makefile +++ b/Makefile @@ -2,24 +2,22 @@ export PATH := $(PATH):./node_modules/.bin .PHONY: test docs -test-dev: - karma start --browsers=Chrome - -test-chrome: - karma start --single-run --browsers=Chrome - -test-firefox: - karma start --single-run --browsers=Firefox - +NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest") +TEST_BROWSER := $(shell [ -z $(TEST_BROWSER) ] && echo "Chrome" || echo ${TEST_BROWSER}) -test-unit: +# intended for local dev +test: mocha test/server.js +test-browser: + @if [ -z $(CI) ]; \ + then karma start --browsers=${TEST_BROWSER}; \ + else karma start --single-run --browsers=${TEST_BROWSER}; \ + fi + test-node6: transpile node test/node6.js -test: test-unit - typecheck: dtslint --expectOnly types @@ -49,7 +47,7 @@ build: transpile docs: cd docs; jekyll serve build --watch -NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest") + publish: npm version --no-git-tag-version $(CIRCLE_TAG) npm publish --access public --tag $(NPM_PUBLISH_TAG) From 4029f2c441fb60f59f1c2d5d4e150704df43450a Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:43:22 +0100 Subject: [PATCH 13/29] started using new task names in circle --- .circleci/config.yml | 33 ++++++--------------------------- Makefile | 4 ++-- test/client.js | 1 + test/node6.js | 6 ++++-- 4 files changed, 13 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 051124cf..efaf39dd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,59 +39,45 @@ jobs: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: make build - *persist lint: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: make lint-ci typecheck: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: make typecheck test: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - - run: make coverage-report + - run: make coverage nodefetch2: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - - run: FETCH_MOCK_SRC=../cjs/server.js make test-unit + - run: FETCH_MOCK_SRC=../cjs/server.js make test nodefetch1: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install node-fetch@1 - - run: FETCH_MOCK_SRC=../cjs/server.js make test-unit + - run: FETCH_MOCK_SRC=../cjs/server.js make test node6: docker: - image: circleci/node:6.13.0 steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: npm rebuild - run: make test-node6 @@ -99,27 +85,20 @@ jobs: <<: *container-browsers steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - - run: make test-chrome + - run: TEST_BROWSER=Chrome make test-browser firefox: <<: *container-browsers steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - run: npm install karma-firefox-launcher - - run: make test-firefox + - run: TEST_BROWSER=Firefox make test-browser deploy: <<: *container steps: - *workspace - - restore_cache: - key: npm-cache-{{ checksum "package-lock.json" }} - - run: 'echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc' - run: make publish @@ -172,7 +151,7 @@ workflows: - nodefetch2 - node6 - chrome - # - firefox + - firefox - build - typecheck filters: diff --git a/Makefile b/Makefile index 40bc9fe9..6c992f84 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ lint: eslint --cache --fix --ignore-pattern test/fixtures/* src test prettier --write *.md docs/*.md docs/**/*.md -coverage-report: +coverage: nyc --reporter=lcovonly --reporter=text mocha test/server.js cat ./coverage/lcov.info | coveralls @@ -47,7 +47,7 @@ build: transpile docs: cd docs; jekyll serve build --watch - publish: + echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc npm version --no-git-tag-version $(CIRCLE_TAG) npm publish --access public --tag $(NPM_PUBLISH_TAG) diff --git a/test/client.js b/test/client.js index 157f5d50..6b02142d 100644 --- a/test/client.js +++ b/test/client.js @@ -4,3 +4,4 @@ const expect = require('chai').expect; require('./specs/client-only.test.js')(fetchMock) require('./runner')(fetchMock, window, window.fetch, window.AbortController); + diff --git a/test/node6.js b/test/node6.js index 83acb7bb..0021e1f9 100644 --- a/test/node6.js +++ b/test/node6.js @@ -7,5 +7,7 @@ require('babel-core').transform('code', { }); const fetchMock = require('../es5/server'); -fetchMock.mock('http://it.at.there/', 200); -fetchMock.fetchHandler('http://it.at.there/').catch(() => process.exit(2)); +// fetchMock.mock('http://it.at.there/', 200); +// fetchMock.fetchHandler('http://it.at.there/').catch(() => process.exit(2)); + +require('./server.js') From 0414f6eff62adf5f039e768f404bddb5ecccb23f Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:44:35 +0100 Subject: [PATCH 14/29] fix circle validation errors --- .circleci/config.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index efaf39dd..45466ab6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -111,6 +111,19 @@ workflows: <<: *triggerable-by-tag requires: - checkout_code + - typecheck: + <<: *triggerable-by-tag + requires: + - checkout_code + - lint: + <<: *triggerable-by-tag + requires: + - checkout_code + - build: + <<: *triggerable-by-tag + requires: + - lint + - test - nodefetch1: <<: *triggerable-by-tag requires: @@ -127,23 +140,10 @@ workflows: <<: *triggerable-by-tag requires: - build -# firefox version too old for sw, so postpone cross browser tests till updated in circleci -# - firefox: -# requires: -# - checkout_code - - typecheck: - <<: *triggerable-by-tag - requires: - - checkout_code - - lint: - <<: *triggerable-by-tag - requires: - - checkout_code - - build: + - firefox: <<: *triggerable-by-tag requires: - - lint - - test + - build - deploy: context: wheresrhys-npm-publish requires: From 37800fd6401726641c3289459f7b255b76191c7d Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:49:08 +0100 Subject: [PATCH 15/29] lint --- .circleci/config.yml | 2 +- docs/_api-mocking/combined-shorthands.md | 4 +- test/client.js | 4 +- test/node6.js | 4 +- test/server.js | 19 +-- test/specs/client-only.test.js | 159 +++++++++++------------ test/specs/server-only.test.js | 62 +++++---- 7 files changed, 115 insertions(+), 139 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 45466ab6..933248d6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,7 +79,7 @@ jobs: steps: - *workspace - run: npm rebuild - - run: make test-node6 + - run: FETCH_MOCK_SRC=../es5/server make test-node6 chrome: <<: *container-browsers diff --git a/docs/_api-mocking/combined-shorthands.md b/docs/_api-mocking/combined-shorthands.md index a67ba52b..6b8a2f3a 100644 --- a/docs/_api-mocking/combined-shorthands.md +++ b/docs/_api-mocking/combined-shorthands.md @@ -6,7 +6,7 @@ description: |- The atomic shorthand methods - `.once()`, `any()`, and `.get()`, `.post()`, etc. are combined into a variety of shorthand methods that blend their behaviours. parametersBlockTitle: Methods parameters: - - name: Any once + - name: Any once versionAdded: 9.2.0 content: |- Create a route that responds to any single request: `.anyOnce(response, options)` @@ -17,7 +17,7 @@ parameters: Create a route that only responds to a single request using a particular http method: `.getOnce()`, `.postOnce()`, `.putOnce()`, `.deleteOnce()`, `.headOnce()`, `.patchOnce()` - name: Method any - + versionAdded: 9.2.0 content: |- Create a route that responds to any requests using a particular http method: `.getAny()`, `.postAny()`, `.putAny()`, `.deleteAny()`, `.headAny()`, `.patchAny()` diff --git a/test/client.js b/test/client.js index 6b02142d..a8542887 100644 --- a/test/client.js +++ b/test/client.js @@ -1,7 +1,5 @@ const fetchMock = require('../src/client.js'); -const expect = require('chai').expect; -require('./specs/client-only.test.js')(fetchMock) +require('./specs/client-only.test.js')(fetchMock); require('./runner')(fetchMock, window, window.fetch, window.AbortController); - diff --git a/test/node6.js b/test/node6.js index 0021e1f9..de55bf7f 100644 --- a/test/node6.js +++ b/test/node6.js @@ -5,9 +5,9 @@ require('babel-core').transform('code', { plugins: ['transform-runtime'], }); -const fetchMock = require('../es5/server'); +// const fetchMock = require('../es5/server'); // fetchMock.mock('http://it.at.there/', 200); // fetchMock.fetchHandler('http://it.at.there/').catch(() => process.exit(2)); -require('./server.js') +require('./server.js'); diff --git a/test/server.js b/test/server.js index 1d061977..bc839e6d 100644 --- a/test/server.js +++ b/test/server.js @@ -1,28 +1,11 @@ const fetchMock = require(process.env.FETCH_MOCK_SRC || '../src/server.js'); -const expect = require('chai').expect; -const http = require('http'); -const sinon = require('sinon'); -const { promisify } = require('util'); describe('nodejs tests', () => { - let server; - before(() => { - server = http.createServer((req, res) => { - res.writeHead(200); - res.end(); - }); - - return promisify(server.listen.bind(server))(9876); - }); - after(() => { - server.close(); - }); - require('./runner')( fetchMock, global, require('node-fetch'), require('abort-controller') ); - require('./specs/server-only.test.js')(fetchMock) + require('./specs/server-only.test.js')(fetchMock); }); diff --git a/test/specs/client-only.test.js b/test/specs/client-only.test.js index 5275feda..6a4a3cbd 100644 --- a/test/specs/client-only.test.js +++ b/test/specs/client-only.test.js @@ -1,94 +1,91 @@ const chai = require('chai'); -chai.use(require('sinon-chai')); const expect = chai.expect; -const sinon = require('sinon'); module.exports = (fetchMock) => { -describe('client-side only tests', () => { - -describe('native fetch behaviour', function () { - it('should not throw when passing unmatched calls through to native fetch', function () { - fetchMock.mock(/a/, 200); - expect(function () { - fetch('http://www.example.com'); - }).not.to.throw(); - fetchMock.restore(); - }); - - // this is because we read the body once when normalising the request and - // want to make sure fetch can still use the sullied request - it('can still POST a body successfully when spying', async () => { - fetchMock.spy(); - const req = new fetchMock.config.Request( - 'http://localhost:9876/dummy-file.txt', - { method: 'post', body: JSON.stringify({ prop: 'val' }) } - ); - expect(() => fetch(req)).not.to.throw(); - fetchMock.restore(); - }); -}); + describe('client-side only tests', () => { + describe('native fetch behaviour', function () { + it('should not throw when passing unmatched calls through to native fetch', function () { + fetchMock.mock(/a/, 200); + expect(function () { + fetch('http://www.example.com'); + }).not.to.throw(); + fetchMock.restore(); + }); -describe('request types that only work in the browser', function () { - it('respond with blob', function (done) { - const blob = new Blob(); - fetchMock.mock('http://it.at.there/', blob, { sendAsJson: false }); - fetch('http://it.at.there/').then(function (res) { - expect(res.status).to.equal(200); - res.blob().then(function (blobData) { - expect(blobData).to.eql(blob); + // this is because we read the body once when normalising the request and + // want to make sure fetch can still use the sullied request + it('can still POST a body successfully when spying', async () => { + fetchMock.spy(); + const req = new fetchMock.config.Request( + 'http://localhost:9876/dummy-file.txt', + { method: 'post', body: JSON.stringify({ prop: 'val' }) } + ); + expect(() => fetch(req)).not.to.throw(); fetchMock.restore(); - done(); }); }); - }); -}); -describe('no real fetch', function () { - it('should cope when there is no global fetch defined', function () { - const fetchCache = window.fetch; - delete window.fetch; - const realFetchCache = fetchMock.realFetch; - delete fetchMock.realFetch; - fetchMock.mock(/a/, 200); - expect(function () { - fetch('http://www.example.com'); - }).not.to.throw(); + describe('request types that only work in the browser', function () { + it('respond with blob', function (done) { + const blob = new Blob(); + fetchMock.mock('http://it.at.there/', blob, { sendAsJson: false }); + fetch('http://it.at.there/').then(function (res) { + expect(res.status).to.equal(200); + res.blob().then(function (blobData) { + expect(blobData).to.eql(blob); + fetchMock.restore(); + done(); + }); + }); + }); + }); + + describe('no real fetch', function () { + it('should cope when there is no global fetch defined', function () { + const fetchCache = window.fetch; + delete window.fetch; + const realFetchCache = fetchMock.realFetch; + delete fetchMock.realFetch; + fetchMock.mock(/a/, 200); + expect(function () { + fetch('http://www.example.com'); + }).not.to.throw(); - expect(function () { - fetchMock.calls(); - }).not.to.throw(); - fetchMock.restore(); - fetchMock.realFetch = realFetchCache; - window.fetch = fetchCache; - }); -}); + expect(function () { + fetchMock.calls(); + }).not.to.throw(); + fetchMock.restore(); + fetchMock.realFetch = realFetchCache; + window.fetch = fetchCache; + }); + }); -describe('service worker', () => { - it('should work within a service worker', () => { - return ( - navigator.serviceWorker && - navigator.serviceWorker.register('__sw.js').then((registration) => { - return new Promise((resolve, reject) => { - if (registration.installing) { - registration.installing.onstatechange = function () { - if (this.state === 'activated') { - resolve(); + describe('service worker', () => { + it('should work within a service worker', () => { + return ( + navigator.serviceWorker && + navigator.serviceWorker.register('__sw.js').then((registration) => { + return new Promise((resolve, reject) => { + if (registration.installing) { + registration.installing.onstatechange = function () { + if (this.state === 'activated') { + resolve(); + } + }; + } else { + reject('No idea what happened'); } - }; - } else { - reject('No idea what happened'); - } - }).then(() => { - expect(true).to.be.true; - return navigator.serviceWorker - .getRegistration() - .then((registration) => - registration ? registration.unregister() : false - ); - }); - }) - ); + }).then(() => { + expect(true).to.be.true; + return navigator.serviceWorker + .getRegistration() + .then((registration) => + registration ? registration.unregister() : false + ); + }); + }) + ); + }); + }); }); -}); -}) -} +}; diff --git a/test/specs/server-only.test.js b/test/specs/server-only.test.js index ca51d194..252038ad 100644 --- a/test/specs/server-only.test.js +++ b/test/specs/server-only.test.js @@ -5,42 +5,40 @@ const sinon = require('sinon'); module.exports = (fetchMock) => { describe('nodejs only tests', () => { + describe('support for nodejs body types', () => { + afterEach(() => fetchMock.reset()); + it('can respond with a buffer', () => { + fetchMock.mock(/a/, new Buffer('buffer'), { sendAsJson: false }); + return fetchMock + .fetchHandler('http://a.com') + .then((res) => res.text()) + .then((txt) => { + expect(txt).to.equal('buffer'); + }); + }); - - describe('support for nodejs body types', () => { - afterEach(() => fetchMock.reset()); - it('can respond with a buffer', () => { - fetchMock.mock(/a/, new Buffer('buffer'), { sendAsJson: false }); - return fetchMock - .fetchHandler('http://a.com') - .then((res) => res.text()) - .then((txt) => { - expect(txt).to.equal('buffer'); + it('can respond with a readable stream', (done) => { + const { Readable, Writable } = require('stream'); + const readable = new Readable(); + const write = sinon.stub().callsFake((chunk, enc, cb) => { + cb(); }); - }); - - it('can respond with a readable stream', (done) => { - const { Readable, Writable } = require('stream'); - const readable = new Readable(); - const write = sinon.stub().callsFake((chunk, enc, cb) => { - cb(); - }); - const writable = new Writable({ - write, - }); - readable.push('response string'); - readable.push(null); + const writable = new Writable({ + write, + }); + readable.push('response string'); + readable.push(null); - fetchMock.mock(/a/, readable, { sendAsJson: false }); - fetchMock.fetchHandler('http://a.com').then((res) => { - res.body.pipe(writable); - }); + fetchMock.mock(/a/, readable, { sendAsJson: false }); + fetchMock.fetchHandler('http://a.com').then((res) => { + res.body.pipe(writable); + }); - writable.on('finish', () => { - expect(write.args[0][0].toString('utf8')).to.equal('response string'); - done(); + writable.on('finish', () => { + expect(write.args[0][0].toString('utf8')).to.equal('response string'); + done(); + }); }); }); }); - }) -} +}; From f3581c70e1333d083f9933558a492b1e532026d8 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:52:35 +0100 Subject: [PATCH 16/29] lint .mjs files --- Makefile | 4 ++-- test/client.mjs | 4 ++-- test/server.mjs | 25 ++----------------------- 3 files changed, 6 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index 6c992f84..74a8e867 100644 --- a/Makefile +++ b/Makefile @@ -22,11 +22,11 @@ typecheck: dtslint --expectOnly types lint-ci: - eslint --ignore-pattern test/fixtures/* src test + eslint --ext .js,.mjs --ignore-pattern test/fixtures/* src test prettier *.md docs/*.md docs/**/*.md lint: - eslint --cache --fix --ignore-pattern test/fixtures/* src test + eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test prettier --write *.md docs/*.md docs/**/*.md coverage: diff --git a/test/client.mjs b/test/client.mjs index d43146b6..f40ccf16 100644 --- a/test/client.mjs +++ b/test/client.mjs @@ -1,6 +1,6 @@ import fetchMock from '../esm/client.js'; -import {expect} from 'chai'; import runner from './runner.js'; import clientOnly from './specs/client-only.test.js'; -clientOnly(fetchMock) + +clientOnly(fetchMock); runner(fetchMock, window, window.fetch, window.AbortController); diff --git a/test/server.mjs b/test/server.mjs index ba1cb851..5d78fdc2 100644 --- a/test/server.mjs +++ b/test/server.mjs @@ -1,31 +1,10 @@ import fetchMock from '../esm/server.js'; -import {expect} from 'chai'; -import http from 'http'; -import sinon from 'sinon'; -import { promisify } from 'util'; import runner from './runner.js'; import fetch from 'node-fetch'; import AbortController from 'abort-controller'; import serverOnly from './specs/server-only.test.js'; describe('nodejs tests', () => { - let server; - before(() => { - server = http.createServer((req, res) => { - res.writeHead(200); - res.end(); - }); - return promisify(server.listen.bind(server))(9876); - }); - after(() => { - server.close(); - }); - - runner( - fetchMock, - global, - fetch, - AbortController - ); - serverOnly(fetchMock) + runner(fetchMock, global, fetch, AbortController); + serverOnly(fetchMock); }); From 252de860fb932289e5857244e9095a30b12d3176 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 16:56:47 +0100 Subject: [PATCH 17/29] fix mistake in server side test refactor --- Makefile | 2 +- test/server.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 74a8e867..be790fd5 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ lint-ci: lint: eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test - prettier --write *.md docs/*.md docs/**/*.md + prettier --cache --write *.md docs/*.md docs/**/*.md coverage: nyc --reporter=lcovonly --reporter=text mocha test/server.js diff --git a/test/server.js b/test/server.js index bc839e6d..705d30e7 100644 --- a/test/server.js +++ b/test/server.js @@ -1,6 +1,21 @@ const fetchMock = require(process.env.FETCH_MOCK_SRC || '../src/server.js'); +const http = require('http'); +const { promisify } = require('util'); describe('nodejs tests', () => { + let server; + before(() => { + server = http.createServer((req, res) => { + res.writeHead(200); + res.end(); + }); + + return promisify(server.listen.bind(server))(9876); + }); + after(() => { + server.close(); + }); + require('./runner')( fetchMock, global, From 0c1fab94f1b91c812bb5ffd717d297bd252c134c Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 17:27:52 +0100 Subject: [PATCH 18/29] revert attempt to run tests in node6 - too legacy and unsupported --- Makefile | 3 ++- test/node6.js | 8 +++----- test/package.json | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 test/package.json diff --git a/Makefile b/Makefile index be790fd5..2a325e9d 100644 --- a/Makefile +++ b/Makefile @@ -15,7 +15,7 @@ test-browser: else karma start --single-run --browsers=${TEST_BROWSER}; \ fi -test-node6: transpile +test-node6: node test/node6.js typecheck: @@ -42,6 +42,7 @@ transpile: build: transpile if [ ! -d "cjs" ]; then mkdir cjs; fi cp -r src/* cjs + cp src/package.json es5 rollup -c rollup.config.js docs: diff --git a/test/node6.js b/test/node6.js index de55bf7f..83acb7bb 100644 --- a/test/node6.js +++ b/test/node6.js @@ -5,9 +5,7 @@ require('babel-core').transform('code', { plugins: ['transform-runtime'], }); -// const fetchMock = require('../es5/server'); +const fetchMock = require('../es5/server'); -// fetchMock.mock('http://it.at.there/', 200); -// fetchMock.fetchHandler('http://it.at.there/').catch(() => process.exit(2)); - -require('./server.js'); +fetchMock.mock('http://it.at.there/', 200); +fetchMock.fetchHandler('http://it.at.there/').catch(() => process.exit(2)); diff --git a/test/package.json b/test/package.json new file mode 100644 index 00000000..b731bd61 --- /dev/null +++ b/test/package.json @@ -0,0 +1 @@ +{"type": "commonjs"} From 6fd55daab311dcf1efbc0ed39cf5164142013e9d Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 17:42:20 +0100 Subject: [PATCH 19/29] theoretically test .mjs files inthe browser but karma test runner does not support the extension - will need to move to a different test harness at some point --- karma.conf.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/karma.conf.js b/karma.conf.js index 8480af4e..554d0aea 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -3,7 +3,7 @@ module.exports = (karma) => port: 9876, frameworks: ['mocha'], files: [ - 'test/client.js', + process.env.TEST_SRC || 'test/client.js', { pattern: 'test/fixtures/sw.js', served: true, included: false }, ], proxies: { From 007edaca048286c8ff1642d335a13e6faf651acd Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:02:29 +0100 Subject: [PATCH 20/29] run tests in more versions of node --- .circleci/config.yml | 86 ++++++++++++++++++++++++++++++--------- Makefile | 4 +- test/{node6.js => es5.js} | 0 3 files changed, 69 insertions(+), 21 deletions(-) rename test/{node6.js => es5.js} (100%) diff --git a/.circleci/config.yml b/.circleci/config.yml index 933248d6..b69c2196 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,12 +6,28 @@ references: filters: tags: only: /.*/ - container: &container + + + nodejs: &nodejs + docker: + - image: circleci/node:12.16.3 + browsers: &browsers + docker: + - image: circleci/node:12.16.3-browsers + + node14: &node14 + docker: + - image: circleci/node:14.2.0 + node13: &node13 + docker: + - image: circleci/node:13.14.0 + node10: &node10 docker: - image: circleci/node:10.20.1 - container-browsers: &container-browsers + node6: &node6 docker: - - image: circleci/node:10.20.1-browsers + - image: circleci/node:6.13.0 + workspace: &workspace attach_workspace: at: ~/project @@ -21,9 +37,16 @@ references: paths: - . + rebuild_test: &rebuild_test + steps: + - *workspace + - run: npm rebuild + - run: make test + + jobs: checkout_code: - <<: *container + <<: *nodejs steps: - checkout - restore_cache: @@ -36,59 +59,69 @@ jobs: - *persist build: - <<: *container + <<: *nodejs steps: - *workspace - run: make build - *persist lint: - <<: *container + <<: *nodejs steps: - *workspace - run: make lint-ci typecheck: - <<: *container + <<: *nodejs steps: - *workspace - run: make typecheck test: - <<: *container + <<: *nodejs steps: - *workspace - run: make coverage nodefetch2: - <<: *container + <<: *nodejs steps: - *workspace - run: FETCH_MOCK_SRC=../cjs/server.js make test nodefetch1: - <<: *container + <<: *nodejs steps: - *workspace - run: npm install node-fetch@1 - run: FETCH_MOCK_SRC=../cjs/server.js make test - node6: - docker: - - image: circleci/node:6.13.0 + es5: + <<: *node6 steps: - *workspace - run: npm rebuild - - run: FETCH_MOCK_SRC=../es5/server make test-node6 + - run: FETCH_MOCK_SRC=../es5/server make test-es5 + + node10: + <<: *node10 + <<: *rebuild_test + node13: + <<: *node13 + <<: *rebuild_test + + node14: + <<: *node14 + <<: *rebuild_test chrome: - <<: *container-browsers + <<: *browsers steps: - *workspace - run: TEST_BROWSER=Chrome make test-browser firefox: - <<: *container-browsers + <<: *browsers steps: - *workspace - run: npm install karma-firefox-launcher @@ -96,7 +129,7 @@ jobs: deploy: - <<: *container + <<: *nodejs steps: - *workspace - run: make publish @@ -132,7 +165,19 @@ workflows: <<: *triggerable-by-tag requires: - build - - node6: + - es5: + <<: *triggerable-by-tag + requires: + - build + - node10: + <<: *triggerable-by-tag + requires: + - build + - node13: + <<: *triggerable-by-tag + requires: + - build + - node14: <<: *triggerable-by-tag requires: - build @@ -149,11 +194,14 @@ workflows: requires: - nodefetch1 - nodefetch2 - - node6 + - es5 - chrome - firefox - build - typecheck + - node10 + - node13 + - node14 filters: branches: ignore: /.*/ diff --git a/Makefile b/Makefile index 2a325e9d..c277e75e 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,8 @@ test-browser: else karma start --single-run --browsers=${TEST_BROWSER}; \ fi -test-node6: - node test/node6.js +test-es5: + node test/es5.js typecheck: dtslint --expectOnly types diff --git a/test/node6.js b/test/es5.js similarity index 100% rename from test/node6.js rename to test/es5.js From ea937fe2efcc6114ea6a7c39e8eee34b3535c48c Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:07:36 +0100 Subject: [PATCH 21/29] get linting to work in node 12 --- .eslintrc.js => .eslintrc.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename .eslintrc.js => .eslintrc.json (59%) diff --git a/.eslintrc.js b/.eslintrc.json similarity index 59% rename from .eslintrc.js rename to .eslintrc.json index f882bd89..dd209b5f 100644 --- a/.eslintrc.js +++ b/.eslintrc.json @@ -1,5 +1,5 @@ -module.exports = { - extends: ['origami-component', 'plugin:prettier/recommended'], +{ + "extends": ["origami-component", "plugin:prettier/recommended"], "env": { "browser": true, "mocha": true, @@ -11,8 +11,8 @@ module.exports = { "globals": { "expect": true }, - rules: { - 'guard-for-in': 0 + "rules": { + "guard-for-in": 0 } } From 8f01da5a0a19026a89c6667df89fc11efe8f218f Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:18:20 +0100 Subject: [PATCH 22/29] fix running karma tasks in node 12.15+ from that version onwards type: "module" throws an error --- .circleci/config.yml | 14 +++++++++++++- .eslintrc.json => .eslintrc.js | 2 +- Makefile | 2 +- docs/cheatsheet.md | 2 +- docs/v6-v7-upgrade-guide.md | 2 +- package.json | 1 - test/package.json | 1 - 7 files changed, 17 insertions(+), 7 deletions(-) rename .eslintrc.json => .eslintrc.js (93%) delete mode 100644 test/package.json diff --git a/.circleci/config.yml b/.circleci/config.yml index b69c2196..2a941b3a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -101,7 +101,14 @@ jobs: steps: - *workspace - run: npm rebuild - - run: FETCH_MOCK_SRC=../es5/server make test-es5 + - run: FETCH_MOCK_SRC=../es5/server.js make test-es5 + + esm: + <<: *node14 + steps: + - *workspace + - run: npm rebuild + - run: FETCH_MOCK_SRC=../esm/server.js mocha test/server.mjs node10: <<: *node10 @@ -169,6 +176,10 @@ workflows: <<: *triggerable-by-tag requires: - build + - esm: + <<: *triggerable-by-tag + requires: + - build - node10: <<: *triggerable-by-tag requires: @@ -202,6 +213,7 @@ workflows: - node10 - node13 - node14 + - esm filters: branches: ignore: /.*/ diff --git a/.eslintrc.json b/.eslintrc.js similarity index 93% rename from .eslintrc.json rename to .eslintrc.js index dd209b5f..13ddf612 100644 --- a/.eslintrc.json +++ b/.eslintrc.js @@ -1,4 +1,4 @@ -{ +module.exports = { "extends": ["origami-component", "plugin:prettier/recommended"], "env": { "browser": true, diff --git a/Makefile b/Makefile index c277e75e..e1469bb3 100644 --- a/Makefile +++ b/Makefile @@ -42,7 +42,7 @@ transpile: build: transpile if [ ! -d "cjs" ]; then mkdir cjs; fi cp -r src/* cjs - cp src/package.json es5 + echo '{"type": "module"}' > esm/package.json rollup -c rollup.config.js docs: diff --git a/docs/cheatsheet.md b/docs/cheatsheet.md index b54d8272..5d4d0696 100644 --- a/docs/cheatsheet.md +++ b/docs/cheatsheet.md @@ -63,7 +63,7 @@ The following request would be matched by all the mocks described below: fetch('http://example.com/users/bob?q=rita', { method: 'POST', headers: { 'Content-Type': 'application/json' }, - body: '{"prop1": "val1", "prop2": "val2"}' + body: '{"prop1": "val1", "prop2": "val2"}', }); ``` diff --git a/docs/v6-v7-upgrade-guide.md b/docs/v6-v7-upgrade-guide.md index a2233a61..2d8f7652 100644 --- a/docs/v6-v7-upgrade-guide.md +++ b/docs/v6-v7-upgrade-guide.md @@ -99,7 +99,7 @@ Read more in the [filtering docs](http://www.wheresrhys.co.uk/fetch-mock/#api-in fetchMock.mock('*', 200); await fetch('/main-course/lasagne', { method: 'POST', - headers: { discount: true } + headers: { discount: true }, }); await fetch('/main-course/bolognaise'); diff --git a/package.json b/package.json index d1a3c9ad..74b4ca22 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,5 @@ { "name": "fetch-mock", - "type": "module", "version": "0.0.0", "description": "Mock http requests made using fetch (or isomorphic-fetch)", "main": "./cjs/server.js", diff --git a/test/package.json b/test/package.json deleted file mode 100644 index b731bd61..00000000 --- a/test/package.json +++ /dev/null @@ -1 +0,0 @@ -{"type": "commonjs"} From e6d3ec7d1b3f1ad0889ce4e4f0fbcd23a83d899d Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:18:43 +0100 Subject: [PATCH 23/29] alias verify to lint --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index e1469bb3..701f4e1a 100644 --- a/Makefile +++ b/Makefile @@ -29,6 +29,8 @@ lint: eslint --cache --fix --ext .js,.mjs --ignore-pattern test/fixtures/* src test prettier --cache --write *.md docs/*.md docs/**/*.md +verify: lint + coverage: nyc --reporter=lcovonly --reporter=text mocha test/server.js cat ./coverage/lcov.info | coveralls From 59fbffed102fb5491f50fa60a2c54cb34506c43e Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:20:47 +0100 Subject: [PATCH 24/29] make sure all tests run over built files --- .circleci/config.yml | 2 +- Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2a941b3a..5e2f159d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -41,7 +41,7 @@ references: steps: - *workspace - run: npm rebuild - - run: make test + - run: FETCH_MOCK_SRC=../cjs/server.js make test jobs: diff --git a/Makefile b/Makefile index 701f4e1a..645663de 100644 --- a/Makefile +++ b/Makefile @@ -44,8 +44,8 @@ transpile: build: transpile if [ ! -d "cjs" ]; then mkdir cjs; fi cp -r src/* cjs - echo '{"type": "module"}' > esm/package.json rollup -c rollup.config.js + echo '{"type": "module"}' > esm/package.json docs: cd docs; jekyll serve build --watch From a965c6757f3a55b16ce180a9476413ec6e96716a Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:25:50 +0100 Subject: [PATCH 25/29] why does mocha not exist when using esm? --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5e2f159d..1c88ed42 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,7 +108,7 @@ jobs: steps: - *workspace - run: npm rebuild - - run: FETCH_MOCK_SRC=../esm/server.js mocha test/server.mjs + - run: FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs node10: <<: *node10 From ac4572d501e27ca9c62b4b08b9da1a6a2bf81217 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 18:30:47 +0100 Subject: [PATCH 26/29] add esm hook to mocha --- .circleci/config.yml | 2 +- package-lock.json | 176 ++++++++++++++++++++++--------------------- package.json | 1 + 3 files changed, 93 insertions(+), 86 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 1c88ed42..839bd8e5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,7 +108,7 @@ jobs: steps: - *workspace - run: npm rebuild - - run: FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs + - run: FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs --require esm node10: <<: *node10 diff --git a/package-lock.json b/package-lock.json index 3cb73e85..ba582790 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,7 @@ "@sinonjs/formatio": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-2.0.0.tgz", - "integrity": "sha512-ls6CAMA6/5gG+O/IdsBcblvnd8qcO/l1TYoNeAzp3wcISOxlPXQEus0mLcdwazEkWjaBdaJ3TaxmNgCLWwvWzg==", + "integrity": "sha1-hNt+nrVTHfGKjF4L+25EnlXmVLI=", "dev": true, "requires": { "samsam": "1.3.0" @@ -363,7 +363,7 @@ "anymatch": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-1.3.2.tgz", - "integrity": "sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==", + "integrity": "sha1-VT3Lj5HjyImEXf26NMd3IbkLnXo=", "dev": true, "optional": true, "requires": { @@ -380,7 +380,7 @@ "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -399,7 +399,7 @@ "arr-flatten": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", "dev": true }, "arr-union": { @@ -435,7 +435,7 @@ "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", + "integrity": "sha1-O7xCdd1YTMGxCAm4nU6LY6aednU=", "dev": true }, "asn1": { @@ -450,7 +450,7 @@ "asn1.js": { "version": "4.10.1", "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", - "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "integrity": "sha1-ucK/WAXx5kqt7tbfOiv6+1pz9aA=", "dev": true, "requires": { "bn.js": "^4.0.0", @@ -494,7 +494,7 @@ "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", "dev": true }, "assign-symbols": { @@ -629,7 +629,7 @@ "babel-generator": { "version": "6.26.1", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.1.tgz", - "integrity": "sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==", + "integrity": "sha1-GERAjTuPDTWkBOp6wYDwh6YBvZA=", "dev": true, "requires": { "babel-messages": "^6.23.0", @@ -1245,7 +1245,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -1274,7 +1274,7 @@ "babylon": { "version": "6.18.0", "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==", + "integrity": "sha1-ry87iPpvXB5MY00aD46sT1WzleM=", "dev": true }, "backo2": { @@ -1292,7 +1292,7 @@ "base": { "version": "0.11.2", "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", "dev": true, "requires": { "cache-base": "^1.0.1", @@ -1316,7 +1316,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -1325,7 +1325,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -1334,7 +1334,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -1511,7 +1511,7 @@ "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -1539,7 +1539,7 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=", "dev": true }, "browserify-aes": { @@ -1618,7 +1618,7 @@ "browserify-zlib": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", - "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "integrity": "sha1-KGlFnZqjviRf6P4sofRuLn9U1z8=", "dev": true, "requires": { "pako": "~1.0.5" @@ -1746,7 +1746,7 @@ "cache-base": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", "dev": true, "requires": { "collection-visit": "^1.0.0", @@ -1882,7 +1882,7 @@ "cipher-base": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", "dev": true, "requires": { "inherits": "^2.0.1", @@ -1892,13 +1892,13 @@ "circular-json": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", - "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "integrity": "sha1-gVyZ6oT2gJUp0vRXkb34JxE1LWY=", "dev": true }, "class-utils": { "version": "0.3.6", "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", "dev": true, "requires": { "arr-union": "^3.1.0", @@ -2079,7 +2079,7 @@ "concat-stream": { "version": "1.6.2", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -2132,7 +2132,7 @@ "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", + "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=", "dev": true }, "convert-source-map": { @@ -2247,7 +2247,7 @@ "crypto-browserify": { "version": "3.12.0", "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", - "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "integrity": "sha1-OWz58xN/A+S45TLFj2mCVOAPgOw=", "dev": true, "requires": { "browserify-cipher": "^1.0.0", @@ -2332,7 +2332,7 @@ "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", "dev": true, "requires": { "type-detect": "^4.0.0" @@ -2365,7 +2365,7 @@ "define-property": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", "dev": true, "requires": { "is-descriptor": "^1.0.2", @@ -2375,7 +2375,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2384,7 +2384,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -2393,7 +2393,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -2465,7 +2465,7 @@ "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", + "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=", "dev": true }, "diffie-hellman": { @@ -2482,7 +2482,7 @@ "doctrine": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "integrity": "sha1-XNAfwQFiG0LEzX9dGmYkNxbT850=", "dev": true, "requires": { "esutils": "^2.0.2" @@ -2747,7 +2747,7 @@ "errno": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", - "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "integrity": "sha1-RoTXF3mtOa8Xfj8AeZb3xnyFJhg=", "dev": true, "requires": { "prr": "~1.0.1" @@ -2800,7 +2800,7 @@ "eslint": { "version": "4.19.1", "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", - "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "integrity": "sha1-MtHWU+HZBAiFS/spbwdux+GGowA=", "dev": true, "requires": { "ajv": "^5.3.0", @@ -2980,10 +2980,16 @@ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "dev": true + }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", - "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "integrity": "sha1-sPRHGHyKi+2US4FaZgvd9d610ac=", "dev": true, "requires": { "acorn": "^5.5.0", @@ -3016,7 +3022,7 @@ "esrecurse": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", "dev": true, "requires": { "estraverse": "^4.1.0" @@ -3061,7 +3067,7 @@ "evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", "dev": true, "requires": { "md5.js": "^1.3.4", @@ -3183,7 +3189,7 @@ "is-extendable": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", "dev": true, "requires": { "is-plain-object": "^2.0.4" @@ -3270,7 +3276,7 @@ "file-uri-to-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "integrity": "sha1-VTp7hEb/b2hDWcRF8eN6BdrMM90=", "dev": true, "optional": true }, @@ -3476,7 +3482,7 @@ "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "integrity": "sha1-4y/AMKLM7kSmtTcTCNpUvgs5fSc=", "dev": true }, "fs-write-stream-atomic": { @@ -4051,7 +4057,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", "dev": true }, "functional-red-black-tree": { @@ -4481,7 +4487,7 @@ "inquirer": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", - "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", + "integrity": "sha1-ndLyrXZdyrH/BEO0kUQqILoifck=", "dev": true, "requires": { "ansi-escapes": "^3.0.0", @@ -4549,7 +4555,7 @@ "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -4588,7 +4594,7 @@ "is-buffer": { "version": "1.1.6", "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, "is-data-descriptor": { @@ -4603,7 +4609,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -4614,7 +4620,7 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } @@ -4696,7 +4702,7 @@ "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", "dev": true, "requires": { "isobject": "^3.0.1" @@ -4750,7 +4756,7 @@ "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", - "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "integrity": "sha1-+xj4fOH+uSUWnJpAfBkxijIG7Yg=", "dev": true }, "is-stream": { @@ -4773,7 +4779,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", "dev": true }, "is-wsl": { @@ -5353,7 +5359,7 @@ "karma-chrome-launcher": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", + "integrity": "sha1-zxudBxNswY/iOTJ9JGVMPbw2is8=", "dev": true, "requires": { "fs-access": "^1.0.0", @@ -5763,7 +5769,7 @@ "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "integrity": "sha1-V0Dhxdbw39pK2TI7UzIQfva0xAo=", "dev": true, "requires": { "chalk": "^2.0.1" @@ -5993,7 +5999,7 @@ "miller-rabin": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", "dev": true, "requires": { "bn.js": "^4.0.0", @@ -6042,7 +6048,7 @@ "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -9179,7 +9185,7 @@ "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "integrity": "sha1-ggyGo5M0ZA6ZUWkovQP8qIBX0CI=", "dev": true } } @@ -9468,7 +9474,7 @@ "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", - "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "integrity": "sha1-KYuJ34uTsCIdv0Ia0rGx6iP8Z3c=", "dev": true }, "posix-character-classes": { @@ -9499,7 +9505,7 @@ "private": { "version": "0.1.8", "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==", + "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", "dev": true }, "process": { @@ -9605,7 +9611,7 @@ "qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "integrity": "sha1-xF6cYYAL0IfviNfiVkI73Unl0HE=", "dev": true }, "qs": { @@ -9665,7 +9671,7 @@ "randomfill": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", - "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "integrity": "sha1-ySGW/IarQr6YPxvzF3giSTHWFFg=", "dev": true, "requires": { "randombytes": "^2.0.5", @@ -10016,12 +10022,12 @@ "regenerator-runtime": { "version": "0.11.1", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" }, "regenerator-transform": { "version": "0.10.1", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", + "integrity": "sha1-HkmWg3Ix2ot/PPQRTXG1aRoGgN0=", "dev": true, "requires": { "babel-runtime": "^6.18.0", @@ -10032,7 +10038,7 @@ "regex-cache": { "version": "0.4.4", "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "integrity": "sha1-db3FiioUls7EihKDW8VMjVYjNt0=", "dev": true, "optional": true, "requires": { @@ -10042,7 +10048,7 @@ "regex-not": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", "dev": true, "requires": { "extend-shallow": "^3.0.2", @@ -10052,7 +10058,7 @@ "regexpp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", - "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "integrity": "sha1-DjUW3Qt5BPQT0tQZPc5GGMOmias=", "dev": true }, "regexpu-core": { @@ -10206,7 +10212,7 @@ "ret": { "version": "0.1.15", "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", "dev": true }, "rfdc": { @@ -10405,7 +10411,7 @@ "samsam": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/samsam/-/samsam-1.3.0.tgz", - "integrity": "sha512-1HwIYD/8UlOtFS3QO3w7ey+SdSDFE4HRNLZoZRYVQefrOY3l17epswImeB1ijgJFQJodIaHcwkp3r/myBjFVbg==", + "integrity": "sha1-jR2TUOJWItow3j5EumkrUiGrfFA=", "dev": true }, "schema-utils": { @@ -10483,7 +10489,7 @@ "sha.js": { "version": "2.4.11", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "integrity": "sha1-N6XPC4HsvGlD3hCbopYNGyZYSuc=", "dev": true, "requires": { "inherits": "^2.0.1", @@ -10514,7 +10520,7 @@ "sinon": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/sinon/-/sinon-4.5.0.tgz", - "integrity": "sha512-trdx+mB0VBBgoYucy6a9L7/jfQOmvGeaKZT4OOJ+lPAtI8623xyGr8wLiE4eojzBS8G9yXbhx42GHUOVLr4X2w==", + "integrity": "sha1-QnrjEqM308UWgEzidU6MDVAoywQ=", "dev": true, "requires": { "@sinonjs/formatio": "^2.0.0", @@ -10540,7 +10546,7 @@ "sinon-chai": { "version": "2.14.0", "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-2.14.0.tgz", - "integrity": "sha512-9stIF1utB0ywNHNT7RgiXbdmen8QDCRsrTjw+G9TgKt1Yexjiv8TOWZ6WHsTPz57Yky3DIswZvEqX8fpuHNDtQ==", + "integrity": "sha1-2n3UzIPNaiYLZ8yg96n9riahIF0=", "dev": true }, "slash": { @@ -10552,7 +10558,7 @@ "slice-ansi": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", - "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "integrity": "sha1-BE8aSdiEL/MHqta1Be0Xi9lQE00=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0" @@ -10561,7 +10567,7 @@ "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", "dev": true, "requires": { "base": "^0.11.1", @@ -10577,7 +10583,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -10612,7 +10618,7 @@ "snapdragon-node": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", "dev": true, "requires": { "define-property": "^1.0.0", @@ -10632,7 +10638,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -10641,7 +10647,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -10650,7 +10656,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -10675,7 +10681,7 @@ "snapdragon-util": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", "dev": true, "requires": { "kind-of": "^3.2.0" @@ -10852,7 +10858,7 @@ "split-string": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", "dev": true, "requires": { "extend-shallow": "^3.0.0" @@ -10967,7 +10973,7 @@ "streamroller": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-0.7.0.tgz", - "integrity": "sha512-WREzfy0r0zUqp3lGO096wRuUp7ho1X6uo/7DJfTlEi0Iv/4gT7YHqXDjKC2ioVGBZtE8QzsQD9nx1nIuoZ57jQ==", + "integrity": "sha1-odG3z4PTmvsNYwSaWsv5NJO99ks=", "dev": true, "requires": { "date-format": "^1.2.0", @@ -10996,7 +11002,7 @@ "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "integrity": "sha1-q5Pyeo3BPSjKyBXEYhQ6bZASrp4=", "dev": true, "requires": { "is-fullwidth-code-point": "^2.0.0", @@ -11059,7 +11065,7 @@ "table": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "integrity": "sha1-ozRHN1OR52atNNNIbm4q7chNLjY=", "dev": true, "requires": { "ajv": "^5.2.3", @@ -11306,7 +11312,7 @@ "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", - "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", "dev": true, "requires": { "os-tmpdir": "~1.0.2" @@ -11342,7 +11348,7 @@ "to-regex": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", "dev": true, "requires": { "define-property": "^2.0.2", @@ -11508,7 +11514,7 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", "dev": true }, "type-is": { @@ -11542,7 +11548,7 @@ "ultron": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", - "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "integrity": "sha1-n+FTahCmZKZSZqHjzPhf02MCvJw=", "dev": true }, "union-value": { @@ -11693,7 +11699,7 @@ "useragent": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz", - "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==", + "integrity": "sha1-IX+UOtVAyyEoZYqyP8lg9qiMmXI=", "dev": true, "requires": { "lru-cache": "4.1.x", @@ -12679,7 +12685,7 @@ "ws": { "version": "3.3.3", "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", - "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "integrity": "sha1-8c+E/i1ekB686U767OeF8YeiKPI=", "dev": true, "requires": { "async-limiter": "~1.0.0", diff --git a/package.json b/package.json index 74b4ca22..ed2d1501 100644 --- a/package.json +++ b/package.json @@ -87,6 +87,7 @@ "eslint-config-origami-component": "1.0.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-prettier": "^2.6.1", + "esm": "^3.2.25", "karma": "^3.1.4", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^2.2.0", From ad9906325d8a4e0a157614f5ae056e4d135964fe Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 19:16:38 +0100 Subject: [PATCH 27/29] trey and fail to fix testing esm build in mocha; --- .circleci/config.yml | 4 +- Makefile | 3 + package-lock.json | 756 +++++++++++++++++++++++++++++++-- package.json | 3 +- rollup.config.js | 2 + test/specs/server-only.test.js | 1 + 6 files changed, 720 insertions(+), 49 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 839bd8e5..929334a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -108,7 +108,7 @@ jobs: steps: - *workspace - run: npm rebuild - - run: FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs --require esm + - run: make test-esm node10: <<: *node10 @@ -213,7 +213,7 @@ workflows: - node10 - node13 - node14 - - esm + # - esm filters: branches: ignore: /.*/ diff --git a/Makefile b/Makefile index 645663de..4cfd8911 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,9 @@ test-browser: test-es5: node test/es5.js +test-esm: + FETCH_MOCK_SRC=../esm/server.js ./node_modules/.bin/mocha test/server.mjs + typecheck: dtslint --expectOnly types diff --git a/package-lock.json b/package-lock.json index ba582790..c99abcd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,31 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@rollup/pluginutils": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.0.10.tgz", + "integrity": "sha512-d44M7t+PjmMrASHbhgpSbVgtL6EFyX7J4mYxwQ/c5eoaE6N2VgCgEcWVzNnwycIloti+/MpwFr8qfw+nRw00sw==", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + }, + "dependencies": { + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", + "dev": true + }, + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", + "dev": true + } + } + }, "@sinonjs/commons": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.7.2.tgz", @@ -342,6 +367,12 @@ "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, + "ansi-colors": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", + "integrity": "sha512-LEHHyuhlPY3TmuUYMh2oz89lTShfvgbmzaBcxve9t/9Wuy7Dwf4yoAKcND7KFT1HAQfqZ12qtc+DUrBMeKF9nw==", + "dev": true + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -2608,6 +2639,12 @@ "minimalistic-crypto-utils": "^1.0.0" } }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, "emojis-list": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", @@ -2753,6 +2790,36 @@ "prr": "~1.0.1" } }, + "es-abstract": { + "version": "1.17.5", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.5.tgz", + "integrity": "sha512-BR9auzDbySxOcfog0tLECW8l28eRGpDpU3Dm3Hp4q/N+VtLTmyj4EUN088XZWQDW/hzj6sYRDXeOFsaAODKvpg==", + "dev": true, + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.1.5", + "is-regex": "^1.0.5", + "object-inspect": "^1.7.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.0", + "string.prototype.trimleft": "^2.1.1", + "string.prototype.trimright": "^2.1.1" + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es5-ext": { "version": "0.10.53", "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.53.tgz", @@ -3353,6 +3420,23 @@ "locate-path": "^2.0.0" } }, + "flat": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/flat/-/flat-4.1.0.tgz", + "integrity": "sha512-Px/TiLIznH7gEDlPXcUD4KnBusa6kR6ayRUVcnEAbreRIuhkqow/mun59BuRXwoYk7ZQOLW1ZM05ilIvK38hFw==", + "dev": true, + "requires": { + "is-buffer": "~2.0.3" + }, + "dependencies": { + "is-buffer": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz", + "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A==", + "dev": true + } + } + }, "flat-cache": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", @@ -4217,6 +4301,15 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -4342,9 +4435,9 @@ } }, "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", "dev": true }, "hmac-drbg": { @@ -4597,6 +4690,12 @@ "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", "dev": true }, + "is-callable": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", + "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "dev": true + }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -4606,6 +4705,12 @@ "kind-of": "^3.0.2" } }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", + "dev": true + }, "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", @@ -4753,6 +4858,15 @@ } } }, + "is-regex": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", + "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "dev": true, + "requires": { + "has": "^1.0.3" + } + }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", @@ -4770,6 +4884,15 @@ "resolved": "https://registry.npmjs.org/is-subset/-/is-subset-0.1.1.tgz", "integrity": "sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY=" }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "dev": true, + "requires": { + "has-symbols": "^1.0.1" + } + }, "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", @@ -6109,43 +6232,170 @@ } }, "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-7.1.2.tgz", + "integrity": "sha512-o96kdRKMKI3E8U0bjnfqW4QMk12MwZ4mhdBTf+B5a1q9+aq2HRnj+3ZdJu0B/ZhJeK78MgYuv6L8d/rA5AeBJA==", "dev": true, "requires": { + "ansi-colors": "3.2.3", "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", + "chokidar": "3.3.0", + "debug": "3.2.6", "diff": "3.5.0", "escape-string-regexp": "1.0.5", - "glob": "7.1.2", + "find-up": "3.0.0", + "glob": "7.1.3", "growl": "1.10.5", - "he": "1.1.1", + "he": "1.2.0", + "js-yaml": "3.13.1", + "log-symbols": "3.0.0", "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "mkdirp": "0.5.5", + "ms": "2.1.1", + "node-environment-flags": "1.0.6", + "object.assign": "4.1.0", + "strip-json-comments": "2.0.1", + "supports-color": "6.0.0", + "which": "1.3.1", + "wide-align": "1.1.3", + "yargs": "13.3.2", + "yargs-parser": "13.1.2", + "yargs-unparser": "1.6.0" }, "dependencies": { - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "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" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", "dev": true }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "dependencies": { + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "chokidar": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.0.tgz", + "integrity": "sha512-dGmKLDdT3Gdl7fBUe8XK+gAtGmzy5Fn0XkkWQuYxGIgWVPPse2CxFA5mtrlD0TOHaHjEUqkWNyP1XdHoJES/4A==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" + } + }, + "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" + } + }, "debug": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", "dev": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" } }, + "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" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", + "dev": true, + "optional": true + }, + "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.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -6156,35 +6406,191 @@ "path-is-absolute": "^1.0.0" } }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { - "minimist": "0.0.8" + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "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" + } + }, + "log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "requires": { + "chalk": "^2.4.2" } }, "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "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 + }, + "readdirp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, + "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" + } + }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.0.0.tgz", + "integrity": "sha512-on9Kwidc1IUQo+bQdhi8+Tijpo0e1SS6RoGo2guUwn5vdaxw8RXOF9Vb2ws+ihWOmh4JnCJOvaziZWP1VABaLg==", "dev": true, "requires": { "has-flag": "^3.0.0" } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "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" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "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.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } } } }, @@ -6338,6 +6744,16 @@ } } }, + "node-environment-flags": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/node-environment-flags/-/node-environment-flags-1.0.6.tgz", + "integrity": "sha512-5Evy2epuL+6TM0lCQGpFIj6KwiEsGh1SrHUhTbNX+sLbBtjidPZFAnVK9y5yU1+h//RitLbRHTIMyxQPtxMdHw==", + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3", + "semver": "^5.7.0" + } + }, "node-fetch": { "version": "2.6.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", @@ -9086,6 +9502,12 @@ } } }, + "object-inspect": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz", + "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==", + "dev": true + }, "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", @@ -9121,6 +9543,16 @@ "object-keys": "^1.0.11" } }, + "object.getownpropertydescriptors": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.0.tgz", + "integrity": "sha512-Z53Oah9A3TdLoblT7VKJaTDdXdT+lQO+cNpKVnya5JDe9uLvzu1YyY1yFDFrcxrlRgWrEFH0jJtD/IbuwjcEVg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.0-next.1" + } + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -9456,6 +9888,12 @@ "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", "dev": true }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", @@ -10345,6 +10783,28 @@ } } }, + "rollup-plugin-sourcemaps": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-sourcemaps/-/rollup-plugin-sourcemaps-0.6.2.tgz", + "integrity": "sha512-9AwTKg3yRykwzemfLt71ySe0LvrAci+bpsOL1LaTYFk5BX4HF6X7DQfpHa74ANfSja3hyjiQkXCR8goSOnW//Q==", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.9", + "source-map-resolve": "^0.6.0" + }, + "dependencies": { + "source-map-resolve": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.6.0.tgz", + "integrity": "sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0" + } + } + } + }, "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", @@ -11026,6 +11486,48 @@ } } }, + "string.prototype.trimend": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.1.tgz", + "integrity": "sha512-LRPxFUaTtpqYsTeNKaFOw3R4bxIzWOnbQ837QfBylo8jIxtcbK/A/sMV7Q+OAV/vWo+7s25pOE10KYSjaSO06g==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, + "string.prototype.trimleft": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.2.tgz", + "integrity": "sha512-gCA0tza1JBvqr3bfAIFJGqfdRTyPae82+KTnm3coDXkZN9wnuW3HjGgN386D7hfv5CHQYCI022/rJPVlqXyHSw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimstart": "^1.0.0" + } + }, + "string.prototype.trimright": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.2.tgz", + "integrity": "sha512-ZNRQ7sY3KroTaYjRS6EbNiiHrOkjihL9aQE/8gfQ4DtAC/aEBRHFJa44OmoWxGGqXuJlfKkZW4WcXErGr+9ZFg==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5", + "string.prototype.trimend": "^1.0.0" + } + }, + "string.prototype.trimstart": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.1.tgz", + "integrity": "sha512-XxZn+QpvrBI1FOcg6dIpxUPgWCPuNXvMD72aaRaUQv1eD4e/Qy8i/hFTe0BUmD60p/QA6bh1avmuPTfNjqVWRw==", + "dev": true, + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.5" + } + }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", @@ -11151,7 +11653,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", "dev": true }, "source-map-support": { @@ -12256,7 +12758,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", "dev": true, "requires": { "ms": "2.0.0" @@ -12348,7 +12850,7 @@ "is-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", "dev": true, "requires": { "is-accessor-descriptor": "^0.1.6", @@ -12359,7 +12861,7 @@ "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", "dev": true } } @@ -12367,7 +12869,7 @@ "extglob": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", "dev": true, "requires": { "array-unique": "^0.3.2", @@ -12426,7 +12928,7 @@ "is-accessor-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -12435,7 +12937,7 @@ "is-data-descriptor": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", "dev": true, "requires": { "kind-of": "^6.0.0" @@ -12444,7 +12946,7 @@ "is-descriptor": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", "dev": true, "requires": { "is-accessor-descriptor": "^1.0.0", @@ -12487,7 +12989,7 @@ "micromatch": { "version": "3.1.10", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -12614,6 +13116,15 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "dev": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", @@ -12792,6 +13303,159 @@ "decamelize": "^1.2.0" } }, + "yargs-unparser": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-1.6.0.tgz", + "integrity": "sha512-W9tKgmSn0DpSatfri0nx52Joq5hVXgeLiqR/5G0sZNDoLZFOr/xjBUDcShCOGNsBnEMNo1KAMBkTej1Hm62HTw==", + "dev": true, + "requires": { + "flat": "^4.1.0", + "lodash": "^4.17.15", + "yargs": "^13.3.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" + } + }, + "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 + }, + "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.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "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 + }, + "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 + }, + "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" + } + }, + "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" + } + }, + "yargs": { + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", + "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.2" + } + }, + "yargs-parser": { + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } + }, "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", diff --git a/package.json b/package.json index ed2d1501..96e48441 100644 --- a/package.json +++ b/package.json @@ -94,7 +94,7 @@ "karma-mocha": "^1.3.0", "karma-mocha-reporter": "^2.2.5", "karma-webpack": "^3.0.0", - "mocha": "^5.1.1", + "mocha": "^7.1.2", "node-fetch": "^2.0.0", "nyc": "^11.7.3", "prettier": "^2.0.4", @@ -104,6 +104,7 @@ "rollup-plugin-node-builtins": "^2.1.2", "rollup-plugin-node-globals": "^1.4.0", "rollup-plugin-node-resolve": "^5.2.0", + "rollup-plugin-sourcemaps": "^0.6.2", "sinon": "^4.5.0", "sinon-chai": "^2.14.0", "typescript": "^3.6.4", diff --git a/rollup.config.js b/rollup.config.js index e0e21cb0..1f74842b 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -3,6 +3,7 @@ import commonjs from 'rollup-plugin-commonjs'; import builtins from 'rollup-plugin-node-builtins'; import globals from 'rollup-plugin-node-globals'; import json from 'rollup-plugin-json'; +// import sourcemaps from 'rollup-plugin-sourcemaps'; export default [ { @@ -26,6 +27,7 @@ export default [ plugins: [ resolve({ preferBuiltins: true }), commonjs(), + // sourcemaps(), builtins(), globals(), ], diff --git a/test/specs/server-only.test.js b/test/specs/server-only.test.js index 252038ad..b85d8eb5 100644 --- a/test/specs/server-only.test.js +++ b/test/specs/server-only.test.js @@ -7,6 +7,7 @@ module.exports = (fetchMock) => { describe('nodejs only tests', () => { describe('support for nodejs body types', () => { afterEach(() => fetchMock.reset()); + it('can respond with a buffer', () => { fetchMock.mock(/a/, new Buffer('buffer'), { sendAsJson: false }); return fetchMock From a1baad37ca95acc6c53178e6facb766f49d46cc9 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 19:26:32 +0100 Subject: [PATCH 28/29] stop trying to get esm tests to pass for now --- .circleci/config.yml | 8 ++++---- package-lock.json | 6 ------ package.json | 1 - 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 929334a3..e7b8f0c3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -176,10 +176,10 @@ workflows: <<: *triggerable-by-tag requires: - build - - esm: - <<: *triggerable-by-tag - requires: - - build + # - esm: + # <<: *triggerable-by-tag + # requires: + # - build - node10: <<: *triggerable-by-tag requires: diff --git a/package-lock.json b/package-lock.json index c99abcd8..10831ba2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3047,12 +3047,6 @@ "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", "dev": true }, - "esm": { - "version": "3.2.25", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", - "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", - "dev": true - }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", diff --git a/package.json b/package.json index 96e48441..58858faf 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,6 @@ "eslint-config-origami-component": "1.0.0", "eslint-config-prettier": "^2.9.0", "eslint-plugin-prettier": "^2.6.1", - "esm": "^3.2.25", "karma": "^3.1.4", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^2.2.0", From bb525aa60d0e89437e736bb24d5fe7770bfbc330 Mon Sep 17 00:00:00 2001 From: Rhys Evans Date: Sun, 10 May 2020 20:36:54 +0100 Subject: [PATCH 29/29] attempt to fix npm releases --- Makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Makefile b/Makefile index 4cfd8911..7c8572f3 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ export PATH := $(PATH):./node_modules/.bin .PHONY: test docs +SHELL := env "PATH=$(PATH)" /bin/bash NPM_PUBLISH_TAG := $(shell [[ "$(CIRCLE_TAG)" =~ -[a-z-]+ ]] && echo "pre-release" || echo "latest") TEST_BROWSER := $(shell [ -z $(TEST_BROWSER) ] && echo "Chrome" || echo ${TEST_BROWSER}) @@ -53,6 +54,9 @@ build: transpile docs: cd docs; jekyll serve build --watch +la: + @echo $(NPM_PUBLISH_TAG) + publish: echo "//registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}" > ${HOME}/.npmrc npm version --no-git-tag-version $(CIRCLE_TAG)