Compare commits
38 Commits
@@ -0,0 +1,42 @@
|
|||||||
|
root: true
|
||||||
|
parser: "@typescript-eslint/parser"
|
||||||
|
parserOptions:
|
||||||
|
project: tsconfig.json
|
||||||
|
plugins:
|
||||||
|
- "@typescript-eslint"
|
||||||
|
- prettier
|
||||||
|
extends:
|
||||||
|
- eslint:recommended
|
||||||
|
- plugin:@typescript-eslint/eslint-recommended
|
||||||
|
- plugin:@typescript-eslint/recommended
|
||||||
|
- plugin:@typescript-eslint/recommended-requiring-type-checking
|
||||||
|
- prettier/@typescript-eslint
|
||||||
|
- plugin:prettier/recommended
|
||||||
|
rules:
|
||||||
|
"prettier/prettier":
|
||||||
|
- 1
|
||||||
|
- singleQuote: true
|
||||||
|
trailingComma: all
|
||||||
|
tabWidth: 4
|
||||||
|
endOfLine: lf
|
||||||
|
printWidth: 160
|
||||||
|
- usePrettierrc: false
|
||||||
|
"@typescript-eslint/array-type": [1, { default: array-simple }]
|
||||||
|
"@typescript-eslint/explicit-function-return-type":
|
||||||
|
[2, { allowExpressions: true }]
|
||||||
|
"@typescript-eslint/no-extra-non-null-assertion": [2]
|
||||||
|
"@typescript-eslint/no-extraneous-class": [1, { allowWithDecorator: true, allowStaticOnly: true }]
|
||||||
|
"@typescript-eslint/no-floating-promises": [1]
|
||||||
|
"@typescript-eslint/no-parameter-properties":
|
||||||
|
- 1
|
||||||
|
- allows:
|
||||||
|
- protected readonly
|
||||||
|
- private readonly
|
||||||
|
- public readonly
|
||||||
|
- readonly
|
||||||
|
"@typescript-eslint/no-throw-literal": [2]
|
||||||
|
"no-unused-vars": [0]
|
||||||
|
"@typescript-eslint/prefer-for-of": [1]
|
||||||
|
"@typescript-eslint/prefer-function-type": [1]
|
||||||
|
"@typescript-eslint/prefer-nullish-coalescing": [1]
|
||||||
|
"@typescript-eslint/prefer-optional-chain": [1]
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
name: checkin
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
- pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
checkin:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- name: install
|
||||||
|
run: yarn install
|
||||||
|
- name: build
|
||||||
|
run: yarn build
|
||||||
|
- name: test
|
||||||
|
run: yarn test
|
||||||
|
- name: release
|
||||||
|
run: yarn release
|
||||||
|
- name: "check for uncommitted changes"
|
||||||
|
# Ensure no changes
|
||||||
|
run: |
|
||||||
|
git add . && git diff --exit-code --stat \
|
||||||
|
|| (echo "##[error] found changed files after build. please 'yarn build && npm run format'" \
|
||||||
|
"and check in all changes" \
|
||||||
|
&& exit 1)
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
name: test
|
||||||
|
|
||||||
|
on:
|
||||||
|
- push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||||
|
version: [latest, branch@master]
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v1
|
||||||
|
- uses: xmake-io/github-action-setup-xmake@master
|
||||||
|
with:
|
||||||
|
xmake-version: ${{ matrix.version }}
|
||||||
|
- name: Run tests
|
||||||
|
run: |
|
||||||
|
xmake create -P test
|
||||||
|
xmake build -P test
|
||||||
|
xmake run -P test
|
||||||
Vendored
+25
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"npm.packageManager": "yarn",
|
||||||
|
"eslint.validate": [
|
||||||
|
"javascript",
|
||||||
|
"javascriptreact",
|
||||||
|
"typescript",
|
||||||
|
"typescriptreact",
|
||||||
|
"vue"
|
||||||
|
],
|
||||||
|
"eslint.enable": true,
|
||||||
|
"files.autoSave": "off",
|
||||||
|
"eslint.format.enable": true,
|
||||||
|
"editor.tabSize": 4,
|
||||||
|
"editor.formatOnSave": false,
|
||||||
|
"editor.codeActionsOnSave": {
|
||||||
|
"source.fixAll.eslint": true
|
||||||
|
},
|
||||||
|
"[typescript]": {
|
||||||
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
|
},
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
|
||||||
|
},
|
||||||
|
"git.ignoreLimitWarning": true
|
||||||
|
}
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
# GitHub Action - Setup xmake
|
# GitHub Action - Setup xmake
|
||||||
|
[](https://github.com/xmake-io/github-action-setup-xmake/actions)
|
||||||
|
[](https://github.com/marketplace/actions/setup-xmake)
|
||||||
|
|
||||||
Set up your GitHub Actions workflow with a specific version of xmake
|
Set up your GitHub Actions workflow with a specific version of xmake
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
@@ -8,20 +11,33 @@ See [action.yml](./action.yml).
|
|||||||
## Example
|
## Example
|
||||||
|
|
||||||
Use latest version:
|
Use latest version:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
uses: xmake-io/github-action-setup-xmake@v1
|
||||||
|
with:
|
||||||
|
xmake-version: latest
|
||||||
```
|
```
|
||||||
|
|
||||||
Use specified version:
|
Use specified version:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
uses: xmake-io/github-action-setup-xmake@v1
|
||||||
with:
|
with:
|
||||||
xmake-version: '2.2.8'
|
xmake-version: '2.3.1'
|
||||||
|
```
|
||||||
|
|
||||||
|
Use specified branch:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
uses: xmake-io/github-action-setup-xmake@v1
|
||||||
|
with:
|
||||||
|
xmake-version: branch@master
|
||||||
```
|
```
|
||||||
|
|
||||||
Use semver:
|
Use semver:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
uses: xmake-io/github-action-setup-xmake@v1
|
uses: xmake-io/github-action-setup-xmake@v1
|
||||||
with:
|
with:
|
||||||
xmake-version: '>=2.2.6 <=2.2.8'
|
xmake-version: '>=2.2.6 <=2.3.1'
|
||||||
```
|
```
|
||||||
+2
-2
@@ -9,9 +9,9 @@ inputs:
|
|||||||
xmake-version:
|
xmake-version:
|
||||||
required: true
|
required: true
|
||||||
default: latest
|
default: latest
|
||||||
description: The version to use. Should be a semver range or 'latest'
|
description: The version to use. Should be a semver range or 'latest'. Or use branch@{branch_name} to select a branch.
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'index.js'
|
main: 'dist/index.js'
|
||||||
|
|
||||||
Vendored
+56
@@ -0,0 +1,56 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const exec_1 = require("@actions/exec");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
function makeOpt(ref) {
|
||||||
|
return { cwd: path.join(os.tmpdir(), `xmake-git-${ref}`) };
|
||||||
|
}
|
||||||
|
async function lsRemote() {
|
||||||
|
let out = '';
|
||||||
|
await exec_1.exec('git', ['ls-remote', 'https://github.com/xmake-io/xmake.git'], {
|
||||||
|
silent: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (d) => (out += d.toString()),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const data = { heads: {}, tags: {}, pull: {} };
|
||||||
|
out.split('\n').forEach((line) => {
|
||||||
|
const [ref, tag] = line.trim().split('\t');
|
||||||
|
if (ref && tag && tag.startsWith('refs/')) {
|
||||||
|
const tagPath = tag.split('/').splice(1);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
|
let ldata = data;
|
||||||
|
for (let i = 0; i < tagPath.length - 1; i++) {
|
||||||
|
const seg = tagPath[i];
|
||||||
|
if (typeof ldata[seg] === 'object') {
|
||||||
|
ldata = ldata[seg];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ldata = ldata[seg] = {};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ldata[tagPath[tagPath.length - 1]] = ref;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
exports.lsRemote = lsRemote;
|
||||||
|
async function create(ref) {
|
||||||
|
const opt = makeOpt(ref);
|
||||||
|
await io.rmRF(opt.cwd);
|
||||||
|
await io.mkdirP(opt.cwd);
|
||||||
|
await exec_1.exec('git', ['init'], opt);
|
||||||
|
await exec_1.exec('git', ['remote', 'add', 'origin', 'https://github.com/xmake-io/xmake.git'], opt);
|
||||||
|
await exec_1.exec('git', ['fetch', 'origin', '+refs/pull/*:refs/remotes/origin/pull/*', '+refs/heads/*:refs/remotes/origin/*'], opt);
|
||||||
|
await exec_1.exec('git', ['checkout', ref], opt);
|
||||||
|
await exec_1.exec('git', ['submodule', 'update', '--init', '--recursive'], opt);
|
||||||
|
return opt.cwd;
|
||||||
|
}
|
||||||
|
exports.create = create;
|
||||||
|
async function cleanup(ref) {
|
||||||
|
const opt = makeOpt(ref);
|
||||||
|
await io.rmRF(opt.cwd);
|
||||||
|
}
|
||||||
|
exports.cleanup = cleanup;
|
||||||
Vendored
+22
@@ -0,0 +1,22 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = require("@actions/core");
|
||||||
|
const exec_1 = require("@actions/exec");
|
||||||
|
const os = require("os");
|
||||||
|
const versions_1 = require("./versions");
|
||||||
|
const win_install_1 = require("./win-install");
|
||||||
|
const unix_install_1 = require("./unix-install");
|
||||||
|
async function run() {
|
||||||
|
try {
|
||||||
|
const version = await versions_1.selectVersion();
|
||||||
|
if (os.platform() === 'win32' || os.platform() === 'cygwin')
|
||||||
|
await win_install_1.winInstall(version);
|
||||||
|
else
|
||||||
|
await unix_install_1.unixInstall(version);
|
||||||
|
await exec_1.exec('xmake --version');
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
core.setFailed(error.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
run().catch((e) => core.error(e));
|
||||||
Vendored
+34
@@ -0,0 +1,34 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = require("@actions/core");
|
||||||
|
const exec_1 = require("@actions/exec");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const toolCache = require("@actions/tool-cache");
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
const semver = require("semver");
|
||||||
|
const git = require("./git");
|
||||||
|
async function unixInstall(version) {
|
||||||
|
const ver = version.version;
|
||||||
|
let toolDir = toolCache.find('xmake', ver);
|
||||||
|
if (!toolDir) {
|
||||||
|
const sourceDir = await core.group(`download xmake ${version}`, () => git.create(version.sha));
|
||||||
|
toolDir = await core.group(`install xmake ${version}`, async () => {
|
||||||
|
await exec_1.exec('make', ['build'], { cwd: sourceDir });
|
||||||
|
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
|
||||||
|
await exec_1.exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir });
|
||||||
|
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
|
||||||
|
await io.rmRF(binDir);
|
||||||
|
await git.cleanup(version.sha);
|
||||||
|
return cacheDir;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// for versions 2.3.2 and above, xmake will be installed directly into the bin directory, and no script will be used to wrap it.
|
||||||
|
if (version.type !== 'tags' || semver.gt(ver, '2.3.1')) {
|
||||||
|
core.addPath(path.join(toolDir, 'bin'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
core.addPath(path.join(toolDir, 'share', 'xmake')); // only for <= 2.3.1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.unixInstall = unixInstall;
|
||||||
Vendored
+123
@@ -0,0 +1,123 @@
|
|||||||
|
"use strict";
|
||||||
|
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, privateMap, value) {
|
||||||
|
if (!privateMap.has(receiver)) {
|
||||||
|
throw new TypeError("attempted to set private field on non-instance");
|
||||||
|
}
|
||||||
|
privateMap.set(receiver, value);
|
||||||
|
return value;
|
||||||
|
};
|
||||||
|
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, privateMap) {
|
||||||
|
if (!privateMap.has(receiver)) {
|
||||||
|
throw new TypeError("attempted to get private field on non-instance");
|
||||||
|
}
|
||||||
|
return privateMap.get(receiver);
|
||||||
|
};
|
||||||
|
var _string;
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = require("@actions/core");
|
||||||
|
const semver = require("semver");
|
||||||
|
const git_1 = require("./git");
|
||||||
|
let VERSIONS;
|
||||||
|
async function getVersions() {
|
||||||
|
if (VERSIONS)
|
||||||
|
return VERSIONS;
|
||||||
|
return (VERSIONS = await git_1.lsRemote());
|
||||||
|
}
|
||||||
|
class VersionImpl {
|
||||||
|
constructor(version, sha, type, toString) {
|
||||||
|
this.version = version;
|
||||||
|
this.sha = sha;
|
||||||
|
this.type = type;
|
||||||
|
_string.set(this, void 0);
|
||||||
|
__classPrivateFieldSet(this, _string, toString);
|
||||||
|
}
|
||||||
|
toString() {
|
||||||
|
return __classPrivateFieldGet(this, _string);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_string = new WeakMap();
|
||||||
|
async function selectBranch(branch) {
|
||||||
|
const versions = await getVersions();
|
||||||
|
if (branch in versions.heads) {
|
||||||
|
return new VersionImpl(branch, versions.heads[branch], 'heads', `branch ${branch}`);
|
||||||
|
}
|
||||||
|
throw new Error(`Branch ${branch} not found`);
|
||||||
|
}
|
||||||
|
async function selectPr(pr) {
|
||||||
|
var _a;
|
||||||
|
const versions = await getVersions();
|
||||||
|
if (pr in versions.pull) {
|
||||||
|
const prheads = versions.pull[pr];
|
||||||
|
const sha = (_a = prheads.merge) !== null && _a !== void 0 ? _a : prheads.head;
|
||||||
|
if (sha) {
|
||||||
|
return new VersionImpl(`pr#${pr}`, sha, 'pull', `pull request #${pr}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Error(`Pull requrest #${pr} not found`);
|
||||||
|
}
|
||||||
|
async function selectSemver(version) {
|
||||||
|
// check version valid
|
||||||
|
const v = new semver.Range(version);
|
||||||
|
if (!v) {
|
||||||
|
throw new Error(`Invalid semver`);
|
||||||
|
}
|
||||||
|
const versions = await getVersions();
|
||||||
|
const ver = semver.maxSatisfying(Object.keys(versions.tags), v);
|
||||||
|
if (!ver) {
|
||||||
|
throw new Error(`No matched releases of xmake-version ${v.format()}`);
|
||||||
|
}
|
||||||
|
const sha = versions.tags[ver];
|
||||||
|
return new VersionImpl(ver, sha, 'tags', ver);
|
||||||
|
}
|
||||||
|
async function selectSha(sha) {
|
||||||
|
sha = sha.toLowerCase();
|
||||||
|
if (!/^[a-f0-9]{40}$/gi.test(sha))
|
||||||
|
throw new Error(`Invalid sha value ${sha}`);
|
||||||
|
const versions = await getVersions();
|
||||||
|
for (const branch in versions.heads) {
|
||||||
|
if (versions.heads[branch] === sha) {
|
||||||
|
return selectBranch(branch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const tag in versions.tags) {
|
||||||
|
if (versions.tags[tag] === sha) {
|
||||||
|
return selectSemver(tag);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Promise.resolve(new VersionImpl(`sha#${sha}`, sha, 'sha', `commit ${sha.substr(0, 8)}`));
|
||||||
|
}
|
||||||
|
async function selectVersion(version) {
|
||||||
|
// get version string
|
||||||
|
version = (version !== null && version !== void 0 ? version : core.getInput('xmake-version')) || 'latest';
|
||||||
|
if (version.toLowerCase() === 'latest')
|
||||||
|
version = '';
|
||||||
|
let ret;
|
||||||
|
// select branch
|
||||||
|
if (version.startsWith('branch@')) {
|
||||||
|
const branch = version.substr('branch@'.length);
|
||||||
|
ret = await selectBranch(branch);
|
||||||
|
}
|
||||||
|
// select pr
|
||||||
|
if (version.startsWith('pr@')) {
|
||||||
|
const pr = Number.parseInt(version.substr('pr@'.length));
|
||||||
|
if (Number.isNaN(pr) || pr <= 0) {
|
||||||
|
throw new Error(`Invalid pull requrest ${version.substr('pr@'.length)}, should be a positive integer`);
|
||||||
|
}
|
||||||
|
ret = await selectPr(pr);
|
||||||
|
}
|
||||||
|
// select sha
|
||||||
|
if (version.startsWith('sha@')) {
|
||||||
|
const sha = version.substr('sha@'.length);
|
||||||
|
ret = await selectSha(sha);
|
||||||
|
}
|
||||||
|
// select version
|
||||||
|
if (semver.validRange(version)) {
|
||||||
|
ret = await selectSemver(version);
|
||||||
|
}
|
||||||
|
if (!ret) {
|
||||||
|
throw new Error(`Invalid input xmake-version ${core.getInput('xmake-version')}`);
|
||||||
|
}
|
||||||
|
core.info(`Selected xmake ${ret} (commit: ${ret.sha.substr(0, 8)})`);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
exports.selectVersion = selectVersion;
|
||||||
Vendored
+65
@@ -0,0 +1,65 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = require("@actions/core");
|
||||||
|
const exec_1 = require("@actions/exec");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const toolCache = require("@actions/tool-cache");
|
||||||
|
const os = require("os");
|
||||||
|
const path = require("path");
|
||||||
|
const semver = require("semver");
|
||||||
|
function getInstallerUrl(version) {
|
||||||
|
const ver = version.version;
|
||||||
|
switch (version.type) {
|
||||||
|
case 'heads': {
|
||||||
|
// we only use appveyor ci artifacts for branch version
|
||||||
|
const arch = os.arch() === 'x64' ? 'x64' : 'x86';
|
||||||
|
return `https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?branch=${ver}&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+${arch}`;
|
||||||
|
}
|
||||||
|
case 'pull': {
|
||||||
|
throw new Error('PR builds for windows is not supported');
|
||||||
|
}
|
||||||
|
case 'sha': {
|
||||||
|
throw new Error('Sha builds for windows is not supported');
|
||||||
|
}
|
||||||
|
case 'tags': {
|
||||||
|
// we cannot use appveyor ci artifacts, the old version links may be broken.
|
||||||
|
const arch = os.arch() === 'x64' ? 'win64' : 'win32';
|
||||||
|
return semver.gt(ver, '2.2.6')
|
||||||
|
? `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.${arch}.exe`
|
||||||
|
: `https://github.com/xmake-io/xmake/releases/download/${ver}/xmake-${ver}.exe`;
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
// check that we have tested all types
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
const _ = version.type;
|
||||||
|
throw new Error('Unknown version type');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
async function winInstall(version) {
|
||||||
|
const ver = version.version;
|
||||||
|
let toolDir = toolCache.find('xmake', ver);
|
||||||
|
if (!toolDir) {
|
||||||
|
const installer = await core.group(`download xmake ${version}`, async () => {
|
||||||
|
const url = getInstallerUrl(version);
|
||||||
|
core.info(`downloading from ${url}`);
|
||||||
|
const file = await toolCache.downloadTool(url);
|
||||||
|
const exe = path.format({ ...path.parse(file), ext: '.exe', base: undefined });
|
||||||
|
await io.mv(file, exe);
|
||||||
|
core.info(`downloaded to ${exe}`);
|
||||||
|
return exe;
|
||||||
|
});
|
||||||
|
toolDir = await core.group(`install xmake ${version}`, async () => {
|
||||||
|
const binDir = path.join(os.tmpdir(), `xmake-${version.sha}`);
|
||||||
|
core.info(`installing to ${binDir}`);
|
||||||
|
await exec_1.exec(`"${installer}" /NOADMIN /S /D=${binDir}`);
|
||||||
|
core.info(`installed to ${binDir}`);
|
||||||
|
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', ver);
|
||||||
|
await io.rmRF(binDir);
|
||||||
|
await io.rmRF(installer);
|
||||||
|
return cacheDir;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
core.addPath(toolDir);
|
||||||
|
}
|
||||||
|
exports.winInstall = winInstall;
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
const exec = require('@actions/exec').exec
|
|
||||||
const io = require('@actions/io')
|
|
||||||
const os = require('os')
|
|
||||||
const path = require('path')
|
|
||||||
|
|
||||||
const folder = path.join(os.tmpdir(), `xmake${Date.now()}`)
|
|
||||||
const opt = { cwd: folder }
|
|
||||||
|
|
||||||
module.exports.folder = folder
|
|
||||||
|
|
||||||
module.exports.create = async function (ref) {
|
|
||||||
await io.rmRF(folder)
|
|
||||||
await io.mkdirP(folder)
|
|
||||||
await exec('git', ['init'], opt)
|
|
||||||
await exec('git', ['remote', 'add', 'origin', 'https://github.com/xmake-io/xmake.git'], opt)
|
|
||||||
await exec('git', ['fetch'], opt)
|
|
||||||
await exec('git', ['checkout', ref], opt)
|
|
||||||
await exec('git', ['submodule', 'update', '--init', '--recursive'], opt)
|
|
||||||
return folder
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports.cleanup = async function () {
|
|
||||||
await io.rmRF(folder)
|
|
||||||
}
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
const core = require('@actions/core')
|
|
||||||
const exec = require('@actions/exec').exec
|
|
||||||
const fs = require('fs').promises
|
|
||||||
const io = require('@actions/io')
|
|
||||||
const toolCache = require('@actions/tool-cache')
|
|
||||||
const os = require('os')
|
|
||||||
const path = require('path')
|
|
||||||
const semver = require('semver')
|
|
||||||
const git = require('./git')
|
|
||||||
const selectVersion = require('./selectVersion')
|
|
||||||
|
|
||||||
async function winInstall(version) {
|
|
||||||
let toolDir = toolCache.find('xmake', version)
|
|
||||||
if (!toolDir) {
|
|
||||||
const installer = await core.group("download xmake", async () => {
|
|
||||||
const arch = os.arch() === 'x64' ? 'x64' : 'x86'
|
|
||||||
const url = semver.gt(version, '2.2.6')
|
|
||||||
? `https://ci.appveyor.com/api/projects/waruqi/xmake/artifacts/xmake-installer.exe?tag=v${version}&pr=false&job=Image%3A+Visual+Studio+2017%3B+Platform%3A+${arch}`
|
|
||||||
: `https://github.com/xmake-io/xmake/releases/download/v$v/xmake-v${version}.exe`
|
|
||||||
core.info(`downloading from ${url}`)
|
|
||||||
const file = await toolCache.downloadTool(url)
|
|
||||||
const exe = path.format({ ...path.parse(file), ext: '.exe', base: undefined })
|
|
||||||
await fs.rename(file, exe)
|
|
||||||
core.info(`downloaded to ${exe}`)
|
|
||||||
return exe
|
|
||||||
})
|
|
||||||
toolDir = await core.group("install xmake", async () => {
|
|
||||||
const binDir = path.join(os.tmpdir(), `xmake-${version}`)
|
|
||||||
core.info(`installing to ${binDir}`)
|
|
||||||
await exec(`"${installer}" /NOADMIN /S /D=${binDir}`)
|
|
||||||
core.info(`installed to ${binDir}`)
|
|
||||||
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', version)
|
|
||||||
await io.rmRF(binDir)
|
|
||||||
await io.rmRF(installer)
|
|
||||||
return cacheDir
|
|
||||||
})
|
|
||||||
}
|
|
||||||
core.addPath(toolDir)
|
|
||||||
}
|
|
||||||
|
|
||||||
async function unixInstall(version, sha) {
|
|
||||||
let toolDir = toolCache.find('xmake', version)
|
|
||||||
if (!toolDir) {
|
|
||||||
const sourceDir = await core.group("download xmake", () => git.create(sha))
|
|
||||||
toolDir = await core.group("install xmake", async () => {
|
|
||||||
await exec('make', ['build'], { cwd: sourceDir })
|
|
||||||
const binDir = path.join(os.tmpdir(), `xmake-${version}-${sha}`)
|
|
||||||
await exec('make', ['install', `prefix=${binDir}`], { cwd: sourceDir })
|
|
||||||
const cacheDir = await toolCache.cacheDir(binDir, 'xmake', version)
|
|
||||||
await io.rmRF(binDir)
|
|
||||||
await git.cleanup()
|
|
||||||
return cacheDir
|
|
||||||
})
|
|
||||||
}
|
|
||||||
core.addPath(path.join(toolDir, 'share', 'xmake'))
|
|
||||||
}
|
|
||||||
|
|
||||||
async function run() {
|
|
||||||
try {
|
|
||||||
const { version, sha } = selectVersion()
|
|
||||||
if (os.platform() === 'win32' || os.platform() === 'cygwin')
|
|
||||||
await winInstall(version)
|
|
||||||
else
|
|
||||||
await unixInstall(version, sha)
|
|
||||||
await exec('xmake --version')
|
|
||||||
} catch (error) {
|
|
||||||
core.setFailed(error.message)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
run()
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
module.exports = {
|
||||||
|
preset: 'ts-jest',
|
||||||
|
testEnvironment: 'node',
|
||||||
|
};
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../semver/bin/semver.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../semver/bin/semver.js" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
@ECHO off
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
"%_prog%" "%dp0%\..\semver\bin\semver.js" %*
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /b %errorlevel%
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../semver/bin/semver.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../semver/bin/semver.js" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
|
||||||
|
|
||||||
case `uname` in
|
|
||||||
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if [ -x "$basedir/node" ]; then
|
|
||||||
"$basedir/node" "$basedir/../uuid/bin/uuid" "$@"
|
|
||||||
ret=$?
|
|
||||||
else
|
|
||||||
node "$basedir/../uuid/bin/uuid" "$@"
|
|
||||||
ret=$?
|
|
||||||
fi
|
|
||||||
exit $ret
|
|
||||||
-17
@@ -1,17 +0,0 @@
|
|||||||
@ECHO off
|
|
||||||
SETLOCAL
|
|
||||||
CALL :find_dp0
|
|
||||||
|
|
||||||
IF EXIST "%dp0%\node.exe" (
|
|
||||||
SET "_prog=%dp0%\node.exe"
|
|
||||||
) ELSE (
|
|
||||||
SET "_prog=node"
|
|
||||||
SET PATHEXT=%PATHEXT:;.JS;=;%
|
|
||||||
)
|
|
||||||
|
|
||||||
"%_prog%" "%dp0%\..\uuid\bin\uuid" %*
|
|
||||||
ENDLOCAL
|
|
||||||
EXIT /b %errorlevel%
|
|
||||||
:find_dp0
|
|
||||||
SET dp0=%~dp0
|
|
||||||
EXIT /b
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../uuid/bin/uuid" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../uuid/bin/uuid" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../which/bin/which" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
+660
@@ -0,0 +1,660 @@
|
|||||||
|
{
|
||||||
|
"systemParams": "win32-x64-72",
|
||||||
|
"modulesFolders": [
|
||||||
|
"node_modules"
|
||||||
|
],
|
||||||
|
"flags": [
|
||||||
|
"production"
|
||||||
|
],
|
||||||
|
"linkedModules": [],
|
||||||
|
"topLevelPatterns": [
|
||||||
|
"@actions/core@^1.1.3",
|
||||||
|
"@actions/exec@^1.0.1",
|
||||||
|
"@actions/io@^1.0.1",
|
||||||
|
"@actions/tool-cache@^1.1.2",
|
||||||
|
"@types/jest@^25.1.4",
|
||||||
|
"@types/node@^13.9.8",
|
||||||
|
"@types/semver@^7.1.0",
|
||||||
|
"@typescript-eslint/eslint-plugin@^2.26.0",
|
||||||
|
"@typescript-eslint/parser@^2.26.0",
|
||||||
|
"eslint-config-prettier@^6.10.1",
|
||||||
|
"eslint-plugin-prettier@^3.1.2",
|
||||||
|
"eslint@^6.8.0",
|
||||||
|
"jest@^25.2.4",
|
||||||
|
"prettier@^2.0.2",
|
||||||
|
"rimraf@^3.0.2",
|
||||||
|
"semver@^7.1.3",
|
||||||
|
"ts-jest@^25.3.0",
|
||||||
|
"typescript@^3.8.3"
|
||||||
|
],
|
||||||
|
"lockfileEntries": {
|
||||||
|
"@actions/core@^1.1.3": "https://registry.npm.taobao.org/@actions/core/download/@actions/core-1.2.3.tgz#e844b4fa0820e206075445079130868f95bfca95",
|
||||||
|
"@actions/core@^1.2.0": "https://registry.npm.taobao.org/@actions/core/download/@actions/core-1.2.3.tgz#e844b4fa0820e206075445079130868f95bfca95",
|
||||||
|
"@actions/exec@^1.0.0": "https://registry.npm.taobao.org/@actions/exec/download/@actions/exec-1.0.3.tgz#b967f8700d6ff011dcc91243b58bafc1bb9ab95f",
|
||||||
|
"@actions/exec@^1.0.1": "https://registry.npm.taobao.org/@actions/exec/download/@actions/exec-1.0.3.tgz#b967f8700d6ff011dcc91243b58bafc1bb9ab95f",
|
||||||
|
"@actions/http-client@^1.0.3": "https://registry.npm.taobao.org/@actions/http-client/download/@actions/http-client-1.0.6.tgz#6f9267ca50e1d74d8581f4a894a943cd4c97b49a",
|
||||||
|
"@actions/io@^1.0.1": "https://registry.npm.taobao.org/@actions/io/download/@actions/io-1.0.2.tgz#2f614b6e69ce14d191180451eb38e6576a6e6b27",
|
||||||
|
"@actions/tool-cache@^1.1.2": "https://registry.npm.taobao.org/@actions/tool-cache/download/@actions/tool-cache-1.3.3.tgz#34cf87a0436a2178207a644932114a236194b0fd",
|
||||||
|
"@babel/code-frame@^7.0.0": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.8.3.tgz?cache=0&sync_timestamp=1580303207516&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e",
|
||||||
|
"@babel/code-frame@^7.8.3": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.8.3.tgz?cache=0&sync_timestamp=1580303207516&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e",
|
||||||
|
"@babel/core@^7.1.0": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.8.7.tgz#b69017d221ccdeb203145ae9da269d72cf102f3b",
|
||||||
|
"@babel/core@^7.7.5": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.8.7.tgz#b69017d221ccdeb203145ae9da269d72cf102f3b",
|
||||||
|
"@babel/generator@^7.8.6": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.8.8.tgz#cdcd58caab730834cee9eeadb729e833b625da3e",
|
||||||
|
"@babel/generator@^7.8.7": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.8.8.tgz#cdcd58caab730834cee9eeadb729e833b625da3e",
|
||||||
|
"@babel/helper-function-name@^7.8.3": "https://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.8.3.tgz#eeeb665a01b1f11068e9fb86ad56a1cb1a824cca",
|
||||||
|
"@babel/helper-get-function-arity@^7.8.3": "https://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.8.3.tgz#b894b947bd004381ce63ea1db9f08547e920abd5",
|
||||||
|
"@babel/helper-plugin-utils@^7.0.0": "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670",
|
||||||
|
"@babel/helper-plugin-utils@^7.8.0": "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.8.3.tgz#9ea293be19babc0f52ff8ca88b34c3611b208670",
|
||||||
|
"@babel/helper-split-export-declaration@^7.8.3": "https://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.8.3.tgz#31a9f30070f91368a7182cf05f831781065fc7a9",
|
||||||
|
"@babel/helpers@^7.8.4": "https://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.8.4.tgz?cache=0&sync_timestamp=1580387813921&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelpers%2Fdownload%2F%40babel%2Fhelpers-7.8.4.tgz#754eb3ee727c165e0a240d6c207de7c455f36f73",
|
||||||
|
"@babel/highlight@^7.8.3": "https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.8.3.tgz#28f173d04223eaaa59bc1d439a3836e6d1265797",
|
||||||
|
"@babel/parser@^7.1.0": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4",
|
||||||
|
"@babel/parser@^7.7.5": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4",
|
||||||
|
"@babel/parser@^7.8.6": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4",
|
||||||
|
"@babel/parser@^7.8.7": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.8.8.tgz#4c3b7ce36db37e0629be1f0d50a571d2f86f6cd4",
|
||||||
|
"@babel/plugin-syntax-bigint@^7.0.0": "https://registry.npm.taobao.org/@babel/plugin-syntax-bigint/download/@babel/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea",
|
||||||
|
"@babel/plugin-syntax-object-rest-spread@^7.0.0": "https://registry.npm.taobao.org/@babel/plugin-syntax-object-rest-spread/download/@babel/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871",
|
||||||
|
"@babel/template@^7.7.4": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.8.6.tgz?cache=0&sync_timestamp=1582806154512&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b",
|
||||||
|
"@babel/template@^7.8.3": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.8.6.tgz?cache=0&sync_timestamp=1582806154512&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b",
|
||||||
|
"@babel/template@^7.8.6": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.8.6.tgz?cache=0&sync_timestamp=1582806154512&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.8.6.tgz#86b22af15f828dfb086474f964dcc3e39c43ce2b",
|
||||||
|
"@babel/traverse@^7.1.0": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.6.tgz?cache=0&sync_timestamp=1582806154496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff",
|
||||||
|
"@babel/traverse@^7.7.4": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.6.tgz?cache=0&sync_timestamp=1582806154496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff",
|
||||||
|
"@babel/traverse@^7.8.4": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.6.tgz?cache=0&sync_timestamp=1582806154496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff",
|
||||||
|
"@babel/traverse@^7.8.6": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.8.6.tgz?cache=0&sync_timestamp=1582806154496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftraverse%2Fdownload%2F%40babel%2Ftraverse-7.8.6.tgz#acfe0c64e1cd991b3e32eae813a6eb564954b5ff",
|
||||||
|
"@babel/types@^7.0.0": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.8.7.tgz?cache=0&sync_timestamp=1583373427111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d",
|
||||||
|
"@babel/types@^7.3.0": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.8.7.tgz?cache=0&sync_timestamp=1583373427111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d",
|
||||||
|
"@babel/types@^7.8.3": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.8.7.tgz?cache=0&sync_timestamp=1583373427111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d",
|
||||||
|
"@babel/types@^7.8.6": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.8.7.tgz?cache=0&sync_timestamp=1583373427111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d",
|
||||||
|
"@babel/types@^7.8.7": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.8.7.tgz?cache=0&sync_timestamp=1583373427111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.8.7.tgz#1fc9729e1acbb2337d5b6977a63979b4819f5d1d",
|
||||||
|
"@bcoe/v8-coverage@^0.2.3": "https://registry.npm.taobao.org/@bcoe/v8-coverage/download/@bcoe/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39",
|
||||||
|
"@cnakazawa/watch@^1.0.3": "https://registry.npm.taobao.org/@cnakazawa/watch/download/@cnakazawa/watch-1.0.4.tgz#f864ae85004d0fcab6f50be9141c4da368d1656a",
|
||||||
|
"@istanbuljs/load-nyc-config@^1.0.0": "https://registry.npm.taobao.org/@istanbuljs/load-nyc-config/download/@istanbuljs/load-nyc-config-1.0.0.tgz#10602de5570baea82f8afbfa2630b24e7a8cfe5b",
|
||||||
|
"@istanbuljs/schema@^0.1.2": "https://registry.npm.taobao.org/@istanbuljs/schema/download/@istanbuljs/schema-0.1.2.tgz#26520bf09abe4a5644cd5414e37125a8954241dd",
|
||||||
|
"@jest/console@^25.2.3": "https://registry.npm.taobao.org/@jest/console/download/@jest/console-25.2.3.tgz#38ac19b916ff61457173799239472659e1a67c39",
|
||||||
|
"@jest/core@^25.2.4": "https://registry.npm.taobao.org/@jest/core/download/@jest/core-25.2.4.tgz#382ef80369d3311f1df79db1ee19e958ae95cdad",
|
||||||
|
"@jest/environment@^25.2.4": "https://registry.npm.taobao.org/@jest/environment/download/@jest/environment-25.2.4.tgz#74f4d8dd87b427434d0b822cde37bc0e78f3e28b",
|
||||||
|
"@jest/fake-timers@^25.2.4": "https://registry.npm.taobao.org/@jest/fake-timers/download/@jest/fake-timers-25.2.4.tgz#6821b6edde74fda2a42467ae92cc93095d4c9527",
|
||||||
|
"@jest/reporters@^25.2.4": "https://registry.npm.taobao.org/@jest/reporters/download/@jest/reporters-25.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Freporters%2Fdownload%2F%40jest%2Freporters-25.2.4.tgz#aa01c20aab217150d3a6080d5c98ce0bf34b17ed",
|
||||||
|
"@jest/source-map@^25.2.1": "https://registry.npm.taobao.org/@jest/source-map/download/@jest/source-map-25.2.1.tgz?cache=0&sync_timestamp=1585215407328&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fsource-map%2Fdownload%2F%40jest%2Fsource-map-25.2.1.tgz#b62ecf8ae76170b08eff8859b56eb7576df34ab8",
|
||||||
|
"@jest/test-result@^25.2.4": "https://registry.npm.taobao.org/@jest/test-result/download/@jest/test-result-25.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftest-result%2Fdownload%2F%40jest%2Ftest-result-25.2.4.tgz#8fc9eac58e82eb2a82e4058e68c3814f98f59cf5",
|
||||||
|
"@jest/test-sequencer@^25.2.4": "https://registry.npm.taobao.org/@jest/test-sequencer/download/@jest/test-sequencer-25.2.4.tgz#28364aeddec140c696324114f63570f3de536c87",
|
||||||
|
"@jest/transform@^25.2.4": "https://registry.npm.taobao.org/@jest/transform/download/@jest/transform-25.2.4.tgz#34336f37f13f62f7d1f5b93d5d150ba9eb3e11b9",
|
||||||
|
"@jest/types@^25.1.0": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-25.1.0.tgz#b26831916f0d7c381e11dbb5e103a72aed1b4395",
|
||||||
|
"@jest/types@^25.2.3": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-25.2.3.tgz#035c4fb94e2da472f359ff9a211915d59987f6b6",
|
||||||
|
"@sinonjs/commons@^1.7.0": "https://registry.npm.taobao.org/@sinonjs/commons/download/@sinonjs/commons-1.7.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40sinonjs%2Fcommons%2Fdownload%2F%40sinonjs%2Fcommons-1.7.1.tgz#da5fd19a5f71177a53778073978873964f49acf1",
|
||||||
|
"@types/babel__core@^7.1.0": "https://registry.npm.taobao.org/@types/babel__core/download/@types/babel__core-7.1.6.tgz?cache=0&sync_timestamp=1582707998251&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fbabel__core%2Fdownload%2F%40types%2Fbabel__core-7.1.6.tgz#16ff42a5ae203c9af1c6e190ed1f30f83207b610",
|
||||||
|
"@types/babel__generator@*": "https://registry.npm.taobao.org/@types/babel__generator/download/@types/babel__generator-7.6.1.tgz#4901767b397e8711aeb99df8d396d7ba7b7f0e04",
|
||||||
|
"@types/babel__template@*": "https://registry.npm.taobao.org/@types/babel__template/download/@types/babel__template-7.0.2.tgz?cache=0&sync_timestamp=1580847874054&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fbabel__template%2Fdownload%2F%40types%2Fbabel__template-7.0.2.tgz#4ff63d6b52eddac1de7b975a5223ed32ecea9307",
|
||||||
|
"@types/babel__traverse@*": "https://registry.npm.taobao.org/@types/babel__traverse/download/@types/babel__traverse-7.0.9.tgz#be82fab304b141c3eee81a4ce3b034d0eba1590a",
|
||||||
|
"@types/babel__traverse@^7.0.6": "https://registry.npm.taobao.org/@types/babel__traverse/download/@types/babel__traverse-7.0.9.tgz#be82fab304b141c3eee81a4ce3b034d0eba1590a",
|
||||||
|
"@types/color-name@^1.1.1": "https://registry.npm.taobao.org/@types/color-name/download/@types/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0",
|
||||||
|
"@types/eslint-visitor-keys@^1.0.0": "https://registry.npm.taobao.org/@types/eslint-visitor-keys/download/@types/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d",
|
||||||
|
"@types/istanbul-lib-coverage@*": "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff",
|
||||||
|
"@types/istanbul-lib-coverage@^2.0.0": "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff",
|
||||||
|
"@types/istanbul-lib-coverage@^2.0.1": "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff",
|
||||||
|
"@types/istanbul-lib-report@*": "https://registry.npm.taobao.org/@types/istanbul-lib-report/download/@types/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686",
|
||||||
|
"@types/istanbul-reports@^1.1.1": "https://registry.npm.taobao.org/@types/istanbul-reports/download/@types/istanbul-reports-1.1.1.tgz#7a8cbf6a406f36c8add871625b278eaf0b0d255a",
|
||||||
|
"@types/jest@^25.1.4": "https://registry.npm.taobao.org/@types/jest/download/@types/jest-25.1.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fjest%2Fdownload%2F%40types%2Fjest-25.1.4.tgz#9e9f1e59dda86d3fd56afce71d1ea1b331f6f760",
|
||||||
|
"@types/json-schema@^7.0.3": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.4.tgz#38fd73ddfd9b55abb1e1b2ed578cb55bd7b7d339",
|
||||||
|
"@types/node@*": "https://registry.npm.taobao.org/@types/node/download/@types/node-13.9.2.tgz?cache=0&sync_timestamp=1584566829623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnode%2Fdownload%2F%40types%2Fnode-13.9.2.tgz#ace1880c03594cc3e80206d96847157d8e7fa349",
|
||||||
|
"@types/node@^13.9.8": "https://registry.npm.taobao.org/@types/node/download/@types/node-13.9.8.tgz#09976420fc80a7a00bf40680c63815ed8c7616f4",
|
||||||
|
"@types/prettier@^1.19.0": "https://registry.npm.taobao.org/@types/prettier/download/@types/prettier-1.19.1.tgz#33509849f8e679e4add158959fdb086440e9553f",
|
||||||
|
"@types/semver@^7.1.0": "https://registry.npm.taobao.org/@types/semver/download/@types/semver-7.1.0.tgz#c8c630d4c18cd326beff77404887596f96408408",
|
||||||
|
"@types/stack-utils@^1.0.1": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz#0a851d3bd96498fa25c33ab7278ed3bd65f06c3e",
|
||||||
|
"@types/yargs-parser@*": "https://registry.npm.taobao.org/@types/yargs-parser/download/@types/yargs-parser-15.0.0.tgz#cb3f9f741869e20cce330ffbeb9271590483882d",
|
||||||
|
"@types/yargs@^15.0.0": "https://registry.npm.taobao.org/@types/yargs/download/@types/yargs-15.0.4.tgz#7e5d0f8ca25e9d5849f2ea443cf7c402decd8299",
|
||||||
|
"@typescript-eslint/eslint-plugin@^2.26.0": "https://registry.npm.taobao.org/@typescript-eslint/eslint-plugin/download/@typescript-eslint/eslint-plugin-2.26.0.tgz#04c96560c8981421e5a9caad8394192363cc423f",
|
||||||
|
"@typescript-eslint/experimental-utils@2.26.0": "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-2.26.0.tgz#063390c404d9980767d76274df386c0aa675d91d",
|
||||||
|
"@typescript-eslint/parser@^2.26.0": "https://registry.npm.taobao.org/@typescript-eslint/parser/download/@typescript-eslint/parser-2.26.0.tgz#385463615818b33acb72a25b39c03579df93d76f",
|
||||||
|
"@typescript-eslint/typescript-estree@2.26.0": "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-2.26.0.tgz#d8132cf1ee8a72234f996519a47d8a9118b57d56",
|
||||||
|
"abab@^2.0.0": "https://registry.npm.taobao.org/abab/download/abab-2.0.3.tgz#623e2075e02eb2d3f2475e49f99c91846467907a",
|
||||||
|
"acorn-globals@^4.3.2": "https://registry.npm.taobao.org/acorn-globals/download/acorn-globals-4.3.4.tgz#9fa1926addc11c97308c4e66d7add0d40c3272e7",
|
||||||
|
"acorn-jsx@^5.2.0": "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.2.0.tgz#4c66069173d6fdd68ed85239fc256226182b2ebe",
|
||||||
|
"acorn-walk@^6.0.1": "https://registry.npm.taobao.org/acorn-walk/download/acorn-walk-6.2.0.tgz#123cb8f3b84c2171f1f7fb252615b1c78a6b1a8c",
|
||||||
|
"acorn@^6.0.1": "https://registry.npm.taobao.org/acorn/download/acorn-6.4.1.tgz?cache=0&sync_timestamp=1583796451368&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-6.4.1.tgz#531e58ba3f51b9dacb9a6646ca4debf5b14ca474",
|
||||||
|
"acorn@^7.1.0": "https://registry.npm.taobao.org/acorn/download/acorn-7.1.1.tgz?cache=0&sync_timestamp=1583796451368&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf",
|
||||||
|
"acorn@^7.1.1": "https://registry.npm.taobao.org/acorn/download/acorn-7.1.1.tgz?cache=0&sync_timestamp=1583796451368&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Facorn%2Fdownload%2Facorn-7.1.1.tgz#e35668de0b402f359de515c5482a1ab9f89a69bf",
|
||||||
|
"ajv@^6.10.0": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz?cache=0&sync_timestamp=1582379551272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7",
|
||||||
|
"ajv@^6.10.2": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz?cache=0&sync_timestamp=1582379551272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7",
|
||||||
|
"ajv@^6.5.5": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.0.tgz?cache=0&sync_timestamp=1582379551272&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fajv%2Fdownload%2Fajv-6.12.0.tgz#06d60b96d87b8454a5adaba86e7854da629db4b7",
|
||||||
|
"ansi-escapes@^4.2.1": "https://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-4.3.1.tgz?cache=0&sync_timestamp=1583072820951&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fansi-escapes%2Fdownload%2Fansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61",
|
||||||
|
"ansi-regex@^4.1.0": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997",
|
||||||
|
"ansi-regex@^5.0.0": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-5.0.0.tgz#388539f55179bf39339c81af30a654d69f87cb75",
|
||||||
|
"ansi-styles@^3.2.0": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
||||||
|
"ansi-styles@^3.2.1": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d",
|
||||||
|
"ansi-styles@^4.0.0": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359",
|
||||||
|
"ansi-styles@^4.1.0": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz#90ae75c424d008d2624c5bf29ead3177ebfcf359",
|
||||||
|
"anymatch@^2.0.0": "https://registry.npm.taobao.org/anymatch/download/anymatch-2.0.0.tgz#bcb24b4f37934d9aa7ac17b4adaf89e7c76ef2eb",
|
||||||
|
"anymatch@^3.0.3": "https://registry.npm.taobao.org/anymatch/download/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142",
|
||||||
|
"argparse@^1.0.7": "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911",
|
||||||
|
"arr-diff@^4.0.0": "https://registry.npm.taobao.org/arr-diff/download/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520",
|
||||||
|
"arr-flatten@^1.1.0": "https://registry.npm.taobao.org/arr-flatten/download/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1",
|
||||||
|
"arr-union@^3.1.0": "https://registry.npm.taobao.org/arr-union/download/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4",
|
||||||
|
"array-equal@^1.0.0": "https://registry.npm.taobao.org/array-equal/download/array-equal-1.0.0.tgz#8c2a5ef2472fd9ea742b04c77a75093ba2757c93",
|
||||||
|
"array-unique@^0.3.2": "https://registry.npm.taobao.org/array-unique/download/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428",
|
||||||
|
"asn1@~0.2.3": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136",
|
||||||
|
"assert-plus@1.0.0": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
|
||||||
|
"assert-plus@^1.0.0": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525",
|
||||||
|
"assign-symbols@^1.0.0": "https://registry.npm.taobao.org/assign-symbols/download/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367",
|
||||||
|
"astral-regex@^1.0.0": "https://registry.npm.taobao.org/astral-regex/download/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9",
|
||||||
|
"asynckit@^0.4.0": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79",
|
||||||
|
"atob@^2.1.2": "https://registry.npm.taobao.org/atob/download/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9",
|
||||||
|
"aws-sign2@~0.7.0": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8",
|
||||||
|
"aws4@^1.8.0": "https://registry.npm.taobao.org/aws4/download/aws4-1.9.1.tgz#7e33d8f7d449b3f673cd72deb9abdc552dbe528e",
|
||||||
|
"babel-jest@^25.2.4": "https://registry.npm.taobao.org/babel-jest/download/babel-jest-25.2.4.tgz?cache=0&sync_timestamp=1585510733152&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-jest%2Fdownload%2Fbabel-jest-25.2.4.tgz#b21b68d3af8f161c3e6e501e91f0dea8e652e344",
|
||||||
|
"babel-plugin-istanbul@^6.0.0": "https://registry.npm.taobao.org/babel-plugin-istanbul/download/babel-plugin-istanbul-6.0.0.tgz#e159ccdc9af95e0b570c75b4573b7c34d671d765",
|
||||||
|
"babel-plugin-jest-hoist@^25.2.1": "https://registry.npm.taobao.org/babel-plugin-jest-hoist/download/babel-plugin-jest-hoist-25.2.1.tgz?cache=0&sync_timestamp=1585215408279&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-jest-hoist%2Fdownload%2Fbabel-plugin-jest-hoist-25.2.1.tgz#d0003a1f3d5caa281e1107fe03bbf16b799f9955",
|
||||||
|
"babel-preset-jest@^25.2.1": "https://registry.npm.taobao.org/babel-preset-jest/download/babel-preset-jest-25.2.1.tgz?cache=0&sync_timestamp=1585215284183&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-preset-jest%2Fdownload%2Fbabel-preset-jest-25.2.1.tgz#4ccd0e577f69aa11b71806edfe8b25a5c3ac93a2",
|
||||||
|
"balanced-match@^1.0.0": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767",
|
||||||
|
"base@^0.11.1": "https://registry.npm.taobao.org/base/download/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f",
|
||||||
|
"bcrypt-pbkdf@^1.0.0": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e",
|
||||||
|
"brace-expansion@^1.1.7": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
|
||||||
|
"braces@^2.3.1": "https://registry.npm.taobao.org/braces/download/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729",
|
||||||
|
"braces@^3.0.1": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107",
|
||||||
|
"browser-process-hrtime@^1.0.0": "https://registry.npm.taobao.org/browser-process-hrtime/download/browser-process-hrtime-1.0.0.tgz#3c9b4b7d782c8121e56f10106d84c0d0ffc94626",
|
||||||
|
"browser-resolve@^1.11.3": "https://registry.npm.taobao.org/browser-resolve/download/browser-resolve-1.11.3.tgz#9b7cbb3d0f510e4cb86bdbd796124d28b5890af6",
|
||||||
|
"bs-logger@0.x": "https://registry.npm.taobao.org/bs-logger/download/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8",
|
||||||
|
"bser@2.1.1": "https://registry.npm.taobao.org/bser/download/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05",
|
||||||
|
"buffer-from@1.x": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
|
||||||
|
"buffer-from@^1.0.0": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef",
|
||||||
|
"cache-base@^1.0.1": "https://registry.npm.taobao.org/cache-base/download/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2",
|
||||||
|
"callsites@^3.0.0": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73",
|
||||||
|
"camelcase@^5.0.0": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320",
|
||||||
|
"camelcase@^5.3.1": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320",
|
||||||
|
"capture-exit@^2.0.0": "https://registry.npm.taobao.org/capture-exit/download/capture-exit-2.0.0.tgz#fb953bfaebeb781f62898239dabb426d08a509a4",
|
||||||
|
"caseless@~0.12.0": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc",
|
||||||
|
"chalk@^2.0.0": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424",
|
||||||
|
"chalk@^2.1.0": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424",
|
||||||
|
"chalk@^3.0.0": "https://registry.npm.taobao.org/chalk/download/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4",
|
||||||
|
"chardet@^0.7.0": "https://registry.npm.taobao.org/chardet/download/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e",
|
||||||
|
"ci-info@^2.0.0": "https://registry.npm.taobao.org/ci-info/download/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46",
|
||||||
|
"class-utils@^0.3.5": "https://registry.npm.taobao.org/class-utils/download/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463",
|
||||||
|
"cli-cursor@^3.1.0": "https://registry.npm.taobao.org/cli-cursor/download/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307",
|
||||||
|
"cli-width@^2.0.0": "https://registry.npm.taobao.org/cli-width/download/cli-width-2.2.0.tgz#ff19ede8a9a5e579324147b0c11f0fbcbabed639",
|
||||||
|
"cliui@^6.0.0": "https://registry.npm.taobao.org/cliui/download/cliui-6.0.0.tgz#511d702c0c4e41ca156d7d0e96021f23e13225b1",
|
||||||
|
"co@^4.6.0": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184",
|
||||||
|
"collect-v8-coverage@^1.0.0": "https://registry.npm.taobao.org/collect-v8-coverage/download/collect-v8-coverage-1.0.0.tgz#150ee634ac3650b71d9c985eb7f608942334feb1",
|
||||||
|
"collection-visit@^1.0.0": "https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0",
|
||||||
|
"color-convert@^1.9.0": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8",
|
||||||
|
"color-convert@^2.0.1": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3",
|
||||||
|
"color-name@1.1.3": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25",
|
||||||
|
"color-name@~1.1.4": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2",
|
||||||
|
"combined-stream@^1.0.6": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f",
|
||||||
|
"combined-stream@~1.0.6": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f",
|
||||||
|
"component-emitter@^1.2.1": "https://registry.npm.taobao.org/component-emitter/download/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0",
|
||||||
|
"concat-map@0.0.1": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b",
|
||||||
|
"convert-source-map@^1.4.0": "https://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442",
|
||||||
|
"convert-source-map@^1.6.0": "https://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442",
|
||||||
|
"convert-source-map@^1.7.0": "https://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442",
|
||||||
|
"copy-descriptor@^0.1.0": "https://registry.npm.taobao.org/copy-descriptor/download/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d",
|
||||||
|
"core-util-is@1.0.2": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7",
|
||||||
|
"cross-spawn@^6.0.0": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4",
|
||||||
|
"cross-spawn@^6.0.5": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4",
|
||||||
|
"cross-spawn@^7.0.0": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14",
|
||||||
|
"cssom@^0.4.1": "https://registry.npm.taobao.org/cssom/download/cssom-0.4.4.tgz#5a66cf93d2d0b661d80bf6a44fb65f5c2e4e0a10",
|
||||||
|
"cssom@~0.3.6": "https://registry.npm.taobao.org/cssom/download/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a",
|
||||||
|
"cssstyle@^2.0.0": "https://registry.npm.taobao.org/cssstyle/download/cssstyle-2.2.0.tgz#e4c44debccd6b7911ed617a4395e5754bba59992",
|
||||||
|
"dashdash@^1.12.0": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0",
|
||||||
|
"data-urls@^1.1.0": "https://registry.npm.taobao.org/data-urls/download/data-urls-1.1.0.tgz#15ee0582baa5e22bb59c77140da8f9c76963bbfe",
|
||||||
|
"debug@^2.2.0": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
|
||||||
|
"debug@^2.3.3": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f",
|
||||||
|
"debug@^4.0.1": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791",
|
||||||
|
"debug@^4.1.0": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791",
|
||||||
|
"debug@^4.1.1": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791",
|
||||||
|
"decamelize@^1.2.0": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290",
|
||||||
|
"decode-uri-component@^0.2.0": "https://registry.npm.taobao.org/decode-uri-component/download/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545",
|
||||||
|
"deep-is@~0.1.3": "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz#b369d6fb5dbc13eecf524f91b070feedc357cf34",
|
||||||
|
"deepmerge@^4.2.2": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955",
|
||||||
|
"define-property@^0.2.5": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116",
|
||||||
|
"define-property@^1.0.0": "https://registry.npm.taobao.org/define-property/download/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6",
|
||||||
|
"define-property@^2.0.2": "https://registry.npm.taobao.org/define-property/download/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d",
|
||||||
|
"delayed-stream@~1.0.0": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619",
|
||||||
|
"detect-newline@^3.0.0": "https://registry.npm.taobao.org/detect-newline/download/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651",
|
||||||
|
"diff-sequences@^25.1.0": "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-25.1.0.tgz#fd29a46f1c913fd66c22645dc75bffbe43051f32",
|
||||||
|
"diff-sequences@^25.2.1": "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-25.2.1.tgz#fcfe8aa07dd9b0c648396a478dabca8e76c6ab27",
|
||||||
|
"doctrine@^3.0.0": "https://registry.npm.taobao.org/doctrine/download/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961",
|
||||||
|
"domexception@^1.0.1": "https://registry.npm.taobao.org/domexception/download/domexception-1.0.1.tgz#937442644ca6a31261ef36e3ec677fe805582c90",
|
||||||
|
"ecc-jsbn@~0.1.1": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9",
|
||||||
|
"emoji-regex@^7.0.1": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156",
|
||||||
|
"emoji-regex@^8.0.0": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37",
|
||||||
|
"end-of-stream@^1.1.0": "https://registry.npm.taobao.org/end-of-stream/download/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0",
|
||||||
|
"escape-string-regexp@^1.0.5": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4",
|
||||||
|
"escodegen@^1.11.1": "https://registry.npm.taobao.org/escodegen/download/escodegen-1.14.1.tgz#ba01d0c8278b5e95a9a45350142026659027a457",
|
||||||
|
"eslint-config-prettier@^6.10.1": "https://registry.npm.taobao.org/eslint-config-prettier/download/eslint-config-prettier-6.10.1.tgz#129ef9ec575d5ddc0e269667bf09defcd898642a",
|
||||||
|
"eslint-plugin-prettier@^3.1.2": "https://registry.npm.taobao.org/eslint-plugin-prettier/download/eslint-plugin-prettier-3.1.2.tgz#432e5a667666ab84ce72f945c72f77d996a5c9ba",
|
||||||
|
"eslint-scope@^5.0.0": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.0.0.tgz#e87c8887c73e8d1ec84f1ca591645c358bfc8fb9",
|
||||||
|
"eslint-utils@^1.4.3": "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-1.4.3.tgz#74fec7c54d0776b6f67e0251040b5806564e981f",
|
||||||
|
"eslint-utils@^2.0.0": "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-2.0.0.tgz#7be1cc70f27a72a76cd14aa698bcabed6890e1cd",
|
||||||
|
"eslint-visitor-keys@^1.1.0": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2",
|
||||||
|
"eslint@^6.8.0": "https://registry.npm.taobao.org/eslint/download/eslint-6.8.0.tgz?cache=0&sync_timestamp=1582928719498&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-6.8.0.tgz#62262d6729739f9275723824302fb227c8c93ffb",
|
||||||
|
"espree@^6.1.2": "https://registry.npm.taobao.org/espree/download/espree-6.2.1.tgz?cache=0&sync_timestamp=1583870100266&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fespree%2Fdownload%2Fespree-6.2.1.tgz#77fc72e1fd744a2052c20f38a5b575832e82734a",
|
||||||
|
"esprima@^4.0.0": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71",
|
||||||
|
"esprima@^4.0.1": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71",
|
||||||
|
"esquery@^1.0.1": "https://registry.npm.taobao.org/esquery/download/esquery-1.1.0.tgz?cache=0&sync_timestamp=1581531387755&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fesquery%2Fdownload%2Fesquery-1.1.0.tgz#c5c0b66f383e7656404f86b31334d72524eddb48",
|
||||||
|
"esrecurse@^4.1.0": "https://registry.npm.taobao.org/esrecurse/download/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf",
|
||||||
|
"estraverse@^4.0.0": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
||||||
|
"estraverse@^4.1.0": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
||||||
|
"estraverse@^4.1.1": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
||||||
|
"estraverse@^4.2.0": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d",
|
||||||
|
"esutils@^2.0.2": "https://registry.npm.taobao.org/esutils/download/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64",
|
||||||
|
"exec-sh@^0.3.2": "https://registry.npm.taobao.org/exec-sh/download/exec-sh-0.3.4.tgz#3a018ceb526cc6f6df2bb504b2bfe8e3a4934ec5",
|
||||||
|
"execa@^1.0.0": "https://registry.npm.taobao.org/execa/download/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8",
|
||||||
|
"execa@^3.2.0": "https://registry.npm.taobao.org/execa/download/execa-3.4.0.tgz#c08ed4550ef65d858fac269ffc8572446f37eb89",
|
||||||
|
"exit@^0.1.2": "https://registry.npm.taobao.org/exit/download/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c",
|
||||||
|
"expand-brackets@^2.1.4": "https://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622",
|
||||||
|
"expect@^25.2.4": "https://registry.npm.taobao.org/expect/download/expect-25.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexpect%2Fdownload%2Fexpect-25.2.4.tgz#b66e0777c861034ebc21730bb34e1839d5d46806",
|
||||||
|
"extend-shallow@^2.0.1": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f",
|
||||||
|
"extend-shallow@^3.0.0": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8",
|
||||||
|
"extend-shallow@^3.0.2": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8",
|
||||||
|
"extend@~3.0.2": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa",
|
||||||
|
"external-editor@^3.0.3": "https://registry.npm.taobao.org/external-editor/download/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495",
|
||||||
|
"extglob@^2.0.4": "https://registry.npm.taobao.org/extglob/download/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543",
|
||||||
|
"extsprintf@1.3.0": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05",
|
||||||
|
"extsprintf@^1.2.0": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f",
|
||||||
|
"fast-deep-equal@^3.1.1": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz#545145077c501491e33b15ec408c294376e94ae4",
|
||||||
|
"fast-diff@^1.1.2": "https://registry.npm.taobao.org/fast-diff/download/fast-diff-1.2.0.tgz#73ee11982d86caaf7959828d519cfe927fac5f03",
|
||||||
|
"fast-json-stable-stringify@2.x": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
||||||
|
"fast-json-stable-stringify@^2.0.0": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633",
|
||||||
|
"fast-levenshtein@~2.0.6": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917",
|
||||||
|
"fb-watchman@^2.0.0": "https://registry.npm.taobao.org/fb-watchman/download/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85",
|
||||||
|
"figures@^3.0.0": "https://registry.npm.taobao.org/figures/download/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af",
|
||||||
|
"file-entry-cache@^5.0.1": "https://registry.npm.taobao.org/file-entry-cache/download/file-entry-cache-5.0.1.tgz#ca0f6efa6dd3d561333fb14515065c2fafdf439c",
|
||||||
|
"fill-range@^4.0.0": "https://registry.npm.taobao.org/fill-range/download/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7",
|
||||||
|
"fill-range@^7.0.1": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40",
|
||||||
|
"find-up@^4.0.0": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19",
|
||||||
|
"find-up@^4.1.0": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19",
|
||||||
|
"flat-cache@^2.0.1": "https://registry.npm.taobao.org/flat-cache/download/flat-cache-2.0.1.tgz#5d296d6f04bda44a4630a301413bdbc2ec085ec0",
|
||||||
|
"flatted@^2.0.0": "https://registry.npm.taobao.org/flatted/download/flatted-2.0.1.tgz#69e57caa8f0eacbc281d2e2cb458d46fdb449e08",
|
||||||
|
"for-in@^1.0.2": "https://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80",
|
||||||
|
"forever-agent@~0.6.1": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
|
||||||
|
"form-data@~2.3.2": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6",
|
||||||
|
"fragment-cache@^0.2.1": "https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19",
|
||||||
|
"fs.realpath@^1.0.0": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f",
|
||||||
|
"fsevents@^2.1.2": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.2.tgz#4c0a1fb34bc68e543b4b82a9ec392bfbda840805",
|
||||||
|
"functional-red-black-tree@^1.0.1": "https://registry.npm.taobao.org/functional-red-black-tree/download/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327",
|
||||||
|
"gensync@^1.0.0-beta.1": "https://registry.npm.taobao.org/gensync/download/gensync-1.0.0-beta.1.tgz#58f4361ff987e5ff6e1e7a210827aa371eaac269",
|
||||||
|
"get-caller-file@^2.0.1": "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e",
|
||||||
|
"get-stdin@^6.0.0": "https://registry.npm.taobao.org/get-stdin/download/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b",
|
||||||
|
"get-stream@^4.0.0": "https://registry.npm.taobao.org/get-stream/download/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5",
|
||||||
|
"get-stream@^5.0.0": "https://registry.npm.taobao.org/get-stream/download/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9",
|
||||||
|
"get-value@^2.0.3": "https://registry.npm.taobao.org/get-value/download/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28",
|
||||||
|
"get-value@^2.0.6": "https://registry.npm.taobao.org/get-value/download/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28",
|
||||||
|
"getpass@^0.1.1": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa",
|
||||||
|
"glob-parent@^5.0.0": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.0.tgz#5f4c1d1e748d30cd73ad2944b3577a81b081e8c2",
|
||||||
|
"glob@^7.1.1": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6",
|
||||||
|
"glob@^7.1.2": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6",
|
||||||
|
"glob@^7.1.3": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6",
|
||||||
|
"glob@^7.1.4": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6",
|
||||||
|
"glob@^7.1.6": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6",
|
||||||
|
"globals@^11.1.0": "https://registry.npm.taobao.org/globals/download/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e",
|
||||||
|
"globals@^12.1.0": "https://registry.npm.taobao.org/globals/download/globals-12.4.0.tgz#a18813576a41b00a24a97e7f815918c2e19925f8",
|
||||||
|
"graceful-fs@^4.2.3": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423",
|
||||||
|
"growly@^1.3.0": "https://registry.npm.taobao.org/growly/download/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081",
|
||||||
|
"har-schema@^2.0.0": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92",
|
||||||
|
"har-validator@~5.1.3": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz#1ef89ebd3e4996557675eed9893110dc350fa080",
|
||||||
|
"has-flag@^3.0.0": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd",
|
||||||
|
"has-flag@^4.0.0": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b",
|
||||||
|
"has-value@^0.3.1": "https://registry.npm.taobao.org/has-value/download/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f",
|
||||||
|
"has-value@^1.0.0": "https://registry.npm.taobao.org/has-value/download/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177",
|
||||||
|
"has-values@^0.1.4": "https://registry.npm.taobao.org/has-values/download/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771",
|
||||||
|
"has-values@^1.0.0": "https://registry.npm.taobao.org/has-values/download/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f",
|
||||||
|
"html-encoding-sniffer@^1.0.2": "https://registry.npm.taobao.org/html-encoding-sniffer/download/html-encoding-sniffer-1.0.2.tgz#e70d84b94da53aa375e11fe3a351be6642ca46f8",
|
||||||
|
"html-escaper@^2.0.0": "https://registry.npm.taobao.org/html-escaper/download/html-escaper-2.0.0.tgz#71e87f931de3fe09e56661ab9a29aadec707b491",
|
||||||
|
"http-signature@~1.2.0": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz?cache=0&sync_timestamp=1582587749558&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-signature%2Fdownload%2Fhttp-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1",
|
||||||
|
"human-signals@^1.1.1": "https://registry.npm.taobao.org/human-signals/download/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3",
|
||||||
|
"iconv-lite@0.4.24": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b",
|
||||||
|
"iconv-lite@^0.4.24": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b",
|
||||||
|
"ignore@^4.0.6": "https://registry.npm.taobao.org/ignore/download/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc",
|
||||||
|
"import-fresh@^3.0.0": "https://registry.npm.taobao.org/import-fresh/download/import-fresh-3.2.1.tgz#633ff618506e793af5ac91bf48b72677e15cbe66",
|
||||||
|
"import-local@^3.0.2": "https://registry.npm.taobao.org/import-local/download/import-local-3.0.2.tgz#a8cfd0431d1de4a2199703d003e3e62364fa6db6",
|
||||||
|
"imurmurhash@^0.1.4": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea",
|
||||||
|
"inflight@^1.0.4": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9",
|
||||||
|
"inherits@2": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c",
|
||||||
|
"inquirer@^7.0.0": "https://registry.npm.taobao.org/inquirer/download/inquirer-7.1.0.tgz?cache=0&sync_timestamp=1583821033098&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finquirer%2Fdownload%2Finquirer-7.1.0.tgz#1298a01859883e17c7264b82870ae1034f92dd29",
|
||||||
|
"ip-regex@^2.1.0": "https://registry.npm.taobao.org/ip-regex/download/ip-regex-2.1.0.tgz#fa78bf5d2e6913c911ce9f819ee5146bb6d844e9",
|
||||||
|
"is-accessor-descriptor@^0.1.6": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6",
|
||||||
|
"is-accessor-descriptor@^1.0.0": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656",
|
||||||
|
"is-buffer@^1.1.5": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be",
|
||||||
|
"is-ci@^2.0.0": "https://registry.npm.taobao.org/is-ci/download/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c",
|
||||||
|
"is-data-descriptor@^0.1.4": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56",
|
||||||
|
"is-data-descriptor@^1.0.0": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7",
|
||||||
|
"is-descriptor@^0.1.0": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca",
|
||||||
|
"is-descriptor@^1.0.0": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec",
|
||||||
|
"is-descriptor@^1.0.2": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec",
|
||||||
|
"is-extendable@^0.1.0": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89",
|
||||||
|
"is-extendable@^0.1.1": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89",
|
||||||
|
"is-extendable@^1.0.1": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4",
|
||||||
|
"is-extglob@^2.1.1": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2",
|
||||||
|
"is-fullwidth-code-point@^2.0.0": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f",
|
||||||
|
"is-fullwidth-code-point@^3.0.0": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d",
|
||||||
|
"is-generator-fn@^2.0.0": "https://registry.npm.taobao.org/is-generator-fn/download/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118",
|
||||||
|
"is-glob@^4.0.0": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
|
||||||
|
"is-glob@^4.0.1": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc",
|
||||||
|
"is-number@^3.0.0": "https://registry.npm.taobao.org/is-number/download/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195",
|
||||||
|
"is-number@^7.0.0": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b",
|
||||||
|
"is-plain-object@^2.0.3": "https://registry.npm.taobao.org/is-plain-object/download/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677",
|
||||||
|
"is-plain-object@^2.0.4": "https://registry.npm.taobao.org/is-plain-object/download/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677",
|
||||||
|
"is-promise@^2.1.0": "https://registry.npm.taobao.org/is-promise/download/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa",
|
||||||
|
"is-stream@^1.1.0": "https://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44",
|
||||||
|
"is-stream@^2.0.0": "https://registry.npm.taobao.org/is-stream/download/is-stream-2.0.0.tgz#bde9c32680d6fae04129d6ac9d921ce7815f78e3",
|
||||||
|
"is-typedarray@^1.0.0": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a",
|
||||||
|
"is-typedarray@~1.0.0": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a",
|
||||||
|
"is-windows@^1.0.2": "https://registry.npm.taobao.org/is-windows/download/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d",
|
||||||
|
"is-wsl@^2.1.1": "https://registry.npm.taobao.org/is-wsl/download/is-wsl-2.1.1.tgz#4a1c152d429df3d441669498e2486d3596ebaf1d",
|
||||||
|
"isarray@1.0.0": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11",
|
||||||
|
"isexe@^2.0.0": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10",
|
||||||
|
"isobject@^2.0.0": "https://registry.npm.taobao.org/isobject/download/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89",
|
||||||
|
"isobject@^3.0.0": "https://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df",
|
||||||
|
"isobject@^3.0.1": "https://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df",
|
||||||
|
"isstream@~0.1.2": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a",
|
||||||
|
"istanbul-lib-coverage@^3.0.0": "https://registry.npm.taobao.org/istanbul-lib-coverage/download/istanbul-lib-coverage-3.0.0.tgz#f5944a37c70b550b02a78a5c3b2055b280cec8ec",
|
||||||
|
"istanbul-lib-instrument@^4.0.0": "https://registry.npm.taobao.org/istanbul-lib-instrument/download/istanbul-lib-instrument-4.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fistanbul-lib-instrument%2Fdownload%2Fistanbul-lib-instrument-4.0.1.tgz#61f13ac2c96cfefb076fe7131156cc05907874e6",
|
||||||
|
"istanbul-lib-report@^3.0.0": "https://registry.npm.taobao.org/istanbul-lib-report/download/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6",
|
||||||
|
"istanbul-lib-source-maps@^4.0.0": "https://registry.npm.taobao.org/istanbul-lib-source-maps/download/istanbul-lib-source-maps-4.0.0.tgz#75743ce6d96bb86dc7ee4352cf6366a23f0b1ad9",
|
||||||
|
"istanbul-reports@^3.0.0": "https://registry.npm.taobao.org/istanbul-reports/download/istanbul-reports-3.0.0.tgz#d4d16d035db99581b6194e119bbf36c963c5eb70",
|
||||||
|
"jest-changed-files@^25.2.3": "https://registry.npm.taobao.org/jest-changed-files/download/jest-changed-files-25.2.3.tgz?cache=0&sync_timestamp=1585255877649&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-changed-files%2Fdownload%2Fjest-changed-files-25.2.3.tgz#ad19deef9e47ba37efb432d2c9a67dfd97cc78af",
|
||||||
|
"jest-cli@^25.2.4": "https://registry.npm.taobao.org/jest-cli/download/jest-cli-25.2.4.tgz#021c2383904696597abc060dcb133c82ebd8bfcc",
|
||||||
|
"jest-config@^25.2.4": "https://registry.npm.taobao.org/jest-config/download/jest-config-25.2.4.tgz#f4f33238979f225683179c89d1e402893008975d",
|
||||||
|
"jest-diff@^25.1.0": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-25.1.0.tgz#58b827e63edea1bc80c1de952b80cec9ac50e1ad",
|
||||||
|
"jest-diff@^25.2.3": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-25.2.3.tgz?cache=0&sync_timestamp=1585255877885&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-diff%2Fdownload%2Fjest-diff-25.2.3.tgz#54d601a0a754ef26e808a8c8dbadd278c215aa3f",
|
||||||
|
"jest-docblock@^25.2.3": "https://registry.npm.taobao.org/jest-docblock/download/jest-docblock-25.2.3.tgz?cache=0&sync_timestamp=1585255874870&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-docblock%2Fdownload%2Fjest-docblock-25.2.3.tgz#ac45280c43d59e7139f9fbe5896c6e0320c01ebb",
|
||||||
|
"jest-each@^25.2.3": "https://registry.npm.taobao.org/jest-each/download/jest-each-25.2.3.tgz?cache=0&sync_timestamp=1585255872267&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-each%2Fdownload%2Fjest-each-25.2.3.tgz#64067ba1508ebbd07e9b126c173ab371e8e6309d",
|
||||||
|
"jest-environment-jsdom@^25.2.4": "https://registry.npm.taobao.org/jest-environment-jsdom/download/jest-environment-jsdom-25.2.4.tgz#f2783541d0538b1bc43641703372cea6a2e83611",
|
||||||
|
"jest-environment-node@^25.2.4": "https://registry.npm.taobao.org/jest-environment-node/download/jest-environment-node-25.2.4.tgz?cache=0&sync_timestamp=1585510748152&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-environment-node%2Fdownload%2Fjest-environment-node-25.2.4.tgz#dc211dfb0d8b66dfc1965a8f846e72e54ff0c430",
|
||||||
|
"jest-get-type@^25.1.0": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-25.1.0.tgz#1cfe5fc34f148dc3a8a3b7275f6b9ce9e2e8a876",
|
||||||
|
"jest-get-type@^25.2.1": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-25.2.1.tgz?cache=0&sync_timestamp=1585215279267&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-get-type%2Fdownload%2Fjest-get-type-25.2.1.tgz#6c83de603c41b1627e6964da2f5454e6aa3c13a6",
|
||||||
|
"jest-haste-map@^25.2.3": "https://registry.npm.taobao.org/jest-haste-map/download/jest-haste-map-25.2.3.tgz#2649392b5af191f0167a27bfb62e5d96d7eaaade",
|
||||||
|
"jest-jasmine2@^25.2.4": "https://registry.npm.taobao.org/jest-jasmine2/download/jest-jasmine2-25.2.4.tgz#5f77de83e1027f0c7588137055a80da773872374",
|
||||||
|
"jest-leak-detector@^25.2.3": "https://registry.npm.taobao.org/jest-leak-detector/download/jest-leak-detector-25.2.3.tgz?cache=0&sync_timestamp=1585255878917&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-leak-detector%2Fdownload%2Fjest-leak-detector-25.2.3.tgz#4cf39f137925e0061c04c24ca65cae36465f0238",
|
||||||
|
"jest-matcher-utils@^25.2.3": "https://registry.npm.taobao.org/jest-matcher-utils/download/jest-matcher-utils-25.2.3.tgz?cache=0&sync_timestamp=1585255876922&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-matcher-utils%2Fdownload%2Fjest-matcher-utils-25.2.3.tgz#59285bd6d6c810debc9caa585ed985e46a3f28fd",
|
||||||
|
"jest-message-util@^25.2.4": "https://registry.npm.taobao.org/jest-message-util/download/jest-message-util-25.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-message-util%2Fdownload%2Fjest-message-util-25.2.4.tgz#b1441b9c82f5c11fc661303cbf200a2f136a7762",
|
||||||
|
"jest-mock@^25.2.3": "https://registry.npm.taobao.org/jest-mock/download/jest-mock-25.2.3.tgz#b37a581f59d61bd91db27a99bf7eb8b3e5e993d5",
|
||||||
|
"jest-pnp-resolver@^1.2.1": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz#ecdae604c077a7fbc70defb6d517c3c1c898923a",
|
||||||
|
"jest-regex-util@^25.2.1": "https://registry.npm.taobao.org/jest-regex-util/download/jest-regex-util-25.2.1.tgz?cache=0&sync_timestamp=1585215406327&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-regex-util%2Fdownload%2Fjest-regex-util-25.2.1.tgz#db64b0d15cd3642c93b7b9627801d7c518600584",
|
||||||
|
"jest-resolve-dependencies@^25.2.4": "https://registry.npm.taobao.org/jest-resolve-dependencies/download/jest-resolve-dependencies-25.2.4.tgz#2d904400387d74a366dff54badb40a2b3210e733",
|
||||||
|
"jest-resolve@^25.2.3": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-25.2.3.tgz#ababeaf2bb948cb6d2dea8453759116da0fb7842",
|
||||||
|
"jest-runner@^25.2.4": "https://registry.npm.taobao.org/jest-runner/download/jest-runner-25.2.4.tgz#d0daf7c56b4a83b6b675863d5cdcd502c960f9a1",
|
||||||
|
"jest-runtime@^25.2.4": "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-25.2.4.tgz#c66a421e115944426b377a7fd331f6c0902cfa56",
|
||||||
|
"jest-serializer@^25.2.1": "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-25.2.1.tgz?cache=0&sync_timestamp=1585215407092&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-serializer%2Fdownload%2Fjest-serializer-25.2.1.tgz#51727a5fc04256f461abe0fa024a022ba165877a",
|
||||||
|
"jest-snapshot@^25.2.4": "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-25.2.4.tgz#08d4517579c864df4280bcc948ceea34327a4ded",
|
||||||
|
"jest-util@^25.2.3": "https://registry.npm.taobao.org/jest-util/download/jest-util-25.2.3.tgz#0abf95a1d6b96f2de5a3ecd61b36c40a182dc256",
|
||||||
|
"jest-validate@^25.2.3": "https://registry.npm.taobao.org/jest-validate/download/jest-validate-25.2.3.tgz#ecb0f093cf8ae71d15075fb48439b6f78f1fcb5a",
|
||||||
|
"jest-watcher@^25.2.4": "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-25.2.4.tgz?cache=0&sync_timestamp=1585510737791&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-watcher%2Fdownload%2Fjest-watcher-25.2.4.tgz#dda85b914d470fa4145164a8f70bda4f208bafb6",
|
||||||
|
"jest-worker@^25.2.1": "https://registry.npm.taobao.org/jest-worker/download/jest-worker-25.2.1.tgz?cache=0&sync_timestamp=1585215414576&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-worker%2Fdownload%2Fjest-worker-25.2.1.tgz#209617015c768652646aa33a7828cc2ab472a18a",
|
||||||
|
"jest@^25.2.4": "https://registry.npm.taobao.org/jest/download/jest-25.2.4.tgz#d10941948a2b57eb7accc2e7ae78af4a0e11b40a",
|
||||||
|
"js-tokens@^4.0.0": "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499",
|
||||||
|
"js-yaml@^3.13.1": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847",
|
||||||
|
"jsbn@~0.1.0": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513",
|
||||||
|
"jsdom@^15.2.1": "https://registry.npm.taobao.org/jsdom/download/jsdom-15.2.1.tgz?cache=0&sync_timestamp=1585531922622&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjsdom%2Fdownload%2Fjsdom-15.2.1.tgz#d2feb1aef7183f86be521b8c6833ff5296d07ec5",
|
||||||
|
"jsesc@^2.5.1": "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4",
|
||||||
|
"json-schema-traverse@^0.4.1": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660",
|
||||||
|
"json-schema@0.2.3": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13",
|
||||||
|
"json-stable-stringify-without-jsonify@^1.0.1": "https://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651",
|
||||||
|
"json-stringify-safe@~5.0.1": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
|
||||||
|
"json5@2.x": "https://registry.npm.taobao.org/json5/download/json5-2.1.2.tgz?cache=0&sync_timestamp=1584388298930&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e",
|
||||||
|
"json5@^2.1.0": "https://registry.npm.taobao.org/json5/download/json5-2.1.2.tgz?cache=0&sync_timestamp=1584388298930&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.1.2.tgz#43ef1f0af9835dd624751a6b7fa48874fb2d608e",
|
||||||
|
"jsprim@^1.2.2": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz#313e66bc1e5cc06e438bc1b7499c2e5c56acb6a2",
|
||||||
|
"kind-of@^3.0.2": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^3.0.3": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^3.2.0": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64",
|
||||||
|
"kind-of@^4.0.0": "https://registry.npm.taobao.org/kind-of/download/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57",
|
||||||
|
"kind-of@^5.0.0": "https://registry.npm.taobao.org/kind-of/download/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d",
|
||||||
|
"kind-of@^6.0.0": "https://registry.npm.taobao.org/kind-of/download/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd",
|
||||||
|
"kind-of@^6.0.2": "https://registry.npm.taobao.org/kind-of/download/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd",
|
||||||
|
"kleur@^3.0.3": "https://registry.npm.taobao.org/kleur/download/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e",
|
||||||
|
"leven@^3.1.0": "https://registry.npm.taobao.org/leven/download/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2",
|
||||||
|
"levn@^0.3.0": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee",
|
||||||
|
"levn@~0.3.0": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz#3b09924edf9f083c0490fdd4c0bc4421e04764ee",
|
||||||
|
"locate-path@^5.0.0": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0",
|
||||||
|
"lodash.memoize@4.x": "https://registry.npm.taobao.org/lodash.memoize/download/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe",
|
||||||
|
"lodash.sortby@^4.7.0": "https://registry.npm.taobao.org/lodash.sortby/download/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438",
|
||||||
|
"lodash@^4.17.13": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&sync_timestamp=1580303049395&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548",
|
||||||
|
"lodash@^4.17.14": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&sync_timestamp=1580303049395&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548",
|
||||||
|
"lodash@^4.17.15": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz?cache=0&sync_timestamp=1580303049395&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flodash%2Fdownload%2Flodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548",
|
||||||
|
"lolex@^5.0.0": "https://registry.npm.taobao.org/lolex/download/lolex-5.1.2.tgz?cache=0&sync_timestamp=1580817350752&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flolex%2Fdownload%2Flolex-5.1.2.tgz#953694d098ce7c07bc5ed6d0e42bc6c0c6d5a367",
|
||||||
|
"make-dir@^3.0.0": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.0.2.tgz#04a1acbf22221e1d6ef43559f43e05a90dbb4392",
|
||||||
|
"make-error@1.x": "https://registry.npm.taobao.org/make-error/download/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2",
|
||||||
|
"makeerror@1.0.x": "https://registry.npm.taobao.org/makeerror/download/makeerror-1.0.11.tgz#e01a5c9109f2af79660e4e8b9587790184f5a96c",
|
||||||
|
"map-cache@^0.2.2": "https://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf",
|
||||||
|
"map-visit@^1.0.0": "https://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f",
|
||||||
|
"merge-stream@^2.0.0": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60",
|
||||||
|
"micromatch@^3.1.4": "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz?cache=0&sync_timestamp=1580303044337&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23",
|
||||||
|
"micromatch@^4.0.2": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&sync_timestamp=1580303044337&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259",
|
||||||
|
"mime-db@1.43.0": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58",
|
||||||
|
"mime-types@^2.1.12": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06",
|
||||||
|
"mime-types@~2.1.19": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06",
|
||||||
|
"mimic-fn@^2.1.0": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b",
|
||||||
|
"minimatch@^3.0.4": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083",
|
||||||
|
"minimist@^1.1.1": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
|
||||||
|
"minimist@^1.2.0": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
|
||||||
|
"minimist@^1.2.5": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602",
|
||||||
|
"mixin-deep@^1.2.0": "https://registry.npm.taobao.org/mixin-deep/download/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566",
|
||||||
|
"mkdirp@1.x": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-1.0.3.tgz?cache=0&sync_timestamp=1584986213750&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-1.0.3.tgz#4cf2e30ad45959dddea53ad97d518b6c8205e1ea",
|
||||||
|
"mkdirp@^0.5.1": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.3.tgz?cache=0&sync_timestamp=1584667994851&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-0.5.3.tgz#5a514b7179259287952881e94410ec5465659f8c",
|
||||||
|
"ms@2.0.0": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8",
|
||||||
|
"ms@^2.1.1": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009",
|
||||||
|
"mute-stream@0.0.8": "https://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d",
|
||||||
|
"nanomatch@^1.2.9": "https://registry.npm.taobao.org/nanomatch/download/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119",
|
||||||
|
"natural-compare@^1.4.0": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7",
|
||||||
|
"nice-try@^1.0.4": "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366",
|
||||||
|
"node-int64@^0.4.0": "https://registry.npm.taobao.org/node-int64/download/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b",
|
||||||
|
"node-modules-regexp@^1.0.0": "https://registry.npm.taobao.org/node-modules-regexp/download/node-modules-regexp-1.0.0.tgz#8d9dbe28964a4ac5712e9131642107c71e90ec40",
|
||||||
|
"node-notifier@^6.0.0": "https://registry.npm.taobao.org/node-notifier/download/node-notifier-6.0.0.tgz#cea319e06baa16deec8ce5cd7f133c4a46b68e12",
|
||||||
|
"normalize-path@^2.1.1": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9",
|
||||||
|
"normalize-path@^3.0.0": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65",
|
||||||
|
"npm-run-path@^2.0.0": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f",
|
||||||
|
"npm-run-path@^4.0.0": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea",
|
||||||
|
"nwsapi@^2.2.0": "https://registry.npm.taobao.org/nwsapi/download/nwsapi-2.2.0.tgz#204879a9e3d068ff2a55139c2c772780681a38b7",
|
||||||
|
"oauth-sign@~0.9.0": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455",
|
||||||
|
"object-copy@^0.1.0": "https://registry.npm.taobao.org/object-copy/download/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c",
|
||||||
|
"object-visit@^1.0.0": "https://registry.npm.taobao.org/object-visit/download/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb",
|
||||||
|
"object.pick@^1.3.0": "https://registry.npm.taobao.org/object.pick/download/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747",
|
||||||
|
"once@^1.3.0": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"once@^1.3.1": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"once@^1.4.0": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1",
|
||||||
|
"onetime@^5.1.0": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.0.tgz#fff0f3c91617fe62bb50189636e99ac8a6df7be5",
|
||||||
|
"optionator@^0.8.1": "https://registry.npm.taobao.org/optionator/download/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495",
|
||||||
|
"optionator@^0.8.3": "https://registry.npm.taobao.org/optionator/download/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495",
|
||||||
|
"os-tmpdir@~1.0.2": "https://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274",
|
||||||
|
"p-each-series@^2.1.0": "https://registry.npm.taobao.org/p-each-series/download/p-each-series-2.1.0.tgz#961c8dd3f195ea96c747e636b262b800a6b1af48",
|
||||||
|
"p-finally@^1.0.0": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae",
|
||||||
|
"p-finally@^2.0.0": "https://registry.npm.taobao.org/p-finally/download/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561",
|
||||||
|
"p-limit@^2.2.0": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.2.2.tgz#61279b67721f5287aa1c13a9a7fbbc48c9291b1e",
|
||||||
|
"p-locate@^4.1.0": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07",
|
||||||
|
"p-try@^2.0.0": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6",
|
||||||
|
"parent-module@^1.0.0": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2",
|
||||||
|
"parse5@5.1.0": "https://registry.npm.taobao.org/parse5/download/parse5-5.1.0.tgz#c59341c9723f414c452975564c7c00a68d58acd2",
|
||||||
|
"pascalcase@^0.1.1": "https://registry.npm.taobao.org/pascalcase/download/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14",
|
||||||
|
"path-exists@^4.0.0": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3",
|
||||||
|
"path-is-absolute@^1.0.0": "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
||||||
|
"path-key@^2.0.0": "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40",
|
||||||
|
"path-key@^2.0.1": "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40",
|
||||||
|
"path-key@^3.0.0": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
||||||
|
"path-key@^3.1.0": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375",
|
||||||
|
"path-parse@^1.0.6": "https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c",
|
||||||
|
"performance-now@^2.1.0": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b",
|
||||||
|
"picomatch@^2.0.4": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.1.tgz#21bac888b6ed8601f831ce7816e335bc779f0a4a",
|
||||||
|
"picomatch@^2.0.5": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.1.tgz#21bac888b6ed8601f831ce7816e335bc779f0a4a",
|
||||||
|
"pirates@^4.0.1": "https://registry.npm.taobao.org/pirates/download/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87",
|
||||||
|
"pkg-dir@^4.2.0": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3",
|
||||||
|
"pn@^1.1.0": "https://registry.npm.taobao.org/pn/download/pn-1.1.0.tgz#e2f4cef0e219f463c179ab37463e4e1ecdccbafb",
|
||||||
|
"posix-character-classes@^0.1.0": "https://registry.npm.taobao.org/posix-character-classes/download/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab",
|
||||||
|
"prelude-ls@~1.1.2": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54",
|
||||||
|
"prettier-linter-helpers@^1.0.0": "https://registry.npm.taobao.org/prettier-linter-helpers/download/prettier-linter-helpers-1.0.0.tgz#d23d41fe1375646de2d0104d3454a3008802cf7b",
|
||||||
|
"prettier@^2.0.2": "https://registry.npm.taobao.org/prettier/download/prettier-2.0.2.tgz#1ba8f3eb92231e769b7fcd7cb73ae1b6b74ade08",
|
||||||
|
"pretty-format@^25.1.0": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-25.1.0.tgz#ed869bdaec1356fc5ae45de045e2c8ec7b07b0c8",
|
||||||
|
"pretty-format@^25.2.3": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-25.2.3.tgz?cache=0&sync_timestamp=1585255872781&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpretty-format%2Fdownload%2Fpretty-format-25.2.3.tgz#ba6e9603a0d80fa2e470b1fed55de1f9bfd81421",
|
||||||
|
"progress@^2.0.0": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz#7e8cf8d8f5b8f239c1bc68beb4eb78567d572ef8",
|
||||||
|
"prompts@^2.0.1": "https://registry.npm.taobao.org/prompts/download/prompts-2.3.2.tgz?cache=0&sync_timestamp=1584535708984&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprompts%2Fdownload%2Fprompts-2.3.2.tgz#480572d89ecf39566d2bd3fe2c9fccb7c4c0b068",
|
||||||
|
"psl@^1.1.28": "https://registry.npm.taobao.org/psl/download/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c",
|
||||||
|
"pump@^3.0.0": "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64",
|
||||||
|
"punycode@^2.1.0": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec",
|
||||||
|
"punycode@^2.1.1": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec",
|
||||||
|
"qs@~6.5.2": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36",
|
||||||
|
"react-is@^16.12.0": "https://registry.npm.taobao.org/react-is/download/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4",
|
||||||
|
"realpath-native@^2.0.0": "https://registry.npm.taobao.org/realpath-native/download/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866",
|
||||||
|
"regex-not@^1.0.0": "https://registry.npm.taobao.org/regex-not/download/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c",
|
||||||
|
"regex-not@^1.0.2": "https://registry.npm.taobao.org/regex-not/download/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c",
|
||||||
|
"regexpp@^2.0.1": "https://registry.npm.taobao.org/regexpp/download/regexpp-2.0.1.tgz#8d19d31cf632482b589049f8281f93dbcba4d07f",
|
||||||
|
"regexpp@^3.0.0": "https://registry.npm.taobao.org/regexpp/download/regexpp-3.0.0.tgz#dd63982ee3300e67b41c1956f850aa680d9d330e",
|
||||||
|
"remove-trailing-separator@^1.0.1": "https://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef",
|
||||||
|
"repeat-element@^1.1.2": "https://registry.npm.taobao.org/repeat-element/download/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce",
|
||||||
|
"repeat-string@^1.6.1": "https://registry.npm.taobao.org/repeat-string/download/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637",
|
||||||
|
"request-promise-core@1.1.3": "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.3.tgz#e9a3c081b51380dfea677336061fea879a829ee9",
|
||||||
|
"request-promise-native@^1.0.7": "https://registry.npm.taobao.org/request-promise-native/download/request-promise-native-1.0.8.tgz#a455b960b826e44e2bf8999af64dff2bfe58cb36",
|
||||||
|
"request@^2.88.0": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz?cache=0&sync_timestamp=1581439006948&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequest%2Fdownload%2Frequest-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3",
|
||||||
|
"require-directory@^2.1.1": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42",
|
||||||
|
"require-main-filename@^2.0.0": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b",
|
||||||
|
"resolve-cwd@^3.0.0": "https://registry.npm.taobao.org/resolve-cwd/download/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d",
|
||||||
|
"resolve-from@^4.0.0": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6",
|
||||||
|
"resolve-from@^5.0.0": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69",
|
||||||
|
"resolve-url@^0.2.1": "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a",
|
||||||
|
"resolve@1.1.7": "https://registry.npm.taobao.org/resolve/download/resolve-1.1.7.tgz?cache=0&sync_timestamp=1580944242910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b",
|
||||||
|
"resolve@1.x": "https://registry.npm.taobao.org/resolve/download/resolve-1.15.1.tgz?cache=0&sync_timestamp=1580944242910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8",
|
||||||
|
"resolve@^1.15.1": "https://registry.npm.taobao.org/resolve/download/resolve-1.15.1.tgz?cache=0&sync_timestamp=1580944242910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8",
|
||||||
|
"resolve@^1.3.2": "https://registry.npm.taobao.org/resolve/download/resolve-1.15.1.tgz?cache=0&sync_timestamp=1580944242910&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.15.1.tgz#27bdcdeffeaf2d6244b95bb0f9f4b4653451f3e8",
|
||||||
|
"restore-cursor@^3.1.0": "https://registry.npm.taobao.org/restore-cursor/download/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e",
|
||||||
|
"ret@~0.1.10": "https://registry.npm.taobao.org/ret/download/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc",
|
||||||
|
"rimraf@2.6.3": "https://registry.npm.taobao.org/rimraf/download/rimraf-2.6.3.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab",
|
||||||
|
"rimraf@^3.0.0": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a",
|
||||||
|
"rimraf@^3.0.2": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581229865753&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a",
|
||||||
|
"rsvp@^4.8.4": "https://registry.npm.taobao.org/rsvp/download/rsvp-4.8.5.tgz#c8f155311d167f68f21e168df71ec5b083113734",
|
||||||
|
"run-async@^2.4.0": "https://registry.npm.taobao.org/run-async/download/run-async-2.4.0.tgz#e59054a5b86876cfae07f431d18cbaddc594f1e8",
|
||||||
|
"rxjs@^6.5.3": "https://registry.npm.taobao.org/rxjs/download/rxjs-6.5.4.tgz#e0777fe0d184cec7872df147f303572d414e211c",
|
||||||
|
"safe-buffer@^5.0.1": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519",
|
||||||
|
"safe-buffer@^5.1.2": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519",
|
||||||
|
"safe-buffer@~5.1.1": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d",
|
||||||
|
"safe-regex@^1.1.0": "https://registry.npm.taobao.org/safe-regex/download/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e",
|
||||||
|
"safer-buffer@>= 2.1.2 < 3": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
||||||
|
"safer-buffer@^2.0.2": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
||||||
|
"safer-buffer@^2.1.0": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
||||||
|
"safer-buffer@~2.1.0": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a",
|
||||||
|
"sane@^4.0.3": "https://registry.npm.taobao.org/sane/download/sane-4.1.0.tgz#ed881fd922733a6c461bc189dc2b6c006f3ffded",
|
||||||
|
"saxes@^3.1.9": "https://registry.npm.taobao.org/saxes/download/saxes-3.1.11.tgz#d59d1fd332ec92ad98a2e0b2ee644702384b1c5b",
|
||||||
|
"semver@6.x": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^5.4.1": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7",
|
||||||
|
"semver@^5.5.0": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7",
|
||||||
|
"semver@^6.0.0": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^6.1.0": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^6.1.2": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^6.3.0": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d",
|
||||||
|
"semver@^7.1.3": "https://registry.npm.taobao.org/semver/download/semver-7.1.3.tgz#e4345ce73071c53f336445cfc19efb1c311df2a6",
|
||||||
|
"set-blocking@^2.0.0": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7",
|
||||||
|
"set-value@^2.0.0": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b",
|
||||||
|
"set-value@^2.0.1": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b",
|
||||||
|
"shebang-command@^1.2.0": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea",
|
||||||
|
"shebang-command@^2.0.0": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea",
|
||||||
|
"shebang-regex@^1.0.0": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3",
|
||||||
|
"shebang-regex@^3.0.0": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172",
|
||||||
|
"shellwords@^0.1.1": "https://registry.npm.taobao.org/shellwords/download/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b",
|
||||||
|
"signal-exit@^3.0.0": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d",
|
||||||
|
"signal-exit@^3.0.2": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d",
|
||||||
|
"sisteransi@^1.0.4": "https://registry.npm.taobao.org/sisteransi/download/sisteransi-1.0.5.tgz?cache=0&sync_timestamp=1584536263469&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsisteransi%2Fdownload%2Fsisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed",
|
||||||
|
"slash@^3.0.0": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634",
|
||||||
|
"slice-ansi@^2.1.0": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-2.1.0.tgz?cache=0&sync_timestamp=1581873067338&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fslice-ansi%2Fdownload%2Fslice-ansi-2.1.0.tgz#cacd7693461a637a5788d92a7dd4fba068e81636",
|
||||||
|
"snapdragon-node@^2.0.1": "https://registry.npm.taobao.org/snapdragon-node/download/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b",
|
||||||
|
"snapdragon-util@^3.0.1": "https://registry.npm.taobao.org/snapdragon-util/download/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2",
|
||||||
|
"snapdragon@^0.8.1": "https://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d",
|
||||||
|
"source-map-resolve@^0.5.0": "https://registry.npm.taobao.org/source-map-resolve/download/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a",
|
||||||
|
"source-map-support@^0.5.6": "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.16.tgz#0ae069e7fe3ba7538c64c98515e35339eac5a042",
|
||||||
|
"source-map-url@^0.4.0": "https://registry.npm.taobao.org/source-map-url/download/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3",
|
||||||
|
"source-map@^0.5.0": "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc",
|
||||||
|
"source-map@^0.5.6": "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc",
|
||||||
|
"source-map@^0.6.0": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@^0.6.1": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"source-map@^0.7.3": "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz#5302f8169031735226544092e64981f751750383",
|
||||||
|
"source-map@~0.6.1": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263",
|
||||||
|
"split-string@^3.0.1": "https://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2",
|
||||||
|
"split-string@^3.0.2": "https://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2",
|
||||||
|
"sprintf-js@~1.0.2": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c",
|
||||||
|
"sshpk@^1.7.0": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877",
|
||||||
|
"stack-utils@^1.0.1": "https://registry.npm.taobao.org/stack-utils/download/stack-utils-1.0.2.tgz#33eba3897788558bebfc2db059dc158ec36cebb8",
|
||||||
|
"static-extend@^0.1.1": "https://registry.npm.taobao.org/static-extend/download/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6",
|
||||||
|
"stealthy-require@^1.1.1": "https://registry.npm.taobao.org/stealthy-require/download/stealthy-require-1.1.1.tgz#35b09875b4ff49f26a777e509b3090a3226bf24b",
|
||||||
|
"string-length@^3.1.0": "https://registry.npm.taobao.org/string-length/download/string-length-3.1.0.tgz#107ef8c23456e187a8abd4a61162ff4ac6e25837",
|
||||||
|
"string-width@^3.0.0": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961",
|
||||||
|
"string-width@^4.1.0": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5",
|
||||||
|
"string-width@^4.2.0": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.0.tgz#952182c46cc7b2c313d1596e623992bd163b72b5",
|
||||||
|
"strip-ansi@^5.1.0": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
|
||||||
|
"strip-ansi@^5.2.0": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae",
|
||||||
|
"strip-ansi@^6.0.0": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-6.0.0.tgz#0b1571dd7669ccd4f3e06e14ef1eed26225ae532",
|
||||||
|
"strip-bom@^4.0.0": "https://registry.npm.taobao.org/strip-bom/download/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878",
|
||||||
|
"strip-eof@^1.0.0": "https://registry.npm.taobao.org/strip-eof/download/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf",
|
||||||
|
"strip-final-newline@^2.0.0": "https://registry.npm.taobao.org/strip-final-newline/download/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad",
|
||||||
|
"strip-json-comments@^3.0.1": "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7",
|
||||||
|
"supports-color@^5.3.0": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f",
|
||||||
|
"supports-color@^7.0.0": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1",
|
||||||
|
"supports-color@^7.1.0": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz#68e32591df73e25ad1c4b49108a2ec507962bfd1",
|
||||||
|
"supports-hyperlinks@^2.0.0": "https://registry.npm.taobao.org/supports-hyperlinks/download/supports-hyperlinks-2.1.0.tgz#f663df252af5f37c5d49bbd7eeefa9e0b9e59e47",
|
||||||
|
"symbol-tree@^3.2.2": "https://registry.npm.taobao.org/symbol-tree/download/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2",
|
||||||
|
"table@^5.2.3": "https://registry.npm.taobao.org/table/download/table-5.4.6.tgz?cache=0&sync_timestamp=1582102331079&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftable%2Fdownload%2Ftable-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e",
|
||||||
|
"terminal-link@^2.0.0": "https://registry.npm.taobao.org/terminal-link/download/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994",
|
||||||
|
"test-exclude@^6.0.0": "https://registry.npm.taobao.org/test-exclude/download/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e",
|
||||||
|
"text-table@^0.2.0": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4",
|
||||||
|
"throat@^5.0.0": "https://registry.npm.taobao.org/throat/download/throat-5.0.0.tgz#c5199235803aad18754a667d659b5e72ce16764b",
|
||||||
|
"through@^2.3.6": "https://registry.npm.taobao.org/through/download/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5",
|
||||||
|
"tmp@^0.0.33": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9",
|
||||||
|
"tmpl@1.0.x": "https://registry.npm.taobao.org/tmpl/download/tmpl-1.0.4.tgz#23640dd7b42d00433911140820e5cf440e521dd1",
|
||||||
|
"to-fast-properties@^2.0.0": "https://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz?cache=0&sync_timestamp=1580550347606&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fto-fast-properties%2Fdownload%2Fto-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e",
|
||||||
|
"to-object-path@^0.3.0": "https://registry.npm.taobao.org/to-object-path/download/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af",
|
||||||
|
"to-regex-range@^2.1.0": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38",
|
||||||
|
"to-regex-range@^5.0.1": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4",
|
||||||
|
"to-regex@^3.0.1": "https://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce",
|
||||||
|
"to-regex@^3.0.2": "https://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce",
|
||||||
|
"tough-cookie@^2.3.3": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2",
|
||||||
|
"tough-cookie@^3.0.1": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-3.0.1.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-3.0.1.tgz#9df4f57e739c26930a018184887f4adb7dca73b2",
|
||||||
|
"tough-cookie@~2.5.0": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz?cache=0&sync_timestamp=1584645708631&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftough-cookie%2Fdownload%2Ftough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2",
|
||||||
|
"tr46@^1.0.1": "https://registry.npm.taobao.org/tr46/download/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09",
|
||||||
|
"ts-jest@^25.3.0": "https://registry.npm.taobao.org/ts-jest/download/ts-jest-25.3.0.tgz#c12d34573cbe34d49f10567940e44fd19d1c9178",
|
||||||
|
"tslib@^1.8.1": "https://registry.npm.taobao.org/tslib/download/tslib-1.11.1.tgz?cache=0&sync_timestamp=1582832152814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35",
|
||||||
|
"tslib@^1.9.0": "https://registry.npm.taobao.org/tslib/download/tslib-1.11.1.tgz?cache=0&sync_timestamp=1582832152814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftslib%2Fdownload%2Ftslib-1.11.1.tgz#eb15d128827fbee2841549e171f45ed338ac7e35",
|
||||||
|
"tsutils@^3.17.1": "https://registry.npm.taobao.org/tsutils/download/tsutils-3.17.1.tgz#ed719917f11ca0dee586272b2ac49e015a2dd759",
|
||||||
|
"tunnel-agent@^0.6.0": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd",
|
||||||
|
"tunnel@0.0.6": "https://registry.npm.taobao.org/tunnel/download/tunnel-0.0.6.tgz#72f1314b34a5b192db012324df2cc587ca47f92c",
|
||||||
|
"tweetnacl@^0.14.3": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz?cache=0&sync_timestamp=1581364304221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftweetnacl%2Fdownload%2Ftweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64",
|
||||||
|
"tweetnacl@~0.14.0": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz?cache=0&sync_timestamp=1581364304221&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftweetnacl%2Fdownload%2Ftweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64",
|
||||||
|
"type-check@~0.3.2": "https://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz#5884cab512cf1d355e3fb784f30804b2b520db72",
|
||||||
|
"type-detect@4.0.8": "https://registry.npm.taobao.org/type-detect/download/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c",
|
||||||
|
"type-fest@^0.11.0": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.11.0.tgz#97abf0872310fed88a5c466b25681576145e33f1",
|
||||||
|
"type-fest@^0.8.1": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d",
|
||||||
|
"typedarray-to-buffer@^3.1.5": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz?cache=0&sync_timestamp=1580310064722&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypedarray-to-buffer%2Fdownload%2Ftypedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080",
|
||||||
|
"typescript@^3.8.3": "https://registry.npm.taobao.org/typescript/download/typescript-3.8.3.tgz?cache=0&sync_timestamp=1584688517009&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftypescript%2Fdownload%2Ftypescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061",
|
||||||
|
"union-value@^1.0.0": "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847",
|
||||||
|
"unset-value@^1.0.0": "https://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559",
|
||||||
|
"uri-js@^4.2.2": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0",
|
||||||
|
"urix@^0.1.0": "https://registry.npm.taobao.org/urix/download/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72",
|
||||||
|
"use@^3.1.0": "https://registry.npm.taobao.org/use/download/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f",
|
||||||
|
"uuid@^3.3.2": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee",
|
||||||
|
"v8-compile-cache@^2.0.3": "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.1.0.tgz#e14de37b31a6d194f5690d67efc4e7f6fc6ab30e",
|
||||||
|
"v8-to-istanbul@^4.0.1": "https://registry.npm.taobao.org/v8-to-istanbul/download/v8-to-istanbul-4.1.2.tgz#387d173be5383dbec209d21af033dcb892e3ac82",
|
||||||
|
"verror@1.10.0": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400",
|
||||||
|
"w3c-hr-time@^1.0.1": "https://registry.npm.taobao.org/w3c-hr-time/download/w3c-hr-time-1.0.2.tgz?cache=0&sync_timestamp=1583455524970&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fw3c-hr-time%2Fdownload%2Fw3c-hr-time-1.0.2.tgz#0a89cdf5cc15822df9c360543676963e0cc308cd",
|
||||||
|
"w3c-xmlserializer@^1.1.2": "https://registry.npm.taobao.org/w3c-xmlserializer/download/w3c-xmlserializer-1.1.2.tgz#30485ca7d70a6fd052420a3d12fd90e6339ce794",
|
||||||
|
"walker@^1.0.7": "https://registry.npm.taobao.org/walker/download/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb",
|
||||||
|
"walker@~1.0.5": "https://registry.npm.taobao.org/walker/download/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb",
|
||||||
|
"webidl-conversions@^4.0.2": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad",
|
||||||
|
"whatwg-encoding@^1.0.1": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0",
|
||||||
|
"whatwg-encoding@^1.0.5": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz#5abacf777c32166a51d085d6b4f3e7d27113ddb0",
|
||||||
|
"whatwg-mimetype@^2.2.0": "https://registry.npm.taobao.org/whatwg-mimetype/download/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf",
|
||||||
|
"whatwg-mimetype@^2.3.0": "https://registry.npm.taobao.org/whatwg-mimetype/download/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf",
|
||||||
|
"whatwg-url@^7.0.0": "https://registry.npm.taobao.org/whatwg-url/download/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06",
|
||||||
|
"which-module@^2.0.0": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a",
|
||||||
|
"which@^1.2.9": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a",
|
||||||
|
"which@^1.3.1": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a",
|
||||||
|
"which@^2.0.1": "https://registry.npm.taobao.org/which/download/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1",
|
||||||
|
"which@^2.0.2": "https://registry.npm.taobao.org/which/download/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1",
|
||||||
|
"word-wrap@~1.2.3": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c",
|
||||||
|
"wrap-ansi@^6.2.0": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53",
|
||||||
|
"wrappy@1": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f",
|
||||||
|
"write-file-atomic@^3.0.0": "https://registry.npm.taobao.org/write-file-atomic/download/write-file-atomic-3.0.3.tgz?cache=0&sync_timestamp=1582585849133&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwrite-file-atomic%2Fdownload%2Fwrite-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8",
|
||||||
|
"write@1.0.3": "https://registry.npm.taobao.org/write/download/write-1.0.3.tgz#0800e14523b923a387e415123c865616aae0f5c3",
|
||||||
|
"ws@^7.0.0": "https://registry.npm.taobao.org/ws/download/ws-7.2.3.tgz#a5411e1fb04d5ed0efee76d26d5c46d830c39b46",
|
||||||
|
"xml-name-validator@^3.0.0": "https://registry.npm.taobao.org/xml-name-validator/download/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a",
|
||||||
|
"xmlchars@^2.1.1": "https://registry.npm.taobao.org/xmlchars/download/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb",
|
||||||
|
"y18n@^4.0.0": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b",
|
||||||
|
"yargs-parser@^18.1.1": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-18.1.1.tgz?cache=0&sync_timestamp=1584370526706&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs-parser%2Fdownload%2Fyargs-parser-18.1.1.tgz#bf7407b915427fc760fcbbccc6c82b4f0ffcbd37",
|
||||||
|
"yargs@^15.3.1": "https://registry.npm.taobao.org/yargs/download/yargs-15.3.1.tgz?cache=0&sync_timestamp=1584344189540&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fyargs%2Fdownload%2Fyargs-15.3.1.tgz#9505b472763963e54afe60148ad27a330818e98b"
|
||||||
|
},
|
||||||
|
"files": [],
|
||||||
|
"artifacts": {}
|
||||||
|
}
|
||||||
+64
-15
@@ -4,45 +4,53 @@
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
#### Inputs/Outputs
|
### Import the package
|
||||||
|
|
||||||
You can use this library to get inputs or set outputs:
|
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
// javascript
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
|
|
||||||
const myInput = core.getInput('inputName', { required: true });
|
// typescript
|
||||||
|
import * as core from '@actions/core';
|
||||||
|
```
|
||||||
|
|
||||||
// Do stuff
|
#### Inputs/Outputs
|
||||||
|
|
||||||
|
Action inputs can be read with `getInput`. Outputs can be set with `setOutput` which makes them available to be mapped into inputs of other actions to ensure they are decoupled.
|
||||||
|
|
||||||
|
```js
|
||||||
|
const myInput = core.getInput('inputName', { required: true });
|
||||||
|
|
||||||
core.setOutput('outputKey', 'outputVal');
|
core.setOutput('outputKey', 'outputVal');
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Exporting variables
|
#### Exporting variables
|
||||||
|
|
||||||
You can also export variables for future steps. Variables get set in the environment.
|
Since each step runs in a separate process, you can use `exportVariable` to add it to this step and future steps environment blocks.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const core = require('@actions/core');
|
|
||||||
|
|
||||||
// Do stuff
|
|
||||||
|
|
||||||
core.exportVariable('envVar', 'Val');
|
core.exportVariable('envVar', 'Val');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Setting a secret
|
||||||
|
|
||||||
|
Setting a secret registers the secret with the runner to ensure it is masked in logs.
|
||||||
|
|
||||||
|
```js
|
||||||
|
core.setSecret('myPassword');
|
||||||
|
```
|
||||||
|
|
||||||
#### PATH Manipulation
|
#### PATH Manipulation
|
||||||
|
|
||||||
You can explicitly add items to the path for all remaining steps in a workflow:
|
To make a tool's path available in the path for the remainder of the job (without altering the machine or containers state), use `addPath`. The runner will prepend the path given to the jobs PATH.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const core = require('@actions/core');
|
core.addPath('/path/to/mytool');
|
||||||
|
|
||||||
core.addPath('pathToTool');
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Exit codes
|
#### Exit codes
|
||||||
|
|
||||||
You should use this library to set the failing exit code for your action:
|
You should use this library to set the failing exit code for your action. If status is not set and the script runs to completion, that will lead to a success.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const core = require('@actions/core');
|
const core = require('@actions/core');
|
||||||
@@ -55,6 +63,8 @@ catch (err) {
|
|||||||
core.setFailed(`Action failed with error ${err}`);
|
core.setFailed(`Action failed with error ${err}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Note that `setNeutral` is not yet implemented in actions V2 but equivalent functionality is being planned.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Logging
|
#### Logging
|
||||||
@@ -72,6 +82,12 @@ try {
|
|||||||
core.warning('myInput was not set');
|
core.warning('myInput was not set');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (core.isDebug()) {
|
||||||
|
// curl -v https://github.com
|
||||||
|
} else {
|
||||||
|
// curl https://github.com
|
||||||
|
}
|
||||||
|
|
||||||
// Do stuff
|
// Do stuff
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
@@ -95,3 +111,36 @@ const result = await core.group('Do something async', async () => {
|
|||||||
return response
|
return response
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### Action state
|
||||||
|
|
||||||
|
You can use this library to save state and get state for sharing information between a given wrapper action:
|
||||||
|
|
||||||
|
**action.yml**
|
||||||
|
```yaml
|
||||||
|
name: 'Wrapper action sample'
|
||||||
|
inputs:
|
||||||
|
name:
|
||||||
|
default: 'GitHub'
|
||||||
|
runs:
|
||||||
|
using: 'node12'
|
||||||
|
main: 'main.js'
|
||||||
|
post: 'cleanup.js'
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `main.js`:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
core.saveState("pidToKill", 12345);
|
||||||
|
```
|
||||||
|
|
||||||
|
In action's `cleanup.js`:
|
||||||
|
```js
|
||||||
|
const core = require('@actions/core');
|
||||||
|
|
||||||
|
var pid = core.getState("pidToKill");
|
||||||
|
|
||||||
|
process.kill(pid);
|
||||||
|
```
|
||||||
+3
-3
@@ -5,11 +5,11 @@ interface CommandProperties {
|
|||||||
* Commands
|
* Commands
|
||||||
*
|
*
|
||||||
* Command Format:
|
* Command Format:
|
||||||
* ##[name key=value;key=value]message
|
* ::name key=value,key=value::message
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* ##[warning]This is the user warning message
|
* ::warning::This is the message
|
||||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
* ::set-env name=MY_VAR::some value
|
||||||
*/
|
*/
|
||||||
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
export declare function issueCommand(command: string, properties: CommandProperties, message: string): void;
|
||||||
export declare function issue(name: string, message?: string): void;
|
export declare function issue(name: string, message?: string): void;
|
||||||
|
|||||||
+29
-17
@@ -1,15 +1,22 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
|
var __importStar = (this && this.__importStar) || function (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;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const os = require("os");
|
const os = __importStar(require("os"));
|
||||||
/**
|
/**
|
||||||
* Commands
|
* Commands
|
||||||
*
|
*
|
||||||
* Command Format:
|
* Command Format:
|
||||||
* ##[name key=value;key=value]message
|
* ::name key=value,key=value::message
|
||||||
*
|
*
|
||||||
* Examples:
|
* Examples:
|
||||||
* ##[warning]This is the user warning message
|
* ::warning::This is the message
|
||||||
* ##[set-secret name=mypassword]definitelyNotAPassword!
|
* ::set-env name=MY_VAR::some value
|
||||||
*/
|
*/
|
||||||
function issueCommand(command, properties, message) {
|
function issueCommand(command, properties, message) {
|
||||||
const cmd = new Command(command, properties, message);
|
const cmd = new Command(command, properties, message);
|
||||||
@@ -34,33 +41,38 @@ class Command {
|
|||||||
let cmdStr = CMD_STRING + this.command;
|
let cmdStr = CMD_STRING + this.command;
|
||||||
if (this.properties && Object.keys(this.properties).length > 0) {
|
if (this.properties && Object.keys(this.properties).length > 0) {
|
||||||
cmdStr += ' ';
|
cmdStr += ' ';
|
||||||
|
let first = true;
|
||||||
for (const key in this.properties) {
|
for (const key in this.properties) {
|
||||||
if (this.properties.hasOwnProperty(key)) {
|
if (this.properties.hasOwnProperty(key)) {
|
||||||
const val = this.properties[key];
|
const val = this.properties[key];
|
||||||
if (val) {
|
if (val) {
|
||||||
// safely append the val - avoid blowing up when attempting to
|
if (first) {
|
||||||
// call .replace() if message is not a string for some reason
|
first = false;
|
||||||
cmdStr += `${key}=${escape(`${val || ''}`)},`;
|
}
|
||||||
|
else {
|
||||||
|
cmdStr += ',';
|
||||||
|
}
|
||||||
|
cmdStr += `${key}=${escapeProperty(val)}`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cmdStr += CMD_STRING;
|
cmdStr += `${CMD_STRING}${escapeData(this.message)}`;
|
||||||
// safely append the message - avoid blowing up when attempting to
|
|
||||||
// call .replace() if message is not a string for some reason
|
|
||||||
const message = `${this.message || ''}`;
|
|
||||||
cmdStr += escapeData(message);
|
|
||||||
return cmdStr;
|
return cmdStr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function escapeData(s) {
|
function escapeData(s) {
|
||||||
return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
|
return (s || '')
|
||||||
|
.replace(/%/g, '%25')
|
||||||
|
.replace(/\r/g, '%0D')
|
||||||
|
.replace(/\n/g, '%0A');
|
||||||
}
|
}
|
||||||
function escape(s) {
|
function escapeProperty(s) {
|
||||||
return s
|
return (s || '')
|
||||||
|
.replace(/%/g, '%25')
|
||||||
.replace(/\r/g, '%0D')
|
.replace(/\r/g, '%0D')
|
||||||
.replace(/\n/g, '%0A')
|
.replace(/\n/g, '%0A')
|
||||||
.replace(/]/g, '%5D')
|
.replace(/:/g, '%3A')
|
||||||
.replace(/;/g, '%3B');
|
.replace(/,/g, '%2C');
|
||||||
}
|
}
|
||||||
//# sourceMappingURL=command.js.map
|
//# sourceMappingURL=command.js.map
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,8DAA8D;wBAC9D,6DAA6D;wBAC7D,MAAM,IAAI,GAAG,GAAG,IAAI,MAAM,CAAC,GAAG,GAAG,IAAI,EAAE,EAAE,CAAC,GAAG,CAAA;qBAC9C;iBACF;aACF;SACF;QAED,MAAM,IAAI,UAAU,CAAA;QAEpB,kEAAkE;QAClE,6DAA6D;QAC7D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAA;QACvC,MAAM,IAAI,UAAU,CAAC,OAAO,CAAC,CAAA;QAE7B,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,SAAS,MAAM,CAAC,CAAS;IACvB,OAAO,CAAC;SACL,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
{"version":3,"file":"command.js","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAwB;AAQxB;;;;;;;;;GASG;AACH,SAAgB,YAAY,CAC1B,OAAe,EACf,UAA6B,EAC7B,OAAe;IAEf,MAAM,GAAG,GAAG,IAAI,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AAC/C,CAAC;AAPD,oCAOC;AAED,SAAgB,KAAK,CAAC,IAAY,EAAE,UAAkB,EAAE;IACtD,YAAY,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACjC,CAAC;AAFD,sBAEC;AAED,MAAM,UAAU,GAAG,IAAI,CAAA;AAEvB,MAAM,OAAO;IAKX,YAAY,OAAe,EAAE,UAA6B,EAAE,OAAe;QACzE,IAAI,CAAC,OAAO,EAAE;YACZ,OAAO,GAAG,iBAAiB,CAAA;SAC5B;QAED,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,QAAQ;QACN,IAAI,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC,OAAO,CAAA;QAEtC,IAAI,IAAI,CAAC,UAAU,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,EAAE;YAC9D,MAAM,IAAI,GAAG,CAAA;YACb,IAAI,KAAK,GAAG,IAAI,CAAA;YAChB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE;gBACjC,IAAI,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,GAAG,CAAC,EAAE;oBACvC,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;oBAChC,IAAI,GAAG,EAAE;wBACP,IAAI,KAAK,EAAE;4BACT,KAAK,GAAG,KAAK,CAAA;yBACd;6BAAM;4BACL,MAAM,IAAI,GAAG,CAAA;yBACd;wBAED,MAAM,IAAI,GAAG,GAAG,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAA;qBAC1C;iBACF;aACF;SACF;QAED,MAAM,IAAI,GAAG,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAA;QACpD,OAAO,MAAM,CAAA;IACf,CAAC;CACF;AAED,SAAS,UAAU,CAAC,CAAS;IAC3B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,SAAS,cAAc,CAAC,CAAS;IAC/B,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;SACb,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC;SACpB,OAAO,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACzB,CAAC"}
|
||||||
+22
-5
@@ -19,17 +19,16 @@ export declare enum ExitCode {
|
|||||||
Failure = 1
|
Failure = 1
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* sets env variable for this action and future actions in the job
|
* Sets env variable for this action and future actions in the job
|
||||||
* @param name the name of the variable to set
|
* @param name the name of the variable to set
|
||||||
* @param val the value of the variable
|
* @param val the value of the variable
|
||||||
*/
|
*/
|
||||||
export declare function exportVariable(name: string, val: string): void;
|
export declare function exportVariable(name: string, val: string): void;
|
||||||
/**
|
/**
|
||||||
* exports the variable and registers a secret which will get masked from logs
|
* Registers a secret which will get masked from logs
|
||||||
* @param name the name of the variable to set
|
* @param secret value of the secret
|
||||||
* @param val value of the secret
|
|
||||||
*/
|
*/
|
||||||
export declare function exportSecret(name: string, val: string): void;
|
export declare function setSecret(secret: string): void;
|
||||||
/**
|
/**
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
* @param inputPath
|
* @param inputPath
|
||||||
@@ -56,6 +55,10 @@ export declare function setOutput(name: string, value: string): void;
|
|||||||
* @param message add error issue message
|
* @param message add error issue message
|
||||||
*/
|
*/
|
||||||
export declare function setFailed(message: string): void;
|
export declare function setFailed(message: string): void;
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
export declare function isDebug(): boolean;
|
||||||
/**
|
/**
|
||||||
* Writes debug message to user log
|
* Writes debug message to user log
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
@@ -97,3 +100,17 @@ export declare function endGroup(): void;
|
|||||||
* @param fn The function to wrap in the group
|
* @param fn The function to wrap in the group
|
||||||
*/
|
*/
|
||||||
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
export declare function group<T>(name: string, fn: () => Promise<T>): Promise<T>;
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
export declare function saveState(name: string, value: string): void;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
export declare function getState(name: string): string;
|
||||||
|
|||||||
+45
-13
@@ -8,10 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (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;
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const command_1 = require("./command");
|
const command_1 = require("./command");
|
||||||
const os = require("os");
|
const os = __importStar(require("os"));
|
||||||
const path = require("path");
|
const path = __importStar(require("path"));
|
||||||
/**
|
/**
|
||||||
* The code to exit an action
|
* The code to exit an action
|
||||||
*/
|
*/
|
||||||
@@ -30,7 +37,7 @@ var ExitCode;
|
|||||||
// Variables
|
// Variables
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* sets env variable for this action and future actions in the job
|
* Sets env variable for this action and future actions in the job
|
||||||
* @param name the name of the variable to set
|
* @param name the name of the variable to set
|
||||||
* @param val the value of the variable
|
* @param val the value of the variable
|
||||||
*/
|
*/
|
||||||
@@ -40,18 +47,13 @@ function exportVariable(name, val) {
|
|||||||
}
|
}
|
||||||
exports.exportVariable = exportVariable;
|
exports.exportVariable = exportVariable;
|
||||||
/**
|
/**
|
||||||
* exports the variable and registers a secret which will get masked from logs
|
* Registers a secret which will get masked from logs
|
||||||
* @param name the name of the variable to set
|
* @param secret value of the secret
|
||||||
* @param val value of the secret
|
|
||||||
*/
|
*/
|
||||||
function exportSecret(name, val) {
|
function setSecret(secret) {
|
||||||
exportVariable(name, val);
|
command_1.issueCommand('add-mask', {}, secret);
|
||||||
// the runner will error with not implemented
|
|
||||||
// leaving the function but raising the error earlier
|
|
||||||
command_1.issueCommand('set-secret', {}, val);
|
|
||||||
throw new Error('Not implemented.');
|
|
||||||
}
|
}
|
||||||
exports.exportSecret = exportSecret;
|
exports.setSecret = setSecret;
|
||||||
/**
|
/**
|
||||||
* Prepends inputPath to the PATH (for this action and future actions)
|
* Prepends inputPath to the PATH (for this action and future actions)
|
||||||
* @param inputPath
|
* @param inputPath
|
||||||
@@ -102,6 +104,13 @@ exports.setFailed = setFailed;
|
|||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
// Logging Commands
|
// Logging Commands
|
||||||
//-----------------------------------------------------------------------
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Gets whether Actions Step Debug is on or not
|
||||||
|
*/
|
||||||
|
function isDebug() {
|
||||||
|
return process.env['RUNNER_DEBUG'] === '1';
|
||||||
|
}
|
||||||
|
exports.isDebug = isDebug;
|
||||||
/**
|
/**
|
||||||
* Writes debug message to user log
|
* Writes debug message to user log
|
||||||
* @param message debug message
|
* @param message debug message
|
||||||
@@ -174,4 +183,27 @@ function group(name, fn) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.group = group;
|
exports.group = group;
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
// Wrapper action state
|
||||||
|
//-----------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* Saves state for current action, the state can only be retrieved by this action's post job execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to store
|
||||||
|
* @param value value to store
|
||||||
|
*/
|
||||||
|
function saveState(name, value) {
|
||||||
|
command_1.issueCommand('save-state', { name }, value);
|
||||||
|
}
|
||||||
|
exports.saveState = saveState;
|
||||||
|
/**
|
||||||
|
* Gets the value of an state set by this action's main execution.
|
||||||
|
*
|
||||||
|
* @param name name of the state to get
|
||||||
|
* @returns string
|
||||||
|
*/
|
||||||
|
function getState(name) {
|
||||||
|
return process.env[`STATE_${name}`] || '';
|
||||||
|
}
|
||||||
|
exports.getState = getState;
|
||||||
//# sourceMappingURL=core.js.map
|
//# sourceMappingURL=core.js.map
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,uCAA6C;AAE7C,yBAAwB;AACxB,6BAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;;GAIG;AACH,SAAgB,YAAY,CAAC,IAAY,EAAE,GAAW;IACpD,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IAEzB,6CAA6C;IAC7C,qDAAqD;IACrD,sBAAY,CAAC,YAAY,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAA;AACrC,CAAC;AAPD,oCAOC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC"}
|
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAE7C,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG;AACH,SAAgB,SAAS,CAAC,MAAc;IACtC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,MAAM,CAAC,CAAA;AACtC,CAAC;AAFD,8BAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,SAAiB;IACvC,sBAAY,CAAC,UAAU,EAAE,EAAE,EAAE,SAAS,CAAC,CAAA;IACvC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAA;AAC7E,CAAC;AAHD,0BAGC;AAED;;;;;;GAMG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,OAAsB;IAC3D,MAAM,GAAG,GACP,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CAAC,IAAI,EAAE,CAAA;IACrE,IAAI,OAAO,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,GAAG,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAA;KAC5D;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;AACnB,CAAC;AARD,4BAQC;AAED;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED,yEAAyE;AACzE,UAAU;AACV,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,SAAS,CAAC,OAAe;IACvC,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAA;IACnC,KAAK,CAAC,OAAO,CAAC,CAAA;AAChB,CAAC;AAHD,8BAGC;AAED,yEAAyE;AACzE,mBAAmB;AACnB,yEAAyE;AAEzE;;GAEG;AACH,SAAgB,OAAO;IACrB,OAAO,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAA;AAC5C,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,sBAAY,CAAC,OAAO,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;AACpC,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,KAAK,CAAC,OAAe;IACnC,eAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;AACzB,CAAC;AAFD,sBAEC;AAED;;;GAGG;AACH,SAAgB,OAAO,CAAC,OAAe;IACrC,eAAK,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AAFD,0BAEC;AAED;;;GAGG;AACH,SAAgB,IAAI,CAAC,OAAe;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
||||||
+19
-43
@@ -1,38 +1,16 @@
|
|||||||
{
|
{
|
||||||
"_from": "@actions/core",
|
|
||||||
"_id": "@actions/core@1.1.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-O5G6EmlzTVsng7VSpNtszIoQq6kOgMGNTFB/hmwKNNA4V71JyxImCIrL27vVHCt2Cb3ImkaCr6o27C2MV9Ylwg==",
|
|
||||||
"_location": "/@actions/core",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@actions/core",
|
|
||||||
"name": "@actions/core",
|
"name": "@actions/core",
|
||||||
"escapedName": "@actions%2fcore",
|
"version": "1.2.3",
|
||||||
"scope": "@actions",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.1.1.tgz",
|
|
||||||
"_shasum": "e08f3dbfe04721bb3d040f8fca2d6d7e1817b2e1",
|
|
||||||
"_spec": "@actions/core",
|
|
||||||
"_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Actions core lib",
|
"description": "Actions core lib",
|
||||||
"devDependencies": {
|
"keywords": [
|
||||||
"@types/node": "^12.0.2"
|
"github",
|
||||||
},
|
"actions",
|
||||||
|
"core"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/core.js",
|
||||||
|
"types": "lib/core.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -40,25 +18,23 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"core"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/core.js",
|
|
||||||
"name": "@actions/core",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/toolkit.git"
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/core"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc"
|
"tsc": "tsc"
|
||||||
},
|
},
|
||||||
"version": "1.1.1"
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^12.0.2"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
+3
-6
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#### Basic
|
#### Basic
|
||||||
|
|
||||||
You can use this package to execute your tools on the command line in a cross platform way:
|
You can use this package to execute tools in a cross platform way:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const exec = require('@actions/exec');
|
const exec = require('@actions/exec');
|
||||||
@@ -48,13 +48,10 @@ await exec.exec('node', ['index.js', 'foo=bar'], options);
|
|||||||
|
|
||||||
#### Exec tools not in the PATH
|
#### Exec tools not in the PATH
|
||||||
|
|
||||||
You can use it in conjunction with the `which` function from `@actions/io` to execute tools that are not in the PATH:
|
You can specify the full path for tools not in the PATH:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
const exec = require('@actions/exec');
|
const exec = require('@actions/exec');
|
||||||
const io = require('@actions/io');
|
|
||||||
|
|
||||||
const pythonPath: string = await io.which('python', true)
|
await exec.exec('"/path/to/my-tool"', ['arg1']);
|
||||||
|
|
||||||
await exec.exec(`"${pythonPath}"`, ['main.py']);
|
|
||||||
```
|
```
|
||||||
|
|||||||
+13
@@ -12,6 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|||||||
const os = require("os");
|
const os = require("os");
|
||||||
const events = require("events");
|
const events = require("events");
|
||||||
const child = require("child_process");
|
const child = require("child_process");
|
||||||
|
const path = require("path");
|
||||||
|
const io = require("@actions/io");
|
||||||
|
const ioUtil = require("@actions/io/lib/io-util");
|
||||||
/* eslint-disable @typescript-eslint/unbound-method */
|
/* eslint-disable @typescript-eslint/unbound-method */
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
/*
|
/*
|
||||||
@@ -357,6 +360,16 @@ class ToolRunner extends events.EventEmitter {
|
|||||||
*/
|
*/
|
||||||
exec() {
|
exec() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
// root the tool path if it is unrooted and contains relative pathing
|
||||||
|
if (!ioUtil.isRooted(this.toolPath) &&
|
||||||
|
(this.toolPath.includes('/') ||
|
||||||
|
(IS_WINDOWS && this.toolPath.includes('\\')))) {
|
||||||
|
// prefer options.cwd if it is specified, however options.cwd may also need to be rooted
|
||||||
|
this.toolPath = path.resolve(process.cwd(), this.options.cwd || process.cwd(), this.toolPath);
|
||||||
|
}
|
||||||
|
// if the tool is only a file name, then resolve it from the PATH
|
||||||
|
// otherwise verify it exists (add extension on Windows if necessary)
|
||||||
|
this.toolPath = yield io.which(this.toolPath, true);
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
this._debug(`exec tool: ${this.toolPath}`);
|
this._debug(`exec tool: ${this.toolPath}`);
|
||||||
this._debug('arguments:');
|
this._debug('arguments:');
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
+19
-45
@@ -1,39 +1,16 @@
|
|||||||
{
|
{
|
||||||
"_from": "@actions/exec",
|
|
||||||
"_id": "@actions/exec@1.0.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-nvFkxwiicvpzNiCBF4wFBDfnBvi7xp/as7LE1hBxBxKG2L29+gkIPBiLKMVORL+Hg3JNf07AKRfl0V5djoypjQ==",
|
|
||||||
"_location": "/@actions/exec",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@actions/exec",
|
|
||||||
"name": "@actions/exec",
|
"name": "@actions/exec",
|
||||||
"escapedName": "@actions%2fexec",
|
"version": "1.0.3",
|
||||||
"scope": "@actions",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/",
|
|
||||||
"/@actions/tool-cache"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.1.tgz",
|
|
||||||
"_shasum": "1624b541165697e7008d7c87bc1f69f191263c6c",
|
|
||||||
"_spec": "@actions/exec",
|
|
||||||
"_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Actions exec lib",
|
"description": "Actions exec lib",
|
||||||
"devDependencies": {
|
"keywords": [
|
||||||
"@actions/io": "^1.0.1"
|
"github",
|
||||||
},
|
"actions",
|
||||||
|
"exec"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/exec.js",
|
||||||
|
"types": "lib/exec.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -41,26 +18,23 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
|
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"exec"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/exec.js",
|
|
||||||
"name": "@actions/exec",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/toolkit.git"
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/exec"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc"
|
"tsc": "tsc"
|
||||||
},
|
},
|
||||||
"version": "1.0.1"
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/io": "^1.0.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
Typed Rest Client for Node.js
|
Actions Http Client for Node.js
|
||||||
|
|
||||||
Copyright (c) Microsoft Corporation
|
Copyright (c) GitHub, Inc.
|
||||||
|
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
+79
@@ -0,0 +1,79 @@
|
|||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<img src="actions.png">
|
||||||
|
</p>
|
||||||
|
|
||||||
|
# Actions Http-Client
|
||||||
|
|
||||||
|
[](https://github.com/actions/http-client/actions)
|
||||||
|
|
||||||
|
A lightweight HTTP client optimized for use with actions, TypeScript with generics and async await.
|
||||||
|
|
||||||
|
## Features
|
||||||
|
|
||||||
|
- HTTP client with TypeScript generics and async/await/Promises
|
||||||
|
- Typings included so no need to acquire separately (great for intellisense and no versioning drift)
|
||||||
|
- [Proxy support](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/about-self-hosted-runners#using-a-proxy-server-with-self-hosted-runners) just works with actions and the runner
|
||||||
|
- Targets ES2019 (runner runs actions with node 12+). Only supported on node 12+.
|
||||||
|
- Basic, Bearer and PAT Support out of the box. Extensible handlers for others.
|
||||||
|
- Redirects supported
|
||||||
|
|
||||||
|
Features and releases [here](./RELEASES.md)
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```
|
||||||
|
npm install @actions/http-client --save
|
||||||
|
```
|
||||||
|
|
||||||
|
## Samples
|
||||||
|
|
||||||
|
See the [HTTP](./__tests__) tests for detailed examples.
|
||||||
|
|
||||||
|
## Errors
|
||||||
|
|
||||||
|
### HTTP
|
||||||
|
|
||||||
|
The HTTP client does not throw unless truly exceptional.
|
||||||
|
|
||||||
|
* A request that successfully executes resulting in a 404, 500 etc... will return a response object with a status code and a body.
|
||||||
|
* Redirects (3xx) will be followed by default.
|
||||||
|
|
||||||
|
See [HTTP tests](./__tests__) for detailed examples.
|
||||||
|
|
||||||
|
## Debugging
|
||||||
|
|
||||||
|
To enable detailed console logging of all HTTP requests and responses, set the NODE_DEBUG environment varible:
|
||||||
|
|
||||||
|
```
|
||||||
|
export NODE_DEBUG=http
|
||||||
|
```
|
||||||
|
|
||||||
|
## Node support
|
||||||
|
|
||||||
|
The http-client is built using the latest LTS version of Node 12. It may work on previous node LTS versions but it's tested and officially supported on Node12+.
|
||||||
|
|
||||||
|
## Support and Versioning
|
||||||
|
|
||||||
|
We follow semver and will hold compatibility between major versions and increment the minor version with new features and capabilities (while holding compat).
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
We welcome PRs. Please create an issue and if applicable, a design before proceeding with code.
|
||||||
|
|
||||||
|
once:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
To build:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ npm run build
|
||||||
|
```
|
||||||
|
|
||||||
|
To run all tests:
|
||||||
|
```bash
|
||||||
|
$ npm test
|
||||||
|
```
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
## Releases
|
||||||
|
|
||||||
|
## 1.0.6
|
||||||
|
Automatically sends Content-Type and Accept application/json headers for \<verb>Json() helper methods if not set in the client or parameters.
|
||||||
|
|
||||||
|
## 1.0.5
|
||||||
|
Adds \<verb>Json() helper methods for json over http scenarios.
|
||||||
|
|
||||||
|
## 1.0.4
|
||||||
|
Started to add \<verb>Json() helper methods. Do not use this release for that. Use >= 1.0.5 since there was an issue with types.
|
||||||
|
|
||||||
|
## 1.0.1 to 1.0.3
|
||||||
|
Adds proxy support.
|
||||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 33 KiB |
+23
@@ -0,0 +1,23 @@
|
|||||||
|
import ifm = require('./interfaces');
|
||||||
|
export declare class BasicCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
username: string;
|
||||||
|
password: string;
|
||||||
|
constructor(username: string, password: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class BearerCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
||||||
|
export declare class PersonalAccessTokenCredentialHandler implements ifm.IRequestHandler {
|
||||||
|
token: string;
|
||||||
|
constructor(token: string);
|
||||||
|
prepareRequest(options: any): void;
|
||||||
|
canHandleAuthentication(response: ifm.IHttpClientResponse): boolean;
|
||||||
|
handleAuthentication(httpClient: ifm.IHttpClient, requestInfo: ifm.IRequestInfo, objs: any): Promise<ifm.IHttpClientResponse>;
|
||||||
|
}
|
||||||
+55
@@ -0,0 +1,55 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
class BasicCredentialHandler {
|
||||||
|
constructor(username, password) {
|
||||||
|
this.username = username;
|
||||||
|
this.password = password;
|
||||||
|
}
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Basic ' + Buffer.from(this.username + ':' + this.password).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BasicCredentialHandler = BasicCredentialHandler;
|
||||||
|
class BearerCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Bearer ' + this.token;
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.BearerCredentialHandler = BearerCredentialHandler;
|
||||||
|
class PersonalAccessTokenCredentialHandler {
|
||||||
|
constructor(token) {
|
||||||
|
this.token = token;
|
||||||
|
}
|
||||||
|
// currently implements pre-authorization
|
||||||
|
// TODO: support preAuth = false where it hooks on 401
|
||||||
|
prepareRequest(options) {
|
||||||
|
options.headers['Authorization'] = 'Basic ' + Buffer.from('PAT:' + this.token).toString('base64');
|
||||||
|
}
|
||||||
|
// This handler cannot handle 401
|
||||||
|
canHandleAuthentication(response) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
handleAuthentication(httpClient, requestInfo, objs) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.PersonalAccessTokenCredentialHandler = PersonalAccessTokenCredentialHandler;
|
||||||
Generated
Vendored
+39
-24
@@ -1,7 +1,6 @@
|
|||||||
/// <reference types="node" />
|
/// <reference types="node" />
|
||||||
import url = require("url");
|
|
||||||
import http = require("http");
|
import http = require("http");
|
||||||
import ifm = require('./Interfaces');
|
import ifm = require('./interfaces');
|
||||||
export declare enum HttpCodes {
|
export declare enum HttpCodes {
|
||||||
OK = 200,
|
OK = 200,
|
||||||
MultipleChoices = 300,
|
MultipleChoices = 300,
|
||||||
@@ -28,28 +27,34 @@ export declare enum HttpCodes {
|
|||||||
NotImplemented = 501,
|
NotImplemented = 501,
|
||||||
BadGateway = 502,
|
BadGateway = 502,
|
||||||
ServiceUnavailable = 503,
|
ServiceUnavailable = 503,
|
||||||
GatewayTimeout = 504,
|
GatewayTimeout = 504
|
||||||
}
|
}
|
||||||
|
export declare enum Headers {
|
||||||
|
Accept = "accept",
|
||||||
|
ContentType = "content-type"
|
||||||
|
}
|
||||||
|
export declare enum MediaTypes {
|
||||||
|
ApplicationJson = "application/json"
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
export declare function getProxyUrl(serverUrl: string): string;
|
||||||
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
|
export declare class HttpClientResponse implements ifm.IHttpClientResponse {
|
||||||
constructor(message: http.IncomingMessage);
|
constructor(message: http.IncomingMessage);
|
||||||
message: http.IncomingMessage;
|
message: http.IncomingMessage;
|
||||||
readBody(): Promise<string>;
|
readBody(): Promise<string>;
|
||||||
}
|
}
|
||||||
export interface RequestInfo {
|
|
||||||
options: http.RequestOptions;
|
|
||||||
parsedUrl: url.Url;
|
|
||||||
httpModule: any;
|
|
||||||
}
|
|
||||||
export declare function isHttps(requestUrl: string): boolean;
|
export declare function isHttps(requestUrl: string): boolean;
|
||||||
export declare class HttpClient implements ifm.IHttpClient {
|
export declare class HttpClient {
|
||||||
userAgent: string;
|
userAgent: string | undefined;
|
||||||
handlers: ifm.IRequestHandler[];
|
handlers: ifm.IRequestHandler[];
|
||||||
requestOptions: ifm.IRequestOptions;
|
requestOptions: ifm.IRequestOptions;
|
||||||
private _ignoreSslError;
|
private _ignoreSslError;
|
||||||
private _socketTimeout;
|
private _socketTimeout;
|
||||||
private _httpProxy;
|
|
||||||
private _httpProxyBypassHosts;
|
|
||||||
private _allowRedirects;
|
private _allowRedirects;
|
||||||
|
private _allowRedirectDowngrade;
|
||||||
private _maxRedirects;
|
private _maxRedirects;
|
||||||
private _allowRetries;
|
private _allowRetries;
|
||||||
private _maxRetries;
|
private _maxRetries;
|
||||||
@@ -57,11 +62,7 @@ export declare class HttpClient implements ifm.IHttpClient {
|
|||||||
private _proxyAgent;
|
private _proxyAgent;
|
||||||
private _keepAlive;
|
private _keepAlive;
|
||||||
private _disposed;
|
private _disposed;
|
||||||
private _certConfig;
|
constructor(userAgent?: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
||||||
private _ca;
|
|
||||||
private _cert;
|
|
||||||
private _key;
|
|
||||||
constructor(userAgent: string, handlers?: ifm.IRequestHandler[], requestOptions?: ifm.IRequestOptions);
|
|
||||||
options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
options(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
get(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
del(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
@@ -70,6 +71,14 @@ export declare class HttpClient implements ifm.IHttpClient {
|
|||||||
put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
put(requestUrl: string, data: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
head(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
sendStream(verb: string, requestUrl: string, stream: NodeJS.ReadableStream, additionalHeaders?: ifm.IHeaders): Promise<ifm.IHttpClientResponse>;
|
||||||
|
/**
|
||||||
|
* Gets a typed object from an endpoint
|
||||||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||||
|
*/
|
||||||
|
getJson<T>(requestUrl: string, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||||
|
postJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||||
|
putJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||||
|
patchJson<T>(requestUrl: string, obj: any, additionalHeaders?: ifm.IHeaders): Promise<ifm.ITypedResponse<T>>;
|
||||||
/**
|
/**
|
||||||
* Makes a raw http request.
|
* Makes a raw http request.
|
||||||
* All other methods such as get, post, patch, and request ultimately call this.
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
@@ -93,11 +102,17 @@ export declare class HttpClient implements ifm.IHttpClient {
|
|||||||
* @param onResult
|
* @param onResult
|
||||||
*/
|
*/
|
||||||
requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
|
requestRawWithCallback(info: ifm.IRequestInfo, data: string | NodeJS.ReadableStream, onResult: (err: any, res: ifm.IHttpClientResponse) => void): void;
|
||||||
private _prepareRequest(method, requestUrl, headers);
|
/**
|
||||||
private _isPresigned(requestUrl);
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
private _mergeHeaders(headers);
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
private _getAgent(requestUrl);
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
private _getProxy(requestUrl);
|
*/
|
||||||
private _isBypassProxy(requestUrl);
|
getAgent(serverUrl: string): http.Agent;
|
||||||
private _performExponentialBackoff(retryNumber);
|
private _prepareRequest;
|
||||||
|
private _mergeHeaders;
|
||||||
|
private _getExistingOrDefaultHeader;
|
||||||
|
private _getAgent;
|
||||||
|
private _performExponentialBackoff;
|
||||||
|
private static dateTimeDeserializer;
|
||||||
|
private _processResponse;
|
||||||
}
|
}
|
||||||
Generated
Vendored
+167
-122
@@ -1,19 +1,9 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
// Copyright (c) Microsoft. All rights reserved.
|
|
||||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
var __awaiter = (this && this.__awaiter) || function (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());
|
|
||||||
});
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const url = require("url");
|
const url = require("url");
|
||||||
const http = require("http");
|
const http = require("http");
|
||||||
const https = require("https");
|
const https = require("https");
|
||||||
let fs;
|
const pm = require("./proxy");
|
||||||
let tunnel;
|
let tunnel;
|
||||||
var HttpCodes;
|
var HttpCodes;
|
||||||
(function (HttpCodes) {
|
(function (HttpCodes) {
|
||||||
@@ -44,6 +34,24 @@ var HttpCodes;
|
|||||||
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
|
||||||
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
|
||||||
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
})(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
|
||||||
|
var Headers;
|
||||||
|
(function (Headers) {
|
||||||
|
Headers["Accept"] = "accept";
|
||||||
|
Headers["ContentType"] = "content-type";
|
||||||
|
})(Headers = exports.Headers || (exports.Headers = {}));
|
||||||
|
var MediaTypes;
|
||||||
|
(function (MediaTypes) {
|
||||||
|
MediaTypes["ApplicationJson"] = "application/json";
|
||||||
|
})(MediaTypes = exports.MediaTypes || (exports.MediaTypes = {}));
|
||||||
|
/**
|
||||||
|
* Returns the proxy URL, depending upon the supplied url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
function getProxyUrl(serverUrl) {
|
||||||
|
let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
|
||||||
|
return proxyUrl ? proxyUrl.href : '';
|
||||||
|
}
|
||||||
|
exports.getProxyUrl = getProxyUrl;
|
||||||
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
|
||||||
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
|
||||||
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
|
||||||
@@ -54,15 +62,15 @@ class HttpClientResponse {
|
|||||||
this.message = message;
|
this.message = message;
|
||||||
}
|
}
|
||||||
readBody() {
|
readBody() {
|
||||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
return new Promise(async (resolve, reject) => {
|
||||||
let output = '';
|
let output = Buffer.alloc(0);
|
||||||
this.message.on('data', (chunk) => {
|
this.message.on('data', (chunk) => {
|
||||||
output += chunk;
|
output = Buffer.concat([output, chunk]);
|
||||||
});
|
});
|
||||||
this.message.on('end', () => {
|
this.message.on('end', () => {
|
||||||
resolve(output);
|
resolve(output.toString());
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.HttpClientResponse = HttpClientResponse;
|
exports.HttpClientResponse = HttpClientResponse;
|
||||||
@@ -71,15 +79,11 @@ function isHttps(requestUrl) {
|
|||||||
return parsedUrl.protocol === 'https:';
|
return parsedUrl.protocol === 'https:';
|
||||||
}
|
}
|
||||||
exports.isHttps = isHttps;
|
exports.isHttps = isHttps;
|
||||||
var EnvironmentVariables;
|
|
||||||
(function (EnvironmentVariables) {
|
|
||||||
EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
|
|
||||||
EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
|
|
||||||
})(EnvironmentVariables || (EnvironmentVariables = {}));
|
|
||||||
class HttpClient {
|
class HttpClient {
|
||||||
constructor(userAgent, handlers, requestOptions) {
|
constructor(userAgent, handlers, requestOptions) {
|
||||||
this._ignoreSslError = false;
|
this._ignoreSslError = false;
|
||||||
this._allowRedirects = true;
|
this._allowRedirects = true;
|
||||||
|
this._allowRedirectDowngrade = false;
|
||||||
this._maxRedirects = 50;
|
this._maxRedirects = 50;
|
||||||
this._allowRetries = false;
|
this._allowRetries = false;
|
||||||
this._maxRetries = 1;
|
this._maxRetries = 1;
|
||||||
@@ -93,31 +97,12 @@ class HttpClient {
|
|||||||
this._ignoreSslError = requestOptions.ignoreSslError;
|
this._ignoreSslError = requestOptions.ignoreSslError;
|
||||||
}
|
}
|
||||||
this._socketTimeout = requestOptions.socketTimeout;
|
this._socketTimeout = requestOptions.socketTimeout;
|
||||||
this._httpProxy = requestOptions.proxy;
|
|
||||||
if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
|
|
||||||
this._httpProxyBypassHosts = [];
|
|
||||||
requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
|
|
||||||
this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this._certConfig = requestOptions.cert;
|
|
||||||
if (this._certConfig) {
|
|
||||||
// If using cert, need fs
|
|
||||||
fs = require('fs');
|
|
||||||
// cache the cert content into memory, so we don't have to read it from disk every time
|
|
||||||
if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
|
|
||||||
this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
|
|
||||||
}
|
|
||||||
if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
|
|
||||||
this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
|
|
||||||
}
|
|
||||||
if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
|
|
||||||
this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (requestOptions.allowRedirects != null) {
|
if (requestOptions.allowRedirects != null) {
|
||||||
this._allowRedirects = requestOptions.allowRedirects;
|
this._allowRedirects = requestOptions.allowRedirects;
|
||||||
}
|
}
|
||||||
|
if (requestOptions.allowRedirectDowngrade != null) {
|
||||||
|
this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
|
||||||
|
}
|
||||||
if (requestOptions.maxRedirects != null) {
|
if (requestOptions.maxRedirects != null) {
|
||||||
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
|
||||||
}
|
}
|
||||||
@@ -156,23 +141,53 @@ class HttpClient {
|
|||||||
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
sendStream(verb, requestUrl, stream, additionalHeaders) {
|
||||||
return this.request(verb, requestUrl, stream, additionalHeaders);
|
return this.request(verb, requestUrl, stream, additionalHeaders);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets a typed object from an endpoint
|
||||||
|
* Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
|
||||||
|
*/
|
||||||
|
async getJson(requestUrl, additionalHeaders = {}) {
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.get(requestUrl, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async postJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.post(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async putJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.put(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
|
async patchJson(requestUrl, obj, additionalHeaders = {}) {
|
||||||
|
let data = JSON.stringify(obj, null, 2);
|
||||||
|
additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
|
||||||
|
additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
|
||||||
|
let res = await this.patch(requestUrl, data, additionalHeaders);
|
||||||
|
return this._processResponse(res, this.requestOptions);
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Makes a raw http request.
|
* Makes a raw http request.
|
||||||
* All other methods such as get, post, patch, and request ultimately call this.
|
* All other methods such as get, post, patch, and request ultimately call this.
|
||||||
* Prefer get, del, post and patch
|
* Prefer get, del, post and patch
|
||||||
*/
|
*/
|
||||||
request(verb, requestUrl, data, headers) {
|
async request(verb, requestUrl, data, headers) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
|
||||||
if (this._disposed) {
|
if (this._disposed) {
|
||||||
throw new Error("Client has already been disposed.");
|
throw new Error("Client has already been disposed.");
|
||||||
}
|
}
|
||||||
let info = this._prepareRequest(verb, requestUrl, headers);
|
let parsedUrl = url.parse(requestUrl);
|
||||||
|
let info = this._prepareRequest(verb, parsedUrl, headers);
|
||||||
// Only perform retries on reads since writes may not be idempotent.
|
// Only perform retries on reads since writes may not be idempotent.
|
||||||
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
|
let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
|
||||||
let numTries = 0;
|
let numTries = 0;
|
||||||
let response;
|
let response;
|
||||||
while (numTries < maxTries) {
|
while (numTries < maxTries) {
|
||||||
response = yield this.requestRaw(info, data);
|
response = await this.requestRaw(info, data);
|
||||||
// Check if it's an authentication challenge
|
// Check if it's an authentication challenge
|
||||||
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
||||||
let authenticationHandler;
|
let authenticationHandler;
|
||||||
@@ -200,12 +215,16 @@ class HttpClient {
|
|||||||
// if there's no location to redirect to, we won't
|
// if there's no location to redirect to, we won't
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
let parsedRedirectUrl = url.parse(redirectUrl);
|
||||||
|
if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
|
||||||
|
throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
|
||||||
|
}
|
||||||
// we need to finish reading the response before reassigning response
|
// we need to finish reading the response before reassigning response
|
||||||
// which will leak the open socket.
|
// which will leak the open socket.
|
||||||
yield response.readBody();
|
await response.readBody();
|
||||||
// let's make the request with the new redirectUrl
|
// let's make the request with the new redirectUrl
|
||||||
info = this._prepareRequest(verb, redirectUrl, headers);
|
info = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
||||||
response = yield this.requestRaw(info, data);
|
response = await this.requestRaw(info, data);
|
||||||
redirectsRemaining--;
|
redirectsRemaining--;
|
||||||
}
|
}
|
||||||
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
|
||||||
@@ -214,12 +233,11 @@ class HttpClient {
|
|||||||
}
|
}
|
||||||
numTries += 1;
|
numTries += 1;
|
||||||
if (numTries < maxTries) {
|
if (numTries < maxTries) {
|
||||||
yield response.readBody();
|
await response.readBody();
|
||||||
yield this._performExponentialBackoff(numTries);
|
await this._performExponentialBackoff(numTries);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
});
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Needs to be called if keepAlive is set to true in request options.
|
* Needs to be called if keepAlive is set to true in request options.
|
||||||
@@ -254,7 +272,6 @@ class HttpClient {
|
|||||||
*/
|
*/
|
||||||
requestRawWithCallback(info, data, onResult) {
|
requestRawWithCallback(info, data, onResult) {
|
||||||
let socket;
|
let socket;
|
||||||
let isDataString = typeof (data) === 'string';
|
|
||||||
if (typeof (data) === 'string') {
|
if (typeof (data) === 'string') {
|
||||||
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
|
info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
|
||||||
}
|
}
|
||||||
@@ -297,9 +314,18 @@ class HttpClient {
|
|||||||
req.end();
|
req.end();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets an http agent. This function is useful when you need an http agent that handles
|
||||||
|
* routing through a proxy server - depending upon the url and proxy environment variables.
|
||||||
|
* @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
|
||||||
|
*/
|
||||||
|
getAgent(serverUrl) {
|
||||||
|
let parsedUrl = url.parse(serverUrl);
|
||||||
|
return this._getAgent(parsedUrl);
|
||||||
|
}
|
||||||
_prepareRequest(method, requestUrl, headers) {
|
_prepareRequest(method, requestUrl, headers) {
|
||||||
const info = {};
|
const info = {};
|
||||||
info.parsedUrl = url.parse(requestUrl);
|
info.parsedUrl = requestUrl;
|
||||||
const usingSsl = info.parsedUrl.protocol === 'https:';
|
const usingSsl = info.parsedUrl.protocol === 'https:';
|
||||||
info.httpModule = usingSsl ? https : http;
|
info.httpModule = usingSsl ? https : http;
|
||||||
const defaultPort = usingSsl ? 443 : 80;
|
const defaultPort = usingSsl ? 443 : 80;
|
||||||
@@ -309,27 +335,18 @@ class HttpClient {
|
|||||||
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
|
||||||
info.options.method = method;
|
info.options.method = method;
|
||||||
info.options.headers = this._mergeHeaders(headers);
|
info.options.headers = this._mergeHeaders(headers);
|
||||||
|
if (this.userAgent != null) {
|
||||||
info.options.headers["user-agent"] = this.userAgent;
|
info.options.headers["user-agent"] = this.userAgent;
|
||||||
info.options.agent = this._getAgent(requestUrl);
|
}
|
||||||
|
info.options.agent = this._getAgent(info.parsedUrl);
|
||||||
// gives handlers an opportunity to participate
|
// gives handlers an opportunity to participate
|
||||||
if (this.handlers && !this._isPresigned(requestUrl)) {
|
if (this.handlers) {
|
||||||
this.handlers.forEach((handler) => {
|
this.handlers.forEach((handler) => {
|
||||||
handler.prepareRequest(info.options);
|
handler.prepareRequest(info.options);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
_isPresigned(requestUrl) {
|
|
||||||
if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
|
|
||||||
const patterns = this.requestOptions.presignedUrlPatterns;
|
|
||||||
for (let i = 0; i < patterns.length; i++) {
|
|
||||||
if (requestUrl.match(patterns[i])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
_mergeHeaders(headers) {
|
_mergeHeaders(headers) {
|
||||||
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
||||||
if (this.requestOptions && this.requestOptions.headers) {
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
@@ -337,10 +354,18 @@ class HttpClient {
|
|||||||
}
|
}
|
||||||
return lowercaseKeys(headers || {});
|
return lowercaseKeys(headers || {});
|
||||||
}
|
}
|
||||||
_getAgent(requestUrl) {
|
_getExistingOrDefaultHeader(additionalHeaders, header, _default) {
|
||||||
|
const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
|
||||||
|
let clientHeader;
|
||||||
|
if (this.requestOptions && this.requestOptions.headers) {
|
||||||
|
clientHeader = lowercaseKeys(this.requestOptions.headers)[header];
|
||||||
|
}
|
||||||
|
return additionalHeaders[header] || clientHeader || _default;
|
||||||
|
}
|
||||||
|
_getAgent(parsedUrl) {
|
||||||
let agent;
|
let agent;
|
||||||
let proxy = this._getProxy(requestUrl);
|
let proxyUrl = pm.getProxyUrl(parsedUrl);
|
||||||
let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
|
let useProxy = proxyUrl && proxyUrl.hostname;
|
||||||
if (this._keepAlive && useProxy) {
|
if (this._keepAlive && useProxy) {
|
||||||
agent = this._proxyAgent;
|
agent = this._proxyAgent;
|
||||||
}
|
}
|
||||||
@@ -351,7 +376,6 @@ class HttpClient {
|
|||||||
if (!!agent) {
|
if (!!agent) {
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
let parsedUrl = url.parse(requestUrl);
|
|
||||||
const usingSsl = parsedUrl.protocol === 'https:';
|
const usingSsl = parsedUrl.protocol === 'https:';
|
||||||
let maxSockets = 100;
|
let maxSockets = 100;
|
||||||
if (!!this.requestOptions) {
|
if (!!this.requestOptions) {
|
||||||
@@ -366,13 +390,13 @@ class HttpClient {
|
|||||||
maxSockets: maxSockets,
|
maxSockets: maxSockets,
|
||||||
keepAlive: this._keepAlive,
|
keepAlive: this._keepAlive,
|
||||||
proxy: {
|
proxy: {
|
||||||
proxyAuth: proxy.proxyAuth,
|
proxyAuth: proxyUrl.auth,
|
||||||
host: proxy.proxyUrl.hostname,
|
host: proxyUrl.hostname,
|
||||||
port: proxy.proxyUrl.port
|
port: proxyUrl.port
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
let tunnelAgent;
|
let tunnelAgent;
|
||||||
const overHttps = proxy.proxyUrl.protocol === 'https:';
|
const overHttps = proxyUrl.protocol === 'https:';
|
||||||
if (usingSsl) {
|
if (usingSsl) {
|
||||||
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
|
||||||
}
|
}
|
||||||
@@ -398,58 +422,79 @@ class HttpClient {
|
|||||||
// we have to cast it to any and change it directly
|
// we have to cast it to any and change it directly
|
||||||
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
|
agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
|
||||||
}
|
}
|
||||||
if (usingSsl && this._certConfig) {
|
|
||||||
agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
|
|
||||||
}
|
|
||||||
return agent;
|
return agent;
|
||||||
}
|
}
|
||||||
_getProxy(requestUrl) {
|
|
||||||
const parsedUrl = url.parse(requestUrl);
|
|
||||||
let usingSsl = parsedUrl.protocol === 'https:';
|
|
||||||
let proxyConfig = this._httpProxy;
|
|
||||||
// fallback to http_proxy and https_proxy env
|
|
||||||
let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
|
|
||||||
let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
|
|
||||||
if (!proxyConfig) {
|
|
||||||
if (https_proxy && usingSsl) {
|
|
||||||
proxyConfig = {
|
|
||||||
proxyUrl: https_proxy
|
|
||||||
};
|
|
||||||
}
|
|
||||||
else if (http_proxy) {
|
|
||||||
proxyConfig = {
|
|
||||||
proxyUrl: http_proxy
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
let proxyUrl;
|
|
||||||
let proxyAuth;
|
|
||||||
if (proxyConfig) {
|
|
||||||
if (proxyConfig.proxyUrl.length > 0) {
|
|
||||||
proxyUrl = url.parse(proxyConfig.proxyUrl);
|
|
||||||
}
|
|
||||||
if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
|
|
||||||
proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
|
|
||||||
}
|
|
||||||
_isBypassProxy(requestUrl) {
|
|
||||||
if (!this._httpProxyBypassHosts) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let bypass = false;
|
|
||||||
this._httpProxyBypassHosts.forEach(bypassHost => {
|
|
||||||
if (bypassHost.test(requestUrl)) {
|
|
||||||
bypass = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return bypass;
|
|
||||||
}
|
|
||||||
_performExponentialBackoff(retryNumber) {
|
_performExponentialBackoff(retryNumber) {
|
||||||
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
|
||||||
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
|
||||||
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
return new Promise(resolve => setTimeout(() => resolve(), ms));
|
||||||
}
|
}
|
||||||
|
static dateTimeDeserializer(key, value) {
|
||||||
|
if (typeof value === 'string') {
|
||||||
|
let a = new Date(value);
|
||||||
|
if (!isNaN(a.valueOf())) {
|
||||||
|
return a;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
async _processResponse(res, options) {
|
||||||
|
return new Promise(async (resolve, reject) => {
|
||||||
|
const statusCode = res.message.statusCode;
|
||||||
|
const response = {
|
||||||
|
statusCode: statusCode,
|
||||||
|
result: null,
|
||||||
|
headers: {}
|
||||||
|
};
|
||||||
|
// not found leads to null obj returned
|
||||||
|
if (statusCode == HttpCodes.NotFound) {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
let obj;
|
||||||
|
let contents;
|
||||||
|
// get the result from the body
|
||||||
|
try {
|
||||||
|
contents = await res.readBody();
|
||||||
|
if (contents && contents.length > 0) {
|
||||||
|
if (options && options.deserializeDates) {
|
||||||
|
obj = JSON.parse(contents, HttpClient.dateTimeDeserializer);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj = JSON.parse(contents);
|
||||||
|
}
|
||||||
|
response.result = obj;
|
||||||
|
}
|
||||||
|
response.headers = res.message.headers;
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
// Invalid resource (contents not json); leaving result obj null
|
||||||
|
}
|
||||||
|
// note that 3xx redirects are handled by the http layer.
|
||||||
|
if (statusCode > 299) {
|
||||||
|
let msg;
|
||||||
|
// if exception/error in body, attempt to get better error
|
||||||
|
if (obj && obj.message) {
|
||||||
|
msg = obj.message;
|
||||||
|
}
|
||||||
|
else if (contents && contents.length > 0) {
|
||||||
|
// it may be the case that the exception is in the body message as string
|
||||||
|
msg = contents;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
msg = "Failed request: (" + statusCode + ")";
|
||||||
|
}
|
||||||
|
let err = new Error(msg);
|
||||||
|
// attach statusCode and body obj (if available) to the error object
|
||||||
|
err['statusCode'] = statusCode;
|
||||||
|
if (response.result) {
|
||||||
|
err['result'] = response.result;
|
||||||
|
}
|
||||||
|
reject(err);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
resolve(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.HttpClient = HttpClient;
|
exports.HttpClient = HttpClient;
|
||||||
Generated
Vendored
+6
-18
@@ -4,10 +4,6 @@ import url = require("url");
|
|||||||
export interface IHeaders {
|
export interface IHeaders {
|
||||||
[key: string]: any;
|
[key: string]: any;
|
||||||
}
|
}
|
||||||
export interface IBasicCredentials {
|
|
||||||
username: string;
|
|
||||||
password: string;
|
|
||||||
}
|
|
||||||
export interface IHttpClient {
|
export interface IHttpClient {
|
||||||
options(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
options(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
get(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
get(requestUrl: string, additionalHeaders?: IHeaders): Promise<IHttpClientResponse>;
|
||||||
@@ -38,25 +34,17 @@ export interface IRequestOptions {
|
|||||||
headers?: IHeaders;
|
headers?: IHeaders;
|
||||||
socketTimeout?: number;
|
socketTimeout?: number;
|
||||||
ignoreSslError?: boolean;
|
ignoreSslError?: boolean;
|
||||||
proxy?: IProxyConfiguration;
|
|
||||||
cert?: ICertConfiguration;
|
|
||||||
allowRedirects?: boolean;
|
allowRedirects?: boolean;
|
||||||
|
allowRedirectDowngrade?: boolean;
|
||||||
maxRedirects?: number;
|
maxRedirects?: number;
|
||||||
maxSockets?: number;
|
maxSockets?: number;
|
||||||
keepAlive?: boolean;
|
keepAlive?: boolean;
|
||||||
presignedUrlPatterns?: RegExp[];
|
deserializeDates?: boolean;
|
||||||
allowRetries?: boolean;
|
allowRetries?: boolean;
|
||||||
maxRetries?: number;
|
maxRetries?: number;
|
||||||
}
|
}
|
||||||
export interface IProxyConfiguration {
|
export interface ITypedResponse<T> {
|
||||||
proxyUrl: string;
|
statusCode: number;
|
||||||
proxyUsername?: string;
|
result: T | null;
|
||||||
proxyPassword?: string;
|
headers: Object;
|
||||||
proxyBypassHosts?: string[];
|
|
||||||
}
|
|
||||||
export interface ICertConfiguration {
|
|
||||||
caFile?: string;
|
|
||||||
certFile?: string;
|
|
||||||
keyFile?: string;
|
|
||||||
passphrase?: string;
|
|
||||||
}
|
}
|
||||||
Generated
Vendored
+1
@@ -1,2 +1,3 @@
|
|||||||
"use strict";
|
"use strict";
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
;
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
{
|
||||||
|
"name": "@actions/http-client",
|
||||||
|
"version": "1.0.6",
|
||||||
|
"description": "Actions Http Client",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": "rm -Rf ./_out && tsc && cp package*.json ./_out && cp *.md ./_out && cp LICENSE ./_out && cp actions.png ./_out",
|
||||||
|
"test": "jest"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/actions/http-client.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"Actions",
|
||||||
|
"Http"
|
||||||
|
],
|
||||||
|
"author": "GitHub, Inc.",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/http-client/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/actions/http-client#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/jest": "^24.0.25",
|
||||||
|
"@types/node": "^12.12.24",
|
||||||
|
"jest": "^24.9.0",
|
||||||
|
"proxy": "^1.0.1",
|
||||||
|
"ts-jest": "^24.3.0",
|
||||||
|
"typescript": "^3.7.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tunnel": "0.0.6"
|
||||||
|
}
|
||||||
|
}
|
||||||
+4
@@ -0,0 +1,4 @@
|
|||||||
|
/// <reference types="node" />
|
||||||
|
import * as url from 'url';
|
||||||
|
export declare function getProxyUrl(reqUrl: url.Url): url.Url | undefined;
|
||||||
|
export declare function checkBypass(reqUrl: url.Url): boolean;
|
||||||
+57
@@ -0,0 +1,57 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const url = require("url");
|
||||||
|
function getProxyUrl(reqUrl) {
|
||||||
|
let usingSsl = reqUrl.protocol === 'https:';
|
||||||
|
let proxyUrl;
|
||||||
|
if (checkBypass(reqUrl)) {
|
||||||
|
return proxyUrl;
|
||||||
|
}
|
||||||
|
let proxyVar;
|
||||||
|
if (usingSsl) {
|
||||||
|
proxyVar = process.env["https_proxy"] ||
|
||||||
|
process.env["HTTPS_PROXY"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
proxyVar = process.env["http_proxy"] ||
|
||||||
|
process.env["HTTP_PROXY"];
|
||||||
|
}
|
||||||
|
if (proxyVar) {
|
||||||
|
proxyUrl = url.parse(proxyVar);
|
||||||
|
}
|
||||||
|
return proxyUrl;
|
||||||
|
}
|
||||||
|
exports.getProxyUrl = getProxyUrl;
|
||||||
|
function checkBypass(reqUrl) {
|
||||||
|
if (!reqUrl.hostname) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
|
||||||
|
if (!noProxy) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// Determine the request port
|
||||||
|
let reqPort;
|
||||||
|
if (reqUrl.port) {
|
||||||
|
reqPort = Number(reqUrl.port);
|
||||||
|
}
|
||||||
|
else if (reqUrl.protocol === 'http:') {
|
||||||
|
reqPort = 80;
|
||||||
|
}
|
||||||
|
else if (reqUrl.protocol === 'https:') {
|
||||||
|
reqPort = 443;
|
||||||
|
}
|
||||||
|
// Format the request hostname and hostname with port
|
||||||
|
let upperReqHosts = [reqUrl.hostname.toUpperCase()];
|
||||||
|
if (typeof reqPort === 'number') {
|
||||||
|
upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
|
||||||
|
}
|
||||||
|
// Compare request host against noproxy
|
||||||
|
for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
|
||||||
|
if (upperReqHosts.some(x => x === upperNoProxyItem)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
exports.checkBypass = checkBypass;
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
Copyright 2019 GitHub
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
+16
-42
@@ -1,36 +1,16 @@
|
|||||||
{
|
{
|
||||||
"_from": "@actions/io",
|
|
||||||
"_id": "@actions/io@1.0.1",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-rhq+tfZukbtaus7xyUtwKfuiCRXd1hWSfmJNEpFgBQJ4woqPEpsBw04awicjwz9tyG2/MVhAEMfVn664Cri5zA==",
|
|
||||||
"_location": "/@actions/io",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@actions/io",
|
|
||||||
"name": "@actions/io",
|
"name": "@actions/io",
|
||||||
"escapedName": "@actions%2fio",
|
"version": "1.0.2",
|
||||||
"scope": "@actions",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/",
|
|
||||||
"/@actions/tool-cache"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.1.tgz",
|
|
||||||
"_shasum": "81a9418fe2bbdef2d2717a8e9f85188b9c565aca",
|
|
||||||
"_spec": "@actions/io",
|
|
||||||
"_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Actions io lib",
|
"description": "Actions io lib",
|
||||||
|
"keywords": [
|
||||||
|
"github",
|
||||||
|
"actions",
|
||||||
|
"io"
|
||||||
|
],
|
||||||
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/io",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/io.js",
|
||||||
|
"types": "lib/io.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -38,26 +18,20 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"lib"
|
"lib"
|
||||||
],
|
],
|
||||||
"gitHead": "a2ab4bcf78e4f7080f0d45856e6eeba16f0bbc52",
|
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/io",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"io"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/io.js",
|
|
||||||
"name": "@actions/io",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/toolkit.git"
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/io"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc"
|
"tsc": "tsc"
|
||||||
},
|
},
|
||||||
"version": "1.0.1"
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -22,11 +22,11 @@ These can then be extracted in platform specific ways:
|
|||||||
const tc = require('@actions/tool-cache');
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
if (process.platform === 'win32') {
|
if (process.platform === 'win32') {
|
||||||
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
|
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.zip');
|
||||||
const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to');
|
const node12ExtractedFolder = await tc.extractZip(node12Path, 'path/to/extract/to');
|
||||||
|
|
||||||
// Or alternately
|
// Or alternately
|
||||||
const node12Path = tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
|
const node12Path = await tc.downloadTool('https://nodejs.org/dist/v12.7.0/node-v12.7.0-win-x64.7z');
|
||||||
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
|
const node12ExtractedFolder = await tc.extract7z(node12Path, 'path/to/extract/to');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -37,7 +37,7 @@ else {
|
|||||||
|
|
||||||
#### Cache
|
#### Cache
|
||||||
|
|
||||||
Finally, you can cache these directories in our tool-cache. This is useful if you want to switch back and forth between versions of a tool, or save a tool between runs for private runners (private runners are still in development but are on the roadmap).
|
Finally, you can cache these directories in our tool-cache. This is useful if you want to switch back and forth between versions of a tool, or save a tool between runs for self-hosted runners.
|
||||||
|
|
||||||
You'll often want to add it to the path as part of this step:
|
You'll often want to add it to the path as part of this step:
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ You can also cache files for reuse.
|
|||||||
```js
|
```js
|
||||||
const tc = require('@actions/tool-cache');
|
const tc = require('@actions/tool-cache');
|
||||||
|
|
||||||
tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0');
|
const cachedPath = await tc.cacheFile('path/to/exe', 'destFileName.exe', 'myExeName', '1.1.0');
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Find
|
#### Find
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
/**
|
||||||
|
* Internal class for retries
|
||||||
|
*/
|
||||||
|
export declare class RetryHelper {
|
||||||
|
private maxAttempts;
|
||||||
|
private minSeconds;
|
||||||
|
private maxSeconds;
|
||||||
|
constructor(maxAttempts: number, minSeconds: number, maxSeconds: number);
|
||||||
|
execute<T>(action: () => Promise<T>, isRetryable?: (e: Error) => boolean): Promise<T>;
|
||||||
|
private getSleepAmount;
|
||||||
|
private sleep;
|
||||||
|
}
|
||||||
+70
@@ -0,0 +1,70 @@
|
|||||||
|
"use strict";
|
||||||
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||||
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
||||||
|
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) : adopt(result.value).then(fulfilled, rejected); }
|
||||||
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (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;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const core = __importStar(require("@actions/core"));
|
||||||
|
/**
|
||||||
|
* Internal class for retries
|
||||||
|
*/
|
||||||
|
class RetryHelper {
|
||||||
|
constructor(maxAttempts, minSeconds, maxSeconds) {
|
||||||
|
if (maxAttempts < 1) {
|
||||||
|
throw new Error('max attempts should be greater than or equal to 1');
|
||||||
|
}
|
||||||
|
this.maxAttempts = maxAttempts;
|
||||||
|
this.minSeconds = Math.floor(minSeconds);
|
||||||
|
this.maxSeconds = Math.floor(maxSeconds);
|
||||||
|
if (this.minSeconds > this.maxSeconds) {
|
||||||
|
throw new Error('min seconds should be less than or equal to max seconds');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
execute(action, isRetryable) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
let attempt = 1;
|
||||||
|
while (attempt < this.maxAttempts) {
|
||||||
|
// Try
|
||||||
|
try {
|
||||||
|
return yield action();
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
if (isRetryable && !isRetryable(err)) {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
core.info(err.message);
|
||||||
|
}
|
||||||
|
// Sleep
|
||||||
|
const seconds = this.getSleepAmount();
|
||||||
|
core.info(`Waiting ${seconds} seconds before trying again`);
|
||||||
|
yield this.sleep(seconds);
|
||||||
|
attempt++;
|
||||||
|
}
|
||||||
|
// Last attempt
|
||||||
|
return yield action();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
getSleepAmount() {
|
||||||
|
return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
|
||||||
|
this.minSeconds);
|
||||||
|
}
|
||||||
|
sleep(seconds) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return new Promise(resolve => setTimeout(resolve, seconds * 1000));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.RetryHelper = RetryHelper;
|
||||||
|
//# sourceMappingURL=retry-helper.js.map
|
||||||
+1
@@ -0,0 +1 @@
|
|||||||
|
{"version":3,"file":"retry-helper.js","sourceRoot":"","sources":["../src/retry-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,oDAAqC;AAErC;;GAEG;AACH,MAAa,WAAW;IAKtB,YAAY,WAAmB,EAAE,UAAkB,EAAE,UAAkB;QACrE,IAAI,WAAW,GAAG,CAAC,EAAE;YACnB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAA;SACrE;QAED,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;QAC9B,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACxC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAA;QACxC,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE;YACrC,MAAM,IAAI,KAAK,CAAC,yDAAyD,CAAC,CAAA;SAC3E;IACH,CAAC;IAEK,OAAO,CACX,MAAwB,EACxB,WAAmC;;YAEnC,IAAI,OAAO,GAAG,CAAC,CAAA;YACf,OAAO,OAAO,GAAG,IAAI,CAAC,WAAW,EAAE;gBACjC,MAAM;gBACN,IAAI;oBACF,OAAO,MAAM,MAAM,EAAE,CAAA;iBACtB;gBAAC,OAAO,GAAG,EAAE;oBACZ,IAAI,WAAW,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE;wBACpC,MAAM,GAAG,CAAA;qBACV;oBAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;iBACvB;gBAED,QAAQ;gBACR,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;gBACrC,IAAI,CAAC,IAAI,CAAC,WAAW,OAAO,8BAA8B,CAAC,CAAA;gBAC3D,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;gBACzB,OAAO,EAAE,CAAA;aACV;YAED,eAAe;YACf,OAAO,MAAM,MAAM,EAAE,CAAA;QACvB,CAAC;KAAA;IAEO,cAAc;QACpB,OAAO,CACL,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAChB,CAAA;IACH,CAAC;IAEa,KAAK,CAAC,OAAe;;YACjC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC,CAAC,CAAA;QACpE,CAAC;KAAA;CACF;AAxDD,kCAwDC"}
|
||||||
+4
-3
@@ -6,9 +6,10 @@ export declare class HTTPError extends Error {
|
|||||||
* Download a tool from an url and stream it into a file
|
* Download a tool from an url and stream it into a file
|
||||||
*
|
*
|
||||||
* @param url url of tool to download
|
* @param url url of tool to download
|
||||||
|
* @param dest path to download tool
|
||||||
* @returns path to downloaded tool
|
* @returns path to downloaded tool
|
||||||
*/
|
*/
|
||||||
export declare function downloadTool(url: string): Promise<string>;
|
export declare function downloadTool(url: string, dest?: string): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Extract a .7z file
|
* Extract a .7z file
|
||||||
*
|
*
|
||||||
@@ -26,11 +27,11 @@ export declare function downloadTool(url: string): Promise<string>;
|
|||||||
*/
|
*/
|
||||||
export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>;
|
export declare function extract7z(file: string, dest?: string, _7zPath?: string): Promise<string>;
|
||||||
/**
|
/**
|
||||||
* Extract a tar
|
* Extract a compressed tar archive
|
||||||
*
|
*
|
||||||
* @param file path to the tar
|
* @param file path to the tar
|
||||||
* @param dest destination directory. Optional.
|
* @param dest destination directory. Optional.
|
||||||
* @param flags flags for the tar. Optional.
|
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
|
||||||
* @returns path to the destination directory
|
* @returns path to the destination directory
|
||||||
*/
|
*/
|
||||||
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>;
|
export declare function extractTar(file: string, dest?: string, flags?: string): Promise<string>;
|
||||||
|
|||||||
+137
-75
@@ -8,17 +8,30 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|||||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
var __importStar = (this && this.__importStar) || function (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;
|
||||||
|
};
|
||||||
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||||
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||||
|
};
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const core = require("@actions/core");
|
const core = __importStar(require("@actions/core"));
|
||||||
const io = require("@actions/io");
|
const io = __importStar(require("@actions/io"));
|
||||||
const fs = require("fs");
|
const fs = __importStar(require("fs"));
|
||||||
const os = require("os");
|
const os = __importStar(require("os"));
|
||||||
const path = require("path");
|
const path = __importStar(require("path"));
|
||||||
const httpm = require("typed-rest-client/HttpClient");
|
const httpm = __importStar(require("@actions/http-client"));
|
||||||
const semver = require("semver");
|
const semver = __importStar(require("semver"));
|
||||||
const uuidV4 = require("uuid/v4");
|
const stream = __importStar(require("stream"));
|
||||||
|
const util = __importStar(require("util"));
|
||||||
|
const v4_1 = __importDefault(require("uuid/v4"));
|
||||||
const exec_1 = require("@actions/exec/lib/exec");
|
const exec_1 = require("@actions/exec/lib/exec");
|
||||||
const assert_1 = require("assert");
|
const assert_1 = require("assert");
|
||||||
|
const retry_helper_1 = require("./retry-helper");
|
||||||
class HTTPError extends Error {
|
class HTTPError extends Error {
|
||||||
constructor(httpStatusCode) {
|
constructor(httpStatusCode) {
|
||||||
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
super(`Unexpected HTTP response: ${httpStatusCode}`);
|
||||||
@@ -29,85 +42,80 @@ class HTTPError extends Error {
|
|||||||
exports.HTTPError = HTTPError;
|
exports.HTTPError = HTTPError;
|
||||||
const IS_WINDOWS = process.platform === 'win32';
|
const IS_WINDOWS = process.platform === 'win32';
|
||||||
const userAgent = 'actions/tool-cache';
|
const userAgent = 'actions/tool-cache';
|
||||||
// On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
|
|
||||||
let tempDirectory = process.env['RUNNER_TEMP'] || '';
|
|
||||||
let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
|
|
||||||
// If directories not found, place them in common temp locations
|
|
||||||
if (!tempDirectory || !cacheRoot) {
|
|
||||||
let baseLocation;
|
|
||||||
if (IS_WINDOWS) {
|
|
||||||
// On windows use the USERPROFILE env variable
|
|
||||||
baseLocation = process.env['USERPROFILE'] || 'C:\\';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (process.platform === 'darwin') {
|
|
||||||
baseLocation = '/Users';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
baseLocation = '/home';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!tempDirectory) {
|
|
||||||
tempDirectory = path.join(baseLocation, 'actions', 'temp');
|
|
||||||
}
|
|
||||||
if (!cacheRoot) {
|
|
||||||
cacheRoot = path.join(baseLocation, 'actions', 'cache');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* Download a tool from an url and stream it into a file
|
* Download a tool from an url and stream it into a file
|
||||||
*
|
*
|
||||||
* @param url url of tool to download
|
* @param url url of tool to download
|
||||||
|
* @param dest path to download tool
|
||||||
* @returns path to downloaded tool
|
* @returns path to downloaded tool
|
||||||
*/
|
*/
|
||||||
function downloadTool(url) {
|
function downloadTool(url, dest) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
// Wrap in a promise so that we can resolve from within stream callbacks
|
dest = dest || path.join(_getTempDirectory(), v4_1.default());
|
||||||
return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
yield io.mkdirP(path.dirname(dest));
|
||||||
try {
|
|
||||||
const http = new httpm.HttpClient(userAgent, [], {
|
|
||||||
allowRetries: true,
|
|
||||||
maxRetries: 3
|
|
||||||
});
|
|
||||||
const destPath = path.join(tempDirectory, uuidV4());
|
|
||||||
yield io.mkdirP(tempDirectory);
|
|
||||||
core.debug(`Downloading ${url}`);
|
core.debug(`Downloading ${url}`);
|
||||||
core.debug(`Downloading ${destPath}`);
|
core.debug(`Destination ${dest}`);
|
||||||
if (fs.existsSync(destPath)) {
|
const maxAttempts = 3;
|
||||||
throw new Error(`Destination file path ${destPath} already exists`);
|
const minSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MIN_SECONDS', 10);
|
||||||
|
const maxSeconds = _getGlobal('TEST_DOWNLOAD_TOOL_RETRY_MAX_SECONDS', 20);
|
||||||
|
const retryHelper = new retry_helper_1.RetryHelper(maxAttempts, minSeconds, maxSeconds);
|
||||||
|
return yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
|
||||||
|
return yield downloadToolAttempt(url, dest || '');
|
||||||
|
}), (err) => {
|
||||||
|
if (err instanceof HTTPError && err.httpStatusCode) {
|
||||||
|
// Don't retry anything less than 500, except 408 Request Timeout and 429 Too Many Requests
|
||||||
|
if (err.httpStatusCode < 500 &&
|
||||||
|
err.httpStatusCode !== 408 &&
|
||||||
|
err.httpStatusCode !== 429) {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// Otherwise retry
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.downloadTool = downloadTool;
|
||||||
|
function downloadToolAttempt(url, dest) {
|
||||||
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
|
if (fs.existsSync(dest)) {
|
||||||
|
throw new Error(`Destination file path ${dest} already exists`);
|
||||||
|
}
|
||||||
|
// Get the response headers
|
||||||
|
const http = new httpm.HttpClient(userAgent, [], {
|
||||||
|
allowRetries: false
|
||||||
|
});
|
||||||
const response = yield http.get(url);
|
const response = yield http.get(url);
|
||||||
if (response.message.statusCode !== 200) {
|
if (response.message.statusCode !== 200) {
|
||||||
const err = new HTTPError(response.message.statusCode);
|
const err = new HTTPError(response.message.statusCode);
|
||||||
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
const file = fs.createWriteStream(destPath);
|
// Download the response body
|
||||||
file.on('open', () => __awaiter(this, void 0, void 0, function* () {
|
const pipeline = util.promisify(stream.pipeline);
|
||||||
|
const responseMessageFactory = _getGlobal('TEST_DOWNLOAD_TOOL_RESPONSE_MESSAGE_FACTORY', () => response.message);
|
||||||
|
const readStream = responseMessageFactory();
|
||||||
|
let succeeded = false;
|
||||||
try {
|
try {
|
||||||
const stream = response.message.pipe(file);
|
yield pipeline(readStream, fs.createWriteStream(dest));
|
||||||
stream.on('close', () => {
|
|
||||||
core.debug('download complete');
|
core.debug('download complete');
|
||||||
resolve(destPath);
|
succeeded = true;
|
||||||
});
|
return dest;
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
// Error, delete dest before retry
|
||||||
|
if (!succeeded) {
|
||||||
|
core.debug('download failed');
|
||||||
|
try {
|
||||||
|
yield io.rmRF(dest);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
|
core.debug(`Failed to delete '${dest}'. ${err.message}`);
|
||||||
reject(err);
|
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
file.on('error', err => {
|
|
||||||
file.end();
|
|
||||||
reject(err);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
catch (err) {
|
|
||||||
reject(err);
|
|
||||||
}
|
}
|
||||||
}));
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
exports.downloadTool = downloadTool;
|
|
||||||
/**
|
/**
|
||||||
* Extract a .7z file
|
* Extract a .7z file
|
||||||
*
|
*
|
||||||
@@ -127,7 +135,7 @@ function extract7z(file, dest, _7zPath) {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
|
assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
|
||||||
assert_1.ok(file, 'parameter "file" is required');
|
assert_1.ok(file, 'parameter "file" is required');
|
||||||
dest = dest || (yield _createExtractFolder(dest));
|
dest = yield _createExtractFolder(dest);
|
||||||
const originalCwd = process.cwd();
|
const originalCwd = process.cwd();
|
||||||
process.chdir(dest);
|
process.chdir(dest);
|
||||||
if (_7zPath) {
|
if (_7zPath) {
|
||||||
@@ -182,11 +190,11 @@ function extract7z(file, dest, _7zPath) {
|
|||||||
}
|
}
|
||||||
exports.extract7z = extract7z;
|
exports.extract7z = extract7z;
|
||||||
/**
|
/**
|
||||||
* Extract a tar
|
* Extract a compressed tar archive
|
||||||
*
|
*
|
||||||
* @param file path to the tar
|
* @param file path to the tar
|
||||||
* @param dest destination directory. Optional.
|
* @param dest destination directory. Optional.
|
||||||
* @param flags flags for the tar. Optional.
|
* @param flags flags for the tar command to use for extraction. Defaults to 'xz' (extracting gzipped tars). Optional.
|
||||||
* @returns path to the destination directory
|
* @returns path to the destination directory
|
||||||
*/
|
*/
|
||||||
function extractTar(file, dest, flags = 'xz') {
|
function extractTar(file, dest, flags = 'xz') {
|
||||||
@@ -194,9 +202,38 @@ function extractTar(file, dest, flags = 'xz') {
|
|||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error("parameter 'file' is required");
|
throw new Error("parameter 'file' is required");
|
||||||
}
|
}
|
||||||
dest = dest || (yield _createExtractFolder(dest));
|
// Create dest
|
||||||
const tarPath = yield io.which('tar', true);
|
dest = yield _createExtractFolder(dest);
|
||||||
yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
|
// Determine whether GNU tar
|
||||||
|
core.debug('Checking tar --version');
|
||||||
|
let versionOutput = '';
|
||||||
|
yield exec_1.exec('tar --version', [], {
|
||||||
|
ignoreReturnCode: true,
|
||||||
|
silent: true,
|
||||||
|
listeners: {
|
||||||
|
stdout: (data) => (versionOutput += data.toString()),
|
||||||
|
stderr: (data) => (versionOutput += data.toString())
|
||||||
|
}
|
||||||
|
});
|
||||||
|
core.debug(versionOutput.trim());
|
||||||
|
const isGnuTar = versionOutput.toUpperCase().includes('GNU TAR');
|
||||||
|
// Initialize args
|
||||||
|
const args = [flags];
|
||||||
|
let destArg = dest;
|
||||||
|
let fileArg = file;
|
||||||
|
if (IS_WINDOWS && isGnuTar) {
|
||||||
|
args.push('--force-local');
|
||||||
|
destArg = dest.replace(/\\/g, '/');
|
||||||
|
// Technically only the dest needs to have `/` but for aesthetic consistency
|
||||||
|
// convert slashes in the file arg too.
|
||||||
|
fileArg = file.replace(/\\/g, '/');
|
||||||
|
}
|
||||||
|
if (isGnuTar) {
|
||||||
|
// Suppress warnings when using GNU tar to extract archives created by BSD tar
|
||||||
|
args.push('--warning=no-unknown-keyword');
|
||||||
|
}
|
||||||
|
args.push('-C', destArg, '-f', fileArg);
|
||||||
|
yield exec_1.exec(`tar`, args);
|
||||||
return dest;
|
return dest;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -213,7 +250,7 @@ function extractZip(file, dest) {
|
|||||||
if (!file) {
|
if (!file) {
|
||||||
throw new Error("parameter 'file' is required");
|
throw new Error("parameter 'file' is required");
|
||||||
}
|
}
|
||||||
dest = dest || (yield _createExtractFolder(dest));
|
dest = yield _createExtractFolder(dest);
|
||||||
if (IS_WINDOWS) {
|
if (IS_WINDOWS) {
|
||||||
yield extractZipWin(file, dest);
|
yield extractZipWin(file, dest);
|
||||||
}
|
}
|
||||||
@@ -339,7 +376,7 @@ function find(toolName, versionSpec, arch) {
|
|||||||
let toolPath = '';
|
let toolPath = '';
|
||||||
if (versionSpec) {
|
if (versionSpec) {
|
||||||
versionSpec = semver.clean(versionSpec) || '';
|
versionSpec = semver.clean(versionSpec) || '';
|
||||||
const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
|
const cachePath = path.join(_getCacheDirectory(), toolName, versionSpec, arch);
|
||||||
core.debug(`checking cache: ${cachePath}`);
|
core.debug(`checking cache: ${cachePath}`);
|
||||||
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
|
if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
|
||||||
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
|
core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
|
||||||
@@ -361,7 +398,7 @@ exports.find = find;
|
|||||||
function findAllVersions(toolName, arch) {
|
function findAllVersions(toolName, arch) {
|
||||||
const versions = [];
|
const versions = [];
|
||||||
arch = arch || os.arch();
|
arch = arch || os.arch();
|
||||||
const toolPath = path.join(cacheRoot, toolName);
|
const toolPath = path.join(_getCacheDirectory(), toolName);
|
||||||
if (fs.existsSync(toolPath)) {
|
if (fs.existsSync(toolPath)) {
|
||||||
const children = fs.readdirSync(toolPath);
|
const children = fs.readdirSync(toolPath);
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
@@ -380,7 +417,7 @@ function _createExtractFolder(dest) {
|
|||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
if (!dest) {
|
if (!dest) {
|
||||||
// create a temp dir
|
// create a temp dir
|
||||||
dest = path.join(tempDirectory, uuidV4());
|
dest = path.join(_getTempDirectory(), v4_1.default());
|
||||||
}
|
}
|
||||||
yield io.mkdirP(dest);
|
yield io.mkdirP(dest);
|
||||||
return dest;
|
return dest;
|
||||||
@@ -388,7 +425,7 @@ function _createExtractFolder(dest) {
|
|||||||
}
|
}
|
||||||
function _createToolPath(tool, version, arch) {
|
function _createToolPath(tool, version, arch) {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
|
||||||
core.debug(`destination ${folderPath}`);
|
core.debug(`destination ${folderPath}`);
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
yield io.rmRF(folderPath);
|
yield io.rmRF(folderPath);
|
||||||
@@ -398,7 +435,7 @@ function _createToolPath(tool, version, arch) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
function _completeToolPath(tool, version, arch) {
|
function _completeToolPath(tool, version, arch) {
|
||||||
const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
|
const folderPath = path.join(_getCacheDirectory(), tool, semver.clean(version) || version, arch || '');
|
||||||
const markerPath = `${folderPath}.complete`;
|
const markerPath = `${folderPath}.complete`;
|
||||||
fs.writeFileSync(markerPath, '');
|
fs.writeFileSync(markerPath, '');
|
||||||
core.debug('finished caching tool');
|
core.debug('finished caching tool');
|
||||||
@@ -435,4 +472,29 @@ function _evaluateVersions(versions, versionSpec) {
|
|||||||
}
|
}
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Gets RUNNER_TOOL_CACHE
|
||||||
|
*/
|
||||||
|
function _getCacheDirectory() {
|
||||||
|
const cacheDirectory = process.env['RUNNER_TOOL_CACHE'] || '';
|
||||||
|
assert_1.ok(cacheDirectory, 'Expected RUNNER_TOOL_CACHE to be defined');
|
||||||
|
return cacheDirectory;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets RUNNER_TEMP
|
||||||
|
*/
|
||||||
|
function _getTempDirectory() {
|
||||||
|
const tempDirectory = process.env['RUNNER_TEMP'] || '';
|
||||||
|
assert_1.ok(tempDirectory, 'Expected RUNNER_TEMP to be defined');
|
||||||
|
return tempDirectory;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* Gets a global variable
|
||||||
|
*/
|
||||||
|
function _getGlobal(key, defaultValue) {
|
||||||
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
|
const value = global[key];
|
||||||
|
/* eslint-enable @typescript-eslint/no-explicit-any */
|
||||||
|
return value !== undefined ? value : defaultValue;
|
||||||
|
}
|
||||||
//# sourceMappingURL=tool-cache.js.map
|
//# sourceMappingURL=tool-cache.js.map
|
||||||
+1
-1
File diff suppressed because one or more lines are too long
+70
@@ -0,0 +1,70 @@
|
|||||||
|
# changes log
|
||||||
|
|
||||||
|
## 6.2.0
|
||||||
|
|
||||||
|
* Coerce numbers to strings when passed to semver.coerce()
|
||||||
|
* Add `rtl` option to coerce from right to left
|
||||||
|
|
||||||
|
## 6.1.3
|
||||||
|
|
||||||
|
* Handle X-ranges properly in includePrerelease mode
|
||||||
|
|
||||||
|
## 6.1.2
|
||||||
|
|
||||||
|
* Do not throw when testing invalid version strings
|
||||||
|
|
||||||
|
## 6.1.1
|
||||||
|
|
||||||
|
* Add options support for semver.coerce()
|
||||||
|
* Handle undefined version passed to Range.test
|
||||||
|
|
||||||
|
## 6.1.0
|
||||||
|
|
||||||
|
* Add semver.compareBuild function
|
||||||
|
* Support `*` in semver.intersects
|
||||||
|
|
||||||
|
## 6.0
|
||||||
|
|
||||||
|
* Fix `intersects` logic.
|
||||||
|
|
||||||
|
This is technically a bug fix, but since it is also a change to behavior
|
||||||
|
that may require users updating their code, it is marked as a major
|
||||||
|
version increment.
|
||||||
|
|
||||||
|
## 5.7
|
||||||
|
|
||||||
|
* Add `minVersion` method
|
||||||
|
|
||||||
|
## 5.6
|
||||||
|
|
||||||
|
* Move boolean `loose` param to an options object, with
|
||||||
|
backwards-compatibility protection.
|
||||||
|
* Add ability to opt out of special prerelease version handling with
|
||||||
|
the `includePrerelease` option flag.
|
||||||
|
|
||||||
|
## 5.5
|
||||||
|
|
||||||
|
* Add version coercion capabilities
|
||||||
|
|
||||||
|
## 5.4
|
||||||
|
|
||||||
|
* Add intersection checking
|
||||||
|
|
||||||
|
## 5.3
|
||||||
|
|
||||||
|
* Add `minSatisfying` method
|
||||||
|
|
||||||
|
## 5.2
|
||||||
|
|
||||||
|
* Add `prerelease(v)` that returns prerelease components
|
||||||
|
|
||||||
|
## 5.1
|
||||||
|
|
||||||
|
* Add Backus-Naur for ranges
|
||||||
|
* Remove excessively cute inspection methods
|
||||||
|
|
||||||
|
## 5.0
|
||||||
|
|
||||||
|
* Remove AMD/Browserified build artifacts
|
||||||
|
* Fix ltr and gtr when using the `*` range
|
||||||
|
* Fix for range `*` with a prerelease identifier
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
The ISC License
|
||||||
|
|
||||||
|
Copyright (c) Isaac Z. Schlueter and Contributors
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
+443
@@ -0,0 +1,443 @@
|
|||||||
|
semver(1) -- The semantic versioner for npm
|
||||||
|
===========================================
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install semver
|
||||||
|
````
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
As a node module:
|
||||||
|
|
||||||
|
```js
|
||||||
|
const semver = require('semver')
|
||||||
|
|
||||||
|
semver.valid('1.2.3') // '1.2.3'
|
||||||
|
semver.valid('a.b.c') // null
|
||||||
|
semver.clean(' =v1.2.3 ') // '1.2.3'
|
||||||
|
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
|
||||||
|
semver.gt('1.2.3', '9.8.7') // false
|
||||||
|
semver.lt('1.2.3', '9.8.7') // true
|
||||||
|
semver.minVersion('>=1.0.0') // '1.0.0'
|
||||||
|
semver.valid(semver.coerce('v2')) // '2.0.0'
|
||||||
|
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||||
|
```
|
||||||
|
|
||||||
|
As a command-line utility:
|
||||||
|
|
||||||
|
```
|
||||||
|
$ semver -h
|
||||||
|
|
||||||
|
A JavaScript implementation of the https://semver.org/ specification
|
||||||
|
Copyright Isaac Z. Schlueter
|
||||||
|
|
||||||
|
Usage: semver [options] <version> [<version> [...]]
|
||||||
|
Prints valid versions sorted by SemVer precedence
|
||||||
|
|
||||||
|
Options:
|
||||||
|
-r --range <range>
|
||||||
|
Print versions that match the specified range.
|
||||||
|
|
||||||
|
-i --increment [<level>]
|
||||||
|
Increment a version by the specified level. Level can
|
||||||
|
be one of: major, minor, patch, premajor, preminor,
|
||||||
|
prepatch, or prerelease. Default level is 'patch'.
|
||||||
|
Only one version may be specified.
|
||||||
|
|
||||||
|
--preid <identifier>
|
||||||
|
Identifier to be used to prefix premajor, preminor,
|
||||||
|
prepatch or prerelease version increments.
|
||||||
|
|
||||||
|
-l --loose
|
||||||
|
Interpret versions and ranges loosely
|
||||||
|
|
||||||
|
-p --include-prerelease
|
||||||
|
Always include prerelease versions in range matching
|
||||||
|
|
||||||
|
-c --coerce
|
||||||
|
Coerce a string into SemVer if possible
|
||||||
|
(does not imply --loose)
|
||||||
|
|
||||||
|
--rtl
|
||||||
|
Coerce version strings right to left
|
||||||
|
|
||||||
|
--ltr
|
||||||
|
Coerce version strings left to right (default)
|
||||||
|
|
||||||
|
Program exits successfully if any valid version satisfies
|
||||||
|
all supplied ranges, and prints all satisfying versions.
|
||||||
|
|
||||||
|
If no satisfying versions are found, then exits failure.
|
||||||
|
|
||||||
|
Versions are printed in ascending order, so supplying
|
||||||
|
multiple versions to the utility will just sort them.
|
||||||
|
```
|
||||||
|
|
||||||
|
## Versions
|
||||||
|
|
||||||
|
A "version" is described by the `v2.0.0` specification found at
|
||||||
|
<https://semver.org/>.
|
||||||
|
|
||||||
|
A leading `"="` or `"v"` character is stripped off and ignored.
|
||||||
|
|
||||||
|
## Ranges
|
||||||
|
|
||||||
|
A `version range` is a set of `comparators` which specify versions
|
||||||
|
that satisfy the range.
|
||||||
|
|
||||||
|
A `comparator` is composed of an `operator` and a `version`. The set
|
||||||
|
of primitive `operators` is:
|
||||||
|
|
||||||
|
* `<` Less than
|
||||||
|
* `<=` Less than or equal to
|
||||||
|
* `>` Greater than
|
||||||
|
* `>=` Greater than or equal to
|
||||||
|
* `=` Equal. If no operator is specified, then equality is assumed,
|
||||||
|
so this operator is optional, but MAY be included.
|
||||||
|
|
||||||
|
For example, the comparator `>=1.2.7` would match the versions
|
||||||
|
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
|
||||||
|
or `1.1.0`.
|
||||||
|
|
||||||
|
Comparators can be joined by whitespace to form a `comparator set`,
|
||||||
|
which is satisfied by the **intersection** of all of the comparators
|
||||||
|
it includes.
|
||||||
|
|
||||||
|
A range is composed of one or more comparator sets, joined by `||`. A
|
||||||
|
version matches a range if and only if every comparator in at least
|
||||||
|
one of the `||`-separated comparator sets is satisfied by the version.
|
||||||
|
|
||||||
|
For example, the range `>=1.2.7 <1.3.0` would match the versions
|
||||||
|
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
|
||||||
|
or `1.1.0`.
|
||||||
|
|
||||||
|
The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
|
||||||
|
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.
|
||||||
|
|
||||||
|
### Prerelease Tags
|
||||||
|
|
||||||
|
If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
|
||||||
|
it will only be allowed to satisfy comparator sets if at least one
|
||||||
|
comparator with the same `[major, minor, patch]` tuple also has a
|
||||||
|
prerelease tag.
|
||||||
|
|
||||||
|
For example, the range `>1.2.3-alpha.3` would be allowed to match the
|
||||||
|
version `1.2.3-alpha.7`, but it would *not* be satisfied by
|
||||||
|
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
|
||||||
|
than" `1.2.3-alpha.3` according to the SemVer sort rules. The version
|
||||||
|
range only accepts prerelease tags on the `1.2.3` version. The
|
||||||
|
version `3.4.5` *would* satisfy the range, because it does not have a
|
||||||
|
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.
|
||||||
|
|
||||||
|
The purpose for this behavior is twofold. First, prerelease versions
|
||||||
|
frequently are updated very quickly, and contain many breaking changes
|
||||||
|
that are (by the author's design) not yet fit for public consumption.
|
||||||
|
Therefore, by default, they are excluded from range matching
|
||||||
|
semantics.
|
||||||
|
|
||||||
|
Second, a user who has opted into using a prerelease version has
|
||||||
|
clearly indicated the intent to use *that specific* set of
|
||||||
|
alpha/beta/rc versions. By including a prerelease tag in the range,
|
||||||
|
the user is indicating that they are aware of the risk. However, it
|
||||||
|
is still not appropriate to assume that they have opted into taking a
|
||||||
|
similar risk on the *next* set of prerelease versions.
|
||||||
|
|
||||||
|
Note that this behavior can be suppressed (treating all prerelease
|
||||||
|
versions as if they were normal versions, for the purpose of range
|
||||||
|
matching) by setting the `includePrerelease` flag on the options
|
||||||
|
object to any
|
||||||
|
[functions](https://github.com/npm/node-semver#functions) that do
|
||||||
|
range matching.
|
||||||
|
|
||||||
|
#### Prerelease Identifiers
|
||||||
|
|
||||||
|
The method `.inc` takes an additional `identifier` string argument that
|
||||||
|
will append the value of the string as a prerelease identifier:
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
semver.inc('1.2.3', 'prerelease', 'beta')
|
||||||
|
// '1.2.4-beta.0'
|
||||||
|
```
|
||||||
|
|
||||||
|
command-line example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ semver 1.2.3 -i prerelease --preid beta
|
||||||
|
1.2.4-beta.0
|
||||||
|
```
|
||||||
|
|
||||||
|
Which then can be used to increment further:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ semver 1.2.4-beta.0 -i prerelease
|
||||||
|
1.2.4-beta.1
|
||||||
|
```
|
||||||
|
|
||||||
|
### Advanced Range Syntax
|
||||||
|
|
||||||
|
Advanced range syntax desugars to primitive comparators in
|
||||||
|
deterministic ways.
|
||||||
|
|
||||||
|
Advanced ranges may be combined in the same way as primitive
|
||||||
|
comparators using white space or `||`.
|
||||||
|
|
||||||
|
#### Hyphen Ranges `X.Y.Z - A.B.C`
|
||||||
|
|
||||||
|
Specifies an inclusive set.
|
||||||
|
|
||||||
|
* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`
|
||||||
|
|
||||||
|
If a partial version is provided as the first version in the inclusive
|
||||||
|
range, then the missing pieces are replaced with zeroes.
|
||||||
|
|
||||||
|
* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`
|
||||||
|
|
||||||
|
If a partial version is provided as the second version in the
|
||||||
|
inclusive range, then all versions that start with the supplied parts
|
||||||
|
of the tuple are accepted, but nothing that would be greater than the
|
||||||
|
provided tuple parts.
|
||||||
|
|
||||||
|
* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0`
|
||||||
|
* `1.2.3 - 2` := `>=1.2.3 <3.0.0`
|
||||||
|
|
||||||
|
#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`
|
||||||
|
|
||||||
|
Any of `X`, `x`, or `*` may be used to "stand in" for one of the
|
||||||
|
numeric values in the `[major, minor, patch]` tuple.
|
||||||
|
|
||||||
|
* `*` := `>=0.0.0` (Any version satisfies)
|
||||||
|
* `1.x` := `>=1.0.0 <2.0.0` (Matching major version)
|
||||||
|
* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions)
|
||||||
|
|
||||||
|
A partial version range is treated as an X-Range, so the special
|
||||||
|
character is in fact optional.
|
||||||
|
|
||||||
|
* `""` (empty string) := `*` := `>=0.0.0`
|
||||||
|
* `1` := `1.x.x` := `>=1.0.0 <2.0.0`
|
||||||
|
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0`
|
||||||
|
|
||||||
|
#### Tilde Ranges `~1.2.3` `~1.2` `~1`
|
||||||
|
|
||||||
|
Allows patch-level changes if a minor version is specified on the
|
||||||
|
comparator. Allows minor-level changes if not.
|
||||||
|
|
||||||
|
* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0`
|
||||||
|
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`)
|
||||||
|
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`)
|
||||||
|
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0`
|
||||||
|
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`)
|
||||||
|
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`)
|
||||||
|
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in
|
||||||
|
the `1.2.3` version will be allowed, if they are greater than or
|
||||||
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||||
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||||
|
different `[major, minor, patch]` tuple.
|
||||||
|
|
||||||
|
#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`
|
||||||
|
|
||||||
|
Allows changes that do not modify the left-most non-zero element in the
|
||||||
|
`[major, minor, patch]` tuple. In other words, this allows patch and
|
||||||
|
minor updates for versions `1.0.0` and above, patch updates for
|
||||||
|
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.
|
||||||
|
|
||||||
|
Many authors treat a `0.x` version as if the `x` were the major
|
||||||
|
"breaking-change" indicator.
|
||||||
|
|
||||||
|
Caret ranges are ideal when an author may make breaking changes
|
||||||
|
between `0.2.4` and `0.3.0` releases, which is a common practice.
|
||||||
|
However, it presumes that there will *not* be breaking changes between
|
||||||
|
`0.2.4` and `0.2.5`. It allows for changes that are presumed to be
|
||||||
|
additive (but non-breaking), according to commonly observed practices.
|
||||||
|
|
||||||
|
* `^1.2.3` := `>=1.2.3 <2.0.0`
|
||||||
|
* `^0.2.3` := `>=0.2.3 <0.3.0`
|
||||||
|
* `^0.0.3` := `>=0.0.3 <0.0.4`
|
||||||
|
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in
|
||||||
|
the `1.2.3` version will be allowed, if they are greater than or
|
||||||
|
equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but
|
||||||
|
`1.2.4-beta.2` would not, because it is a prerelease of a
|
||||||
|
different `[major, minor, patch]` tuple.
|
||||||
|
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the
|
||||||
|
`0.0.3` version *only* will be allowed, if they are greater than or
|
||||||
|
equal to `beta`. So, `0.0.3-pr.2` would be allowed.
|
||||||
|
|
||||||
|
When parsing caret ranges, a missing `patch` value desugars to the
|
||||||
|
number `0`, but will allow flexibility within that value, even if the
|
||||||
|
major and minor versions are both `0`.
|
||||||
|
|
||||||
|
* `^1.2.x` := `>=1.2.0 <2.0.0`
|
||||||
|
* `^0.0.x` := `>=0.0.0 <0.1.0`
|
||||||
|
* `^0.0` := `>=0.0.0 <0.1.0`
|
||||||
|
|
||||||
|
A missing `minor` and `patch` values will desugar to zero, but also
|
||||||
|
allow flexibility within those values, even if the major version is
|
||||||
|
zero.
|
||||||
|
|
||||||
|
* `^1.x` := `>=1.0.0 <2.0.0`
|
||||||
|
* `^0.x` := `>=0.0.0 <1.0.0`
|
||||||
|
|
||||||
|
### Range Grammar
|
||||||
|
|
||||||
|
Putting all this together, here is a Backus-Naur grammar for ranges,
|
||||||
|
for the benefit of parser authors:
|
||||||
|
|
||||||
|
```bnf
|
||||||
|
range-set ::= range ( logical-or range ) *
|
||||||
|
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||||
|
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||||
|
hyphen ::= partial ' - ' partial
|
||||||
|
simple ::= primitive | partial | tilde | caret
|
||||||
|
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||||
|
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||||
|
xr ::= 'x' | 'X' | '*' | nr
|
||||||
|
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||||
|
tilde ::= '~' partial
|
||||||
|
caret ::= '^' partial
|
||||||
|
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||||
|
pre ::= parts
|
||||||
|
build ::= parts
|
||||||
|
parts ::= part ( '.' part ) *
|
||||||
|
part ::= nr | [-0-9A-Za-z]+
|
||||||
|
```
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
All methods and classes take a final `options` object argument. All
|
||||||
|
options in this object are `false` by default. The options supported
|
||||||
|
are:
|
||||||
|
|
||||||
|
- `loose` Be more forgiving about not-quite-valid semver strings.
|
||||||
|
(Any resulting output will always be 100% strict compliant, of
|
||||||
|
course.) For backwards compatibility reasons, if the `options`
|
||||||
|
argument is a boolean value instead of an object, it is interpreted
|
||||||
|
to be the `loose` param.
|
||||||
|
- `includePrerelease` Set to suppress the [default
|
||||||
|
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
||||||
|
excluding prerelease tagged versions from ranges unless they are
|
||||||
|
explicitly opted into.
|
||||||
|
|
||||||
|
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||||
|
strings that they parse.
|
||||||
|
|
||||||
|
* `valid(v)`: Return the parsed version, or null if it's not valid.
|
||||||
|
* `inc(v, release)`: Return the version incremented by the release
|
||||||
|
type (`major`, `premajor`, `minor`, `preminor`, `patch`,
|
||||||
|
`prepatch`, or `prerelease`), or null if it's not valid
|
||||||
|
* `premajor` in one call will bump the version up to the next major
|
||||||
|
version and down to a prerelease of that major version.
|
||||||
|
`preminor`, and `prepatch` work the same way.
|
||||||
|
* If called from a non-prerelease version, the `prerelease` will work the
|
||||||
|
same as `prepatch`. It increments the patch version, then makes a
|
||||||
|
prerelease. If the input version is already a prerelease it simply
|
||||||
|
increments it.
|
||||||
|
* `prerelease(v)`: Returns an array of prerelease components, or null
|
||||||
|
if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
|
||||||
|
* `major(v)`: Return the major version number.
|
||||||
|
* `minor(v)`: Return the minor version number.
|
||||||
|
* `patch(v)`: Return the patch version number.
|
||||||
|
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
|
||||||
|
or comparators intersect.
|
||||||
|
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
|
||||||
|
a `SemVer` object or `null`.
|
||||||
|
|
||||||
|
### Comparison
|
||||||
|
|
||||||
|
* `gt(v1, v2)`: `v1 > v2`
|
||||||
|
* `gte(v1, v2)`: `v1 >= v2`
|
||||||
|
* `lt(v1, v2)`: `v1 < v2`
|
||||||
|
* `lte(v1, v2)`: `v1 <= v2`
|
||||||
|
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
|
||||||
|
even if they're not the exact same string. You already know how to
|
||||||
|
compare strings.
|
||||||
|
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
|
||||||
|
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
|
||||||
|
the corresponding function above. `"==="` and `"!=="` do simple
|
||||||
|
string comparison, but are included for completeness. Throws if an
|
||||||
|
invalid comparison string is provided.
|
||||||
|
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
|
||||||
|
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions
|
||||||
|
in descending order when passed to `Array.sort()`.
|
||||||
|
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
|
||||||
|
are equal. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
`v2` is greater. Sorts in ascending order if passed to `Array.sort()`.
|
||||||
|
* `diff(v1, v2)`: Returns difference between two versions by the release type
|
||||||
|
(`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
|
||||||
|
or null if the versions are the same.
|
||||||
|
|
||||||
|
### Comparators
|
||||||
|
|
||||||
|
* `intersects(comparator)`: Return true if the comparators intersect
|
||||||
|
|
||||||
|
### Ranges
|
||||||
|
|
||||||
|
* `validRange(range)`: Return the valid range or null if it's not valid
|
||||||
|
* `satisfies(version, range)`: Return true if the version satisfies the
|
||||||
|
range.
|
||||||
|
* `maxSatisfying(versions, range)`: Return the highest version in the list
|
||||||
|
that satisfies the range, or `null` if none of them do.
|
||||||
|
* `minSatisfying(versions, range)`: Return the lowest version in the list
|
||||||
|
that satisfies the range, or `null` if none of them do.
|
||||||
|
* `minVersion(range)`: Return the lowest version that can possibly match
|
||||||
|
the given range.
|
||||||
|
* `gtr(version, range)`: Return `true` if version is greater than all the
|
||||||
|
versions possible in the range.
|
||||||
|
* `ltr(version, range)`: Return `true` if version is less than all the
|
||||||
|
versions possible in the range.
|
||||||
|
* `outside(version, range, hilo)`: Return true if the version is outside
|
||||||
|
the bounds of the range in either the high or low direction. The
|
||||||
|
`hilo` argument must be either the string `'>'` or `'<'`. (This is
|
||||||
|
the function called by `gtr` and `ltr`.)
|
||||||
|
* `intersects(range)`: Return true if any of the ranges comparators intersect
|
||||||
|
|
||||||
|
Note that, since ranges may be non-contiguous, a version might not be
|
||||||
|
greater than a range, less than a range, *or* satisfy a range! For
|
||||||
|
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
|
||||||
|
until `2.0.0`, so the version `1.2.10` would not be greater than the
|
||||||
|
range (because `2.0.1` satisfies, which is higher), nor less than the
|
||||||
|
range (since `1.2.8` satisfies, which is lower), and it also does not
|
||||||
|
satisfy the range.
|
||||||
|
|
||||||
|
If you want to know if a version satisfies or does not satisfy a
|
||||||
|
range, use the `satisfies(version, range)` function.
|
||||||
|
|
||||||
|
### Coercion
|
||||||
|
|
||||||
|
* `coerce(version, options)`: Coerces a string to semver if possible
|
||||||
|
|
||||||
|
This aims to provide a very forgiving translation of a non-semver string to
|
||||||
|
semver. It looks for the first digit in a string, and consumes all
|
||||||
|
remaining characters which satisfy at least a partial semver (e.g., `1`,
|
||||||
|
`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer
|
||||||
|
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All
|
||||||
|
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
||||||
|
`3.4.0`). Only text which lacks digits will fail coercion (`version one`
|
||||||
|
is not valid). The maximum length for any semver component considered for
|
||||||
|
coercion is 16 characters; longer components will be ignored
|
||||||
|
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||||
|
semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||||
|
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||||
|
|
||||||
|
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||||
|
coercible tuple that does not share an ending index with a longer coercible
|
||||||
|
tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
|
||||||
|
`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
|
||||||
|
any other overlapping SemVer tuple.
|
||||||
|
|
||||||
|
### Clean
|
||||||
|
|
||||||
|
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||||
|
|
||||||
|
This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
|
||||||
|
|
||||||
|
ex.
|
||||||
|
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||||
|
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
|
||||||
|
* `s.clean(' = v 2.1.5-foo')`: `null`
|
||||||
|
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
|
||||||
|
* `s.clean('=v2.1.5')`: `'2.1.5'`
|
||||||
|
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||||
|
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||||
|
* `s.clean('~1.0.0')`: `null`
|
||||||
+174
@@ -0,0 +1,174 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
// Standalone semver comparison program.
|
||||||
|
// Exits successfully and prints matching version(s) if
|
||||||
|
// any supplied version is valid and passes all tests.
|
||||||
|
|
||||||
|
var argv = process.argv.slice(2)
|
||||||
|
|
||||||
|
var versions = []
|
||||||
|
|
||||||
|
var range = []
|
||||||
|
|
||||||
|
var inc = null
|
||||||
|
|
||||||
|
var version = require('../package.json').version
|
||||||
|
|
||||||
|
var loose = false
|
||||||
|
|
||||||
|
var includePrerelease = false
|
||||||
|
|
||||||
|
var coerce = false
|
||||||
|
|
||||||
|
var rtl = false
|
||||||
|
|
||||||
|
var identifier
|
||||||
|
|
||||||
|
var semver = require('../semver')
|
||||||
|
|
||||||
|
var reverse = false
|
||||||
|
|
||||||
|
var options = {}
|
||||||
|
|
||||||
|
main()
|
||||||
|
|
||||||
|
function main () {
|
||||||
|
if (!argv.length) return help()
|
||||||
|
while (argv.length) {
|
||||||
|
var a = argv.shift()
|
||||||
|
var indexOfEqualSign = a.indexOf('=')
|
||||||
|
if (indexOfEqualSign !== -1) {
|
||||||
|
a = a.slice(0, indexOfEqualSign)
|
||||||
|
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||||
|
}
|
||||||
|
switch (a) {
|
||||||
|
case '-rv': case '-rev': case '--rev': case '--reverse':
|
||||||
|
reverse = true
|
||||||
|
break
|
||||||
|
case '-l': case '--loose':
|
||||||
|
loose = true
|
||||||
|
break
|
||||||
|
case '-p': case '--include-prerelease':
|
||||||
|
includePrerelease = true
|
||||||
|
break
|
||||||
|
case '-v': case '--version':
|
||||||
|
versions.push(argv.shift())
|
||||||
|
break
|
||||||
|
case '-i': case '--inc': case '--increment':
|
||||||
|
switch (argv[0]) {
|
||||||
|
case 'major': case 'minor': case 'patch': case 'prerelease':
|
||||||
|
case 'premajor': case 'preminor': case 'prepatch':
|
||||||
|
inc = argv.shift()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
inc = 'patch'
|
||||||
|
break
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case '--preid':
|
||||||
|
identifier = argv.shift()
|
||||||
|
break
|
||||||
|
case '-r': case '--range':
|
||||||
|
range.push(argv.shift())
|
||||||
|
break
|
||||||
|
case '-c': case '--coerce':
|
||||||
|
coerce = true
|
||||||
|
break
|
||||||
|
case '--rtl':
|
||||||
|
rtl = true
|
||||||
|
break
|
||||||
|
case '--ltr':
|
||||||
|
rtl = false
|
||||||
|
break
|
||||||
|
case '-h': case '--help': case '-?':
|
||||||
|
return help()
|
||||||
|
default:
|
||||||
|
versions.push(a)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
||||||
|
|
||||||
|
versions = versions.map(function (v) {
|
||||||
|
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||||
|
}).filter(function (v) {
|
||||||
|
return semver.valid(v)
|
||||||
|
})
|
||||||
|
if (!versions.length) return fail()
|
||||||
|
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||||
|
|
||||||
|
for (var i = 0, l = range.length; i < l; i++) {
|
||||||
|
versions = versions.filter(function (v) {
|
||||||
|
return semver.satisfies(v, range[i], options)
|
||||||
|
})
|
||||||
|
if (!versions.length) return fail()
|
||||||
|
}
|
||||||
|
return success(versions)
|
||||||
|
}
|
||||||
|
|
||||||
|
function failInc () {
|
||||||
|
console.error('--inc can only be used on a single version with no range')
|
||||||
|
fail()
|
||||||
|
}
|
||||||
|
|
||||||
|
function fail () { process.exit(1) }
|
||||||
|
|
||||||
|
function success () {
|
||||||
|
var compare = reverse ? 'rcompare' : 'compare'
|
||||||
|
versions.sort(function (a, b) {
|
||||||
|
return semver[compare](a, b, options)
|
||||||
|
}).map(function (v) {
|
||||||
|
return semver.clean(v, options)
|
||||||
|
}).map(function (v) {
|
||||||
|
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||||
|
}).forEach(function (v, i, _) { console.log(v) })
|
||||||
|
}
|
||||||
|
|
||||||
|
function help () {
|
||||||
|
console.log(['SemVer ' + version,
|
||||||
|
'',
|
||||||
|
'A JavaScript implementation of the https://semver.org/ specification',
|
||||||
|
'Copyright Isaac Z. Schlueter',
|
||||||
|
'',
|
||||||
|
'Usage: semver [options] <version> [<version> [...]]',
|
||||||
|
'Prints valid versions sorted by SemVer precedence',
|
||||||
|
'',
|
||||||
|
'Options:',
|
||||||
|
'-r --range <range>',
|
||||||
|
' Print versions that match the specified range.',
|
||||||
|
'',
|
||||||
|
'-i --increment [<level>]',
|
||||||
|
' Increment a version by the specified level. Level can',
|
||||||
|
' be one of: major, minor, patch, premajor, preminor,',
|
||||||
|
" prepatch, or prerelease. Default level is 'patch'.",
|
||||||
|
' Only one version may be specified.',
|
||||||
|
'',
|
||||||
|
'--preid <identifier>',
|
||||||
|
' Identifier to be used to prefix premajor, preminor,',
|
||||||
|
' prepatch or prerelease version increments.',
|
||||||
|
'',
|
||||||
|
'-l --loose',
|
||||||
|
' Interpret versions and ranges loosely',
|
||||||
|
'',
|
||||||
|
'-p --include-prerelease',
|
||||||
|
' Always include prerelease versions in range matching',
|
||||||
|
'',
|
||||||
|
'-c --coerce',
|
||||||
|
' Coerce a string into SemVer if possible',
|
||||||
|
' (does not imply --loose)',
|
||||||
|
'',
|
||||||
|
'--rtl',
|
||||||
|
' Coerce version strings right to left',
|
||||||
|
'',
|
||||||
|
'--ltr',
|
||||||
|
' Coerce version strings left to right (default)',
|
||||||
|
'',
|
||||||
|
'Program exits successfully if any valid version satisfies',
|
||||||
|
'all supplied ranges, and prints all satisfying versions.',
|
||||||
|
'',
|
||||||
|
'If no satisfying versions are found, then exits failure.',
|
||||||
|
'',
|
||||||
|
'Versions are printed in ascending order, so supplying',
|
||||||
|
'multiple versions to the utility will just sort them.'
|
||||||
|
].join('\n'))
|
||||||
|
}
|
||||||
+28
@@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
"name": "semver",
|
||||||
|
"version": "6.3.0",
|
||||||
|
"description": "The semantic version parser used by npm.",
|
||||||
|
"main": "semver.js",
|
||||||
|
"scripts": {
|
||||||
|
"test": "tap",
|
||||||
|
"preversion": "npm test",
|
||||||
|
"postversion": "npm publish",
|
||||||
|
"postpublish": "git push origin --follow-tags"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"tap": "^14.3.1"
|
||||||
|
},
|
||||||
|
"license": "ISC",
|
||||||
|
"repository": "https://github.com/npm/node-semver",
|
||||||
|
"bin": {
|
||||||
|
"semver": "./bin/semver.js"
|
||||||
|
},
|
||||||
|
"files": [
|
||||||
|
"bin",
|
||||||
|
"range.bnf",
|
||||||
|
"semver.js"
|
||||||
|
],
|
||||||
|
"tap": {
|
||||||
|
"check-coverage": true
|
||||||
|
}
|
||||||
|
}
|
||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
range-set ::= range ( logical-or range ) *
|
||||||
|
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
||||||
|
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||||
|
hyphen ::= partial ' - ' partial
|
||||||
|
simple ::= primitive | partial | tilde | caret
|
||||||
|
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
||||||
|
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||||
|
xr ::= 'x' | 'X' | '*' | nr
|
||||||
|
nr ::= '0' | [1-9] ( [0-9] ) *
|
||||||
|
tilde ::= '~' partial
|
||||||
|
caret ::= '^' partial
|
||||||
|
qualifier ::= ( '-' pre )? ( '+' build )?
|
||||||
|
pre ::= parts
|
||||||
|
build ::= parts
|
||||||
|
parts ::= part ( '.' part ) *
|
||||||
|
part ::= nr | [-0-9A-Za-z]+
|
||||||
Generated
Vendored
+30
-54
@@ -1,49 +1,16 @@
|
|||||||
{
|
{
|
||||||
"_from": "@actions/tool-cache",
|
|
||||||
"_id": "@actions/tool-cache@1.1.2",
|
|
||||||
"_inBundle": false,
|
|
||||||
"_integrity": "sha512-IJczPaZr02ECa3Lgws/TJEVco9tjOujiQSZbO3dHuXXjhd5vrUtfOgGwhmz3/f97L910OraPZ8SknofUk6RvOQ==",
|
|
||||||
"_location": "/@actions/tool-cache",
|
|
||||||
"_phantomChildren": {},
|
|
||||||
"_requested": {
|
|
||||||
"type": "tag",
|
|
||||||
"registry": true,
|
|
||||||
"raw": "@actions/tool-cache",
|
|
||||||
"name": "@actions/tool-cache",
|
"name": "@actions/tool-cache",
|
||||||
"escapedName": "@actions%2ftool-cache",
|
"version": "1.3.3",
|
||||||
"scope": "@actions",
|
|
||||||
"rawSpec": "",
|
|
||||||
"saveSpec": null,
|
|
||||||
"fetchSpec": "latest"
|
|
||||||
},
|
|
||||||
"_requiredBy": [
|
|
||||||
"#USER",
|
|
||||||
"/"
|
|
||||||
],
|
|
||||||
"_resolved": "https://registry.npmjs.org/@actions/tool-cache/-/tool-cache-1.1.2.tgz",
|
|
||||||
"_shasum": "304d44cecb9547324731e03ca004a3905e6530d2",
|
|
||||||
"_spec": "@actions/tool-cache",
|
|
||||||
"_where": "C:\\Users\\lzy\\Documents\\Source\\OpportunityLiu\\github-action-setup-xmake",
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/actions/toolkit/issues"
|
|
||||||
},
|
|
||||||
"bundleDependencies": false,
|
|
||||||
"dependencies": {
|
|
||||||
"@actions/core": "^1.1.0",
|
|
||||||
"@actions/exec": "^1.0.1",
|
|
||||||
"@actions/io": "^1.0.1",
|
|
||||||
"semver": "^6.1.0",
|
|
||||||
"typed-rest-client": "^1.4.0",
|
|
||||||
"uuid": "^3.3.2"
|
|
||||||
},
|
|
||||||
"deprecated": false,
|
|
||||||
"description": "Actions tool-cache lib",
|
"description": "Actions tool-cache lib",
|
||||||
"devDependencies": {
|
"keywords": [
|
||||||
"@types/nock": "^10.0.3",
|
"github",
|
||||||
"@types/semver": "^6.0.0",
|
"actions",
|
||||||
"@types/uuid": "^3.4.4",
|
"exec"
|
||||||
"nock": "^10.0.6"
|
],
|
||||||
},
|
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
||||||
|
"license": "MIT",
|
||||||
|
"main": "lib/tool-cache.js",
|
||||||
|
"types": "lib/tool-cache.d.ts",
|
||||||
"directories": {
|
"directories": {
|
||||||
"lib": "lib",
|
"lib": "lib",
|
||||||
"test": "__tests__"
|
"test": "__tests__"
|
||||||
@@ -52,25 +19,34 @@
|
|||||||
"lib",
|
"lib",
|
||||||
"scripts"
|
"scripts"
|
||||||
],
|
],
|
||||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/exec",
|
|
||||||
"keywords": [
|
|
||||||
"github",
|
|
||||||
"actions",
|
|
||||||
"exec"
|
|
||||||
],
|
|
||||||
"license": "MIT",
|
|
||||||
"main": "lib/tool-cache.js",
|
|
||||||
"name": "@actions/tool-cache",
|
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public"
|
"access": "public"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/actions/toolkit.git"
|
"url": "git+https://github.com/actions/toolkit.git",
|
||||||
|
"directory": "packages/tool-cache"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
"audit-moderate": "npm install && npm audit --audit-level=moderate",
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"tsc": "tsc"
|
"tsc": "tsc"
|
||||||
},
|
},
|
||||||
"version": "1.1.2"
|
"bugs": {
|
||||||
|
"url": "https://github.com/actions/toolkit/issues"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@actions/core": "^1.2.0",
|
||||||
|
"@actions/exec": "^1.0.0",
|
||||||
|
"@actions/http-client": "^1.0.3",
|
||||||
|
"@actions/io": "^1.0.1",
|
||||||
|
"semver": "^6.1.0",
|
||||||
|
"uuid": "^3.3.2"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/nock": "^10.0.3",
|
||||||
|
"@types/semver": "^6.0.0",
|
||||||
|
"@types/uuid": "^3.4.4",
|
||||||
|
"nock": "^10.0.6"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-18
@@ -1,18 +0,0 @@
|
|||||||
#!/usr/bin/env pwsh
|
|
||||||
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
|
||||||
|
|
||||||
$exe=""
|
|
||||||
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
|
||||||
# Fix case when both the Windows and Linux builds of Node
|
|
||||||
# are installed in the same directory
|
|
||||||
$exe=".exe"
|
|
||||||
}
|
|
||||||
$ret=0
|
|
||||||
if (Test-Path "$basedir/node$exe") {
|
|
||||||
& "$basedir/node$exe" "$basedir/../semver/bin/semver" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
} else {
|
|
||||||
& "node$exe" "$basedir/../semver/bin/semver" $args
|
|
||||||
$ret=$LASTEXITCODE
|
|
||||||
}
|
|
||||||
exit $ret
|
|
||||||
+15
@@ -1,5 +1,20 @@
|
|||||||
# changes log
|
# changes log
|
||||||
|
|
||||||
|
## 7.1.0
|
||||||
|
|
||||||
|
* Add `require('semver/preload')` to load the entire module without using
|
||||||
|
lazy getter methods.
|
||||||
|
|
||||||
|
## 7.0.0
|
||||||
|
|
||||||
|
* Refactor module into separate files for better tree-shaking
|
||||||
|
* Drop support for very old node versions, use const/let, `=>` functions,
|
||||||
|
and classes.
|
||||||
|
|
||||||
|
## 6.3.0
|
||||||
|
|
||||||
|
* Expose the token enum on the exports
|
||||||
|
|
||||||
## 6.2.0
|
## 6.2.0
|
||||||
|
|
||||||
* Coerce numbers to strings when passed to semver.coerce()
|
* Coerce numbers to strings when passed to semver.coerce()
|
||||||
|
|||||||
+113
-2
@@ -25,6 +25,61 @@ semver.valid(semver.coerce('v2')) // '2.0.0'
|
|||||||
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also just load the module for the function that you care about, if
|
||||||
|
you'd like to minimize your footprint.
|
||||||
|
|
||||||
|
```js
|
||||||
|
// load the whole API at once in a single object
|
||||||
|
const semver = require('semver')
|
||||||
|
|
||||||
|
// or just load the bits you need
|
||||||
|
// all of them listed here, just pick and choose what you want
|
||||||
|
|
||||||
|
// classes
|
||||||
|
const SemVer = require('semver/classes/semver')
|
||||||
|
const Comparator = require('semver/classes/comparator')
|
||||||
|
const Range = require('semver/classes/range')
|
||||||
|
|
||||||
|
// functions for working with versions
|
||||||
|
const semverParse = require('semver/functions/parse')
|
||||||
|
const semverValid = require('semver/functions/valid')
|
||||||
|
const semverClean = require('semver/functions/clean')
|
||||||
|
const semverInc = require('semver/functions/inc')
|
||||||
|
const semverDiff = require('semver/functions/diff')
|
||||||
|
const semverMajor = require('semver/functions/major')
|
||||||
|
const semverMinor = require('semver/functions/minor')
|
||||||
|
const semverPatch = require('semver/functions/patch')
|
||||||
|
const semverPrerelease = require('semver/functions/prerelease')
|
||||||
|
const semverCompare = require('semver/functions/compare')
|
||||||
|
const semverRcompare = require('semver/functions/rcompare')
|
||||||
|
const semverCompareLoose = require('semver/functions/compare-loose')
|
||||||
|
const semverCompareBuild = require('semver/functions/compare-build')
|
||||||
|
const semverSort = require('semver/functions/sort')
|
||||||
|
const semverRsort = require('semver/functions/rsort')
|
||||||
|
|
||||||
|
// low-level comparators between versions
|
||||||
|
const semverGt = require('semver/functions/gt')
|
||||||
|
const semverLt = require('semver/functions/lt')
|
||||||
|
const semverEq = require('semver/functions/eq')
|
||||||
|
const semverNeq = require('semver/functions/neq')
|
||||||
|
const semverGte = require('semver/functions/gte')
|
||||||
|
const semverLte = require('semver/functions/lte')
|
||||||
|
const semverCmp = require('semver/functions/cmp')
|
||||||
|
const semverCoerce = require('semver/functions/coerce')
|
||||||
|
|
||||||
|
// working with ranges
|
||||||
|
const semverSatisfies = require('semver/functions/satisfies')
|
||||||
|
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
|
||||||
|
const semverMinSatisfying = require('semver/ranges/min-satisfying')
|
||||||
|
const semverToComparators = require('semver/ranges/to-comparators')
|
||||||
|
const semverMinVersion = require('semver/ranges/min-version')
|
||||||
|
const semverValidRange = require('semver/ranges/valid')
|
||||||
|
const semverOutside = require('semver/ranges/outside')
|
||||||
|
const semverGtr = require('semver/ranges/gtr')
|
||||||
|
const semverLtr = require('semver/ranges/ltr')
|
||||||
|
const semverIntersects = require('semver/ranges/intersects')
|
||||||
|
```
|
||||||
|
|
||||||
As a command-line utility:
|
As a command-line utility:
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -417,7 +472,7 @@ surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
|
|||||||
is not valid). The maximum length for any semver component considered for
|
is not valid). The maximum length for any semver component considered for
|
||||||
coercion is 16 characters; longer components will be ignored
|
coercion is 16 characters; longer components will be ignored
|
||||||
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any
|
||||||
semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
|
||||||
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
components are invalid (`9999999999999999.4.7.4` is likely invalid).
|
||||||
|
|
||||||
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
If the `options.rtl` flag is set, then `coerce` will return the right-most
|
||||||
@@ -430,7 +485,9 @@ any other overlapping SemVer tuple.
|
|||||||
|
|
||||||
* `clean(version)`: Clean a string to be a valid semver if possible
|
* `clean(version)`: Clean a string to be a valid semver if possible
|
||||||
|
|
||||||
This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges.
|
This will return a cleaned and trimmed semver version. If the provided
|
||||||
|
version is not valid a null will be returned. This does not work for
|
||||||
|
ranges.
|
||||||
|
|
||||||
ex.
|
ex.
|
||||||
* `s.clean(' = v 2.1.5foo')`: `null`
|
* `s.clean(' = v 2.1.5foo')`: `null`
|
||||||
@@ -441,3 +498,57 @@ ex.
|
|||||||
* `s.clean(' =v2.1.5')`: `2.1.5`
|
* `s.clean(' =v2.1.5')`: `2.1.5`
|
||||||
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
* `s.clean(' 2.1.5 ')`: `'2.1.5'`
|
||||||
* `s.clean('~1.0.0')`: `null`
|
* `s.clean('~1.0.0')`: `null`
|
||||||
|
|
||||||
|
## Exported Modules
|
||||||
|
|
||||||
|
<!--
|
||||||
|
TODO: Make sure that all of these items are documented (classes aren't,
|
||||||
|
eg), and then pull the module name into the documentation for that specific
|
||||||
|
thing.
|
||||||
|
-->
|
||||||
|
|
||||||
|
You may pull in just the part of this semver utility that you need, if you
|
||||||
|
are sensitive to packing and tree-shaking concerns. The main
|
||||||
|
`require('semver')` export uses getter functions to lazily load the parts
|
||||||
|
of the API that are used.
|
||||||
|
|
||||||
|
The following modules are available:
|
||||||
|
|
||||||
|
* `require('semver')`
|
||||||
|
* `require('semver/classes')`
|
||||||
|
* `require('semver/classes/comparator')`
|
||||||
|
* `require('semver/classes/range')`
|
||||||
|
* `require('semver/classes/semver')`
|
||||||
|
* `require('semver/functions/clean')`
|
||||||
|
* `require('semver/functions/cmp')`
|
||||||
|
* `require('semver/functions/coerce')`
|
||||||
|
* `require('semver/functions/compare')`
|
||||||
|
* `require('semver/functions/compare-build')`
|
||||||
|
* `require('semver/functions/compare-loose')`
|
||||||
|
* `require('semver/functions/diff')`
|
||||||
|
* `require('semver/functions/eq')`
|
||||||
|
* `require('semver/functions/gt')`
|
||||||
|
* `require('semver/functions/gte')`
|
||||||
|
* `require('semver/functions/inc')`
|
||||||
|
* `require('semver/functions/lt')`
|
||||||
|
* `require('semver/functions/lte')`
|
||||||
|
* `require('semver/functions/major')`
|
||||||
|
* `require('semver/functions/minor')`
|
||||||
|
* `require('semver/functions/neq')`
|
||||||
|
* `require('semver/functions/parse')`
|
||||||
|
* `require('semver/functions/patch')`
|
||||||
|
* `require('semver/functions/prerelease')`
|
||||||
|
* `require('semver/functions/rcompare')`
|
||||||
|
* `require('semver/functions/rsort')`
|
||||||
|
* `require('semver/functions/satisfies')`
|
||||||
|
* `require('semver/functions/sort')`
|
||||||
|
* `require('semver/functions/valid')`
|
||||||
|
* `require('semver/ranges/gtr')`
|
||||||
|
* `require('semver/ranges/intersects')`
|
||||||
|
* `require('semver/ranges/ltr')`
|
||||||
|
* `require('semver/ranges/max-satisfying')`
|
||||||
|
* `require('semver/ranges/min-satisfying')`
|
||||||
|
* `require('semver/ranges/min-version')`
|
||||||
|
* `require('semver/ranges/outside')`
|
||||||
|
* `require('semver/ranges/to-comparators')`
|
||||||
|
* `require('semver/ranges/valid')`
|
||||||
|
|||||||
+78
-79
@@ -3,39 +3,37 @@
|
|||||||
// Exits successfully and prints matching version(s) if
|
// Exits successfully and prints matching version(s) if
|
||||||
// any supplied version is valid and passes all tests.
|
// any supplied version is valid and passes all tests.
|
||||||
|
|
||||||
var argv = process.argv.slice(2)
|
const argv = process.argv.slice(2)
|
||||||
|
|
||||||
var versions = []
|
let versions = []
|
||||||
|
|
||||||
var range = []
|
const range = []
|
||||||
|
|
||||||
var inc = null
|
let inc = null
|
||||||
|
|
||||||
var version = require('../package.json').version
|
const version = require('../package.json').version
|
||||||
|
|
||||||
var loose = false
|
let loose = false
|
||||||
|
|
||||||
var includePrerelease = false
|
let includePrerelease = false
|
||||||
|
|
||||||
var coerce = false
|
let coerce = false
|
||||||
|
|
||||||
var rtl = false
|
let rtl = false
|
||||||
|
|
||||||
var identifier
|
let identifier
|
||||||
|
|
||||||
var semver = require('../semver')
|
const semver = require('../')
|
||||||
|
|
||||||
var reverse = false
|
let reverse = false
|
||||||
|
|
||||||
var options = {}
|
const options = {}
|
||||||
|
|
||||||
main()
|
const main = () => {
|
||||||
|
|
||||||
function main () {
|
|
||||||
if (!argv.length) return help()
|
if (!argv.length) return help()
|
||||||
while (argv.length) {
|
while (argv.length) {
|
||||||
var a = argv.shift()
|
let a = argv.shift()
|
||||||
var indexOfEqualSign = a.indexOf('=')
|
const indexOfEqualSign = a.indexOf('=')
|
||||||
if (indexOfEqualSign !== -1) {
|
if (indexOfEqualSign !== -1) {
|
||||||
a = a.slice(0, indexOfEqualSign)
|
a = a.slice(0, indexOfEqualSign)
|
||||||
argv.unshift(a.slice(indexOfEqualSign + 1))
|
argv.unshift(a.slice(indexOfEqualSign + 1))
|
||||||
@@ -87,18 +85,18 @@ function main () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
const options = { loose: loose, includePrerelease: includePrerelease, rtl: rtl }
|
||||||
|
|
||||||
versions = versions.map(function (v) {
|
versions = versions.map((v) => {
|
||||||
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
return coerce ? (semver.coerce(v, options) || { version: v }).version : v
|
||||||
}).filter(function (v) {
|
}).filter((v) => {
|
||||||
return semver.valid(v)
|
return semver.valid(v)
|
||||||
})
|
})
|
||||||
if (!versions.length) return fail()
|
if (!versions.length) return fail()
|
||||||
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
if (inc && (versions.length !== 1 || range.length)) { return failInc() }
|
||||||
|
|
||||||
for (var i = 0, l = range.length; i < l; i++) {
|
for (let i = 0, l = range.length; i < l; i++) {
|
||||||
versions = versions.filter(function (v) {
|
versions = versions.filter((v) => {
|
||||||
return semver.satisfies(v, range[i], options)
|
return semver.satisfies(v, range[i], options)
|
||||||
})
|
})
|
||||||
if (!versions.length) return fail()
|
if (!versions.length) return fail()
|
||||||
@@ -106,69 +104,70 @@ function main () {
|
|||||||
return success(versions)
|
return success(versions)
|
||||||
}
|
}
|
||||||
|
|
||||||
function failInc () {
|
|
||||||
|
const failInc = () => {
|
||||||
console.error('--inc can only be used on a single version with no range')
|
console.error('--inc can only be used on a single version with no range')
|
||||||
fail()
|
fail()
|
||||||
}
|
}
|
||||||
|
|
||||||
function fail () { process.exit(1) }
|
const fail = () => process.exit(1)
|
||||||
|
|
||||||
function success () {
|
const success = () => {
|
||||||
var compare = reverse ? 'rcompare' : 'compare'
|
const compare = reverse ? 'rcompare' : 'compare'
|
||||||
versions.sort(function (a, b) {
|
versions.sort((a, b) => {
|
||||||
return semver[compare](a, b, options)
|
return semver[compare](a, b, options)
|
||||||
}).map(function (v) {
|
}).map((v) => {
|
||||||
return semver.clean(v, options)
|
return semver.clean(v, options)
|
||||||
}).map(function (v) {
|
}).map((v) => {
|
||||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
return inc ? semver.inc(v, inc, options, identifier) : v
|
||||||
}).forEach(function (v, i, _) { console.log(v) })
|
}).forEach((v, i, _) => { console.log(v) })
|
||||||
}
|
}
|
||||||
|
|
||||||
function help () {
|
const help = () => console.log(
|
||||||
console.log(['SemVer ' + version,
|
`SemVer ${version}
|
||||||
'',
|
|
||||||
'A JavaScript implementation of the https://semver.org/ specification',
|
A JavaScript implementation of the https://semver.org/ specification
|
||||||
'Copyright Isaac Z. Schlueter',
|
Copyright Isaac Z. Schlueter
|
||||||
'',
|
|
||||||
'Usage: semver [options] <version> [<version> [...]]',
|
Usage: semver [options] <version> [<version> [...]]
|
||||||
'Prints valid versions sorted by SemVer precedence',
|
Prints valid versions sorted by SemVer precedence
|
||||||
'',
|
|
||||||
'Options:',
|
Options:
|
||||||
'-r --range <range>',
|
-r --range <range>
|
||||||
' Print versions that match the specified range.',
|
Print versions that match the specified range.
|
||||||
'',
|
|
||||||
'-i --increment [<level>]',
|
-i --increment [<level>]
|
||||||
' Increment a version by the specified level. Level can',
|
Increment a version by the specified level. Level can
|
||||||
' be one of: major, minor, patch, premajor, preminor,',
|
be one of: major, minor, patch, premajor, preminor,
|
||||||
" prepatch, or prerelease. Default level is 'patch'.",
|
prepatch, or prerelease. Default level is 'patch'.
|
||||||
' Only one version may be specified.',
|
Only one version may be specified.
|
||||||
'',
|
|
||||||
'--preid <identifier>',
|
--preid <identifier>
|
||||||
' Identifier to be used to prefix premajor, preminor,',
|
Identifier to be used to prefix premajor, preminor,
|
||||||
' prepatch or prerelease version increments.',
|
prepatch or prerelease version increments.
|
||||||
'',
|
|
||||||
'-l --loose',
|
-l --loose
|
||||||
' Interpret versions and ranges loosely',
|
Interpret versions and ranges loosely
|
||||||
'',
|
|
||||||
'-p --include-prerelease',
|
-p --include-prerelease
|
||||||
' Always include prerelease versions in range matching',
|
Always include prerelease versions in range matching
|
||||||
'',
|
|
||||||
'-c --coerce',
|
-c --coerce
|
||||||
' Coerce a string into SemVer if possible',
|
Coerce a string into SemVer if possible
|
||||||
' (does not imply --loose)',
|
(does not imply --loose)
|
||||||
'',
|
|
||||||
'--rtl',
|
--rtl
|
||||||
' Coerce version strings right to left',
|
Coerce version strings right to left
|
||||||
'',
|
|
||||||
'--ltr',
|
--ltr
|
||||||
' Coerce version strings left to right (default)',
|
Coerce version strings left to right (default)
|
||||||
'',
|
|
||||||
'Program exits successfully if any valid version satisfies',
|
Program exits successfully if any valid version satisfies
|
||||||
'all supplied ranges, and prints all satisfying versions.',
|
all supplied ranges, and prints all satisfying versions.
|
||||||
'',
|
|
||||||
'If no satisfying versions are found, then exits failure.',
|
If no satisfying versions are found, then exits failure.
|
||||||
'',
|
|
||||||
'Versions are printed in ascending order, so supplying',
|
Versions are printed in ascending order, so supplying
|
||||||
'multiple versions to the utility will just sort them.'
|
multiple versions to the utility will just sort them.`)
|
||||||
].join('\n'))
|
|
||||||
}
|
main()
|
||||||
|
|||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
const ANY = Symbol('SemVer ANY')
|
||||||
|
// hoisted class for cyclic dependency
|
||||||
|
class Comparator {
|
||||||
|
static get ANY () {
|
||||||
|
return ANY
|
||||||
|
}
|
||||||
|
constructor (comp, options) {
|
||||||
|
if (!options || typeof options !== 'object') {
|
||||||
|
options = {
|
||||||
|
loose: !!options,
|
||||||
|
includePrerelease: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (comp instanceof Comparator) {
|
||||||
|
if (comp.loose === !!options.loose) {
|
||||||
|
return comp
|
||||||
|
} else {
|
||||||
|
comp = comp.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
debug('comparator', comp, options)
|
||||||
|
this.options = options
|
||||||
|
this.loose = !!options.loose
|
||||||
|
this.parse(comp)
|
||||||
|
|
||||||
|
if (this.semver === ANY) {
|
||||||
|
this.value = ''
|
||||||
|
} else {
|
||||||
|
this.value = this.operator + this.semver.version
|
||||||
|
}
|
||||||
|
|
||||||
|
debug('comp', this)
|
||||||
|
}
|
||||||
|
|
||||||
|
parse (comp) {
|
||||||
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||||
|
const m = comp.match(r)
|
||||||
|
|
||||||
|
if (!m) {
|
||||||
|
throw new TypeError(`Invalid comparator: ${comp}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.operator = m[1] !== undefined ? 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.options.loose)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
toString () {
|
||||||
|
return this.value
|
||||||
|
}
|
||||||
|
|
||||||
|
test (version) {
|
||||||
|
debug('Comparator.test', version, this.options.loose)
|
||||||
|
|
||||||
|
if (this.semver === ANY || version === ANY) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof version === 'string') {
|
||||||
|
try {
|
||||||
|
version = new SemVer(version, this.options)
|
||||||
|
} catch (er) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return cmp(version, this.operator, this.semver, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
intersects (comp, options) {
|
||||||
|
if (!(comp instanceof Comparator)) {
|
||||||
|
throw new TypeError('a Comparator is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!options || typeof options !== 'object') {
|
||||||
|
options = {
|
||||||
|
loose: !!options,
|
||||||
|
includePrerelease: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.operator === '') {
|
||||||
|
if (this.value === '') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return new Range(comp.value, options).test(this.value)
|
||||||
|
} else if (comp.operator === '') {
|
||||||
|
if (comp.value === '') {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
return new Range(this.value, options).test(comp.semver)
|
||||||
|
}
|
||||||
|
|
||||||
|
const sameDirectionIncreasing =
|
||||||
|
(this.operator === '>=' || this.operator === '>') &&
|
||||||
|
(comp.operator === '>=' || comp.operator === '>')
|
||||||
|
const sameDirectionDecreasing =
|
||||||
|
(this.operator === '<=' || this.operator === '<') &&
|
||||||
|
(comp.operator === '<=' || comp.operator === '<')
|
||||||
|
const sameSemVer = this.semver.version === comp.semver.version
|
||||||
|
const differentDirectionsInclusive =
|
||||||
|
(this.operator === '>=' || this.operator === '<=') &&
|
||||||
|
(comp.operator === '>=' || comp.operator === '<=')
|
||||||
|
const oppositeDirectionsLessThan =
|
||||||
|
cmp(this.semver, '<', comp.semver, options) &&
|
||||||
|
(this.operator === '>=' || this.operator === '>') &&
|
||||||
|
(comp.operator === '<=' || comp.operator === '<')
|
||||||
|
const oppositeDirectionsGreaterThan =
|
||||||
|
cmp(this.semver, '>', comp.semver, options) &&
|
||||||
|
(this.operator === '<=' || this.operator === '<') &&
|
||||||
|
(comp.operator === '>=' || comp.operator === '>')
|
||||||
|
|
||||||
|
return (
|
||||||
|
sameDirectionIncreasing ||
|
||||||
|
sameDirectionDecreasing ||
|
||||||
|
(sameSemVer && differentDirectionsInclusive) ||
|
||||||
|
oppositeDirectionsLessThan ||
|
||||||
|
oppositeDirectionsGreaterThan
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Comparator
|
||||||
|
|
||||||
|
const {re, t} = require('../internal/re')
|
||||||
|
const cmp = require('../functions/cmp')
|
||||||
|
const debug = require('../internal/debug')
|
||||||
|
const SemVer = require('./semver')
|
||||||
|
const Range = require('./range')
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
module.exports = {
|
||||||
|
SemVer: require('./semver.js'),
|
||||||
|
Range: require('./range.js'),
|
||||||
|
Comparator: require('./comparator.js')
|
||||||
|
}
|
||||||
+448
@@ -0,0 +1,448 @@
|
|||||||
|
// hoisted class for cyclic dependency
|
||||||
|
class Range {
|
||||||
|
constructor (range, options) {
|
||||||
|
if (!options || typeof options !== 'object') {
|
||||||
|
options = {
|
||||||
|
loose: !!options,
|
||||||
|
includePrerelease: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (range instanceof Range) {
|
||||||
|
if (
|
||||||
|
range.loose === !!options.loose &&
|
||||||
|
range.includePrerelease === !!options.includePrerelease
|
||||||
|
) {
|
||||||
|
return range
|
||||||
|
} else {
|
||||||
|
return new Range(range.raw, options)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (range instanceof Comparator) {
|
||||||
|
// just put it in the set and return
|
||||||
|
this.raw = range.value
|
||||||
|
this.set = [[range]]
|
||||||
|
this.format()
|
||||||
|
return this
|
||||||
|
}
|
||||||
|
|
||||||
|
this.options = options
|
||||||
|
this.loose = !!options.loose
|
||||||
|
this.includePrerelease = !!options.includePrerelease
|
||||||
|
|
||||||
|
// First, split based on boolean or ||
|
||||||
|
this.raw = range
|
||||||
|
this.set = range
|
||||||
|
.split(/\s*\|\|\s*/)
|
||||||
|
// map the range to a 2d array of comparators
|
||||||
|
.map(range => this.parseRange(range.trim()))
|
||||||
|
// throw out any comparator lists that are empty
|
||||||
|
// this generally means that it was not a valid range, which is allowed
|
||||||
|
// in loose mode, but will still throw if the WHOLE range is invalid.
|
||||||
|
.filter(c => c.length)
|
||||||
|
|
||||||
|
if (!this.set.length) {
|
||||||
|
throw new TypeError(`Invalid SemVer Range: ${range}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.format()
|
||||||
|
}
|
||||||
|
|
||||||
|
format () {
|
||||||
|
this.range = this.set
|
||||||
|
.map((comps) => {
|
||||||
|
return comps.join(' ').trim()
|
||||||
|
})
|
||||||
|
.join('||')
|
||||||
|
.trim()
|
||||||
|
return this.range
|
||||||
|
}
|
||||||
|
|
||||||
|
toString () {
|
||||||
|
return this.range
|
||||||
|
}
|
||||||
|
|
||||||
|
parseRange (range) {
|
||||||
|
const loose = this.options.loose
|
||||||
|
range = range.trim()
|
||||||
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||||
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.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[t.COMPARATORTRIM], comparatorTrimReplace)
|
||||||
|
debug('comparator trim', range, re[t.COMPARATORTRIM])
|
||||||
|
|
||||||
|
// `~ 1.2.3` => `~1.2.3`
|
||||||
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
|
||||||
|
|
||||||
|
// `^ 1.2.3` => `^1.2.3`
|
||||||
|
range = range.replace(re[t.CARETTRIM], caretTrimReplace)
|
||||||
|
|
||||||
|
// normalize spaces
|
||||||
|
range = range.split(/\s+/).join(' ')
|
||||||
|
|
||||||
|
// At this point, the range is completely trimmed and
|
||||||
|
// ready to be split into comparators.
|
||||||
|
|
||||||
|
const compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
|
||||||
|
return range
|
||||||
|
.split(' ')
|
||||||
|
.map(comp => parseComparator(comp, this.options))
|
||||||
|
.join(' ')
|
||||||
|
.split(/\s+/)
|
||||||
|
// in loose mode, throw out any that are not valid comparators
|
||||||
|
.filter(this.options.loose ? comp => !!comp.match(compRe) : () => true)
|
||||||
|
.map(comp => new Comparator(comp, this.options))
|
||||||
|
}
|
||||||
|
|
||||||
|
intersects (range, options) {
|
||||||
|
if (!(range instanceof Range)) {
|
||||||
|
throw new TypeError('a Range is required')
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.set.some((thisComparators) => {
|
||||||
|
return (
|
||||||
|
isSatisfiable(thisComparators, options) &&
|
||||||
|
range.set.some((rangeComparators) => {
|
||||||
|
return (
|
||||||
|
isSatisfiable(rangeComparators, options) &&
|
||||||
|
thisComparators.every((thisComparator) => {
|
||||||
|
return rangeComparators.every((rangeComparator) => {
|
||||||
|
return thisComparator.intersects(rangeComparator, options)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ANY of the sets match ALL of its comparators, then pass
|
||||||
|
test (version) {
|
||||||
|
if (!version) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof version === 'string') {
|
||||||
|
try {
|
||||||
|
version = new SemVer(version, this.options)
|
||||||
|
} catch (er) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (let i = 0; i < this.set.length; i++) {
|
||||||
|
if (testSet(this.set[i], version, this.options)) {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = Range
|
||||||
|
|
||||||
|
const Comparator = require('./comparator')
|
||||||
|
const debug = require('../internal/debug')
|
||||||
|
const SemVer = require('./semver')
|
||||||
|
const {
|
||||||
|
re,
|
||||||
|
t,
|
||||||
|
comparatorTrimReplace,
|
||||||
|
tildeTrimReplace,
|
||||||
|
caretTrimReplace
|
||||||
|
} = require('../internal/re')
|
||||||
|
|
||||||
|
// take a set of comparators and determine whether there
|
||||||
|
// exists a version which can satisfy it
|
||||||
|
const isSatisfiable = (comparators, options) => {
|
||||||
|
let result = true
|
||||||
|
const remainingComparators = comparators.slice()
|
||||||
|
let testComparator = remainingComparators.pop()
|
||||||
|
|
||||||
|
while (result && remainingComparators.length) {
|
||||||
|
result = remainingComparators.every((otherComparator) => {
|
||||||
|
return testComparator.intersects(otherComparator, options)
|
||||||
|
})
|
||||||
|
|
||||||
|
testComparator = remainingComparators.pop()
|
||||||
|
}
|
||||||
|
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
|
||||||
|
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||||
|
// already replaced the hyphen ranges
|
||||||
|
// turn into a set of JUST comparators.
|
||||||
|
const parseComparator = (comp, options) => {
|
||||||
|
debug('comp', comp, options)
|
||||||
|
comp = replaceCarets(comp, options)
|
||||||
|
debug('caret', comp)
|
||||||
|
comp = replaceTildes(comp, options)
|
||||||
|
debug('tildes', comp)
|
||||||
|
comp = replaceXRanges(comp, options)
|
||||||
|
debug('xrange', comp)
|
||||||
|
comp = replaceStars(comp, options)
|
||||||
|
debug('stars', comp)
|
||||||
|
return comp
|
||||||
|
}
|
||||||
|
|
||||||
|
const isX = id => !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
|
||||||
|
const replaceTildes = (comp, options) =>
|
||||||
|
comp.trim().split(/\s+/).map((comp) => {
|
||||||
|
return replaceTilde(comp, options)
|
||||||
|
}).join(' ')
|
||||||
|
|
||||||
|
const replaceTilde = (comp, options) => {
|
||||||
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
|
||||||
|
return comp.replace(r, (_, M, m, p, pr) => {
|
||||||
|
debug('tilde', comp, _, M, m, p, pr)
|
||||||
|
let 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)
|
||||||
|
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
|
||||||
|
const replaceCarets = (comp, options) =>
|
||||||
|
comp.trim().split(/\s+/).map((comp) => {
|
||||||
|
return replaceCaret(comp, options)
|
||||||
|
}).join(' ')
|
||||||
|
|
||||||
|
const replaceCaret = (comp, options) => {
|
||||||
|
debug('caret', comp, options)
|
||||||
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
|
||||||
|
return comp.replace(r, (_, M, m, p, pr) => {
|
||||||
|
debug('caret', comp, _, M, m, p, pr)
|
||||||
|
let 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 (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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const replaceXRanges = (comp, options) => {
|
||||||
|
debug('replaceXRanges', comp, options)
|
||||||
|
return comp.split(/\s+/).map((comp) => {
|
||||||
|
return replaceXRange(comp, options)
|
||||||
|
}).join(' ')
|
||||||
|
}
|
||||||
|
|
||||||
|
const replaceXRange = (comp, options) => {
|
||||||
|
comp = comp.trim()
|
||||||
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
|
||||||
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
||||||
|
debug('xRange', comp, ret, gtlt, M, m, p, pr)
|
||||||
|
const xM = isX(M)
|
||||||
|
const xm = xM || isX(m)
|
||||||
|
const xp = xm || isX(p)
|
||||||
|
const anyX = xp
|
||||||
|
|
||||||
|
if (gtlt === '=' && anyX) {
|
||||||
|
gtlt = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// if we're including prereleases in the match, then we need
|
||||||
|
// to fix this to -0, the lowest possible prerelease value
|
||||||
|
pr = options.includePrerelease ? '-0' : ''
|
||||||
|
|
||||||
|
if (xM) {
|
||||||
|
if (gtlt === '>' || gtlt === '<') {
|
||||||
|
// nothing is allowed
|
||||||
|
ret = '<0.0.0-0'
|
||||||
|
} else {
|
||||||
|
// nothing is forbidden
|
||||||
|
ret = '*'
|
||||||
|
}
|
||||||
|
} else if (gtlt && anyX) {
|
||||||
|
// we know patch is an x, because we have any x at all.
|
||||||
|
// replace X with 0
|
||||||
|
if (xm) {
|
||||||
|
m = 0
|
||||||
|
}
|
||||||
|
p = 0
|
||||||
|
|
||||||
|
if (gtlt === '>') {
|
||||||
|
// >1 => >=2.0.0
|
||||||
|
// >1.2 => >=1.3.0
|
||||||
|
gtlt = '>='
|
||||||
|
if (xm) {
|
||||||
|
M = +M + 1
|
||||||
|
m = 0
|
||||||
|
p = 0
|
||||||
|
} else {
|
||||||
|
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}${pr}`
|
||||||
|
} else if (xm) {
|
||||||
|
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0${pr}`
|
||||||
|
} else if (xp) {
|
||||||
|
ret = `>=${M}.${m}.0${pr
|
||||||
|
} <${M}.${+m + 1}.0${pr}`
|
||||||
|
}
|
||||||
|
|
||||||
|
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.
|
||||||
|
const replaceStars = (comp, options) => {
|
||||||
|
debug('replaceStars', comp, options)
|
||||||
|
// Looseness is ignored here. star is always as loose as it gets!
|
||||||
|
return comp.trim().replace(re[t.STAR], '')
|
||||||
|
}
|
||||||
|
|
||||||
|
// This function is passed to string.replace(re[t.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
|
||||||
|
const 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()
|
||||||
|
}
|
||||||
|
|
||||||
|
const testSet = (set, version, options) => {
|
||||||
|
for (let i = 0; i < set.length; i++) {
|
||||||
|
if (!set[i].test(version)) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version.prerelease.length && !options.includePrerelease) {
|
||||||
|
// 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 (let i = 0; i < set.length; i++) {
|
||||||
|
debug(set[i].semver)
|
||||||
|
if (set[i].semver === Comparator.ANY) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
if (set[i].semver.prerelease.length > 0) {
|
||||||
|
const 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
|
||||||
|
}
|
||||||
+290
@@ -0,0 +1,290 @@
|
|||||||
|
const debug = require('../internal/debug')
|
||||||
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
|
||||||
|
const { re, t } = require('../internal/re')
|
||||||
|
|
||||||
|
const { compareIdentifiers } = require('../internal/identifiers')
|
||||||
|
class SemVer {
|
||||||
|
constructor (version, options) {
|
||||||
|
if (!options || typeof options !== 'object') {
|
||||||
|
options = {
|
||||||
|
loose: !!options,
|
||||||
|
includePrerelease: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (version instanceof SemVer) {
|
||||||
|
if (version.loose === !!options.loose &&
|
||||||
|
version.includePrerelease === !!options.includePrerelease) {
|
||||||
|
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`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
debug('SemVer', version, options)
|
||||||
|
this.options = options
|
||||||
|
this.loose = !!options.loose
|
||||||
|
// this isn't actually relevant for versions, but keep it so that we
|
||||||
|
// don't run into trouble passing this.options around.
|
||||||
|
this.includePrerelease = !!options.includePrerelease
|
||||||
|
|
||||||
|
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.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((id) => {
|
||||||
|
if (/^[0-9]+$/.test(id)) {
|
||||||
|
const num = +id
|
||||||
|
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
||||||
|
return num
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return id
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
this.build = m[5] ? m[5].split('.') : []
|
||||||
|
this.format()
|
||||||
|
}
|
||||||
|
|
||||||
|
format () {
|
||||||
|
this.version = `${this.major}.${this.minor}.${this.patch}`
|
||||||
|
if (this.prerelease.length) {
|
||||||
|
this.version += `-${this.prerelease.join('.')}`
|
||||||
|
}
|
||||||
|
return this.version
|
||||||
|
}
|
||||||
|
|
||||||
|
toString () {
|
||||||
|
return this.version
|
||||||
|
}
|
||||||
|
|
||||||
|
compare (other) {
|
||||||
|
debug('SemVer.compare', this.version, this.options, other)
|
||||||
|
if (!(other instanceof SemVer)) {
|
||||||
|
if (typeof other === 'string' && other === this.version) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
other = new SemVer(other, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (other.version === this.version) {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.compareMain(other) || this.comparePre(other)
|
||||||
|
}
|
||||||
|
|
||||||
|
compareMain (other) {
|
||||||
|
if (!(other instanceof SemVer)) {
|
||||||
|
other = new SemVer(other, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
compareIdentifiers(this.major, other.major) ||
|
||||||
|
compareIdentifiers(this.minor, other.minor) ||
|
||||||
|
compareIdentifiers(this.patch, other.patch)
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
comparePre (other) {
|
||||||
|
if (!(other instanceof SemVer)) {
|
||||||
|
other = new SemVer(other, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
|
||||||
|
let i = 0
|
||||||
|
do {
|
||||||
|
const a = this.prerelease[i]
|
||||||
|
const 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)
|
||||||
|
}
|
||||||
|
|
||||||
|
compareBuild (other) {
|
||||||
|
if (!(other instanceof SemVer)) {
|
||||||
|
other = new SemVer(other, this.options)
|
||||||
|
}
|
||||||
|
|
||||||
|
let i = 0
|
||||||
|
do {
|
||||||
|
const a = this.build[i]
|
||||||
|
const b = other.build[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.
|
||||||
|
inc (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 {
|
||||||
|
let 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = SemVer
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
const parse = require('./parse')
|
||||||
|
const clean = (version, options) => {
|
||||||
|
const s = parse(version.trim().replace(/^[=v]+/, ''), options)
|
||||||
|
return s ? s.version : null
|
||||||
|
}
|
||||||
|
module.exports = clean
|
||||||
+48
@@ -0,0 +1,48 @@
|
|||||||
|
const eq = require('./eq')
|
||||||
|
const neq = require('./neq')
|
||||||
|
const gt = require('./gt')
|
||||||
|
const gte = require('./gte')
|
||||||
|
const lt = require('./lt')
|
||||||
|
const lte = require('./lte')
|
||||||
|
|
||||||
|
const cmp = (a, op, b, loose) => {
|
||||||
|
switch (op) {
|
||||||
|
case '===':
|
||||||
|
if (typeof a === 'object')
|
||||||
|
a = a.version
|
||||||
|
if (typeof b === 'object')
|
||||||
|
b = b.version
|
||||||
|
return a === b
|
||||||
|
|
||||||
|
case '!==':
|
||||||
|
if (typeof a === 'object')
|
||||||
|
a = a.version
|
||||||
|
if (typeof b === 'object')
|
||||||
|
b = b.version
|
||||||
|
return a !== b
|
||||||
|
|
||||||
|
case '':
|
||||||
|
case '=':
|
||||||
|
case '==':
|
||||||
|
return eq(a, b, loose)
|
||||||
|
|
||||||
|
case '!=':
|
||||||
|
return neq(a, b, loose)
|
||||||
|
|
||||||
|
case '>':
|
||||||
|
return gt(a, b, loose)
|
||||||
|
|
||||||
|
case '>=':
|
||||||
|
return gte(a, b, loose)
|
||||||
|
|
||||||
|
case '<':
|
||||||
|
return lt(a, b, loose)
|
||||||
|
|
||||||
|
case '<=':
|
||||||
|
return lte(a, b, loose)
|
||||||
|
|
||||||
|
default:
|
||||||
|
throw new TypeError(`Invalid operator: ${op}`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = cmp
|
||||||
+51
@@ -0,0 +1,51 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const parse = require('./parse')
|
||||||
|
const {re, t} = require('../internal/re')
|
||||||
|
|
||||||
|
const coerce = (version, options) => {
|
||||||
|
if (version instanceof SemVer) {
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof version === 'number') {
|
||||||
|
version = String(version)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof version !== 'string') {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
options = options || {}
|
||||||
|
|
||||||
|
let match = null
|
||||||
|
if (!options.rtl) {
|
||||||
|
match = version.match(re[t.COERCE])
|
||||||
|
} else {
|
||||||
|
// Find the right-most coercible string that does not share
|
||||||
|
// a terminus with a more left-ward coercible string.
|
||||||
|
// Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
|
||||||
|
//
|
||||||
|
// Walk through the string checking with a /g regexp
|
||||||
|
// Manually set the index so as to pick up overlapping matches.
|
||||||
|
// Stop when we get a match that ends at the string end, since no
|
||||||
|
// coercible string can be more right-ward without the same terminus.
|
||||||
|
let next
|
||||||
|
while ((next = re[t.COERCERTL].exec(version)) &&
|
||||||
|
(!match || match.index + match[0].length !== version.length)
|
||||||
|
) {
|
||||||
|
if (!match ||
|
||||||
|
next.index + next[0].length !== match.index + match[0].length) {
|
||||||
|
match = next
|
||||||
|
}
|
||||||
|
re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
|
||||||
|
}
|
||||||
|
// leave it in a clean state
|
||||||
|
re[t.COERCERTL].lastIndex = -1
|
||||||
|
}
|
||||||
|
|
||||||
|
if (match === null)
|
||||||
|
return null
|
||||||
|
|
||||||
|
return parse(`${match[2]}.${match[3] || '0'}.${match[4] || '0'}`, options)
|
||||||
|
}
|
||||||
|
module.exports = coerce
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const compareBuild = (a, b, loose) => {
|
||||||
|
const versionA = new SemVer(a, loose)
|
||||||
|
const versionB = new SemVer(b, loose)
|
||||||
|
return versionA.compare(versionB) || versionA.compareBuild(versionB)
|
||||||
|
}
|
||||||
|
module.exports = compareBuild
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const compareLoose = (a, b) => compare(a, b, true)
|
||||||
|
module.exports = compareLoose
|
||||||
+5
@@ -0,0 +1,5 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const compare = (a, b, loose) =>
|
||||||
|
new SemVer(a, loose).compare(new SemVer(b, loose))
|
||||||
|
|
||||||
|
module.exports = compare
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
const parse = require('./parse')
|
||||||
|
const eq = require('./eq')
|
||||||
|
|
||||||
|
const diff = (version1, version2) => {
|
||||||
|
if (eq(version1, version2)) {
|
||||||
|
return null
|
||||||
|
} else {
|
||||||
|
const v1 = parse(version1)
|
||||||
|
const v2 = parse(version2)
|
||||||
|
const hasPre = v1.prerelease.length || v2.prerelease.length
|
||||||
|
const prefix = hasPre ? 'pre' : ''
|
||||||
|
const defaultResult = hasPre ? 'prerelease' : ''
|
||||||
|
for (const key in v1) {
|
||||||
|
if (key === 'major' || key === 'minor' || key === 'patch') {
|
||||||
|
if (v1[key] !== v2[key]) {
|
||||||
|
return prefix + key
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return defaultResult // may be undefined
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = diff
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const eq = (a, b, loose) => compare(a, b, loose) === 0
|
||||||
|
module.exports = eq
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const gt = (a, b, loose) => compare(a, b, loose) > 0
|
||||||
|
module.exports = gt
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const gte = (a, b, loose) => compare(a, b, loose) >= 0
|
||||||
|
module.exports = gte
|
||||||
+15
@@ -0,0 +1,15 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
|
||||||
|
const inc = (version, release, options, identifier) => {
|
||||||
|
if (typeof (options) === 'string') {
|
||||||
|
identifier = options
|
||||||
|
options = undefined
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new SemVer(version, options).inc(release, identifier).version
|
||||||
|
} catch (er) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = inc
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const lt = (a, b, loose) => compare(a, b, loose) < 0
|
||||||
|
module.exports = lt
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const lte = (a, b, loose) => compare(a, b, loose) <= 0
|
||||||
|
module.exports = lte
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const major = (a, loose) => new SemVer(a, loose).major
|
||||||
|
module.exports = major
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const minor = (a, loose) => new SemVer(a, loose).minor
|
||||||
|
module.exports = minor
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const neq = (a, b, loose) => compare(a, b, loose) !== 0
|
||||||
|
module.exports = neq
|
||||||
+37
@@ -0,0 +1,37 @@
|
|||||||
|
const {MAX_LENGTH} = require('../internal/constants')
|
||||||
|
const { re, t } = require('../internal/re')
|
||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
|
||||||
|
const parse = (version, options) => {
|
||||||
|
if (!options || typeof options !== 'object') {
|
||||||
|
options = {
|
||||||
|
loose: !!options,
|
||||||
|
includePrerelease: false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version instanceof SemVer) {
|
||||||
|
return version
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof version !== 'string') {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
if (version.length > MAX_LENGTH) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
const r = options.loose ? re[t.LOOSE] : re[t.FULL]
|
||||||
|
if (!r.test(version)) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
return new SemVer(version, options)
|
||||||
|
} catch (er) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = parse
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const SemVer = require('../classes/semver')
|
||||||
|
const patch = (a, loose) => new SemVer(a, loose).patch
|
||||||
|
module.exports = patch
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
const parse = require('./parse')
|
||||||
|
const prerelease = (version, options) => {
|
||||||
|
const parsed = parse(version, options)
|
||||||
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
|
||||||
|
}
|
||||||
|
module.exports = prerelease
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compare = require('./compare')
|
||||||
|
const rcompare = (a, b, loose) => compare(b, a, loose)
|
||||||
|
module.exports = rcompare
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compareBuild = require('./compare-build')
|
||||||
|
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
|
||||||
|
module.exports = rsort
|
||||||
+10
@@ -0,0 +1,10 @@
|
|||||||
|
const Range = require('../classes/range')
|
||||||
|
const satisfies = (version, range, options) => {
|
||||||
|
try {
|
||||||
|
range = new Range(range, options)
|
||||||
|
} catch (er) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
return range.test(version)
|
||||||
|
}
|
||||||
|
module.exports = satisfies
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
const compareBuild = require('./compare-build')
|
||||||
|
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
|
||||||
|
module.exports = sort
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
const parse = require('./parse')
|
||||||
|
const valid = (version, options) => {
|
||||||
|
const v = parse(version, options)
|
||||||
|
return v ? v.version : null
|
||||||
|
}
|
||||||
|
module.exports = valid
|
||||||
+46
@@ -0,0 +1,46 @@
|
|||||||
|
// just pre-load all the stuff that index.js lazily exports
|
||||||
|
const internalRe = require('./internal/re')
|
||||||
|
module.exports = {
|
||||||
|
re: internalRe.re,
|
||||||
|
src: internalRe.src,
|
||||||
|
tokens: internalRe.t,
|
||||||
|
SEMVER_SPEC_VERSION: require('./internal/constants').SEMVER_SPEC_VERSION,
|
||||||
|
SemVer: require('./classes/semver'),
|
||||||
|
compareIdentifiers: require('./internal/identifiers').compareIdentifiers,
|
||||||
|
rcompareIdentifiers: require('./internal/identifiers').rcompareIdentifiers,
|
||||||
|
parse: require('./functions/parse'),
|
||||||
|
valid: require('./functions/valid'),
|
||||||
|
clean: require('./functions/clean'),
|
||||||
|
inc: require('./functions/inc'),
|
||||||
|
diff: require('./functions/diff'),
|
||||||
|
major: require('./functions/major'),
|
||||||
|
minor: require('./functions/minor'),
|
||||||
|
patch: require('./functions/patch'),
|
||||||
|
prerelease: require('./functions/prerelease'),
|
||||||
|
compare: require('./functions/compare'),
|
||||||
|
rcompare: require('./functions/rcompare'),
|
||||||
|
compareLoose: require('./functions/compare-loose'),
|
||||||
|
compareBuild: require('./functions/compare-build'),
|
||||||
|
sort: require('./functions/sort'),
|
||||||
|
rsort: require('./functions/rsort'),
|
||||||
|
gt: require('./functions/gt'),
|
||||||
|
lt: require('./functions/lt'),
|
||||||
|
eq: require('./functions/eq'),
|
||||||
|
neq: require('./functions/neq'),
|
||||||
|
gte: require('./functions/gte'),
|
||||||
|
lte: require('./functions/lte'),
|
||||||
|
cmp: require('./functions/cmp'),
|
||||||
|
coerce: require('./functions/coerce'),
|
||||||
|
Comparator: require('./classes/comparator'),
|
||||||
|
Range: require('./classes/range'),
|
||||||
|
satisfies: require('./functions/satisfies'),
|
||||||
|
toComparators: require('./ranges/to-comparators'),
|
||||||
|
maxSatisfying: require('./ranges/max-satisfying'),
|
||||||
|
minSatisfying: require('./ranges/min-satisfying'),
|
||||||
|
minVersion: require('./ranges/min-version'),
|
||||||
|
validRange: require('./ranges/valid'),
|
||||||
|
outside: require('./ranges/outside'),
|
||||||
|
gtr: require('./ranges/gtr'),
|
||||||
|
ltr: require('./ranges/ltr'),
|
||||||
|
intersects: require('./ranges/intersects'),
|
||||||
|
}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
// Note: this is the semver.org version of the spec that it implements
|
||||||
|
// Not necessarily the package version of this code.
|
||||||
|
const SEMVER_SPEC_VERSION = '2.0.0'
|
||||||
|
|
||||||
|
const MAX_LENGTH = 256
|
||||||
|
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
|
||||||
|
/* istanbul ignore next */ 9007199254740991
|
||||||
|
|
||||||
|
// Max safe segment length for coercion.
|
||||||
|
const MAX_SAFE_COMPONENT_LENGTH = 16
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
SEMVER_SPEC_VERSION,
|
||||||
|
MAX_LENGTH,
|
||||||
|
MAX_SAFE_INTEGER,
|
||||||
|
MAX_SAFE_COMPONENT_LENGTH
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
const debug = (
|
||||||
|
typeof process === 'object' &&
|
||||||
|
process.env &&
|
||||||
|
process.env.NODE_DEBUG &&
|
||||||
|
/\bsemver\b/i.test(process.env.NODE_DEBUG)
|
||||||
|
) ? (...args) => console.error('SEMVER', ...args)
|
||||||
|
: () => {}
|
||||||
|
|
||||||
|
module.exports = debug
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user