diff --git a/lib/webpack-config-bower.js b/lib/webpack-config-bower.js index d014565..a57a2a4 100644 --- a/lib/webpack-config-bower.js +++ b/lib/webpack-config-bower.js @@ -30,7 +30,8 @@ module.exports = ({ // the order is respected modules: [path.join(installationDirectory, "bower_components")], // These JSON files are read in directories - descriptionFiles: ["bower.json"], + // We use `.bower.json` and not `bower.json` because this file is created by Bower for every component that has been installed. + descriptionFiles: [".bower.json"], // These fields in the description files are looked up when trying to resolve the package directory mainFields: ["browser", "main"], // These files are tried when trying to resolve a directory diff --git a/package-lock.json b/package-lock.json index 0bd14fa..dd25976 100644 --- a/package-lock.json +++ b/package-lock.json @@ -956,6 +956,27 @@ "winston": "^2.4.0" } }, + "@financial-times/origami-repo-data-client": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@financial-times/origami-repo-data-client/-/origami-repo-data-client-1.5.0.tgz", + "integrity": "sha512-PjNpqQCdzry6PvkPjbGBCYwVMcmAA7YIManKwDMQ4sVEdCJ2F+n+5RbVmFyQ2pEBlqNjpgmMruM20+3u0bjxYw==", + "requires": { + "@financial-times/origami-service-makefile": "^6.1.0", + "lodash": "^4.17.4", + "request": "^2.85.0", + "request-promise-native": "^1.0.5" + }, + "dependencies": { + "@financial-times/origami-service-makefile": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/@financial-times/origami-service-makefile/-/origami-service-makefile-6.4.0.tgz", + "integrity": "sha512-BAta9ElfKENOO+WTLNxmFu75uO+bImxXt20YWsHJTGEg4VzKTUMjXv77yDx5uc8mLJVuEiGNXJvNg2XMWxxT1Q==", + "requires": { + "esm": "^3.0.18" + } + } + } + }, "@financial-times/origami-service": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@financial-times/origami-service/-/origami-service-4.1.0.tgz", @@ -1211,6 +1232,12 @@ "resolved": "https://registry.npmjs.org/@xtuc/long/-/long-4.2.2.tgz", "integrity": "sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==" }, + "abab": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.0.tgz", + "integrity": "sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w==", + "dev": true + }, "abbrev": { "version": "1.0.9", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", @@ -1241,12 +1268,28 @@ "integrity": "sha512-QDQJBe2DfxNBIMxs+19XY2i/XXilJn+kPgX30HWNYK4IXoNj3ACNSWPU7szL0SzqjFyOG4zoZxG9P7JfNw5g7A==", "dev": true }, + "acorn-globals": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz", + "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==", + "dev": true, + "requires": { + "acorn": "^6.0.1", + "acorn-walk": "^6.0.1" + } + }, "acorn-jsx": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", "dev": true }, + "acorn-walk": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.1.1.tgz", + "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", + "dev": true + }, "address": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/address/-/address-1.1.0.tgz", @@ -1464,6 +1507,12 @@ "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=", + "dev": true + }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", @@ -2576,6 +2625,12 @@ "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, + "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==", + "dev": true + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -3787,6 +3842,21 @@ } } }, + "cssom": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.6.tgz", + "integrity": "sha512-DtUeseGk9/GBW0hl0vVPpU22iHL6YB5BUX7ml1hB+GMpo0NX5G4voX3kdWiMSEguFtcW3Vh3djqNF4aIe6ne0A==", + "dev": true + }, + "cssstyle": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", + "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", + "dev": true, + "requires": { + "cssom": "0.3.x" + } + }, "currently-unhandled": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", @@ -3831,6 +3901,17 @@ "assert-plus": "^1.0.0" } }, + "data-urls": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz", + "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "whatwg-mimetype": "^2.2.0", + "whatwg-url": "^7.0.0" + } + }, "date-fns": { "version": "1.30.1", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.30.1.tgz", @@ -4079,6 +4160,15 @@ "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.1.tgz", "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" }, + "domexception": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", + "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==", + "dev": true, + "requires": { + "webidl-conversions": "^4.0.2" + } + }, "domutils": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", @@ -4687,9 +4777,9 @@ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==" }, "esm": { - "version": "3.2.22", - "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.22.tgz", - "integrity": "sha512-z8YG7U44L82j1XrdEJcqZOLUnjxco8pO453gKOlaMD1/md1n/5QrscAmYG+oKUspsmDLuBFZrpbxI6aQ67yRxA==" + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" }, "espree": { "version": "5.0.1", @@ -6407,6 +6497,15 @@ "resolved": "https://registry.npmjs.org/html-comment-regex/-/html-comment-regex-1.1.2.tgz", "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==" }, + "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==", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.1" + } + }, "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", @@ -7182,6 +7281,80 @@ "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=" }, + "jsdom": { + "version": "15.1.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-15.1.0.tgz", + "integrity": "sha512-QEmc2XIkNfCK3KRfa9ljMJjC4kAGdVgRrs/pCBsQG/QoKz0B42+C58f6TdAmhq/rw494eFCoLHxX6+hWuxb96Q==", + "dev": true, + "requires": { + "abab": "^2.0.0", + "acorn": "^6.0.4", + "acorn-globals": "^4.3.0", + "array-equal": "^1.0.0", + "cssom": "^0.3.4", + "cssstyle": "^1.1.1", + "data-urls": "^1.1.0", + "domexception": "^1.0.1", + "escodegen": "^1.11.0", + "html-encoding-sniffer": "^1.0.2", + "nwsapi": "^2.1.3", + "parse5": "5.1.0", + "pn": "^1.1.0", + "request": "^2.88.0", + "request-promise-native": "^1.0.5", + "saxes": "^3.1.9", + "symbol-tree": "^3.2.2", + "tough-cookie": "^2.5.0", + "w3c-hr-time": "^1.0.1", + "w3c-xmlserializer": "^1.1.2", + "webidl-conversions": "^4.0.2", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^7.0.0", + "ws": "^6.1.2", + "xml-name-validator": "^3.0.0" + }, + "dependencies": { + "escodegen": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", + "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", + "dev": true, + "requires": { + "esprima": "^3.1.3", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + } + }, + "esprima": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-3.1.3.tgz", + "integrity": "sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM=", + "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "ws": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.2.1.tgz", + "integrity": "sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA==", + "dev": true, + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", @@ -7989,6 +8162,12 @@ "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=" }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, "lodash.uniq": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", @@ -9107,6 +9286,12 @@ "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, + "nwsapi": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", + "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", + "dev": true + }, "oauth-sign": { "version": "0.9.0", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", @@ -11373,6 +11558,11 @@ } } }, + "raw-loader": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", + "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=" + }, "regexpp": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", @@ -11818,6 +12008,12 @@ "json-parse-better-errors": "^1.0.1" } }, + "parse5": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz", + "integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ==", + "dev": true + }, "parsejson": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/parsejson/-/parsejson-0.0.3.tgz", @@ -12018,6 +12214,12 @@ "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==" }, + "pn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz", + "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==", + "dev": true + }, "portfinder": { "version": "1.0.20", "resolved": "https://registry.npmjs.org/portfinder/-/portfinder-1.0.20.tgz", @@ -13014,11 +13216,6 @@ } } }, - "raw-loader": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-0.5.1.tgz", - "integrity": "sha1-DD0L6u2KAclm2Xh793goElKpeao=" - }, "rc": { "version": "1.2.8", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", @@ -14126,6 +14323,15 @@ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" }, + "saxes": { + "version": "3.1.9", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-3.1.9.tgz", + "integrity": "sha512-FZeKhJglhJHk7eWG5YM0z46VHmI3KJpMBAQm3xa9meDvd+wevB5GuBB0wc0exPInZiBBHqi00DbS8AcvCGCFMw==", + "dev": true, + "requires": { + "xmlchars": "^1.3.1" + } + }, "schema-utils": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-1.0.0.tgz", @@ -15209,6 +15415,12 @@ "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz", "integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=" }, + "symbol-tree": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.2.tgz", + "integrity": "sha1-rifbOPZgp64uHDt9G8KQgZuFGeY=", + "dev": true + }, "table": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", @@ -15517,6 +15729,15 @@ } } }, + "tr46": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz", + "integrity": "sha1-qLE/1r/SSJUZZ0zN5VujaTtwbQk=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "trim-newlines": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-1.0.0.tgz", @@ -16061,6 +16282,26 @@ "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=" }, + "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=", + "dev": true, + "requires": { + "browser-process-hrtime": "^0.1.2" + } + }, + "w3c-xmlserializer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-1.1.2.tgz", + "integrity": "sha512-p10l/ayESzrBMYWRID6xbuCKh2Fp77+sA0doRuGn4tTIMrrZVeqfpKjXHY+oDh3K4nLdPgNwMTVP6Vp4pvqbNg==", + "dev": true, + "requires": { + "domexception": "^1.0.1", + "webidl-conversions": "^4.0.2", + "xml-name-validator": "^3.0.0" + } + }, "watchpack": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", @@ -16071,6 +16312,12 @@ "neo-async": "^2.5.0" } }, + "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==", + "dev": true + }, "webpack": { "version": "4.30.0", "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.30.0.tgz", @@ -16145,11 +16392,48 @@ "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==", + "dev": true, + "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==", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + } + } + }, "whatwg-fetch": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz", "integrity": "sha512-9GSJUgz1D4MfyKU7KRqwOjXCXTqWdFNvEr7eUBYchQiVc744mqK/MzXPNR2WsPkmkOa4ywfg8C2n8h+13Bey1Q==" }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "whatwg-url": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.0.0.tgz", + "integrity": "sha512-37GeVSIJ3kn1JgKyjiYNmSLP1yzbpb29jdmwBSgkD9h40/hyrR/OifpVUndji3tmwGgD8qpw7iQu3RSbCrBpsQ==", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^1.0.1", + "webidl-conversions": "^4.0.2" + } + }, "whet.extend": { "version": "0.9.9", "resolved": "https://registry.npmjs.org/whet.extend/-/whet.extend-0.9.9.tgz", @@ -16287,6 +16571,18 @@ "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=" }, + "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==", + "dev": true + }, + "xmlchars": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-1.3.1.tgz", + "integrity": "sha512-tGkGJkN8XqCod7OT+EvGYK5Z4SfDQGD30zAa58OcnAa0RRWgzUEK72tkXhsX1FZd+rgnhRxFtmO+ihkp8LHSkw==", + "dev": true + }, "xmlhttprequest-ssl": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.3.tgz", diff --git a/package.json b/package.json index 55ce610..c12709f 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "@babel/plugin-proposal-export-namespace-from": "^7.2.0", "@babel/preset-env": "^7.4.4", "@financial-times/health-check": "^1.10.0", + "@financial-times/origami-repo-data-client": "^1.5.0", "@financial-times/origami-service": "^4.1.0", "@financial-times/origami-service-makefile": "^7.0.0", "@financial-times/polyfill-useragent-normaliser": "^1.0.6", @@ -46,15 +47,18 @@ "is-es6-syntax": "^1.0.1", "is-es7-syntax": "^1.0.0", "istanbul": "^0.4.5", + "jsdom": "^15.1.0", "mocha": "^6.1.4", "nodemon": "^1.19.0", "prettier": "1.17.0", "proclaim": "^3.6.0", - "supertest": "^4.0.2" + "supertest": "^4.0.2", + "whatwg-fetch": "^3.0.0" }, "scripts": { "start": "node ./index.js", "test:fastly": "mocha \"test/fastly/**/*.test.js\" --recursive --timeout 15000 --bail --check-leaks --forbid-only --forbid-pending --exit", - "test:integration": "mocha \"test/integration/**/*.test.js\" --recursive --timeout 15000 --bail --check-leaks --forbid-only --exit" + "test:integration": "mocha \"test/integration/**/*.test.js\" --recursive --timeout 15000 --bail --check-leaks --forbid-only --exit", + "update-components-list": "node ./scripts/fetch-components.js" } } diff --git a/scripts/components.json b/scripts/components.json new file mode 100644 index 0000000..18bae4d --- /dev/null +++ b/scripts/components.json @@ -0,0 +1,501 @@ +[ + { + "name": "o-ads", + "version": "12.3.2", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-ads-embed", + "version": "3.0.3", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-assets", + "version": "3.4.1", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-autoinit", + "version": "1.5.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-banner", + "version": "2.2.24", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-buttons", + "version": "5.16.4", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-colors", + "version": "4.8.8", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-cookie-message", + "version": "4.7.1", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-date", + "version": "3.1.2", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-element-visibility", + "version": "2.3.2", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-errors", + "version": "4.0.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-expander", + "version": "4.7.1", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-fetch-jsonp", + "version": "2.1.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-fonts", + "version": "3.3.2", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-footer", + "version": "6.1.3", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-footer-services", + "version": "2.1.4", + "brands": [ + "master", + "internal" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-forms", + "version": "7.0.3", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-ft-affiliate-ribbon", + "version": "3.1.1", + "brands": [], + "languages": [ + "scss" + ] + }, + { + "name": "ftdomdelegate", + "version": "3.0.2", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-gallery", + "version": "3.0.8", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-grid", + "version": "4.5.3", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-header", + "version": "7.8.6", + "brands": [ + "master", + "internal" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-header-services", + "version": "3.2.15", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-icons", + "version": "5.11.1", + "brands": [], + "languages": [ + "scss" + ] + }, + { + "name": "o-labels", + "version": "4.2.3", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-layers", + "version": "2.1.0", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-layout", + "version": "3.1.12", + "brands": [ + "internal" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-lazy-load", + "version": "1.0.1", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-loading", + "version": "3.1.2", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-message", + "version": "3.1.2", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-normalise", + "version": "1.7.3", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "scss" + ] + }, + { + "name": "o-overlay", + "version": "2.7.4", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-quote", + "version": "2.2.23", + "brands": [], + "languages": [ + "scss" + ] + }, + { + "name": "o-share", + "version": "6.4.4", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-squishy-list", + "version": "2.4.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-stepped-progress", + "version": "1.0.1", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-subs-card", + "version": "3.0.0", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-syntax-highlight", + "version": "2.0.0", + "brands": [ + "master", + "internal" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-table", + "version": "7.3.2", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-tabs", + "version": "4.3.2", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-teaser", + "version": "3.5.4", + "brands": [], + "languages": [ + "scss" + ] + }, + { + "name": "o-teaser-collection", + "version": "2.3.2", + "brands": [], + "languages": [ + "scss" + ] + }, + { + "name": "o-toggle", + "version": "1.2.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-tooltip", + "version": "3.5.0", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-tracking", + "version": "1.7.2", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-typography", + "version": "5.11.5", + "brands": [ + "master", + "internal", + "whitelabel" + ], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-utils", + "version": "1.1.1", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-video", + "version": "5.1.5", + "brands": [], + "languages": [ + "js", + "scss" + ] + }, + { + "name": "o-viewport", + "version": "3.3.3", + "brands": [], + "languages": [ + "js" + ] + }, + { + "name": "o-visual-effects", + "version": "2.1.1", + "brands": [], + "languages": [ + "scss" + ] + } +] \ No newline at end of file diff --git a/scripts/fetch-components.js b/scripts/fetch-components.js new file mode 100644 index 0000000..56c81c7 --- /dev/null +++ b/scripts/fetch-components.js @@ -0,0 +1,48 @@ +"use strict"; + +// https://github.com/nodejs/node/issues/20392 +// installs an 'unhandledRejection' handler which exits the process. +require("make-promises-safe"); + +const dotenv = require("dotenv"); +dotenv.config(); + +const RepoDataClient = require("@financial-times/origami-repo-data-client"); +const fs = require("fs").promises; +const path = require("path"); +const repoData = new RepoDataClient({ + apiKey: process.env.ORIGAMI_REPO_DATA_ACCESS_KEY_ID, + apiSecret: process.env.ORIGAMI_REPO_DATA_ACCESS_KEY_SECRET, +}); + +const componentFileLocation = path.join(__dirname, "./components.json"); +repoData + .listRepos({ + type: "module", + status: ["active", "maintained"], + }) + .then(components => { + const componentsWithScssOrJs = components + .filter(repo => { + if (repo.name.startsWith("o-comment")) { + return false; + } + return repo.languages.includes("js") || repo.languages.includes("scss"); + }) + .map(component => { + return { + name: component.name, + version: component.version, + brands: component.brands, + languages: component.languages, + }; + }); + return fs.writeFile( + componentFileLocation, + JSON.stringify(componentsWithScssOrJs, undefined, 4), + "utf-8", + ); + }) + .then(() => { + console.log(`Updated components file located at ${componentFileLocation}`); + }); diff --git a/test/integration/v3/bundles/css.test.js b/test/integration/v3/bundles/css.test.js index 3b3eabf..2d5ceb5 100644 --- a/test/integration/v3/bundles/css.test.js +++ b/test/integration/v3/bundles/css.test.js @@ -1,9 +1,12 @@ +/* eslint-disable no-loop-func */ "use strict"; const request = require("supertest"); const proclaim = require("proclaim"); const service = require("../../../../lib/service"); - +const componentsWithScss = require("../../../../scripts/components.json").filter( + component => component.languages.includes("scss"), +); describe("/v3/bundles/css", function() { let app; beforeEach(() => { @@ -14,6 +17,7 @@ describe("/v3/bundles/css", function() { error: () => {}, warn: () => {}, }, + requestLogFormat: null, port: 0, }) .listen() @@ -305,5 +309,45 @@ describe("/v3/bundles/css", function() { }); }); }); + + context( + "works with all active and maintained components which have no defined brand support", + function() { + const bundleUrl = ({ name, version }) => + `/v3/bundles/css?modules=${name}@${version}&source=test`; + for (const component of componentsWithScss) { + if (component.brands.length === 0) { + const url = bundleUrl(component); + it(url, function() { + return request(app) + .get(url) + .expect(200) + .expect("Content-Type", "text/css; charset=utf-8"); + }); + } + } + }, + ); + + context( + "works with all active and maintained components which have defined brand support", + function() { + const bundleUrl = ({ name, version }, brand) => + `/v3/bundles/css?modules=${name}@${version}&source=test&brand=${brand}`; + for (const component of componentsWithScss) { + if (component.brands.length > 0) { + for (const brand of component.brands) { + const url = bundleUrl(component, brand); + it(url, function() { + return request(app) + .get(url) + .expect(200) + .expect("Content-Type", "text/css; charset=utf-8"); + }); + } + } + } + }, + ); }); }); diff --git a/test/integration/v3/bundles/js.test.js b/test/integration/v3/bundles/js.test.js index d283982..27cfe4f 100644 --- a/test/integration/v3/bundles/js.test.js +++ b/test/integration/v3/bundles/js.test.js @@ -1,6 +1,8 @@ +/* eslint-disable no-loop-func */ "use strict"; -const vm = require("vm"); +const dotenv = require("dotenv"); +dotenv.config(); const proclaim = require("proclaim"); const request = require("supertest"); const service = require("../../../../lib/service"); @@ -9,6 +11,30 @@ const isES6 = require("is-es6-syntax"); const isES7 = require("is-es7-syntax"); const { Parser } = require("acorn"); const acornExportNsFrom = require("acorn-export-ns-from"); +const jsdom = require("jsdom"); +const { JSDOM } = jsdom; +const fs = require("fs"); +const fetchPolyfill = fs.readFileSync(require.resolve("whatwg-fetch"), "utf-8"); +const componentsWithJavaScript = require("../../../../scripts/components.json").filter( + component => component.languages.includes("js"), +); +const executeBrowserJavaScript = js => { + const window = new JSDOM(``, { runScripts: "outside-only" }).window; + proclaim.doesNotThrow( + () => { + try { + window.eval(fetchPolyfill); + window.eval(js); + } catch (err) { + console.error(err); + throw err; + } + }, + undefined, + `Expected to be valid browser-based JavaScript but it was not.`, + ); + return window; +}; const containsExportStatement = js => { if (!isES7(js)) { @@ -32,6 +58,7 @@ describe("/v3/bundles/js", function() { error: () => {}, warn: () => {}, }, + requestLogFormat: null, port: 0, }) .listen() @@ -155,7 +182,16 @@ describe("/v3/bundles/js", function() { .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { proclaim.isString(response.text); - proclaim.doesNotThrow(() => new vm.Script(response.text)); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; + proclaim.doesNotThrow(() => { + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } + }); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }) .expect("etag", "e59bc417b0d50279f73fac87b290c65b"); @@ -217,27 +253,21 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); proclaim.include( - sandbox.window.Origami, + window.Origami, "@financial-times/o-test-component", ); - proclaim.include( - sandbox.window.Origami, - "@financial-times/o-autoinit", - ); + proclaim.include(window.Origami, "@financial-times/o-autoinit"); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }); }); @@ -281,23 +311,18 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); proclaim.include( - sandbox.window.Origami, + window.Origami, "@financial-times/o-test-component", ); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); @@ -317,23 +342,18 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); proclaim.include( - sandbox.window.Origami, + window.Origami, "@financial-times/o-test-component", ); // proclaim.match(response.text, /\/\/#\ssourceMappingURL(.+)/); @@ -356,23 +376,18 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); proclaim.include( - sandbox.window.Origami, + window.Origami, "@financial-times/o-test-component", ); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); @@ -644,7 +659,16 @@ describe("/v3/bundles/js", function() { .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { proclaim.isString(response.text); - proclaim.doesNotThrow(() => new vm.Script(response.text)); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; + proclaim.doesNotThrow(() => { + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } + }); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }) .expect("etag", "87af47fbb8b5af7c96219492c7c77681"); @@ -664,7 +688,16 @@ describe("/v3/bundles/js", function() { .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { proclaim.isString(response.text); - proclaim.doesNotThrow(() => new vm.Script(response.text)); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; + proclaim.doesNotThrow(() => { + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } + }); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }) .expect("etag", "87af47fbb8b5af7c96219492c7c77681"); @@ -728,22 +761,18 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }) + .window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); - proclaim.include(sandbox.window.Origami, "o-test-component"); + proclaim.include(window.Origami, "o-test-component"); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }); }); @@ -784,22 +813,17 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); - proclaim.include(sandbox.window.Origami, "o-test-component"); + proclaim.include(window.Origami, "o-test-component"); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }) .expect("etag", "7d0e6490aad03b8b795f5fbf297f497f"); @@ -817,22 +841,17 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); - proclaim.include(sandbox.window.Origami, "o-test-component"); + proclaim.include(window.Origami, "o-test-component"); // proclaim.match(response.text, /\/\/#\ssourceMappingURL(.+)/); }); // TODO: Ensure consistent builds when minification is turned off @@ -877,22 +896,17 @@ describe("/v3/bundles/js", function() { ) .expect("Content-Type", "application/javascript; charset=utf-8") .expect(response => { - const sandbox = { - globalThis: {}, - self: {}, - window: { - addEventListener: () => {}, - }, - document: { - addEventListener: () => {}, - }, - }; - vm.createContext(sandbox); - proclaim.isString(response.text); + const window = new JSDOM(``, { runScripts: "outside-only" }).window; proclaim.doesNotThrow(() => { - vm.runInContext(response.text, sandbox); + try { + window.eval(fetchPolyfill); + window.eval(response.text); + } catch (err) { + console.error(err); + throw err; + } }); - proclaim.include(sandbox.window.Origami, "o-test-component"); + proclaim.include(window.Origami, "o-test-component"); proclaim.notMatch(response.text, /\/\/#\ssourceMappingURL(.+)/); }) .expect("etag", "7d0e6490aad03b8b795f5fbf297f497f"); @@ -1148,5 +1162,69 @@ describe("/v3/bundles/js", function() { }); }, ); + + context( + "works with all active and maintained components which have JavaScript minified", + function() { + const bundleUrl = ({ name, version }) => + `/v3/bundles/js?modules=${name}@${version}&source=test®istry=bower`; + for (const component of componentsWithJavaScript) { + const url = bundleUrl(component); + it(url, function() { + return request(app) + .get(url) + .expect(200) + .expect("Content-Type", "application/javascript; charset=utf-8") + .expect(response => { + const window = executeBrowserJavaScript(response.text); + proclaim.include(window.Origami, component.name); + }); + }); + } + }, + ); + + context( + "works with all active and maintained components which have JavaScript unminified", + function() { + const bundleUrl = ({ name, version }) => + `/v3/bundles/js?modules=${name}@${version}&source=test®istry=bower&minify=off`; + for (const component of componentsWithJavaScript) { + const url = bundleUrl(component); + it(url, function() { + return request(app) + .get(url) + .expect(200) + .expect("Content-Type", "application/javascript; charset=utf-8") + .expect(response => { + const window = executeBrowserJavaScript(response.text); + proclaim.include(window.Origami, component.name); + }); + }); + } + }, + ); + + // Waiting on https://github.com/jsdom/jsdom/issues/2475 + context.skip( + "works with all active and maintained components which have JavaScript ESM", + function() { + const bundleUrl = ({ name, version }) => + `/v3/bundles/js?modules=${name}@${version}&source=test®istry=bower&esmodules=on`; + for (const component of componentsWithJavaScript) { + const url = bundleUrl(component); + it(url, function() { + return request(app) + .get(url) + .expect(200) + .expect("Content-Type", "application/javascript; charset=utf-8") + .expect(response => { + const window = executeBrowserJavaScript(response.text); + proclaim.include(window.Origami, component.name); + }); + }); + } + }, + ); }); });