This commit is contained in:
Stephen Franceschelli 2019-07-30 13:30:32 -04:00
parent ffce9ce43f
commit a966e84ff9
6749 changed files with 937822 additions and 460 deletions

7
node_modules/import-local/fixtures/cli.js generated vendored Normal file
View file

@ -0,0 +1,7 @@
#!/usr/bin/env node
'use strict';
const importLocal = require('..');
if (importLocal(__filename)) {
console.log('local');
}

17
node_modules/import-local/index.js generated vendored Normal file
View file

@ -0,0 +1,17 @@
'use strict';
const path = require('path');
const resolveCwd = require('resolve-cwd');
const pkgDir = require('pkg-dir');
module.exports = filename => {
const globalDir = pkgDir.sync(path.dirname(filename));
const relativePath = path.relative(globalDir, filename);
const pkg = require(path.join(globalDir, 'package.json'));
const localFile = resolveCwd.silent(path.join(pkg.name, relativePath));
// Use `path.relative()` to detect local package installation,
// because __filename's case is inconsistent on Windows
// Can use `===` when targeting Node.js 8
// See https://github.com/nodejs/node/issues/6624
return localFile && path.relative(localFile, filename) !== '' ? require(localFile) : null;
};

9
node_modules/import-local/license generated vendored Normal file
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,10 @@
'use strict';
const path = require('path');
const findUp = require('find-up');
module.exports = cwd => findUp('package.json', {cwd}).then(fp => fp ? path.dirname(fp) : null);
module.exports.sync = cwd => {
const fp = findUp.sync('package.json', {cwd});
return fp ? path.dirname(fp) : null;
};

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,85 @@
{
"_from": "pkg-dir@^3.0.0",
"_id": "pkg-dir@3.0.0",
"_inBundle": false,
"_integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
"_location": "/import-local/pkg-dir",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "pkg-dir@^3.0.0",
"name": "pkg-dir",
"escapedName": "pkg-dir",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/import-local"
],
"_resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
"_shasum": "2749020f239ed990881b1f71210d51eb6523bea3",
"_spec": "pkg-dir@^3.0.0",
"_where": "E:\\github\\setup-go\\node_modules\\import-local",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/pkg-dir/issues"
},
"bundleDependencies": false,
"dependencies": {
"find-up": "^3.0.0"
},
"deprecated": false,
"description": "Find the root directory of a Node.js project or npm package",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/pkg-dir#readme",
"keywords": [
"package",
"json",
"root",
"npm",
"entry",
"find",
"up",
"find-up",
"findup",
"look-up",
"look",
"file",
"search",
"match",
"resolve",
"parent",
"parents",
"folder",
"directory",
"dir",
"walk",
"walking",
"path"
],
"license": "MIT",
"name": "pkg-dir",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/pkg-dir.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "3.0.0"
}

View file

@ -0,0 +1,66 @@
# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir)
> Find the root directory of a Node.js project or npm package
## Install
```
$ npm install pkg-dir
```
## Usage
```
/
└── Users
└── sindresorhus
└── foo
├── package.json
└── bar
├── baz
└── example.js
```
```js
// example.js
const pkgDir = require('pkg-dir');
(async () => {
const rootDir = await pkgDir(__dirname);
console.log(rootDir);
//=> '/Users/sindresorhus/foo'
})();
```
## API
### pkgDir([cwd])
Returns a `Promise` for either the project root path or `null` if it couldn't be found.
### pkgDir.sync([cwd])
Returns the project root path or `null`.
#### cwd
Type: `string`<br>
Default: `process.cwd()`
Directory to start from.
## Related
- [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
- [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

86
node_modules/import-local/package.json generated vendored Normal file
View file

@ -0,0 +1,86 @@
{
"_from": "import-local@^2.0.0",
"_id": "import-local@2.0.0",
"_inBundle": false,
"_integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==",
"_location": "/import-local",
"_phantomChildren": {
"find-up": "3.0.0"
},
"_requested": {
"type": "range",
"registry": true,
"raw": "import-local@^2.0.0",
"name": "import-local",
"escapedName": "import-local",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/jest",
"/jest/jest-cli"
],
"_resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz",
"_shasum": "55070be38a5993cf18ef6db7e961f5bee5c5a09d",
"_spec": "import-local@^2.0.0",
"_where": "E:\\github\\setup-go\\node_modules\\jest",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bin": {
"import-local-fixture": "fixtures/cli.js"
},
"bugs": {
"url": "https://github.com/sindresorhus/import-local/issues"
},
"bundleDependencies": false,
"dependencies": {
"pkg-dir": "^3.0.0",
"resolve-cwd": "^2.0.0"
},
"deprecated": false,
"description": "Let a globally installed package use a locally installed version of itself if available",
"devDependencies": {
"ava": "*",
"cpy": "^7.0.1",
"del": "^3.0.0",
"execa": "^0.11.0",
"xo": "*"
},
"engines": {
"node": ">=6"
},
"files": [
"index.js",
"fixtures/cli.js"
],
"homepage": "https://github.com/sindresorhus/import-local#readme",
"keywords": [
"import",
"local",
"require",
"resolve",
"global",
"version",
"prefer",
"cli"
],
"license": "MIT",
"name": "import-local",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/import-local.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.0",
"xo": {
"ignores": [
"fixtures"
]
}
}

30
node_modules/import-local/readme.md generated vendored Normal file
View file

@ -0,0 +1,30 @@
# import-local [![Build Status](https://travis-ci.org/sindresorhus/import-local.svg?branch=master)](https://travis-ci.org/sindresorhus/import-local)
> Let a globally installed package use a locally installed version of itself if available
Useful for CLI tools that want to defer to the user's locally installed version when available, but still work if it's not installed locally. For example, [AVA](http://ava.li) and [XO](https://github.com/xojs/xo) uses this method.
## Install
```
$ npm install import-local
```
## Usage
```js
const importLocal = require('import-local');
if (importLocal(__filename)) {
console.log('Using local version of this package');
} else {
// Code for both global and local version here…
}
```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)