1
0
mirror of https://github.com/S2-/gitlit synced 2025-08-03 21:00:04 +02:00

remove electron-in-page-search

This commit is contained in:
s2
2019-06-06 15:44:24 +02:00
parent e2a57318a7
commit c5f9b551ab
92637 changed files with 636010 additions and 15 deletions

5
app/node_modules/get-package-info/.babelrc generated vendored Normal file
View File

@@ -0,0 +1,5 @@
{
"presets": [
"es2015"
]
}

4
app/node_modules/get-package-info/.npmignore generated vendored Normal file
View File

@@ -0,0 +1,4 @@
node_modules/
src/
*.log

4
app/node_modules/get-package-info/.travis.yml generated vendored Normal file
View File

@@ -0,0 +1,4 @@
language: node_js
node_js:
- "4"
- "6"

9
app/node_modules/get-package-info/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright (c) 2016 Rahat Ahmed
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.

66
app/node_modules/get-package-info/README.md generated vendored Normal file
View File

@@ -0,0 +1,66 @@
# get-package-info [![Build Status](https://travis-ci.org/rahatarmanahmed/get-package-info.svg?branch=master)](https://travis-ci.org/rahatarmanahmed/get-package-info)
Gets properties from package.json files in parent directories.
## Installing
`npm install get-package-info`
## Usage
### `getPackageInfo(props, dir, [cb])`
Searches for properties from package.json starting from the given directory going upwards, until all properties are found. Properties are set to the first instance found, and not overwritten. It returns a promise that resolves with the results (see [example](#Example) below for the structure of the results object). You may also specify a node-style callback if you prefer.
#### `props`
An array of string properties to search for. Nested properties can be retreived with dot notation (ex: `dependencies.lodash`).
If an individual property is an array, it will search for those properties in order, and the first value found will be saved under all the given properties. This is useful if you want at least one of those properties, but don't want the search to fail when it finds one but not another. Ex: `getPackageInfo([['dependencies.lodash', 'devDependencies.lodash']], dir)` will search for lodash in both `dependencies` and `devDependencies`, and save whichever one it finds first under both properties in the results.
#### `dir`
The initial directory to search in. `getPackageInfo(props, dir)` will look for a package.json in `dir`, and get the requested properties. If all the properties are not found, it will look in package.json files in parent directories.
## Example
```js
var getPackageInfo = require('get-package-info');
getPackageInfo([['productName', 'name'], 'dependencies.lodash'], '/path/to/dir')
.then((result) => {
console.log(result);
});
```
Possible output, depending on the directory structure and package.json contents:
```
{
values: {
name: 'package-name',
'dependencies.lodash': '~3.0.0'
},
source: {
productName: {
src: '/path/to/dir/package.json',
pkg: { ... }, // the parsed package.json this property came from
prop: 'productName'
},
name: {
src: '/path/to/dir/package.json',
pkg: { ... }, // the parsed package.json this property came from
prop: 'productName' // name uses productName's value because productName has priority
},
'dependencies.lodash': {
src: '/path/to/package.json', // This property was found in a higher directory
pkg: { ... },
prop: 'dependencies.lodash'
}
}
}
*/
```
## Handling Errors
If all the properties cannot be found in parent package.json files, then `getPackageInfo()` will reject it's promise (or callback with err argument) with an Error. `err.missingProps` will have an array of the properties that it could not find, and `err.result` will contain all the props that were found.
If any other error occurs(like I/O or runtime errors), `getPackageInfo()` will reject with that error itself.

88
app/node_modules/get-package-info/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,88 @@
'use strict';
var Promise = require('bluebird');
var get = require('lodash.get');
var readPkgUp = require('read-pkg-up');
var path = require('path');
var debug = require('debug')('get-package-info');
var getInfo = function getInfo(props, dir, result) {
if (!Array.isArray(props)) return Promise.reject(new Error('First argument must be array of properties to retrieve.'));
if (!props.length) return Promise.resolve(result);
debug('Getting props: ', props);
debug('Looking up starting from directory: ', dir);
debug('Result so far:', result);
return Promise.resolve(readPkgUp({ cwd: dir, normalize: false })).then(function (_ref) {
var src = _ref.path;
var pkg = _ref.pkg;
if (!src) {
debug('Couldn\'t find any more package.json files');
var err = new Error('Unable to find all properties in parent package.json files. Missing props: ' + props.map(function (prop) {
return JSON.stringify(prop);
}).join(', '));
err.missingProps = props;
err.result = result;
throw err;
}
debug('Checking props in package.json found at:', src);
var nextProps = [];
props.forEach(function (prop) {
// For props given as array
// Look for props in that order, and when found
// save value under all given props
if (Array.isArray(prop)) {
(function () {
var value = void 0,
sourceProp = void 0;
prop.some(function (p) {
sourceProp = p;
value = get(pkg, p);
return value;
});
if (value !== undefined) {
debug('Found prop:', prop);
prop.forEach(function (p) {
result.values[p] = value;
result.source[p] = { src: src, pkg: pkg, prop: sourceProp };
});
} else {
debug('Couldn\'t find prop:', prop);
nextProps.push(prop);
}
})();
} else {
// For regular string props, just look normally
var _value = get(pkg, prop);
if (_value !== undefined) {
debug('Found prop:', prop);
result.values[prop] = _value;
result.source[prop] = { src: src, pkg: pkg, prop: prop };
} else {
debug('Couldn\'t find prop:', prop);
nextProps.push(prop);
}
}
});
// Still have props to look for, look at another package.json above this one
if (nextProps.length) {
debug('Not all props satisfied, looking for parent package.json');
return getInfo(nextProps, path.join(path.dirname(src), '..'), result);
}
debug('Found all props!');
return result;
});
};
module.exports = function (props, dir, cb) {
return getInfo(props, dir, { values: {}, source: {} }).nodeify(cb);
};

View File

@@ -0,0 +1,48 @@
'use strict';
const path = require('path');
const locatePath = require('locate-path');
module.exports = (filename, opts) => {
opts = opts || {};
const startDir = path.resolve(opts.cwd || '');
const root = path.parse(startDir).root;
const filenames = [].concat(filename);
return new Promise(resolve => {
(function find(dir) {
locatePath(filenames, {cwd: dir}).then(file => {
if (file) {
resolve(path.join(dir, file));
} else if (dir === root) {
resolve(null);
} else {
find(path.dirname(dir));
}
});
})(startDir);
});
};
module.exports.sync = (filename, opts) => {
opts = opts || {};
let dir = path.resolve(opts.cwd || '');
const root = path.parse(dir).root;
const filenames = [].concat(filename);
// eslint-disable-next-line no-constant-condition
while (true) {
const file = locatePath.sync(filenames, {cwd: dir});
if (file) {
return path.join(dir, file);
} else if (dir === root) {
return null;
}
dir = path.dirname(dir);
}
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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": "find-up@^2.0.0",
"_id": "find-up@2.1.0",
"_inBundle": false,
"_integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=",
"_location": "/get-package-info/find-up",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "find-up@^2.0.0",
"name": "find-up",
"escapedName": "find-up",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/get-package-info/read-pkg-up"
],
"_resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz",
"_shasum": "45d1b7e506c717ddd482775a2b77920a3c0c57a7",
"_spec": "find-up@^2.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg-up",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/find-up/issues"
},
"bundleDependencies": false,
"dependencies": {
"locate-path": "^2.0.0"
},
"deprecated": false,
"description": "Find a file by walking up parent directories",
"devDependencies": {
"ava": "*",
"tempfile": "^1.1.1",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/find-up#readme",
"keywords": [
"find",
"up",
"find-up",
"findup",
"look-up",
"look",
"file",
"search",
"match",
"package",
"resolve",
"parent",
"parents",
"folder",
"directory",
"dir",
"walk",
"walking",
"path"
],
"license": "MIT",
"name": "find-up",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/find-up.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.1.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,85 @@
# find-up [![Build Status: Linux and macOS](https://travis-ci.org/sindresorhus/find-up.svg?branch=master)](https://travis-ci.org/sindresorhus/find-up) [![Build Status: Windows](https://ci.appveyor.com/api/projects/status/l0cyjmvh5lq72vq2/branch/master?svg=true)](https://ci.appveyor.com/project/sindresorhus/find-up/branch/master)
> Find a file by walking up parent directories
## Install
```
$ npm install --save find-up
```
## Usage
```
/
└── Users
└── sindresorhus
├── unicorn.png
└── foo
└── bar
├── baz
└── example.js
```
```js
// example.js
const findUp = require('find-up');
findUp('unicorn.png').then(filepath => {
console.log(filepath);
//=> '/Users/sindresorhus/unicorn.png'
});
findUp(['rainbow.png', 'unicorn.png']).then(filepath => {
console.log(filepath);
//=> '/Users/sindresorhus/unicorn.png'
});
```
## API
### findUp(filename, [options])
Returns a `Promise` for the filepath or `null`.
### findUp([filenameA, filenameB], [options])
Returns a `Promise` for the first filepath found (by respecting the order) or `null`.
### findUp.sync(filename, [options])
Returns a filepath or `null`.
### findUp.sync([filenameA, filenameB], [options])
Returns the first filepath found (by respecting the order) or `null`.
#### filename
Type: `string`
Filename of the file to find.
#### options
##### cwd
Type: `string`<br>
Default: `process.cwd()`
Directory to start from.
## Related
- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,11 @@
'use strict';
const path = require('path');
const fs = require('graceful-fs');
const stripBom = require('strip-bom');
const parseJson = require('parse-json');
const pify = require('pify');
const parse = (data, fp) => parseJson(stripBom(data), path.relative('.', fp));
module.exports = fp => pify(fs.readFile)(fp, 'utf8').then(data => parse(data, fp));
module.exports.sync = fp => parse(fs.readFileSync(fp, 'utf8'), fp);

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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,75 @@
{
"_from": "load-json-file@^2.0.0",
"_id": "load-json-file@2.0.0",
"_inBundle": false,
"_integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=",
"_location": "/get-package-info/load-json-file",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "load-json-file@^2.0.0",
"name": "load-json-file",
"escapedName": "load-json-file",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/get-package-info/read-pkg"
],
"_resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz",
"_shasum": "7947e42149af80d696cbf797bcaabcfe1fe29ca8",
"_spec": "load-json-file@^2.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/load-json-file/issues"
},
"bundleDependencies": false,
"dependencies": {
"graceful-fs": "^4.1.2",
"parse-json": "^2.2.0",
"pify": "^2.0.0",
"strip-bom": "^3.0.0"
},
"deprecated": false,
"description": "Read and parse a JSON file",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/load-json-file#readme",
"keywords": [
"read",
"json",
"parse",
"file",
"fs",
"graceful",
"load"
],
"license": "MIT",
"name": "load-json-file",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/load-json-file.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,45 @@
# load-json-file [![Build Status](https://travis-ci.org/sindresorhus/load-json-file.svg?branch=master)](https://travis-ci.org/sindresorhus/load-json-file)
> Read and parse a JSON file
[Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom), uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs), and throws more [helpful JSON errors](https://github.com/sindresorhus/parse-json).
## Install
```
$ npm install --save load-json-file
```
## Usage
```js
const loadJsonFile = require('load-json-file');
loadJsonFile('foo.json').then(json => {
console.log(json);
//=> {foo: true}
});
```
## API
### loadJsonFile(filepath)
Returns a promise for the parsed JSON.
### loadJsonFile.sync(filepath)
Returns the parsed JSON.
## Related
- [write-json-file](https://github.com/sindresorhus/write-json-file) - Stringify and write JSON to a file atomically
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,26 @@
'use strict';
const fs = require('fs');
const pify = require('pify');
function type(fn, fn2, fp) {
if (typeof fp !== 'string') {
return Promise.reject(new TypeError(`Expected a string, got ${typeof fp}`));
}
return pify(fs[fn])(fp).then(stats => stats[fn2]());
}
function typeSync(fn, fn2, fp) {
if (typeof fp !== 'string') {
throw new TypeError(`Expected a string, got ${typeof fp}`);
}
return fs[fn](fp)[fn2]();
}
exports.file = type.bind(null, 'stat', 'isFile');
exports.dir = type.bind(null, 'stat', 'isDirectory');
exports.symlink = type.bind(null, 'lstat', 'isSymbolicLink');
exports.fileSync = typeSync.bind(null, 'statSync', 'isFile');
exports.dirSync = typeSync.bind(null, 'statSync', 'isDirectory');
exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink');

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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,80 @@
{
"_from": "path-type@^2.0.0",
"_id": "path-type@2.0.0",
"_inBundle": false,
"_integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=",
"_location": "/get-package-info/path-type",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "path-type@^2.0.0",
"name": "path-type",
"escapedName": "path-type",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/get-package-info/read-pkg"
],
"_resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz",
"_shasum": "f012ccb8415b7096fc2daa1054c3d72389594c73",
"_spec": "path-type@^2.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/path-type/issues"
},
"bundleDependencies": false,
"dependencies": {
"pify": "^2.0.0"
},
"deprecated": false,
"description": "Check if a path is a file, directory, or symlink",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/path-type#readme",
"keywords": [
"path",
"fs",
"type",
"is",
"check",
"directory",
"dir",
"file",
"filepath",
"symlink",
"symbolic",
"link",
"stat",
"stats",
"filesystem"
],
"license": "MIT",
"name": "path-type",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/path-type.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,42 @@
# path-type [![Build Status](https://travis-ci.org/sindresorhus/path-type.svg?branch=master)](https://travis-ci.org/sindresorhus/path-type)
> Check if a path is a file, directory, or symlink
## Install
```
$ npm install --save path-type
```
## Usage
```js
const pathType = require('path-type');
pathType.file('package.json').then(isFile => {
console.log(isFile);
//=> true
})
```
## API
### .file(path)
### .dir(path)
### .symlink(path)
Returns a `Promise` for a `boolean` of whether the path is the checked type.
### .fileSync(path)
### .dirSync(path)
### .symlinkSync(path)
Returns a `boolean` of whether the path is the checked type.
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,26 @@
'use strict';
const findUp = require('find-up');
const readPkg = require('read-pkg');
module.exports = opts => {
return findUp('package.json', opts).then(fp => {
if (!fp) {
return {};
}
return readPkg(fp, opts).then(pkg => ({pkg, path: fp}));
});
};
module.exports.sync = opts => {
const fp = findUp.sync('package.json', opts);
if (!fp) {
return {};
}
return {
pkg: readPkg.sync(fp, opts),
path: fp
};
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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,94 @@
{
"_from": "read-pkg-up@^2.0.0",
"_id": "read-pkg-up@2.0.0",
"_inBundle": false,
"_integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=",
"_location": "/get-package-info/read-pkg-up",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "read-pkg-up@^2.0.0",
"name": "read-pkg-up",
"escapedName": "read-pkg-up",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/get-package-info"
],
"_resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz",
"_shasum": "6b72a8048984e0c41e79510fd5e9fa99b3b549be",
"_spec": "read-pkg-up@^2.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/read-pkg-up/issues"
},
"bundleDependencies": false,
"dependencies": {
"find-up": "^2.0.0",
"read-pkg": "^2.0.0"
},
"deprecated": false,
"description": "Read the closest package.json file",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/read-pkg-up#readme",
"keywords": [
"json",
"read",
"parse",
"file",
"fs",
"graceful",
"load",
"pkg",
"package",
"find",
"up",
"find-up",
"findup",
"look-up",
"look",
"file",
"search",
"match",
"package",
"resolve",
"parent",
"parents",
"folder",
"directory",
"dir",
"walk",
"walking",
"path"
],
"license": "MIT",
"name": "read-pkg-up",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/read-pkg-up.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,80 @@
# read-pkg-up [![Build Status](https://travis-ci.org/sindresorhus/read-pkg-up.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg-up)
> Read the closest package.json file
## Why
- [Finds the closest package.json](https://github.com/sindresorhus/find-up)
- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom)
- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
## Install
```
$ npm install --save read-pkg-up
```
## Usage
```js
const readPkgUp = require('read-pkg-up');
readPkgUp().then(result => {
console.log(result);
/*
{
pkg: {
name: 'awesome-package',
version: '1.0.0',
...
},
path: '/Users/sindresorhus/dev/awesome-package/package.json'
}
*/
});
```
## API
### readPkgUp([options])
Returns a `Promise` for the result object.
### readPkgUp.sync([options])
Returns the result object.
#### options
##### cwd
Type: `string`<br>
Default: `.`
Directory to start looking for a package.json file.
##### normalize
Type: `boolean`<br>
Default: `true`
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
## Related
- [read-pkg](https://github.com/sindresorhus/read-pkg) - Read a package.json file
- [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
- [pkg-conf](https://github.com/sindresorhus/pkg-conf) - Get namespaced config from the closest package.json
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,47 @@
'use strict';
const path = require('path');
const loadJsonFile = require('load-json-file');
const pathType = require('path-type');
module.exports = (fp, opts) => {
if (typeof fp !== 'string') {
opts = fp;
fp = '.';
}
opts = opts || {};
return pathType.dir(fp)
.then(isDir => {
if (isDir) {
fp = path.join(fp, 'package.json');
}
return loadJsonFile(fp);
})
.then(x => {
if (opts.normalize !== false) {
require('normalize-package-data')(x);
}
return x;
});
};
module.exports.sync = (fp, opts) => {
if (typeof fp !== 'string') {
opts = fp;
fp = '.';
}
opts = opts || {};
fp = pathType.dirSync(fp) ? path.join(fp, 'package.json') : fp;
const x = loadJsonFile.sync(fp);
if (opts.normalize !== false) {
require('normalize-package-data')(x);
}
return x;
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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,77 @@
{
"_from": "read-pkg@^2.0.0",
"_id": "read-pkg@2.0.0",
"_inBundle": false,
"_integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=",
"_location": "/get-package-info/read-pkg",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "read-pkg@^2.0.0",
"name": "read-pkg",
"escapedName": "read-pkg",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/get-package-info/read-pkg-up"
],
"_resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz",
"_shasum": "8ef1c0623c6a6db0dc6713c4bfac46332b2368f8",
"_spec": "read-pkg@^2.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\read-pkg-up",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/read-pkg/issues"
},
"bundleDependencies": false,
"dependencies": {
"load-json-file": "^2.0.0",
"normalize-package-data": "^2.3.2",
"path-type": "^2.0.0"
},
"deprecated": false,
"description": "Read a package.json file",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/read-pkg#readme",
"keywords": [
"json",
"read",
"parse",
"file",
"fs",
"graceful",
"load",
"pkg",
"package",
"normalize"
],
"license": "MIT",
"name": "read-pkg",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/read-pkg.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "2.0.0",
"xo": {
"esnext": true
}
}

View File

@@ -0,0 +1,79 @@
# read-pkg [![Build Status](https://travis-ci.org/sindresorhus/read-pkg.svg?branch=master)](https://travis-ci.org/sindresorhus/read-pkg)
> Read a package.json file
## Why
- [Gracefully handles filesystem issues](https://github.com/isaacs/node-graceful-fs)
- [Strips UTF-8 BOM](https://github.com/sindresorhus/strip-bom)
- [Throws more helpful JSON errors](https://github.com/sindresorhus/parse-json)
- [Normalizes the data](https://github.com/npm/normalize-package-data#what-normalization-currently-entails)
## Install
```
$ npm install --save read-pkg
```
## Usage
```js
const readPkg = require('read-pkg');
readPkg().then(pkg => {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
readPkg(__dirname).then(pkg => {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
readPkg(path.join('unicorn', 'package.json')).then(pkg => {
console.log(pkg);
//=> {name: 'read-pkg', ...}
});
```
## API
### readPkg([path], [options])
Returns a `Promise` for the parsed JSON.
### readPkg.sync([path], [options])
Returns the parsed JSON.
#### path
Type: `string`<br>
Default: `.`
Path to a `package.json` file or its directory.
#### options
##### normalize
Type: `boolean`<br>
Default: `true`
[Normalize](https://github.com/npm/normalize-package-data#what-normalization-currently-entails) the package data.
## Related
- [read-pkg-up](https://github.com/sindresorhus/read-pkg-up) - Read the closest package.json file
- [write-pkg](https://github.com/sindresorhus/write-pkg) - Write a `package.json` file
- [load-json-file](https://github.com/sindresorhus/load-json-file) - Read and parse a JSON file
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

View File

@@ -0,0 +1,14 @@
'use strict';
module.exports = x => {
if (typeof x !== 'string') {
throw new TypeError('Expected a string, got ' + typeof x);
}
// Catches EFBBBF (UTF-8 BOM) because the buffer-to-string
// conversion translates it to FEFF (UTF-16 BOM)
if (x.charCodeAt(0) === 0xFEFF) {
return x.slice(1);
}
return x;
};

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
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,72 @@
{
"_from": "strip-bom@^3.0.0",
"_id": "strip-bom@3.0.0",
"_inBundle": false,
"_integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=",
"_location": "/get-package-info/strip-bom",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "strip-bom@^3.0.0",
"name": "strip-bom",
"escapedName": "strip-bom",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/get-package-info/load-json-file"
],
"_resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
"_shasum": "2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3",
"_spec": "strip-bom@^3.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\get-package-info\\node_modules\\load-json-file",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"bugs": {
"url": "https://github.com/sindresorhus/strip-bom/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Strip UTF-8 byte order mark (BOM) from a string",
"devDependencies": {
"ava": "*",
"xo": "*"
},
"engines": {
"node": ">=4"
},
"files": [
"index.js"
],
"homepage": "https://github.com/sindresorhus/strip-bom#readme",
"keywords": [
"strip",
"bom",
"byte",
"order",
"mark",
"unicode",
"utf8",
"utf-8",
"remove",
"delete",
"trim",
"text",
"string"
],
"license": "MIT",
"name": "strip-bom",
"repository": {
"type": "git",
"url": "git+https://github.com/sindresorhus/strip-bom.git"
},
"scripts": {
"test": "xo && ava"
},
"version": "3.0.0"
}

View File

@@ -0,0 +1,36 @@
# strip-bom [![Build Status](https://travis-ci.org/sindresorhus/strip-bom.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-bom)
> Strip UTF-8 [byte order mark](http://en.wikipedia.org/wiki/Byte_order_mark#UTF-8) (BOM) from a string
From Wikipedia:
> The Unicode Standard permits the BOM in UTF-8, but does not require nor recommend its use. Byte order has no meaning in UTF-8.
## Install
```
$ npm install --save strip-bom
```
## Usage
```js
const stripBom = require('strip-bom');
stripBom('\uFEFFunicorn');
//=> 'unicorn'
```
## Related
- [strip-bom-cli](https://github.com/sindresorhus/strip-bom-cli) - CLI for this module
- [strip-bom-buf](https://github.com/sindresorhus/strip-bom-buf) - Buffer version of this module
- [strip-bom-stream](https://github.com/sindresorhus/strip-bom-stream) - Stream version of this module
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)

77
app/node_modules/get-package-info/package.json generated vendored Normal file
View File

@@ -0,0 +1,77 @@
{
"_from": "get-package-info@^1.0.0",
"_id": "get-package-info@1.0.0",
"_inBundle": false,
"_integrity": "sha1-ZDJ5ZWPigRPNlHTbvQAFKYWkmZw=",
"_location": "/get-package-info",
"_phantomChildren": {
"graceful-fs": "4.1.15",
"locate-path": "2.0.0",
"normalize-package-data": "2.5.0",
"parse-json": "2.2.0",
"pify": "2.3.0"
},
"_requested": {
"type": "range",
"registry": true,
"raw": "get-package-info@^1.0.0",
"name": "get-package-info",
"escapedName": "get-package-info",
"rawSpec": "^1.0.0",
"saveSpec": null,
"fetchSpec": "^1.0.0"
},
"_requiredBy": [
"/electron-packager"
],
"_resolved": "https://registry.npmjs.org/get-package-info/-/get-package-info-1.0.0.tgz",
"_shasum": "6432796563e28113cd9474dbbd00052985a4999c",
"_spec": "get-package-info@^1.0.0",
"_where": "F:\\projects\\p\\gitlit\\app\\node_modules\\electron-packager",
"author": {
"name": "Rahat Ahmed"
},
"bugs": {
"url": "https://github.com/rahatarmanahmed/get-package-info/issues"
},
"bundleDependencies": false,
"dependencies": {
"bluebird": "^3.1.1",
"debug": "^2.2.0",
"lodash.get": "^4.0.0",
"read-pkg-up": "^2.0.0"
},
"deprecated": false,
"description": "Gets properties from package.json files in parent directories.",
"devDependencies": {
"babel-cli": "^6.4.0",
"babel-preset-es2015": "^6.3.13",
"babel-register": "^6.4.3",
"chai": "^3.4.1",
"mocha": "^3.0.0",
"onchange": "^3.0.0",
"standard": "^8.4.0"
},
"engines": {
"node": ">= 4.0"
},
"homepage": "https://github.com/rahatarmanahmed/get-package-info#readme",
"license": "MIT",
"main": "lib/index.js",
"name": "get-package-info",
"repository": {
"type": "git",
"url": "git+https://github.com/rahatarmanahmed/get-package-info.git"
},
"scripts": {
"build": "babel -d lib/ src/",
"dev": "npm run watch",
"lint": "standard",
"prebuild": "npm run test",
"prepublish": "npm run build",
"pretest": "npm run lint",
"test": "mocha --compilers js:babel-register,es6:babel-register,es6.js:babel-register test/",
"watch": "onchange src/ -- npm run build && echo Done"
},
"version": "1.0.0"
}

View File

@@ -0,0 +1,4 @@
{
"productName": "Deeper",
"name": "deeper"
}

View File

@@ -0,0 +1,5 @@
{
"name": "go",
"version": "1.2.3",
"ignore_this_property": true
}

View File

@@ -0,0 +1,11 @@
{
"name": "we",
"dependencies": {
"some-dependency": "~1.2.3",
"some-other-dependency": "~3.2.1"
},
"devDependencies": {
"some-dev-dependency": "~1.2.3",
"some-other-dev-dependency": "~3.2.1"
}
}

114
app/node_modules/get-package-info/test/test.js generated vendored Normal file
View File

@@ -0,0 +1,114 @@
/* eslint-env mocha */
const Promise = require('bluebird')
const expect = require('chai').expect
const path = require('path')
const getPackageInfo = require('../src/index')
const readFile = Promise.promisify(require('fs').readFile)
// Test to see if given source actually represents the source
const testSource = (prop, source) => {
return readFile(source.src, 'utf-8')
.then(JSON.parse)
.then((pkg) => expect(pkg).to.deep.equal(source.pkg))
}
describe('get-package-info', () => {
it('should reject promise for non-array non-string props', (done) => {
getPackageInfo(
{},
path.join(__dirname, 'node_modules/we/need/to/go/deeper/')
)
.catch(() => {
done()
})
})
it('should return an empty result', () => {
return getPackageInfo(
[],
path.join(__dirname, 'node_modules/we/need/to/go/deeper/')
)
.then((result) => {
expect(result.values).to.deep.equal({})
expect(result.source).to.deep.equal({})
})
})
it('should return the right properties', () => {
return getPackageInfo(
[
['productName', 'name'],
'version',
'dependencies.some-dependency',
'devDependencies.some-dev-dependency'
],
path.join(__dirname, 'node_modules/we/need/to/go/deeper/')
)
.then((result) => {
expect(result.values).to.deep.equal({
productName: 'Deeper',
name: 'Deeper',
version: '1.2.3',
'dependencies.some-dependency': '~1.2.3',
'devDependencies.some-dev-dependency': '~1.2.3'
})
return Promise.all(Object.keys(result.source).map(
(prop) => testSource(prop, result.source[prop])
))
})
})
it('should return the right properties to a given callback', (done) => {
getPackageInfo(
[
['productName', 'name'],
'version',
'dependencies.some-dependency',
'devDependencies.some-dev-dependency'
],
path.join(__dirname, 'node_modules/we/need/to/go/deeper/'),
(err, result) => {
expect(err).to.be.null
expect(result.values).to.deep.equal({
productName: 'Deeper',
name: 'Deeper',
version: '1.2.3',
'dependencies.some-dependency': '~1.2.3',
'devDependencies.some-dev-dependency': '~1.2.3'
})
// Test source prop points to the prop the value came from
expect(result.source['productName'].prop).to.equal('productName')
expect(result.source['name'].prop).to.equal('productName')
expect(result.source['version'].prop).to.equal('version')
Promise.all(Object.keys(result.source).map(
(prop) => testSource(prop, result.source[prop])
))
.then(() => done())
}
)
})
it('should resolve with error message when unable to find all props', () => {
return getPackageInfo(
[
['productName', 'name'],
'nonexistent',
'version',
['this', 'doesntexist']
],
path.join(__dirname, 'node_modules/we/need/to/go/deeper/')
)
.then(() => {
throw new Error('Should not resolve when props are missing')
})
.catch((err) => {
expect(err.missingProps).to.deep.equal(['nonexistent', ['this', 'doesntexist']])
return Promise.all(Object.keys(err.result.source).map(
(prop) => testSource(prop, err.result.source[prop])
))
})
})
})