From 6d844ee089b59dc0fdb48e0ec9813d7f54e7f2c7 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Tue, 18 Dec 2018 10:35:03 -0800 Subject: [PATCH 01/47] Add publishConfig --- packages/core/fs/package.json | 3 +++ packages/core/logger/package.json | 3 +++ packages/core/utils/package.json | 3 +++ packages/core/watcher/package.json | 3 +++ packages/core/workers/package.json | 3 +++ 5 files changed, 15 insertions(+) diff --git a/packages/core/fs/package.json b/packages/core/fs/package.json index 587d423aa82..8decfcc5b1a 100644 --- a/packages/core/fs/package.json +++ b/packages/core/fs/package.json @@ -11,6 +11,9 @@ "engines": { "node": ">= 6.0.0" }, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "echo this package has no tests yet", "test-ci": "yarn build && yarn test", diff --git a/packages/core/logger/package.json b/packages/core/logger/package.json index de2aeab6ea0..ca3f6871982 100644 --- a/packages/core/logger/package.json +++ b/packages/core/logger/package.json @@ -11,6 +11,9 @@ "engines": { "node": ">= 6.0.0" }, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "cross-env NODE_ENV=test mocha", "test-ci": "yarn build && yarn test", diff --git a/packages/core/utils/package.json b/packages/core/utils/package.json index 988a8f50732..57e9341df5f 100644 --- a/packages/core/utils/package.json +++ b/packages/core/utils/package.json @@ -11,6 +11,9 @@ "engines": { "node": ">= 6.0.0" }, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "echo this package has no tests yet", "test-ci": "yarn build && yarn test", diff --git a/packages/core/watcher/package.json b/packages/core/watcher/package.json index c7f813065f3..0498e07b139 100644 --- a/packages/core/watcher/package.json +++ b/packages/core/watcher/package.json @@ -8,6 +8,9 @@ "type": "git", "url": "https://github.com/parcel-bundler/parcel.git" }, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "cross-env NODE_ENV=test mocha", "test-ci": "yarn build && yarn test", diff --git a/packages/core/workers/package.json b/packages/core/workers/package.json index 2f2e9827fd7..7b9aa01d75a 100644 --- a/packages/core/workers/package.json +++ b/packages/core/workers/package.json @@ -11,6 +11,9 @@ "engines": { "node": ">= 6.0.0" }, + "publishConfig": { + "access": "public" + }, "scripts": { "test": "cross-env NODE_ENV=test mocha", "test-ci": "yarn build && yarn test", From 34eb91e8e6991073e594bff731c333d09b0403b5 Mon Sep 17 00:00:00 2001 From: Devon Govett Date: Tue, 18 Dec 2018 10:35:23 -0800 Subject: [PATCH 02/47] Publish - @parcel/babel-register@1.11.0 - @parcel/fs@1.11.0 - @parcel/integration-tests@1.11.0 - @parcel/logger@1.11.0 - parcel-bundler@1.11.0 - @parcel/test-utils@1.11.0 - @parcel/utils@1.11.0 - @parcel/watcher@1.11.0 - @parcel/workers@1.11.0 --- packages/core/babel-register/package.json | 2 +- packages/core/fs/package.json | 4 ++-- packages/core/integration-tests/package.json | 8 ++++---- packages/core/logger/package.json | 8 ++++---- packages/core/parcel-bundler/package.json | 16 ++++++++-------- packages/core/test-utils/package.json | 2 +- packages/core/utils/package.json | 2 +- packages/core/watcher/package.json | 12 ++++++------ packages/core/workers/package.json | 6 +++--- 9 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/core/babel-register/package.json b/packages/core/babel-register/package.json index 4386c3c6408..c8860593f34 100644 --- a/packages/core/babel-register/package.json +++ b/packages/core/babel-register/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/babel-register", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", diff --git a/packages/core/fs/package.json b/packages/core/fs/package.json index 8decfcc5b1a..05489f28cd7 100644 --- a/packages/core/fs/package.json +++ b/packages/core/fs/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/fs", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", @@ -23,7 +23,7 @@ "prepublish": "yarn build" }, "dependencies": { - "@parcel/utils": "^1.10.3", + "@parcel/utils": "^1.11.0", "mkdirp": "^0.5.1", "rimraf": "^2.6.2" } diff --git a/packages/core/integration-tests/package.json b/packages/core/integration-tests/package.json index 05f684ff89a..8cf563fb5ac 100644 --- a/packages/core/integration-tests/package.json +++ b/packages/core/integration-tests/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/integration-tests", - "version": "1.10.3", + "version": "1.11.0", "private": true, "license": "MIT", "repository": { @@ -14,8 +14,8 @@ "devDependencies": { "@babel/core": "^7.2.0", "@jetbrains/kotlinc-js-api": "^1.2.12", - "@parcel/fs": "^1.10.3", - "@parcel/test-utils": "^1.10.3", + "@parcel/fs": "^1.11.0", + "@parcel/test-utils": "^1.11.0", "codecov": "^3.0.0", "command-exists": "^1.2.6", "graphql-tag": "^2.6.0", @@ -26,7 +26,7 @@ "mocha-multi-reporters": "^1.1.7", "ncp": "^2.0.0", "nyc": "^11.1.0", - "parcel-bundler": "^1.10.3", + "parcel-bundler": "^1.11.0", "rimraf": "^2.6.1", "sinon": "^5.0.1", "sourcemap-validator": "^1.0.6", diff --git a/packages/core/logger/package.json b/packages/core/logger/package.json index ca3f6871982..bedcd5e884e 100644 --- a/packages/core/logger/package.json +++ b/packages/core/logger/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/logger", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", @@ -23,15 +23,15 @@ "prepublish": "yarn build" }, "dependencies": { - "@parcel/workers": "^1.10.3", + "@parcel/workers": "^1.11.0", "chalk": "^2.1.0", "grapheme-breaker": "^0.3.2", "ora": "^2.1.0", "strip-ansi": "^4.0.0" }, "devDependencies": { + "@parcel/babel-register": "^1.11.0", "mocha": "^5.2.0", - "sinon": "^5.0.1", - "@parcel/babel-register": "^1.10.3" + "sinon": "^5.0.1" } } diff --git a/packages/core/parcel-bundler/package.json b/packages/core/parcel-bundler/package.json index 7399202ea5b..1e819659199 100644 --- a/packages/core/parcel-bundler/package.json +++ b/packages/core/parcel-bundler/package.json @@ -1,6 +1,6 @@ { "name": "parcel-bundler", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", @@ -28,11 +28,11 @@ "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", "@iarna/toml": "^2.2.0", - "@parcel/fs": "^1.10.3", - "@parcel/logger": "^1.10.3", - "@parcel/utils": "^1.10.3", - "@parcel/watcher": "1.10.3", - "@parcel/workers": "^1.10.3", + "@parcel/fs": "^1.11.0", + "@parcel/logger": "^1.11.0", + "@parcel/utils": "^1.11.0", + "@parcel/watcher": "^1.11.0", + "@parcel/workers": "^1.11.0", "ansi-to-html": "^0.6.4", "babylon-walk": "^1.0.2", "browserslist": "^4.1.0", @@ -78,8 +78,8 @@ "@babel/plugin-syntax-export-namespace-from": "^7.0.0", "@babel/plugin-transform-runtime": "^7.0.0", "@babel/preset-flow": "^7.0.0", - "@parcel/babel-register": "^1.10.3", - "@parcel/test-utils": "^1.10.3", + "@parcel/babel-register": "^1.11.0", + "@parcel/test-utils": "^1.11.0", "@vue/component-compiler-utils": "^2.0.0", "babel-core": "^6.26.3", "babel-preset-env": "^1.7.0", diff --git a/packages/core/test-utils/package.json b/packages/core/test-utils/package.json index 8e36cc28e0d..21b34740888 100644 --- a/packages/core/test-utils/package.json +++ b/packages/core/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/test-utils", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", diff --git a/packages/core/utils/package.json b/packages/core/utils/package.json index 57e9341df5f..31533a8d96b 100644 --- a/packages/core/utils/package.json +++ b/packages/core/utils/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/utils", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", diff --git a/packages/core/watcher/package.json b/packages/core/watcher/package.json index 0498e07b139..65720e86e28 100644 --- a/packages/core/watcher/package.json +++ b/packages/core/watcher/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/watcher", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", @@ -20,13 +20,13 @@ "prepublish": "yarn build" }, "dependencies": { - "@parcel/utils": "^1.10.3", + "@parcel/utils": "^1.11.0", "chokidar": "^2.0.3" }, "devDependencies": { - "mocha": "^5.2.0", - "@parcel/babel-register": "^1.10.3", - "@parcel/fs": "^1.10.3", - "@parcel/test-utils": "^1.10.3" + "@parcel/babel-register": "^1.11.0", + "@parcel/fs": "^1.11.0", + "@parcel/test-utils": "^1.11.0", + "mocha": "^5.2.0" } } diff --git a/packages/core/workers/package.json b/packages/core/workers/package.json index 7b9aa01d75a..e25cf332204 100644 --- a/packages/core/workers/package.json +++ b/packages/core/workers/package.json @@ -1,6 +1,6 @@ { "name": "@parcel/workers", - "version": "1.10.3", + "version": "1.11.0", "description": "Blazing fast, zero configuration web application bundler", "main": "index.js", "license": "MIT", @@ -26,7 +26,7 @@ "mocha": "^5.2.0" }, "dependencies": { - "physical-cpu-count": "^2.0.0", - "@parcel/utils": "^1.10.3" + "@parcel/utils": "^1.11.0", + "physical-cpu-count": "^2.0.0" } } From 4189dcb9fc95ee2b348a6071e21e6d092ee82265 Mon Sep 17 00:00:00 2001 From: Dan Dascalescu Date: Tue, 18 Dec 2018 18:34:04 -0800 Subject: [PATCH 03/47] seperate -> separate (#2437) --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce7d382d42e..7e904a13617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and parcel adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - Add support for HMR with elm-hot [Details](https://github.com/parcel-bundler/parcel/pull/2388) - Log dev server access for log level verbose or more [Details](https://github.com/parcel-bundler/parcel/pull/2402) - Process array of assets for JSON-LD [Details](https://github.com/parcel-bundler/parcel/pull/2319) -- Extract workerfarm into seperate package [Details](https://github.com/parcel-bundler/parcel/pull/2162) +- Extract workerfarm into separate package [Details](https://github.com/parcel-bundler/parcel/pull/2162) - Extract Logger into its own package [Details](https://github.com/parcel-bundler/parcel/pull/2165) - Extract watcher into its own package [Details](https://github.com/parcel-bundler/parcel/pull/2176) - Merge fs-watcher-child into Parcel's monorepo [Details](https://github.com/parcel-bundler/parcel/pull/2197) @@ -538,7 +538,7 @@ and parcel adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). - Opencollective [Details](https://github.com/parcel-bundler/parcel/commit/0f554dc2f5c8f2557ec84eee5301b90ffb279764) - Use `JSON5` to parse config files [Details](https://github.com/parcel-bundler/parcel/commit/bd458660ce38e7a1d25bd9758084acc24418e054) -- Move JSAsset options gathering into seperate function [Details](https://github.com/parcel-bundler/parcel/commit/333c3aa5d20f98a5f3c52635751032d12854c13c) +- Move JSAsset options gathering into separate function [Details](https://github.com/parcel-bundler/parcel/commit/333c3aa5d20f98a5f3c52635751032d12854c13c) ### Fixed From 449a48e91894861774b702f072564a3f70a3f595 Mon Sep 17 00:00:00 2001 From: "Robert Hurst (Dialpad)" <43556103+rhurstdialpad@users.noreply.github.com> Date: Fri, 21 Dec 2018 07:00:52 -0800 Subject: [PATCH 04/47] Add support for `chrome-extension://` protocol to bundle-url.js (#2434) --- packages/core/parcel-bundler/src/builtins/bundle-url.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/parcel-bundler/src/builtins/bundle-url.js b/packages/core/parcel-bundler/src/builtins/bundle-url.js index 5815b1dd033..533ba60c9f5 100644 --- a/packages/core/parcel-bundler/src/builtins/bundle-url.js +++ b/packages/core/parcel-bundler/src/builtins/bundle-url.js @@ -12,7 +12,7 @@ function getBundleURL() { try { throw new Error; } catch (err) { - var matches = ('' + err.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g); + var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension):\/\/[^)\n]+/g); if (matches) { return getBaseURL(matches[0]); } @@ -22,7 +22,7 @@ function getBundleURL() { } function getBaseURL(url) { - return ('' + url).replace(/^((?:https?|file|ftp):\/\/.+)\/[^/]+$/, '$1') + '/'; + return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension):\/\/.+)\/[^/]+$/, '$1') + '/'; } exports.getBundleURL = getBundleURLCached; From 0fac29efd7a60cd982eb26ba026ac4b8ad715e91 Mon Sep 17 00:00:00 2001 From: Dan Marshall Date: Mon, 24 Dec 2018 14:14:12 -0800 Subject: [PATCH 05/47] Resolve package.browser in subfolders (with backslashes) (#2445) * add alias lookup when filename contains backslashes * Create subfile.js in a deep subfolder * Create nested.js * add unit test for files in subfolders * prettier * Remove white space * zero length file --- packages/core/parcel-bundler/src/Resolver.js | 4 ++++ .../package-browser-alias/nested.js | 0 .../package-browser-alias/package.json | 3 ++- .../subfolder1/subfolder2/subfile.js | 0 packages/core/parcel-bundler/test/resolver.js | 22 +++++++++++++++++++ 5 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/nested.js create mode 100644 packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/subfolder1/subfolder2/subfile.js diff --git a/packages/core/parcel-bundler/src/Resolver.js b/packages/core/parcel-bundler/src/Resolver.js index d5037782eaa..f63c13a8f90 100755 --- a/packages/core/parcel-bundler/src/Resolver.js +++ b/packages/core/parcel-bundler/src/Resolver.js @@ -405,6 +405,10 @@ class Resolver { } } } + // Or try a lookup replacing backslash characters with forward slash + if (alias == null && ~filename.indexOf('\\')) { + alias = aliases[filename.replace(/\\/g, '/')]; + } } if (typeof alias === 'string') { diff --git a/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/nested.js b/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/nested.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/package.json b/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/package.json index 8dd1b6b1544..b173a0e5612 100644 --- a/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/package.json +++ b/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/package.json @@ -3,6 +3,7 @@ "main": "main.js", "browser": { "./main.js": "./browser.js", - "./foo": "./bar" + "./foo": "./bar", + "./nested.js": "./subfolder1/subfolder2/subfile.js" } } diff --git a/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/subfolder1/subfolder2/subfile.js b/packages/core/parcel-bundler/test/integration/resolver/node_modules/package-browser-alias/subfolder1/subfolder2/subfile.js new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/core/parcel-bundler/test/resolver.js b/packages/core/parcel-bundler/test/resolver.js index f645f23dd8d..f16bdd7d9cd 100644 --- a/packages/core/parcel-bundler/test/resolver.js +++ b/packages/core/parcel-bundler/test/resolver.js @@ -362,6 +362,28 @@ describe('resolver', function() { assert.equal(resolved.pkg.name, 'package-browser-alias'); }); + it('should alias a deep nested relative file using the package.browser field', async function() { + let resolved = await resolver.resolve( + './nested', + path.join( + rootDir, + 'node_modules', + 'package-browser-alias', + 'browser.js' + ) + ); + assert.equal( + resolved.path, + path.join( + rootDir, + 'node_modules', + 'package-browser-alias', + 'subfolder1/subfolder2/subfile.js' + ) + ); + assert.equal(resolved.pkg.name, 'package-browser-alias'); + }); + it('should alias a sub-file using the package.alias field', async function() { let resolved = await resolver.resolve( 'package-alias/foo', From 0c0563dee58fced5bb4c1b9fb6b04bdc49872013 Mon Sep 17 00:00:00 2001 From: Kirill Rogovoy Date: Thu, 27 Dec 2018 18:14:06 +0200 Subject: [PATCH 06/47] Generate source map files with long extentions (e.g. .js.map) (#2472) --- packages/core/integration-tests/test/css.js | 4 ++-- .../core/integration-tests/test/sourcemaps.js | 20 +++++++++---------- packages/core/parcel-bundler/src/Bundle.js | 15 ++++++++++++-- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/packages/core/integration-tests/test/css.js b/packages/core/integration-tests/test/css.js index 44be2354224..ac8db41d712 100644 --- a/packages/core/integration-tests/test/css.js +++ b/packages/core/integration-tests/test/css.js @@ -12,7 +12,7 @@ describe('css', function() { assets: ['index.js', 'index.css', 'local.js', 'local.css'], childBundles: [ { - name: 'index.map' + name: 'index.js.map' }, { name: 'index.css', @@ -88,7 +88,7 @@ describe('css', function() { childBundles: [] }, { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] diff --git a/packages/core/integration-tests/test/sourcemaps.js b/packages/core/integration-tests/test/sourcemaps.js index 4eafe6b6e05..dad3d802d18 100644 --- a/packages/core/integration-tests/test/sourcemaps.js +++ b/packages/core/integration-tests/test/sourcemaps.js @@ -14,7 +14,7 @@ describe('sourcemaps', function() { assets: ['index.js'], childBundles: [ { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] @@ -24,7 +24,7 @@ describe('sourcemaps', function() { path.join(__dirname, '/dist/index.js') )).toString(); let map = (await fs.readFile( - path.join(__dirname, '/dist/index.map') + path.join(__dirname, '/dist/index.js.map') )).toString(); mapValidator(raw, map); let mapObject = JSON.parse(map); @@ -59,7 +59,7 @@ describe('sourcemaps', function() { assets: ['index.ts'], childBundles: [ { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] @@ -69,7 +69,7 @@ describe('sourcemaps', function() { path.join(__dirname, '/dist/index.js') )).toString(); let map = (await fs.readFile( - path.join(__dirname, '/dist/index.map') + path.join(__dirname, '/dist/index.js.map') )).toString(); mapValidator(raw, map); @@ -88,7 +88,7 @@ describe('sourcemaps', function() { assets: ['index.ts', 'local.ts'], childBundles: [ { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] @@ -98,7 +98,7 @@ describe('sourcemaps', function() { path.join(__dirname, '/dist/index.js') )).toString(); let map = (await fs.readFile( - path.join(__dirname, '/dist/index.map') + path.join(__dirname, '/dist/index.js.map') )).toString(); mapValidator(raw, map); @@ -117,7 +117,7 @@ describe('sourcemaps', function() { assets: ['index.js', 'local.js', 'util.js'], childBundles: [ { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] @@ -127,7 +127,7 @@ describe('sourcemaps', function() { path.join(__dirname, '/dist/index.js') )).toString(); let map = (await fs.readFile( - path.join(__dirname, '/dist/index.map') + path.join(__dirname, '/dist/index.js.map') )).toString(); mapValidator(raw, map); @@ -149,7 +149,7 @@ describe('sourcemaps', function() { assets: ['index.js', 'local.js', 'util.js'], childBundles: [ { - name: 'index.map', + name: 'index.js.map', type: 'map' } ] @@ -159,7 +159,7 @@ describe('sourcemaps', function() { path.join(__dirname, '/dist/index.js') )).toString(); let map = (await fs.readFile( - path.join(__dirname, '/dist/index.map') + path.join(__dirname, '/dist/index.js.map') )).toString(); mapValidator(raw, map); diff --git a/packages/core/parcel-bundler/src/Bundle.js b/packages/core/parcel-bundler/src/Bundle.js index e4dbf718776..1847eb3eaec 100644 --- a/packages/core/parcel-bundler/src/Bundle.js +++ b/packages/core/parcel-bundler/src/Bundle.js @@ -64,7 +64,11 @@ class Bundle { type, Path.join( Path.dirname(this.name), - Path.basename(this.name, Path.extname(this.name)) + '.' + type + // keep the original extension for source map files, so we have + // .js.map instead of just .map + type === 'map' + ? Path.basename(this.name) + '.' + type + : Path.basename(this.name, Path.extname(this.name)) + '.' + type ), this ); @@ -110,7 +114,14 @@ class Bundle { getHashedBundleName(contentHash) { // If content hashing is enabled, generate a hash from all assets in the bundle. // Otherwise, use a hash of the filename so it remains consistent across builds. - let ext = Path.extname(this.name); + let basename = Path.basename(this.name); + + let ext = Path.extname(basename); + if (this.type === 'map') { + // Using this instead of Path.extname because the source map files have long + // extensions like '.js.map' but extname only return the last piece (.map). + ext = basename.substring(basename.indexOf('.')); + } let hash = (contentHash ? this.getHash() : Path.basename(this.name, ext) From 46f6fe7822d9fad98f637f7eec29699362cdf653 Mon Sep 17 00:00:00 2001 From: DefiantDog66 Date: Thu, 27 Dec 2018 17:27:33 +0000 Subject: [PATCH 07/47] Update README.md (#2473) This matters --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 68c4d2000f0..cbe0d6d3fd2 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ or with npm: npm install -g parcel-bundler ``` -2. Parcel can take any type of file as an entry point, but an HTML or JavaScript file is a good place to start. If you link your main JavaScript file in the HTML using a relative path, Parcel will also process it for you, and replace the reference with a URL to the output file. +2. Parcel can take any type of file as an entry point, but a HTML or JavaScript file is a good place to start. If you link your main JavaScript file in the HTML using a relative path, Parcel will also process it for you, and replace the reference with a URL to the output file. ```html @@ -46,7 +46,7 @@ npm install -g parcel-bundler ``` -3. Parcel has a development server built in, which will automatically rebuild your app as you change files and supports hot module replacement for fast development. Just point it at your entry file: +3. Parcel has a development server built in which will automatically rebuild your app as you change files and supports hot module replacement for fast development. Just point it at your entry file: ```shell parcel index.html From 8322e477e638c5d6526d894bf98af074a68543c5 Mon Sep 17 00:00:00 2001 From: Abdullah <5623766+abdullahtariq1171@users.noreply.github.com> Date: Sun, 30 Dec 2018 21:51:57 +0500 Subject: [PATCH 08/47] fix chokidar ignored regex (#2479) --- packages/core/watcher/src/Watcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/watcher/src/Watcher.js b/packages/core/watcher/src/Watcher.js index dccd5cf3292..47400a7c1e8 100644 --- a/packages/core/watcher/src/Watcher.js +++ b/packages/core/watcher/src/Watcher.js @@ -19,7 +19,7 @@ class Watcher extends EventEmitter { process.platform === 'darwin' && process.env.NODE_ENV !== 'test', ignoreInitial: true, ignorePermissionErrors: true, - ignored: /\.cache|\.git/ + ignored: /(^|[/\\])\.(git|cache)/ } ) { super(); From d04192b2dc827c3d01bd6ba723d2920d2c60d149 Mon Sep 17 00:00:00 2001 From: Viktor Hundahl Strate Date: Mon, 31 Dec 2018 17:57:58 +0100 Subject: [PATCH 09/47] Add support for Firefox's 'moz-extension://' protocol, to bundle-url.js (#2465) --- packages/core/parcel-bundler/src/builtins/bundle-url.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/parcel-bundler/src/builtins/bundle-url.js b/packages/core/parcel-bundler/src/builtins/bundle-url.js index 533ba60c9f5..b38a6b119d3 100644 --- a/packages/core/parcel-bundler/src/builtins/bundle-url.js +++ b/packages/core/parcel-bundler/src/builtins/bundle-url.js @@ -12,7 +12,7 @@ function getBundleURL() { try { throw new Error; } catch (err) { - var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension):\/\/[^)\n]+/g); + var matches = ('' + err.stack).match(/(https?|file|ftp|chrome-extension|moz-extension):\/\/[^)\n]+/g); if (matches) { return getBaseURL(matches[0]); } @@ -22,7 +22,7 @@ function getBundleURL() { } function getBaseURL(url) { - return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension):\/\/.+)\/[^/]+$/, '$1') + '/'; + return ('' + url).replace(/^((?:https?|file|ftp|chrome-extension|moz-extension):\/\/.+)\/[^/]+$/, '$1') + '/'; } exports.getBundleURL = getBundleURLCached; From c3d99dee452640cd0ffb0e17682e482e8c3abd85 Mon Sep 17 00:00:00 2001 From: Matthew Cheely Date: Thu, 3 Jan 2019 08:24:22 -0500 Subject: [PATCH 10/47] Defer throwing asset errors until after dependencies are handled. (#2475) * Defer throwing asset errors until after dependencies are handled. This allows compiled langauges like Elm that handle their own dependency compilation to set up watchers for dependencies so that hot-reload continues to work due to errors in new depdenencies. Fixes #2147. * Fix Elm error generation. I'm not entirely sure why this fix is necessary, but without it a compile error during a rebuild results in Parcel printing "Unknown error" instead of anything useful. Since we are intecepting the error though, we can also remove redundant stack information. * Add test for tracking dependencies on error * revert hmr-runtime changes * Transform all errors in Pipeline.process. This prevents error data from being lost when Pipeline is run via `WorkerFarm`. * Separate error-depenency test input from basic Elm tests. * Update ElmAsset.js --- packages/core/integration-tests/test/hmr.js | 52 +++++++++++++++++++ .../test/integration/elm-dep-error/elm.json | 24 +++++++++ .../test/integration/elm-dep-error/index.js | 5 ++ .../elm-dep-error/src/BrokenDep.elm | 8 +++ .../integration/elm-dep-error/src/Main.elm | 7 +++ packages/core/parcel-bundler/src/Bundler.js | 7 +++ packages/core/parcel-bundler/src/Pipeline.js | 14 +++-- .../parcel-bundler/src/assets/ElmAsset.js | 21 +++++--- 8 files changed, 129 insertions(+), 9 deletions(-) create mode 100644 packages/core/integration-tests/test/integration/elm-dep-error/elm.json create mode 100644 packages/core/integration-tests/test/integration/elm-dep-error/index.js create mode 100644 packages/core/integration-tests/test/integration/elm-dep-error/src/BrokenDep.elm create mode 100644 packages/core/integration-tests/test/integration/elm-dep-error/src/Main.elm diff --git a/packages/core/integration-tests/test/hmr.js b/packages/core/integration-tests/test/hmr.js index e06276c6e30..7ea84ce743b 100644 --- a/packages/core/integration-tests/test/hmr.js +++ b/packages/core/integration-tests/test/hmr.js @@ -529,4 +529,56 @@ describe('hmr', function() { await buildEnd; }); + + it('should watch new dependencies that cause errors', async function() { + await ncp( + path.join(__dirname, '/integration/elm-dep-error'), + path.join(__dirname, '/input') + ); + + b = bundler(path.join(__dirname, '/input/index.js'), { + watch: true, + hmr: true + }); + await b.bundle(); + + ws = new WebSocket('ws://localhost:' + b.options.hmrPort); + + const buildEnd = nextEvent(b, 'buildEnd'); + + await sleep(100); + fs.writeFile( + path.join(__dirname, '/input/src/Main.elm'), + ` +module Main exposing (main) + +import BrokenDep +import Html + +main = + Html.text "Hello, world!" + ` + ); + + let msg = JSON.parse(await nextEvent(ws, 'message')); + assert.equal(msg.type, 'error'); + + await sleep(100); + fs.writeFile( + path.join(__dirname, '/input/src/BrokenDep.elm'), + ` +module BrokenDep exposing (anError) + + +anError : String +anError = + "fixed" + ` + ); + + msg = JSON.parse(await nextEvent(ws, 'message')); + assert.equal(msg.type, 'error-resolved'); + + await buildEnd; + }); }); diff --git a/packages/core/integration-tests/test/integration/elm-dep-error/elm.json b/packages/core/integration-tests/test/integration/elm-dep-error/elm.json new file mode 100644 index 00000000000..dd41cae2a31 --- /dev/null +++ b/packages/core/integration-tests/test/integration/elm-dep-error/elm.json @@ -0,0 +1,24 @@ +{ + "type": "application", + "source-directories": [ + "src" + ], + "elm-version": "0.19.0", + "dependencies": { + "direct": { + "elm/browser": "1.0.0", + "elm/core": "1.0.0", + "elm/html": "1.0.0" + }, + "indirect": { + "elm/json": "1.0.0", + "elm/time": "1.0.0", + "elm/url": "1.0.0", + "elm/virtual-dom": "1.0.0" + } + }, + "test-dependencies": { + "direct": {}, + "indirect": {} + } +} \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/elm-dep-error/index.js b/packages/core/integration-tests/test/integration/elm-dep-error/index.js new file mode 100644 index 00000000000..61906ed5a66 --- /dev/null +++ b/packages/core/integration-tests/test/integration/elm-dep-error/index.js @@ -0,0 +1,5 @@ +var local = require('./src/Main.elm'); + +module.exports = function () { + return local; +}; \ No newline at end of file diff --git a/packages/core/integration-tests/test/integration/elm-dep-error/src/BrokenDep.elm b/packages/core/integration-tests/test/integration/elm-dep-error/src/BrokenDep.elm new file mode 100644 index 00000000000..b52d49738bd --- /dev/null +++ b/packages/core/integration-tests/test/integration/elm-dep-error/src/BrokenDep.elm @@ -0,0 +1,8 @@ +module BrokenDep exposing (anError) + +{- This module causes a compiler error -} + + +anError : String +anError = + 2 diff --git a/packages/core/integration-tests/test/integration/elm-dep-error/src/Main.elm b/packages/core/integration-tests/test/integration/elm-dep-error/src/Main.elm new file mode 100644 index 00000000000..67393aaa654 --- /dev/null +++ b/packages/core/integration-tests/test/integration/elm-dep-error/src/Main.elm @@ -0,0 +1,7 @@ +module Main exposing (main) + +import Html + + +main = + Html.text "Hello, world!" diff --git a/packages/core/parcel-bundler/src/Bundler.js b/packages/core/parcel-bundler/src/Bundler.js index f82222bf88f..98238faa5a2 100644 --- a/packages/core/parcel-bundler/src/Bundler.js +++ b/packages/core/parcel-bundler/src/Bundler.js @@ -593,6 +593,13 @@ class Bundler extends EventEmitter { }) ); + // If there was a processing error, re-throw now that we've set up + // depdenency watchers. This keeps reloading working if there is an + // error in a dependency not directly handled by Parcel. + if (processed.error !== null) { + throw processed.error; + } + // Store resolved assets in their original order dependencies.forEach((dep, i) => { asset.dependencies.set(dep.name, dep); diff --git a/packages/core/parcel-bundler/src/Pipeline.js b/packages/core/parcel-bundler/src/Pipeline.js index 03a7579492f..e076fa90f81 100644 --- a/packages/core/parcel-bundler/src/Pipeline.js +++ b/packages/core/parcel-bundler/src/Pipeline.js @@ -1,5 +1,6 @@ const Parser = require('./Parser'); const path = require('path'); +const {errorUtils} = require('@parcel/utils'); /** * A Pipeline composes multiple Asset types together. @@ -17,16 +18,23 @@ class Pipeline { } let asset = this.parser.getAsset(path, options); - let generated = await this.processAsset(asset); + let error = null; let generatedMap = {}; - for (let rendition of generated) { - generatedMap[rendition.type] = rendition.value; + try { + let generated = await this.processAsset(asset); + for (let rendition of generated) { + generatedMap[rendition.type] = rendition.value; + } + } catch (err) { + error = errorUtils.errorToJson(err); + error.fileName = path; } return { id: asset.id, dependencies: Array.from(asset.dependencies.values()), generated: generatedMap, + error: error, hash: asset.hash, cacheData: asset.cacheData }; diff --git a/packages/core/parcel-bundler/src/assets/ElmAsset.js b/packages/core/parcel-bundler/src/assets/ElmAsset.js index 7a2309b3a5f..5f81ebc1260 100644 --- a/packages/core/parcel-bundler/src/assets/ElmAsset.js +++ b/packages/core/parcel-bundler/src/assets/ElmAsset.js @@ -44,12 +44,7 @@ class ElmAsset extends Asset { options.optimize = true; } - let compiled = await this.elm.compileToString(this.name, options); - this.contents = compiled.toString(); - if (this.options.hmr) { - let {inject} = await localRequire('elm-hot', this.name); - this.contents = inject(this.contents); - } + this.elmOpts = options; } async collectDependencies() { @@ -76,6 +71,13 @@ class ElmAsset extends Asset { } async generate() { + let compiled = await this.elm.compileToString(this.name, this.elmOpts); + this.contents = compiled.toString(); + if (this.options.hmr) { + let {inject} = await localRequire('elm-hot', this.name); + this.contents = inject(this.contents); + } + let output = this.contents; if (this.options.minify) { @@ -129,6 +131,13 @@ class ElmAsset extends Asset { return result.code; } } + + generateErrorMessage(err) { + // The generated stack is not useful, but other code may + // expect it and try to print it, so make it an empty string. + err.stack = ''; + return err; + } } module.exports = ElmAsset; From 08398bd31e19dde4053beca0402bda24ce2a29fa Mon Sep 17 00:00:00 2001 From: Maurizio Pucci Date: Fri, 4 Jan 2019 19:19:29 +0100 Subject: [PATCH 11/47] upgrade htmlnano dep (#2506) --- packages/core/parcel-bundler/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/parcel-bundler/package.json b/packages/core/parcel-bundler/package.json index 1e819659199..5fa76b6ed63 100644 --- a/packages/core/parcel-bundler/package.json +++ b/packages/core/parcel-bundler/package.json @@ -48,7 +48,7 @@ "fast-glob": "^2.2.2", "filesize": "^3.6.0", "get-port": "^3.2.0", - "htmlnano": "^0.1.9", + "htmlnano": "^0.2.2", "is-glob": "^4.0.0", "is-url": "^1.2.2", "js-yaml": "^3.10.0", From 38df51332310e2f4b2bdf5738674724d6b3654d4 Mon Sep 17 00:00:00 2001 From: Jasper De Moor Date: Mon, 7 Jan 2019 05:13:53 +0100 Subject: [PATCH 12/47] fix(sourcemaps): Handle null mappings properly (#2149) --- packages/core/parcel-bundler/src/SourceMap.js | 43 +- .../core/parcel-bundler/test/sourcemaps.js | 199 +++++ yarn.lock | 789 +++++++----------- 3 files changed, 517 insertions(+), 514 deletions(-) create mode 100644 packages/core/parcel-bundler/test/sourcemaps.js diff --git a/packages/core/parcel-bundler/src/SourceMap.js b/packages/core/parcel-bundler/src/SourceMap.js index 82a3a7ba7e3..c7415aa778b 100644 --- a/packages/core/parcel-bundler/src/SourceMap.js +++ b/packages/core/parcel-bundler/src/SourceMap.js @@ -10,20 +10,20 @@ class SourceMap { purifyMappings(mappings) { if (Array.isArray(mappings)) { - return mappings.filter(mapping => { - return ( + return mappings.filter( + mapping => mapping && - mapping.source && - mapping.original && - typeof mapping.original.line === 'number' && - mapping.original.line > 0 && - typeof mapping.original.column === 'number' && + (typeof mapping.original === 'object' && + (mapping.original === null || + (typeof mapping.original.line === 'number' && + mapping.original.line > 0 && + typeof mapping.original.column === 'number' && + mapping.source))) && mapping.generated && typeof mapping.generated.line === 'number' && mapping.generated.line > 0 && typeof mapping.generated.column === 'number' - ); - }); + ); } return []; @@ -34,12 +34,14 @@ class SourceMap { return map; } map = typeof map === 'string' ? JSON.parse(map) : map; + if (map.sourceRoot) delete map.sourceRoot; return await new SourceMapConsumer(map); } async addMap(map, lineOffset = 0, columnOffset = 0) { - if (!(map instanceof SourceMap) && map.version) { + if (typeof map === 'string' || (typeof map === 'object' && map.version)) { let consumer = await this.getConsumer(map); + if (!consumer) return this; consumer.eachMapping(mapping => { this.addConsumerMapping(mapping, lineOffset, columnOffset); @@ -55,7 +57,7 @@ class SourceMap { // Only needs to happen in source-map 0.7 consumer.destroy(); } - } else { + } else if (map.mappings && map.sources) { if (!map.eachMapping) { map = new SourceMap(map.mappings, map.sources); } @@ -91,21 +93,22 @@ class SourceMap { } addConsumerMapping(mapping, lineOffset = 0, columnOffset = 0) { + let original = null; if ( - !mapping.source || - !mapping.originalLine || - (!mapping.originalColumn && mapping.originalColumn !== 0) + typeof mapping.originalLine === 'number' && + mapping.originalLine > 0 && + typeof mapping.originalColumn === 'number' ) { - return; + original = { + line: mapping.originalLine, + column: mapping.originalColumn + }; } this.mappings.push({ - source: mapping.source, + source: original ? mapping.source : null, name: mapping.name, - original: { - line: mapping.originalLine, - column: mapping.originalColumn - }, + original, generated: { line: mapping.generatedLine + lineOffset, column: mapping.generatedColumn + columnOffset diff --git a/packages/core/parcel-bundler/test/sourcemaps.js b/packages/core/parcel-bundler/test/sourcemaps.js new file mode 100644 index 00000000000..8e6b41cbea4 --- /dev/null +++ b/packages/core/parcel-bundler/test/sourcemaps.js @@ -0,0 +1,199 @@ +const assert = require('assert'); +const fs = require('@parcel/fs'); +const SourceMap = require('../src/SourceMap'); + +describe('sourcemaps', function() { + it('should purify mappings properly', async function() { + let mappings = [ + { + source: 'index.js', + name: 'A', + original: { + line: 0, + column: 0 + }, + generated: { + line: 0, + column: 0 + } + }, + { + generated: { + line: 1, + column: 0 + }, + original: null, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: null, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 0, + column: 0 + }, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 1, + column: 0 + }, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 1, + column: 0 + }, + source: 'index.js', + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 0, + column: 0 + }, + source: 'index.js', + name: null + }, + { + source: 'index.js', + name: 'A', + original: { + line: 1, + column: 18 + }, + generated: { + line: 4, + column: 187 + } + } + ]; + + let expectedResult = [ + { + generated: { + line: 1, + column: 0 + }, + original: null, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: null, + source: null, + name: null + }, + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 1, + column: 0 + }, + source: 'index.js', + name: null + }, + { + source: 'index.js', + name: 'A', + original: { + line: 1, + column: 18 + }, + generated: { + line: 4, + column: 187 + } + } + ]; + + let sourcemap = new SourceMap(mappings, {}); + assert.deepEqual(sourcemap.mappings, expectedResult); + }); + + it('should be able to handle null mappings properly', async function() { + let mappings = [ + { + generated: { + line: 1, + column: 0 + }, + original: { + line: 1, + column: 0 + }, + source: 'input.js', + name: 'console' + }, + { + generated: { + line: 1, + column: 7 + }, + original: null, + source: null, + name: null + } + ]; + + let sources = { + 'input.js': 'console.log("hello world!");' + }; + + let sourcemap = new SourceMap(mappings, sources); + assert.equal(sourcemap.mappings.length, 2); + assert.deepEqual(sourcemap.mappings, mappings); + + let mapString = sourcemap.stringify('index.map', '/'); + let combinedSourcemap = new SourceMap(mappings, sources); + await combinedSourcemap.addMap(mapString); + + let newMapString = combinedSourcemap.stringify('index.map', '/'); + assert.equal(mapString, newMapString); + + let newSourcemap = new SourceMap([], {}); + await newSourcemap.addMap(sourcemap); + + assert.deepEqual(newSourcemap.mappings, mappings); + + newSourcemap = new SourceMap([], {}); + await newSourcemap.addMap(mapString); + + assert.deepEqual(newSourcemap.mappings, mappings); + }); +}); diff --git a/yarn.lock b/yarn.lock index beebc180050..a848cd60b05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1425,6 +1425,11 @@ JSONStream@^1.0.4, JSONStream@^1.3.4: jsonparse "^1.2.0" through ">=2.2.7 <3" +abab@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.0.tgz#aba0ab4c5eee2d4c79d3487d85450fb2376ebb0f" + integrity sha512-sY5AXXVZv4Y1VACTtR11UJCPHHudgY5i26Qj5TypE6DKlIApbwb5uqhXcJ5UUGbvZNRh7EeIoW+LrJumBsKp7w== + abbrev@1: version "1.1.1" resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.1.1.tgz#f8f2c887ad10bf67f634f005b6987fed3179aac8" @@ -1437,6 +1442,14 @@ acorn-globals@^3.0.0: dependencies: acorn "^4.0.4" +acorn-globals@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/acorn-globals/-/acorn-globals-4.3.0.tgz#e3b6f8da3c1552a95ae627571f7dd6923bb54103" + integrity sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw== + dependencies: + acorn "^6.0.1" + acorn-walk "^6.0.1" + acorn-jsx@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-3.0.1.tgz#afdf9488fb1ecefc8348f6fb22f464e32a58b36b" @@ -1444,6 +1457,11 @@ acorn-jsx@^3.0.0: dependencies: acorn "^3.0.4" +acorn-walk@^6.0.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-6.1.1.tgz#d363b66f5fac5f018ff9c3a1e7b6f8e310cc3913" + integrity sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw== + acorn@^3.0.4, acorn@^3.1.0: version "3.3.0" resolved "https://registry.yarnpkg.com/acorn/-/acorn-3.3.0.tgz#45e37fb39e8da3f25baee3ff5369e2bb5f22017a" @@ -1454,11 +1472,16 @@ acorn@^4.0.4, acorn@~4.0.2: resolved "https://registry.yarnpkg.com/acorn/-/acorn-4.0.13.tgz#105495ae5361d697bd195c825192e1ad7f253787" integrity sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c= -acorn@^5.0.0, acorn@^5.5.0: +acorn@^5.0.0, acorn@^5.5.0, acorn@^5.5.3: version "5.7.3" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.7.3.tgz#67aa231bf8812974b85235a96771eb6bd07ea279" integrity sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw== +acorn@^6.0.1: + version "6.0.5" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-6.0.5.tgz#81730c0815f3f3b34d8efa95cb7430965f4d887a" + integrity sha512-i33Zgp3XWtmZBMNvCr4azvOFeWVw1Rk6p3hfi3LUDvIFraOMywb1kAtrbi+med14m4Xfpqm3zRZMT+c0FNE7kg== + agent-base@4, agent-base@^4.1.0, agent-base@~4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.2.1.tgz#d89e5999f797875674c07d87f260fc41e83e8ca9" @@ -1497,7 +1520,7 @@ align-text@^0.1.1, align-text@^0.1.3: longest "^1.0.1" repeat-string "^1.5.2" -alphanum-sort@^1.0.0, alphanum-sort@^1.0.1, alphanum-sort@^1.0.2: +alphanum-sort@^1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/alphanum-sort/-/alphanum-sort-1.0.2.tgz#97a1119649b211ad33691d9f9f486a8ec9fbe0a3" integrity sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM= @@ -1628,6 +1651,11 @@ array-differ@^1.0.0: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-1.0.0.tgz#eff52e3758249d33be402b8bb8e564bb2b5d4031" integrity sha1-7/UuN1gknTO+QCuLuOVkuytdQDE= +array-equal@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/array-equal/-/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93" + integrity sha1-jCpe8kcv2ep0KwTHenUJO6J1fJM= + array-find-index@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1" @@ -1735,18 +1763,6 @@ atob@^2.1.1: resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9" integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg== -autoprefixer@^6.3.1: - version "6.7.7" - resolved "https://registry.yarnpkg.com/autoprefixer/-/autoprefixer-6.7.7.tgz#1dbd1c835658e35ce3f9984099db00585c782014" - integrity sha1-Hb0cg1ZY41zj+ZhAmdsAWFx4IBQ= - dependencies: - browserslist "^1.7.6" - caniuse-db "^1.0.30000634" - normalize-range "^0.1.2" - num2fraction "^1.2.2" - postcss "^5.2.16" - postcss-value-parser "^3.2.3" - aws-sign2@~0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" @@ -2277,11 +2293,6 @@ babylon@^6.18.0: resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3" integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ== -balanced-match@^0.4.2: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" - integrity sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg= - balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" @@ -2415,6 +2426,11 @@ brorand@^1.0.1: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8= +browser-process-hrtime@^0.1.2: + version "0.1.3" + resolved "https://registry.yarnpkg.com/browser-process-hrtime/-/browser-process-hrtime-0.1.3.tgz#616f00faef1df7ec1b5bf9cfe2bdc3170f26c7b4" + integrity sha512-bRFnI4NnjO6cnyLmOV/7PVoDEMJChlcfN0z4s1YMBY989/SvlfMI1lgCnkFUs53e9gQF+w7qu7XdllSTiSl8Aw== + browser-stdout@1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60" @@ -2479,14 +2495,6 @@ browserify-zlib@^0.2.0: dependencies: pako "~1.0.5" -browserslist@^1.3.6, browserslist@^1.5.2, browserslist@^1.7.6: - version "1.7.7" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-1.7.7.tgz#0bd76704258be829b2398bb50e4b62d1a166b0b9" - integrity sha1-C9dnBCWL6CmyOYu1Dkti0aFmsLk= - dependencies: - caniuse-db "^1.0.30000639" - electron-to-chromium "^1.2.7" - browserslist@^3.2.6: version "3.2.8" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-3.2.8.tgz#b0005361d6471f0f5952797a76fc985f1f978fc6" @@ -2656,16 +2664,6 @@ camelcase@^4.1.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" integrity sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0= -caniuse-api@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-1.6.1.tgz#b534e7c734c4f81ec5fbe8aca2ad24354b962c6c" - integrity sha1-tTTnxzTE+B7F++isoq0kNUuWLGw= - dependencies: - browserslist "^1.3.6" - caniuse-db "^1.0.30000529" - lodash.memoize "^4.1.2" - lodash.uniq "^4.5.0" - caniuse-api@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/caniuse-api/-/caniuse-api-3.0.0.tgz#5e4d90e2274961d46291997df599e3ed008ee4c0" @@ -2676,11 +2674,6 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-db@^1.0.30000529, caniuse-db@^1.0.30000634, caniuse-db@^1.0.30000639: - version "1.0.30000899" - resolved "https://registry.yarnpkg.com/caniuse-db/-/caniuse-db-1.0.30000899.tgz#f66d667d507c2aa19603a4a3763d71aa89cc360f" - integrity sha512-MSCUohyoLU4/PGapapw/PLQkmQ+sFgzX6e3tM6ue8HX9HW9rBD5gRiAYKhC8r0QkvUE0pWTA8Ze6f3jrzBizVg== - caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000844, caniuse-lite@^1.0.30000898: version "1.0.30000899" resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30000899.tgz#6febdbbc388a7982f620ee0e3d09aab0c061389e" @@ -2791,13 +2784,6 @@ circular-json@^0.3.1: resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66" integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A== -clap@^1.0.9: - version "1.2.3" - resolved "https://registry.yarnpkg.com/clap/-/clap-1.2.3.tgz#4f36745b32008492557f46412d66d50cb99bce51" - integrity sha512-4CoL/A3hf90V3VIEjeuhSvlGFEHKzOz+Wfc2IVZc+FaUgU0ZQafJTP49fvnULipOPcAfqhyI2duwQyns6xqjYA== - dependencies: - chalk "^1.1.3" - class-utils@^0.3.5: version "0.3.6" resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463" @@ -2893,13 +2879,6 @@ co@^4.6.0: resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= -coa@~1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/coa/-/coa-1.0.4.tgz#a9ef153660d6a86a8bdec0289a5c684d217432fd" - integrity sha1-qe8VNmDWqGqL3sAomlxoTSF0Mv0= - dependencies: - q "^1.1.2" - coa@~2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/coa/-/coa-2.0.1.tgz#f3f8b0b15073e35d70263fb1042cb2c023db38af" @@ -2936,7 +2915,7 @@ collection-visit@^1.0.0: map-visit "^1.0.0" object-visit "^1.0.0" -color-convert@^1.3.0, color-convert@^1.9.0, color-convert@^1.9.1: +color-convert@^1.9.0, color-convert@^1.9.1: version "1.9.3" resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== @@ -2953,13 +2932,6 @@ color-name@^1.0.0: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== -color-string@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/color-string/-/color-string-0.3.0.tgz#27d46fb67025c5c2fa25993bfbf579e47841b991" - integrity sha1-J9RvtnAlxcL6JZk7+/V55HhBuZE= - dependencies: - color-name "^1.0.0" - color-string@^1.5.2: version "1.5.3" resolved "https://registry.yarnpkg.com/color-string/-/color-string-1.5.3.tgz#c9bbc5f01b58b5492f3d6857459cb6590ce204cc" @@ -2968,15 +2940,6 @@ color-string@^1.5.2: color-name "^1.0.0" simple-swizzle "^0.2.2" -color@^0.11.0: - version "0.11.4" - resolved "https://registry.yarnpkg.com/color/-/color-0.11.4.tgz#6d7b5c74fb65e841cd48792ad1ed5e07b904d764" - integrity sha1-bXtcdPtl6EHNSHkq0e1eB7kE12Q= - dependencies: - clone "^1.0.2" - color-convert "^1.3.0" - color-string "^0.3.0" - color@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/color/-/color-3.1.0.tgz#d8e9fb096732875774c84bf922815df0308d0ffc" @@ -2985,15 +2948,6 @@ color@^3.0.0: color-convert "^1.9.1" color-string "^1.5.2" -colormin@^1.0.5: - version "1.1.2" - resolved "https://registry.yarnpkg.com/colormin/-/colormin-1.1.2.tgz#ea2f7420a72b96881a38aae59ec124a6f7298133" - integrity sha1-6i90IKcrlogaOKrlnsEkpvcpgTM= - dependencies: - color "^0.11.0" - css-color-names "0.0.4" - has "^1.0.1" - colors@~1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/colors/-/colors-1.1.2.tgz#168a4701756b6a7f51a12ce0c97bfa28c084ed63" @@ -3463,6 +3417,42 @@ cssnano-preset-default@^4.0.5: postcss-svgo "^4.0.1" postcss-unique-selectors "^4.0.1" +cssnano-preset-default@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-4.0.6.tgz#92379e2a6db4a91c0ea727f5f556eeac693eab6a" + integrity sha512-UPboYbFaJFtDUhJ4fqctThWbbyF4q01/7UhsZbLzp35l+nUxtzh1SifoVlEfyLM3n3Z0htd8B1YlCxy9i+bQvg== + dependencies: + css-declaration-sorter "^4.0.1" + cssnano-util-raw-cache "^4.0.1" + postcss "^7.0.0" + postcss-calc "^7.0.0" + postcss-colormin "^4.0.2" + postcss-convert-values "^4.0.1" + postcss-discard-comments "^4.0.1" + postcss-discard-duplicates "^4.0.2" + postcss-discard-empty "^4.0.1" + postcss-discard-overridden "^4.0.1" + postcss-merge-longhand "^4.0.10" + postcss-merge-rules "^4.0.2" + postcss-minify-font-values "^4.0.2" + postcss-minify-gradients "^4.0.1" + postcss-minify-params "^4.0.1" + postcss-minify-selectors "^4.0.1" + postcss-normalize-charset "^4.0.1" + postcss-normalize-display-values "^4.0.1" + postcss-normalize-positions "^4.0.1" + postcss-normalize-repeat-style "^4.0.1" + postcss-normalize-string "^4.0.1" + postcss-normalize-timing-functions "^4.0.1" + postcss-normalize-unicode "^4.0.1" + postcss-normalize-url "^4.0.1" + postcss-normalize-whitespace "^4.0.1" + postcss-ordered-values "^4.1.1" + postcss-reduce-initial "^4.0.2" + postcss-reduce-transforms "^4.0.1" + postcss-svgo "^4.0.1" + postcss-unique-selectors "^4.0.1" + cssnano-util-get-arguments@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/cssnano-util-get-arguments/-/cssnano-util-get-arguments-4.0.0.tgz#ed3a08299f21d75741b20f3b81f194ed49cc150f" @@ -3485,44 +3475,6 @@ cssnano-util-same-parent@^4.0.0: resolved "https://registry.yarnpkg.com/cssnano-util-same-parent/-/cssnano-util-same-parent-4.0.1.tgz#574082fb2859d2db433855835d9a8456ea18bbf3" integrity sha512-WcKx5OY+KoSIAxBW6UBBRay1U6vkYheCdjyVNDm85zt5K9mHoGOfsOsqIszfAqrQQFIIKgjh2+FDgIj/zsl21Q== -cssnano@^3.4.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-3.10.0.tgz#4f38f6cea2b9b17fa01490f23f1dc68ea65c1c38" - integrity sha1-Tzj2zqK5sX+gFJDyPx3GjqZcHDg= - dependencies: - autoprefixer "^6.3.1" - decamelize "^1.1.2" - defined "^1.0.0" - has "^1.0.1" - object-assign "^4.0.1" - postcss "^5.0.14" - postcss-calc "^5.2.0" - postcss-colormin "^2.1.8" - postcss-convert-values "^2.3.4" - postcss-discard-comments "^2.0.4" - postcss-discard-duplicates "^2.0.1" - postcss-discard-empty "^2.0.1" - postcss-discard-overridden "^0.1.1" - postcss-discard-unused "^2.2.1" - postcss-filter-plugins "^2.0.0" - postcss-merge-idents "^2.1.5" - postcss-merge-longhand "^2.0.1" - postcss-merge-rules "^2.0.3" - postcss-minify-font-values "^1.0.2" - postcss-minify-gradients "^1.0.1" - postcss-minify-params "^1.0.4" - postcss-minify-selectors "^2.0.4" - postcss-normalize-charset "^1.1.0" - postcss-normalize-url "^3.0.7" - postcss-ordered-values "^2.1.0" - postcss-reduce-idents "^2.2.2" - postcss-reduce-initial "^1.0.0" - postcss-reduce-transforms "^1.0.3" - postcss-svgo "^2.1.1" - postcss-unique-selectors "^2.0.2" - postcss-value-parser "^3.2.3" - postcss-zindex "^2.0.1" - cssnano@^4.0.0: version "4.1.7" resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.7.tgz#0bf112294bec103ab5f68d3f805732c8325a0b1b" @@ -3533,6 +3485,16 @@ cssnano@^4.0.0: is-resolvable "^1.0.0" postcss "^7.0.0" +cssnano@^4.1.8: + version "4.1.8" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-4.1.8.tgz#8014989679d5fd42491e4499a521dbfb85c95fd1" + integrity sha512-5GIY0VzAHORpbKiL3rMXp4w4M1Ki+XlXgEXyuWXVd3h6hlASb+9Vo76dNP56/elLMVBBsUfusCo1q56uW0UWig== + dependencies: + cosmiconfig "^5.0.0" + cssnano-preset-default "^4.0.6" + is-resolvable "^1.0.0" + postcss "^7.0.0" + csso@^3.5.0: version "3.5.1" resolved "https://registry.yarnpkg.com/csso/-/csso-3.5.1.tgz#7b9eb8be61628973c1b261e169d2f024008e758b" @@ -3540,13 +3502,17 @@ csso@^3.5.0: dependencies: css-tree "1.0.0-alpha.29" -csso@~2.3.1: - version "2.3.2" - resolved "https://registry.yarnpkg.com/csso/-/csso-2.3.2.tgz#ddd52c587033f49e94b71fc55569f252e8ff5f85" - integrity sha1-3dUsWHAz9J6Utx/FVWnyUuj/X4U= +cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": + version "0.3.4" + resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.4.tgz#8cd52e8a3acfd68d3aed38ee0a640177d2f9d797" + integrity sha512-+7prCSORpXNeR4/fUP3rL+TzqtiFfhMvTd7uEqMdgPvLPt4+uzFUeufx5RHjGTACCargg/DiEt/moMQmvnfkog== + +cssstyle@^1.0.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/cssstyle/-/cssstyle-1.1.1.tgz#18b038a9c44d65f7a8e428a653b9f6fe42faf5fb" + integrity sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog== dependencies: - clap "^1.0.9" - source-map "^0.5.3" + cssom "0.3.x" currently-unhandled@^0.4.1: version "0.4.1" @@ -3574,6 +3540,15 @@ dashdash@^1.12.0: dependencies: assert-plus "^1.0.0" +data-urls@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/data-urls/-/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe" + integrity sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ== + dependencies: + abab "^2.0.0" + whatwg-mimetype "^2.2.0" + whatwg-url "^7.0.0" + date-fns@^1.27.2: version "1.29.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.29.0.tgz#12e609cdcb935127311d04d33334e2960a2a54e6" @@ -3723,11 +3698,6 @@ define-property@^2.0.2: is-descriptor "^1.0.2" isobject "^3.0.1" -defined@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" - integrity sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM= - del@^2.0.2: version "2.2.2" resolved "https://registry.yarnpkg.com/del/-/del-2.2.2.tgz#c12c981d067846c84bcaf862cff930d907ffd1a8" @@ -3856,6 +3826,13 @@ domelementtype@~1.1.1: resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.1.3.tgz#bd28773e2642881aec51544924299c5cd822185b" integrity sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs= +domexception@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/domexception/-/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90" + integrity sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug== + dependencies: + webidl-conversions "^4.0.2" + domhandler@^2.3.0: version "2.4.2" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" @@ -3942,7 +3919,7 @@ ee-first@1.1.1: resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -electron-to-chromium@^1.2.7, electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.81: +electron-to-chromium@^1.3.47, electron-to-chromium@^1.3.81: version "1.3.82" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.82.tgz#7d13ae4437d2a783de3f4efba96b186c540b67b1" integrity sha512-NI4nB2IWGcU4JVT1AE8kBb/dFor4zjLHMLsOROPahppeHrR0FG5uslxMmkp/thO1MvPjM2xhlKoY29/I60s0ew== @@ -4067,7 +4044,7 @@ escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2, escape-string-regexp@^1 resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -escodegen@^1.8.1: +escodegen@^1.8.1, escodegen@^1.9.1: version "1.11.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-1.11.0.tgz#b27a9389481d5bfd5bec76f7bb1eb3f8f4556589" integrity sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw== @@ -4156,11 +4133,6 @@ espree@^3.5.4: acorn "^5.5.0" acorn-jsx "^3.0.0" -esprima@^2.6.0: - version "2.7.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" - integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= - esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" @@ -4535,11 +4507,6 @@ flat-cache@^1.2.1: graceful-fs "^4.1.2" write "^0.2.1" -flatten@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/flatten/-/flatten-1.0.2.tgz#dae46a9d78fbe25292258cc1e780a41d95c03782" - integrity sha1-2uRqnXj74lKSJYzB54CkHZXAN4I= - flush-write-stream@^1.0.0: version "1.0.3" resolved "https://registry.yarnpkg.com/flush-write-stream/-/flush-write-stream-1.0.3.tgz#c5d586ef38af6097650b49bc41b55fabb19f35bd" @@ -5205,17 +5172,31 @@ html-comment-regex@^1.1.0: resolved "https://registry.yarnpkg.com/html-comment-regex/-/html-comment-regex-1.1.2.tgz#97d4688aeb5c81886a364faa0cad1dda14d433a7" integrity sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ== -htmlnano@^0.1.9: - version "0.1.10" - resolved "https://registry.yarnpkg.com/htmlnano/-/htmlnano-0.1.10.tgz#a0a548eb4c76ae2cf2423ec7a25c881734d3dea6" - integrity sha512-eTEUzz8VdWYp+w/KUdb99kwao4reR64epUySyZkQeepcyzPQ2n2EPWzibf6QDxmkGy10Kr+CKxYqI3izSbmhJQ== +html-encoding-sniffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8" + integrity sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw== dependencies: - cssnano "^3.4.0" + whatwg-encoding "^1.0.1" + +html-tags@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/html-tags/-/html-tags-1.2.0.tgz#c78de65b5663aa597989dd2b7ab49200d7e4db98" + integrity sha1-x43mW1Zjqll5id0rerSSANfk25g= + +htmlnano@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/htmlnano/-/htmlnano-0.2.2.tgz#750b2c4a92b326fe64f8748016a007b49334b372" + integrity sha512-p4NEuzj7O8GLSckYQgxxwnAP8ryVm4UuZSID7Z4EcFzg/i7XTx+3QOYpWSkmIxIquIaM0yOlGbdnzoTD1UkTLw== + dependencies: + cssnano "^4.1.8" + normalize-html-whitespace "^0.2.0" object-assign "^4.0.1" posthtml "^0.11.3" posthtml-render "^1.1.4" svgo "^1.0.5" - terser "^3.8.1" + terser "^3.14.0" + uncss "^0.16.2" htmlparser2@^3.8.3, htmlparser2@^3.9.2: version "3.10.0" @@ -5290,7 +5271,7 @@ husky@^0.14.3: normalize-path "^1.0.0" strip-indent "^2.0.0" -iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: +iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -5658,6 +5639,13 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-html@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-html/-/is-html-1.1.0.tgz#e04f1c18d39485111396f9a0273eab51af218464" + integrity sha1-4E8cGNOUhRETlvmgJz6rUa8hhGQ= + dependencies: + html-tags "^1.0.0" + is-number@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" @@ -5762,13 +5750,6 @@ is-subset@^0.1.1: resolved "https://registry.yarnpkg.com/is-subset/-/is-subset-0.1.1.tgz#8a59117d932de1de00f245fcdd39ce43f1e939a6" integrity sha1-ilkRfZMt4d4A8kX83TnOQ/HpOaY= -is-svg@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-2.1.0.tgz#cf61090da0d9efbcab8722deba6f032208dbb0e9" - integrity sha1-z2EJDaDZ77yrhyLeum8DIgjbsOk= - dependencies: - html-comment-regex "^1.1.0" - is-svg@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-svg/-/is-svg-3.0.0.tgz#9321dbd29c212e5ca99c4fa9794c714bcafa2f75" @@ -5920,11 +5901,6 @@ jest-validate@^23.5.0: leven "^2.1.0" pretty-format "^23.6.0" -js-base64@^2.1.9: - version "2.4.9" - resolved "https://registry.yarnpkg.com/js-base64/-/js-base64-2.4.9.tgz#748911fb04f48a60c4771b375cac45a80df11c03" - integrity sha512-xcinL3AuDJk7VSzsHgb9DvvIXayBbadtMZ4HFPx8rUszbW1MuNMlwYVC4zzCZ6e1sqZpnNS5ZFYOhXqA39T7LQ== - js-beautify@^1.7.5: version "1.8.8" resolved "https://registry.yarnpkg.com/js-beautify/-/js-beautify-1.8.8.tgz#1eb175b73a3571a5f1ed8d98e7cf2b05bfa98471" @@ -5963,19 +5939,43 @@ js-yaml@^3.10.0, js-yaml@^3.12.0, js-yaml@^3.9.0, js-yaml@^3.9.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@~3.7.0: - version "3.7.0" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80" - integrity sha1-XJZ93YN6m/3KXy3oQlOr6KHAO4A= - dependencies: - argparse "^1.0.7" - esprima "^2.6.0" - jsbn@~0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +jsdom@^11.3.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz#1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8" + integrity sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw== + dependencies: + abab "^2.0.0" + acorn "^5.5.3" + acorn-globals "^4.1.0" + array-equal "^1.0.0" + cssom ">= 0.3.2 < 0.4.0" + cssstyle "^1.0.0" + data-urls "^1.0.0" + domexception "^1.0.1" + escodegen "^1.9.1" + html-encoding-sniffer "^1.0.2" + left-pad "^1.3.0" + nwsapi "^2.0.7" + parse5 "4.0.0" + pn "^1.1.0" + request "^2.87.0" + request-promise-native "^1.0.5" + sax "^1.2.4" + symbol-tree "^3.2.2" + tough-cookie "^2.3.4" + w3c-hr-time "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-encoding "^1.0.3" + whatwg-mimetype "^2.1.0" + whatwg-url "^6.4.1" + ws "^5.2.0" + xml-name-validator "^3.0.0" + jsesc@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" @@ -6128,6 +6128,11 @@ lcid@^2.0.0: dependencies: invert-kv "^2.0.0" +left-pad@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.3.0.tgz#5b8a3a7765dfe001261dde915589e782f8c94d1e" + integrity sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA== + lerna@^3.3.2: version "3.4.3" resolved "https://registry.yarnpkg.com/lerna/-/lerna-3.4.3.tgz#501454efb453c65c305802d370ee337f7298787e" @@ -6720,11 +6725,6 @@ map-visit@^1.0.0: buffers "~0.1.1" readable-stream "~1.0.0" -math-expression-evaluator@^1.2.14: - version "1.2.17" - resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac" - integrity sha1-3oGf282E3M2PrlnGrreWFbnSZqw= - math-random@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.1.tgz#8b3aac588b8a66e4975e3cdea67f7bb329601fac" @@ -7261,6 +7261,11 @@ nopt@^4.0.1, nopt@~4.0.1: abbrev "1" osenv "^0.1.4" +normalize-html-whitespace@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/normalize-html-whitespace/-/normalize-html-whitespace-0.2.0.tgz#101722f6423551c75cdb8f9d104ff850daf1e10e" + integrity sha1-EBci9kI1Ucdc24+dEE/4UNrx4Q4= + normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package-data@^2.3.2, normalize-package-data@^2.3.4, normalize-package-data@^2.3.5, normalize-package-data@^2.4.0: version "2.4.0" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.4.0.tgz#12f95a307d58352075a04907b84ac8be98ac012f" @@ -7283,21 +7288,6 @@ normalize-path@^2.0.1, normalize-path@^2.1.1: dependencies: remove-trailing-separator "^1.0.1" -normalize-range@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/normalize-range/-/normalize-range-0.1.2.tgz#2d10c06bdfd312ea9777695a4d28439456b75942" - integrity sha1-LRDAa9/TEuqXd2laTShDlFa3WUI= - -normalize-url@^1.4.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-1.9.1.tgz#2cc0d66b31ea23036458436e3620d85954c66c3c" - integrity sha1-LMDWazHqIwNkWENuNiDYWVTGbDw= - dependencies: - object-assign "^4.0.1" - prepend-http "^1.0.0" - query-string "^4.1.0" - sort-keys "^1.0.0" - normalize-url@^3.0.0: version "3.3.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" @@ -7400,16 +7390,16 @@ nth-check@^1.0.2: dependencies: boolbase "~1.0.0" -num2fraction@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/num2fraction/-/num2fraction-1.2.2.tgz#6f682b6a027a4e9ddfa4564cd2589d1d4e669ede" - integrity sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4= - number-is-nan@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0= +nwsapi@^2.0.7: + version "2.0.9" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.0.9.tgz#77ac0cdfdcad52b6a1151a84e73254edc33ed016" + integrity sha512-nlWFSCTYQcHk/6A9FFnfhKc14c3aFhfdNBXgo8Qgi9QTBu/qg3Ww+Uiz9wMzXd1T8GFxPc2QIHB6Qtf2XFryFQ== + nyc@^11.1.0: version "11.9.0" resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.9.0.tgz#4106e89e8fbe73623a1fc8b6ecb7abaa271ae1e4" @@ -7814,6 +7804,11 @@ parse-json@^4.0.0: error-ex "^1.3.1" json-parse-better-errors "^1.0.1" +parse5@4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/parse5/-/parse5-4.0.0.tgz#6d78656e3da8d78b4ec0b906f7c08ef1dfe3f608" + integrity sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA== + parseurl@~1.3.2: version "1.3.2" resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.2.tgz#fc289d4ed8993119460c156253262cdc8de65bf3" @@ -7965,20 +7960,16 @@ pluralize@^7.0.0: resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" integrity sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow== +pn@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/pn/-/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb" + integrity sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA== + posix-character-classes@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab" integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs= -postcss-calc@^5.2.0: - version "5.3.1" - resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-5.3.1.tgz#77bae7ca928ad85716e2fda42f261bf7c1d65b5e" - integrity sha1-d7rnypKK2FcW4v2kLyYb98HWW14= - dependencies: - postcss "^5.0.2" - postcss-message-helpers "^2.0.0" - reduce-css-calc "^1.2.6" - postcss-calc@^7.0.0: version "7.0.1" resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-7.0.1.tgz#36d77bab023b0ecbb9789d84dcb23c4941145436" @@ -7989,15 +7980,6 @@ postcss-calc@^7.0.0: postcss-selector-parser "^5.0.0-rc.4" postcss-value-parser "^3.3.1" -postcss-colormin@^2.1.8: - version "2.2.2" - resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-2.2.2.tgz#6631417d5f0e909a3d7ec26b24c8a8d1e4f96e4b" - integrity sha1-ZjFBfV8OkJo9fsJrJMio0eT5bks= - dependencies: - colormin "^1.0.5" - postcss "^5.0.13" - postcss-value-parser "^3.2.3" - postcss-colormin@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-colormin/-/postcss-colormin-4.0.2.tgz#93cd1fa11280008696887db1a528048b18e7ed99" @@ -8009,14 +7991,6 @@ postcss-colormin@^4.0.2: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-convert-values@^2.3.4: - version "2.6.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-2.6.1.tgz#bbd8593c5c1fd2e3d1c322bb925dcae8dae4d62d" - integrity sha1-u9hZPFwf0uPRwyK7kl3K6Nrk1i0= - dependencies: - postcss "^5.0.11" - postcss-value-parser "^3.1.2" - postcss-convert-values@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-4.0.1.tgz#ca3813ed4da0f812f9d43703584e449ebe189a7f" @@ -8025,13 +7999,6 @@ postcss-convert-values@^4.0.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-discard-comments@^2.0.4: - version "2.0.4" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-2.0.4.tgz#befe89fafd5b3dace5ccce51b76b81514be00e3d" - integrity sha1-vv6J+v1bPazlzM5Rt2uBUUvgDj0= - dependencies: - postcss "^5.0.14" - postcss-discard-comments@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-4.0.1.tgz#30697735b0c476852a7a11050eb84387a67ef55d" @@ -8039,13 +8006,6 @@ postcss-discard-comments@^4.0.1: dependencies: postcss "^7.0.0" -postcss-discard-duplicates@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-2.1.0.tgz#b9abf27b88ac188158a5eb12abcae20263b91932" - integrity sha1-uavye4isGIFYpesSq8riAmO5GTI= - dependencies: - postcss "^5.0.4" - postcss-discard-duplicates@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-discard-duplicates/-/postcss-discard-duplicates-4.0.2.tgz#3fe133cd3c82282e550fc9b239176a9207b784eb" @@ -8053,13 +8013,6 @@ postcss-discard-duplicates@^4.0.2: dependencies: postcss "^7.0.0" -postcss-discard-empty@^2.0.1: - version "2.1.0" - resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-2.1.0.tgz#d2b4bd9d5ced5ebd8dcade7640c7d7cd7f4f92b5" - integrity sha1-0rS9nVztXr2Nyt52QMfXzX9PkrU= - dependencies: - postcss "^5.0.14" - postcss-discard-empty@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-discard-empty/-/postcss-discard-empty-4.0.1.tgz#c8c951e9f73ed9428019458444a02ad90bb9f765" @@ -8067,13 +8020,6 @@ postcss-discard-empty@^4.0.1: dependencies: postcss "^7.0.0" -postcss-discard-overridden@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-0.1.1.tgz#8b1eaf554f686fb288cd874c55667b0aa3668d58" - integrity sha1-ix6vVU9ob7KIzYdMVWZ7CqNmjVg= - dependencies: - postcss "^5.0.16" - postcss-discard-overridden@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-discard-overridden/-/postcss-discard-overridden-4.0.1.tgz#652aef8a96726f029f5e3e00146ee7a4e755ff57" @@ -8081,36 +8027,15 @@ postcss-discard-overridden@^4.0.1: dependencies: postcss "^7.0.0" -postcss-discard-unused@^2.2.1: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-discard-unused/-/postcss-discard-unused-2.2.3.tgz#bce30b2cc591ffc634322b5fb3464b6d934f4433" - integrity sha1-vOMLLMWR/8Y0Mitfs0ZLbZNPRDM= - dependencies: - postcss "^5.0.14" - uniqs "^2.0.0" - -postcss-filter-plugins@^2.0.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/postcss-filter-plugins/-/postcss-filter-plugins-2.0.3.tgz#82245fdf82337041645e477114d8e593aa18b8ec" - integrity sha512-T53GVFsdinJhgwm7rg1BzbeBRomOg9y5MBVhGcsV0CxurUdVj1UlPdKtn7aqYA/c/QVkzKMjq2bSV5dKG5+AwQ== - dependencies: - postcss "^5.0.4" - -postcss-merge-idents@^2.1.5: - version "2.1.7" - resolved "https://registry.yarnpkg.com/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz#4c5530313c08e1d5b3bbf3d2bbc747e278eea270" - integrity sha1-TFUwMTwI4dWzu/PSu8dH4njuonA= - dependencies: - has "^1.0.1" - postcss "^5.0.10" - postcss-value-parser "^3.1.1" - -postcss-merge-longhand@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-2.0.2.tgz#23d90cd127b0a77994915332739034a1a4f3d658" - integrity sha1-I9kM0Sewp3mUkVMyc5A0oaTz1lg= +postcss-merge-longhand@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-4.0.10.tgz#c4d63ab57bdc054ab4067ab075d488c8c2978380" + integrity sha512-hME10s6CSjm9nlVIcO1ukR7Jr5RisTaaC1y83jWCivpuBtPohA3pZE7cGTIVSYjXvLnXozHTiVOkG4dnnl756g== dependencies: - postcss "^5.0.4" + css-color-names "0.0.4" + postcss "^7.0.0" + postcss-value-parser "^3.0.0" + stylehacks "^4.0.0" postcss-merge-longhand@^4.0.9: version "4.0.9" @@ -8122,17 +8047,6 @@ postcss-merge-longhand@^4.0.9: postcss-value-parser "^3.0.0" stylehacks "^4.0.0" -postcss-merge-rules@^2.0.3: - version "2.1.2" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-2.1.2.tgz#d1df5dfaa7b1acc3be553f0e9e10e87c61b5f721" - integrity sha1-0d9d+qexrMO+VT8OnhDofGG19yE= - dependencies: - browserslist "^1.5.2" - caniuse-api "^1.5.2" - postcss "^5.0.4" - postcss-selector-parser "^2.2.2" - vendors "^1.0.0" - postcss-merge-rules@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-4.0.2.tgz#2be44401bf19856f27f32b8b12c0df5af1b88e74" @@ -8145,20 +8059,6 @@ postcss-merge-rules@^4.0.2: postcss-selector-parser "^3.0.0" vendors "^1.0.0" -postcss-message-helpers@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/postcss-message-helpers/-/postcss-message-helpers-2.0.0.tgz#a4f2f4fab6e4fe002f0aed000478cdf52f9ba60e" - integrity sha1-pPL0+rbk/gAvCu0ABHjN9S+bpg4= - -postcss-minify-font-values@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-1.0.5.tgz#4b58edb56641eba7c8474ab3526cafd7bbdecb69" - integrity sha1-S1jttWZB66fIR0qzUmyv17vey2k= - dependencies: - object-assign "^4.0.1" - postcss "^5.0.4" - postcss-value-parser "^3.0.2" - postcss-minify-font-values@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-minify-font-values/-/postcss-minify-font-values-4.0.2.tgz#cd4c344cce474343fac5d82206ab2cbcb8afd5a6" @@ -8167,14 +8067,6 @@ postcss-minify-font-values@^4.0.2: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-minify-gradients@^1.0.1: - version "1.0.5" - resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-1.0.5.tgz#5dbda11373703f83cfb4a3ea3881d8d75ff5e6e1" - integrity sha1-Xb2hE3NwP4PPtKPqOIHY11/15uE= - dependencies: - postcss "^5.0.12" - postcss-value-parser "^3.3.0" - postcss-minify-gradients@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-minify-gradients/-/postcss-minify-gradients-4.0.1.tgz#6da95c6e92a809f956bb76bf0c04494953e1a7dd" @@ -8185,16 +8077,6 @@ postcss-minify-gradients@^4.0.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-minify-params@^1.0.4: - version "1.2.2" - resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz#ad2ce071373b943b3d930a3fa59a358c28d6f1f3" - integrity sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM= - dependencies: - alphanum-sort "^1.0.1" - postcss "^5.0.2" - postcss-value-parser "^3.0.2" - uniqs "^2.0.0" - postcss-minify-params@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-minify-params/-/postcss-minify-params-4.0.1.tgz#5b2e2d0264dd645ef5d68f8fec0d4c38c1cf93d2" @@ -8207,16 +8089,6 @@ postcss-minify-params@^4.0.1: postcss-value-parser "^3.0.0" uniqs "^2.0.0" -postcss-minify-selectors@^2.0.4: - version "2.1.1" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-2.1.1.tgz#b2c6a98c0072cf91b932d1a496508114311735bf" - integrity sha1-ssapjAByz5G5MtGkllCBFDEXNb8= - dependencies: - alphanum-sort "^1.0.2" - has "^1.0.1" - postcss "^5.0.14" - postcss-selector-parser "^2.0.0" - postcss-minify-selectors@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-4.0.1.tgz#a891c197977cc37abf60b3ea06b84248b1c1e9cd" @@ -8269,13 +8141,6 @@ postcss-modules@^1.4.1: postcss "^7.0.1" string-hash "^1.1.1" -postcss-normalize-charset@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-1.1.1.tgz#ef9ee71212d7fe759c78ed162f61ed62b5cb93f1" - integrity sha1-757nEhLX/nWceO0WL2HtYrXLk/E= - dependencies: - postcss "^5.0.5" - postcss-normalize-charset@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-normalize-charset/-/postcss-normalize-charset-4.0.1.tgz#8b35add3aee83a136b0471e0d59be58a50285dd4" @@ -8339,16 +8204,6 @@ postcss-normalize-unicode@^4.0.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-normalize-url@^3.0.7: - version "3.0.8" - resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-3.0.8.tgz#108f74b3f2fcdaf891a2ffa3ea4592279fc78222" - integrity sha1-EI90s/L82viRov+j6kWSJ5/HgiI= - dependencies: - is-absolute-url "^2.0.0" - normalize-url "^1.4.0" - postcss "^5.0.14" - postcss-value-parser "^3.2.3" - postcss-normalize-url@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-normalize-url/-/postcss-normalize-url-4.0.1.tgz#10e437f86bc7c7e58f7b9652ed878daaa95faae1" @@ -8367,14 +8222,6 @@ postcss-normalize-whitespace@^4.0.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-ordered-values@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-2.2.3.tgz#eec6c2a67b6c412a8db2042e77fe8da43f95c11d" - integrity sha1-7sbCpntsQSqNsgQud/6NpD+VwR0= - dependencies: - postcss "^5.0.4" - postcss-value-parser "^3.0.1" - postcss-ordered-values@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-4.1.1.tgz#2e3b432ef3e489b18333aeca1f1295eb89be9fc2" @@ -8384,21 +8231,6 @@ postcss-ordered-values@^4.1.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-reduce-idents@^2.2.2: - version "2.4.0" - resolved "https://registry.yarnpkg.com/postcss-reduce-idents/-/postcss-reduce-idents-2.4.0.tgz#c2c6d20cc958284f6abfbe63f7609bf409059ad3" - integrity sha1-wsbSDMlYKE9qv75j92Cb9AkFmtM= - dependencies: - postcss "^5.0.4" - postcss-value-parser "^3.0.2" - -postcss-reduce-initial@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz#68f80695f045d08263a879ad240df8dd64f644ea" - integrity sha1-aPgGlfBF0IJjqHmtJA343WT2ROo= - dependencies: - postcss "^5.0.4" - postcss-reduce-initial@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/postcss-reduce-initial/-/postcss-reduce-initial-4.0.2.tgz#bac8e325d67510ee01fa460676dc8ea9e3b40f15" @@ -8409,15 +8241,6 @@ postcss-reduce-initial@^4.0.2: has "^1.0.0" postcss "^7.0.0" -postcss-reduce-transforms@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz#ff76f4d8212437b31c298a42d2e1444025771ae1" - integrity sha1-/3b02CEkN7McKYpC0uFEQCV3GuE= - dependencies: - has "^1.0.1" - postcss "^5.0.8" - postcss-value-parser "^3.0.1" - postcss-reduce-transforms@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-reduce-transforms/-/postcss-reduce-transforms-4.0.1.tgz#8600d5553bdd3ad640f43bff81eb52f8760d4561" @@ -8428,16 +8251,7 @@ postcss-reduce-transforms@^4.0.1: postcss "^7.0.0" postcss-value-parser "^3.0.0" -postcss-selector-parser@^2.0.0, postcss-selector-parser@^2.2.2: - version "2.2.3" - resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-2.2.3.tgz#f9437788606c3c9acee16ffe8d8b16297f27bb90" - integrity sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A= - dependencies: - flatten "^1.0.2" - indexes-of "^1.0.1" - uniq "^1.0.1" - -postcss-selector-parser@^3.0.0, postcss-selector-parser@^3.1.1: +postcss-selector-parser@3.1.1, postcss-selector-parser@^3.0.0, postcss-selector-parser@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-3.1.1.tgz#4f875f4afb0c96573d5cf4d74011aee250a7e865" integrity sha1-T4dfSvsMllc9XPTXQBGu4lCn6GU= @@ -8455,16 +8269,6 @@ postcss-selector-parser@^5.0.0-rc.4: indexes-of "^1.0.1" uniq "^1.0.1" -postcss-svgo@^2.1.1: - version "2.1.6" - resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-2.1.6.tgz#b6df18aa613b666e133f08adb5219c2684ac108d" - integrity sha1-tt8YqmE7Zm4TPwittSGcJoSsEI0= - dependencies: - is-svg "^2.0.0" - postcss "^5.0.14" - postcss-value-parser "^3.2.3" - svgo "^0.7.0" - postcss-svgo@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-svgo/-/postcss-svgo-4.0.1.tgz#5628cdb38f015de6b588ce6d0bf0724b492b581d" @@ -8475,15 +8279,6 @@ postcss-svgo@^4.0.1: postcss-value-parser "^3.0.0" svgo "^1.0.0" -postcss-unique-selectors@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz#981d57d29ddcb33e7b1dfe1fd43b8649f933ca1d" - integrity sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0= - dependencies: - alphanum-sort "^1.0.1" - postcss "^5.0.4" - uniqs "^2.0.0" - postcss-unique-selectors@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/postcss-unique-selectors/-/postcss-unique-selectors-4.0.1.tgz#9446911f3289bfd64c6d680f073c03b1f9ee4bac" @@ -8493,20 +8288,11 @@ postcss-unique-selectors@^4.0.1: postcss "^7.0.0" uniqs "^2.0.0" -postcss-value-parser@^3.0.0, postcss-value-parser@^3.0.1, postcss-value-parser@^3.0.2, postcss-value-parser@^3.1.1, postcss-value-parser@^3.1.2, postcss-value-parser@^3.2.3, postcss-value-parser@^3.3.0, postcss-value-parser@^3.3.1: +postcss-value-parser@^3.0.0, postcss-value-parser@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz#9ff822547e2893213cf1c30efa51ac5fd1ba8281" integrity sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ== -postcss-zindex@^2.0.1: - version "2.2.0" - resolved "https://registry.yarnpkg.com/postcss-zindex/-/postcss-zindex-2.2.0.tgz#d2109ddc055b91af67fc4cb3b025946639d2af22" - integrity sha1-0hCd3AVbka9n/EyzsCWUZjnSryI= - dependencies: - has "^1.0.1" - postcss "^5.0.4" - uniqs "^2.0.0" - postcss@6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.1.tgz#000dbd1f8eef217aa368b9a212c5fc40b2a8f3f2" @@ -8516,17 +8302,7 @@ postcss@6.0.1: source-map "^0.5.6" supports-color "^3.2.3" -postcss@^5.0.10, postcss@^5.0.11, postcss@^5.0.12, postcss@^5.0.13, postcss@^5.0.14, postcss@^5.0.16, postcss@^5.0.2, postcss@^5.0.4, postcss@^5.0.5, postcss@^5.0.8, postcss@^5.2.16: - version "5.2.18" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-5.2.18.tgz#badfa1497d46244f6390f58b319830d9107853c5" - integrity sha512-zrUjRRe1bpXKsX1qAJNJjqZViErVuyEkMTRrwu4ud4sbTtIBRmtaYDrHmcGgmrbsW3MHfmtIf+vJumgQn+PrXg== - dependencies: - chalk "^1.1.3" - js-base64 "^2.1.9" - source-map "^0.5.6" - supports-color "^3.2.3" - -postcss@^6.0.1, postcss@^6.0.20: +postcss@^6.0.1, postcss@^6.0.14, postcss@^6.0.20: version "6.0.23" resolved "https://registry.yarnpkg.com/postcss/-/postcss-6.0.23.tgz#61c82cc328ac60e677645f979054eb98bc0e3324" integrity sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag== @@ -8602,11 +8378,6 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= -prepend-http@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc" - integrity sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw= - preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" @@ -8704,6 +8475,11 @@ psl@^1.1.24: resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.29.tgz#60f580d360170bb722a797cc704411e6da850c67" integrity sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ== +psl@^1.1.28: + version "1.1.31" + resolved "https://registry.yarnpkg.com/psl/-/psl-1.1.31.tgz#e9aa86d0101b5b105cbe93ac6b784cd547276184" + integrity sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw== + public-encrypt@^4.0.0: version "4.0.3" resolved "https://registry.yarnpkg.com/public-encrypt/-/public-encrypt-4.0.3.tgz#4fcc9d77a07e48ba7527e7cbe0de33d0701331e0" @@ -8866,7 +8642,7 @@ punycode@^1.2.4, punycode@^1.4.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0: +punycode@^2.1.0, punycode@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -8881,14 +8657,6 @@ qs@~6.5.2: resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== -query-string@^4.1.0: - version "4.3.4" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-4.3.4.tgz#bbb693b9ca915c232515b228b1a02b609043dbeb" - integrity sha1-u7aTucqRXCMlFbIosaArYJBD2+s= - dependencies: - object-assign "^4.1.0" - strict-uri-encode "^1.0.0" - querystring-es3@^0.2.0: version "0.2.1" resolved "https://registry.yarnpkg.com/querystring-es3/-/querystring-es3-0.2.1.tgz#9ec61f79049875707d69414596fd907a4d711e73" @@ -9090,22 +8858,6 @@ redent@^2.0.0: indent-string "^3.0.0" strip-indent "^2.0.0" -reduce-css-calc@^1.2.6: - version "1.3.0" - resolved "https://registry.yarnpkg.com/reduce-css-calc/-/reduce-css-calc-1.3.0.tgz#747c914e049614a4c9cfbba629871ad1d2927716" - integrity sha1-dHyRTgSWFKTJz7umKYca0dKSdxY= - dependencies: - balanced-match "^0.4.2" - math-expression-evaluator "^1.2.14" - reduce-function-call "^1.0.1" - -reduce-function-call@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/reduce-function-call/-/reduce-function-call-1.0.2.tgz#5a200bf92e0e37751752fe45b0ab330fd4b6be99" - integrity sha1-WiAL+S4ON3UXUv5FsKszD9S2vpk= - dependencies: - balanced-match "^0.4.2" - regenerate-unicode-properties@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz#107405afcc4a190ec5ed450ecaa00ed0cafa7a4c" @@ -9247,6 +8999,15 @@ request-promise-core@1.1.1: dependencies: lodash "^4.13.1" +request-promise-native@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/request-promise-native/-/request-promise-native-1.0.5.tgz#5281770f68e0c9719e5163fd3fab482215f4fda5" + integrity sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU= + dependencies: + request-promise-core "1.1.1" + stealthy-require "^1.1.0" + tough-cookie ">=2.3.3" + request-promise@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/request-promise/-/request-promise-4.2.2.tgz#d1ea46d654a6ee4f8ee6a4fea1018c22911904b4" @@ -9257,7 +9018,7 @@ request-promise@^4.2.0: stealthy-require "^1.1.0" tough-cookie ">=2.3.3" -request@^2.81.0, request@^2.83.0, request@^2.87.0: +request@^2.72.0, request@^2.81.0, request@^2.83.0, request@^2.87.0: version "2.88.0" resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef" integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg== @@ -9482,7 +9243,7 @@ sax@0.5.x: resolved "https://registry.yarnpkg.com/sax/-/sax-0.5.8.tgz#d472db228eb331c2506b0e8c15524adb939d12c1" integrity sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE= -sax@^1.2.4, sax@~1.2.1, sax@~1.2.4: +sax@^1.2.4, sax@~1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== @@ -9714,13 +9475,6 @@ socks@~2.2.0: ip "^1.1.5" smart-buffer "^4.0.1" -sort-keys@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" - integrity sha1-RBttTTRnmPG05J6JIK37oOVD+a0= - dependencies: - is-plain-obj "^1.0.0" - sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" @@ -9964,11 +9718,6 @@ stream-shift@^1.0.0: resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.0.tgz#d5c752825e5367e786f78e18e445ea223a155952" integrity sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI= -strict-uri-encode@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-1.1.0.tgz#279b225df1d582b1f54e65addd4352e18faa0713" - integrity sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM= - string-argv@^0.0.2: version "0.0.2" resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.0.2.tgz#dac30408690c21f3c3630a3ff3a05877bdcbd736" @@ -10129,19 +9878,6 @@ supports-color@^5.3.0, supports-color@^5.4.0, supports-color@^5.5.0: dependencies: has-flag "^3.0.0" -svgo@^0.7.0: - version "0.7.2" - resolved "https://registry.yarnpkg.com/svgo/-/svgo-0.7.2.tgz#9f5772413952135c6fefbf40afe6a4faa88b4bb5" - integrity sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U= - dependencies: - coa "~1.0.1" - colors "~1.1.2" - csso "~2.3.1" - js-yaml "~3.7.0" - mkdirp "~0.5.1" - sax "~1.2.1" - whet.extend "~0.9.9" - svgo@^1.0.0, svgo@^1.0.5: version "1.1.1" resolved "https://registry.yarnpkg.com/svgo/-/svgo-1.1.1.tgz#12384b03335bcecd85cfa5f4e3375fed671cb985" @@ -10167,6 +9903,11 @@ symbol-observable@^1.1.0: resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== +symbol-tree@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.2.tgz#ae27db38f660a7ae2e1c3b7d1bc290819b8519e6" + integrity sha1-rifbOPZgp64uHDt9G8KQgZuFGeY= + table@4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/table/-/table-4.0.2.tgz#a33447375391e766ad34d3486e6e2aedc84d2e36" @@ -10226,7 +9967,16 @@ temp@^0.8.3: os-tmpdir "^1.0.0" rimraf "~2.2.6" -terser@^3.7.3, terser@^3.8.1: +terser@^3.14.0: + version "3.14.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-3.14.1.tgz#cc4764014af570bc79c79742358bd46926018a32" + integrity sha512-NSo3E99QDbYSMeJaEk9YW2lTg3qS9V0aKGlb+PlOrei1X02r1wSBHCNX/O+yeTRFSWPKPIGj6MqvvdqV4rnVGw== + dependencies: + commander "~2.17.1" + source-map "~0.6.1" + source-map-support "~0.5.6" + +terser@^3.7.3: version "3.10.3" resolved "https://registry.yarnpkg.com/terser/-/terser-3.10.3.tgz#4085f9e62171ca746c5759fe955d921291703ee6" integrity sha512-uyL5hwDICjnv49JANhZvQYLikt/HADWNbUFsKQpZ/i+JSOkL2T4V7WUpW7S/5QGZceVq2x0HRVhEQQuW2ZpX6g== @@ -10359,6 +10109,14 @@ tough-cookie@>=2.3.3, tough-cookie@~2.4.3: psl "^1.1.24" punycode "^1.4.1" +tough-cookie@^2.3.4: + version "2.5.0" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" + integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== + dependencies: + psl "^1.1.28" + punycode "^2.1.1" + tr46@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" @@ -10468,6 +10226,21 @@ umask@^1.1.0: resolved "https://registry.yarnpkg.com/umask/-/umask-1.1.0.tgz#f29cebf01df517912bb58ff9c4e50fde8e33320d" integrity sha1-8pzr8B31F5ErtY/5xOUP3o4zMg0= +uncss@^0.16.2: + version "0.16.2" + resolved "https://registry.yarnpkg.com/uncss/-/uncss-0.16.2.tgz#3b2269c59012da7c66cbe98fbedddeef94f0649c" + integrity sha1-OyJpxZAS2nxmy+mPvt3e75TwZJw= + dependencies: + commander "^2.9.0" + glob "^7.0.3" + is-absolute-url "^2.0.0" + is-html "^1.0.0" + jsdom "^11.3.0" + lodash "^4.13.1" + postcss "^6.0.14" + postcss-selector-parser "3.1.1" + request "^2.72.0" + unicode-canonical-property-names-ecmascript@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz#2619800c4c825800efdd8343af7dd9933cbe2818" @@ -10692,6 +10465,13 @@ vue@^2.5.16: resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.17.tgz#0f8789ad718be68ca1872629832ed533589c6ada" integrity sha512-mFbcWoDIJi0w0Za4emyLiW72Jae0yjANHbCVquMKijcavBGypqlF7zHRgMa5k4sesdv7hv2rB4JPdZfR+TPfhQ== +w3c-hr-time@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" + integrity sha1-gqwr/2PZUOqeMYmlimViX+3xkEU= + dependencies: + browser-process-hrtime "^0.1.2" + wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -10704,6 +10484,27 @@ webidl-conversions@^4.0.2: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== +whatwg-encoding@^1.0.1, whatwg-encoding@^1.0.3: + version "1.0.5" + resolved "https://registry.yarnpkg.com/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0" + integrity sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw== + dependencies: + iconv-lite "0.4.24" + +whatwg-mimetype@^2.1.0, whatwg-mimetype@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf" + integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g== + +whatwg-url@^6.4.1: + version "6.5.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-6.5.0.tgz#f2df02bff176fd65070df74ad5ccbb5a199965a8" + integrity sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ== + dependencies: + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" + whatwg-url@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.0.0.tgz#fde926fa54a599f3adf82dff25a9f7be02dc6edd" @@ -10713,11 +10514,6 @@ whatwg-url@^7.0.0: tr46 "^1.0.1" webidl-conversions "^4.0.2" -whet.extend@~0.9.9: - version "0.9.9" - resolved "https://registry.yarnpkg.com/whet.extend/-/whet.extend-0.9.9.tgz#f877d5bf648c97e5aa542fadc16d6a259b9c11a1" - integrity sha1-+HfVv2SMl+WqVC+twW1qJZucEaE= - which-module@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" @@ -10823,13 +10619,18 @@ write@^0.2.1: dependencies: mkdirp "^0.5.1" -ws@^5.1.1: +ws@^5.1.1, ws@^5.2.0: version "5.2.2" resolved "https://registry.yarnpkg.com/ws/-/ws-5.2.2.tgz#dffef14866b8e8dc9133582514d1befaf96e980f" integrity sha512-jaHFD6PFv6UgoIVda6qZllptQsMlDEJkTQcybzzXDYM1XO9Y8em691FGMPmM46WGyLU4z9KMgQN+qrux/nhlHA== dependencies: async-limiter "~1.0.0" +xml-name-validator@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" + integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== + xml@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" From 6e1bc689c5cb1816e3afd87b1efbd183b2e0fda2 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Mon, 7 Jan 2019 21:15:16 +0100 Subject: [PATCH 13/47] Use Buffer.from (#2512) --- .../core/integration-tests/test/integration/globals/index.js | 2 +- packages/core/integration-tests/test/javascript.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/integration-tests/test/integration/globals/index.js b/packages/core/integration-tests/test/integration/globals/index.js index fa6f5ff1411..d036bcb5735 100644 --- a/packages/core/integration-tests/test/integration/globals/index.js +++ b/packages/core/integration-tests/test/integration/globals/index.js @@ -2,7 +2,7 @@ module.exports = function () { return { dir: __dirname, file: __filename, - buf: new Buffer(process.title).toString('base64'), + buf: Buffer.from(process.title).toString('base64'), global: !!global.document }; }; diff --git a/packages/core/integration-tests/test/javascript.js b/packages/core/integration-tests/test/javascript.js index a0474f8212e..ba255be5792 100644 --- a/packages/core/integration-tests/test/javascript.js +++ b/packages/core/integration-tests/test/javascript.js @@ -802,7 +802,7 @@ describe('javascript', function() { assert.deepEqual(output(), { dir: path.join(__dirname, '/integration/globals'), file: path.join(__dirname, '/integration/globals/index.js'), - buf: new Buffer('browser').toString('base64'), + buf: Buffer.from('browser').toString('base64'), global: true }); }); From 6566e160affa161daa6d5486139e6059f685ba3a Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Mon, 7 Jan 2019 21:19:54 +0100 Subject: [PATCH 14/47] addURLDependency: use always relative path (#2518) --- packages/core/integration-tests/test/css.js | 48 ++++++++++++++++++ .../css-url-relative/src/a/style1.css | 3 ++ .../css-url-relative/src/b/style2.css | 3 ++ .../integration/css-url-relative/src/foo.png | Bin 0 -> 255 bytes packages/core/parcel-bundler/src/Asset.js | 3 +- 5 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 packages/core/integration-tests/test/integration/css-url-relative/src/a/style1.css create mode 100644 packages/core/integration-tests/test/integration/css-url-relative/src/b/style2.css create mode 100644 packages/core/integration-tests/test/integration/css-url-relative/src/foo.png diff --git a/packages/core/integration-tests/test/css.js b/packages/core/integration-tests/test/css.js index ac8db41d712..c022343cac8 100644 --- a/packages/core/integration-tests/test/css.js +++ b/packages/core/integration-tests/test/css.js @@ -213,6 +213,54 @@ describe('css', function() { ); }); + it('should support linking to assets in parent folders with url() from CSS', async function() { + let b = await bundle( + [ + path.join(__dirname, '/integration/css-url-relative/src/a/style1.css'), + path.join(__dirname, '/integration/css-url-relative/src/b/style2.css') + ], + { + production: true, + sourceMaps: false + } + ); + + await assertBundleTree(b, [ + { + type: 'css', + assets: ['style1.css'], + childBundles: [ + { + type: 'png' + } + ] + }, + { + type: 'css', + assets: ['style2.css'] + } + ]); + + let css = await fs.readFile( + path.join(__dirname, '/dist/a/style1.css'), + 'utf8' + ); + + assert(css.includes('background-image'), 'includes `background-image`'); + assert(/url\([^)]*\)/.test(css), 'includes url()'); + + assert( + await fs.exists( + path.join( + __dirname, + path.dirname('/dist/a/style1.css'), + css.match(/url\(([^)]*)\)/)[1] + ) + ), + 'path specified in url() exists' + ); + }); + it('should support transforming with postcss', async function() { let b = await bundle(path.join(__dirname, '/integration/postcss/index.js')); diff --git a/packages/core/integration-tests/test/integration/css-url-relative/src/a/style1.css b/packages/core/integration-tests/test/integration/css-url-relative/src/a/style1.css new file mode 100644 index 00000000000..8ad6f805d0d --- /dev/null +++ b/packages/core/integration-tests/test/integration/css-url-relative/src/a/style1.css @@ -0,0 +1,3 @@ +body { + background-image: url('../foo.png'); +} diff --git a/packages/core/integration-tests/test/integration/css-url-relative/src/b/style2.css b/packages/core/integration-tests/test/integration/css-url-relative/src/b/style2.css new file mode 100644 index 00000000000..b05faf8ead0 --- /dev/null +++ b/packages/core/integration-tests/test/integration/css-url-relative/src/b/style2.css @@ -0,0 +1,3 @@ +body { + color: red; +} diff --git a/packages/core/integration-tests/test/integration/css-url-relative/src/foo.png b/packages/core/integration-tests/test/integration/css-url-relative/src/foo.png new file mode 100644 index 0000000000000000000000000000000000000000..8a1daa0121d524256c1d1b45ff5e7ed771784c52 GIT binary patch literal 255 zcmeAS@N?(olHy`uVBq!ia0vp^DImVS)*E46%Oq(`s&YU^>_U&7| zc=6GrN4Ia^zG~H~jT<-Ko_$0QsEo6~BeIx*f$sR&2=kJHM z&5N9@w|=XzipNCbb|s-xrJeH)f2E%im~OIrio1Qy&Sj1+>x<+1)+oPni}kGd6Ohy! z>6x1RttNZTv!7LG>?+Ii&zjEnadB}e3778<6P>u`Anzuis~9|8{an^LB{Ts5qZeh6 literal 0 HcmV?d00001 diff --git a/packages/core/parcel-bundler/src/Asset.js b/packages/core/parcel-bundler/src/Asset.js index 3b3c11a7668..92b443a021b 100644 --- a/packages/core/parcel-bundler/src/Asset.js +++ b/packages/core/parcel-bundler/src/Asset.js @@ -249,7 +249,8 @@ class Asset { // Replace temporary bundle names in the output with the final content-hashed names. let newValue = value; for (let [name, map] of bundleNameMap) { - newValue = newValue.split(name).join(map); + let mapRelative = path.relative(path.dirname(this.relativeName), map); + newValue = newValue.split(name).join(mapRelative); } // Copy `this.generated` on write so we don't end up writing the final names to the cache. From 58a034871bcaa7abe30065f9b9f9a5417b1d389b Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Sat, 12 Jan 2019 19:20:40 +0100 Subject: [PATCH 15/47] reexporting + renaming when scopehoisting (#2491) --- .../scope-hoisting/es6/re-export-renamed/a.js | 3 +++ .../scope-hoisting/es6/re-export-renamed/b.js | 3 +++ .../scope-hoisting/es6/re-export-renamed/c.js | 1 + .../core/integration-tests/test/scope-hoisting.js | 12 ++++++++++++ .../parcel-bundler/src/scope-hoisting/renamer.js | 5 +++++ 5 files changed, 24 insertions(+) create mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/a.js create mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/b.js create mode 100644 packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/c.js diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/a.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/a.js new file mode 100644 index 00000000000..1077b636aca --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/a.js @@ -0,0 +1,3 @@ +import { x } from './b.js'; + +output = x; diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/b.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/b.js new file mode 100644 index 00000000000..154372df193 --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/b.js @@ -0,0 +1,3 @@ +export const x = 'foobar'; + +export { x as y } from './c.js' diff --git a/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/c.js b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/c.js new file mode 100644 index 00000000000..0190dbd267f --- /dev/null +++ b/packages/core/integration-tests/test/integration/scope-hoisting/es6/re-export-renamed/c.js @@ -0,0 +1 @@ +export const x = 'xyz'; diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 139397dcf07..16f90cb5e4b 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -321,6 +321,18 @@ describe('scope hoisting', function() { assert.deepEqual(output, 'foobar'); }); + it('supports requiring a re-exported and renamed ES6 import', async function() { + let b = await bundle( + path.join( + __dirname, + '/integration/scope-hoisting/es6/re-export-renamed/a.js' + ) + ); + + let output = await run(b); + assert.deepEqual(output, 'foobar'); + }); + it('keeps side effects by default', async function() { let b = await bundle( path.join( diff --git a/packages/core/parcel-bundler/src/scope-hoisting/renamer.js b/packages/core/parcel-bundler/src/scope-hoisting/renamer.js index 00ec7ae66b1..1b9d90f3d6b 100644 --- a/packages/core/parcel-bundler/src/scope-hoisting/renamer.js +++ b/packages/core/parcel-bundler/src/scope-hoisting/renamer.js @@ -1,3 +1,5 @@ +const t = require('@babel/types'); + function rename(scope, oldName, newName) { if (oldName === newName) { return; @@ -19,6 +21,9 @@ function rename(scope, oldName, newName) { // Rename all references for (let path of binding.referencePaths) { + if (t.isExportSpecifier(path.parent) && path.parentPath.parent.source) { + continue; + } if (path.node.name === oldName) { path.node.name = newName; } From a4eb94ec04caeaf0122f72368b677336939e2667 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Tue, 15 Jan 2019 03:02:58 +0100 Subject: [PATCH 16/47] Fix and reenable windows scope-hoisting tests (#2537) --- .../integration-tests/test/scope-hoisting.js | 9 ---- .../src/packagers/JSConcatPackager.js | 54 ++++++++++--------- 2 files changed, 30 insertions(+), 33 deletions(-) diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 16f90cb5e4b..0632164f044 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -7,15 +7,6 @@ const bundle = (name, opts = {}) => _bundle(name, Object.assign({scopeHoist: true}, opts)); describe('scope hoisting', function() { - if (process.platform === 'win32') { - // eslint-disable-next-line no-console - console.warn( - 'WARNING: Scope hoisting tests are disabled on windows due to ' + - 'filesystem errors. Feel free to look into this and contribute a fix!' - ); - return; - } - describe('es6', function() { it('supports default imports and exports of expressions', async function() { let b = await bundle( diff --git a/packages/core/parcel-bundler/src/packagers/JSConcatPackager.js b/packages/core/parcel-bundler/src/packagers/JSConcatPackager.js index 5500b648667..bffd16ed9e8 100644 --- a/packages/core/parcel-bundler/src/packagers/JSConcatPackager.js +++ b/packages/core/parcel-bundler/src/packagers/JSConcatPackager.js @@ -513,36 +513,42 @@ class JSConcatPackager extends Packager { `); } - let ast = t.file(t.program(this.statements)); - let {code: output} = concat(this, ast); + try { + let ast = t.file(t.program(this.statements)); + let {code: output} = concat(this, ast); - if (!this.options.minify) { - output = '\n' + output + '\n'; - } + if (!this.options.minify) { + output = '\n' + output + '\n'; + } - let preludeCode = this.options.minify ? prelude.minified : prelude.source; - if (this.needsPrelude) { - output = preludeCode + '(function (require) {' + output + '});'; - } else { - output = '(function () {' + output + '})();'; - } + let preludeCode = this.options.minify ? prelude.minified : prelude.source; + if (this.needsPrelude) { + output = preludeCode + '(function (require) {' + output + '});'; + } else { + output = '(function () {' + output + '})();'; + } - this.size = output.length; + this.size = output.length; - let {sourceMaps} = this.options; - if (sourceMaps) { - // Add source map url if a map bundle exists - let mapBundle = this.bundle.siblingBundlesMap.get('map'); - if (mapBundle) { - let mapUrl = urlJoin( - this.options.publicURL, - path.basename(mapBundle.name) - ); - output += `\n//# sourceMappingURL=${mapUrl}`; + let {sourceMaps} = this.options; + if (sourceMaps) { + // Add source map url if a map bundle exists + let mapBundle = this.bundle.siblingBundlesMap.get('map'); + if (mapBundle) { + let mapUrl = urlJoin( + this.options.publicURL, + path.basename(mapBundle.name) + ); + output += `\n//# sourceMappingURL=${mapUrl}`; + } } - } - await super.write(output); + await super.write(output); + } catch (e) { + throw e; + } finally { + await super.end(); + } } resolveModule(id, name) { From d7dc51f9eacd80aadd1e41888771033e447758f1 Mon Sep 17 00:00:00 2001 From: Abdullah Date: Thu, 17 Jan 2019 01:00:39 +0500 Subject: [PATCH 17/47] added fix for typescript asset invalidation (#2485) --- packages/core/parcel-bundler/src/assets/JSAsset.js | 9 ++------- .../parcel-bundler/src/assets/TypeScriptAsset.js | 6 ++++++ .../src/utils/isAccessedVarChanged.js | 14 ++++++++++++++ 3 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js diff --git a/packages/core/parcel-bundler/src/assets/JSAsset.js b/packages/core/parcel-bundler/src/assets/JSAsset.js index 5e108895203..1e1b9308a80 100644 --- a/packages/core/parcel-bundler/src/assets/JSAsset.js +++ b/packages/core/parcel-bundler/src/assets/JSAsset.js @@ -16,6 +16,7 @@ const hoist = require('../scope-hoisting/hoist'); const path = require('path'); const fs = require('@parcel/fs'); const logger = require('@parcel/logger'); +const isAccessedVarChanged = require('../utils/isAccessedVarChanged'); const IMPORT_RE = /\b(?:import\b|export\b|require\s*\()/; const ENV_RE = /\b(?:process\.env)\b/; @@ -40,13 +41,7 @@ class JSAsset extends Asset { } shouldInvalidate(cacheData) { - for (let key in cacheData.env) { - if (cacheData.env[key] !== process.env[key]) { - return true; - } - } - - return false; + return isAccessedVarChanged(cacheData); } mightHaveDependencies() { diff --git a/packages/core/parcel-bundler/src/assets/TypeScriptAsset.js b/packages/core/parcel-bundler/src/assets/TypeScriptAsset.js index 715a8ea94c2..1e8e8197000 100644 --- a/packages/core/parcel-bundler/src/assets/TypeScriptAsset.js +++ b/packages/core/parcel-bundler/src/assets/TypeScriptAsset.js @@ -1,10 +1,16 @@ const Asset = require('../Asset'); const localRequire = require('../utils/localRequire'); +const isAccessedVarChanged = require('../utils/isAccessedVarChanged'); class TypeScriptAsset extends Asset { constructor(name, options) { super(name, options); this.type = 'js'; + this.cacheData.env = {}; + } + + shouldInvalidate(cacheData) { + return isAccessedVarChanged(cacheData); } async generate() { diff --git a/packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js b/packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js new file mode 100644 index 00000000000..9cd4284b0da --- /dev/null +++ b/packages/core/parcel-bundler/src/utils/isAccessedVarChanged.js @@ -0,0 +1,14 @@ +/* + Checks if any of the used variable from process.env is changed +*/ +function isAccessedVarChanged(cacheData) { + for (let key in cacheData.env) { + if (cacheData.env[key] !== process.env[key]) { + return true; + } + } + + return false; +} + +module.exports = isAccessedVarChanged; From 561cb1e71f91d6e7355e8fe102b8fec917ddc726 Mon Sep 17 00:00:00 2001 From: Jannick Garthen Date: Wed, 16 Jan 2019 22:32:55 +0100 Subject: [PATCH 18/47] Fix hang up when a lot of parallel operation request the file system (#2452) --- packages/core/parcel-bundler/bin/cli.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/core/parcel-bundler/bin/cli.js b/packages/core/parcel-bundler/bin/cli.js index bcf058add51..0a63cdf59b4 100755 --- a/packages/core/parcel-bundler/bin/cli.js +++ b/packages/core/parcel-bundler/bin/cli.js @@ -1,5 +1,7 @@ #!/usr/bin/env node +process.env.UV_THREADPOOL_SIZE = process.env.UV_THREADPOOL_SIZE || 16; + // Node 8 supports native async functions - no need to use compiled code! module.exports = parseInt(process.versions.node, 10) < 8 From 6cbf2a65cdcd66af135ff9eca2a3799bde9f8a5b Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Wed, 16 Jan 2019 22:35:00 +0100 Subject: [PATCH 19/47] Fix localRequire with package/path requests (#2425) --- packages/core/parcel-bundler/src/Resolver.js | 17 ++++------------- .../parcel-bundler/src/utils/getModuleParts.js | 11 +++++++++++ .../parcel-bundler/src/utils/localRequire.js | 4 +++- 3 files changed, 18 insertions(+), 14 deletions(-) create mode 100644 packages/core/parcel-bundler/src/utils/getModuleParts.js diff --git a/packages/core/parcel-bundler/src/Resolver.js b/packages/core/parcel-bundler/src/Resolver.js index f63c13a8f90..c047d1ba211 100755 --- a/packages/core/parcel-bundler/src/Resolver.js +++ b/packages/core/parcel-bundler/src/Resolver.js @@ -4,6 +4,7 @@ const path = require('path'); const {isGlob} = require('./utils/glob'); const fs = require('@parcel/fs'); const micromatch = require('micromatch'); +const getModuleParts = require('./utils/getModuleParts'); const EMPTY_SHIM = require.resolve('./builtins/_empty'); @@ -104,7 +105,7 @@ class Resolver { // If we couldn't resolve the node_modules path, just return the module name info if (!resolved) { - let parts = this.getModuleParts(filename); + let parts = getModuleParts(filename); resolved = { moduleName: parts[0], subPath: parts[1] @@ -171,7 +172,7 @@ class Resolver { return {filePath: builtins[filename]}; } - let parts = this.getModuleParts(filename); + let parts = getModuleParts(filename); let root = path.parse(dir).root; while (dir !== root) { @@ -374,7 +375,7 @@ class Resolver { alias = this.lookupAlias(aliases, filename, dir); if (alias == null) { // If it didn't match, try only the module name. - let parts = this.getModuleParts(filename); + let parts = getModuleParts(filename); alias = this.lookupAlias(aliases, parts[0], dir); if (typeof alias === 'string') { // Append the filename back onto the aliased module. @@ -442,16 +443,6 @@ class Resolver { let pkg = await this.findPackage(dir); return this.resolveAliases(filename, pkg); } - - getModuleParts(name) { - let parts = path.normalize(name).split(path.sep); - if (parts[0].charAt(0) === '@') { - // Scoped module (e.g. @scope/module). Merge the first two parts back together. - parts.splice(0, 2, `${parts[0]}/${parts[1]}`); - } - - return parts; - } } module.exports = Resolver; diff --git a/packages/core/parcel-bundler/src/utils/getModuleParts.js b/packages/core/parcel-bundler/src/utils/getModuleParts.js new file mode 100644 index 00000000000..848876c9959 --- /dev/null +++ b/packages/core/parcel-bundler/src/utils/getModuleParts.js @@ -0,0 +1,11 @@ +const path = require('path'); + +module.exports = function(name) { + let parts = path.normalize(name).split(path.sep); + if (parts[0].charAt(0) === '@') { + // Scoped module (e.g. @scope/module). Merge the first two parts back together. + parts.splice(0, 2, `${parts[0]}/${parts[1]}`); + } + + return parts; +}; diff --git a/packages/core/parcel-bundler/src/utils/localRequire.js b/packages/core/parcel-bundler/src/utils/localRequire.js index 24f20da9345..42a2fd6c950 100644 --- a/packages/core/parcel-bundler/src/utils/localRequire.js +++ b/packages/core/parcel-bundler/src/utils/localRequire.js @@ -2,6 +2,7 @@ const {dirname} = require('path'); const {promisify} = require('@parcel/utils'); const resolve = promisify(require('resolve')); const installPackage = require('./installPackage'); +const getModuleParts = require('./getModuleParts'); const cache = new Map(); @@ -19,7 +20,8 @@ async function localResolve(name, path, triedInstall = false) { resolved = await resolve(name, {basedir}); } catch (e) { if (e.code === 'MODULE_NOT_FOUND' && !triedInstall) { - await installPackage(name, path); + const packageName = getModuleParts(name)[0]; + await installPackage(packageName, path); return await localResolve(name, path, true); } throw e; From bdc044acfad84ba25bdb6631fbd3dd955424a227 Mon Sep 17 00:00:00 2001 From: Liz Date: Sun, 20 Jan 2019 22:30:55 -0500 Subject: [PATCH 20/47] Default port to process.env.PORT (#2559) --- packages/core/parcel-bundler/src/cli.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/core/parcel-bundler/src/cli.js b/packages/core/parcel-bundler/src/cli.js index 6fd3f2eb098..0ecb014fedb 100755 --- a/packages/core/parcel-bundler/src/cli.js +++ b/packages/core/parcel-bundler/src/cli.js @@ -218,11 +218,8 @@ async function bundle(main, command) { command.target = command.target || 'browser'; if (command.name() === 'serve' && command.target === 'browser') { - const server = await bundler.serve( - command.port || 1234, - command.https, - command.host - ); + const port = command.port || process.env.PORT || 1234; + const server = await bundler.serve(port, command.https, command.host); if (server && command.open) { await require('./utils/openInBrowser')( `${command.https ? 'https' : 'http'}://localhost:${ From 9abe11ed7fa0171b36ec7499e48d86dcbbac7e00 Mon Sep 17 00:00:00 2001 From: Jasper De Moor Date: Wed, 30 Jan 2019 17:13:10 +0100 Subject: [PATCH 21/47] Refactor htmlnano tests to test for filesize (#2591) --- packages/core/integration-tests/test/html.js | 40 +++++++++++-------- .../core/parcel-bundler/test/sourcemaps.js | 1 - 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/packages/core/integration-tests/test/html.js b/packages/core/integration-tests/test/html.js index ed3962951e4..c498e84fc41 100644 --- a/packages/core/integration-tests/test/html.js +++ b/packages/core/integration-tests/test/html.js @@ -280,16 +280,20 @@ describe('html', function() { }); it('should minify HTML in production mode', async function() { - await bundle(path.join(__dirname, '/integration/htmlnano/index.html'), { + let inputFile = path.join(__dirname, '/integration/htmlnano/index.html'); + await bundle(inputFile, { production: true }); - let html = await fs.readFile( - path.join(__dirname, '/dist/index.html'), - 'utf8' - ); + let inputSize = (await fs.stat(inputFile)).size; + + let outputFile = path.join(__dirname, '/dist/index.html'); + let outputSize = (await fs.stat(outputFile)).size; + + assert(inputSize > outputSize); + + let html = await fs.readFile(outputFile, 'utf8'); assert(html.includes('Other page')); - assert(!html.includes('\n')); }); it('should read .htmlnanorc and minify HTML in production mode', async function() { @@ -326,19 +330,23 @@ describe('html', function() { }); it('should not minify default values inside HTML in production mode', async function() { - await bundle( - path.join(__dirname, '/integration/htmlnano-defaults-form/index.html'), - { - production: true - } + let inputFile = path.join( + __dirname, + '/integration/htmlnano-defaults-form/index.html' ); + await bundle(inputFile, { + production: true + }); - let html = await fs.readFile( - path.join(__dirname, '/dist/index.html'), - 'utf8' - ); + let inputSize = (await fs.stat(inputFile)).size; + + let outputFile = path.join(__dirname, '/dist/index.html'); + let outputSize = (await fs.stat(outputFile)).size; + + assert(inputSize > outputSize); + + let html = await fs.readFile(outputFile, 'utf8'); assert(html.includes('')); - assert(!html.includes('\n')); }); it('should not prepend the public path to assets with remote URLs', async function() { diff --git a/packages/core/parcel-bundler/test/sourcemaps.js b/packages/core/parcel-bundler/test/sourcemaps.js index 8e6b41cbea4..075a63415c5 100644 --- a/packages/core/parcel-bundler/test/sourcemaps.js +++ b/packages/core/parcel-bundler/test/sourcemaps.js @@ -1,5 +1,4 @@ const assert = require('assert'); -const fs = require('@parcel/fs'); const SourceMap = require('../src/SourceMap'); describe('sourcemaps', function() { From 0ada4d6a8ce3d6687fb33e03e88e91167b6a497d Mon Sep 17 00:00:00 2001 From: miewx Date: Thu, 31 Jan 2019 00:19:40 +0800 Subject: [PATCH 22/47] pug Deprecated pretty (#2582) see https://pugjs.org/api/reference.html#options pretty: boolean | string [Deprecated.] Adds whitespace to the resulting HTML to make it easier for a human to read using ' ' as indentation. If a string is specified, that will be used as indentation instead (e.g. '\t'). We strongly recommend against using this option. Too often, it creates subtle bugs in your templates because of the way it alters the interpretation and rendering of whitespace, and so this feature is going to be removed. Defaults to false. --- packages/core/parcel-bundler/src/assets/PugAsset.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/parcel-bundler/src/assets/PugAsset.js b/packages/core/parcel-bundler/src/assets/PugAsset.js index 069b62a9ddd..b9a431b2bf3 100644 --- a/packages/core/parcel-bundler/src/assets/PugAsset.js +++ b/packages/core/parcel-bundler/src/assets/PugAsset.js @@ -18,7 +18,7 @@ class PugAsset extends Asset { compileDebug: false, filename: this.name, basedir: path.dirname(this.name), - pretty: !this.options.minify, + pretty: config.pretty || false, templateName: path.basename(this.basename, path.extname(this.basename)), filters: config.filters, filterOptions: config.filterOptions, From 791b4b80462fee453d82f4c711b86553daa3427e Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Thu, 31 Jan 2019 22:21:47 +0100 Subject: [PATCH 23/47] Fix pug test (#2600) * Fix pug test * Update pug.js --- packages/core/integration-tests/test/pug.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/core/integration-tests/test/pug.js b/packages/core/integration-tests/test/pug.js index 79bc8f0f778..59198e60a7b 100644 --- a/packages/core/integration-tests/test/pug.js +++ b/packages/core/integration-tests/test/pug.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree, normaliseNewlines} = require('./utils'); +const {bundle, assertBundleTree} = require('./utils'); describe('pug', function() { it('should support bundling HTML', async function() { @@ -58,17 +58,13 @@ describe('pug', function() { assets: ['index.pug'] }); - const html = normaliseNewlines( - await fs.readFile(path.join(__dirname, '/dist/index.html'), 'utf-8') - ); - const expect = normaliseNewlines( - await fs.readFile( - path.join(__dirname, '/integration/pug-include-extends/expect.html'), - 'utf-8' - ) + const html = await fs.readFile( + path.join(__dirname, '/dist/index.html'), + 'utf-8' ); - assert.equal(html, expect, 'Content mismatch'); + assert(html.includes('')); + assert(html.includes("

Yep, it's working!

")); }); it('should support variables', async function() { From 32791e3233179e6fc862cbecb58ebf3fc086f21c Mon Sep 17 00:00:00 2001 From: sainthkh Date: Sun, 3 Feb 2019 08:28:05 +0900 Subject: [PATCH 24/47] Use the test to assert this.child.killed rather than checking time difference. (#2609) (#2612) --- packages/core/watcher/test/fswatcher.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/watcher/test/fswatcher.js b/packages/core/watcher/test/fswatcher.js index 013e19ba04e..1ac223fe874 100644 --- a/packages/core/watcher/test/fswatcher.js +++ b/packages/core/watcher/test/fswatcher.js @@ -25,8 +25,7 @@ describe('Watcher', function() { assert(!!watcher.child); assert(watcher.ready); - let time = Date.now(); await watcher.stop(); - assert.notEqual(time, Date.now()); + assert(watcher.child.killed); }); }); From eb759a44fdad1f158ff315f653ade89dafa843ef Mon Sep 17 00:00:00 2001 From: sainthkh Date: Mon, 4 Feb 2019 02:28:22 +0900 Subject: [PATCH 25/47] Improve tests: symlink tests, Kotlin tests, and maybe test-util module (#2605) * Ignore Kotlin tests and show messages when Java is not installed or configured. (#2603) * Skip symlink tests and show warning message when tests are run without admin privilege. (#2602) * Moved parcel-bundler/test/utils.js and integration-tests/test/utils.js into test-utils/src/utils.js. (#2604) * Fixed eslint errors. * Use the test to assert this.child.killed rather than checking time difference. (#2609) (#2612) --- .../core/integration-tests/test/bundler.js | 7 +- .../integration-tests/test/contentHashing.js | 2 +- packages/core/integration-tests/test/css.js | 8 +- packages/core/integration-tests/test/elm.js | 2 +- .../core/integration-tests/test/encodedURI.js | 2 +- packages/core/integration-tests/test/fs.js | 2 +- packages/core/integration-tests/test/glob.js | 2 +- packages/core/integration-tests/test/glsl.js | 7 +- .../core/integration-tests/test/graphql.js | 2 +- packages/core/integration-tests/test/hmr.js | 2 +- packages/core/integration-tests/test/html.js | 2 +- .../core/integration-tests/test/javascript.js | 36 ++- .../core/integration-tests/test/kotlin.js | 11 +- packages/core/integration-tests/test/less.js | 2 +- .../core/integration-tests/test/parser.js | 2 +- packages/core/integration-tests/test/pug.js | 2 +- .../core/integration-tests/test/reason.js | 2 +- packages/core/integration-tests/test/rust.js | 2 +- packages/core/integration-tests/test/sass.js | 2 +- .../integration-tests/test/schema-jsonld.js | 2 +- .../integration-tests/test/scope-hoisting.js | 2 +- .../core/integration-tests/test/server.js | 2 +- .../core/integration-tests/test/sourcemaps.js | 2 +- .../core/integration-tests/test/stylus.js | 2 +- .../core/integration-tests/test/sugarss.js | 2 +- .../core/integration-tests/test/typescript.js | 2 +- packages/core/integration-tests/test/utils.js | 280 +---------------- packages/core/integration-tests/test/vue.js | 2 +- packages/core/integration-tests/test/wasm.js | 2 +- .../core/integration-tests/test/watcher.js | 58 ++-- packages/core/parcel-bundler/test/asset.js | 2 +- .../core/parcel-bundler/test/autoinstall.js | 2 +- packages/core/parcel-bundler/test/fs-cache.js | 2 +- .../test/generateCertificate.js | 2 +- packages/core/parcel-bundler/test/plugins.js | 2 +- packages/core/parcel-bundler/test/resolver.js | 50 ++- packages/core/parcel-bundler/test/utils.js | 280 +---------------- packages/core/test-utils/src/utils.js | 292 ++++++++++++++++++ 38 files changed, 440 insertions(+), 645 deletions(-) diff --git a/packages/core/integration-tests/test/bundler.js b/packages/core/integration-tests/test/bundler.js index 7534f3a5603..3203dcca046 100644 --- a/packages/core/integration-tests/test/bundler.js +++ b/packages/core/integration-tests/test/bundler.js @@ -1,7 +1,12 @@ const assert = require('assert'); const sinon = require('sinon'); const path = require('path'); -const {assertBundleTree, bundle, bundler, nextBundle} = require('./utils'); +const { + assertBundleTree, + bundle, + bundler, + nextBundle +} = require('@parcel/test-utils'); describe('bundler', function() { it('should bundle once before exporting middleware', async function() { diff --git a/packages/core/integration-tests/test/contentHashing.js b/packages/core/integration-tests/test/contentHashing.js index 9dc279db394..584677c07c9 100644 --- a/packages/core/integration-tests/test/contentHashing.js +++ b/packages/core/integration-tests/test/contentHashing.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, rimraf, ncp} = require('./utils'); +const {bundle, rimraf, ncp} = require('@parcel/test-utils'); describe('content hashing', function() { beforeEach(async function() { diff --git a/packages/core/integration-tests/test/css.js b/packages/core/integration-tests/test/css.js index c022343cac8..422b8b9a01f 100644 --- a/packages/core/integration-tests/test/css.js +++ b/packages/core/integration-tests/test/css.js @@ -1,7 +1,13 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree, rimraf, ncp} = require('./utils'); +const { + bundle, + run, + assertBundleTree, + rimraf, + ncp +} = require('@parcel/test-utils'); describe('css', function() { it('should produce two bundles when importing a CSS file', async function() { diff --git a/packages/core/integration-tests/test/elm.js b/packages/core/integration-tests/test/elm.js index 4ab71a716db..972c5a3a4a0 100644 --- a/packages/core/integration-tests/test/elm.js +++ b/packages/core/integration-tests/test/elm.js @@ -1,6 +1,6 @@ const assert = require('assert'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree, run} = require('./utils'); +const {bundle, assertBundleTree, run} = require('@parcel/test-utils'); describe('elm', function() { it('should produce a basic Elm bundle', async function() { diff --git a/packages/core/integration-tests/test/encodedURI.js b/packages/core/integration-tests/test/encodedURI.js index 8450f167962..4aecc42eff2 100644 --- a/packages/core/integration-tests/test/encodedURI.js +++ b/packages/core/integration-tests/test/encodedURI.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); describe('encodedURI', function() { it('should support bundling files which names in encoded URI', async function() { diff --git a/packages/core/integration-tests/test/fs.js b/packages/core/integration-tests/test/fs.js index 1bfa96c2721..f466d80218f 100644 --- a/packages/core/integration-tests/test/fs.js +++ b/packages/core/integration-tests/test/fs.js @@ -1,7 +1,7 @@ const assert = require('assert'); const fs = require('@parcel/fs'); const path = require('path'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('fs', function() { describe('--target=browser', function() { diff --git a/packages/core/integration-tests/test/glob.js b/packages/core/integration-tests/test/glob.js index 9663d7be4b6..7a7253408c9 100644 --- a/packages/core/integration-tests/test/glob.js +++ b/packages/core/integration-tests/test/glob.js @@ -1,7 +1,7 @@ const assert = require('assert'); const fs = require('@parcel/fs'); const path = require('path'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('glob', function() { it('should require a glob of files', async function() { diff --git a/packages/core/integration-tests/test/glsl.js b/packages/core/integration-tests/test/glsl.js index b8b1db9e3db..e16f033f638 100644 --- a/packages/core/integration-tests/test/glsl.js +++ b/packages/core/integration-tests/test/glsl.js @@ -1,7 +1,12 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree, normaliseNewlines} = require('./utils'); +const { + bundle, + run, + assertBundleTree, + normaliseNewlines +} = require('@parcel/test-utils'); describe('glsl', function() { it('should support requiring GLSL files via glslify', async function() { diff --git a/packages/core/integration-tests/test/graphql.js b/packages/core/integration-tests/test/graphql.js index 4c890f7b1dc..2a90d4b22ba 100644 --- a/packages/core/integration-tests/test/graphql.js +++ b/packages/core/integration-tests/test/graphql.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const gql = require('graphql-tag'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('graphql', function() { it('should support requiring graphql files', async function() { diff --git a/packages/core/integration-tests/test/hmr.js b/packages/core/integration-tests/test/hmr.js index 7ea84ce743b..6e5a91ce2ee 100644 --- a/packages/core/integration-tests/test/hmr.js +++ b/packages/core/integration-tests/test/hmr.js @@ -1,7 +1,7 @@ const assert = require('assert'); const fs = require('@parcel/fs'); const path = require('path'); -const {bundler, run, rimraf, ncp} = require('./utils'); +const {bundler, run, rimraf, ncp} = require('@parcel/test-utils'); const {sleep} = require('@parcel/test-utils'); const WebSocket = require('ws'); const json5 = require('json5'); diff --git a/packages/core/integration-tests/test/html.js b/packages/core/integration-tests/test/html.js index c498e84fc41..7b3ee6da5cf 100644 --- a/packages/core/integration-tests/test/html.js +++ b/packages/core/integration-tests/test/html.js @@ -1,6 +1,6 @@ const assert = require('assert'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); const path = require('path'); describe('html', function() { diff --git a/packages/core/integration-tests/test/javascript.js b/packages/core/integration-tests/test/javascript.js index ba255be5792..55286f20bea 100644 --- a/packages/core/integration-tests/test/javascript.js +++ b/packages/core/integration-tests/test/javascript.js @@ -8,8 +8,9 @@ const { assertBundleTree, deferred, ncp -} = require('./utils'); +} = require('@parcel/test-utils'); const {mkdirp} = require('@parcel/fs'); +const {symlinkPrivilegeWarning} = require('@parcel/test-utils'); const {symlinkSync} = require('fs'); describe('javascript', function() { @@ -1290,21 +1291,28 @@ describe('javascript', function() { inputDir ); - // Create the symlink here to prevent cross platform and git issues - symlinkSync( - path.join(inputDir, 'packages/foo'), - path.join(inputDir, 'node_modules/foo'), - 'dir' - ); + try { + // Create the symlink here to prevent cross platform and git issues + symlinkSync( + path.join(inputDir, 'packages/foo'), + path.join(inputDir, 'node_modules/foo'), + 'dir' + ); - await bundle(inputDir + '/index.js'); + await bundle(inputDir + '/index.js'); - let file = await fs.readFile( - path.join(__dirname, '/dist/index.js'), - 'utf8' - ); - assert(file.includes('function Foo')); - assert(file.includes('function Bar')); + let file = await fs.readFile( + path.join(__dirname, '/dist/index.js'), + 'utf8' + ); + assert(file.includes('function Foo')); + assert(file.includes('function Bar')); + } catch (e) { + if (e.perm == 'EPERM') { + symlinkPrivilegeWarning(); + this.skip(); + } + } }); it('should not compile node_modules with a source field in package.json when not symlinked', async function() { diff --git a/packages/core/integration-tests/test/kotlin.js b/packages/core/integration-tests/test/kotlin.js index 0e62f88133d..43ddbcdc7a9 100644 --- a/packages/core/integration-tests/test/kotlin.js +++ b/packages/core/integration-tests/test/kotlin.js @@ -1,7 +1,16 @@ const assert = require('assert'); -const {bundle, assertBundleTree, run} = require('./utils'); +const {bundle, assertBundleTree, run} = require('@parcel/test-utils'); +const commandExists = require('command-exists'); describe('kotlin', function() { + if (!commandExists.sync('java')) { + // eslint-disable-next-line no-console + console.log( + 'Skipping Kotlin tests. Install https://www.java.com/download/ to run them.' + ); + return; + } + it('should produce a basic kotlin bundle', async function() { let b = await bundle(__dirname + '/integration/kotlin/index.js'); diff --git a/packages/core/integration-tests/test/less.js b/packages/core/integration-tests/test/less.js index da522dd66d0..11bc5ca177f 100644 --- a/packages/core/integration-tests/test/less.js +++ b/packages/core/integration-tests/test/less.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('less', function() { it('should support requiring less files', async function() { diff --git a/packages/core/integration-tests/test/parser.js b/packages/core/integration-tests/test/parser.js index af10583255a..4d9fd37390f 100644 --- a/packages/core/integration-tests/test/parser.js +++ b/packages/core/integration-tests/test/parser.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); describe('parser', function() { it('should support case-insensitive file extension', async function() { diff --git a/packages/core/integration-tests/test/pug.js b/packages/core/integration-tests/test/pug.js index 59198e60a7b..81f0d9fda7c 100644 --- a/packages/core/integration-tests/test/pug.js +++ b/packages/core/integration-tests/test/pug.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); describe('pug', function() { it('should support bundling HTML', async function() { diff --git a/packages/core/integration-tests/test/reason.js b/packages/core/integration-tests/test/reason.js index 6356858d7ea..bf81dade629 100644 --- a/packages/core/integration-tests/test/reason.js +++ b/packages/core/integration-tests/test/reason.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle, run} = require('./utils'); +const {bundle, run} = require('@parcel/test-utils'); describe('reason', function() { it('should produce a bundle', async function() { diff --git a/packages/core/integration-tests/test/rust.js b/packages/core/integration-tests/test/rust.js index 90e4bd11b60..aa00fce6ed8 100644 --- a/packages/core/integration-tests/test/rust.js +++ b/packages/core/integration-tests/test/rust.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle, bundler, run, assertBundleTree} = require('./utils'); +const {bundle, bundler, run, assertBundleTree} = require('@parcel/test-utils'); const fs = require('@parcel/fs'); const commandExists = require('command-exists'); diff --git a/packages/core/integration-tests/test/sass.js b/packages/core/integration-tests/test/sass.js index 5febcbd0e64..245e3af66b1 100644 --- a/packages/core/integration-tests/test/sass.js +++ b/packages/core/integration-tests/test/sass.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('sass', function() { it('should support requiring sass files', async function() { diff --git a/packages/core/integration-tests/test/schema-jsonld.js b/packages/core/integration-tests/test/schema-jsonld.js index 5e7d24c1aec..24ead830864 100644 --- a/packages/core/integration-tests/test/schema-jsonld.js +++ b/packages/core/integration-tests/test/schema-jsonld.js @@ -1,4 +1,4 @@ -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); describe('schema ld+json', function() { it('Should parse a LD+JSON schema and collect dependencies', async function() { diff --git a/packages/core/integration-tests/test/scope-hoisting.js b/packages/core/integration-tests/test/scope-hoisting.js index 0632164f044..d40a48f2ea2 100644 --- a/packages/core/integration-tests/test/scope-hoisting.js +++ b/packages/core/integration-tests/test/scope-hoisting.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle: _bundle, run} = require('./utils'); +const {bundle: _bundle, run} = require('@parcel/test-utils'); const fs = require('@parcel/fs'); const bundle = (name, opts = {}) => diff --git a/packages/core/integration-tests/test/server.js b/packages/core/integration-tests/test/server.js index 9dccf7ca8be..f5e18b07dab 100644 --- a/packages/core/integration-tests/test/server.js +++ b/packages/core/integration-tests/test/server.js @@ -2,7 +2,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); const logger = require('@parcel/logger'); -const {bundler} = require('./utils'); +const {bundler} = require('@parcel/test-utils'); const http = require('http'); const https = require('https'); const sinon = require('sinon'); diff --git a/packages/core/integration-tests/test/sourcemaps.js b/packages/core/integration-tests/test/sourcemaps.js index dad3d802d18..233915d50ab 100644 --- a/packages/core/integration-tests/test/sourcemaps.js +++ b/packages/core/integration-tests/test/sourcemaps.js @@ -2,7 +2,7 @@ const assert = require('assert'); const fs = require('@parcel/fs'); const path = require('path'); const mapValidator = require('sourcemap-validator'); -const {bundler, bundle, run, assertBundleTree} = require('./utils'); +const {bundler, bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('sourcemaps', function() { it('should create a valid sourcemap as a child of a JS bundle', async function() { diff --git a/packages/core/integration-tests/test/stylus.js b/packages/core/integration-tests/test/stylus.js index 40458ed46ed..f2dd3c087bc 100644 --- a/packages/core/integration-tests/test/stylus.js +++ b/packages/core/integration-tests/test/stylus.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('stylus', function() { it('should support requiring stylus files', async function() { diff --git a/packages/core/integration-tests/test/sugarss.js b/packages/core/integration-tests/test/sugarss.js index 6f0e18994df..f46fec12cb6 100644 --- a/packages/core/integration-tests/test/sugarss.js +++ b/packages/core/integration-tests/test/sugarss.js @@ -1,5 +1,5 @@ const assert = require('assert'); -const {bundle, assertBundleTree} = require('./utils'); +const {bundle, assertBundleTree} = require('@parcel/test-utils'); const fs = require('@parcel/fs'); const path = require('path'); diff --git a/packages/core/integration-tests/test/typescript.js b/packages/core/integration-tests/test/typescript.js index 7aaada0a37b..ef792f5563e 100644 --- a/packages/core/integration-tests/test/typescript.js +++ b/packages/core/integration-tests/test/typescript.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('typescript', function() { it('should produce a ts bundle using ES6 imports', async function() { diff --git a/packages/core/integration-tests/test/utils.js b/packages/core/integration-tests/test/utils.js index e2f78fd517a..25ebdb32d9e 100644 --- a/packages/core/integration-tests/test/utils.js +++ b/packages/core/integration-tests/test/utils.js @@ -1,283 +1,5 @@ -const Bundler = require('parcel-bundler'); -const assert = require('assert'); -const vm = require('vm'); -const fs = require('@parcel/fs'); -const nodeFS = require('fs'); -const path = require('path'); -const WebSocket = require('ws'); -const Module = require('module'); - -const {promisify} = require('@parcel/utils'); -const {sleep} = require('@parcel/test-utils'); -const rimraf = promisify(require('rimraf')); -const ncp = promisify(require('ncp')); - -const chalk = new (require('chalk')).constructor({enabled: true}); -const warning = chalk.keyword('orange'); -// eslint-disable-next-line no-console -console.warn = (...args) => { - // eslint-disable-next-line no-console - console.error(warning(...args)); -}; - -async function removeDistDirectory(count = 0) { - try { - await rimraf(path.join(__dirname, 'dist')); - } catch (e) { - if (count > 8) { - // eslint-disable-next-line no-console - console.warn('WARNING: Unable to remove dist directory:', e.message); - return; - } - - await sleep(250); - await removeDistDirectory(count + 1); - } -} +const {removeDistDirectory} = require('@parcel/test-utils'); beforeEach(async function() { await removeDistDirectory(); }); - -function bundler(file, opts) { - return new Bundler( - file, - Object.assign( - { - outDir: path.join(__dirname, 'dist'), - watch: false, - cache: false, - killWorkers: false, - hmr: false, - logLevel: 0, - throwErrors: true - }, - opts - ) - ); -} - -function bundle(file, opts) { - return bundler(file, opts).bundle(); -} - -function prepareBrowserContext(bundle, globals) { - // for testing dynamic imports - const fakeElement = { - remove() {} - }; - - const fakeDocument = { - createElement(tag) { - return {tag}; - }, - - getElementsByTagName() { - return [ - { - appendChild(el) { - setTimeout(function() { - if (el.tag === 'script') { - vm.runInContext( - nodeFS.readFileSync( - path.join(path.dirname(bundle.name), el.src) - ), - ctx - ); - } - - el.onload(); - }, 0); - } - } - ]; - }, - - getElementById() { - return fakeElement; - }, - - body: { - appendChild() { - return null; - } - } - }; - - var exports = {}; - var ctx = Object.assign( - { - exports, - module: {exports}, - document: fakeDocument, - WebSocket, - console, - location: {hostname: 'localhost'}, - fetch(url) { - return Promise.resolve({ - arrayBuffer() { - return Promise.resolve( - new Uint8Array( - nodeFS.readFileSync(path.join(path.dirname(bundle.name), url)) - ).buffer - ); - }, - text() { - return Promise.resolve( - nodeFS.readFileSync( - path.join(path.dirname(bundle.name), url), - 'utf8' - ) - ); - } - }); - } - }, - globals - ); - - ctx.window = ctx; - return ctx; -} - -function prepareNodeContext(bundle, globals) { - var mod = new Module(bundle.name); - mod.paths = [path.dirname(bundle.name) + '/node_modules']; - - var ctx = Object.assign( - { - module: mod, - exports: module.exports, - __filename: bundle.name, - __dirname: path.dirname(bundle.name), - require: function(path) { - return mod.require(path); - }, - console, - process: process, - setTimeout: setTimeout, - setImmediate: setImmediate - }, - globals - ); - - ctx.global = ctx; - return ctx; -} - -async function run(bundle, globals, opts = {}) { - var ctx; - switch (bundle.entryAsset.options.target) { - case 'browser': - ctx = prepareBrowserContext(bundle, globals); - break; - case 'node': - ctx = prepareNodeContext(bundle, globals); - break; - case 'electron': - ctx = Object.assign( - prepareBrowserContext(bundle, globals), - prepareNodeContext(bundle, globals) - ); - break; - } - - vm.createContext(ctx); - vm.runInContext(await fs.readFile(bundle.name), ctx); - - if (opts.require !== false) { - if (ctx.parcelRequire) { - return ctx.parcelRequire(bundle.entryAsset.id); - } else if (ctx.output) { - return ctx.output; - } - if (ctx.module) { - return ctx.module.exports; - } - } - - return ctx; -} - -async function assertBundleTree(bundle, tree) { - if (tree.name) { - assert.equal( - path.basename(bundle.name), - tree.name, - 'bundle names mismatched' - ); - } - - if (tree.type) { - assert.equal( - bundle.type.toLowerCase(), - tree.type.toLowerCase(), - 'bundle types mismatched' - ); - } - - if (tree.assets) { - assert.deepEqual( - Array.from(bundle.assets) - .map(a => a.basename) - .sort(), - tree.assets.sort() - ); - } - - let childBundles = Array.isArray(tree) ? tree : tree.childBundles; - if (childBundles) { - let children = Array.from(bundle.childBundles).sort( - (a, b) => - Array.from(a.assets).sort()[0].basename < - Array.from(b.assets).sort()[0].basename - ? -1 - : 1 - ); - assert.equal( - bundle.childBundles.size, - childBundles.length, - 'expected number of child bundles mismatched' - ); - await Promise.all( - childBundles.map((b, i) => assertBundleTree(children[i], b)) - ); - } - - if (/js|css/.test(bundle.type)) { - assert(await fs.exists(bundle.name), 'expected file does not exist'); - } -} - -function nextBundle(b) { - return new Promise(resolve => { - b.once('bundled', resolve); - }); -} - -function deferred() { - let resolve, reject; - let promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - - promise.resolve = resolve; - promise.reject = reject; - - return promise; -} - -function normaliseNewlines(text) { - return text.replace(/(\r\n|\n|\r)/g, '\n'); -} - -exports.bundler = bundler; -exports.bundle = bundle; -exports.run = run; -exports.assertBundleTree = assertBundleTree; -exports.nextBundle = nextBundle; -exports.deferred = deferred; -exports.rimraf = rimraf; -exports.ncp = ncp; -exports.normaliseNewlines = normaliseNewlines; diff --git a/packages/core/integration-tests/test/vue.js b/packages/core/integration-tests/test/vue.js index c53dbb5220f..b27c5a7b4ea 100644 --- a/packages/core/integration-tests/test/vue.js +++ b/packages/core/integration-tests/test/vue.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle, assertBundleTree, run} = require('./utils'); +const {bundle, assertBundleTree, run} = require('@parcel/test-utils'); const fs = require('@parcel/fs'); describe('vue', function() { diff --git a/packages/core/integration-tests/test/wasm.js b/packages/core/integration-tests/test/wasm.js index 9fef9ef40cc..67a8eb51fcb 100644 --- a/packages/core/integration-tests/test/wasm.js +++ b/packages/core/integration-tests/test/wasm.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle, run, assertBundleTree, deferred} = require('./utils'); +const {bundle, run, assertBundleTree, deferred} = require('@parcel/test-utils'); describe('wasm', function() { if (typeof WebAssembly === 'undefined') { diff --git a/packages/core/integration-tests/test/watcher.js b/packages/core/integration-tests/test/watcher.js index 58bee8fb362..3426d3defc1 100644 --- a/packages/core/integration-tests/test/watcher.js +++ b/packages/core/integration-tests/test/watcher.js @@ -9,8 +9,9 @@ const { nextBundle, rimraf, ncp -} = require('./utils'); +} = require('@parcel/test-utils'); const {sleep} = require('@parcel/test-utils'); +const {symlinkPrivilegeWarning} = require('@parcel/test-utils'); const {symlinkSync} = require('fs'); const inputDir = path.join(__dirname, '/input'); @@ -274,29 +275,36 @@ describe('watcher', function() { inputDir ); - // Create the symlink here to prevent cross platform and git issues - symlinkSync( - path.join(inputDir, 'local.js'), - path.join(inputDir, 'src/symlinked_local.js') - ); - - b = bundler(path.join(inputDir, '/src/index.js'), { - watch: true - }); - - let bundle = await b.bundle(); - let output = await run(bundle); - - assert.equal(output(), 3); - - await sleep(100); - fs.writeFile( - path.join(inputDir, '/local.js'), - 'exports.a = 5; exports.b = 5;' - ); - - bundle = await nextBundle(b); - output = await run(bundle); - assert.equal(output(), 10); + try { + // Create the symlink here to prevent cross platform and git issues + symlinkSync( + path.join(inputDir, 'local.js'), + path.join(inputDir, 'src/symlinked_local.js') + ); + + b = bundler(path.join(inputDir, '/src/index.js'), { + watch: true + }); + + let bundle = await b.bundle(); + let output = await run(bundle); + + assert.equal(output(), 3); + + await sleep(100); + fs.writeFile( + path.join(inputDir, '/local.js'), + 'exports.a = 5; exports.b = 5;' + ); + + bundle = await nextBundle(b); + output = await run(bundle); + assert.equal(output(), 10); + } catch (e) { + if (e.code == 'EPERM') { + symlinkPrivilegeWarning(); + this.skip(); + } + } }); }); diff --git a/packages/core/parcel-bundler/test/asset.js b/packages/core/parcel-bundler/test/asset.js index 11f83118cba..a093f469493 100644 --- a/packages/core/parcel-bundler/test/asset.js +++ b/packages/core/parcel-bundler/test/asset.js @@ -2,7 +2,7 @@ const assert = require('assert'); const fs = require('@parcel/fs'); const path = require('path'); const Asset = require('../src/Asset'); -const {bundle} = require('./utils'); +const {bundle} = require('@parcel/test-utils'); describe('Asset', () => { it('should include default implementations', async () => { diff --git a/packages/core/parcel-bundler/test/autoinstall.js b/packages/core/parcel-bundler/test/autoinstall.js index 0aa5b8fb098..04dd294f1d1 100644 --- a/packages/core/parcel-bundler/test/autoinstall.js +++ b/packages/core/parcel-bundler/test/autoinstall.js @@ -1,7 +1,7 @@ const assert = require('assert'); const install = require('../src/utils/installPackage'); const fs = require('@parcel/fs'); -const {ncp, rimraf} = require('./utils'); +const {ncp, rimraf} = require('@parcel/test-utils'); const path = require('path'); const inputDirPath = path.join(__dirname, '/input'); diff --git a/packages/core/parcel-bundler/test/fs-cache.js b/packages/core/parcel-bundler/test/fs-cache.js index f868ce894fa..346f6912b30 100644 --- a/packages/core/parcel-bundler/test/fs-cache.js +++ b/packages/core/parcel-bundler/test/fs-cache.js @@ -1,7 +1,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); -const {rimraf, ncp} = require('./utils'); +const {rimraf, ncp} = require('@parcel/test-utils'); const {sleep} = require('@parcel/test-utils'); const FSCache = require('../src/FSCache'); diff --git a/packages/core/parcel-bundler/test/generateCertificate.js b/packages/core/parcel-bundler/test/generateCertificate.js index 844156eb7a0..b803ceaec49 100644 --- a/packages/core/parcel-bundler/test/generateCertificate.js +++ b/packages/core/parcel-bundler/test/generateCertificate.js @@ -2,7 +2,7 @@ const assert = require('assert'); const path = require('path'); const fs = require('@parcel/fs'); const generateCertificate = require('../src/utils/generateCertificate'); -const {rimraf, ncp} = require('./utils'); +const {rimraf, ncp} = require('@parcel/test-utils'); const cachePath = path.join(__dirname, '.cache'); const inputPath = path.join(__dirname, '/input'); diff --git a/packages/core/parcel-bundler/test/plugins.js b/packages/core/parcel-bundler/test/plugins.js index c1510d8200f..d8e69fdb879 100644 --- a/packages/core/parcel-bundler/test/plugins.js +++ b/packages/core/parcel-bundler/test/plugins.js @@ -1,6 +1,6 @@ const assert = require('assert'); const path = require('path'); -const {bundle, run, assertBundleTree} = require('./utils'); +const {bundle, run, assertBundleTree} = require('@parcel/test-utils'); describe('plugins', function() { it('should load plugins and apply custom asset type', async function() { diff --git a/packages/core/parcel-bundler/test/resolver.js b/packages/core/parcel-bundler/test/resolver.js index f16bdd7d9cd..6dcf1885667 100644 --- a/packages/core/parcel-bundler/test/resolver.js +++ b/packages/core/parcel-bundler/test/resolver.js @@ -1,35 +1,45 @@ const Resolver = require('../src/Resolver'); const path = require('path'); const assert = require('assert'); -const {rimraf, ncp} = require('./utils'); +const {rimraf, ncp} = require('@parcel/test-utils'); const {mkdirp} = require('@parcel/fs'); +const {symlinkPrivilegeWarning} = require('@parcel/test-utils'); const {symlinkSync} = require('fs'); const rootDir = path.join(__dirname, 'input/resolver'); describe('resolver', function() { let resolver; + let hasPrivilege = true; + before(async function() { await rimraf(path.join(__dirname, '/input')); await mkdirp(rootDir); await ncp(path.join(__dirname, 'integration/resolver'), rootDir); // Create the symlinks here to prevent cross platform and git issues - symlinkSync( - path.join(rootDir, 'packages/source'), - path.join(rootDir, 'node_modules/source'), - 'dir' - ); - symlinkSync( - path.join(rootDir, 'packages/source-alias'), - path.join(rootDir, 'node_modules/source-alias'), - 'dir' - ); - symlinkSync( - path.join(rootDir, 'packages/source-alias-glob'), - path.join(rootDir, 'node_modules/source-alias-glob'), - 'dir' - ); + try { + symlinkSync( + path.join(rootDir, 'packages/source'), + path.join(rootDir, 'node_modules/source'), + 'dir' + ); + symlinkSync( + path.join(rootDir, 'packages/source-alias'), + path.join(rootDir, 'node_modules/source-alias'), + 'dir' + ); + symlinkSync( + path.join(rootDir, 'packages/source-alias-glob'), + path.join(rootDir, 'node_modules/source-alias-glob'), + 'dir' + ); + } catch (e) { + if (e.code == 'EPERM') { + symlinkPrivilegeWarning(); + hasPrivilege = false; + } + } resolver = new Resolver({ rootDir, @@ -579,6 +589,8 @@ describe('resolver', function() { describe('source field', function() { it('should use the source field when symlinked', async function() { + if (!hasPrivilege) this.skip(); + let resolved = await resolver.resolve( 'source', path.join(rootDir, 'foo.js') @@ -591,6 +603,8 @@ describe('resolver', function() { }); it('should not use the source field when not symlinked', async function() { + if (!hasPrivilege) this.skip(); + let resolved = await resolver.resolve( 'source-not-symlinked', path.join(rootDir, 'foo.js') @@ -603,6 +617,8 @@ describe('resolver', function() { }); it('should use the source field as an alias when symlinked', async function() { + if (!hasPrivilege) this.skip(); + let resolved = await resolver.resolve( 'source-alias/dist', path.join(rootDir, 'foo.js') @@ -615,6 +631,8 @@ describe('resolver', function() { }); it('should use the source field as a glob alias when symlinked', async function() { + if (!hasPrivilege) this.skip(); + let resolved = await resolver.resolve( 'source-alias-glob', path.join(rootDir, 'foo.js') diff --git a/packages/core/parcel-bundler/test/utils.js b/packages/core/parcel-bundler/test/utils.js index f844538007c..25ebdb32d9e 100644 --- a/packages/core/parcel-bundler/test/utils.js +++ b/packages/core/parcel-bundler/test/utils.js @@ -1,283 +1,5 @@ -const Bundler = require('../src/Bundler'); -const assert = require('assert'); -const vm = require('vm'); -const fs = require('@parcel/fs'); -const nodeFS = require('fs'); -const path = require('path'); -const WebSocket = require('ws'); -const Module = require('module'); - -const {promisify} = require('@parcel/utils'); -const {sleep} = require('@parcel/test-utils'); -const rimraf = promisify(require('rimraf')); -const ncp = promisify(require('ncp')); - -const chalk = new (require('chalk')).constructor({enabled: true}); -const warning = chalk.keyword('orange'); -// eslint-disable-next-line no-console -console.warn = (...args) => { - // eslint-disable-next-line no-console - console.error(warning(...args)); -}; - -async function removeDistDirectory(count = 0) { - try { - await rimraf(path.join(__dirname, 'dist')); - } catch (e) { - if (count > 8) { - // eslint-disable-next-line no-console - console.warn('WARNING: Unable to remove dist directory:', e.message); - return; - } - - await sleep(250); - await removeDistDirectory(count + 1); - } -} +const {removeDistDirectory} = require('@parcel/test-utils'); beforeEach(async function() { await removeDistDirectory(); }); - -function bundler(file, opts) { - return new Bundler( - file, - Object.assign( - { - outDir: path.join(__dirname, 'dist'), - watch: false, - cache: false, - killWorkers: false, - hmr: false, - logLevel: 0, - throwErrors: true - }, - opts - ) - ); -} - -function bundle(file, opts) { - return bundler(file, opts).bundle(); -} - -function prepareBrowserContext(bundle, globals) { - // for testing dynamic imports - const fakeElement = { - remove() {} - }; - - const fakeDocument = { - createElement(tag) { - return {tag}; - }, - - getElementsByTagName() { - return [ - { - appendChild(el) { - setTimeout(function() { - if (el.tag === 'script') { - vm.runInContext( - nodeFS.readFileSync( - path.join(path.dirname(bundle.name), el.src) - ), - ctx - ); - } - - el.onload(); - }, 0); - } - } - ]; - }, - - getElementById() { - return fakeElement; - }, - - body: { - appendChild() { - return null; - } - } - }; - - var exports = {}; - var ctx = Object.assign( - { - exports, - module: {exports}, - document: fakeDocument, - WebSocket, - console, - location: {hostname: 'localhost'}, - fetch(url) { - return Promise.resolve({ - arrayBuffer() { - return Promise.resolve( - new Uint8Array( - nodeFS.readFileSync(path.join(path.dirname(bundle.name), url)) - ).buffer - ); - }, - text() { - return Promise.resolve( - nodeFS.readFileSync( - path.join(path.dirname(bundle.name), url), - 'utf8' - ) - ); - } - }); - } - }, - globals - ); - - ctx.window = ctx; - return ctx; -} - -function prepareNodeContext(bundle, globals) { - var mod = new Module(bundle.name); - mod.paths = [path.dirname(bundle.name) + '/node_modules']; - - var ctx = Object.assign( - { - module: mod, - exports: module.exports, - __filename: bundle.name, - __dirname: path.dirname(bundle.name), - require: function(path) { - return mod.require(path); - }, - console, - process: process, - setTimeout: setTimeout, - setImmediate: setImmediate - }, - globals - ); - - ctx.global = ctx; - return ctx; -} - -async function run(bundle, globals, opts = {}) { - var ctx; - switch (bundle.entryAsset.options.target) { - case 'browser': - ctx = prepareBrowserContext(bundle, globals); - break; - case 'node': - ctx = prepareNodeContext(bundle, globals); - break; - case 'electron': - ctx = Object.assign( - prepareBrowserContext(bundle, globals), - prepareNodeContext(bundle, globals) - ); - break; - } - - vm.createContext(ctx); - vm.runInContext(await fs.readFile(bundle.name), ctx); - - if (opts.require !== false) { - if (ctx.parcelRequire) { - return ctx.parcelRequire(bundle.entryAsset.id); - } else if (ctx.output) { - return ctx.output; - } - if (ctx.module) { - return ctx.module.exports; - } - } - - return ctx; -} - -async function assertBundleTree(bundle, tree) { - if (tree.name) { - assert.equal( - path.basename(bundle.name), - tree.name, - 'bundle names mismatched' - ); - } - - if (tree.type) { - assert.equal( - bundle.type.toLowerCase(), - tree.type.toLowerCase(), - 'bundle types mismatched' - ); - } - - if (tree.assets) { - assert.deepEqual( - Array.from(bundle.assets) - .map(a => a.basename) - .sort(), - tree.assets.sort() - ); - } - - let childBundles = Array.isArray(tree) ? tree : tree.childBundles; - if (childBundles) { - let children = Array.from(bundle.childBundles).sort( - (a, b) => - Array.from(a.assets).sort()[0].basename < - Array.from(b.assets).sort()[0].basename - ? -1 - : 1 - ); - assert.equal( - bundle.childBundles.size, - childBundles.length, - 'expected number of child bundles mismatched' - ); - await Promise.all( - childBundles.map((b, i) => assertBundleTree(children[i], b)) - ); - } - - if (/js|css/.test(bundle.type)) { - assert(await fs.exists(bundle.name), 'expected file does not exist'); - } -} - -function nextBundle(b) { - return new Promise(resolve => { - b.once('bundled', resolve); - }); -} - -function deferred() { - let resolve, reject; - let promise = new Promise((res, rej) => { - resolve = res; - reject = rej; - }); - - promise.resolve = resolve; - promise.reject = reject; - - return promise; -} - -function normaliseNewlines(text) { - return text.replace(/(\r\n|\n|\r)/g, '\n'); -} - -exports.bundler = bundler; -exports.bundle = bundle; -exports.run = run; -exports.assertBundleTree = assertBundleTree; -exports.nextBundle = nextBundle; -exports.deferred = deferred; -exports.rimraf = rimraf; -exports.ncp = ncp; -exports.normaliseNewlines = normaliseNewlines; diff --git a/packages/core/test-utils/src/utils.js b/packages/core/test-utils/src/utils.js index 4cdf552655a..10a8cd1649f 100644 --- a/packages/core/test-utils/src/utils.js +++ b/packages/core/test-utils/src/utils.js @@ -1,5 +1,297 @@ +const Bundler = require('parcel-bundler'); +const assert = require('assert'); +const vm = require('vm'); +const fs = require('@parcel/fs'); +const nodeFS = require('fs'); +const path = require('path'); +const WebSocket = require('ws'); +const Module = require('module'); + +const {promisify} = require('@parcel/utils'); +//const {sleep} = require('@parcel/test-utils'); +const rimraf = promisify(require('rimraf')); +const ncp = promisify(require('ncp')); + +const chalk = new (require('chalk')).constructor({enabled: true}); +const warning = chalk.keyword('orange'); +// eslint-disable-next-line no-console +console.warn = (...args) => { + // eslint-disable-next-line no-console + console.error(warning(...args)); +}; + +async function removeDistDirectory(count = 0) { + try { + await rimraf(path.join(process.cwd(), 'test/dist')); + } catch (e) { + if (count > 8) { + // eslint-disable-next-line no-console + console.warn('WARNING: Unable to remove dist directory:', e.message); + return; + } + + await sleep(250); + await removeDistDirectory(count + 1); + } +} + function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); } +function symlinkPrivilegeWarning() { + // eslint-disable-next-line no-console + console.warn( + `----------------------------------- +Skipping symbolic link test(s) because you don't have the privilege. +Run tests with Administrator privilege. +If you don't know how, check here: https://bit.ly/2UmWsbD +-----------------------------------` + ); +} + +function bundler(file, opts) { + return new Bundler( + file, + Object.assign( + { + outDir: path.join(process.cwd(), 'test/dist'), + watch: false, + cache: false, + killWorkers: false, + hmr: false, + logLevel: 0, + throwErrors: true + }, + opts + ) + ); +} + +function bundle(file, opts) { + return bundler(file, opts).bundle(); +} + +async function run(bundle, globals, opts = {}) { + var ctx; + switch (bundle.entryAsset.options.target) { + case 'browser': + ctx = prepareBrowserContext(bundle, globals); + break; + case 'node': + ctx = prepareNodeContext(bundle, globals); + break; + case 'electron': + ctx = Object.assign( + prepareBrowserContext(bundle, globals), + prepareNodeContext(bundle, globals) + ); + break; + } + + vm.createContext(ctx); + vm.runInContext(await fs.readFile(bundle.name), ctx); + + if (opts.require !== false) { + if (ctx.parcelRequire) { + return ctx.parcelRequire(bundle.entryAsset.id); + } else if (ctx.output) { + return ctx.output; + } + if (ctx.module) { + return ctx.module.exports; + } + } + + return ctx; +} + +async function assertBundleTree(bundle, tree) { + if (tree.name) { + assert.equal( + path.basename(bundle.name), + tree.name, + 'bundle names mismatched' + ); + } + + if (tree.type) { + assert.equal( + bundle.type.toLowerCase(), + tree.type.toLowerCase(), + 'bundle types mismatched' + ); + } + + if (tree.assets) { + assert.deepEqual( + Array.from(bundle.assets) + .map(a => a.basename) + .sort(), + tree.assets.sort() + ); + } + + let childBundles = Array.isArray(tree) ? tree : tree.childBundles; + if (childBundles) { + let children = Array.from(bundle.childBundles).sort( + (a, b) => + Array.from(a.assets).sort()[0].basename < + Array.from(b.assets).sort()[0].basename + ? -1 + : 1 + ); + assert.equal( + bundle.childBundles.size, + childBundles.length, + 'expected number of child bundles mismatched' + ); + await Promise.all( + childBundles.map((b, i) => assertBundleTree(children[i], b)) + ); + } + + if (/js|css/.test(bundle.type)) { + assert(await fs.exists(bundle.name), 'expected file does not exist'); + } +} + +function nextBundle(b) { + return new Promise(resolve => { + b.once('bundled', resolve); + }); +} + +function deferred() { + let resolve, reject; + let promise = new Promise((res, rej) => { + resolve = res; + reject = rej; + }); + + promise.resolve = resolve; + promise.reject = reject; + + return promise; +} + +function normaliseNewlines(text) { + return text.replace(/(\r\n|\n|\r)/g, '\n'); +} + +function prepareBrowserContext(bundle, globals) { + // for testing dynamic imports + const fakeElement = { + remove() {} + }; + + const fakeDocument = { + createElement(tag) { + return {tag}; + }, + + getElementsByTagName() { + return [ + { + appendChild(el) { + setTimeout(function() { + if (el.tag === 'script') { + vm.runInContext( + nodeFS.readFileSync( + path.join(path.dirname(bundle.name), el.src) + ), + ctx + ); + } + + el.onload(); + }, 0); + } + } + ]; + }, + + getElementById() { + return fakeElement; + }, + + body: { + appendChild() { + return null; + } + } + }; + + var exports = {}; + var ctx = Object.assign( + { + exports, + module: {exports}, + document: fakeDocument, + WebSocket, + console, + location: {hostname: 'localhost'}, + fetch(url) { + return Promise.resolve({ + arrayBuffer() { + return Promise.resolve( + new Uint8Array( + nodeFS.readFileSync(path.join(path.dirname(bundle.name), url)) + ).buffer + ); + }, + text() { + return Promise.resolve( + nodeFS.readFileSync( + path.join(path.dirname(bundle.name), url), + 'utf8' + ) + ); + } + }); + } + }, + globals + ); + + ctx.window = ctx; + return ctx; +} + +function prepareNodeContext(bundle, globals) { + var mod = new Module(bundle.name); + mod.paths = [path.dirname(bundle.name) + '/node_modules']; + + var ctx = Object.assign( + { + module: mod, + exports: module.exports, + __filename: bundle.name, + __dirname: path.dirname(bundle.name), + require: function(path) { + return mod.require(path); + }, + console, + process: process, + setTimeout: setTimeout, + setImmediate: setImmediate + }, + globals + ); + + ctx.global = ctx; + return ctx; +} + exports.sleep = sleep; +exports.removeDistDirectory = removeDistDirectory; +exports.symlinkPrivilegeWarning = symlinkPrivilegeWarning; +exports.bundler = bundler; +exports.bundle = bundle; +exports.run = run; +exports.assertBundleTree = assertBundleTree; +exports.nextBundle = nextBundle; +exports.deferred = deferred; +exports.rimraf = rimraf; +exports.ncp = ncp; +exports.normaliseNewlines = normaliseNewlines; From 4c5993f9afd8b0a97a167d0899c44d5a5856447e Mon Sep 17 00:00:00 2001 From: Jannick Garthen Date: Wed, 6 Feb 2019 16:05:47 +0100 Subject: [PATCH 26/47] Inline process.browser for better code elimination (#2583) --- .../test/integration/process/index.js | 8 ++++ .../core/integration-tests/test/javascript.js | 39 +++++++++++++++++++ .../core/parcel-bundler/src/assets/JSAsset.js | 9 +++++ .../parcel-bundler/src/visitors/process.js | 17 ++++++++ 4 files changed, 73 insertions(+) create mode 100644 packages/core/integration-tests/test/integration/process/index.js create mode 100644 packages/core/parcel-bundler/src/visitors/process.js diff --git a/packages/core/integration-tests/test/integration/process/index.js b/packages/core/integration-tests/test/integration/process/index.js new file mode 100644 index 00000000000..469e248a1e5 --- /dev/null +++ b/packages/core/integration-tests/test/integration/process/index.js @@ -0,0 +1,8 @@ +process.browser = false +module.exports = function () { + return process.browser && test(process.browser); +}; + +function test(val) { + return val; +} diff --git a/packages/core/integration-tests/test/javascript.js b/packages/core/integration-tests/test/javascript.js index 55286f20bea..c481b081df5 100644 --- a/packages/core/integration-tests/test/javascript.js +++ b/packages/core/integration-tests/test/javascript.js @@ -856,6 +856,45 @@ describe('javascript', function() { assert.equal(output, 'bartest'); }); + it('should replace process.browser on --target=browser', async function() { + let b = await bundle( + path.join(__dirname, '/integration/process/index.js'), + { + target: 'browser' + } + ); + + let output = await run(b); + assert.ok(output.toString().indexOf('process.browser') === -1); + assert.equal(output(), true); + }); + + it('should not replace process.browser on --target=node', async function() { + let b = await bundle( + path.join(__dirname, '/integration/process/index.js'), + { + target: 'node' + } + ); + + let output = await run(b); + assert.ok(output.toString().indexOf('process.browser') !== -1); + assert.equal(output(), false); + }); + + it('should not replace process.browser on --target=electron', async function() { + let b = await bundle( + path.join(__dirname, '/integration/process/index.js'), + { + target: 'electron' + } + ); + + let output = await run(b); + assert.ok(output.toString().indexOf('process.browser') !== -1); + assert.equal(output(), false); + }); + it('should support adding implicit dependencies', async function() { let b = await bundle(path.join(__dirname, '/integration/json/index.js'), { delegate: { diff --git a/packages/core/parcel-bundler/src/assets/JSAsset.js b/packages/core/parcel-bundler/src/assets/JSAsset.js index 1e1b9308a80..e300a07e8ba 100644 --- a/packages/core/parcel-bundler/src/assets/JSAsset.js +++ b/packages/core/parcel-bundler/src/assets/JSAsset.js @@ -7,6 +7,7 @@ const babelParser = require('@babel/parser'); const insertGlobals = require('../visitors/globals'); const fsVisitor = require('../visitors/fs'); const envVisitor = require('../visitors/env'); +const processVisitor = require('../visitors/process'); const babel = require('../transforms/babel/transform'); const babel7 = require('../transforms/babel/babel7'); const generate = require('@babel/generator').default; @@ -20,6 +21,7 @@ const isAccessedVarChanged = require('../utils/isAccessedVarChanged'); const IMPORT_RE = /\b(?:import\b|export\b|require\s*\()/; const ENV_RE = /\b(?:process\.env)\b/; +const BROWSER_RE = /\b(?:process\.browser)\b/; const GLOBAL_RE = /\b(?:process|__dirname|__filename|global|Buffer|define)\b/; const FS_RE = /\breadFileSync\b/; const SW_RE = /\bnavigator\s*\.\s*serviceWorker\s*\.\s*register\s*\(/; @@ -155,6 +157,13 @@ class JSAsset extends Asset { await this.parseIfNeeded(); this.traverseFast(envVisitor); } + + // Inline process.browser + if (this.options.target === 'browser' && BROWSER_RE.test(this.contents)) { + await this.parseIfNeeded(); + this.traverse(processVisitor); + this.isAstDirty = true; + } } async transform() { diff --git a/packages/core/parcel-bundler/src/visitors/process.js b/packages/core/parcel-bundler/src/visitors/process.js new file mode 100644 index 00000000000..4a3c209b9cd --- /dev/null +++ b/packages/core/parcel-bundler/src/visitors/process.js @@ -0,0 +1,17 @@ +const t = require('@babel/types'); + +module.exports = { + MemberExpression(path) { + // Inline process.browser + const isProcess = path.node.object.name === 'process'; + const isBrowser = path.node.property.name === 'browser'; + const isAssignment = path.parentPath.type === 'AssignmentExpression'; + if (isProcess && isBrowser) { + if (isAssignment) { + path.parentPath.remove(); + } else { + path.replaceWith(t.booleanLiteral(true)); + } + } + } +}; From bdef68b6a12ed7ada12995f93c9ca910e895ab18 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig Date: Thu, 7 Feb 2019 18:24:18 +0100 Subject: [PATCH 27/47] Handle empty html files (#2621) --- packages/core/integration-tests/test/html.js | 12 +++ .../test/integration/html-empty/index.html | 0 .../parcel-bundler/src/assets/HTMLAsset.js | 82 ++++++++++--------- 3 files changed, 54 insertions(+), 40 deletions(-) create mode 100644 packages/core/integration-tests/test/integration/html-empty/index.html diff --git a/packages/core/integration-tests/test/html.js b/packages/core/integration-tests/test/html.js index 7b3ee6da5cf..31ce79fd64f 100644 --- a/packages/core/integration-tests/test/html.js +++ b/packages/core/integration-tests/test/html.js @@ -296,6 +296,18 @@ describe('html', function() { assert(html.includes('Other page')); }); + it('should work with an empty html file', async function() { + let inputFile = path.join(__dirname, '/integration/html-empty/index.html'); + await bundle(inputFile, { + minify: false + }); + + let outputFile = path.join(__dirname, '/dist/index.html'); + + let html = await fs.readFile(outputFile, 'utf8'); + assert.equal(html.length, 0); + }); + it('should read .htmlnanorc and minify HTML in production mode', async function() { await bundle( path.join(__dirname, '/integration/htmlnano-config/index.html'), diff --git a/packages/core/integration-tests/test/integration/html-empty/index.html b/packages/core/integration-tests/test/integration/html-empty/index.html new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/core/parcel-bundler/src/assets/HTMLAsset.js b/packages/core/parcel-bundler/src/assets/HTMLAsset.js index e2646c7fbee..f308759cb04 100644 --- a/packages/core/parcel-bundler/src/assets/HTMLAsset.js +++ b/packages/core/parcel-bundler/src/assets/HTMLAsset.js @@ -204,59 +204,61 @@ class HTMLAsset extends Asset { async generate() { // Extract inline