initial commit taken from gitlab.lrz.de

This commit is contained in:
privatereese
2018-08-24 18:09:42 +02:00
parent ae54ed4c48
commit fc05486403
28494 changed files with 2159823 additions and 0 deletions

66
node_modules/jest-changed-files/README.md generated vendored Normal file
View File

@@ -0,0 +1,66 @@
# jest-changed-files
A module used internally by Jest to check which files have changed since you
last committed in git or hg.
## Install
```sh
$ npm install --save jest-changed-files
```
## API
### `getChangedFilesForRoots(roots: <Array<string>>, options: ?object): Promise<?object>`
Get the list of files and repos that have changed since the last commit.
#### Parameters
roots: Array of string paths gathered from
[jest roots](https://facebook.github.io/jest/docs/configuration.html#roots-array-string).
options: Object literal with keys
* lastCommit: boolean
* withAncestor: boolean
### findRepos(roots: <Array<string>>): Promise<?object>
Get a set of git and hg repositories.
#### Parameters
roots: Array of string paths gathered from
[jest roots](https://facebook.github.io/jest/docs/configuration.html#roots-array-string).
## Usage
```javascript
import {getChangedFilesForRoots} from 'jest-changed-files';
getChangedFilesForRoots(['/path/to/test'], {
lastCommit: true,
withAncestor: true,
}).then(files => {
/*
{
repos: [],
changedFiles: []
}
*/
});
```
```javascript
import {findRepos} from 'jest-changed-files';
findRepos(['/path/to/test']).then(repos => {
/*
{
git: Set<Path>,
hg: Set<Path>
}
*/
});
```

121
node_modules/jest-changed-files/build/git.js generated vendored Normal file
View File

@@ -0,0 +1,121 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _path;
function _load_path() {
return _path = _interopRequireDefault(require('path'));
}
var _child_process;
function _load_child_process() {
return _child_process = _interopRequireDefault(require('child_process'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i]; return arr2; } else { return Array.from(arr); } }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
const findChangedFilesUsingCommand = (() => {
var _ref = _asyncToGenerator(function* (args, cwd) {
return new Promise(function (resolve, reject) {
const child = (_child_process || _load_child_process()).default.spawn('git', args, { cwd });
let stdout = '';
let stderr = '';
child.stdout.on('data', function (data) {
return stdout += data;
});
child.stderr.on('data', function (data) {
return stderr += data;
});
child.on('error', function (e) {
return reject(e);
});
child.on('close', function (code) {
if (code === 0) {
stdout = stdout.trim();
if (stdout === '') {
resolve([]);
} else {
resolve(stdout.split('\n').filter(function (s) {
return s !== '';
}).map(function (changedPath) {
return (_path || _load_path()).default.resolve(cwd, changedPath);
}));
}
} else {
reject(code + ': ' + stderr);
}
});
});
});
return function findChangedFilesUsingCommand(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
const adapter = {
findChangedFiles: (() => {
var _ref2 = _asyncToGenerator(function* (cwd, options) {
const changedSince = options && (options.withAncestor ? 'HEAD^' : options.changedSince);
if (options && options.lastCommit) {
return yield findChangedFilesUsingCommand(['show', '--name-only', '--pretty=%b', 'HEAD'], cwd);
} else if (changedSince) {
const committed = yield findChangedFilesUsingCommand(['log', '--name-only', '--pretty=%b', 'HEAD', `^${changedSince}`], cwd);
const staged = yield findChangedFilesUsingCommand(['diff', '--cached', '--name-only'], cwd);
const unstaged = yield findChangedFilesUsingCommand(['ls-files', '--other', '--modified', '--exclude-standard'], cwd);
return [].concat(_toConsumableArray(committed), _toConsumableArray(staged), _toConsumableArray(unstaged));
} else {
return yield findChangedFilesUsingCommand(['ls-files', '--other', '--modified', '--exclude-standard'], cwd);
}
});
return function findChangedFiles(_x3, _x4) {
return _ref2.apply(this, arguments);
};
})(),
getRoot: (() => {
var _ref3 = _asyncToGenerator(function* (cwd) {
return new Promise(function (resolve) {
try {
let stdout = '';
const options = ['rev-parse', '--show-toplevel'];
const child = (_child_process || _load_child_process()).default.spawn('git', options, { cwd });
child.stdout.on('data', function (data) {
return stdout += data;
});
child.on('error', function () {
return resolve(null);
});
child.on('close', function (code) {
return resolve(code === 0 ? stdout.trim() : null);
});
} catch (e) {
resolve(null);
}
});
});
return function getRoot(_x5) {
return _ref3.apply(this, arguments);
};
})()
};
exports.default = adapter;

117
node_modules/jest-changed-files/build/hg.js generated vendored Normal file
View File

@@ -0,0 +1,117 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _path;
function _load_path() {
return _path = _interopRequireDefault(require('path'));
}
var _child_process;
function _load_child_process() {
return _child_process = _interopRequireDefault(require('child_process'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
const env = Object.assign({}, process.env, {
HGPLAIN: 1
});
const ANCESTORS = [
// Parent commit to this one.
'.^',
// The first commit of my branch, only if we are not on the default branch.
'min(branch(.)) and not min(branch(default))',
// Latest public commit.
'max(public())'];
const adapter = {
findChangedFiles: (() => {
var _ref = _asyncToGenerator(function* (cwd, options) {
return new Promise(function (resolve, reject) {
let args = ['status', '-amnu'];
if (options && options.withAncestor) {
args.push('--rev', `ancestor(${ANCESTORS.join(', ')})`);
} else if (options && options.changedSince) {
args.push('--rev', `ancestor(., ${options.changedSince})`);
} else if (options && options.lastCommit === true) {
args = ['tip', '--template', '{files%"{file}\n"}'];
}
const child = (_child_process || _load_child_process()).default.spawn('hg', args, { cwd, env });
let stdout = '';
let stderr = '';
child.stdout.on('data', function (data) {
return stdout += data;
});
child.stderr.on('data', function (data) {
return stderr += data;
});
child.on('error', function (error) {
return reject(error);
});
child.on('close', function (code) {
if (code === 0) {
stdout = stdout.trim();
if (stdout === '') {
resolve([]);
} else {
resolve(stdout.split('\n').map(function (changedPath) {
return (_path || _load_path()).default.resolve(cwd, changedPath);
}));
}
} else {
reject(new Error(code + ': ' + stderr));
}
});
});
});
return function findChangedFiles(_x, _x2) {
return _ref.apply(this, arguments);
};
})(),
getRoot: (() => {
var _ref2 = _asyncToGenerator(function* (cwd) {
return new Promise(function (resolve) {
try {
let stdout = '';
const child = (_child_process || _load_child_process()).default.spawn('hg', ['root'], { cwd, env });
child.stdout.on('data', function (data) {
return stdout += data;
});
child.on('error', function () {
return resolve(null);
});
child.on('close', function (code) {
return resolve(code === 0 ? stdout.trim() : null);
});
} catch (e) {
resolve(null);
}
});
});
return function getRoot(_x3) {
return _ref2.apply(this, arguments);
};
})()
};
exports.default = adapter;

90
node_modules/jest-changed-files/build/index.js generated vendored Normal file
View File

@@ -0,0 +1,90 @@
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.findRepos = exports.getChangedFilesForRoots = undefined;
var _git;
function _load_git() {
return _git = _interopRequireDefault(require('./git'));
}
var _hg;
function _load_hg() {
return _hg = _interopRequireDefault(require('./hg'));
}
var _throat;
function _load_throat() {
return _throat = _interopRequireDefault(require('throat'));
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /**
* Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*
*/
// This is an arbitrary number. The main goal is to prevent projects with
// many roots (50+) from spawning too many processes at once.
const mutex = (0, (_throat || _load_throat()).default)(5);
const findGitRoot = dir => mutex(() => (_git || _load_git()).default.getRoot(dir));
const findHgRoot = dir => mutex(() => (_hg || _load_hg()).default.getRoot(dir));
const getChangedFilesForRoots = exports.getChangedFilesForRoots = (() => {
var _ref = _asyncToGenerator(function* (roots, options) {
const repos = yield findRepos(roots);
const gitPromises = Array.from(repos.git).map(function (repo) {
return (_git || _load_git()).default.findChangedFiles(repo, options);
});
const hgPromises = Array.from(repos.hg).map(function (repo) {
return (_hg || _load_hg()).default.findChangedFiles(repo, options);
});
const changedFiles = (yield Promise.all(gitPromises.concat(hgPromises))).reduce(function (allFiles, changedFilesInTheRepo) {
for (const file of changedFilesInTheRepo) {
allFiles.add(file);
}
return allFiles;
}, new Set());
return { changedFiles, repos };
});
return function getChangedFilesForRoots(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
const findRepos = exports.findRepos = (() => {
var _ref2 = _asyncToGenerator(function* (roots) {
const gitRepos = yield Promise.all(roots.reduce(function (promises, root) {
return promises.concat(findGitRoot(root));
}, []));
const hgRepos = yield Promise.all(roots.reduce(function (promises, root) {
return promises.concat(findHgRoot(root));
}, []));
return {
git: new Set(gitRepos.filter(Boolean)),
hg: new Set(hgRepos.filter(Boolean))
};
});
return function findRepos(_x3) {
return _ref2.apply(this, arguments);
};
})();

89
node_modules/jest-changed-files/package.json generated vendored Normal file
View File

@@ -0,0 +1,89 @@
{
"_args": [
[
"jest-changed-files@^22.2.0",
"/home/bernhard/freifunk-app/node_modules/jest/node_modules/jest-cli"
]
],
"_from": "jest-changed-files@>=22.2.0 <23.0.0",
"_id": "jest-changed-files@22.4.3",
"_inCache": true,
"_installable": true,
"_location": "/jest-changed-files",
"_nodeVersion": "8.9.1",
"_npmOperationalInternal": {
"host": "s3://npm-registry-packages",
"tmp": "tmp/jest-changed-files_22.4.3_1521648478652_0.313021524176992"
},
"_npmUser": {
"email": "mjesun@hotmail.com",
"name": "mjesun"
},
"_npmVersion": "5.5.1",
"_phantomChildren": {},
"_requested": {
"name": "jest-changed-files",
"raw": "jest-changed-files@^22.2.0",
"rawSpec": "^22.2.0",
"scope": null,
"spec": ">=22.2.0 <23.0.0",
"type": "range"
},
"_requiredBy": [
"/jest/jest-cli"
],
"_resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.4.3.tgz",
"_shasum": "8882181e022c38bd46a2e4d18d44d19d90a90fb2",
"_shrinkwrap": null,
"_spec": "jest-changed-files@^22.2.0",
"_where": "/home/bernhard/freifunk-app/node_modules/jest/node_modules/jest-cli",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"dependencies": {
"throat": "^4.0.0"
},
"description": "A module used internally by Jest to check which files have changed since you last committed in git or hg.",
"devDependencies": {},
"directories": {},
"dist": {
"fileCount": 5,
"integrity": "sha512-83Dh0w1aSkUNFhy5d2dvqWxi/y6weDwVVLU6vmK0cV9VpRxPzhTeGimbsbRDSnEoszhF937M4sDLLeS7Cu/Tmw==",
"shasum": "8882181e022c38bd46a2e4d18d44d19d90a90fb2",
"tarball": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-22.4.3.tgz",
"unpackedSize": 22344
},
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"maintainers": [
{
"name": "aaronabramov",
"email": "aaron@abramov.io"
},
{
"name": "cpojer",
"email": "christoph.pojer@gmail.com"
},
{
"name": "fb",
"email": "opensource+npm@fb.com"
},
{
"name": "jeanlauliac",
"email": "jean@lauliac.com"
},
{
"name": "mjesun",
"email": "mjesun@hotmail.com"
}
],
"name": "jest-changed-files",
"optionalDependencies": {},
"readme": "ERROR: No README data found!",
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git"
},
"version": "22.4.3"
}