extension(compilation): add object rest support (#4954)

This commit is contained in:
Brendan Kenny 2018-04-11 15:02:03 -07:00 коммит произвёл GitHub
Родитель 419b023680
Коммит 5bacdff524
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 85 добавлений и 106 удалений

Просмотреть файл

@ -129,13 +129,7 @@ async function saveArtifacts(artifacts, basePath) {
rimraf.sync(`${basePath}/*${traceSuffix}`);
rimraf.sync(`${basePath}/${artifactsFilename}`);
// TODO: when https://github.com/GoogleChrome/lighthouse/issues/4952 is fixed
// const {traces, devtoolsLogs, ...restArtifacts} = artifacts;
const traces = artifacts.traces;
const devtoolsLogs = artifacts.devtoolsLogs;
const restArtifacts = Object.assign({}, artifacts);
delete restArtifacts.traces;
delete restArtifacts.devtoolsLogs;
const {traces, devtoolsLogs, ...restArtifacts} = artifacts;
// save traces
for (const [passName, trace] of Object.entries(traces)) {

Просмотреть файл

@ -97,7 +97,7 @@ function applyBrowserifyTransforms(bundle) {
// Fix an issue with imported speedline code that doesn't brfs well.
return bundle.transform('./fs-transform', {global: true})
// Transform the fs.readFile etc, but do so in all the modules.
.transform('brfs', {global: true})
.transform('brfs', {global: true, parserOpts: {ecmaVersion: 9}})
// Strip everything out of package.json includes except for the version.
.transform('package-json-versionify');
}
@ -170,6 +170,9 @@ gulp.task('compilejs', () => {
retainLines: true, // Keep things on the same line (looks wonky but helps with stacktraces)
comments: false, // Don't output comments
shouldPrintComment: _ => false, // Don't include @license or @preserve comments either
plugins: [
'syntax-object-rest-spread',
],
// sourceMaps: 'both'
};

Просмотреть файл

@ -10,7 +10,8 @@
"test": "mocha test/extension-test.js"
},
"devDependencies": {
"brfs": "^1.5.0",
"babel-plugin-syntax-object-rest-spread": "^6.13.0",
"brfs": "^1.6.1",
"browserify": "^16.1.1",
"del": "^2.2.0",
"gulp": "^3.9.1",

Просмотреть файл

@ -199,6 +199,10 @@ babel-code-frame@^6.22.0:
esutils "^2.0.2"
js-tokens "^3.0.2"
babel-plugin-syntax-object-rest-spread@^6.13.0:
version "6.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz#fd6536f2bce13836ffa3a5458c4903a597bb3bf5"
balanced-match@^0.4.1:
version "0.4.2"
resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838"
@ -256,9 +260,9 @@ braces@^1.8.2:
preserve "^0.2.0"
repeat-element "^1.1.2"
brfs@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.5.0.tgz#a3822ed7a65723e056f89ff4b58e8abc63658f03"
brfs@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/brfs/-/brfs-1.6.1.tgz#b78ce2336d818e25eea04a0947cba6d4fb8849c3"
dependencies:
quote-stream "^1.0.1"
resolve "^1.1.5"

Просмотреть файл

@ -69,7 +69,7 @@
"@types/update-notifier": "^1.0.2",
"@types/ws": "^4.0.1",
"@types/yargs": "^8.0.2",
"babel-core": "^6.16.0",
"babel-core": "^6.26.0",
"bundlesize": "^0.14.4",
"codecov": "^2.2.0",
"commitizen": "^2.9.6",

163
yarn.lock
Просмотреть файл

@ -446,45 +446,31 @@ babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
esutils "^2.0.2"
js-tokens "^3.0.2"
babel-core@^6.16.0:
version "6.17.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.17.0.tgz#6c4576447df479e241e58c807e4bc7da4db7f425"
babel-core@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8"
dependencies:
babel-code-frame "^6.16.0"
babel-generator "^6.17.0"
babel-helpers "^6.16.0"
babel-messages "^6.8.0"
babel-register "^6.16.0"
babel-runtime "^6.9.1"
babel-template "^6.16.0"
babel-traverse "^6.16.0"
babel-types "^6.16.0"
babylon "^6.11.0"
convert-source-map "^1.1.0"
debug "^2.1.1"
json5 "^0.4.0"
lodash "^4.2.0"
minimatch "^3.0.2"
path-exists "^1.0.0"
path-is-absolute "^1.0.0"
private "^0.1.6"
shebang-regex "^1.0.0"
babel-code-frame "^6.26.0"
babel-generator "^6.26.0"
babel-helpers "^6.24.1"
babel-messages "^6.23.0"
babel-register "^6.26.0"
babel-runtime "^6.26.0"
babel-template "^6.26.0"
babel-traverse "^6.26.0"
babel-types "^6.26.0"
babylon "^6.18.0"
convert-source-map "^1.5.0"
debug "^2.6.8"
json5 "^0.5.1"
lodash "^4.17.4"
minimatch "^3.0.4"
path-is-absolute "^1.0.1"
private "^0.1.7"
slash "^1.0.0"
source-map "^0.5.0"
source-map "^0.5.6"
babel-generator@^6.17.0:
version "6.17.0"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.17.0.tgz#b894e3808beef7800f2550635bfe024b6226cf33"
dependencies:
babel-messages "^6.8.0"
babel-runtime "^6.9.0"
babel-types "^6.16.0"
detect-indent "^3.0.1"
jsesc "^1.3.0"
lodash "^4.2.0"
source-map "^0.5.0"
babel-generator@^6.18.0:
babel-generator@^6.18.0, babel-generator@^6.26.0:
version "6.26.1"
resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90"
dependencies:
@ -497,12 +483,12 @@ babel-generator@^6.18.0:
source-map "^0.5.7"
trim-right "^1.0.1"
babel-helpers@^6.16.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.16.0.tgz#1095ec10d99279460553e67eb3eee9973d3867e3"
babel-helpers@^6.24.1:
version "6.24.1"
resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
dependencies:
babel-runtime "^6.0.0"
babel-template "^6.16.0"
babel-runtime "^6.22.0"
babel-template "^6.24.1"
babel-messages@^6.23.0:
version "6.23.0"
@ -516,20 +502,19 @@ babel-messages@^6.8.0:
dependencies:
babel-runtime "^6.0.0"
babel-register@^6.16.0:
version "6.16.3"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.16.3.tgz#7b0c0ca7bfdeb9188ba4c27e5fcb7599a497c624"
babel-register@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
dependencies:
babel-core "^6.16.0"
babel-runtime "^6.11.6"
core-js "^2.4.0"
home-or-tmp "^1.0.0"
lodash "^4.2.0"
babel-core "^6.26.0"
babel-runtime "^6.26.0"
core-js "^2.5.0"
home-or-tmp "^2.0.0"
lodash "^4.17.4"
mkdirp "^0.5.1"
path-exists "^1.0.0"
source-map-support "^0.4.2"
source-map-support "^0.4.15"
babel-runtime@^6.0.0, babel-runtime@^6.11.6, babel-runtime@^6.9.0, babel-runtime@^6.9.1:
babel-runtime@^6.0.0, babel-runtime@^6.9.0, babel-runtime@^6.9.1:
version "6.11.6"
resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.11.6.tgz#6db707fef2d49c49bfa3cb64efdb436b518b8222"
dependencies:
@ -553,6 +538,16 @@ babel-template@^6.16.0:
babylon "^6.11.0"
lodash "^4.2.0"
babel-template@^6.24.1, babel-template@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
dependencies:
babel-runtime "^6.26.0"
babel-traverse "^6.26.0"
babel-types "^6.26.0"
babylon "^6.18.0"
lodash "^4.17.4"
babel-traverse@^6.16.0:
version "6.16.0"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.16.0.tgz#fba85ae1fd4d107de9ce003149cc57f53bef0c4f"
@ -567,7 +562,7 @@ babel-traverse@^6.16.0:
invariant "^2.2.0"
lodash "^4.2.0"
babel-traverse@^6.18.0:
babel-traverse@^6.18.0, babel-traverse@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
dependencies:
@ -1203,11 +1198,7 @@ conventional-commits-parser@^2.0.0:
through2 "^2.0.0"
trim-off-newlines "^1.0.0"
convert-source-map@^1.1.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.3.0.tgz#e9f3e9c6e2728efc2676696a70eb382f73106a67"
convert-source-map@^1.5.1:
convert-source-map@^1.5.0, convert-source-map@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.1.tgz#b8278097b9bc229365de5c62cf5fcaed8b5599e5"
@ -1223,6 +1214,10 @@ core-js@^2.4.0:
version "2.4.1"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
core-js@^2.5.0:
version "2.5.5"
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.5.tgz#b14dde936c640c0579a6b50cabcc132dd6127e3b"
core-util-is@~1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@ -1365,7 +1360,7 @@ debug@2.6.9, debug@^2.3.3:
dependencies:
ms "2.0.0"
debug@^2.1.1, debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:
debug@^2.2.0, debug@^2.4.5, debug@^2.6.8:
version "2.6.8"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc"
dependencies:
@ -1460,14 +1455,6 @@ detect-indent@4.0.0, detect-indent@^4.0.0:
dependencies:
repeating "^2.0.0"
detect-indent@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-3.0.1.tgz#9dc5e5ddbceef8325764b9451b02bc6d54084f75"
dependencies:
get-stdin "^4.0.1"
minimist "^1.1.0"
repeating "^1.1.0"
devtools-timeline-model@1.1.6:
version "1.1.6"
resolved "https://registry.yarnpkg.com/devtools-timeline-model/-/devtools-timeline-model-1.1.6.tgz#7be51a73b55d727b597bb30dd1ed2e8e210639a5"
@ -2436,12 +2423,12 @@ hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
home-or-tmp@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-1.0.0.tgz#4b9f1e40800c3e50c6c27f781676afcce71f3985"
home-or-tmp@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
dependencies:
os-homedir "^1.0.0"
os-tmpdir "^1.0.1"
user-home "^1.1.1"
hosted-git-info@^2.1.4:
version "2.1.5"
@ -3009,9 +2996,9 @@ json3@3.3.2:
version "3.3.2"
resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1"
json5@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.4.0.tgz#054352e4c4c80c86c0923877d449de176a732c8d"
json5@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
jsonfile@^2.1.0:
version "2.4.0"
@ -3892,15 +3879,11 @@ path-exists@2.1.0, path-exists@^2.0.0:
dependencies:
pinkie-promise "^2.0.0"
path-exists@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-1.0.0.tgz#d5a8998eb71ef37a74c34eb0d9eba6e878eea081"
path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
path-is-absolute@^1.0.0:
path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
@ -4012,9 +3995,9 @@ prettycli@^1.4.3:
dependencies:
chalk "2.1.0"
private@^0.1.6:
version "0.1.6"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.6.tgz#55c6a976d0f9bafb9924851350fe47b9b5fbb7c1"
private@^0.1.7:
version "0.1.8"
resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"
process-nextick-args@^1.0.6, process-nextick-args@~1.0.6:
version "1.0.7"
@ -4237,12 +4220,6 @@ repeat-string@^1.6.1:
version "1.6.1"
resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
repeating@^1.1.0:
version "1.1.3"
resolved "https://registry.yarnpkg.com/repeating/-/repeating-1.1.3.tgz#3d4114218877537494f97f77f9785fab810fa4ac"
dependencies:
is-finite "^1.0.0"
repeating@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
@ -4584,11 +4561,11 @@ source-map-resolve@^0.5.0:
source-map-url "^0.4.0"
urix "^0.1.0"
source-map-support@^0.4.2:
version "0.4.3"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.3.tgz#693c8383d4389a4569486987c219744dfc601685"
source-map-support@^0.4.15:
version "0.4.18"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
dependencies:
source-map "^0.5.3"
source-map "^0.5.6"
source-map-url@^0.4.0:
version "0.4.0"
@ -4600,7 +4577,7 @@ source-map@^0.4.4:
dependencies:
amdefine ">=0.0.4"
source-map@^0.5.0, source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1:
source-map@^0.5.1, source-map@^0.5.3, source-map@~0.5.1:
version "0.5.6"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412"