This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
parent 596a6da241
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

23
node_modules/jest-changed-files/LICENSE generated vendored Normal file
View file

@ -0,0 +1,23 @@
MIT License
For Jest software
Copyright (c) 2014-present, Facebook, Inc.
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.

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

@ -0,0 +1,63 @@
# 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://jestjs.io/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://jestjs.io/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>
}
*/
});
```

11
node_modules/jest-changed-files/build/git.d.ts generated vendored Normal file
View file

@ -0,0 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. 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.
*
*/
import { SCMAdapter } from './types';
declare const adapter: SCMAdapter;
export default adapter;
//# sourceMappingURL=git.d.ts.map

1
node_modules/jest-changed-files/build/git.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAcnC,QAAA,MAAM,OAAO,EAAE,UA4Dd,CAAC;AAEF,eAAe,OAAO,CAAC"}

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

@ -0,0 +1,159 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _execa() {
const data = _interopRequireDefault(require('execa'));
_execa = function _execa() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
const findChangedFilesUsingCommand =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*(args, cwd) {
const result = yield (0, _execa().default)('git', args, {
cwd
});
return result.stdout
.split('\n')
.filter(s => s !== '')
.map(changedPath => _path().default.resolve(cwd, changedPath));
});
return function findChangedFilesUsingCommand(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
const adapter = {
findChangedFiles: (function() {
var _findChangedFiles = _asyncToGenerator(function*(cwd, options) {
const changedSince =
options && (options.withAncestor ? 'HEAD^' : options.changedSince);
const includePaths = ((options && options.includePaths) || []).map(
absoluteRoot =>
_path().default.normalize(_path().default.relative(cwd, absoluteRoot))
);
if (options && options.lastCommit) {
return findChangedFilesUsingCommand(
['show', '--name-only', '--pretty=format:', 'HEAD'].concat(
includePaths
),
cwd
);
} else if (changedSince) {
const committed = yield findChangedFilesUsingCommand(
[
'log',
'--name-only',
'--pretty=format:',
'HEAD',
`^${changedSince}`
].concat(includePaths),
cwd
);
const staged = yield findChangedFilesUsingCommand(
['diff', '--cached', '--name-only'].concat(includePaths),
cwd
);
const unstaged = yield findChangedFilesUsingCommand(
['ls-files', '--other', '--modified', '--exclude-standard'].concat(
includePaths
),
cwd
);
return [...committed, ...staged, ...unstaged];
} else {
return findChangedFilesUsingCommand(
['ls-files', '--other', '--modified', '--exclude-standard'].concat(
includePaths
),
cwd
);
}
});
function findChangedFiles(_x3, _x4) {
return _findChangedFiles.apply(this, arguments);
}
return findChangedFiles;
})(),
getRoot: (function() {
var _getRoot = _asyncToGenerator(function*(cwd) {
const options = ['rev-parse', '--show-cdup'];
try {
const result = yield (0, _execa().default)('git', options, {
cwd
});
return _path().default.resolve(cwd, result.stdout);
} catch (e) {
return null;
}
});
function getRoot(_x5) {
return _getRoot.apply(this, arguments);
}
return getRoot;
})()
};
var _default = adapter;
exports.default = _default;

11
node_modules/jest-changed-files/build/hg.d.ts generated vendored Normal file
View file

@ -0,0 +1,11 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. 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.
*
*/
import { SCMAdapter } from './types';
declare const adapter: SCMAdapter;
export default adapter;
//# sourceMappingURL=hg.d.ts.map

1
node_modules/jest-changed-files/build/hg.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"hg.d.ts","sourceRoot":"","sources":["../src/hg.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AAInC,QAAA,MAAM,OAAO,EAAE,UAgCd,CAAC;AAEF,eAAe,OAAO,CAAC"}

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

@ -0,0 +1,152 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _path() {
const data = _interopRequireDefault(require('path'));
_path = function _path() {
return data;
};
return data;
}
function _execa() {
const data = _interopRequireDefault(require('execa'));
_execa = function _execa() {
return data;
};
return data;
}
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
const env = _objectSpread({}, process.env, {
HGPLAIN: '1'
});
const adapter = {
findChangedFiles: (function() {
var _findChangedFiles = _asyncToGenerator(function*(cwd, options) {
const includePaths = (options && options.includePaths) || [];
const args = ['status', '-amnu'];
if (options && options.withAncestor) {
args.push('--rev', `min((!public() & ::.)+.)^`);
} else if (options && options.changedSince) {
args.push('--rev', `ancestor(., ${options.changedSince})`);
} else if (options && options.lastCommit === true) {
args.push('--change', '.');
}
args.push(...includePaths);
const result = yield (0, _execa().default)('hg', args, {
cwd,
env
});
return result.stdout
.split('\n')
.filter(s => s !== '')
.map(changedPath => _path().default.resolve(cwd, changedPath));
});
function findChangedFiles(_x, _x2) {
return _findChangedFiles.apply(this, arguments);
}
return findChangedFiles;
})(),
getRoot: (function() {
var _getRoot = _asyncToGenerator(function*(cwd) {
try {
const result = yield (0, _execa().default)('hg', ['root'], {
cwd,
env
});
return result.stdout;
} catch (e) {
return null;
}
});
function getRoot(_x3) {
return _getRoot.apply(this, arguments);
}
return getRoot;
})()
};
var _default = adapter;
exports.default = _default;

12
node_modules/jest-changed-files/build/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. 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.
*
*/
import { Options, Repos } from './types';
export { ChangedFiles, ChangedFilesPromise } from './types';
export declare const getChangedFilesForRoots: (roots: string[], options: Options) => Promise<import("./types").ChangedFiles>;
export declare const findRepos: (roots: string[]) => Promise<Repos>;
//# sourceMappingURL=index.d.ts.map

1
node_modules/jest-changed-files/build/index.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,EAAsB,OAAO,EAAE,KAAK,EAAa,MAAM,SAAS,CAAC;AAMxE,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAC,MAAM,SAAS,CAAC;AAa1D,eAAO,MAAM,uBAAuB,gFA2BnC,CAAC;AAEF,eAAO,MAAM,SAAS,qCAkBrB,CAAC"}

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

@ -0,0 +1,201 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
Object.defineProperty(exports, 'ChangedFiles', {
enumerable: true,
get: function get() {
return _types.ChangedFiles;
}
});
Object.defineProperty(exports, 'ChangedFilesPromise', {
enumerable: true,
get: function get() {
return _types.ChangedFilesPromise;
}
});
exports.findRepos = exports.getChangedFilesForRoots = void 0;
function _throat() {
const data = _interopRequireDefault(require('throat'));
_throat = function _throat() {
return data;
};
return data;
}
var _types = require('./types');
var _git = _interopRequireDefault(require('./git'));
var _hg = _interopRequireDefault(require('./hg'));
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(
Object.getOwnPropertySymbols(source).filter(function(sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
})
);
}
ownKeys.forEach(function(key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function() {
var self = this,
args = arguments;
return new Promise(function(resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'next', value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, 'throw', err);
}
_next(undefined);
});
};
}
function notEmpty(value) {
return value != null;
} // 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().default)(5);
const findGitRoot = dir => mutex(() => _git.default.getRoot(dir));
const findHgRoot = dir => mutex(() => _hg.default.getRoot(dir));
const getChangedFilesForRoots =
/*#__PURE__*/
(function() {
var _ref = _asyncToGenerator(function*(roots, options) {
const repos = yield findRepos(roots);
const changedFilesOptions = _objectSpread(
{
includePaths: roots
},
options
);
const gitPromises = Array.from(repos.git).map(repo =>
_git.default.findChangedFiles(repo, changedFilesOptions)
);
const hgPromises = Array.from(repos.hg).map(repo =>
_hg.default.findChangedFiles(repo, changedFilesOptions)
);
const changedFiles = (yield Promise.all(
gitPromises.concat(hgPromises)
)).reduce((allFiles, changedFilesInTheRepo) => {
var _iteratorNormalCompletion = true;
var _didIteratorError = false;
var _iteratorError = undefined;
try {
for (
var _iterator = changedFilesInTheRepo[Symbol.iterator](), _step;
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
_iteratorNormalCompletion = true
) {
const file = _step.value;
allFiles.add(file);
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return != null) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
return allFiles;
}, new Set());
return {
changedFiles,
repos
};
});
return function getChangedFilesForRoots(_x, _x2) {
return _ref.apply(this, arguments);
};
})();
exports.getChangedFilesForRoots = getChangedFilesForRoots;
const findRepos =
/*#__PURE__*/
(function() {
var _ref2 = _asyncToGenerator(function*(roots) {
const gitRepos = yield Promise.all(
roots.reduce((promises, root) => promises.concat(findGitRoot(root)), [])
);
const hgRepos = yield Promise.all(
roots.reduce((promises, root) => promises.concat(findHgRoot(root)), [])
);
return {
git: new Set(gitRepos.filter(notEmpty)),
hg: new Set(hgRepos.filter(notEmpty))
};
});
return function findRepos(_x3) {
return _ref2.apply(this, arguments);
};
})();
exports.findRepos = findRepos;

29
node_modules/jest-changed-files/build/types.d.ts generated vendored Normal file
View file

@ -0,0 +1,29 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates. 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.
*/
import { Config } from '@jest/types';
export declare type Options = {
lastCommit?: boolean;
withAncestor?: boolean;
changedSince?: string;
includePaths?: Array<Config.Path>;
};
declare type Paths = Set<Config.Path>;
export declare type Repos = {
git: Paths;
hg: Paths;
};
export declare type ChangedFiles = {
repos: Repos;
changedFiles: Paths;
};
export declare type ChangedFilesPromise = Promise<ChangedFiles>;
export declare type SCMAdapter = {
findChangedFiles: (cwd: Config.Path, options: Options) => Promise<Array<Config.Path>>;
getRoot: (cwd: Config.Path) => Promise<Config.Path | null>;
};
export {};
//# sourceMappingURL=types.d.ts.map

1
node_modules/jest-changed-files/build/types.d.ts.map generated vendored Normal file
View file

@ -0,0 +1 @@
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAEnC,oBAAY,OAAO,GAAG;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;CACnC,CAAC;AAEF,aAAK,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;AAC9B,oBAAY,KAAK,GAAG;IAAC,GAAG,EAAE,KAAK,CAAC;IAAC,EAAE,EAAE,KAAK,CAAA;CAAC,CAAC;AAC5C,oBAAY,YAAY,GAAG;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,YAAY,EAAE,KAAK,CAAA;CAAC,CAAC;AAC/D,oBAAY,mBAAmB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAExD,oBAAY,UAAU,GAAG;IACvB,gBAAgB,EAAE,CAChB,GAAG,EAAE,MAAM,CAAC,IAAI,EAChB,OAAO,EAAE,OAAO,KACb,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;CAC5D,CAAC"}

1
node_modules/jest-changed-files/build/types.js generated vendored Normal file
View file

@ -0,0 +1 @@
'use strict';

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

@ -0,0 +1,57 @@
{
"_from": "jest-changed-files@^24.8.0",
"_id": "jest-changed-files@24.8.0",
"_inBundle": false,
"_integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==",
"_location": "/jest-changed-files",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "jest-changed-files@^24.8.0",
"name": "jest-changed-files",
"escapedName": "jest-changed-files",
"rawSpec": "^24.8.0",
"saveSpec": null,
"fetchSpec": "^24.8.0"
},
"_requiredBy": [
"/@jest/core"
],
"_resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz",
"_shasum": "7e7eb21cf687587a85e50f3d249d1327e15b157b",
"_spec": "jest-changed-files@^24.8.0",
"_where": "E:\\github\\setup-java\\node_modules\\@jest\\core",
"bugs": {
"url": "https://github.com/facebook/jest/issues"
},
"bundleDependencies": false,
"dependencies": {
"@jest/types": "^24.8.0",
"execa": "^1.0.0",
"throat": "^4.0.0"
},
"deprecated": false,
"description": "A module used internally by Jest to check which files have changed since you last committed in git or hg.",
"devDependencies": {
"@types/execa": "^0.9.0"
},
"engines": {
"node": ">= 6"
},
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4",
"homepage": "https://github.com/facebook/jest#readme",
"license": "MIT",
"main": "build/index.js",
"name": "jest-changed-files",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/facebook/jest.git",
"directory": "packages/jest-changed-files"
},
"types": "build/index.d.ts",
"version": "24.8.0"
}

10
node_modules/jest-changed-files/tsconfig.json generated vendored Normal file
View file

@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "build"
},
"references": [
{"path": "../jest-types"}
]
}

2351
node_modules/jest-changed-files/tsconfig.tsbuildinfo generated vendored Normal file

File diff suppressed because it is too large Load diff