From 331365ad24b73ab20667827e344e4d32ee9da1b3 Mon Sep 17 00:00:00 2001 From: busma13 Date: Wed, 20 Sep 2023 08:08:43 -0700 Subject: [PATCH 1/5] Add bump and bump-asset scripts to scripts list. Update package.json to include `bump` and `bump-asset` scripts. Add scripts dev dependency. Update package.json files so files have the required fields needed to run a bump script. --- asset/package.json | 20 +++++++++++------ package.json | 19 ++++++++++++---- packages/standard-asset-apis/package.json | 27 +++++++++++++---------- 3 files changed, 43 insertions(+), 23 deletions(-) diff --git a/asset/package.json b/asset/package.json index aacdea04..09769269 100644 --- a/asset/package.json +++ b/asset/package.json @@ -1,18 +1,23 @@ { "name": "standard", + "displayName": "Asset", "version": "0.22.1", + "private": true, "description": "Teraslice standard processor asset bundle", + "repository": { + "type": "git", + "url": "git+https://github.com/terascope/standard-assets.git" + }, "license": "MIT", - "private": true, "workspaces": { "nohoist": [ "**" ] }, "scripts": { - "test": "yarn --cwd ../ test", "build": "tsc --project tsconfig.json", - "build:watch": "yarn build --watch" + "build:watch": "yarn build --watch", + "test": "yarn --cwd ../ test" }, "dependencies": { "@terascope/job-components": "^0.59.0", @@ -26,8 +31,9 @@ "timsort": "^0.3.0", "ts-transforms": "^0.71.0" }, - "repository": { - "type": "git", - "url": "git+https://github.com/terascope/standard-assets.git" - } + "engines": { + "node": ">=14.17.0", + "yarn": ">=1.16.0" + }, + "terascope": {} } diff --git a/package.json b/package.json index 22e9c558..79261afc 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,9 @@ { "name": "standard-assets-bundle", + "displayName": "Standard Assets Bundle", "version": "0.22.1", - "description": "Teraslice standard processor asset bundle", "private": true, + "description": "Teraslice standard processor asset bundle", "workspaces": [ "packages/*", "asset" @@ -12,18 +13,21 @@ "asset:post-build": "./scripts/copy-links.sh", "build": "tsc --build", "build:watch": "tsc --build --watch", + "bump": "ts-scripts bump", + "bump-asset": "ts-scripts bump-asset", "lint": "eslint --ignore-path .gitignore --ext .js,.ts .", "lint:fix": "yarn lint --fix", + "publish:changed": "./scripts/publish.sh", "setup": "yarn && yarn build --force", "test": "jest", "test:all": "yarn workspaces run test", - "test:watch": "jest --coverage=false --notify --watch --onlyChanged", "test:debug": "env DEBUG=\"${DEBUG:-*teraslice*}\" jest --detectOpenHandles --coverage=false --runInBand", - "publish:changed": "./scripts/publish.sh" + "test:watch": "jest --coverage=false --notify --watch --onlyChanged" }, "devDependencies": { "@terascope/eslint-config": "^0.7.1", "@terascope/job-components": "^0.59.0", + "@terascope/scripts": "0.57.0", "@terascope/standard-asset-apis": "^0.6.1", "@types/express": "^4.17.17", "@types/jest": "^29.5.5", @@ -42,6 +46,13 @@ "typescript": "^4.8.3" }, "engines": { - "node": ">=14.17.0" + "node": ">=14.17.0", + "yarn": ">=1.16.0" + }, + "terascope": { + "root": true, + "tests": { + "suites": {} + } } } diff --git a/packages/standard-asset-apis/package.json b/packages/standard-asset-apis/package.json index 77d04c56..d4b076fd 100644 --- a/packages/standard-asset-apis/package.json +++ b/packages/standard-asset-apis/package.json @@ -1,11 +1,12 @@ { "name": "@terascope/standard-asset-apis", + "displayName": "Standard Asset Apis", "version": "0.6.1", "description": "A common set of tools for data processing", - "publishConfig": { - "access": "public" - }, - "srcMain": "src/index.ts", + "homepage": "https://github.com/terascope/standard-assets", + "repository": "git@github.com:terascope/standard-assets.git", + "license": "MIT", + "author": "Terascope, LLC ", "main": "dist/src/index.js", "typings": "dist/src/index.d.ts", "files": [ @@ -15,13 +16,9 @@ "build": "tsc --project tsconfig.json", "build:watch": "yarn build --watch", "test": "jest", - "test:watch": "jest --coverage=false --notify --watch --onlyChanged", - "test:debug": "env DEBUG='*teraslice*' jest --detectOpenHandles --coverage=false --runInBand" + "test:debug": "env DEBUG='*teraslice*' jest --detectOpenHandles --coverage=false --runInBand", + "test:watch": "jest --coverage=false --notify --watch --onlyChanged" }, - "homepage": "https://github.com/terascope/standard-assets", - "repository": "git@github.com:terascope/standard-assets.git", - "author": "Terascope, LLC ", - "license": "MIT", "dependencies": { "@sindresorhus/fnv1a": "^2.0.1", "@terascope/utils": "^0.46.0" @@ -34,6 +31,12 @@ "ts-jest": "^29.1.1" }, "engines": { - "node": ">=10.16.0" - } + "node": ">=14.17.0", + "yarn": ">=1.16.0" + }, + "publishConfig": { + "access": "public" + }, + "srcMain": "src/index.ts", + "terascope": {} } From 9d307f31e5d1e71cffb0ee01b5bf390f3693fa38 Mon Sep 17 00:00:00 2001 From: busma13 Date: Fri, 22 Sep 2023 09:48:11 -0700 Subject: [PATCH 2/5] Update all package.jsons to be test.ts compatible. --- package.json | 5 ++++- packages/standard-asset-apis/package.json | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 79261afc..179cf5b4 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,11 @@ }, "terascope": { "root": true, + "testSuite": "unit", "tests": { - "suites": {} + "suites": { + "unit": [] + } } } } diff --git a/packages/standard-asset-apis/package.json b/packages/standard-asset-apis/package.json index d4b076fd..537ca4d9 100644 --- a/packages/standard-asset-apis/package.json +++ b/packages/standard-asset-apis/package.json @@ -38,5 +38,7 @@ "access": "public" }, "srcMain": "src/index.ts", - "terascope": {} + "terascope": { + "testSuite": "unit" + } } From 6b5e3c93618c7aec27054f119bdc5e4a2388bfef Mon Sep 17 00:00:00 2001 From: busma13 Date: Mon, 25 Sep 2023 09:58:30 -0700 Subject: [PATCH 3/5] Bump @terascope/scripts to version 0.58.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 179cf5b4..e3ea946a 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "devDependencies": { "@terascope/eslint-config": "^0.7.1", "@terascope/job-components": "^0.59.0", - "@terascope/scripts": "0.57.0", + "@terascope/scripts": "0.58.0", "@terascope/standard-asset-apis": "^0.6.1", "@types/express": "^4.17.17", "@types/jest": "^29.5.5", From 6a6831d25850cefd558f9a38e99a0a24e522a4ae Mon Sep 17 00:00:00 2001 From: busma13 Date: Mon, 25 Sep 2023 18:17:33 +0000 Subject: [PATCH 4/5] Update yarn version to 1.22.19 --- .../{yarn-1.18.0.cjs => yarn-1.22.19.js} | 47432 ++++++++-------- .yarnrc | 3 +- asset/package.json | 2 +- package.json | 2 +- packages/standard-asset-apis/package.json | 2 +- 5 files changed, 23908 insertions(+), 23533 deletions(-) rename .yarn/releases/{yarn-1.18.0.cjs => yarn-1.22.19.js} (98%) diff --git a/.yarn/releases/yarn-1.18.0.cjs b/.yarn/releases/yarn-1.22.19.js similarity index 98% rename from .yarn/releases/yarn-1.18.0.cjs rename to .yarn/releases/yarn-1.22.19.js index 89a2dca0..0fefc258 100755 --- a/.yarn/releases/yarn-1.18.0.cjs +++ b/.yarn/releases/yarn-1.22.19.js @@ -65,7 +65,7 @@ module.exports = /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports -/******/ return __webpack_require__(__webpack_require__.s = 549); +/******/ return __webpack_require__(__webpack_require__.s = 517); /******/ }) /************************************************************************/ /******/ ([ @@ -98,192 +98,192 @@ module.exports = require("path"); /* unused harmony export __makeTemplateObject */ /* unused harmony export __importStar */ /* unused harmony export __importDefault */ -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. All rights reserved. -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at http://www.apache.org/licenses/LICENSE-2.0 - -THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED -WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, -MERCHANTABLITY OR NON-INFRINGEMENT. - -See the Apache Version 2.0 License for specific language governing permissions -and limitations under the License. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) - t[p[i]] = s[p[i]]; - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __exportStar(m, exports) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; - if (m) return m.call(o); - return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0) + t[p[i]] = s[p[i]]; + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __exportStar(m, exports) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0; + if (m) return m.call(o); + return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} /***/ }), @@ -295,7 +295,7 @@ function __importDefault(mod) { exports.__esModule = true; -var _promise = __webpack_require__(227); +var _promise = __webpack_require__(224); var _promise2 = _interopRequireDefault(_promise); @@ -338,6 +338,12 @@ module.exports = require("util"); /***/ }), /* 4 */ +/***/ (function(module, exports) { + +module.exports = require("fs"); + +/***/ }), +/* 5 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1393,7 +1399,7 @@ exports.normalizeOS = normalizeOS; var _fs; function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(5)); + return _fs = _interopRequireDefault(__webpack_require__(4)); } var _glob; @@ -1405,7 +1411,7 @@ function _load_glob() { var _os; function _load_os() { - return _os = _interopRequireDefault(__webpack_require__(49)); + return _os = _interopRequireDefault(__webpack_require__(46)); } var _path; @@ -1423,13 +1429,13 @@ function _load_blockingQueue() { var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(50)); + return _promise = _interopRequireWildcard(__webpack_require__(51)); } var _promise2; function _load_promise2() { - return _promise2 = __webpack_require__(50); + return _promise2 = __webpack_require__(51); } var _map; @@ -1441,7 +1447,7 @@ function _load_map() { var _fsNormalized; function _load_fsNormalized() { - return _fsNormalized = __webpack_require__(218); + return _fsNormalized = __webpack_require__(216); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -1516,12 +1522,6 @@ function normalizeOS(body) { const cr = '\r'.charCodeAt(0); const lf = '\n'.charCodeAt(0); -/***/ }), -/* 5 */ -/***/ (function(module, exports) { - -module.exports = require("fs"); - /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { @@ -1565,7 +1565,13 @@ class ResponseError extends Error { } exports.ResponseError = ResponseError; -class OneTimePasswordError extends Error {} +class OneTimePasswordError extends Error { + constructor(notice) { + super(); + this.notice = notice; + } + +} exports.OneTimePasswordError = OneTimePasswordError; /***/ }), @@ -1580,7 +1586,7 @@ exports.OneTimePasswordError = OneTimePasswordError; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observer__ = __webpack_require__(420); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__ = __webpack_require__(321); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__config__ = __webpack_require__(186); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__util_hostReportError__ = __webpack_require__(323); /** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */ @@ -1832,11 +1838,11 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.getPathKey = getPathKey; -const os = __webpack_require__(49); +const os = __webpack_require__(46); const path = __webpack_require__(0); -const userHome = __webpack_require__(66).default; +const userHome = __webpack_require__(67).default; -var _require = __webpack_require__(225); +var _require = __webpack_require__(222); const getCacheDir = _require.getCacheDir, getConfigDir = _require.getConfigDir, @@ -1862,7 +1868,7 @@ const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/lat const SELF_UPDATE_VERSION_URL = exports.SELF_UPDATE_VERSION_URL = 'https://yarnpkg.com/latest-version'; // cache version, bump whenever we make backwards incompatible changes -const CACHE_VERSION = exports.CACHE_VERSION = 4; +const CACHE_VERSION = exports.CACHE_VERSION = 6; // lockfile version, bump whenever we make backwards incompatible changes const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1; @@ -2027,7 +2033,7 @@ module.exports = invariant; "use strict"; -var YAMLException = __webpack_require__(54); +var YAMLException = __webpack_require__(55); var TYPE_CONSTRUCTOR_OPTIONS = [ 'kind', @@ -2090,15 +2096,21 @@ module.exports = Type; /***/ }), /* 11 */ +/***/ (function(module, exports) { + +module.exports = require("crypto"); + +/***/ }), +/* 12 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Observable; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_canReportError__ = __webpack_require__(322); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__ = __webpack_require__(932); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__ = __webpack_require__(118); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_pipe__ = __webpack_require__(324); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(186); /** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */ @@ -2217,12 +2229,6 @@ function getPromiseCtor(promiseCtor) { //# sourceMappingURL=Observable.js.map -/***/ }), -/* 12 */ -/***/ (function(module, exports) { - -module.exports = require("crypto"); - /***/ }), /* 13 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { @@ -2610,7 +2616,7 @@ exports.hyphenate = hyphenate; exports.camelCase = camelCase; exports.compareSortedArrays = compareSortedArrays; exports.sleep = sleep; -const _camelCase = __webpack_require__(230); +const _camelCase = __webpack_require__(227); function sortAlpha(a, b) { // sort alphabetically in a deterministic way @@ -2718,7 +2724,7 @@ function _load_asyncToGenerator() { var _parse; function _load_parse() { - return _parse = __webpack_require__(105); + return _parse = __webpack_require__(106); } Object.defineProperty(exports, 'parse', { @@ -2731,7 +2737,7 @@ Object.defineProperty(exports, 'parse', { var _stringify; function _load_stringify() { - return _stringify = __webpack_require__(199); + return _stringify = __webpack_require__(200); } Object.defineProperty(exports, 'stringify', { @@ -2758,7 +2764,7 @@ function _load_normalizePattern() { var _parse2; function _load_parse2() { - return _parse2 = _interopRequireDefault(__webpack_require__(105)); + return _parse2 = _interopRequireDefault(__webpack_require__(106)); } var _constants; @@ -2770,7 +2776,7 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -2780,7 +2786,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const invariant = __webpack_require__(9); const path = __webpack_require__(0); -const ssri = __webpack_require__(77); +const ssri = __webpack_require__(65); function getName(pattern) { return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name; @@ -2886,6 +2892,11 @@ class Lockfile { reporter.info(reporter.lang('noLockfileFound')); } + if (lockfile && lockfile.__metadata) { + const lockfilev2 = lockfile; + lockfile = {}; + } + return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type }); })(); } @@ -2989,6 +3000,35 @@ exports.default = Lockfile; /* 20 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +exports.__esModule = true; + +var _assign = __webpack_require__(559); + +var _assign2 = _interopRequireDefault(_assign); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +exports.default = _assign2.default || function (target) { + for (var i = 1; i < arguments.length; i++) { + var source = arguments[i]; + + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; + } + } + } + + return target; +}; + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + var store = __webpack_require__(133)('wks'); var uid = __webpack_require__(137); var Symbol = __webpack_require__(17).Symbol; @@ -3003,7 +3043,7 @@ $exports.store = store; /***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, exports) { exports = module.exports = SemVer; @@ -4332,35 +4372,6 @@ function coerce(version) { } -/***/ }), -/* 22 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -exports.__esModule = true; - -var _assign = __webpack_require__(591); - -var _assign2 = _interopRequireDefault(_assign); - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -exports.default = _assign2.default || function (target) { - for (var i = 1; i < arguments.length; i++) { - var source = arguments[i]; - - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } - } - - return target; -}; - /***/ }), /* 23 */ /***/ (function(module, exports) { @@ -4382,8 +4393,8 @@ module.exports = require("url"); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isArray__ = __webpack_require__(41); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isObject__ = __webpack_require__(444); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isFunction__ = __webpack_require__(154); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_tryCatch__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_errorObject__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__ = __webpack_require__(441); /** PURE_IMPORTS_START _util_isArray,_util_isObject,_util_isFunction,_util_tryCatch,_util_errorObject,_util_UnsubscriptionError PURE_IMPORTS_END */ @@ -4549,9 +4560,9 @@ var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var PrivateKey = __webpack_require__(33); var Key = __webpack_require__(27); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var algs = __webpack_require__(32); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var ec, jsbn; var nacl; @@ -4799,7 +4810,7 @@ function calculateED25519Public(k) { assert.buffer(k); if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); @@ -4809,7 +4820,7 @@ function calculateX25519Public(k) { assert.buffer(k); if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k)); return (Buffer.from(kp.publicKey)); @@ -4924,11 +4935,11 @@ module.exports = Key; var assert = __webpack_require__(16); var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); +var Signature = __webpack_require__(75); var DiffieHellman = __webpack_require__(325).DiffieHellman; -var errs = __webpack_require__(73); +var errs = __webpack_require__(74); var utils = __webpack_require__(26); var PrivateKey = __webpack_require__(33); var edCompat; @@ -4949,7 +4960,7 @@ formats['pkcs1'] = __webpack_require__(327); formats['pkcs8'] = __webpack_require__(157); formats['rfc4253'] = __webpack_require__(103); formats['ssh'] = __webpack_require__(456); -formats['ssh-private'] = __webpack_require__(192); +formats['ssh-private'] = __webpack_require__(193); formats['openssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(326); @@ -5250,11 +5261,11 @@ function nullify(obj = {}) { "use strict"; -const escapeStringRegexp = __webpack_require__(388); -const ansiStyles = __webpack_require__(506); -const stdoutColor = __webpack_require__(598).stdout; +const escapeStringRegexp = __webpack_require__(382); +const ansiStyles = __webpack_require__(474); +const stdoutColor = __webpack_require__(566).stdout; -const template = __webpack_require__(599); +const template = __webpack_require__(567); const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm'); @@ -5672,10 +5683,10 @@ module.exports = PrivateKey; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); -var errs = __webpack_require__(73); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); var util = __webpack_require__(3); var utils = __webpack_require__(26); var dhe = __webpack_require__(325); @@ -5702,7 +5713,7 @@ formats['pem'] = __webpack_require__(86); formats['pkcs1'] = __webpack_require__(327); formats['pkcs8'] = __webpack_require__(157); formats['rfc4253'] = __webpack_require__(103); -formats['ssh-private'] = __webpack_require__(192); +formats['ssh-private'] = __webpack_require__(193); formats['openssh'] = formats['ssh-private']; formats['ssh'] = formats['ssh-private']; formats['dnssec'] = __webpack_require__(326); @@ -5758,7 +5769,7 @@ PrivateKey.prototype.derive = function (newType) { if (this.type === 'ed25519' && newType === 'curve25519') { if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); priv = this.part.k.data; if (priv[0] === 0x00) @@ -5776,7 +5787,7 @@ PrivateKey.prototype.derive = function (newType) { })); } else if (this.type === 'curve25519' && newType === 'ed25519') { if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); priv = this.part.k.data; if (priv[0] === 0x00) @@ -5935,7 +5946,7 @@ exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefi var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -6036,13 +6047,13 @@ function _load_objectPath() { var _hooks; function _load_hooks() { - return _hooks = __webpack_require__(374); + return _hooks = __webpack_require__(368); } var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(220)); + return _index = _interopRequireDefault(__webpack_require__(218)); } var _errors; @@ -6054,7 +6065,7 @@ function _load_errors() { var _integrityChecker; function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); + return _integrityChecker = _interopRequireDefault(__webpack_require__(206)); } var _lockfile; @@ -6072,37 +6083,37 @@ function _load_lockfile2() { var _packageFetcher; function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); + return _packageFetcher = _interopRequireWildcard(__webpack_require__(208)); } var _packageInstallScripts; function _load_packageInstallScripts() { - return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557)); + return _packageInstallScripts = _interopRequireDefault(__webpack_require__(525)); } var _packageCompatibility; function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(207)); } var _packageResolver; function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(366)); + return _packageResolver = _interopRequireDefault(__webpack_require__(360)); } var _packageLinker; function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(211)); + return _packageLinker = _interopRequireDefault(__webpack_require__(209)); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(57); + return _index2 = __webpack_require__(58); } var _index3; @@ -6114,7 +6125,7 @@ function _load_index3() { var _autoclean; function _load_autoclean() { - return _autoclean = __webpack_require__(354); + return _autoclean = __webpack_require__(348); } var _constants; @@ -6132,7 +6143,7 @@ function _load_normalizePattern() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _map; @@ -6144,13 +6155,13 @@ function _load_map() { var _yarnVersion; function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(120); + return _yarnVersion = __webpack_require__(105); } var _generatePnpMap; function _load_generatePnpMap() { - return _generatePnpMap = __webpack_require__(579); + return _generatePnpMap = __webpack_require__(547); } var _workspaceLayout; @@ -6162,7 +6173,7 @@ function _load_workspaceLayout() { var _resolutionMap; function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); + return _resolutionMap = _interopRequireDefault(__webpack_require__(212)); } var _guessName; @@ -6174,21 +6185,21 @@ function _load_guessName() { var _audit; function _load_audit() { - return _audit = _interopRequireDefault(__webpack_require__(353)); + return _audit = _interopRequireDefault(__webpack_require__(347)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const deepEqual = __webpack_require__(631); +const deepEqual = __webpack_require__(599); const emoji = __webpack_require__(302); const invariant = __webpack_require__(9); const path = __webpack_require__(0); -const semver = __webpack_require__(21); -const uuid = __webpack_require__(119); -const ssri = __webpack_require__(77); +const semver = __webpack_require__(22); +const uuid = __webpack_require__(120); +const ssri = __webpack_require__(65); const ONE_DAY = 1000 * 60 * 60 * 24; @@ -7480,7 +7491,7 @@ function setFlags(commander) { /* 35 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(52); +var isObject = __webpack_require__(53); module.exports = function (it) { if (!isObject(it)) throw TypeError(it + ' is not an object!'); return it; @@ -7496,10 +7507,10 @@ module.exports = function (it) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subject; }); /* unused harmony export AnonymousSubject */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscriber__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__ = __webpack_require__(190); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__ = __webpack_require__(422); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__ = __webpack_require__(321); /** PURE_IMPORTS_START tslib,_Observable,_Subscriber,_Subscription,_util_ObjectUnsubscribedError,_SubjectSubscription,_internal_symbol_rxSubscriber PURE_IMPORTS_END */ @@ -24832,7 +24843,7 @@ function normalizePattern(pattern) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return EMPTY; }); /* harmony export (immutable) */ __webpack_exports__["a"] = empty; /* unused harmony export emptyScheduled */ -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); /** PURE_IMPORTS_START _Observable PURE_IMPORTS_END */ var EMPTY = /*@__PURE__*/ new __WEBPACK_IMPORTED_MODULE_0__Observable__["a" /* Observable */](function (subscriber) { return subscriber.complete(); }); @@ -24875,9 +24886,9 @@ var isArray = Array.isArray || (function (x) { return x && typeof x.length === ' /* 42 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(71); +var dP = __webpack_require__(72); var createDesc = __webpack_require__(132); -module.exports = __webpack_require__(51) ? function (object, key, value) { +module.exports = __webpack_require__(52) ? function (object, key, value) { return dP.f(object, key, createDesc(1, value)); } : function (object, key, value) { object[key] = value; @@ -24961,7 +24972,7 @@ module.exports.extend = extend; /*eslint-disable max-len*/ var common = __webpack_require__(43); -var YAMLException = __webpack_require__(54); +var YAMLException = __webpack_require__(55); var Type = __webpack_require__(10); @@ -25136,6 +25147,12 @@ SafeBuffer.allocUnsafeSlow = function (size) { /***/ }), /* 46 */ +/***/ (function(module, exports) { + +module.exports = require("os"); + +/***/ }), +/* 47 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25191,7 +25208,7 @@ var MapSubscriber = /*@__PURE__*/ (function (_super) { /***/ }), -/* 47 */ +/* 48 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25202,7 +25219,7 @@ var errorObject = { e: {} }; /***/ }), -/* 48 */ +/* 49 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -25215,13 +25232,224 @@ function isScheduler(value) { /***/ }), -/* 49 */ -/***/ (function(module, exports) { +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { -module.exports = require("os"); +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.exec = exports.queue = undefined; +exports.forkp = forkp; +exports.spawnp = spawnp; +exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; +exports.spawn = spawn; + +var _constants; + +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} + +var _blockingQueue; + +function _load_blockingQueue() { + return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); +} + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _promise; + +function _load_promise() { + return _promise = __webpack_require__(51); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +/* global child_process$spawnOpts */ + +const child = __webpack_require__(331); +const fs = __webpack_require__(4); +const path = __webpack_require__(0); + +const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); + +// TODO: this uid check is kinda whack +let uid = 0; + +const exec = exports.exec = (0, (_promise || _load_promise()).promisify)(child.exec); + +function validate(program, opts = {}) { + if (program.match(/[\\\/]/)) { + return; + } + + if (process.platform === 'win32' && process.env.PATHEXT) { + const cwd = opts.cwd || process.cwd(); + const pathext = process.env.PATHEXT; + + for (var _iterator = pathext.split(';'), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + + const ext = _ref; + + const candidate = path.join(cwd, `${program}${ext}`); + if (fs.existsSync(candidate)) { + throw new Error(`Potentially dangerous call to "${program}" in ${cwd}`); + } + } + } +} + +function forkp(program, args, opts) { + validate(program, opts); + const key = String(++uid); + return new Promise((resolve, reject) => { + const proc = child.fork(program, args, opts); + spawnedProcesses[key] = proc; + + proc.on('error', error => { + reject(error); + }); + + proc.on('close', exitCode => { + resolve(exitCode); + }); + }); +} + +function spawnp(program, args, opts) { + validate(program, opts); + const key = String(++uid); + return new Promise((resolve, reject) => { + const proc = child.spawn(program, args, opts); + spawnedProcesses[key] = proc; + + proc.on('error', error => { + reject(error); + }); + + proc.on('close', exitCode => { + resolve(exitCode); + }); + }); +} + +const spawnedProcesses = {}; + +function forwardSignalToSpawnedProcesses(signal) { + for (var _iterator2 = Object.keys(spawnedProcesses), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref2; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref2 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref2 = _i2.value; + } + + const key = _ref2; + + spawnedProcesses[key].kill(signal); + } +} + +function spawn(program, args, opts = {}, onData) { + const key = opts.cwd || String(++uid); + return queue.push(key, () => new Promise((resolve, reject) => { + validate(program, opts); + + const proc = child.spawn(program, args, opts); + spawnedProcesses[key] = proc; + + let processingDone = false; + let processClosed = false; + let err = null; + + let stdout = ''; + + proc.on('error', err => { + if (err.code === 'ENOENT') { + reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); + } else { + reject(err); + } + }); + + function updateStdout(chunk) { + stdout += chunk; + if (onData) { + onData(chunk); + } + } + + function finish() { + delete spawnedProcesses[key]; + if (err) { + reject(err); + } else { + resolve(stdout.trim()); + } + } + + if (typeof opts.process === 'function') { + opts.process(proc, updateStdout, reject, function () { + if (processClosed) { + finish(); + } else { + processingDone = true; + } + }); + } else { + if (proc.stderr) { + proc.stderr.on('data', updateStdout); + } + + if (proc.stdout) { + proc.stdout.on('data', updateStdout); + } + + processingDone = true; + } + + proc.on('close', (code, signal) => { + if (signal || code >= 1) { + err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); + err.EXIT_SIGNAL = signal; + err.EXIT_CODE = code; + } + + if (processingDone || err) { + finish(); + } else { + processClosed = true; + } + }); + })); +} /***/ }), -/* 50 */ +/* 51 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25304,7 +25532,7 @@ function queue(arr, promiseProducer, concurrency = Infinity) { } /***/ }), -/* 51 */ +/* 52 */ /***/ (function(module, exports, __webpack_require__) { // Thank's IE8 for his funny defineProperty @@ -25314,7 +25542,7 @@ module.exports = !__webpack_require__(112)(function () { /***/ }), -/* 52 */ +/* 53 */ /***/ (function(module, exports) { module.exports = function (it) { @@ -25323,14 +25551,14 @@ module.exports = function (it) { /***/ }), -/* 53 */ +/* 54 */ /***/ (function(module, exports) { module.exports = {}; /***/ }), -/* 54 */ +/* 55 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25380,7 +25608,7 @@ module.exports = YAMLException; /***/ }), -/* 55 */ +/* 56 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25415,12 +25643,12 @@ module.exports = new Schema({ /***/ }), -/* 56 */ +/* 57 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = tryCatch; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__errorObject__ = __webpack_require__(48); /** PURE_IMPORTS_START _errorObject PURE_IMPORTS_END */ var tryCatchTarget; @@ -25441,7 +25669,7 @@ function tryCatch(fn) { /***/ }), -/* 57 */ +/* 58 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -25455,7 +25683,7 @@ exports.registryNames = exports.registries = undefined; var _yarnRegistry; function _load_yarnRegistry() { - return _yarnRegistry = _interopRequireDefault(__webpack_require__(559)); + return _yarnRegistry = _interopRequireDefault(__webpack_require__(527)); } var _npmRegistry; @@ -25473,182 +25701,6 @@ const registries = exports.registries = { const registryNames = exports.registryNames = Object.keys(registries); -/***/ }), -/* 58 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.exec = exports.queue = undefined; -exports.forkp = forkp; -exports.spawnp = spawnp; -exports.forwardSignalToSpawnedProcesses = forwardSignalToSpawnedProcesses; -exports.spawn = spawn; - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(8)); -} - -var _blockingQueue; - -function _load_blockingQueue() { - return _blockingQueue = _interopRequireDefault(__webpack_require__(110)); -} - -var _errors; - -function _load_errors() { - return _errors = __webpack_require__(6); -} - -var _promise; - -function _load_promise() { - return _promise = __webpack_require__(50); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -/* global child_process$spawnOpts */ - -const child = __webpack_require__(331); - -const queue = exports.queue = new (_blockingQueue || _load_blockingQueue()).default('child', (_constants || _load_constants()).CHILD_CONCURRENCY); - -// TODO: this uid check is kinda whack -let uid = 0; - -const exec = exports.exec = (0, (_promise || _load_promise()).promisify)(child.exec); - -function forkp(program, args, opts) { - return new Promise((resolve, reject) => { - const proc = child.fork(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -function spawnp(program, args, opts) { - return new Promise((resolve, reject) => { - const proc = child.spawn(program, args, opts); - - proc.on('error', error => { - reject(error); - }); - - proc.on('close', exitCode => { - resolve(exitCode); - }); - }); -} - -const spawnedProcesses = {}; - -function forwardSignalToSpawnedProcesses(signal) { - for (var _iterator = Object.keys(spawnedProcesses), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; - - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } - - const key = _ref; - - spawnedProcesses[key].kill(signal); - } -} - -function spawn(program, args, opts = {}, onData) { - const key = opts.cwd || String(++uid); - return queue.push(key, () => new Promise((resolve, reject) => { - const proc = child.spawn(program, args, opts); - spawnedProcesses[key] = proc; - - let processingDone = false; - let processClosed = false; - let err = null; - - let stdout = ''; - - proc.on('error', err => { - if (err.code === 'ENOENT') { - reject(new (_errors || _load_errors()).ProcessSpawnError(`Couldn't find the binary ${program}`, err.code, program)); - } else { - reject(err); - } - }); - - function updateStdout(chunk) { - stdout += chunk; - if (onData) { - onData(chunk); - } - } - - function finish() { - delete spawnedProcesses[key]; - if (err) { - reject(err); - } else { - resolve(stdout.trim()); - } - } - - if (typeof opts.process === 'function') { - opts.process(proc, updateStdout, reject, function () { - if (processClosed) { - finish(); - } else { - processingDone = true; - } - }); - } else { - if (proc.stderr) { - proc.stderr.on('data', updateStdout); - } - - if (proc.stdout) { - proc.stdout.on('data', updateStdout); - } - - processingDone = true; - } - - proc.on('close', (code, signal) => { - if (signal || code >= 1) { - err = new (_errors || _load_errors()).ProcessTermError(['Command failed.', signal ? `Exit signal: ${signal}` : `Exit code: ${code}`, `Command: ${program}`, `Arguments: ${args.join(' ')}`, `Directory: ${opts.cwd || process.cwd()}`, `Output:\n${stdout.trim()}`].join('\n')); - err.EXIT_SIGNAL = signal; - err.EXIT_CODE = code; - } - - if (processingDone || err) { - finish(); - } else { - processClosed = true; - } - }); - })); -} - /***/ }), /* 59 */ /***/ (function(module, exports, __webpack_require__) { @@ -25742,9 +25794,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de var global = __webpack_require__(17); var core = __webpack_require__(31); -var ctx = __webpack_require__(69); +var ctx = __webpack_require__(70); var hide = __webpack_require__(42); -var has = __webpack_require__(70); +var has = __webpack_require__(71); var PROTOTYPE = 'prototype'; var $export = function (type, name, source) { @@ -25823,7 +25875,7 @@ try { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = from; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isPromise__ = __webpack_require__(445); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isArrayLike__ = __webpack_require__(442); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isInteropObservable__ = __webpack_require__(928); @@ -25954,7 +26006,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isEmpty", function() { return __WEBPACK_IMPORTED_MODULE_37__internal_operators_isEmpty__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__ = __webpack_require__(868); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "last", function() { return __WEBPACK_IMPORTED_MODULE_38__internal_operators_last__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__ = __webpack_require__(47); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "map", function() { return __WEBPACK_IMPORTED_MODULE_39__internal_operators_map__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__ = __webpack_require__(869); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mapTo", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_operators_mapTo__["a"]; }); @@ -25975,7 +26027,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "mergeScan", function() { return __WEBPACK_IMPORTED_MODULE_47__internal_operators_mergeScan__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__ = __webpack_require__(875); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "min", function() { return __WEBPACK_IMPORTED_MODULE_48__internal_operators_min__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(116); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__ = __webpack_require__(117); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "multicast", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_operators_multicast__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__ = __webpack_require__(434); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observeOn", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_operators_observeOn__["b"]; }); @@ -25997,7 +26049,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "publishReplay", function() { return __WEBPACK_IMPORTED_MODULE_58__internal_operators_publishReplay__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__ = __webpack_require__(884); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "race", function() { return __WEBPACK_IMPORTED_MODULE_59__internal_operators_race__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(187); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__ = __webpack_require__(188); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "reduce", function() { return __WEBPACK_IMPORTED_MODULE_60__internal_operators_reduce__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__ = __webpack_require__(885); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "repeat", function() { return __WEBPACK_IMPORTED_MODULE_61__internal_operators_repeat__["a"]; }); @@ -26055,7 +26107,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttle", function() { return __WEBPACK_IMPORTED_MODULE_87__internal_operators_throttle__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__ = __webpack_require__(905); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throttleTime", function() { return __WEBPACK_IMPORTED_MODULE_88__internal_operators_throttleTime__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(188); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__ = __webpack_require__(189); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "throwIfEmpty", function() { return __WEBPACK_IMPORTED_MODULE_89__internal_operators_throwIfEmpty__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__ = __webpack_require__(906); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "timeInterval", function() { return __WEBPACK_IMPORTED_MODULE_90__internal_operators_timeInterval__["a"]; }); @@ -26201,12 +26253,398 @@ module.exports = require("buffer"); /* 65 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +const Buffer = __webpack_require__(45).Buffer + +const crypto = __webpack_require__(11) +const Transform = __webpack_require__(23).Transform + +const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] + +const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i +const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ +const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ +const VCHAR_REGEX = /^[\x21-\x7E]+$/ + +class Hash { + get isHash () { return true } + constructor (hash, opts) { + const strict = !!(opts && opts.strict) + this.source = hash.trim() + // 3.1. Integrity metadata (called "Hash" by ssri) + // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description + const match = this.source.match( + strict + ? STRICT_SRI_REGEX + : SRI_REGEX + ) + if (!match) { return } + if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } + this.algorithm = match[1] + this.digest = match[2] + + const rawOpts = match[3] + this.options = rawOpts ? rawOpts.slice(1).split('?') : [] + } + hexDigest () { + return this.digest && Buffer.from(this.digest, 'base64').toString('hex') + } + toJSON () { + return this.toString() + } + toString (opts) { + if (opts && opts.strict) { + // Strict mode enforces the standard as close to the foot of the + // letter as it can. + if (!( + // The spec has very restricted productions for algorithms. + // https://www.w3.org/TR/CSP2/#source-list-syntax + SPEC_ALGORITHMS.some(x => x === this.algorithm) && + // Usually, if someone insists on using a "different" base64, we + // leave it as-is, since there's multiple standards, and the + // specified is not a URL-safe variant. + // https://www.w3.org/TR/CSP2/#base64_value + this.digest.match(BASE64_REGEX) && + // Option syntax is strictly visual chars. + // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression + // https://tools.ietf.org/html/rfc5234#appendix-B.1 + (this.options || []).every(opt => opt.match(VCHAR_REGEX)) + )) { + return '' + } + } + const options = this.options && this.options.length + ? `?${this.options.join('?')}` + : '' + return `${this.algorithm}-${this.digest}${options}` + } +} + +class Integrity { + get isIntegrity () { return true } + toJSON () { + return this.toString() + } + toString (opts) { + opts = opts || {} + let sep = opts.sep || ' ' + if (opts.strict) { + // Entries must be separated by whitespace, according to spec. + sep = sep.replace(/\S+/g, ' ') + } + return Object.keys(this).map(k => { + return this[k].map(hash => { + return Hash.prototype.toString.call(hash, opts) + }).filter(x => x.length).join(sep) + }).filter(x => x.length).join(sep) + } + concat (integrity, opts) { + const other = typeof integrity === 'string' + ? integrity + : stringify(integrity, opts) + return parse(`${this.toString(opts)} ${other}`, opts) + } + hexDigest () { + return parse(this, {single: true}).hexDigest() + } + match (integrity, opts) { + const other = parse(integrity, opts) + const algo = other.pickAlgorithm(opts) + return ( + this[algo] && + other[algo] && + this[algo].find(hash => + other[algo].find(otherhash => + hash.digest === otherhash.digest + ) + ) + ) || false + } + pickAlgorithm (opts) { + const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash + const keys = Object.keys(this) + if (!keys.length) { + throw new Error(`No algorithms available for ${ + JSON.stringify(this.toString()) + }`) + } + return keys.reduce((acc, algo) => { + return pickAlgorithm(acc, algo) || acc + }) + } +} + +module.exports.parse = parse +function parse (sri, opts) { + opts = opts || {} + if (typeof sri === 'string') { + return _parse(sri, opts) + } else if (sri.algorithm && sri.digest) { + const fullSri = new Integrity() + fullSri[sri.algorithm] = [sri] + return _parse(stringify(fullSri, opts), opts) + } else { + return _parse(stringify(sri, opts), opts) + } +} + +function _parse (integrity, opts) { + // 3.4.3. Parse metadata + // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata + if (opts.single) { + return new Hash(integrity, opts) + } + return integrity.trim().split(/\s+/).reduce((acc, string) => { + const hash = new Hash(string, opts) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.stringify = stringify +function stringify (obj, opts) { + if (obj.algorithm && obj.digest) { + return Hash.prototype.toString.call(obj, opts) + } else if (typeof obj === 'string') { + return stringify(parse(obj, opts), opts) + } else { + return Integrity.prototype.toString.call(obj, opts) + } +} + +module.exports.fromHex = fromHex +function fromHex (hexDigest, algorithm, opts) { + const optString = (opts && opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + return parse( + `${algorithm}-${ + Buffer.from(hexDigest, 'hex').toString('base64') + }${optString}`, opts + ) +} + +module.exports.fromData = fromData +function fromData (data, opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + return algorithms.reduce((acc, algo) => { + const digest = crypto.createHash(algo).update(data).digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) +} + +module.exports.fromStream = fromStream +function fromStream (stream, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const istream = integrityStream(opts) + return new P((resolve, reject) => { + stream.pipe(istream) + stream.on('error', reject) + istream.on('error', reject) + let sri + istream.on('integrity', s => { sri = s }) + istream.on('end', () => resolve(sri)) + istream.on('data', () => {}) + }) +} + +module.exports.checkData = checkData +function checkData (data, sri, opts) { + opts = opts || {} + sri = parse(sri, opts) + if (!Object.keys(sri).length) { + if (opts.error) { + throw Object.assign( + new Error('No valid integrity hashes to check against'), { + code: 'EINTEGRITY' + } + ) + } else { + return false + } + } + const algorithm = sri.pickAlgorithm(opts) + const digest = crypto.createHash(algorithm).update(data).digest('base64') + const newSri = parse({algorithm, digest}) + const match = newSri.match(sri, opts) + if (match || !opts.error) { + return match + } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { + const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) + err.code = 'EBADSIZE' + err.found = data.length + err.expected = opts.size + err.sri = sri + throw err + } else { + const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = sri + err.algorithm = algorithm + err.sri = sri + throw err + } +} + +module.exports.checkStream = checkStream +function checkStream (stream, sri, opts) { + opts = opts || {} + const P = opts.Promise || Promise + const checker = integrityStream(Object.assign({}, opts, { + integrity: sri + })) + return new P((resolve, reject) => { + stream.pipe(checker) + stream.on('error', reject) + checker.on('error', reject) + let sri + checker.on('verified', s => { sri = s }) + checker.on('end', () => resolve(sri)) + checker.on('data', () => {}) + }) +} + +module.exports.integrityStream = integrityStream +function integrityStream (opts) { + opts = opts || {} + // For verification + const sri = opts.integrity && parse(opts.integrity, opts) + const goodSri = sri && Object.keys(sri).length + const algorithm = goodSri && sri.pickAlgorithm(opts) + const digests = goodSri && sri[algorithm] + // Calculating stream + const algorithms = Array.from( + new Set( + (opts.algorithms || ['sha512']) + .concat(algorithm ? [algorithm] : []) + ) + ) + const hashes = algorithms.map(crypto.createHash) + let streamSize = 0 + const stream = new Transform({ + transform (chunk, enc, cb) { + streamSize += chunk.length + hashes.forEach(h => h.update(chunk, enc)) + cb(null, chunk, enc) + } + }).on('end', () => { + const optString = (opts.options && opts.options.length) + ? `?${opts.options.join('?')}` + : '' + const newSri = parse(hashes.map((h, i) => { + return `${algorithms[i]}-${h.digest('base64')}${optString}` + }).join(' '), opts) + // Integrity verification mode + const match = goodSri && newSri.match(sri, opts) + if (typeof opts.size === 'number' && streamSize !== opts.size) { + const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) + err.code = 'EBADSIZE' + err.found = streamSize + err.expected = opts.size + err.sri = sri + stream.emit('error', err) + } else if (opts.integrity && !match) { + const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) + err.code = 'EINTEGRITY' + err.found = newSri + err.expected = digests + err.algorithm = algorithm + err.sri = sri + stream.emit('error', err) + } else { + stream.emit('size', streamSize) + stream.emit('integrity', newSri) + match && stream.emit('verified', match) + } + }) + return stream +} + +module.exports.create = createIntegrity +function createIntegrity (opts) { + opts = opts || {} + const algorithms = opts.algorithms || ['sha512'] + const optString = opts.options && opts.options.length + ? `?${opts.options.join('?')}` + : '' + + const hashes = algorithms.map(crypto.createHash) + + return { + update: function (chunk, enc) { + hashes.forEach(h => h.update(chunk, enc)) + return this + }, + digest: function (enc) { + const integrity = algorithms.reduce((acc, algo) => { + const digest = hashes.shift().digest('base64') + const hash = new Hash( + `${algo}-${digest}${optString}`, + opts + ) + if (hash.algorithm && hash.digest) { + const algo = hash.algorithm + if (!acc[algo]) { acc[algo] = [] } + acc[algo].push(hash) + } + return acc + }, new Integrity()) + + return integrity + } + } +} + +const NODE_HASHES = new Set(crypto.getHashes()) + +// This is a Best Effort™ at a reasonable priority for hash algos +const DEFAULT_PRIORITY = [ + 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', + // TODO - it's unclear _which_ of these Node will actually use as its name + // for the algorithm, so we guesswork it based on the OpenSSL names. + 'sha3', + 'sha3-256', 'sha3-384', 'sha3-512', + 'sha3_256', 'sha3_384', 'sha3_512' +].filter(algo => NODE_HASHES.has(algo)) + +function getPrioritizedHash (algo1, algo2) { + return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) + ? algo1 + : algo2 +} + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + // Copyright 2011 Mark Cavage All rights reserved. // If you have no idea what ASN.1 or BER is, see this: // ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc -var Ber = __webpack_require__(514); +var Ber = __webpack_require__(482); @@ -26224,7 +26662,7 @@ module.exports = { /***/ }), -/* 66 */ +/* 67 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26238,21 +26676,21 @@ exports.home = undefined; var _rootUser; function _load_rootUser() { - return _rootUser = _interopRequireDefault(__webpack_require__(223)); + return _rootUser = _interopRequireDefault(__webpack_require__(221)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const path = __webpack_require__(0); -const home = exports.home = __webpack_require__(49).homedir(); +const home = exports.home = __webpack_require__(46).homedir(); const userHomeDir = (_rootUser || _load_rootUser()).default ? path.resolve('/usr/local/share') : home; exports.default = userHomeDir; /***/ }), -/* 67 */ +/* 68 */ /***/ (function(module, exports) { module.exports = function (it) { @@ -26262,7 +26700,7 @@ module.exports = function (it) { /***/ }), -/* 68 */ +/* 69 */ /***/ (function(module, exports) { var toString = {}.toString; @@ -26273,11 +26711,11 @@ module.exports = function (it) { /***/ }), -/* 69 */ +/* 70 */ /***/ (function(module, exports, __webpack_require__) { // optional / simple context binding -var aFunction = __webpack_require__(67); +var aFunction = __webpack_require__(68); module.exports = function (fn, that, length) { aFunction(fn); if (that === undefined) return fn; @@ -26299,7 +26737,7 @@ module.exports = function (fn, that, length) { /***/ }), -/* 70 */ +/* 71 */ /***/ (function(module, exports) { var hasOwnProperty = {}.hasOwnProperty; @@ -26309,15 +26747,15 @@ module.exports = function (it, key) { /***/ }), -/* 71 */ +/* 72 */ /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(35); -var IE8_DOM_DEFINE = __webpack_require__(238); -var toPrimitive = __webpack_require__(255); +var IE8_DOM_DEFINE = __webpack_require__(235); +var toPrimitive = __webpack_require__(252); var dP = Object.defineProperty; -exports.f = __webpack_require__(51) ? Object.defineProperty : function defineProperty(O, P, Attributes) { +exports.f = __webpack_require__(52) ? Object.defineProperty : function defineProperty(O, P, Attributes) { anObject(O); P = toPrimitive(P, true); anObject(Attributes); @@ -26331,7 +26769,7 @@ exports.f = __webpack_require__(51) ? Object.defineProperty : function definePro /***/ }), -/* 72 */ +/* 73 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -26352,7 +26790,7 @@ var Schema = __webpack_require__(44); module.exports = Schema.DEFAULT = new Schema({ include: [ - __webpack_require__(55) + __webpack_require__(56) ], explicit: [ __webpack_require__(290), @@ -26363,7 +26801,7 @@ module.exports = Schema.DEFAULT = new Schema({ /***/ }), -/* 73 */ +/* 74 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -26453,7 +26891,7 @@ module.exports = { /***/ }), -/* 74 */ +/* 75 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -26463,10 +26901,10 @@ module.exports = Signature; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); -var errs = __webpack_require__(73); +var crypto = __webpack_require__(11); +var errs = __webpack_require__(74); var utils = __webpack_require__(26); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var SSHBuffer = __webpack_require__(159); var InvalidAlgorithmError = errs.InvalidAlgorithmError; @@ -26773,7 +27211,7 @@ Signature._oldVersionDetect = function (obj) { /***/ }), -/* 75 */ +/* 76 */ /***/ (function(module, exports, __webpack_require__) { (function(nacl) { @@ -29152,7 +29590,7 @@ nacl.setPRNG = function(fn) { }); } else if (true) { // Node.js. - crypto = __webpack_require__(12); + crypto = __webpack_require__(11); if (crypto && crypto.randomBytes) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); @@ -29167,397 +29605,11 @@ nacl.setPRNG = function(fn) { /***/ }), -/* 76 */ +/* 77 */ /***/ (function(module, exports) { module.exports = require("events"); -/***/ }), -/* 77 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -const Buffer = __webpack_require__(45).Buffer - -const crypto = __webpack_require__(12) -const Transform = __webpack_require__(23).Transform - -const SPEC_ALGORITHMS = ['sha256', 'sha384', 'sha512'] - -const BASE64_REGEX = /^[a-z0-9+/]+(?:=?=?)$/i -const SRI_REGEX = /^([^-]+)-([^?]+)([?\S*]*)$/ -const STRICT_SRI_REGEX = /^([^-]+)-([A-Za-z0-9+/=]{44,88})(\?[\x21-\x7E]*)*$/ -const VCHAR_REGEX = /^[\x21-\x7E]+$/ - -class Hash { - get isHash () { return true } - constructor (hash, opts) { - const strict = !!(opts && opts.strict) - this.source = hash.trim() - // 3.1. Integrity metadata (called "Hash" by ssri) - // https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description - const match = this.source.match( - strict - ? STRICT_SRI_REGEX - : SRI_REGEX - ) - if (!match) { return } - if (strict && !SPEC_ALGORITHMS.some(a => a === match[1])) { return } - this.algorithm = match[1] - this.digest = match[2] - - const rawOpts = match[3] - this.options = rawOpts ? rawOpts.slice(1).split('?') : [] - } - hexDigest () { - return this.digest && Buffer.from(this.digest, 'base64').toString('hex') - } - toJSON () { - return this.toString() - } - toString (opts) { - if (opts && opts.strict) { - // Strict mode enforces the standard as close to the foot of the - // letter as it can. - if (!( - // The spec has very restricted productions for algorithms. - // https://www.w3.org/TR/CSP2/#source-list-syntax - SPEC_ALGORITHMS.some(x => x === this.algorithm) && - // Usually, if someone insists on using a "different" base64, we - // leave it as-is, since there's multiple standards, and the - // specified is not a URL-safe variant. - // https://www.w3.org/TR/CSP2/#base64_value - this.digest.match(BASE64_REGEX) && - // Option syntax is strictly visual chars. - // https://w3c.github.io/webappsec-subresource-integrity/#grammardef-option-expression - // https://tools.ietf.org/html/rfc5234#appendix-B.1 - (this.options || []).every(opt => opt.match(VCHAR_REGEX)) - )) { - return '' - } - } - const options = this.options && this.options.length - ? `?${this.options.join('?')}` - : '' - return `${this.algorithm}-${this.digest}${options}` - } -} - -class Integrity { - get isIntegrity () { return true } - toJSON () { - return this.toString() - } - toString (opts) { - opts = opts || {} - let sep = opts.sep || ' ' - if (opts.strict) { - // Entries must be separated by whitespace, according to spec. - sep = sep.replace(/\S+/g, ' ') - } - return Object.keys(this).map(k => { - return this[k].map(hash => { - return Hash.prototype.toString.call(hash, opts) - }).filter(x => x.length).join(sep) - }).filter(x => x.length).join(sep) - } - concat (integrity, opts) { - const other = typeof integrity === 'string' - ? integrity - : stringify(integrity, opts) - return parse(`${this.toString(opts)} ${other}`, opts) - } - hexDigest () { - return parse(this, {single: true}).hexDigest() - } - match (integrity, opts) { - const other = parse(integrity, opts) - const algo = other.pickAlgorithm(opts) - return ( - this[algo] && - other[algo] && - this[algo].find(hash => - other[algo].find(otherhash => - hash.digest === otherhash.digest - ) - ) - ) || false - } - pickAlgorithm (opts) { - const pickAlgorithm = (opts && opts.pickAlgorithm) || getPrioritizedHash - const keys = Object.keys(this) - if (!keys.length) { - throw new Error(`No algorithms available for ${ - JSON.stringify(this.toString()) - }`) - } - return keys.reduce((acc, algo) => { - return pickAlgorithm(acc, algo) || acc - }) - } -} - -module.exports.parse = parse -function parse (sri, opts) { - opts = opts || {} - if (typeof sri === 'string') { - return _parse(sri, opts) - } else if (sri.algorithm && sri.digest) { - const fullSri = new Integrity() - fullSri[sri.algorithm] = [sri] - return _parse(stringify(fullSri, opts), opts) - } else { - return _parse(stringify(sri, opts), opts) - } -} - -function _parse (integrity, opts) { - // 3.4.3. Parse metadata - // https://w3c.github.io/webappsec-subresource-integrity/#parse-metadata - if (opts.single) { - return new Hash(integrity, opts) - } - return integrity.trim().split(/\s+/).reduce((acc, string) => { - const hash = new Hash(string, opts) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) -} - -module.exports.stringify = stringify -function stringify (obj, opts) { - if (obj.algorithm && obj.digest) { - return Hash.prototype.toString.call(obj, opts) - } else if (typeof obj === 'string') { - return stringify(parse(obj, opts), opts) - } else { - return Integrity.prototype.toString.call(obj, opts) - } -} - -module.exports.fromHex = fromHex -function fromHex (hexDigest, algorithm, opts) { - const optString = (opts && opts.options && opts.options.length) - ? `?${opts.options.join('?')}` - : '' - return parse( - `${algorithm}-${ - Buffer.from(hexDigest, 'hex').toString('base64') - }${optString}`, opts - ) -} - -module.exports.fromData = fromData -function fromData (data, opts) { - opts = opts || {} - const algorithms = opts.algorithms || ['sha512'] - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' - return algorithms.reduce((acc, algo) => { - const digest = crypto.createHash(algo).update(data).digest('base64') - const hash = new Hash( - `${algo}-${digest}${optString}`, - opts - ) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) -} - -module.exports.fromStream = fromStream -function fromStream (stream, opts) { - opts = opts || {} - const P = opts.Promise || Promise - const istream = integrityStream(opts) - return new P((resolve, reject) => { - stream.pipe(istream) - stream.on('error', reject) - istream.on('error', reject) - let sri - istream.on('integrity', s => { sri = s }) - istream.on('end', () => resolve(sri)) - istream.on('data', () => {}) - }) -} - -module.exports.checkData = checkData -function checkData (data, sri, opts) { - opts = opts || {} - sri = parse(sri, opts) - if (!Object.keys(sri).length) { - if (opts.error) { - throw Object.assign( - new Error('No valid integrity hashes to check against'), { - code: 'EINTEGRITY' - } - ) - } else { - return false - } - } - const algorithm = sri.pickAlgorithm(opts) - const digest = crypto.createHash(algorithm).update(data).digest('base64') - const newSri = parse({algorithm, digest}) - const match = newSri.match(sri, opts) - if (match || !opts.error) { - return match - } else if (typeof opts.size === 'number' && (data.length !== opts.size)) { - const err = new Error(`data size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${data.length}`) - err.code = 'EBADSIZE' - err.found = data.length - err.expected = opts.size - err.sri = sri - throw err - } else { - const err = new Error(`Integrity checksum failed when using ${algorithm}: Wanted ${sri}, but got ${newSri}. (${data.length} bytes)`) - err.code = 'EINTEGRITY' - err.found = newSri - err.expected = sri - err.algorithm = algorithm - err.sri = sri - throw err - } -} - -module.exports.checkStream = checkStream -function checkStream (stream, sri, opts) { - opts = opts || {} - const P = opts.Promise || Promise - const checker = integrityStream(Object.assign({}, opts, { - integrity: sri - })) - return new P((resolve, reject) => { - stream.pipe(checker) - stream.on('error', reject) - checker.on('error', reject) - let sri - checker.on('verified', s => { sri = s }) - checker.on('end', () => resolve(sri)) - checker.on('data', () => {}) - }) -} - -module.exports.integrityStream = integrityStream -function integrityStream (opts) { - opts = opts || {} - // For verification - const sri = opts.integrity && parse(opts.integrity, opts) - const goodSri = sri && Object.keys(sri).length - const algorithm = goodSri && sri.pickAlgorithm(opts) - const digests = goodSri && sri[algorithm] - // Calculating stream - const algorithms = Array.from( - new Set( - (opts.algorithms || ['sha512']) - .concat(algorithm ? [algorithm] : []) - ) - ) - const hashes = algorithms.map(crypto.createHash) - let streamSize = 0 - const stream = new Transform({ - transform (chunk, enc, cb) { - streamSize += chunk.length - hashes.forEach(h => h.update(chunk, enc)) - cb(null, chunk, enc) - } - }).on('end', () => { - const optString = (opts.options && opts.options.length) - ? `?${opts.options.join('?')}` - : '' - const newSri = parse(hashes.map((h, i) => { - return `${algorithms[i]}-${h.digest('base64')}${optString}` - }).join(' '), opts) - // Integrity verification mode - const match = goodSri && newSri.match(sri, opts) - if (typeof opts.size === 'number' && streamSize !== opts.size) { - const err = new Error(`stream size mismatch when checking ${sri}.\n Wanted: ${opts.size}\n Found: ${streamSize}`) - err.code = 'EBADSIZE' - err.found = streamSize - err.expected = opts.size - err.sri = sri - stream.emit('error', err) - } else if (opts.integrity && !match) { - const err = new Error(`${sri} integrity checksum failed when using ${algorithm}: wanted ${digests} but got ${newSri}. (${streamSize} bytes)`) - err.code = 'EINTEGRITY' - err.found = newSri - err.expected = digests - err.algorithm = algorithm - err.sri = sri - stream.emit('error', err) - } else { - stream.emit('size', streamSize) - stream.emit('integrity', newSri) - match && stream.emit('verified', match) - } - }) - return stream -} - -module.exports.create = createIntegrity -function createIntegrity (opts) { - opts = opts || {} - const algorithms = opts.algorithms || ['sha512'] - const optString = opts.options && opts.options.length - ? `?${opts.options.join('?')}` - : '' - - const hashes = algorithms.map(crypto.createHash) - - return { - update: function (chunk, enc) { - hashes.forEach(h => h.update(chunk, enc)) - return this - }, - digest: function (enc) { - const integrity = algorithms.reduce((acc, algo) => { - const digest = hashes.shift().digest('base64') - const hash = new Hash( - `${algo}-${digest}${optString}`, - opts - ) - if (hash.algorithm && hash.digest) { - const algo = hash.algorithm - if (!acc[algo]) { acc[algo] = [] } - acc[algo].push(hash) - } - return acc - }, new Integrity()) - - return integrity - } - } -} - -const NODE_HASHES = new Set(crypto.getHashes()) - -// This is a Best Effort™ at a reasonable priority for hash algos -const DEFAULT_PRIORITY = [ - 'md5', 'whirlpool', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512', - // TODO - it's unclear _which_ of these Node will actually use as its name - // for the algorithm, so we guesswork it based on the OpenSSL names. - 'sha3', - 'sha3-256', 'sha3-384', 'sha3-512', - 'sha3_256', 'sha3_384', 'sha3_512' -].filter(algo => NODE_HASHES.has(algo)) - -function getPrioritizedHash (algo1, algo2) { - return DEFAULT_PRIORITY.indexOf(algo1.toLowerCase()) >= DEFAULT_PRIORITY.indexOf(algo2.toLowerCase()) - ? algo1 - : algo2 -} - - /***/ }), /* 78 */ /***/ (function(module, exports, __webpack_require__) { @@ -29581,13 +29633,13 @@ function _load_baseResolver() { var _npmResolver; function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(217)); + return _npmResolver = _interopRequireDefault(__webpack_require__(215)); } var _yarnResolver; function _load_yarnResolver() { - return _yarnResolver = _interopRequireDefault(__webpack_require__(576)); + return _yarnResolver = _interopRequireDefault(__webpack_require__(544)); } var _gitResolver; @@ -29599,43 +29651,43 @@ function _load_gitResolver() { var _tarballResolver; function _load_tarballResolver() { - return _tarballResolver = _interopRequireDefault(__webpack_require__(574)); + return _tarballResolver = _interopRequireDefault(__webpack_require__(542)); } var _githubResolver; function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(367)); + return _githubResolver = _interopRequireDefault(__webpack_require__(361)); } var _fileResolver; function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(215)); + return _fileResolver = _interopRequireDefault(__webpack_require__(213)); } var _linkResolver; function _load_linkResolver() { - return _linkResolver = _interopRequireDefault(__webpack_require__(368)); + return _linkResolver = _interopRequireDefault(__webpack_require__(362)); } var _gitlabResolver; function _load_gitlabResolver() { - return _gitlabResolver = _interopRequireDefault(__webpack_require__(572)); + return _gitlabResolver = _interopRequireDefault(__webpack_require__(540)); } var _gistResolver; function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(216)); + return _gistResolver = _interopRequireDefault(__webpack_require__(214)); } var _bitbucketResolver; function _load_bitbucketResolver() { - return _bitbucketResolver = _interopRequireDefault(__webpack_require__(571)); + return _bitbucketResolver = _interopRequireDefault(__webpack_require__(539)); } var _hostedGitResolver; @@ -29647,7 +29699,7 @@ function _load_hostedGitResolver() { var _registryResolver; function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(573)); + return _registryResolver = _interopRequireDefault(__webpack_require__(541)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -29725,7 +29777,7 @@ for (const key in registries) { var _ = __webpack_require__(38); var chalk = __webpack_require__(30); -var runAsync = __webpack_require__(181); +var runAsync = __webpack_require__(182); var { filter, flatMap, share, take, takeUntil } = __webpack_require__(63); var Choices = __webpack_require__(686); var ScreenManager = __webpack_require__(697); @@ -29873,7 +29925,7 @@ module.exports = Prompt; "use strict"; -var { fromEvent } = __webpack_require__(182); +var { fromEvent } = __webpack_require__(183); var { filter, map, share } = __webpack_require__(63); function normalizeKeypressEvents(value, key) { @@ -31303,7 +31355,7 @@ try { } catch (er) {} var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = __webpack_require__(229) +var expand = __webpack_require__(226) var plTypes = { '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, @@ -32311,7 +32363,7 @@ var InnerSubscriber = /*@__PURE__*/ (function (_super) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = fromArray; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscription__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_subscribeToArray__ = __webpack_require__(447); /** PURE_IMPORTS_START _Observable,_Subscription,_util_subscribeToArray PURE_IMPORTS_END */ @@ -32355,8 +32407,8 @@ module.exports = { }; var assert = __webpack_require__(16); -var asn1 = __webpack_require__(65); -var crypto = __webpack_require__(12); +var asn1 = __webpack_require__(66); +var crypto = __webpack_require__(11); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); var utils = __webpack_require__(26); @@ -32365,10 +32417,10 @@ var PrivateKey = __webpack_require__(33); var pkcs1 = __webpack_require__(327); var pkcs8 = __webpack_require__(157); -var sshpriv = __webpack_require__(192); +var sshpriv = __webpack_require__(193); var rfc4253 = __webpack_require__(103); -var errors = __webpack_require__(73); +var errors = __webpack_require__(74); /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, @@ -32562,7 +32614,7 @@ exports.SCOPE_SEPARATOR = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -32580,25 +32632,25 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _npmResolver; function _load_npmResolver() { - return _npmResolver = _interopRequireDefault(__webpack_require__(217)); + return _npmResolver = _interopRequireDefault(__webpack_require__(215)); } var _envReplace; function _load_envReplace() { - return _envReplace = _interopRequireDefault(__webpack_require__(577)); + return _envReplace = _interopRequireDefault(__webpack_require__(545)); } var _baseRegistry; function _load_baseRegistry() { - return _baseRegistry = _interopRequireDefault(__webpack_require__(558)); + return _baseRegistry = _interopRequireDefault(__webpack_require__(526)); } var _misc; @@ -32610,7 +32662,7 @@ function _load_misc() { var _path; function _load_path() { - return _path = __webpack_require__(377); + return _path = __webpack_require__(371); } var _normalizeUrl; @@ -32622,13 +32674,13 @@ function _load_normalizeUrl() { var _userHomeDir; function _load_userHomeDir() { - return _userHomeDir = _interopRequireDefault(__webpack_require__(66)); + return _userHomeDir = _interopRequireDefault(__webpack_require__(67)); } var _userHomeDir2; function _load_userHomeDir2() { - return _userHomeDir2 = __webpack_require__(66); + return _userHomeDir2 = __webpack_require__(67); } var _errors; @@ -32746,7 +32798,7 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { let resolved = pathname; if (!REGEX_REGISTRY_PREFIX.test(pathname)) { - resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), pathname); + resolved = (_url || _load_url()).default.resolve((0, (_misc || _load_misc()).addSuffix)(registry, '/'), `./${pathname}`); } if (REGEX_REGISTRY_ENFORCED_HTTPS.test(resolved)) { @@ -32821,6 +32873,10 @@ class NpmRegistry extends (_baseRegistry || _load_baseRegistry()).default { } _this.reporter.info(_this.reporter.lang('twoFactorAuthenticationEnabled')); + if (error.notice) { + _this.reporter.info(error.notice); + } + _this.otp = yield (0, (_login || _load_login()).getOneTimePassword)(_this.reporter); _this.requestManager.clearCache(); @@ -33178,7 +33234,7 @@ function _load_normalizePattern() { return _normalizePattern2 = __webpack_require__(37); } -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); class WorkspaceLayout { constructor(workspaces, config) { @@ -33220,7 +33276,7 @@ module.exports = function (it) { /* 92 */ /***/ (function(module, exports, __webpack_require__) { -var isObject = __webpack_require__(52); +var isObject = __webpack_require__(53); var document = __webpack_require__(17).document; // typeof document.createElement is 'object' in old IE var is = isObject(document) && isObject(document.createElement); @@ -33243,7 +33299,7 @@ module.exports = true; "use strict"; // 25.4.1.5 NewPromiseCapability(C) -var aFunction = __webpack_require__(67); +var aFunction = __webpack_require__(68); function PromiseCapability(C) { var resolve, reject; @@ -33265,9 +33321,9 @@ module.exports.f = function (C) { /* 95 */ /***/ (function(module, exports, __webpack_require__) { -var def = __webpack_require__(71).f; -var has = __webpack_require__(70); -var TAG = __webpack_require__(20)('toStringTag'); +var def = __webpack_require__(72).f; +var has = __webpack_require__(71); +var TAG = __webpack_require__(21)('toStringTag'); module.exports = function (it, tag, stat) { if (it && !has(it = stat ? it : it.prototype, TAG)) def(it, TAG, { configurable: true, value: tag }); @@ -33302,7 +33358,7 @@ module.exports = function (it) { /***/ (function(module, exports, __webpack_require__) { // to indexed object, toObject with fallback for non-array-like ES3 strings -var IObject = __webpack_require__(170); +var IObject = __webpack_require__(171); var defined = __webpack_require__(91); module.exports = function (it) { return IObject(defined(it)); @@ -33355,16 +33411,16 @@ module.exports = function (it) { module.exports = glob -var fs = __webpack_require__(5) +var fs = __webpack_require__(4) var rp = __webpack_require__(140) var minimatch = __webpack_require__(82) var Minimatch = minimatch.Minimatch var inherits = __webpack_require__(61) -var EE = __webpack_require__(76).EventEmitter +var EE = __webpack_require__(77).EventEmitter var path = __webpack_require__(0) var assert = __webpack_require__(28) var isAbsolute = __webpack_require__(101) -var globSync = __webpack_require__(272) +var globSync = __webpack_require__(269) var common = __webpack_require__(141) var alphasort = common.alphasort var alphasorti = common.alphasorti @@ -34175,7 +34231,7 @@ if (process.env.READABLE_STREAM === 'disable' && Stream) { exports.Stream = Stream || exports; exports.Readable = exports; exports.Writable = __webpack_require__(408); - exports.Duplex = __webpack_require__(115); + exports.Duplex = __webpack_require__(116); exports.Transform = __webpack_require__(407); exports.PassThrough = __webpack_require__(792); } @@ -34366,6 +34422,85 @@ module.exports = require("tty"); "use strict"; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getInstallationMethod = exports.version = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let getInstallationMethod = exports.getInstallationMethod = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + let installationMethod = originalInstallationMethod; + + // If there's a package.json in the parent directory, it could have an + // override for the installation method, so we should prefer that over + // whatever was originally in Yarn's package.json. This is the case with + // systems such as Homebrew, which take the tarball and modify the + // installation method so we're aware of the fact that Yarn was installed via + // Homebrew (so things like update notifications can point out the correct + // command to upgrade). + try { + const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); + if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { + // non-async version is deprecated + const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); + if (manifest.installationMethod) { + installationMethod = manifest.installationMethod; + } + } + } catch (e) { + // Ignore any errors; this is not critical functionality. + } + return installationMethod; + }); + + return function getInstallationMethod() { + return _ref.apply(this, arguments); + }; +})(); + +var _fs; + +function _load_fs() { + return _fs = __webpack_require__(5); +} + +var _fs2; + +function _load_fs2() { + return _fs2 = _interopRequireDefault(__webpack_require__(4)); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +// This will be bundled directly in the .js file for production builds +var _require = __webpack_require__(195); /** + * Determines the current version of Yarn itself. + * + */ + +const version = _require.version, + originalInstallationMethod = _require.installationMethod; +exports.version = version; + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + Object.defineProperty(exports, "__esModule", { value: true }); @@ -34800,15 +34935,27 @@ function hasMergeConflicts(str) { function parse(str, fileLoc) { const parser = new Parser(str, fileLoc); parser.next(); - try { - return parser.parse(); - } catch (error1) { + + if (!fileLoc.endsWith(`.yml`)) { try { - return safeLoad(str, { - schema: FAILSAFE_SCHEMA - }); - } catch (error2) { - throw error1; + return parser.parse(); + } catch (error1) { + try { + return safeLoad(str, { + schema: FAILSAFE_SCHEMA + }); + } catch (error2) { + throw error1; + } + } + } else { + const result = safeLoad(str, { + schema: FAILSAFE_SCHEMA + }); + if (typeof result === 'object') { + return result; + } else { + return {}; } } } @@ -34829,280 +34976,6 @@ function parseWithConflict(str, fileLoc) { } } -/***/ }), -/* 106 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - - -module.exports = { - copy: copy, - checkDataType: checkDataType, - checkDataTypes: checkDataTypes, - coerceToTypes: coerceToTypes, - toHash: toHash, - getProperty: getProperty, - escapeQuotes: escapeQuotes, - equal: __webpack_require__(204), - ucs2length: __webpack_require__(480), - varOccurences: varOccurences, - varReplace: varReplace, - cleanUpCode: cleanUpCode, - finalCleanUpCode: finalCleanUpCode, - schemaHasRules: schemaHasRules, - schemaHasRulesExcept: schemaHasRulesExcept, - toQuotedString: toQuotedString, - getPathExpr: getPathExpr, - getPath: getPath, - getData: getData, - unescapeFragment: unescapeFragment, - unescapeJsonPointer: unescapeJsonPointer, - escapeFragment: escapeFragment, - escapeJsonPointer: escapeJsonPointer -}; - - -function copy(o, to) { - to = to || {}; - for (var key in o) to[key] = o[key]; - return to; -} - - -function checkDataType(dataType, data, negate) { - var EQUAL = negate ? ' !== ' : ' === ' - , AND = negate ? ' || ' : ' && ' - , OK = negate ? '!' : '' - , NOT = negate ? '' : '!'; - switch (dataType) { - case 'null': return data + EQUAL + 'null'; - case 'array': return OK + 'Array.isArray(' + data + ')'; - case 'object': return '(' + OK + data + AND + - 'typeof ' + data + EQUAL + '"object"' + AND + - NOT + 'Array.isArray(' + data + '))'; - case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND + - NOT + '(' + data + ' % 1)' + - AND + data + EQUAL + data + ')'; - default: return 'typeof ' + data + EQUAL + '"' + dataType + '"'; - } -} - - -function checkDataTypes(dataTypes, data) { - switch (dataTypes.length) { - case 1: return checkDataType(dataTypes[0], data, true); - default: - var code = ''; - var types = toHash(dataTypes); - if (types.array && types.object) { - code = types.null ? '(': '(!' + data + ' || '; - code += 'typeof ' + data + ' !== "object")'; - delete types.null; - delete types.array; - delete types.object; - } - if (types.number) delete types.integer; - for (var t in types) - code += (code ? ' && ' : '' ) + checkDataType(t, data, true); - - return code; - } -} - - -var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]); -function coerceToTypes(optionCoerceTypes, dataTypes) { - if (Array.isArray(dataTypes)) { - var types = []; - for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); - return paths[lvl - up]; - } - - if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); - data = 'data' + ((lvl - up) || ''); - if (!jsonPointer) return data; - } - - var expr = data; - var segments = jsonPointer.split('/'); - for (var i=0; i= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl); + return paths[lvl - up]; + } + + if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl); + data = 'data' + ((lvl - up) || ''); + if (!jsonPointer) return data; + } + + var expr = data; + var segments = jsonPointer.split('/'); + for (var i=0; i * @@ -37097,7 +37244,7 @@ module.exports = micromatch; /***/ }), -/* 115 */ +/* 116 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -37131,7 +37278,7 @@ module.exports = micromatch; /**/ -var pna = __webpack_require__(180); +var pna = __webpack_require__(181); /**/ /**/ @@ -37234,7 +37381,7 @@ Duplex.prototype._destroy = function (err, cb) { }; /***/ }), -/* 116 */ +/* 117 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37282,7 +37429,7 @@ var MulticastOperator = /*@__PURE__*/ (function () { /***/ }), -/* 117 */ +/* 118 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37293,7 +37440,7 @@ var observable = typeof Symbol === 'function' && Symbol.observable || '@@observa /***/ }), -/* 118 */ +/* 119 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -37306,7 +37453,7 @@ function identity(x) { /***/ }), -/* 119 */ +/* 120 */ /***/ (function(module, exports, __webpack_require__) { var v1 = __webpack_require__(957); @@ -37319,85 +37466,6 @@ uuid.v4 = v4; module.exports = uuid; -/***/ }), -/* 120 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.getInstallationMethod = exports.version = undefined; - -var _asyncToGenerator2; - -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} - -let getInstallationMethod = exports.getInstallationMethod = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - let installationMethod = originalInstallationMethod; - - // If there's a package.json in the parent directory, it could have an - // override for the installation method, so we should prefer that over - // whatever was originally in Yarn's package.json. This is the case with - // systems such as Homebrew, which take the tarball and modify the - // installation method so we're aware of the fact that Yarn was installed via - // Homebrew (so things like update notifications can point out the correct - // command to upgrade). - try { - const manifestPath = (_path || _load_path()).default.join(__dirname, '..', 'package.json'); - if ((_fs2 || _load_fs2()).default.existsSync(manifestPath)) { - // non-async version is deprecated - const manifest = yield (0, (_fs || _load_fs()).readJson)(manifestPath); - if (manifest.installationMethod) { - installationMethod = manifest.installationMethod; - } - } - } catch (e) { - // Ignore any errors; this is not critical functionality. - } - return installationMethod; - }); - - return function getInstallationMethod() { - return _ref.apply(this, arguments); - }; -})(); - -var _fs; - -function _load_fs() { - return _fs = __webpack_require__(4); -} - -var _fs2; - -function _load_fs2() { - return _fs2 = _interopRequireDefault(__webpack_require__(5)); -} - -var _path; - -function _load_path() { - return _path = _interopRequireDefault(__webpack_require__(0)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -// This will be bundled directly in the .js file for production builds -var _require = __webpack_require__(194); /** - * Determines the current version of Yarn itself. - * - */ - -const version = _require.version, - originalInstallationMethod = _require.installationMethod; -exports.version = version; - /***/ }), /* 121 */ /***/ (function(module, exports, __webpack_require__) { @@ -37690,7 +37758,7 @@ function _load_errors() { var _index; function _load_index() { - return _index = __webpack_require__(57); + return _index = __webpack_require__(58); } var _baseReporter; @@ -37726,25 +37794,25 @@ function _load_add() { var _remove; function _load_remove() { - return _remove = __webpack_require__(359); + return _remove = __webpack_require__(353); } var _upgrade; function _load_upgrade() { - return _upgrade = __webpack_require__(207); + return _upgrade = __webpack_require__(205); } var _upgradeInteractive; function _load_upgradeInteractive() { - return _upgradeInteractive = __webpack_require__(362); + return _upgradeInteractive = __webpack_require__(356); } var _packageLinker; function _load_packageLinker() { - return _packageLinker = __webpack_require__(211); + return _packageLinker = __webpack_require__(209); } var _constants; @@ -37756,7 +37824,7 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -37946,7 +38014,7 @@ function _load_invariant() { var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); + return _semver = _interopRequireDefault(__webpack_require__(22)); } var _validate; @@ -37964,7 +38032,7 @@ function _load_lockfile() { var _packageReference; function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(365)); + return _packageReference = _interopRequireDefault(__webpack_require__(359)); } var _index; @@ -37988,19 +38056,19 @@ function _load_constants() { var _version; function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(226)); + return _version = _interopRequireWildcard(__webpack_require__(223)); } var _workspaceResolver; function _load_workspaceResolver() { - return _workspaceResolver = _interopRequireDefault(__webpack_require__(570)); + return _workspaceResolver = _interopRequireDefault(__webpack_require__(538)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _normalizePattern4; @@ -38013,7 +38081,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const micromatch = __webpack_require__(114); +const micromatch = __webpack_require__(115); class PackageRequest { constructor(req, resolver) { @@ -38560,7 +38628,7 @@ function _load_misc() { var _version; function _load_version() { - return _version = _interopRequireWildcard(__webpack_require__(226)); + return _version = _interopRequireWildcard(__webpack_require__(223)); } var _guessName; @@ -38572,7 +38640,7 @@ function _load_guessName() { var _index2; function _load_index2() { - return _index2 = __webpack_require__(57); + return _index2 = __webpack_require__(58); } var _exoticResolver; @@ -38584,7 +38652,7 @@ function _load_exoticResolver() { var _git; function _load_git() { - return _git = _interopRequireDefault(__webpack_require__(219)); + return _git = _interopRequireDefault(__webpack_require__(217)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -38841,13 +38909,13 @@ function _load_errors() { var _util; function _load_util() { - return _util = __webpack_require__(221); + return _util = __webpack_require__(219); } var _typos; function _load_typos() { - return _typos = _interopRequireDefault(__webpack_require__(587)); + return _typos = _interopRequireDefault(__webpack_require__(555)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -39004,8 +39072,8 @@ function cleanDependencies(info, isRoot, reporter, warn) { /***/ (function(module, exports, __webpack_require__) { // getting tag from 19.1.3.6 Object.prototype.toString() -var cof = __webpack_require__(68); -var TAG = __webpack_require__(20)('toStringTag'); +var cof = __webpack_require__(69); +var TAG = __webpack_require__(21)('toStringTag'); // ES3 wrong here var ARG = cof(function () { return arguments; }()) == 'Arguments'; @@ -39054,13 +39122,13 @@ module.exports = document && document.documentElement; var LIBRARY = __webpack_require__(93); var $export = __webpack_require__(60); -var redefine = __webpack_require__(251); +var redefine = __webpack_require__(248); var hide = __webpack_require__(42); -var Iterators = __webpack_require__(53); -var $iterCreate = __webpack_require__(242); +var Iterators = __webpack_require__(54); +var $iterCreate = __webpack_require__(239); var setToStringTag = __webpack_require__(95); -var getPrototypeOf = __webpack_require__(248); -var ITERATOR = __webpack_require__(20)('iterator'); +var getPrototypeOf = __webpack_require__(245); +var ITERATOR = __webpack_require__(21)('iterator'); var BUGGY = !([].keys && 'next' in [].keys()); // Safari has buggy iterators w/o `next` var FF_ITERATOR = '@@iterator'; var KEYS = 'keys'; @@ -39140,7 +39208,7 @@ module.exports = function (exec) { /***/ (function(module, exports, __webpack_require__) { var anObject = __webpack_require__(35); -var isObject = __webpack_require__(52); +var isObject = __webpack_require__(53); var newPromiseCapability = __webpack_require__(94); module.exports = function (C, x) { @@ -39191,8 +39259,8 @@ var store = global[SHARED] || (global[SHARED] = {}); // 7.3.20 SpeciesConstructor(O, defaultConstructor) var anObject = __webpack_require__(35); -var aFunction = __webpack_require__(67); -var SPECIES = __webpack_require__(20)('species'); +var aFunction = __webpack_require__(68); +var SPECIES = __webpack_require__(21)('species'); module.exports = function (O, D) { var C = anObject(O).constructor; var S; @@ -39204,8 +39272,8 @@ module.exports = function (O, D) { /* 135 */ /***/ (function(module, exports, __webpack_require__) { -var ctx = __webpack_require__(69); -var invoke = __webpack_require__(239); +var ctx = __webpack_require__(70); +var invoke = __webpack_require__(236); var html = __webpack_require__(128); var cel = __webpack_require__(92); var global = __webpack_require__(17); @@ -39247,7 +39315,7 @@ if (!setTask || !clearTask) { delete queue[id]; }; // Node.js 0.8- - if (__webpack_require__(68)(process) == 'process') { + if (__webpack_require__(69)(process) == 'process') { defer = function (id) { process.nextTick(ctx(run, id, 1)); }; @@ -40122,13 +40190,13 @@ realpath.realpathSync = realpathSync realpath.monkeypatch = monkeypatch realpath.unmonkeypatch = unmonkeypatch -var fs = __webpack_require__(5) +var fs = __webpack_require__(4) var origRealpath = fs.realpath var origRealpathSync = fs.realpathSync var version = process.version var ok = /^v[0-5]\./.test(version) -var old = __webpack_require__(271) +var old = __webpack_require__(268) function newError (er) { return er && er.syscall === 'realpath' && ( @@ -40503,7 +40571,7 @@ module.exports = new Schema({ /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(0); -var fs = __webpack_require__(5); +var fs = __webpack_require__(4); var _0777 = parseInt('0777', 8); module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP; @@ -40716,7 +40784,7 @@ var FilterSubscriber = /*@__PURE__*/ (function (_super) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_subscribeToResult__ = __webpack_require__(14); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__OuterSubscriber__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__InnerSubscriber__ = __webpack_require__(84); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(46); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__map__ = __webpack_require__(47); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__observable_from__ = __webpack_require__(62); /** PURE_IMPORTS_START tslib,_util_subscribeToResult,_OuterSubscriber,_InnerSubscriber,_map,_observable_from PURE_IMPORTS_END */ @@ -41072,10 +41140,10 @@ module.exports = Certificate; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); -var errs = __webpack_require__(73); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); var util = __webpack_require__(3); var utils = __webpack_require__(26); var Key = __webpack_require__(27); @@ -41456,8 +41524,8 @@ module.exports = Fingerprint; var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); -var errs = __webpack_require__(73); +var crypto = __webpack_require__(11); +var errs = __webpack_require__(74); var Key = __webpack_require__(27); var Certificate = __webpack_require__(155); var utils = __webpack_require__(26); @@ -41630,7 +41698,7 @@ module.exports = { }; var assert = __webpack_require__(16); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); var utils = __webpack_require__(26); @@ -42241,13 +42309,13 @@ module.exports = Identity; var assert = __webpack_require__(16); var algs = __webpack_require__(32); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var Fingerprint = __webpack_require__(156); -var Signature = __webpack_require__(74); -var errs = __webpack_require__(73); +var Signature = __webpack_require__(75); +var errs = __webpack_require__(74); var util = __webpack_require__(3); var utils = __webpack_require__(26); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var Buffer = __webpack_require__(15).Buffer; /*JSSTYLED*/ @@ -42755,7 +42823,7 @@ Object.defineProperty(exports, "__esModule", { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -42775,7 +42843,7 @@ function _load_executeLifecycleScript() { var _path; function _load_path() { - return _path = __webpack_require__(377); + return _path = __webpack_require__(371); } var _conversion; @@ -42787,7 +42855,7 @@ function _load_conversion() { var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(220)); + return _index = _interopRequireDefault(__webpack_require__(218)); } var _errors; @@ -42799,7 +42867,7 @@ function _load_errors() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _constants; @@ -42811,25 +42879,25 @@ function _load_constants() { var _packageConstraintResolver; function _load_packageConstraintResolver() { - return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(555)); + return _packageConstraintResolver = _interopRequireDefault(__webpack_require__(523)); } var _requestManager; function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(378)); + return _requestManager = _interopRequireDefault(__webpack_require__(372)); } var _index2; function _load_index2() { - return _index2 = __webpack_require__(57); + return _index2 = __webpack_require__(58); } var _index3; function _load_index3() { - return _index3 = __webpack_require__(200); + return _index3 = __webpack_require__(201); } var _map; @@ -42842,10 +42910,11 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const detectIndent = __webpack_require__(635); +const crypto = __webpack_require__(11); +const detectIndent = __webpack_require__(603); const invariant = __webpack_require__(9); const path = __webpack_require__(0); -const micromatch = __webpack_require__(114); +const micromatch = __webpack_require__(115); const isCi = __webpack_require__(397); function sortObject(object) { @@ -43264,6 +43333,10 @@ class Config { slug += `-${hash}`; } + if (pkg.remote.integrity) { + slug += `-integrity`; + } + return slug; } @@ -43879,28 +43952,28 @@ function extractWorkspaces(manifest) { /* 163 */ /***/ (function(module, exports) { -module.exports = function(module) { - if(!module.webpackPolyfill) { - module.deprecate = function() {}; - module.paths = []; - // module.parent = undefined by default - if(!module.children) module.children = []; - Object.defineProperty(module, "loaded", { - enumerable: true, - get: function() { - return module.l; - } - }); - Object.defineProperty(module, "id", { - enumerable: true, - get: function() { - return module.i; - } - }); - module.webpackPolyfill = 1; - } - return module; -}; +module.exports = function(module) { + if(!module.webpackPolyfill) { + module.deprecate = function() {}; + module.paths = []; + // module.parent = undefined by default + if(!module.children) module.children = []; + Object.defineProperty(module, "loaded", { + enumerable: true, + get: function() { + return module.l; + } + }); + Object.defineProperty(module, "id", { + enumerable: true, + get: function() { + return module.i; + } + }); + module.webpackPolyfill = 1; + } + return module; +}; /***/ }), @@ -43930,7 +44003,7 @@ function _load_asyncToGenerator() { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } let run = exports.run = (() => { @@ -43982,7 +44055,7 @@ function _load_index() { var _list; function _load_list() { - return _list = __webpack_require__(358); + return _list = __webpack_require__(352); } var _install; @@ -44006,7 +44079,7 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _invariant; @@ -44024,7 +44097,7 @@ function _load_path() { var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); + return _semver = _interopRequireDefault(__webpack_require__(22)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -44600,13 +44673,13 @@ exports.hasWrapper = hasWrapper; var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _filter; function _load_filter() { - return _filter = __webpack_require__(372); + return _filter = __webpack_require__(366); } var _errors; @@ -44619,10 +44692,10 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const zlib = __webpack_require__(198); +const zlib = __webpack_require__(199); const path = __webpack_require__(0); -const tar = __webpack_require__(193); -const fs2 = __webpack_require__(5); +const tar = __webpack_require__(194); +const fs2 = __webpack_require__(4); const depsFor = __webpack_require__(678); const FOLDERS_IGNORE = [ @@ -44632,7 +44705,7 @@ const FOLDERS_IGNORE = [ const DEFAULT_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([...FOLDERS_IGNORE, // ignore cruft -'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.npmignore', '.gitignore', '.DS_Store']); +'yarn.lock', '.lock-wscript', '.wafpickle-{0..9}', '*.swp', '._*', 'npm-debug.log', 'yarn-error.log', '.npmrc', '.yarnrc', '.yarnrc.yml', '.npmignore', '.gitignore', '.DS_Store']); const NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ // never ignore these files @@ -44641,6 +44714,7 @@ const NEVER_IGNORE = (0, (_filter || _load_filter()).ignoreLinesToRegex)([ function packWithIgnoreAndHeaders(cwd, ignoreFunction, { mapHeader } = {}) { return tar.pack(cwd, { ignore: ignoreFunction, + sort: true, map: header => { const suffix = header.name === '.' ? '' : `/${header.name}`; header.name = `package${suffix}`; @@ -44680,7 +44754,7 @@ function _load_asyncToGenerator() { var _index; function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(220)); + return _index = _interopRequireDefault(__webpack_require__(218)); } var _constants; @@ -44692,13 +44766,13 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _mutex; function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(375)); + return _mutex = _interopRequireDefault(__webpack_require__(369)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -44707,7 +44781,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de /* eslint no-unused-vars: 0 */ -const cmdShim = __webpack_require__(201); +const cmdShim = __webpack_require__(202); const path = __webpack_require__(0); class BaseFetcher { @@ -44828,7 +44902,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.hash = hash; -const crypto = __webpack_require__(12); +const crypto = __webpack_require__(11); const stream = __webpack_require__(23); function hash(content, type = 'md5') { @@ -44944,8 +45018,141 @@ function guessName(source) { /* 170 */ /***/ (function(module, exports, __webpack_require__) { +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.satisfiesWithPrereleases = satisfiesWithPrereleases; +exports.diffWithUnstable = diffWithUnstable; + +var _semver; + +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +/** + * Returns whether the given semver version satisfies the given range. Notably this supports + * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example. + */ + +function satisfiesWithPrereleases(version, range, loose = false) { + let semverRange; + try { + // $FlowFixMe: Add a definition for the Range class + semverRange = new (_semver || _load_semver()).default.Range(range, loose); + } catch (err) { + return false; + } + + if (!version) { + return false; + } + let semverVersion; + try { + semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose); + } catch (err) { + return false; + } + + // A range has multiple sets of comparators. A version must satisfy all comparators in a set + // and at least one set to satisfy the range. + return semverRange.set.some(comparatorSet => { + // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't + // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0", + // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease + // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and + // convert "<2.0.0" to "<2.0.0-0", for example. + comparatorSet = comparatorSet.map(comparator => { + if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) { + return comparator; + } + + // "0" is the lowest prerelease version + comparator.semver.inc('pre', 0); + + const comparatorString = comparator.operator + comparator.semver.version; + // $FlowFixMe: Add a definition for the Comparator class + return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose); + }); + + return !comparatorSet.some(comparator => !comparator.test(semverVersion)); + }); +} + +const PRE_RELEASES = { + major: 'premajor', + minor: 'preminor', + patch: 'prepatch' +}; + +/** + * Returns the difference between two versions as a semantic string representation. + * Similar to the `diff` method in node-semver, but it also accounts for unstable versions, + * like 0.x.x or 0.0.x. + */ + +function diffWithUnstable(version1, version2) { + if ((_semver || _load_semver()).default.eq(version1, version2) === false) { + const v1 = (_semver || _load_semver()).default.parse(version1); + const v2 = (_semver || _load_semver()).default.parse(version2); + + if (v1 != null && v2 != null) { + const isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0; + const preMajor = v1.major === 0 || v2.major === 0; + const preMinor = preMajor && (v1.minor === 0 || v2.minor === 0); + + let diff = null; + + if (v1.major !== v2.major) { + diff = 'major'; + } else if (v1.minor !== v2.minor) { + if (preMajor) { + // If the major version number is zero (0.x.x), treat a change + // of the minor version number as a major change. + diff = 'major'; + } else { + diff = 'minor'; + } + } else if (v1.patch !== v2.patch) { + if (preMinor) { + // If the major & minor version numbers are zero (0.0.x), treat a change + // of the patch version number as a major change. + diff = 'major'; + } else if (preMajor) { + // If the major version number is zero (0.x.x), treat a change + // of the patch version number as a minor change. + diff = 'minor'; + } else { + diff = 'patch'; + } + } + + if (isPreRelease) { + if (diff != null) { + diff = PRE_RELEASES[diff]; + } else { + diff = 'prerelease'; + } + } + + return diff; + } + } + + return null; +} + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + // fallback for non-array-like ES3 and non-enumerable old V8 strings -var cof = __webpack_require__(68); +var cof = __webpack_require__(69); // eslint-disable-next-line no-prototype-builtins module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { return cof(it) == 'String' ? it.split('') : Object(it); @@ -44953,11 +45160,11 @@ module.exports = Object('z').propertyIsEnumerable(0) ? Object : function (it) { /***/ }), -/* 171 */ +/* 172 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.14 / 15.2.3.14 Object.keys(O) -var $keys = __webpack_require__(249); +var $keys = __webpack_require__(246); var enumBugKeys = __webpack_require__(127); module.exports = Object.keys || function keys(O) { @@ -44966,7 +45173,7 @@ module.exports = Object.keys || function keys(O) { /***/ }), -/* 172 */ +/* 173 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.13 ToObject(argument) @@ -44977,7 +45184,7 @@ module.exports = function (it) { /***/ }), -/* 173 */ +/* 174 */ /***/ (function(module, exports, __webpack_require__) { var once = __webpack_require__(83); @@ -45070,7 +45277,7 @@ module.exports = eos; /***/ }), -/* 174 */ +/* 175 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2012 Joyent, Inc. All rights reserved. @@ -45188,13 +45395,13 @@ module.exports = { /***/ }), -/* 175 */ +/* 176 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var chalk = __webpack_require__(30); -var figures = __webpack_require__(270); +var figures = __webpack_require__(267); /** * Separator object @@ -45232,7 +45439,7 @@ module.exports = Separator; /***/ }), -/* 176 */ +/* 177 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45292,7 +45499,7 @@ module.exports = Paginator; /***/ }), -/* 177 */ +/* 178 */ /***/ (function(module, exports) { /*! @@ -45309,7 +45516,7 @@ module.exports = function isExtglob(str) { /***/ }), -/* 178 */ +/* 179 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -45319,7 +45526,7 @@ module.exports = function isExtglob(str) { * Licensed under the MIT License. */ -var isExtglob = __webpack_require__(177); +var isExtglob = __webpack_require__(178); module.exports = function isGlob(str) { return typeof str === 'string' @@ -45328,7 +45535,7 @@ module.exports = function isGlob(str) { }; /***/ }), -/* 179 */ +/* 180 */ /***/ (function(module, exports, __webpack_require__) { var isBuffer = __webpack_require__(729); @@ -45450,7 +45657,7 @@ module.exports = function kindOf(val) { /***/ }), -/* 180 */ +/* 181 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45501,7 +45708,7 @@ function nextTick(fn, arg1, arg2, arg3) { /***/ }), -/* 181 */ +/* 182 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -45569,18 +45776,18 @@ runAsync.cb = function (func, cb) { /***/ }), -/* 182 */ +/* 183 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__internal_Observable__ = __webpack_require__(12); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Observable", function() { return __WEBPACK_IMPORTED_MODULE_0__internal_Observable__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__ = __webpack_require__(423); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ConnectableObservable", function() { return __WEBPACK_IMPORTED_MODULE_1__internal_observable_ConnectableObservable__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__ = __webpack_require__(433); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "GroupedObservable", function() { return __WEBPACK_IMPORTED_MODULE_2__internal_operators_groupBy__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__ = __webpack_require__(118); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "observable", function() { return __WEBPACK_IMPORTED_MODULE_3__internal_symbol_observable__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__internal_Subject__ = __webpack_require__(36); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subject", function() { return __WEBPACK_IMPORTED_MODULE_4__internal_Subject__["a"]; }); @@ -45588,7 +45795,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "BehaviorSubject", function() { return __WEBPACK_IMPORTED_MODULE_5__internal_BehaviorSubject__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__ = __webpack_require__(308); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ReplaySubject", function() { return __WEBPACK_IMPORTED_MODULE_6__internal_ReplaySubject__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(183); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__ = __webpack_require__(184); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "AsyncSubject", function() { return __WEBPACK_IMPORTED_MODULE_7__internal_AsyncSubject__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__ = __webpack_require__(438); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "asapScheduler", function() { return __WEBPACK_IMPORTED_MODULE_8__internal_scheduler_asap__["a"]; }); @@ -45607,13 +45814,13 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscription", function() { return __WEBPACK_IMPORTED_MODULE_14__internal_Subscription__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__ = __webpack_require__(7); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Subscriber", function() { return __WEBPACK_IMPORTED_MODULE_15__internal_Subscriber__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__internal_Notification__ = __webpack_require__(185); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "Notification", function() { return __WEBPACK_IMPORTED_MODULE_16__internal_Notification__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__ = __webpack_require__(324); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "pipe", function() { return __WEBPACK_IMPORTED_MODULE_17__internal_util_pipe__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__ = __webpack_require__(192); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "noop", function() { return __WEBPACK_IMPORTED_MODULE_18__internal_util_noop__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(118); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__ = __webpack_require__(119); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "identity", function() { return __WEBPACK_IMPORTED_MODULE_19__internal_util_identity__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__ = __webpack_require__(930); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "isObservable", function() { return __WEBPACK_IMPORTED_MODULE_20__internal_util_isObservable__["a"]; }); @@ -45621,7 +45828,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ArgumentOutOfRangeError", function() { return __WEBPACK_IMPORTED_MODULE_21__internal_util_ArgumentOutOfRangeError__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__ = __webpack_require__(153); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EmptyError", function() { return __WEBPACK_IMPORTED_MODULE_22__internal_util_EmptyError__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__ = __webpack_require__(190); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "ObjectUnsubscribedError", function() { return __WEBPACK_IMPORTED_MODULE_23__internal_util_ObjectUnsubscribedError__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__ = __webpack_require__(441); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "UnsubscriptionError", function() { return __WEBPACK_IMPORTED_MODULE_24__internal_util_UnsubscriptionError__["a"]; }); @@ -45633,7 +45840,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "bindNodeCallback", function() { return __WEBPACK_IMPORTED_MODULE_27__internal_observable_bindNodeCallback__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__ = __webpack_require__(309); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "combineLatest", function() { return __WEBPACK_IMPORTED_MODULE_28__internal_observable_combineLatest__["a"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(186); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__ = __webpack_require__(187); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "concat", function() { return __WEBPACK_IMPORTED_MODULE_29__internal_observable_concat__["a"]; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__ = __webpack_require__(310); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "defer", function() { return __WEBPACK_IMPORTED_MODULE_30__internal_observable_defer__["a"]; }); @@ -45677,7 +45884,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "zip", function() { return __WEBPACK_IMPORTED_MODULE_49__internal_observable_zip__["a"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "EMPTY", function() { return __WEBPACK_IMPORTED_MODULE_31__internal_observable_empty__["b"]; }); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "NEVER", function() { return __WEBPACK_IMPORTED_MODULE_40__internal_observable_never__["b"]; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__internal_config__ = __webpack_require__(186); /* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, "config", function() { return __WEBPACK_IMPORTED_MODULE_50__internal_config__["a"]; }); /** PURE_IMPORTS_START PURE_IMPORTS_END */ @@ -45737,7 +45944,7 @@ Object.defineProperty(__webpack_exports__, "__esModule", { value: true }); /***/ }), -/* 183 */ +/* 184 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45795,7 +46002,7 @@ var AsyncSubject = /*@__PURE__*/ (function (_super) { /***/ }), -/* 184 */ +/* 185 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45876,7 +46083,7 @@ var Notification = /*@__PURE__*/ (function () { /***/ }), -/* 185 */ +/* 186 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45903,12 +46110,12 @@ var config = { /***/ }), -/* 186 */ +/* 187 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = concat; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__util_isScheduler__ = __webpack_require__(49); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__of__ = __webpack_require__(311); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__from__ = __webpack_require__(62); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__operators_concatAll__ = __webpack_require__(429); @@ -45931,7 +46138,7 @@ function concat() { /***/ }), -/* 187 */ +/* 188 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45959,7 +46166,7 @@ function reduce(accumulator, seed) { /***/ }), -/* 188 */ +/* 189 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -45990,7 +46197,7 @@ function defaultErrorFactory() { /***/ }), -/* 189 */ +/* 190 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -46008,7 +46215,7 @@ var ObjectUnsubscribedError = ObjectUnsubscribedErrorImpl; /***/ }), -/* 190 */ +/* 191 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -46023,7 +46230,7 @@ function isNumeric(val) { /***/ }), -/* 191 */ +/* 192 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -46034,7 +46241,7 @@ function noop() { } /***/ }), -/* 192 */ +/* 193 */ /***/ (function(module, exports, __webpack_require__) { // Copyright 2015 Joyent, Inc. @@ -46046,18 +46253,18 @@ module.exports = { }; var assert = __webpack_require__(16); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); var utils = __webpack_require__(26); -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var Key = __webpack_require__(27); var PrivateKey = __webpack_require__(33); var pem = __webpack_require__(86); var rfc4253 = __webpack_require__(103); var SSHBuffer = __webpack_require__(159); -var errors = __webpack_require__(73); +var errors = __webpack_require__(74); var bcrypt; @@ -46106,7 +46313,7 @@ function readSSHPrivate(type, buf, options) { var rounds = kdfOptsBuf.readInt(); var cinf = utils.opensshCipherInfo(cipher); if (bcrypt === undefined) { - bcrypt = __webpack_require__(379); + bcrypt = __webpack_require__(373); } if (typeof (options.passphrase) === 'string') { @@ -46227,7 +46434,7 @@ function write(key, options) { kdfopts = kdfssh.toBuffer(); if (bcrypt === undefined) { - bcrypt = __webpack_require__(379); + bcrypt = __webpack_require__(373); } var pass = new Uint8Array(passphrase); var salti = new Uint8Array(salt); @@ -46302,16 +46509,16 @@ function write(key, options) { /***/ }), -/* 193 */ +/* 194 */ /***/ (function(module, exports, __webpack_require__) { -var chownr = __webpack_require__(600) +var chownr = __webpack_require__(568) var tar = __webpack_require__(460) var pump = __webpack_require__(781) var mkdirp = __webpack_require__(145) -var fs = __webpack_require__(5) +var fs = __webpack_require__(4) var path = __webpack_require__(0) -var os = __webpack_require__(49) +var os = __webpack_require__(46) var win32 = os.platform() === 'win32' @@ -46653,37 +46860,37 @@ function mkdirfix (name, opts, cb) { /***/ }), -/* 194 */ +/* 195 */ /***/ (function(module, exports) { -module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.18.0","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}} +module.exports = {"name":"yarn","installationMethod":"unknown","version":"1.22.19","packageManager":"yarn@1.22.17","license":"BSD-2-Clause","preferGlobal":true,"description":"📦🐈 Fast, reliable, and secure dependency management.","dependencies":{"@zkochan/cmd-shim":"^3.1.0","babel-runtime":"^6.26.0","bytes":"^3.0.0","camelcase":"^4.0.0","chalk":"^2.1.0","cli-table3":"^0.4.0","commander":"^2.9.0","death":"^1.0.0","debug":"^3.0.0","deep-equal":"^1.0.1","detect-indent":"^5.0.0","dnscache":"^1.0.1","glob":"^7.1.1","gunzip-maybe":"^1.4.0","hash-for-dep":"^1.2.3","imports-loader":"^0.8.0","ini":"^1.3.4","inquirer":"^6.2.0","invariant":"^2.2.0","is-builtin-module":"^2.0.0","is-ci":"^1.0.10","is-webpack-bundle":"^1.0.0","js-yaml":"^3.13.1","leven":"^2.0.0","loud-rejection":"^1.2.0","micromatch":"^2.3.11","mkdirp":"^0.5.1","node-emoji":"^1.6.1","normalize-url":"^2.0.0","npm-logical-tree":"^1.2.1","object-path":"^0.11.2","proper-lockfile":"^2.0.0","puka":"^1.0.0","read":"^1.0.7","request":"^2.87.0","request-capture-har":"^1.2.2","rimraf":"^2.5.0","semver":"^5.1.0","ssri":"^5.3.0","strip-ansi":"^4.0.0","strip-bom":"^3.0.0","tar-fs":"^1.16.0","tar-stream":"^1.6.1","uuid":"^3.0.1","v8-compile-cache":"^2.0.0","validate-npm-package-license":"^3.0.4","yn":"^2.0.0"},"devDependencies":{"babel-core":"^6.26.0","babel-eslint":"^7.2.3","babel-loader":"^6.2.5","babel-plugin-array-includes":"^2.0.3","babel-plugin-inline-import":"^3.0.0","babel-plugin-transform-builtin-extend":"^1.1.2","babel-plugin-transform-inline-imports-commonjs":"^1.0.0","babel-plugin-transform-runtime":"^6.4.3","babel-preset-env":"^1.6.0","babel-preset-flow":"^6.23.0","babel-preset-stage-0":"^6.0.0","babylon":"^6.5.0","commitizen":"^2.9.6","cz-conventional-changelog":"^2.0.0","eslint":"^4.3.0","eslint-config-fb-strict":"^22.0.0","eslint-plugin-babel":"^5.0.0","eslint-plugin-flowtype":"^2.35.0","eslint-plugin-jasmine":"^2.6.2","eslint-plugin-jest":"^21.0.0","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prefer-object-spread":"^1.2.1","eslint-plugin-prettier":"^2.1.2","eslint-plugin-react":"^7.1.0","eslint-plugin-relay":"^0.0.28","eslint-plugin-yarn-internal":"file:scripts/eslint-rules","execa":"^0.11.0","fancy-log":"^1.3.2","flow-bin":"^0.66.0","git-release-notes":"^3.0.0","gulp":"^4.0.0","gulp-babel":"^7.0.0","gulp-if":"^2.0.1","gulp-newer":"^1.0.0","gulp-plumber":"^1.0.1","gulp-sourcemaps":"^2.2.0","jest":"^22.4.4","jsinspect":"^0.12.6","minimatch":"^3.0.4","mock-stdin":"^0.3.0","prettier":"^1.5.2","string-replace-loader":"^2.1.1","temp":"^0.8.3","webpack":"^2.1.0-beta.25","yargs":"^6.3.0"},"resolutions":{"sshpk":"^1.14.2"},"engines":{"node":">=4.0.0"},"repository":"yarnpkg/yarn","bin":{"yarn":"./bin/yarn.js","yarnpkg":"./bin/yarn.js"},"scripts":{"build":"gulp build","build-bundle":"node ./scripts/build-webpack.js","build-chocolatey":"powershell ./scripts/build-chocolatey.ps1","build-deb":"./scripts/build-deb.sh","build-dist":"bash ./scripts/build-dist.sh","build-win-installer":"scripts\\build-windows-installer.bat","changelog":"git-release-notes $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..$(git describe --tags --abbrev=0) scripts/changelog.md","dupe-check":"yarn jsinspect ./src","lint":"eslint . && flow check","pkg-tests":"yarn --cwd packages/pkg-tests jest yarn.test.js","prettier":"eslint src __tests__ --fix","release-branch":"./scripts/release-branch.sh","test":"yarn lint && yarn test-only","test-only":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --verbose","test-only-debug":"node --inspect-brk --max_old_space_size=4096 node_modules/jest/bin/jest.js --runInBand --verbose","test-coverage":"node --max_old_space_size=4096 node_modules/jest/bin/jest.js --coverage --verbose","watch":"gulp watch","commit":"git-cz"},"jest":{"collectCoverageFrom":["src/**/*.js"],"testEnvironment":"node","modulePathIgnorePatterns":["__tests__/fixtures/","packages/pkg-tests/pkg-tests-fixtures","dist/"],"testPathIgnorePatterns":["__tests__/(fixtures|__mocks__)/","updates/","_(temp|mock|install|init|helpers).js$","packages/pkg-tests"]},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}}} /***/ }), -/* 195 */ +/* 196 */ /***/ (function(module, exports) { module.exports = require("https"); /***/ }), -/* 196 */ +/* 197 */ /***/ (function(module, exports) { module.exports = require("querystring"); /***/ }), -/* 197 */ +/* 198 */ /***/ (function(module, exports) { module.exports = require("readline"); /***/ }), -/* 198 */ +/* 199 */ /***/ (function(module, exports) { module.exports = require("zlib"); /***/ }), -/* 199 */ +/* 200 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46709,7 +46916,7 @@ function _load_constants() { var _package; function _load_package() { - return _package = __webpack_require__(194); + return _package = __webpack_require__(195); } const NODE_VERSION = process.version; @@ -46817,7 +47024,7 @@ function stringify(obj, noHeader, enableVersions) { } /***/ }), -/* 200 */ +/* 201 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -46830,7 +47037,7 @@ Object.defineProperty(exports, "__esModule", { var _consoleReporter; function _load_consoleReporter() { - return _consoleReporter = __webpack_require__(561); + return _consoleReporter = __webpack_require__(529); } Object.defineProperty(exports, 'ConsoleReporter', { @@ -46843,7 +47050,7 @@ Object.defineProperty(exports, 'ConsoleReporter', { var _bufferReporter; function _load_bufferReporter() { - return _bufferReporter = __webpack_require__(560); + return _bufferReporter = __webpack_require__(528); } Object.defineProperty(exports, 'BufferReporter', { @@ -46856,7 +47063,7 @@ Object.defineProperty(exports, 'BufferReporter', { var _eventReporter; function _load_eventReporter() { - return _eventReporter = __webpack_require__(565); + return _eventReporter = __webpack_require__(533); } Object.defineProperty(exports, 'EventReporter', { @@ -46869,7 +47076,7 @@ Object.defineProperty(exports, 'EventReporter', { var _jsonReporter; function _load_jsonReporter() { - return _jsonReporter = __webpack_require__(213); + return _jsonReporter = __webpack_require__(211); } Object.defineProperty(exports, 'JSONReporter', { @@ -46882,7 +47089,7 @@ Object.defineProperty(exports, 'JSONReporter', { var _noopReporter; function _load_noopReporter() { - return _noopReporter = __webpack_require__(569); + return _noopReporter = __webpack_require__(537); } Object.defineProperty(exports, 'NoopReporter', { @@ -46908,7 +47115,7 @@ Object.defineProperty(exports, 'Reporter', { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 201 */ +/* 202 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47180,389 +47387,8 @@ function normalizePathEnvVar (nodePath) { } -/***/ }), -/* 202 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var resolve = __webpack_require__(203); - -module.exports = { - Validation: errorSubclass(ValidationError), - MissingRef: errorSubclass(MissingRefError) -}; - - -function ValidationError(errors) { - this.message = 'validation failed'; - this.errors = errors; - this.ajv = this.validation = true; -} - - -MissingRefError.message = function (baseId, ref) { - return 'can\'t resolve reference ' + ref + ' from id ' + baseId; -}; - - -function MissingRefError(baseId, ref, message) { - this.message = message || MissingRefError.message(baseId, ref); - this.missingRef = resolve.url(baseId, ref); - this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); -} - - -function errorSubclass(Subclass) { - Subclass.prototype = Object.create(Error.prototype); - Subclass.prototype.constructor = Subclass; - return Subclass; -} - - /***/ }), /* 203 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var url = __webpack_require__(24) - , equal = __webpack_require__(204) - , util = __webpack_require__(106) - , SchemaObject = __webpack_require__(339) - , traverse = __webpack_require__(503); - -module.exports = resolve; - -resolve.normalizeId = normalizeId; -resolve.fullPath = getFullPath; -resolve.url = resolveUrl; -resolve.ids = resolveIds; -resolve.inlineRef = inlineRef; -resolve.schema = resolveSchema; - -/** - * [resolve and compile the references ($ref)] - * @this Ajv - * @param {Function} compile reference to schema compilation funciton (localCompile) - * @param {Object} root object with information about the root schema for the current schema - * @param {String} ref reference to resolve - * @return {Object|Function} schema object (if the schema can be inlined) or validation function - */ -function resolve(compile, root, ref) { - /* jshint validthis: true */ - var refVal = this._refs[ref]; - if (typeof refVal == 'string') { - if (this._refs[refVal]) refVal = this._refs[refVal]; - else return resolve.call(this, compile, root, refVal); - } - - refVal = refVal || this._schemas[ref]; - if (refVal instanceof SchemaObject) { - return inlineRef(refVal.schema, this._opts.inlineRefs) - ? refVal.schema - : refVal.validate || this._compile(refVal); - } - - var res = resolveSchema.call(this, root, ref); - var schema, v, baseId; - if (res) { - schema = res.schema; - root = res.root; - baseId = res.baseId; - } - - if (schema instanceof SchemaObject) { - v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); - } else if (schema !== undefined) { - v = inlineRef(schema, this._opts.inlineRefs) - ? schema - : compile.call(this, schema, root, undefined, baseId); - } - - return v; -} - - -/** - * Resolve schema, its root and baseId - * @this Ajv - * @param {Object} root root object with properties schema, refVal, refs - * @param {String} ref reference to resolve - * @return {Object} object with properties schema, root, baseId - */ -function resolveSchema(root, ref) { - /* jshint validthis: true */ - var p = url.parse(ref, false, true) - , refPath = _getFullPath(p) - , baseId = getFullPath(this._getId(root.schema)); - if (refPath !== baseId) { - var id = normalizeId(refPath); - var refVal = this._refs[id]; - if (typeof refVal == 'string') { - return resolveRecursive.call(this, root, refVal, p); - } else if (refVal instanceof SchemaObject) { - if (!refVal.validate) this._compile(refVal); - root = refVal; - } else { - refVal = this._schemas[id]; - if (refVal instanceof SchemaObject) { - if (!refVal.validate) this._compile(refVal); - if (id == normalizeId(ref)) - return { schema: refVal, root: root, baseId: baseId }; - root = refVal; - } else { - return; - } - } - if (!root.schema) return; - baseId = getFullPath(this._getId(root.schema)); - } - return getJsonPointer.call(this, p, baseId, root.schema, root); -} - - -/* @this Ajv */ -function resolveRecursive(root, ref, parsedRef) { - /* jshint validthis: true */ - var res = resolveSchema.call(this, root, ref); - if (res) { - var schema = res.schema; - var baseId = res.baseId; - root = res.root; - var id = this._getId(schema); - if (id) baseId = resolveUrl(baseId, id); - return getJsonPointer.call(this, parsedRef, baseId, schema, root); - } -} - - -var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); -/* @this Ajv */ -function getJsonPointer(parsedRef, baseId, schema, root) { - /* jshint validthis: true */ - parsedRef.hash = parsedRef.hash || ''; - if (parsedRef.hash.slice(0,2) != '#/') return; - var parts = parsedRef.hash.split('/'); - - for (var i = 1; i < parts.length; i++) { - var part = parts[i]; - if (part) { - part = util.unescapeFragment(part); - schema = schema[part]; - if (schema === undefined) break; - var id; - if (!PREVENT_SCOPE_CHANGE[part]) { - id = this._getId(schema); - if (id) baseId = resolveUrl(baseId, id); - if (schema.$ref) { - var $ref = resolveUrl(baseId, schema.$ref); - var res = resolveSchema.call(this, root, $ref); - if (res) { - schema = res.schema; - root = res.root; - baseId = res.baseId; - } - } - } - } - } - if (schema !== undefined && schema !== root.schema) - return { schema: schema, root: root, baseId: baseId }; -} - - -var SIMPLE_INLINED = util.toHash([ - 'type', 'format', 'pattern', - 'maxLength', 'minLength', - 'maxProperties', 'minProperties', - 'maxItems', 'minItems', - 'maximum', 'minimum', - 'uniqueItems', 'multipleOf', - 'required', 'enum' -]); -function inlineRef(schema, limit) { - if (limit === false) return false; - if (limit === undefined || limit === true) return checkNoRef(schema); - else if (limit) return countKeys(schema) <= limit; -} - - -function checkNoRef(schema) { - var item; - if (Array.isArray(schema)) { - for (var i=0; i All rights reserved. @@ -47581,7 +47407,7 @@ module.exports = { /***/ }), -/* 206 */ +/* 204 */ /***/ (function(module, exports) { // Copyright 2011 Mark Cavage All rights reserved. @@ -47623,7 +47449,7 @@ module.exports = { /***/ }), -/* 207 */ +/* 205 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47903,7 +47729,7 @@ function hasWrapper(commander, args) { const requireLockfile = exports.requireLockfile = true; /***/ }), -/* 208 */ +/* 206 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -47917,7 +47743,7 @@ exports.integrityErrors = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -47935,7 +47761,7 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _misc; @@ -47947,7 +47773,7 @@ function _load_misc() { var _packageNameUtils; function _load_packageNameUtils() { - return _packageNameUtils = __webpack_require__(222); + return _packageNameUtils = __webpack_require__(220); } var _workspaceLayout; @@ -48525,7 +48351,7 @@ class InstallationIntegrityChecker { exports.default = InstallationIntegrityChecker; /***/ }), -/* 209 */ +/* 207 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48560,18 +48386,18 @@ function _load_misc() { var _yarnVersion; function _load_yarnVersion() { - return _yarnVersion = __webpack_require__(120); + return _yarnVersion = __webpack_require__(105); } var _semver; function _load_semver() { - return _semver = __webpack_require__(224); + return _semver = __webpack_require__(170); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); const VERSIONS = Object.assign({}, process.versions, { yarn: (_yarnVersion || _load_yarnVersion()).version @@ -48697,9 +48523,7 @@ function checkOne(info, config, ignoreEngines) { ref.ignore = true; ref.incompatible = true; - reporter.info(`${human}: ${msg}`); if (!didIgnore) { - reporter.info(reporter.lang('optionalCompatibilityExcluded', human)); didIgnore = true; } } else { @@ -48794,7 +48618,7 @@ function shouldCheck(manifest, options) { } /***/ }), -/* 210 */ +/* 208 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -48812,11 +48636,29 @@ function _load_asyncToGenerator() { } let fetchCache = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config) { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dest, fetcher, config, remote) { + // $FlowFixMe: This error doesn't make sense var _ref2 = yield config.readPackageMetadata(dest); const hash = _ref2.hash, - pkg = _ref2.package; + pkg = _ref2.package, + cacheRemote = _ref2.remote; + + + const cacheIntegrity = cacheRemote.cacheIntegrity || cacheRemote.integrity; + const cacheHash = cacheRemote.hash; + + if (remote.integrity) { + if (!cacheIntegrity || !ssri.parse(cacheIntegrity).match(remote.integrity)) { + throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadIntegrityCache', pkg.name, cacheIntegrity, remote.integrity)); + } + } + + if (remote.hash) { + if (!cacheHash || cacheHash !== remote.hash) { + throw new (_errors || _load_errors()).SecurityError(config.reporter.lang('fetchBadHashCache', pkg.name, cacheHash, remote.hash)); + } + } yield fetcher.setupMirrorFromCache(); return { @@ -48827,7 +48669,7 @@ let fetchCache = (() => { }; }); - return function fetchCache(_x, _x2, _x3) { + return function fetchCache(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; })(); @@ -48847,7 +48689,7 @@ let fetchOneRemote = exports.fetchOneRemote = (() => { const fetcher = new Fetcher(dest, remote, config); if (yield config.isValidModuleDest(dest)) { - return fetchCache(dest, fetcher, config); + return fetchCache(dest, fetcher, config, remote); } // remove as the module may be invalid @@ -48868,7 +48710,7 @@ let fetchOneRemote = exports.fetchOneRemote = (() => { } }); - return function fetchOneRemote(_x4, _x5, _x6, _x7, _x8) { + return function fetchOneRemote(_x5, _x6, _x7, _x8, _x9) { return _ref3.apply(this, arguments); }; })(); @@ -48887,7 +48729,7 @@ let maybeFetchOne = (() => { } }); - return function maybeFetchOne(_x9, _x10) { + return function maybeFetchOne(_x10, _x11) { return _ref4.apply(this, arguments); }; })(); @@ -48903,25 +48745,27 @@ function _load_errors() { var _index; function _load_index() { - return _index = _interopRequireWildcard(__webpack_require__(552)); + return _index = _interopRequireWildcard(__webpack_require__(520)); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(50)); + return _promise = _interopRequireWildcard(__webpack_require__(51)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const ssri = __webpack_require__(65); + function fetchOne(ref, config) { const dest = config.generateModuleCachePath(ref); @@ -48993,14 +48837,14 @@ function fetch(pkgs, config) { return pkg; }); - return function (_x11) { + return function (_x12) { return _ref5.apply(this, arguments); }; })(), config.networkConcurrency); } /***/ }), -/* 211 */ +/* 209 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -49041,7 +48885,7 @@ let linkBin = exports.linkBin = (() => { var _packageHoister; function _load_packageHoister() { - return _packageHoister = _interopRequireDefault(__webpack_require__(556)); + return _packageHoister = _interopRequireDefault(__webpack_require__(524)); } var _constants; @@ -49053,7 +48897,7 @@ function _load_constants() { var _promise; function _load_promise() { - return _promise = _interopRequireWildcard(__webpack_require__(50)); + return _promise = _interopRequireWildcard(__webpack_require__(51)); } var _normalizePattern2; @@ -49071,19 +48915,19 @@ function _load_misc() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _mutex; function _load_mutex() { - return _mutex = _interopRequireDefault(__webpack_require__(375)); + return _mutex = _interopRequireDefault(__webpack_require__(369)); } var _semver; function _load_semver() { - return _semver = __webpack_require__(224); + return _semver = __webpack_require__(170); } var _workspaceLayout; @@ -49098,9 +48942,9 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const invariant = __webpack_require__(9); -const cmdShim = __webpack_require__(201); +const cmdShim = __webpack_require__(202); const path = __webpack_require__(0); -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); // Concurrency for creating bin links disabled because of the issue #1961 const linkBinConcurrency = 1; @@ -49386,10 +49230,6 @@ class PackageLinker { } else if (workspaceLayout && remote.type === 'workspace' && !isShallow) { src = remote.reference; type = 'symlink'; - if (dest.indexOf(workspaceLayout.virtualManifestName) !== -1) { - // we don't need to install virtual manifest - continue; - } // to get real path for non hoisted dependencies symlinkPaths.set(dest, src); } else { @@ -49566,6 +49406,10 @@ class PackageLinker { possibleExtraneous.add(path.join(filepath, subfile)); } + } else if (file[0] === '.' && file !== '.bin') { + if (!(yield (_fs || _load_fs()).lstat(filepath)).isDirectory()) { + possibleExtraneous.add(filepath); + } } else { possibleExtraneous.add(filepath); } @@ -50140,7 +49984,7 @@ class PackageLinker { exports.default = PackageLinker; /***/ }), -/* 212 */ +/* 210 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50162,7 +50006,7 @@ function _load_tty() { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const readline = __webpack_require__(197); +const readline = __webpack_require__(198); var _require = __webpack_require__(30); @@ -50231,7 +50075,7 @@ function clearNthLine(stdout, n) { } /***/ }), -/* 213 */ +/* 211 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50244,7 +50088,7 @@ Object.defineProperty(exports, "__esModule", { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _baseReporter; @@ -50425,7 +50269,7 @@ class JSONReporter extends (_baseReporter || _load_baseReporter()).default { exports.default = JSONReporter; /***/ }), -/* 214 */ +/* 212 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50439,7 +50283,7 @@ exports.shouldUpdateLockfile = undefined; var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); + return _semver = _interopRequireDefault(__webpack_require__(22)); } var _minimatch; @@ -50463,13 +50307,13 @@ function _load_normalizePattern() { var _parsePackagePath; function _load_parsePackagePath() { - return _parsePackagePath = _interopRequireDefault(__webpack_require__(376)); + return _parsePackagePath = _interopRequireDefault(__webpack_require__(370)); } var _parsePackagePath2; function _load_parsePackagePath2() { - return _parsePackagePath2 = __webpack_require__(376); + return _parsePackagePath2 = __webpack_require__(370); } var _resolvers; @@ -50573,7 +50417,7 @@ const shouldUpdateLockfile = exports.shouldUpdateLockfile = (lockfileEntry, reso }; /***/ }), -/* 215 */ +/* 213 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50605,7 +50449,7 @@ function _load_invariant() { var _uuid; function _load_uuid() { - return _uuid = _interopRequireDefault(__webpack_require__(119)); + return _uuid = _interopRequireDefault(__webpack_require__(120)); } var _errors; @@ -50629,7 +50473,7 @@ function _load_misc() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -50711,7 +50555,7 @@ FileResolver.protocol = 'file'; FileResolver.prefixMatcher = /^\.{1,2}\//; /***/ }), -/* 216 */ +/* 214 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50787,7 +50631,7 @@ exports.default = GistResolver; GistResolver.protocol = 'gist'; /***/ }), -/* 217 */ +/* 215 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -50806,7 +50650,7 @@ function _load_asyncToGenerator() { var _cache; function _load_cache() { - return _cache = __webpack_require__(355); + return _cache = __webpack_require__(349); } var _errors; @@ -50818,7 +50662,7 @@ function _load_errors() { var _registryResolver; function _load_registryResolver() { - return _registryResolver = _interopRequireDefault(__webpack_require__(575)); + return _registryResolver = _interopRequireDefault(__webpack_require__(543)); } var _npmRegistry; @@ -50836,7 +50680,7 @@ function _load_map() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _constants; @@ -50848,7 +50692,7 @@ function _load_constants() { var _packageNameUtils; function _load_packageNameUtils() { - return _packageNameUtils = __webpack_require__(222); + return _packageNameUtils = __webpack_require__(220); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -50858,8 +50702,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const inquirer = __webpack_require__(276); const tty = __webpack_require__(104); const path = __webpack_require__(0); -const semver = __webpack_require__(21); -const ssri = __webpack_require__(77); +const semver = __webpack_require__(22); +const ssri = __webpack_require__(65); const NPM_REGISTRY_ID = 'npm'; @@ -51076,7 +50920,7 @@ exports.default = NpmResolver; NpmResolver.registry = NPM_REGISTRY_ID; /***/ }), -/* 218 */ +/* 216 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51156,19 +51000,19 @@ let fixTimes = (() => { var _fs; function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(5)); + return _fs = _interopRequireDefault(__webpack_require__(4)); } var _promise; function _load_promise() { - return _promise = __webpack_require__(50); + return _promise = __webpack_require__(51); } var _fs2; function _load_fs2() { - return _fs2 = __webpack_require__(4); + return _fs2 = __webpack_require__(5); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -51274,7 +51118,7 @@ const copyWithBuffer = (() => { }; /***/ }), -/* 219 */ +/* 217 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51293,7 +51137,7 @@ function _load_asyncToGenerator() { var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _invariant; @@ -51311,7 +51155,7 @@ function _load_string_decoder() { var _tarFs; function _load_tarFs() { - return _tarFs = _interopRequireDefault(__webpack_require__(193)); + return _tarFs = _interopRequireDefault(__webpack_require__(194)); } var _tarStream; @@ -51329,7 +51173,7 @@ function _load_url() { var _fs; function _load_fs() { - return _fs = __webpack_require__(5); + return _fs = __webpack_require__(4); } var _errors; @@ -51341,13 +51185,13 @@ function _load_errors() { var _gitSpawn; function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(373); + return _gitSpawn = __webpack_require__(367); } var _gitRefResolver; function _load_gitRefResolver() { - return _gitRefResolver = __webpack_require__(581); + return _gitRefResolver = __webpack_require__(549); } var _crypto; @@ -51359,7 +51203,7 @@ function _load_crypto() { var _fs2; function _load_fs2() { - return _fs2 = _interopRequireWildcard(__webpack_require__(4)); + return _fs2 = _interopRequireWildcard(__webpack_require__(5)); } var _map; @@ -51918,7 +51762,7 @@ class Git { exports.default = Git; /***/ }), -/* 220 */ +/* 218 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -51937,7 +51781,7 @@ function _load_asyncToGenerator() { var _resolveRelative; function _load_resolveRelative() { - return _resolveRelative = _interopRequireDefault(__webpack_require__(586)); + return _resolveRelative = _interopRequireDefault(__webpack_require__(554)); } var _validate; @@ -51949,7 +51793,7 @@ function _load_validate() { var _fix; function _load_fix() { - return _fix = _interopRequireDefault(__webpack_require__(583)); + return _fix = _interopRequireDefault(__webpack_require__(551)); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -52005,7 +51849,7 @@ exports.default = (() => { })(); /***/ }), -/* 221 */ +/* 219 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52015,6 +51859,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.isValidLicense = isValidLicense; +exports.isValidBin = isValidBin; exports.stringifyPerson = stringifyPerson; exports.parsePerson = parsePerson; exports.normalizePerson = normalizePerson; @@ -52022,12 +51867,20 @@ exports.extractDescription = extractDescription; exports.extractRepositoryUrl = extractRepositoryUrl; +const path = __webpack_require__(0); + const validateLicense = __webpack_require__(959); +const PARENT_PATH = /^\.\.([\\\/]|$)/; + function isValidLicense(license) { return !!license && validateLicense(license).validForNewPackages; } +function isValidBin(bin) { + return !path.isAbsolute(bin) && !PARENT_PATH.test(path.normalize(bin)); +} + function stringifyPerson(person) { if (!person || typeof person !== 'object') { return person; @@ -52125,7 +51978,7 @@ function extractRepositoryUrl(repository) { } /***/ }), -/* 222 */ +/* 220 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52149,7 +52002,7 @@ function getSystemParams() { } /***/ }), -/* 223 */ +/* 221 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52177,140 +52030,7 @@ function isRootUser(uid) { } /***/ }), -/* 224 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.satisfiesWithPrereleases = satisfiesWithPrereleases; -exports.diffWithUnstable = diffWithUnstable; - -var _semver; - -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); -} - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -/** - * Returns whether the given semver version satisfies the given range. Notably this supports - * prerelease versions so that "2.0.0-rc.0" satisfies the range ">=1.0.0", for example. - */ - -function satisfiesWithPrereleases(version, range, loose = false) { - let semverRange; - try { - // $FlowFixMe: Add a definition for the Range class - semverRange = new (_semver || _load_semver()).default.Range(range, loose); - } catch (err) { - return false; - } - - if (!version) { - return false; - } - let semverVersion; - try { - semverVersion = new (_semver || _load_semver()).default.SemVer(version, semverRange.loose); - } catch (err) { - return false; - } - - // A range has multiple sets of comparators. A version must satisfy all comparators in a set - // and at least one set to satisfy the range. - return semverRange.set.some(comparatorSet => { - // node-semver converts ~ and ^ ranges into pairs of >= and < ranges but the upper bounds don't - // properly exclude prerelease versions. For example, "^1.0.0" is converted to ">=1.0.0 <2.0.0", - // which includes "2.0.0-pre" since prerelease versions are lower than their non-prerelease - // counterparts. As a practical workaround we make upper-bound ranges exclude prereleases and - // convert "<2.0.0" to "<2.0.0-0", for example. - comparatorSet = comparatorSet.map(comparator => { - if (comparator.operator !== '<' || !comparator.value || comparator.semver.prerelease.length) { - return comparator; - } - - // "0" is the lowest prerelease version - comparator.semver.inc('pre', 0); - - const comparatorString = comparator.operator + comparator.semver.version; - // $FlowFixMe: Add a definition for the Comparator class - return new (_semver || _load_semver()).default.Comparator(comparatorString, comparator.loose); - }); - - return !comparatorSet.some(comparator => !comparator.test(semverVersion)); - }); -} - -const PRE_RELEASES = { - major: 'premajor', - minor: 'preminor', - patch: 'prepatch' -}; - -/** - * Returns the difference between two versions as a semantic string representation. - * Similar to the `diff` method in node-semver, but it also accounts for unstable versions, - * like 0.x.x or 0.0.x. - */ - -function diffWithUnstable(version1, version2) { - if ((_semver || _load_semver()).default.eq(version1, version2) === false) { - const v1 = (_semver || _load_semver()).default.parse(version1); - const v2 = (_semver || _load_semver()).default.parse(version2); - - if (v1 != null && v2 != null) { - const isPreRelease = v1.prerelease.length > 0 || v2.prerelease.length > 0; - const preMajor = v1.major === 0 || v2.major === 0; - const preMinor = preMajor && (v1.minor === 0 || v2.minor === 0); - - let diff = null; - - if (v1.major !== v2.major) { - diff = 'major'; - } else if (v1.minor !== v2.minor) { - if (preMajor) { - // If the major version number is zero (0.x.x), treat a change - // of the minor version number as a major change. - diff = 'major'; - } else { - diff = 'minor'; - } - } else if (v1.patch !== v2.patch) { - if (preMinor) { - // If the major & minor version numbers are zero (0.0.x), treat a change - // of the patch version number as a major change. - diff = 'major'; - } else if (preMajor) { - // If the major version number is zero (0.x.x), treat a change - // of the patch version number as a minor change. - diff = 'minor'; - } else { - diff = 'patch'; - } - } - - if (isPreRelease) { - if (diff != null) { - diff = PRE_RELEASES[diff]; - } else { - diff = 'prerelease'; - } - } - - return diff; - } - } - - return null; -} - -/***/ }), -/* 225 */ +/* 222 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52323,7 +52043,7 @@ exports.getDataDir = getDataDir; exports.getCacheDir = getCacheDir; exports.getConfigDir = getConfigDir; const path = __webpack_require__(0); -const userHome = __webpack_require__(66).default; +const userHome = __webpack_require__(67).default; const FALLBACK_CONFIG_DIR = path.join(userHome, '.config', 'yarn'); const FALLBACK_CACHE_DIR = path.join(userHome, '.cache', 'yarn'); @@ -52376,7 +52096,7 @@ function getLocalAppDataDir() { } /***/ }), -/* 226 */ +/* 223 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52396,13 +52116,13 @@ function explodeHashedUrl(url) { } /***/ }), -/* 227 */ +/* 224 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = { "default": __webpack_require__(233), __esModule: true }; +module.exports = { "default": __webpack_require__(230), __esModule: true }; /***/ }), -/* 228 */ +/* 225 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52468,11 +52188,11 @@ function range(a, b, str) { /***/ }), -/* 229 */ +/* 226 */ /***/ (function(module, exports, __webpack_require__) { -var concatMap = __webpack_require__(232); -var balanced = __webpack_require__(228); +var concatMap = __webpack_require__(229); +var balanced = __webpack_require__(225); module.exports = expandTop; @@ -52675,7 +52395,7 @@ function expand(str, isTop) { /***/ }), -/* 230 */ +/* 227 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -52746,7 +52466,7 @@ module.exports = function (str) { /***/ }), -/* 231 */ +/* 228 */ /***/ (function(module, exports) { function Caseless (dict) { @@ -52819,7 +52539,7 @@ module.exports.httpify = function (resp, headers) { /***/ }), -/* 232 */ +/* 229 */ /***/ (function(module, exports) { module.exports = function (xs, fn) { @@ -52838,27 +52558,27 @@ var isArray = Array.isArray || function (xs) { /***/ }), -/* 233 */ +/* 230 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(259); +__webpack_require__(256); +__webpack_require__(258); __webpack_require__(261); -__webpack_require__(264); +__webpack_require__(257); +__webpack_require__(259); __webpack_require__(260); -__webpack_require__(262); -__webpack_require__(263); module.exports = __webpack_require__(31).Promise; /***/ }), -/* 234 */ +/* 231 */ /***/ (function(module, exports) { module.exports = function () { /* empty */ }; /***/ }), -/* 235 */ +/* 232 */ /***/ (function(module, exports) { module.exports = function (it, Constructor, name, forbiddenField) { @@ -52869,14 +52589,14 @@ module.exports = function (it, Constructor, name, forbiddenField) { /***/ }), -/* 236 */ +/* 233 */ /***/ (function(module, exports, __webpack_require__) { // false -> Array#indexOf // true -> Array#includes var toIObject = __webpack_require__(98); var toLength = __webpack_require__(136); -var toAbsoluteIndex = __webpack_require__(254); +var toAbsoluteIndex = __webpack_require__(251); module.exports = function (IS_INCLUDES) { return function ($this, el, fromIndex) { var O = toIObject($this); @@ -52898,15 +52618,15 @@ module.exports = function (IS_INCLUDES) { /***/ }), -/* 237 */ +/* 234 */ /***/ (function(module, exports, __webpack_require__) { -var ctx = __webpack_require__(69); -var call = __webpack_require__(241); -var isArrayIter = __webpack_require__(240); +var ctx = __webpack_require__(70); +var call = __webpack_require__(238); +var isArrayIter = __webpack_require__(237); var anObject = __webpack_require__(35); var toLength = __webpack_require__(136); -var getIterFn = __webpack_require__(257); +var getIterFn = __webpack_require__(254); var BREAK = {}; var RETURN = {}; var exports = module.exports = function (iterable, entries, fn, that, ITERATOR) { @@ -52929,16 +52649,16 @@ exports.RETURN = RETURN; /***/ }), -/* 238 */ +/* 235 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = !__webpack_require__(51) && !__webpack_require__(112)(function () { +module.exports = !__webpack_require__(52) && !__webpack_require__(112)(function () { return Object.defineProperty(__webpack_require__(92)('div'), 'a', { get: function () { return 7; } }).a != 7; }); /***/ }), -/* 239 */ +/* 236 */ /***/ (function(module, exports) { // fast apply, http://jsperf.lnkit.com/fast-apply/5 @@ -52960,12 +52680,12 @@ module.exports = function (fn, args, that) { /***/ }), -/* 240 */ +/* 237 */ /***/ (function(module, exports, __webpack_require__) { // check on default Array iterator -var Iterators = __webpack_require__(53); -var ITERATOR = __webpack_require__(20)('iterator'); +var Iterators = __webpack_require__(54); +var ITERATOR = __webpack_require__(21)('iterator'); var ArrayProto = Array.prototype; module.exports = function (it) { @@ -52974,7 +52694,7 @@ module.exports = function (it) { /***/ }), -/* 241 */ +/* 238 */ /***/ (function(module, exports, __webpack_require__) { // call something on iterator step with safe closing on error @@ -52992,18 +52712,18 @@ module.exports = function (iterator, fn, value, entries) { /***/ }), -/* 242 */ +/* 239 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var create = __webpack_require__(246); +var create = __webpack_require__(243); var descriptor = __webpack_require__(132); var setToStringTag = __webpack_require__(95); var IteratorPrototype = {}; // 25.1.2.1.1 %IteratorPrototype%[@@iterator]() -__webpack_require__(42)(IteratorPrototype, __webpack_require__(20)('iterator'), function () { return this; }); +__webpack_require__(42)(IteratorPrototype, __webpack_require__(21)('iterator'), function () { return this; }); module.exports = function (Constructor, NAME, next) { Constructor.prototype = create(IteratorPrototype, { next: descriptor(1, next) }); @@ -53012,10 +52732,10 @@ module.exports = function (Constructor, NAME, next) { /***/ }), -/* 243 */ +/* 240 */ /***/ (function(module, exports, __webpack_require__) { -var ITERATOR = __webpack_require__(20)('iterator'); +var ITERATOR = __webpack_require__(21)('iterator'); var SAFE_CLOSING = false; try { @@ -53040,7 +52760,7 @@ module.exports = function (exec, skipClosing) { /***/ }), -/* 244 */ +/* 241 */ /***/ (function(module, exports) { module.exports = function (done, value) { @@ -53049,7 +52769,7 @@ module.exports = function (done, value) { /***/ }), -/* 245 */ +/* 242 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(17); @@ -53057,7 +52777,7 @@ var macrotask = __webpack_require__(135).set; var Observer = global.MutationObserver || global.WebKitMutationObserver; var process = global.process; var Promise = global.Promise; -var isNode = __webpack_require__(68)(process) == 'process'; +var isNode = __webpack_require__(69)(process) == 'process'; module.exports = function () { var head, last, notify; @@ -53124,12 +52844,12 @@ module.exports = function () { /***/ }), -/* 246 */ +/* 243 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.2 / 15.2.3.5 Object.create(O [, Properties]) var anObject = __webpack_require__(35); -var dPs = __webpack_require__(247); +var dPs = __webpack_require__(244); var enumBugKeys = __webpack_require__(127); var IE_PROTO = __webpack_require__(96)('IE_PROTO'); var Empty = function () { /* empty */ }; @@ -53171,14 +52891,14 @@ module.exports = Object.create || function create(O, Properties) { /***/ }), -/* 247 */ +/* 244 */ /***/ (function(module, exports, __webpack_require__) { -var dP = __webpack_require__(71); +var dP = __webpack_require__(72); var anObject = __webpack_require__(35); -var getKeys = __webpack_require__(171); +var getKeys = __webpack_require__(172); -module.exports = __webpack_require__(51) ? Object.defineProperties : function defineProperties(O, Properties) { +module.exports = __webpack_require__(52) ? Object.defineProperties : function defineProperties(O, Properties) { anObject(O); var keys = getKeys(Properties); var length = keys.length; @@ -53190,12 +52910,12 @@ module.exports = __webpack_require__(51) ? Object.defineProperties : function de /***/ }), -/* 248 */ +/* 245 */ /***/ (function(module, exports, __webpack_require__) { // 19.1.2.9 / 15.2.3.2 Object.getPrototypeOf(O) -var has = __webpack_require__(70); -var toObject = __webpack_require__(172); +var has = __webpack_require__(71); +var toObject = __webpack_require__(173); var IE_PROTO = __webpack_require__(96)('IE_PROTO'); var ObjectProto = Object.prototype; @@ -53209,12 +52929,12 @@ module.exports = Object.getPrototypeOf || function (O) { /***/ }), -/* 249 */ +/* 246 */ /***/ (function(module, exports, __webpack_require__) { -var has = __webpack_require__(70); +var has = __webpack_require__(71); var toIObject = __webpack_require__(98); -var arrayIndexOf = __webpack_require__(236)(false); +var arrayIndexOf = __webpack_require__(233)(false); var IE_PROTO = __webpack_require__(96)('IE_PROTO'); module.exports = function (object, names) { @@ -53232,7 +52952,7 @@ module.exports = function (object, names) { /***/ }), -/* 250 */ +/* 247 */ /***/ (function(module, exports, __webpack_require__) { var hide = __webpack_require__(42); @@ -53245,23 +52965,23 @@ module.exports = function (target, src, safe) { /***/ }), -/* 251 */ +/* 248 */ /***/ (function(module, exports, __webpack_require__) { module.exports = __webpack_require__(42); /***/ }), -/* 252 */ +/* 249 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var global = __webpack_require__(17); var core = __webpack_require__(31); -var dP = __webpack_require__(71); -var DESCRIPTORS = __webpack_require__(51); -var SPECIES = __webpack_require__(20)('species'); +var dP = __webpack_require__(72); +var DESCRIPTORS = __webpack_require__(52); +var SPECIES = __webpack_require__(21)('species'); module.exports = function (KEY) { var C = typeof core[KEY] == 'function' ? core[KEY] : global[KEY]; @@ -53273,7 +52993,7 @@ module.exports = function (KEY) { /***/ }), -/* 253 */ +/* 250 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(97); @@ -53296,7 +53016,7 @@ module.exports = function (TO_STRING) { /***/ }), -/* 254 */ +/* 251 */ /***/ (function(module, exports, __webpack_require__) { var toInteger = __webpack_require__(97); @@ -53309,11 +53029,11 @@ module.exports = function (index, length) { /***/ }), -/* 255 */ +/* 252 */ /***/ (function(module, exports, __webpack_require__) { // 7.1.1 ToPrimitive(input [, PreferredType]) -var isObject = __webpack_require__(52); +var isObject = __webpack_require__(53); // instead of the ES6 spec version, we didn't implement @@toPrimitive case // and the second argument - flag - preferred type is a string module.exports = function (it, S) { @@ -53327,7 +53047,7 @@ module.exports = function (it, S) { /***/ }), -/* 256 */ +/* 253 */ /***/ (function(module, exports, __webpack_require__) { var global = __webpack_require__(17); @@ -53337,12 +53057,12 @@ module.exports = navigator && navigator.userAgent || ''; /***/ }), -/* 257 */ +/* 254 */ /***/ (function(module, exports, __webpack_require__) { var classof = __webpack_require__(126); -var ITERATOR = __webpack_require__(20)('iterator'); -var Iterators = __webpack_require__(53); +var ITERATOR = __webpack_require__(21)('iterator'); +var Iterators = __webpack_require__(54); module.exports = __webpack_require__(31).getIteratorMethod = function (it) { if (it != undefined) return it[ITERATOR] || it['@@iterator'] @@ -53351,14 +53071,14 @@ module.exports = __webpack_require__(31).getIteratorMethod = function (it) { /***/ }), -/* 258 */ +/* 255 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var addToUnscopables = __webpack_require__(234); -var step = __webpack_require__(244); -var Iterators = __webpack_require__(53); +var addToUnscopables = __webpack_require__(231); +var step = __webpack_require__(241); +var Iterators = __webpack_require__(54); var toIObject = __webpack_require__(98); // 22.1.3.4 Array.prototype.entries() @@ -53392,32 +53112,32 @@ addToUnscopables('entries'); /***/ }), -/* 259 */ +/* 256 */ /***/ (function(module, exports) { /***/ }), -/* 260 */ +/* 257 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var LIBRARY = __webpack_require__(93); var global = __webpack_require__(17); -var ctx = __webpack_require__(69); +var ctx = __webpack_require__(70); var classof = __webpack_require__(126); var $export = __webpack_require__(60); -var isObject = __webpack_require__(52); -var aFunction = __webpack_require__(67); -var anInstance = __webpack_require__(235); -var forOf = __webpack_require__(237); +var isObject = __webpack_require__(53); +var aFunction = __webpack_require__(68); +var anInstance = __webpack_require__(232); +var forOf = __webpack_require__(234); var speciesConstructor = __webpack_require__(134); var task = __webpack_require__(135).set; -var microtask = __webpack_require__(245)(); +var microtask = __webpack_require__(242)(); var newPromiseCapabilityModule = __webpack_require__(94); var perform = __webpack_require__(130); -var userAgent = __webpack_require__(256); +var userAgent = __webpack_require__(253); var promiseResolve = __webpack_require__(131); var PROMISE = 'Promise'; var TypeError = global.TypeError; @@ -53434,7 +53154,7 @@ var USE_NATIVE = !!function () { try { // correct subclassing with @@species support var promise = $Promise.resolve(1); - var FakePromise = (promise.constructor = {})[__webpack_require__(20)('species')] = function (exec) { + var FakePromise = (promise.constructor = {})[__webpack_require__(21)('species')] = function (exec) { exec(empty, empty); }; // unhandled rejections tracking support, NodeJS Promise without it fails @@species test @@ -53593,7 +53313,7 @@ if (!USE_NATIVE) { this._h = 0; // <- rejection state, 0 - default, 1 - handled, 2 - unhandled this._n = false; // <- notify }; - Internal.prototype = __webpack_require__(250)($Promise.prototype, { + Internal.prototype = __webpack_require__(247)($Promise.prototype, { // 25.4.5.3 Promise.prototype.then(onFulfilled, onRejected) then: function then(onFulfilled, onRejected) { var reaction = newPromiseCapability(speciesConstructor(this, $Promise)); @@ -53625,7 +53345,7 @@ if (!USE_NATIVE) { $export($export.G + $export.W + $export.F * !USE_NATIVE, { Promise: $Promise }); __webpack_require__(95)($Promise, PROMISE); -__webpack_require__(252)(PROMISE); +__webpack_require__(249)(PROMISE); Wrapper = __webpack_require__(31)[PROMISE]; // statics @@ -53644,7 +53364,7 @@ $export($export.S + $export.F * (LIBRARY || !USE_NATIVE), PROMISE, { return promiseResolve(LIBRARY && this === Wrapper ? $Promise : this, x); } }); -$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(243)(function (iter) { +$export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(240)(function (iter) { $Promise.all(iter)['catch'](empty); })), PROMISE, { // 25.4.4.1 Promise.all(iterable) @@ -53691,12 +53411,12 @@ $export($export.S + $export.F * !(USE_NATIVE && __webpack_require__(243)(functio /***/ }), -/* 261 */ +/* 258 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var $at = __webpack_require__(253)(true); +var $at = __webpack_require__(250)(true); // 21.1.3.27 String.prototype[@@iterator]() __webpack_require__(129)(String, 'String', function (iterated) { @@ -53715,7 +53435,7 @@ __webpack_require__(129)(String, 'String', function (iterated) { /***/ }), -/* 262 */ +/* 259 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53742,7 +53462,7 @@ $export($export.P + $export.R, 'Promise', { 'finally': function (onFinally) { /***/ }), -/* 263 */ +/* 260 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -53761,14 +53481,14 @@ $export($export.S, 'Promise', { 'try': function (callbackfn) { /***/ }), -/* 264 */ +/* 261 */ /***/ (function(module, exports, __webpack_require__) { -__webpack_require__(258); +__webpack_require__(255); var global = __webpack_require__(17); var hide = __webpack_require__(42); -var Iterators = __webpack_require__(53); -var TO_STRING_TAG = __webpack_require__(20)('toStringTag'); +var Iterators = __webpack_require__(54); +var TO_STRING_TAG = __webpack_require__(21)('toStringTag'); var DOMIterables = ('CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,' + 'DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,' + @@ -53786,7 +53506,7 @@ for (var i = 0; i < DOMIterables.length; i++) { /***/ }), -/* 265 */ +/* 262 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53987,7 +53707,7 @@ function localstorage() { /***/ }), -/* 266 */ +/* 263 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -53996,14 +53716,14 @@ function localstorage() { */ if (typeof process === 'undefined' || process.type === 'renderer') { - module.exports = __webpack_require__(265); + module.exports = __webpack_require__(262); } else { - module.exports = __webpack_require__(267); + module.exports = __webpack_require__(264); } /***/ }), -/* 267 */ +/* 264 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -54195,7 +53915,7 @@ exports.enable(load()); /***/ }), -/* 268 */ +/* 265 */ /***/ (function(module, exports, __webpack_require__) { (function webpackUniversalModuleDefinition(root, factory) { @@ -60909,7 +60629,7 @@ return /******/ (function(modules) { // webpackBootstrap ; /***/ }), -/* 269 */ +/* 266 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61033,12 +60753,12 @@ module.exports = function extend() { /***/ }), -/* 270 */ +/* 267 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const escapeStringRegexp = __webpack_require__(388); +const escapeStringRegexp = __webpack_require__(382); const platform = process.platform; @@ -61187,7 +60907,7 @@ module.exports = Object.assign(fn, figures); /***/ }), -/* 271 */ +/* 268 */ /***/ (function(module, exports, __webpack_require__) { // Copyright Joyent, Inc. and other Node contributors. @@ -61213,7 +60933,7 @@ module.exports = Object.assign(fn, figures); var pathModule = __webpack_require__(0); var isWindows = process.platform === 'win32'; -var fs = __webpack_require__(5); +var fs = __webpack_require__(4); // JavaScript implementation of realpath, ported from node pre-v6 @@ -61496,13 +61216,13 @@ exports.realpath = function realpath(p, cache, cb) { /***/ }), -/* 272 */ +/* 269 */ /***/ (function(module, exports, __webpack_require__) { module.exports = globSync globSync.GlobSync = GlobSync -var fs = __webpack_require__(5) +var fs = __webpack_require__(4) var rp = __webpack_require__(140) var minimatch = __webpack_require__(82) var Minimatch = minimatch.Minimatch @@ -61987,6 +61707,387 @@ GlobSync.prototype._makeAbs = function (f) { } +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var resolve = __webpack_require__(271); + +module.exports = { + Validation: errorSubclass(ValidationError), + MissingRef: errorSubclass(MissingRefError) +}; + + +function ValidationError(errors) { + this.message = 'validation failed'; + this.errors = errors; + this.ajv = this.validation = true; +} + + +MissingRefError.message = function (baseId, ref) { + return 'can\'t resolve reference ' + ref + ' from id ' + baseId; +}; + + +function MissingRefError(baseId, ref, message) { + this.message = message || MissingRefError.message(baseId, ref); + this.missingRef = resolve.url(baseId, ref); + this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef)); +} + + +function errorSubclass(Subclass) { + Subclass.prototype = Object.create(Error.prototype); + Subclass.prototype.constructor = Subclass; + return Subclass; +} + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var url = __webpack_require__(24) + , equal = __webpack_require__(272) + , util = __webpack_require__(114) + , SchemaObject = __webpack_require__(386) + , traverse = __webpack_require__(677); + +module.exports = resolve; + +resolve.normalizeId = normalizeId; +resolve.fullPath = getFullPath; +resolve.url = resolveUrl; +resolve.ids = resolveIds; +resolve.inlineRef = inlineRef; +resolve.schema = resolveSchema; + +/** + * [resolve and compile the references ($ref)] + * @this Ajv + * @param {Function} compile reference to schema compilation funciton (localCompile) + * @param {Object} root object with information about the root schema for the current schema + * @param {String} ref reference to resolve + * @return {Object|Function} schema object (if the schema can be inlined) or validation function + */ +function resolve(compile, root, ref) { + /* jshint validthis: true */ + var refVal = this._refs[ref]; + if (typeof refVal == 'string') { + if (this._refs[refVal]) refVal = this._refs[refVal]; + else return resolve.call(this, compile, root, refVal); + } + + refVal = refVal || this._schemas[ref]; + if (refVal instanceof SchemaObject) { + return inlineRef(refVal.schema, this._opts.inlineRefs) + ? refVal.schema + : refVal.validate || this._compile(refVal); + } + + var res = resolveSchema.call(this, root, ref); + var schema, v, baseId; + if (res) { + schema = res.schema; + root = res.root; + baseId = res.baseId; + } + + if (schema instanceof SchemaObject) { + v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId); + } else if (schema !== undefined) { + v = inlineRef(schema, this._opts.inlineRefs) + ? schema + : compile.call(this, schema, root, undefined, baseId); + } + + return v; +} + + +/** + * Resolve schema, its root and baseId + * @this Ajv + * @param {Object} root root object with properties schema, refVal, refs + * @param {String} ref reference to resolve + * @return {Object} object with properties schema, root, baseId + */ +function resolveSchema(root, ref) { + /* jshint validthis: true */ + var p = url.parse(ref, false, true) + , refPath = _getFullPath(p) + , baseId = getFullPath(this._getId(root.schema)); + if (refPath !== baseId) { + var id = normalizeId(refPath); + var refVal = this._refs[id]; + if (typeof refVal == 'string') { + return resolveRecursive.call(this, root, refVal, p); + } else if (refVal instanceof SchemaObject) { + if (!refVal.validate) this._compile(refVal); + root = refVal; + } else { + refVal = this._schemas[id]; + if (refVal instanceof SchemaObject) { + if (!refVal.validate) this._compile(refVal); + if (id == normalizeId(ref)) + return { schema: refVal, root: root, baseId: baseId }; + root = refVal; + } else { + return; + } + } + if (!root.schema) return; + baseId = getFullPath(this._getId(root.schema)); + } + return getJsonPointer.call(this, p, baseId, root.schema, root); +} + + +/* @this Ajv */ +function resolveRecursive(root, ref, parsedRef) { + /* jshint validthis: true */ + var res = resolveSchema.call(this, root, ref); + if (res) { + var schema = res.schema; + var baseId = res.baseId; + root = res.root; + var id = this._getId(schema); + if (id) baseId = resolveUrl(baseId, id); + return getJsonPointer.call(this, parsedRef, baseId, schema, root); + } +} + + +var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']); +/* @this Ajv */ +function getJsonPointer(parsedRef, baseId, schema, root) { + /* jshint validthis: true */ + parsedRef.hash = parsedRef.hash || ''; + if (parsedRef.hash.slice(0,2) != '#/') return; + var parts = parsedRef.hash.split('/'); + + for (var i = 1; i < parts.length; i++) { + var part = parts[i]; + if (part) { + part = util.unescapeFragment(part); + schema = schema[part]; + if (schema === undefined) break; + var id; + if (!PREVENT_SCOPE_CHANGE[part]) { + id = this._getId(schema); + if (id) baseId = resolveUrl(baseId, id); + if (schema.$ref) { + var $ref = resolveUrl(baseId, schema.$ref); + var res = resolveSchema.call(this, root, $ref); + if (res) { + schema = res.schema; + root = res.root; + baseId = res.baseId; + } + } + } + } + } + if (schema !== undefined && schema !== root.schema) + return { schema: schema, root: root, baseId: baseId }; +} + + +var SIMPLE_INLINED = util.toHash([ + 'type', 'format', 'pattern', + 'maxLength', 'minLength', + 'maxProperties', 'minProperties', + 'maxItems', 'minItems', + 'maximum', 'minimum', + 'uniqueItems', 'multipleOf', + 'required', 'enum' +]); +function inlineRef(schema, limit) { + if (limit === false) return false; + if (limit === undefined || limit === true) return checkNoRef(schema); + else if (limit) return countKeys(schema) <= limit; +} + + +function checkNoRef(schema) { + var item; + if (Array.isArray(schema)) { + for (var i=0; i', - $notOp = $isMax ? '>' : '<', - $errorKeyword = undefined; - if ($isDataExcl) { - var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), - $exclusive = 'exclusive' + $lvl, - $exclType = 'exclType' + $lvl, - $exclIsNumber = 'exclIsNumber' + $lvl, - $opExpr = 'op' + $lvl, - $opStr = '\' + ' + $opExpr + ' + \''; - out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; - $schemaValueExcl = 'schemaExcl' + $lvl; - out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; - var $errorKeyword = $exclusiveKeyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; - } else { - var $exclIsNumber = typeof $schemaExcl == 'number', - $opStr = $op; - if ($exclIsNumber && $isData) { - var $opExpr = '\'' + $opStr + '\''; - out += ' if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; - } else { - if ($exclIsNumber && $schema === undefined) { - $exclusive = true; - $errorKeyword = $exclusiveKeyword; - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; - $schemaValue = $schemaExcl; - $notOp += '='; - } else { - if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); - if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { - $exclusive = true; - $errorKeyword = $exclusiveKeyword; - $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; - $notOp += '='; - } else { - $exclusive = false; - $opStr += '='; - } - } - var $opExpr = '\'' + $opStr + '\''; - out += ' if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; - } - } - $errorKeyword = $errorKeyword || $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be ' + ($opStr) + ' '; - if ($isData) { - out += '\' + ' + ($schemaValue); - } else { - out += '' + ($schemaValue) + '\''; - } - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 341 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitItems(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxItems' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have '; - if ($keyword == 'maxItems') { - out += 'more'; - } else { - out += 'less'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' items\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 342 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitLength(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxLength' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - if (it.opts.unicode === false) { - out += ' ' + ($data) + '.length '; - } else { - out += ' ucs2length(' + ($data) + ') '; - } - out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be '; - if ($keyword == 'maxLength') { - out += 'longer'; - } else { - out += 'shorter'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' characters\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 343 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate__limitProperties(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $op = $keyword == 'maxProperties' ? '>' : '<'; - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; - } - out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; - var $errorKeyword = $keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have '; - if ($keyword == 'maxProperties') { - out += 'more'; - } else { - out += 'less'; - } - out += ' than '; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + ($schema); - } - out += ' properties\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += '} '; - if ($breakOnError) { - out += ' else { '; - } - return out; -} - - -/***/ }), -/* 344 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - -module.exports = function generate_validate(it, $keyword, $ruleType) { - var out = ''; - var $async = it.schema.$async === true, - $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), - $id = it.self._getId(it.schema); - if (it.isTop) { - if ($async) { - it.async = true; - var $es7 = it.opts.async == 'es7'; - it.yieldAwait = $es7 ? 'await' : 'yield'; - } - out += ' var validate = '; - if ($async) { - if ($es7) { - out += ' (async function '; - } else { - if (it.opts.async != '*') { - out += 'co.wrap'; - } - out += '(function* '; - } - } else { - out += ' (function '; - } - out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; - if ($id && (it.opts.sourceCode || it.opts.processCode)) { - out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; - } - } - if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { - var $keyword = 'false schema'; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - if (it.schema === false) { - if (it.isTop) { - $breakOnError = true; - } else { - out += ' var ' + ($valid) + ' = false; '; - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'boolean schema is false\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } else { - if (it.isTop) { - if ($async) { - out += ' return data; '; - } else { - out += ' validate.errors = null; return true; '; - } - } else { - out += ' var ' + ($valid) + ' = true; '; - } - } - if (it.isTop) { - out += ' }); return validate; '; - } - return out; - } - if (it.isTop) { - var $top = it.isTop, - $lvl = it.level = 0, - $dataLvl = it.dataLevel = 0, - $data = 'data'; - it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); - it.baseId = it.baseId || it.rootId; - delete it.isTop; - it.dataPathArr = [undefined]; - out += ' var vErrors = null; '; - out += ' var errors = 0; '; - out += ' if (rootData === undefined) rootData = data; '; - } else { - var $lvl = it.level, - $dataLvl = it.dataLevel, - $data = 'data' + ($dataLvl || ''); - if ($id) it.baseId = it.resolve.url(it.baseId, $id); - if ($async && !it.async) throw new Error('async schema in sync schema'); - out += ' var errs_' + ($lvl) + ' = errors;'; - } - var $valid = 'valid' + $lvl, - $breakOnError = !it.opts.allErrors, - $closingBraces1 = '', - $closingBraces2 = ''; - var $errorKeyword; - var $typeSchema = it.schema.type, - $typeIsArray = Array.isArray($typeSchema); - if ($typeIsArray && $typeSchema.length == 1) { - $typeSchema = $typeSchema[0]; - $typeIsArray = false; - } - if (it.schema.$ref && $refKeywords) { - if (it.opts.extendRefs == 'fail') { - throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); - } else if (it.opts.extendRefs !== true) { - $refKeywords = false; - it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); - } - } - if ($typeSchema) { - if (it.opts.coerceTypes) { - var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); - } - var $rulesGroup = it.RULES.types[$typeSchema]; - if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type'; - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type', - $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; - out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; - if ($coerceToTypes) { - var $dataType = 'dataType' + $lvl, - $coerced = 'coerced' + $lvl; - out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; - if (it.opts.coerceTypes == 'array') { - out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; - } - out += ' var ' + ($coerced) + ' = undefined; '; - var $bracesCoercion = ''; - var arr1 = $coerceToTypes; - if (arr1) { - var $type, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $type = arr1[$i += 1]; - if ($i) { - out += ' if (' + ($coerced) + ' === undefined) { '; - $bracesCoercion += '}'; - } - if (it.opts.coerceTypes == 'array' && $type != 'array') { - out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; - } - if ($type == 'string') { - out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; - } else if ($type == 'number' || $type == 'integer') { - out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; - if ($type == 'integer') { - out += ' && !(' + ($data) + ' % 1)'; - } - out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; - } else if ($type == 'boolean') { - out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; - } else if ($type == 'null') { - out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; - } else if (it.opts.coerceTypes == 'array' && $type == 'array') { - out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; - } - } - } - out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' ' + ($data) + ' = ' + ($coerced) + '; '; - if (!$dataLvl) { - out += 'if (' + ($parentData) + ' !== undefined)'; - } - out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; - } else { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - } - out += ' } '; - } - } - if (it.schema.$ref && !$refKeywords) { - out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; - if ($breakOnError) { - out += ' } if (errors === '; - if ($top) { - out += '0'; - } else { - out += 'errs_' + ($lvl); - } - out += ') { '; - $closingBraces2 += '}'; - } - } else { - if (it.opts.v5 && it.schema.patternGroups) { - it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); - } - var arr2 = it.RULES; - if (arr2) { - var $rulesGroup, i2 = -1, - l2 = arr2.length - 1; - while (i2 < l2) { - $rulesGroup = arr2[i2 += 1]; - if ($shouldUseGroup($rulesGroup)) { - if ($rulesGroup.type) { - out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; - } - if (it.opts.useDefaults && !it.compositeRule) { - if ($rulesGroup.type == 'object' && it.schema.properties) { - var $schema = it.schema.properties, - $schemaKeys = Object.keys($schema); - var arr3 = $schemaKeys; - if (arr3) { - var $propertyKey, i3 = -1, - l3 = arr3.length - 1; - while (i3 < l3) { - $propertyKey = arr3[i3 += 1]; - var $sch = $schema[$propertyKey]; - if ($sch.default !== undefined) { - var $passData = $data + it.util.getProperty($propertyKey); - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; - } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; - } - out += '; '; - } - } - } - } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { - var arr4 = it.schema.items; - if (arr4) { - var $sch, $i = -1, - l4 = arr4.length - 1; - while ($i < l4) { - $sch = arr4[$i += 1]; - if ($sch.default !== undefined) { - var $passData = $data + '[' + $i + ']'; - out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; - if (it.opts.useDefaults == 'shared') { - out += ' ' + (it.useDefault($sch.default)) + ' '; - } else { - out += ' ' + (JSON.stringify($sch.default)) + ' '; - } - out += '; '; - } - } - } - } - } - var arr5 = $rulesGroup.rules; - if (arr5) { - var $rule, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $rule = arr5[i5 += 1]; - if ($shouldUseRule($rule)) { - var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); - if ($code) { - out += ' ' + ($code) + ' '; - if ($breakOnError) { - $closingBraces1 += '}'; - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces1) + ' '; - $closingBraces1 = ''; - } - if ($rulesGroup.type) { - out += ' } '; - if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { - out += ' else { '; - var $schemaPath = it.schemaPath + '.type', - $errSchemaPath = it.errSchemaPath + '/type'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be '; - if ($typeIsArray) { - out += '' + ($typeSchema.join(",")); - } else { - out += '' + ($typeSchema); - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - } - if ($breakOnError) { - out += ' if (errors === '; - if ($top) { - out += '0'; - } else { - out += 'errs_' + ($lvl); - } - out += ') { '; - $closingBraces2 += '}'; - } - } - } - } - } - if ($breakOnError) { - out += ' ' + ($closingBraces2) + ' '; - } - if ($top) { - if ($async) { - out += ' if (errors === 0) return data; '; - out += ' else throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; '; - out += ' return errors === 0; '; - } - out += ' }); return validate;'; - } else { - out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; - } - out = it.util.cleanUpCode(out); - if ($top) { - out = it.util.finalCleanUpCode(out, $async); - } - - function $shouldUseGroup($rulesGroup) { - var rules = $rulesGroup.rules; - for (var i = 0; i < rules.length; i++) - if ($shouldUseRule(rules[i])) return true; - } - - function $shouldUseRule($rule) { - return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); - } - - function $ruleImplementsSomeKeyword($rule) { - var impl = $rule.implements; - for (var i = 0; i < impl.length; i++) - if (it.schema[impl[i]] !== undefined) return true; - } - return out; -} - - -/***/ }), -/* 345 */ -/***/ (function(module, exports, __webpack_require__) { - -module.exports = __webpack_require__(509)().Promise - - -/***/ }), -/* 346 */ /***/ (function(module, exports) { // API @@ -72176,10 +71397,10 @@ function clean(key) /***/ }), -/* 347 */ +/* 341 */ /***/ (function(module, exports, __webpack_require__) { -var defer = __webpack_require__(518); +var defer = __webpack_require__(486); // API module.exports = async; @@ -72216,11 +71437,11 @@ function async(callback) /***/ }), -/* 348 */ +/* 342 */ /***/ (function(module, exports, __webpack_require__) { -var async = __webpack_require__(347) - , abort = __webpack_require__(346) +var async = __webpack_require__(341) + , abort = __webpack_require__(340) ; // API @@ -72297,7 +71518,7 @@ function runJob(iterator, key, item, callback) /***/ }), -/* 349 */ +/* 343 */ /***/ (function(module, exports) { // API @@ -72340,11 +71561,11 @@ function state(list, sortMethod) /***/ }), -/* 350 */ +/* 344 */ /***/ (function(module, exports, __webpack_require__) { -var abort = __webpack_require__(346) - , async = __webpack_require__(347) +var abort = __webpack_require__(340) + , async = __webpack_require__(341) ; // API @@ -72375,12 +71596,12 @@ function terminator(callback) /***/ }), -/* 351 */ +/* 345 */ /***/ (function(module, exports, __webpack_require__) { -var iterate = __webpack_require__(348) - , initState = __webpack_require__(349) - , terminator = __webpack_require__(350) +var iterate = __webpack_require__(342) + , initState = __webpack_require__(343) + , terminator = __webpack_require__(344) ; // Public API @@ -72456,7 +71677,7 @@ function descending(a, b) /***/ }), -/* 352 */ +/* 346 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72471,7 +71692,7 @@ exports.default = { }; /***/ }), -/* 353 */ +/* 347 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72539,19 +71760,19 @@ exports.hasWrapper = hasWrapper; var _promise; function _load_promise() { - return _promise = __webpack_require__(50); + return _promise = __webpack_require__(51); } var _hoistedTreeBuilder; function _load_hoistedTreeBuilder() { - return _hoistedTreeBuilder = __webpack_require__(554); + return _hoistedTreeBuilder = __webpack_require__(522); } var _getTransitiveDevDependencies; function _load_getTransitiveDevDependencies() { - return _getTransitiveDevDependencies = __webpack_require__(580); + return _getTransitiveDevDependencies = __webpack_require__(548); } var _install; @@ -72574,7 +71795,7 @@ function _load_constants() { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const zlib = __webpack_require__(198); +const zlib = __webpack_require__(199); const gzip = (0, (_promise || _load_promise()).promisify)(zlib.gzip); @@ -72788,7 +72009,7 @@ class Audit { exports.default = Audit; /***/ }), -/* 354 */ +/* 348 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73024,13 +72245,13 @@ exports.hasWrapper = hasWrapper; var _index; function _load_index() { - return _index = __webpack_require__(57); + return _index = __webpack_require__(58); } var _filter; function _load_filter() { - return _filter = __webpack_require__(372); + return _filter = __webpack_require__(366); } var _constants; @@ -73042,7 +72263,7 @@ function _load_constants() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -73115,7 +72336,7 @@ function hasWrapper(commander) { } /***/ }), -/* 355 */ +/* 349 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73315,7 +72536,7 @@ function _load_buildSubCommands() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -73324,7 +72545,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const invariant = __webpack_require__(9); const path = __webpack_require__(0); -const micromatch = __webpack_require__(114); +const micromatch = __webpack_require__(115); function hasWrapper(flags, args) { return args[0] !== 'dir'; @@ -73363,7 +72584,7 @@ function setFlags(commander) { } /***/ }), -/* 356 */ +/* 350 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73832,13 +73053,13 @@ function _load_errors() { var _integrityChecker; function _load_integrityChecker() { - return _integrityChecker = _interopRequireDefault(__webpack_require__(208)); + return _integrityChecker = _interopRequireDefault(__webpack_require__(206)); } var _integrityChecker2; function _load_integrityChecker2() { - return _integrityChecker2 = __webpack_require__(208); + return _integrityChecker2 = __webpack_require__(206); } var _lockfile; @@ -73850,7 +73071,7 @@ function _load_lockfile() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _install; @@ -73869,7 +73090,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); const path = __webpack_require__(0); const requireLockfile = exports.requireLockfile = false; @@ -73886,7 +73107,7 @@ function setFlags(commander) { } /***/ }), -/* 357 */ +/* 351 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74015,7 +73236,7 @@ function _load_errors() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _global; @@ -74030,7 +73251,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const invariant = __webpack_require__(9); -const cmdShim = __webpack_require__(201); +const cmdShim = __webpack_require__(202); const path = __webpack_require__(0); function hasWrapper(commander, args) { @@ -74042,7 +73263,7 @@ function setFlags(commander) { } /***/ }), -/* 358 */ +/* 352 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74315,7 +73536,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de const invariant = __webpack_require__(9); -const micromatch = __webpack_require__(114); +const micromatch = __webpack_require__(115); const requireLockfile = exports.requireLockfile = true; @@ -74392,7 +73613,7 @@ function getDevDeps(manifest) { } /***/ }), -/* 359 */ +/* 353 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74406,7 +73627,7 @@ exports.run = exports.requireLockfile = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -74559,7 +73780,7 @@ function _load_lockfile() { var _index; function _load_index() { - return _index = __webpack_require__(57); + return _index = __webpack_require__(58); } var _install; @@ -74577,13 +73798,13 @@ function _load_errors() { var _index2; function _load_index2() { - return _index2 = __webpack_require__(200); + return _index2 = __webpack_require__(201); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _constants; @@ -74613,7 +73834,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 360 */ +/* 354 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74650,6 +73871,7 @@ let getBinEntries = exports.getBinEntries = (() => { const registryFolder = _ref4; + binFolders.add(path.resolve(config.cwd, registryFolder, '.bin')); binFolders.add(path.resolve(config.lockfileFolder, registryFolder, '.bin')); } @@ -74797,7 +74019,20 @@ let run = exports.run = (() => { } else { let suggestion; - for (const commandName in scripts) { + for (var _iterator9 = scripts.keys(), _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { + var _ref16; + + if (_isArray9) { + if (_i9 >= _iterator9.length) break; + _ref16 = _iterator9[_i9++]; + } else { + _i9 = _iterator9.next(); + if (_i9.done) break; + _ref16 = _i9.value; + } + + const commandName = _ref16; + const steps = leven(commandName, action); if (steps < 2) { suggestion = commandName; @@ -74882,19 +74117,19 @@ let run = exports.run = (() => { const printedCommands = new Map(); - for (var _iterator9 = pkgCommands, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) { - var _ref16; + for (var _iterator10 = pkgCommands, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) { + var _ref17; - if (_isArray9) { - if (_i9 >= _iterator9.length) break; - _ref16 = _iterator9[_i9++]; + if (_isArray10) { + if (_i10 >= _iterator10.length) break; + _ref17 = _iterator10[_i10++]; } else { - _i9 = _iterator9.next(); - if (_i9.done) break; - _ref16 = _i9.value; + _i10 = _iterator10.next(); + if (_i10.done) break; + _ref17 = _i10.value; } - const pkgCommand = _ref16; + const pkgCommand = _ref17; const action = scripts.get(pkgCommand); invariant(action, 'Action must exists'); @@ -74937,13 +74172,13 @@ function _load_executeLifecycleScript() { var _dynamicRequire; function _load_dynamicRequire() { - return _dynamicRequire = __webpack_require__(371); + return _dynamicRequire = __webpack_require__(365); } var _hooks; function _load_hooks() { - return _hooks = __webpack_require__(374); + return _hooks = __webpack_require__(368); } var _errors; @@ -74955,13 +74190,13 @@ function _load_errors() { var _packageCompatibility; function _load_packageCompatibility() { - return _packageCompatibility = __webpack_require__(209); + return _packageCompatibility = __webpack_require__(207); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _constants; @@ -75020,7 +74255,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 361 */ +/* 355 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75251,7 +74486,7 @@ exports.hasWrapper = hasWrapper; exports.examples = examples; /***/ }), -/* 362 */ +/* 356 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75265,7 +74500,7 @@ exports.run = exports.requireLockfile = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -75500,19 +74735,19 @@ function _load_add() { var _upgrade; function _load_upgrade() { - return _upgrade = __webpack_require__(207); + return _upgrade = __webpack_require__(205); } var _colorForVersions; function _load_colorForVersions() { - return _colorForVersions = _interopRequireDefault(__webpack_require__(369)); + return _colorForVersions = _interopRequireDefault(__webpack_require__(363)); } var _colorizeDiff; function _load_colorizeDiff() { - return _colorizeDiff = _interopRequireDefault(__webpack_require__(370)); + return _colorizeDiff = _interopRequireDefault(__webpack_require__(364)); } var _install; @@ -75542,7 +74777,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 363 */ +/* 357 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75762,7 +74997,7 @@ exports.hasWrapper = hasWrapper; var _index; function _load_index() { - return _index = __webpack_require__(57); + return _index = __webpack_require__(58); } var _executeLifecycleScript; @@ -75780,13 +75015,13 @@ function _load_errors() { var _gitSpawn; function _load_gitSpawn() { - return _gitSpawn = __webpack_require__(373); + return _gitSpawn = __webpack_require__(367); } var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _map; @@ -75800,7 +75035,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const invariant = __webpack_require__(9); -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); const path = __webpack_require__(0); const NEW_VERSION_FLAG = '--new-version [version]'; @@ -75829,7 +75064,7 @@ function hasWrapper(commander, args) { } /***/ }), -/* 364 */ +/* 358 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75843,7 +75078,7 @@ exports.LocalTarballFetcher = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -75873,7 +75108,7 @@ function _load_baseFetcher() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } var _misc; @@ -75892,15 +75127,15 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const crypto = __webpack_require__(12); +const crypto = __webpack_require__(11); const path = __webpack_require__(0); -const tarFs = __webpack_require__(193); +const tarFs = __webpack_require__(194); const url = __webpack_require__(24); -const fs = __webpack_require__(5); +const fs = __webpack_require__(4); const stream = __webpack_require__(23); -const gunzip = __webpack_require__(656); +const gunzip = __webpack_require__(624); const invariant = __webpack_require__(9); -const ssri = __webpack_require__(77); +const ssri = __webpack_require__(65); const RE_URL_NAME_MATCH = /\/(?:(@[^/]+)(?:\/|%2f))?[^/]+\/(?:-|_attachments)\/(?:@[^/]+\/)?([^/]+)$/; @@ -75981,11 +75216,12 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { } createExtractor(resolve, reject, tarballPath) { - const integrityInfo = this._supportedIntegrity(); + const hashInfo = this._supportedIntegrity({ hashOnly: true }); + const integrityInfo = this._supportedIntegrity({ hashOnly: false }); const now = new Date(); - const fs = __webpack_require__(5); + const fs = __webpack_require__(4); const patchedFs = Object.assign({}, fs, { utimes: (path, atime, mtime, cb) => { fs.stat(path, (err, stat) => { @@ -76014,7 +75250,9 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { } }); - const validateStream = new ssri.integrityStream(integrityInfo); + const hashValidateStream = new ssri.integrityStream(hashInfo); + const integrityValidateStream = new ssri.integrityStream(integrityInfo); + const untarStream = tarFs.extract(this.dest, { strip: 1, dmode: 0o755, // all dirs should be readable @@ -76022,16 +75260,24 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { chown: false, // don't chown. just leave as it is map: header => { header.mtime = now; + if (header.linkname) { + const basePath = path.posix.dirname(path.join('/', header.name)); + const jailPath = path.posix.join(basePath, header.linkname); + header.linkname = path.posix.relative('/', jailPath); + } return header; }, fs: patchedFs }); const extractorStream = gunzip(); - validateStream.once('error', err => { + hashValidateStream.once('error', err => { this.validateError = err; }); - validateStream.once('integrity', sri => { + integrityValidateStream.once('error', err => { + this.validateError = err; + }); + integrityValidateStream.once('integrity', sri => { this.validateIntegrity = sri; }); @@ -76044,9 +75290,11 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { const hexDigest = this.validateIntegrity ? this.validateIntegrity.hexDigest() : ''; if (this.config.updateChecksums && this.remote.integrity && this.validateIntegrity && this.remote.integrity !== this.validateIntegrity.toString()) { this.remote.integrity = this.validateIntegrity.toString(); + } else if (this.validateIntegrity) { + this.remote.cacheIntegrity = this.validateIntegrity.toString(); } - if (integrityInfo.algorithms.length === 0) { + if (integrityInfo.integrity && Object.keys(integrityInfo.integrity).length === 0) { return reject(new (_errors || _load_errors()).SecurityError(this.config.reporter.lang('fetchBadIntegrityAlgorithm', this.packageName, this.remote.reference))); } @@ -76063,7 +75311,7 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { }); }); - return { validateStream, extractorStream }; + return { hashValidateStream, integrityValidateStream, extractorStream }; } getLocalPaths(override) { @@ -76090,11 +75338,15 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { var _createExtractor = _this2.createExtractor(resolve, reject, tarballPath); - const validateStream = _createExtractor.validateStream, + const hashValidateStream = _createExtractor.hashValidateStream, + integrityValidateStream = _createExtractor.integrityValidateStream, extractorStream = _createExtractor.extractorStream; - stream.pipe(validateStream).pipe(extractorStream).on('error', function (err) { + stream.pipe(hashValidateStream); + hashValidateStream.pipe(integrityValidateStream); + + integrityValidateStream.pipe(extractorStream).on('error', function (err) { reject(new (_errors || _load_errors()).MessageError(_this2.config.reporter.lang('fetchErrorCorrupt', err.message, tarballPath))); }); }); @@ -76121,21 +75373,23 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { var _createExtractor2 = _this3.createExtractor(resolve, reject); - const validateStream = _createExtractor2.validateStream, + const hashValidateStream = _createExtractor2.hashValidateStream, + integrityValidateStream = _createExtractor2.integrityValidateStream, extractorStream = _createExtractor2.extractorStream; - req.pipe(validateStream); + req.pipe(hashValidateStream); + hashValidateStream.pipe(integrityValidateStream); if (tarballMirrorPath) { - validateStream.pipe(fs.createWriteStream(tarballMirrorPath)).on('error', reject); + integrityValidateStream.pipe(fs.createWriteStream(tarballMirrorPath)).on('error', reject); } if (tarballCachePath) { - validateStream.pipe(fs.createWriteStream(tarballCachePath)).on('error', reject); + integrityValidateStream.pipe(fs.createWriteStream(tarballCachePath)).on('error', reject); } - validateStream.pipe(extractorStream).on('error', reject); + integrityValidateStream.pipe(extractorStream).on('error', reject); } }, _this3.packageName); } catch (err) { @@ -76188,8 +75442,8 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { return this.fetchFromLocal().catch(err => this.fetchFromExternal()); } - _findIntegrity() { - if (this.remote.integrity) { + _findIntegrity({ hashOnly }) { + if (this.remote.integrity && !hashOnly) { return ssri.parse(this.remote.integrity); } if (this.hash) { @@ -76198,18 +75452,18 @@ class TarballFetcher extends (_baseFetcher || _load_baseFetcher()).default { return null; } - _supportedIntegrity() { - const expectedIntegrity = this._findIntegrity() || {}; + _supportedIntegrity({ hashOnly }) { + const expectedIntegrity = this._findIntegrity({ hashOnly }) || {}; const expectedIntegrityAlgorithms = Object.keys(expectedIntegrity); const shouldValidateIntegrity = (this.hash || this.remote.integrity) && !this.config.updateChecksums; - if (expectedIntegrityAlgorithms.length === 0 && !shouldValidateIntegrity) { + if (expectedIntegrityAlgorithms.length === 0 && (!shouldValidateIntegrity || hashOnly)) { const algorithms = this.config.updateChecksums ? ['sha512'] : ['sha1']; // for consistency, return sha1 for packages without a remote integrity (eg. github) return { integrity: null, algorithms }; } - const algorithms = new Set(); + const algorithms = new Set(['sha512', 'sha1']); const integrity = {}; for (var _iterator = expectedIntegrityAlgorithms, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref; @@ -76254,7 +75508,7 @@ function urlParts(requestUrl) { } /***/ }), -/* 365 */ +/* 359 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76394,7 +75648,7 @@ class PackageReference { exports.default = PackageReference; /***/ }), -/* 366 */ +/* 360 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76431,7 +75685,7 @@ function _load_normalizePattern() { var _requestManager; function _load_requestManager() { - return _requestManager = _interopRequireDefault(__webpack_require__(378)); + return _requestManager = _interopRequireDefault(__webpack_require__(372)); } var _blockingQueue; @@ -76461,20 +75715,20 @@ function _load_workspaceLayout() { var _resolutionMap; function _load_resolutionMap() { - return _resolutionMap = _interopRequireDefault(__webpack_require__(214)); + return _resolutionMap = _interopRequireDefault(__webpack_require__(212)); } var _resolutionMap2; function _load_resolutionMap2() { - return _resolutionMap2 = __webpack_require__(214); + return _resolutionMap2 = __webpack_require__(212); } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } const invariant = __webpack_require__(9); -const semver = __webpack_require__(21); +const semver = __webpack_require__(22); class PackageResolver { constructor(config, lockfile, resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config)) { @@ -77328,7 +76582,7 @@ class PackageResolver { exports.default = PackageResolver; /***/ }), -/* 367 */ +/* 361 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77387,7 +76641,7 @@ GitHubResolver.protocol = 'github'; GitHubResolver.hostname = 'github.com'; /***/ }), -/* 368 */ +/* 362 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77419,7 +76673,7 @@ function _load_misc() { var _fs; function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _fs = _interopRequireWildcard(__webpack_require__(5)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -77467,7 +76721,7 @@ exports.default = LinkResolver; LinkResolver.protocol = 'link'; /***/ }), -/* 369 */ +/* 363 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77490,13 +76744,13 @@ exports.default = function (from, to) { var _semver; function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); + return _semver = _interopRequireDefault(__webpack_require__(22)); } var _semver2; function _load_semver2() { - return _semver2 = __webpack_require__(224); + return _semver2 = __webpack_require__(170); } var _constants; @@ -77508,7 +76762,7 @@ function _load_constants() { function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } /***/ }), -/* 370 */ +/* 364 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77532,7 +76786,7 @@ exports.default = function (from, to, reporter) { }; /***/ }), -/* 371 */ +/* 365 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77542,7 +76796,7 @@ exports.default = function (from, to, reporter) { exports.dynamicRequire = true ? require : require; // eslint-disable-line /***/ }), -/* 372 */ +/* 366 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77562,7 +76816,7 @@ function _load_misc() { return _misc = __webpack_require__(18); } -const mm = __webpack_require__(114); +const mm = __webpack_require__(115); const path = __webpack_require__(0); const WHITESPACE_RE = /^\s+$/; @@ -77784,7 +77038,7 @@ function filterOverridenGitignores(files) { } /***/ }), -/* 373 */ +/* 367 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77798,7 +77052,7 @@ exports.spawn = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _path; @@ -77810,7 +77064,7 @@ function _load_path() { var _child; function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(58)); + return _child = _interopRequireWildcard(__webpack_require__(50)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } @@ -77842,7 +77096,7 @@ const spawn = exports.spawn = (args, opts = {}) => { }; /***/ }), -/* 374 */ +/* 368 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77875,7 +77129,7 @@ function callThroughHook(type, fn, context) { } /***/ }), -/* 375 */ +/* 369 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77903,7 +77157,7 @@ exports.default = key => { }; /***/ }), -/* 376 */ +/* 370 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77930,7 +77184,7 @@ function isValidPackagePath(input) { } /***/ }), -/* 377 */ +/* 371 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77948,7 +77202,7 @@ function _load_path() { return _path = __webpack_require__(0); } -const userHome = __webpack_require__(66).default; +const userHome = __webpack_require__(67).default; function getPosixPath(path) { return path.replace(/\\/g, '/'); @@ -77964,7 +77218,7 @@ function resolveWithHome(path) { } /***/ }), -/* 378 */ +/* 372 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77977,7 +77231,7 @@ Object.defineProperty(exports, "__esModule", { var _fs; function _load_fs() { - return _fs = _interopRequireDefault(__webpack_require__(5)); + return _fs = _interopRequireDefault(__webpack_require__(4)); } var _http; @@ -77995,7 +77249,7 @@ function _load_url() { var _dnscache; function _load_dnscache() { - return _dnscache = _interopRequireDefault(__webpack_require__(637)); + return _dnscache = _interopRequireDefault(__webpack_require__(605)); } var _invariant; @@ -78344,6 +77598,11 @@ class RequestManager { rejectNext(err); }; + const rejectWithoutUrl = function rejectWithoutUrl(err) { + err.message = err.message; + rejectNext(err); + }; + const queueForRetry = reason => { const attempts = params.retryAttempts || 0; if (attempts >= this.maxRetryAttempts - 1) { @@ -78399,11 +77658,15 @@ class RequestManager { } } + if (res.statusCode === 401 && res.caseless && res.caseless.get('server') === 'GitHub.com') { + const message = `${res.body.message}. If using GITHUB_TOKEN in your env, check that it is valid.`; + rejectWithoutUrl(new Error(this.reporter.lang('unauthorizedResponse', res.caseless.get('server'), message))); + } + if (res.statusCode === 401 && res.headers['www-authenticate']) { const authMethods = res.headers['www-authenticate'].split(/,\s*/).map(s => s.toLowerCase()); - if (authMethods.indexOf('otp') !== -1) { - reject(new (_errors || _load_errors()).OneTimePasswordError()); + reject(new (_errors || _load_errors()).OneTimePasswordError(res.headers['npm-notice'])); return; } } @@ -78515,13 +77778,13 @@ class RequestManager { exports.default = RequestManager; /***/ }), -/* 379 */ +/* 373 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var crypto_hash_sha512 = __webpack_require__(75).lowlevel.crypto_hash; +var crypto_hash_sha512 = __webpack_require__(76).lowlevel.crypto_hash; /* * This file is a 1:1 port from the OpenBSD blowfish.c and bcrypt_pbkdf.c. As a @@ -79078,11 +78341,11 @@ module.exports = { /***/ }), -/* 380 */ +/* 374 */ /***/ (function(module, exports, __webpack_require__) { -var bufferFill = __webpack_require__(594) -var allocUnsafe = __webpack_require__(593) +var bufferFill = __webpack_require__(562) +var allocUnsafe = __webpack_require__(561) module.exports = function alloc (size, fill, encoding) { if (typeof size !== 'number') { @@ -79116,7 +78379,7 @@ module.exports = function alloc (size, fill, encoding) { /***/ }), -/* 381 */ +/* 375 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79162,7 +78425,7 @@ exports.toggle = (force, stream) => { /***/ }), -/* 382 */ +/* 376 */ /***/ (function(module, exports, __webpack_require__) { var objectAssign = __webpack_require__(303); @@ -79472,7 +78735,7 @@ module.exports = { /***/ }), -/* 383 */ +/* 377 */ /***/ (function(module, exports) { @@ -79715,11 +78978,11 @@ function isObject(val) { /***/ }), -/* 384 */ +/* 378 */ /***/ (function(module, exports, __webpack_require__) { /* MIT license */ -var cssKeywords = __webpack_require__(610); +var cssKeywords = __webpack_require__(578); // NOTE: conversions should only return primitive values (i.e. arrays, or // values that give correct `typeof` results). @@ -80589,13 +79852,13 @@ convert.rgb.gray = function (rgb) { /***/ }), -/* 385 */ +/* 379 */ /***/ (function(module, exports, __webpack_require__) { var util = __webpack_require__(3); var Stream = __webpack_require__(23).Stream; -var DelayedStream = __webpack_require__(634); -var defer = __webpack_require__(622); +var DelayedStream = __webpack_require__(602); +var defer = __webpack_require__(590); module.exports = CombinedStream; function CombinedStream() { @@ -80784,11 +80047,11 @@ CombinedStream.prototype._emitError = function(err) { /***/ }), -/* 386 */ +/* 380 */ /***/ (function(module, exports, __webpack_require__) { var stream = __webpack_require__(102) -var eos = __webpack_require__(173) +var eos = __webpack_require__(174) var inherits = __webpack_require__(61) var shift = __webpack_require__(942) @@ -81025,14 +80288,14 @@ module.exports = Duplexify /***/ }), -/* 387 */ +/* 381 */ /***/ (function(module, exports, __webpack_require__) { -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); var BigInteger = __webpack_require__(81).BigInteger; var ECPointFp = __webpack_require__(139).ECPointFp; var Buffer = __webpack_require__(15).Buffer; -exports.ECCurves = __webpack_require__(638); +exports.ECCurves = __webpack_require__(606); // zero prepad function unstupid(hex,len) @@ -81089,7 +80352,7 @@ exports.ECKey = function(curve, key, isPublic) /***/ }), -/* 388 */ +/* 382 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81107,7 +80370,7 @@ module.exports = function (str) { /***/ }), -/* 389 */ +/* 383 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81173,13 +80436,13 @@ module.exports = function (data, opts) { /***/ }), -/* 390 */ +/* 384 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var fs = __webpack_require__(5) +var fs = __webpack_require__(4) module.exports = clone(fs) @@ -81201,12 +80464,12 @@ function clone (obj) { /***/ }), -/* 391 */ +/* 385 */ /***/ (function(module, exports, __webpack_require__) { -var fs = __webpack_require__(5) -var polyfills = __webpack_require__(655) -var legacy = __webpack_require__(654) +var fs = __webpack_require__(4) +var polyfills = __webpack_require__(623) +var legacy = __webpack_require__(622) var queue = [] var util = __webpack_require__(3) @@ -81230,7 +80493,7 @@ if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || '')) { }) } -module.exports = patch(__webpack_require__(390)) +module.exports = patch(__webpack_require__(384)) if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) { module.exports = patch(fs) } @@ -81468,6 +80731,897 @@ function retry () { } +/***/ }), +/* 386 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var util = __webpack_require__(114); + +module.exports = SchemaObject; + +function SchemaObject(obj) { + util.copy(obj, this); +} + + +/***/ }), +/* 387 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate__limit(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $isMax = $keyword == 'maximum', + $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum', + $schemaExcl = it.schema[$exclusiveKeyword], + $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data, + $op = $isMax ? '<' : '>', + $notOp = $isMax ? '>' : '<', + $errorKeyword = undefined; + if ($isDataExcl) { + var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr), + $exclusive = 'exclusive' + $lvl, + $exclType = 'exclType' + $lvl, + $exclIsNumber = 'exclIsNumber' + $lvl, + $opExpr = 'op' + $lvl, + $opStr = '\' + ' + $opExpr + ' + \''; + out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; '; + $schemaValueExcl = 'schemaExcl' + $lvl; + out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { '; + var $errorKeyword = $exclusiveKeyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\';'; + } else { + var $exclIsNumber = typeof $schemaExcl == 'number', + $opStr = $op; + if ($exclIsNumber && $isData) { + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { '; + } else { + if ($exclIsNumber && $schema === undefined) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $schemaValue = $schemaExcl; + $notOp += '='; + } else { + if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema); + if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) { + $exclusive = true; + $errorKeyword = $exclusiveKeyword; + $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword; + $notOp += '='; + } else { + $exclusive = false; + $opStr += '='; + } + } + var $opExpr = '\'' + $opStr + '\''; + out += ' if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { '; + } + } + $errorKeyword = $errorKeyword || $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be ' + ($opStr) + ' '; + if ($isData) { + out += '\' + ' + ($schemaValue); + } else { + out += '' + ($schemaValue) + '\''; + } + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 388 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate__limitItems(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxItems' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxItems') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' items\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 389 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate__limitLength(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxLength' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + if (it.opts.unicode === false) { + out += ' ' + ($data) + '.length '; + } else { + out += ' ucs2length(' + ($data) + ') '; + } + out += ' ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT be '; + if ($keyword == 'maxLength') { + out += 'longer'; + } else { + out += 'shorter'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' characters\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 390 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate__limitProperties(it, $keyword, $ruleType) { + var out = ' '; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $isData = it.opts.$data && $schema && $schema.$data, + $schemaValue; + if ($isData) { + out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; + $schemaValue = 'schema' + $lvl; + } else { + $schemaValue = $schema; + } + var $op = $keyword == 'maxProperties' ? '>' : '<'; + out += 'if ( '; + if ($isData) { + out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || '; + } + out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { '; + var $errorKeyword = $keyword; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should NOT have '; + if ($keyword == 'maxProperties') { + out += 'more'; + } else { + out += 'less'; + } + out += ' than '; + if ($isData) { + out += '\' + ' + ($schemaValue) + ' + \''; + } else { + out += '' + ($schema); + } + out += ' properties\' '; + } + if (it.opts.verbose) { + out += ' , schema: '; + if ($isData) { + out += 'validate.schema' + ($schemaPath); + } else { + out += '' + ($schema); + } + out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += '} '; + if ($breakOnError) { + out += ' else { '; + } + return out; +} + + +/***/ }), +/* 391 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +module.exports = function generate_validate(it, $keyword, $ruleType) { + var out = ''; + var $async = it.schema.$async === true, + $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'), + $id = it.self._getId(it.schema); + if (it.isTop) { + if ($async) { + it.async = true; + var $es7 = it.opts.async == 'es7'; + it.yieldAwait = $es7 ? 'await' : 'yield'; + } + out += ' var validate = '; + if ($async) { + if ($es7) { + out += ' (async function '; + } else { + if (it.opts.async != '*') { + out += 'co.wrap'; + } + out += '(function* '; + } + } else { + out += ' (function '; + } + out += ' (data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; '; + if ($id && (it.opts.sourceCode || it.opts.processCode)) { + out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' '; + } + } + if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) { + var $keyword = 'false schema'; + var $lvl = it.level; + var $dataLvl = it.dataLevel; + var $schema = it.schema[$keyword]; + var $schemaPath = it.schemaPath + it.util.getProperty($keyword); + var $errSchemaPath = it.errSchemaPath + '/' + $keyword; + var $breakOnError = !it.opts.allErrors; + var $errorKeyword; + var $data = 'data' + ($dataLvl || ''); + var $valid = 'valid' + $lvl; + if (it.schema === false) { + if (it.isTop) { + $breakOnError = true; + } else { + out += ' var ' + ($valid) + ' = false; '; + } + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; + if (it.opts.messages !== false) { + out += ' , message: \'boolean schema is false\' '; + } + if (it.opts.verbose) { + out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } else { + if (it.isTop) { + if ($async) { + out += ' return data; '; + } else { + out += ' validate.errors = null; return true; '; + } + } else { + out += ' var ' + ($valid) + ' = true; '; + } + } + if (it.isTop) { + out += ' }); return validate; '; + } + return out; + } + if (it.isTop) { + var $top = it.isTop, + $lvl = it.level = 0, + $dataLvl = it.dataLevel = 0, + $data = 'data'; + it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema)); + it.baseId = it.baseId || it.rootId; + delete it.isTop; + it.dataPathArr = [undefined]; + out += ' var vErrors = null; '; + out += ' var errors = 0; '; + out += ' if (rootData === undefined) rootData = data; '; + } else { + var $lvl = it.level, + $dataLvl = it.dataLevel, + $data = 'data' + ($dataLvl || ''); + if ($id) it.baseId = it.resolve.url(it.baseId, $id); + if ($async && !it.async) throw new Error('async schema in sync schema'); + out += ' var errs_' + ($lvl) + ' = errors;'; + } + var $valid = 'valid' + $lvl, + $breakOnError = !it.opts.allErrors, + $closingBraces1 = '', + $closingBraces2 = ''; + var $errorKeyword; + var $typeSchema = it.schema.type, + $typeIsArray = Array.isArray($typeSchema); + if ($typeIsArray && $typeSchema.length == 1) { + $typeSchema = $typeSchema[0]; + $typeIsArray = false; + } + if (it.schema.$ref && $refKeywords) { + if (it.opts.extendRefs == 'fail') { + throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); + } else if (it.opts.extendRefs !== true) { + $refKeywords = false; + it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"'); + } + } + if ($typeSchema) { + if (it.opts.coerceTypes) { + var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); + } + var $rulesGroup = it.RULES.types[$typeSchema]; + if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) { + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type', + $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType'; + out += ' if (' + (it.util[$method]($typeSchema, $data, true)) + ') { '; + if ($coerceToTypes) { + var $dataType = 'dataType' + $lvl, + $coerced = 'coerced' + $lvl; + out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; '; + if (it.opts.coerceTypes == 'array') { + out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ')) ' + ($dataType) + ' = \'array\'; '; + } + out += ' var ' + ($coerced) + ' = undefined; '; + var $bracesCoercion = ''; + var arr1 = $coerceToTypes; + if (arr1) { + var $type, $i = -1, + l1 = arr1.length - 1; + while ($i < l1) { + $type = arr1[$i += 1]; + if ($i) { + out += ' if (' + ($coerced) + ' === undefined) { '; + $bracesCoercion += '}'; + } + if (it.opts.coerceTypes == 'array' && $type != 'array') { + out += ' if (' + ($dataType) + ' == \'array\' && ' + ($data) + '.length == 1) { ' + ($coerced) + ' = ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; } '; + } + if ($type == 'string') { + out += ' if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; '; + } else if ($type == 'number' || $type == 'integer') { + out += ' if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' '; + if ($type == 'integer') { + out += ' && !(' + ($data) + ' % 1)'; + } + out += ')) ' + ($coerced) + ' = +' + ($data) + '; '; + } else if ($type == 'boolean') { + out += ' if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; '; + } else if ($type == 'null') { + out += ' if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; '; + } else if (it.opts.coerceTypes == 'array' && $type == 'array') { + out += ' if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; '; + } + } + } + out += ' ' + ($bracesCoercion) + ' if (' + ($coerced) + ' === undefined) { '; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } else { '; + var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', + $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; + out += ' ' + ($data) + ' = ' + ($coerced) + '; '; + if (!$dataLvl) { + out += 'if (' + ($parentData) + ' !== undefined)'; + } + out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } '; + } else { + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + } + out += ' } '; + } + } + if (it.schema.$ref && !$refKeywords) { + out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' '; + if ($breakOnError) { + out += ' } if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } else { + if (it.opts.v5 && it.schema.patternGroups) { + it.logger.warn('keyword "patternGroups" is deprecated and disabled. Use option patternGroups: true to enable.'); + } + var arr2 = it.RULES; + if (arr2) { + var $rulesGroup, i2 = -1, + l2 = arr2.length - 1; + while (i2 < l2) { + $rulesGroup = arr2[i2 += 1]; + if ($shouldUseGroup($rulesGroup)) { + if ($rulesGroup.type) { + out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data)) + ') { '; + } + if (it.opts.useDefaults && !it.compositeRule) { + if ($rulesGroup.type == 'object' && it.schema.properties) { + var $schema = it.schema.properties, + $schemaKeys = Object.keys($schema); + var arr3 = $schemaKeys; + if (arr3) { + var $propertyKey, i3 = -1, + l3 = arr3.length - 1; + while (i3 < l3) { + $propertyKey = arr3[i3 += 1]; + var $sch = $schema[$propertyKey]; + if ($sch.default !== undefined) { + var $passData = $data + it.util.getProperty($propertyKey); + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) { + var arr4 = it.schema.items; + if (arr4) { + var $sch, $i = -1, + l4 = arr4.length - 1; + while ($i < l4) { + $sch = arr4[$i += 1]; + if ($sch.default !== undefined) { + var $passData = $data + '[' + $i + ']'; + out += ' if (' + ($passData) + ' === undefined) ' + ($passData) + ' = '; + if (it.opts.useDefaults == 'shared') { + out += ' ' + (it.useDefault($sch.default)) + ' '; + } else { + out += ' ' + (JSON.stringify($sch.default)) + ' '; + } + out += '; '; + } + } + } + } + } + var arr5 = $rulesGroup.rules; + if (arr5) { + var $rule, i5 = -1, + l5 = arr5.length - 1; + while (i5 < l5) { + $rule = arr5[i5 += 1]; + if ($shouldUseRule($rule)) { + var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); + if ($code) { + out += ' ' + ($code) + ' '; + if ($breakOnError) { + $closingBraces1 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces1) + ' '; + $closingBraces1 = ''; + } + if ($rulesGroup.type) { + out += ' } '; + if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) { + out += ' else { '; + var $schemaPath = it.schemaPath + '.type', + $errSchemaPath = it.errSchemaPath + '/type'; + var $$outStack = $$outStack || []; + $$outStack.push(out); + out = ''; /* istanbul ignore else */ + if (it.createErrors !== false) { + out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \''; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' } '; + if (it.opts.messages !== false) { + out += ' , message: \'should be '; + if ($typeIsArray) { + out += '' + ($typeSchema.join(",")); + } else { + out += '' + ($typeSchema); + } + out += '\' '; + } + if (it.opts.verbose) { + out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + } + out += ' } '; + } else { + out += ' {} '; + } + var __err = out; + out = $$outStack.pop(); + if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ + if (it.async) { + out += ' throw new ValidationError([' + (__err) + ']); '; + } else { + out += ' validate.errors = [' + (__err) + ']; return false; '; + } + } else { + out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + } + out += ' } '; + } + } + if ($breakOnError) { + out += ' if (errors === '; + if ($top) { + out += '0'; + } else { + out += 'errs_' + ($lvl); + } + out += ') { '; + $closingBraces2 += '}'; + } + } + } + } + } + if ($breakOnError) { + out += ' ' + ($closingBraces2) + ' '; + } + if ($top) { + if ($async) { + out += ' if (errors === 0) return data; '; + out += ' else throw new ValidationError(vErrors); '; + } else { + out += ' validate.errors = vErrors; '; + out += ' return errors === 0; '; + } + out += ' }); return validate;'; + } else { + out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';'; + } + out = it.util.cleanUpCode(out); + if ($top) { + out = it.util.finalCleanUpCode(out, $async); + } + + function $shouldUseGroup($rulesGroup) { + var rules = $rulesGroup.rules; + for (var i = 0; i < rules.length; i++) + if ($shouldUseRule(rules[i])) return true; + } + + function $shouldUseRule($rule) { + return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule)); + } + + function $ruleImplementsSomeKeyword($rule) { + var impl = $rule.implements; + for (var i = 0; i < impl.length; i++) + if (it.schema[impl[i]] !== undefined) return true; + } + return out; +} + + /***/ }), /* 392 */ /***/ (function(module, exports, __webpack_require__) { @@ -81593,7 +81747,7 @@ module.exports = InputPrompt; var _ = __webpack_require__(38); var MuteStream = __webpack_require__(401); -var readline = __webpack_require__(197); +var readline = __webpack_require__(198); /** * Base interface class other can inherits from @@ -81680,7 +81834,7 @@ module.exports = UI; "use strict"; -var ansiEscapes = __webpack_require__(504); +var ansiEscapes = __webpack_require__(472); /** * Move cursor left by `x` @@ -81751,7 +81905,7 @@ module.exports = [["a140","",62],["a180","",32],["a240","",62],["a280", "use strict"; -module.exports = __webpack_require__(601).isCI +module.exports = __webpack_require__(569).isCI /***/ }), @@ -82607,7 +82761,7 @@ module.exports = { /**/ -var pna = __webpack_require__(180); +var pna = __webpack_require__(181); /**/ module.exports = Readable; @@ -82623,7 +82777,7 @@ var Duplex; Readable.ReadableState = ReadableState; /**/ -var EE = __webpack_require__(76).EventEmitter; +var EE = __webpack_require__(77).EventEmitter; var EElistenerCount = function (emitter, type) { return emitter.listeners(type).length; @@ -82683,7 +82837,7 @@ function prependListener(emitter, event, fn) { } function ReadableState(options, stream) { - Duplex = Duplex || __webpack_require__(115); + Duplex = Duplex || __webpack_require__(116); options = options || {}; @@ -82760,7 +82914,7 @@ function ReadableState(options, stream) { } function Readable(options) { - Duplex = Duplex || __webpack_require__(115); + Duplex = Duplex || __webpack_require__(116); if (!(this instanceof Readable)) return new Readable(options); @@ -83674,7 +83828,7 @@ function indexOf(xs, x) { module.exports = Transform; -var Duplex = __webpack_require__(115); +var Duplex = __webpack_require__(116); /**/ var util = __webpack_require__(113); @@ -83856,7 +84010,7 @@ function done(stream, er, data) { /**/ -var pna = __webpack_require__(180); +var pna = __webpack_require__(181); /**/ module.exports = Writable; @@ -83927,7 +84081,7 @@ util.inherits(Writable, Stream); function nop() {} function WritableState(options, stream) { - Duplex = Duplex || __webpack_require__(115); + Duplex = Duplex || __webpack_require__(116); options = options || {}; @@ -84077,7 +84231,7 @@ if (typeof Symbol === 'function' && Symbol.hasInstance && typeof Function.protot } function Writable(options) { - Duplex = Duplex || __webpack_require__(115); + Duplex = Duplex || __webpack_require__(116); // Writable ctor is applied to Duplexes, too. // `realHasInstance` is necessary because using plain `instanceof` @@ -84524,7 +84678,7 @@ Writable.prototype._destroy = function (err, cb) { /**/ -var pna = __webpack_require__(180); +var pna = __webpack_require__(181); /**/ // undocumented cb() API, needed for core, not for public API @@ -85005,7 +85159,7 @@ module.exports = function () { /***/ (function(module, exports, __webpack_require__) { var path = __webpack_require__(0); -var fs = __webpack_require__(5); +var fs = __webpack_require__(4); var parse = path.parse || __webpack_require__(774); module.exports = function nodeModulesPaths(start, opts) { @@ -85059,7 +85213,7 @@ module.exports = function nodeModulesPaths(start, opts) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return BehaviorSubject; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__ = __webpack_require__(189); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_ObjectUnsubscribedError__ = __webpack_require__(190); /** PURE_IMPORTS_START tslib,_Subject,_util_ObjectUnsubscribedError PURE_IMPORTS_END */ @@ -85111,7 +85265,7 @@ var BehaviorSubject = /*@__PURE__*/ (function (_super) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return empty; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(185); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__config__ = __webpack_require__(186); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_hostReportError__ = __webpack_require__(323); /** PURE_IMPORTS_START _config,_util_hostReportError PURE_IMPORTS_END */ @@ -85210,7 +85364,7 @@ var SubjectSubscription = /*@__PURE__*/ (function (_super) { /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return connectableObservableDescriptor; }); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subject__ = __webpack_require__(36); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Subscriber__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subscription__ = __webpack_require__(25); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__operators_refCount__ = __webpack_require__(316); @@ -85365,8 +85519,8 @@ var RefCountSubscriber = /*@__PURE__*/ (function (_super) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = merge; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isScheduler__ = __webpack_require__(49); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__operators_mergeAll__ = __webpack_require__(315); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__fromArray__ = __webpack_require__(85); /** PURE_IMPORTS_START _Observable,_util_isScheduler,_operators_mergeAll,_fromArray PURE_IMPORTS_END */ @@ -85406,8 +85560,8 @@ function merge() { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return NEVER; }); /* harmony export (immutable) */ __webpack_exports__["a"] = never; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_noop__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_noop__ = __webpack_require__(192); /** PURE_IMPORTS_START _Observable,_util_noop PURE_IMPORTS_END */ @@ -85517,10 +85671,10 @@ var RaceSubscriber = /*@__PURE__*/ (function (_super) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = timer; -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__scheduler_async__ = __webpack_require__(40); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(190); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(48); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_isNumeric__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isScheduler__ = __webpack_require__(49); /** PURE_IMPORTS_START _Observable,_scheduler_async,_util_isNumeric,_util_isScheduler PURE_IMPORTS_END */ @@ -85571,8 +85725,8 @@ function dispatch(state) { "use strict"; /* harmony export (immutable) */ __webpack_exports__["a"] = audit; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_tryCatch__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_errorObject__ = __webpack_require__(48); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__OuterSubscriber__ = __webpack_require__(13); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__util_subscribeToResult__ = __webpack_require__(14); /** PURE_IMPORTS_START tslib,_util_tryCatch,_util_errorObject,_OuterSubscriber,_util_subscribeToResult PURE_IMPORTS_END */ @@ -85684,8 +85838,8 @@ function concatMap(project, resultSelector) { /* harmony export (immutable) */ __webpack_exports__["a"] = distinctUntilChanged; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(56); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(47); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_tryCatch__ = __webpack_require__(57); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_errorObject__ = __webpack_require__(48); /** PURE_IMPORTS_START tslib,_Subscriber,_util_tryCatch,_util_errorObject PURE_IMPORTS_END */ @@ -85828,7 +85982,7 @@ var FindValueSubscriber = /*@__PURE__*/ (function (_super) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Subscription__ = __webpack_require__(25); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__Subject__ = __webpack_require__(36); /** PURE_IMPORTS_START tslib,_Subscriber,_Subscription,_Observable,_Subject PURE_IMPORTS_END */ @@ -86025,7 +86179,7 @@ var InnerRefCountSubscription = /*@__PURE__*/ (function (_super) { /* unused harmony export ObserveOnMessage */ /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(184); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__Notification__ = __webpack_require__(185); /** PURE_IMPORTS_START tslib,_Subscriber,_Notification PURE_IMPORTS_END */ @@ -86105,7 +86259,7 @@ var ObserveOnMessage = /*@__PURE__*/ (function () { /* harmony export (immutable) */ __webpack_exports__["a"] = tap; /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_noop__ = __webpack_require__(191); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__util_noop__ = __webpack_require__(192); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__util_isFunction__ = __webpack_require__(154); /** PURE_IMPORTS_START tslib,_Subscriber,_util_noop,_util_isFunction PURE_IMPORTS_END */ @@ -86492,7 +86646,7 @@ function isPromise(value) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeTo; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(11); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__Observable__ = __webpack_require__(12); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeToArray__ = __webpack_require__(447); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__subscribeToPromise__ = __webpack_require__(450); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__subscribeToIterable__ = __webpack_require__(448); @@ -86501,7 +86655,7 @@ function isPromise(value) { /* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__isPromise__ = __webpack_require__(445); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__isObject__ = __webpack_require__(444); /* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__symbol_iterator__ = __webpack_require__(151); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__symbol_observable__ = __webpack_require__(118); /** PURE_IMPORTS_START _Observable,_subscribeToArray,_subscribeToPromise,_subscribeToIterable,_subscribeToObservable,_isArrayLike,_isPromise,_isObject,_symbol_iterator,_symbol_observable PURE_IMPORTS_END */ @@ -86610,7 +86764,7 @@ var subscribeToIterable = function (iterable) { "use strict"; /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return subscribeToObservable; }); -/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(117); +/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__symbol_observable__ = __webpack_require__(118); /** PURE_IMPORTS_START _symbol_observable PURE_IMPORTS_END */ var subscribeToObservable = function (obj) { @@ -86661,7 +86815,7 @@ var subscribeToPromise = function (promise) { var assert = __webpack_require__(28) var signals = __webpack_require__(933) -var EE = __webpack_require__(76) +var EE = __webpack_require__(77) /* istanbul ignore if */ if (typeof EE !== 'function') { EE = EE.EventEmitter @@ -86851,11 +87005,11 @@ var stream = __webpack_require__(23); var util = __webpack_require__(3); var assert = __webpack_require__(16); var Buffer = __webpack_require__(15).Buffer; -var Signature = __webpack_require__(74); +var Signature = __webpack_require__(75); function Verifier(key, hashAlgo) { if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + @@ -86903,7 +87057,7 @@ Verifier.prototype.verify = function (signature, fmt) { function Signer(key, hashAlgo) { if (nacl === undefined) - nacl = __webpack_require__(75); + nacl = __webpack_require__(76); if (hashAlgo.toLowerCase() !== 'sha512') throw (new Error('ED25519 only supports the use of ' + @@ -87070,7 +87224,7 @@ var utils = __webpack_require__(26); var Key = __webpack_require__(27); var PrivateKey = __webpack_require__(33); -var sshpriv = __webpack_require__(192); +var sshpriv = __webpack_require__(193); /*JSSTYLED*/ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([ \t]+([^ \t][^\n]*[\n]*)?)?$/; @@ -87188,7 +87342,7 @@ module.exports = { }; var assert = __webpack_require__(16); -var asn1 = __webpack_require__(65); +var asn1 = __webpack_require__(66); var Buffer = __webpack_require__(15).Buffer; var algs = __webpack_require__(32); var utils = __webpack_require__(26); @@ -87196,7 +87350,7 @@ var Key = __webpack_require__(27); var PrivateKey = __webpack_require__(33); var pem = __webpack_require__(86); var Identity = __webpack_require__(158); -var Signature = __webpack_require__(74); +var Signature = __webpack_require__(75); var Certificate = __webpack_require__(155); var pkcs8 = __webpack_require__(157); @@ -88215,7 +88369,7 @@ function simpleEnd(buf) { /***/ (function(module, exports, __webpack_require__) { var toBuffer = __webpack_require__(462) -var alloc = __webpack_require__(380) +var alloc = __webpack_require__(374) var ZEROS = '0000000000000000000' var SEVENS = '7777777777777777777' @@ -88666,7 +88820,7 @@ module.exports = bytesToUuid; // Unique ID creation requires a high quality random # generator. In node.js // this is pretty straight-forward - we use the crypto API. -var crypto = __webpack_require__(12); +var crypto = __webpack_require__(11); module.exports = function nodeRNG() { return crypto.randomBytes(16); @@ -88725,7 +88879,7 @@ exports.default = handleSignals; var _child; function _load_child() { - return _child = __webpack_require__(58); + return _child = __webpack_require__(50); } function forwardSignalAndExit(signal) { @@ -88819,7 +88973,7 @@ module.exports = function (arg) { var util = __webpack_require__(3); var onExit = __webpack_require__(451); -var currentlyUnhandled = __webpack_require__(629); +var currentlyUnhandled = __webpack_require__(597); var installed = false; @@ -88861,7 +89015,7 @@ module.exports = function (log) { "use strict"; -const fs = __webpack_require__(391); +const fs = __webpack_require__(385); const path = __webpack_require__(0); const retry = __webpack_require__(819); const syncFs = __webpack_require__(779); @@ -89247,2038 +89401,1417 @@ module.exports.checkSync = checkSync; "use strict"; +const x = module.exports; +const ESC = '\u001B['; +const OSC = '\u001B]'; +const BEL = '\u0007'; +const SEP = ';'; +const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal'; -var KEYWORDS = [ - 'multipleOf', - 'maximum', - 'exclusiveMaximum', - 'minimum', - 'exclusiveMinimum', - 'maxLength', - 'minLength', - 'pattern', - 'additionalItems', - 'maxItems', - 'minItems', - 'uniqueItems', - 'maxProperties', - 'minProperties', - 'required', - 'additionalProperties', - 'enum', - 'format', - 'const' -]; - -module.exports = function (metaSchema, keywordsJsonPointers) { - for (var i=0; i { + if (typeof x !== 'number') { + throw new TypeError('The `x` argument is required'); + } - for (j=0; j { + if (typeof x !== 'number') { + throw new TypeError('The `x` argument is required'); + } -/***/ }), -/* 473 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - -var compileSchema = __webpack_require__(478) - , resolve = __webpack_require__(203) - , Cache = __webpack_require__(474) - , SchemaObject = __webpack_require__(339) - , stableStringify = __webpack_require__(389) - , formats = __webpack_require__(477) - , rules = __webpack_require__(479) - , $dataMetaSchema = __webpack_require__(472) - , patternGroups = __webpack_require__(500) - , util = __webpack_require__(106) - , co = __webpack_require__(383); + let ret = ''; -module.exports = Ajv; + if (x < 0) { + ret += ESC + (-x) + 'D'; + } else if (x > 0) { + ret += ESC + x + 'C'; + } -Ajv.prototype.validate = validate; -Ajv.prototype.compile = compile; -Ajv.prototype.addSchema = addSchema; -Ajv.prototype.addMetaSchema = addMetaSchema; -Ajv.prototype.validateSchema = validateSchema; -Ajv.prototype.getSchema = getSchema; -Ajv.prototype.removeSchema = removeSchema; -Ajv.prototype.addFormat = addFormat; -Ajv.prototype.errorsText = errorsText; + if (y < 0) { + ret += ESC + (-y) + 'A'; + } else if (y > 0) { + ret += ESC + y + 'B'; + } -Ajv.prototype._addSchema = _addSchema; -Ajv.prototype._compile = _compile; + return ret; +}; -Ajv.prototype.compileAsync = __webpack_require__(476); -var customKeyword = __webpack_require__(499); -Ajv.prototype.addKeyword = customKeyword.add; -Ajv.prototype.getKeyword = customKeyword.get; -Ajv.prototype.removeKeyword = customKeyword.remove; +x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A'; +x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B'; +x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C'; +x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D'; -var errorClasses = __webpack_require__(202); -Ajv.ValidationError = errorClasses.Validation; -Ajv.MissingRefError = errorClasses.MissingRef; -Ajv.$dataMetaSchema = $dataMetaSchema; +x.cursorLeft = ESC + 'G'; +x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's'); +x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u'); +x.cursorGetPosition = ESC + '6n'; +x.cursorNextLine = ESC + 'E'; +x.cursorPrevLine = ESC + 'F'; +x.cursorHide = ESC + '?25l'; +x.cursorShow = ESC + '?25h'; -var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; +x.eraseLines = count => { + let clear = ''; -var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes' ]; -var META_SUPPORT_DATA = ['/properties']; + for (let i = 0; i < count; i++) { + clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : ''); + } -/** - * Creates validator instance. - * Usage: `Ajv(opts)` - * @param {Object} opts optional options - * @return {Object} ajv instance - */ -function Ajv(opts) { - if (!(this instanceof Ajv)) return new Ajv(opts); - opts = this._opts = util.copy(opts) || {}; - setLogger(this); - this._schemas = {}; - this._refs = {}; - this._fragments = {}; - this._formats = formats(opts.format); - var schemaUriFormat = this._schemaUriFormat = this._formats['uri-reference']; - this._schemaUriFormatFunc = function (str) { return schemaUriFormat.test(str); }; + if (count) { + clear += x.cursorLeft; + } - this._cache = opts.cache || new Cache; - this._loadingSchemas = {}; - this._compilations = []; - this.RULES = rules(); - this._getId = chooseGetId(opts); + return clear; +}; - opts.loopRequired = opts.loopRequired || Infinity; - if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true; - if (opts.serialize === undefined) opts.serialize = stableStringify; - this._metaOpts = getMetaSchemaOptions(this); +x.eraseEndLine = ESC + 'K'; +x.eraseStartLine = ESC + '1K'; +x.eraseLine = ESC + '2K'; +x.eraseDown = ESC + 'J'; +x.eraseUp = ESC + '1J'; +x.eraseScreen = ESC + '2J'; +x.scrollUp = ESC + 'S'; +x.scrollDown = ESC + 'T'; - if (opts.formats) addInitialFormats(this); - addDraft6MetaSchema(this); - if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta); - addInitialSchemas(this); - if (opts.patternGroups) patternGroups(this); -} +x.clearScreen = '\u001Bc'; +x.beep = BEL; +x.link = (text, url) => { + return [ + OSC, + '8', + SEP, + SEP, + url, + BEL, + text, + OSC, + '8', + SEP, + SEP, + BEL + ].join(''); +}; +x.image = (buf, opts) => { + opts = opts || {}; -/** - * Validate data using schema - * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize. - * @this Ajv - * @param {String|Object} schemaKeyRef key, ref or schema object - * @param {Any} data to be validated - * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`). - */ -function validate(schemaKeyRef, data) { - var v; - if (typeof schemaKeyRef == 'string') { - v = this.getSchema(schemaKeyRef); - if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"'); - } else { - var schemaObj = this._addSchema(schemaKeyRef); - v = schemaObj.validate || this._compile(schemaObj); - } + let ret = OSC + '1337;File=inline=1'; - var valid = v(data); - if (v.$async === true) - return this._opts.async == '*' ? co(valid) : valid; - this.errors = v.errors; - return valid; -} + if (opts.width) { + ret += `;width=${opts.width}`; + } + if (opts.height) { + ret += `;height=${opts.height}`; + } -/** - * Create validating function for passed schema. - * @this Ajv - * @param {Object} schema schema object - * @param {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords. - * @return {Function} validating function - */ -function compile(schema, _meta) { - var schemaObj = this._addSchema(schema, undefined, _meta); - return schemaObj.validate || this._compile(schemaObj); -} + if (opts.preserveAspectRatio === false) { + ret += ';preserveAspectRatio=0'; + } + return ret + ':' + buf.toString('base64') + BEL; +}; -/** - * Adds schema to the instance. - * @this Ajv - * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored. - * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`. - * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead. - * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead. - * @return {Ajv} this for method chaining - */ -function addSchema(schema, key, _skipValidation, _meta) { - if (Array.isArray(schema)){ - for (var i=0; i OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; -/** - * Add schema that will be used to validate other schemas - * options in META_IGNORE_OPTIONS are alway set to false - * @this Ajv - * @param {Object} schema schema object - * @param {String} key optional schema key - * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema - * @return {Ajv} this for method chaining - */ -function addMetaSchema(schema, key, skipValidation) { - this.addSchema(schema, key, skipValidation, true); - return this; -} +/***/ }), +/* 473 */ +/***/ (function(module, exports, __webpack_require__) { -/** - * Validate schema - * @this Ajv - * @param {Object} schema schema to validate - * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid - * @return {Boolean} true if schema is valid - */ -function validateSchema(schema, throwOrLogError) { - var $schema = schema.$schema; - if ($schema !== undefined && typeof $schema != 'string') - throw new Error('$schema must be a string'); - $schema = $schema || this._opts.defaultMeta || defaultMeta(this); - if (!$schema) { - this.logger.warn('meta-schema not available'); - this.errors = null; - return true; - } - var currentUriFormat = this._formats.uri; - this._formats.uri = typeof currentUriFormat == 'function' - ? this._schemaUriFormatFunc - : this._schemaUriFormat; - var valid; - try { valid = this.validate($schema, schema); } - finally { this._formats.uri = currentUriFormat; } - if (!valid && throwOrLogError) { - var message = 'schema is invalid: ' + this.errorsText(); - if (this._opts.validateSchema == 'log') this.logger.error(message); - else throw new Error(message); - } - return valid; -} +"use strict"; +module.exports = function () { + return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; +}; -function defaultMeta(self) { - var meta = self._opts.meta; - self._opts.defaultMeta = typeof meta == 'object' - ? self._getId(meta) || meta - : self.getSchema(META_SCHEMA_ID) - ? META_SCHEMA_ID - : undefined; - return self._opts.defaultMeta; -} +/***/ }), +/* 474 */ +/***/ (function(module, exports, __webpack_require__) { -/** - * Get compiled schema from the instance by `key` or `ref`. - * @this Ajv - * @param {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id). - * @return {Function} schema validating function (with property `schema`). - */ -function getSchema(keyRef) { - var schemaObj = _getSchemaObj(this, keyRef); - switch (typeof schemaObj) { - case 'object': return schemaObj.validate || this._compile(schemaObj); - case 'string': return this.getSchema(schemaObj); - case 'undefined': return _getSchemaFragment(this, keyRef); - } -} +"use strict"; +/* WEBPACK VAR INJECTION */(function(module) { +const colorConvert = __webpack_require__(576); +const wrapAnsi16 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${code + offset}m`; +}; -function _getSchemaFragment(self, ref) { - var res = resolve.schema.call(self, { schema: {} }, ref); - if (res) { - var schema = res.schema - , root = res.root - , baseId = res.baseId; - var v = compileSchema.call(self, schema, root, undefined, baseId); - self._fragments[ref] = new SchemaObject({ - ref: ref, - fragment: true, - schema: schema, - root: root, - baseId: baseId, - validate: v - }); - return v; - } -} +const wrapAnsi256 = (fn, offset) => function () { + const code = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};5;${code}m`; +}; +const wrapAnsi16m = (fn, offset) => function () { + const rgb = fn.apply(colorConvert, arguments); + return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; +}; -function _getSchemaObj(self, keyRef) { - keyRef = resolve.normalizeId(keyRef); - return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef]; -} +function assembleStyles() { + const codes = new Map(); + const styles = { + modifier: { + reset: [0, 0], + // 21 isn't widely supported and 22 does the same thing + bold: [1, 22], + dim: [2, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + hidden: [8, 28], + strikethrough: [9, 29] + }, + color: { + black: [30, 39], + red: [31, 39], + green: [32, 39], + yellow: [33, 39], + blue: [34, 39], + magenta: [35, 39], + cyan: [36, 39], + white: [37, 39], + gray: [90, 39], + // Bright color + redBright: [91, 39], + greenBright: [92, 39], + yellowBright: [93, 39], + blueBright: [94, 39], + magentaBright: [95, 39], + cyanBright: [96, 39], + whiteBright: [97, 39] + }, + bgColor: { + bgBlack: [40, 49], + bgRed: [41, 49], + bgGreen: [42, 49], + bgYellow: [43, 49], + bgBlue: [44, 49], + bgMagenta: [45, 49], + bgCyan: [46, 49], + bgWhite: [47, 49], -/** - * Remove cached schema(s). - * If no parameter is passed all schemas but meta-schemas are removed. - * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed. - * Even if schema is referenced by other schemas it still can be removed as other schemas have local references. - * @this Ajv - * @param {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object - * @return {Ajv} this for method chaining - */ -function removeSchema(schemaKeyRef) { - if (schemaKeyRef instanceof RegExp) { - _removeAllSchemas(this, this._schemas, schemaKeyRef); - _removeAllSchemas(this, this._refs, schemaKeyRef); - return this; - } - switch (typeof schemaKeyRef) { - case 'undefined': - _removeAllSchemas(this, this._schemas); - _removeAllSchemas(this, this._refs); - this._cache.clear(); - return this; - case 'string': - var schemaObj = _getSchemaObj(this, schemaKeyRef); - if (schemaObj) this._cache.del(schemaObj.cacheKey); - delete this._schemas[schemaKeyRef]; - delete this._refs[schemaKeyRef]; - return this; - case 'object': - var serialize = this._opts.serialize; - var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef; - this._cache.del(cacheKey); - var id = this._getId(schemaKeyRef); - if (id) { - id = resolve.normalizeId(id); - delete this._schemas[id]; - delete this._refs[id]; - } - } - return this; -} + // Bright color + bgBlackBright: [100, 49], + bgRedBright: [101, 49], + bgGreenBright: [102, 49], + bgYellowBright: [103, 49], + bgBlueBright: [104, 49], + bgMagentaBright: [105, 49], + bgCyanBright: [106, 49], + bgWhiteBright: [107, 49] + } + }; + // Fix humans + styles.color.grey = styles.color.gray; -function _removeAllSchemas(self, schemas, regex) { - for (var keyRef in schemas) { - var schemaObj = schemas[keyRef]; - if (!schemaObj.meta && (!regex || regex.test(keyRef))) { - self._cache.del(schemaObj.cacheKey); - delete schemas[keyRef]; - } - } -} + for (const groupName of Object.keys(styles)) { + const group = styles[groupName]; + for (const styleName of Object.keys(group)) { + const style = group[styleName]; -/* @this Ajv */ -function _addSchema(schema, skipValidation, meta, shouldAddSchema) { - if (typeof schema != 'object' && typeof schema != 'boolean') - throw new Error('schema should be object or boolean'); - var serialize = this._opts.serialize; - var cacheKey = serialize ? serialize(schema) : schema; - var cached = this._cache.get(cacheKey); - if (cached) return cached; + styles[styleName] = { + open: `\u001B[${style[0]}m`, + close: `\u001B[${style[1]}m` + }; - shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false; + group[styleName] = styles[styleName]; - var id = resolve.normalizeId(this._getId(schema)); - if (id && shouldAddSchema) checkUnique(this, id); + codes.set(style[0], style[1]); + } - var willValidate = this._opts.validateSchema !== false && !skipValidation; - var recursiveMeta; - if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema))) - this.validateSchema(schema, true); + Object.defineProperty(styles, groupName, { + value: group, + enumerable: false + }); - var localRefs = resolve.ids.call(this, schema); + Object.defineProperty(styles, 'codes', { + value: codes, + enumerable: false + }); + } - var schemaObj = new SchemaObject({ - id: id, - schema: schema, - localRefs: localRefs, - cacheKey: cacheKey, - meta: meta - }); + const ansi2ansi = n => n; + const rgb2rgb = (r, g, b) => [r, g, b]; - if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj; - this._cache.put(cacheKey, schemaObj); + styles.color.close = '\u001B[39m'; + styles.bgColor.close = '\u001B[49m'; - if (willValidate && recursiveMeta) this.validateSchema(schema, true); + styles.color.ansi = { + ansi: wrapAnsi16(ansi2ansi, 0) + }; + styles.color.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 0) + }; + styles.color.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 0) + }; - return schemaObj; -} + styles.bgColor.ansi = { + ansi: wrapAnsi16(ansi2ansi, 10) + }; + styles.bgColor.ansi256 = { + ansi256: wrapAnsi256(ansi2ansi, 10) + }; + styles.bgColor.ansi16m = { + rgb: wrapAnsi16m(rgb2rgb, 10) + }; + for (let key of Object.keys(colorConvert)) { + if (typeof colorConvert[key] !== 'object') { + continue; + } -/* @this Ajv */ -function _compile(schemaObj, root) { - if (schemaObj.compiling) { - schemaObj.validate = callValidate; - callValidate.schema = schemaObj.schema; - callValidate.errors = null; - callValidate.root = root ? root : callValidate; - if (schemaObj.schema.$async === true) - callValidate.$async = true; - return callValidate; - } - schemaObj.compiling = true; + const suite = colorConvert[key]; - var currentOpts; - if (schemaObj.meta) { - currentOpts = this._opts; - this._opts = this._metaOpts; - } + if (key === 'ansi16') { + key = 'ansi'; + } - var v; - try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); } - finally { - schemaObj.compiling = false; - if (schemaObj.meta) this._opts = currentOpts; - } + if ('ansi16' in suite) { + styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); + styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); + } - schemaObj.validate = v; - schemaObj.refs = v.refs; - schemaObj.refVal = v.refVal; - schemaObj.root = v.root; - return v; + if ('ansi256' in suite) { + styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); + styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); + } + if ('rgb' in suite) { + styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); + styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); + } + } - function callValidate() { - var _validate = schemaObj.validate; - var result = _validate.apply(null, arguments); - callValidate.errors = _validate.errors; - return result; - } + return styles; } +// Make the export immutable +Object.defineProperty(module, 'exports', { + enumerable: true, + get: assembleStyles +}); -function chooseGetId(opts) { - switch (opts.schemaId) { - case '$id': return _get$Id; - case 'id': return _getId; - default: return _get$IdOrId; - } -} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(163)(module))) -/* @this Ajv */ -function _getId(schema) { - if (schema.$id) this.logger.warn('schema $id ignored', schema.$id); - return schema.id; -} +/***/ }), +/* 475 */ +/***/ (function(module, exports) { -/* @this Ajv */ -function _get$Id(schema) { - if (schema.id) this.logger.warn('schema id ignored', schema.id); - return schema.$id; +function webpackEmptyContext(req) { + throw new Error("Cannot find module '" + req + "'."); } +webpackEmptyContext.keys = function() { return []; }; +webpackEmptyContext.resolve = webpackEmptyContext; +module.exports = webpackEmptyContext; +webpackEmptyContext.id = 475; +/***/ }), +/* 476 */ +/***/ (function(module, exports, __webpack_require__) { -function _get$IdOrId(schema) { - if (schema.$id && schema.id && schema.$id != schema.id) - throw new Error('schema $id is different from id'); - return schema.$id || schema.id; -} +"use strict"; + // global key for user preferred registration +var REGISTRATION_KEY = '@@any-promise/REGISTRATION', + // Prior registration (preferred or detected) + registered = null /** - * Convert array of error message objects to string - * @this Ajv - * @param {Array} errors optional array of validation errors, if not passed errors from the instance are used. - * @param {Object} options optional options with properties `separator` and `dataVar`. - * @return {String} human readable string with all errors descriptions + * Registers the given implementation. An implementation must + * be registered prior to any call to `require("any-promise")`, + * typically on application load. + * + * If called with no arguments, will return registration in + * following priority: + * + * For Node.js: + * + * 1. Previous registration + * 2. global.Promise if node.js version >= 0.12 + * 3. Auto detected promise based on first sucessful require of + * known promise libraries. Note this is a last resort, as the + * loaded library is non-deterministic. node.js >= 0.12 will + * always use global.Promise over this priority list. + * 4. Throws error. + * + * For Browser: + * + * 1. Previous registration + * 2. window.Promise + * 3. Throws error. + * + * Options: + * + * Promise: Desired Promise constructor + * global: Boolean - Should the registration be cached in a global variable to + * allow cross dependency/bundle registration? (default true) */ -function errorsText(errors, options) { - errors = errors || this.errors; - if (!errors) return 'No errors'; - options = options || {}; - var separator = options.separator === undefined ? ', ' : options.separator; - var dataVar = options.dataVar === undefined ? 'data' : options.dataVar; +module.exports = function(root, loadImplementation){ + return function register(implementation, opts){ + implementation = implementation || null + opts = opts || {} + // global registration unless explicitly {global: false} in options (default true) + var registerGlobal = opts.global !== false; - var text = ''; - for (var i=0; i + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + */ -var Cache = module.exports = function Cache() { - this._cache = {}; -}; - - -Cache.prototype.put = function Cache_put(key, value) { - this._cache[key] = value; +module.exports = function (arr) { + return flat(arr, []); }; - -Cache.prototype.get = function Cache_get(key) { - return this._cache[key]; -}; +function flat(arr, res) { + var i = 0, cur; + var len = arr.length; + for (; i < len; i++) { + cur = arr[i]; + Array.isArray(cur) ? flat(cur, res) : res.push(cur); + } + return res; +} -Cache.prototype.del = function Cache_del(key) { - delete this._cache[key]; -}; +/***/ }), +/* 479 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -Cache.prototype.clear = function Cache_clear() { - this._cache = {}; -}; +module.exports = function (arr, predicate, ctx) { + if (typeof Array.prototype.findIndex === 'function') { + return arr.findIndex(predicate, ctx); + } + if (typeof predicate !== 'function') { + throw new TypeError('predicate must be a function'); + } -/***/ }), -/* 475 */ -/***/ (function(module, exports, __webpack_require__) { + var list = Object(arr); + var len = list.length; -"use strict"; + if (len === 0) { + return -1; + } + for (var i = 0; i < len; i++) { + if (predicate.call(ctx, list[i], i, list)) { + return i; + } + } -//all requires must be explicit because browserify won't work with dynamic requires -module.exports = { - '$ref': __webpack_require__(496), - allOf: __webpack_require__(481), - anyOf: __webpack_require__(482), - const: __webpack_require__(483), - contains: __webpack_require__(484), - dependencies: __webpack_require__(486), - 'enum': __webpack_require__(487), - format: __webpack_require__(488), - items: __webpack_require__(489), - maximum: __webpack_require__(340), - minimum: __webpack_require__(340), - maxItems: __webpack_require__(341), - minItems: __webpack_require__(341), - maxLength: __webpack_require__(342), - minLength: __webpack_require__(342), - maxProperties: __webpack_require__(343), - minProperties: __webpack_require__(343), - multipleOf: __webpack_require__(490), - not: __webpack_require__(491), - oneOf: __webpack_require__(492), - pattern: __webpack_require__(493), - properties: __webpack_require__(494), - propertyNames: __webpack_require__(495), - required: __webpack_require__(497), - uniqueItems: __webpack_require__(498), - validate: __webpack_require__(344) + return -1; }; /***/ }), -/* 476 */ +/* 480 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var MissingRefError = __webpack_require__(202).MissingRef; - -module.exports = compileAsync; - +var rawAsap = __webpack_require__(481); +var freeTasks = []; /** - * Creates validating function for passed schema with asynchronous loading of missing schemas. - * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema. - * @this Ajv - * @param {Object} schema schema object - * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped - * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function. - * @return {Promise} promise that resolves with a validating function. + * Calls a task as soon as possible after returning, in its own event, with + * priority over IO events. An exception thrown in a task can be handled by + * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise + * crash the process. If the error is handled, all subsequent tasks will + * resume. + * + * @param {{call}} task A callable object, typically a function that takes no + * arguments. */ -function compileAsync(schema, meta, callback) { - /* eslint no-shadow: 0 */ - /* global Promise */ - /* jshint validthis: true */ - var self = this; - if (typeof this._opts.loadSchema != 'function') - throw new Error('options.loadSchema should be a function'); +module.exports = asap; +function asap(task) { + var rawTask; + if (freeTasks.length) { + rawTask = freeTasks.pop(); + } else { + rawTask = new RawTask(); + } + rawTask.task = task; + rawTask.domain = process.domain; + rawAsap(rawTask); +} - if (typeof meta == 'function') { - callback = meta; - meta = undefined; - } +function RawTask() { + this.task = null; + this.domain = null; +} - var p = loadMetaSchemaOf(schema).then(function () { - var schemaObj = self._addSchema(schema, undefined, meta); - return schemaObj.validate || _compileAsync(schemaObj); - }); +RawTask.prototype.call = function () { + if (this.domain) { + this.domain.enter(); + } + var threw = true; + try { + this.task.call(); + threw = false; + // If the task throws an exception (presumably) Node.js restores the + // domain stack for the next event. + if (this.domain) { + this.domain.exit(); + } + } finally { + // We use try/finally and a threw flag to avoid messing up stack traces + // when we catch and release errors. + if (threw) { + // In Node.js, uncaught exceptions are considered fatal errors. + // Re-throw them to interrupt flushing! + // Ensure that flushing continues if an uncaught exception is + // suppressed listening process.on("uncaughtException") or + // domain.on("error"). + rawAsap.requestFlush(); + } + // If the task threw an error, we do not want to exit the domain here. + // Exiting the domain would prevent the domain from catching the error. + this.task = null; + this.domain = null; + freeTasks.push(this); + } +}; - if (callback) { - p.then( - function(v) { callback(null, v); }, - callback - ); - } - return p; +/***/ }), +/* 481 */ +/***/ (function(module, exports, __webpack_require__) { - function loadMetaSchemaOf(sch) { - var $schema = sch.$schema; - return $schema && !self.getSchema($schema) - ? compileAsync.call(self, { $ref: $schema }, true) - : Promise.resolve(); - } +"use strict"; - function _compileAsync(schemaObj) { - try { return self._compile(schemaObj); } - catch(e) { - if (e instanceof MissingRefError) return loadMissingSchema(e); - throw e; - } +var domain; // The domain module is executed on demand +var hasSetImmediate = typeof setImmediate === "function"; +// Use the fastest means possible to execute a task in its own turn, with +// priority over other events including network IO events in Node.js. +// +// An exception thrown by a task will permanently interrupt the processing of +// subsequent tasks. The higher level `asap` function ensures that if an +// exception is thrown by a task, that the task queue will continue flushing as +// soon as possible, but if you use `rawAsap` directly, you are responsible to +// either ensure that no exceptions are thrown from your task, or to manually +// call `rawAsap.requestFlush` if an exception is thrown. +module.exports = rawAsap; +function rawAsap(task) { + if (!queue.length) { + requestFlush(); + flushing = true; + } + // Avoids a function call + queue[queue.length] = task; +} - function loadMissingSchema(e) { - var ref = e.missingSchema; - if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved'); +var queue = []; +// Once a flush has been requested, no further calls to `requestFlush` are +// necessary until the next `flush` completes. +var flushing = false; +// The position of the next task to execute in the task queue. This is +// preserved between calls to `flush` so that it can be resumed if +// a task throws an exception. +var index = 0; +// If a task schedules additional tasks recursively, the task queue can grow +// unbounded. To prevent memory excaustion, the task queue will periodically +// truncate already-completed tasks. +var capacity = 1024; - var schemaPromise = self._loadingSchemas[ref]; - if (!schemaPromise) { - schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref); - schemaPromise.then(removePromise, removePromise); - } +// The flush function processes all tasks that have been scheduled with +// `rawAsap` unless and until one of those tasks throws an exception. +// If a task throws an exception, `flush` ensures that its state will remain +// consistent and will resume where it left off when called again. +// However, `flush` does not make any arrangements to be called again if an +// exception is thrown. +function flush() { + while (index < queue.length) { + var currentIndex = index; + // Advance the index before calling the task. This ensures that we will + // begin flushing on the next task the task throws an error. + index = index + 1; + queue[currentIndex].call(); + // Prevent leaking memory for long chains of recursive calls to `asap`. + // If we call `asap` within tasks scheduled by `asap`, the queue will + // grow, but to avoid an O(n) walk for every task we execute, we don't + // shift tasks off the queue after they have been executed. + // Instead, we periodically shift 1024 tasks off the queue. + if (index > capacity) { + // Manually shift all values starting at the index back to the + // beginning of the queue. + for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { + queue[scan] = queue[scan + index]; + } + queue.length -= index; + index = 0; + } + } + queue.length = 0; + index = 0; + flushing = false; +} - return schemaPromise.then(function (sch) { - if (!added(ref)) { - return loadMetaSchemaOf(sch).then(function () { - if (!added(ref)) self.addSchema(sch, ref, undefined, meta); - }); +rawAsap.requestFlush = requestFlush; +function requestFlush() { + // Ensure flushing is not bound to any domain. + // It is not sufficient to exit the domain, because domains exist on a stack. + // To execute code outside of any domain, the following dance is necessary. + var parentDomain = process.domain; + if (parentDomain) { + if (!domain) { + // Lazy execute the domain module. + // Only employed if the user elects to use domains. + domain = __webpack_require__(965); } - }).then(function() { - return _compileAsync(schemaObj); - }); + domain.active = process.domain = null; + } - function removePromise() { - delete self._loadingSchemas[ref]; - } + // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` + // cannot handle recursion. + // `requestFlush` will only be called recursively from `asap.js`, to resume + // flushing after an error is thrown into a domain. + // Conveniently, `setImmediate` was introduced in the same version + // `process.nextTick` started throwing recursion errors. + if (flushing && hasSetImmediate) { + setImmediate(flush); + } else { + process.nextTick(flush); + } - function added(ref) { - return self._refs[ref] || self._schemas[ref]; - } + if (parentDomain) { + domain.active = process.domain = parentDomain; } - } } /***/ }), -/* 477 */ +/* 482 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +// Copyright 2011 Mark Cavage All rights reserved. +var errors = __webpack_require__(203); +var types = __webpack_require__(204); -var util = __webpack_require__(106); +var Reader = __webpack_require__(483); +var Writer = __webpack_require__(484); -var DATE = /^\d\d\d\d-(\d\d)-(\d\d)$/; -var DAYS = [0,31,29,31,30,31,30,31,31,30,31,30,31]; -var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d:\d\d)?$/i; -var HOSTNAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*$/i; -var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; -var URIREF = /^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i; -// uri-template: https://tools.ietf.org/html/rfc6570 -var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i; -// For the source: https://gist.github.com/dperini/729294 -// For test cases: https://mathiasbynens.be/demo/url-regex -// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983. -// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu; -var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i; -var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i; -var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$|^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i; -var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/; +// --- Exports -module.exports = formats; +module.exports = { -function formats(mode) { - mode = mode == 'full' ? 'full' : 'fast'; - return util.copy(formats[mode]); -} + Reader: Reader, + Writer: Writer -formats.fast = { - // date: http://tools.ietf.org/html/rfc3339#section-5.6 - date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/, - // date-time: http://tools.ietf.org/html/rfc3339#section-5.6 - time: /^[0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)?$/i, - 'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s][0-2]\d:[0-5]\d:[0-5]\d(?:\.\d+)?(?:z|[+-]\d\d:\d\d)$/i, - // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js - uri: /^(?:[a-z][a-z0-9+-.]*)(?::|\/)\/?[^\s]*$/i, - 'uri-reference': /^(?:(?:[a-z][a-z0-9+-.]*:)?\/\/)?[^\s]*$/i, - 'uri-template': URITEMPLATE, - url: URL, - // email (sources from jsen validator): - // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363 - // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation') - email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i, - hostname: HOSTNAME, - // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, - // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses - ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, - regex: regex, - // uuid: http://tools.ietf.org/html/rfc4122 - uuid: UUID, - // JSON-pointer: https://tools.ietf.org/html/rfc6901 - // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A - 'json-pointer': JSON_POINTER, - // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00 - 'relative-json-pointer': RELATIVE_JSON_POINTER }; +for (var t in types) { + if (types.hasOwnProperty(t)) + module.exports[t] = types[t]; +} +for (var e in errors) { + if (errors.hasOwnProperty(e)) + module.exports[e] = errors[e]; +} -formats.full = { - date: date, - time: time, - 'date-time': date_time, - uri: uri, - 'uri-reference': URIREF, - 'uri-template': URITEMPLATE, - url: URL, - email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&''*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i, - hostname: hostname, - ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/, - ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i, - regex: regex, - uuid: UUID, - 'json-pointer': JSON_POINTER, - 'relative-json-pointer': RELATIVE_JSON_POINTER -}; +/***/ }), +/* 483 */ +/***/ (function(module, exports, __webpack_require__) { -function date(str) { - // full-date from http://tools.ietf.org/html/rfc3339#section-5.6 - var matches = str.match(DATE); - if (!matches) return false; +// Copyright 2011 Mark Cavage All rights reserved. - var month = +matches[1]; - var day = +matches[2]; - return month >= 1 && month <= 12 && day >= 1 && day <= DAYS[month]; -} +var assert = __webpack_require__(28); +var Buffer = __webpack_require__(15).Buffer; +var ASN1 = __webpack_require__(204); +var errors = __webpack_require__(203); -function time(str, full) { - var matches = str.match(TIME); - if (!matches) return false; - var hour = matches[1]; - var minute = matches[2]; - var second = matches[3]; - var timeZone = matches[5]; - return hour <= 23 && minute <= 59 && second <= 59 && (!full || timeZone); -} +// --- Globals +var newInvalidAsn1Error = errors.newInvalidAsn1Error; -var DATE_TIME_SEPARATOR = /t|\s/i; -function date_time(str) { - // http://tools.ietf.org/html/rfc3339#section-5.6 - var dateTime = str.split(DATE_TIME_SEPARATOR); - return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true); -} -function hostname(str) { - // https://tools.ietf.org/html/rfc1034#section-3.5 - // https://tools.ietf.org/html/rfc1123#section-2 - return str.length <= 255 && HOSTNAME.test(str); -} +// --- API + +function Reader(data) { + if (!data || !Buffer.isBuffer(data)) + throw new TypeError('data must be a node Buffer'); + this._buf = data; + this._size = data.length; -var NOT_URI_FRAGMENT = /\/|:/; -function uri(str) { - // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "." - return NOT_URI_FRAGMENT.test(str) && URI.test(str); + // These hold the "current" state + this._len = 0; + this._offset = 0; } +Object.defineProperty(Reader.prototype, 'length', { + enumerable: true, + get: function () { return (this._len); } +}); -var Z_ANCHOR = /[^\\]\\Z/; -function regex(str) { - if (Z_ANCHOR.test(str)) return false; - try { - new RegExp(str); - return true; - } catch(e) { - return false; - } -} +Object.defineProperty(Reader.prototype, 'offset', { + enumerable: true, + get: function () { return (this._offset); } +}); +Object.defineProperty(Reader.prototype, 'remain', { + get: function () { return (this._size - this._offset); } +}); -/***/ }), -/* 478 */ -/***/ (function(module, exports, __webpack_require__) { +Object.defineProperty(Reader.prototype, 'buffer', { + get: function () { return (this._buf.slice(this._offset)); } +}); -"use strict"; + +/** + * Reads a single byte and advances offset; you can pass in `true` to make this + * a "peek" operation (i.e., get the byte, but don't advance the offset). + * + * @param {Boolean} peek true means don't move offset. + * @return {Number} the next byte, null if not enough data. + */ +Reader.prototype.readByte = function (peek) { + if (this._size - this._offset < 1) + return null; + + var b = this._buf[this._offset] & 0xff; + + if (!peek) + this._offset += 1; + + return b; +}; -var resolve = __webpack_require__(203) - , util = __webpack_require__(106) - , errorClasses = __webpack_require__(202) - , stableStringify = __webpack_require__(389); +Reader.prototype.peek = function () { + return this.readByte(true); +}; -var validateGenerator = __webpack_require__(344); /** - * Functions below are used inside compiled validations function + * Reads a (potentially) variable length off the BER buffer. This call is + * not really meant to be called directly, as callers have to manipulate + * the internal buffer afterwards. + * + * As a result of this call, you can call `Reader.length`, until the + * next thing called that does a readLength. + * + * @return {Number} the amount of offset to advance the buffer. + * @throws {InvalidAsn1Error} on bad ASN.1 */ +Reader.prototype.readLength = function (offset) { + if (offset === undefined) + offset = this._offset; -var co = __webpack_require__(383); -var ucs2length = util.ucs2length; -var equal = __webpack_require__(204); + if (offset >= this._size) + return null; -// this error is thrown by async schemas to return validation errors via exception -var ValidationError = errorClasses.Validation; + var lenB = this._buf[offset++] & 0xff; + if (lenB === null) + return null; -module.exports = compile; + if ((lenB & 0x80) === 0x80) { + lenB &= 0x7f; + + if (lenB === 0) + throw newInvalidAsn1Error('Indefinite length not supported'); + + if (lenB > 4) + throw newInvalidAsn1Error('encoding too long'); + + if (this._size - offset < lenB) + return null; + + this._len = 0; + for (var i = 0; i < lenB; i++) + this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + + } else { + // Wasn't a variable length + this._len = lenB; + } + + return offset; +}; /** - * Compiles schema to validation function - * @this Ajv - * @param {Object} schema schema object - * @param {Object} root object with information about the root schema for this schema - * @param {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution - * @param {String} baseId base ID for IDs in the schema - * @return {Function} validation function + * Parses the next sequence in this BER buffer. + * + * To get the length of the sequence, call `Reader.length`. + * + * @return {Number} the sequence's tag. */ -function compile(schema, root, localRefs, baseId) { - /* jshint validthis: true, evil: true */ - /* eslint no-shadow: 0 */ - var self = this - , opts = this._opts - , refVal = [ undefined ] - , refs = {} - , patterns = [] - , patternsHash = {} - , defaults = [] - , defaultsHash = {} - , customRules = []; +Reader.prototype.readSequence = function (tag) { + var seq = this.peek(); + if (seq === null) + return null; + if (tag !== undefined && tag !== seq) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + seq.toString(16)); - root = root || { schema: schema, refVal: refVal, refs: refs }; + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; - var c = checkCompiling.call(this, schema, root, baseId); - var compilation = this._compilations[c.index]; - if (c.compiling) return (compilation.callValidate = callValidate); + this._offset = o; + return seq; +}; - var formats = this._formats; - var RULES = this.RULES; - try { - var v = localCompile(schema, root, localRefs, baseId); - compilation.validate = v; - var cv = compilation.callValidate; - if (cv) { - cv.schema = v.schema; - cv.errors = null; - cv.refs = v.refs; - cv.refVal = v.refVal; - cv.root = v.root; - cv.$async = v.$async; - if (opts.sourceCode) cv.source = v.source; - } - return v; - } finally { - endCompiling.call(this, schema, root, baseId); - } +Reader.prototype.readInt = function () { + return this._readTag(ASN1.Integer); +}; - function callValidate() { - var validate = compilation.validate; - var result = validate.apply(null, arguments); - callValidate.errors = validate.errors; - return result; - } - function localCompile(_schema, _root, localRefs, baseId) { - var isRoot = !_root || (_root && _root.schema == _schema); - if (_root.schema != root.schema) - return compile.call(self, _schema, _root, localRefs, baseId); +Reader.prototype.readBoolean = function () { + return (this._readTag(ASN1.Boolean) === 0 ? false : true); +}; - var $async = _schema.$async === true; - var sourceCode = validateGenerator({ - isTop: true, - schema: _schema, - isRoot: isRoot, - baseId: baseId, - root: _root, - schemaPath: '', - errSchemaPath: '#', - errorPath: '""', - MissingRefError: errorClasses.MissingRef, - RULES: RULES, - validate: validateGenerator, - util: util, - resolve: resolve, - resolveRef: resolveRef, - usePattern: usePattern, - useDefault: useDefault, - useCustomRule: useCustomRule, - opts: opts, - formats: formats, - logger: self.logger, - self: self - }); +Reader.prototype.readEnumeration = function () { + return this._readTag(ASN1.Enumeration); +}; - sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode) - + vars(defaults, defaultCode) + vars(customRules, customRuleCode) - + sourceCode; - if (opts.processCode) sourceCode = opts.processCode(sourceCode); - // console.log('\n\n\n *** \n', JSON.stringify(sourceCode)); - var validate; - try { - var makeValidate = new Function( - 'self', - 'RULES', - 'formats', - 'root', - 'refVal', - 'defaults', - 'customRules', - 'co', - 'equal', - 'ucs2length', - 'ValidationError', - sourceCode - ); +Reader.prototype.readString = function (tag, retbuf) { + if (!tag) + tag = ASN1.OctetString; - validate = makeValidate( - self, - RULES, - formats, - root, - refVal, - defaults, - customRules, - co, - equal, - ucs2length, - ValidationError - ); + var b = this.peek(); + if (b === null) + return null; - refVal[0] = validate; - } catch(e) { - self.logger.error('Error compiling schema, function code:', sourceCode); - throw e; - } + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); - validate.schema = _schema; - validate.errors = null; - validate.refs = refs; - validate.refVal = refVal; - validate.root = isRoot ? validate : _root; - if ($async) validate.$async = true; - if (opts.sourceCode === true) { - validate.source = { - code: sourceCode, - patterns: patterns, - defaults: defaults - }; - } + var o = this.readLength(this._offset + 1); // stored in `length` - return validate; - } + if (o === null) + return null; - function resolveRef(baseId, ref, isRoot) { - ref = resolve.url(baseId, ref); - var refIndex = refs[ref]; - var _refVal, refCode; - if (refIndex !== undefined) { - _refVal = refVal[refIndex]; - refCode = 'refVal[' + refIndex + ']'; - return resolvedRef(_refVal, refCode); - } - if (!isRoot && root.refs) { - var rootRefId = root.refs[ref]; - if (rootRefId !== undefined) { - _refVal = root.refVal[rootRefId]; - refCode = addLocalRef(ref, _refVal); - return resolvedRef(_refVal, refCode); - } - } + if (this.length > this._size - o) + return null; - refCode = addLocalRef(ref); - var v = resolve.call(self, localCompile, root, ref); - if (v === undefined) { - var localSchema = localRefs && localRefs[ref]; - if (localSchema) { - v = resolve.inlineRef(localSchema, opts.inlineRefs) - ? localSchema - : compile.call(self, localSchema, root, localRefs, baseId); - } - } + this._offset = o; - if (v === undefined) { - removeLocalRef(ref); - } else { - replaceLocalRef(ref, v); - return resolvedRef(v, refCode); - } - } + if (this.length === 0) + return retbuf ? Buffer.alloc(0) : ''; - function addLocalRef(ref, v) { - var refId = refVal.length; - refVal[refId] = v; - refs[ref] = refId; - return 'refVal' + refId; - } + var str = this._buf.slice(this._offset, this._offset + this.length); + this._offset += this.length; - function removeLocalRef(ref) { - delete refs[ref]; - } + return retbuf ? str : str.toString('utf8'); +}; - function replaceLocalRef(ref, v) { - var refId = refs[ref]; - refVal[refId] = v; - } +Reader.prototype.readOID = function (tag) { + if (!tag) + tag = ASN1.OID; - function resolvedRef(refVal, code) { - return typeof refVal == 'object' || typeof refVal == 'boolean' - ? { code: code, schema: refVal, inline: true } - : { code: code, $async: refVal && refVal.$async }; - } + var b = this.readString(tag, true); + if (b === null) + return null; - function usePattern(regexStr) { - var index = patternsHash[regexStr]; - if (index === undefined) { - index = patternsHash[regexStr] = patterns.length; - patterns[index] = regexStr; - } - return 'pattern' + index; - } + var values = []; + var value = 0; - function useDefault(value) { - switch (typeof value) { - case 'boolean': - case 'number': - return '' + value; - case 'string': - return util.toQuotedString(value); - case 'object': - if (value === null) return 'null'; - var valueStr = stableStringify(value); - var index = defaultsHash[valueStr]; - if (index === undefined) { - index = defaultsHash[valueStr] = defaults.length; - defaults[index] = value; - } - return 'default' + index; + for (var i = 0; i < b.length; i++) { + var byte = b[i] & 0xff; + + value <<= 7; + value += byte & 0x7f; + if ((byte & 0x80) === 0) { + values.push(value); + value = 0; } } - function useCustomRule(rule, schema, parentSchema, it) { - var validateSchema = rule.definition.validateSchema; - if (validateSchema && self._opts.validateSchema !== false) { - var valid = validateSchema(schema); - if (!valid) { - var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors); - if (self._opts.validateSchema == 'log') self.logger.error(message); - else throw new Error(message); - } - } + value = values.shift(); + values.unshift(value % 40); + values.unshift((value / 40) >> 0); - var compile = rule.definition.compile - , inline = rule.definition.inline - , macro = rule.definition.macro; + return values.join('.'); +}; - var validate; - if (compile) { - validate = compile.call(self, schema, parentSchema, it); - } else if (macro) { - validate = macro.call(self, schema, parentSchema, it); - if (opts.validateSchema !== false) self.validateSchema(validate, true); - } else if (inline) { - validate = inline.call(self, it, rule.keyword, schema, parentSchema); - } else { - validate = rule.definition.validate; - if (!validate) return; - } - if (validate === undefined) - throw new Error('custom keyword "' + rule.keyword + '"failed to compile'); +Reader.prototype._readTag = function (tag) { + assert.ok(tag !== undefined); - var index = customRules.length; - customRules[index] = validate; + var b = this.peek(); - return { - code: 'customRule' + index, - validate: validate - }; - } -} + if (b === null) + return null; + if (b !== tag) + throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + + ': got 0x' + b.toString(16)); -/** - * Checks if the schema is currently compiled - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean) - */ -function checkCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var index = compIndex.call(this, schema, root, baseId); - if (index >= 0) return { index: index, compiling: true }; - index = this._compilations.length; - this._compilations[index] = { - schema: schema, - root: root, - baseId: baseId - }; - return { index: index, compiling: false }; -} + var o = this.readLength(this._offset + 1); // stored in `length` + if (o === null) + return null; + if (this.length > 4) + throw newInvalidAsn1Error('Integer too long: ' + this.length); -/** - * Removes the schema from the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - */ -function endCompiling(schema, root, baseId) { - /* jshint validthis: true */ - var i = compIndex.call(this, schema, root, baseId); - if (i >= 0) this._compilations.splice(i, 1); -} + if (this.length > this._size - o) + return null; + this._offset = o; + var fb = this._buf[this._offset]; + var value = 0; -/** - * Index of schema compilation in the currently compiled list - * @this Ajv - * @param {Object} schema schema to compile - * @param {Object} root root object - * @param {String} baseId base schema ID - * @return {Integer} compilation index - */ -function compIndex(schema, root, baseId) { - /* jshint validthis: true */ - for (var i=0; i> 0; +}; -function defaultCode(i) { - return 'var default' + i + ' = defaults[' + i + '];'; -} +// --- Exported API -function refValCode(i, refVal) { - return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];'; -} +module.exports = Reader; -function customRuleCode(i) { - return 'var customRule' + i + ' = customRules[' + i + '];'; -} +/***/ }), +/* 484 */ +/***/ (function(module, exports, __webpack_require__) { +// Copyright 2011 Mark Cavage All rights reserved. -function vars(arr, statement) { - if (!arr.length) return ''; - var code = ''; - for (var i=0; i= 0xD800 && value <= 0xDBFF && pos < len) { - // high surrogate, and there is a next character - value = str.charCodeAt(pos); - if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate - } + // A list of offsets in the buffer where we need to insert + // sequence tag/len pairs. + this._seq = []; +} + +Object.defineProperty(Writer.prototype, 'buffer', { + get: function () { + if (this._seq.length) + throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); + + return (this._buf.slice(0, this._offset)); } - return length; +}); + +Writer.prototype.writeByte = function (b) { + if (typeof (b) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(1); + this._buf[this._offset++] = b; }; -/***/ }), -/* 481 */ -/***/ (function(module, exports, __webpack_require__) { +Writer.prototype.writeInt = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Integer; -"use strict"; + var sz = 4; -module.exports = function generate_allOf(it, $keyword, $ruleType) { - var out = ' '; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $currentBaseId = $it.baseId, - $allSchemasEmpty = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $allSchemasEmpty = false; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if ($breakOnError) { - if ($allSchemasEmpty) { - out += ' if (true) { '; - } else { - out += ' ' + ($closingBraces.slice(0, -1)) + ' '; - } + while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && + (sz > 1)) { + sz--; + i <<= 8; } - out = it.util.cleanUpCode(out); - return out; -} + if (sz > 4) + throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); -/***/ }), -/* 482 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + this._ensure(2 + sz); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = sz; -module.exports = function generate_anyOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $noEmptySchema = $schema.every(function($sch) { - return it.util.schemaHasRules($sch, it.RULES.all); - }); - if ($noEmptySchema) { - var $currentBaseId = $it.baseId; - out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match some schema in anyOf\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; return false; '; - } - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } - out = it.util.cleanUpCode(out); - } else { - if ($breakOnError) { - out += ' if (true) { '; - } + while (sz-- > 0) { + this._buf[this._offset++] = ((i & 0xff000000) >>> 24); + i <<= 8; } - return out; -} +}; -/***/ }), -/* 483 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +Writer.prototype.writeNull = function () { + this.writeByte(ASN1.Null); + this.writeByte(0x00); +}; -module.exports = function generate_const(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if (!$isData) { - out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';'; - } - out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should be equal to constant\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' }'; - if ($breakOnError) { - out += ' else { '; + +Writer.prototype.writeEnumeration = function (i, tag) { + if (typeof (i) !== 'number') + throw new TypeError('argument must be a Number'); + if (typeof (tag) !== 'number') + tag = ASN1.Enumeration; + + return this.writeInt(i, tag); +}; + + +Writer.prototype.writeBoolean = function (b, tag) { + if (typeof (b) !== 'boolean') + throw new TypeError('argument must be a Boolean'); + if (typeof (tag) !== 'number') + tag = ASN1.Boolean; + + this._ensure(3); + this._buf[this._offset++] = tag; + this._buf[this._offset++] = 0x01; + this._buf[this._offset++] = b ? 0xff : 0x00; +}; + + +Writer.prototype.writeString = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); + if (typeof (tag) !== 'number') + tag = ASN1.OctetString; + + var len = Buffer.byteLength(s); + this.writeByte(tag); + this.writeLength(len); + if (len) { + this._ensure(len); + this._buf.write(s, this._offset); + this._offset += len; } - return out; -} +}; -/***/ }), -/* 484 */ -/***/ (function(module, exports, __webpack_require__) { +Writer.prototype.writeBuffer = function (buf, tag) { + if (typeof (tag) !== 'number') + throw new TypeError('tag must be a number'); + if (!Buffer.isBuffer(buf)) + throw new TypeError('argument must be a buffer'); -"use strict"; + this.writeByte(tag); + this.writeLength(buf.length); + this._ensure(buf.length); + buf.copy(this._buf, this._offset, 0, buf.length); + this._offset += buf.length; +}; -module.exports = function generate_contains(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $idx = 'i' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $currentBaseId = it.baseId, - $nonEmptySchema = it.util.schemaHasRules($schema, it.RULES.all); - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if ($nonEmptySchema) { - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; + +Writer.prototype.writeStringArray = function (strings) { + if ((!strings instanceof Array)) + throw new TypeError('argument must be an Array[String]'); + + var self = this; + strings.forEach(function (s) { + self.writeString(s); + }); +}; + +// This is really to solve DER cases, but whatever for now +Writer.prototype.writeOID = function (s, tag) { + if (typeof (s) !== 'string') + throw new TypeError('argument must be a string'); + if (typeof (tag) !== 'number') + tag = ASN1.OID; + + if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) + throw new Error('argument is not a valid OID string'); + + function encodeOctet(bytes, octet) { + if (octet < 128) { + bytes.push(octet); + } else if (octet < 16384) { + bytes.push((octet >>> 7) | 0x80); + bytes.push(octet & 0x7F); + } else if (octet < 2097152) { + bytes.push((octet >>> 14) | 0x80); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); + } else if (octet < 268435456) { + bytes.push((octet >>> 21) | 0x80); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; + bytes.push(((octet >>> 28) | 0x80) & 0xFF); + bytes.push(((octet >>> 21) | 0x80) & 0xFF); + bytes.push(((octet >>> 14) | 0x80) & 0xFF); + bytes.push(((octet >>> 7) | 0x80) & 0xFF); + bytes.push(octet & 0x7F); } - out += ' if (' + ($nextValid) + ') break; } '; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {'; - } else { - out += ' if (' + ($data) + '.length == 0) {'; } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should contain a valid item\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; + + var tmp = s.split('.'); + var bytes = []; + bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); + tmp.slice(2).forEach(function (b) { + encodeOctet(bytes, parseInt(b, 10)); + }); + + var self = this; + this._ensure(2 + bytes.length); + this.writeByte(tag); + this.writeLength(bytes.length); + bytes.forEach(function (b) { + self.writeByte(b); + }); +}; + + +Writer.prototype.writeLength = function (len) { + if (typeof (len) !== 'number') + throw new TypeError('argument must be a Number'); + + this._ensure(4); + + if (len <= 0x7f) { + this._buf[this._offset++] = len; + } else if (len <= 0xff) { + this._buf[this._offset++] = 0x81; + this._buf[this._offset++] = len; + } else if (len <= 0xffff) { + this._buf[this._offset++] = 0x82; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; + } else if (len <= 0xffffff) { + this._buf[this._offset++] = 0x83; + this._buf[this._offset++] = len >> 16; + this._buf[this._offset++] = len >> 8; + this._buf[this._offset++] = len; } else { - out += ' {} '; + throw newInvalidAsn1Error('Length too long (> 4 bytes)'); } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } +}; + +Writer.prototype.startSequence = function (tag) { + if (typeof (tag) !== 'number') + tag = ASN1.Sequence | ASN1.Constructor; + + this.writeByte(tag); + this._seq.push(this._offset); + this._ensure(3); + this._offset += 3; +}; + + +Writer.prototype.endSequence = function () { + var seq = this._seq.pop(); + var start = seq + 3; + var len = this._offset - start; + + if (len <= 0x7f) { + this._shift(start, len, -2); + this._buf[seq] = len; + } else if (len <= 0xff) { + this._shift(start, len, -1); + this._buf[seq] = 0x81; + this._buf[seq + 1] = len; + } else if (len <= 0xffff) { + this._buf[seq] = 0x82; + this._buf[seq + 1] = len >> 8; + this._buf[seq + 2] = len; + } else if (len <= 0xffffff) { + this._shift(start, len, 1); + this._buf[seq] = 0x83; + this._buf[seq + 1] = len >> 16; + this._buf[seq + 2] = len >> 8; + this._buf[seq + 3] = len; } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - if ($nonEmptySchema) { - out += ' errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; + throw newInvalidAsn1Error('Sequence too long'); } - if (it.opts.allErrors) { - out += ' } '; +}; + + +Writer.prototype._shift = function (start, len, shift) { + assert.ok(start !== undefined); + assert.ok(len !== undefined); + assert.ok(shift); + + this._buf.copy(this._buf, start + shift, start, start + len); + this._offset += shift; +}; + +Writer.prototype._ensure = function (len) { + assert.ok(len); + + if (this._size - this._offset < len) { + var sz = this._size * this._options.growthFactor; + if (sz - this._offset < len) + sz += len; + + var buf = Buffer.alloc(sz); + + this._buf.copy(buf, 0, 0, this._offset); + this._buf = buf; + this._size = sz; } - out = it.util.cleanUpCode(out); - return out; -} +}; + + + +// --- Exported API + +module.exports = Writer; /***/ }), /* 485 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; - -module.exports = function generate_custom(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $errorKeyword; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $rule = this, - $definition = 'definition' + $lvl, - $rDef = $rule.definition, - $closingBraces = ''; - var $compile, $inline, $macro, $ruleValidate, $validateCode; - if ($isData && $rDef.$data) { - $validateCode = 'keywordValidate' + $lvl; - var $validateSchema = $rDef.validateSchema; - out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;'; - } else { - $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it); - if (!$ruleValidate) return; - $schemaValue = 'validate.schema' + $schemaPath; - $validateCode = $ruleValidate.code; - $compile = $rDef.compile; - $inline = $rDef.inline; - $macro = $rDef.macro; - } - var $ruleErrs = $validateCode + '.errors', - $i = 'i' + $lvl, - $ruleErr = 'ruleErr' + $lvl, - $asyncKeyword = $rDef.async; - if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema'); - if (!($inline || $macro)) { - out += '' + ($ruleErrs) + ' = null;'; - } - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if ($isData && $rDef.$data) { - $closingBraces += '}'; - out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { '; - if ($validateSchema) { - $closingBraces += '}'; - out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { '; - } - } - if ($inline) { - if ($rDef.statements) { - out += ' ' + ($ruleValidate.validate) + ' '; - } else { - out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; '; - } - } else if ($macro) { - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - $it.schema = $ruleValidate.validate; - $it.schemaPath = ''; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' ' + ($code); - } else { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - out += ' ' + ($validateCode) + '.call( '; - if (it.opts.passContext) { - out += 'this'; - } else { - out += 'self'; - } - if ($compile || $rDef.schema === false) { - out += ' , ' + ($data) + ' '; - } else { - out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' '; - } - out += ' , (dataPath || \'\')'; - if (it.errorPath != '""') { - out += ' + ' + (it.errorPath); - } - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData ) '; - var def_callRuleValidate = out; - out = $$outStack.pop(); - if ($rDef.errors === false) { - out += ' ' + ($valid) + ' = '; - if ($asyncKeyword) { - out += '' + (it.yieldAwait); - } - out += '' + (def_callRuleValidate) + '; '; - } else { - if ($asyncKeyword) { - $ruleErrs = 'customErrors' + $lvl; - out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = ' + (it.yieldAwait) + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } '; - } else { - out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; '; - } - } - } - if ($rDef.modifying) { - out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];'; - } - out += '' + ($closingBraces); - if ($rDef.valid) { - if ($breakOnError) { - out += ' if (true) { '; - } - } else { - out += ' if ( '; - if ($rDef.valid === undefined) { - out += ' !'; - if ($macro) { - out += '' + ($nextValid); - } else { - out += '' + ($valid); - } - } else { - out += ' ' + (!$rDef.valid) + ' '; - } - out += ') { '; - $errorKeyword = $rule.keyword; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - var def_customError = out; - out = $$outStack.pop(); - if ($inline) { - if ($rDef.errors) { - if ($rDef.errors != 'full') { - out += ' for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '= 0) { - if ($breakOnError) { - out += ' if (true) { '; - } - return out; - } else { - throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); - } - } - var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate; - var $formatType = $isObject && $format.type || 'string'; - if ($isObject) { - var $async = $format.async === true; - $format = $format.validate; - } - if ($formatType != $ruleType) { - if ($breakOnError) { - out += ' if (true) { '; - } - return out; - } - if ($async) { - if (!it.async) throw new Error('async format in sync schema'); - var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate'; - out += ' if (!(' + (it.yieldAwait) + ' ' + ($formatRef) + '(' + ($data) + '))) { '; - } else { - out += ' if (! '; - var $formatRef = 'formats' + it.util.getProperty($schema); - if ($isObject) $formatRef += '.validate'; - if (typeof $format == 'function') { - out += ' ' + ($formatRef) + '(' + ($data) + ') '; - } else { - out += ' ' + ($formatRef) + '.test(' + ($data) + ') '; - } - out += ') { '; - } - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should match format "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - return out; +// Public API +module.exports = serial; + +/** + * Runs iterator over provided array elements in series + * + * @param {array|object} list - array or object (named list) to iterate over + * @param {function} iterator - iterator to run + * @param {function} callback - invoked when all elements processed + * @returns {function} - jobs terminator + */ +function serial(list, iterator, callback) +{ + return serialOrdered(list, iterator, null, callback); } @@ -91514,954 +90891,794 @@ module.exports = function generate_format(it, $keyword, $ruleType) { /* 489 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -module.exports = function generate_items(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $idx = 'i' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $currentBaseId = it.baseId; - out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';'; - if (Array.isArray($schema)) { - var $additionalItems = it.schema.additionalItems; - if ($additionalItems === false) { - out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; '; - var $currErrSchemaPath = $errSchemaPath; - $errSchemaPath = it.errSchemaPath + '/additionalItems'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - $closingBraces += '}'; - out += ' else { '; - } - } - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { '; - var $passData = $data + '[' + $i + ']'; - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true); - $it.dataPathArr[$dataNxt] = $i; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if (typeof $additionalItems == 'object' && it.util.schemaHasRules($additionalItems, it.RULES.all)) { - $it.schema = $additionalItems; - $it.schemaPath = it.schemaPath + '.additionalItems'; - $it.errSchemaPath = it.errSchemaPath + '/additionalItems'; - out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') { for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } else if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true); - var $passData = $data + '[' + $idx + ']'; - $it.dataPathArr[$dataNxt] = $idx; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' }'; - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; +/*! + * Copyright 2010 LearnBoost + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Module dependencies. + */ + +var crypto = __webpack_require__(11) + , parse = __webpack_require__(24).parse + ; + +/** + * Valid keys. + */ + +var keys = + [ 'acl' + , 'location' + , 'logging' + , 'notification' + , 'partNumber' + , 'policy' + , 'requestPayment' + , 'torrent' + , 'uploadId' + , 'uploads' + , 'versionId' + , 'versioning' + , 'versions' + , 'website' + ] + +/** + * Return an "Authorization" header value with the given `options` + * in the form of "AWS :" + * + * @param {Object} options + * @return {String} + * @api private + */ + +function authorization (options) { + return 'AWS ' + options.key + ':' + sign(options) +} + +module.exports = authorization +module.exports.authorization = authorization + +/** + * Simple HMAC-SHA1 Wrapper + * + * @param {Object} options + * @return {String} + * @api private + */ + +function hmacSha1 (options) { + return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +} + +module.exports.hmacSha1 = hmacSha1 + +/** + * Create a base64 sha1 HMAC for `options`. + * + * @param {Object} options + * @return {String} + * @api private + */ + +function sign (options) { + options.message = stringToSign(options) + return hmacSha1(options) +} +module.exports.sign = sign + +/** + * Create a base64 sha1 HMAC for `options`. + * + * Specifically to be used with S3 presigned URLs + * + * @param {Object} options + * @return {String} + * @api private + */ + +function signQuery (options) { + options.message = queryStringToSign(options) + return hmacSha1(options) +} +module.exports.signQuery= signQuery + +/** + * Return a string for sign() with the given `options`. + * + * Spec: + * + * \n + * \n + * \n + * \n + * [headers\n] + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function stringToSign (options) { + var headers = options.amazonHeaders || '' + if (headers) headers += '\n' + var r = + [ options.verb + , options.md5 + , options.contentType + , options.date ? options.date.toUTCString() : '' + , headers + options.resource + ] + return r.join('\n') +} +module.exports.stringToSign = stringToSign + +/** + * Return a string for sign() with the given `options`, but is meant exclusively + * for S3 presigned URLs + * + * Spec: + * + * \n + * + * + * @param {Object} options + * @return {String} + * @api private + */ + +function queryStringToSign (options){ + return 'GET\n\n\n' + options.date + '\n' + options.resource +} +module.exports.queryStringToSign = queryStringToSign + +/** + * Perform the following: + * + * - ignore non-amazon headers + * - lowercase fields + * - sort lexicographically + * - trim whitespace between ":" + * - join with newline + * + * @param {Object} headers + * @return {String} + * @api private + */ + +function canonicalizeHeaders (headers) { + var buf = [] + , fields = Object.keys(headers) + ; + for (var i = 0, len = fields.length; i < len; ++i) { + var field = fields[i] + , val = headers[field] + , field = field.toLowerCase() + ; + if (0 !== field.indexOf('x-amz')) continue + buf.push(field + ':' + val) } - out = it.util.cleanUpCode(out); - return out; + return buf.sort().join('\n') +} +module.exports.canonicalizeHeaders = canonicalizeHeaders + +/** + * Perform the following: + * + * - ignore non sub-resources + * - sort lexicographically + * + * @param {String} resource + * @return {String} + * @api private + */ + +function canonicalizeResource (resource) { + var url = parse(resource, true) + , path = url.pathname + , buf = [] + ; + + Object.keys(url.query).forEach(function(key){ + if (!~keys.indexOf(key)) return + var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) + buf.push(key + val) + }) + + return path + (buf.length ? '?' + buf.sort().join('&') : '') } +module.exports.canonicalizeResource = canonicalizeResource /***/ }), /* 490 */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; +var aws4 = exports, + url = __webpack_require__(24), + querystring = __webpack_require__(197), + crypto = __webpack_require__(11), + lru = __webpack_require__(491), + credentialsCache = lru(1000) -module.exports = function generate_multipleOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - out += 'var division' + ($lvl) + ';if ('; - if ($isData) { - out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || '; +// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html + +function hmac(key, string, encoding) { + return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) +} + +function hash(string, encoding) { + return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +} + +// This function assumes the string has already been percent encoded +function encodeRfc3986(urlEncodedString) { + return urlEncodedString.replace(/[!'()*]/g, function(c) { + return '%' + c.charCodeAt(0).toString(16).toUpperCase() + }) +} + +// request: { path | body, [host], [method], [headers], [service], [region] } +// credentials: { accessKeyId, secretAccessKey, [sessionToken] } +function RequestSigner(request, credentials) { + + if (typeof request === 'string') request = url.parse(request) + + var headers = request.headers = (request.headers || {}), + hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) + + this.request = request + this.credentials = credentials || this.defaultCredentials() + + this.service = request.service || hostParts[0] || '' + this.region = request.region || hostParts[1] || 'us-east-1' + + // SES uses a different domain from the service name + if (this.service === 'email') this.service = 'ses' + + if (!request.method && request.body) + request.method = 'POST' + + if (!headers.Host && !headers.host) { + headers.Host = request.hostname || request.host || this.createHost() + + // If a port is specified explicitly, use it as is + if (request.port) + headers.Host += ':' + request.port } - out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', '; - if (it.opts.multipleOfPrecision) { - out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' '; + if (!request.hostname && !request.host) + request.hostname = headers.Host || headers.host + + this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' +} + +RequestSigner.prototype.matchHost = function(host) { + var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) + var hostParts = (match || []).slice(1, 3) + + // ES's hostParts are sometimes the other way round, if the value that is expected + // to be region equals ‘es’ switch them back + // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com + if (hostParts[1] === 'es') + hostParts = hostParts.reverse() + + return hostParts +} + +// http://docs.aws.amazon.com/general/latest/gr/rande.html +RequestSigner.prototype.isSingleRegion = function() { + // Special case for S3 and SimpleDB in us-east-1 + if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true + + return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] + .indexOf(this.service) >= 0 +} + +RequestSigner.prototype.createHost = function() { + var region = this.isSingleRegion() ? '' : + (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, + service = this.service === 'ses' ? 'email' : this.service + return service + region + '.amazonaws.com' +} + +RequestSigner.prototype.prepareRequest = function() { + this.parsePath() + + var request = this.request, headers = request.headers, query + + if (request.signQuery) { + + this.parsedPath.query = query = this.parsedPath.query || {} + + if (this.credentials.sessionToken) + query['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !query['X-Amz-Expires']) + query['X-Amz-Expires'] = 86400 + + if (query['X-Amz-Date']) + this.datetime = query['X-Amz-Date'] + else + query['X-Amz-Date'] = this.getDateTime() + + query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' + query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() + query['X-Amz-SignedHeaders'] = this.signedHeaders() + } else { - out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') '; - } - out += ' ) '; - if ($isData) { - out += ' ) '; - } - out += ' ) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should be multiple of '; - if ($isData) { - out += '\' + ' + ($schemaValue); - } else { - out += '' + ($schemaValue) + '\''; - } - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + + if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { + if (request.body && !headers['Content-Type'] && !headers['content-type']) + headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + + if (request.body && !headers['Content-Length'] && !headers['content-length']) + headers['Content-Length'] = Buffer.byteLength(request.body) + + if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) + headers['X-Amz-Security-Token'] = this.credentials.sessionToken + + if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) + headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') + + if (headers['X-Amz-Date'] || headers['x-amz-date']) + this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] + else + headers['X-Amz-Date'] = this.getDateTime() } - out += ' } '; - } else { - out += ' {} '; + + delete headers.Authorization + delete headers.authorization } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } +} + +RequestSigner.prototype.sign = function() { + if (!this.parsedPath) this.prepareRequest() + + if (this.request.signQuery) { + this.parsedPath.query['X-Amz-Signature'] = this.signature() } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; + this.request.headers.Authorization = this.authHeader() } - out += '} '; - if ($breakOnError) { - out += ' else { '; + + this.request.path = this.formatPath() + + return this.request +} + +RequestSigner.prototype.getDateTime = function() { + if (!this.datetime) { + var headers = this.request.headers, + date = new Date(headers.Date || headers.date || new Date) + + this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') + + // Remove the trailing 'Z' on the timestamp string for CodeCommit git access + if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) } - return out; + return this.datetime } +RequestSigner.prototype.getDate = function() { + return this.getDateTime().substr(0, 8) +} -/***/ }), -/* 491 */ -/***/ (function(module, exports, __webpack_require__) { +RequestSigner.prototype.authHeader = function() { + return [ + 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), + 'SignedHeaders=' + this.signedHeaders(), + 'Signature=' + this.signature(), + ].join(', ') +} -"use strict"; +RequestSigner.prototype.signature = function() { + var date = this.getDate(), + cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), + kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) + if (!kCredentials) { + kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) + kRegion = hmac(kDate, this.region) + kService = hmac(kRegion, this.service) + kCredentials = hmac(kService, 'aws4_request') + credentialsCache.set(cacheKey, kCredentials) + } + return hmac(kCredentials, this.stringToSign(), 'hex') +} -module.exports = function generate_not(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - $it.level++; - var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.createErrors = false; - var $allErrorsOption; - if ($it.opts.allErrors) { - $allErrorsOption = $it.opts.allErrors; - $it.opts.allErrors = false; - } - out += ' ' + (it.validate($it)) + ' '; - $it.createErrors = true; - if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption; - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' if (' + ($nextValid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } '; - if (it.opts.allErrors) { - out += ' } '; - } +RequestSigner.prototype.stringToSign = function() { + return [ + 'AWS4-HMAC-SHA256', + this.getDateTime(), + this.credentialString(), + hash(this.canonicalString(), 'hex'), + ].join('\n') +} + +RequestSigner.prototype.canonicalString = function() { + if (!this.parsedPath) this.prepareRequest() + + var pathStr = this.parsedPath.path, + query = this.parsedPath.query, + headers = this.request.headers, + queryStr = '', + normalizePath = this.service !== 's3', + decodePath = this.service === 's3' || this.request.doNotEncodePath, + decodeSlashesInPath = this.service === 's3', + firstValOnly = this.service === 's3', + bodyHash + + if (this.service === 's3' && this.request.signQuery) { + bodyHash = 'UNSIGNED-PAYLOAD' + } else if (this.isCodeCommitGit) { + bodyHash = '' } else { - out += ' var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT be valid\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; + bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || + hash(this.request.body || '', 'hex') + } + + if (query) { + queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { + if (!key) return obj + obj[key] = !Array.isArray(query[key]) ? query[key] : + (firstValOnly ? query[key][0] : query[key].slice().sort()) + return obj + }, {}))) + } + if (pathStr !== '/') { + if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') + pathStr = pathStr.split('/').reduce(function(path, piece) { + if (normalizePath && piece === '..') { + path.pop() + } else if (!normalizePath || piece !== '.') { + if (decodePath) piece = decodeURIComponent(piece) + path.push(encodeRfc3986(encodeURIComponent(piece))) } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if ($breakOnError) { - out += ' if (false) { '; - } + return path + }, []).join('/') + if (pathStr[0] !== '/') pathStr = '/' + pathStr + if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') } - return out; + + return [ + this.request.method || 'GET', + pathStr, + queryStr, + this.canonicalHeaders() + '\n', + this.signedHeaders(), + bodyHash, + ].join('\n') } +RequestSigner.prototype.canonicalHeaders = function() { + var headers = this.request.headers + function trimAll(header) { + return header.toString().trim().replace(/\s+/g, ' ') + } + return Object.keys(headers) + .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) + .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) + .join('\n') +} -/***/ }), -/* 492 */ -/***/ (function(module, exports, __webpack_require__) { +RequestSigner.prototype.signedHeaders = function() { + return Object.keys(this.request.headers) + .map(function(key) { return key.toLowerCase() }) + .sort() + .join(';') +} -"use strict"; +RequestSigner.prototype.credentialString = function() { + return [ + this.getDate(), + this.region, + this.service, + 'aws4_request', + ].join('/') +} -module.exports = function generate_oneOf(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - out += 'var ' + ($errs) + ' = errors;var prevValid' + ($lvl) + ' = false;var ' + ($valid) + ' = false;'; - var $currentBaseId = $it.baseId; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var arr1 = $schema; - if (arr1) { - var $sch, $i = -1, - l1 = arr1.length - 1; - while ($i < l1) { - $sch = arr1[$i += 1]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = $schemaPath + '[' + $i + ']'; - $it.errSchemaPath = $errSchemaPath + '/' + $i; - out += ' ' + (it.validate($it)) + ' '; - $it.baseId = $currentBaseId; - } else { - out += ' var ' + ($nextValid) + ' = true; '; - } - if ($i) { - out += ' if (' + ($nextValid) + ' && prevValid' + ($lvl) + ') ' + ($valid) + ' = false; else { '; - $closingBraces += '}'; - } - out += ' if (' + ($nextValid) + ') ' + ($valid) + ' = prevValid' + ($lvl) + ' = true;'; - } +RequestSigner.prototype.defaultCredentials = function() { + var env = process.env + return { + accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, + secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, + sessionToken: env.AWS_SESSION_TOKEN, } - it.compositeRule = $it.compositeRule = $wasComposite; - out += '' + ($closingBraces) + 'if (!' + ($valid) + ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} '; - if (it.opts.messages !== false) { - out += ' , message: \'should match exactly one schema in oneOf\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; +} + +RequestSigner.prototype.parsePath = function() { + var path = this.request.path || '/', + queryIx = path.indexOf('?'), + query = null + + if (queryIx >= 0) { + query = querystring.parse(path.slice(queryIx + 1)) + path = path.slice(0, queryIx) } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; return false; '; - } + + // S3 doesn't always encode characters > 127 correctly and + // all services don't encode characters > 255 correctly + // So if there are non-reserved chars (and it's not already all % encoded), just encode them all + if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { + path = path.split('/').map(function(piece) { + return encodeURIComponent(decodeURIComponent(piece)) + }).join('/') } - out += '} else { errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }'; - if (it.opts.allErrors) { - out += ' } '; + + this.parsedPath = { + path: path, + query: query, } - return out; +} + +RequestSigner.prototype.formatPath = function() { + var path = this.parsedPath.path, + query = this.parsedPath.query + + if (!query) return path + + // Services don't support empty query string keys + if (query[''] != null) delete query[''] + + return path + '?' + encodeRfc3986(querystring.stringify(query)) +} + +aws4.RequestSigner = RequestSigner + +aws4.sign = function(request, credentials) { + return new RequestSigner(request, credentials).sign() } /***/ }), -/* 493 */ -/***/ (function(module, exports, __webpack_require__) { +/* 491 */ +/***/ (function(module, exports) { -"use strict"; +module.exports = function(size) { + return new LruCache(size) +} -module.exports = function generate_pattern(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val } else { - $schemaValue = $schema; + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- } - var $regexp = $isData ? '(new RegExp(' + $schemaValue + '))' : it.usePattern($schema); - out += 'if ( '; - if ($isData) { - out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || '; + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ } - out += ' !' + ($regexp) + '.test(' + ($data) + ') ) { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern: '; - if ($isData) { - out += '' + ($schemaValue); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should match pattern "'; - if ($isData) { - out += '\' + ' + ($schemaValue) + ' + \''; - } else { - out += '' + (it.util.escapeQuotes($schema)); - } - out += '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + (it.util.toQuotedString($schema)); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null } else { - out += ' {} '; + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) } - out += '} '; - if ($breakOnError) { - out += ' else { '; + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next } - return out; + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null } /***/ }), -/* 494 */ +/* 492 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -module.exports = function generate_properties(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $dataProperties = 'dataProperties' + $lvl; - var $schemaKeys = Object.keys($schema || {}), - $pProperties = it.schema.patternProperties || {}, - $pPropertyKeys = Object.keys($pProperties), - $aProperties = it.schema.additionalProperties, - $someProperties = $schemaKeys.length || $pPropertyKeys.length, - $noAdditional = $aProperties === false, - $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length, - $removeAdditional = it.opts.removeAdditional, - $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional, - $ownProperties = it.opts.ownProperties, - $currentBaseId = it.baseId; - var $required = it.schema.required; - if ($required && !(it.opts.v5 && $required.$data) && $required.length < it.opts.loopRequired) var $requiredHash = it.util.toHash($required); - if (it.opts.patternGroups) { - var $pgProperties = it.schema.patternGroups || {}, - $pgPropertyKeys = Object.keys($pgProperties); - } - out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;'; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined;'; - } - if ($checkAdditional) { - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - if ($someProperties) { - out += ' var isAdditional' + ($lvl) + ' = !(false '; - if ($schemaKeys.length) { - if ($schemaKeys.length > 5) { - out += ' || validate.schema' + ($schemaPath) + '[' + ($key) + '] '; - } else { - var arr1 = $schemaKeys; - if (arr1) { - var $propertyKey, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $propertyKey = arr1[i1 += 1]; - out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' '; - } - } - } - } - if ($pPropertyKeys.length) { - var arr2 = $pPropertyKeys; - if (arr2) { - var $pProperty, $i = -1, - l2 = arr2.length - 1; - while ($i < l2) { - $pProperty = arr2[$i += 1]; - out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') '; - } - } - } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr3 = $pgPropertyKeys; - if (arr3) { - var $pgProperty, $i = -1, - l3 = arr3.length - 1; - while ($i < l3) { - $pgProperty = arr3[$i += 1]; - out += ' || ' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ') '; - } - } - } - out += ' ); if (isAdditional' + ($lvl) + ') { '; - } - if ($removeAdditional == 'all') { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +exports.default = function (message) { + return { + useless: true, + run() { + throw new (_errors || _load_errors()).MessageError(message); + }, + setFlags: () => {}, + hasWrapper: () => true + }; +}; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +/***/ }), +/* 493 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.hasWrapper = exports.run = undefined; +exports.setFlags = setFlags; + +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const notYetImplemented = () => Promise.reject(new Error('This command is not implemented yet.')); + +function setFlags(commander) { + commander.description('Has not been implemented yet'); +} + +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', { + public: notYetImplemented, + restricted: notYetImplemented, + grant: notYetImplemented, + revoke: notYetImplemented, + lsPackages: notYetImplemented, + lsCollaborators: notYetImplemented, + edit: notYetImplemented +}, ['WARNING: This command yet to be implemented.', 'public []', 'restricted []', 'grant []', 'revoke []', 'ls-packages [||]', 'ls-collaborators [ []]', 'edit []']); + +const run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; +exports.run = run; +exports.hasWrapper = hasWrapper; +exports.examples = examples; + +/***/ }), +/* 494 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const binFolder = path.join(config.cwd, config.registryFolders[0], '.bin'); + if (args.length === 0) { + reporter.log(binFolder, { force: true }); } else { - var $currentErrorPath = it.errorPath; - var $additionalProperty = '\' + ' + $key + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - } - if ($noAdditional) { - if ($removeAdditional) { - out += ' delete ' + ($data) + '[' + ($key) + ']; '; - } else { - out += ' ' + ($nextValid) + ' = false; '; - var $currErrSchemaPath = $errSchemaPath; - $errSchemaPath = it.errSchemaPath + '/additionalProperties'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have additional properties\' '; - } - if (it.opts.verbose) { - out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' break; '; - } - } - } else if ($additionalIsSchema) { - if ($removeAdditional == 'failing') { - out += ' var ' + ($errs) + ' = errors; '; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; } '; - it.compositeRule = $it.compositeRule = $wasComposite; - } else { - $it.schema = $aProperties; - $it.schemaPath = it.schemaPath + '.additionalProperties'; - $it.errSchemaPath = it.errSchemaPath + '/additionalProperties'; - $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - } - } - it.errorPath = $currentErrorPath; - } - if ($someProperties) { - out += ' } '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - var $useDefaults = it.opts.useDefaults && !it.compositeRule; - if ($schemaKeys.length) { - var arr4 = $schemaKeys; - if (arr4) { - var $propertyKey, i4 = -1, - l4 = arr4.length - 1; - while (i4 < l4) { - $propertyKey = arr4[i4 += 1]; - var $sch = $schema[$propertyKey]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - var $prop = it.util.getProperty($propertyKey), - $passData = $data + $prop, - $hasDefault = $useDefaults && $sch.default !== undefined; - $it.schema = $sch; - $it.schemaPath = $schemaPath + $prop; - $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey); - $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers); - $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey); - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - $code = it.util.varReplace($code, $nextData, $passData); - var $useData = $passData; - } else { - var $useData = $nextData; - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; '; - } - if ($hasDefault) { - out += ' ' + ($code) + ' '; - } else { - if ($requiredHash && $requiredHash[$propertyKey]) { - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { ' + ($nextValid) + ' = false; '; - var $currentErrorPath = it.errorPath, - $currErrSchemaPath = $errSchemaPath, - $missingProperty = it.util.escapeQuotes($propertyKey); - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); - } - $errSchemaPath = it.errSchemaPath + '/required'; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - $errSchemaPath = $currErrSchemaPath; - it.errorPath = $currentErrorPath; - out += ' } else { '; - } else { - if ($breakOnError) { - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { ' + ($nextValid) + ' = true; } else { '; - } else { - out += ' if (' + ($useData) + ' !== undefined '; - if ($ownProperties) { - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ' ) { '; - } - } - out += ' ' + ($code) + ' } '; - } - } - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - if ($pPropertyKeys.length) { - var arr5 = $pPropertyKeys; - if (arr5) { - var $pProperty, i5 = -1, - l5 = arr5.length - 1; - while (i5 < l5) { - $pProperty = arr5[i5 += 1]; - var $sch = $pProperties[$pProperty]; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty); - $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty); - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - } - } - } - } - if (it.opts.patternGroups && $pgPropertyKeys.length) { - var arr6 = $pgPropertyKeys; - if (arr6) { - var $pgProperty, i6 = -1, - l6 = arr6.length - 1; - while (i6 < l6) { - $pgProperty = arr6[i6 += 1]; - var $pgSchema = $pgProperties[$pgProperty], - $sch = $pgSchema.schema; - if (it.util.schemaHasRules($sch, it.RULES.all)) { - $it.schema = $sch; - $it.schemaPath = it.schemaPath + '.patternGroups' + it.util.getProperty($pgProperty) + '.schema'; - $it.errSchemaPath = it.errSchemaPath + '/patternGroups/' + it.util.escapeFragment($pgProperty) + '/schema'; - out += ' var pgPropCount' + ($lvl) + ' = 0; '; - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' if (' + (it.usePattern($pgProperty)) + '.test(' + ($key) + ')) { pgPropCount' + ($lvl) + '++; '; - $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers); - var $passData = $data + '[' + $key + ']'; - $it.dataPathArr[$dataNxt] = $key; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - if ($breakOnError) { - out += ' if (!' + ($nextValid) + ') break; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else ' + ($nextValid) + ' = true; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - $closingBraces += '}'; - } - var $pgMin = $pgSchema.minimum, - $pgMax = $pgSchema.maximum; - if ($pgMin !== undefined || $pgMax !== undefined) { - out += ' var ' + ($valid) + ' = true; '; - var $currErrSchemaPath = $errSchemaPath; - if ($pgMin !== undefined) { - var $limit = $pgMin, - $reason = 'minimum', - $moreOrLess = 'less'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' >= ' + ($pgMin) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/minimum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($pgMax !== undefined) { - out += ' else '; - } - } - if ($pgMax !== undefined) { - var $limit = $pgMax, - $reason = 'maximum', - $moreOrLess = 'more'; - out += ' ' + ($valid) + ' = pgPropCount' + ($lvl) + ' <= ' + ($pgMax) + '; '; - $errSchemaPath = it.errSchemaPath + '/patternGroups/maximum'; - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('patternGroups') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { reason: \'' + ($reason) + '\', limit: ' + ($limit) + ', pattern: \'' + (it.util.escapeQuotes($pgProperty)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have ' + ($moreOrLess) + ' than ' + ($limit) + ' properties matching pattern "' + (it.util.escapeQuotes($pgProperty)) + '"\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - } - $errSchemaPath = $currErrSchemaPath; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - $closingBraces += '}'; - } - } - } + const binEntries = yield (0, (_run || _load_run()).getBinEntries)(config); + + const binName = args[0]; + const binPath = binEntries.get(binName); + + if (binPath) { + reporter.log(binPath, { force: true }); + } else { + reporter.error(reporter.lang('packageBinaryNotFound', binName)); } } - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; - } - out = it.util.cleanUpCode(out); - return out; + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); + +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; + +var _run; + +function _load_run() { + return _run = __webpack_require__(354); +} + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +function hasWrapper(commander) { + return false; } +function setFlags(commander) { + commander.description('Displays the location of the yarn bin folder.'); +} /***/ }), /* 495 */ @@ -92469,87 +91686,119 @@ module.exports = function generate_properties(it, $keyword, $ruleType) { "use strict"; -module.exports = function generate_propertyNames(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $errs = 'errs__' + $lvl; - var $it = it.util.copy(it); - var $closingBraces = ''; - $it.level++; - var $nextValid = 'valid' + $it.level; - if (it.util.schemaHasRules($schema, it.RULES.all)) { - $it.schema = $schema; - $it.schemaPath = $schemaPath; - $it.errSchemaPath = $errSchemaPath; - var $key = 'key' + $lvl, - $idx = 'idx' + $lvl, - $i = 'i' + $lvl, - $invalidName = '\' + ' + $key + ' + \'', - $dataNxt = $it.dataLevel = it.dataLevel + 1, - $nextData = 'data' + $dataNxt, - $dataProperties = 'dataProperties' + $lvl, - $ownProperties = it.opts.ownProperties, - $currentBaseId = it.baseId; - out += ' var ' + ($errs) + ' = errors; '; - if ($ownProperties) { - out += ' var ' + ($dataProperties) + ' = undefined; '; - } - if ($ownProperties) { - out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; '; - } else { - out += ' for (var ' + ($key) + ' in ' + ($data) + ') { '; - } - out += ' var startErrs' + ($lvl) + ' = errors; '; - var $passData = $key; - var $wasComposite = it.compositeRule; - it.compositeRule = $it.compositeRule = true; - var $code = it.validate($it); - $it.baseId = $currentBaseId; - if (it.util.varOccurences($code, $nextData) < 2) { - out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' '; - } else { - out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' '; - } - it.compositeRule = $it.compositeRule = $wasComposite; - out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + ' 2) { + return false; } - out += ' } '; - } else { - out += ' {} '; + const key = args[0]; + var _args$ = args[1]; + const val = _args$ === undefined ? true : _args$; + + const yarnConfig = config.registries.yarn; + yield yarnConfig.saveHomeConfig({ [key]: val }); + reporter.success(reporter.lang('configSet', key, val)); + return true; + })(); + }, + + get(config, reporter, flags, args) { + if (args.length !== 1) { + return false; } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError(vErrors); '; - } else { - out += ' validate.errors = vErrors; return false; '; + + reporter.log(String(config.getOption(args[0])), { force: true }); + return true; + }, + + delete: (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length !== 1) { + return false; } + + const key = args[0]; + const yarnConfig = config.registries.yarn; + yield yarnConfig.saveHomeConfig({ [key]: undefined }); + reporter.success(reporter.lang('configDelete', key)); + return true; + }); + + function _delete(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); } - if ($breakOnError) { - out += ' break; '; + + return _delete; + })(), + + list(config, reporter, flags, args) { + if (args.length) { + return false; } - out += ' } }'; - } - if ($breakOnError) { - out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {'; + + reporter.info(reporter.lang('configYarn')); + reporter.inspect(config.registries.yarn.config); + + reporter.info(reporter.lang('configNpm')); + reporter.inspect(config.registries.npm.config); + + return true; + }, + + current(config, reporter, flags, args) { + if (args.length) { + return false; + } + + reporter.log(JSON.stringify(config, CONFIG_KEYS, 2), { force: true }); + + return true; } - out = it.util.cleanUpCode(out); - return out; -} +}); +const run = _buildSubCommands.run, + examples = _buildSubCommands.examples; +exports.run = run; +exports.examples = examples; /***/ }), /* 496 */ @@ -92557,129 +91806,139 @@ module.exports = function generate_propertyNames(it, $keyword, $ruleType) { "use strict"; -module.exports = function generate_ref(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $async, $refCode; - if ($schema == '#' || $schema == '#/') { - if (it.isRoot) { - $async = it.async; - $refCode = 'validate'; - } else { - $async = it.root.schema.$async === true; - $refCode = 'root.refVal[0]'; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); +} + +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const builderName = args[0], + rest = args.slice(1); + + + if (!builderName) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); } - } else { - var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); - if ($refVal === undefined) { - var $message = it.MissingRefError.message(it.baseId, $schema); - if (it.opts.missingRefs == 'fail') { - it.logger.error($message); - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' '; - } - if (it.opts.verbose) { - out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - if ($breakOnError) { - out += ' if (false) { '; - } - } else if (it.opts.missingRefs == 'ignore') { - it.logger.warn($message); - if ($breakOnError) { - out += ' if (true) { '; - } - } else { - throw new it.MissingRefError(it.baseId, $schema, $message); - } - } else if ($refVal.inline) { - var $it = it.util.copy(it); - $it.level++; - var $nextValid = 'valid' + $it.level; - $it.schema = $refVal.schema; - $it.schemaPath = ''; - $it.errSchemaPath = $schema; - var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); - out += ' ' + ($code) + ' '; - if ($breakOnError) { - out += ' if (' + ($nextValid) + ') { '; - } + + var _coerceCreatePackageN = coerceCreatePackageName(builderName); + + const packageName = _coerceCreatePackageN.fullName, + commandName = _coerceCreatePackageN.name; + + + const linkLoc = path.join(config.linkFolder, commandName); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + reporter.info(reporter.lang('linkUsing', packageName)); } else { - $async = $refVal.$async === true; - $refCode = $refVal.code; + yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]); } + + const binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {}); + const command = path.resolve(binFolder, commandName); + const env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('create', config.cwd, config); + + yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true, env }); + }); + + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); + +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; +exports.parsePackageName = parsePackageName; +exports.coerceCreatePackageName = coerceCreatePackageName; + +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); +} + +var _child; + +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); +} + +var _executeLifecycleScript; + +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(111); +} + +var _fs; + +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); +} + +var _global; + +function _load_global() { + return _global = __webpack_require__(121); +} + +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + +function setFlags(commander) { + commander.description('Creates new projects from any create-* starter kits.'); +} + +function hasWrapper(commander, args) { + return true; +} + +function parsePackageName(str) { + if (str.charAt(0) === '/') { + throw new Error(`Name should not start with "/", got "${str}"`); } - if ($refCode) { - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; - if (it.opts.passContext) { - out += ' ' + ($refCode) + '.call(this, '; - } else { - out += ' ' + ($refCode) + '( '; - } - out += ' ' + ($data) + ', (dataPath || \'\')'; - if (it.errorPath != '""') { - out += ' + ' + (it.errorPath); - } - var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData', - $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty'; - out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData) '; - var __callValidate = out; - out = $$outStack.pop(); - if ($async) { - if (!it.async) throw new Error('async schema referenced by sync schema'); - if ($breakOnError) { - out += ' var ' + ($valid) + '; '; - } - out += ' try { ' + (it.yieldAwait) + ' ' + (__callValidate) + '; '; - if ($breakOnError) { - out += ' ' + ($valid) + ' = true; '; - } - out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; '; - if ($breakOnError) { - out += ' ' + ($valid) + ' = false; '; - } - out += ' } '; - if ($breakOnError) { - out += ' if (' + ($valid) + ') { '; - } - } else { - out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } '; - if ($breakOnError) { - out += ' else { '; - } - } + if (str.charAt(0) === '.') { + throw new Error(`Name should not start with ".", got "${str}"`); } - return out; + const parts = str.split('/'); + const isScoped = str.charAt(0) === '@'; + if (isScoped && parts[0] === '@') { + throw new Error(`Scope should not be empty, got "${str}"`); + } + const scope = isScoped ? parts[0] : ''; + const name = parts[isScoped ? 1 : 0] || ''; + const path = parts.slice(isScoped ? 2 : 1).join('/'); + const fullName = [scope, name].filter(Boolean).join('/'); + const full = [scope, name, path].filter(Boolean).join('/'); + + return { fullName, name, scope, path, full }; } +function coerceCreatePackageName(str) { + const pkgNameObj = parsePackageName(str); + const coercedName = pkgNameObj.name !== '' ? `create-${pkgNameObj.name}` : `create`; + const coercedPkgNameObj = (0, (_extends2 || _load_extends()).default)({}, pkgNameObj, { + name: coercedName, + fullName: [pkgNameObj.scope, coercedName].filter(Boolean).join('/'), + full: [pkgNameObj.scope, coercedName, pkgNameObj.path].filter(Boolean).join('/') + }); + return coercedPkgNameObj; +} /***/ }), /* 497 */ @@ -92687,2852 +91946,2194 @@ module.exports = function generate_ref(it, $keyword, $ruleType) { "use strict"; -module.exports = function generate_required(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - var $vSchema = 'schema' + $lvl; - if (!$isData) { - if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) { - var $required = []; - var arr1 = $schema; - if (arr1) { - var $property, i1 = -1, - l1 = arr1.length - 1; - while (i1 < l1) { - $property = arr1[i1 += 1]; - var $propertySch = it.schema.properties[$property]; - if (!($propertySch && it.util.schemaHasRules($propertySch, it.RULES.all))) { - $required[$required.length] = $property; - } - } - } - } else { - var $required = $schema; - } - } - if ($isData || $required.length) { - var $currentErrorPath = it.errorPath, - $loopRequired = $isData || $required.length >= it.opts.loopRequired, - $ownProperties = it.opts.ownProperties; - if ($breakOnError) { - out += ' var missing' + ($lvl) + '; '; - if ($loopRequired) { - if (!$isData) { - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; - } - var $i = 'i' + $lvl, - $propertyPath = 'schema' + $lvl + '[' + $i + ']', - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); - } - out += ' var ' + ($valid) + ' = true; '; - if ($isData) { - out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {'; - } - out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined '; - if ($ownProperties) { - out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; - } - out += '; if (!' + ($valid) + ') break; } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - } else { - out += ' if ( '; - var arr2 = $required; - if (arr2) { - var $propertyKey, $i = -1, - l2 = arr2.length - 1; - while ($i < l2) { - $propertyKey = arr2[$i += 1]; - if ($i) { - out += ' || '; - } - var $prop = it.util.getProperty($propertyKey), - $useData = $data + $prop; - out += ' ( ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) '; - } - } - out += ') { '; - var $propertyPath = 'missing' + $lvl, - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath; - } - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } else { '; - } - } else { - if ($loopRequired) { - if (!$isData) { - out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; '; - } - var $i = 'i' + $lvl, - $propertyPath = 'schema' + $lvl + '[' + $i + ']', - $missingProperty = '\' + ' + $propertyPath + ' + \''; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers); - } - if ($isData) { - out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { '; - } - out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) '; - } - out += ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } '; - if ($isData) { - out += ' } '; - } - } else { - var arr3 = $required; - if (arr3) { - var $propertyKey, i3 = -1, - l3 = arr3.length - 1; - while (i3 < l3) { - $propertyKey = arr3[i3 += 1]; - var $prop = it.util.getProperty($propertyKey), - $missingProperty = it.util.escapeQuotes($propertyKey), - $useData = $data + $prop; - if (it.opts._errorDataPathProperty) { - it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers); - } - out += ' if ( ' + ($useData) + ' === undefined '; - if ($ownProperties) { - out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') '; - } - out += ') { var err = '; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } '; - if (it.opts.messages !== false) { - out += ' , message: \''; - if (it.opts._errorDataPathProperty) { - out += 'is a required property'; - } else { - out += 'should have required property \\\'' + ($missingProperty) + '\\\''; - } - out += '\' '; - } - if (it.opts.verbose) { - out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - out += '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } '; - } - } - } - } - it.errorPath = $currentErrorPath; - } else if ($breakOnError) { - out += ' if (true) {'; - } - return out; -} +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -/***/ }), -/* 498 */ -/***/ (function(module, exports, __webpack_require__) { +var _asyncToGenerator2; -"use strict"; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} -module.exports = function generate_uniqueItems(it, $keyword, $ruleType) { - var out = ' '; - var $lvl = it.level; - var $dataLvl = it.dataLevel; - var $schema = it.schema[$keyword]; - var $schemaPath = it.schemaPath + it.util.getProperty($keyword); - var $errSchemaPath = it.errSchemaPath + '/' + $keyword; - var $breakOnError = !it.opts.allErrors; - var $data = 'data' + ($dataLvl || ''); - var $valid = 'valid' + $lvl; - var $isData = it.opts.$data && $schema && $schema.$data, - $schemaValue; - if ($isData) { - out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; '; - $schemaValue = 'schema' + $lvl; - } else { - $schemaValue = $schema; - } - if (($schema || $isData) && it.opts.uniqueItems !== false) { - if ($isData) { - out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { '; - } - out += ' var ' + ($valid) + ' = true; if (' + ($data) + '.length > 1) { var i = ' + ($data) + '.length, j; outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } } '; - if ($isData) { - out += ' } '; - } - out += ' if (!' + ($valid) + ') { '; - var $$outStack = $$outStack || []; - $$outStack.push(out); - out = ''; /* istanbul ignore else */ - if (it.createErrors !== false) { - out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } '; - if (it.opts.messages !== false) { - out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' '; - } - if (it.opts.verbose) { - out += ' , schema: '; - if ($isData) { - out += 'validate.schema' + ($schemaPath); - } else { - out += '' + ($schema); - } - out += ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' '; - } - out += ' } '; - } else { - out += ' {} '; - } - var __err = out; - out = $$outStack.pop(); - if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */ - if (it.async) { - out += ' throw new ValidationError([' + (__err) + ']); '; - } else { - out += ' validate.errors = [' + (__err) + ']; return false; '; - } - } else { - out += ' var err = ' + (__err) + '; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; '; - } - out += ' } '; - if ($breakOnError) { - out += ' else { '; - } - } else { - if ($breakOnError) { - out += ' if (true) { '; +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config); + + if (args.length < 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand')); } - } - return out; -} + const execName = args[0], + rest = args.slice(1); -/***/ }), -/* 499 */ -/***/ (function(module, exports, __webpack_require__) { + yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env }); + }); -"use strict"; + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i; -var customRuleCode = __webpack_require__(485); +var _errors; -module.exports = { - add: addKeyword, - get: getKeyword, - remove: removeKeyword -}; +function _load_errors() { + return _errors = __webpack_require__(6); +} -/** - * Define custom keyword - * @this Ajv - * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords). - * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`. - * @return {Ajv} this for method chaining - */ -function addKeyword(keyword, definition) { - /* jshint validthis: true */ - /* eslint no-shadow: 0 */ - var RULES = this.RULES; +var _child; - if (RULES.keywords[keyword]) - throw new Error('Keyword ' + keyword + ' is already defined'); +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); +} - if (!IDENTIFIER.test(keyword)) - throw new Error('Keyword ' + keyword + ' is not a valid identifier'); +var _executeLifecycleScript; - if (definition) { - if (definition.macro && definition.valid !== undefined) - throw new Error('"valid" option cannot be used with macro keywords'); +function _load_executeLifecycleScript() { + return _executeLifecycleScript = __webpack_require__(111); +} - var dataType = definition.type; - if (Array.isArray(dataType)) { - var i, len = dataType.length; - for (i=0; i { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + let manifest; + if (flags.useManifest) { + manifest = yield config.readJson(flags.useManifest); + } else { + manifest = yield config.readRootManifest(); + } + if (!manifest.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); + } + if (!manifest.version) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); } - var rule = { - keyword: keyword, - definition: definition, - custom: true, - code: customRuleCode, - implements: definition.implements + const entry = { + name: manifest.name, + version: manifest.version, + resolved: flags.resolved, + registry: flags.registry || manifest._registry, + optionalDependencies: manifest.optionalDependencies, + dependencies: manifest.dependencies }; - ruleGroup.rules.push(rule); - RULES.custom[keyword] = rule; - } + const pattern = flags.pattern || `${entry.name}@${entry.version}`; + reporter.log((0, (_lockfile || _load_lockfile()).stringify)({ + [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry) + })); + }); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); - function checkDataType(dataType) { - if (!RULES.types[dataType]) throw new Error('Unknown type ' + dataType); - } +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; - return this; +var _errors; + +function _load_errors() { + return _errors = __webpack_require__(6); } +var _lockfile; -/** - * Get keyword - * @this Ajv - * @param {String} keyword pre-defined or custom keyword. - * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise. - */ -function getKeyword(keyword) { - /* jshint validthis: true */ - var rule = this.RULES.custom[keyword]; - return rule ? rule.definition : this.RULES.keywords[keyword] || false; +function _load_lockfile() { + return _lockfile = __webpack_require__(19); } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Remove keyword - * @this Ajv - * @param {String} keyword pre-defined or custom keyword. - * @return {Ajv} this for method chaining - */ -function removeKeyword(keyword) { - /* jshint validthis: true */ - var RULES = this.RULES; - delete RULES.keywords[keyword]; - delete RULES.all[keyword]; - delete RULES.custom[keyword]; - for (var i=0; i', 'description'); + commander.option('--resolved ', 'description'); + commander.option('--registry ', 'description'); } +const examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash']; /***/ }), -/* 500 */ +/* 499 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var META_SCHEMA_ID = 'http://json-schema.org/draft-06/schema'; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; +exports.run = run; -module.exports = function (ajv) { - var defaultMeta = ajv._opts.defaultMeta; - var metaSchemaRef = typeof defaultMeta == 'string' - ? { $ref: defaultMeta } - : ajv.getSchema(META_SCHEMA_ID) - ? { $ref: META_SCHEMA_ID } - : {}; +var _index; - ajv.addKeyword('patternGroups', { - // implemented in properties.jst - metaSchema: { - type: 'object', - additionalProperties: { - type: 'object', - required: [ 'schema' ], - properties: { - maximum: { - type: 'integer', - minimum: 0 - }, - minimum: { - type: 'integer', - minimum: 0 - }, - schema: metaSchemaRef - }, - additionalProperties: false - } - } - }); - ajv.RULES.all.properties.implements.push('patternGroups'); -}; +function _load_index() { + return _index = _interopRequireDefault(__webpack_require__(334)); +} +var _constants; -/***/ }), -/* 501 */ -/***/ (function(module, exports) { +function _load_constants() { + return _constants = _interopRequireWildcard(__webpack_require__(8)); +} -module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"https://raw.githubusercontent.com/epoberezkin/ajv/master/lib/refs/$data.json#","description":"Meta-schema for $data reference (JSON-schema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false} +var _misc; -/***/ }), -/* 502 */ -/***/ (function(module, exports) { +function _load_misc() { + return _misc = __webpack_require__(18); +} -module.exports = {"$schema":"http://json-schema.org/draft-06/schema#","$id":"http://json-schema.org/draft-06/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"title":{"type":"string"},"description":{"type":"string"},"default":{},"examples":{"type":"array","items":{}},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":{}},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":{},"enum":{"type":"array","minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":{}} +var _aliases; -/***/ }), -/* 503 */ -/***/ (function(module, exports, __webpack_require__) { +function _load_aliases() { + return _aliases = _interopRequireDefault(__webpack_require__(346)); +} -"use strict"; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var traverse = module.exports = function (schema, opts, cb) { - if (typeof opts == 'function') { - cb = opts; - opts = {}; - } - _traverse(opts, cb, schema, '', schema); -}; +const chalk = __webpack_require__(30); +function hasWrapper(flags, args) { + return false; +} -traverse.keywords = { - additionalItems: true, - items: true, - contains: true, - additionalProperties: true, - propertyNames: true, - not: true -}; +function setFlags(commander) { + commander.description('Displays help information.'); +} -traverse.arrayKeywords = { - items: true, - allOf: true, - anyOf: true, - oneOf: true -}; +function run(config, reporter, commander, args) { + if (args.length) { + const commandName = args.shift(); + if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) { + const command = (_index || _load_index()).default[commandName]; + if (command) { + command.setFlags(commander); + const examples = (command.examples || []).map(example => ` $ yarn ${example}`); + if (examples.length) { + commander.on('--help', () => { + reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n')))); + }); + } + // eslint-disable-next-line yarn-internal/warn-language + commander.on('--help', () => reporter.log(' ' + command.getDocsInfo + '\n')); + commander.help(); + return Promise.resolve(); + } + } + } -traverse.propsKeywords = { - definitions: true, - properties: true, - patternProperties: true, - dependencies: true -}; + commander.on('--help', () => { + const commandsText = []; + for (var _iterator = Object.keys((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; -traverse.skipKeywords = { - enum: true, - const: true, - required: true, - maximum: true, - minimum: true, - exclusiveMaximum: true, - exclusiveMinimum: true, - multipleOf: true, - maxLength: true, - minLength: true, - pattern: true, - format: true, - maxItems: true, - minItems: true, - uniqueItems: true, - maxProperties: true, - minProperties: true -}; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } + const name = _ref; -function _traverse(opts, cb, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) { - if (schema && typeof schema == 'object' && !Array.isArray(schema)) { - cb(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex); - for (var key in schema) { - var sch = schema[key]; - if (Array.isArray(sch)) { - if (key in traverse.arrayKeywords) { - for (var i=0; i (_aliases || _load_aliases()).default[key]).indexOf(name) > -1) { + continue; + } + if ((_aliases || _load_aliases()).default[name]) { + commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`); + } else { + commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`); } } - } -} + reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n')))); + reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND')))); + reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS)))); + }); + commander.options.sort((_misc || _load_misc()).sortOptionsByFlags); -function escapeJsonPtr(str) { - return str.replace(/~/g, '~0').replace(/\//g, '~1'); + commander.help(); + return Promise.resolve(); } - /***/ }), -/* 504 */ +/* 500 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const x = module.exports; -const ESC = '\u001B['; -const OSC = '\u001B]'; -const BEL = '\u0007'; -const SEP = ';'; -const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal'; -x.cursorTo = (x, y) => { - if (typeof x !== 'number') { - throw new TypeError('The `x` argument is required'); - } +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.Import = exports.noArguments = undefined; - if (typeof y !== 'number') { - return ESC + (x + 1) + 'G'; - } +var _asyncToGenerator2; - return ESC + (y + 1) + ';' + (x + 1) + 'H'; -}; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} -x.cursorMove = (x, y) => { - if (typeof x !== 'number') { - throw new TypeError('The `x` argument is required'); - } +let run = exports.run = (() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} })); + yield imp.init(); + }); - let ret = ''; + return function run(_x, _x2, _x3, _x4) { + return _ref5.apply(this, arguments); + }; +})(); - if (x < 0) { - ret += ESC + (-x) + 'D'; - } else if (x > 0) { - ret += ESC + x + 'C'; - } +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - if (y < 0) { - ret += ESC + (-y) + 'A'; - } else if (y > 0) { - ret += ESC + y + 'B'; - } +var _install; - return ret; -}; +function _load_install() { + return _install = __webpack_require__(34); +} -x.cursorUp = count => ESC + (typeof count === 'number' ? count : 1) + 'A'; -x.cursorDown = count => ESC + (typeof count === 'number' ? count : 1) + 'B'; -x.cursorForward = count => ESC + (typeof count === 'number' ? count : 1) + 'C'; -x.cursorBackward = count => ESC + (typeof count === 'number' ? count : 1) + 'D'; +var _check; -x.cursorLeft = ESC + 'G'; -x.cursorSavePosition = ESC + (isTerminalApp ? '7' : 's'); -x.cursorRestorePosition = ESC + (isTerminalApp ? '8' : 'u'); -x.cursorGetPosition = ESC + '6n'; -x.cursorNextLine = ESC + 'E'; -x.cursorPrevLine = ESC + 'F'; -x.cursorHide = ESC + '?25l'; -x.cursorShow = ESC + '?25h'; +function _load_check() { + return _check = __webpack_require__(350); +} -x.eraseLines = count => { - let clear = ''; +var _errors; - for (let i = 0; i < count; i++) { - clear += x.eraseLine + (i < count - 1 ? x.cursorUp() : ''); - } +function _load_errors() { + return _errors = __webpack_require__(6); +} - if (count) { - clear += x.cursorLeft; - } +var _index; - return clear; -}; +function _load_index() { + return _index = __webpack_require__(78); +} -x.eraseEndLine = ESC + 'K'; -x.eraseStartLine = ESC + '1K'; -x.eraseLine = ESC + '2K'; -x.eraseDown = ESC + 'J'; -x.eraseUp = ESC + '1J'; -x.eraseScreen = ESC + '2J'; -x.scrollUp = ESC + 'S'; -x.scrollDown = ESC + 'T'; +var _baseResolver; -x.clearScreen = '\u001Bc'; -x.beep = BEL; +function _load_baseResolver() { + return _baseResolver = _interopRequireDefault(__webpack_require__(123)); +} -x.link = (text, url) => { - return [ - OSC, - '8', - SEP, - SEP, - url, - BEL, - text, - OSC, - '8', - SEP, - SEP, - BEL - ].join(''); -}; +var _hostedGitResolver; -x.image = (buf, opts) => { - opts = opts || {}; +function _load_hostedGitResolver() { + return _hostedGitResolver = _interopRequireDefault(__webpack_require__(109)); +} - let ret = OSC + '1337;File=inline=1'; +var _hostedGitResolver2; - if (opts.width) { - ret += `;width=${opts.width}`; - } +function _load_hostedGitResolver2() { + return _hostedGitResolver2 = __webpack_require__(109); +} - if (opts.height) { - ret += `;height=${opts.height}`; - } +var _gistResolver; - if (opts.preserveAspectRatio === false) { - ret += ';preserveAspectRatio=0'; - } +function _load_gistResolver() { + return _gistResolver = _interopRequireDefault(__webpack_require__(214)); +} - return ret + ':' + buf.toString('base64') + BEL; -}; +var _gistResolver2; -x.iTerm = {}; +function _load_gistResolver2() { + return _gistResolver2 = __webpack_require__(214); +} -x.iTerm.setCwd = cwd => OSC + '50;CurrentDir=' + (cwd || process.cwd()) + BEL; +var _gitResolver; +function _load_gitResolver() { + return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +} -/***/ }), -/* 505 */ -/***/ (function(module, exports, __webpack_require__) { +var _fileResolver; -"use strict"; +function _load_fileResolver() { + return _fileResolver = _interopRequireDefault(__webpack_require__(213)); +} -module.exports = function () { - return /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-PRZcf-nqry=><]/g; -}; +var _packageResolver; +function _load_packageResolver() { + return _packageResolver = _interopRequireDefault(__webpack_require__(360)); +} -/***/ }), -/* 506 */ -/***/ (function(module, exports, __webpack_require__) { +var _packageRequest; -"use strict"; -/* WEBPACK VAR INJECTION */(function(module) { -const colorConvert = __webpack_require__(608); +function _load_packageRequest() { + return _packageRequest = _interopRequireDefault(__webpack_require__(122)); +} -const wrapAnsi16 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${code + offset}m`; -}; +var _packageReference; -const wrapAnsi256 = (fn, offset) => function () { - const code = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};5;${code}m`; -}; +function _load_packageReference() { + return _packageReference = _interopRequireDefault(__webpack_require__(359)); +} -const wrapAnsi16m = (fn, offset) => function () { - const rgb = fn.apply(colorConvert, arguments); - return `\u001B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`; -}; +var _packageFetcher; -function assembleStyles() { - const codes = new Map(); - const styles = { - modifier: { - reset: [0, 0], - // 21 isn't widely supported and 22 does the same thing - bold: [1, 22], - dim: [2, 22], - italic: [3, 23], - underline: [4, 24], - inverse: [7, 27], - hidden: [8, 28], - strikethrough: [9, 29] - }, - color: { - black: [30, 39], - red: [31, 39], - green: [32, 39], - yellow: [33, 39], - blue: [34, 39], - magenta: [35, 39], - cyan: [36, 39], - white: [37, 39], - gray: [90, 39], +function _load_packageFetcher() { + return _packageFetcher = _interopRequireWildcard(__webpack_require__(208)); +} - // Bright color - redBright: [91, 39], - greenBright: [92, 39], - yellowBright: [93, 39], - blueBright: [94, 39], - magentaBright: [95, 39], - cyanBright: [96, 39], - whiteBright: [97, 39] - }, - bgColor: { - bgBlack: [40, 49], - bgRed: [41, 49], - bgGreen: [42, 49], - bgYellow: [43, 49], - bgBlue: [44, 49], - bgMagenta: [45, 49], - bgCyan: [46, 49], - bgWhite: [47, 49], +var _packageLinker; - // Bright color - bgBlackBright: [100, 49], - bgRedBright: [101, 49], - bgGreenBright: [102, 49], - bgYellowBright: [103, 49], - bgBlueBright: [104, 49], - bgMagentaBright: [105, 49], - bgCyanBright: [106, 49], - bgWhiteBright: [107, 49] - } - }; +function _load_packageLinker() { + return _packageLinker = _interopRequireDefault(__webpack_require__(209)); +} - // Fix humans - styles.color.grey = styles.color.gray; +var _packageCompatibility; - for (const groupName of Object.keys(styles)) { - const group = styles[groupName]; +function _load_packageCompatibility() { + return _packageCompatibility = _interopRequireWildcard(__webpack_require__(207)); +} - for (const styleName of Object.keys(group)) { - const style = group[styleName]; +var _lockfile; - styles[styleName] = { - open: `\u001B[${style[0]}m`, - close: `\u001B[${style[1]}m` - }; +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} - group[styleName] = styles[styleName]; +var _normalizePattern9; - codes.set(style[0], style[1]); - } +function _load_normalizePattern() { + return _normalizePattern9 = __webpack_require__(37); +} - Object.defineProperty(styles, groupName, { - value: group, - enumerable: false - }); +var _logicalDependencyTree; - Object.defineProperty(styles, 'codes', { - value: codes, - enumerable: false - }); - } +function _load_logicalDependencyTree() { + return _logicalDependencyTree = __webpack_require__(550); +} - const ansi2ansi = n => n; - const rgb2rgb = (r, g, b) => [r, g, b]; +var _fs; - styles.color.close = '\u001B[39m'; - styles.bgColor.close = '\u001B[49m'; +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); +} - styles.color.ansi = { - ansi: wrapAnsi16(ansi2ansi, 0) - }; - styles.color.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 0) - }; - styles.color.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 0) - }; +var _misc; - styles.bgColor.ansi = { - ansi: wrapAnsi16(ansi2ansi, 10) - }; - styles.bgColor.ansi256 = { - ansi256: wrapAnsi256(ansi2ansi, 10) - }; - styles.bgColor.ansi16m = { - rgb: wrapAnsi16m(rgb2rgb, 10) - }; +function _load_misc() { + return _misc = _interopRequireWildcard(__webpack_require__(18)); +} - for (let key of Object.keys(colorConvert)) { - if (typeof colorConvert[key] !== 'object') { - continue; - } - - const suite = colorConvert[key]; - - if (key === 'ansi16') { - key = 'ansi'; - } - - if ('ansi16' in suite) { - styles.color.ansi[key] = wrapAnsi16(suite.ansi16, 0); - styles.bgColor.ansi[key] = wrapAnsi16(suite.ansi16, 10); - } - - if ('ansi256' in suite) { - styles.color.ansi256[key] = wrapAnsi256(suite.ansi256, 0); - styles.bgColor.ansi256[key] = wrapAnsi256(suite.ansi256, 10); - } - - if ('rgb' in suite) { - styles.color.ansi16m[key] = wrapAnsi16m(suite.rgb, 0); - styles.bgColor.ansi16m[key] = wrapAnsi16m(suite.rgb, 10); - } - } +var _constants; - return styles; +function _load_constants() { + return _constants = __webpack_require__(8); } -// Make the export immutable -Object.defineProperty(module, 'exports', { - enumerable: true, - get: assembleStyles -}); - -/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(163)(module))) - -/***/ }), -/* 507 */ -/***/ (function(module, exports) { +var _semver; -function webpackEmptyContext(req) { - throw new Error("Cannot find module '" + req + "'."); +function _load_semver() { + return _semver = _interopRequireDefault(__webpack_require__(22)); } -webpackEmptyContext.keys = function() { return []; }; -webpackEmptyContext.resolve = webpackEmptyContext; -module.exports = webpackEmptyContext; -webpackEmptyContext.id = 507; - -/***/ }), -/* 508 */ -/***/ (function(module, exports, __webpack_require__) { -"use strict"; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - // global key for user preferred registration -var REGISTRATION_KEY = '@@any-promise/REGISTRATION', - // Prior registration (preferred or detected) - registered = null +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/** - * Registers the given implementation. An implementation must - * be registered prior to any call to `require("any-promise")`, - * typically on application load. - * - * If called with no arguments, will return registration in - * following priority: - * - * For Node.js: - * - * 1. Previous registration - * 2. global.Promise if node.js version >= 0.12 - * 3. Auto detected promise based on first sucessful require of - * known promise libraries. Note this is a last resort, as the - * loaded library is non-deterministic. node.js >= 0.12 will - * always use global.Promise over this priority list. - * 4. Throws error. - * - * For Browser: - * - * 1. Previous registration - * 2. window.Promise - * 3. Throws error. - * - * Options: - * - * Promise: Desired Promise constructor - * global: Boolean - Should the registration be cached in a global variable to - * allow cross dependency/bundle registration? (default true) - */ -module.exports = function(root, loadImplementation){ - return function register(implementation, opts){ - implementation = implementation || null - opts = opts || {} - // global registration unless explicitly {global: false} in options (default true) - var registerGlobal = opts.global !== false; +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const uuid = __webpack_require__(120); +const ssri = __webpack_require__(65); +const nodeVersion = process.versions.node.split('-')[0]; - // load any previous global registration - if(registered === null && registerGlobal){ - registered = root[REGISTRATION_KEY] || null - } +const noArguments = exports.noArguments = true; - if(registered !== null - && implementation !== null - && registered.implementation !== implementation){ - // Throw error if attempting to redefine implementation - throw new Error('any-promise already defined as "'+registered.implementation+ - '". You can only register an implementation before the first '+ - ' call to require("any-promise") and an implementation cannot be changed') +class ImportResolver extends (_baseResolver || _load_baseResolver()).default { + getCwd() { + if (this.request.parentRequest) { + const parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern); + invariant(parent._loc, 'expected package location'); + return path.dirname(parent._loc); } + return this.config.cwd; + } - if(registered === null){ - // use provided implementation - if(implementation !== null && typeof opts.Promise !== 'undefined'){ - registered = { - Promise: opts.Promise, - implementation: implementation - } - } else { - // require implementation if implementation is specified but not provided - registered = loadImplementation(implementation) - } + resolveHostedGit(info, Resolver) { + var _normalizePattern = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); - if(registerGlobal){ - // register preference globally in case multiple installations - root[REGISTRATION_KEY] = registered - } - } + const range = _normalizePattern.range; - return registered + const exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter); + const hash = info.gitHead; + invariant(hash, 'expected package gitHead'); + const url = Resolver.getTarballUrl(exploded, hash); + info._uid = hash; + info._remote = { + resolved: url, + type: 'tarball', + registry: this.registry, + reference: url, + hash: null + }; + return info; } -} + resolveGist(info, Resolver) { + var _normalizePattern2 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); -/***/ }), -/* 509 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; + const range = _normalizePattern2.range; -module.exports = __webpack_require__(508)(global, loadImplementation); + var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter); -/** - * Node.js version of loadImplementation. - * - * Requires the given implementation and returns the registration - * containing {Promise, implementation} - * - * If implementation is undefined or global.Promise, loads it - * Otherwise uses require - */ -function loadImplementation(implementation){ - var impl = null + const id = _explodeGistFragment.id; - if(shouldPreferGlobalPromise(implementation)){ - // if no implementation or env specified use global.Promise - impl = { - Promise: global.Promise, - implementation: 'global.Promise' - } - } else if(implementation){ - // if implementation specified, require it - var lib = !(function webpackMissingModule() { var e = new Error("Cannot find module \".\""); e.code = 'MODULE_NOT_FOUND'; throw e; }()) - impl = { - Promise: lib.Promise || lib, - implementation: implementation - } - } else { - // try to auto detect implementation. This is non-deterministic - // and should prefer other branches, but this is our last chance - // to load something without throwing error - impl = tryAutoDetect() + const hash = info.gitHead; + invariant(hash, 'expected package gitHead'); + const url = `https://gist.github.com/${id}.git`; + info._uid = hash; + info._remote = { + resolved: `${url}#${hash}`, + type: 'git', + registry: this.registry, + reference: url, + hash + }; + return info; } - if(impl === null){ - throw new Error('Cannot find any-promise implementation nor'+ - ' global.Promise. You must install polyfill or call'+ - ' require("any-promise/register") with your preferred'+ - ' implementation, e.g. require("any-promise/register/bluebird")'+ - ' on application load prior to any require("any-promise").') + resolveGit(info, Resolver) { + const url = info._resolved; + const hash = info.gitHead; + invariant(url, 'expected package _resolved'); + invariant(hash, 'expected package gitHead'); + info._uid = hash; + info._remote = { + resolved: `${url}#${hash}`, + type: 'git', + registry: this.registry, + reference: url, + hash + }; + return info; } - return impl -} - -/** - * Determines if the global.Promise should be preferred if an implementation - * has not been registered. - */ -function shouldPreferGlobalPromise(implementation){ - if(implementation){ - return implementation === 'global.Promise' - } else if(typeof global.Promise !== 'undefined'){ - // Load global promise if implementation not specified - // Versions < 0.11 did not have global Promise - // Do not use for version < 0.12 as version 0.11 contained buggy versions - var version = (/v(\d+)\.(\d+)\.(\d+)/).exec(process.version) - return !(version && +version[1] == 0 && +version[2] < 12) - } + resolveFile(info, Resolver) { + var _normalizePattern3 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); - // do not have global.Promise or another implementation was specified - return false -} + const range = _normalizePattern3.range; -/** - * Look for common libs as last resort there is no guarantee that - * this will return a desired implementation or even be deterministic. - * The priority is also nearly arbitrary. We are only doing this - * for older versions of Node.js <0.12 that do not have a reasonable - * global.Promise implementation and we the user has not registered - * the preference. This preserves the behavior of any-promise <= 0.1 - * and may be deprecated or removed in the future - */ -function tryAutoDetect(){ - var libs = [ - "es6-promise", - "promise", - "native-promise-only", - "bluebird", - "rsvp", - "when", - "q", - "pinkie", - "lie", - "vow"] - var i = 0, len = libs.length - for(; i < len; i++){ - try { - return loadImplementation(libs[i]) - } catch(e){} + let loc = (_misc || _load_misc()).removePrefix(range, 'file:'); + if (!path.isAbsolute(loc)) { + loc = path.join(this.config.cwd, loc); + } + info._uid = info.version; + info._remote = { + type: 'copy', + registry: this.registry, + hash: `${uuid.v4()}-${new Date().getTime()}`, + reference: loc + }; + return info; } - return null -} + resolveRegistry(info) { + let url = info._resolved; + const hash = info._shasum; + invariant(url, 'expected package _resolved'); + invariant(hash, 'expected package _shasum'); + if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { + url = url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY); + } + info._uid = info.version; + info._remote = { + resolved: `${url}#${hash}`, + type: 'tarball', + registry: this.registry, + reference: url, + integrity: info._integrity ? ssri.parse(info._integrity) : ssri.fromHex(hash, 'sha1'), + hash + }; + return info; + } -/***/ }), -/* 510 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -/*! - * arr-flatten - * - * Copyright (c) 2014-2017, Jon Schlinkert. - * Released under the MIT License. - */ + resolveImport(info) { + var _normalizePattern4 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); + const range = _normalizePattern4.range; + const Resolver = (0, (_index || _load_index()).getExoticResolver)(range); + if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) { + return this.resolveHostedGit(info, Resolver); + } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) { + return this.resolveGist(info, Resolver); + } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) { + return this.resolveGit(info, Resolver); + } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) { + return this.resolveFile(info, Resolver); + } + return this.resolveRegistry(info); + } -module.exports = function (arr) { - return flat(arr, []); -}; + resolveLocation(loc) { + var _this = this; -function flat(arr, res) { - var i = 0, cur; - var len = arr.length; - for (; i < len; i++) { - cur = arr[i]; - Array.isArray(cur) ? flat(cur, res) : res.push(cur); + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const info = yield _this.config.tryManifest(loc, 'npm', false); + if (!info) { + return null; + } + return _this.resolveImport(info); + })(); } - return res; -} - -/***/ }), -/* 511 */ -/***/ (function(module, exports, __webpack_require__) { + resolveFixedVersion(fixedVersionPattern) { + var _this2 = this; -"use strict"; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _normalizePattern5 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(fixedVersionPattern); -module.exports = function (arr, predicate, ctx) { - if (typeof Array.prototype.findIndex === 'function') { - return arr.findIndex(predicate, ctx); - } + const range = _normalizePattern5.range; - if (typeof predicate !== 'function') { - throw new TypeError('predicate must be a function'); - } + const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); + const manifest = exoticResolver ? yield _this2.request.findExoticVersionInfo(exoticResolver, range) : yield _this2.request.findVersionOnRegistry(fixedVersionPattern); + return manifest; + })(); + } - var list = Object(arr); - var len = list.length; + _resolveFromFixedVersions() { + var _this3 = this; - if (len === 0) { - return -1; - } + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + invariant(_this3.request instanceof ImportPackageRequest, 'request must be ImportPackageRequest'); - for (var i = 0; i < len; i++) { - if (predicate.call(ctx, list[i], i, list)) { - return i; - } - } + var _normalizePattern6 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(_this3.pattern); - return -1; -}; + const name = _normalizePattern6.name; + invariant(_this3.request.dependencyTree instanceof (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree, 'dependencyTree on request must be LogicalDependencyTree'); + const fixedVersionPattern = _this3.request.dependencyTree.getFixedVersionPattern(name, _this3.request.parentNames); + const info = yield _this3.config.getCache(`import-resolver-${fixedVersionPattern}`, function () { + return _this3.resolveFixedVersion(fixedVersionPattern); + }); + if (info) { + return info; + } + throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('importResolveFailed', name, _this3.getCwd())); + })(); + } -/***/ }), -/* 512 */ -/***/ (function(module, exports, __webpack_require__) { + _resolveFromNodeModules() { + var _this4 = this; -"use strict"; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + var _normalizePattern7 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(_this4.pattern); + const name = _normalizePattern7.name; -var rawAsap = __webpack_require__(513); -var freeTasks = []; + let cwd = _this4.getCwd(); + while (!path.relative(_this4.config.cwd, cwd).startsWith('..')) { + const loc = path.join(cwd, 'node_modules', name); + const info = yield _this4.config.getCache(`import-resolver-${loc}`, function () { + return _this4.resolveLocation(loc); + }); + if (info) { + return info; + } + cwd = path.resolve(cwd, '../..'); + } + throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('importResolveFailed', name, _this4.getCwd())); + })(); + } -/** - * Calls a task as soon as possible after returning, in its own event, with - * priority over IO events. An exception thrown in a task can be handled by - * `process.on("uncaughtException") or `domain.on("error")`, but will otherwise - * crash the process. If the error is handled, all subsequent tasks will - * resume. - * - * @param {{call}} task A callable object, typically a function that takes no - * arguments. - */ -module.exports = asap; -function asap(task) { - var rawTask; - if (freeTasks.length) { - rawTask = freeTasks.pop(); + resolve() { + if (this.request instanceof ImportPackageRequest && this.request.dependencyTree) { + return this._resolveFromFixedVersions(); } else { - rawTask = new RawTask(); + return this._resolveFromNodeModules(); } - rawTask.task = task; - rawTask.domain = process.domain; - rawAsap(rawTask); -} - -function RawTask() { - this.task = null; - this.domain = null; + } } -RawTask.prototype.call = function () { - if (this.domain) { - this.domain.enter(); - } - var threw = true; - try { - this.task.call(); - threw = false; - // If the task throws an exception (presumably) Node.js restores the - // domain stack for the next event. - if (this.domain) { - this.domain.exit(); - } - } finally { - // We use try/finally and a threw flag to avoid messing up stack traces - // when we catch and release errors. - if (threw) { - // In Node.js, uncaught exceptions are considered fatal errors. - // Re-throw them to interrupt flushing! - // Ensure that flushing continues if an uncaught exception is - // suppressed listening process.on("uncaughtException") or - // domain.on("error"). - rawAsap.requestFlush(); - } - // If the task threw an error, we do not want to exit the domain here. - // Exiting the domain would prevent the domain from catching the error. - this.task = null; - this.domain = null; - freeTasks.push(this); - } -}; - - - -/***/ }), -/* 513 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; +class ImportPackageRequest extends (_packageRequest || _load_packageRequest()).default { + constructor(req, dependencyTree, resolver) { + super(req, resolver); + this.import = this.parentRequest instanceof ImportPackageRequest ? this.parentRequest.import : true; + this.dependencyTree = dependencyTree; + } + getRootName() { + return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root'; + } -var domain; // The domain module is executed on demand -var hasSetImmediate = typeof setImmediate === "function"; + getParentHumanName() { + return [this.getRootName()].concat(this.parentNames).join(' > '); + } -// Use the fastest means possible to execute a task in its own turn, with -// priority over other events including network IO events in Node.js. -// -// An exception thrown by a task will permanently interrupt the processing of -// subsequent tasks. The higher level `asap` function ensures that if an -// exception is thrown by a task, that the task queue will continue flushing as -// soon as possible, but if you use `rawAsap` directly, you are responsible to -// either ensure that no exceptions are thrown from your task, or to manually -// call `rawAsap.requestFlush` if an exception is thrown. -module.exports = rawAsap; -function rawAsap(task) { - if (!queue.length) { - requestFlush(); - flushing = true; + reportResolvedRangeMatch(info, resolved) { + if (info.version === resolved.version) { + return; } - // Avoids a function call - queue[queue.length] = task; -} + this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName())); + } -var queue = []; -// Once a flush has been requested, no further calls to `requestFlush` are -// necessary until the next `flush` completes. -var flushing = false; -// The position of the next task to execute in the task queue. This is -// preserved between calls to `flush` so that it can be resumed if -// a task throws an exception. -var index = 0; -// If a task schedules additional tasks recursively, the task queue can grow -// unbounded. To prevent memory excaustion, the task queue will periodically -// truncate already-completed tasks. -var capacity = 1024; + _findResolvedManifest(info) { + var _normalizePattern8 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); -// The flush function processes all tasks that have been scheduled with -// `rawAsap` unless and until one of those tasks throws an exception. -// If a task throws an exception, `flush` ensures that its state will remain -// consistent and will resume where it left off when called again. -// However, `flush` does not make any arrangements to be called again if an -// exception is thrown. -function flush() { - while (index < queue.length) { - var currentIndex = index; - // Advance the index before calling the task. This ensures that we will - // begin flushing on the next task the task throws an error. - index = index + 1; - queue[currentIndex].call(); - // Prevent leaking memory for long chains of recursive calls to `asap`. - // If we call `asap` within tasks scheduled by `asap`, the queue will - // grow, but to avoid an O(n) walk for every task we execute, we don't - // shift tasks off the queue after they have been executed. - // Instead, we periodically shift 1024 tasks off the queue. - if (index > capacity) { - // Manually shift all values starting at the index back to the - // beginning of the queue. - for (var scan = 0, newLength = queue.length - index; scan < newLength; scan++) { - queue[scan] = queue[scan + index]; - } - queue.length -= index; - index = 0; - } - } - queue.length = 0; - index = 0; - flushing = false; -} + const range = _normalizePattern8.range, + name = _normalizePattern8.name; -rawAsap.requestFlush = requestFlush; -function requestFlush() { - // Ensure flushing is not bound to any domain. - // It is not sufficient to exit the domain, because domains exist on a stack. - // To execute code outside of any domain, the following dance is necessary. - var parentDomain = process.domain; - if (parentDomain) { - if (!domain) { - // Lazy execute the domain module. - // Only employed if the user elects to use domains. - domain = __webpack_require__(965); - } - domain.active = process.domain = null; + const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; + const resolved = this.resolver.getExactVersionMatch(name, solvedRange, info); + if (resolved) { + return resolved; } + invariant(info._remote, 'expected package remote'); + const ref = new (_packageReference || _load_packageReference()).default(this, info, info._remote); + info._reference = ref; + return info; + } - // `setImmediate` is slower that `process.nextTick`, but `process.nextTick` - // cannot handle recursion. - // `requestFlush` will only be called recursively from `asap.js`, to resume - // flushing after an error is thrown into a domain. - // Conveniently, `setImmediate` was introduced in the same version - // `process.nextTick` started throwing recursion errors. - if (flushing && hasSetImmediate) { - setImmediate(flush); - } else { - process.nextTick(flush); - } + resolveToExistingVersion(info) { + const resolved = this._findResolvedManifest(info); + invariant(resolved, 'should have found a resolved reference'); + const ref = resolved._reference; + invariant(ref, 'should have a package reference'); + ref.addRequest(this); + ref.addPattern(this.pattern, resolved); + ref.addOptional(this.optional); + } - if (parentDomain) { - domain.active = process.domain = parentDomain; + findVersionInfo() { + if (!this.import) { + this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName())); + return super.findVersionInfo(); } + const resolver = new ImportResolver(this, this.pattern); + return resolver.resolve().catch(() => { + this.import = false; + this.reporter.warn(this.reporter.lang('importFailed', this.pattern, this.getParentHumanName())); + return super.findVersionInfo(); + }); + } } +class ImportPackageResolver extends (_packageResolver || _load_packageResolver()).default { + constructor(config, lockfile) { + super(config, lockfile); + this.next = []; + this.rootName = 'root'; + } -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { + find(req) { + this.next.push(req); + return Promise.resolve(); + } -// Copyright 2011 Mark Cavage All rights reserved. + findOne(req) { + var _this5 = this; -var errors = __webpack_require__(205); -var types = __webpack_require__(206); + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (_this5.activity) { + _this5.activity.tick(req.pattern); + } + const request = new ImportPackageRequest(req, _this5.dependencyTree, _this5); + yield request.find({ fresh: false }); + })(); + } -var Reader = __webpack_require__(515); -var Writer = __webpack_require__(516); + findAll(deps) { + var _this6 = this; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield Promise.all(deps.map(function (dep) { + return _this6.findOne(dep); + })); + deps = _this6.next; + _this6.next = []; + if (!deps.length) { + // all required package versions have been discovered, so now packages that + // resolved to existing versions can be resolved to their best available version + _this6.resolvePackagesWithExistingVersions(); + return; + } + yield _this6.findAll(deps); + })(); + } -// --- Exports + resetOptional() { + for (const pattern in this.patterns) { + const ref = this.patterns[pattern]._reference; + invariant(ref, 'expected reference'); + ref.optional = null; + for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref; -module.exports = { + if (_isArray) { + if (_i >= _iterator.length) break; + _ref = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref = _i.value; + } - Reader: Reader, + const req = _ref; - Writer: Writer + ref.addOptional(req.optional); + } + } + } -}; + init(deps, { isFlat, isFrozen, workspaceLayout } = { isFlat: false, isFrozen: false, workspaceLayout: undefined }) { + var _this7 = this; -for (var t in types) { - if (types.hasOwnProperty(t)) - module.exports[t] = types[t]; -} -for (var e in errors) { - if (errors.hasOwnProperty(e)) - module.exports[e] = errors[e]; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + _this7.flat = Boolean(isFlat); + const activity = _this7.activity = _this7.reporter.activity(); + yield _this7.findAll(deps); + _this7.resetOptional(); + activity.end(); + _this7.activity = null; + })(); + } } +class Import extends (_install || _load_install()).Install { + constructor(flags, config, reporter, lockfile) { + super(flags, config, reporter, lockfile); + this.resolver = new ImportPackageResolver(this.config, this.lockfile); + this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); + } + createLogicalDependencyTree(packageJson, packageLock) { + invariant(packageJson, 'package.json should exist'); + invariant(packageLock, 'package-lock.json should exist'); + invariant(this.resolver instanceof ImportPackageResolver, 'resolver should be an ImportPackageResolver'); + try { + this.resolver.dependencyTree = new (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree(packageJson, packageLock); + } catch (e) { + throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importSourceFilesCorrupted')); + } + } + getExternalLockfileContents() { + var _this8 = this; -/***/ }), -/* 515 */ -/***/ (function(module, exports, __webpack_require__) { - -// Copyright 2011 Mark Cavage All rights reserved. + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + try { + var _ref2 = yield Promise.all([(_fs || _load_fs()).readFile(path.join(_this8.config.cwd, (_constants || _load_constants()).NODE_PACKAGE_JSON)), (_fs || _load_fs()).readFile(path.join(_this8.config.cwd, (_constants || _load_constants()).NPM_LOCK_FILENAME))]); -var assert = __webpack_require__(28); -var Buffer = __webpack_require__(15).Buffer; + const packageJson = _ref2[0], + packageLock = _ref2[1]; -var ASN1 = __webpack_require__(206); -var errors = __webpack_require__(205); + return { packageJson, packageLock }; + } catch (e) { + return { packageJson: null, packageLock: null }; + } + })(); + } + init() { + var _this9 = this; + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + if (yield (_fs || _load_fs()).exists(path.join(_this9.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) { + throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('lockfileExists')); + } -// --- Globals + var _ref3 = yield _this9.getExternalLockfileContents(); -var newInvalidAsn1Error = errors.newInvalidAsn1Error; + const packageJson = _ref3.packageJson, + packageLock = _ref3.packageLock; + const importSource = packageJson && packageLock && (_semver || _load_semver()).default.satisfies(nodeVersion, '>=5.0.0') ? 'package-lock.json' : 'node_modules'; + if (importSource === 'package-lock.json') { + _this9.reporter.info(_this9.reporter.lang('importPackageLock')); + _this9.createLogicalDependencyTree(packageJson, packageLock); + } + if (importSource === 'node_modules') { + _this9.reporter.info(_this9.reporter.lang('importNodeModules')); + yield (0, (_check || _load_check()).verifyTreeCheck)(_this9.config, _this9.reporter, {}, []); + } + var _ref4 = yield _this9.fetchRequestFromCwd(); -// --- API + const requests = _ref4.requests, + patterns = _ref4.patterns, + manifest = _ref4.manifest; -function Reader(data) { - if (!data || !Buffer.isBuffer(data)) - throw new TypeError('data must be a node Buffer'); + if (manifest.name && _this9.resolver instanceof ImportPackageResolver) { + _this9.resolver.rootName = manifest.name; + } + yield _this9.resolver.init(requests, { isFlat: _this9.flags.flat, isFrozen: _this9.flags.frozenLockfile }); + const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this9.resolver.getManifests(), _this9.config); + _this9.resolver.updateManifests(manifests); + yield (_packageCompatibility || _load_packageCompatibility()).check(_this9.resolver.getManifests(), _this9.config, _this9.flags.ignoreEngines); + yield _this9.linker.resolvePeerModules(); + yield _this9.saveLockfileAndIntegrity(patterns); + return patterns; + })(); + } +} - this._buf = data; - this._size = data.length; +exports.Import = Import; +function setFlags(commander) { + commander.description('Generates yarn.lock from an npm package-lock.json file or an existing npm-installed node_modules folder.'); +} - // These hold the "current" state - this._len = 0; - this._offset = 0; +function hasWrapper(commander, args) { + return true; } -Object.defineProperty(Reader.prototype, 'length', { - enumerable: true, - get: function () { return (this._len); } -}); +/***/ }), +/* 501 */ +/***/ (function(module, exports, __webpack_require__) { -Object.defineProperty(Reader.prototype, 'offset', { - enumerable: true, - get: function () { return (this._offset); } -}); +"use strict"; -Object.defineProperty(Reader.prototype, 'remain', { - get: function () { return (this._size - this._offset); } -}); -Object.defineProperty(Reader.prototype, 'buffer', { - get: function () { return (this._buf.slice(this._offset)); } +Object.defineProperty(exports, "__esModule", { + value: true }); +exports.run = undefined; +var _asyncToGenerator2; -/** - * Reads a single byte and advances offset; you can pass in `true` to make this - * a "peek" operation (i.e., get the byte, but don't advance the offset). - * - * @param {Boolean} peek true means don't move offset. - * @return {Number} the next byte, null if not enough data. - */ -Reader.prototype.readByte = function (peek) { - if (this._size - this._offset < 1) - return null; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} - var b = this._buf[this._offset] & 0xff; +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length > 2) { + reporter.error(reporter.lang('tooManyArguments', 2)); + return; + } - if (!peek) - this._offset += 1; + let packageName = args.shift() || '.'; - return b; -}; + // Handle the case when we are referencing a local package. + if (packageName === '.') { + packageName = (yield config.readRootManifest()).name; + } + const packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName); -Reader.prototype.peek = function () { - return this.readByte(true); -}; + var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput); + const name = _parsePackageName.name, + version = _parsePackageName.version; -/** - * Reads a (potentially) variable length off the BER buffer. This call is - * not really meant to be called directly, as callers have to manipulate - * the internal buffer afterwards. - * - * As a result of this call, you can call `Reader.length`, until the - * next thing called that does a readLength. - * - * @return {Number} the amount of offset to advance the buffer. - * @throws {InvalidAsn1Error} on bad ASN.1 - */ -Reader.prototype.readLength = function (offset) { - if (offset === undefined) - offset = this._offset; - if (offset >= this._size) - return null; + let result; + try { + result = yield config.registries.npm.request(name, { unfiltered: true }); + } catch (e) { + reporter.error(reporter.lang('infoFail')); + return; + } + if (!result) { + reporter.error(reporter.lang('infoFail')); + return; + } - var lenB = this._buf[offset++] & 0xff; - if (lenB === null) - return null; + result = clean(result); - if ((lenB & 0x80) === 0x80) { - lenB &= 0x7f; + const versions = result.versions; + // $FlowFixMe + result.versions = Object.keys(versions).sort(semver.compareLoose); + result.version = version || result['dist-tags'].latest; + result = Object.assign(result, versions[result.version]); - if (lenB === 0) - throw newInvalidAsn1Error('Indefinite length not supported'); + const fieldPath = args.shift(); + const fields = fieldPath ? fieldPath.split('.') : []; - if (lenB > 4) - throw newInvalidAsn1Error('encoding too long'); + // Readmes can be long so exclude them unless explicitly asked for. + if (fields[0] !== 'readme') { + delete result.readme; + } - if (this._size - offset < lenB) - return null; + result = fields.reduce(function (prev, cur) { + return prev && prev[cur]; + }, result); + reporter.inspect(result); + }); - this._len = 0; - for (var i = 0; i < lenB; i++) - this._len = (this._len << 8) + (this._buf[offset++] & 0xff); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); - } else { - // Wasn't a variable length - this._len = lenB; - } +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - return offset; -}; +var _npmRegistry; +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); +} -/** - * Parses the next sequence in this BER buffer. - * - * To get the length of the sequence, call `Reader.length`. - * - * @return {Number} the sequence's tag. - */ -Reader.prototype.readSequence = function (tag) { - var seq = this.peek(); - if (seq === null) - return null; - if (tag !== undefined && tag !== seq) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + seq.toString(16)); +var _parsePackageName2; - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; +function _load_parsePackageName() { + return _parsePackageName2 = _interopRequireDefault(__webpack_require__(556)); +} - this._offset = o; - return seq; -}; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +const semver = __webpack_require__(22); -Reader.prototype.readInt = function () { - return this._readTag(ASN1.Integer); -}; +function clean(object) { + if (Array.isArray(object)) { + const result = []; + object.forEach(item => { + item = clean(item); + if (item) { + result.push(item); + } + }); + return result; + } else if (typeof object === 'object') { + const result = {}; + for (const key in object) { + if (key.startsWith('_')) { + continue; + } + const item = clean(object[key]); + if (item) { + result[key] = item; + } + } + return result; + } else if (object) { + return object; + } else { + return null; + } +} -Reader.prototype.readBoolean = function () { - return (this._readTag(ASN1.Boolean) === 0 ? false : true); -}; +function setFlags(commander) { + commander.description('Shows information about a package.'); +} +function hasWrapper(commander, args) { + return true; +} -Reader.prototype.readEnumeration = function () { - return this._readTag(ASN1.Enumeration); -}; +/***/ }), +/* 502 */ +/***/ (function(module, exports, __webpack_require__) { +"use strict"; -Reader.prototype.readString = function (tag, retbuf) { - if (!tag) - tag = ASN1.OctetString; - var b = this.peek(); - if (b === null) - return null; +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined; - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); +var _asyncToGenerator2; - var o = this.readLength(this._offset + 1); // stored in `length` +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} - if (o === null) - return null; +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const installVersion = flags[`2`] ? `berry` : flags.install; + const forwardedArgs = process.argv.slice(process.argv.indexOf('init', 2) + 1); - if (this.length > this._size - o) - return null; + if (installVersion) { + if (flags[`2`] && process.env.COREPACK_ROOT) { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${flags.install || `stable`}`, `init`, ...forwardedArgs, `--install=self`], { + stdio: 'inherit', + cwd: config.cwd + }); + } else { + const lockfilePath = path.resolve(config.cwd, 'yarn.lock'); + if (!(yield (_fs || _load_fs()).exists(lockfilePath))) { + yield (_fs || _load_fs()).writeFile(lockfilePath, ''); + } + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'policies', 'set-version', installVersion, '--silent'], { + stdio: 'inherit', + cwd: config.cwd + }); + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [process.argv[1], 'init', ...forwardedArgs], { + stdio: 'inherit', + cwd: config.cwd + }); + } + return; + } - this._offset = o; + const manifests = yield config.getRootManifests(); - if (this.length === 0) - return retbuf ? Buffer.alloc(0) : ''; + let repository = {}; + const author = { + name: config.getOption('init-author-name'), + email: config.getOption('init-author-email'), + url: config.getOption('init-author-url') + }; + if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) { + // get git origin of the cwd + try { + repository = { + type: 'git', + url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], { + cwd: config.cwd + }) + }; + } catch (ex) { + // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) + } - var str = this._buf.slice(this._offset, this._offset + this.length); - this._offset += this.length; + if (author.name === undefined) { + author.name = yield getGitConfigInfo('user.name'); + } - return retbuf ? str : str.toString('utf8'); -}; + if (author.email === undefined) { + author.email = yield getGitConfigInfo('user.email'); + } + } -Reader.prototype.readOID = function (tag) { - if (!tag) - tag = ASN1.OID; + const keys = [{ + key: 'name', + question: 'name', + default: path.basename(config.cwd), + validation: (_validate || _load_validate()).isValidPackageName, + validationError: 'invalidPackageName' + }, { + key: 'version', + question: 'version', + default: String(config.getOption('init-version')) + }, { + key: 'description', + question: 'description', + default: '' + }, { + key: 'main', + question: 'entry point', + default: 'index.js' + }, { + key: 'repository', + question: 'repository url', + default: (0, (_util || _load_util()).extractRepositoryUrl)(repository) + }, { + key: 'author', + question: 'author', + default: (0, (_util || _load_util()).stringifyPerson)(author) + }, { + key: 'license', + question: 'license', + default: String(config.getOption('init-license')) + }, { + key: 'private', + question: 'private', + default: config.getOption('init-private') || '', + inputFormatter: yn + }]; - var b = this.readString(tag, true); - if (b === null) - return null; + // get answers + const pkg = {}; + for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; - var values = []; - var value = 0; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } - for (var i = 0; i < b.length; i++) { - var byte = b[i] & 0xff; + const entry = _ref2; + const yes = flags.yes, + privateFlag = flags.private; + const manifestKey = entry.key; + let question = entry.question, + def = entry.default; - value <<= 7; - value += byte & 0x7f; - if ((byte & 0x80) === 0) { - values.push(value); - value = 0; - } - } - value = values.shift(); - values.unshift(value % 40); - values.unshift((value / 40) >> 0); + for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref5; - return values.join('.'); -}; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref5 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref5 = _i4.value; + } + const registryName = _ref5; + const object = manifests[registryName].object; -Reader.prototype._readTag = function (tag) { - assert.ok(tag !== undefined); + let val = objectPath.get(object, manifestKey); + if (!val) { + break; + } + if (typeof val === 'object') { + if (manifestKey === 'author') { + val = (0, (_util || _load_util()).stringifyPerson)(val); + } else if (manifestKey === 'repository') { + val = (0, (_util || _load_util()).extractRepositoryUrl)(val); + } + } + def = val; + } - var b = this.peek(); + if (manifestKey === 'private' && privateFlag) { + def = true; + } - if (b === null) - return null; + if (def) { + question += ` (${String(def)})`; + } - if (b !== tag) - throw newInvalidAsn1Error('Expected 0x' + tag.toString(16) + - ': got 0x' + b.toString(16)); + let answer; + let validAnswer = false; - var o = this.readLength(this._offset + 1); // stored in `length` - if (o === null) - return null; + if (yes) { + answer = def; + } else { + // loop until a valid answer is provided, if validation is on entry + if (entry.validation) { + while (!validAnswer) { + answer = (yield reporter.question(question)) || def; + // validate answer + if (entry.validation(String(answer))) { + validAnswer = true; + } else { + reporter.error(reporter.lang('invalidPackageName')); + } + } + } else { + answer = (yield reporter.question(question)) || def; + } + } - if (this.length > 4) - throw newInvalidAsn1Error('Integer too long: ' + this.length); + if (answer) { + if (entry.inputFormatter) { + answer = entry.inputFormatter(answer); + } + objectPath.set(pkg, manifestKey, answer); + } + } - if (this.length > this._size - o) - return null; - this._offset = o; + if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) { + pkg.repository = `https://github.com/${pkg.repository}`; + } - var fb = this._buf[this._offset]; - var value = 0; + // save answers + const targetManifests = []; + for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; - for (var i = 0; i < this.length; i++) { - value <<= 8; - value |= (this._buf[this._offset++] & 0xff); - } + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; + } - if ((fb & 0x80) === 0x80 && i !== 4) - value -= (1 << (i * 8)); + const registryName = _ref3; - return value >> 0; -}; + const info = manifests[registryName]; + if (info.exists) { + targetManifests.push(info); + } + } + if (!targetManifests.length) { + targetManifests.push(manifests.npm); + } + for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } + const targetManifest = _ref4; -// --- Exported API + Object.assign(targetManifest.object, pkg); + reporter.success(`Saved ${path.basename(targetManifest.loc)}`); + } -module.exports = Reader; + yield config.saveRootManifests(manifests); + }); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); -/***/ }), -/* 516 */ -/***/ (function(module, exports, __webpack_require__) { +let getGitConfigInfo = exports.getGitConfigInfo = (() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential, spawn = (_child || _load_child()).spawn) { + try { + // try to get author default based on git config + return yield spawn('git', ['config', credential]); + } catch (e) { + return ''; + } + }); -// Copyright 2011 Mark Cavage All rights reserved. + return function getGitConfigInfo(_x5) { + return _ref6.apply(this, arguments); + }; +})(); -var assert = __webpack_require__(28); -var Buffer = __webpack_require__(15).Buffer; -var ASN1 = __webpack_require__(206); -var errors = __webpack_require__(205); +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; +var _util; -// --- Globals +function _load_util() { + return _util = __webpack_require__(219); +} -var newInvalidAsn1Error = errors.newInvalidAsn1Error; +var _index; -var DEFAULT_OPTS = { - size: 1024, - growthFactor: 8 -}; +function _load_index() { + return _index = __webpack_require__(58); +} +var _githubResolver; -// --- Helpers +function _load_githubResolver() { + return _githubResolver = _interopRequireDefault(__webpack_require__(361)); +} -function merge(from, to) { - assert.ok(from); - assert.equal(typeof (from), 'object'); - assert.ok(to); - assert.equal(typeof (to), 'object'); +var _child; - var keys = Object.getOwnPropertyNames(from); - keys.forEach(function (key) { - if (to[key]) - return; +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); +} - var value = Object.getOwnPropertyDescriptor(from, key); - Object.defineProperty(to, key, value); - }); +var _fs; - return to; +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); } +var _validate; +function _load_validate() { + return _validate = _interopRequireWildcard(__webpack_require__(125)); +} -// --- API +var _constants; -function Writer(options) { - options = merge(DEFAULT_OPTS, options || {}); +function _load_constants() { + return _constants = __webpack_require__(8); +} - this._buf = Buffer.alloc(options.size || 1024); - this._size = this._buf.length; - this._offset = 0; - this._options = options; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - // A list of offsets in the buffer where we need to insert - // sequence tag/len pairs. - this._seq = []; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const objectPath = __webpack_require__(304); + +const path = __webpack_require__(0); +const yn = __webpack_require__(962); + +function setFlags(commander) { + commander.description('Interactively creates or updates a package.json file.'); + commander.option('-y, --yes', 'use default options'); + commander.option('-p, --private', 'use default options and private true'); + commander.option('-i, --install ', 'install a specific Yarn release'); + commander.option('-2', 'generates the project using Yarn 2'); } -Object.defineProperty(Writer.prototype, 'buffer', { - get: function () { - if (this._seq.length) - throw newInvalidAsn1Error(this._seq.length + ' unended sequence(s)'); +function hasWrapper(commander, args) { + return true; +} - return (this._buf.slice(0, this._offset)); - } +const shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true; + +/***/ }), +/* 503 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true }); +exports.examples = exports.run = undefined; -Writer.prototype.writeByte = function (b) { - if (typeof (b) !== 'number') - throw new TypeError('argument must be a Number'); +var _extends2; - this._ensure(1); - this._buf[this._offset++] = b; -}; +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); +} +var _asyncToGenerator2; -Writer.prototype.writeInt = function (i, tag) { - if (typeof (i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof (tag) !== 'number') - tag = ASN1.Integer; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +} - var sz = 4; +let getManifests = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); + const install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile); + yield install.hydrate(true); - while ((((i & 0xff800000) === 0) || ((i & 0xff800000) === 0xff800000 >> 0)) && - (sz > 1)) { - sz--; - i <<= 8; - } + let manifests = install.resolver.getManifests(); - if (sz > 4) - throw newInvalidAsn1Error('BER ints cannot be > 0xffffffff'); + // sort by name + manifests = manifests.sort(function (a, b) { + if (!a.name && !b.name) { + return 0; + } - this._ensure(2 + sz); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = sz; + if (!a.name) { + return 1; + } - while (sz-- > 0) { - this._buf[this._offset++] = ((i & 0xff000000) >>> 24); - i <<= 8; - } + if (!b.name) { + return -1; + } -}; + return a.name.localeCompare(b.name); + }); + // filter ignored manifests + manifests = manifests.filter(function (manifest) { + const ref = manifest._reference; + return !!ref && !ref.ignore; + }); -Writer.prototype.writeNull = function () { - this.writeByte(ASN1.Null); - this.writeByte(0x00); -}; + return manifests; + }); + return function getManifests(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); -Writer.prototype.writeEnumeration = function (i, tag) { - if (typeof (i) !== 'number') - throw new TypeError('argument must be a Number'); - if (typeof (tag) !== 'number') - tag = ASN1.Enumeration; +let list = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const manifests = yield getManifests(config, flags); + const manifestsByLicense = new Map(); - return this.writeInt(i, tag); -}; + for (var _iterator = manifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref4; + if (_isArray) { + if (_i >= _iterator.length) break; + _ref4 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref4 = _i.value; + } -Writer.prototype.writeBoolean = function (b, tag) { - if (typeof (b) !== 'boolean') - throw new TypeError('argument must be a Boolean'); - if (typeof (tag) !== 'number') - tag = ASN1.Boolean; + const _ref3 = _ref4; + const name = _ref3.name, + version = _ref3.version, + license = _ref3.license, + repository = _ref3.repository, + homepage = _ref3.homepage, + author = _ref3.author; - this._ensure(3); - this._buf[this._offset++] = tag; - this._buf[this._offset++] = 0x01; - this._buf[this._offset++] = b ? 0xff : 0x00; -}; + const licenseKey = license || 'UNKNOWN'; + const url = repository ? repository.url : homepage; + const vendorUrl = homepage || author && author.url; + const vendorName = author && author.name; + if (!manifestsByLicense.has(licenseKey)) { + manifestsByLicense.set(licenseKey, new Map()); + } -Writer.prototype.writeString = function (s, tag) { - if (typeof (s) !== 'string') - throw new TypeError('argument must be a string (was: ' + typeof (s) + ')'); - if (typeof (tag) !== 'number') - tag = ASN1.OctetString; + const byLicense = manifestsByLicense.get(licenseKey); + invariant(byLicense, 'expected value'); + byLicense.set(`${name}@${version}`, { + name, + version, + url, + vendorUrl, + vendorName + }); + } - var len = Buffer.byteLength(s); - this.writeByte(tag); - this.writeLength(len); - if (len) { - this._ensure(len); - this._buf.write(s, this._offset); - this._offset += len; - } -}; + if (flags.json) { + const body = []; + manifestsByLicense.forEach(function (license, licenseKey) { + license.forEach(function ({ name, version, url, vendorUrl, vendorName }) { + body.push([name, version, licenseKey, url || 'Unknown', vendorUrl || 'Unknown', vendorName || 'Unknown']); + }); + }); -Writer.prototype.writeBuffer = function (buf, tag) { - if (typeof (tag) !== 'number') - throw new TypeError('tag must be a number'); - if (!Buffer.isBuffer(buf)) - throw new TypeError('argument must be a buffer'); + reporter.table(['Name', 'Version', 'License', 'URL', 'VendorUrl', 'VendorName'], body); + } else { + const trees = []; - this.writeByte(tag); - this.writeLength(buf.length); - this._ensure(buf.length); - buf.copy(this._buf, this._offset, 0, buf.length); - this._offset += buf.length; -}; + manifestsByLicense.forEach(function (license, licenseKey) { + const licenseTree = []; + license.forEach(function ({ name, version, url, vendorUrl, vendorName }) { + const children = []; -Writer.prototype.writeStringArray = function (strings) { - if ((!strings instanceof Array)) - throw new TypeError('argument must be an Array[String]'); + if (url) { + children.push({ name: `${reporter.format.bold('URL:')} ${url}` }); + } - var self = this; - strings.forEach(function (s) { - self.writeString(s); - }); -}; + if (vendorUrl) { + children.push({ name: `${reporter.format.bold('VendorUrl:')} ${vendorUrl}` }); + } -// This is really to solve DER cases, but whatever for now -Writer.prototype.writeOID = function (s, tag) { - if (typeof (s) !== 'string') - throw new TypeError('argument must be a string'); - if (typeof (tag) !== 'number') - tag = ASN1.OID; + if (vendorName) { + children.push({ name: `${reporter.format.bold('VendorName:')} ${vendorName}` }); + } - if (!/^([0-9]+\.){3,}[0-9]+$/.test(s)) - throw new Error('argument is not a valid OID string'); + licenseTree.push({ + name: `${name}@${version}`, + children + }); + }); - function encodeOctet(bytes, octet) { - if (octet < 128) { - bytes.push(octet); - } else if (octet < 16384) { - bytes.push((octet >>> 7) | 0x80); - bytes.push(octet & 0x7F); - } else if (octet < 2097152) { - bytes.push((octet >>> 14) | 0x80); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else if (octet < 268435456) { - bytes.push((octet >>> 21) | 0x80); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } else { - bytes.push(((octet >>> 28) | 0x80) & 0xFF); - bytes.push(((octet >>> 21) | 0x80) & 0xFF); - bytes.push(((octet >>> 14) | 0x80) & 0xFF); - bytes.push(((octet >>> 7) | 0x80) & 0xFF); - bytes.push(octet & 0x7F); - } - } + trees.push({ + name: licenseKey, + children: licenseTree + }); + }); - var tmp = s.split('.'); - var bytes = []; - bytes.push(parseInt(tmp[0], 10) * 40 + parseInt(tmp[1], 10)); - tmp.slice(2).forEach(function (b) { - encodeOctet(bytes, parseInt(b, 10)); + reporter.tree('licenses', trees, { force: true }); + } }); - var self = this; - this._ensure(2 + bytes.length); - this.writeByte(tag); - this.writeLength(bytes.length); - bytes.forEach(function (b) { - self.writeByte(b); - }); -}; + return function list(_x3, _x4, _x5, _x6) { + return _ref2.apply(this, arguments); + }; +})(); +exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; -Writer.prototype.writeLength = function (len) { - if (typeof (len) !== 'number') - throw new TypeError('argument must be a Number'); +var _baseReporter; - this._ensure(4); +function _load_baseReporter() { + return _baseReporter = _interopRequireDefault(__webpack_require__(108)); +} - if (len <= 0x7f) { - this._buf[this._offset++] = len; - } else if (len <= 0xff) { - this._buf[this._offset++] = 0x81; - this._buf[this._offset++] = len; - } else if (len <= 0xffff) { - this._buf[this._offset++] = 0x82; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else if (len <= 0xffffff) { - this._buf[this._offset++] = 0x83; - this._buf[this._offset++] = len >> 16; - this._buf[this._offset++] = len >> 8; - this._buf[this._offset++] = len; - } else { - throw newInvalidAsn1Error('Length too long (> 4 bytes)'); - } -}; +var _install; -Writer.prototype.startSequence = function (tag) { - if (typeof (tag) !== 'number') - tag = ASN1.Sequence | ASN1.Constructor; +function _load_install() { + return _install = __webpack_require__(34); +} - this.writeByte(tag); - this._seq.push(this._offset); - this._ensure(3); - this._offset += 3; -}; +var _lockfile; +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); +} -Writer.prototype.endSequence = function () { - var seq = this._seq.pop(); - var start = seq + 3; - var len = this._offset - start; +var _buildSubCommands2; - if (len <= 0x7f) { - this._shift(start, len, -2); - this._buf[seq] = len; - } else if (len <= 0xff) { - this._shift(start, len, -1); - this._buf[seq] = 0x81; - this._buf[seq + 1] = len; - } else if (len <= 0xffff) { - this._buf[seq] = 0x82; - this._buf[seq + 1] = len >> 8; - this._buf[seq + 2] = len; - } else if (len <= 0xffffff) { - this._shift(start, len, 1); - this._buf[seq] = 0x83; - this._buf[seq + 1] = len >> 16; - this._buf[seq + 2] = len >> 8; - this._buf[seq + 3] = len; - } else { - throw newInvalidAsn1Error('Sequence too long'); - } -}; +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); +} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -Writer.prototype._shift = function (start, len, shift) { - assert.ok(start !== undefined); - assert.ok(len !== undefined); - assert.ok(shift); +const invariant = __webpack_require__(9); - this._buf.copy(this._buf, start + shift, start, start + len); - this._offset += shift; -}; +function hasWrapper(flags, args) { + return args[0] != 'generate-disclaimer'; +} -Writer.prototype._ensure = function (len) { - assert.ok(len); +function setFlags(commander) { + commander.description('Lists licenses for installed packages.'); +} - if (this._size - this._offset < len) { - var sz = this._size * this._options.growthFactor; - if (sz - this._offset < len) - sz += len; +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('licenses', { + ls(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + reporter.warn(`\`yarn licenses ls\` is deprecated. Please use \`yarn licenses list\`.`); + yield list(config, reporter, flags, args); + })(); + }, - var buf = Buffer.alloc(sz); + list(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield list(config, reporter, flags, args); + })(); + }, - this._buf.copy(buf, 0, 0, this._offset); - this._buf = buf; - this._size = sz; - } -}; + generateDisclaimer(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + /* eslint-disable no-console */ + // `reporter.log` dumps a bunch of ANSI escapes to clear the current line and + // is for abstracting the console output so it can be consumed by other tools + // (JSON output being the primary one). This command is only for text consumption + // and you should just be dumping it to a TXT file. Using a reporter here has the + // potential to mess up the output since it might print ansi escapes. + const manifests = yield getManifests(config, flags); + const manifest = yield config.readRootManifest(); + // Create a map of license text to manifest so that packages with exactly + // the same license text are grouped together. + const manifestsByLicense = new Map(); + for (var _iterator2 = manifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref5; -// --- Exported API + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref5 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref5 = _i2.value; + } -module.exports = Writer; + const manifest = _ref5; + const licenseText = manifest.licenseText, + noticeText = manifest.noticeText; + let licenseKey; + if (!licenseText) { + continue; + } -/***/ }), -/* 517 */ -/***/ (function(module, exports, __webpack_require__) { + if (!noticeText) { + licenseKey = licenseText; + } else { + licenseKey = `${licenseText}\n\nNOTICE\n\n${noticeText}`; + } -module.exports = -{ - parallel : __webpack_require__(519), - serial : __webpack_require__(520), - serialOrdered : __webpack_require__(351) -}; + if (!manifestsByLicense.has(licenseKey)) { + manifestsByLicense.set(licenseKey, new Map()); + } + const byLicense = manifestsByLicense.get(licenseKey); + invariant(byLicense, 'expected value'); + byLicense.set(manifest.name, manifest); + } -/***/ }), -/* 518 */ -/***/ (function(module, exports) { + console.log('THE FOLLOWING SETS FORTH ATTRIBUTION NOTICES FOR THIRD PARTY SOFTWARE THAT MAY BE CONTAINED ' + `IN PORTIONS OF THE ${String(manifest.name).toUpperCase().replace(/-/g, ' ')} PRODUCT.`); + console.log(); -module.exports = defer; + for (var _iterator3 = manifestsByLicense, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref7; -/** - * Runs provided function on next iteration of the event loop - * - * @param {function} fn - function to run - */ -function defer(fn) -{ - var nextTick = typeof setImmediate == 'function' - ? setImmediate - : ( - typeof process == 'object' && typeof process.nextTick == 'function' - ? process.nextTick - : null - ); + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } - if (nextTick) - { - nextTick(fn); - } - else - { - setTimeout(fn, 0); - } -} + const _ref6 = _ref7; + const licenseKey = _ref6[0]; + const manifests = _ref6[1]; + console.log('-----'); + console.log(); -/***/ }), -/* 519 */ -/***/ (function(module, exports, __webpack_require__) { + const names = []; + const urls = []; + for (var _iterator4 = manifests, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref9; -var iterate = __webpack_require__(348) - , initState = __webpack_require__(349) - , terminator = __webpack_require__(350) - ; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref9 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref9 = _i4.value; + } -// Public API -module.exports = parallel; + const _ref8 = _ref9; + const name = _ref8[0]; + const repository = _ref8[1].repository; -/** - * Runs iterator over provided array elements in parallel - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function parallel(list, iterator, callback) -{ - var state = initState(list); + names.push(name); + if (repository && repository.url) { + urls.push(manifests.size === 1 ? repository.url : `${repository.url} (${name})`); + } + } - while (state.index < (state['keyedList'] || list).length) - { - iterate(list, iterator, state, function(error, result) - { - if (error) - { - callback(error, result); - return; - } + const heading = []; + heading.push(`The following software may be included in this product: ${names.join(', ')}.`); + if (urls.length > 0) { + heading.push(`A copy of the source code may be downloaded from ${urls.join(', ')}.`); + } + heading.push('This software contains the following license and notice below:'); - // looks like it's the last one - if (Object.keys(state.jobs).length === 0) - { - callback(null, state.results); - return; - } - }); + console.log(heading.join(' ')); + console.log(); - state.index++; - } + if (licenseKey) { + console.log(licenseKey.trim()); + } else { + // what do we do here? base it on `license`? + } - return terminator.bind(state, callback); -} + console.log(); + } + })(); + } +}); +const run = _buildSubCommands.run, + examples = _buildSubCommands.examples; +exports.run = run; +exports.examples = examples; /***/ }), -/* 520 */ +/* 504 */ /***/ (function(module, exports, __webpack_require__) { -var serialOrdered = __webpack_require__(351); +"use strict"; -// Public API -module.exports = serial; -/** - * Runs iterator over provided array elements in series - * - * @param {array|object} list - array or object (named list) to iterate over - * @param {function} iterator - iterator to run - * @param {function} callback - invoked when all elements processed - * @returns {function} - jobs terminator - */ -function serial(list, iterator, callback) -{ - return serialOrdered(list, iterator, null, callback); +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; + +var _asyncToGenerator2; + +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + yield config.registries.yarn.saveHomeConfig({ + username: undefined, + email: undefined + }); -/***/ }), -/* 521 */ -/***/ (function(module, exports, __webpack_require__) { + reporter.success(reporter.lang('clearedCredentials')); + }); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); -/*! - * Copyright 2010 LearnBoost - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -/** - * Module dependencies. - */ +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var crypto = __webpack_require__(12) - , parse = __webpack_require__(24).parse - ; +function setFlags(commander) { + commander.description('Clears registry username and email.'); +} -/** - * Valid keys. - */ +function hasWrapper(commander, args) { + return true; +} -var keys = - [ 'acl' - , 'location' - , 'logging' - , 'notification' - , 'partNumber' - , 'policy' - , 'requestPayment' - , 'torrent' - , 'uploadId' - , 'uploads' - , 'versionId' - , 'versioning' - , 'versions' - , 'website' - ] +/***/ }), +/* 505 */ +/***/ (function(module, exports, __webpack_require__) { -/** - * Return an "Authorization" header value with the given `options` - * in the form of "AWS :" - * - * @param {Object} options - * @return {String} - * @api private - */ +"use strict"; -function authorization (options) { - return 'AWS ' + options.key + ':' + sign(options) -} -module.exports = authorization -module.exports.authorization = authorization +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -/** - * Simple HMAC-SHA1 Wrapper - * - * @param {Object} options - * @return {String} - * @api private - */ +var _extends2; -function hmacSha1 (options) { - return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } -module.exports.hmacSha1 = hmacSha1 - -/** - * Create a base64 sha1 HMAC for `options`. - * - * @param {Object} options - * @return {String} - * @api private - */ +var _asyncToGenerator2; -function sign (options) { - options.message = stringToSign(options) - return hmacSha1(options) +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -module.exports.sign = sign -/** - * Create a base64 sha1 HMAC for `options`. - * - * Specifically to be used with S3 presigned URLs - * - * @param {Object} options - * @return {String} - * @api private - */ - -function signQuery (options) { - options.message = queryStringToSign(options) - return hmacSha1(options) -} -module.exports.signQuery= signQuery +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const pnpPath = `${config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`; -/** - * Return a string for sign() with the given `options`. - * - * Spec: - * - * \n - * \n - * \n - * \n - * [headers\n] - * - * - * @param {Object} options - * @return {String} - * @api private - */ + let nodeOptions = process.env.NODE_OPTIONS || ''; + if (yield (_fs || _load_fs()).exists(pnpPath)) { + nodeOptions = `--require ${pnpPath} ${nodeOptions}`; + } -function stringToSign (options) { - var headers = options.amazonHeaders || '' - if (headers) headers += '\n' - var r = - [ options.verb - , options.md5 - , options.contentType - , options.date ? options.date.toUTCString() : '' - , headers + options.resource - ] - return r.join('\n') -} -module.exports.stringToSign = stringToSign + try { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, args, { + stdio: 'inherit', + cwd: flags.into || config.cwd, + env: (0, (_extends2 || _load_extends()).default)({}, process.env, { NODE_OPTIONS: nodeOptions }) + }); + } catch (err) { + throw err; + } + }); -/** - * Return a string for sign() with the given `options`, but is meant exclusively - * for S3 presigned URLs - * - * Spec: - * - * \n - * - * - * @param {Object} options - * @return {String} - * @api private - */ + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); -function queryStringToSign (options){ - return 'GET\n\n\n' + options.date + '\n' + options.resource -} -module.exports.queryStringToSign = queryStringToSign +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -/** - * Perform the following: - * - * - ignore non-amazon headers - * - lowercase fields - * - sort lexicographically - * - trim whitespace between ":" - * - join with newline - * - * @param {Object} headers - * @return {String} - * @api private - */ +var _child; -function canonicalizeHeaders (headers) { - var buf = [] - , fields = Object.keys(headers) - ; - for (var i = 0, len = fields.length; i < len; ++i) { - var field = fields[i] - , val = headers[field] - , field = field.toLowerCase() - ; - if (0 !== field.indexOf('x-amz')) continue - buf.push(field + ':' + val) - } - return buf.sort().join('\n') +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); } -module.exports.canonicalizeHeaders = canonicalizeHeaders - -/** - * Perform the following: - * - * - ignore non sub-resources - * - sort lexicographically - * - * @param {String} resource - * @return {String} - * @api private - */ - -function canonicalizeResource (resource) { - var url = parse(resource, true) - , path = url.pathname - , buf = [] - ; - Object.keys(url.query).forEach(function(key){ - if (!~keys.indexOf(key)) return - var val = '' == url.query[key] ? '' : '=' + encodeURIComponent(url.query[key]) - buf.push(key + val) - }) +var _fs; - return path + (buf.length ? '?' + buf.sort().join('&') : '') +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); } -module.exports.canonicalizeResource = canonicalizeResource +var _constants; -/***/ }), -/* 522 */ -/***/ (function(module, exports, __webpack_require__) { - -var aws4 = exports, - url = __webpack_require__(24), - querystring = __webpack_require__(196), - crypto = __webpack_require__(12), - lru = __webpack_require__(523), - credentialsCache = lru(1000) +function _load_constants() { + return _constants = __webpack_require__(8); +} -// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -function hmac(key, string, encoding) { - return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding) -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function hash(string, encoding) { - return crypto.createHash('sha256').update(string, 'utf8').digest(encoding) +function setFlags(commander) { + commander.description('Runs Node with the same version that the one used by Yarn itself, and by default from the project root'); + commander.usage('node [--into PATH] [... args]'); + commander.option('--into ', 'Sets the cwd to the specified location'); } -// This function assumes the string has already been percent encoded -function encodeRfc3986(urlEncodedString) { - return urlEncodedString.replace(/[!'()*]/g, function(c) { - return '%' + c.charCodeAt(0).toString(16).toUpperCase() - }) +function hasWrapper(commander, args) { + return true; } -// request: { path | body, [host], [method], [headers], [service], [region] } -// credentials: { accessKeyId, secretAccessKey, [sessionToken] } -function RequestSigner(request, credentials) { - - if (typeof request === 'string') request = url.parse(request) - - var headers = request.headers = (request.headers || {}), - hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host) - - this.request = request - this.credentials = credentials || this.defaultCredentials() - - this.service = request.service || hostParts[0] || '' - this.region = request.region || hostParts[1] || 'us-east-1' - - // SES uses a different domain from the service name - if (this.service === 'email') this.service = 'ses' - - if (!request.method && request.body) - request.method = 'POST' - - if (!headers.Host && !headers.host) { - headers.Host = request.hostname || request.host || this.createHost() +/***/ }), +/* 506 */ +/***/ (function(module, exports, __webpack_require__) { - // If a port is specified explicitly, use it as is - if (request.port) - headers.Host += ':' + request.port - } - if (!request.hostname && !request.host) - request.hostname = headers.Host || headers.host +"use strict"; - this.isCodeCommitGit = this.service === 'codecommit' && request.method === 'GIT' -} -RequestSigner.prototype.matchHost = function(host) { - var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/) - var hostParts = (match || []).slice(1, 3) +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.requireLockfile = undefined; - // ES's hostParts are sometimes the other way round, if the value that is expected - // to be region equals ‘es’ switch them back - // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com - if (hostParts[1] === 'es') - hostParts = hostParts.reverse() +var _extends2; - return hostParts +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } -// http://docs.aws.amazon.com/general/latest/gr/rande.html -RequestSigner.prototype.isSingleRegion = function() { - // Special case for S3 and SimpleDB in us-east-1 - if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true - - return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts'] - .indexOf(this.service) >= 0 -} +var _asyncToGenerator2; -RequestSigner.prototype.createHost = function() { - var region = this.isSingleRegion() ? '' : - (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region, - service = this.service === 'ses' ? 'email' : this.service - return service + region + '.amazonaws.com' +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -RequestSigner.prototype.prepareRequest = function() { - this.parsePath() - - var request = this.request, headers = request.headers, query +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder); + const install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({}, flags, { includeWorkspaceDeps: true }), config, reporter, lockfile); + let deps = yield (_packageRequest || _load_packageRequest()).default.getOutdatedPackages(lockfile, install, config, reporter); - if (request.signQuery) { + if (args.length) { + const requested = new Set(args); - this.parsedPath.query = query = this.parsedPath.query || {} + deps = deps.filter(function ({ name }) { + return requested.has(name); + }); + } - if (this.credentials.sessionToken) - query['X-Amz-Security-Token'] = this.credentials.sessionToken + const getNameFromHint = function getNameFromHint(hint) { + return hint ? `${hint}Dependencies` : 'dependencies'; + }; + const colorizeName = function colorizeName({ current, latest, name }) { + return reporter.format[(0, (_colorForVersions || _load_colorForVersions()).default)(current, latest)](name); + }; - if (this.service === 's3' && !query['X-Amz-Expires']) - query['X-Amz-Expires'] = 86400 + if (deps.length) { + const usesWorkspaces = !!config.workspaceRootFolder; + const body = deps.map(function (info) { + const row = [colorizeName(info), info.current, (0, (_colorizeDiff || _load_colorizeDiff()).default)(info.current, info.wanted, reporter), reporter.format.cyan(info.latest), info.workspaceName || '', getNameFromHint(info.hint), reporter.format.cyan(info.url)]; + if (!usesWorkspaces) { + row.splice(4, 1); + } + return row; + }); - if (query['X-Amz-Date']) - this.datetime = query['X-Amz-Date'] - else - query['X-Amz-Date'] = this.getDateTime() + const red = reporter.format.red(''); + const yellow = reporter.format.yellow(''); + const green = reporter.format.green(''); + reporter.info(reporter.lang('legendColorsForVersionUpdates', red, yellow, green)); - query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256' - query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString() - query['X-Amz-SignedHeaders'] = this.signedHeaders() + const header = ['Package', 'Current', 'Wanted', 'Latest', 'Workspace', 'Package Type', 'URL']; + if (!usesWorkspaces) { + header.splice(4, 1); + } + reporter.table(header, body); - } else { + return 1; + } + return 0; + }); - if (!request.doNotModifyHeaders && !this.isCodeCommitGit) { - if (request.body && !headers['Content-Type'] && !headers['content-type']) - headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8' + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); - if (request.body && !headers['Content-Length'] && !headers['content-length']) - headers['Content-Length'] = Buffer.byteLength(request.body) +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; - if (this.credentials.sessionToken && !headers['X-Amz-Security-Token'] && !headers['x-amz-security-token']) - headers['X-Amz-Security-Token'] = this.credentials.sessionToken +var _packageRequest; - if (this.service === 's3' && !headers['X-Amz-Content-Sha256'] && !headers['x-amz-content-sha256']) - headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex') +function _load_packageRequest() { + return _packageRequest = _interopRequireDefault(__webpack_require__(122)); +} - if (headers['X-Amz-Date'] || headers['x-amz-date']) - this.datetime = headers['X-Amz-Date'] || headers['x-amz-date'] - else - headers['X-Amz-Date'] = this.getDateTime() - } +var _lockfile; - delete headers.Authorization - delete headers.authorization - } +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } -RequestSigner.prototype.sign = function() { - if (!this.parsedPath) this.prepareRequest() +var _install; - if (this.request.signQuery) { - this.parsedPath.query['X-Amz-Signature'] = this.signature() - } else { - this.request.headers.Authorization = this.authHeader() - } +function _load_install() { + return _install = __webpack_require__(34); +} - this.request.path = this.formatPath() +var _colorForVersions; - return this.request +function _load_colorForVersions() { + return _colorForVersions = _interopRequireDefault(__webpack_require__(363)); } -RequestSigner.prototype.getDateTime = function() { - if (!this.datetime) { - var headers = this.request.headers, - date = new Date(headers.Date || headers.date || new Date) - - this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '') +var _colorizeDiff; - // Remove the trailing 'Z' on the timestamp string for CodeCommit git access - if (this.isCodeCommitGit) this.datetime = this.datetime.slice(0, -1) - } - return this.datetime +function _load_colorizeDiff() { + return _colorizeDiff = _interopRequireDefault(__webpack_require__(364)); } -RequestSigner.prototype.getDate = function() { - return this.getDateTime().substr(0, 8) -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -RequestSigner.prototype.authHeader = function() { - return [ - 'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(), - 'SignedHeaders=' + this.signedHeaders(), - 'Signature=' + this.signature(), - ].join(', ') -} +const requireLockfile = exports.requireLockfile = true; -RequestSigner.prototype.signature = function() { - var date = this.getDate(), - cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(), - kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey) - if (!kCredentials) { - kDate = hmac('AWS4' + this.credentials.secretAccessKey, date) - kRegion = hmac(kDate, this.region) - kService = hmac(kRegion, this.service) - kCredentials = hmac(kService, 'aws4_request') - credentialsCache.set(cacheKey, kCredentials) - } - return hmac(kCredentials, this.stringToSign(), 'hex') +function setFlags(commander) { + commander.description('Checks for outdated package dependencies.'); + commander.usage('outdated [packages ...]'); } -RequestSigner.prototype.stringToSign = function() { - return [ - 'AWS4-HMAC-SHA256', - this.getDateTime(), - this.credentialString(), - hash(this.canonicalString(), 'hex'), - ].join('\n') +function hasWrapper(commander, args) { + return true; } -RequestSigner.prototype.canonicalString = function() { - if (!this.parsedPath) this.prepareRequest() - - var pathStr = this.parsedPath.path, - query = this.parsedPath.query, - headers = this.request.headers, - queryStr = '', - normalizePath = this.service !== 's3', - decodePath = this.service === 's3' || this.request.doNotEncodePath, - decodeSlashesInPath = this.service === 's3', - firstValOnly = this.service === 's3', - bodyHash +/***/ }), +/* 507 */ +/***/ (function(module, exports, __webpack_require__) { - if (this.service === 's3' && this.request.signQuery) { - bodyHash = 'UNSIGNED-PAYLOAD' - } else if (this.isCodeCommitGit) { - bodyHash = '' - } else { - bodyHash = headers['X-Amz-Content-Sha256'] || headers['x-amz-content-sha256'] || - hash(this.request.body || '', 'hex') - } +"use strict"; - if (query) { - queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) { - if (!key) return obj - obj[key] = !Array.isArray(query[key]) ? query[key] : - (firstValOnly ? query[key][0] : query[key].slice().sort()) - return obj - }, {}))) - } - if (pathStr !== '/') { - if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/') - pathStr = pathStr.split('/').reduce(function(path, piece) { - if (normalizePath && piece === '..') { - path.pop() - } else if (!normalizePath || piece !== '.') { - if (decodePath) piece = decodeURIComponent(piece) - path.push(encodeRfc3986(encodeURIComponent(piece))) - } - return path - }, []).join('/') - if (pathStr[0] !== '/') pathStr = '/' + pathStr - if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/') - } - return [ - this.request.method || 'GET', - pathStr, - queryStr, - this.canonicalHeaders() + '\n', - this.signedHeaders(), - bodyHash, - ].join('\n') -} +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.examples = exports.hasWrapper = exports.run = exports.mutate = undefined; -RequestSigner.prototype.canonicalHeaders = function() { - var headers = this.request.headers - function trimAll(header) { - return header.toString().trim().replace(/\s+/g, ' ') - } - return Object.keys(headers) - .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 }) - .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) }) - .join('\n') -} +var _asyncToGenerator2; -RequestSigner.prototype.signedHeaders = function() { - return Object.keys(this.request.headers) - .map(function(key) { return key.toLowerCase() }) - .sort() - .join(';') +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -RequestSigner.prototype.credentialString = function() { - return [ - this.getDate(), - this.region, - this.service, - 'aws4_request', - ].join('/') -} +let mutate = exports.mutate = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (args, config, reporter, buildMessages, mutator) { + if (args.length !== 2 && args.length !== 1) { + return false; + } -RequestSigner.prototype.defaultCredentials = function() { - var env = process.env - return { - accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY, - secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY, - sessionToken: env.AWS_SESSION_TOKEN, - } -} + const username = args.shift(); + const name = yield (0, (_tag || _load_tag()).getName)(args, config); + if (!(0, (_validate || _load_validate()).isValidPackageName)(name)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); + } -RequestSigner.prototype.parsePath = function() { - var path = this.request.path || '/', - queryIx = path.indexOf('?'), - query = null + const msgs = buildMessages(username, name); + reporter.step(1, 3, reporter.lang('loggingIn')); + const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, name); - if (queryIx >= 0) { - query = querystring.parse(path.slice(queryIx + 1)) - path = path.slice(0, queryIx) - } + reporter.step(2, 3, msgs.info); + const user = yield config.registries.npm.request(`-/user/org.couchdb.user:${username}`); + let error = false; + if (user) { + // get package + const pkg = yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(name)); + if (pkg) { + pkg.maintainers = pkg.maintainers || []; + error = mutator({ name: user.name, email: user.email }, pkg); + } else { + error = true; + reporter.error(reporter.lang('unknownPackage', name)); + } - // S3 doesn't always encode characters > 127 correctly and - // all services don't encode characters > 255 correctly - // So if there are non-reserved chars (and it's not already all % encoded), just encode them all - if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) { - path = path.split('/').map(function(piece) { - return encodeURIComponent(decodeURIComponent(piece)) - }).join('/') - } + // update package + if (pkg && !error) { + const res = yield config.registries.npm.request(`${(_npmRegistry || _load_npmRegistry()).default.escapeName(name)}/-rev/${pkg._rev}`, { + method: 'PUT', + body: { + _id: pkg._id, + _rev: pkg._rev, + maintainers: pkg.maintainers + } + }); - this.parsedPath = { - path: path, - query: query, - } -} + if (res != null && res.success) { + reporter.success(msgs.success); + } else { + error = true; + reporter.error(msgs.error); + } + } + } else { + error = true; + reporter.error(reporter.lang('unknownUser', username)); + } -RequestSigner.prototype.formatPath = function() { - var path = this.parsedPath.path, - query = this.parsedPath.query + reporter.step(3, 3, reporter.lang('revokingToken')); + yield revoke(); - if (!query) return path + if (error) { + throw new Error(); + } else { + return true; + } + }); - // Services don't support empty query string keys - if (query[''] != null) delete query[''] + return function mutate(_x, _x2, _x3, _x4, _x5) { + return _ref.apply(this, arguments); + }; +})(); - return path + '?' + encodeRfc3986(querystring.stringify(query)) -} +let list = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (args.length > 1) { + return false; + } + const name = yield (0, (_tag || _load_tag()).getName)(args, config); + reporter.step(1, 1, reporter.lang('ownerGetting', name)); + const pkg = yield config.registries.npm.request(name, { unfiltered: true }); + if (pkg) { + const owners = pkg.maintainers; + if (!owners || !owners.length) { + reporter.warn(reporter.lang('ownerNone')); + } else { + for (var _iterator = owners, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref3; -aws4.RequestSigner = RequestSigner + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; + } -aws4.sign = function(request, credentials) { - return new RequestSigner(request, credentials).sign() -} + const owner = _ref3; + reporter.info(`${owner.name} <${owner.email}>`); + } + } + } else { + reporter.error(reporter.lang('ownerGettingFailed')); + } -/***/ }), -/* 523 */ -/***/ (function(module, exports) { + if (pkg) { + return true; + } else { + throw new Error(); + } + }); -module.exports = function(size) { - return new LruCache(size) -} + return function list(_x6, _x7, _x8, _x9) { + return _ref2.apply(this, arguments); + }; +})(); -function LruCache(size) { - this.capacity = size | 0 - this.map = Object.create(null) - this.list = new DoublyLinkedList() -} +exports.setFlags = setFlags; -LruCache.prototype.get = function(key) { - var node = this.map[key] - if (node == null) return undefined - this.used(node) - return node.val -} +var _errors; -LruCache.prototype.set = function(key, val) { - var node = this.map[key] - if (node != null) { - node.val = val - } else { - if (!this.capacity) this.prune() - if (!this.capacity) return false - node = new DoublyLinkedNode(key, val) - this.map[key] = node - this.capacity-- - } - this.used(node) - return true +function _load_errors() { + return _errors = __webpack_require__(6); } -LruCache.prototype.used = function(node) { - this.list.moveToFront(node) -} +var _buildSubCommands2; -LruCache.prototype.prune = function() { - var node = this.list.pop() - if (node != null) { - delete this.map[node.key] - this.capacity++ - } +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); } +var _validate; -function DoublyLinkedList() { - this.firstNode = null - this.lastNode = null +function _load_validate() { + return _validate = __webpack_require__(125); } -DoublyLinkedList.prototype.moveToFront = function(node) { - if (this.firstNode == node) return - - this.remove(node) +var _tag; - if (this.firstNode == null) { - this.firstNode = node - this.lastNode = node - node.prev = null - node.next = null - } else { - node.prev = null - node.next = this.firstNode - node.next.prev = node - this.firstNode = node - } +function _load_tag() { + return _tag = __webpack_require__(355); } -DoublyLinkedList.prototype.pop = function() { - var lastNode = this.lastNode - if (lastNode != null) { - this.remove(lastNode) - } - return lastNode -} +var _login; -DoublyLinkedList.prototype.remove = function(node) { - if (this.firstNode == node) { - this.firstNode = node.next - } else if (node.prev != null) { - node.prev.next = node.next - } - if (this.lastNode == node) { - this.lastNode = node.prev - } else if (node.next != null) { - node.next.prev = node.prev - } +function _load_login() { + return _login = __webpack_require__(107); } +var _npmRegistry; -function DoublyLinkedNode(key, val) { - this.key = key - this.val = val - this.prev = null - this.next = null +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -/***/ }), -/* 524 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - +function remove(config, reporter, flags, args) { + return mutate(args, config, reporter, (username, name) => ({ + info: reporter.lang('ownerRemoving', username, name), + success: reporter.lang('ownerRemoved'), + error: reporter.lang('ownerRemoveError') + }), (user, pkg) => { + let found = false; -Object.defineProperty(exports, "__esModule", { - value: true -}); + pkg.maintainers = pkg.maintainers.filter(o => { + const match = o.name === user.name; + found = found || match; + return !match; + }); -exports.default = function (message) { - return { - useless: true, - run() { - throw new (_errors || _load_errors()).MessageError(message); - }, - setFlags: () => {}, - hasWrapper: () => true - }; -}; + if (!found) { + reporter.error(reporter.lang('userNotAnOwner', user.name)); + } -var _errors; + return found; + }); +} -function _load_errors() { - return _errors = __webpack_require__(6); +function setFlags(commander) { + commander.description('Manages package owners.'); } -/***/ }), -/* 525 */ -/***/ (function(module, exports, __webpack_require__) { +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('owner', { + add(config, reporter, flags, args) { + return mutate(args, config, reporter, (username, name) => ({ + info: reporter.lang('ownerAdding', username, name), + success: reporter.lang('ownerAdded'), + error: reporter.lang('ownerAddingFailed') + }), (user, pkg) => { + for (var _iterator2 = pkg.maintainers, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref4; -"use strict"; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref4 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref4 = _i2.value; + } + const owner = _ref4; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.hasWrapper = exports.run = undefined; -exports.setFlags = setFlags; + if (owner.name === user) { + reporter.error(reporter.lang('ownerAlready')); + return true; + } + } -var _buildSubCommands2; + pkg.maintainers.push(user); -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); -} + return false; + }); + }, -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + rm(config, reporter, flags, args) { + reporter.warn(`\`yarn owner rm\` is deprecated. Please use \`yarn owner remove\`.`); + return remove(config, reporter, flags, args); + }, -const notYetImplemented = () => Promise.reject(new Error('This command is not implemented yet.')); + remove(config, reporter, flags, args) { + return remove(config, reporter, flags, args); + }, -function setFlags(commander) { - commander.description('Has not been implemented yet'); -} + ls(config, reporter, flags, args) { + reporter.warn(`\`yarn owner ls\` is deprecated. Please use \`yarn owner list\`.`); + return list(config, reporter, flags, args); + }, -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('access', { - public: notYetImplemented, - restricted: notYetImplemented, - grant: notYetImplemented, - revoke: notYetImplemented, - lsPackages: notYetImplemented, - lsCollaborators: notYetImplemented, - edit: notYetImplemented -}, ['WARNING: This command yet to be implemented.', 'public []', 'restricted []', 'grant []', 'revoke []', 'ls-packages [||]', 'ls-collaborators [ []]', 'edit []']); + list(config, reporter, flags, args) { + return list(config, reporter, flags, args); + } +}, ['add [[<@scope>/]]', 'remove [[<@scope>/]]', 'list [<@scope>/]']); const run = _buildSubCommands.run, hasWrapper = _buildSubCommands.hasWrapper, @@ -95542,7 +94143,7 @@ exports.hasWrapper = hasWrapper; exports.examples = examples; /***/ }), -/* 526 */ +/* 508 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -95551,7 +94152,13 @@ exports.examples = examples; Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = undefined; +exports.examples = exports.setFlags = exports.run = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); +} var _asyncToGenerator2; @@ -95559,173 +94166,273 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -let run = exports.run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const binFolder = path.join(config.cwd, config.registryFolders[0], '.bin'); - if (args.length === 0) { - reporter.log(binFolder, { force: true }); - } else { - const binEntries = yield (0, (_run || _load_run()).getBinEntries)(config); +let fetchReleases = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, { includePrereleases = false } = {}) { + const token = process.env.GITHUB_TOKEN; + const tokenUrlParameter = token ? `?access_token=${token}` : ''; - const binName = args[0]; - const binPath = binEntries.get(binName); + const request = yield config.requestManager.request({ + url: `https://api.github.com/repos/yarnpkg/yarn/releases${tokenUrlParameter}`, + json: true + }); - if (binPath) { - reporter.log(binPath, { force: true }); - } else { - reporter.error(reporter.lang('packageBinaryNotFound', binName)); + const releases = request.filter(function (release) { + if (release.draft) { + return false; } - } + + if (release.prerelease && !includePrereleases) { + return false; + } + + // $FlowFixMe + release.version = semver.coerce(release.tag_name); + + if (!release.version) { + return false; + } + + if (!getBundleAsset(release)) { + return false; + } + + return true; + }); + + releases.sort(function (a, b) { + // $FlowFixMe + return -semver.compare(a.version, b.version); + }); + + return releases; }); - return function run(_x, _x2, _x3, _x4) { + return function fetchReleases(_x) { return _ref.apply(this, arguments); }; })(); exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -var _run; +var _yarnVersion; -function _load_run() { - return _run = __webpack_require__(360); +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(105); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - -const path = __webpack_require__(0); +var _child; -function hasWrapper(commander) { - return false; +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); } -function setFlags(commander) { - commander.description('Displays the location of the yarn bin folder.'); +var _buildSubCommands2; + +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); } -/***/ }), -/* 527 */ -/***/ (function(module, exports, __webpack_require__) { +var _rc; -"use strict"; +function _load_rc() { + return _rc = __webpack_require__(335); +} +var _fs; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.examples = exports.run = undefined; +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); +} -var _asyncToGenerator2; +var _lockfile; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); +function _load_lockfile() { + return _lockfile = __webpack_require__(19); } -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; +var _semver; -var _buildSubCommands2; +function _load_semver() { + return _semver = __webpack_require__(170); +} -function _load_buildSubCommands() { - return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); +var _constants; + +function _load_constants() { + return _constants = __webpack_require__(8); } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const CONFIG_KEYS = [ -// 'reporter', -'registryFolders', 'linkedModules', -// 'registries', -'cache', 'cwd', 'looseSemver', 'commandName', 'preferOffline', 'modulesFolder', 'globalFolder', 'linkFolder', 'offline', 'binLinks', 'ignorePlatform', 'ignoreScripts', 'disablePrepublish', 'nonInteractive', 'workspaceRootFolder', 'lockfileFolder', 'networkConcurrency', 'childConcurrency', 'networkTimeout', 'workspacesEnabled', 'workspacesNohoistEnabled', 'pruneOfflineMirror', 'enableMetaFolder', 'enableLockfileVersions', 'linkFileDependencies', 'cacheFolder', 'tempFolder', 'production']; -/* eslint object-shorthand: 0 */ +/* eslint-disable max-len */ -function hasWrapper(flags, args) { - return args[0] !== 'get'; +const V2_NAMES = ['berry', 'stable', 'canary', 'v2', '2']; + +const isLocalFile = version => version.match(/^\.{0,2}[\\/]/) || path.isAbsolute(version); +const isV2Version = version => (0, (_semver || _load_semver()).satisfiesWithPrereleases)(version, '>=2.0.0'); + +const chalk = __webpack_require__(30); +const invariant = __webpack_require__(9); +const path = __webpack_require__(0); +const semver = __webpack_require__(22); + +function getBundleAsset(release) { + return release.assets.find(asset => { + return asset.name.match(/^yarn-[0-9]+\.[0-9]+\.[0-9]+\.js$/); + }); } -function setFlags(commander) { - commander.description('Manages the yarn configuration files.'); +function fetchBundle(config, url) { + return config.requestManager.request({ + url, + buffer: true + }); } -var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('config', { - set(config, reporter, flags, args) { - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (args.length === 0 || args.length > 2) { - return false; - } - const key = args[0]; - var _args$ = args[1]; - const val = _args$ === undefined ? true : _args$; +function hasWrapper(flags, args) { + return false; +} - const yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: val }); - reporter.success(reporter.lang('configSet', key, val)); - return true; - })(); - }, +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('policies', { + setVersion(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const initialRange = args[0] || 'latest'; + let range = initialRange; - get(config, reporter, flags, args) { - if (args.length !== 1) { - return false; - } + let allowRc = flags.rc; - reporter.log(String(config.getOption(args[0])), { force: true }); - return true; - }, + if (range === 'rc') { + reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version rc' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`canary`)} instead. Sorry for the inconvenience.\n`); - delete: (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length !== 1) { - return false; + range = '*'; + allowRc = true; } - const key = args[0]; - const yarnConfig = config.registries.yarn; - yield yarnConfig.saveHomeConfig({ [key]: undefined }); - reporter.success(reporter.lang('configDelete', key)); - return true; - }); + if (range === 'latest') { + reporter.log(`${chalk.yellow(`Warning:`)} Your current Yarn binary is currently Yarn ${(_yarnVersion || _load_yarnVersion()).version}; to avoid potential breaking changes, 'set version latest' won't receive upgrades past the 1.22.x branch.\n To upgrade to the latest versions, run ${chalk.cyan(`yarn set version`)} ${chalk.yellow.underline(`stable`)} instead. Sorry for the inconvenience.\n`); - function _delete(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - } + range = '*'; + } - return _delete; - })(), + if (range === 'classic') { + range = '*'; + } - list(config, reporter, flags, args) { - if (args.length) { - return false; - } + let bundleUrl; + let bundleVersion; + const isV2 = false; - reporter.info(reporter.lang('configYarn')); - reporter.inspect(config.registries.yarn.config); + if (range === 'nightly' || range === 'nightlies') { + reporter.log(`${chalk.yellow(`Warning:`)} Nightlies only exist for Yarn 1.x; starting from 2.x onwards, you should use 'canary' instead`); - reporter.info(reporter.lang('configNpm')); - reporter.inspect(config.registries.npm.config); + bundleUrl = 'https://nightly.yarnpkg.com/latest.js'; + bundleVersion = 'nightly'; + } else if (V2_NAMES.includes(range) || isLocalFile(range) || isV2Version(range)) { + const normalizedRange = range === `canary` ? `canary` : `stable`; - return true; - }, + if (process.env.COREPACK_ROOT) { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [path.join(process.env.COREPACK_ROOT, 'dist/corepack.js'), `yarn@${normalizedRange}`, `set`, `version`, normalizedRange], { + stdio: 'inherit', + cwd: config.cwd + }); - current(config, reporter, flags, args) { - if (args.length) { - return false; - } + return; + } else { + const bundle = yield fetchBundle(config, 'https://github.com/yarnpkg/berry/raw/master/packages/yarnpkg-cli/bin/yarn.js'); - reporter.log(JSON.stringify(config, CONFIG_KEYS, 2), { force: true }); + const yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-stable-temp.cjs`); + yield (_fs || _load_fs()).mkdirp(path.dirname(yarnPath)); + yield (_fs || _load_fs()).writeFile(yarnPath, bundle); + yield (_fs || _load_fs()).chmod(yarnPath, 0o755); - return true; + try { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [yarnPath, 'set', 'version', range], { + stdio: 'inherit', + cwd: config.lockfileFolder, + env: (0, (_extends2 || _load_extends()).default)({}, process.env, { + YARN_IGNORE_PATH: `1` + }) + }); + } catch (err) { + // eslint-disable-next-line no-process-exit + process.exit(1); + } + + return; + } + } else { + reporter.log(`Resolving ${chalk.yellow(initialRange)} to a url...`); + + let releases = []; + + try { + releases = yield fetchReleases(config, { + includePrereleases: allowRc + }); + } catch (e) { + reporter.error(e.message); + return; + } + + const release = releases.find(function (release) { + // $FlowFixMe + return semver.satisfies(release.version, range); + }); + + if (!release) { + throw new Error(`Release not found: ${range}`); + } + + const asset = getBundleAsset(release); + invariant(asset, 'The bundle asset should exist'); + + bundleUrl = asset.browser_download_url; + bundleVersion = release.version.version; + } + + reporter.log(`Downloading ${chalk.green(bundleUrl)}...`); + + const bundle = yield fetchBundle(config, bundleUrl); + + const yarnPath = path.resolve(config.lockfileFolder, `.yarn/releases/yarn-${bundleVersion}.cjs`); + reporter.log(`Saving it into ${chalk.magenta(yarnPath)}...`); + yield (_fs || _load_fs()).mkdirp(path.dirname(yarnPath)); + yield (_fs || _load_fs()).writeFile(yarnPath, bundle); + yield (_fs || _load_fs()).chmod(yarnPath, 0o755); + + const targetPath = path.relative(config.lockfileFolder, yarnPath).replace(/\\/g, '/'); + + if (isV2) { + const rcPath = `${config.lockfileFolder}/.yarnrc.yml`; + reporter.log(`Updating ${chalk.magenta(rcPath)}...`); + + yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `yarnPath: ${JSON.stringify(targetPath)}\n`); + } else { + const rcPath = `${config.lockfileFolder}/.yarnrc`; + reporter.log(`Updating ${chalk.magenta(rcPath)}...`); + + const rc = (0, (_rc || _load_rc()).getRcConfigForFolder)(config.lockfileFolder); + rc['yarn-path'] = targetPath; + + yield (_fs || _load_fs()).writeFilePreservingEol(rcPath, `${(0, (_lockfile || _load_lockfile()).stringify)(rc)}\n`); + } + + reporter.log(`Done!`); + })(); } }); const run = _buildSubCommands.run, + setFlags = _buildSubCommands.setFlags, examples = _buildSubCommands.examples; exports.run = run; +exports.setFlags = setFlags; exports.examples = examples; /***/ }), -/* 528 */ +/* 509 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -95742,51 +94449,174 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _extends2; +let publish = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, pkg, flags, dir) { + let access = flags.access; -function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); -} + // if no access level is provided, check package.json for `publishConfig.access` + // see: https://docs.npmjs.com/files/package.json#publishconfig + if (!access && pkg && pkg.publishConfig && pkg.publishConfig.access) { + access = pkg.publishConfig.access; + } -let run = exports.run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const builderName = args[0], - rest = args.slice(1); + // validate access argument + if (access && access !== 'public' && access !== 'restricted') { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('invalidAccess')); + } + // TODO this might modify package.json, do we need to reload it? + yield config.executeLifecycleScript('prepublish'); + yield config.executeLifecycleScript('prepare'); + yield config.executeLifecycleScript('prepublishOnly'); + yield config.executeLifecycleScript('prepack'); - if (!builderName) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('invalidPackageName')); + // get tarball stream + const stat = yield (_fs || _load_fs()).lstat(dir); + let stream; + if (stat.isDirectory()) { + stream = yield (0, (_pack || _load_pack()).pack)(config); + } else if (stat.isFile()) { + stream = fs2.createReadStream(dir); + } else { + throw new Error("Don't know how to handle this file type"); } + const buffer = yield new Promise(function (resolve, reject) { + const data = []; + invariant(stream, 'expected stream'); + stream.on('data', data.push.bind(data)).on('end', function () { + return resolve(Buffer.concat(data)); + }).on('error', reject); + }); - var _coerceCreatePackageN = coerceCreatePackageName(builderName); + yield config.executeLifecycleScript('postpack'); - const packageName = _coerceCreatePackageN.fullName, - commandName = _coerceCreatePackageN.name; + // copy normalized package and remove internal keys as they may be sensitive or yarn specific + pkg = Object.assign({}, pkg); + for (const key in pkg) { + if (key[0] === '_') { + delete pkg[key]; + } + } + const tag = flags.tag || 'latest'; + const tbName = `${pkg.name}-${pkg.version}.tgz`; + const tbURI = `${pkg.name}/-/${tbName}`; - const linkLoc = path.join(config.linkFolder, commandName); - if (yield (_fs || _load_fs()).exists(linkLoc)) { - reporter.info(reporter.lang('linkUsing', packageName)); - } else { - yield (0, (_global || _load_global()).run)(config, reporter, {}, ['add', packageName]); - } + // create body + const root = { + _id: pkg.name, + access, + name: pkg.name, + description: pkg.description, + 'dist-tags': { + [tag]: pkg.version + }, + versions: { + [pkg.version]: pkg + }, + readme: pkg.readme || '', + _attachments: { + [tbName]: { + content_type: 'application/octet-stream', + data: buffer.toString('base64'), + length: buffer.length + } + } + }; - const binFolder = yield (0, (_global || _load_global()).getBinFolder)(config, {}); - const command = path.resolve(binFolder, commandName); - const env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)('create', config.cwd, config); + pkg._id = `${pkg.name}@${pkg.version}`; + pkg.dist = pkg.dist || {}; + pkg.dist.shasum = crypto.createHash('sha1').update(buffer).digest('hex'); + pkg.dist.integrity = ssri.fromData(buffer).toString(); - yield (_child || _load_child()).spawn(command, rest, { stdio: `inherit`, shell: true, env }); + const registry = String(config.getOption('registry')); + pkg.dist.tarball = url.resolve(registry, tbURI).replace(/^https:\/\//, 'http://'); + + // publish package + try { + yield config.registries.npm.request((_npmRegistry || _load_npmRegistry()).default.escapeName(pkg.name), { + registry: pkg && pkg.publishConfig && pkg.publishConfig.registry, + method: 'PUT', + body: root + }); + } catch (error) { + throw new (_errors || _load_errors()).MessageError(config.reporter.lang('publishFail', error.message)); + } + + yield config.executeLifecycleScript('publish'); + yield config.executeLifecycleScript('postpublish'); }); - return function run(_x, _x2, _x3, _x4) { + return function publish(_x, _x2, _x3, _x4) { return _ref.apply(this, arguments); }; })(); +let run = exports.run = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + // validate arguments + const dir = args[0] ? (_path || _load_path()).default.resolve(config.cwd, args[0]) : config.cwd; + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); + } + if (!(yield (_fs || _load_fs()).exists(dir))) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownFolderOrTarball')); + } + + const stat = yield (_fs || _load_fs()).lstat(dir); + let publishPath = dir; + if (stat.isDirectory()) { + config.cwd = (_path || _load_path()).default.resolve(dir); + publishPath = config.cwd; + } + + // validate package fields that are required for publishing + // $FlowFixMe + const pkg = yield config.readRootManifest(); + if (pkg.private) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('publishPrivate')); + } + if (!pkg.name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); + } + + let registry = ''; + + if (pkg && pkg.publishConfig && pkg.publishConfig.registry) { + registry = pkg.publishConfig.registry; + } + + reporter.step(1, 4, reporter.lang('bumpingVersion')); + const commitVersion = yield (0, (_version || _load_version()).setVersion)(config, reporter, flags, [], false); + + // + reporter.step(2, 4, reporter.lang('loggingIn')); + const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter, pkg.name, flags, registry); + + // + reporter.step(3, 4, reporter.lang('publishing')); + yield publish(config, pkg, flags, publishPath); + yield commitVersion(); + reporter.success(reporter.lang('published')); + + // + reporter.step(4, 4, reporter.lang('revokingToken')); + yield revoke(); + }); + + return function run(_x5, _x6, _x7, _x8) { + return _ref2.apply(this, arguments); + }; +})(); + exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; -exports.parsePackageName = parsePackageName; -exports.coerceCreatePackageName = coerceCreatePackageName; + +var _npmRegistry; + +function _load_npmRegistry() { + return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); +} var _errors; @@ -95794,78 +94624,61 @@ function _load_errors() { return _errors = __webpack_require__(6); } -var _child; +var _version; -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(58)); +function _load_version() { + return _version = __webpack_require__(357); } -var _executeLifecycleScript; +var _fs; -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(111); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); } -var _fs; +var _pack; -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); +function _load_pack() { + return _pack = __webpack_require__(166); } -var _global; +var _login; -function _load_global() { - return _global = __webpack_require__(121); +function _load_login() { + return _login = __webpack_require__(107); +} + +var _path; + +function _load_path() { + return _path = _interopRequireDefault(__webpack_require__(0)); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const path = __webpack_require__(0); +const invariant = __webpack_require__(9); + +const crypto = __webpack_require__(11); +const url = __webpack_require__(24); +const fs2 = __webpack_require__(4); +const ssri = __webpack_require__(65); function setFlags(commander) { - commander.description('Creates new projects from any create-* starter kits.'); + (0, (_version || _load_version()).setFlags)(commander); + commander.description('Publishes a package to the npm registry.'); + commander.usage('publish [|] [--tag ] [--access ]'); + commander.option('--access [access]', 'access'); + commander.option('--tag [tag]', 'tag'); } function hasWrapper(commander, args) { return true; } -function parsePackageName(str) { - if (str.charAt(0) === '/') { - throw new Error(`Name should not start with "/", got "${str}"`); - } - if (str.charAt(0) === '.') { - throw new Error(`Name should not start with ".", got "${str}"`); - } - const parts = str.split('/'); - const isScoped = str.charAt(0) === '@'; - if (isScoped && parts[0] === '@') { - throw new Error(`Scope should not be empty, got "${str}"`); - } - const scope = isScoped ? parts[0] : ''; - const name = parts[isScoped ? 1 : 0] || ''; - const path = parts.slice(isScoped ? 2 : 1).join('/'); - const fullName = [scope, name].filter(Boolean).join('/'); - const full = [scope, name, path].filter(Boolean).join('/'); - - return { fullName, name, scope, path, full }; -} - -function coerceCreatePackageName(str) { - const pkgNameObj = parsePackageName(str); - const coercedName = pkgNameObj.name !== '' ? `create-${pkgNameObj.name}` : `create`; - const coercedPkgNameObj = (0, (_extends2 || _load_extends()).default)({}, pkgNameObj, { - name: coercedName, - fullName: [pkgNameObj.scope, coercedName].filter(Boolean).join('/'), - full: [pkgNameObj.scope, coercedName, pkgNameObj.path].filter(Boolean).join('/') - }); - return coercedPkgNameObj; -} - /***/ }), -/* 529 */ +/* 510 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -95874,7 +94687,13 @@ function coerceCreatePackageName(str) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = undefined; +exports.examples = exports.hasWrapper = exports.run = undefined; + +var _extends2; + +function _load_extends() { + return _extends2 = _interopRequireDefault(__webpack_require__(20)); +} var _asyncToGenerator2; @@ -95882,58 +94701,225 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -let run = exports.run = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const env = yield (0, (_executeLifecycleScript || _load_executeLifecycleScript()).makeEnv)(`exec`, config.cwd, config); - - if (args.length < 1) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('execMissingCommand')); - } +let removeTeamUser = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang('teamRemovingUser')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { + method: 'DELETE', + body: { + user: parts.user + } + }))); + return true; + }); - const execName = args[0], - rest = args.slice(1); + return function removeTeamUser(_x5, _x6, _x7) { + return _ref2.apply(this, arguments); + }; +})(); - yield (_child || _load_child()).spawn(execName, rest, { stdio: 'inherit', env }); +let list = (() => { + var _ref3 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter) { + reporter.step(2, 3, reporter.lang('teamListing')); + const uriParams = '?format=cli'; + if (parts.team) { + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user${uriParams}`))); + } else { + reporter.inspect((yield config.registries.npm.request(`org/${parts.scope}/team${uriParams}`))); + } + return true; }); - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); + return function list(_x8, _x9, _x10) { + return _ref3.apply(this, arguments); }; })(); exports.setFlags = setFlags; -exports.hasWrapper = hasWrapper; -var _errors; +var _buildSubCommands2; -function _load_errors() { - return _errors = __webpack_require__(6); +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); } -var _child; +var _login; -function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(58)); +function _load_login() { + return _login = __webpack_require__(107); } -var _executeLifecycleScript; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _load_executeLifecycleScript() { - return _executeLifecycleScript = __webpack_require__(111); +function explodeScopeTeam(arg, requireTeam, reporter) { + var _arg$split = arg.split(':'); + + const scope = _arg$split[0], + team = _arg$split[1], + parts = _arg$split.slice(2); + + if (parts.length) { + return false; + } + + if (requireTeam && !team) { + return false; + } + + return { + scope: scope || '', + team: team || '', + user: '' + }; } -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } +function warnDeprecation(reporter, deprecationWarning) { + const command = 'yarn team'; + reporter.warn(reporter.lang('deprecatedCommand', `${command} ${deprecationWarning.deprecatedCommand}`, `${command} ${deprecationWarning.currentCommand}`)); +} -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +function wrapRequired(callback, requireTeam, deprecationInfo) { + return (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (deprecationInfo) { + warnDeprecation(reporter, deprecationInfo); + } -function setFlags(commander) {} + if (!args.length) { + return false; + } -function hasWrapper(commander, args) { - return true; + const parts = explodeScopeTeam(args[0], requireTeam, reporter); + if (!parts) { + return false; + } + + reporter.step(1, 3, reporter.lang('loggingIn')); + const revoke = yield (0, (_login || _load_login()).getToken)(config, reporter); + + const res = yield callback(parts, config, reporter, flags, args); + if (!res) { + return res; + } + + reporter.step(3, 3, reporter.lang('revokingToken')); + yield revoke(); + return true; + }); + + return function (_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; + })(); +} + +function wrapRequiredTeam(callback, requireTeam = true, subCommandDeprecated) { + return wrapRequired(function (parts, config, reporter, flags, args) { + if (args.length === 1) { + return callback(parts, config, reporter, flags, args); + } else { + return false; + } + }, requireTeam, subCommandDeprecated); +} + +function wrapRequiredUser(callback, subCommandDeprecated) { + return wrapRequired(function (parts, config, reporter, flags, args) { + if (args.length === 2) { + return callback((0, (_extends2 || _load_extends()).default)({ + user: args[1] + }, parts), config, reporter, flags, args); + } else { + return false; + } + }, true, subCommandDeprecated); +} + +function setFlags(commander) { + commander.description('Maintain team memberships'); } +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('team', { + create: wrapRequiredTeam((() => { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamCreating')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}`, { + method: 'PUT', + body: { + team: parts.team + } + }))); + return true; + }); + + return function (_x11, _x12, _x13, _x14, _x15) { + return _ref4.apply(this, arguments); + }; + })()), + + destroy: wrapRequiredTeam((() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamRemoving')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}`, { + method: 'DELETE' + }))); + return true; + }); + + return function (_x16, _x17, _x18, _x19, _x20) { + return _ref5.apply(this, arguments); + }; + })()), + + add: wrapRequiredUser((() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (parts, config, reporter, flags, args) { + reporter.step(2, 3, reporter.lang('teamAddingUser')); + reporter.inspect((yield config.registries.npm.request(`team/${parts.scope}/${parts.team}/user`, { + method: 'PUT', + body: { + user: parts.user + } + }))); + return true; + }); + + return function (_x21, _x22, _x23, _x24, _x25) { + return _ref6.apply(this, arguments); + }; + })()), + + rm: wrapRequiredUser(function (parts, config, reporter, flags, args) { + removeTeamUser(parts, config, reporter); + }, { + deprecatedCommand: 'rm', + currentCommand: 'remove' + }), + + remove: wrapRequiredUser(function (parts, config, reporter, flags, args) { + removeTeamUser(parts, config, reporter); + }), + + ls: wrapRequiredTeam(function (parts, config, reporter, flags, args) { + list(parts, config, reporter); + }, false, { + deprecatedCommand: 'ls', + currentCommand: 'list' + }), + + list: wrapRequiredTeam(function (parts, config, reporter, flags, args) { + list(parts, config, reporter); + }, false) +}, ['create ', 'destroy ', 'add ', 'remove ', 'list |']); + +const run = _buildSubCommands.run, + hasWrapper = _buildSubCommands.hasWrapper, + examples = _buildSubCommands.examples; +exports.run = run; +exports.hasWrapper = hasWrapper; +exports.examples = examples; + /***/ }), -/* 530 */ +/* 511 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -95942,7 +94928,7 @@ function hasWrapper(commander, args) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.examples = exports.run = undefined; +exports.run = undefined; var _asyncToGenerator2; @@ -95952,31 +94938,63 @@ function _load_asyncToGenerator() { let run = exports.run = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - let manifest; - if (flags.useManifest) { - manifest = yield config.readJson(flags.useManifest); + if (args.length) { + for (var _iterator = args, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref2; + + if (_isArray) { + if (_i >= _iterator.length) break; + _ref2 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref2 = _i.value; + } + + const name = _ref2; + + const linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + yield (_fs || _load_fs()).unlink(path.join((yield (0, (_link || _load_link()).getRegistryFolder)(config, name)), name)); + reporter.success(reporter.lang('linkDisusing', name)); + reporter.info(reporter.lang('linkDisusingMessage', name)); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name)); + } + } } else { - manifest = yield config.readRootManifest(); - } - if (!manifest.name) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noName')); - } - if (!manifest.version) { - throw new (_errors || _load_errors()).MessageError(reporter.lang('noVersion')); - } + // remove from registry + const manifest = yield config.readRootManifest(); + const name = manifest.name; + if (!name) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('unknownPackageName')); + } - const entry = { - name: manifest.name, - version: manifest.version, - resolved: flags.resolved, - registry: flags.registry || manifest._registry, - optionalDependencies: manifest.optionalDependencies, - dependencies: manifest.dependencies - }; - const pattern = flags.pattern || `${entry.name}@${entry.version}`; - reporter.log((0, (_lockfile || _load_lockfile()).stringify)({ - [pattern]: (0, (_lockfile || _load_lockfile()).implodeEntry)(pattern, entry) - })); + const linkLoc = path.join(config.linkFolder, name); + if (yield (_fs || _load_fs()).exists(linkLoc)) { + // If there is a `bin` defined in the package.json, + // link each bin to the global bin + if (manifest.bin) { + const globalBinFolder = yield (0, (_global || _load_global()).getBinFolder)(config, flags); + for (const binName in manifest.bin) { + const binDestLoc = path.join(globalBinFolder, binName); + if (yield (_fs || _load_fs()).exists(binDestLoc)) { + yield (_fs || _load_fs()).unlink(binDestLoc); + if (process.platform === 'win32') { + yield (_fs || _load_fs()).unlink(binDestLoc + '.cmd'); + } + } + } + } + + yield (_fs || _load_fs()).unlink(linkLoc); + + reporter.success(reporter.lang('linkUnregistered', name)); + reporter.info(reporter.lang('linkUnregisteredMessage', name)); + } else { + throw new (_errors || _load_errors()).MessageError(reporter.lang('linkMissing', name)); + } + } }); return function run(_x, _x2, _x3, _x4) { @@ -95984,8 +95002,8 @@ let run = exports.run = (() => { }; })(); -exports.hasWrapper = hasWrapper; exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; var _errors; @@ -95993,29 +95011,40 @@ function _load_errors() { return _errors = __webpack_require__(6); } -var _lockfile; +var _fs; -function _load_lockfile() { - return _lockfile = __webpack_require__(19); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _link; -function hasWrapper(commander, args) { - return false; +function _load_link() { + return _link = __webpack_require__(351); +} + +var _global; + +function _load_global() { + return _global = __webpack_require__(121); } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +const path = __webpack_require__(0); + function setFlags(commander) { - commander.description('Generates a lock file entry.'); - commander.option('--use-manifest ', 'description'); - commander.option('--resolved ', 'description'); - commander.option('--registry ', 'description'); + commander.description('Unlink a previously created symlink for a package.'); } -const examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry --use-manifest ./package.json', 'generate-lock-entry --resolved local-file.tgz#hash']; +function hasWrapper(commander, args) { + return true; +} /***/ }), -/* 531 */ +/* 512 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -96024,147 +95053,146 @@ const examples = exports.examples = ['generate-lock-entry', 'generate-lock-entry Object.defineProperty(exports, "__esModule", { value: true }); -exports.hasWrapper = hasWrapper; -exports.setFlags = setFlags; -exports.run = run; - -var _index; - -function _load_index() { - return _index = _interopRequireDefault(__webpack_require__(334)); -} - -var _constants; - -function _load_constants() { - return _constants = _interopRequireWildcard(__webpack_require__(8)); -} - -var _misc; - -function _load_misc() { - return _misc = __webpack_require__(18); -} - -var _aliases; - -function _load_aliases() { - return _aliases = _interopRequireDefault(__webpack_require__(352)); -} - -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +exports.clearAll = exports.clearSome = exports.run = undefined; -const chalk = __webpack_require__(30); +var _asyncToGenerator2; -function hasWrapper(flags, args) { - return false; +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -function setFlags(commander) { - commander.description('Displays help information.'); -} +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!config.plugnplayEnabled) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('unplugDisabled')); + } + if (!args.length && flags.clear) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('tooFewArguments', 1)); + } + if (args.length && flags.clearAll) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('noArguments')); + } -function run(config, reporter, commander, args) { - if (args.length) { - const commandName = args.shift(); - if (Object.prototype.hasOwnProperty.call((_index || _load_index()).default, commandName)) { - const command = (_index || _load_index()).default[commandName]; - if (command) { - command.setFlags(commander); - const examples = (command.examples || []).map(example => ` $ yarn ${example}`); - if (examples.length) { - commander.on('--help', () => { - reporter.log(reporter.lang('helpExamples', reporter.rawText(examples.join('\n')))); - }); - } - // eslint-disable-next-line yarn-internal/warn-language - commander.on('--help', () => reporter.log(' ' + command.getDocsInfo + '\n')); - commander.help(); - return Promise.resolve(); - } + if (flags.clearAll) { + yield clearAll(config); + } else if (flags.clear) { + yield clearSome(config, new Set(args)); + } else if (args.length > 0) { + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + yield (0, (_install || _load_install()).wrapLifecycle)(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); + install.linker.unplugged = args; + yield install.init(); + })); } - } - commander.on('--help', () => { - const commandsText = []; - for (var _iterator = Object.keys((_index || _load_index()).default).sort((_misc || _load_misc()).sortAlpha), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; + const unpluggedPackageFolders = yield config.listUnpluggedPackageFolders(); + + for (var _iterator = unpluggedPackageFolders.values(), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref3; if (_isArray) { if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; + _ref3 = _iterator[_i++]; } else { _i = _iterator.next(); if (_i.done) break; - _ref = _i.value; + _ref3 = _i.value; } - const name = _ref; + const target = _ref3; - if ((_index || _load_index()).default[name].useless || Object.keys((_aliases || _load_aliases()).default).map(key => (_aliases || _load_aliases()).default[key]).indexOf(name) > -1) { - continue; - } - if ((_aliases || _load_aliases()).default[name]) { - commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)} / ${(_aliases || _load_aliases()).default[name]}`); - } else { - commandsText.push(` - ${(0, (_misc || _load_misc()).hyphenate)(name)}`); - } + reporter.log(target, { force: true }); } - reporter.log(reporter.lang('helpCommands', reporter.rawText(commandsText.join('\n')))); - reporter.log(reporter.lang('helpCommandsMore', reporter.rawText(chalk.bold('yarn help COMMAND')))); - reporter.log(reporter.lang('helpLearnMore', reporter.rawText(chalk.bold((_constants || _load_constants()).YARN_DOCS)))); }); - commander.options.sort((_misc || _load_misc()).sortOptionsByFlags); + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); - commander.help(); - return Promise.resolve(); -} +let clearSome = exports.clearSome = (() => { + var _ref4 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, filters) { + const unpluggedPackageFolders = yield config.listUnpluggedPackageFolders(); + const removeList = []; -/***/ }), -/* 532 */ -/***/ (function(module, exports, __webpack_require__) { + for (var _iterator2 = unpluggedPackageFolders.entries(), _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref6; -"use strict"; + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref6 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref6 = _i2.value; + } + const _ref5 = _ref6; + const unpluggedName = _ref5[0]; + const target = _ref5[1]; -Object.defineProperty(exports, "__esModule", { - value: true -}); -exports.run = exports.Import = exports.noArguments = undefined; + var _ref8 = yield (_fs || _load_fs()).readJson(path.join(target, 'package.json')); -var _asyncToGenerator2; + const name = _ref8.name; -function _load_asyncToGenerator() { - return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); -} + const toBeRemoved = filters.has(name); -let run = exports.run = (() => { - var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const imp = new Import(flags, config, reporter, new (_lockfile || _load_lockfile()).default({ cache: {} })); - yield imp.init(); + if (toBeRemoved) { + removeList.push(path.join(config.getUnpluggedPath(), unpluggedName)); + } + } + + if (removeList.length === unpluggedPackageFolders.size) { + yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); + } else { + for (var _iterator3 = removeList, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref7; + + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref7 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref7 = _i3.value; + } + + const unpluggedPackagePath = _ref7; + + yield (_fs || _load_fs()).unlink(unpluggedPackagePath); + } + } }); - return function run(_x, _x2, _x3, _x4) { - return _ref5.apply(this, arguments); + return function clearSome(_x5, _x6) { + return _ref4.apply(this, arguments); + }; +})(); + +let clearAll = exports.clearAll = (() => { + var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config) { + yield (_fs || _load_fs()).unlink(config.getUnpluggedPath()); + }); + + return function clearAll(_x7) { + return _ref9.apply(this, arguments); }; })(); -exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; +exports.setFlags = setFlags; -var _install; +var _lockfile; -function _load_install() { - return _install = __webpack_require__(34); +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } -var _check; +var _install; -function _load_check() { - return _check = __webpack_require__(356); +function _load_install() { + return _install = __webpack_require__(34); } var _errors; @@ -96173,580 +95201,520 @@ function _load_errors() { return _errors = __webpack_require__(6); } -var _index; +var _fs; -function _load_index() { - return _index = __webpack_require__(78); +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); } -var _baseResolver; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } -function _load_baseResolver() { - return _baseResolver = _interopRequireDefault(__webpack_require__(123)); -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -var _hostedGitResolver; +const path = __webpack_require__(0); -function _load_hostedGitResolver() { - return _hostedGitResolver = _interopRequireDefault(__webpack_require__(109)); +function hasWrapper(commander) { + return true; } -var _hostedGitResolver2; - -function _load_hostedGitResolver2() { - return _hostedGitResolver2 = __webpack_require__(109); +function setFlags(commander) { + commander.description('Temporarily copies a package (with an optional @range suffix) outside of the global cache for debugging purposes'); + commander.usage('unplug [packages ...] [flags]'); + commander.option('--clear', 'Delete the selected packages'); + commander.option('--clear-all', 'Delete all unplugged packages'); } -var _gistResolver; +/***/ }), +/* 513 */ +/***/ (function(module, exports, __webpack_require__) { -function _load_gistResolver() { - return _gistResolver = _interopRequireDefault(__webpack_require__(216)); -} +"use strict"; -var _gistResolver2; -function _load_gistResolver2() { - return _gistResolver2 = __webpack_require__(216); -} +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = undefined; -var _gitResolver; +var _asyncToGenerator2; -function _load_gitResolver() { - return _gitResolver = _interopRequireDefault(__webpack_require__(124)); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _fileResolver; +let run = exports.run = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const versions = { yarn: (_yarnVersion || _load_yarnVersion()).version }; -function _load_fileResolver() { - return _fileResolver = _interopRequireDefault(__webpack_require__(215)); -} + const pkg = yield config.maybeReadManifest(config.cwd); + if (pkg && pkg.name && pkg.version) { + versions[pkg.name] = pkg.version; + } -var _packageResolver; + Object.assign(versions, process.versions); -function _load_packageResolver() { - return _packageResolver = _interopRequireDefault(__webpack_require__(366)); -} + reporter.inspect(versions); + }); -var _packageRequest; + return function run(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); -function _load_packageRequest() { - return _packageRequest = _interopRequireDefault(__webpack_require__(122)); -} +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; -var _packageReference; +var _yarnVersion; -function _load_packageReference() { - return _packageReference = _interopRequireDefault(__webpack_require__(365)); +function _load_yarnVersion() { + return _yarnVersion = __webpack_require__(105); } -var _packageFetcher; +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function _load_packageFetcher() { - return _packageFetcher = _interopRequireWildcard(__webpack_require__(210)); +function setFlags(commander) { + commander.description('Displays version information of currently installed Yarn, Node.js, and its dependencies.'); } -var _packageLinker; - -function _load_packageLinker() { - return _packageLinker = _interopRequireDefault(__webpack_require__(211)); +function hasWrapper(commander, args) { + return true; } -var _packageCompatibility; +/***/ }), +/* 514 */ +/***/ (function(module, exports, __webpack_require__) { -function _load_packageCompatibility() { - return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209)); -} +"use strict"; -var _lockfile; -function _load_lockfile() { - return _lockfile = _interopRequireDefault(__webpack_require__(19)); -} +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.run = exports.requireLockfile = undefined; -var _normalizePattern9; +var _asyncToGenerator2; -function _load_normalizePattern() { - return _normalizePattern9 = __webpack_require__(37); +function _load_asyncToGenerator() { + return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -var _logicalDependencyTree; +let cleanQuery = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, query) { + // if a location was passed then turn it into a hash query + if (path.isAbsolute(query) && (yield (_fs || _load_fs()).exists(query))) { + // absolute path + query = path.relative(config.cwd, query); + } -function _load_logicalDependencyTree() { - return _logicalDependencyTree = __webpack_require__(582); -} + // remove references to node_modules with hashes + query = query.replace(/([\\/]|^)node_modules[\\/]/g, '#'); -var _fs; + // remove trailing hashes + query = query.replace(/^#+/g, ''); -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); -} + // remove trailing paths from each part of the query, skip second part of path for scoped packages + let queryParts = query.split('#'); + queryParts = queryParts.map(function (part) { + let parts = part.split(/[\\/]/g); -var _misc; + if (part[0] === '@') { + parts = parts.slice(0, 2); + } else { + parts = parts.slice(0, 1); + } -function _load_misc() { - return _misc = _interopRequireWildcard(__webpack_require__(18)); -} + return parts.join('/'); + }); + query = queryParts.join('#'); -var _constants; + return query; + }); -function _load_constants() { - return _constants = __webpack_require__(8); -} + return function cleanQuery(_x, _x2) { + return _ref.apply(this, arguments); + }; +})(); -var _semver; +let getPackageSize = (() => { + var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (tuple) { + const loc = tuple[0]; -function _load_semver() { - return _semver = _interopRequireDefault(__webpack_require__(21)); -} -function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + const files = yield (_fs || _load_fs()).walk(loc, null, new Set([(_constants || _load_constants()).METADATA_FILENAME, (_constants || _load_constants()).TARBALL_FILENAME])); -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + const sizes = yield Promise.all(files.map(function (walkFile) { + return (_fs || _load_fs()).getFileSizeOnDisk(walkFile.absolute); + })); -const invariant = __webpack_require__(9); -const path = __webpack_require__(0); -const uuid = __webpack_require__(119); -const ssri = __webpack_require__(77); -const nodeVersion = process.versions.node.split('-')[0]; + return sum(sizes); + }); -const noArguments = exports.noArguments = true; + return function getPackageSize(_x3) { + return _ref2.apply(this, arguments); + }; +})(); -class ImportResolver extends (_baseResolver || _load_baseResolver()).default { - getCwd() { - if (this.request.parentRequest) { - const parent = this.resolver.getStrictResolvedPattern(this.request.parentRequest.pattern); - invariant(parent._loc, 'expected package location'); - return path.dirname(parent._loc); +let run = exports.run = (() => { + var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + if (!args.length) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('missingWhyDependency')); + } + if (args.length > 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('tooManyArguments', 1)); } - return this.config.cwd; - } - resolveHostedGit(info, Resolver) { - var _normalizePattern = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); + const query = yield cleanQuery(config, args[0]); - const range = _normalizePattern.range; + reporter.step(1, 4, reporter.lang('whyStart', args[0]), emoji.get('thinking_face')); - const exploded = (0, (_hostedGitResolver2 || _load_hostedGitResolver2()).explodeHostedGitFragment)(range, this.reporter); - const hash = info.gitHead; - invariant(hash, 'expected package gitHead'); - const url = Resolver.getTarballUrl(exploded, hash); - info._uid = hash; - info._remote = { - resolved: url, - type: 'tarball', - registry: this.registry, - reference: url, - hash: null - }; - return info; - } + // init + reporter.step(2, 4, reporter.lang('whyInitGraph'), emoji.get('truck')); + const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter); + const install = new (_install || _load_install()).Install(flags, config, reporter, lockfile); - resolveGist(info, Resolver) { - var _normalizePattern2 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); + var _ref7 = yield install.fetchRequestFromCwd(); - const range = _normalizePattern2.range; + const depRequests = _ref7.requests, + patterns = _ref7.patterns, + workspaceLayout = _ref7.workspaceLayout; - var _explodeGistFragment = (0, (_gistResolver2 || _load_gistResolver2()).explodeGistFragment)(range, this.reporter); + yield install.resolver.init(depRequests, { + isFlat: install.flags.flat, + isFrozen: install.flags.frozenLockfile, + workspaceLayout + }); + const hoisted = yield install.linker.getFlatHoistedTree(patterns); - const id = _explodeGistFragment.id; + // finding + reporter.step(3, 4, reporter.lang('whyFinding'), emoji.get('mag')); - const hash = info.gitHead; - invariant(hash, 'expected package gitHead'); - const url = `https://gist.github.com/${id}.git`; - info._uid = hash; - info._remote = { - resolved: `${url}#${hash}`, - type: 'git', - registry: this.registry, - reference: url, - hash - }; - return info; - } + const matches = queryWhy(query, hoisted); - resolveGit(info, Resolver) { - const url = info._resolved; - const hash = info.gitHead; - invariant(url, 'expected package _resolved'); - invariant(hash, 'expected package gitHead'); - info._uid = hash; - info._remote = { - resolved: `${url}#${hash}`, - type: 'git', - registry: this.registry, - reference: url, - hash - }; - return info; - } + if (matches.length <= 0) { + reporter.error(reporter.lang('whyUnknownMatch')); + return; + } - resolveFile(info, Resolver) { - var _normalizePattern3 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); + const processMatch = (() => { + var _ref8 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (match) { + const matchInfo = match[1]; - const range = _normalizePattern3.range; + const matchRef = matchInfo.pkg._reference; + invariant(matchRef, 'expected reference'); - let loc = (_misc || _load_misc()).removePrefix(range, 'file:'); - if (!path.isAbsolute(loc)) { - loc = path.join(this.config.cwd, loc); - } - info._uid = info.version; - info._remote = { - type: 'copy', - registry: this.registry, - hash: `${uuid.v4()}-${new Date().getTime()}`, - reference: loc - }; - return info; - } + const distinctMatchPatterns = new Set(matchRef.patterns); + const reasons = []; - resolveRegistry(info) { - let url = info._resolved; - const hash = info._shasum; - invariant(url, 'expected package _resolved'); - invariant(hash, 'expected package _shasum'); - if (this.config.getOption('registry') === (_constants || _load_constants()).YARN_REGISTRY) { - url = url.replace((_constants || _load_constants()).NPM_REGISTRY_RE, (_constants || _load_constants()).YARN_REGISTRY); - } - info._uid = info.version; - info._remote = { - resolved: `${url}#${hash}`, - type: 'tarball', - registry: this.registry, - reference: url, - integrity: info._integrity ? ssri.parse(info._integrity) : ssri.fromHex(hash, 'sha1'), - hash - }; - return info; - } + // reason: dependency of these modules + if (matchInfo.originalParentPath.length > 0) { + reasons.push({ + type: 'whyDependedOn', + typeSimple: 'whyDependedOnSimple', + value: toStandardPathString(matchInfo.originalParentPath) + }); + } - resolveImport(info) { - var _normalizePattern4 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); + // reason: exists in manifest + let rootType; + for (var _iterator3 = distinctMatchPatterns, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref9; - const range = _normalizePattern4.range; + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref9 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref9 = _i3.value; + } - const Resolver = (0, (_index || _load_index()).getExoticResolver)(range); - if (Resolver && Resolver.prototype instanceof (_hostedGitResolver || _load_hostedGitResolver()).default) { - return this.resolveHostedGit(info, Resolver); - } else if (Resolver && Resolver === (_gistResolver || _load_gistResolver()).default) { - return this.resolveGist(info, Resolver); - } else if (Resolver && Resolver === (_gitResolver || _load_gitResolver()).default) { - return this.resolveGit(info, Resolver); - } else if (Resolver && Resolver === (_fileResolver || _load_fileResolver()).default) { - return this.resolveFile(info, Resolver); - } - return this.resolveRegistry(info); - } + const pattern = _ref9; - resolveLocation(loc) { - var _this = this; + rootType = install.rootPatternsToOrigin[pattern]; + if (rootType) { + reasons.push({ + type: 'whySpecified', + typeSimple: 'whySpecifiedSimple', + value: rootType + }); + } + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - const info = yield _this.config.tryManifest(loc, 'npm', false); - if (!info) { - return null; - } - return _this.resolveImport(info); - })(); - } + // reason: this is hoisted from these modules + for (var _iterator4 = matchInfo.previousPaths, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref10; - resolveFixedVersion(fixedVersionPattern) { - var _this2 = this; + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref10 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref10 = _i4.value; + } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _normalizePattern5 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(fixedVersionPattern); + const path = _ref10; - const range = _normalizePattern5.range; + reasons.push({ + type: 'whyHoistedFrom', + typeSimple: 'whyHoistedFromSimple', + value: toStandardPathString(path) + }); + } - const exoticResolver = (0, (_index || _load_index()).getExoticResolver)(range); - const manifest = exoticResolver ? yield _this2.request.findExoticVersionInfo(exoticResolver, range) : yield _this2.request.findVersionOnRegistry(fixedVersionPattern); - return manifest; - })(); - } + // package sizes + let packageSize = 0; + let directSizes = []; + let transitiveSizes = []; + try { + packageSize = yield getPackageSize(match); + } catch (e) {} - _resolveFromFixedVersions() { - var _this3 = this; + const dependencies = Array.from(collect(hoisted, new Set(), match)); + const transitiveDependencies = Array.from(collect(hoisted, new Set(), match, { recursive: true })); - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - invariant(_this3.request instanceof ImportPackageRequest, 'request must be ImportPackageRequest'); + try { + directSizes = yield Promise.all(dependencies.map(getPackageSize)); + transitiveSizes = yield Promise.all(transitiveDependencies.map(getPackageSize)); + } catch (e) {} - var _normalizePattern6 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(_this3.pattern); + const transitiveKeys = new Set(transitiveDependencies.map(function ([, info]) { + return info.key; + })); + const sharedDependencies = getSharedDependencies(hoisted, transitiveKeys); - const name = _normalizePattern6.name; + // prepare output: populate reporter + reporter.info(reporter.lang('whyMatch', `${matchInfo.key}@${matchInfo.pkg.version}`)); + // + // reason: hoisted/nohoist + if (matchInfo.isNohoist) { + reasons.push({ + type: 'whyNotHoisted', + typeSimple: 'whyNotHoistedSimple', + value: matchInfo.nohoistList + }); + } else if (query === matchInfo.originalKey) { + reporter.info(reporter.lang('whyHoistedTo', matchInfo.key)); + } - invariant(_this3.request.dependencyTree instanceof (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree, 'dependencyTree on request must be LogicalDependencyTree'); - const fixedVersionPattern = _this3.request.dependencyTree.getFixedVersionPattern(name, _this3.request.parentNames); - const info = yield _this3.config.getCache(`import-resolver-${fixedVersionPattern}`, function () { - return _this3.resolveFixedVersion(fixedVersionPattern); - }); - if (info) { - return info; - } - throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('importResolveFailed', name, _this3.getCwd())); - })(); - } + if (reasons.length === 1) { + reporter.info(reporter.lang(reasons[0].typeSimple, reasons[0].value)); + } else if (reasons.length > 1) { + reporter.info(reporter.lang('whyReasons')); + reporter.list('reasons', reasons.map(function (reason) { + return reporter.lang(reason.type, reason.value); + })); + } else { + reporter.error(reporter.lang('whyWhoKnows')); + } - _resolveFromNodeModules() { - var _this4 = this; + if (packageSize) { + // stats: file size of this dependency without any dependencies + reporter.info(reporter.lang('whyDiskSizeWithout', bytes(packageSize))); - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - var _normalizePattern7 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(_this4.pattern); + // stats: file size of this dependency including dependencies that aren't shared + reporter.info(reporter.lang('whyDiskSizeUnique', bytes(packageSize + sum(directSizes)))); - const name = _normalizePattern7.name; + // stats: file size of this dependency including dependencies + reporter.info(reporter.lang('whyDiskSizeTransitive', bytes(packageSize + sum(transitiveSizes)))); - let cwd = _this4.getCwd(); - while (!path.relative(_this4.config.cwd, cwd).startsWith('..')) { - const loc = path.join(cwd, 'node_modules', name); - const info = yield _this4.config.getCache(`import-resolver-${loc}`, function () { - return _this4.resolveLocation(loc); - }); - if (info) { - return info; + // stats: shared transitive dependencies + reporter.info(reporter.lang('whySharedDependencies', sharedDependencies.size)); } - cwd = path.resolve(cwd, '../..'); - } - throw new (_errors || _load_errors()).MessageError(_this4.reporter.lang('importResolveFailed', name, _this4.getCwd())); + }); + + return function processMatch(_x8) { + return _ref8.apply(this, arguments); + }; })(); - } - resolve() { - if (this.request instanceof ImportPackageRequest && this.request.dependencyTree) { - return this._resolveFromFixedVersions(); - } else { - return this._resolveFromNodeModules(); + reporter.step(4, 4, reporter.lang('whyCalculating'), emoji.get('aerial_tramway')); + for (var _iterator5 = matches, _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) { + var _ref11; + + if (_isArray5) { + if (_i5 >= _iterator5.length) break; + _ref11 = _iterator5[_i5++]; + } else { + _i5 = _iterator5.next(); + if (_i5.done) break; + _ref11 = _i5.value; + } + + const match = _ref11; + + yield processMatch(match); } - } -} + }); -class ImportPackageRequest extends (_packageRequest || _load_packageRequest()).default { - constructor(req, dependencyTree, resolver) { - super(req, resolver); - this.import = this.parentRequest instanceof ImportPackageRequest ? this.parentRequest.import : true; - this.dependencyTree = dependencyTree; - } + return function run(_x4, _x5, _x6, _x7) { + return _ref6.apply(this, arguments); + }; +})(); - getRootName() { - return this.resolver instanceof ImportPackageResolver && this.resolver.rootName || 'root'; - } +exports.setFlags = setFlags; +exports.hasWrapper = hasWrapper; +exports.queryWhy = queryWhy; - getParentHumanName() { - return [this.getRootName()].concat(this.parentNames).join(' > '); - } +var _install; - reportResolvedRangeMatch(info, resolved) { - if (info.version === resolved.version) { - return; - } - this.reporter.warn(this.reporter.lang('importResolvedRangeMatch', resolved.version, resolved.name, info.version, this.getParentHumanName())); - } +function _load_install() { + return _install = __webpack_require__(34); +} - _findResolvedManifest(info) { - var _normalizePattern8 = (0, (_normalizePattern9 || _load_normalizePattern()).normalizePattern)(this.pattern); +var _constants; - const range = _normalizePattern8.range, - name = _normalizePattern8.name; +function _load_constants() { + return _constants = __webpack_require__(8); +} - const solvedRange = (_semver || _load_semver()).default.validRange(range) ? info.version : range; - const resolved = this.resolver.getExactVersionMatch(name, solvedRange, info); - if (resolved) { - return resolved; - } - invariant(info._remote, 'expected package remote'); - const ref = new (_packageReference || _load_packageReference()).default(this, info, info._remote); - info._reference = ref; - return info; - } +var _fs; - resolveToExistingVersion(info) { - const resolved = this._findResolvedManifest(info); - invariant(resolved, 'should have found a resolved reference'); - const ref = resolved._reference; - invariant(ref, 'should have a package reference'); - ref.addRequest(this); - ref.addPattern(this.pattern, resolved); - ref.addOptional(this.optional); - } +function _load_fs() { + return _fs = _interopRequireWildcard(__webpack_require__(5)); +} - findVersionInfo() { - if (!this.import) { - this.reporter.verbose(this.reporter.lang('skippingImport', this.pattern, this.getParentHumanName())); - return super.findVersionInfo(); - } - const resolver = new ImportResolver(this, this.pattern); - return resolver.resolve().catch(() => { - this.import = false; - this.reporter.warn(this.reporter.lang('importFailed', this.pattern, this.getParentHumanName())); - return super.findVersionInfo(); - }); - } +var _lockfile; + +function _load_lockfile() { + return _lockfile = _interopRequireDefault(__webpack_require__(19)); } -class ImportPackageResolver extends (_packageResolver || _load_packageResolver()).default { - constructor(config, lockfile) { - super(config, lockfile); - this.next = []; - this.rootName = 'root'; - } +var _errors; - find(req) { - this.next.push(req); - return Promise.resolve(); - } +function _load_errors() { + return _errors = __webpack_require__(6); +} - findOne(req) { - var _this5 = this; +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (_this5.activity) { - _this5.activity.tick(req.pattern); - } - const request = new ImportPackageRequest(req, _this5.dependencyTree, _this5); - yield request.find({ fresh: false }); - })(); - } +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - findAll(deps) { - var _this6 = this; +const requireLockfile = exports.requireLockfile = true; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - yield Promise.all(deps.map(function (dep) { - return _this6.findOne(dep); - })); - deps = _this6.next; - _this6.next = []; - if (!deps.length) { - // all required package versions have been discovered, so now packages that - // resolved to existing versions can be resolved to their best available version - _this6.resolvePackagesWithExistingVersions(); - return; - } - yield _this6.findAll(deps); - })(); - } +const invariant = __webpack_require__(9); +const bytes = __webpack_require__(564); +const emoji = __webpack_require__(302); +const path = __webpack_require__(0); - resetOptional() { - for (const pattern in this.patterns) { - const ref = this.patterns[pattern]._reference; - invariant(ref, 'expected reference'); - ref.optional = null; - for (var _iterator = ref.requests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { - var _ref; +function sum(array) { + return array.length ? array.reduce((a, b) => a + b, 0) : 0; +} - if (_isArray) { - if (_i >= _iterator.length) break; - _ref = _iterator[_i++]; - } else { - _i = _iterator.next(); - if (_i.done) break; - _ref = _i.value; - } +function collect(hoistManifests, allDependencies, dependency, { recursive } = { recursive: false }) { + const depInfo = dependency[1]; - const req = _ref; + const deps = depInfo.pkg.dependencies; - ref.addOptional(req.optional); - } - } + if (!deps) { + return allDependencies; } - init(deps, { isFlat, isFrozen, workspaceLayout } = { isFlat: false, isFrozen: false, workspaceLayout: undefined }) { - var _this7 = this; + const dependencyKeys = new Set(Object.keys(deps)); + const directDependencies = []; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - _this7.flat = Boolean(isFlat); - const activity = _this7.activity = _this7.reporter.activity(); - yield _this7.findAll(deps); - _this7.resetOptional(); - activity.end(); - _this7.activity = null; - })(); - } -} + for (var _iterator = hoistManifests, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + var _ref3; -class Import extends (_install || _load_install()).Install { - constructor(flags, config, reporter, lockfile) { - super(flags, config, reporter, lockfile); - this.resolver = new ImportPackageResolver(this.config, this.lockfile); - this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver); - } - createLogicalDependencyTree(packageJson, packageLock) { - invariant(packageJson, 'package.json should exist'); - invariant(packageLock, 'package-lock.json should exist'); - invariant(this.resolver instanceof ImportPackageResolver, 'resolver should be an ImportPackageResolver'); - try { - this.resolver.dependencyTree = new (_logicalDependencyTree || _load_logicalDependencyTree()).LogicalDependencyTree(packageJson, packageLock); - } catch (e) { - throw new (_errors || _load_errors()).MessageError(this.reporter.lang('importSourceFilesCorrupted')); + if (_isArray) { + if (_i >= _iterator.length) break; + _ref3 = _iterator[_i++]; + } else { + _i = _iterator.next(); + if (_i.done) break; + _ref3 = _i.value; } - } - getExternalLockfileContents() { - var _this8 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - try { - var _ref2 = yield Promise.all([(_fs || _load_fs()).readFile(path.join(_this8.config.cwd, (_constants || _load_constants()).NODE_PACKAGE_JSON)), (_fs || _load_fs()).readFile(path.join(_this8.config.cwd, (_constants || _load_constants()).NPM_LOCK_FILENAME))]); + const dep = _ref3; + const info = dep[1]; - const packageJson = _ref2[0], - packageLock = _ref2[1]; - return { packageJson, packageLock }; - } catch (e) { - return { packageJson: null, packageLock: null }; - } - })(); + if (!allDependencies.has(dep) && dependencyKeys.has(info.key)) { + allDependencies.add(dep); + directDependencies.push(dep); + } } - init() { - var _this9 = this; - return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { - if (yield (_fs || _load_fs()).exists(path.join(_this9.config.cwd, (_constants || _load_constants()).LOCKFILE_FILENAME))) { - throw new (_errors || _load_errors()).MessageError(_this9.reporter.lang('lockfileExists')); - } - - var _ref3 = yield _this9.getExternalLockfileContents(); + if (recursive) { + directDependencies.forEach(dependency => collect(hoistManifests, allDependencies, dependency, { recursive: true })); + } - const packageJson = _ref3.packageJson, - packageLock = _ref3.packageLock; + return allDependencies; +} - const importSource = packageJson && packageLock && (_semver || _load_semver()).default.satisfies(nodeVersion, '>=5.0.0') ? 'package-lock.json' : 'node_modules'; - if (importSource === 'package-lock.json') { - _this9.reporter.info(_this9.reporter.lang('importPackageLock')); - _this9.createLogicalDependencyTree(packageJson, packageLock); - } - if (importSource === 'node_modules') { - _this9.reporter.info(_this9.reporter.lang('importNodeModules')); - yield (0, (_check || _load_check()).verifyTreeCheck)(_this9.config, _this9.reporter, {}, []); - } +function getSharedDependencies(hoistManifests, transitiveKeys) { + const sharedDependencies = new Set(); + for (var _iterator2 = hoistManifests, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref5; - var _ref4 = yield _this9.fetchRequestFromCwd(); + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref5 = _iterator2[_i2++]; + } else { + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref5 = _i2.value; + } - const requests = _ref4.requests, - patterns = _ref4.patterns, - manifest = _ref4.manifest; + const _ref4 = _ref5; + const info = _ref4[1]; - if (manifest.name && _this9.resolver instanceof ImportPackageResolver) { - _this9.resolver.rootName = manifest.name; - } - yield _this9.resolver.init(requests, { isFlat: _this9.flags.flat, isFrozen: _this9.flags.frozenLockfile }); - const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this9.resolver.getManifests(), _this9.config); - _this9.resolver.updateManifests(manifests); - yield (_packageCompatibility || _load_packageCompatibility()).check(_this9.resolver.getManifests(), _this9.config, _this9.flags.ignoreEngines); - yield _this9.linker.resolvePeerModules(); - yield _this9.saveLockfileAndIntegrity(patterns); - return patterns; - })(); + if (!transitiveKeys.has(info.key) && info.pkg.dependencies) { + Object.keys(info.pkg.dependencies).forEach(dependency => { + if (transitiveKeys.has(dependency) && !sharedDependencies.has(dependency)) { + sharedDependencies.add(dependency); + } + }); + } } + return sharedDependencies; } -exports.Import = Import; function setFlags(commander) { - commander.description('Generates yarn.lock from an npm package-lock.json file or an existing npm-installed node_modules folder.'); + commander.description('Identifies why a package has been installed, detailing which other packages depend on it.'); } function hasWrapper(commander, args) { return true; } +// to conform to the current standard '#' as package tree separator +function toStandardPathString(pathString) { + const str = pathString.replace(/\//g, '#'); + if (str[0] === '#') { + return str.slice(1); + } + return str; +} + +function queryWhy(pattern, hoisted) { + const nohoistPattern = `#${pattern}`; + const found = []; + for (var _iterator6 = hoisted, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) { + var _ref13; + + if (_isArray6) { + if (_i6 >= _iterator6.length) break; + _ref13 = _iterator6[_i6++]; + } else { + _i6 = _iterator6.next(); + if (_i6.done) break; + _ref13 = _i6.value; + } + + const _ref12 = _ref13; + const loc = _ref12[0]; + const info = _ref12[1]; + + if (info.key === pattern || info.previousPaths.indexOf(pattern) >= 0 || info.key.endsWith(nohoistPattern)) { + found.push([loc, info]); + } + } + return found; +} + /***/ }), -/* 533 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -96765,58 +95733,45 @@ function _load_asyncToGenerator() { let run = exports.run = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - if (args.length > 2) { - reporter.error(reporter.lang('tooManyArguments', 2)); - return; - } + const workspaceRootFolder = config.workspaceRootFolder; - let packageName = args.shift() || '.'; - // Handle the case when we are referencing a local package. - if (packageName === '.') { - packageName = (yield config.readRootManifest()).name; + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); } - const packageInput = (_npmRegistry || _load_npmRegistry()).default.escapeName(packageName); + if (args.length < 1) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingWorkspace')); + } - var _parsePackageName = (0, (_parsePackageName2 || _load_parsePackageName()).default)(packageInput); + if (args.length < 2) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceMissingCommand')); + } - const name = _parsePackageName.name, - version = _parsePackageName.version; + const manifest = yield config.findManifest(workspaceRootFolder, false); + invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); + const workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - let result; - try { - result = yield config.registries.npm.request(name, { unfiltered: true }); - } catch (e) { - reporter.error(reporter.lang('infoFail')); - return; - } - if (!result) { - reporter.error(reporter.lang('infoFail')); - return; - } + var _ref2 = args || []; - result = clean(result); + const workspaceName = _ref2[0], + rest = _ref2.slice(1); - const versions = result.versions; - // $FlowFixMe - result.versions = Object.keys(versions).sort(semver.compareLoose); - result.version = version || result['dist-tags'].latest; - result = Object.assign(result, versions[result.version]); + if (!Object.prototype.hasOwnProperty.call(workspaces, workspaceName)) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceUnknownWorkspace', workspaceName)); + } - const fieldPath = args.shift(); - const fields = fieldPath ? fieldPath.split('.') : []; + const workspace = workspaces[workspaceName]; - // Readmes can be long so exclude them unless explicitly asked for. - if (fields[0] !== 'readme') { - delete result.readme; + try { + yield (_child || _load_child()).spawn((_constants || _load_constants()).NODE_BIN_PATH, [(_constants || _load_constants()).YARN_BIN_PATH, ...rest], { + stdio: 'inherit', + cwd: workspace.loc + }); + } catch (err) { + throw err; } - - result = fields.reduce(function (prev, cur) { - return prev && prev[cur]; - }, result); - reporter.inspect(result); }); return function run(_x, _x2, _x3, _x4) { @@ -96827,62 +95782,38 @@ let run = exports.run = (() => { exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; -var _npmRegistry; +var _errors; -function _load_npmRegistry() { - return _npmRegistry = _interopRequireDefault(__webpack_require__(88)); +function _load_errors() { + return _errors = __webpack_require__(6); } -var _parsePackageName2; +var _child; -function _load_parsePackageName() { - return _parsePackageName2 = _interopRequireDefault(__webpack_require__(588)); +function _load_child() { + return _child = _interopRequireWildcard(__webpack_require__(50)); } -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } +var _constants; -const semver = __webpack_require__(21); +function _load_constants() { + return _constants = __webpack_require__(8); +} -function clean(object) { - if (Array.isArray(object)) { - const result = []; - object.forEach(item => { - item = clean(item); - if (item) { - result.push(item); - } - }); - return result; - } else if (typeof object === 'object') { - const result = {}; - for (const key in object) { - if (key.startsWith('_')) { - continue; - } +function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } - const item = clean(object[key]); - if (item) { - result[key] = item; - } - } - return result; - } else if (object) { - return object; - } else { - return null; - } -} +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -function setFlags(commander) { - commander.description('Shows information about a package.'); -} +const invariant = __webpack_require__(9); + +function setFlags(commander) {} function hasWrapper(commander, args) { return true; } /***/ }), -/* 534 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -96891,7 +95822,7 @@ function hasWrapper(commander, args) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.getGitConfigInfo = exports.run = exports.shouldRunInCurrentCwd = undefined; +exports.examples = exports.setFlags = exports.run = exports.runScript = exports.info = undefined; var _asyncToGenerator2; @@ -96899,78 +95830,23 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -let run = exports.run = (() => { +let info = exports.info = (() => { var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const manifests = yield config.getRootManifests(); - - let repository = {}; - const author = { - name: config.getOption('init-author-name'), - email: config.getOption('init-author-email'), - url: config.getOption('init-author-url') - }; - if (yield (_fs || _load_fs()).exists(path.join(config.cwd, '.git'))) { - // get git origin of the cwd - try { - repository = { - type: 'git', - url: yield (_child || _load_child()).spawn('git', ['config', 'remote.origin.url'], { - cwd: config.cwd - }) - }; - } catch (ex) { - // Ignore - Git repo may not have an origin URL yet (eg. if it only exists locally) - } + const workspaceRootFolder = config.workspaceRootFolder; - if (author.name === undefined) { - author.name = yield getGitConfigInfo('user.name'); - } - if (author.email === undefined) { - author.email = yield getGitConfigInfo('user.email'); - } + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); } - const keys = [{ - key: 'name', - question: 'name', - default: path.basename(config.cwd), - validation: (_validate || _load_validate()).isValidPackageName, - validationError: 'invalidPackageName' - }, { - key: 'version', - question: 'version', - default: String(config.getOption('init-version')) - }, { - key: 'description', - question: 'description', - default: '' - }, { - key: 'main', - question: 'entry point', - default: 'index.js' - }, { - key: 'repository', - question: 'repository url', - default: (0, (_util || _load_util()).extractRepositoryUrl)(repository) - }, { - key: 'author', - question: 'author', - default: (0, (_util || _load_util()).stringifyPerson)(author) - }, { - key: 'license', - question: 'license', - default: String(config.getOption('init-license')) - }, { - key: 'private', - question: 'private', - default: config.getOption('init-private') || '', - inputFormatter: yn - }]; + const manifest = yield config.findManifest(workspaceRootFolder, false); + invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - // get answers - const pkg = {}; - for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { + const workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); + + const publicData = {}; + + for (var _iterator = Object.keys(workspaces), _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : _iterator[Symbol.iterator]();;) { var _ref2; if (_isArray) { @@ -96982,225 +95858,199 @@ let run = exports.run = (() => { _ref2 = _i.value; } - const entry = _ref2; - const yes = flags.yes, - privateFlag = flags.private; - const manifestKey = entry.key; - let question = entry.question, - def = entry.default; + const workspaceName = _ref2; + var _workspaces$workspace = workspaces[workspaceName]; + const loc = _workspaces$workspace.loc, + manifest = _workspaces$workspace.manifest; - for (var _iterator4 = (_index || _load_index()).registryNames, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { - var _ref5; + const workspaceDependencies = new Set(); + const mismatchedWorkspaceDependencies = new Set(); - if (_isArray4) { - if (_i4 >= _iterator4.length) break; - _ref5 = _iterator4[_i4++]; + for (var _iterator2 = (_constants || _load_constants()).DEPENDENCY_TYPES, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { + var _ref3; + + if (_isArray2) { + if (_i2 >= _iterator2.length) break; + _ref3 = _iterator2[_i2++]; } else { - _i4 = _iterator4.next(); - if (_i4.done) break; - _ref5 = _i4.value; + _i2 = _iterator2.next(); + if (_i2.done) break; + _ref3 = _i2.value; } - const registryName = _ref5; - const object = manifests[registryName].object; - - let val = objectPath.get(object, manifestKey); - if (!val) { - break; - } - if (typeof val === 'object') { - if (manifestKey === 'author') { - val = (0, (_util || _load_util()).stringifyPerson)(val); - } else if (manifestKey === 'repository') { - val = (0, (_util || _load_util()).extractRepositoryUrl)(val); - } - } - def = val; - } + const dependencyType = _ref3; - if (manifestKey === 'private' && privateFlag) { - def = true; - } + if (dependencyType !== 'peerDependencies') { + for (var _iterator3 = Object.keys(manifest[dependencyType] || {}), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { + var _ref4; - if (def) { - question += ` (${String(def)})`; - } + if (_isArray3) { + if (_i3 >= _iterator3.length) break; + _ref4 = _iterator3[_i3++]; + } else { + _i3 = _iterator3.next(); + if (_i3.done) break; + _ref4 = _i3.value; + } - let answer; - let validAnswer = false; + const dependencyName = _ref4; - if (yes) { - answer = def; - } else { - // loop until a valid answer is provided, if validation is on entry - if (entry.validation) { - while (!validAnswer) { - answer = (yield reporter.question(question)) || def; - // validate answer - if (entry.validation(String(answer))) { - validAnswer = true; - } else { - reporter.error(reporter.lang('invalidPackageName')); + if (Object.prototype.hasOwnProperty.call(workspaces, dependencyName)) { + invariant(manifest && manifest[dependencyType], 'The request should exist'); + const requestedRange = manifest[dependencyType][dependencyName]; + if (semver.satisfies(workspaces[dependencyName].manifest.version, requestedRange)) { + workspaceDependencies.add(dependencyName); + } else { + mismatchedWorkspaceDependencies.add(dependencyName); + } } } - } else { - answer = (yield reporter.question(question)) || def; } } - if (answer) { - if (entry.inputFormatter) { - answer = entry.inputFormatter(answer); - } - objectPath.set(pkg, manifestKey, answer); - } + publicData[workspaceName] = { + location: path.relative(config.lockfileFolder, loc).replace(/\\/g, '/'), + workspaceDependencies: Array.from(workspaceDependencies), + mismatchedWorkspaceDependencies: Array.from(mismatchedWorkspaceDependencies) + }; } - if (pkg.repository && (_githubResolver || _load_githubResolver()).default.isVersion(pkg.repository)) { - pkg.repository = `https://github.com/${pkg.repository}`; - } + reporter.log(JSON.stringify(publicData, null, 2), { force: true }); + }); - // save answers - const targetManifests = []; - for (var _iterator2 = (_index || _load_index()).registryNames, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : _iterator2[Symbol.iterator]();;) { - var _ref3; + return function info(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; +})(); - if (_isArray2) { - if (_i2 >= _iterator2.length) break; - _ref3 = _iterator2[_i2++]; - } else { - _i2 = _iterator2.next(); - if (_i2.done) break; - _ref3 = _i2.value; - } +let runScript = exports.runScript = (() => { + var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { + const workspaceRootFolder = config.workspaceRootFolder; - const registryName = _ref3; - const info = manifests[registryName]; - if (info.exists) { - targetManifests.push(info); - } - } - if (!targetManifests.length) { - targetManifests.push(manifests.npm); + if (!workspaceRootFolder) { + throw new (_errors || _load_errors()).MessageError(reporter.lang('workspaceRootNotFound', config.cwd)); } - for (var _iterator3 = targetManifests, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) { - var _ref4; - if (_isArray3) { - if (_i3 >= _iterator3.length) break; - _ref4 = _iterator3[_i3++]; - } else { - _i3 = _iterator3.next(); - if (_i3.done) break; - _ref4 = _i3.value; - } + const manifest = yield config.findManifest(workspaceRootFolder, false); + invariant(manifest && manifest.workspaces, 'We must find a manifest with a "workspaces" property'); - const targetManifest = _ref4; + const workspaces = yield config.resolveWorkspaces(workspaceRootFolder, manifest); - Object.assign(targetManifest.object, pkg); - reporter.success(`Saved ${path.basename(targetManifest.loc)}`); - } + try { + for (var _iterator4 = Object.keys(workspaces), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) { + var _ref6; - yield config.saveRootManifests(manifests); - }); + if (_isArray4) { + if (_i4 >= _iterator4.length) break; + _ref6 = _iterator4[_i4++]; + } else { + _i4 = _iterator4.next(); + if (_i4.done) break; + _ref6 = _i4.value; + } - return function run(_x, _x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; -})(); + const workspaceName = _ref6; + const loc = workspaces[workspaceName].loc; -let getGitConfigInfo = exports.getGitConfigInfo = (() => { - var _ref6 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (credential, spawn = (_child || _load_child()).spawn) { - try { - // try to get author default based on git config - return yield spawn('git', ['config', credential]); - } catch (e) { - return ''; + reporter.log(`${os.EOL}> ${workspaceName}`); + yield (_child || _load_child()).spawn((_constants2 || _load_constants2()).NODE_BIN_PATH, [(_constants2 || _load_constants2()).YARN_BIN_PATH, 'run', ...args], { + stdio: 'inherit', + cwd: loc + }); + } + } catch (err) { + throw err; } }); - return function getGitConfigInfo(_x5) { - return _ref6.apply(this, arguments); + return function runScript(_x5, _x6, _x7, _x8) { + return _ref5.apply(this, arguments); }; })(); -exports.setFlags = setFlags; exports.hasWrapper = hasWrapper; -var _util; +var _errors; -function _load_util() { - return _util = __webpack_require__(221); +function _load_errors() { + return _errors = __webpack_require__(6); } -var _index; +var _buildSubCommands2; -function _load_index() { - return _index = __webpack_require__(57); +function _load_buildSubCommands() { + return _buildSubCommands2 = _interopRequireDefault(__webpack_require__(59)); } -var _githubResolver; +var _constants; -function _load_githubResolver() { - return _githubResolver = _interopRequireDefault(__webpack_require__(367)); +function _load_constants() { + return _constants = __webpack_require__(8); } var _child; function _load_child() { - return _child = _interopRequireWildcard(__webpack_require__(58)); -} - -var _fs; - -function _load_fs() { - return _fs = _interopRequireWildcard(__webpack_require__(4)); + return _child = _interopRequireWildcard(__webpack_require__(50)); } -var _validate; +var _constants2; -function _load_validate() { - return _validate = _interopRequireWildcard(__webpack_require__(125)); +function _load_constants2() { + return _constants2 = __webpack_require__(8); } function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } -const objectPath = __webpack_require__(304); +const invariant = __webpack_require__(9); const path = __webpack_require__(0); -const yn = __webpack_require__(962); - -function setFlags(commander) { - commander.description('Interactively creates or updates a package.json file.'); - commander.option('-y, --yes', 'use default options'); - commander.option('-p, --private', 'use default options and private true'); -} +const os = __webpack_require__(46); +const semver = __webpack_require__(22); function hasWrapper(commander, args) { return true; } -const shouldRunInCurrentCwd = exports.shouldRunInCurrentCwd = true; +var _buildSubCommands = (0, (_buildSubCommands2 || _load_buildSubCommands()).default)('workspaces', { + info(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield info(config, reporter, flags, args); + })(); + }, + run(config, reporter, flags, args) { + return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () { + yield runScript(config, reporter, flags, args); + })(); + } +}); + +const run = _buildSubCommands.run, + setFlags = _buildSubCommands.setFlags, + examples = _buildSubCommands.examples; +exports.run = run; +exports.setFlags = setFlags; +exports.examples = examples; /***/ }), -/* 535 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - +/* WEBPACK VAR INJECTION */(function(module) { Object.defineProperty(exports, "__esModule", { value: true }); -exports.examples = exports.run = undefined; +exports.autoRun = exports.main = undefined; var _extends2; function _load_extends() { - return _extends2 = _interopRequireDefault(__webpack_require__(22)); + return _extends2 = _interopRequireDefault(__webpack_require__(20)); } var _asyncToGenerator2; @@ -97209,573 +96059,827 @@ function _load_asyncToGenerator() { return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2)); } -let getManifests = (() => { - var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags) { - const lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.cwd); - const install = new (_install || _load_install()).Install((0, (_extends2 || _load_extends()).default)({ skipIntegrityCheck: true }, flags), config, new (_baseReporter || _load_baseReporter()).default(), lockfile); - yield install.hydrate(true); +let main = exports.main = (() => { + var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* ({ + startArgs, + args, + endArgs + }) { + const collect = function collect(val, acc) { + acc.push(val); + return acc; + }; - let manifests = install.resolver.getManifests(); + (0, (_loudRejection || _load_loudRejection()).default)(); + (0, (_signalHandler || _load_signalHandler()).default)(); - // sort by name - manifests = manifests.sort(function (a, b) { - if (!a.name && !b.name) { - return 0; - } + // set global options + (_commander || _load_commander()).default.version((_yarnVersion || _load_yarnVersion()).version, '-v, --version'); + (_commander || _load_commander()).default.usage('[command] [flags]'); + (_commander || _load_commander()).default.option('--no-default-rc', 'prevent Yarn from automatically detecting yarnrc and npmrc files'); + (_commander || _load_commander()).default.option('--use-yarnrc ', 'specifies a yarnrc file that Yarn should use (.yarnrc only, not .npmrc)', collect, []); + (_commander || _load_commander()).default.option('--verbose', 'output verbose messages on internal operations'); + (_commander || _load_commander()).default.option('--offline', 'trigger an error if any required dependencies are not available in local cache'); + (_commander || _load_commander()).default.option('--prefer-offline', 'use network only if dependencies are not available in local cache'); + (_commander || _load_commander()).default.option('--enable-pnp, --pnp', "enable the Plug'n'Play installation"); + (_commander || _load_commander()).default.option('--disable-pnp', "disable the Plug'n'Play installation"); + (_commander || _load_commander()).default.option('--strict-semver'); + (_commander || _load_commander()).default.option('--json', 'format Yarn log messages as lines of JSON (see jsonlines.org)'); + (_commander || _load_commander()).default.option('--ignore-scripts', "don't run lifecycle scripts"); + (_commander || _load_commander()).default.option('--har', 'save HAR output of network traffic'); + (_commander || _load_commander()).default.option('--ignore-platform', 'ignore platform checks'); + (_commander || _load_commander()).default.option('--ignore-engines', 'ignore engines check'); + (_commander || _load_commander()).default.option('--ignore-optional', 'ignore optional dependencies'); + (_commander || _load_commander()).default.option('--force', 'install and build packages even if they were built before, overwrite lockfile'); + (_commander || _load_commander()).default.option('--skip-integrity-check', 'run install without checking if node_modules is installed'); + (_commander || _load_commander()).default.option('--check-files', 'install will verify file tree of packages for consistency'); + (_commander || _load_commander()).default.option('--no-bin-links', "don't generate bin links when setting up packages"); + (_commander || _load_commander()).default.option('--flat', 'only allow one version of a package'); + (_commander || _load_commander()).default.option('--prod, --production [prod]', '', (_conversion || _load_conversion()).boolify); + (_commander || _load_commander()).default.option('--no-lockfile', "don't read or generate a lockfile"); + (_commander || _load_commander()).default.option('--pure-lockfile', "don't generate a lockfile"); + (_commander || _load_commander()).default.option('--frozen-lockfile', "don't generate a lockfile and fail if an update is needed"); + (_commander || _load_commander()).default.option('--update-checksums', 'update package checksums from current repository'); + (_commander || _load_commander()).default.option('--link-duplicates', 'create hardlinks to the repeated modules in node_modules'); + (_commander || _load_commander()).default.option('--link-folder ', 'specify a custom folder to store global links'); + (_commander || _load_commander()).default.option('--global-folder ', 'specify a custom folder to store global packages'); + (_commander || _load_commander()).default.option('--modules-folder ', 'rather than installing modules into the node_modules folder relative to the cwd, output them here'); + (_commander || _load_commander()).default.option('--preferred-cache-folder ', 'specify a custom folder to store the yarn cache if possible'); + (_commander || _load_commander()).default.option('--cache-folder ', 'specify a custom folder that must be used to store the yarn cache'); + (_commander || _load_commander()).default.option('--mutex [:specifier]', 'use a mutex to ensure only one yarn instance is executing'); + (_commander || _load_commander()).default.option('--emoji [bool]', 'enable emoji in output', (_conversion || _load_conversion()).boolify, process.platform === 'darwin' || process.env.TERM_PROGRAM === 'Hyper' || process.env.TERM_PROGRAM === 'HyperTerm' || process.env.TERM_PROGRAM === 'Terminus'); + (_commander || _load_commander()).default.option('-s, --silent', 'skip Yarn console logs, other types of logs (script output) will be printed'); + (_commander || _load_commander()).default.option('--cwd ', 'working directory to use', process.cwd()); + (_commander || _load_commander()).default.option('--proxy ', ''); + (_commander || _load_commander()).default.option('--https-proxy ', ''); + (_commander || _load_commander()).default.option('--registry ', 'override configuration registry'); + (_commander || _load_commander()).default.option('--no-progress', 'disable progress bar'); + (_commander || _load_commander()).default.option('--network-concurrency ', 'maximum number of concurrent network requests', parseInt); + (_commander || _load_commander()).default.option('--network-timeout ', 'TCP timeout for network requests', parseInt); + (_commander || _load_commander()).default.option('--non-interactive', 'do not show interactive prompts'); + (_commander || _load_commander()).default.option('--scripts-prepend-node-path [bool]', 'prepend the node executable dir to the PATH in scripts', (_conversion || _load_conversion()).boolify); + (_commander || _load_commander()).default.option('--no-node-version-check', 'do not warn when using a potentially unsupported Node version'); + (_commander || _load_commander()).default.option('--focus', 'Focus on a single workspace by installing remote copies of its sibling workspaces.'); + (_commander || _load_commander()).default.option('--otp ', 'one-time password for two factor authentication'); - if (!a.name) { - return 1; - } + // if -v is the first command, then always exit after returning the version + if (args[0] === '-v') { + console.log((_yarnVersion || _load_yarnVersion()).version.trim()); + process.exitCode = 0; + return; + } - if (!b.name) { - return -1; - } + // get command name + const firstNonFlagIndex = args.findIndex(function (arg, idx, arr) { + const isOption = arg.startsWith('-'); + const prev = idx > 0 && arr[idx - 1]; + const prevOption = prev && prev.startsWith('-') && (_commander || _load_commander()).default.optionFor(prev); + const boundToPrevOption = prevOption && (prevOption.optional || prevOption.required); - return a.name.localeCompare(b.name); + return !isOption && !boundToPrevOption; }); + let preCommandArgs; + let commandName = ''; + if (firstNonFlagIndex > -1) { + preCommandArgs = args.slice(0, firstNonFlagIndex); + commandName = args[firstNonFlagIndex]; + args = args.slice(firstNonFlagIndex + 1); + } else { + preCommandArgs = args; + args = []; + } - // filter ignored manifests - manifests = manifests.filter(function (manifest) { - const ref = manifest._reference; - return !!ref && !ref.ignore; - }); + let isKnownCommand = Object.prototype.hasOwnProperty.call((_index3 || _load_index3()).default, commandName); + const isHelp = function isHelp(arg) { + return arg === '--help' || arg === '-h'; + }; + const helpInPre = preCommandArgs.findIndex(isHelp); + const helpInArgs = args.findIndex(isHelp); + const setHelpMode = function setHelpMode() { + if (isKnownCommand) { + args.unshift(commandName); + } + commandName = 'help'; + isKnownCommand = true; + }; - return manifests; - }); + if (helpInPre > -1) { + preCommandArgs.splice(helpInPre); + setHelpMode(); + } else if (isKnownCommand && helpInArgs === 0) { + args.splice(helpInArgs); + setHelpMode(); + } - return function getManifests(_x, _x2) { - return _ref.apply(this, arguments); - }; -})(); + if (!commandName) { + commandName = 'install'; + isKnownCommand = true; + } + if (commandName === 'set' && args[0] === 'version') { + commandName = 'policies'; + args.splice(0, 1, 'set-version'); + isKnownCommand = true; + } + if (!isKnownCommand) { + // if command is not recognized, then set default to `run` + args.unshift(commandName); + commandName = 'run'; + } + const command = (_index3 || _load_index3()).default[commandName]; -let list = (() => { - var _ref2 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) { - const manifests = yield getManifests(config, flags); - const manifestsByLicense = new Map(); + let warnAboutRunDashDash = false; + // we are using "yarn