diff --git a/intern.json b/intern.json index 81d0c1ce..e0d8d25e 100644 --- a/intern.json +++ b/intern.json @@ -1,7 +1,7 @@ { "extends": "./node_modules/@dojo/scripts/intern/base.json", "coverage": [ - "./dist/dev/src/**/*.js" + "./dist/dev/src/**/*.js", "!./dist/dev/src/build-time-render/helpers.js" ], "capabilities+": { "name": "@dojo/webpack-contrib" diff --git a/package-lock.json b/package-lock.json index 3fcee8be..2b4cf844 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,21 +14,23 @@ } }, "@dojo/framework": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@dojo/framework/-/framework-4.0.0.tgz", - "integrity": "sha512-0yNtfIQVBZiI6Ipdsn9cOTsnwfj0NUflHIRqAgbhKv3vCn7rbKiTephJ271SvXn3+6DlXReDWSLJ5LvkeoAvoQ==", + "version": "5.0.0-alpha.1", + "resolved": "https://registry.npmjs.org/@dojo/framework/-/framework-5.0.0-alpha.1.tgz", + "integrity": "sha512-uwK1YxvTI2osTXU1jAe9Sz8cQCm/kBH78Bqz76TrCKnqJjUXF9TRvRcdV9cUaGLI6v6C6oQvoLGJXn08+ErR7w==", "requires": { "@types/cldrjs": "0.4.20", "@types/globalize": "0.0.34", "@webcomponents/webcomponentsjs": "1.1.0", "cldrjs": "0.4.8", "css-select-umd": "1.3.0-rc0", - "diff": "3.4.0", + "diff": "3.5.0", "globalize": "1.3.0", "intersection-observer": "0.4.2", "pepjs": "0.4.2", + "resize-observer-polyfill": "1.5.0", "tslib": "1.8.1", - "web-animations-js": "2.3.1" + "web-animations-js": "2.3.1", + "whatwg-fetch": "2.0.4" } }, "@dojo/has": { @@ -292,9 +294,9 @@ } }, "@types/chai": { - "version": "4.1.6", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.6.tgz", - "integrity": "sha512-CBk7KTZt3FhPsEkYioG6kuCIpWISw+YI8o+3op4+NXwTpvAPxE1ES8+PY8zfaK2L98b1z5oq03UHa4VYpeUxnw==", + "version": "4.1.7", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.7.tgz", + "integrity": "sha512-2Y8uPt0/jwjhQ6EiluT0XCri1Dbplr0ZxfFXUz+ye13gaqE8u5gL5ppao1JrUYr9cIip5S6MvQzBS7Kke7U9VA==", "dev": true }, "@types/charm": { @@ -321,9 +323,9 @@ } }, "@types/diff": { - "version": "3.5.1", - "resolved": "http://registry.npmjs.org/@types/diff/-/diff-3.5.1.tgz", - "integrity": "sha512-nkT7bd/YM6QRDQjww8PYf0kOj1MvwxQ/WaCinj2Hm1HlL+JqGTm4cDoQeROfiWX/B3SNI1nyLLhLAQpp5sE3hw==", + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/@types/diff/-/diff-3.5.2.tgz", + "integrity": "sha512-T1y8ed2DipuUGqgzWzBDUMlJM1bD1CG73ETOi08VURsGArjRfC4nqfeC5owrV7SFvgbeKDbonI/Es4vQgJ2IKA==", "dev": true }, "@types/estree": { @@ -339,9 +341,9 @@ "dev": true }, "@types/express": { - "version": "4.11.1", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.11.1.tgz", - "integrity": "sha512-ttWle8cnPA5rAelauSWeWJimtY2RsUf2aspYZs7xPHiWgOlPn6nnUfBMtrkcnjFJuIHJF4gNOdVvpLK2Zmvh6g==", + "version": "4.16.0", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.16.0.tgz", + "integrity": "sha512-TtPEYumsmSTtTetAPXlJVf3kEqb6wZK0bZojpJQrnD/djV4q1oB6QQ8aKvKqwNPACoe02GNiy5zDzcYivR5Z2w==", "dev": true, "requires": { "@types/body-parser": "*", @@ -369,6 +371,12 @@ "@types/node": "*" } }, + "@types/get-port": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/get-port/-/get-port-4.0.0.tgz", + "integrity": "sha512-Zp1GxOt3GNbIQqz2hSHSH7LALpTPvPHMA/aYut3VeitDgGwqcXEVvDQWWP3kPABsh3CGSHPSt67DN6jnc7oJMA==", + "dev": true + }, "@types/glob": { "version": "5.0.36", "resolved": "https://registry.npmjs.org/@types/glob/-/glob-5.0.36.tgz", @@ -475,9 +483,9 @@ } }, "@types/lodash": { - "version": "4.14.117", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.117.tgz", - "integrity": "sha512-xyf2m6tRbz8qQKcxYZa7PA4SllYcay+eh25DN3jmNYY6gSTL7Htc/bttVdkqj2wfJGbeWlQiX8pIyJpKU+tubw==", + "version": "4.14.118", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.118.tgz", + "integrity": "sha512-iiJbKLZbhSa6FYRip/9ZDX6HXhayXLDGY2Fqws9cOkEQ6XeKfaxB0sC541mowZJueYyMnVUmmG+al5/4fCDrgw==", "dev": true }, "@types/mime": { @@ -615,11 +623,6 @@ "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-1.1.0.tgz", "integrity": "sha512-7toNyVlrl7vJnY3PU0eXIK1KWq8phfnEe1IwOdCMxkIl/BfUkUB2aaVs45R0LSx1qxHRnkqj0vlGtskUvKkNkA==" }, - "abab": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/abab/-/abab-1.0.4.tgz", - "integrity": "sha1-X6rZwsB/YN12dw9xzwJbYqY8/U4=" - }, "accepts": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.5.tgz", @@ -642,36 +645,24 @@ "acorn": "^5.0.0" } }, - "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "requires": { - "acorn": "^6.0.1", - "acorn-walk": "^6.0.1" - }, - "dependencies": { - "acorn": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.0.2.tgz", - "integrity": "sha512-GXmKIvbrN3TV7aVqAzVFaMW8F8wzVX7voEBRO3bDA64+EX37YSayggRJP5Xig6HYHBkWKpFg9W5gg6orklubhg==" - } + "es6-promisify": "^5.0.0" } }, - "acorn-walk": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.0.tgz", - "integrity": "sha512-ugTb7Lq7u4GfWSqqpwE0bGyoBZNMTok/zDBXxfEG0QM50jNlGhIWjRC1pPN7bvV1anhF+bs+/gNcRw+o55Evbg==" - }, "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "version": "6.5.5", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.5.tgz", + "integrity": "sha512-7q7gtRQDJSyuEHjuVgHoUa2VuemFiCMrfQc9Tc08XTAc4Zj/5U1buQJ0HU6i7fKjXU09SVgSmxa4sLvuvS8Iyg==", + "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", + "fast-deep-equal": "^2.0.1", "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, "ajv-keywords": { @@ -707,7 +698,7 @@ }, "ansi-escapes": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", + "resolved": "http://registry.npmjs.org/ansi-escapes/-/ansi-escapes-1.4.0.tgz", "integrity": "sha1-06ioOzGapneTZisT52HHkRQiMG4=", "dev": true }, @@ -787,11 +778,6 @@ "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" }, - "array-equal": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz", - "integrity": "sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM=" - }, "array-filter": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", @@ -850,6 +836,7 @@ "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, "requires": { "safer-buffer": "~2.1.0" } @@ -882,7 +869,7 @@ }, "util": { "version": "0.10.3", - "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "resolved": "http://registry.npmjs.org/util/-/util-0.10.3.tgz", "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", "dev": true, "requires": { @@ -894,7 +881,8 @@ "assert-plus": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true }, "assertion-error": { "version": "1.1.0", @@ -913,21 +901,9 @@ "integrity": "sha1-sTYwDWcCZiWuFTJpgsqZGOXbc8k=" }, "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - }, - "dependencies": { - "lodash": { - "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", - "dev": true - } - } + "version": "1.5.2", + "resolved": "http://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "async-each": { "version": "1.0.1", @@ -942,7 +918,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "atob": { "version": "2.1.2", @@ -1028,12 +1005,14 @@ "aws-sign2": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true }, "aws4": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.8.0.tgz", - "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" + "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==", + "dev": true }, "babel-code-frame": { "version": "6.26.0", @@ -1249,6 +1228,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, "requires": { "tweetnacl": "^0.14.3" } @@ -1294,9 +1274,9 @@ } }, "bluebird": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.2.tgz", - "integrity": "sha512-dhHTWMI7kMx5whMQntl7Vr9C6BvV10lFXDAasnqnrMYhXVCzzk6IO9Fo2L75jXHT07WrOngL1WDXOp+yYS91Yg==" + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.3.tgz", + "integrity": "sha512-/qKPUQlaW1OyR51WeCPBvRnAlnZFUJkCSG5HzGnuIqhgyJtF+T94lFnn33eiazjRm2LAHVy2guNnaq48X9SJuw==" }, "bn.js": { "version": "4.11.8", @@ -1390,11 +1370,6 @@ "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", "dev": true }, - "browser-process-hrtime": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz", - "integrity": "sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw==" - }, "browserify-aes": { "version": "1.2.0", "resolved": "http://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", @@ -1523,6 +1498,11 @@ "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "dev": true }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, "buffer-xor": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", @@ -1604,9 +1584,9 @@ } }, "caniuse-db": { - "version": "1.0.30000899", - "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000899.tgz", - "integrity": "sha512-MSCUohyoLU4/PGapapw/PLQkmQ+sFgzX6e3tM6ue8HX9HW9rBD5gRiAYKhC8r0QkvUE0pWTA8Ze6f3jrzBizVg==", + "version": "1.0.30000910", + "resolved": "https://registry.npmjs.org/caniuse-db/-/caniuse-db-1.0.30000910.tgz", + "integrity": "sha512-eysv5eAsXCBnfnhTZsKBtCZKdgeFaRqOlTN74kCfzdHdz0In3E5Aop7PyqPI757DsdjVwJOWrFHIrTPYzmll6g==", "dev": true }, "capture-stack-trace": { @@ -1617,7 +1597,8 @@ "caseless": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true }, "center-align": { "version": "0.1.3", @@ -1790,7 +1771,7 @@ }, "classnames": { "version": "2.2.5", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.5.tgz", + "resolved": "http://registry.npmjs.org/classnames/-/classnames-2.2.5.tgz", "integrity": "sha1-+zgB1FNGdknvNgPH1hoCvRKb3m0=", "dev": true }, @@ -1848,7 +1829,8 @@ "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", - "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true }, "coa": { "version": "1.0.4", @@ -1911,7 +1893,7 @@ }, "color-string": { "version": "0.3.0", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", + "resolved": "http://registry.npmjs.org/color-string/-/color-string-0.3.0.tgz", "integrity": "sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE=", "dev": true, "requires": { @@ -1930,15 +1912,15 @@ } }, "colors": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/colors/-/colors-1.1.2.tgz", - "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", - "dev": true + "version": "1.0.3", + "resolved": "http://registry.npmjs.org/colors/-/colors-1.0.3.tgz", + "integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=" }, "combined-stream": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -1969,6 +1951,17 @@ "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, "configstore": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/configstore/-/configstore-2.1.0.tgz", @@ -2010,11 +2003,6 @@ "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" }, - "content-type-parser": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/content-type-parser/-/content-type-parser-1.0.2.tgz", - "integrity": "sha512-lM4l4CnMEwOLHAHr/P6MEZwZFPJFtAAKgL6pogbXmVZggIqXhdB6RbBtPOTsw2FcXwYhehRGERJmRrjOiIB8pQ==" - }, "cookie": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", @@ -2052,7 +2040,7 @@ }, "fs-extra": { "version": "0.26.7", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", + "resolved": "http://registry.npmjs.org/fs-extra/-/fs-extra-0.26.7.tgz", "integrity": "sha1-muH92UiXeY7at20JGM9C0MMYT6k=", "requires": { "graceful-fs": "^4.1.2", @@ -2097,6 +2085,11 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "corser": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/corser/-/corser-2.0.1.tgz", + "integrity": "sha1-jtolLsqrWEDc2XXOuQ2TcMgZ/4c=" + }, "cosmiconfig": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-3.1.0.tgz", @@ -2298,9 +2291,9 @@ } }, "postcss-modules-extract-imports": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.0.tgz", - "integrity": "sha1-ZhQOzs447wa/DT41XWm/WdFB6oU=", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/postcss-modules-extract-imports/-/postcss-modules-extract-imports-1.2.1.tgz", + "integrity": "sha512-6jt9XZwUhwmRUhb/CkyJY020PYaPJsCyt3UjbaWo6XEbH/94Hmv6MP7fG2C5NDU/BcHzyGYxNtHvM+LTf9HrYw==", "dev": true, "requires": { "postcss": "^6.0.1" @@ -2403,9 +2396,9 @@ } }, "css-selector-tokenizer": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.0.tgz", - "integrity": "sha1-5piEdK6MlTR3v15+/s/OzNnPTIY=", + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz", + "integrity": "sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==", "requires": { "cssesc": "^0.1.0", "fastparse": "^1.1.1", @@ -2542,19 +2535,6 @@ } } }, - "cssom": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.4.tgz", - "integrity": "sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog==" - }, - "cssstyle": { - "version": "0.2.37", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-0.2.37.tgz", - "integrity": "sha1-VBCXI0yyUTyDzu06zdwn/yeYfVQ=", - "requires": { - "cssom": "0.3.x" - } - }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -2565,7 +2545,7 @@ }, "d": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz", "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "requires": { "es5-ext": "^0.10.9" @@ -2575,6 +2555,7 @@ "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } @@ -2680,6 +2661,15 @@ "yauzl": "^2.4.2" }, "dependencies": { + "fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "dev": true, + "requires": { + "pend": "~1.2.0" + } + }, "file-type": { "version": "3.9.0", "resolved": "http://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", @@ -2695,6 +2685,16 @@ "object-assign": "^4.0.1", "pinkie-promise": "^2.0.0" } + }, + "yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "dev": true, + "requires": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } } } }, @@ -2718,11 +2718,6 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, - "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" - }, "default-require-extensions": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-1.0.0.tgz", @@ -2819,7 +2814,8 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "depd": { "version": "1.1.2", @@ -2850,9 +2846,9 @@ } }, "diff": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.4.0.tgz", - "integrity": "sha512-QpVuMTEoJMF7cKzi6bvWhRulU1fZqZnvyVQgNhPaxxuTYwyjn/j1v9falseQ/uXWwPnO56RBfwtg4h/EQXmucA==" + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==" }, "diffie-hellman": { "version": "5.0.3", @@ -2892,14 +2888,6 @@ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.2.1.tgz", "integrity": "sha512-SQVCLFS2E7G5CRCMdn6K9bIhRj1bS6QBWZfF0TUPh4V/BbqrQ619IdSS3/izn0FZ+9l+uODzaZjb08fjOfablA==" }, - "domexception": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", - "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", - "requires": { - "webidl-conversions": "^4.0.2" - } - }, "domutils": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.5.1.tgz", @@ -2934,20 +2922,39 @@ "version": "0.1.2", "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" } }, + "ecstatic": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/ecstatic/-/ecstatic-3.3.0.tgz", + "integrity": "sha512-EblWYTd+wPIAMQ0U4oYJZ7QBypT9ZUIwpqli0bKDjeIIQnXDBK2dXtZ9yzRCOlkW1HkO8gn7/FxLK1yPIW17pw==", + "requires": { + "he": "^1.1.1", + "mime": "^1.6.0", + "minimist": "^1.1.0", + "url-join": "^2.0.5" + }, + "dependencies": { + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + } + } + }, "ee-first": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" }, "electron-to-chromium": { - "version": "1.3.82", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.82.tgz", - "integrity": "sha512-NI4nB2IWGcU4JVT1AE8kBb/dFor4zjLHMLsOROPahppeHrR0FG5uslxMmkp/thO1MvPjM2xhlKoY29/I60s0ew==", + "version": "1.3.84", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.84.tgz", + "integrity": "sha512-IYhbzJYOopiTaNWMBp7RjbecUBsbnbDneOP86f3qvS0G0xfzwNSvMJpTrvi5/Y1gU7tg2NAgeg8a8rCYvW9Whw==", "dev": true }, "elegant-spinner": { @@ -3087,10 +3094,17 @@ "dev": true }, "es6-promise": { - "version": "3.0.2", - "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", - "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", - "dev": true + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.5.tgz", + "integrity": "sha512-n6wvpdE43VFtJq+lUDYDBFUwV8TZbuGXLV4D6wKafg13ldznKsyEvatubnmUe31zcvelSzOHF+XbaT+Bl9ObDg==" + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "http://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "requires": { + "es6-promise": "^4.0.3" + } }, "es6-set": { "version": "0.1.5", @@ -3135,18 +3149,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", - "requires": { - "esprima": "^3.1.3", - "estraverse": "^4.2.0", - "esutils": "^2.0.2", - "optionator": "^0.8.1", - "source-map": "~0.6.1" - } - }, "escope": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/escope/-/escope-3.6.0.tgz", @@ -3160,9 +3162,9 @@ } }, "esprima": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", - "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" }, "esrecurse": { "version": "4.2.1", @@ -3176,7 +3178,8 @@ "estraverse": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", - "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true }, "esutils": { "version": "2.0.2", @@ -3197,21 +3200,10 @@ "es5-ext": "~0.10.14" } }, - "event-stream": { - "version": "3.3.6", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.6.tgz", - "integrity": "sha512-dGXNg4F/FgVzlApjzItL+7naHutA3fDqbV/zAZqDDlXTjiMnQmZKu+prImWKszeBM5UQeGvAl3u1wBiKeDh61g==", - "dev": true, - "requires": { - "duplexer": "^0.1.1", - "flatmap-stream": "^0.1.0", - "from": "^0.1.7", - "map-stream": "0.0.7", - "pause-stream": "^0.0.11", - "split": "^1.0.1", - "stream-combiner": "^0.2.2", - "through": "^2.3.8" - } + "eventemitter3": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.0.tgz", + "integrity": "sha512-ivIvhpq/Y0uSjcHDcOIccjmYjGLcP09MFGE7ysAwkAvkXfpZlC985pH2/ui64DKazbTW/4kN3yqozUxlXzI6cA==" }, "events": { "version": "1.1.1", @@ -3259,7 +3251,7 @@ }, "expand-range": { "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "requires": { "fill-range": "^2.1.0" @@ -3332,7 +3324,8 @@ "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true }, "extend-shallow": { "version": "3.0.2", @@ -3368,36 +3361,44 @@ } } }, + "extract-zip": { + "version": "1.6.7", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.6.7.tgz", + "integrity": "sha1-qEC0uK9kAyZMjbV/Txp0Mz74H+k=", + "requires": { + "concat-stream": "1.6.2", + "debug": "2.6.9", + "mkdirp": "0.5.1", + "yauzl": "2.4.1" + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", + "dev": true }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", - "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true }, "fastparse": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.1.tgz", - "integrity": "sha1-0eJkOzipTXWDtHkGDmxK/8lAcfg=" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/fastparse/-/fastparse-1.1.2.tgz", + "integrity": "sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ==" }, "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "dev": true, + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.0.1.tgz", + "integrity": "sha1-i1vL2ewyfFBBv5qwI/1nUPEXfmU=", "requires": { "pend": "~1.2.0" } @@ -3492,18 +3493,30 @@ "pinkie-promise": "^2.0.0" } }, - "flatmap-stream": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/flatmap-stream/-/flatmap-stream-0.1.1.tgz", - "integrity": "sha512-lAq4tLbm3sidmdCN8G3ExaxH7cUCtP5mgDvrYowsx84dcYkJJ4I28N7gkxA6+YlSXzaGLJYIDEi9WGfXzMiXdw==", - "dev": true - }, "flatten": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/flatten/-/flatten-1.0.2.tgz", "integrity": "sha1-2uRqnXj74lKSJYzB54CkHZXAN4I=", "dev": true }, + "follow-redirects": { + "version": "1.5.10", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz", + "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==", + "requires": { + "debug": "=3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -3520,12 +3533,14 @@ "forever-agent": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true }, "form-data": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.6", @@ -3550,12 +3565,6 @@ "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true - }, "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", @@ -4077,6 +4086,11 @@ "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.0.tgz", "integrity": "sha512-CIJYJC4GGF06TakLg8z4GQKvDsx9EMspVxOYih7LerEL/WosUnFIww45CGfxfeKHqlg3twgUrYRT1O3WQqjGCg==" }, + "get-port": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-4.0.0.tgz", + "integrity": "sha512-Yy3yNI2oShgbaWg4cmPhWjkZfktEvpKI09aDX4PZzNtlU9obuYrX7x2mumQsrNxlF+Ls7OtMQW/u+X4s896bOQ==" + }, "get-stdin": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", @@ -4096,13 +4110,14 @@ "version": "0.1.7", "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, "requires": { "assert-plus": "^1.0.0" } }, "git-config-path": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/git-config-path/-/git-config-path-1.0.1.tgz", "integrity": "sha1-bTP37WPbDQ4RgTFQO6s6ykfVRmQ=", "dev": true, "requires": { @@ -4206,7 +4221,7 @@ }, "globby": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "resolved": "http://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { @@ -4240,9 +4255,9 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" }, "graceful-readlink": { "version": "1.0.1", @@ -4276,19 +4291,38 @@ "optimist": "^0.6.1", "source-map": "^0.6.1", "uglify-js": "^3.1.4" + }, + "dependencies": { + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } } }, "har-schema": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true }, "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", + "dev": true, "requires": { - "ajv": "^5.3.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, @@ -4394,6 +4428,11 @@ "minimalistic-assert": "^1.0.1" } }, + "he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" + }, "hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -4407,7 +4446,7 @@ }, "hoek": { "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "resolved": "http://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" }, "homedir-polyfill": { @@ -4430,14 +4469,6 @@ "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", "dev": true }, - "html-encoding-sniffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz", - "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==", - "requires": { - "whatwg-encoding": "^1.0.1" - } - }, "html-webpack-include-assets-plugin": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/html-webpack-include-assets-plugin/-/html-webpack-include-assets-plugin-1.0.2.tgz", @@ -4466,10 +4497,36 @@ } } }, + "http-proxy": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.17.0.tgz", + "integrity": "sha512-Taqn+3nNvYRfJ3bGvKfBSRwy1v6eePlm3oc/aWVxZp57DQr5Eq3xhKJi7Z4hZpS8PC3H4qI+Yly5EmFacGuA/g==", + "requires": { + "eventemitter3": "^3.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + } + }, + "http-server": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/http-server/-/http-server-0.11.1.tgz", + "integrity": "sha512-6JeGDGoujJLmhjiRGlt8yK8Z9Kl0vnl/dQoQZlc4oeqaUoAKQg94NILLfrY3oWzSyFaQCVNTcKE5PZ3cH8VP9w==", + "requires": { + "colors": "1.0.3", + "corser": "~2.0.0", + "ecstatic": "^3.0.0", + "http-proxy": "^1.8.1", + "opener": "~1.4.0", + "optimist": "0.6.x", + "portfinder": "^1.0.13", + "union": "~0.4.3" + } + }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "jsprim": "^1.2.2", @@ -4482,6 +4539,30 @@ "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", "dev": true }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "requires": { + "agent-base": "^4.1.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "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==" + } + } + }, "husky": { "version": "0.14.3", "resolved": "https://registry.npmjs.org/husky/-/husky-0.14.3.tgz", @@ -4648,11 +4729,16 @@ "ws": "~5.1.1" }, "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "@types/express": { + "version": "4.11.1", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.11.1.tgz", + "integrity": "sha512-ttWle8cnPA5rAelauSWeWJimtY2RsUf2aspYZs7xPHiWgOlPn6nnUfBMtrkcnjFJuIHJF4gNOdVvpLK2Zmvh6g==", + "dev": true, + "requires": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "*", + "@types/serve-static": "*" + } }, "express": { "version": "4.16.4", @@ -5184,7 +5270,8 @@ "is-typedarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true }, "is-utf8": { "version": "0.2.1", @@ -5207,13 +5294,6 @@ "integrity": "sha512-zKqkK+O+dGqevc93KNsbZ/TqTUFd46MwWjYOoMrjIMZ51eU7DtQG3Wmd9SQQT7i7RVnuTPEiYEWHU3MSbxC1Tg==", "requires": { "punycode": "2.x.x" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" - } } }, "isexe": { @@ -5232,7 +5312,8 @@ "isstream": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true }, "istanbul-lib-coverage": { "version": "1.2.1", @@ -5383,57 +5464,17 @@ "requires": { "argparse": "^1.0.7", "esprima": "^4.0.0" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true - } } }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" - }, - "jsdom": { - "version": "11.6.2", - "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.6.2.tgz", - "integrity": "sha512-pAeZhpbSlUp5yQcS6cBQJwkbzmv4tWFaYxHbFVSxzXefqjvtRA851Z5N2P+TguVG9YeUDcgb8pdeVQRJh0XR3Q==", - "requires": { - "abab": "^1.0.4", - "acorn": "^5.3.0", - "acorn-globals": "^4.1.0", - "array-equal": "^1.0.0", - "browser-process-hrtime": "^0.1.2", - "content-type-parser": "^1.0.2", - "cssom": ">= 0.3.2 < 0.4.0", - "cssstyle": ">= 0.2.37 < 0.3.0", - "domexception": "^1.0.0", - "escodegen": "^1.9.0", - "html-encoding-sniffer": "^1.0.2", - "left-pad": "^1.2.0", - "nwmatcher": "^1.4.3", - "parse5": "4.0.0", - "pn": "^1.1.0", - "request": "^2.83.0", - "request-promise-native": "^1.0.5", - "sax": "^1.2.4", - "symbol-tree": "^3.2.2", - "tough-cookie": "^2.3.3", - "w3c-hr-time": "^1.0.1", - "webidl-conversions": "^4.0.2", - "whatwg-encoding": "^1.0.3", - "whatwg-url": "^6.4.0", - "ws": "^4.0.0", - "xml-name-validator": "^3.0.0" - } + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true }, "jsesc": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=" }, "json-loader": { @@ -5451,12 +5492,14 @@ "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", - "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "json-stable-stringify": { "version": "1.0.1", @@ -5469,7 +5512,8 @@ "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true }, "json5": { "version": "0.5.1", @@ -5493,6 +5537,7 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, "requires": { "assert-plus": "1.0.0", "extsprintf": "1.3.0", @@ -5515,10 +5560,16 @@ "dependencies": { "core-js": { "version": "2.3.0", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", + "resolved": "http://registry.npmjs.org/core-js/-/core-js-2.3.0.tgz", "integrity": "sha1-+rg/uwstjchfpjbEudNMdUIMbWU=", "dev": true }, + "es6-promise": { + "version": "3.0.2", + "resolved": "http://registry.npmjs.org/es6-promise/-/es6-promise-3.0.2.tgz", + "integrity": "sha1-AQ1YWEI6XxGJeWZfRkhqlcbuK7Y=", + "dev": true + }, "process-nextick-args": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", @@ -5591,26 +5642,12 @@ "invert-kv": "^1.0.0" } }, - "left-pad": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz", - "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==" - }, "leven": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-2.1.0.tgz", "integrity": "sha1-wuep93IJTe6dNCAq6KzORoeHVYA=", "dev": true }, - "levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", - "requires": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - } - }, "lie": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/lie/-/lie-3.1.1.tgz", @@ -5937,11 +5974,6 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, - "lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=" - }, "lodash.template": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.4.0.tgz", @@ -6019,12 +6051,12 @@ "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==" }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.4.tgz", + "integrity": "sha512-EPstzZ23znHUVLKj+lcXO1KvZkrlw+ZirdwvOmnAnA/1PB4ggyXJ77LRkCqkff+ShQ+cqoxCxLQOh4cKITO5iA==", "requires": { "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } }, "make-dir": { @@ -6054,12 +6086,6 @@ "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=" }, - "map-stream": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.0.7.tgz", - "integrity": "sha1-ih8HiW2CsQkmvTdEokIACfiJdKg=", - "dev": true - }, "map-visit": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", @@ -6354,7 +6380,7 @@ }, "next-tick": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz", "integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=" }, "nice-try": { @@ -6457,12 +6483,18 @@ "ieee754": "^1.1.4", "isarray": "^1.0.0" } + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, "node-status-codes": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-status-codes/-/node-status-codes-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/node-status-codes/-/node-status-codes-1.0.0.tgz", "integrity": "sha1-WuVUHQJGRdMqWPzdyc7s6nrjrC8=" }, "normalize-newline": { @@ -6518,22 +6550,33 @@ } }, "npm-run-all": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.3.tgz", - "integrity": "sha512-aOG0N3Eo/WW+q6sUIdzcV2COS8VnTZCmdji0VQIAZF3b+a3YWb0AD0vFIyjKec18A7beLGbaQ5jFTNI2bPt9Cg==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/npm-run-all/-/npm-run-all-4.1.5.tgz", + "integrity": "sha512-Oo82gJDAVcaMdi3nuoKFavkIHBRVqQ1qvMb+9LHk/cF4P6B2m8aP04hGf7oL6wZ9BuGwX1onlLhpuoofSyoQDQ==", "dev": true, "requires": { - "ansi-styles": "^3.2.0", - "chalk": "^2.1.0", - "cross-spawn": "^6.0.4", + "ansi-styles": "^3.2.1", + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", "memorystream": "^0.3.1", "minimatch": "^3.0.4", - "ps-tree": "^1.1.0", + "pidtree": "^0.3.0", "read-pkg": "^3.0.0", "shell-quote": "^1.6.1", "string.prototype.padend": "^3.0.0" }, "dependencies": { + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -6547,6 +6590,12 @@ "which": "^1.2.9" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -6600,6 +6649,15 @@ "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true + }, + "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" + } } } }, @@ -6641,15 +6699,11 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, - "nwmatcher": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/nwmatcher/-/nwmatcher-1.4.4.tgz", - "integrity": "sha512-3iuY4N5dhgMpCUrOVnuAdGrgxVqV2cJpM+XNccjR2DKOB1RUP0aA+wGXEiNziG/UKboFyGBIoKOaNlJxx8bciQ==" - }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==" + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true }, "object-assign": { "version": "4.1.1", @@ -6752,7 +6806,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", - "dev": true, "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" @@ -6761,30 +6814,10 @@ "minimist": { "version": "0.0.10", "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=", - "dev": true - }, - "wordwrap": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=", - "dev": true + "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" } } }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "requires": { - "deep-is": "~0.1.3", - "fast-levenshtein": "~2.0.4", - "levn": "~0.3.0", - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2", - "wordwrap": "~1.0.0" - } - }, "ora": { "version": "0.2.3", "resolved": "http://registry.npmjs.org/ora/-/ora-0.2.3.tgz", @@ -6832,7 +6865,7 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" }, "os-locale": { @@ -6847,7 +6880,7 @@ }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, "osenv": { @@ -6972,11 +7005,6 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=", "dev": true }, - "parse5": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz", - "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==" - }, "parseurl": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", @@ -7009,7 +7037,7 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -7050,15 +7078,6 @@ "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=", "dev": true }, - "pause-stream": { - "version": "0.0.11", - "resolved": "http://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", - "dev": true, - "requires": { - "through": "~2.3" - } - }, "pbkdf2": { "version": "3.0.17", "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.17.tgz", @@ -7075,8 +7094,7 @@ "pend": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", - "dev": true + "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" }, "pepjs": { "version": "0.4.2", @@ -7086,7 +7104,14 @@ "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "pidtree": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.3.0.tgz", + "integrity": "sha512-9CT4NFlDcosssyg8KVFltgokyKZIFjoBxw8CTGy+5F38Y1eQWrt8tRayiUOXE+zVKQnYu5BR8JjCtvK3BcnBhg==", + "dev": true }, "pify": { "version": "2.3.0", @@ -7112,10 +7137,15 @@ "integrity": "sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==", "dev": true }, - "pn": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", - "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==" + "portfinder": { + "version": "1.0.19", + "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.19.tgz", + "integrity": "sha512-23aeQKW9KgHe6citUrG3r9HjeX6vls0h713TAa+CwTKZwNIr/pD2ApaxYF4Um3ZZyq4ar+Siv3+fhoHaIwSOSw==", + "requires": { + "async": "^1.5.2", + "debug": "^2.2.0", + "mkdirp": "0.5.x" + } }, "posix-character-classes": { "version": "0.1.1", @@ -9044,11 +9074,6 @@ } } }, - "prelude-ls": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", - "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=" - }, "prepend-http": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-1.0.4.tgz", @@ -9067,7 +9092,7 @@ }, "pretty-bytes": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=" }, "pretty-format": { @@ -9104,6 +9129,11 @@ "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, + "progress": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.1.tgz", + "integrity": "sha512-OE+a6vzqazc+K6LxJrX5UPyKFvGnL5CYmq2jFGNIBWHpc4QyE49/YOumcrpQFJpfejmvRtbJzgO1zPmMCqlbBg==" + }, "proxy-addr": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", @@ -9113,20 +9143,16 @@ "ipaddr.js": "1.8.0" } }, + "proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4=" + }, "prr": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, - "ps-tree": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.1.0.tgz", - "integrity": "sha1-tCGyQUDWID8e08dplrRCewjowBQ=", - "dev": true, - "requires": { - "event-stream": "~3.3.0" - } - }, "pseudomap": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", @@ -9135,7 +9161,8 @@ "psl": { "version": "1.1.29", "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==" + "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "dev": true }, "public-encrypt": { "version": "4.0.3", @@ -9160,9 +9187,44 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "puppeteer": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-1.10.0.tgz", + "integrity": "sha512-3i28X/ucX8t3eL4TZA60FLMOQNKqudFSOGDHr0cT7T4dE027CrcS885aAqjdxNybhMPliM5yImNsKJ6SQrPzhw==", + "requires": { + "debug": "^3.1.0", + "extract-zip": "^1.6.6", + "https-proxy-agent": "^2.2.1", + "mime": "^2.0.3", + "progress": "^2.0.0", + "proxy-from-env": "^1.0.0", + "rimraf": "^2.6.1", + "ws": "^5.1.1" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "mime": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.3.1.tgz", + "integrity": "sha512-OEUllcVoydBHGN1z84yfQDimn58pZNNNXgZlHXSboxMlFvgI6MXSWpWKpFRra7H1HxpVhHTkrghfRW49k6yjeg==" + }, + "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==" + } + } }, "q": { "version": "1.5.1", @@ -9600,13 +9662,6 @@ "esprima": "~4.0.0", "private": "~0.1.5", "source-map": "~0.6.1" - }, - "dependencies": { - "esprima": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" - } } }, "rechoir": { @@ -9719,12 +9774,12 @@ }, "regjsgen": { "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", + "resolved": "http://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" }, "regjsparser": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", + "resolved": "http://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", "requires": { "jsesc": "~0.5.0" @@ -9732,7 +9787,7 @@ "dependencies": { "jsesc": { "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "resolved": "http://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" } } @@ -9764,6 +9819,7 @@ "version": "2.88.0", "resolved": "https://registry.npmjs.org/request/-/request-2.88.0.tgz", "integrity": "sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==", + "dev": true, "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.8.0", @@ -9790,38 +9846,23 @@ "qs": { "version": "6.5.2", "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", - "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true }, "uuid": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true } } }, - "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", - "requires": { - "lodash": "^4.13.1" - } - }, - "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", - "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" - } - }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -9838,6 +9879,16 @@ "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, + "requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=" + }, + "resize-observer-polyfill": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/resize-observer-polyfill/-/resize-observer-polyfill-1.5.0.tgz", + "integrity": "sha512-M2AelyJDVR/oLnToJLtuDJRBBWUGUvvGigj1411hXhAdyFWqMaqHp7TixW3FpiLuVaikIcR1QL+zqoJoZlOgpg==" + }, "resolve": { "version": "1.7.1", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", @@ -9910,7 +9961,7 @@ }, "safe-regex": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "resolved": "http://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "requires": { "ret": "~0.1.10" @@ -9919,7 +9970,8 @@ "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true }, "samsam": { "version": "1.3.0", @@ -9930,7 +9982,8 @@ "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "dev": true }, "schema-utils": { "version": "0.4.7", @@ -9940,32 +9993,6 @@ "requires": { "ajv": "^6.1.0", "ajv-keywords": "^3.1.0" - }, - "dependencies": { - "ajv": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.4.tgz", - "integrity": "sha512-4Wyjt8+t6YszqaXnLDfMmG/8AlO5Zbcsy3ATHncCzjW/NoPzAId8AK6749Ybjmdt+kUY1gP60fCu46oDxPv/mg==", - "dev": true, - "requires": { - "fast-deep-equal": "^2.0.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "fast-deep-equal": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", - "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", - "dev": true - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - } } }, "seek-bzip": { @@ -10105,9 +10132,9 @@ } }, "shelljs": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.2.tgz", - "integrity": "sha512-pRXeNrCA2Wd9itwhvLp5LZQvPJ0wU6bcjaTMywHHGX5XWhVN2nzSu7WV0q+oUY7mGK3mgSkDDzP3MgjqdyIgbQ==", + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.3.tgz", + "integrity": "sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==", "dev": true, "requires": { "glob": "^7.0.0", @@ -10342,18 +10369,9 @@ } }, "spdx-license-ids": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.1.tgz", - "integrity": "sha512-TfOfPcYGBB5sDuPn3deByxPhmfegAhpDYKSOXZQN81Oyrrif8ZCodOLzK3AesELnCx03kikhyDwh0pfvvQvF8w==" - }, - "split": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", - "dev": true, - "requires": { - "through": "2" - } + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.2.tgz", + "integrity": "sha512-qky9CVt0lVIECkEsYbNILVnPvycuEBkXoMFLRWsREkomQLevYhtRKC+R91a5TOAQ3bCMjikRwhyaRqj1VYatYg==" }, "split-string": { "version": "3.1.0", @@ -10370,9 +10388,10 @@ "dev": true }, "sshpk": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.1.tgz", - "integrity": "sha512-mSdgNUaidk+dRU5MhYtN9zebdzF2iG0cNPWy8HG+W8y+fT1JnSkh0fzzpjOa0L7P8i1Rscz38t0h4gPcKz43xA==", + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.15.2.tgz", + "integrity": "sha512-Ra/OXQtuh0/enyl4ETZAfTaeksa6BXks5ZcjpSUNrjBr0DvrJKX+1fsKDPpT9TBXgHAFsa4510aNVgI8g/+SzA==", + "dev": true, "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -10393,7 +10412,7 @@ }, "staged-git-files": { "version": "0.0.4", - "resolved": "https://registry.npmjs.org/staged-git-files/-/staged-git-files-0.0.4.tgz", + "resolved": "http://registry.npmjs.org/staged-git-files/-/staged-git-files-0.0.4.tgz", "integrity": "sha1-15fhtVHKemOd7AI33G60u5vhfTU=", "dev": true }, @@ -10421,14 +10440,9 @@ "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.3.1.tgz", "integrity": "sha1-+vUbnrdKrvOzrPStX2Gr8ky3uT4=" }, - "stealthy-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", - "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=" - }, "stream-browserify": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "resolved": "http://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { @@ -10436,16 +10450,6 @@ "readable-stream": "^2.0.2" } }, - "stream-combiner": { - "version": "0.2.2", - "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", - "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", - "dev": true, - "requires": { - "duplexer": "~0.1.1", - "through": "~2.3.4" - } - }, "stream-combiner2": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz", @@ -10559,7 +10563,7 @@ }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "resolved": "http://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-indent": { @@ -10624,6 +10628,12 @@ "whet.extend": "~0.9.9" }, "dependencies": { + "colors": { + "version": "1.1.2", + "resolved": "http://registry.npmjs.org/colors/-/colors-1.1.2.tgz", + "integrity": "sha1-FopHAXVran9RoSzgyXv6KMCE7WM=", + "dev": true + }, "esprima": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", @@ -10648,11 +10658,6 @@ "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=", "dev": true }, - "symbol-tree": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", - "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=" - }, "tapable": { "version": "0.2.8", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.2.8.tgz", @@ -10756,7 +10761,7 @@ }, "topo": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/topo/-/topo-2.0.2.tgz", + "resolved": "http://registry.npmjs.org/topo/-/topo-2.0.2.tgz", "integrity": "sha1-zVYVdSU5BXwNwEkaYhw7xvvh0YI=", "requires": { "hoek": "4.x.x" @@ -10766,23 +10771,17 @@ "version": "2.4.3", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, "requires": { "psl": "^1.1.24", "punycode": "^1.4.1" - } - }, - "tr46": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", - "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", - "requires": { - "punycode": "^2.1.0" }, "dependencies": { "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true } } }, @@ -10865,6 +10864,7 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, "requires": { "safe-buffer": "^5.0.1" } @@ -10872,15 +10872,8 @@ "tweetnacl": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=" - }, - "type-check": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", - "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", - "requires": { - "prelude-ls": "~1.1.2" - } + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true }, "type-detect": { "version": "4.0.8", @@ -10919,6 +10912,11 @@ } } }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, "typescript": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.2.tgz", @@ -11027,6 +11025,21 @@ "through": "^2.3.6" } }, + "union": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/union/-/union-0.4.6.tgz", + "integrity": "sha1-GY+9rrolTniLDvy2MLwR8kopWeA=", + "requires": { + "qs": "~2.3.3" + }, + "dependencies": { + "qs": { + "version": "2.3.3", + "resolved": "http://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=" + } + } + }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -11179,14 +11192,6 @@ "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, "urix": { @@ -11212,6 +11217,11 @@ } } }, + "url-join": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/url-join/-/url-join-2.0.5.tgz", + "integrity": "sha1-WvIvGMBSoACkjXuCxenC4v7tpyg=" + }, "url-parse-lax": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-1.0.0.tgz", @@ -11279,6 +11289,7 @@ "version": "1.10.0", "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, "requires": { "assert-plus": "^1.0.0", "core-util-is": "1.0.2", @@ -11294,14 +11305,6 @@ "indexof": "0.0.1" } }, - "w3c-hr-time": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz", - "integrity": "sha1-gqwr/2PZUOqeMYmlimViX+3xkEU=", - "requires": { - "browser-process-hrtime": "^0.1.2" - } - }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", @@ -11655,11 +11658,6 @@ "resolved": "https://registry.npmjs.org/web-animations-js/-/web-animations-js-2.3.1.tgz", "integrity": "sha1-Om2bwVGWN3qQ+OKAP6UmIWWwRRA=" }, - "webidl-conversions": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", - "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==" - }, "webpack": { "version": "3.8.1", "resolved": "https://registry.npmjs.org/webpack/-/webpack-3.8.1.tgz", @@ -11707,12 +11705,51 @@ } } }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, "ajv-keywords": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", "dev": true }, + "async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", + "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", + "dev": true, + "requires": { + "lodash": "^4.17.10" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "http://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -11731,33 +11768,10 @@ "source-map": "~0.6.1" } }, - "whatwg-encoding": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", - "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", - "requires": { - "iconv-lite": "0.4.24" - }, - "dependencies": { - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - } - } - }, - "whatwg-url": { - "version": "6.5.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz", - "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==", - "requires": { - "lodash.sortby": "^4.7.0", - "tr46": "^1.0.1", - "webidl-conversions": "^4.0.2" - } + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==" }, "whet.extend": { "version": "0.9.9", @@ -11793,9 +11807,9 @@ "dev": true }, "wordwrap": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", - "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=" + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" }, "workbox-background-sync": { "version": "3.6.3", @@ -11981,12 +11995,11 @@ } }, "ws": { - "version": "4.1.0", - "resolved": "http://registry.npmjs.org/ws/-/ws-4.1.0.tgz", - "integrity": "sha512-ZGh/8kF9rrRNffkLFV4AzhvooEclrOH0xaugmqGsIfFgOE/pIz4fMc4Ef+5HSQqTEug2S9JZIWDR47duDSLfaA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.2.tgz", + "integrity": "sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA==", "requires": { - "async-limiter": "~1.0.0", - "safe-buffer": "~5.1.0" + "async-limiter": "~1.0.0" } }, "xdg-basedir": { @@ -11997,11 +12010,6 @@ "os-homedir": "^1.0.0" } }, - "xml-name-validator": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", - "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==" - }, "xtend": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", @@ -12014,9 +12022,9 @@ "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" }, "yallist": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", + "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==" }, "yargs": { "version": "8.0.2", @@ -12139,13 +12147,11 @@ } }, "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "dev": true, + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.4.1.tgz", + "integrity": "sha1-lSj0QtqxsihOWLQ3m7GU4i4MQAU=", "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "fd-slicer": "~1.0.1" } } } diff --git a/package.json b/package.json index 47aa6c1b..c3225ec8 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,7 @@ "watch": "run-p watch:ts \"build:static:** -- --watch\"" }, "dependencies": { - "@dojo/framework": "^4.0.0", + "@dojo/framework": "next", "acorn": "5.3.0", "acorn-dynamic-import": "3.0.0", "bfj-node4": "5.2.0", @@ -53,16 +53,18 @@ "express": "4.16.2", "filesize": "3.5.11", "filter-css": "0.1.2", - "fs-extra": "^7.0.0", + "fs-extra": "7.0.0", + "get-port": "4.0.0", "glob": "^7.1.2", "gzip-size": "4.1.0", "html-webpack-include-assets-plugin": "1.0.2", + "http-server": "0.11.1", "istanbul-lib-instrument": "1.10.1", - "jsdom": "11.6.2", "loader-utils": "1.1.0", "lodash": "4.17.4", "mkdirp": "0.5.1", "opener": "1.4.3", + "puppeteer": "1.10.0", "recast": "0.12.7", "source-map": "0.6.1", "ts-loader": "3.1.1", @@ -73,7 +75,9 @@ "@dojo/scripts": "~3.0.1", "@types/acorn": "^4.0.3", "@types/estree": "0.0.37", + "@types/express": "^4.16.0", "@types/fs-extra": "^5.0.4", + "@types/get-port": "^4.0.0", "@types/glob": "^5.0.35", "@types/gzip-size": "^4.1.0", "@types/loader-utils": "^1.1.3", diff --git a/src/build-time-render/BuildTimeRender.ts b/src/build-time-render/BuildTimeRender.ts index cfa2a5bd..c223f367 100644 --- a/src/build-time-render/BuildTimeRender.ts +++ b/src/build-time-render/BuildTimeRender.ts @@ -1,15 +1,25 @@ import { Compiler } from 'webpack'; -import { readFileSync, writeFileSync, existsSync } from 'fs'; -import * as path from 'path'; - -const jsdom = require('jsdom'); -const { JSDOM } = jsdom; - -declare global { - interface Window { - eval: Function; - NodeFilter: any; - } +import { readFileSync, outputFileSync, existsSync } from 'fs-extra'; + +import { join } from 'path'; +import { + serve, + navigate, + getClasses, + getPrefix, + generateBasePath, + generateRouteInjectionScript, + getForSelector, + setHasFlags +} from './helpers'; +const filterCss = require('filter-css'); +const puppeteer = require('puppeteer'); + +export interface RenderResult { + path?: string | BuildTimePath; + html: string; + styles: string; + script: string; } export interface BuildTimePath { @@ -22,162 +32,206 @@ export interface BuildTimeRenderArguments { entries: string[]; useManifest?: boolean; paths?: (BuildTimePath | string)[]; + useHistory?: boolean; + puppeteerOptions?: any; } -class BuildTimeRender { +export default class BuildTimeRender { private _paths: any[]; - private _disabled = false; - private _root: string; - private _entries: string[]; private _useManifest: boolean; - private _hasPaths: boolean; - private _btrRoot: string; + private _manifest: any; + private _entries: string[]; + private _root: string; + private _output?: string; + private _cssFiles: string[] = []; + private _useHistory = false; + private _inlinedCssClassNames: string[] = []; + private _head: string; + private _puppeteerOptions: any; constructor(args: BuildTimeRenderArguments) { - const { paths = [], root = '', useManifest = false, entries } = args; - this._paths = ['', ...paths]; - this._hasPaths = paths.length > 0; + const { paths = [], root = '', useManifest = false, entries, useHistory, puppeteerOptions } = args; + const path = paths[0]; + const initialPath = typeof path === 'object' ? path.path : path; + + this._puppeteerOptions = puppeteerOptions; + this._paths = paths; this._root = root; - this._entries = entries; this._useManifest = useManifest; - if (root === '') { - this._disabled = true; - } + this._entries = entries.map((entry) => `${entry.replace('.js', '')}.js`); + this._manifest = this._entries.reduce( + (manifest, entry) => { + manifest[entry] = entry; + return manifest; + }, + {} as any + ); + this._useHistory = useHistory !== undefined ? useHistory : paths.length > 0 && !/^#.*/.test(initialPath); } - private _render(compiler: Compiler, location: string, htmlContent: string, root: string, output: string) { - const window: Window = new JSDOM(htmlContent, { runScripts: 'outside-only', pretendToBeVisual: true }).window; - const document: Document = window.document; - const parent = document.getElementById(root)!; - if (!this._btrRoot) { - this._btrRoot = parent.outerHTML; + private _writeIndexHtml({ html, script, path = '', styles }: RenderResult) { + path = typeof path === 'object' ? path.path : path; + const prefix = getPrefix(path); + if (this._head) { + html = html.replace(/([\s\S]*?)<\/head>/gm, this._head); } - let manifest: any = {}; - if (this._useManifest) { - manifest = JSON.parse(readFileSync(path.join(output, 'manifest.json'), 'utf-8')); - } - window.eval(` -window.location.hash = '${location}'; -window.DojoHasEnvironment = { staticFeatures: { 'build-time-render': true } };`); - - this._entries.forEach((entry) => { - entry = this._useManifest ? manifest[`${entry}.js`] : `${entry}.js`; - const entryContent = readFileSync(path.join(output, entry), 'utf-8'); - window.eval(entryContent); - }); + const css = this._cssFiles.reduce((css, entry: string | undefined) => { + html = html.replace(``, ``); + css = `${css}`; + return css; + }, ''); + + html = html.replace(/^(\s*)(\r\n?|\n)/gm, '').trim(); + html = html.replace(this._createScripts(path), `${script}${css}${this._createScripts(path)}`); + outputFileSync(join(this._output!, ...path.split('/'), 'index.html'), html); + } - const treeWalker = document.createTreeWalker(document.body, window.NodeFilter.SHOW_ELEMENT); - let classes: string[] = []; + private _createScripts(path = '') { + const prefix = this._useHistory ? getPrefix(path) : ''; + return this._entries.reduce( + (script, entry) => + `${script}`, + '' + ); + } - while (treeWalker.nextNode()) { - const node = treeWalker.currentNode as HTMLElement; - node.classList.length && classes.push.apply(classes, node.classList); - } + private _filterCss(classes: string[]): string { + return this._cssFiles.reduce((result, entry: string) => { + let filteredCss: string = filterCss(join(this._output!, entry), (context: string, value: string) => { + if (context === 'selector') { + value = value.replace(/(:| ).*/, ''); + value = value + .split('.') + .slice(0, 2) + .join('.'); + const firstChar = value.substr(0, 1); + if (!this._useHistory && this._inlinedCssClassNames.indexOf(value) !== -1) { + return true; + } + if (classes.indexOf(value) !== -1 || ['.', '#'].indexOf(firstChar) === -1) { + this._inlinedCssClassNames.push(value); + return false; + } + return true; + } + }); - classes = classes.map((className) => `.${className}`); - return { html: parent.outerHTML, classes }; + filteredCss = filteredCss + .replace(/\/\*.*\*\//g, '') + .replace(/^(\s*)(\r\n?|\n)/gm, '') + .trim(); + result = `${result}${filteredCss}`; + return result; + }, ''); + } + + private async _getRenderResult( + page: any, + path: BuildTimePath | string | undefined = undefined, + allContents = true + ): Promise { + const classes: any[] = await getClasses(page); + let pathValue = typeof path === 'object' ? path.path : path; + let html = allContents ? await page.content() : await getForSelector(page, `#${this._root}`); + let styles = this._filterCss(classes); + let script = ''; + html = html.replace(/http:\/\/localhost:\d+\//g, ''); + if (this._useHistory) { + styles = styles.replace(/url\("(?!(http(s)?|\/))(.*?)"/g, `url("${getPrefix(pathValue)}$3"`); + html = html.replace(/src="(?!(http(s)?|\/))(.*?)"/g, `src="${getPrefix(pathValue)}$3"`); + script = generateBasePath(pathValue); + } + return { html, styles, script, path }; } public apply(compiler: Compiler) { - if (this._disabled) { + if (!this._root) { return; } - compiler.plugin('done', () => { - const output = compiler.options.output && compiler.options.output.path; - if (!output) { - return; + compiler.plugin('after-emit', async (compilation, callback) => { + this._output = compiler.options.output && compiler.options.output.path; + if (!this._output) { + return Promise.resolve().then(() => { + callback(); + }); } - let htmlContent = readFileSync(path.join(output, 'index.html'), 'utf-8'); - let manifest: any = {}; + if (this._useManifest) { - manifest = JSON.parse(readFileSync(path.join(output, 'manifest.json'), 'utf-8')); + this._manifest = JSON.parse(readFileSync(join(this._output, 'manifest.json'), 'utf-8')); } - const filterCss = require('filter-css'); - - let html: string[] = []; - let classes: string[] = []; - const cssFiles: string[] = []; - this._paths.forEach((path) => { - path = typeof path === 'object' ? path.path : path; - const result = this._render(compiler, path, htmlContent, this._root, output); - classes = [...classes, ...result.classes]; - html = [...html, result.html]; - }); - - const result = this._entries.reduce((result, entry: string | undefined) => { - if (this._useManifest) { - entry = manifest[`${entry}.css`]; + let originalIndexHtml = readFileSync(join(this._output, 'index.html'), 'utf-8'); + const matchingHead = /([\s\S]*?)<\/head>/.exec(originalIndexHtml); + if (matchingHead) { + this._head = matchingHead[0]; + } + this._cssFiles = this._entries.reduce( + (files, entry) => { + const fileName = this._manifest[entry.replace('.js', '.css')] || entry.replace('.js', '.css'); + const exists = existsSync(join(this._output!, fileName)); + if (exists) { + files.push(fileName); + } + return files; + }, + [] as string[] + ); + + const browser = await puppeteer.launch(this._puppeteerOptions); + const app = await serve(`${this._output}`); + try { + const page = await browser.newPage(); + await setHasFlags(page); + const wait = page.waitForNavigation({ waitUntil: 'networkidle0' }); + await page.goto(`http://localhost:${app.port}/`); + await wait; + + if (this._paths.length === 0) { + const result = await this._getRenderResult(page, undefined); + this._writeIndexHtml(result); } else { - entry = `${entry}.css`; - const cssExists = existsSync(path.join(output, entry)); - if (!cssExists) { - entry = undefined; + let renderResults: RenderResult[] = []; + renderResults.push(await this._getRenderResult(page, undefined, this._useHistory)); + + for (let i = 0; i < this._paths.length; i++) { + let path = typeof this._paths[i] === 'object' ? this._paths[i].path : this._paths[i]; + await navigate(page, this._useHistory, path); + let result = await this._getRenderResult(page, this._paths[i], this._useHistory); + renderResults.push(result); } - } - if (entry) { - cssFiles.push(entry); - const filteredCss = filterCss(path.join(output, entry), (context: string, value: string) => { - if (context === 'selector') { - value = value.replace(/(:| ).*/, ''); - const firstChar = value.substr(0, 1); - if (classes.indexOf(value) !== -1 || ['.', '#'].indexOf(firstChar) === -1) { - return false; + + if (this._useHistory) { + renderResults.forEach((result) => { + this._writeIndexHtml(result); + }); + } else { + const combined = renderResults.reduce( + (combined, result) => { + combined.styles = result.styles + ? `${combined.styles}\n${result.styles}` + : combined.styles; + combined.html.push(result.html); + combined.paths.push(result.path || ''); + return combined; + }, + { styles: '', html: [], paths: [] } as { + paths: (string | BuildTimePath)[]; + styles: string; + html: string[]; } - return true; - } - }) - .replace(/\/\*.*\*\//g, '') - .replace(/^(\s*)(\r\n?|\n)/gm, ''); - result = `${result}\n${filteredCss}`; + ); + let html = readFileSync(join(this._output, 'index.html'), 'utf-8'); + const script = generateRouteInjectionScript(combined.html, combined.paths, this._root); + this._writeIndexHtml({ styles: combined.styles, html, script }); + } } - return result; - }, ''); - - let replacement = ''; - if (this._hasPaths) { - replacement = ``; - } - - const script = this._entries.reduce((script, entry) => { - entry = this._useManifest ? manifest[`${entry}.js`] : `${entry}.js`; - script = `${script}`; - return script; - }, ''); - const css = cssFiles.reduce((css, entry: string | undefined) => { - htmlContent = htmlContent.replace( - ``, - `` - ); - css = `${css}`; - return css; - }, ''); - - htmlContent = htmlContent.replace(script, `${replacement}${css}${script}`); - if (!this._hasPaths) { - htmlContent = htmlContent.replace(this._btrRoot, html[0]); - } - writeFileSync(path.join(output, 'index.html'), htmlContent); }); } } - -export default BuildTimeRender; diff --git a/src/build-time-render/hasBuildTimeRender.ts b/src/build-time-render/hasBuildTimeRender.ts index ce4dfddf..a6068e54 100644 --- a/src/build-time-render/hasBuildTimeRender.ts +++ b/src/build-time-render/hasBuildTimeRender.ts @@ -1,6 +1,13 @@ // tslint:disable-next-line -var has = require('@dojo/framework/has/has'); +var has = require('@dojo/framework/has/has'), + globals = require('@dojo/framework/shim/global'); if (!has.exists('build-time-render')) { has.add('build-time-render', false, false); } + +if (globals.default.__public_path__) { + // @ts-ignore + __webpack_public_path__ = `${window.location.origin}${globals.default.__public_path__}`; + has.add('public-path', globals.default.__public_path__, true); +} diff --git a/src/build-time-render/helpers.ts b/src/build-time-render/helpers.ts new file mode 100644 index 00000000..cf447d89 --- /dev/null +++ b/src/build-time-render/helpers.ts @@ -0,0 +1,107 @@ +import * as express from 'express'; +import * as getPort from 'get-port'; +import * as http from 'http'; + +export async function navigate(page: any, useHistory: boolean, route: string) { + const promise = new Promise(async (resolve) => { + await page.evaluate( + (route: string, useHistory: boolean) => { + if (useHistory) { + route = route[0] === '/' ? route : `/${route}`; + window.history.pushState({}, '', route); + window.dispatchEvent(new Event('popstate')); + } else { + window.location.hash = route; + } + }, + route, + useHistory + ); + setTimeout(resolve, 500); + }); + return promise; +} + +export interface ServeDetails { + server: http.Server; + port: number; +} + +export async function serve(directory: string): Promise { + const app = express(); + const port = await getPort(); + app.use(express.static(directory)); + const promise = new Promise((resolve) => { + const server = app.listen(port, () => { + resolve({ server, port }); + }); + }); + return promise; +} + +export async function getClasses(page: any): Promise { + return await page.evaluate(() => { + // @ts-ignore + const SHOW_ELEMENT = window.NodeFilter.SHOW_ELEMENT; + const treeWalker = document.createTreeWalker(document.body, SHOW_ELEMENT); + let classes: string[] = []; + + while (treeWalker.nextNode()) { + const node = treeWalker.currentNode as HTMLElement; + node.classList.length && classes.push.apply(classes, node.classList); + } + + classes = classes.map((className) => `.${className}`); + return classes; + }); +} + +export async function setHasFlags(page: any): Promise { + await page.evaluateOnNewDocument(() => { + // @ts-ignore + window.DojoHasEnvironment = { staticFeatures: { 'build-time-render': true } }; + // @ts-ignore + window.__public_path__ = '/'; + }); +} + +export async function getForSelector(page: any, selector: string) { + return page.$eval(selector, (element: Element) => element.outerHTML); +} + +export function generateRouteInjectionScript(html: string[], paths: any[], root: string): string { + return ``; +} + +export function generateBasePath(route = '__app_root__') { + return ``; +} + +export function getPrefix(path?: string) { + return path + ? `${path + .split('/') + .map(() => '..') + .join('/')}/` + : ''; +} diff --git a/tests/support/fixtures/build-time-render/expected/indexWithPaths.html b/tests/support/fixtures/build-time-render/expected/indexWithPaths.html deleted file mode 100644 index 544909dd..00000000 --- a/tests/support/fixtures/build-time-render/expected/indexWithPaths.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - -
- - - diff --git a/tests/support/fixtures/build-time-render/expected/index.html b/tests/support/fixtures/build-time-render/hash/expected/index.html similarity index 83% rename from tests/support/fixtures/build-time-render/expected/index.html rename to tests/support/fixtures/build-time-render/hash/expected/index.html index ac6bfd2e..fb9cd198 100644 --- a/tests/support/fixtures/build-time-render/expected/index.html +++ b/tests/support/fixtures/build-time-render/hash/expected/index.html @@ -1,16 +1,12 @@ - - - +}
Hello
- - + diff --git a/tests/support/fixtures/build-time-render/hash/expected/indexWithPaths.html b/tests/support/fixtures/build-time-render/hash/expected/indexWithPaths.html new file mode 100644 index 00000000..dc9b7132 --- /dev/null +++ b/tests/support/fixtures/build-time-render/hash/expected/indexWithPaths.html @@ -0,0 +1,36 @@ + + + + + +
+ + + diff --git a/tests/support/fixtures/build-time-render/index.html b/tests/support/fixtures/build-time-render/hash/index.html similarity index 100% rename from tests/support/fixtures/build-time-render/index.html rename to tests/support/fixtures/build-time-render/hash/index.html diff --git a/tests/support/fixtures/build-time-render/main.css b/tests/support/fixtures/build-time-render/hash/main.css similarity index 87% rename from tests/support/fixtures/build-time-render/main.css rename to tests/support/fixtures/build-time-render/hash/main.css index 313f91d9..06a9344e 100644 --- a/tests/support/fixtures/build-time-render/main.css +++ b/tests/support/fixtures/build-time-render/hash/main.css @@ -8,6 +8,10 @@ background: red; } +.other { + color: pink; +} + span { width: 100%; } diff --git a/tests/support/fixtures/build-time-render/hash/main.js b/tests/support/fixtures/build-time-render/hash/main.js new file mode 100644 index 00000000..9f6cb079 --- /dev/null +++ b/tests/support/fixtures/build-time-render/hash/main.js @@ -0,0 +1,22 @@ +(function main() { + const app = document.getElementById('app'); + let div = document.createElement('div'); + div.classList.add('hello'); + div.innerHTML = 'Hello'; + app.appendChild(div); + + window.addEventListener('hashchange', () => { + app.removeChild(div); + if (window.location.hash === '#my-path') { + div = document.createElement('div'); + div.classList.add('other'); + div.innerHTML = 'Root'; + app.appendChild(div); + } else { + div = document.createElement('div'); + div.classList.add('hello'); + div.innerHTML = 'Hello'; + app.appendChild(div); + } + }, false); +})(); diff --git a/tests/support/fixtures/build-time-render/manifest.json b/tests/support/fixtures/build-time-render/hash/manifest.json similarity index 100% rename from tests/support/fixtures/build-time-render/manifest.json rename to tests/support/fixtures/build-time-render/hash/manifest.json diff --git a/tests/support/fixtures/build-time-render/runtime.js b/tests/support/fixtures/build-time-render/hash/runtime.js similarity index 100% rename from tests/support/fixtures/build-time-render/runtime.js rename to tests/support/fixtures/build-time-render/hash/runtime.js diff --git a/tests/support/fixtures/build-time-render/main.js b/tests/support/fixtures/build-time-render/main.js deleted file mode 100644 index e8248de4..00000000 --- a/tests/support/fixtures/build-time-render/main.js +++ /dev/null @@ -1,15 +0,0 @@ -(function main() { - if (window.location.hash === '#my-path') { - const app = document.getElementById('app'); - const div = document.createElement('div'); - div.classList.add('hello'); - div.innerHTML = 'Root'; - app.appendChild(div); - } else { - const app = document.getElementById('app'); - const div = document.createElement('div'); - div.classList.add('hello'); - div.innerHTML = 'Hello'; - app.appendChild(div); - } -})(); diff --git a/tests/support/fixtures/build-time-render/state/index.html b/tests/support/fixtures/build-time-render/state/index.html new file mode 100644 index 00000000..3f1e6782 --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/index.html @@ -0,0 +1,9 @@ + + + + + +
+ + + diff --git a/tests/support/fixtures/build-time-render/state/main.css b/tests/support/fixtures/build-time-render/state/main.css new file mode 100644 index 00000000..e9a2b61c --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/main.css @@ -0,0 +1,27 @@ +#root { + margin: 10px; +} + +/* example comment */ + +.hello { + background: red; +} + +.other.another { + color: pink; + background: url("relative.png"); + background: url("/root.png"); + background: url("./relative.png"); + background: url("../relative.png"); + background: url("https://example.com"); + background: url("http://example.com"); + background: url(https://example.com); + background: url(http://example.com); +} + +span { + width: 100%; +} + +/*# sourceMappingURL=main.16469ae7e579bf3f6af50cbfcb734efa.bundle.css.map*/ diff --git a/tests/support/fixtures/build-time-render/state/main.js b/tests/support/fixtures/build-time-render/state/main.js new file mode 100644 index 00000000..ed7fb3a5 --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/main.js @@ -0,0 +1,49 @@ +(function main() { + const app = document.getElementById('app'); + let div = document.createElement('div'); + + function renderDefault() { + const imgOne = document.createElement('img'); + const imgTwo = document.createElement('img'); + const imgThree = document.createElement('img'); + const imgFour = document.createElement('img'); + const imgFive = document.createElement('img'); + div.classList.add('hello'); + div.innerHTML = JSON.stringify(window.DojoHasEnvironment); + app.appendChild(div); + + imgOne.setAttribute('src', 'https://example.com'); + div.appendChild(imgOne); + + imgTwo.setAttribute('src', 'http://example.com'); + div.appendChild(imgTwo); + + imgThree.setAttribute('src', '/image.svg'); + div.appendChild(imgThree); + + imgFour.setAttribute('src', './relative-image.svg'); + div.appendChild(imgFour); + + imgFive.setAttribute('src', '../other-relative-image.svg'); + div.appendChild(imgFive); + } + + renderDefault(); + + window.addEventListener('popstate', () => { + app.removeChild(div); + if (window.location.pathname === '/my-path') { + div = document.createElement('div'); + div.classList.add('hello'); + div.innerHTML = JSON.stringify(window.DojoHasEnvironment); + app.appendChild(div); + } else if (window.location.pathname === '/my-path/other') { + div = document.createElement('div'); + div.classList.add('other'); + div.innerHTML = 'Other'; + app.appendChild(div); + } else { + renderDefault(); + } + }); +})(); diff --git a/tests/support/fixtures/build-time-render/state/manifest.json b/tests/support/fixtures/build-time-render/state/manifest.json new file mode 100644 index 00000000..ac2d754b --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/manifest.json @@ -0,0 +1,6 @@ +{ + "main.js": "main.js", + "other.js": "other.js", + "main.css": "main.css", + "runtime.js": "runtime.js" +} diff --git a/tests/support/fixtures/build-time-render/state/my-path/index.html b/tests/support/fixtures/build-time-render/state/my-path/index.html new file mode 100644 index 00000000..8c27140b --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/my-path/index.html @@ -0,0 +1,14 @@ + + + + +
{"staticFeatures":{"build-time-render":true}}
+ + diff --git a/tests/support/fixtures/build-time-render/state/my-path/other/index.html b/tests/support/fixtures/build-time-render/state/my-path/other/index.html new file mode 100644 index 00000000..757f50f5 --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/my-path/other/index.html @@ -0,0 +1,22 @@ + + + + +
Other
+ + diff --git a/tests/support/fixtures/build-time-render/state/other.js b/tests/support/fixtures/build-time-render/state/other.js new file mode 100644 index 00000000..063c9209 --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/other.js @@ -0,0 +1 @@ +(function other() {})(); diff --git a/tests/support/fixtures/build-time-render/state/other/index.html b/tests/support/fixtures/build-time-render/state/other/index.html new file mode 100644 index 00000000..d516d82d --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/other/index.html @@ -0,0 +1,14 @@ + + + + +
{"staticFeatures":{"build-time-render":true}}
+ + diff --git a/tests/support/fixtures/build-time-render/state/runtime.js b/tests/support/fixtures/build-time-render/state/runtime.js new file mode 100644 index 00000000..4ea10a2b --- /dev/null +++ b/tests/support/fixtures/build-time-render/state/runtime.js @@ -0,0 +1 @@ +(function runtime() {})(); diff --git a/tests/unit/build-time-render/BuildTimeRender.ts b/tests/unit/build-time-render/BuildTimeRender.ts index 67a173db..eca2f04e 100644 --- a/tests/unit/build-time-render/BuildTimeRender.ts +++ b/tests/unit/build-time-render/BuildTimeRender.ts @@ -1,126 +1,309 @@ import MockModule from '../../support/MockModule'; import { stub } from 'sinon'; import * as path from 'path'; -import { readFileSync, existsSync } from 'fs'; +import { readFileSync, existsSync } from 'fs-extra'; const { afterEach, beforeEach, describe, it } = intern.getInterface('bdd'); const { assert } = intern.getPlugin('chai'); let mockModule: MockModule; - -const outputPath = path.join(__dirname, '..', '..', 'support', 'fixtures', 'build-time-render'); - -const pluginStub = stub(); -const compiler = { - plugin: pluginStub, - options: { - output: { - path: outputPath - } - } +let outputPath: string; +let compiler: any; +let pluginRegistered = false; +let runBtr: Function = () => {}; +const pluginStub = (type: string, cb: Function) => { + pluginRegistered = true; + runBtr = cb; }; -pluginStub.yields(); +function normalise(value: string) { + return value.replace(/^(\s*)(\r\n?|\n)/gm, '').trim(); +} + +const callbackStub = stub(); describe('build-time-render', () => { beforeEach(() => { mockModule = new MockModule('../../../src/build-time-render/BuildTimeRender', require); - mockModule.dependencies(['fs']); + mockModule.dependencies(['fs-extra']); }); afterEach(() => { + pluginRegistered = false; mockModule.destroy(); + callbackStub.reset(); + runBtr = () => {}; }); - it('should inject btr using entry names', () => { - const fs = mockModule.getMock('fs'); - const writeFileSync = stub(); - fs.writeFileSync = writeFileSync; - fs.readFileSync = readFileSync; - fs.existsSync = existsSync; - const Btr = mockModule.getModuleUnderTest().default; - const btr = new Btr({ - entries: ['runtime', 'main'], - root: 'app' + describe('hash history', () => { + beforeEach(() => { + outputPath = path.join(__dirname, '..', '..', 'support', 'fixtures', 'build-time-render', 'hash'); + compiler = { + plugin: pluginStub, + options: { + output: { + path: outputPath + } + } + }; + }); + + it('should inject btr using entry names', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + const expected = readFileSync(path.join(outputPath, 'expected', 'index.html'), 'utf-8'); + const actual = outputFileSync.firstCall.args[1]; + assert.strictEqual(actual, expected.replace(/^(\s*)(\r\n?|\n)/gm, '').trim()); + }); }); - btr.apply(compiler); - const expected = readFileSync(path.join(outputPath, 'expected', 'index.html'), 'utf-8'); - const actual = writeFileSync.firstCall.args[1]; - assert.strictEqual(actual, expected); - }); - it('should inject btr using manifest to map', () => { - const fs = mockModule.getMock('fs'); - const writeFileSync = stub(); - fs.writeFileSync = writeFileSync; - fs.readFileSync = readFileSync; - fs.existsSync = existsSync; - const Btr = mockModule.getModuleUnderTest().default; - const btr = new Btr({ - paths: [], - useManifest: true, - entries: ['runtime', 'main'], - root: 'app' + it('should inject btr using manifest to map', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [], + useManifest: true, + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + const expected = readFileSync(path.join(outputPath, 'expected', 'index.html'), 'utf-8'); + const actual = outputFileSync.firstCall.args[1]; + assert.strictEqual(actual, expected.replace(/^(\s*)(\r\n?|\n)/gm, '').trim()); + }); + }); + + it('should inject btr for paths specified', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [ + { + path: '#my-path' + } + ], + useManifest: true, + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + const expected = readFileSync(path.join(outputPath, 'expected', 'indexWithPaths.html'), 'utf-8'); + const actual = outputFileSync.firstCall.args[1]; + assert.strictEqual(actual, expected.replace(/^(\s*)(\r\n?|\n)/gm, '').trim()); + }); + }); + + it('should not inject btr when missing root', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [], + useManifest: true, + entries: ['runtime', 'main'], + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isFalse(pluginRegistered); + }); + + it('should not inject btr when no output path can be found', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [], + useManifest: true, + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply({ ...compiler, options: {} }); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + assert.isTrue(outputFileSync.notCalled); + }); }); - btr.apply(compiler); - const expected = readFileSync(path.join(outputPath, 'expected', 'index.html'), 'utf-8'); - const actual = writeFileSync.firstCall.args[1]; - assert.strictEqual(actual, expected); }); - it('should inject btr for paths specified', () => { - const fs = mockModule.getMock('fs'); - const writeFileSync = stub(); - fs.writeFileSync = writeFileSync; - fs.readFileSync = readFileSync; - fs.existsSync = existsSync; - const Btr = mockModule.getModuleUnderTest().default; - const btr = new Btr({ - paths: [ - { - path: '#my-path' + describe('history api', () => { + beforeEach(() => { + outputPath = path.join(__dirname, '..', '..', 'support', 'fixtures', 'build-time-render', 'state'); + compiler = { + plugin: pluginStub, + options: { + output: { + path: outputPath + } } - ], - useManifest: true, - entries: ['runtime', 'main'], - root: 'app' + }; }); - btr.apply(compiler); - const expected = readFileSync(path.join(outputPath, 'expected', 'indexWithPaths.html'), 'utf-8'); - const actual = writeFileSync.firstCall.args[1]; - assert.strictEqual(actual, expected); - }); - it('should not inject btr when missing root', () => { - const fs = mockModule.getMock('fs'); - const writeFileSync = stub(); - fs.writeFileSync = writeFileSync; - fs.readFileSync = readFileSync; - fs.existsSync = existsSync; - const Btr = mockModule.getModuleUnderTest().default; - const btr = new Btr({ - paths: [], - useManifest: true, - entries: ['runtime', 'main'] + it('should auto detect history routing and statically build an index file for each route', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [ + { + path: 'my-path' + }, + 'other', + 'my-path/other' + ], + useManifest: true, + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + assert.strictEqual(outputFileSync.callCount, 4); + assert.isTrue( + outputFileSync.secondCall.args[0].indexOf( + path.join('support', 'fixtures', 'build-time-render', 'state', 'my-path', 'index.html') + ) > -1 + ); + assert.isTrue( + outputFileSync.thirdCall.args[0].indexOf( + path.join('support', 'fixtures', 'build-time-render', 'state', 'other', 'index.html') + ) > -1 + ); + assert.isTrue( + outputFileSync + .getCall(3) + .args[0].indexOf( + path.join( + 'support', + 'fixtures', + 'build-time-render', + 'state', + 'my-path', + 'other', + 'index.html' + ) + ) > -1 + ); + assert.strictEqual( + outputFileSync.secondCall.args[1], + normalise(readFileSync(outputFileSync.getCall(1).args[0], 'utf8')) + ); + assert.strictEqual( + outputFileSync.thirdCall.args[1], + normalise(readFileSync(outputFileSync.getCall(2).args[0], 'utf8')) + ); + assert.strictEqual( + outputFileSync.getCall(3).args[1], + normalise(readFileSync(outputFileSync.getCall(3).args[0], 'utf8')) + ); + }); }); - btr.apply(compiler); - assert.isTrue(writeFileSync.notCalled); - }); - it('should not inject btr when no output path can be found', () => { - const fs = mockModule.getMock('fs'); - const writeFileSync = stub(); - fs.writeFileSync = writeFileSync; - fs.readFileSync = readFileSync; - fs.existsSync = existsSync; - const Btr = mockModule.getModuleUnderTest().default; - const btr = new Btr({ - paths: [], - useManifest: true, - entries: ['runtime', 'main'], - root: 'app' + it('should statically build an index file for each route', () => { + const fs = mockModule.getMock('fs-extra'); + const outputFileSync = stub(); + fs.outputFileSync = outputFileSync; + fs.readFileSync = readFileSync; + fs.existsSync = existsSync; + const Btr = mockModule.getModuleUnderTest().default; + const btr = new Btr({ + paths: [ + { + path: 'my-path' + }, + 'other', + 'my-path/other' + ], + useHistory: true, + useManifest: true, + entries: ['runtime', 'main'], + root: 'app', + puppeteerOptions: { args: ['--no-sandbox'] } + }); + btr.apply(compiler); + assert.isTrue(pluginRegistered); + return runBtr('', callbackStub).then(() => { + assert.isTrue(callbackStub.calledOnce); + assert.strictEqual(outputFileSync.callCount, 4); + assert.isTrue( + outputFileSync.secondCall.args[0].indexOf( + path.join('support', 'fixtures', 'build-time-render', 'state', 'my-path', 'index.html') + ) > -1 + ); + assert.isTrue( + outputFileSync.thirdCall.args[0].indexOf( + path.join('support', 'fixtures', 'build-time-render', 'state', 'other', 'index.html') + ) > -1 + ); + assert.isTrue( + outputFileSync + .getCall(3) + .args[0].indexOf( + path.join( + 'support', + 'fixtures', + 'build-time-render', + 'state', + 'my-path', + 'other', + 'index.html' + ) + ) > -1 + ); + assert.strictEqual( + outputFileSync.secondCall.args[1], + normalise(readFileSync(outputFileSync.getCall(1).args[0], 'utf8')) + ); + assert.strictEqual( + outputFileSync.thirdCall.args[1], + normalise(readFileSync(outputFileSync.getCall(2).args[0], 'utf8')) + ); + assert.strictEqual( + outputFileSync.getCall(3).args[1], + normalise(readFileSync(outputFileSync.getCall(3).args[0], 'utf8')) + ); + }); }); - btr.apply({ ...compiler, options: {} }); - assert.isTrue(writeFileSync.notCalled); }); });