initial status

This commit is contained in:
Simon Priet
2021-09-05 12:34:08 +02:00
commit a041f9f575
9441 changed files with 627158 additions and 0 deletions

15
node_modules/update-notifier/node_modules/.bin/is-ci generated vendored Normal file
View File

@@ -0,0 +1,15 @@
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../is-ci/bin.js" "$@"
ret=$?
else
node "$basedir/../is-ci/bin.js" "$@"
ret=$?
fi
exit $ret

View File

@@ -0,0 +1,7 @@
@IF EXIST "%~dp0\node.exe" (
"%~dp0\node.exe" "%~dp0\..\is-ci\bin.js" %*
) ELSE (
@SETLOCAL
@SET PATHEXT=%PATHEXT:;.JS;=;%
node "%~dp0\..\is-ci\bin.js" %*
)

View File

@@ -0,0 +1,78 @@
# Changelog
## v2.0.0
Breaking changes:
* Drop support for Node.js end-of-life versions: 0.10, 0.12, 4, 5, 7,
and 9
* Team Foundation Server will now be detected as Azure Pipelines. The
constant `ci.TFS` no longer exists - use `ci.AZURE_PIPELINES` instead
* Remove deprecated `ci.TDDIUM` constant - use `ci.SOLANDO` instead
New features:
* feat: support Azure Pipelines ([#23](https://github.com/watson/ci-info/pull/23))
* feat: support Netlify CI ([#26](https://github.com/watson/ci-info/pull/26))
* feat: support Bitbucket pipelines PR detection ([#27](https://github.com/watson/ci-info/pull/27))
## v1.6.0
* feat: add Sail CI support
* feat: add Buddy support
* feat: add Bitrise support
* feat: detect Jenkins PRs
* feat: detect Drone PRs
## v1.5.1
* fix: use full path to vendors.json
## v1.5.0
* feat: add dsari detection ([#15](https://github.com/watson/ci-info/pull/15))
* feat: add ci.isPR ([#16](https://github.com/watson/ci-info/pull/16))
## v1.4.0
* feat: add Cirrus CI detection ([#13](https://github.com/watson/ci-info/pull/13))
* feat: add Shippable CI detection ([#14](https://github.com/watson/ci-info/pull/14))
## v1.3.1
* chore: reduce npm package size by not including `.github` folder content ([#11](https://github.com/watson/ci-info/pull/11))
## v1.3.0
* feat: add support for Strider CD
* chore: deprecate vendor constant `TDDIUM` in favor of `SOLANO`
* docs: add missing vendor constant to docs
## v1.2.0
* feat: detect solano-ci ([#9](https://github.com/watson/ci-info/pull/9))
## v1.1.3
* fix: fix spelling of Hunson in `ci.name`
## v1.1.2
* fix: no more false positive matches for Jenkins
## v1.1.1
* docs: sort lists of CI servers in README.md
* docs: add missing AWS CodeBuild to the docs
## v1.1.0
* feat: add AWS CodeBuild to CI detection ([#2](https://github.com/watson/ci-info/pull/2))
## v1.0.1
* chore: reduce npm package size by using an `.npmignore` file ([#3](https://github.com/watson/ci-info/pull/3))
## v1.0.0
* Initial release

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-2018 Thomas Watson Steen
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.

View File

@@ -0,0 +1,108 @@
# ci-info
Get details about the current Continuous Integration environment.
Please [open an
issue](https://github.com/watson/ci-info/issues/new?template=ci-server-not-detected.md)
if your CI server isn't properly detected :)
[![npm](https://img.shields.io/npm/v/ci-info.svg)](https://www.npmjs.com/package/ci-info)
[![Build status](https://travis-ci.org/watson/ci-info.svg?branch=master)](https://travis-ci.org/watson/ci-info)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
## Installation
```bash
npm install ci-info --save
```
## Usage
```js
var ci = require('ci-info')
if (ci.isCI) {
console.log('The name of the CI server is:', ci.name)
} else {
console.log('This program is not running on a CI server')
}
```
## Supported CI tools
Officially supported CI servers:
| Name | Constant | isPR |
|------|----------|------|
| [AWS CodeBuild](https://aws.amazon.com/codebuild/) | `ci.CODEBUILD` | 🚫 |
| [AppVeyor](http://www.appveyor.com) | `ci.APPVEYOR` | ✅ |
| [Azure Pipelines](https://azure.microsoft.com/en-us/services/devops/pipelines/) | `ci.AZURE_PIPELINES` | ✅ |
| [Bamboo](https://www.atlassian.com/software/bamboo) by Atlassian | `ci.BAMBOO` | 🚫 |
| [Bitbucket Pipelines](https://bitbucket.org/product/features/pipelines) | `ci.BITBUCKET` | ✅ |
| [Bitrise](https://www.bitrise.io/) | `ci.BITRISE` | ✅ |
| [Buddy](https://buddy.works/) | `ci.BUDDY` | ✅ |
| [Buildkite](https://buildkite.com) | `ci.BUILDKITE` | ✅ |
| [CircleCI](http://circleci.com) | `ci.CIRCLE` | ✅ |
| [Cirrus CI](https://cirrus-ci.org) | `ci.CIRRUS` | ✅ |
| [Codeship](https://codeship.com) | `ci.CODESHIP` | 🚫 |
| [Drone](https://drone.io) | `ci.DRONE` | ✅ |
| [dsari](https://github.com/rfinnie/dsari) | `ci.DSARI` | 🚫 |
| [GitLab CI](https://about.gitlab.com/gitlab-ci/) | `ci.GITLAB` | 🚫 |
| [GoCD](https://www.go.cd/) | `ci.GOCD` | 🚫 |
| [Hudson](http://hudson-ci.org) | `ci.HUDSON` | 🚫 |
| [Jenkins CI](https://jenkins-ci.org) | `ci.JENKINS` | ✅ |
| [Magnum CI](https://magnum-ci.com) | `ci.MAGNUM` | 🚫 |
| [Netlify CI](https://www.netlify.com/) | `ci.NETLIFY` | ✅ |
| [Sail CI](https://sail.ci/) | `ci.SAIL` | ✅ |
| [Semaphore](https://semaphoreci.com) | `ci.SEMAPHORE` | ✅ |
| [Shippable](https://www.shippable.com/) | `ci.SHIPPABLE` | ✅ |
| [Solano CI](https://www.solanolabs.com/) | `ci.SOLANO` | ✅ |
| [Strider CD](https://strider-cd.github.io/) | `ci.STRIDER` | 🚫 |
| [TaskCluster](http://docs.taskcluster.net) | `ci.TASKCLUSTER` | 🚫 |
| [TeamCity](https://www.jetbrains.com/teamcity/) by JetBrains | `ci.TEAMCITY` | 🚫 |
| [Travis CI](http://travis-ci.org) | `ci.TRAVIS` | ✅ |
## API
### `ci.name`
Returns a string containing name of the CI server the code is running on.
If CI server is not detected, it returns `null`.
Don't depend on the value of this string not to change for a specific
vendor. If you find your self writing `ci.name === 'Travis CI'`, you
most likely want to use `ci.TRAVIS` instead.
### `ci.isCI`
Returns a boolean. Will be `true` if the code is running on a CI server,
otherwise `false`.
Some CI servers not listed here might still trigger the `ci.isCI`
boolean to be set to `true` if they use certain vendor neutral
environment variables. In those cases `ci.name` will be `null` and no
vendor specific boolean will be set to `true`.
### `ci.isPR`
Returns a boolean if PR detection is supported for the current CI server. Will
be `true` if a PR is being tested, otherwise `false`. If PR detection is
not supported for the current CI server, the value will be `null`.
### `ci.<VENDOR-CONSTANT>`
A vendor specific boolean constant is exposed for each support CI
vendor. A constant will be `true` if the code is determined to run on
the given CI server, otherwise `false`.
Examples of vendor constants are `ci.TRAVIS` or `ci.APPVEYOR`. For a
complete list, see the support table above.
Deprecated vendor constants that will be removed in the next major
release:
- `ci.TDDIUM` (Solano CI) This have been renamed `ci.SOLANO`
## License
[MIT](LICENSE)

View File

@@ -0,0 +1,66 @@
'use strict'
var vendors = require('./vendors.json')
var env = process.env
// Used for testing only
Object.defineProperty(exports, '_vendors', {
value: vendors.map(function (v) { return v.constant })
})
exports.name = null
exports.isPR = null
vendors.forEach(function (vendor) {
var envs = Array.isArray(vendor.env) ? vendor.env : [vendor.env]
var isCI = envs.every(function (obj) {
return checkEnv(obj)
})
exports[vendor.constant] = isCI
if (isCI) {
exports.name = vendor.name
switch (typeof vendor.pr) {
case 'string':
// "pr": "CIRRUS_PR"
exports.isPR = !!env[vendor.pr]
break
case 'object':
if ('env' in vendor.pr) {
// "pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" }
exports.isPR = vendor.pr.env in env && env[vendor.pr.env] !== vendor.pr.ne
} else if ('any' in vendor.pr) {
// "pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
exports.isPR = vendor.pr.any.some(function (key) {
return !!env[key]
})
} else {
// "pr": { "DRONE_BUILD_EVENT": "pull_request" }
exports.isPR = checkEnv(vendor.pr)
}
break
default:
// PR detection not supported for this vendor
exports.isPR = null
}
}
})
exports.isCI = !!(
env.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
env.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
env.BUILD_NUMBER || // Jenkins, TeamCity
env.RUN_ID || // TaskCluster, dsari
exports.name ||
false
)
function checkEnv (obj) {
if (typeof obj === 'string') return !!env[obj]
return Object.keys(obj).every(function (k) {
return env[k] === obj[k]
})
}

View File

@@ -0,0 +1,36 @@
{
"name": "ci-info",
"version": "2.0.0",
"description": "Get details about the current Continuous Integration environment",
"main": "index.js",
"dependencies": {},
"devDependencies": {
"clear-require": "^1.0.1",
"standard": "^12.0.1",
"tape": "^4.9.1"
},
"scripts": {
"test": "standard && node test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/watson/ci-info.git"
},
"keywords": [
"ci",
"continuous",
"integration",
"test",
"detect"
],
"author": "Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",
"license": "MIT",
"bugs": {
"url": "https://github.com/watson/ci-info/issues"
},
"homepage": "https://github.com/watson/ci-info",
"coordinates": [
55.778231,
12.593179
]
}

View File

@@ -0,0 +1,153 @@
[
{
"name": "AppVeyor",
"constant": "APPVEYOR",
"env": "APPVEYOR",
"pr": "APPVEYOR_PULL_REQUEST_NUMBER"
},
{
"name": "Azure Pipelines",
"constant": "AZURE_PIPELINES",
"env": "SYSTEM_TEAMFOUNDATIONCOLLECTIONURI",
"pr": "SYSTEM_PULLREQUEST_PULLREQUESTID"
},
{
"name": "Bamboo",
"constant": "BAMBOO",
"env": "bamboo_planKey"
},
{
"name": "Bitbucket Pipelines",
"constant": "BITBUCKET",
"env": "BITBUCKET_COMMIT",
"pr": "BITBUCKET_PR_ID"
},
{
"name": "Bitrise",
"constant": "BITRISE",
"env": "BITRISE_IO",
"pr": "BITRISE_PULL_REQUEST"
},
{
"name": "Buddy",
"constant": "BUDDY",
"env": "BUDDY_WORKSPACE_ID",
"pr": "BUDDY_EXECUTION_PULL_REQUEST_ID"
},
{
"name": "Buildkite",
"constant": "BUILDKITE",
"env": "BUILDKITE",
"pr": { "env": "BUILDKITE_PULL_REQUEST", "ne": "false" }
},
{
"name": "CircleCI",
"constant": "CIRCLE",
"env": "CIRCLECI",
"pr": "CIRCLE_PULL_REQUEST"
},
{
"name": "Cirrus CI",
"constant": "CIRRUS",
"env": "CIRRUS_CI",
"pr": "CIRRUS_PR"
},
{
"name": "AWS CodeBuild",
"constant": "CODEBUILD",
"env": "CODEBUILD_BUILD_ARN"
},
{
"name": "Codeship",
"constant": "CODESHIP",
"env": { "CI_NAME": "codeship" }
},
{
"name": "Drone",
"constant": "DRONE",
"env": "DRONE",
"pr": { "DRONE_BUILD_EVENT": "pull_request" }
},
{
"name": "dsari",
"constant": "DSARI",
"env": "DSARI"
},
{
"name": "GitLab CI",
"constant": "GITLAB",
"env": "GITLAB_CI"
},
{
"name": "GoCD",
"constant": "GOCD",
"env": "GO_PIPELINE_LABEL"
},
{
"name": "Hudson",
"constant": "HUDSON",
"env": "HUDSON_URL"
},
{
"name": "Jenkins",
"constant": "JENKINS",
"env": ["JENKINS_URL", "BUILD_ID"],
"pr": { "any": ["ghprbPullId", "CHANGE_ID"] }
},
{
"name": "Magnum CI",
"constant": "MAGNUM",
"env": "MAGNUM"
},
{
"name": "Netlify CI",
"constant": "NETLIFY",
"env": "NETLIFY_BUILD_BASE",
"pr": { "env": "PULL_REQUEST", "ne": "false" }
},
{
"name": "Sail CI",
"constant": "SAIL",
"env": "SAILCI",
"pr": "SAIL_PULL_REQUEST_NUMBER"
},
{
"name": "Semaphore",
"constant": "SEMAPHORE",
"env": "SEMAPHORE",
"pr": "PULL_REQUEST_NUMBER"
},
{
"name": "Shippable",
"constant": "SHIPPABLE",
"env": "SHIPPABLE",
"pr": { "IS_PULL_REQUEST": "true" }
},
{
"name": "Solano CI",
"constant": "SOLANO",
"env": "TDDIUM",
"pr": "TDDIUM_PR_ID"
},
{
"name": "Strider CD",
"constant": "STRIDER",
"env": "STRIDER"
},
{
"name": "TaskCluster",
"constant": "TASKCLUSTER",
"env": ["TASK_ID", "RUN_ID"]
},
{
"name": "TeamCity",
"constant": "TEAMCITY",
"env": "TEAMCITY_VERSION"
},
{
"name": "Travis CI",
"constant": "TRAVIS",
"env": "TRAVIS",
"pr": { "env": "TRAVIS_PULL_REQUEST", "ne": "false" }
}
]

View File

@@ -0,0 +1,60 @@
declare namespace globalDirectories {
interface GlobalDirectories {
/**
Directory with globally installed packages.
Equivalent to `npm root --global`.
*/
readonly packages: string;
/**
Directory with globally installed binaries.
Equivalent to `npm bin --global`.
*/
readonly binaries: string;
/**
Directory with directories for packages and binaries. You probably want either of the above.
Equivalent to `npm prefix --global`.
*/
readonly prefix: string;
}
}
declare const globalDirectories: {
/**
Get the directory of globally installed packages and binaries.
@example
```
import globalDirectories = require('global-dirs');
console.log(globalDirectories.npm.prefix);
//=> '/usr/local'
console.log(globalDirectories.npm.packages);
//=> '/usr/local/lib/node_modules'
```
*/
readonly npm: globalDirectories.GlobalDirectories;
/**
Get the directory of globally installed packages and binaries.
@example
```
import globalDirectories = require('global-dirs');
console.log(globalDirectories.npm.binaries);
//=> '/usr/local/bin'
console.log(globalDirectories.yarn.packages);
//=> '/Users/sindresorhus/.config/yarn/global/node_modules'
```
*/
readonly yarn: globalDirectories.GlobalDirectories;
}
export = globalDirectories;

View File

@@ -0,0 +1,118 @@
'use strict';
const path = require('path');
const os = require('os');
const fs = require('fs');
const ini = require('ini');
const isWindows = process.platform === 'win32';
const readRc = filePath => {
try {
return ini.parse(fs.readFileSync(filePath, 'utf8')).prefix;
} catch (_) {}
};
const getEnvNpmPrefix = () => {
return Object.keys(process.env).reduce((prefix, name) => {
return (/^npm_config_prefix$/i).test(name) ? process.env[name] : prefix;
}, undefined);
};
const getGlobalNpmrc = () => {
if (isWindows && process.env.APPDATA) {
// Hardcoded contents of `c:\Program Files\nodejs\node_modules\npm\npmrc`
return path.join(process.env.APPDATA, '/npm/etc/npmrc');
}
// Homebrew special case: `$(brew --prefix)/lib/node_modules/npm/npmrc`
if (process.execPath.includes('/Cellar/node')) {
const homebrewPrefix = process.execPath.slice(0, process.execPath.indexOf('/Cellar/node'));
return path.join(homebrewPrefix, '/lib/node_modules/npm/npmrc');
}
if (process.execPath.endsWith('/bin/node')) {
const installDir = path.dirname(path.dirname(process.execPath));
return path.join(installDir, '/etc/npmrc');
}
};
const getDefaultNpmPrefix = () => {
if (isWindows) {
// `c:\node\node.exe` → `prefix=c:\node\`
return path.dirname(process.execPath);
}
// `/usr/local/bin/node` → `prefix=/usr/local`
return path.dirname(path.dirname(process.execPath));
};
const getNpmPrefix = () => {
const envPrefix = getEnvNpmPrefix();
if (envPrefix) {
return envPrefix;
}
const homePrefix = readRc(path.join(os.homedir(), '.npmrc'));
if (homePrefix) {
return homePrefix;
}
if (process.env.PREFIX) {
return process.env.PREFIX;
}
const globalPrefix = readRc(getGlobalNpmrc());
if (globalPrefix) {
return globalPrefix;
}
return getDefaultNpmPrefix();
};
const npmPrefix = path.resolve(getNpmPrefix());
const getYarnWindowsDirectory = () => {
if (isWindows && process.env.LOCALAPPDATA) {
const dir = path.join(process.env.LOCALAPPDATA, 'Yarn');
if (fs.existsSync(dir)) {
return dir;
}
}
return false;
};
const getYarnPrefix = () => {
if (process.env.PREFIX) {
return process.env.PREFIX;
}
const windowsPrefix = getYarnWindowsDirectory();
if (windowsPrefix) {
return windowsPrefix;
}
const configPrefix = path.join(os.homedir(), '.config/yarn');
if (fs.existsSync(configPrefix)) {
return configPrefix;
}
const homePrefix = path.join(os.homedir(), '.yarn-config');
if (fs.existsSync(homePrefix)) {
return homePrefix;
}
// Yarn supports the npm conventions but the inverse is not true
return npmPrefix;
};
exports.npm = {};
exports.npm.prefix = npmPrefix;
exports.npm.packages = path.join(npmPrefix, isWindows ? 'node_modules' : 'lib/node_modules');
exports.npm.binaries = isWindows ? npmPrefix : path.join(npmPrefix, 'bin');
const yarnPrefix = path.resolve(getYarnPrefix());
exports.yarn = {};
exports.yarn.prefix = yarnPrefix;
exports.yarn.packages = path.join(yarnPrefix, getYarnWindowsDirectory() ? 'Data/global/node_modules' : 'global/node_modules');
exports.yarn.binaries = path.join(exports.yarn.packages, '.bin');

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
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.

View File

@@ -0,0 +1,56 @@
{
"name": "global-dirs",
"version": "2.1.0",
"description": "Get the directory of globally installed packages and binaries",
"license": "MIT",
"repository": "sindresorhus/global-dirs",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"global",
"prefix",
"path",
"paths",
"npm",
"yarn",
"node",
"modules",
"node-modules",
"package",
"packages",
"binary",
"binaries",
"bin",
"directory",
"directories",
"npmrc",
"rc",
"config",
"root",
"resolve"
],
"dependencies": {
"ini": "1.3.7"
},
"devDependencies": {
"ava": "^2.4.0",
"execa": "^3.2.0",
"import-fresh": "^3.1.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}

View File

@@ -0,0 +1,72 @@
# global-dirs
> Get the directory of globally installed packages and binaries
Uses the same resolution logic as `npm` and `yarn`.
## Install
```
$ npm install global-dirs
```
## Usage
```js
const globalDirectories = require('global-dirs');
console.log(globalDirectories.npm.prefix);
//=> '/usr/local'
console.log(globalDirectories.npm.packages);
//=> '/usr/local/lib/node_modules'
console.log(globalDirectories.npm.binaries);
//=> '/usr/local/bin'
console.log(globalDirectories.yarn.packages);
//=> '/Users/sindresorhus/.config/yarn/global/node_modules'
```
## API
### globalDirectories
#### npm
#### yarn
##### packages
Directory with globally installed packages.
Equivalent to `npm root --global`.
##### binaries
Directory with globally installed binaries.
Equivalent to `npm bin --global`.
##### prefix
Directory with directories for packages and binaries. You probably want either of the above.
Equivalent to `npm prefix --global`.
## Related
- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
- [is-installed-globally](https://github.com/sindresorhus/is-installed-globally) - Check if your package was installed globally
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-global-dirs?utm_source=npm-global-dirs&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

15
node_modules/update-notifier/node_modules/ini/LICENSE generated vendored Normal file
View File

@@ -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.

102
node_modules/update-notifier/node_modules/ini/README.md generated vendored Normal file
View File

@@ -0,0 +1,102 @@
An ini format parser and serializer for node.
Sections are treated as nested objects. Items before the first
heading are saved on the object directly.
## Usage
Consider an ini-file `config.ini` that looks like this:
; this comment is being ignored
scope = global
[database]
user = dbuser
password = dbpassword
database = use_this_database
[paths.default]
datadir = /var/lib/data
array[] = first value
array[] = second value
array[] = third value
You can read, manipulate and write the ini-file like so:
var fs = require('fs')
, ini = require('ini')
var config = ini.parse(fs.readFileSync('./config.ini', 'utf-8'))
config.scope = 'local'
config.database.database = 'use_another_database'
config.paths.default.tmpdir = '/tmp'
delete config.paths.default.datadir
config.paths.default.array.push('fourth value')
fs.writeFileSync('./config_modified.ini', ini.stringify(config, { section: 'section' }))
This will result in a file called `config_modified.ini` being written
to the filesystem with the following content:
[section]
scope=local
[section.database]
user=dbuser
password=dbpassword
database=use_another_database
[section.paths.default]
tmpdir=/tmp
array[]=first value
array[]=second value
array[]=third value
array[]=fourth value
## API
### decode(inistring)
Decode the ini-style formatted `inistring` into a nested object.
### parse(inistring)
Alias for `decode(inistring)`
### encode(object, [options])
Encode the object `object` into an ini-style formatted string. If the
optional parameter `section` is given, then all top-level properties
of the object are put into this section and the `section`-string is
prepended to all sub-sections, see the usage example above.
The `options` object may contain the following:
* `section` A string which will be the first `section` in the encoded
ini data. Defaults to none.
* `whitespace` Boolean to specify whether to put whitespace around the
`=` character. By default, whitespace is omitted, to be friendly to
some persnickety old parsers that don't tolerate it well. But some
find that it's more human-readable and pretty with the whitespace.
For backwards compatibility reasons, if a `string` options is passed
in, then it is assumed to be the `section` value.
### stringify(object, [options])
Alias for `encode(object, [options])`
### safe(val)
Escapes the string `val` such that it is safe to be used as a key or
value in an ini-file. Basically escapes quotes. For example
ini.safe('"unsafe string"')
would result in
"\"unsafe string\""
### unsafe(val)
Unescapes the string `val`

206
node_modules/update-notifier/node_modules/ini/ini.js generated vendored Normal file
View File

@@ -0,0 +1,206 @@
exports.parse = exports.decode = decode
exports.stringify = exports.encode = encode
exports.safe = safe
exports.unsafe = unsafe
var eol = typeof process !== 'undefined' &&
process.platform === 'win32' ? '\r\n' : '\n'
function encode (obj, opt) {
var children = []
var out = ''
if (typeof opt === 'string') {
opt = {
section: opt,
whitespace: false,
}
} else {
opt = opt || Object.create(null)
opt.whitespace = opt.whitespace === true
}
var separator = opt.whitespace ? ' = ' : '='
Object.keys(obj).forEach(function (k, _, __) {
var val = obj[k]
if (val && Array.isArray(val)) {
val.forEach(function (item) {
out += safe(k + '[]') + separator + safe(item) + '\n'
})
} else if (val && typeof val === 'object')
children.push(k)
else
out += safe(k) + separator + safe(val) + eol
})
if (opt.section && out.length)
out = '[' + safe(opt.section) + ']' + eol + out
children.forEach(function (k, _, __) {
var nk = dotSplit(k).join('\\.')
var section = (opt.section ? opt.section + '.' : '') + nk
var child = encode(obj[k], {
section: section,
whitespace: opt.whitespace,
})
if (out.length && child.length)
out += eol
out += child
})
return out
}
function dotSplit (str) {
return str.replace(/\1/g, '\u0002LITERAL\\1LITERAL\u0002')
.replace(/\\\./g, '\u0001')
.split(/\./).map(function (part) {
return part.replace(/\1/g, '\\.')
.replace(/\2LITERAL\\1LITERAL\2/g, '\u0001')
})
}
function decode (str) {
var out = Object.create(null)
var p = out
var section = null
// section |key = value
var re = /^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i
var lines = str.split(/[\r\n]+/g)
lines.forEach(function (line, _, __) {
if (!line || line.match(/^\s*[;#]/))
return
var match = line.match(re)
if (!match)
return
if (match[1] !== undefined) {
section = unsafe(match[1])
if (section === '__proto__') {
// not allowed
// keep parsing the section, but don't attach it.
p = Object.create(null)
return
}
p = out[section] = out[section] || Object.create(null)
return
}
var key = unsafe(match[2])
if (key === '__proto__')
return
var value = match[3] ? unsafe(match[4]) : true
switch (value) {
case 'true':
case 'false':
case 'null': value = JSON.parse(value)
}
// Convert keys with '[]' suffix to an array
if (key.length > 2 && key.slice(-2) === '[]') {
key = key.substring(0, key.length - 2)
if (key === '__proto__')
return
if (!p[key])
p[key] = []
else if (!Array.isArray(p[key]))
p[key] = [p[key]]
}
// safeguard against resetting a previously defined
// array by accidentally forgetting the brackets
if (Array.isArray(p[key]))
p[key].push(value)
else
p[key] = value
})
// {a:{y:1},"a.b":{x:2}} --> {a:{y:1,b:{x:2}}}
// use a filter to return the keys that have to be deleted.
Object.keys(out).filter(function (k, _, __) {
if (!out[k] ||
typeof out[k] !== 'object' ||
Array.isArray(out[k]))
return false
// see if the parent section is also an object.
// if so, add it to that, and mark this one for deletion
var parts = dotSplit(k)
var p = out
var l = parts.pop()
var nl = l.replace(/\\\./g, '.')
parts.forEach(function (part, _, __) {
if (part === '__proto__')
return
if (!p[part] || typeof p[part] !== 'object')
p[part] = Object.create(null)
p = p[part]
})
if (p === out && nl === l)
return false
p[nl] = out[k]
return true
}).forEach(function (del, _, __) {
delete out[del]
})
return out
}
function isQuoted (val) {
return (val.charAt(0) === '"' && val.slice(-1) === '"') ||
(val.charAt(0) === "'" && val.slice(-1) === "'")
}
function safe (val) {
return (typeof val !== 'string' ||
val.match(/[=\r\n]/) ||
val.match(/^\[/) ||
(val.length > 1 &&
isQuoted(val)) ||
val !== val.trim())
? JSON.stringify(val)
: val.replace(/;/g, '\\;').replace(/#/g, '\\#')
}
function unsafe (val, doUnesc) {
val = (val || '').trim()
if (isQuoted(val)) {
// remove the single quotes before calling JSON.parse
if (val.charAt(0) === "'")
val = val.substr(1, val.length - 2)
try {
val = JSON.parse(val)
} catch (_) {}
} else {
// walk the val to find the first not-escaped ; character
var esc = false
var unesc = ''
for (var i = 0, l = val.length; i < l; i++) {
var c = val.charAt(i)
if (esc) {
if ('\\;#'.indexOf(c) !== -1)
unesc += c
else
unesc += '\\' + c
esc = false
} else if (';#'.indexOf(c) !== -1)
break
else if (c === '\\')
esc = true
else
unesc += c
}
if (esc)
unesc += '\\'
return unesc.trim()
}
return val
}

View File

@@ -0,0 +1,33 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "ini",
"description": "An ini encoder/decoder for node",
"version": "1.3.7",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/ini.git"
},
"main": "ini.js",
"scripts": {
"eslint": "eslint",
"lint": "npm run eslint -- ini.js test/*.js",
"lintfix": "npm run lint -- --fix",
"test": "tap",
"posttest": "npm run lint",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags"
},
"devDependencies": {
"eslint": "^7.9.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"tap": "14"
},
"license": "ISC",
"files": [
"ini.js"
]
}

View File

@@ -0,0 +1,14 @@
# Changelog
## v2.0.0
Breaking changes:
* Drop support for Node.js end-of-life versions: 0.10, 0.12, 4, 5, 7,
and 9
Other changes:
See [ci-info
changelog](https://github.com/watson/ci-info/blob/master/CHANGELOG.md#v200)
for a list of newly supported CI servers.

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2016-2018 Thomas Watson Steen
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.

View File

@@ -0,0 +1,50 @@
# is-ci
Returns `true` if the current environment is a Continuous Integration
server.
Please [open an issue](https://github.com/watson/is-ci/issues) if your
CI server isn't properly detected :)
[![npm](https://img.shields.io/npm/v/is-ci.svg)](https://www.npmjs.com/package/is-ci)
[![Build status](https://travis-ci.org/watson/is-ci.svg?branch=master)](https://travis-ci.org/watson/is-ci)
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)
## Installation
```bash
npm install is-ci --save
```
## Programmatic Usage
```js
const isCI = require('is-ci')
if (isCI) {
console.log('The code is running on a CI server')
}
```
## CLI Usage
For CLI usage you need to have the `is-ci` executable in your `PATH`.
There's a few ways to do that:
- Either install the module globally using `npm install is-ci -g`
- Or add the module as a dependency to your app in which case it can be
used inside your package.json scripts as is
- Or provide the full path to the executable, e.g.
`./node_modules/.bin/is-ci`
```bash
is-ci && echo "This is a CI server"
```
## Supported CI tools
Refer to [ci-info](https://github.com/watson/ci-info#supported-ci-tools) docs for all supported CI's
## License
[MIT](LICENSE)

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env node
'use strict'
process.exit(require('./') ? 0 : 1)

View File

@@ -0,0 +1,3 @@
'use strict'
module.exports = require('ci-info').isCI

View File

@@ -0,0 +1,38 @@
{
"name": "is-ci",
"version": "2.0.0",
"description": "Detect if the current environment is a CI server",
"bin": "bin.js",
"main": "index.js",
"dependencies": {
"ci-info": "^2.0.0"
},
"devDependencies": {
"clear-module": "^3.0.0",
"standard": "^12.0.1"
},
"scripts": {
"test": "standard && node test.js"
},
"repository": {
"type": "git",
"url": "https://github.com/watson/is-ci.git"
},
"keywords": [
"ci",
"continuous",
"integration",
"test",
"detect"
],
"author": "Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",
"license": "MIT",
"bugs": {
"url": "https://github.com/watson/is-ci/issues"
},
"homepage": "https://github.com/watson/is-ci",
"coordinates": [
55.778272,
12.593116
]
}

View File

@@ -0,0 +1,19 @@
/**
Check if your package was installed globally.
@example
```
import isInstalledGlobally = require('is-installed-globally');
// With `npm install your-package`
console.log(isInstalledGlobally);
//=> false
// With `npm install --global your-package`
console.log(isInstalledGlobally);
//=> true
```
*/
declare const isInstalledGlobally: boolean;
export = isInstalledGlobally;

View File

@@ -0,0 +1,15 @@
'use strict';
const fs = require('fs');
const globalDirs = require('global-dirs');
const isPathInside = require('is-path-inside');
module.exports = (() => {
try {
return (
isPathInside(__dirname, globalDirs.yarn.packages) ||
isPathInside(__dirname, fs.realpathSync(globalDirs.npm.packages))
);
} catch (_) {
return false;
}
})();

View File

@@ -0,0 +1,9 @@
MIT License
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
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.

View File

@@ -0,0 +1,54 @@
{
"name": "is-installed-globally",
"version": "0.3.2",
"description": "Check if your package was installed globally",
"license": "MIT",
"repository": "sindresorhus/is-installed-globally",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"global",
"package",
"globally",
"module",
"install",
"installed",
"npm",
"yarn",
"is",
"check",
"detect",
"local",
"locally",
"cli",
"bin",
"binary"
],
"dependencies": {
"global-dirs": "^2.0.1",
"is-path-inside": "^3.0.1"
},
"devDependencies": {
"ava": "^2.4.0",
"cpy": "^7.3.0",
"del": "^5.1.0",
"execa": "^2.0.4",
"make-dir": "^3.0.0",
"tsd": "^0.10.0",
"xo": "^0.25.3"
}
}

View File

@@ -0,0 +1,34 @@
# is-installed-globally [![Build Status](https://travis-ci.org/sindresorhus/is-installed-globally.svg?branch=master)](https://travis-ci.org/sindresorhus/is-installed-globally)
> Check if your package was installed globally
Can be useful if your CLI needs different behavior when installed globally and locally.
## Install
```
$ npm install is-installed-globally
```
## Usage
```js
const isInstalledGlobally = require('is-installed-globally');
// With `npm install your-package`
console.log(isInstalledGlobally);
//=> false
// With `npm install --global your-package`
console.log(isInstalledGlobally);
//=> true
```
## Related
- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
- [resolve-global](https://github.com/sindresorhus/resolve-global) - Resolve the path of a globally installed module
- [global-dirs](https://github.com/sindresorhus/global-dirs) - Get the directory of globally installed packages and binaries