diff --git a/.eslintrc b/.eslintrc
index 213b7eff..04e3e07c 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,15 +4,11 @@
"jsx": true,
"sourceType": "module",
"ecmaFeatures": {
- "jsx": true,
- "experimentalObjectRestSpread": true
+ "jsx": true
}
},
- "plugins": ["prettier"],
+ "plugins": ["prettier", "@typescript-eslint"],
"settings": {
- "react": {
- "version": "15.2"
- },
"import/resolver": {
"node": {
"extensions": [".js", ".ts", ".tsx"]
@@ -21,27 +17,85 @@
},
"env": {
"node": true,
- "amd": true,
"es6": true,
"jest": true
},
- "globals": {
- "window": true,
- "document": true,
- "console": true,
- "navigator": true,
- "alert": true,
- "Blob": true,
- "fetch": true,
- "FileReader": true,
- "Element": true,
- "AudioNode": true,
- "MutationObserver": true,
- "Image": true,
- "location": true
- },
"rules": {
"prettier/prettier": "error",
- "no-constant-binary-expression": "error"
+ "no-constant-binary-expression": "error",
+ "array-callback-return": "error",
+ "no-template-curly-in-string": "error",
+ "no-promise-executor-return": "error",
+ "no-constructor-return": "error",
+ "no-unsafe-optional-chaining": "error",
+ "block-scoped-var": "warn",
+ "camelcase": "error",
+ "constructor-super": "error",
+ "dot-notation": "error",
+ "eqeqeq": ["error", "smart"],
+ "guard-for-in": "error",
+ "max-depth": ["warn", 4],
+ "new-cap": "error",
+ "no-caller": "error",
+ "no-const-assign": "error",
+ "no-debugger": "error",
+ "no-delete-var": "error",
+ "no-div-regex": "warn",
+ "no-dupe-args": "error",
+ "no-dupe-class-members": "error",
+ "no-dupe-keys": "error",
+ "no-duplicate-case": "error",
+ "no-duplicate-imports": "error",
+ "no-else-return": "error",
+ "no-empty-character-class": "error",
+ "no-eval": "error",
+ "no-ex-assign": "error",
+ "no-extend-native": "warn",
+ "no-extra-boolean-cast": "error",
+ "no-extra-semi": "error",
+ "no-fallthrough": "error",
+ "no-func-assign": "error",
+ "no-implied-eval": "error",
+ "no-inner-declarations": "error",
+ "no-irregular-whitespace": "error",
+ "no-label-var": "error",
+ "no-labels": "error",
+ "no-lone-blocks": "error",
+ "no-lonely-if": "error",
+ "no-multi-str": "error",
+ "no-nested-ternary": "warn",
+ "no-new-object": "error",
+ "no-new-symbol": "error",
+ "no-new-wrappers": "error",
+ "no-obj-calls": "error",
+ "no-octal": "error",
+ "no-octal-escape": "error",
+ "no-proto": "error",
+ "no-redeclare": "error",
+ "no-shadow": "warn",
+ "no-this-before-super": "error",
+ "no-throw-literal": "error",
+ "no-undef-init": "error",
+ "no-unneeded-ternary": "error",
+ "no-unreachable": "error",
+ "no-unused-expressions": "error",
+ "no-useless-rename": "error",
+ "no-var": "error",
+ "no-with": "error",
+ "prefer-arrow-callback": "warn",
+ "prefer-const": "error",
+ "prefer-spread": "error",
+ "prefer-template": "warn",
+ "radix": "error",
+ "use-isnan": "error",
+ "valid-typeof": "error",
+ "@typescript-eslint/no-unused-vars": [
+ "warn",
+ {
+ "argsIgnorePattern": "^_",
+ "varsIgnorePattern": "^_",
+ "caughtErrorsIgnorePattern": "^_"
+ }
+ ]
}
}
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index cb049977..5d6a8a2e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,85 +1,125 @@
name: CI
-on: [push]
+on:
+ push:
+ pull_request:
jobs:
- build-and-test:
+ # Main CI job - using Turborepo for dependency management
+ ci:
runs-on: ubuntu-latest
-
- strategy:
- matrix:
- node-version: [20.x]
-
steps:
- - uses: actions/checkout@v2
- - name: Use Node.js ${{ matrix.node-version }}
- uses: actions/setup-node@v2
+ - uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
with:
- node-version: ${{ matrix.node-version }}
+ version: 9.12.0
+ - name: Use Node.js 20.x
+ uses: actions/setup-node@v4
+ with:
+ node-version: 20.x
+ cache: "pnpm"
- name: Install Dependencies
- run: yarn install --frozen-lockfile
- - name: Build
+ run: pnpm install --frozen-lockfile
+ - name: Build all packages
run: |
- yarn workspace ani-cursor build
- yarn workspace webamp build
- yarn workspace webamp build-library
- - name: Lint
+ npx turbo build build-library
+ env:
+ NODE_ENV: production
+ - name: Lint and type-check
run: |
- yarn lint
- yarn workspace webamp type-check
- - name: Run Unit Tests
+ npx turbo lint type-check
+ - name: Validate Grats generated files are up-to-date
+ run: ./scripts/validate-grats.sh
+ - name: Run tests
run: |
- touch packages/skin-database/config.js
- yarn test
- yarn workspace webamp test
- # - name: Run Integration Tests
- # run: yarn workspace webamp integration-tests
- # env:
- # CI: true
- # - name: Upload Screenshot Diffs
- # if: failure()
- # uses: actions/upload-artifact@v4
- # with:
- # name: image_diffs
- # path: packages/webamp/js/__tests__/__image_snapshots__/__diff_output__/
- # - name: Generate New Screenshots
- # if: failure()
- # run: |
- # yarn workspace webamp integration-tests -u
- # - name: Upload New Screenshots
- # if: failure()
- # uses: actions/upload-artifact@v4
- # with:
- # name: new_images
- # path: packages/webamp/js/__tests__/__image_snapshots__/
- main-release:
- name: Publish to NPM
+ npx turbo test -- --maxWorkers=2
+ env:
+ NODE_ENV: test
+ - name: Cache build artifacts for release
+ uses: actions/cache@v4
+ with:
+ path: |
+ packages/ani-cursor/dist
+ packages/winamp-eqf/built
+ packages/webamp/built
+ key: release-artifacts-${{ github.sha }}
+ # Release job - publish packages to NPM
+ release:
+ name: Publish packages to NPM
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository == 'captbaritone/webamp'
- needs: [build-and-test]
+ needs: [ci]
+ permissions:
+ contents: read
+ id-token: write # Required for OIDC trusted publishing
steps:
- - uses: actions/checkout@v2
- - uses: actions/setup-node@v2
+ - uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
with:
+ version: 9.12.0
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 20.x
registry-url: https://registry.npmjs.org/
+ cache: "pnpm"
+ - name: Update npm to latest version
+ run: npm install -g npm@latest
- name: Install dependencies
- run: yarn install --frozen-lockfile
- - name: Set version
+ run: pnpm install --frozen-lockfile
+ - name: Restore build artifacts
+ uses: actions/cache@v4
+ with:
+ path: |
+ packages/ani-cursor/dist
+ packages/winamp-eqf/built
+ packages/webamp/built
+ key: release-artifacts-${{ github.sha }}
+ fail-on-cache-miss: true
+ - name: Set version for all packages
if: github.ref == 'refs/heads/master'
run: |
echo "Setting version to 0.0.0-next-${RELEASE_COMMIT_SHA::7}"
- yarn workspace webamp version --new-version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
+ cd packages/webamp && npm version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
+ cd ../ani-cursor && npm version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
+ cd ../winamp-eqf && npm version 0.0.0-next-${RELEASE_COMMIT_SHA::7} --no-git-tag-version
env:
RELEASE_COMMIT_SHA: ${{ github.sha }}
- - name: Build release version
+ - name: Set version for tagged release
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
- run: exit 1 # TODO: Script to update version number in webampLazy.tsx
- - name: Publish to npm
- working-directory: ./packages/webamp
- if: github.ref == 'refs/heads/master' || github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
- # Note: This also triggers a build
run: |
- npm publish ${TAG}
- env:
- TAG: ${{ github.ref == 'refs/heads/master' && '--tag=next' || ''}}
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
+ VERSION=${GITHUB_REF_NAME#v}
+ echo "Setting version to $VERSION for tagged release"
+ cd packages/webamp && npm version $VERSION --no-git-tag-version
+ cd ../ani-cursor && npm version $VERSION --no-git-tag-version
+ cd ../winamp-eqf && npm version $VERSION --no-git-tag-version
+ # TODO: Update version number in webampLazy.tsx if needed
+ - name: Publish ani-cursor to npm
+ working-directory: ./packages/ani-cursor
+ if: github.ref == 'refs/heads/master' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
+ run: |
+ if [ "${{ github.ref }}" = "refs/heads/master" ]; then
+ npm publish --tag=next --ignore-scripts --provenance
+ else
+ npm publish --ignore-scripts --provenance
+ fi
+ - name: Publish winamp-eqf to npm
+ working-directory: ./packages/winamp-eqf
+ if: github.ref == 'refs/heads/master' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
+ run: |
+ if [ "${{ github.ref }}" = "refs/heads/master" ]; then
+ npm publish --tag=next --ignore-scripts --provenance
+ else
+ npm publish --ignore-scripts --provenance
+ fi
+ - name: Publish webamp to npm
+ working-directory: ./packages/webamp
+ if: github.ref == 'refs/heads/master' || (github.ref_type == 'tag' && startsWith(github.ref_name, 'v'))
+ # Use pre-built artifacts instead of rebuilding
+ run: |
+ if [ "${{ github.ref }}" = "refs/heads/master" ]; then
+ npm publish --tag=next --ignore-scripts --provenance
+ else
+ npm publish --ignore-scripts --provenance
+ fi
diff --git a/.github/workflows/code-size.yml b/.github/workflows/code-size.yml
index 338a24a1..e86aac99 100644
--- a/.github/workflows/code-size.yml
+++ b/.github/workflows/code-size.yml
@@ -4,13 +4,23 @@ on: [pull_request]
jobs:
build:
-
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v2
- - uses: preactjs/compressed-size-action@v2
- with:
- repo-token: "${{ secrets.GITHUB_TOKEN }}"
- build-script: "deploy"
- pattern: "./packages/webamp/built/*bundle.min.js"
\ No newline at end of file
+ - uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 9.12.0
+ - name: Use Node.js 22.x
+ uses: actions/setup-node@v4
+ with:
+ node-version: 22.x
+ cache: "pnpm"
+ - name: Install Dependencies
+ run: pnpm install --frozen-lockfile
+ - uses: preactjs/compressed-size-action@v2
+ with:
+ repo-token: "${{ secrets.GITHUB_TOKEN }}"
+ build-script: "deploy"
+ pattern: "./packages/webamp/built/*bundle.min.js"
diff --git a/.github/workflows/ia-integration-tests.yml b/.github/workflows/ia-integration-tests.yml
deleted file mode 100644
index 4c6d4c7d..00000000
--- a/.github/workflows/ia-integration-tests.yml
+++ /dev/null
@@ -1,29 +0,0 @@
-name: "Internet Archive Integration Tests"
-
-on:
- workflow_dispatch:
-# push:
-# schedule:
-# - cron: "0 8 * * *"
-
-jobs:
- ia-tests:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v1
- - name: Use Node.js
- uses: actions/setup-node@v1
- with:
- node-version: 12.x
- - name: Run Tests
- run: |
- cd packages/archive-org-webamp-integration-tests
- yarn
- node ./index.js
- env:
- CI: true
- - uses: actions/upload-artifact@v1
- if: failure()
- with:
- name: error
- path: packages/webamp/experiments/archive-org-integration-tests/error.png
diff --git a/.gitignore b/.gitignore
index a876d52e..0f1fe805 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
node_modules
.vscode
-.parcel-cache
+.idea
dist
-parcel-bundle-reports
\ No newline at end of file
+
+# Turborepo cache
+.turbo
\ No newline at end of file
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 00000000..2bd5a0a9
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+22
diff --git a/.parcelrc b/.parcelrc
deleted file mode 100644
index 47d1b5e3..00000000
--- a/.parcelrc
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "extends": "@parcel/config-default"
-}
diff --git a/.yarn/releases/yarn-1.22.10.cjs b/.yarn/releases/yarn-1.22.10.cjs
deleted file mode 100755
index 6418ae5d..00000000
--- a/.yarn/releases/yarn-1.22.10.cjs
+++ /dev/null
@@ -1,147392 +0,0 @@
-#!/usr/bin/env node
-module.exports =
-/******/ (function(modules) { // webpackBootstrap
-/******/ // The module cache
-/******/ var installedModules = {};
-/******/
-/******/ // The require function
-/******/ function __webpack_require__(moduleId) {
-/******/
-/******/ // Check if module is in cache
-/******/ if(installedModules[moduleId]) {
-/******/ return installedModules[moduleId].exports;
-/******/ }
-/******/ // Create a new module (and put it into the cache)
-/******/ var module = installedModules[moduleId] = {
-/******/ i: moduleId,
-/******/ l: false,
-/******/ exports: {}
-/******/ };
-/******/
-/******/ // Execute the module function
-/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
-/******/
-/******/ // Flag the module as loaded
-/******/ module.l = true;
-/******/
-/******/ // Return the exports of the module
-/******/ return module.exports;
-/******/ }
-/******/
-/******/
-/******/ // expose the modules object (__webpack_modules__)
-/******/ __webpack_require__.m = modules;
-/******/
-/******/ // expose the module cache
-/******/ __webpack_require__.c = installedModules;
-/******/
-/******/ // identity function for calling harmony imports with the correct context
-/******/ __webpack_require__.i = function(value) { return value; };
-/******/
-/******/ // define getter function for harmony exports
-/******/ __webpack_require__.d = function(exports, name, getter) {
-/******/ if(!__webpack_require__.o(exports, name)) {
-/******/ Object.defineProperty(exports, name, {
-/******/ configurable: false,
-/******/ enumerable: true,
-/******/ get: getter
-/******/ });
-/******/ }
-/******/ };
-/******/
-/******/ // getDefaultExport function for compatibility with non-harmony modules
-/******/ __webpack_require__.n = function(module) {
-/******/ var getter = module && module.__esModule ?
-/******/ function getDefault() { return module['default']; } :
-/******/ function getModuleExports() { return module; };
-/******/ __webpack_require__.d(getter, 'a', getter);
-/******/ return getter;
-/******/ };
-/******/
-/******/ // Object.prototype.hasOwnProperty.call
-/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
-/******/
-/******/ // __webpack_public_path__
-/******/ __webpack_require__.p = "";
-/******/
-/******/ // Load entry module and return exports
-/******/ return __webpack_require__(__webpack_require__.s = 549);
-/******/ })
-/************************************************************************/
-/******/ ([
-/* 0 */
-/***/ (function(module, exports) {
-
-module.exports = require("path");
-
-/***/ }),
-/* 1 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = __extends;
-/* unused harmony export __assign */
-/* unused harmony export __rest */
-/* unused harmony export __decorate */
-/* unused harmony export __param */
-/* unused harmony export __metadata */
-/* unused harmony export __awaiter */
-/* unused harmony export __generator */
-/* unused harmony export __exportStar */
-/* unused harmony export __values */
-/* unused harmony export __read */
-/* unused harmony export __spread */
-/* unused harmony export __await */
-/* unused harmony export __asyncGenerator */
-/* unused harmony export __asyncDelegator */
-/* unused harmony export __asyncValues */
-/* 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 };
-}
-
-
-/***/ }),
-/* 2 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-exports.__esModule = true;
-
-var _promise = __webpack_require__(227);
-
-var _promise2 = _interopRequireDefault(_promise);
-
-function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
-
-exports.default = function (fn) {
- return function () {
- var gen = fn.apply(this, arguments);
- return new _promise2.default(function (resolve, reject) {
- function step(key, arg) {
- try {
- var info = gen[key](arg);
- var value = info.value;
- } catch (error) {
- reject(error);
- return;
- }
-
- if (info.done) {
- resolve(value);
- } else {
- return _promise2.default.resolve(value).then(function (value) {
- step("next", value);
- }, function (err) {
- step("throw", err);
- });
- }
- }
-
- return step("next");
- });
- };
-};
-
-/***/ }),
-/* 3 */
-/***/ (function(module, exports) {
-
-module.exports = require("util");
-
-/***/ }),
-/* 4 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.getFirstSuitableFolder = exports.readFirstAvailableStream = exports.makeTempDir = exports.hardlinksWork = exports.writeFilePreservingEol = exports.getFileSizeOnDisk = exports.walk = exports.symlink = exports.find = exports.readJsonAndFile = exports.readJson = exports.readFileAny = exports.hardlinkBulk = exports.copyBulk = exports.unlink = exports.glob = exports.link = exports.chmod = exports.lstat = exports.exists = exports.mkdirp = exports.stat = exports.access = exports.rename = exports.readdir = exports.realpath = exports.readlink = exports.writeFile = exports.open = exports.readFileBuffer = exports.lockQueue = exports.constants = undefined;
-
-var _asyncToGenerator2;
-
-function _load_asyncToGenerator() {
- return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
-}
-
-let buildActionsForCopy = (() => {
- var _ref = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
-
- //
- let build = (() => {
- var _ref5 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
- const src = data.src,
- dest = data.dest,
- type = data.type;
-
- const onFresh = data.onFresh || noop;
- const onDone = data.onDone || noop;
-
- // TODO https://github.com/yarnpkg/yarn/issues/3751
- // related to bundled dependencies handling
- if (files.has(dest.toLowerCase())) {
- reporter.verbose(`The case-insensitive file ${dest} shouldn't be copied twice in one bulk copy`);
- } else {
- files.add(dest.toLowerCase());
- }
-
- if (type === 'symlink') {
- yield mkdirp((_path || _load_path()).default.dirname(dest));
- onFresh();
- actions.symlink.push({
- dest,
- linkname: src
- });
- onDone();
- return;
- }
-
- if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) {
- // ignored file
- return;
- }
-
- const srcStat = yield lstat(src);
- let srcFiles;
-
- if (srcStat.isDirectory()) {
- srcFiles = yield readdir(src);
- }
-
- let destStat;
- try {
- // try accessing the destination
- destStat = yield lstat(dest);
- } catch (e) {
- // proceed if destination doesn't exist, otherwise error
- if (e.code !== 'ENOENT') {
- throw e;
- }
- }
-
- // if destination exists
- if (destStat) {
- const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
- const bothFolders = srcStat.isDirectory() && destStat.isDirectory();
- const bothFiles = srcStat.isFile() && destStat.isFile();
-
- // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
- // us modes that aren't valid. investigate this, it's generally safe to proceed.
-
- /* if (srcStat.mode !== destStat.mode) {
- try {
- await access(dest, srcStat.mode);
- } catch (err) {}
- } */
-
- if (bothFiles && artifactFiles.has(dest)) {
- // this file gets changed during build, likely by a custom install script. Don't bother checking it.
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
- return;
- }
-
- if (bothFiles && srcStat.size === destStat.size && (0, (_fsNormalized || _load_fsNormalized()).fileDatesEqual)(srcStat.mtime, destStat.mtime)) {
- // we can safely assume this is the same file
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.size, +srcStat.mtime));
- return;
- }
-
- if (bothSymlinks) {
- const srcReallink = yield readlink(src);
- if (srcReallink === (yield readlink(dest))) {
- // if both symlinks are the same then we can continue on
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
- return;
- }
- }
-
- if (bothFolders) {
- // mark files that aren't in this folder as possibly extraneous
- const destFiles = yield readdir(dest);
- invariant(srcFiles, 'src files not initialised');
-
- for (var _iterator4 = destFiles, _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref6;
-
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref6 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref6 = _i4.value;
- }
-
- const file = _ref6;
-
- if (srcFiles.indexOf(file) < 0) {
- const loc = (_path || _load_path()).default.join(dest, file);
- possibleExtraneous.add(loc);
-
- if ((yield lstat(loc)).isDirectory()) {
- for (var _iterator5 = yield readdir(loc), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref7;
-
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref7 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref7 = _i5.value;
- }
-
- const file = _ref7;
-
- possibleExtraneous.add((_path || _load_path()).default.join(loc, file));
- }
- }
- }
- }
- }
- }
-
- if (destStat && destStat.isSymbolicLink()) {
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
- destStat = null;
- }
-
- if (srcStat.isSymbolicLink()) {
- onFresh();
- const linkname = yield readlink(src);
- actions.symlink.push({
- dest,
- linkname
- });
- onDone();
- } else if (srcStat.isDirectory()) {
- if (!destStat) {
- reporter.verbose(reporter.lang('verboseFileFolder', dest));
- yield mkdirp(dest);
- }
-
- const destParts = dest.split((_path || _load_path()).default.sep);
- while (destParts.length) {
- files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase());
- destParts.pop();
- }
-
- // push all files to queue
- invariant(srcFiles, 'src files not initialised');
- let remaining = srcFiles.length;
- if (!remaining) {
- onDone();
- }
- for (var _iterator6 = srcFiles, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref8;
-
- if (_isArray6) {
- if (_i6 >= _iterator6.length) break;
- _ref8 = _iterator6[_i6++];
- } else {
- _i6 = _iterator6.next();
- if (_i6.done) break;
- _ref8 = _i6.value;
- }
-
- const file = _ref8;
-
- queue.push({
- dest: (_path || _load_path()).default.join(dest, file),
- onFresh,
- onDone: function (_onDone) {
- function onDone() {
- return _onDone.apply(this, arguments);
- }
-
- onDone.toString = function () {
- return _onDone.toString();
- };
-
- return onDone;
- }(function () {
- if (--remaining === 0) {
- onDone();
- }
- }),
- src: (_path || _load_path()).default.join(src, file)
- });
- }
- } else if (srcStat.isFile()) {
- onFresh();
- actions.file.push({
- src,
- dest,
- atime: srcStat.atime,
- mtime: srcStat.mtime,
- mode: srcStat.mode
- });
- onDone();
- } else {
- throw new Error(`unsure how to copy this: ${src}`);
- }
- });
-
- return function build(_x5) {
- return _ref5.apply(this, arguments);
- };
- })();
-
- const artifactFiles = new Set(events.artifactFiles || []);
- const files = new Set();
-
- // initialise events
- for (var _iterator = queue, _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 item = _ref2;
-
- const onDone = item.onDone;
- item.onDone = function () {
- events.onProgress(item.dest);
- if (onDone) {
- onDone();
- }
- };
- }
- events.onStart(queue.length);
-
- // start building actions
- const actions = {
- file: [],
- symlink: [],
- link: []
- };
-
- // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
- // at a time due to the requirement to push items onto the queue
- while (queue.length) {
- const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
- yield Promise.all(items.map(build));
- }
-
- // simulate the existence of some files to prevent considering them extraneous
- for (var _iterator2 = artifactFiles, _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 {
- _i2 = _iterator2.next();
- if (_i2.done) break;
- _ref3 = _i2.value;
- }
-
- const file = _ref3;
-
- if (possibleExtraneous.has(file)) {
- reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file));
- possibleExtraneous.delete(file);
- }
- }
-
- for (var _iterator3 = possibleExtraneous, _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 loc = _ref4;
-
- if (files.has(loc.toLowerCase())) {
- possibleExtraneous.delete(loc);
- }
- }
-
- return actions;
- });
-
- return function buildActionsForCopy(_x, _x2, _x3, _x4) {
- return _ref.apply(this, arguments);
- };
-})();
-
-let buildActionsForHardlink = (() => {
- var _ref9 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, events, possibleExtraneous, reporter) {
-
- //
- let build = (() => {
- var _ref13 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
- const src = data.src,
- dest = data.dest;
-
- const onFresh = data.onFresh || noop;
- const onDone = data.onDone || noop;
- if (files.has(dest.toLowerCase())) {
- // Fixes issue https://github.com/yarnpkg/yarn/issues/2734
- // When bulk hardlinking we have A -> B structure that we want to hardlink to A1 -> B1,
- // package-linker passes that modules A1 and B1 need to be hardlinked,
- // the recursive linking algorithm of A1 ends up scheduling files in B1 to be linked twice which will case
- // an exception.
- onDone();
- return;
- }
- files.add(dest.toLowerCase());
-
- if (events.ignoreBasenames.indexOf((_path || _load_path()).default.basename(src)) >= 0) {
- // ignored file
- return;
- }
-
- const srcStat = yield lstat(src);
- let srcFiles;
-
- if (srcStat.isDirectory()) {
- srcFiles = yield readdir(src);
- }
-
- const destExists = yield exists(dest);
- if (destExists) {
- const destStat = yield lstat(dest);
-
- const bothSymlinks = srcStat.isSymbolicLink() && destStat.isSymbolicLink();
- const bothFolders = srcStat.isDirectory() && destStat.isDirectory();
- const bothFiles = srcStat.isFile() && destStat.isFile();
-
- if (srcStat.mode !== destStat.mode) {
- try {
- yield access(dest, srcStat.mode);
- } catch (err) {
- // EINVAL access errors sometimes happen which shouldn't because node shouldn't be giving
- // us modes that aren't valid. investigate this, it's generally safe to proceed.
- reporter.verbose(err);
- }
- }
-
- if (bothFiles && artifactFiles.has(dest)) {
- // this file gets changed during build, likely by a custom install script. Don't bother checking it.
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkipArtifact', src));
- return;
- }
-
- // correct hardlink
- if (bothFiles && srcStat.ino !== null && srcStat.ino === destStat.ino) {
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkip', src, dest, srcStat.ino));
- return;
- }
-
- if (bothSymlinks) {
- const srcReallink = yield readlink(src);
- if (srcReallink === (yield readlink(dest))) {
- // if both symlinks are the same then we can continue on
- onDone();
- reporter.verbose(reporter.lang('verboseFileSkipSymlink', src, dest, srcReallink));
- return;
- }
- }
-
- if (bothFolders) {
- // mark files that aren't in this folder as possibly extraneous
- const destFiles = yield readdir(dest);
- invariant(srcFiles, 'src files not initialised');
-
- for (var _iterator10 = destFiles, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
- var _ref14;
-
- if (_isArray10) {
- if (_i10 >= _iterator10.length) break;
- _ref14 = _iterator10[_i10++];
- } else {
- _i10 = _iterator10.next();
- if (_i10.done) break;
- _ref14 = _i10.value;
- }
-
- const file = _ref14;
-
- if (srcFiles.indexOf(file) < 0) {
- const loc = (_path || _load_path()).default.join(dest, file);
- possibleExtraneous.add(loc);
-
- if ((yield lstat(loc)).isDirectory()) {
- for (var _iterator11 = yield readdir(loc), _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
- var _ref15;
-
- if (_isArray11) {
- if (_i11 >= _iterator11.length) break;
- _ref15 = _iterator11[_i11++];
- } else {
- _i11 = _iterator11.next();
- if (_i11.done) break;
- _ref15 = _i11.value;
- }
-
- const file = _ref15;
-
- possibleExtraneous.add((_path || _load_path()).default.join(loc, file));
- }
- }
- }
- }
- }
- }
-
- if (srcStat.isSymbolicLink()) {
- onFresh();
- const linkname = yield readlink(src);
- actions.symlink.push({
- dest,
- linkname
- });
- onDone();
- } else if (srcStat.isDirectory()) {
- reporter.verbose(reporter.lang('verboseFileFolder', dest));
- yield mkdirp(dest);
-
- const destParts = dest.split((_path || _load_path()).default.sep);
- while (destParts.length) {
- files.add(destParts.join((_path || _load_path()).default.sep).toLowerCase());
- destParts.pop();
- }
-
- // push all files to queue
- invariant(srcFiles, 'src files not initialised');
- let remaining = srcFiles.length;
- if (!remaining) {
- onDone();
- }
- for (var _iterator12 = srcFiles, _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
- var _ref16;
-
- if (_isArray12) {
- if (_i12 >= _iterator12.length) break;
- _ref16 = _iterator12[_i12++];
- } else {
- _i12 = _iterator12.next();
- if (_i12.done) break;
- _ref16 = _i12.value;
- }
-
- const file = _ref16;
-
- queue.push({
- onFresh,
- src: (_path || _load_path()).default.join(src, file),
- dest: (_path || _load_path()).default.join(dest, file),
- onDone: function (_onDone2) {
- function onDone() {
- return _onDone2.apply(this, arguments);
- }
-
- onDone.toString = function () {
- return _onDone2.toString();
- };
-
- return onDone;
- }(function () {
- if (--remaining === 0) {
- onDone();
- }
- })
- });
- }
- } else if (srcStat.isFile()) {
- onFresh();
- actions.link.push({
- src,
- dest,
- removeDest: destExists
- });
- onDone();
- } else {
- throw new Error(`unsure how to copy this: ${src}`);
- }
- });
-
- return function build(_x10) {
- return _ref13.apply(this, arguments);
- };
- })();
-
- const artifactFiles = new Set(events.artifactFiles || []);
- const files = new Set();
-
- // initialise events
- for (var _iterator7 = queue, _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
- var _ref10;
-
- if (_isArray7) {
- if (_i7 >= _iterator7.length) break;
- _ref10 = _iterator7[_i7++];
- } else {
- _i7 = _iterator7.next();
- if (_i7.done) break;
- _ref10 = _i7.value;
- }
-
- const item = _ref10;
-
- const onDone = item.onDone || noop;
- item.onDone = function () {
- events.onProgress(item.dest);
- onDone();
- };
- }
- events.onStart(queue.length);
-
- // start building actions
- const actions = {
- file: [],
- symlink: [],
- link: []
- };
-
- // custom concurrency logic as we're always executing stacks of CONCURRENT_QUEUE_ITEMS queue items
- // at a time due to the requirement to push items onto the queue
- while (queue.length) {
- const items = queue.splice(0, CONCURRENT_QUEUE_ITEMS);
- yield Promise.all(items.map(build));
- }
-
- // simulate the existence of some files to prevent considering them extraneous
- for (var _iterator8 = artifactFiles, _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
- var _ref11;
-
- if (_isArray8) {
- if (_i8 >= _iterator8.length) break;
- _ref11 = _iterator8[_i8++];
- } else {
- _i8 = _iterator8.next();
- if (_i8.done) break;
- _ref11 = _i8.value;
- }
-
- const file = _ref11;
-
- if (possibleExtraneous.has(file)) {
- reporter.verbose(reporter.lang('verboseFilePhantomExtraneous', file));
- possibleExtraneous.delete(file);
- }
- }
-
- for (var _iterator9 = possibleExtraneous, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
- var _ref12;
-
- if (_isArray9) {
- if (_i9 >= _iterator9.length) break;
- _ref12 = _iterator9[_i9++];
- } else {
- _i9 = _iterator9.next();
- if (_i9.done) break;
- _ref12 = _i9.value;
- }
-
- const loc = _ref12;
-
- if (files.has(loc.toLowerCase())) {
- possibleExtraneous.delete(loc);
- }
- }
-
- return actions;
- });
-
- return function buildActionsForHardlink(_x6, _x7, _x8, _x9) {
- return _ref9.apply(this, arguments);
- };
-})();
-
-let copyBulk = exports.copyBulk = (() => {
- var _ref17 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
- const events = {
- onStart: _events && _events.onStart || noop,
- onProgress: _events && _events.onProgress || noop,
- possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
- ignoreBasenames: _events && _events.ignoreBasenames || [],
- artifactFiles: _events && _events.artifactFiles || []
- };
-
- const actions = yield buildActionsForCopy(queue, events, events.possibleExtraneous, reporter);
- events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
-
- const fileActions = actions.file;
-
- const currentlyWriting = new Map();
-
- yield (_promise || _load_promise()).queue(fileActions, (() => {
- var _ref18 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
- let writePromise;
- while (writePromise = currentlyWriting.get(data.dest)) {
- yield writePromise;
- }
-
- reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest));
- const copier = (0, (_fsNormalized || _load_fsNormalized()).copyFile)(data, function () {
- return currentlyWriting.delete(data.dest);
- });
- currentlyWriting.set(data.dest, copier);
- events.onProgress(data.dest);
- return copier;
- });
-
- return function (_x14) {
- return _ref18.apply(this, arguments);
- };
- })(), CONCURRENT_QUEUE_ITEMS);
-
- // we need to copy symlinks last as they could reference files we were copying
- const symlinkActions = actions.symlink;
- yield (_promise || _load_promise()).queue(symlinkActions, function (data) {
- const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname);
- reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
- return symlink(linkname, data.dest);
- });
- });
-
- return function copyBulk(_x11, _x12, _x13) {
- return _ref17.apply(this, arguments);
- };
-})();
-
-let hardlinkBulk = exports.hardlinkBulk = (() => {
- var _ref19 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (queue, reporter, _events) {
- const events = {
- onStart: _events && _events.onStart || noop,
- onProgress: _events && _events.onProgress || noop,
- possibleExtraneous: _events ? _events.possibleExtraneous : new Set(),
- artifactFiles: _events && _events.artifactFiles || [],
- ignoreBasenames: []
- };
-
- const actions = yield buildActionsForHardlink(queue, events, events.possibleExtraneous, reporter);
- events.onStart(actions.file.length + actions.symlink.length + actions.link.length);
-
- const fileActions = actions.link;
-
- yield (_promise || _load_promise()).queue(fileActions, (() => {
- var _ref20 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (data) {
- reporter.verbose(reporter.lang('verboseFileLink', data.src, data.dest));
- if (data.removeDest) {
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(data.dest);
- }
- yield link(data.src, data.dest);
- });
-
- return function (_x18) {
- return _ref20.apply(this, arguments);
- };
- })(), CONCURRENT_QUEUE_ITEMS);
-
- // we need to copy symlinks last as they could reference files we were copying
- const symlinkActions = actions.symlink;
- yield (_promise || _load_promise()).queue(symlinkActions, function (data) {
- const linkname = (_path || _load_path()).default.resolve((_path || _load_path()).default.dirname(data.dest), data.linkname);
- reporter.verbose(reporter.lang('verboseFileSymlink', data.dest, linkname));
- return symlink(linkname, data.dest);
- });
- });
-
- return function hardlinkBulk(_x15, _x16, _x17) {
- return _ref19.apply(this, arguments);
- };
-})();
-
-let readFileAny = exports.readFileAny = (() => {
- var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (files) {
- for (var _iterator13 = files, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) {
- var _ref22;
-
- if (_isArray13) {
- if (_i13 >= _iterator13.length) break;
- _ref22 = _iterator13[_i13++];
- } else {
- _i13 = _iterator13.next();
- if (_i13.done) break;
- _ref22 = _i13.value;
- }
-
- const file = _ref22;
-
- if (yield exists(file)) {
- return readFile(file);
- }
- }
- return null;
- });
-
- return function readFileAny(_x19) {
- return _ref21.apply(this, arguments);
- };
-})();
-
-let readJson = exports.readJson = (() => {
- var _ref23 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
- return (yield readJsonAndFile(loc)).object;
- });
-
- return function readJson(_x20) {
- return _ref23.apply(this, arguments);
- };
-})();
-
-let readJsonAndFile = exports.readJsonAndFile = (() => {
- var _ref24 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
- const file = yield readFile(loc);
- try {
- return {
- object: (0, (_map || _load_map()).default)(JSON.parse(stripBOM(file))),
- content: file
- };
- } catch (err) {
- err.message = `${loc}: ${err.message}`;
- throw err;
- }
- });
-
- return function readJsonAndFile(_x21) {
- return _ref24.apply(this, arguments);
- };
-})();
-
-let find = exports.find = (() => {
- var _ref25 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (filename, dir) {
- const parts = dir.split((_path || _load_path()).default.sep);
-
- while (parts.length) {
- const loc = parts.concat(filename).join((_path || _load_path()).default.sep);
-
- if (yield exists(loc)) {
- return loc;
- } else {
- parts.pop();
- }
- }
-
- return false;
- });
-
- return function find(_x22, _x23) {
- return _ref25.apply(this, arguments);
- };
-})();
-
-let symlink = exports.symlink = (() => {
- var _ref26 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (src, dest) {
- if (process.platform !== 'win32') {
- // use relative paths otherwise which will be retained if the directory is moved
- src = (_path || _load_path()).default.relative((_path || _load_path()).default.dirname(dest), src);
- // When path.relative returns an empty string for the current directory, we should instead use
- // '.', which is a valid fs.symlink target.
- src = src || '.';
- }
-
- try {
- const stats = yield lstat(dest);
- if (stats.isSymbolicLink()) {
- const resolved = dest;
- if (resolved === src) {
- return;
- }
- }
- } catch (err) {
- if (err.code !== 'ENOENT') {
- throw err;
- }
- }
-
- // We use rimraf for unlink which never throws an ENOENT on missing target
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dest);
-
- if (process.platform === 'win32') {
- // use directory junctions if possible on win32, this requires absolute paths
- yield fsSymlink(src, dest, 'junction');
- } else {
- yield fsSymlink(src, dest);
- }
- });
-
- return function symlink(_x24, _x25) {
- return _ref26.apply(this, arguments);
- };
-})();
-
-let walk = exports.walk = (() => {
- var _ref27 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir, relativeDir, ignoreBasenames = new Set()) {
- let files = [];
-
- let filenames = yield readdir(dir);
- if (ignoreBasenames.size) {
- filenames = filenames.filter(function (name) {
- return !ignoreBasenames.has(name);
- });
- }
-
- for (var _iterator14 = filenames, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
- var _ref28;
-
- if (_isArray14) {
- if (_i14 >= _iterator14.length) break;
- _ref28 = _iterator14[_i14++];
- } else {
- _i14 = _iterator14.next();
- if (_i14.done) break;
- _ref28 = _i14.value;
- }
-
- const name = _ref28;
-
- const relative = relativeDir ? (_path || _load_path()).default.join(relativeDir, name) : name;
- const loc = (_path || _load_path()).default.join(dir, name);
- const stat = yield lstat(loc);
-
- files.push({
- relative,
- basename: name,
- absolute: loc,
- mtime: +stat.mtime
- });
-
- if (stat.isDirectory()) {
- files = files.concat((yield walk(loc, relative, ignoreBasenames)));
- }
- }
-
- return files;
- });
-
- return function walk(_x26, _x27) {
- return _ref27.apply(this, arguments);
- };
-})();
-
-let getFileSizeOnDisk = exports.getFileSizeOnDisk = (() => {
- var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (loc) {
- const stat = yield lstat(loc);
- const size = stat.size,
- blockSize = stat.blksize;
-
-
- return Math.ceil(size / blockSize) * blockSize;
- });
-
- return function getFileSizeOnDisk(_x28) {
- return _ref29.apply(this, arguments);
- };
-})();
-
-let getEolFromFile = (() => {
- var _ref30 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path) {
- if (!(yield exists(path))) {
- return undefined;
- }
-
- const buffer = yield readFileBuffer(path);
-
- for (let i = 0; i < buffer.length; ++i) {
- if (buffer[i] === cr) {
- return '\r\n';
- }
- if (buffer[i] === lf) {
- return '\n';
- }
- }
- return undefined;
- });
-
- return function getEolFromFile(_x29) {
- return _ref30.apply(this, arguments);
- };
-})();
-
-let writeFilePreservingEol = exports.writeFilePreservingEol = (() => {
- var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (path, data) {
- const eol = (yield getEolFromFile(path)) || (_os || _load_os()).default.EOL;
- if (eol !== '\n') {
- data = data.replace(/\n/g, eol);
- }
- yield writeFile(path, data);
- });
-
- return function writeFilePreservingEol(_x30, _x31) {
- return _ref31.apply(this, arguments);
- };
-})();
-
-let hardlinksWork = exports.hardlinksWork = (() => {
- var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (dir) {
- const filename = 'test-file' + Math.random();
- const file = (_path || _load_path()).default.join(dir, filename);
- const fileLink = (_path || _load_path()).default.join(dir, filename + '-link');
- try {
- yield writeFile(file, 'test');
- yield link(file, fileLink);
- } catch (err) {
- return false;
- } finally {
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(file);
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(fileLink);
- }
- return true;
- });
-
- return function hardlinksWork(_x32) {
- return _ref32.apply(this, arguments);
- };
-})();
-
-// not a strict polyfill for Node's fs.mkdtemp
-
-
-let makeTempDir = exports.makeTempDir = (() => {
- var _ref33 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (prefix) {
- const dir = (_path || _load_path()).default.join((_os || _load_os()).default.tmpdir(), `yarn-${prefix || ''}-${Date.now()}-${Math.random()}`);
- yield (0, (_fsNormalized || _load_fsNormalized()).unlink)(dir);
- yield mkdirp(dir);
- return dir;
- });
-
- return function makeTempDir(_x33) {
- return _ref33.apply(this, arguments);
- };
-})();
-
-let readFirstAvailableStream = exports.readFirstAvailableStream = (() => {
- var _ref34 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths) {
- for (var _iterator15 = paths, _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) {
- var _ref35;
-
- if (_isArray15) {
- if (_i15 >= _iterator15.length) break;
- _ref35 = _iterator15[_i15++];
- } else {
- _i15 = _iterator15.next();
- if (_i15.done) break;
- _ref35 = _i15.value;
- }
-
- const path = _ref35;
-
- try {
- const fd = yield open(path, 'r');
- return (_fs || _load_fs()).default.createReadStream(path, { fd });
- } catch (err) {
- // Try the next one
- }
- }
- return null;
- });
-
- return function readFirstAvailableStream(_x34) {
- return _ref34.apply(this, arguments);
- };
-})();
-
-let getFirstSuitableFolder = exports.getFirstSuitableFolder = (() => {
- var _ref36 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (paths, mode = constants.W_OK | constants.X_OK) {
- const result = {
- skipped: [],
- folder: null
- };
-
- for (var _iterator16 = paths, _isArray16 = Array.isArray(_iterator16), _i16 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
- var _ref37;
-
- if (_isArray16) {
- if (_i16 >= _iterator16.length) break;
- _ref37 = _iterator16[_i16++];
- } else {
- _i16 = _iterator16.next();
- if (_i16.done) break;
- _ref37 = _i16.value;
- }
-
- const folder = _ref37;
-
- try {
- yield mkdirp(folder);
- yield access(folder, mode);
-
- result.folder = folder;
-
- return result;
- } catch (error) {
- result.skipped.push({
- error,
- folder
- });
- }
- }
- return result;
- });
-
- return function getFirstSuitableFolder(_x35) {
- return _ref36.apply(this, arguments);
- };
-})();
-
-exports.copy = copy;
-exports.readFile = readFile;
-exports.readFileRaw = readFileRaw;
-exports.normalizeOS = normalizeOS;
-
-var _fs;
-
-function _load_fs() {
- return _fs = _interopRequireDefault(__webpack_require__(5));
-}
-
-var _glob;
-
-function _load_glob() {
- return _glob = _interopRequireDefault(__webpack_require__(99));
-}
-
-var _os;
-
-function _load_os() {
- return _os = _interopRequireDefault(__webpack_require__(46));
-}
-
-var _path;
-
-function _load_path() {
- return _path = _interopRequireDefault(__webpack_require__(0));
-}
-
-var _blockingQueue;
-
-function _load_blockingQueue() {
- return _blockingQueue = _interopRequireDefault(__webpack_require__(110));
-}
-
-var _promise;
-
-function _load_promise() {
- return _promise = _interopRequireWildcard(__webpack_require__(50));
-}
-
-var _promise2;
-
-function _load_promise2() {
- return _promise2 = __webpack_require__(50);
-}
-
-var _map;
-
-function _load_map() {
- return _map = _interopRequireDefault(__webpack_require__(29));
-}
-
-var _fsNormalized;
-
-function _load_fsNormalized() {
- return _fsNormalized = __webpack_require__(218);
-}
-
-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 constants = exports.constants = typeof (_fs || _load_fs()).default.constants !== 'undefined' ? (_fs || _load_fs()).default.constants : {
- R_OK: (_fs || _load_fs()).default.R_OK,
- W_OK: (_fs || _load_fs()).default.W_OK,
- X_OK: (_fs || _load_fs()).default.X_OK
-};
-
-const lockQueue = exports.lockQueue = new (_blockingQueue || _load_blockingQueue()).default('fs lock');
-
-const readFileBuffer = exports.readFileBuffer = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readFile);
-const open = exports.open = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.open);
-const writeFile = exports.writeFile = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.writeFile);
-const readlink = exports.readlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readlink);
-const realpath = exports.realpath = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.realpath);
-const readdir = exports.readdir = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.readdir);
-const rename = exports.rename = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.rename);
-const access = exports.access = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.access);
-const stat = exports.stat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.stat);
-const mkdirp = exports.mkdirp = (0, (_promise2 || _load_promise2()).promisify)(__webpack_require__(145));
-const exists = exports.exists = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.exists, true);
-const lstat = exports.lstat = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.lstat);
-const chmod = exports.chmod = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.chmod);
-const link = exports.link = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.link);
-const glob = exports.glob = (0, (_promise2 || _load_promise2()).promisify)((_glob || _load_glob()).default);
-exports.unlink = (_fsNormalized || _load_fsNormalized()).unlink;
-
-// fs.copyFile uses the native file copying instructions on the system, performing much better
-// than any JS-based solution and consumes fewer resources. Repeated testing to fine tune the
-// concurrency level revealed 128 as the sweet spot on a quad-core, 16 CPU Intel system with SSD.
-
-const CONCURRENT_QUEUE_ITEMS = (_fs || _load_fs()).default.copyFile ? 128 : 4;
-
-const fsSymlink = (0, (_promise2 || _load_promise2()).promisify)((_fs || _load_fs()).default.symlink);
-const invariant = __webpack_require__(9);
-const stripBOM = __webpack_require__(160);
-
-const noop = () => {};
-
-function copy(src, dest, reporter) {
- return copyBulk([{ src, dest }], reporter);
-}
-
-function _readFile(loc, encoding) {
- return new Promise((resolve, reject) => {
- (_fs || _load_fs()).default.readFile(loc, encoding, function (err, content) {
- if (err) {
- reject(err);
- } else {
- resolve(content);
- }
- });
- });
-}
-
-function readFile(loc) {
- return _readFile(loc, 'utf8').then(normalizeOS);
-}
-
-function readFileRaw(loc) {
- return _readFile(loc, 'binary');
-}
-
-function normalizeOS(body) {
- return body.replace(/\r\n/g, '\n');
-}
-
-const cr = '\r'.charCodeAt(0);
-const lf = '\n'.charCodeAt(0);
-
-/***/ }),
-/* 5 */
-/***/ (function(module, exports) {
-
-module.exports = require("fs");
-
-/***/ }),
-/* 6 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-class MessageError extends Error {
- constructor(msg, code) {
- super(msg);
- this.code = code;
- }
-
-}
-
-exports.MessageError = MessageError;
-class ProcessSpawnError extends MessageError {
- constructor(msg, code, process) {
- super(msg, code);
- this.process = process;
- }
-
-}
-
-exports.ProcessSpawnError = ProcessSpawnError;
-class SecurityError extends MessageError {}
-
-exports.SecurityError = SecurityError;
-class ProcessTermError extends MessageError {}
-
-exports.ProcessTermError = ProcessTermError;
-class ResponseError extends Error {
- constructor(msg, responseCode) {
- super(msg);
- this.responseCode = responseCode;
- }
-
-}
-
-exports.ResponseError = ResponseError;
-class OneTimePasswordError extends Error {}
-exports.OneTimePasswordError = OneTimePasswordError;
-
-/***/ }),
-/* 7 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscriber; });
-/* unused harmony export SafeSubscriber */
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__util_isFunction__ = __webpack_require__(154);
-/* 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_6__util_hostReportError__ = __webpack_require__(323);
-/** PURE_IMPORTS_START tslib,_util_isFunction,_Observer,_Subscription,_internal_symbol_rxSubscriber,_config,_util_hostReportError PURE_IMPORTS_END */
-
-
-
-
-
-
-
-var Subscriber = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subscriber, _super);
- function Subscriber(destinationOrNext, error, complete) {
- var _this = _super.call(this) || this;
- _this.syncErrorValue = null;
- _this.syncErrorThrown = false;
- _this.syncErrorThrowable = false;
- _this.isStopped = false;
- _this._parentSubscription = null;
- switch (arguments.length) {
- case 0:
- _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
- break;
- case 1:
- if (!destinationOrNext) {
- _this.destination = __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */];
- break;
- }
- if (typeof destinationOrNext === 'object') {
- if (destinationOrNext instanceof Subscriber) {
- _this.syncErrorThrowable = destinationOrNext.syncErrorThrowable;
- _this.destination = destinationOrNext;
- destinationOrNext.add(_this);
- }
- else {
- _this.syncErrorThrowable = true;
- _this.destination = new SafeSubscriber(_this, destinationOrNext);
- }
- break;
- }
- default:
- _this.syncErrorThrowable = true;
- _this.destination = new SafeSubscriber(_this, destinationOrNext, error, complete);
- break;
- }
- return _this;
- }
- Subscriber.prototype[__WEBPACK_IMPORTED_MODULE_4__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () { return this; };
- Subscriber.create = function (next, error, complete) {
- var subscriber = new Subscriber(next, error, complete);
- subscriber.syncErrorThrowable = false;
- return subscriber;
- };
- Subscriber.prototype.next = function (value) {
- if (!this.isStopped) {
- this._next(value);
- }
- };
- Subscriber.prototype.error = function (err) {
- if (!this.isStopped) {
- this.isStopped = true;
- this._error(err);
- }
- };
- Subscriber.prototype.complete = function () {
- if (!this.isStopped) {
- this.isStopped = true;
- this._complete();
- }
- };
- Subscriber.prototype.unsubscribe = function () {
- if (this.closed) {
- return;
- }
- this.isStopped = true;
- _super.prototype.unsubscribe.call(this);
- };
- Subscriber.prototype._next = function (value) {
- this.destination.next(value);
- };
- Subscriber.prototype._error = function (err) {
- this.destination.error(err);
- this.unsubscribe();
- };
- Subscriber.prototype._complete = function () {
- this.destination.complete();
- this.unsubscribe();
- };
- Subscriber.prototype._unsubscribeAndRecycle = function () {
- var _a = this, _parent = _a._parent, _parents = _a._parents;
- this._parent = null;
- this._parents = null;
- this.unsubscribe();
- this.closed = false;
- this.isStopped = false;
- this._parent = _parent;
- this._parents = _parents;
- this._parentSubscription = null;
- return this;
- };
- return Subscriber;
-}(__WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */]));
-
-var SafeSubscriber = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SafeSubscriber, _super);
- function SafeSubscriber(_parentSubscriber, observerOrNext, error, complete) {
- var _this = _super.call(this) || this;
- _this._parentSubscriber = _parentSubscriber;
- var next;
- var context = _this;
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(observerOrNext)) {
- next = observerOrNext;
- }
- else if (observerOrNext) {
- next = observerOrNext.next;
- error = observerOrNext.error;
- complete = observerOrNext.complete;
- if (observerOrNext !== __WEBPACK_IMPORTED_MODULE_2__Observer__["a" /* empty */]) {
- context = Object.create(observerOrNext);
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isFunction__["a" /* isFunction */])(context.unsubscribe)) {
- _this.add(context.unsubscribe.bind(context));
- }
- context.unsubscribe = _this.unsubscribe.bind(_this);
- }
- }
- _this._context = context;
- _this._next = next;
- _this._error = error;
- _this._complete = complete;
- return _this;
- }
- SafeSubscriber.prototype.next = function (value) {
- if (!this.isStopped && this._next) {
- var _parentSubscriber = this._parentSubscriber;
- if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
- this.__tryOrUnsub(this._next, value);
- }
- else if (this.__tryOrSetError(_parentSubscriber, this._next, value)) {
- this.unsubscribe();
- }
- }
- };
- SafeSubscriber.prototype.error = function (err) {
- if (!this.isStopped) {
- var _parentSubscriber = this._parentSubscriber;
- var useDeprecatedSynchronousErrorHandling = __WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling;
- if (this._error) {
- if (!useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
- this.__tryOrUnsub(this._error, err);
- this.unsubscribe();
- }
- else {
- this.__tryOrSetError(_parentSubscriber, this._error, err);
- this.unsubscribe();
- }
- }
- else if (!_parentSubscriber.syncErrorThrowable) {
- this.unsubscribe();
- if (useDeprecatedSynchronousErrorHandling) {
- throw err;
- }
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
- }
- else {
- if (useDeprecatedSynchronousErrorHandling) {
- _parentSubscriber.syncErrorValue = err;
- _parentSubscriber.syncErrorThrown = true;
- }
- else {
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
- }
- this.unsubscribe();
- }
- }
- };
- SafeSubscriber.prototype.complete = function () {
- var _this = this;
- if (!this.isStopped) {
- var _parentSubscriber = this._parentSubscriber;
- if (this._complete) {
- var wrappedComplete = function () { return _this._complete.call(_this._context); };
- if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling || !_parentSubscriber.syncErrorThrowable) {
- this.__tryOrUnsub(wrappedComplete);
- this.unsubscribe();
- }
- else {
- this.__tryOrSetError(_parentSubscriber, wrappedComplete);
- this.unsubscribe();
- }
- }
- else {
- this.unsubscribe();
- }
- }
- };
- SafeSubscriber.prototype.__tryOrUnsub = function (fn, value) {
- try {
- fn.call(this._context, value);
- }
- catch (err) {
- this.unsubscribe();
- if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
- throw err;
- }
- else {
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
- }
- }
- };
- SafeSubscriber.prototype.__tryOrSetError = function (parent, fn, value) {
- if (!__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
- throw new Error('bad call');
- }
- try {
- fn.call(this._context, value);
- }
- catch (err) {
- if (__WEBPACK_IMPORTED_MODULE_5__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
- parent.syncErrorValue = err;
- parent.syncErrorThrown = true;
- return true;
- }
- else {
- __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_6__util_hostReportError__["a" /* hostReportError */])(err);
- return true;
- }
- }
- return false;
- };
- SafeSubscriber.prototype._unsubscribe = function () {
- var _parentSubscriber = this._parentSubscriber;
- this._context = null;
- this._parentSubscriber = null;
- _parentSubscriber.unsubscribe();
- };
- return SafeSubscriber;
-}(Subscriber));
-
-//# sourceMappingURL=Subscriber.js.map
-
-
-/***/ }),
-/* 8 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.getPathKey = getPathKey;
-const os = __webpack_require__(46);
-const path = __webpack_require__(0);
-const userHome = __webpack_require__(67).default;
-
-var _require = __webpack_require__(225);
-
-const getCacheDir = _require.getCacheDir,
- getConfigDir = _require.getConfigDir,
- getDataDir = _require.getDataDir;
-
-const isWebpackBundle = __webpack_require__(278);
-
-const DEPENDENCY_TYPES = exports.DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies', 'peerDependencies'];
-const OWNED_DEPENDENCY_TYPES = exports.OWNED_DEPENDENCY_TYPES = ['devDependencies', 'dependencies', 'optionalDependencies'];
-
-const RESOLUTIONS = exports.RESOLUTIONS = 'resolutions';
-const MANIFEST_FIELDS = exports.MANIFEST_FIELDS = [RESOLUTIONS, ...DEPENDENCY_TYPES];
-
-const SUPPORTED_NODE_VERSIONS = exports.SUPPORTED_NODE_VERSIONS = '^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0';
-
-const YARN_REGISTRY = exports.YARN_REGISTRY = 'https://registry.yarnpkg.com';
-const NPM_REGISTRY_RE = exports.NPM_REGISTRY_RE = /https?:\/\/registry\.npmjs\.org/g;
-
-const YARN_DOCS = exports.YARN_DOCS = 'https://yarnpkg.com/en/docs/cli/';
-const YARN_INSTALLER_SH = exports.YARN_INSTALLER_SH = 'https://yarnpkg.com/install.sh';
-const YARN_INSTALLER_MSI = exports.YARN_INSTALLER_MSI = 'https://yarnpkg.com/latest.msi';
-
-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 = 6;
-
-// lockfile version, bump whenever we make backwards incompatible changes
-const LOCKFILE_VERSION = exports.LOCKFILE_VERSION = 1;
-
-// max amount of network requests to perform concurrently
-const NETWORK_CONCURRENCY = exports.NETWORK_CONCURRENCY = 8;
-
-// HTTP timeout used when downloading packages
-const NETWORK_TIMEOUT = exports.NETWORK_TIMEOUT = 30 * 1000; // in milliseconds
-
-// max amount of child processes to execute concurrently
-const CHILD_CONCURRENCY = exports.CHILD_CONCURRENCY = 5;
-
-const REQUIRED_PACKAGE_KEYS = exports.REQUIRED_PACKAGE_KEYS = ['name', 'version', '_uid'];
-
-function getPreferredCacheDirectories() {
- const preferredCacheDirectories = [getCacheDir()];
-
- if (process.getuid) {
- // $FlowFixMe: process.getuid exists, dammit
- preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache-${process.getuid()}`));
- }
-
- preferredCacheDirectories.push(path.join(os.tmpdir(), `.yarn-cache`));
-
- return preferredCacheDirectories;
-}
-
-const PREFERRED_MODULE_CACHE_DIRECTORIES = exports.PREFERRED_MODULE_CACHE_DIRECTORIES = getPreferredCacheDirectories();
-const CONFIG_DIRECTORY = exports.CONFIG_DIRECTORY = getConfigDir();
-const DATA_DIRECTORY = exports.DATA_DIRECTORY = getDataDir();
-const LINK_REGISTRY_DIRECTORY = exports.LINK_REGISTRY_DIRECTORY = path.join(DATA_DIRECTORY, 'link');
-const GLOBAL_MODULE_DIRECTORY = exports.GLOBAL_MODULE_DIRECTORY = path.join(DATA_DIRECTORY, 'global');
-
-const NODE_BIN_PATH = exports.NODE_BIN_PATH = process.execPath;
-const YARN_BIN_PATH = exports.YARN_BIN_PATH = getYarnBinPath();
-
-// Webpack needs to be configured with node.__dirname/__filename = false
-function getYarnBinPath() {
- if (isWebpackBundle) {
- return __filename;
- } else {
- return path.join(__dirname, '..', 'bin', 'yarn.js');
- }
-}
-
-const NODE_MODULES_FOLDER = exports.NODE_MODULES_FOLDER = 'node_modules';
-const NODE_PACKAGE_JSON = exports.NODE_PACKAGE_JSON = 'package.json';
-
-const PNP_FILENAME = exports.PNP_FILENAME = '.pnp.js';
-
-const POSIX_GLOBAL_PREFIX = exports.POSIX_GLOBAL_PREFIX = `${process.env.DESTDIR || ''}/usr/local`;
-const FALLBACK_GLOBAL_PREFIX = exports.FALLBACK_GLOBAL_PREFIX = path.join(userHome, '.yarn');
-
-const META_FOLDER = exports.META_FOLDER = '.yarn-meta';
-const INTEGRITY_FILENAME = exports.INTEGRITY_FILENAME = '.yarn-integrity';
-const LOCKFILE_FILENAME = exports.LOCKFILE_FILENAME = 'yarn.lock';
-const METADATA_FILENAME = exports.METADATA_FILENAME = '.yarn-metadata.json';
-const TARBALL_FILENAME = exports.TARBALL_FILENAME = '.yarn-tarball.tgz';
-const CLEAN_FILENAME = exports.CLEAN_FILENAME = '.yarnclean';
-
-const NPM_LOCK_FILENAME = exports.NPM_LOCK_FILENAME = 'package-lock.json';
-const NPM_SHRINKWRAP_FILENAME = exports.NPM_SHRINKWRAP_FILENAME = 'npm-shrinkwrap.json';
-
-const DEFAULT_INDENT = exports.DEFAULT_INDENT = ' ';
-const SINGLE_INSTANCE_PORT = exports.SINGLE_INSTANCE_PORT = 31997;
-const SINGLE_INSTANCE_FILENAME = exports.SINGLE_INSTANCE_FILENAME = '.yarn-single-instance';
-
-const ENV_PATH_KEY = exports.ENV_PATH_KEY = getPathKey(process.platform, process.env);
-
-function getPathKey(platform, env) {
- let pathKey = 'PATH';
-
- // windows calls its path "Path" usually, but this is not guaranteed.
- if (platform === 'win32') {
- pathKey = 'Path';
-
- for (const key in env) {
- if (key.toLowerCase() === 'path') {
- pathKey = key;
- }
- }
- }
-
- return pathKey;
-}
-
-const VERSION_COLOR_SCHEME = exports.VERSION_COLOR_SCHEME = {
- major: 'red',
- premajor: 'red',
- minor: 'yellow',
- preminor: 'yellow',
- patch: 'green',
- prepatch: 'green',
- prerelease: 'red',
- unchanged: 'white',
- unknown: 'red'
-};
-
-/***/ }),
-/* 9 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/**
- * Copyright (c) 2013-present, Facebook, Inc.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */
-
-
-
-/**
- * Use invariant() to assert state which your program assumes to be true.
- *
- * Provide sprintf-style format (only %s is supported) and arguments
- * to provide information about what broke and what you were
- * expecting.
- *
- * The invariant message will be stripped in production, but the invariant
- * will remain to ensure logic does not differ in production.
- */
-
-var NODE_ENV = process.env.NODE_ENV;
-
-var invariant = function(condition, format, a, b, c, d, e, f) {
- if (NODE_ENV !== 'production') {
- if (format === undefined) {
- throw new Error('invariant requires an error message argument');
- }
- }
-
- if (!condition) {
- var error;
- if (format === undefined) {
- error = new Error(
- 'Minified exception occurred; use the non-minified dev environment ' +
- 'for the full error message and additional helpful warnings.'
- );
- } else {
- var args = [a, b, c, d, e, f];
- var argIndex = 0;
- error = new Error(
- format.replace(/%s/g, function() { return args[argIndex++]; })
- );
- error.name = 'Invariant Violation';
- }
-
- error.framesToPop = 1; // we don't care about invariant's own frame
- throw error;
- }
-};
-
-module.exports = invariant;
-
-
-/***/ }),
-/* 10 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-var YAMLException = __webpack_require__(54);
-
-var TYPE_CONSTRUCTOR_OPTIONS = [
- 'kind',
- 'resolve',
- 'construct',
- 'instanceOf',
- 'predicate',
- 'represent',
- 'defaultStyle',
- 'styleAliases'
-];
-
-var YAML_NODE_KINDS = [
- 'scalar',
- 'sequence',
- 'mapping'
-];
-
-function compileStyleAliases(map) {
- var result = {};
-
- if (map !== null) {
- Object.keys(map).forEach(function (style) {
- map[style].forEach(function (alias) {
- result[String(alias)] = style;
- });
- });
- }
-
- return result;
-}
-
-function Type(tag, options) {
- options = options || {};
-
- Object.keys(options).forEach(function (name) {
- if (TYPE_CONSTRUCTOR_OPTIONS.indexOf(name) === -1) {
- throw new YAMLException('Unknown option "' + name + '" is met in definition of "' + tag + '" YAML type.');
- }
- });
-
- // TODO: Add tag format check.
- this.tag = tag;
- this.kind = options['kind'] || null;
- this.resolve = options['resolve'] || function () { return true; };
- this.construct = options['construct'] || function (data) { return data; };
- this.instanceOf = options['instanceOf'] || null;
- this.predicate = options['predicate'] || null;
- this.represent = options['represent'] || null;
- this.defaultStyle = options['defaultStyle'] || null;
- this.styleAliases = compileStyleAliases(options['styleAliases'] || null);
-
- if (YAML_NODE_KINDS.indexOf(this.kind) === -1) {
- throw new YAMLException('Unknown kind "' + this.kind + '" is specified for "' + tag + '" YAML type.');
- }
-}
-
-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_3__util_pipe__ = __webpack_require__(324);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__config__ = __webpack_require__(185);
-/** PURE_IMPORTS_START _util_canReportError,_util_toSubscriber,_internal_symbol_observable,_util_pipe,_config PURE_IMPORTS_END */
-
-
-
-
-
-var Observable = /*@__PURE__*/ (function () {
- function Observable(subscribe) {
- this._isScalar = false;
- if (subscribe) {
- this._subscribe = subscribe;
- }
- }
- Observable.prototype.lift = function (operator) {
- var observable = new Observable();
- observable.source = this;
- observable.operator = operator;
- return observable;
- };
- Observable.prototype.subscribe = function (observerOrNext, error, complete) {
- var operator = this.operator;
- var sink = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_toSubscriber__["a" /* toSubscriber */])(observerOrNext, error, complete);
- if (operator) {
- operator.call(sink, this.source);
- }
- else {
- sink.add(this.source || (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling && !sink.syncErrorThrowable) ?
- this._subscribe(sink) :
- this._trySubscribe(sink));
- }
- if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
- if (sink.syncErrorThrowable) {
- sink.syncErrorThrowable = false;
- if (sink.syncErrorThrown) {
- throw sink.syncErrorValue;
- }
- }
- }
- return sink;
- };
- Observable.prototype._trySubscribe = function (sink) {
- try {
- return this._subscribe(sink);
- }
- catch (err) {
- if (__WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].useDeprecatedSynchronousErrorHandling) {
- sink.syncErrorThrown = true;
- sink.syncErrorValue = err;
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_canReportError__["a" /* canReportError */])(sink)) {
- sink.error(err);
- }
- else {
- console.warn(err);
- }
- }
- };
- Observable.prototype.forEach = function (next, promiseCtor) {
- var _this = this;
- promiseCtor = getPromiseCtor(promiseCtor);
- return new promiseCtor(function (resolve, reject) {
- var subscription;
- subscription = _this.subscribe(function (value) {
- try {
- next(value);
- }
- catch (err) {
- reject(err);
- if (subscription) {
- subscription.unsubscribe();
- }
- }
- }, reject, resolve);
- });
- };
- Observable.prototype._subscribe = function (subscriber) {
- var source = this.source;
- return source && source.subscribe(subscriber);
- };
- Observable.prototype[__WEBPACK_IMPORTED_MODULE_2__internal_symbol_observable__["a" /* observable */]] = function () {
- return this;
- };
- Observable.prototype.pipe = function () {
- var operations = [];
- for (var _i = 0; _i < arguments.length; _i++) {
- operations[_i] = arguments[_i];
- }
- if (operations.length === 0) {
- return this;
- }
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_pipe__["b" /* pipeFromArray */])(operations)(this);
- };
- Observable.prototype.toPromise = function (promiseCtor) {
- var _this = this;
- promiseCtor = getPromiseCtor(promiseCtor);
- return new promiseCtor(function (resolve, reject) {
- var value;
- _this.subscribe(function (x) { return value = x; }, function (err) { return reject(err); }, function () { return resolve(value); });
- });
- };
- Observable.create = function (subscribe) {
- return new Observable(subscribe);
- };
- return Observable;
-}());
-
-function getPromiseCtor(promiseCtor) {
- if (!promiseCtor) {
- promiseCtor = __WEBPACK_IMPORTED_MODULE_4__config__["a" /* config */].Promise || Promise;
- }
- if (!promiseCtor) {
- throw new Error('no Promise impl found');
- }
- return promiseCtor;
-}
-//# sourceMappingURL=Observable.js.map
-
-
-/***/ }),
-/* 13 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return OuterSubscriber; });
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(1);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__Subscriber__ = __webpack_require__(7);
-/** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
-
-
-var OuterSubscriber = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](OuterSubscriber, _super);
- function OuterSubscriber() {
- return _super !== null && _super.apply(this, arguments) || this;
- }
- OuterSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) {
- this.destination.next(innerValue);
- };
- OuterSubscriber.prototype.notifyError = function (error, innerSub) {
- this.destination.error(error);
- };
- OuterSubscriber.prototype.notifyComplete = function (innerSub) {
- this.destination.complete();
- };
- return OuterSubscriber;
-}(__WEBPACK_IMPORTED_MODULE_1__Subscriber__["a" /* Subscriber */]));
-
-//# sourceMappingURL=OuterSubscriber.js.map
-
-
-/***/ }),
-/* 14 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (immutable) */ __webpack_exports__["a"] = subscribeToResult;
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__ = __webpack_require__(84);
-/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__subscribeTo__ = __webpack_require__(446);
-/** PURE_IMPORTS_START _InnerSubscriber,_subscribeTo PURE_IMPORTS_END */
-
-
-function subscribeToResult(outerSubscriber, result, outerValue, outerIndex, destination) {
- if (destination === void 0) {
- destination = new __WEBPACK_IMPORTED_MODULE_0__InnerSubscriber__["a" /* InnerSubscriber */](outerSubscriber, outerValue, outerIndex);
- }
- if (destination.closed) {
- return;
- }
- return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__subscribeTo__["a" /* subscribeTo */])(result)(destination);
-}
-//# sourceMappingURL=subscribeToResult.js.map
-
-
-/***/ }),
-/* 15 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-/* eslint-disable node/no-deprecated-api */
-
-
-
-var buffer = __webpack_require__(64)
-var Buffer = buffer.Buffer
-
-var safer = {}
-
-var key
-
-for (key in buffer) {
- if (!buffer.hasOwnProperty(key)) continue
- if (key === 'SlowBuffer' || key === 'Buffer') continue
- safer[key] = buffer[key]
-}
-
-var Safer = safer.Buffer = {}
-for (key in Buffer) {
- if (!Buffer.hasOwnProperty(key)) continue
- if (key === 'allocUnsafe' || key === 'allocUnsafeSlow') continue
- Safer[key] = Buffer[key]
-}
-
-safer.Buffer.prototype = Buffer.prototype
-
-if (!Safer.from || Safer.from === Uint8Array.from) {
- Safer.from = function (value, encodingOrOffset, length) {
- if (typeof value === 'number') {
- throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value)
- }
- if (value && typeof value.length === 'undefined') {
- throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof value)
- }
- return Buffer(value, encodingOrOffset, length)
- }
-}
-
-if (!Safer.alloc) {
- Safer.alloc = function (size, fill, encoding) {
- if (typeof size !== 'number') {
- throw new TypeError('The "size" argument must be of type number. Received type ' + typeof size)
- }
- if (size < 0 || size >= 2 * (1 << 30)) {
- throw new RangeError('The value "' + size + '" is invalid for option "size"')
- }
- var buf = Buffer(size)
- if (!fill || fill.length === 0) {
- buf.fill(0)
- } else if (typeof encoding === 'string') {
- buf.fill(fill, encoding)
- } else {
- buf.fill(fill)
- }
- return buf
- }
-}
-
-if (!safer.kStringMaxLength) {
- try {
- safer.kStringMaxLength = process.binding('buffer').kStringMaxLength
- } catch (e) {
- // we can't determine kStringMaxLength in environments where process.binding
- // is unsupported, so let's not set it
- }
-}
-
-if (!safer.constants) {
- safer.constants = {
- MAX_LENGTH: safer.kMaxLength
- }
- if (safer.kStringMaxLength) {
- safer.constants.MAX_STRING_LENGTH = safer.kStringMaxLength
- }
-}
-
-module.exports = safer
-
-
-/***/ }),
-/* 16 */
-/***/ (function(module, exports, __webpack_require__) {
-
-// Copyright (c) 2012, Mark Cavage. All rights reserved.
-// Copyright 2015 Joyent, Inc.
-
-var assert = __webpack_require__(28);
-var Stream = __webpack_require__(23).Stream;
-var util = __webpack_require__(3);
-
-
-///--- Globals
-
-/* JSSTYLED */
-var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
-
-
-///--- Internal
-
-function _capitalize(str) {
- return (str.charAt(0).toUpperCase() + str.slice(1));
-}
-
-function _toss(name, expected, oper, arg, actual) {
- throw new assert.AssertionError({
- message: util.format('%s (%s) is required', name, expected),
- actual: (actual === undefined) ? typeof (arg) : actual(arg),
- expected: expected,
- operator: oper || '===',
- stackStartFunction: _toss.caller
- });
-}
-
-function _getClass(arg) {
- return (Object.prototype.toString.call(arg).slice(8, -1));
-}
-
-function noop() {
- // Why even bother with asserts?
-}
-
-
-///--- Exports
-
-var types = {
- bool: {
- check: function (arg) { return typeof (arg) === 'boolean'; }
- },
- func: {
- check: function (arg) { return typeof (arg) === 'function'; }
- },
- string: {
- check: function (arg) { return typeof (arg) === 'string'; }
- },
- object: {
- check: function (arg) {
- return typeof (arg) === 'object' && arg !== null;
- }
- },
- number: {
- check: function (arg) {
- return typeof (arg) === 'number' && !isNaN(arg);
- }
- },
- finite: {
- check: function (arg) {
- return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
- }
- },
- buffer: {
- check: function (arg) { return Buffer.isBuffer(arg); },
- operator: 'Buffer.isBuffer'
- },
- array: {
- check: function (arg) { return Array.isArray(arg); },
- operator: 'Array.isArray'
- },
- stream: {
- check: function (arg) { return arg instanceof Stream; },
- operator: 'instanceof',
- actual: _getClass
- },
- date: {
- check: function (arg) { return arg instanceof Date; },
- operator: 'instanceof',
- actual: _getClass
- },
- regexp: {
- check: function (arg) { return arg instanceof RegExp; },
- operator: 'instanceof',
- actual: _getClass
- },
- uuid: {
- check: function (arg) {
- return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
- },
- operator: 'isUUID'
- }
-};
-
-function _setExports(ndebug) {
- var keys = Object.keys(types);
- var out;
-
- /* re-export standard assert */
- if (process.env.NODE_NDEBUG) {
- out = noop;
- } else {
- out = function (arg, msg) {
- if (!arg) {
- _toss(msg, 'true', arg);
- }
- };
- }
-
- /* standard checks */
- keys.forEach(function (k) {
- if (ndebug) {
- out[k] = noop;
- return;
- }
- var type = types[k];
- out[k] = function (arg, msg) {
- if (!type.check(arg)) {
- _toss(msg, k, type.operator, arg, type.actual);
- }
- };
- });
-
- /* optional checks */
- keys.forEach(function (k) {
- var name = 'optional' + _capitalize(k);
- if (ndebug) {
- out[name] = noop;
- return;
- }
- var type = types[k];
- out[name] = function (arg, msg) {
- if (arg === undefined || arg === null) {
- return;
- }
- if (!type.check(arg)) {
- _toss(msg, k, type.operator, arg, type.actual);
- }
- };
- });
-
- /* arrayOf checks */
- keys.forEach(function (k) {
- var name = 'arrayOf' + _capitalize(k);
- if (ndebug) {
- out[name] = noop;
- return;
- }
- var type = types[k];
- var expected = '[' + k + ']';
- out[name] = function (arg, msg) {
- if (!Array.isArray(arg)) {
- _toss(msg, expected, type.operator, arg, type.actual);
- }
- var i;
- for (i = 0; i < arg.length; i++) {
- if (!type.check(arg[i])) {
- _toss(msg, expected, type.operator, arg, type.actual);
- }
- }
- };
- });
-
- /* optionalArrayOf checks */
- keys.forEach(function (k) {
- var name = 'optionalArrayOf' + _capitalize(k);
- if (ndebug) {
- out[name] = noop;
- return;
- }
- var type = types[k];
- var expected = '[' + k + ']';
- out[name] = function (arg, msg) {
- if (arg === undefined || arg === null) {
- return;
- }
- if (!Array.isArray(arg)) {
- _toss(msg, expected, type.operator, arg, type.actual);
- }
- var i;
- for (i = 0; i < arg.length; i++) {
- if (!type.check(arg[i])) {
- _toss(msg, expected, type.operator, arg, type.actual);
- }
- }
- };
- });
-
- /* re-export built-in assertions */
- Object.keys(assert).forEach(function (k) {
- if (k === 'AssertionError') {
- out[k] = assert[k];
- return;
- }
- if (ndebug) {
- out[k] = noop;
- return;
- }
- out[k] = assert[k];
- });
-
- /* export ourselves (for unit tests _only_) */
- out._setExports = _setExports;
-
- return out;
-}
-
-module.exports = _setExports(process.env.NODE_NDEBUG);
-
-
-/***/ }),
-/* 17 */
-/***/ (function(module, exports) {
-
-// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
-var global = module.exports = typeof window != 'undefined' && window.Math == Math
- ? window : typeof self != 'undefined' && self.Math == Math ? self
- // eslint-disable-next-line no-new-func
- : Function('return this')();
-if (typeof __g == 'number') __g = global; // eslint-disable-line no-undef
-
-
-/***/ }),
-/* 18 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.sortAlpha = sortAlpha;
-exports.sortOptionsByFlags = sortOptionsByFlags;
-exports.entries = entries;
-exports.removePrefix = removePrefix;
-exports.removeSuffix = removeSuffix;
-exports.addSuffix = addSuffix;
-exports.hyphenate = hyphenate;
-exports.camelCase = camelCase;
-exports.compareSortedArrays = compareSortedArrays;
-exports.sleep = sleep;
-const _camelCase = __webpack_require__(230);
-
-function sortAlpha(a, b) {
- // sort alphabetically in a deterministic way
- const shortLen = Math.min(a.length, b.length);
- for (let i = 0; i < shortLen; i++) {
- const aChar = a.charCodeAt(i);
- const bChar = b.charCodeAt(i);
- if (aChar !== bChar) {
- return aChar - bChar;
- }
- }
- return a.length - b.length;
-}
-
-function sortOptionsByFlags(a, b) {
- const aOpt = a.flags.replace(/-/g, '');
- const bOpt = b.flags.replace(/-/g, '');
- return sortAlpha(aOpt, bOpt);
-}
-
-function entries(obj) {
- const entries = [];
- if (obj) {
- for (const key in obj) {
- entries.push([key, obj[key]]);
- }
- }
- return entries;
-}
-
-function removePrefix(pattern, prefix) {
- if (pattern.startsWith(prefix)) {
- pattern = pattern.slice(prefix.length);
- }
-
- return pattern;
-}
-
-function removeSuffix(pattern, suffix) {
- if (pattern.endsWith(suffix)) {
- return pattern.slice(0, -suffix.length);
- }
-
- return pattern;
-}
-
-function addSuffix(pattern, suffix) {
- if (!pattern.endsWith(suffix)) {
- return pattern + suffix;
- }
-
- return pattern;
-}
-
-function hyphenate(str) {
- return str.replace(/[A-Z]/g, match => {
- return '-' + match.charAt(0).toLowerCase();
- });
-}
-
-function camelCase(str) {
- if (/[A-Z]/.test(str)) {
- return null;
- } else {
- return _camelCase(str);
- }
-}
-
-function compareSortedArrays(array1, array2) {
- if (array1.length !== array2.length) {
- return false;
- }
- for (let i = 0, len = array1.length; i < len; i++) {
- if (array1[i] !== array2[i]) {
- return false;
- }
- }
- return true;
-}
-
-function sleep(ms) {
- return new Promise(resolve => {
- setTimeout(resolve, ms);
- });
-}
-
-/***/ }),
-/* 19 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.stringify = exports.parse = undefined;
-
-var _asyncToGenerator2;
-
-function _load_asyncToGenerator() {
- return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
-}
-
-var _parse;
-
-function _load_parse() {
- return _parse = __webpack_require__(105);
-}
-
-Object.defineProperty(exports, 'parse', {
- enumerable: true,
- get: function get() {
- return _interopRequireDefault(_parse || _load_parse()).default;
- }
-});
-
-var _stringify;
-
-function _load_stringify() {
- return _stringify = __webpack_require__(199);
-}
-
-Object.defineProperty(exports, 'stringify', {
- enumerable: true,
- get: function get() {
- return _interopRequireDefault(_stringify || _load_stringify()).default;
- }
-});
-exports.implodeEntry = implodeEntry;
-exports.explodeEntry = explodeEntry;
-
-var _misc;
-
-function _load_misc() {
- return _misc = __webpack_require__(18);
-}
-
-var _normalizePattern;
-
-function _load_normalizePattern() {
- return _normalizePattern = __webpack_require__(37);
-}
-
-var _parse2;
-
-function _load_parse2() {
- return _parse2 = _interopRequireDefault(__webpack_require__(105));
-}
-
-var _constants;
-
-function _load_constants() {
- return _constants = __webpack_require__(8);
-}
-
-var _fs;
-
-function _load_fs() {
- return _fs = _interopRequireWildcard(__webpack_require__(4));
-}
-
-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 invariant = __webpack_require__(9);
-
-const path = __webpack_require__(0);
-const ssri = __webpack_require__(65);
-
-function getName(pattern) {
- return (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern).name;
-}
-
-function blankObjectUndefined(obj) {
- return obj && Object.keys(obj).length ? obj : undefined;
-}
-
-function keyForRemote(remote) {
- return remote.resolved || (remote.reference && remote.hash ? `${remote.reference}#${remote.hash}` : null);
-}
-
-function serializeIntegrity(integrity) {
- // We need this because `Integrity.toString()` does not use sorting to ensure a stable string output
- // See https://git.io/vx2Hy
- return integrity.toString().split(' ').sort().join(' ');
-}
-
-function implodeEntry(pattern, obj) {
- const inferredName = getName(pattern);
- const integrity = obj.integrity ? serializeIntegrity(obj.integrity) : '';
- const imploded = {
- name: inferredName === obj.name ? undefined : obj.name,
- version: obj.version,
- uid: obj.uid === obj.version ? undefined : obj.uid,
- resolved: obj.resolved,
- registry: obj.registry === 'npm' ? undefined : obj.registry,
- dependencies: blankObjectUndefined(obj.dependencies),
- optionalDependencies: blankObjectUndefined(obj.optionalDependencies),
- permissions: blankObjectUndefined(obj.permissions),
- prebuiltVariants: blankObjectUndefined(obj.prebuiltVariants)
- };
- if (integrity) {
- imploded.integrity = integrity;
- }
- return imploded;
-}
-
-function explodeEntry(pattern, obj) {
- obj.optionalDependencies = obj.optionalDependencies || {};
- obj.dependencies = obj.dependencies || {};
- obj.uid = obj.uid || obj.version;
- obj.permissions = obj.permissions || {};
- obj.registry = obj.registry || 'npm';
- obj.name = obj.name || getName(pattern);
- const integrity = obj.integrity;
- if (integrity && integrity.isIntegrity) {
- obj.integrity = ssri.parse(integrity);
- }
- return obj;
-}
-
-class Lockfile {
- constructor({ cache, source, parseResultType } = {}) {
- this.source = source || '';
- this.cache = cache;
- this.parseResultType = parseResultType;
- }
-
- // source string if the `cache` was parsed
-
-
- // if true, we're parsing an old yarn file and need to update integrity fields
- hasEntriesExistWithoutIntegrity() {
- if (!this.cache) {
- return false;
- }
-
- for (const key in this.cache) {
- // $FlowFixMe - `this.cache` is clearly defined at this point
- if (!/^.*@(file:|http)/.test(key) && this.cache[key] && !this.cache[key].integrity) {
- return true;
- }
- }
-
- return false;
- }
-
- static fromDirectory(dir, reporter) {
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- // read the manifest in this directory
- const lockfileLoc = path.join(dir, (_constants || _load_constants()).LOCKFILE_FILENAME);
-
- let lockfile;
- let rawLockfile = '';
- let parseResult;
-
- if (yield (_fs || _load_fs()).exists(lockfileLoc)) {
- rawLockfile = yield (_fs || _load_fs()).readFile(lockfileLoc);
- parseResult = (0, (_parse2 || _load_parse2()).default)(rawLockfile, lockfileLoc);
-
- if (reporter) {
- if (parseResult.type === 'merge') {
- reporter.info(reporter.lang('lockfileMerged'));
- } else if (parseResult.type === 'conflict') {
- reporter.warn(reporter.lang('lockfileConflict'));
- }
- }
-
- lockfile = parseResult.object;
- } else if (reporter) {
- reporter.info(reporter.lang('noLockfileFound'));
- }
-
- if (lockfile && lockfile.__metadata) {
- const lockfilev2 = lockfile;
- lockfile = {};
- }
-
- return new Lockfile({ cache: lockfile, source: rawLockfile, parseResultType: parseResult && parseResult.type });
- })();
- }
-
- getLocked(pattern) {
- const cache = this.cache;
- if (!cache) {
- return undefined;
- }
-
- const shrunk = pattern in cache && cache[pattern];
-
- if (typeof shrunk === 'string') {
- return this.getLocked(shrunk);
- } else if (shrunk) {
- explodeEntry(pattern, shrunk);
- return shrunk;
- }
-
- return undefined;
- }
-
- removePattern(pattern) {
- const cache = this.cache;
- if (!cache) {
- return;
- }
- delete cache[pattern];
- }
-
- getLockfile(patterns) {
- const lockfile = {};
- const seen = new Map();
-
- // order by name so that lockfile manifest is assigned to the first dependency with this manifest
- // the others that have the same remoteKey will just refer to the first
- // ordering allows for consistency in lockfile when it is serialized
- const sortedPatternsKeys = Object.keys(patterns).sort((_misc || _load_misc()).sortAlpha);
-
- for (var _iterator = sortedPatternsKeys, _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 pattern = _ref;
-
- const pkg = patterns[pattern];
- const remote = pkg._remote,
- ref = pkg._reference;
-
- invariant(ref, 'Package is missing a reference');
- invariant(remote, 'Package is missing a remote');
-
- const remoteKey = keyForRemote(remote);
- const seenPattern = remoteKey && seen.get(remoteKey);
- if (seenPattern) {
- // no point in duplicating it
- lockfile[pattern] = seenPattern;
-
- // if we're relying on our name being inferred and two of the patterns have
- // different inferred names then we need to set it
- if (!seenPattern.name && getName(pattern) !== pkg.name) {
- seenPattern.name = pkg.name;
- }
- continue;
- }
- const obj = implodeEntry(pattern, {
- name: pkg.name,
- version: pkg.version,
- uid: pkg._uid,
- resolved: remote.resolved,
- integrity: remote.integrity,
- registry: remote.registry,
- dependencies: pkg.dependencies,
- peerDependencies: pkg.peerDependencies,
- optionalDependencies: pkg.optionalDependencies,
- permissions: ref.permissions,
- prebuiltVariants: pkg.prebuiltVariants
- });
-
- lockfile[pattern] = obj;
-
- if (remoteKey) {
- seen.set(remoteKey, obj);
- }
- }
-
- return lockfile;
- }
-}
-exports.default = Lockfile;
-
-/***/ }),
-/* 20 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var store = __webpack_require__(133)('wks');
-var uid = __webpack_require__(137);
-var Symbol = __webpack_require__(17).Symbol;
-var USE_SYMBOL = typeof Symbol == 'function';
-
-var $exports = module.exports = function (name) {
- return store[name] || (store[name] =
- USE_SYMBOL && Symbol[name] || (USE_SYMBOL ? Symbol : uid)('Symbol.' + name));
-};
-
-$exports.store = store;
-
-
-/***/ }),
-/* 21 */
-/***/ (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;
-};
-
-/***/ }),
-/* 22 */
-/***/ (function(module, exports) {
-
-exports = module.exports = SemVer;
-
-// The debug function is excluded entirely from the minified version.
-/* nomin */ var debug;
-/* nomin */ if (typeof process === 'object' &&
- /* nomin */ process.env &&
- /* nomin */ process.env.NODE_DEBUG &&
- /* nomin */ /\bsemver\b/i.test(process.env.NODE_DEBUG))
- /* nomin */ debug = function() {
- /* nomin */ var args = Array.prototype.slice.call(arguments, 0);
- /* nomin */ args.unshift('SEMVER');
- /* nomin */ console.log.apply(console, args);
- /* nomin */ };
-/* nomin */ else
- /* nomin */ debug = function() {};
-
-// Note: this is the semver.org version of the spec that it implements
-// Not necessarily the package version of this code.
-exports.SEMVER_SPEC_VERSION = '2.0.0';
-
-var MAX_LENGTH = 256;
-var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
-
-// Max safe segment length for coercion.
-var MAX_SAFE_COMPONENT_LENGTH = 16;
-
-// The actual regexps go on exports.re
-var re = exports.re = [];
-var src = exports.src = [];
-var R = 0;
-
-// The following Regular Expressions can be used for tokenizing,
-// validating, and parsing SemVer version strings.
-
-// ## Numeric Identifier
-// A single `0`, or a non-zero digit followed by zero or more digits.
-
-var NUMERICIDENTIFIER = R++;
-src[NUMERICIDENTIFIER] = '0|[1-9]\\d*';
-var NUMERICIDENTIFIERLOOSE = R++;
-src[NUMERICIDENTIFIERLOOSE] = '[0-9]+';
-
-
-// ## Non-numeric Identifier
-// Zero or more digits, followed by a letter or hyphen, and then zero or
-// more letters, digits, or hyphens.
-
-var NONNUMERICIDENTIFIER = R++;
-src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*';
-
-
-// ## Main Version
-// Three dot-separated numeric identifiers.
-
-var MAINVERSION = R++;
-src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
- '(' + src[NUMERICIDENTIFIER] + ')\\.' +
- '(' + src[NUMERICIDENTIFIER] + ')';
-
-var MAINVERSIONLOOSE = R++;
-src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
- '(' + src[NUMERICIDENTIFIERLOOSE] + ')';
-
-// ## Pre-release Version Identifier
-// A numeric identifier, or a non-numeric identifier.
-
-var PRERELEASEIDENTIFIER = R++;
-src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
- '|' + src[NONNUMERICIDENTIFIER] + ')';
-
-var PRERELEASEIDENTIFIERLOOSE = R++;
-src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
- '|' + src[NONNUMERICIDENTIFIER] + ')';
-
-
-// ## Pre-release Version
-// Hyphen, followed by one or more dot-separated pre-release version
-// identifiers.
-
-var PRERELEASE = R++;
-src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
- '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))';
-
-var PRERELEASELOOSE = R++;
-src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
- '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))';
-
-// ## Build Metadata Identifier
-// Any combination of digits, letters, or hyphens.
-
-var BUILDIDENTIFIER = R++;
-src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+';
-
-// ## Build Metadata
-// Plus sign, followed by one or more period-separated build metadata
-// identifiers.
-
-var BUILD = R++;
-src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
- '(?:\\.' + src[BUILDIDENTIFIER] + ')*))';
-
-
-// ## Full Version String
-// A main version, followed optionally by a pre-release version and
-// build metadata.
-
-// Note that the only major, minor, patch, and pre-release sections of
-// the version string are capturing groups. The build metadata is not a
-// capturing group, because it should not ever be used in version
-// comparison.
-
-var FULL = R++;
-var FULLPLAIN = 'v?' + src[MAINVERSION] +
- src[PRERELEASE] + '?' +
- src[BUILD] + '?';
-
-src[FULL] = '^' + FULLPLAIN + '$';
-
-// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
-// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
-// common in the npm registry.
-var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
- src[PRERELEASELOOSE] + '?' +
- src[BUILD] + '?';
-
-var LOOSE = R++;
-src[LOOSE] = '^' + LOOSEPLAIN + '$';
-
-var GTLT = R++;
-src[GTLT] = '((?:<|>)?=?)';
-
-// Something like "2.*" or "1.2.x".
-// Note that "x.x" is a valid xRange identifer, meaning "any version"
-// Only the first item is strictly required.
-var XRANGEIDENTIFIERLOOSE = R++;
-src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*';
-var XRANGEIDENTIFIER = R++;
-src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*';
-
-var XRANGEPLAIN = R++;
-src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
- '(?:' + src[PRERELEASE] + ')?' +
- src[BUILD] + '?' +
- ')?)?';
-
-var XRANGEPLAINLOOSE = R++;
-src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
- '(?:' + src[PRERELEASELOOSE] + ')?' +
- src[BUILD] + '?' +
- ')?)?';
-
-var XRANGE = R++;
-src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$';
-var XRANGELOOSE = R++;
-src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$';
-
-// Coercion.
-// Extract anything that could conceivably be a part of a valid semver
-var COERCE = R++;
-src[COERCE] = '(?:^|[^\\d])' +
- '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
- '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
- '(?:$|[^\\d])';
-
-// Tilde ranges.
-// Meaning is "reasonably at or greater than"
-var LONETILDE = R++;
-src[LONETILDE] = '(?:~>?)';
-
-var TILDETRIM = R++;
-src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+';
-re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g');
-var tildeTrimReplace = '$1~';
-
-var TILDE = R++;
-src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$';
-var TILDELOOSE = R++;
-src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$';
-
-// Caret ranges.
-// Meaning is "at least and backwards compatible with"
-var LONECARET = R++;
-src[LONECARET] = '(?:\\^)';
-
-var CARETTRIM = R++;
-src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+';
-re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g');
-var caretTrimReplace = '$1^';
-
-var CARET = R++;
-src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$';
-var CARETLOOSE = R++;
-src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$';
-
-// A simple gt/lt/eq thing, or just "" to indicate "any version"
-var COMPARATORLOOSE = R++;
-src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$';
-var COMPARATOR = R++;
-src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$';
-
-
-// An expression to strip any whitespace between the gtlt and the thing
-// it modifies, so that `> 1.2.3` ==> `>1.2.3`
-var COMPARATORTRIM = R++;
-src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
- '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')';
-
-// this one has to use the /g flag
-re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g');
-var comparatorTrimReplace = '$1$2$3';
-
-
-// Something like `1.2.3 - 1.2.4`
-// Note that these all use the loose form, because they'll be
-// checked against either the strict or loose comparator form
-// later.
-var HYPHENRANGE = R++;
-src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
- '\\s+-\\s+' +
- '(' + src[XRANGEPLAIN] + ')' +
- '\\s*$';
-
-var HYPHENRANGELOOSE = R++;
-src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
- '\\s+-\\s+' +
- '(' + src[XRANGEPLAINLOOSE] + ')' +
- '\\s*$';
-
-// Star ranges basically just allow anything at all.
-var STAR = R++;
-src[STAR] = '(<|>)?=?\\s*\\*';
-
-// Compile to actual regexp objects.
-// All are flag-free, unless they were created above with a flag.
-for (var i = 0; i < R; i++) {
- debug(i, src[i]);
- if (!re[i])
- re[i] = new RegExp(src[i]);
-}
-
-exports.parse = parse;
-function parse(version, loose) {
- if (version instanceof SemVer)
- return version;
-
- if (typeof version !== 'string')
- return null;
-
- if (version.length > MAX_LENGTH)
- return null;
-
- var r = loose ? re[LOOSE] : re[FULL];
- if (!r.test(version))
- return null;
-
- try {
- return new SemVer(version, loose);
- } catch (er) {
- return null;
- }
-}
-
-exports.valid = valid;
-function valid(version, loose) {
- var v = parse(version, loose);
- return v ? v.version : null;
-}
-
-
-exports.clean = clean;
-function clean(version, loose) {
- var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
- return s ? s.version : null;
-}
-
-exports.SemVer = SemVer;
-
-function SemVer(version, loose) {
- if (version instanceof SemVer) {
- if (version.loose === loose)
- return version;
- else
- version = version.version;
- } else if (typeof version !== 'string') {
- throw new TypeError('Invalid Version: ' + version);
- }
-
- if (version.length > MAX_LENGTH)
- throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
-
- if (!(this instanceof SemVer))
- return new SemVer(version, loose);
-
- debug('SemVer', version, loose);
- this.loose = loose;
- var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
-
- if (!m)
- throw new TypeError('Invalid Version: ' + version);
-
- this.raw = version;
-
- // these are actually numbers
- this.major = +m[1];
- this.minor = +m[2];
- this.patch = +m[3];
-
- if (this.major > MAX_SAFE_INTEGER || this.major < 0)
- throw new TypeError('Invalid major version')
-
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
- throw new TypeError('Invalid minor version')
-
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
- throw new TypeError('Invalid patch version')
-
- // numberify any prerelease numeric ids
- if (!m[4])
- this.prerelease = [];
- else
- this.prerelease = m[4].split('.').map(function(id) {
- if (/^[0-9]+$/.test(id)) {
- var num = +id;
- if (num >= 0 && num < MAX_SAFE_INTEGER)
- return num;
- }
- return id;
- });
-
- this.build = m[5] ? m[5].split('.') : [];
- this.format();
-}
-
-SemVer.prototype.format = function() {
- this.version = this.major + '.' + this.minor + '.' + this.patch;
- if (this.prerelease.length)
- this.version += '-' + this.prerelease.join('.');
- return this.version;
-};
-
-SemVer.prototype.toString = function() {
- return this.version;
-};
-
-SemVer.prototype.compare = function(other) {
- debug('SemVer.compare', this.version, this.loose, other);
- if (!(other instanceof SemVer))
- other = new SemVer(other, this.loose);
-
- return this.compareMain(other) || this.comparePre(other);
-};
-
-SemVer.prototype.compareMain = function(other) {
- if (!(other instanceof SemVer))
- other = new SemVer(other, this.loose);
-
- return compareIdentifiers(this.major, other.major) ||
- compareIdentifiers(this.minor, other.minor) ||
- compareIdentifiers(this.patch, other.patch);
-};
-
-SemVer.prototype.comparePre = function(other) {
- if (!(other instanceof SemVer))
- other = new SemVer(other, this.loose);
-
- // NOT having a prerelease is > having one
- if (this.prerelease.length && !other.prerelease.length)
- return -1;
- else if (!this.prerelease.length && other.prerelease.length)
- return 1;
- else if (!this.prerelease.length && !other.prerelease.length)
- return 0;
-
- var i = 0;
- do {
- var a = this.prerelease[i];
- var b = other.prerelease[i];
- debug('prerelease compare', i, a, b);
- if (a === undefined && b === undefined)
- return 0;
- else if (b === undefined)
- return 1;
- else if (a === undefined)
- return -1;
- else if (a === b)
- continue;
- else
- return compareIdentifiers(a, b);
- } while (++i);
-};
-
-// preminor will bump the version up to the next minor release, and immediately
-// down to pre-release. premajor and prepatch work the same way.
-SemVer.prototype.inc = function(release, identifier) {
- switch (release) {
- case 'premajor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor = 0;
- this.major++;
- this.inc('pre', identifier);
- break;
- case 'preminor':
- this.prerelease.length = 0;
- this.patch = 0;
- this.minor++;
- this.inc('pre', identifier);
- break;
- case 'prepatch':
- // If this is already a prerelease, it will bump to the next version
- // drop any prereleases that might already exist, since they are not
- // relevant at this point.
- this.prerelease.length = 0;
- this.inc('patch', identifier);
- this.inc('pre', identifier);
- break;
- // If the input is a non-prerelease version, this acts the same as
- // prepatch.
- case 'prerelease':
- if (this.prerelease.length === 0)
- this.inc('patch', identifier);
- this.inc('pre', identifier);
- break;
-
- case 'major':
- // If this is a pre-major version, bump up to the same major version.
- // Otherwise increment major.
- // 1.0.0-5 bumps to 1.0.0
- // 1.1.0 bumps to 2.0.0
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0)
- this.major++;
- this.minor = 0;
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'minor':
- // If this is a pre-minor version, bump up to the same minor version.
- // Otherwise increment minor.
- // 1.2.0-5 bumps to 1.2.0
- // 1.2.1 bumps to 1.3.0
- if (this.patch !== 0 || this.prerelease.length === 0)
- this.minor++;
- this.patch = 0;
- this.prerelease = [];
- break;
- case 'patch':
- // If this is not a pre-release version, it will increment the patch.
- // If it is a pre-release it will bump up to the same patch version.
- // 1.2.0-5 patches to 1.2.0
- // 1.2.0 patches to 1.2.1
- if (this.prerelease.length === 0)
- this.patch++;
- this.prerelease = [];
- break;
- // This probably shouldn't be used publicly.
- // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
- case 'pre':
- if (this.prerelease.length === 0)
- this.prerelease = [0];
- else {
- var i = this.prerelease.length;
- while (--i >= 0) {
- if (typeof this.prerelease[i] === 'number') {
- this.prerelease[i]++;
- i = -2;
- }
- }
- if (i === -1) // didn't increment anything
- this.prerelease.push(0);
- }
- if (identifier) {
- // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
- // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
- if (this.prerelease[0] === identifier) {
- if (isNaN(this.prerelease[1]))
- this.prerelease = [identifier, 0];
- } else
- this.prerelease = [identifier, 0];
- }
- break;
-
- default:
- throw new Error('invalid increment argument: ' + release);
- }
- this.format();
- this.raw = this.version;
- return this;
-};
-
-exports.inc = inc;
-function inc(version, release, loose, identifier) {
- if (typeof(loose) === 'string') {
- identifier = loose;
- loose = undefined;
- }
-
- try {
- return new SemVer(version, loose).inc(release, identifier).version;
- } catch (er) {
- return null;
- }
-}
-
-exports.diff = diff;
-function diff(version1, version2) {
- if (eq(version1, version2)) {
- return null;
- } else {
- var v1 = parse(version1);
- var v2 = parse(version2);
- if (v1.prerelease.length || v2.prerelease.length) {
- for (var key in v1) {
- if (key === 'major' || key === 'minor' || key === 'patch') {
- if (v1[key] !== v2[key]) {
- return 'pre'+key;
- }
- }
- }
- return 'prerelease';
- }
- for (var key in v1) {
- if (key === 'major' || key === 'minor' || key === 'patch') {
- if (v1[key] !== v2[key]) {
- return key;
- }
- }
- }
- }
-}
-
-exports.compareIdentifiers = compareIdentifiers;
-
-var numeric = /^[0-9]+$/;
-function compareIdentifiers(a, b) {
- var anum = numeric.test(a);
- var bnum = numeric.test(b);
-
- if (anum && bnum) {
- a = +a;
- b = +b;
- }
-
- return (anum && !bnum) ? -1 :
- (bnum && !anum) ? 1 :
- a < b ? -1 :
- a > b ? 1 :
- 0;
-}
-
-exports.rcompareIdentifiers = rcompareIdentifiers;
-function rcompareIdentifiers(a, b) {
- return compareIdentifiers(b, a);
-}
-
-exports.major = major;
-function major(a, loose) {
- return new SemVer(a, loose).major;
-}
-
-exports.minor = minor;
-function minor(a, loose) {
- return new SemVer(a, loose).minor;
-}
-
-exports.patch = patch;
-function patch(a, loose) {
- return new SemVer(a, loose).patch;
-}
-
-exports.compare = compare;
-function compare(a, b, loose) {
- return new SemVer(a, loose).compare(new SemVer(b, loose));
-}
-
-exports.compareLoose = compareLoose;
-function compareLoose(a, b) {
- return compare(a, b, true);
-}
-
-exports.rcompare = rcompare;
-function rcompare(a, b, loose) {
- return compare(b, a, loose);
-}
-
-exports.sort = sort;
-function sort(list, loose) {
- return list.sort(function(a, b) {
- return exports.compare(a, b, loose);
- });
-}
-
-exports.rsort = rsort;
-function rsort(list, loose) {
- return list.sort(function(a, b) {
- return exports.rcompare(a, b, loose);
- });
-}
-
-exports.gt = gt;
-function gt(a, b, loose) {
- return compare(a, b, loose) > 0;
-}
-
-exports.lt = lt;
-function lt(a, b, loose) {
- return compare(a, b, loose) < 0;
-}
-
-exports.eq = eq;
-function eq(a, b, loose) {
- return compare(a, b, loose) === 0;
-}
-
-exports.neq = neq;
-function neq(a, b, loose) {
- return compare(a, b, loose) !== 0;
-}
-
-exports.gte = gte;
-function gte(a, b, loose) {
- return compare(a, b, loose) >= 0;
-}
-
-exports.lte = lte;
-function lte(a, b, loose) {
- return compare(a, b, loose) <= 0;
-}
-
-exports.cmp = cmp;
-function cmp(a, op, b, loose) {
- var ret;
- switch (op) {
- case '===':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- ret = a === b;
- break;
- case '!==':
- if (typeof a === 'object') a = a.version;
- if (typeof b === 'object') b = b.version;
- ret = a !== b;
- break;
- case '': case '=': case '==': ret = eq(a, b, loose); break;
- case '!=': ret = neq(a, b, loose); break;
- case '>': ret = gt(a, b, loose); break;
- case '>=': ret = gte(a, b, loose); break;
- case '<': ret = lt(a, b, loose); break;
- case '<=': ret = lte(a, b, loose); break;
- default: throw new TypeError('Invalid operator: ' + op);
- }
- return ret;
-}
-
-exports.Comparator = Comparator;
-function Comparator(comp, loose) {
- if (comp instanceof Comparator) {
- if (comp.loose === loose)
- return comp;
- else
- comp = comp.value;
- }
-
- if (!(this instanceof Comparator))
- return new Comparator(comp, loose);
-
- debug('comparator', comp, loose);
- this.loose = loose;
- this.parse(comp);
-
- if (this.semver === ANY)
- this.value = '';
- else
- this.value = this.operator + this.semver.version;
-
- debug('comp', this);
-}
-
-var ANY = {};
-Comparator.prototype.parse = function(comp) {
- var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
- var m = comp.match(r);
-
- if (!m)
- throw new TypeError('Invalid comparator: ' + comp);
-
- this.operator = m[1];
- if (this.operator === '=')
- this.operator = '';
-
- // if it literally is just '>' or '' then allow anything.
- if (!m[2])
- this.semver = ANY;
- else
- this.semver = new SemVer(m[2], this.loose);
-};
-
-Comparator.prototype.toString = function() {
- return this.value;
-};
-
-Comparator.prototype.test = function(version) {
- debug('Comparator.test', version, this.loose);
-
- if (this.semver === ANY)
- return true;
-
- if (typeof version === 'string')
- version = new SemVer(version, this.loose);
-
- return cmp(version, this.operator, this.semver, this.loose);
-};
-
-Comparator.prototype.intersects = function(comp, loose) {
- if (!(comp instanceof Comparator)) {
- throw new TypeError('a Comparator is required');
- }
-
- var rangeTmp;
-
- if (this.operator === '') {
- rangeTmp = new Range(comp.value, loose);
- return satisfies(this.value, rangeTmp, loose);
- } else if (comp.operator === '') {
- rangeTmp = new Range(this.value, loose);
- return satisfies(comp.semver, rangeTmp, loose);
- }
-
- var sameDirectionIncreasing =
- (this.operator === '>=' || this.operator === '>') &&
- (comp.operator === '>=' || comp.operator === '>');
- var sameDirectionDecreasing =
- (this.operator === '<=' || this.operator === '<') &&
- (comp.operator === '<=' || comp.operator === '<');
- var sameSemVer = this.semver.version === comp.semver.version;
- var differentDirectionsInclusive =
- (this.operator === '>=' || this.operator === '<=') &&
- (comp.operator === '>=' || comp.operator === '<=');
- var oppositeDirectionsLessThan =
- cmp(this.semver, '<', comp.semver, loose) &&
- ((this.operator === '>=' || this.operator === '>') &&
- (comp.operator === '<=' || comp.operator === '<'));
- var oppositeDirectionsGreaterThan =
- cmp(this.semver, '>', comp.semver, loose) &&
- ((this.operator === '<=' || this.operator === '<') &&
- (comp.operator === '>=' || comp.operator === '>'));
-
- return sameDirectionIncreasing || sameDirectionDecreasing ||
- (sameSemVer && differentDirectionsInclusive) ||
- oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
-};
-
-
-exports.Range = Range;
-function Range(range, loose) {
- if (range instanceof Range) {
- if (range.loose === loose) {
- return range;
- } else {
- return new Range(range.raw, loose);
- }
- }
-
- if (range instanceof Comparator) {
- return new Range(range.value, loose);
- }
-
- if (!(this instanceof Range))
- return new Range(range, loose);
-
- this.loose = loose;
-
- // First, split based on boolean or ||
- this.raw = range;
- this.set = range.split(/\s*\|\|\s*/).map(function(range) {
- return this.parseRange(range.trim());
- }, this).filter(function(c) {
- // throw out any that are not relevant for whatever reason
- return c.length;
- });
-
- if (!this.set.length) {
- throw new TypeError('Invalid SemVer Range: ' + range);
- }
-
- this.format();
-}
-
-Range.prototype.format = function() {
- this.range = this.set.map(function(comps) {
- return comps.join(' ').trim();
- }).join('||').trim();
- return this.range;
-};
-
-Range.prototype.toString = function() {
- return this.range;
-};
-
-Range.prototype.parseRange = function(range) {
- var loose = this.loose;
- range = range.trim();
- debug('range', range, loose);
- // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
- var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
- range = range.replace(hr, hyphenReplace);
- debug('hyphen replace', range);
- // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
- range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace);
- debug('comparator trim', range, re[COMPARATORTRIM]);
-
- // `~ 1.2.3` => `~1.2.3`
- range = range.replace(re[TILDETRIM], tildeTrimReplace);
-
- // `^ 1.2.3` => `^1.2.3`
- range = range.replace(re[CARETTRIM], caretTrimReplace);
-
- // normalize spaces
- range = range.split(/\s+/).join(' ');
-
- // At this point, the range is completely trimmed and
- // ready to be split into comparators.
-
- var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
- var set = range.split(' ').map(function(comp) {
- return parseComparator(comp, loose);
- }).join(' ').split(/\s+/);
- if (this.loose) {
- // in loose mode, throw out any that are not valid comparators
- set = set.filter(function(comp) {
- return !!comp.match(compRe);
- });
- }
- set = set.map(function(comp) {
- return new Comparator(comp, loose);
- });
-
- return set;
-};
-
-Range.prototype.intersects = function(range, loose) {
- if (!(range instanceof Range)) {
- throw new TypeError('a Range is required');
- }
-
- return this.set.some(function(thisComparators) {
- return thisComparators.every(function(thisComparator) {
- return range.set.some(function(rangeComparators) {
- return rangeComparators.every(function(rangeComparator) {
- return thisComparator.intersects(rangeComparator, loose);
- });
- });
- });
- });
-};
-
-// Mostly just for testing and legacy API reasons
-exports.toComparators = toComparators;
-function toComparators(range, loose) {
- return new Range(range, loose).set.map(function(comp) {
- return comp.map(function(c) {
- return c.value;
- }).join(' ').trim().split(' ');
- });
-}
-
-// comprised of xranges, tildes, stars, and gtlt's at this point.
-// already replaced the hyphen ranges
-// turn into a set of JUST comparators.
-function parseComparator(comp, loose) {
- debug('comp', comp);
- comp = replaceCarets(comp, loose);
- debug('caret', comp);
- comp = replaceTildes(comp, loose);
- debug('tildes', comp);
- comp = replaceXRanges(comp, loose);
- debug('xrange', comp);
- comp = replaceStars(comp, loose);
- debug('stars', comp);
- return comp;
-}
-
-function isX(id) {
- return !id || id.toLowerCase() === 'x' || id === '*';
-}
-
-// ~, ~> --> * (any, kinda silly)
-// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
-// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
-// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
-// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
-// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
-function replaceTildes(comp, loose) {
- return comp.trim().split(/\s+/).map(function(comp) {
- return replaceTilde(comp, loose);
- }).join(' ');
-}
-
-function replaceTilde(comp, loose) {
- var r = loose ? re[TILDELOOSE] : re[TILDE];
- return comp.replace(r, function(_, M, m, p, pr) {
- debug('tilde', comp, _, M, m, p, pr);
- var ret;
-
- if (isX(M))
- ret = '';
- else if (isX(m))
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
- else if (isX(p))
- // ~1.2 == >=1.2.0 <1.3.0
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
- else if (pr) {
- debug('replaceTilde pr', pr);
- if (pr.charAt(0) !== '-')
- pr = '-' + pr;
- ret = '>=' + M + '.' + m + '.' + p + pr +
- ' <' + M + '.' + (+m + 1) + '.0';
- } else
- // ~1.2.3 == >=1.2.3 <1.3.0
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + (+m + 1) + '.0';
-
- debug('tilde return', ret);
- return ret;
- });
-}
-
-// ^ --> * (any, kinda silly)
-// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
-// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
-// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
-// ^1.2.3 --> >=1.2.3 <2.0.0
-// ^1.2.0 --> >=1.2.0 <2.0.0
-function replaceCarets(comp, loose) {
- return comp.trim().split(/\s+/).map(function(comp) {
- return replaceCaret(comp, loose);
- }).join(' ');
-}
-
-function replaceCaret(comp, loose) {
- debug('caret', comp, loose);
- var r = loose ? re[CARETLOOSE] : re[CARET];
- return comp.replace(r, function(_, M, m, p, pr) {
- debug('caret', comp, _, M, m, p, pr);
- var ret;
-
- if (isX(M))
- ret = '';
- else if (isX(m))
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
- else if (isX(p)) {
- if (M === '0')
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
- else
- ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0';
- } else if (pr) {
- debug('replaceCaret pr', pr);
- if (pr.charAt(0) !== '-')
- pr = '-' + pr;
- if (M === '0') {
- if (m === '0')
- ret = '>=' + M + '.' + m + '.' + p + pr +
- ' <' + M + '.' + m + '.' + (+p + 1);
- else
- ret = '>=' + M + '.' + m + '.' + p + pr +
- ' <' + M + '.' + (+m + 1) + '.0';
- } else
- ret = '>=' + M + '.' + m + '.' + p + pr +
- ' <' + (+M + 1) + '.0.0';
- } else {
- debug('no pr');
- if (M === '0') {
- if (m === '0')
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + m + '.' + (+p + 1);
- else
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + M + '.' + (+m + 1) + '.0';
- } else
- ret = '>=' + M + '.' + m + '.' + p +
- ' <' + (+M + 1) + '.0.0';
- }
-
- debug('caret return', ret);
- return ret;
- });
-}
-
-function replaceXRanges(comp, loose) {
- debug('replaceXRanges', comp, loose);
- return comp.split(/\s+/).map(function(comp) {
- return replaceXRange(comp, loose);
- }).join(' ');
-}
-
-function replaceXRange(comp, loose) {
- comp = comp.trim();
- var r = loose ? re[XRANGELOOSE] : re[XRANGE];
- return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
- debug('xRange', comp, ret, gtlt, M, m, p, pr);
- var xM = isX(M);
- var xm = xM || isX(m);
- var xp = xm || isX(p);
- var anyX = xp;
-
- if (gtlt === '=' && anyX)
- gtlt = '';
-
- if (xM) {
- if (gtlt === '>' || gtlt === '<') {
- // nothing is allowed
- ret = '<0.0.0';
- } else {
- // nothing is forbidden
- ret = '*';
- }
- } else if (gtlt && anyX) {
- // replace X with 0
- if (xm)
- m = 0;
- if (xp)
- p = 0;
-
- if (gtlt === '>') {
- // >1 => >=2.0.0
- // >1.2 => >=1.3.0
- // >1.2.3 => >= 1.2.4
- gtlt = '>=';
- if (xm) {
- M = +M + 1;
- m = 0;
- p = 0;
- } else if (xp) {
- m = +m + 1;
- p = 0;
- }
- } else if (gtlt === '<=') {
- // <=0.7.x is actually <0.8.0, since any 0.7.x should
- // pass. Similarly, <=7.x is actually <8.0.0, etc.
- gtlt = '<';
- if (xm)
- M = +M + 1;
- else
- m = +m + 1;
- }
-
- ret = gtlt + M + '.' + m + '.' + p;
- } else if (xm) {
- ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0';
- } else if (xp) {
- ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0';
- }
-
- debug('xRange return', ret);
-
- return ret;
- });
-}
-
-// Because * is AND-ed with everything else in the comparator,
-// and '' means "any version", just remove the *s entirely.
-function replaceStars(comp, loose) {
- debug('replaceStars', comp, loose);
- // Looseness is ignored here. star is always as loose as it gets!
- return comp.trim().replace(re[STAR], '');
-}
-
-// This function is passed to string.replace(re[HYPHENRANGE])
-// M, m, patch, prerelease, build
-// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
-// 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
-// 1.2 - 3.4 => >=1.2.0 <3.5.0
-function hyphenReplace($0,
- from, fM, fm, fp, fpr, fb,
- to, tM, tm, tp, tpr, tb) {
-
- if (isX(fM))
- from = '';
- else if (isX(fm))
- from = '>=' + fM + '.0.0';
- else if (isX(fp))
- from = '>=' + fM + '.' + fm + '.0';
- else
- from = '>=' + from;
-
- if (isX(tM))
- to = '';
- else if (isX(tm))
- to = '<' + (+tM + 1) + '.0.0';
- else if (isX(tp))
- to = '<' + tM + '.' + (+tm + 1) + '.0';
- else if (tpr)
- to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr;
- else
- to = '<=' + to;
-
- return (from + ' ' + to).trim();
-}
-
-
-// if ANY of the sets match ALL of its comparators, then pass
-Range.prototype.test = function(version) {
- if (!version)
- return false;
-
- if (typeof version === 'string')
- version = new SemVer(version, this.loose);
-
- for (var i = 0; i < this.set.length; i++) {
- if (testSet(this.set[i], version))
- return true;
- }
- return false;
-};
-
-function testSet(set, version) {
- for (var i = 0; i < set.length; i++) {
- if (!set[i].test(version))
- return false;
- }
-
- if (version.prerelease.length) {
- // Find the set of versions that are allowed to have prereleases
- // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
- // That should allow `1.2.3-pr.2` to pass.
- // However, `1.2.4-alpha.notready` should NOT be allowed,
- // even though it's within the range set by the comparators.
- for (var i = 0; i < set.length; i++) {
- debug(set[i].semver);
- if (set[i].semver === ANY)
- continue;
-
- if (set[i].semver.prerelease.length > 0) {
- var allowed = set[i].semver;
- if (allowed.major === version.major &&
- allowed.minor === version.minor &&
- allowed.patch === version.patch)
- return true;
- }
- }
-
- // Version has a -pre, but it's not one of the ones we like.
- return false;
- }
-
- return true;
-}
-
-exports.satisfies = satisfies;
-function satisfies(version, range, loose) {
- try {
- range = new Range(range, loose);
- } catch (er) {
- return false;
- }
- return range.test(version);
-}
-
-exports.maxSatisfying = maxSatisfying;
-function maxSatisfying(versions, range, loose) {
- var max = null;
- var maxSV = null;
- try {
- var rangeObj = new Range(range, loose);
- } catch (er) {
- return null;
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) { // satisfies(v, range, loose)
- if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
- max = v;
- maxSV = new SemVer(max, loose);
- }
- }
- })
- return max;
-}
-
-exports.minSatisfying = minSatisfying;
-function minSatisfying(versions, range, loose) {
- var min = null;
- var minSV = null;
- try {
- var rangeObj = new Range(range, loose);
- } catch (er) {
- return null;
- }
- versions.forEach(function (v) {
- if (rangeObj.test(v)) { // satisfies(v, range, loose)
- if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
- min = v;
- minSV = new SemVer(min, loose);
- }
- }
- })
- return min;
-}
-
-exports.validRange = validRange;
-function validRange(range, loose) {
- try {
- // Return '*' instead of '' so that truthiness works.
- // This will throw if it's invalid anyway
- return new Range(range, loose).range || '*';
- } catch (er) {
- return null;
- }
-}
-
-// Determine if version is less than all the versions possible in the range
-exports.ltr = ltr;
-function ltr(version, range, loose) {
- return outside(version, range, '<', loose);
-}
-
-// Determine if version is greater than all the versions possible in the range.
-exports.gtr = gtr;
-function gtr(version, range, loose) {
- return outside(version, range, '>', loose);
-}
-
-exports.outside = outside;
-function outside(version, range, hilo, loose) {
- version = new SemVer(version, loose);
- range = new Range(range, loose);
-
- var gtfn, ltefn, ltfn, comp, ecomp;
- switch (hilo) {
- case '>':
- gtfn = gt;
- ltefn = lte;
- ltfn = lt;
- comp = '>';
- ecomp = '>=';
- break;
- case '<':
- gtfn = lt;
- ltefn = gte;
- ltfn = gt;
- comp = '<';
- ecomp = '<=';
- break;
- default:
- throw new TypeError('Must provide a hilo val of "<" or ">"');
- }
-
- // If it satisifes the range it is not outside
- if (satisfies(version, range, loose)) {
- return false;
- }
-
- // From now on, variable terms are as if we're in "gtr" mode.
- // but note that everything is flipped for the "ltr" function.
-
- for (var i = 0; i < range.set.length; ++i) {
- var comparators = range.set[i];
-
- var high = null;
- var low = null;
-
- comparators.forEach(function(comparator) {
- if (comparator.semver === ANY) {
- comparator = new Comparator('>=0.0.0')
- }
- high = high || comparator;
- low = low || comparator;
- if (gtfn(comparator.semver, high.semver, loose)) {
- high = comparator;
- } else if (ltfn(comparator.semver, low.semver, loose)) {
- low = comparator;
- }
- });
-
- // If the edge version comparator has a operator then our version
- // isn't outside it
- if (high.operator === comp || high.operator === ecomp) {
- return false;
- }
-
- // If the lowest version comparator has an operator and our version
- // is less than it then it isn't higher than the range
- if ((!low.operator || low.operator === comp) &&
- ltefn(version, low.semver)) {
- return false;
- } else if (low.operator === ecomp && ltfn(version, low.semver)) {
- return false;
- }
- }
- return true;
-}
-
-exports.prerelease = prerelease;
-function prerelease(version, loose) {
- var parsed = parse(version, loose);
- return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
-}
-
-exports.intersects = intersects;
-function intersects(r1, r2, loose) {
- r1 = new Range(r1, loose)
- r2 = new Range(r2, loose)
- return r1.intersects(r2)
-}
-
-exports.coerce = coerce;
-function coerce(version) {
- if (version instanceof SemVer)
- return version;
-
- if (typeof version !== 'string')
- return null;
-
- var match = version.match(re[COERCE]);
-
- if (match == null)
- return null;
-
- return parse((match[1] || '0') + '.' + (match[2] || '0') + '.' + (match[3] || '0'));
-}
-
-
-/***/ }),
-/* 23 */
-/***/ (function(module, exports) {
-
-module.exports = require("stream");
-
-/***/ }),
-/* 24 */
-/***/ (function(module, exports) {
-
-module.exports = require("url");
-
-/***/ }),
-/* 25 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return Subscription; });
-/* 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__(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 */
-
-
-
-
-
-
-var Subscription = /*@__PURE__*/ (function () {
- function Subscription(unsubscribe) {
- this.closed = false;
- this._parent = null;
- this._parents = null;
- this._subscriptions = null;
- if (unsubscribe) {
- this._unsubscribe = unsubscribe;
- }
- }
- Subscription.prototype.unsubscribe = function () {
- var hasErrors = false;
- var errors;
- if (this.closed) {
- return;
- }
- var _a = this, _parent = _a._parent, _parents = _a._parents, _unsubscribe = _a._unsubscribe, _subscriptions = _a._subscriptions;
- this.closed = true;
- this._parent = null;
- this._parents = null;
- this._subscriptions = null;
- var index = -1;
- var len = _parents ? _parents.length : 0;
- while (_parent) {
- _parent.remove(this);
- _parent = ++index < len && _parents[index] || null;
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__util_isFunction__["a" /* isFunction */])(_unsubscribe)) {
- var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(_unsubscribe).call(this);
- if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
- hasErrors = true;
- errors = errors || (__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */] ?
- flattenUnsubscriptionErrors(__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e.errors) : [__WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e]);
- }
- }
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_isArray__["a" /* isArray */])(_subscriptions)) {
- index = -1;
- len = _subscriptions.length;
- while (++index < len) {
- var sub = _subscriptions[index];
- if (__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__util_isObject__["a" /* isObject */])(sub)) {
- var trial = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__util_tryCatch__["a" /* tryCatch */])(sub.unsubscribe).call(sub);
- if (trial === __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */]) {
- hasErrors = true;
- errors = errors || [];
- var err = __WEBPACK_IMPORTED_MODULE_4__util_errorObject__["a" /* errorObject */].e;
- if (err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) {
- errors = errors.concat(flattenUnsubscriptionErrors(err.errors));
- }
- else {
- errors.push(err);
- }
- }
- }
- }
- }
- if (hasErrors) {
- throw new __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */](errors);
- }
- };
- Subscription.prototype.add = function (teardown) {
- if (!teardown || (teardown === Subscription.EMPTY)) {
- return Subscription.EMPTY;
- }
- if (teardown === this) {
- return this;
- }
- var subscription = teardown;
- switch (typeof teardown) {
- case 'function':
- subscription = new Subscription(teardown);
- case 'object':
- if (subscription.closed || typeof subscription.unsubscribe !== 'function') {
- return subscription;
- }
- else if (this.closed) {
- subscription.unsubscribe();
- return subscription;
- }
- else if (typeof subscription._addParent !== 'function') {
- var tmp = subscription;
- subscription = new Subscription();
- subscription._subscriptions = [tmp];
- }
- break;
- default:
- throw new Error('unrecognized teardown ' + teardown + ' added to Subscription.');
- }
- var subscriptions = this._subscriptions || (this._subscriptions = []);
- subscriptions.push(subscription);
- subscription._addParent(this);
- return subscription;
- };
- Subscription.prototype.remove = function (subscription) {
- var subscriptions = this._subscriptions;
- if (subscriptions) {
- var subscriptionIndex = subscriptions.indexOf(subscription);
- if (subscriptionIndex !== -1) {
- subscriptions.splice(subscriptionIndex, 1);
- }
- }
- };
- Subscription.prototype._addParent = function (parent) {
- var _a = this, _parent = _a._parent, _parents = _a._parents;
- if (!_parent || _parent === parent) {
- this._parent = parent;
- }
- else if (!_parents) {
- this._parents = [parent];
- }
- else if (_parents.indexOf(parent) === -1) {
- _parents.push(parent);
- }
- };
- Subscription.EMPTY = (function (empty) {
- empty.closed = true;
- return empty;
- }(new Subscription()));
- return Subscription;
-}());
-
-function flattenUnsubscriptionErrors(errors) {
- return errors.reduce(function (errs, err) { return errs.concat((err instanceof __WEBPACK_IMPORTED_MODULE_5__util_UnsubscriptionError__["a" /* UnsubscriptionError */]) ? err.errors : err); }, []);
-}
-//# sourceMappingURL=Subscription.js.map
-
-
-/***/ }),
-/* 26 */
-/***/ (function(module, exports, __webpack_require__) {
-
-// Copyright 2015 Joyent, Inc.
-
-module.exports = {
- bufferSplit: bufferSplit,
- addRSAMissing: addRSAMissing,
- calculateDSAPublic: calculateDSAPublic,
- calculateED25519Public: calculateED25519Public,
- calculateX25519Public: calculateX25519Public,
- mpNormalize: mpNormalize,
- mpDenormalize: mpDenormalize,
- ecNormalize: ecNormalize,
- countZeros: countZeros,
- assertCompatible: assertCompatible,
- isCompatible: isCompatible,
- opensslKeyDeriv: opensslKeyDeriv,
- opensshCipherInfo: opensshCipherInfo,
- publicFromPrivateECDSA: publicFromPrivateECDSA,
- zeroPadToLength: zeroPadToLength,
- writeBitString: writeBitString,
- readBitString: readBitString
-};
-
-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__(11);
-var algs = __webpack_require__(32);
-var asn1 = __webpack_require__(66);
-
-var ec, jsbn;
-var nacl;
-
-var MAX_CLASS_DEPTH = 3;
-
-function isCompatible(obj, klass, needVer) {
- if (obj === null || typeof (obj) !== 'object')
- return (false);
- if (needVer === undefined)
- needVer = klass.prototype._sshpkApiVersion;
- if (obj instanceof klass &&
- klass.prototype._sshpkApiVersion[0] == needVer[0])
- return (true);
- var proto = Object.getPrototypeOf(obj);
- var depth = 0;
- while (proto.constructor.name !== klass.name) {
- proto = Object.getPrototypeOf(proto);
- if (!proto || ++depth > MAX_CLASS_DEPTH)
- return (false);
- }
- if (proto.constructor.name !== klass.name)
- return (false);
- var ver = proto._sshpkApiVersion;
- if (ver === undefined)
- ver = klass._oldVersionDetect(obj);
- if (ver[0] != needVer[0] || ver[1] < needVer[1])
- return (false);
- return (true);
-}
-
-function assertCompatible(obj, klass, needVer, name) {
- if (name === undefined)
- name = 'object';
- assert.ok(obj, name + ' must not be null');
- assert.object(obj, name + ' must be an object');
- if (needVer === undefined)
- needVer = klass.prototype._sshpkApiVersion;
- if (obj instanceof klass &&
- klass.prototype._sshpkApiVersion[0] == needVer[0])
- return;
- var proto = Object.getPrototypeOf(obj);
- var depth = 0;
- while (proto.constructor.name !== klass.name) {
- proto = Object.getPrototypeOf(proto);
- assert.ok(proto && ++depth <= MAX_CLASS_DEPTH,
- name + ' must be a ' + klass.name + ' instance');
- }
- assert.strictEqual(proto.constructor.name, klass.name,
- name + ' must be a ' + klass.name + ' instance');
- var ver = proto._sshpkApiVersion;
- if (ver === undefined)
- ver = klass._oldVersionDetect(obj);
- assert.ok(ver[0] == needVer[0] && ver[1] >= needVer[1],
- name + ' must be compatible with ' + klass.name + ' klass ' +
- 'version ' + needVer[0] + '.' + needVer[1]);
-}
-
-var CIPHER_LEN = {
- 'des-ede3-cbc': { key: 7, iv: 8 },
- 'aes-128-cbc': { key: 16, iv: 16 }
-};
-var PKCS5_SALT_LEN = 8;
-
-function opensslKeyDeriv(cipher, salt, passphrase, count) {
- assert.buffer(salt, 'salt');
- assert.buffer(passphrase, 'passphrase');
- assert.number(count, 'iteration count');
-
- var clen = CIPHER_LEN[cipher];
- assert.object(clen, 'supported cipher');
-
- salt = salt.slice(0, PKCS5_SALT_LEN);
-
- var D, D_prev, bufs;
- var material = Buffer.alloc(0);
- while (material.length < clen.key + clen.iv) {
- bufs = [];
- if (D_prev)
- bufs.push(D_prev);
- bufs.push(passphrase);
- bufs.push(salt);
- D = Buffer.concat(bufs);
- for (var j = 0; j < count; ++j)
- D = crypto.createHash('md5').update(D).digest();
- material = Buffer.concat([material, D]);
- D_prev = D;
- }
-
- return ({
- key: material.slice(0, clen.key),
- iv: material.slice(clen.key, clen.key + clen.iv)
- });
-}
-
-/* Count leading zero bits on a buffer */
-function countZeros(buf) {
- var o = 0, obit = 8;
- while (o < buf.length) {
- var mask = (1 << obit);
- if ((buf[o] & mask) === mask)
- break;
- obit--;
- if (obit < 0) {
- o++;
- obit = 8;
- }
- }
- return (o*8 + (8 - obit) - 1);
-}
-
-function bufferSplit(buf, chr) {
- assert.buffer(buf);
- assert.string(chr);
-
- var parts = [];
- var lastPart = 0;
- var matches = 0;
- for (var i = 0; i < buf.length; ++i) {
- if (buf[i] === chr.charCodeAt(matches))
- ++matches;
- else if (buf[i] === chr.charCodeAt(0))
- matches = 1;
- else
- matches = 0;
-
- if (matches >= chr.length) {
- var newPart = i + 1;
- parts.push(buf.slice(lastPart, newPart - matches));
- lastPart = newPart;
- matches = 0;
- }
- }
- if (lastPart <= buf.length)
- parts.push(buf.slice(lastPart, buf.length));
-
- return (parts);
-}
-
-function ecNormalize(buf, addZero) {
- assert.buffer(buf);
- if (buf[0] === 0x00 && buf[1] === 0x04) {
- if (addZero)
- return (buf);
- return (buf.slice(1));
- } else if (buf[0] === 0x04) {
- if (!addZero)
- return (buf);
- } else {
- while (buf[0] === 0x00)
- buf = buf.slice(1);
- if (buf[0] === 0x02 || buf[0] === 0x03)
- throw (new Error('Compressed elliptic curve points ' +
- 'are not supported'));
- if (buf[0] !== 0x04)
- throw (new Error('Not a valid elliptic curve point'));
- if (!addZero)
- return (buf);
- }
- var b = Buffer.alloc(buf.length + 1);
- b[0] = 0x0;
- buf.copy(b, 1);
- return (b);
-}
-
-function readBitString(der, tag) {
- if (tag === undefined)
- tag = asn1.Ber.BitString;
- var buf = der.readString(tag, true);
- assert.strictEqual(buf[0], 0x00, 'bit strings with unused bits are ' +
- 'not supported (0x' + buf[0].toString(16) + ')');
- return (buf.slice(1));
-}
-
-function writeBitString(der, buf, tag) {
- if (tag === undefined)
- tag = asn1.Ber.BitString;
- var b = Buffer.alloc(buf.length + 1);
- b[0] = 0x00;
- buf.copy(b, 1);
- der.writeBuffer(b, tag);
-}
-
-function mpNormalize(buf) {
- assert.buffer(buf);
- while (buf.length > 1 && buf[0] === 0x00 && (buf[1] & 0x80) === 0x00)
- buf = buf.slice(1);
- if ((buf[0] & 0x80) === 0x80) {
- var b = Buffer.alloc(buf.length + 1);
- b[0] = 0x00;
- buf.copy(b, 1);
- buf = b;
- }
- return (buf);
-}
-
-function mpDenormalize(buf) {
- assert.buffer(buf);
- while (buf.length > 1 && buf[0] === 0x00)
- buf = buf.slice(1);
- return (buf);
-}
-
-function zeroPadToLength(buf, len) {
- assert.buffer(buf);
- assert.number(len);
- while (buf.length > len) {
- assert.equal(buf[0], 0x00);
- buf = buf.slice(1);
- }
- while (buf.length < len) {
- var b = Buffer.alloc(buf.length + 1);
- b[0] = 0x00;
- buf.copy(b, 1);
- buf = b;
- }
- return (buf);
-}
-
-function bigintToMpBuf(bigint) {
- var buf = Buffer.from(bigint.toByteArray());
- buf = mpNormalize(buf);
- return (buf);
-}
-
-function calculateDSAPublic(g, p, x) {
- assert.buffer(g);
- assert.buffer(p);
- assert.buffer(x);
- try {
- var bigInt = __webpack_require__(81).BigInteger;
- } catch (e) {
- throw (new Error('To load a PKCS#8 format DSA private key, ' +
- 'the node jsbn library is required.'));
- }
- g = new bigInt(g);
- p = new bigInt(p);
- x = new bigInt(x);
- var y = g.modPow(x, p);
- var ybuf = bigintToMpBuf(y);
- return (ybuf);
-}
-
-function calculateED25519Public(k) {
- assert.buffer(k);
-
- if (nacl === undefined)
- nacl = __webpack_require__(76);
-
- var kp = nacl.sign.keyPair.fromSeed(new Uint8Array(k));
- return (Buffer.from(kp.publicKey));
-}
-
-function calculateX25519Public(k) {
- assert.buffer(k);
-
- if (nacl === undefined)
- nacl = __webpack_require__(76);
-
- var kp = nacl.box.keyPair.fromSeed(new Uint8Array(k));
- return (Buffer.from(kp.publicKey));
-}
-
-function addRSAMissing(key) {
- assert.object(key);
- assertCompatible(key, PrivateKey, [1, 1]);
- try {
- var bigInt = __webpack_require__(81).BigInteger;
- } catch (e) {
- throw (new Error('To write a PEM private key from ' +
- 'this source, the node jsbn lib is required.'));
- }
-
- var d = new bigInt(key.part.d.data);
- var buf;
-
- if (!key.part.dmodp) {
- var p = new bigInt(key.part.p.data);
- var dmodp = d.mod(p.subtract(1));
-
- buf = bigintToMpBuf(dmodp);
- key.part.dmodp = {name: 'dmodp', data: buf};
- key.parts.push(key.part.dmodp);
- }
- if (!key.part.dmodq) {
- var q = new bigInt(key.part.q.data);
- var dmodq = d.mod(q.subtract(1));
-
- buf = bigintToMpBuf(dmodq);
- key.part.dmodq = {name: 'dmodq', data: buf};
- key.parts.push(key.part.dmodq);
- }
-}
-
-function publicFromPrivateECDSA(curveName, priv) {
- assert.string(curveName, 'curveName');
- assert.buffer(priv);
- if (ec === undefined)
- ec = __webpack_require__(139);
- if (jsbn === undefined)
- jsbn = __webpack_require__(81).BigInteger;
- var params = algs.curves[curveName];
- var p = new jsbn(params.p);
- var a = new jsbn(params.a);
- var b = new jsbn(params.b);
- var curve = new ec.ECCurveFp(p, a, b);
- var G = curve.decodePointHex(params.G.toString('hex'));
-
- var d = new jsbn(mpNormalize(priv));
- var pub = G.multiply(d);
- pub = Buffer.from(curve.encodePointHex(pub), 'hex');
-
- var parts = [];
- parts.push({name: 'curve', data: Buffer.from(curveName)});
- parts.push({name: 'Q', data: pub});
-
- var key = new Key({type: 'ecdsa', curve: curve, parts: parts});
- return (key);
-}
-
-function opensshCipherInfo(cipher) {
- var inf = {};
- switch (cipher) {
- case '3des-cbc':
- inf.keySize = 24;
- inf.blockSize = 8;
- inf.opensslName = 'des-ede3-cbc';
- break;
- case 'blowfish-cbc':
- inf.keySize = 16;
- inf.blockSize = 8;
- inf.opensslName = 'bf-cbc';
- break;
- case 'aes128-cbc':
- case 'aes128-ctr':
- case 'aes128-gcm@openssh.com':
- inf.keySize = 16;
- inf.blockSize = 16;
- inf.opensslName = 'aes-128-' + cipher.slice(7, 10);
- break;
- case 'aes192-cbc':
- case 'aes192-ctr':
- case 'aes192-gcm@openssh.com':
- inf.keySize = 24;
- inf.blockSize = 16;
- inf.opensslName = 'aes-192-' + cipher.slice(7, 10);
- break;
- case 'aes256-cbc':
- case 'aes256-ctr':
- case 'aes256-gcm@openssh.com':
- inf.keySize = 32;
- inf.blockSize = 16;
- inf.opensslName = 'aes-256-' + cipher.slice(7, 10);
- break;
- default:
- throw (new Error(
- 'Unsupported openssl cipher "' + cipher + '"'));
- }
- return (inf);
-}
-
-
-/***/ }),
-/* 27 */
-/***/ (function(module, exports, __webpack_require__) {
-
-// Copyright 2017 Joyent, Inc.
-
-module.exports = Key;
-
-var assert = __webpack_require__(16);
-var algs = __webpack_require__(32);
-var crypto = __webpack_require__(11);
-var Fingerprint = __webpack_require__(156);
-var Signature = __webpack_require__(75);
-var DiffieHellman = __webpack_require__(325).DiffieHellman;
-var errs = __webpack_require__(74);
-var utils = __webpack_require__(26);
-var PrivateKey = __webpack_require__(33);
-var edCompat;
-
-try {
- edCompat = __webpack_require__(454);
-} catch (e) {
- /* Just continue through, and bail out if we try to use it. */
-}
-
-var InvalidAlgorithmError = errs.InvalidAlgorithmError;
-var KeyParseError = errs.KeyParseError;
-
-var formats = {};
-formats['auto'] = __webpack_require__(455);
-formats['pem'] = __webpack_require__(86);
-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['openssh'] = formats['ssh-private'];
-formats['dnssec'] = __webpack_require__(326);
-
-function Key(opts) {
- assert.object(opts, 'options');
- assert.arrayOfObject(opts.parts, 'options.parts');
- assert.string(opts.type, 'options.type');
- assert.optionalString(opts.comment, 'options.comment');
-
- var algInfo = algs.info[opts.type];
- if (typeof (algInfo) !== 'object')
- throw (new InvalidAlgorithmError(opts.type));
-
- var partLookup = {};
- for (var i = 0; i < opts.parts.length; ++i) {
- var part = opts.parts[i];
- partLookup[part.name] = part;
- }
-
- this.type = opts.type;
- this.parts = opts.parts;
- this.part = partLookup;
- this.comment = undefined;
- this.source = opts.source;
-
- /* for speeding up hashing/fingerprint operations */
- this._rfc4253Cache = opts._rfc4253Cache;
- this._hashCache = {};
-
- var sz;
- this.curve = undefined;
- if (this.type === 'ecdsa') {
- var curve = this.part.curve.data.toString();
- this.curve = curve;
- sz = algs.curves[curve].size;
- } else if (this.type === 'ed25519' || this.type === 'curve25519') {
- sz = 256;
- this.curve = 'curve25519';
- } else {
- var szPart = this.part[algInfo.sizePart];
- sz = szPart.data.length;
- sz = sz * 8 - utils.countZeros(szPart.data);
- }
- this.size = sz;
-}
-
-Key.formats = formats;
-
-Key.prototype.toBuffer = function (format, options) {
- if (format === undefined)
- format = 'ssh';
- assert.string(format, 'format');
- assert.object(formats[format], 'formats[format]');
- assert.optionalObject(options, 'options');
-
- if (format === 'rfc4253') {
- if (this._rfc4253Cache === undefined)
- this._rfc4253Cache = formats['rfc4253'].write(this);
- return (this._rfc4253Cache);
- }
-
- return (formats[format].write(this, options));
-};
-
-Key.prototype.toString = function (format, options) {
- return (this.toBuffer(format, options).toString());
-};
-
-Key.prototype.hash = function (algo) {
- assert.string(algo, 'algorithm');
- algo = algo.toLowerCase();
- if (algs.hashAlgs[algo] === undefined)
- throw (new InvalidAlgorithmError(algo));
-
- if (this._hashCache[algo])
- return (this._hashCache[algo]);
- var hash = crypto.createHash(algo).
- update(this.toBuffer('rfc4253')).digest();
- this._hashCache[algo] = hash;
- return (hash);
-};
-
-Key.prototype.fingerprint = function (algo) {
- if (algo === undefined)
- algo = 'sha256';
- assert.string(algo, 'algorithm');
- var opts = {
- type: 'key',
- hash: this.hash(algo),
- algorithm: algo
- };
- return (new Fingerprint(opts));
-};
-
-Key.prototype.defaultHashAlgorithm = function () {
- var hashAlgo = 'sha1';
- if (this.type === 'rsa')
- hashAlgo = 'sha256';
- if (this.type === 'dsa' && this.size > 1024)
- hashAlgo = 'sha256';
- if (this.type === 'ed25519')
- hashAlgo = 'sha512';
- if (this.type === 'ecdsa') {
- if (this.size <= 256)
- hashAlgo = 'sha256';
- else if (this.size <= 384)
- hashAlgo = 'sha384';
- else
- hashAlgo = 'sha512';
- }
- return (hashAlgo);
-};
-
-Key.prototype.createVerify = function (hashAlgo) {
- if (hashAlgo === undefined)
- hashAlgo = this.defaultHashAlgorithm();
- assert.string(hashAlgo, 'hash algorithm');
-
- /* ED25519 is not supported by OpenSSL, use a javascript impl. */
- if (this.type === 'ed25519' && edCompat !== undefined)
- return (new edCompat.Verifier(this, hashAlgo));
- if (this.type === 'curve25519')
- throw (new Error('Curve25519 keys are not suitable for ' +
- 'signing or verification'));
-
- var v, nm, err;
- try {
- nm = hashAlgo.toUpperCase();
- v = crypto.createVerify(nm);
- } catch (e) {
- err = e;
- }
- if (v === undefined || (err instanceof Error &&
- err.message.match(/Unknown message digest/))) {
- nm = 'RSA-';
- nm += hashAlgo.toUpperCase();
- v = crypto.createVerify(nm);
- }
- assert.ok(v, 'failed to create verifier');
- var oldVerify = v.verify.bind(v);
- var key = this.toBuffer('pkcs8');
- var curve = this.curve;
- var self = this;
- v.verify = function (signature, fmt) {
- if (Signature.isSignature(signature, [2, 0])) {
- if (signature.type !== self.type)
- return (false);
- if (signature.hashAlgorithm &&
- signature.hashAlgorithm !== hashAlgo)
- return (false);
- if (signature.curve && self.type === 'ecdsa' &&
- signature.curve !== curve)
- return (false);
- return (oldVerify(key, signature.toBuffer('asn1')));
-
- } else if (typeof (signature) === 'string' ||
- Buffer.isBuffer(signature)) {
- return (oldVerify(key, signature, fmt));
-
- /*
- * Avoid doing this on valid arguments, walking the prototype
- * chain can be quite slow.
- */
- } else if (Signature.isSignature(signature, [1, 0])) {
- throw (new Error('signature was created by too old ' +
- 'a version of sshpk and cannot be verified'));
-
- } else {
- throw (new TypeError('signature must be a string, ' +
- 'Buffer, or Signature object'));
- }
- };
- return (v);
-};
-
-Key.prototype.createDiffieHellman = function () {
- if (this.type === 'rsa')
- throw (new Error('RSA keys do not support Diffie-Hellman'));
-
- return (new DiffieHellman(this));
-};
-Key.prototype.createDH = Key.prototype.createDiffieHellman;
-
-Key.parse = function (data, format, options) {
- if (typeof (data) !== 'string')
- assert.buffer(data, 'data');
- if (format === undefined)
- format = 'auto';
- assert.string(format, 'format');
- if (typeof (options) === 'string')
- options = { filename: options };
- assert.optionalObject(options, 'options');
- if (options === undefined)
- options = {};
- assert.optionalString(options.filename, 'options.filename');
- if (options.filename === undefined)
- options.filename = '(unnamed)';
-
- assert.object(formats[format], 'formats[format]');
-
- try {
- var k = formats[format].read(data, options);
- if (k instanceof PrivateKey)
- k = k.toPublic();
- if (!k.comment)
- k.comment = options.filename;
- return (k);
- } catch (e) {
- if (e.name === 'KeyEncryptedError')
- throw (e);
- throw (new KeyParseError(options.filename, format, e));
- }
-};
-
-Key.isKey = function (obj, ver) {
- return (utils.isCompatible(obj, Key, ver));
-};
-
-/*
- * API versions for Key:
- * [1,0] -- initial ver, may take Signature for createVerify or may not
- * [1,1] -- added pkcs1, pkcs8 formats
- * [1,2] -- added auto, ssh-private, openssh formats
- * [1,3] -- added defaultHashAlgorithm
- * [1,4] -- added ed support, createDH
- * [1,5] -- first explicitly tagged version
- * [1,6] -- changed ed25519 part names
- */
-Key.prototype._sshpkApiVersion = [1, 6];
-
-Key._oldVersionDetect = function (obj) {
- assert.func(obj.toBuffer);
- assert.func(obj.fingerprint);
- if (obj.createDH)
- return ([1, 4]);
- if (obj.defaultHashAlgorithm)
- return ([1, 3]);
- if (obj.formats['auto'])
- return ([1, 2]);
- if (obj.formats['pkcs1'])
- return ([1, 1]);
- return ([1, 0]);
-};
-
-
-/***/ }),
-/* 28 */
-/***/ (function(module, exports) {
-
-module.exports = require("assert");
-
-/***/ }),
-/* 29 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.default = nullify;
-function nullify(obj = {}) {
- if (Array.isArray(obj)) {
- for (var _iterator = obj, _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 item = _ref;
-
- nullify(item);
- }
- } else if (obj !== null && typeof obj === 'object' || typeof obj === 'function') {
- Object.setPrototypeOf(obj, null);
-
- // for..in can only be applied to 'object', not 'function'
- if (typeof obj === 'object') {
- for (const key in obj) {
- nullify(obj[key]);
- }
- }
- }
-
- return obj;
-}
-
-/***/ }),
-/* 30 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-const escapeStringRegexp = __webpack_require__(388);
-const ansiStyles = __webpack_require__(506);
-const stdoutColor = __webpack_require__(598).stdout;
-
-const template = __webpack_require__(599);
-
-const isSimpleWindowsTerm = process.platform === 'win32' && !(process.env.TERM || '').toLowerCase().startsWith('xterm');
-
-// `supportsColor.level` → `ansiStyles.color[name]` mapping
-const levelMapping = ['ansi', 'ansi', 'ansi256', 'ansi16m'];
-
-// `color-convert` models to exclude from the Chalk API due to conflicts and such
-const skipModels = new Set(['gray']);
-
-const styles = Object.create(null);
-
-function applyOptions(obj, options) {
- options = options || {};
-
- // Detect level if not set manually
- const scLevel = stdoutColor ? stdoutColor.level : 0;
- obj.level = options.level === undefined ? scLevel : options.level;
- obj.enabled = 'enabled' in options ? options.enabled : obj.level > 0;
-}
-
-function Chalk(options) {
- // We check for this.template here since calling `chalk.constructor()`
- // by itself will have a `this` of a previously constructed chalk object
- if (!this || !(this instanceof Chalk) || this.template) {
- const chalk = {};
- applyOptions(chalk, options);
-
- chalk.template = function () {
- const args = [].slice.call(arguments);
- return chalkTag.apply(null, [chalk.template].concat(args));
- };
-
- Object.setPrototypeOf(chalk, Chalk.prototype);
- Object.setPrototypeOf(chalk.template, chalk);
-
- chalk.template.constructor = Chalk;
-
- return chalk.template;
- }
-
- applyOptions(this, options);
-}
-
-// Use bright blue on Windows as the normal blue color is illegible
-if (isSimpleWindowsTerm) {
- ansiStyles.blue.open = '\u001B[94m';
-}
-
-for (const key of Object.keys(ansiStyles)) {
- ansiStyles[key].closeRe = new RegExp(escapeStringRegexp(ansiStyles[key].close), 'g');
-
- styles[key] = {
- get() {
- const codes = ansiStyles[key];
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, key);
- }
- };
-}
-
-styles.visible = {
- get() {
- return build.call(this, this._styles || [], true, 'visible');
- }
-};
-
-ansiStyles.color.closeRe = new RegExp(escapeStringRegexp(ansiStyles.color.close), 'g');
-for (const model of Object.keys(ansiStyles.color.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
-
- styles[model] = {
- get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.color[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.color.close,
- closeRe: ansiStyles.color.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
-}
-
-ansiStyles.bgColor.closeRe = new RegExp(escapeStringRegexp(ansiStyles.bgColor.close), 'g');
-for (const model of Object.keys(ansiStyles.bgColor.ansi)) {
- if (skipModels.has(model)) {
- continue;
- }
-
- const bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);
- styles[bgModel] = {
- get() {
- const level = this.level;
- return function () {
- const open = ansiStyles.bgColor[levelMapping[level]][model].apply(null, arguments);
- const codes = {
- open,
- close: ansiStyles.bgColor.close,
- closeRe: ansiStyles.bgColor.closeRe
- };
- return build.call(this, this._styles ? this._styles.concat(codes) : [codes], this._empty, model);
- };
- }
- };
-}
-
-const proto = Object.defineProperties(() => {}, styles);
-
-function build(_styles, _empty, key) {
- const builder = function () {
- return applyStyle.apply(builder, arguments);
- };
-
- builder._styles = _styles;
- builder._empty = _empty;
-
- const self = this;
-
- Object.defineProperty(builder, 'level', {
- enumerable: true,
- get() {
- return self.level;
- },
- set(level) {
- self.level = level;
- }
- });
-
- Object.defineProperty(builder, 'enabled', {
- enumerable: true,
- get() {
- return self.enabled;
- },
- set(enabled) {
- self.enabled = enabled;
- }
- });
-
- // See below for fix regarding invisible grey/dim combination on Windows
- builder.hasGrey = this.hasGrey || key === 'gray' || key === 'grey';
-
- // `__proto__` is used because we must return a function, but there is
- // no way to create a function with a different prototype
- builder.__proto__ = proto; // eslint-disable-line no-proto
-
- return builder;
-}
-
-function applyStyle() {
- // Support varags, but simply cast to string in case there's only one arg
- const args = arguments;
- const argsLen = args.length;
- let str = String(arguments[0]);
-
- if (argsLen === 0) {
- return '';
- }
-
- if (argsLen > 1) {
- // Don't slice `arguments`, it prevents V8 optimizations
- for (let a = 1; a < argsLen; a++) {
- str += ' ' + args[a];
- }
- }
-
- if (!this.enabled || this.level <= 0 || !str) {
- return this._empty ? '' : str;
- }
-
- // Turns out that on Windows dimmed gray text becomes invisible in cmd.exe,
- // see https://github.com/chalk/chalk/issues/58
- // If we're on Windows and we're dealing with a gray color, temporarily make 'dim' a noop.
- const originalDim = ansiStyles.dim.open;
- if (isSimpleWindowsTerm && this.hasGrey) {
- ansiStyles.dim.open = '';
- }
-
- for (const code of this._styles.slice().reverse()) {
- // Replace any instances already present with a re-opening code
- // otherwise only the part of the string until said closing code
- // will be colored, and the rest will simply be 'plain'.
- str = code.open + str.replace(code.closeRe, code.open) + code.close;
-
- // Close the styling before a linebreak and reopen
- // after next line to fix a bleed issue on macOS
- // https://github.com/chalk/chalk/pull/92
- str = str.replace(/\r?\n/g, `${code.close}$&${code.open}`);
- }
-
- // Reset the original `dim` if we changed it to work around the Windows dimmed gray issue
- ansiStyles.dim.open = originalDim;
-
- return str;
-}
-
-function chalkTag(chalk, strings) {
- if (!Array.isArray(strings)) {
- // If chalk() was called by itself or with a string,
- // return the string itself as a string.
- return [].slice.call(arguments, 1).join(' ');
- }
-
- const args = [].slice.call(arguments, 2);
- const parts = [strings.raw[0]];
-
- for (let i = 1; i < strings.length; i++) {
- parts.push(String(args[i - 1]).replace(/[{}\\]/g, '\\$&'));
- parts.push(String(strings.raw[i]));
- }
-
- return template(chalk, parts.join(''));
-}
-
-Object.defineProperties(Chalk.prototype, styles);
-
-module.exports = Chalk(); // eslint-disable-line new-cap
-module.exports.supportsColor = stdoutColor;
-module.exports.default = module.exports; // For TypeScript
-
-
-/***/ }),
-/* 31 */
-/***/ (function(module, exports) {
-
-var core = module.exports = { version: '2.5.7' };
-if (typeof __e == 'number') __e = core; // eslint-disable-line no-undef
-
-
-/***/ }),
-/* 32 */
-/***/ (function(module, exports, __webpack_require__) {
-
-// Copyright 2015 Joyent, Inc.
-
-var Buffer = __webpack_require__(15).Buffer;
-
-var algInfo = {
- 'dsa': {
- parts: ['p', 'q', 'g', 'y'],
- sizePart: 'p'
- },
- 'rsa': {
- parts: ['e', 'n'],
- sizePart: 'n'
- },
- 'ecdsa': {
- parts: ['curve', 'Q'],
- sizePart: 'Q'
- },
- 'ed25519': {
- parts: ['A'],
- sizePart: 'A'
- }
-};
-algInfo['curve25519'] = algInfo['ed25519'];
-
-var algPrivInfo = {
- 'dsa': {
- parts: ['p', 'q', 'g', 'y', 'x']
- },
- 'rsa': {
- parts: ['n', 'e', 'd', 'iqmp', 'p', 'q']
- },
- 'ecdsa': {
- parts: ['curve', 'Q', 'd']
- },
- 'ed25519': {
- parts: ['A', 'k']
- }
-};
-algPrivInfo['curve25519'] = algPrivInfo['ed25519'];
-
-var hashAlgs = {
- 'md5': true,
- 'sha1': true,
- 'sha256': true,
- 'sha384': true,
- 'sha512': true
-};
-
-/*
- * Taken from
- * http://csrc.nist.gov/groups/ST/toolkit/documents/dss/NISTReCur.pdf
- */
-var curves = {
- 'nistp256': {
- size: 256,
- pkcs8oid: '1.2.840.10045.3.1.7',
- p: Buffer.from(('00' +
- 'ffffffff 00000001 00000000 00000000' +
- '00000000 ffffffff ffffffff ffffffff').
- replace(/ /g, ''), 'hex'),
- a: Buffer.from(('00' +
- 'FFFFFFFF 00000001 00000000 00000000' +
- '00000000 FFFFFFFF FFFFFFFF FFFFFFFC').
- replace(/ /g, ''), 'hex'),
- b: Buffer.from((
- '5ac635d8 aa3a93e7 b3ebbd55 769886bc' +
- '651d06b0 cc53b0f6 3bce3c3e 27d2604b').
- replace(/ /g, ''), 'hex'),
- s: Buffer.from(('00' +
- 'c49d3608 86e70493 6a6678e1 139d26b7' +
- '819f7e90').
- replace(/ /g, ''), 'hex'),
- n: Buffer.from(('00' +
- 'ffffffff 00000000 ffffffff ffffffff' +
- 'bce6faad a7179e84 f3b9cac2 fc632551').
- replace(/ /g, ''), 'hex'),
- G: Buffer.from(('04' +
- '6b17d1f2 e12c4247 f8bce6e5 63a440f2' +
- '77037d81 2deb33a0 f4a13945 d898c296' +
- '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16' +
- '2bce3357 6b315ece cbb64068 37bf51f5').
- replace(/ /g, ''), 'hex')
- },
- 'nistp384': {
- size: 384,
- pkcs8oid: '1.3.132.0.34',
- p: Buffer.from(('00' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff ffffffff fffffffe' +
- 'ffffffff 00000000 00000000 ffffffff').
- replace(/ /g, ''), 'hex'),
- a: Buffer.from(('00' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE' +
- 'FFFFFFFF 00000000 00000000 FFFFFFFC').
- replace(/ /g, ''), 'hex'),
- b: Buffer.from((
- 'b3312fa7 e23ee7e4 988e056b e3f82d19' +
- '181d9c6e fe814112 0314088f 5013875a' +
- 'c656398d 8a2ed19d 2a85c8ed d3ec2aef').
- replace(/ /g, ''), 'hex'),
- s: Buffer.from(('00' +
- 'a335926a a319a27a 1d00896a 6773a482' +
- '7acdac73').
- replace(/ /g, ''), 'hex'),
- n: Buffer.from(('00' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff c7634d81 f4372ddf' +
- '581a0db2 48b0a77a ecec196a ccc52973').
- replace(/ /g, ''), 'hex'),
- G: Buffer.from(('04' +
- 'aa87ca22 be8b0537 8eb1c71e f320ad74' +
- '6e1d3b62 8ba79b98 59f741e0 82542a38' +
- '5502f25d bf55296c 3a545e38 72760ab7' +
- '3617de4a 96262c6f 5d9e98bf 9292dc29' +
- 'f8f41dbd 289a147c e9da3113 b5f0b8c0' +
- '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f').
- replace(/ /g, ''), 'hex')
- },
- 'nistp521': {
- size: 521,
- pkcs8oid: '1.3.132.0.35',
- p: Buffer.from((
- '01ffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffff').replace(/ /g, ''), 'hex'),
- a: Buffer.from(('01FF' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFF' +
- 'FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFC').
- replace(/ /g, ''), 'hex'),
- b: Buffer.from(('51' +
- '953eb961 8e1c9a1f 929a21a0 b68540ee' +
- 'a2da725b 99b315f3 b8b48991 8ef109e1' +
- '56193951 ec7e937b 1652c0bd 3bb1bf07' +
- '3573df88 3d2c34f1 ef451fd4 6b503f00').
- replace(/ /g, ''), 'hex'),
- s: Buffer.from(('00' +
- 'd09e8800 291cb853 96cc6717 393284aa' +
- 'a0da64ba').replace(/ /g, ''), 'hex'),
- n: Buffer.from(('01ff' +
- 'ffffffff ffffffff ffffffff ffffffff' +
- 'ffffffff ffffffff ffffffff fffffffa' +
- '51868783 bf2f966b 7fcc0148 f709a5d0' +
- '3bb5c9b8 899c47ae bb6fb71e 91386409').
- replace(/ /g, ''), 'hex'),
- G: Buffer.from(('04' +
- '00c6 858e06b7 0404e9cd 9e3ecb66 2395b442' +
- '9c648139 053fb521 f828af60 6b4d3dba' +
- 'a14b5e77 efe75928 fe1dc127 a2ffa8de' +
- '3348b3c1 856a429b f97e7e31 c2e5bd66' +
- '0118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9' +
- '98f54449 579b4468 17afbd17 273e662c' +
- '97ee7299 5ef42640 c550b901 3fad0761' +
- '353c7086 a272c240 88be9476 9fd16650').
- replace(/ /g, ''), 'hex')
- }
-};
-
-module.exports = {
- info: algInfo,
- privInfo: algPrivInfo,
- hashAlgs: hashAlgs,
- curves: curves
-};
-
-
-/***/ }),
-/* 33 */
-/***/ (function(module, exports, __webpack_require__) {
-
-// Copyright 2017 Joyent, Inc.
-
-module.exports = PrivateKey;
-
-var assert = __webpack_require__(16);
-var Buffer = __webpack_require__(15).Buffer;
-var algs = __webpack_require__(32);
-var crypto = __webpack_require__(11);
-var Fingerprint = __webpack_require__(156);
-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);
-var generateECDSA = dhe.generateECDSA;
-var generateED25519 = dhe.generateED25519;
-var edCompat;
-var nacl;
-
-try {
- edCompat = __webpack_require__(454);
-} catch (e) {
- /* Just continue through, and bail out if we try to use it. */
-}
-
-var Key = __webpack_require__(27);
-
-var InvalidAlgorithmError = errs.InvalidAlgorithmError;
-var KeyParseError = errs.KeyParseError;
-var KeyEncryptedError = errs.KeyEncryptedError;
-
-var formats = {};
-formats['auto'] = __webpack_require__(455);
-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['openssh'] = formats['ssh-private'];
-formats['ssh'] = formats['ssh-private'];
-formats['dnssec'] = __webpack_require__(326);
-
-function PrivateKey(opts) {
- assert.object(opts, 'options');
- Key.call(this, opts);
-
- this._pubCache = undefined;
-}
-util.inherits(PrivateKey, Key);
-
-PrivateKey.formats = formats;
-
-PrivateKey.prototype.toBuffer = function (format, options) {
- if (format === undefined)
- format = 'pkcs1';
- assert.string(format, 'format');
- assert.object(formats[format], 'formats[format]');
- assert.optionalObject(options, 'options');
-
- return (formats[format].write(this, options));
-};
-
-PrivateKey.prototype.hash = function (algo) {
- return (this.toPublic().hash(algo));
-};
-
-PrivateKey.prototype.toPublic = function () {
- if (this._pubCache)
- return (this._pubCache);
-
- var algInfo = algs.info[this.type];
- var pubParts = [];
- for (var i = 0; i < algInfo.parts.length; ++i) {
- var p = algInfo.parts[i];
- pubParts.push(this.part[p]);
- }
-
- this._pubCache = new Key({
- type: this.type,
- source: this,
- parts: pubParts
- });
- if (this.comment)
- this._pubCache.comment = this.comment;
- return (this._pubCache);
-};
-
-PrivateKey.prototype.derive = function (newType) {
- assert.string(newType, 'type');
- var priv, pub, pair;
-
- if (this.type === 'ed25519' && newType === 'curve25519') {
- if (nacl === undefined)
- nacl = __webpack_require__(76);
-
- priv = this.part.k.data;
- if (priv[0] === 0x00)
- priv = priv.slice(1);
-
- pair = nacl.box.keyPair.fromSecretKey(new Uint8Array(priv));
- pub = Buffer.from(pair.publicKey);
-
- return (new PrivateKey({
- type: 'curve25519',
- parts: [
- { name: 'A', data: utils.mpNormalize(pub) },
- { name: 'k', data: utils.mpNormalize(priv) }
- ]
- }));
- } else if (this.type === 'curve25519' && newType === 'ed25519') {
- if (nacl === undefined)
- nacl = __webpack_require__(76);
-
- priv = this.part.k.data;
- if (priv[0] === 0x00)
- priv = priv.slice(1);
-
- pair = nacl.sign.keyPair.fromSeed(new Uint8Array(priv));
- pub = Buffer.from(pair.publicKey);
-
- return (new PrivateKey({
- type: 'ed25519',
- parts: [
- { name: 'A', data: utils.mpNormalize(pub) },
- { name: 'k', data: utils.mpNormalize(priv) }
- ]
- }));
- }
- throw (new Error('Key derivation not supported from ' + this.type +
- ' to ' + newType));
-};
-
-PrivateKey.prototype.createVerify = function (hashAlgo) {
- return (this.toPublic().createVerify(hashAlgo));
-};
-
-PrivateKey.prototype.createSign = function (hashAlgo) {
- if (hashAlgo === undefined)
- hashAlgo = this.defaultHashAlgorithm();
- assert.string(hashAlgo, 'hash algorithm');
-
- /* ED25519 is not supported by OpenSSL, use a javascript impl. */
- if (this.type === 'ed25519' && edCompat !== undefined)
- return (new edCompat.Signer(this, hashAlgo));
- if (this.type === 'curve25519')
- throw (new Error('Curve25519 keys are not suitable for ' +
- 'signing or verification'));
-
- var v, nm, err;
- try {
- nm = hashAlgo.toUpperCase();
- v = crypto.createSign(nm);
- } catch (e) {
- err = e;
- }
- if (v === undefined || (err instanceof Error &&
- err.message.match(/Unknown message digest/))) {
- nm = 'RSA-';
- nm += hashAlgo.toUpperCase();
- v = crypto.createSign(nm);
- }
- assert.ok(v, 'failed to create verifier');
- var oldSign = v.sign.bind(v);
- var key = this.toBuffer('pkcs1');
- var type = this.type;
- var curve = this.curve;
- v.sign = function () {
- var sig = oldSign(key);
- if (typeof (sig) === 'string')
- sig = Buffer.from(sig, 'binary');
- sig = Signature.parse(sig, type, 'asn1');
- sig.hashAlgorithm = hashAlgo;
- sig.curve = curve;
- return (sig);
- };
- return (v);
-};
-
-PrivateKey.parse = function (data, format, options) {
- if (typeof (data) !== 'string')
- assert.buffer(data, 'data');
- if (format === undefined)
- format = 'auto';
- assert.string(format, 'format');
- if (typeof (options) === 'string')
- options = { filename: options };
- assert.optionalObject(options, 'options');
- if (options === undefined)
- options = {};
- assert.optionalString(options.filename, 'options.filename');
- if (options.filename === undefined)
- options.filename = '(unnamed)';
-
- assert.object(formats[format], 'formats[format]');
-
- try {
- var k = formats[format].read(data, options);
- assert.ok(k instanceof PrivateKey, 'key is not a private key');
- if (!k.comment)
- k.comment = options.filename;
- return (k);
- } catch (e) {
- if (e.name === 'KeyEncryptedError')
- throw (e);
- throw (new KeyParseError(options.filename, format, e));
- }
-};
-
-PrivateKey.isPrivateKey = function (obj, ver) {
- return (utils.isCompatible(obj, PrivateKey, ver));
-};
-
-PrivateKey.generate = function (type, options) {
- if (options === undefined)
- options = {};
- assert.object(options, 'options');
-
- switch (type) {
- case 'ecdsa':
- if (options.curve === undefined)
- options.curve = 'nistp256';
- assert.string(options.curve, 'options.curve');
- return (generateECDSA(options.curve));
- case 'ed25519':
- return (generateED25519());
- default:
- throw (new Error('Key generation not supported with key ' +
- 'type "' + type + '"'));
- }
-};
-
-/*
- * API versions for PrivateKey:
- * [1,0] -- initial ver
- * [1,1] -- added auto, pkcs[18], openssh/ssh-private formats
- * [1,2] -- added defaultHashAlgorithm
- * [1,3] -- added derive, ed, createDH
- * [1,4] -- first tagged version
- * [1,5] -- changed ed25519 part names and format
- */
-PrivateKey.prototype._sshpkApiVersion = [1, 5];
-
-PrivateKey._oldVersionDetect = function (obj) {
- assert.func(obj.toPublic);
- assert.func(obj.createSign);
- if (obj.derive)
- return ([1, 3]);
- if (obj.defaultHashAlgorithm)
- return ([1, 2]);
- if (obj.formats['auto'])
- return ([1, 1]);
- return ([1, 0]);
-};
-
-
-/***/ }),
-/* 34 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.wrapLifecycle = exports.run = exports.install = exports.Install = undefined;
-
-var _extends2;
-
-function _load_extends() {
- return _extends2 = _interopRequireDefault(__webpack_require__(21));
-}
-
-var _asyncToGenerator2;
-
-function _load_asyncToGenerator() {
- return _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(2));
-}
-
-let install = exports.install = (() => {
- var _ref29 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, lockfile) {
- yield wrapLifecycle(config, flags, (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const install = new Install(flags, config, reporter, lockfile);
- yield install.init();
- }));
- });
-
- return function install(_x7, _x8, _x9, _x10) {
- return _ref29.apply(this, arguments);
- };
-})();
-
-let run = exports.run = (() => {
- var _ref31 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, reporter, flags, args) {
- let lockfile;
- let error = 'installCommandRenamed';
- if (flags.lockfile === false) {
- lockfile = new (_lockfile || _load_lockfile()).default();
- } else {
- lockfile = yield (_lockfile || _load_lockfile()).default.fromDirectory(config.lockfileFolder, reporter);
- }
-
- if (args.length) {
- const exampleArgs = args.slice();
-
- if (flags.saveDev) {
- exampleArgs.push('--dev');
- }
- if (flags.savePeer) {
- exampleArgs.push('--peer');
- }
- if (flags.saveOptional) {
- exampleArgs.push('--optional');
- }
- if (flags.saveExact) {
- exampleArgs.push('--exact');
- }
- if (flags.saveTilde) {
- exampleArgs.push('--tilde');
- }
- let command = 'add';
- if (flags.global) {
- error = 'globalFlagRemoved';
- command = 'global add';
- }
- throw new (_errors || _load_errors()).MessageError(reporter.lang(error, `yarn ${command} ${exampleArgs.join(' ')}`));
- }
-
- yield install(config, reporter, flags, lockfile);
- });
-
- return function run(_x11, _x12, _x13, _x14) {
- return _ref31.apply(this, arguments);
- };
-})();
-
-let wrapLifecycle = exports.wrapLifecycle = (() => {
- var _ref32 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (config, flags, factory) {
- yield config.executeLifecycleScript('preinstall');
-
- yield factory();
-
- // npm behaviour, seems kinda funky but yay compatibility
- yield config.executeLifecycleScript('install');
- yield config.executeLifecycleScript('postinstall');
-
- if (!config.production) {
- if (!config.disablePrepublish) {
- yield config.executeLifecycleScript('prepublish');
- }
- yield config.executeLifecycleScript('prepare');
- }
- });
-
- return function wrapLifecycle(_x15, _x16, _x17) {
- return _ref32.apply(this, arguments);
- };
-})();
-
-exports.hasWrapper = hasWrapper;
-exports.setFlags = setFlags;
-
-var _objectPath;
-
-function _load_objectPath() {
- return _objectPath = _interopRequireDefault(__webpack_require__(304));
-}
-
-var _hooks;
-
-function _load_hooks() {
- return _hooks = __webpack_require__(374);
-}
-
-var _index;
-
-function _load_index() {
- return _index = _interopRequireDefault(__webpack_require__(220));
-}
-
-var _errors;
-
-function _load_errors() {
- return _errors = __webpack_require__(6);
-}
-
-var _integrityChecker;
-
-function _load_integrityChecker() {
- return _integrityChecker = _interopRequireDefault(__webpack_require__(208));
-}
-
-var _lockfile;
-
-function _load_lockfile() {
- return _lockfile = _interopRequireDefault(__webpack_require__(19));
-}
-
-var _lockfile2;
-
-function _load_lockfile2() {
- return _lockfile2 = __webpack_require__(19);
-}
-
-var _packageFetcher;
-
-function _load_packageFetcher() {
- return _packageFetcher = _interopRequireWildcard(__webpack_require__(210));
-}
-
-var _packageInstallScripts;
-
-function _load_packageInstallScripts() {
- return _packageInstallScripts = _interopRequireDefault(__webpack_require__(557));
-}
-
-var _packageCompatibility;
-
-function _load_packageCompatibility() {
- return _packageCompatibility = _interopRequireWildcard(__webpack_require__(209));
-}
-
-var _packageResolver;
-
-function _load_packageResolver() {
- return _packageResolver = _interopRequireDefault(__webpack_require__(366));
-}
-
-var _packageLinker;
-
-function _load_packageLinker() {
- return _packageLinker = _interopRequireDefault(__webpack_require__(211));
-}
-
-var _index2;
-
-function _load_index2() {
- return _index2 = __webpack_require__(57);
-}
-
-var _index3;
-
-function _load_index3() {
- return _index3 = __webpack_require__(78);
-}
-
-var _autoclean;
-
-function _load_autoclean() {
- return _autoclean = __webpack_require__(354);
-}
-
-var _constants;
-
-function _load_constants() {
- return _constants = _interopRequireWildcard(__webpack_require__(8));
-}
-
-var _normalizePattern;
-
-function _load_normalizePattern() {
- return _normalizePattern = __webpack_require__(37);
-}
-
-var _fs;
-
-function _load_fs() {
- return _fs = _interopRequireWildcard(__webpack_require__(4));
-}
-
-var _map;
-
-function _load_map() {
- return _map = _interopRequireDefault(__webpack_require__(29));
-}
-
-var _yarnVersion;
-
-function _load_yarnVersion() {
- return _yarnVersion = __webpack_require__(120);
-}
-
-var _generatePnpMap;
-
-function _load_generatePnpMap() {
- return _generatePnpMap = __webpack_require__(579);
-}
-
-var _workspaceLayout;
-
-function _load_workspaceLayout() {
- return _workspaceLayout = _interopRequireDefault(__webpack_require__(90));
-}
-
-var _resolutionMap;
-
-function _load_resolutionMap() {
- return _resolutionMap = _interopRequireDefault(__webpack_require__(214));
-}
-
-var _guessName;
-
-function _load_guessName() {
- return _guessName = _interopRequireDefault(__webpack_require__(169));
-}
-
-var _audit;
-
-function _load_audit() {
- return _audit = _interopRequireDefault(__webpack_require__(353));
-}
-
-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 emoji = __webpack_require__(302);
-const invariant = __webpack_require__(9);
-const path = __webpack_require__(0);
-const semver = __webpack_require__(22);
-const uuid = __webpack_require__(119);
-const ssri = __webpack_require__(65);
-
-const ONE_DAY = 1000 * 60 * 60 * 24;
-
-/**
- * Try and detect the installation method for Yarn and provide a command to update it with.
- */
-
-function getUpdateCommand(installationMethod) {
- if (installationMethod === 'tar') {
- return `curl --compressed -o- -L ${(_constants || _load_constants()).YARN_INSTALLER_SH} | bash`;
- }
-
- if (installationMethod === 'homebrew') {
- return 'brew upgrade yarn';
- }
-
- if (installationMethod === 'deb') {
- return 'sudo apt-get update && sudo apt-get install yarn';
- }
-
- if (installationMethod === 'rpm') {
- return 'sudo yum install yarn';
- }
-
- if (installationMethod === 'npm') {
- return 'npm install --global yarn';
- }
-
- if (installationMethod === 'chocolatey') {
- return 'choco upgrade yarn';
- }
-
- if (installationMethod === 'apk') {
- return 'apk update && apk add -u yarn';
- }
-
- if (installationMethod === 'portage') {
- return 'sudo emerge --sync && sudo emerge -au sys-apps/yarn';
- }
-
- return null;
-}
-
-function getUpdateInstaller(installationMethod) {
- // Windows
- if (installationMethod === 'msi') {
- return (_constants || _load_constants()).YARN_INSTALLER_MSI;
- }
-
- return null;
-}
-
-function normalizeFlags(config, rawFlags) {
- const flags = {
- // install
- har: !!rawFlags.har,
- ignorePlatform: !!rawFlags.ignorePlatform,
- ignoreEngines: !!rawFlags.ignoreEngines,
- ignoreScripts: !!rawFlags.ignoreScripts,
- ignoreOptional: !!rawFlags.ignoreOptional,
- force: !!rawFlags.force,
- flat: !!rawFlags.flat,
- lockfile: rawFlags.lockfile !== false,
- pureLockfile: !!rawFlags.pureLockfile,
- updateChecksums: !!rawFlags.updateChecksums,
- skipIntegrityCheck: !!rawFlags.skipIntegrityCheck,
- frozenLockfile: !!rawFlags.frozenLockfile,
- linkDuplicates: !!rawFlags.linkDuplicates,
- checkFiles: !!rawFlags.checkFiles,
- audit: !!rawFlags.audit,
-
- // add
- peer: !!rawFlags.peer,
- dev: !!rawFlags.dev,
- optional: !!rawFlags.optional,
- exact: !!rawFlags.exact,
- tilde: !!rawFlags.tilde,
- ignoreWorkspaceRootCheck: !!rawFlags.ignoreWorkspaceRootCheck,
-
- // outdated, update-interactive
- includeWorkspaceDeps: !!rawFlags.includeWorkspaceDeps,
-
- // add, remove, update
- workspaceRootIsCwd: rawFlags.workspaceRootIsCwd !== false
- };
-
- if (config.getOption('ignore-scripts')) {
- flags.ignoreScripts = true;
- }
-
- if (config.getOption('ignore-platform')) {
- flags.ignorePlatform = true;
- }
-
- if (config.getOption('ignore-engines')) {
- flags.ignoreEngines = true;
- }
-
- if (config.getOption('ignore-optional')) {
- flags.ignoreOptional = true;
- }
-
- if (config.getOption('force')) {
- flags.force = true;
- }
-
- return flags;
-}
-
-class Install {
- constructor(flags, config, reporter, lockfile) {
- this.rootManifestRegistries = [];
- this.rootPatternsToOrigin = (0, (_map || _load_map()).default)();
- this.lockfile = lockfile;
- this.reporter = reporter;
- this.config = config;
- this.flags = normalizeFlags(config, flags);
- this.resolutions = (0, (_map || _load_map()).default)(); // Legacy resolutions field used for flat install mode
- this.resolutionMap = new (_resolutionMap || _load_resolutionMap()).default(config); // Selective resolutions for nested dependencies
- this.resolver = new (_packageResolver || _load_packageResolver()).default(config, lockfile, this.resolutionMap);
- this.integrityChecker = new (_integrityChecker || _load_integrityChecker()).default(config);
- this.linker = new (_packageLinker || _load_packageLinker()).default(config, this.resolver);
- this.scripts = new (_packageInstallScripts || _load_packageInstallScripts()).default(config, this.resolver, this.flags.force);
- }
-
- /**
- * Create a list of dependency requests from the current directories manifests.
- */
-
- fetchRequestFromCwd(excludePatterns = [], ignoreUnusedPatterns = false) {
- var _this = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const patterns = [];
- const deps = [];
- let resolutionDeps = [];
- const manifest = {};
-
- const ignorePatterns = [];
- const usedPatterns = [];
- let workspaceLayout;
-
- // some commands should always run in the context of the entire workspace
- const cwd = _this.flags.includeWorkspaceDeps || _this.flags.workspaceRootIsCwd ? _this.config.lockfileFolder : _this.config.cwd;
-
- // non-workspaces are always root, otherwise check for workspace root
- const cwdIsRoot = !_this.config.workspaceRootFolder || _this.config.lockfileFolder === cwd;
-
- // exclude package names that are in install args
- const excludeNames = [];
- for (var _iterator = excludePatterns, _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 pattern = _ref;
-
- if ((0, (_index3 || _load_index3()).getExoticResolver)(pattern)) {
- excludeNames.push((0, (_guessName || _load_guessName()).default)(pattern));
- } else {
- // extract the name
- const parts = (0, (_normalizePattern || _load_normalizePattern()).normalizePattern)(pattern);
- excludeNames.push(parts.name);
- }
- }
-
- const stripExcluded = function stripExcluded(manifest) {
- for (var _iterator2 = excludeNames, _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 exclude = _ref2;
-
- if (manifest.dependencies && manifest.dependencies[exclude]) {
- delete manifest.dependencies[exclude];
- }
- if (manifest.devDependencies && manifest.devDependencies[exclude]) {
- delete manifest.devDependencies[exclude];
- }
- if (manifest.optionalDependencies && manifest.optionalDependencies[exclude]) {
- delete manifest.optionalDependencies[exclude];
- }
- }
- };
-
- for (var _iterator3 = Object.keys((_index2 || _load_index2()).registries), _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : _iterator3[Symbol.iterator]();;) {
- var _ref3;
-
- if (_isArray3) {
- if (_i3 >= _iterator3.length) break;
- _ref3 = _iterator3[_i3++];
- } else {
- _i3 = _iterator3.next();
- if (_i3.done) break;
- _ref3 = _i3.value;
- }
-
- const registry = _ref3;
-
- const filename = (_index2 || _load_index2()).registries[registry].filename;
-
- const loc = path.join(cwd, filename);
- if (!(yield (_fs || _load_fs()).exists(loc))) {
- continue;
- }
-
- _this.rootManifestRegistries.push(registry);
-
- const projectManifestJson = yield _this.config.readJson(loc);
- yield (0, (_index || _load_index()).default)(projectManifestJson, cwd, _this.config, cwdIsRoot);
-
- Object.assign(_this.resolutions, projectManifestJson.resolutions);
- Object.assign(manifest, projectManifestJson);
-
- _this.resolutionMap.init(_this.resolutions);
- for (var _iterator4 = Object.keys(_this.resolutionMap.resolutionsByPackage), _isArray4 = Array.isArray(_iterator4), _i4 = 0, _iterator4 = _isArray4 ? _iterator4 : _iterator4[Symbol.iterator]();;) {
- var _ref4;
-
- if (_isArray4) {
- if (_i4 >= _iterator4.length) break;
- _ref4 = _iterator4[_i4++];
- } else {
- _i4 = _iterator4.next();
- if (_i4.done) break;
- _ref4 = _i4.value;
- }
-
- const packageName = _ref4;
-
- const optional = (_objectPath || _load_objectPath()).default.has(manifest.optionalDependencies, packageName) && _this.flags.ignoreOptional;
- for (var _iterator8 = _this.resolutionMap.resolutionsByPackage[packageName], _isArray8 = Array.isArray(_iterator8), _i8 = 0, _iterator8 = _isArray8 ? _iterator8 : _iterator8[Symbol.iterator]();;) {
- var _ref9;
-
- if (_isArray8) {
- if (_i8 >= _iterator8.length) break;
- _ref9 = _iterator8[_i8++];
- } else {
- _i8 = _iterator8.next();
- if (_i8.done) break;
- _ref9 = _i8.value;
- }
-
- const _ref8 = _ref9;
- const pattern = _ref8.pattern;
-
- resolutionDeps = [...resolutionDeps, { registry, pattern, optional, hint: 'resolution' }];
- }
- }
-
- const pushDeps = function pushDeps(depType, manifest, { hint, optional }, isUsed) {
- if (ignoreUnusedPatterns && !isUsed) {
- return;
- }
- // We only take unused dependencies into consideration to get deterministic hoisting.
- // Since flat mode doesn't care about hoisting and everything is top level and specified then we can safely
- // leave these out.
- if (_this.flags.flat && !isUsed) {
- return;
- }
- const depMap = manifest[depType];
- for (const name in depMap) {
- if (excludeNames.indexOf(name) >= 0) {
- continue;
- }
-
- let pattern = name;
- if (!_this.lockfile.getLocked(pattern)) {
- // when we use --save we save the dependency to the lockfile with just the name rather than the
- // version combo
- pattern += '@' + depMap[name];
- }
-
- // normalization made sure packages are mentioned only once
- if (isUsed) {
- usedPatterns.push(pattern);
- } else {
- ignorePatterns.push(pattern);
- }
-
- _this.rootPatternsToOrigin[pattern] = depType;
- patterns.push(pattern);
- deps.push({ pattern, registry, hint, optional, workspaceName: manifest.name, workspaceLoc: manifest._loc });
- }
- };
-
- if (cwdIsRoot) {
- pushDeps('dependencies', projectManifestJson, { hint: null, optional: false }, true);
- pushDeps('devDependencies', projectManifestJson, { hint: 'dev', optional: false }, !_this.config.production);
- pushDeps('optionalDependencies', projectManifestJson, { hint: 'optional', optional: true }, true);
- }
-
- if (_this.config.workspaceRootFolder) {
- const workspaceLoc = cwdIsRoot ? loc : path.join(_this.config.lockfileFolder, filename);
- const workspacesRoot = path.dirname(workspaceLoc);
-
- let workspaceManifestJson = projectManifestJson;
- if (!cwdIsRoot) {
- // the manifest we read before was a child workspace, so get the root
- workspaceManifestJson = yield _this.config.readJson(workspaceLoc);
- yield (0, (_index || _load_index()).default)(workspaceManifestJson, workspacesRoot, _this.config, true);
- }
-
- const workspaces = yield _this.config.resolveWorkspaces(workspacesRoot, workspaceManifestJson);
- workspaceLayout = new (_workspaceLayout || _load_workspaceLayout()).default(workspaces, _this.config);
-
- // add virtual manifest that depends on all workspaces, this way package hoisters and resolvers will work fine
- const workspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.dependencies);
- for (var _iterator5 = Object.keys(workspaces), _isArray5 = Array.isArray(_iterator5), _i5 = 0, _iterator5 = _isArray5 ? _iterator5 : _iterator5[Symbol.iterator]();;) {
- var _ref5;
-
- if (_isArray5) {
- if (_i5 >= _iterator5.length) break;
- _ref5 = _iterator5[_i5++];
- } else {
- _i5 = _iterator5.next();
- if (_i5.done) break;
- _ref5 = _i5.value;
- }
-
- const workspaceName = _ref5;
-
- const workspaceManifest = workspaces[workspaceName].manifest;
- workspaceDependencies[workspaceName] = workspaceManifest.version;
-
- // include dependencies from all workspaces
- if (_this.flags.includeWorkspaceDeps) {
- pushDeps('dependencies', workspaceManifest, { hint: null, optional: false }, true);
- pushDeps('devDependencies', workspaceManifest, { hint: 'dev', optional: false }, !_this.config.production);
- pushDeps('optionalDependencies', workspaceManifest, { hint: 'optional', optional: true }, true);
- }
- }
- const virtualDependencyManifest = {
- _uid: '',
- name: `workspace-aggregator-${uuid.v4()}`,
- version: '1.0.0',
- _registry: 'npm',
- _loc: workspacesRoot,
- dependencies: workspaceDependencies,
- devDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.devDependencies),
- optionalDependencies: (0, (_extends2 || _load_extends()).default)({}, workspaceManifestJson.optionalDependencies),
- private: workspaceManifestJson.private,
- workspaces: workspaceManifestJson.workspaces
- };
- workspaceLayout.virtualManifestName = virtualDependencyManifest.name;
- const virtualDep = {};
- virtualDep[virtualDependencyManifest.name] = virtualDependencyManifest.version;
- workspaces[virtualDependencyManifest.name] = { loc: workspacesRoot, manifest: virtualDependencyManifest };
-
- // ensure dependencies that should be excluded are stripped from the correct manifest
- stripExcluded(cwdIsRoot ? virtualDependencyManifest : workspaces[projectManifestJson.name].manifest);
-
- pushDeps('workspaces', { workspaces: virtualDep }, { hint: 'workspaces', optional: false }, true);
-
- const implicitWorkspaceDependencies = (0, (_extends2 || _load_extends()).default)({}, workspaceDependencies);
-
- for (var _iterator6 = (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES, _isArray6 = Array.isArray(_iterator6), _i6 = 0, _iterator6 = _isArray6 ? _iterator6 : _iterator6[Symbol.iterator]();;) {
- var _ref6;
-
- if (_isArray6) {
- if (_i6 >= _iterator6.length) break;
- _ref6 = _iterator6[_i6++];
- } else {
- _i6 = _iterator6.next();
- if (_i6.done) break;
- _ref6 = _i6.value;
- }
-
- const type = _ref6;
-
- for (var _iterator7 = Object.keys(projectManifestJson[type] || {}), _isArray7 = Array.isArray(_iterator7), _i7 = 0, _iterator7 = _isArray7 ? _iterator7 : _iterator7[Symbol.iterator]();;) {
- var _ref7;
-
- if (_isArray7) {
- if (_i7 >= _iterator7.length) break;
- _ref7 = _iterator7[_i7++];
- } else {
- _i7 = _iterator7.next();
- if (_i7.done) break;
- _ref7 = _i7.value;
- }
-
- const dependencyName = _ref7;
-
- delete implicitWorkspaceDependencies[dependencyName];
- }
- }
-
- pushDeps('dependencies', { dependencies: implicitWorkspaceDependencies }, { hint: 'workspaces', optional: false }, true);
- }
-
- break;
- }
-
- // inherit root flat flag
- if (manifest.flat) {
- _this.flags.flat = true;
- }
-
- return {
- requests: [...resolutionDeps, ...deps],
- patterns,
- manifest,
- usedPatterns,
- ignorePatterns,
- workspaceLayout
- };
- })();
- }
-
- /**
- * TODO description
- */
-
- prepareRequests(requests) {
- return requests;
- }
-
- preparePatterns(patterns) {
- return patterns;
- }
- preparePatternsForLinking(patterns, cwdManifest, cwdIsRoot) {
- return patterns;
- }
-
- prepareManifests() {
- var _this2 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const manifests = yield _this2.config.getRootManifests();
- return manifests;
- })();
- }
-
- bailout(patterns, workspaceLayout) {
- var _this3 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- // We don't want to skip the audit - it could yield important errors
- if (_this3.flags.audit) {
- return false;
- }
- // PNP is so fast that the integrity check isn't pertinent
- if (_this3.config.plugnplayEnabled) {
- return false;
- }
- if (_this3.flags.skipIntegrityCheck || _this3.flags.force) {
- return false;
- }
- const lockfileCache = _this3.lockfile.cache;
- if (!lockfileCache) {
- return false;
- }
- const lockfileClean = _this3.lockfile.parseResultType === 'success';
- const match = yield _this3.integrityChecker.check(patterns, lockfileCache, _this3.flags, workspaceLayout);
- if (_this3.flags.frozenLockfile && (!lockfileClean || match.missingPatterns.length > 0)) {
- throw new (_errors || _load_errors()).MessageError(_this3.reporter.lang('frozenLockfileError'));
- }
-
- const haveLockfile = yield (_fs || _load_fs()).exists(path.join(_this3.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME));
-
- const lockfileIntegrityPresent = !_this3.lockfile.hasEntriesExistWithoutIntegrity();
- const integrityBailout = lockfileIntegrityPresent || !_this3.config.autoAddIntegrity;
-
- if (match.integrityMatches && haveLockfile && lockfileClean && integrityBailout) {
- _this3.reporter.success(_this3.reporter.lang('upToDate'));
- return true;
- }
-
- if (match.integrityFileMissing && haveLockfile) {
- // Integrity file missing, force script installations
- _this3.scripts.setForce(true);
- return false;
- }
-
- if (match.hardRefreshRequired) {
- // e.g. node version doesn't match, force script installations
- _this3.scripts.setForce(true);
- return false;
- }
-
- if (!patterns.length && !match.integrityFileMissing) {
- _this3.reporter.success(_this3.reporter.lang('nothingToInstall'));
- yield _this3.createEmptyManifestFolders();
- yield _this3.saveLockfileAndIntegrity(patterns, workspaceLayout);
- return true;
- }
-
- return false;
- })();
- }
-
- /**
- * Produce empty folders for all used root manifests.
- */
-
- createEmptyManifestFolders() {
- var _this4 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- if (_this4.config.modulesFolder) {
- // already created
- return;
- }
-
- for (var _iterator9 = _this4.rootManifestRegistries, _isArray9 = Array.isArray(_iterator9), _i9 = 0, _iterator9 = _isArray9 ? _iterator9 : _iterator9[Symbol.iterator]();;) {
- var _ref10;
-
- if (_isArray9) {
- if (_i9 >= _iterator9.length) break;
- _ref10 = _iterator9[_i9++];
- } else {
- _i9 = _iterator9.next();
- if (_i9.done) break;
- _ref10 = _i9.value;
- }
-
- const registryName = _ref10;
- const folder = _this4.config.registries[registryName].folder;
-
- yield (_fs || _load_fs()).mkdirp(path.join(_this4.config.lockfileFolder, folder));
- }
- })();
- }
-
- /**
- * TODO description
- */
-
- markIgnored(patterns) {
- for (var _iterator10 = patterns, _isArray10 = Array.isArray(_iterator10), _i10 = 0, _iterator10 = _isArray10 ? _iterator10 : _iterator10[Symbol.iterator]();;) {
- var _ref11;
-
- if (_isArray10) {
- if (_i10 >= _iterator10.length) break;
- _ref11 = _iterator10[_i10++];
- } else {
- _i10 = _iterator10.next();
- if (_i10.done) break;
- _ref11 = _i10.value;
- }
-
- const pattern = _ref11;
-
- const manifest = this.resolver.getStrictResolvedPattern(pattern);
- const ref = manifest._reference;
- invariant(ref, 'expected package reference');
-
- // just mark the package as ignored. if the package is used by a required package, the hoister
- // will take care of that.
- ref.ignore = true;
- }
- }
-
- /**
- * helper method that gets only recent manifests
- * used by global.ls command
- */
- getFlattenedDeps() {
- var _this5 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- var _ref12 = yield _this5.fetchRequestFromCwd();
-
- const depRequests = _ref12.requests,
- rawPatterns = _ref12.patterns;
-
-
- yield _this5.resolver.init(depRequests, {});
-
- const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this5.resolver.getManifests(), _this5.config);
- _this5.resolver.updateManifests(manifests);
-
- return _this5.flatten(rawPatterns);
- })();
- }
-
- /**
- * TODO description
- */
-
- init() {
- var _this6 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- _this6.checkUpdate();
-
- // warn if we have a shrinkwrap
- if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_SHRINKWRAP_FILENAME))) {
- _this6.reporter.warn(_this6.reporter.lang('shrinkwrapWarning'));
- }
-
- // warn if we have an npm lockfile
- if (yield (_fs || _load_fs()).exists(path.join(_this6.config.lockfileFolder, (_constants || _load_constants()).NPM_LOCK_FILENAME))) {
- _this6.reporter.warn(_this6.reporter.lang('npmLockfileWarning'));
- }
-
- if (_this6.config.plugnplayEnabled) {
- _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L1'));
- _this6.reporter.info(_this6.reporter.lang('plugnplaySuggestV2L2'));
- }
-
- let flattenedTopLevelPatterns = [];
- const steps = [];
-
- var _ref13 = yield _this6.fetchRequestFromCwd();
-
- const depRequests = _ref13.requests,
- rawPatterns = _ref13.patterns,
- ignorePatterns = _ref13.ignorePatterns,
- workspaceLayout = _ref13.workspaceLayout,
- manifest = _ref13.manifest;
-
- let topLevelPatterns = [];
-
- const artifacts = yield _this6.integrityChecker.getArtifacts();
- if (artifacts) {
- _this6.linker.setArtifacts(artifacts);
- _this6.scripts.setArtifacts(artifacts);
- }
-
- if ((_packageCompatibility || _load_packageCompatibility()).shouldCheck(manifest, _this6.flags)) {
- steps.push((() => {
- var _ref14 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
- _this6.reporter.step(curr, total, _this6.reporter.lang('checkingManifest'), emoji.get('mag'));
- yield _this6.checkCompatibility();
- });
-
- return function (_x, _x2) {
- return _ref14.apply(this, arguments);
- };
- })());
- }
-
- const audit = new (_audit || _load_audit()).default(_this6.config, _this6.reporter, { groups: (_constants || _load_constants()).OWNED_DEPENDENCY_TYPES });
- let auditFoundProblems = false;
-
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('resolveStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- _this6.reporter.step(curr, total, _this6.reporter.lang('resolvingPackages'), emoji.get('mag'));
- yield _this6.resolver.init(_this6.prepareRequests(depRequests), {
- isFlat: _this6.flags.flat,
- isFrozen: _this6.flags.frozenLockfile,
- workspaceLayout
- });
- topLevelPatterns = _this6.preparePatterns(rawPatterns);
- flattenedTopLevelPatterns = yield _this6.flatten(topLevelPatterns);
- return { bailout: !_this6.flags.audit && (yield _this6.bailout(topLevelPatterns, workspaceLayout)) };
- }));
- });
-
- if (_this6.flags.audit) {
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('auditStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- _this6.reporter.step(curr, total, _this6.reporter.lang('auditRunning'), emoji.get('mag'));
- if (_this6.flags.offline) {
- _this6.reporter.warn(_this6.reporter.lang('auditOffline'));
- return { bailout: false };
- }
- const preparedManifests = yield _this6.prepareManifests();
- // $FlowFixMe - Flow considers `m` in the map operation to be "mixed", so does not recognize `m.object`
- const mergedManifest = Object.assign({}, ...Object.values(preparedManifests).map(function (m) {
- return m.object;
- }));
- const auditVulnerabilityCounts = yield audit.performAudit(mergedManifest, _this6.lockfile, _this6.resolver, _this6.linker, topLevelPatterns);
- auditFoundProblems = auditVulnerabilityCounts.info || auditVulnerabilityCounts.low || auditVulnerabilityCounts.moderate || auditVulnerabilityCounts.high || auditVulnerabilityCounts.critical;
- return { bailout: yield _this6.bailout(topLevelPatterns, workspaceLayout) };
- }));
- });
- }
-
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('fetchStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- _this6.markIgnored(ignorePatterns);
- _this6.reporter.step(curr, total, _this6.reporter.lang('fetchingPackages'), emoji.get('truck'));
- const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this6.resolver.getManifests(), _this6.config);
- _this6.resolver.updateManifests(manifests);
- yield (_packageCompatibility || _load_packageCompatibility()).check(_this6.resolver.getManifests(), _this6.config, _this6.flags.ignoreEngines);
- }));
- });
-
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('linkStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- // remove integrity hash to make this operation atomic
- yield _this6.integrityChecker.removeIntegrityFile();
- _this6.reporter.step(curr, total, _this6.reporter.lang('linkingDependencies'), emoji.get('link'));
- flattenedTopLevelPatterns = _this6.preparePatternsForLinking(flattenedTopLevelPatterns, manifest, _this6.config.lockfileFolder === _this6.config.cwd);
- yield _this6.linker.init(flattenedTopLevelPatterns, workspaceLayout, {
- linkDuplicates: _this6.flags.linkDuplicates,
- ignoreOptional: _this6.flags.ignoreOptional
- });
- }));
- });
-
- if (_this6.config.plugnplayEnabled) {
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('pnpStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const pnpPath = `${_this6.config.lockfileFolder}/${(_constants || _load_constants()).PNP_FILENAME}`;
-
- const code = yield (0, (_generatePnpMap || _load_generatePnpMap()).generatePnpMap)(_this6.config, flattenedTopLevelPatterns, {
- resolver: _this6.resolver,
- reporter: _this6.reporter,
- targetPath: pnpPath,
- workspaceLayout
- });
-
- try {
- const file = yield (_fs || _load_fs()).readFile(pnpPath);
- if (file === code) {
- return;
- }
- } catch (error) {}
-
- yield (_fs || _load_fs()).writeFile(pnpPath, code);
- yield (_fs || _load_fs()).chmod(pnpPath, 0o755);
- }));
- });
- }
-
- steps.push(function (curr, total) {
- return (0, (_hooks || _load_hooks()).callThroughHook)('buildStep', (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- _this6.reporter.step(curr, total, _this6.flags.force ? _this6.reporter.lang('rebuildingPackages') : _this6.reporter.lang('buildingFreshPackages'), emoji.get('hammer'));
-
- if (_this6.config.ignoreScripts) {
- _this6.reporter.warn(_this6.reporter.lang('ignoredScripts'));
- } else {
- yield _this6.scripts.init(flattenedTopLevelPatterns);
- }
- }));
- });
-
- if (_this6.flags.har) {
- steps.push((() => {
- var _ref21 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
- const formattedDate = new Date().toISOString().replace(/:/g, '-');
- const filename = `yarn-install_${formattedDate}.har`;
- _this6.reporter.step(curr, total, _this6.reporter.lang('savingHar', filename), emoji.get('black_circle_for_record'));
- yield _this6.config.requestManager.saveHar(filename);
- });
-
- return function (_x3, _x4) {
- return _ref21.apply(this, arguments);
- };
- })());
- }
-
- if (yield _this6.shouldClean()) {
- steps.push((() => {
- var _ref22 = (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* (curr, total) {
- _this6.reporter.step(curr, total, _this6.reporter.lang('cleaningModules'), emoji.get('recycle'));
- yield (0, (_autoclean || _load_autoclean()).clean)(_this6.config, _this6.reporter);
- });
-
- return function (_x5, _x6) {
- return _ref22.apply(this, arguments);
- };
- })());
- }
-
- let currentStep = 0;
- for (var _iterator11 = steps, _isArray11 = Array.isArray(_iterator11), _i11 = 0, _iterator11 = _isArray11 ? _iterator11 : _iterator11[Symbol.iterator]();;) {
- var _ref23;
-
- if (_isArray11) {
- if (_i11 >= _iterator11.length) break;
- _ref23 = _iterator11[_i11++];
- } else {
- _i11 = _iterator11.next();
- if (_i11.done) break;
- _ref23 = _i11.value;
- }
-
- const step = _ref23;
-
- const stepResult = yield step(++currentStep, steps.length);
- if (stepResult && stepResult.bailout) {
- if (_this6.flags.audit) {
- audit.summary();
- }
- if (auditFoundProblems) {
- _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails'));
- }
- _this6.maybeOutputUpdate();
- return flattenedTopLevelPatterns;
- }
- }
-
- // fin!
- if (_this6.flags.audit) {
- audit.summary();
- }
- if (auditFoundProblems) {
- _this6.reporter.warn(_this6.reporter.lang('auditRunAuditForDetails'));
- }
- yield _this6.saveLockfileAndIntegrity(topLevelPatterns, workspaceLayout);
- yield _this6.persistChanges();
- _this6.maybeOutputUpdate();
- _this6.config.requestManager.clearCache();
- return flattenedTopLevelPatterns;
- })();
- }
-
- checkCompatibility() {
- var _this7 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- var _ref24 = yield _this7.fetchRequestFromCwd();
-
- const manifest = _ref24.manifest;
-
- yield (_packageCompatibility || _load_packageCompatibility()).checkOne(manifest, _this7.config, _this7.flags.ignoreEngines);
- })();
- }
-
- persistChanges() {
- var _this8 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- // get all the different registry manifests in this folder
- const manifests = yield _this8.config.getRootManifests();
-
- if (yield _this8.applyChanges(manifests)) {
- yield _this8.config.saveRootManifests(manifests);
- }
- })();
- }
-
- applyChanges(manifests) {
- let hasChanged = false;
-
- if (this.config.plugnplayPersist) {
- const object = manifests.npm.object;
-
-
- if (typeof object.installConfig !== 'object') {
- object.installConfig = {};
- }
-
- if (this.config.plugnplayEnabled && object.installConfig.pnp !== true) {
- object.installConfig.pnp = true;
- hasChanged = true;
- } else if (!this.config.plugnplayEnabled && typeof object.installConfig.pnp !== 'undefined') {
- delete object.installConfig.pnp;
- hasChanged = true;
- }
-
- if (Object.keys(object.installConfig).length === 0) {
- delete object.installConfig;
- }
- }
-
- return Promise.resolve(hasChanged);
- }
-
- /**
- * Check if we should run the cleaning step.
- */
-
- shouldClean() {
- return (_fs || _load_fs()).exists(path.join(this.config.lockfileFolder, (_constants || _load_constants()).CLEAN_FILENAME));
- }
-
- /**
- * TODO
- */
-
- flatten(patterns) {
- var _this9 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- if (!_this9.flags.flat) {
- return patterns;
- }
-
- const flattenedPatterns = [];
-
- for (var _iterator12 = _this9.resolver.getAllDependencyNamesByLevelOrder(patterns), _isArray12 = Array.isArray(_iterator12), _i12 = 0, _iterator12 = _isArray12 ? _iterator12 : _iterator12[Symbol.iterator]();;) {
- var _ref25;
-
- if (_isArray12) {
- if (_i12 >= _iterator12.length) break;
- _ref25 = _iterator12[_i12++];
- } else {
- _i12 = _iterator12.next();
- if (_i12.done) break;
- _ref25 = _i12.value;
- }
-
- const name = _ref25;
-
- const infos = _this9.resolver.getAllInfoForPackageName(name).filter(function (manifest) {
- const ref = manifest._reference;
- invariant(ref, 'expected package reference');
- return !ref.ignore;
- });
-
- if (infos.length === 0) {
- continue;
- }
-
- if (infos.length === 1) {
- // single version of this package
- // take out a single pattern as multiple patterns may have resolved to this package
- flattenedPatterns.push(_this9.resolver.patternsByPackage[name][0]);
- continue;
- }
-
- const options = infos.map(function (info) {
- const ref = info._reference;
- invariant(ref, 'expected reference');
- return {
- // TODO `and is required by {PARENT}`,
- name: _this9.reporter.lang('manualVersionResolutionOption', ref.patterns.join(', '), info.version),
-
- value: info.version
- };
- });
- const versions = infos.map(function (info) {
- return info.version;
- });
- let version;
-
- const resolutionVersion = _this9.resolutions[name];
- if (resolutionVersion && versions.indexOf(resolutionVersion) >= 0) {
- // use json `resolution` version
- version = resolutionVersion;
- } else {
- version = yield _this9.reporter.select(_this9.reporter.lang('manualVersionResolution', name), _this9.reporter.lang('answer'), options);
- _this9.resolutions[name] = version;
- }
-
- flattenedPatterns.push(_this9.resolver.collapseAllVersionsOfPackage(name, version));
- }
-
- // save resolutions to their appropriate root manifest
- if (Object.keys(_this9.resolutions).length) {
- const manifests = yield _this9.config.getRootManifests();
-
- for (const name in _this9.resolutions) {
- const version = _this9.resolutions[name];
-
- const patterns = _this9.resolver.patternsByPackage[name];
- if (!patterns) {
- continue;
- }
-
- let manifest;
- for (var _iterator13 = patterns, _isArray13 = Array.isArray(_iterator13), _i13 = 0, _iterator13 = _isArray13 ? _iterator13 : _iterator13[Symbol.iterator]();;) {
- var _ref26;
-
- if (_isArray13) {
- if (_i13 >= _iterator13.length) break;
- _ref26 = _iterator13[_i13++];
- } else {
- _i13 = _iterator13.next();
- if (_i13.done) break;
- _ref26 = _i13.value;
- }
-
- const pattern = _ref26;
-
- manifest = _this9.resolver.getResolvedPattern(pattern);
- if (manifest) {
- break;
- }
- }
- invariant(manifest, 'expected manifest');
-
- const ref = manifest._reference;
- invariant(ref, 'expected reference');
-
- const object = manifests[ref.registry].object;
- object.resolutions = object.resolutions || {};
- object.resolutions[name] = version;
- }
-
- yield _this9.config.saveRootManifests(manifests);
- }
-
- return flattenedPatterns;
- })();
- }
-
- /**
- * Remove offline tarballs that are no longer required
- */
-
- pruneOfflineMirror(lockfile) {
- var _this10 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const mirror = _this10.config.getOfflineMirrorPath();
- if (!mirror) {
- return;
- }
-
- const requiredTarballs = new Set();
- for (const dependency in lockfile) {
- const resolved = lockfile[dependency].resolved;
- if (resolved) {
- const basename = path.basename(resolved.split('#')[0]);
- if (dependency[0] === '@' && basename[0] !== '@') {
- requiredTarballs.add(`${dependency.split('/')[0]}-${basename}`);
- }
- requiredTarballs.add(basename);
- }
- }
-
- const mirrorFiles = yield (_fs || _load_fs()).walk(mirror);
- for (var _iterator14 = mirrorFiles, _isArray14 = Array.isArray(_iterator14), _i14 = 0, _iterator14 = _isArray14 ? _iterator14 : _iterator14[Symbol.iterator]();;) {
- var _ref27;
-
- if (_isArray14) {
- if (_i14 >= _iterator14.length) break;
- _ref27 = _iterator14[_i14++];
- } else {
- _i14 = _iterator14.next();
- if (_i14.done) break;
- _ref27 = _i14.value;
- }
-
- const file = _ref27;
-
- const isTarball = path.extname(file.basename) === '.tgz';
- // if using experimental-pack-script-packages-in-mirror flag, don't unlink prebuilt packages
- const hasPrebuiltPackage = file.relative.startsWith('prebuilt/');
- if (isTarball && !hasPrebuiltPackage && !requiredTarballs.has(file.basename)) {
- yield (_fs || _load_fs()).unlink(file.absolute);
- }
- }
- })();
- }
-
- /**
- * Save updated integrity and lockfiles.
- */
-
- saveLockfileAndIntegrity(patterns, workspaceLayout) {
- var _this11 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const resolvedPatterns = {};
- Object.keys(_this11.resolver.patterns).forEach(function (pattern) {
- if (!workspaceLayout || !workspaceLayout.getManifestByPattern(pattern)) {
- resolvedPatterns[pattern] = _this11.resolver.patterns[pattern];
- }
- });
-
- // TODO this code is duplicated in a few places, need a common way to filter out workspace patterns from lockfile
- patterns = patterns.filter(function (p) {
- return !workspaceLayout || !workspaceLayout.getManifestByPattern(p);
- });
-
- const lockfileBasedOnResolver = _this11.lockfile.getLockfile(resolvedPatterns);
-
- if (_this11.config.pruneOfflineMirror) {
- yield _this11.pruneOfflineMirror(lockfileBasedOnResolver);
- }
-
- // write integrity hash
- if (!_this11.config.plugnplayEnabled) {
- yield _this11.integrityChecker.save(patterns, lockfileBasedOnResolver, _this11.flags, workspaceLayout, _this11.scripts.getArtifacts());
- }
-
- // --no-lockfile or --pure-lockfile or --frozen-lockfile
- if (_this11.flags.lockfile === false || _this11.flags.pureLockfile || _this11.flags.frozenLockfile) {
- return;
- }
-
- const lockFileHasAllPatterns = patterns.every(function (p) {
- return _this11.lockfile.getLocked(p);
- });
- const lockfilePatternsMatch = Object.keys(_this11.lockfile.cache || {}).every(function (p) {
- return lockfileBasedOnResolver[p];
- });
- const resolverPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) {
- const manifest = _this11.lockfile.getLocked(pattern);
- return manifest && manifest.resolved === lockfileBasedOnResolver[pattern].resolved && deepEqual(manifest.prebuiltVariants, lockfileBasedOnResolver[pattern].prebuiltVariants);
- });
- const integrityPatternsAreSameAsInLockfile = Object.keys(lockfileBasedOnResolver).every(function (pattern) {
- const existingIntegrityInfo = lockfileBasedOnResolver[pattern].integrity;
- if (!existingIntegrityInfo) {
- // if this entry does not have an integrity, no need to re-write the lockfile because of it
- return true;
- }
- const manifest = _this11.lockfile.getLocked(pattern);
- if (manifest && manifest.integrity) {
- const manifestIntegrity = ssri.stringify(manifest.integrity);
- return manifestIntegrity === existingIntegrityInfo;
- }
- return false;
- });
-
- // remove command is followed by install with force, lockfile will be rewritten in any case then
- if (!_this11.flags.force && _this11.lockfile.parseResultType === 'success' && lockFileHasAllPatterns && lockfilePatternsMatch && resolverPatternsAreSameAsInLockfile && integrityPatternsAreSameAsInLockfile && patterns.length) {
- return;
- }
-
- // build lockfile location
- const loc = path.join(_this11.config.lockfileFolder, (_constants || _load_constants()).LOCKFILE_FILENAME);
-
- // write lockfile
- const lockSource = (0, (_lockfile2 || _load_lockfile2()).stringify)(lockfileBasedOnResolver, false, _this11.config.enableLockfileVersions);
- yield (_fs || _load_fs()).writeFilePreservingEol(loc, lockSource);
-
- _this11._logSuccessSaveLockfile();
- })();
- }
-
- _logSuccessSaveLockfile() {
- this.reporter.success(this.reporter.lang('savedLockfile'));
- }
-
- /**
- * Load the dependency graph of the current install. Only does package resolving and wont write to the cwd.
- */
- hydrate(ignoreUnusedPatterns) {
- var _this12 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- const request = yield _this12.fetchRequestFromCwd([], ignoreUnusedPatterns);
- const depRequests = request.requests,
- rawPatterns = request.patterns,
- ignorePatterns = request.ignorePatterns,
- workspaceLayout = request.workspaceLayout;
-
-
- yield _this12.resolver.init(depRequests, {
- isFlat: _this12.flags.flat,
- isFrozen: _this12.flags.frozenLockfile,
- workspaceLayout
- });
- yield _this12.flatten(rawPatterns);
- _this12.markIgnored(ignorePatterns);
-
- // fetch packages, should hit cache most of the time
- const manifests = yield (_packageFetcher || _load_packageFetcher()).fetch(_this12.resolver.getManifests(), _this12.config);
- _this12.resolver.updateManifests(manifests);
- yield (_packageCompatibility || _load_packageCompatibility()).check(_this12.resolver.getManifests(), _this12.config, _this12.flags.ignoreEngines);
-
- // expand minimal manifests
- for (var _iterator15 = _this12.resolver.getManifests(), _isArray15 = Array.isArray(_iterator15), _i15 = 0, _iterator15 = _isArray15 ? _iterator15 : _iterator15[Symbol.iterator]();;) {
- var _ref28;
-
- if (_isArray15) {
- if (_i15 >= _iterator15.length) break;
- _ref28 = _iterator15[_i15++];
- } else {
- _i15 = _iterator15.next();
- if (_i15.done) break;
- _ref28 = _i15.value;
- }
-
- const manifest = _ref28;
-
- const ref = manifest._reference;
- invariant(ref, 'expected reference');
- const type = ref.remote.type;
- // link specifier won't ever hit cache
-
- let loc = '';
- if (type === 'link') {
- continue;
- } else if (type === 'workspace') {
- if (!ref.remote.reference) {
- continue;
- }
- loc = ref.remote.reference;
- } else {
- loc = _this12.config.generateModuleCachePath(ref);
- }
- const newPkg = yield _this12.config.readManifest(loc);
- yield _this12.resolver.updateManifest(ref, newPkg);
- }
-
- return request;
- })();
- }
-
- /**
- * Check for updates every day and output a nag message if there's a newer version.
- */
-
- checkUpdate() {
- if (this.config.nonInteractive) {
- // don't show upgrade dialog on CI or non-TTY terminals
- return;
- }
-
- // don't check if disabled
- if (this.config.getOption('disable-self-update-check')) {
- return;
- }
-
- // only check for updates once a day
- const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0;
- if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) {
- return;
- }
-
- // don't bug for updates on tagged releases
- if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) {
- return;
- }
-
- this._checkUpdate().catch(() => {
- // swallow errors
- });
- }
-
- _checkUpdate() {
- var _this13 = this;
-
- return (0, (_asyncToGenerator2 || _load_asyncToGenerator()).default)(function* () {
- let latestVersion = yield _this13.config.requestManager.request({
- url: (_constants || _load_constants()).SELF_UPDATE_VERSION_URL
- });
- invariant(typeof latestVersion === 'string', 'expected string');
- latestVersion = latestVersion.trim();
- if (!semver.valid(latestVersion)) {
- return;
- }
-
- // ensure we only check for updates periodically
- _this13.config.registries.yarn.saveHomeConfig({
- lastUpdateCheck: Date.now()
- });
-
- if (semver.gt(latestVersion, (_yarnVersion || _load_yarnVersion()).version)) {
- const installationMethod = yield (0, (_yarnVersion || _load_yarnVersion()).getInstallationMethod)();
- _this13.maybeOutputUpdate = function () {
- _this13.reporter.warn(_this13.reporter.lang('yarnOutdated', latestVersion, (_yarnVersion || _load_yarnVersion()).version));
-
- const command = getUpdateCommand(installationMethod);
- if (command) {
- _this13.reporter.info(_this13.reporter.lang('yarnOutdatedCommand'));
- _this13.reporter.command(command);
- } else {
- const installer = getUpdateInstaller(installationMethod);
- if (installer) {
- _this13.reporter.info(_this13.reporter.lang('yarnOutdatedInstaller', installer));
- }
- }
- };
- }
- })();
- }
-
- /**
- * Method to override with a possible upgrade message.
- */
-
- maybeOutputUpdate() {}
-}
-
-exports.Install = Install;
-function hasWrapper(commander, args) {
- return true;
-}
-
-function setFlags(commander) {
- commander.description('Yarn install is used to install all dependencies for a project.');
- commander.usage('install [flags]');
- commander.option('-A, --audit', 'Run vulnerability audit on installed packages');
- commander.option('-g, --global', 'DEPRECATED');
- commander.option('-S, --save', 'DEPRECATED - save package to your `dependencies`');
- commander.option('-D, --save-dev', 'DEPRECATED - save package to your `devDependencies`');
- commander.option('-P, --save-peer', 'DEPRECATED - save package to your `peerDependencies`');
- commander.option('-O, --save-optional', 'DEPRECATED - save package to your `optionalDependencies`');
- commander.option('-E, --save-exact', 'DEPRECATED');
- commander.option('-T, --save-tilde', 'DEPRECATED');
-}
-
-/***/ }),
-/* 35 */
-/***/ (function(module, exports, __webpack_require__) {
-
-var isObject = __webpack_require__(52);
-module.exports = function (it) {
- if (!isObject(it)) throw TypeError(it + ' is not an object!');
- return it;
-};
-
-
-/***/ }),
-/* 36 */
-/***/ (function(module, __webpack_exports__, __webpack_require__) {
-
-"use strict";
-/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "b", function() { return SubjectSubscriber; });
-/* 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__(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_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 */
-
-
-
-
-
-
-
-var SubjectSubscriber = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](SubjectSubscriber, _super);
- function SubjectSubscriber(destination) {
- var _this = _super.call(this, destination) || this;
- _this.destination = destination;
- return _this;
- }
- return SubjectSubscriber;
-}(__WEBPACK_IMPORTED_MODULE_2__Subscriber__["a" /* Subscriber */]));
-
-var Subject = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](Subject, _super);
- function Subject() {
- var _this = _super.call(this) || this;
- _this.observers = [];
- _this.closed = false;
- _this.isStopped = false;
- _this.hasError = false;
- _this.thrownError = null;
- return _this;
- }
- Subject.prototype[__WEBPACK_IMPORTED_MODULE_6__internal_symbol_rxSubscriber__["a" /* rxSubscriber */]] = function () {
- return new SubjectSubscriber(this);
- };
- Subject.prototype.lift = function (operator) {
- var subject = new AnonymousSubject(this, this);
- subject.operator = operator;
- return subject;
- };
- Subject.prototype.next = function (value) {
- if (this.closed) {
- throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
- }
- if (!this.isStopped) {
- var observers = this.observers;
- var len = observers.length;
- var copy = observers.slice();
- for (var i = 0; i < len; i++) {
- copy[i].next(value);
- }
- }
- };
- Subject.prototype.error = function (err) {
- if (this.closed) {
- throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
- }
- this.hasError = true;
- this.thrownError = err;
- this.isStopped = true;
- var observers = this.observers;
- var len = observers.length;
- var copy = observers.slice();
- for (var i = 0; i < len; i++) {
- copy[i].error(err);
- }
- this.observers.length = 0;
- };
- Subject.prototype.complete = function () {
- if (this.closed) {
- throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
- }
- this.isStopped = true;
- var observers = this.observers;
- var len = observers.length;
- var copy = observers.slice();
- for (var i = 0; i < len; i++) {
- copy[i].complete();
- }
- this.observers.length = 0;
- };
- Subject.prototype.unsubscribe = function () {
- this.isStopped = true;
- this.closed = true;
- this.observers = null;
- };
- Subject.prototype._trySubscribe = function (subscriber) {
- if (this.closed) {
- throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
- }
- else {
- return _super.prototype._trySubscribe.call(this, subscriber);
- }
- };
- Subject.prototype._subscribe = function (subscriber) {
- if (this.closed) {
- throw new __WEBPACK_IMPORTED_MODULE_4__util_ObjectUnsubscribedError__["a" /* ObjectUnsubscribedError */]();
- }
- else if (this.hasError) {
- subscriber.error(this.thrownError);
- return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
- }
- else if (this.isStopped) {
- subscriber.complete();
- return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
- }
- else {
- this.observers.push(subscriber);
- return new __WEBPACK_IMPORTED_MODULE_5__SubjectSubscription__["a" /* SubjectSubscription */](this, subscriber);
- }
- };
- Subject.prototype.asObservable = function () {
- var observable = new __WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]();
- observable.source = this;
- return observable;
- };
- Subject.create = function (destination, source) {
- return new AnonymousSubject(destination, source);
- };
- return Subject;
-}(__WEBPACK_IMPORTED_MODULE_1__Observable__["a" /* Observable */]));
-
-var AnonymousSubject = /*@__PURE__*/ (function (_super) {
- __WEBPACK_IMPORTED_MODULE_0_tslib__["a" /* __extends */](AnonymousSubject, _super);
- function AnonymousSubject(destination, source) {
- var _this = _super.call(this) || this;
- _this.destination = destination;
- _this.source = source;
- return _this;
- }
- AnonymousSubject.prototype.next = function (value) {
- var destination = this.destination;
- if (destination && destination.next) {
- destination.next(value);
- }
- };
- AnonymousSubject.prototype.error = function (err) {
- var destination = this.destination;
- if (destination && destination.error) {
- this.destination.error(err);
- }
- };
- AnonymousSubject.prototype.complete = function () {
- var destination = this.destination;
- if (destination && destination.complete) {
- this.destination.complete();
- }
- };
- AnonymousSubject.prototype._subscribe = function (subscriber) {
- var source = this.source;
- if (source) {
- return this.source.subscribe(subscriber);
- }
- else {
- return __WEBPACK_IMPORTED_MODULE_3__Subscription__["a" /* Subscription */].EMPTY;
- }
- };
- return AnonymousSubject;
-}(Subject));
-
-//# sourceMappingURL=Subject.js.map
-
-
-/***/ }),
-/* 37 */
-/***/ (function(module, exports, __webpack_require__) {
-
-"use strict";
-
-
-Object.defineProperty(exports, "__esModule", {
- value: true
-});
-exports.normalizePattern = normalizePattern;
-
-/**
- * Explode and normalize a pattern into its name and range.
- */
-
-function normalizePattern(pattern) {
- let hasVersion = false;
- let range = 'latest';
- let name = pattern;
-
- // if we're a scope then remove the @ and add it back later
- let isScoped = false;
- if (name[0] === '@') {
- isScoped = true;
- name = name.slice(1);
- }
-
- // take first part as the name
- const parts = name.split('@');
- if (parts.length > 1) {
- name = parts.shift();
- range = parts.join('@');
-
- if (range) {
- hasVersion = true;
- } else {
- range = '*';
- }
- }
-
- // add back @ scope suffix
- if (isScoped) {
- name = `@${name}`;
- }
-
- return { name, range, hasVersion };
-}
-
-/***/ }),
-/* 38 */
-/***/ (function(module, exports, __webpack_require__) {
-
-/* WEBPACK VAR INJECTION */(function(module) {var __WEBPACK_AMD_DEFINE_RESULT__;/**
- * @license
- * Lodash ' + func(text) + ' fred, barney, & pebbles
+ {skin.readmeStart}
+ {children}
+ Let me know what you think about the Winamp Skin Museum. Bug reports,
+ feature suggestions, personal anecdotes, or criticism are all welcome.
+ Download the entire Winamp Skin Museum collection.
+
+
+ {showWebamp && (
+
+ {skin.fileName}
+
+
+ {children}
+
+ );
+}
+
+export function Subheading({ children }: { children: ReactNode }) {
+ return (
+
+ {children}
+
+ );
+}
+
+// Styled link component
+export function Link({
+ href,
+ children,
+ ...props
+}: {
+ href: string;
+ children: ReactNode;
+ target?: string;
+ rel?: string;
+}) {
+ return (
+
+ {children}
+
+ );
+}
+
+// Styled paragraph component
+export function Paragraph({ children }: { children: ReactNode }) {
+ return
+
+
+
+
+
+
Your browser does not support filesystem access.
;
+ }
+
+ const gb = Math.round(
+ parseInt(progress.estimatedSizeBytes || "0", 10) / (1024 * 1024 * 1024)
+ );
+
+ return (
+ Bulk Download All Skins
+
+
+