mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-20 05:14:44 +00:00
.
This commit is contained in:
parent
fc725ba36b
commit
422b9fdb15
7395 changed files with 1786235 additions and 3476 deletions
BIN
node_modules/jest-haste-map/build/.DS_Store
generated
vendored
Normal file
BIN
node_modules/jest-haste-map/build/.DS_Store
generated
vendored
Normal file
Binary file not shown.
28
node_modules/jest-haste-map/build/HasteFS.d.ts
generated
vendored
Normal file
28
node_modules/jest-haste-map/build/HasteFS.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
/**
|
||||
* 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';
|
||||
import { FileData } from './types';
|
||||
export default class HasteFS {
|
||||
private readonly _rootDir;
|
||||
private readonly _files;
|
||||
constructor({ rootDir, files }: {
|
||||
rootDir: Config.Path;
|
||||
files: FileData;
|
||||
});
|
||||
getModuleName(file: Config.Path): string | null;
|
||||
getSize(file: Config.Path): number | null;
|
||||
getDependencies(file: Config.Path): Array<string> | null;
|
||||
getSha1(file: Config.Path): string | null;
|
||||
exists(file: Config.Path): boolean;
|
||||
getAllFiles(): Array<Config.Path>;
|
||||
getFileIterator(): Iterable<Config.Path>;
|
||||
getAbsoluteFileIterator(): Iterable<Config.Path>;
|
||||
matchFiles(pattern: RegExp | string): Array<Config.Path>;
|
||||
matchFilesWithGlob(globs: Array<Config.Glob>, root: Config.Path | null): Set<Config.Path>;
|
||||
private _getFileData;
|
||||
}
|
||||
//# sourceMappingURL=HasteFS.d.ts.map
|
1
node_modules/jest-haste-map/build/HasteFS.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/HasteFS.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"HasteFS.d.ts","sourceRoot":"","sources":["../src/HasteFS.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAIjC,MAAM,CAAC,OAAO,OAAO,OAAO;IAC1B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAc;IACvC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAW;gBAEtB,EAAC,OAAO,EAAE,KAAK,EAAC,EAAE;QAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;QAAC,KAAK,EAAE,QAAQ,CAAA;KAAC;IAKrE,aAAa,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI;IAK/C,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI;IAKzC,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI;IAYxD,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,GAAG,IAAI;IAKzC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,OAAO;IAIlC,WAAW,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;IAIjC,eAAe,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IAIvC,uBAAuB,IAAI,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC;IAMjD,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;IAaxD,kBAAkB,CAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EACzB,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,IAAI,GACvB,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;IAWnB,OAAO,CAAC,YAAY;CAIrB"}
|
249
node_modules/jest-haste-map/build/HasteFS.js
generated
vendored
Normal file
249
node_modules/jest-haste-map/build/HasteFS.js
generated
vendored
Normal file
|
@ -0,0 +1,249 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _micromatch() {
|
||||
const data = _interopRequireDefault(require('micromatch'));
|
||||
|
||||
_micromatch = function _micromatch() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
|
||||
_jestUtil = function _jestUtil() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var fastPath = _interopRequireWildcard(require('./lib/fast_path'));
|
||||
|
||||
var _constants = _interopRequireDefault(require('./constants'));
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
class HasteFS {
|
||||
constructor({rootDir, files}) {
|
||||
_defineProperty(this, '_rootDir', void 0);
|
||||
|
||||
_defineProperty(this, '_files', void 0);
|
||||
|
||||
this._rootDir = rootDir;
|
||||
this._files = files;
|
||||
}
|
||||
|
||||
getModuleName(file) {
|
||||
const fileMetadata = this._getFileData(file);
|
||||
|
||||
return (fileMetadata && fileMetadata[_constants.default.ID]) || null;
|
||||
}
|
||||
|
||||
getSize(file) {
|
||||
const fileMetadata = this._getFileData(file);
|
||||
|
||||
return (fileMetadata && fileMetadata[_constants.default.SIZE]) || null;
|
||||
}
|
||||
|
||||
getDependencies(file) {
|
||||
const fileMetadata = this._getFileData(file);
|
||||
|
||||
if (fileMetadata) {
|
||||
return fileMetadata[_constants.default.DEPENDENCIES]
|
||||
? fileMetadata[_constants.default.DEPENDENCIES].split(
|
||||
_constants.default.DEPENDENCY_DELIM
|
||||
)
|
||||
: [];
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
getSha1(file) {
|
||||
const fileMetadata = this._getFileData(file);
|
||||
|
||||
return (fileMetadata && fileMetadata[_constants.default.SHA1]) || null;
|
||||
}
|
||||
|
||||
exists(file) {
|
||||
return this._getFileData(file) != null;
|
||||
}
|
||||
|
||||
getAllFiles() {
|
||||
return Array.from(this.getAbsoluteFileIterator());
|
||||
}
|
||||
|
||||
getFileIterator() {
|
||||
return this._files.keys();
|
||||
}
|
||||
|
||||
*getAbsoluteFileIterator() {
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = this.getFileIterator()[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const file = _step.value;
|
||||
yield fastPath.resolve(this._rootDir, file);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
matchFiles(pattern) {
|
||||
if (!(pattern instanceof RegExp)) {
|
||||
pattern = new RegExp(pattern);
|
||||
}
|
||||
|
||||
const files = [];
|
||||
var _iteratorNormalCompletion2 = true;
|
||||
var _didIteratorError2 = false;
|
||||
var _iteratorError2 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator2 = this.getAbsoluteFileIterator()[Symbol.iterator](),
|
||||
_step2;
|
||||
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
|
||||
_iteratorNormalCompletion2 = true
|
||||
) {
|
||||
const file = _step2.value;
|
||||
|
||||
if (pattern.test(file)) {
|
||||
files.push(file);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError2 = true;
|
||||
_iteratorError2 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
||||
_iterator2.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError2) {
|
||||
throw _iteratorError2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
matchFilesWithGlob(globs, root) {
|
||||
const files = new Set();
|
||||
var _iteratorNormalCompletion3 = true;
|
||||
var _didIteratorError3 = false;
|
||||
var _iteratorError3 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator3 = this.getAbsoluteFileIterator()[Symbol.iterator](),
|
||||
_step3;
|
||||
!(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done);
|
||||
_iteratorNormalCompletion3 = true
|
||||
) {
|
||||
const file = _step3.value;
|
||||
const filePath = root ? fastPath.relative(root, file) : file;
|
||||
|
||||
if (
|
||||
_micromatch().default.some(
|
||||
(0, _jestUtil().replacePathSepForGlob)(filePath),
|
||||
globs
|
||||
)
|
||||
) {
|
||||
files.add(file);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError3 = true;
|
||||
_iteratorError3 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
||||
_iterator3.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError3) {
|
||||
throw _iteratorError3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return files;
|
||||
}
|
||||
|
||||
_getFileData(file) {
|
||||
const relativePath = fastPath.relative(this._rootDir, file);
|
||||
return this._files.get(relativePath);
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = HasteFS;
|
49
node_modules/jest-haste-map/build/ModuleMap.d.ts
generated
vendored
Normal file
49
node_modules/jest-haste-map/build/ModuleMap.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,49 @@
|
|||
/**
|
||||
* 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';
|
||||
import { DuplicatesSet, HTypeValue, RawModuleMap, ModuleMapData, MockData } from './types';
|
||||
declare type ValueType<T> = T extends Map<string, infer V> ? V : never;
|
||||
export declare type SerializableModuleMap = {
|
||||
duplicates: ReadonlyArray<[string, [string, [string, [string, number]]]]>;
|
||||
map: ReadonlyArray<[string, ValueType<ModuleMapData>]>;
|
||||
mocks: ReadonlyArray<[string, ValueType<MockData>]>;
|
||||
rootDir: Config.Path;
|
||||
};
|
||||
export default class ModuleMap {
|
||||
static DuplicateHasteCandidatesError: typeof DuplicateHasteCandidatesError;
|
||||
private readonly _raw;
|
||||
private json;
|
||||
private static mapToArrayRecursive;
|
||||
private static mapFromArrayRecursive;
|
||||
constructor(raw: RawModuleMap);
|
||||
getModule(name: string, platform?: string | null, supportsNativePlatform?: boolean | null, type?: HTypeValue | null): Config.Path | null;
|
||||
getPackage(name: string, platform: string | null | undefined, _supportsNativePlatform: boolean | null): Config.Path | null;
|
||||
getMockModule(name: string): Config.Path | undefined;
|
||||
getRawModuleMap(): RawModuleMap;
|
||||
toJSON(): SerializableModuleMap;
|
||||
static fromJSON(serializableModuleMap: SerializableModuleMap): ModuleMap;
|
||||
/**
|
||||
* When looking up a module's data, we walk through each eligible platform for
|
||||
* the query. For each platform, we want to check if there are known
|
||||
* duplicates for that name+platform pair. The duplication logic normally
|
||||
* removes elements from the `map` object, but we want to check upfront to be
|
||||
* extra sure. If metadata exists both in the `duplicates` object and the
|
||||
* `map`, this would be a bug.
|
||||
*/
|
||||
private _getModuleMetadata;
|
||||
private _assertNoDuplicates;
|
||||
static create(rootDir: Config.Path): ModuleMap;
|
||||
}
|
||||
declare class DuplicateHasteCandidatesError extends Error {
|
||||
hasteName: string;
|
||||
platform: string | null;
|
||||
supportsNativePlatform: boolean;
|
||||
duplicatesSet: DuplicatesSet;
|
||||
constructor(name: string, platform: string, supportsNativePlatform: boolean, duplicatesSet: DuplicatesSet);
|
||||
}
|
||||
export {};
|
||||
//# sourceMappingURL=ModuleMap.d.ts.map
|
1
node_modules/jest-haste-map/build/ModuleMap.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/ModuleMap.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"ModuleMap.d.ts","sourceRoot":"","sources":["../src/ModuleMap.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,EACL,aAAa,EACb,UAAU,EAEV,YAAY,EACZ,aAAa,EACb,QAAQ,EACT,MAAM,SAAS,CAAC;AAQjB,aAAK,SAAS,CAAC,CAAC,IAAI,CAAC,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AAE/D,oBAAY,qBAAqB,GAAG;IAClC,UAAU,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1E,GAAG,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;IACvD,KAAK,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;CACtB,CAAC;AAEF,MAAM,CAAC,OAAO,OAAO,SAAS;IAC5B,MAAM,CAAC,6BAA6B,EAAE,OAAO,6BAA6B,CAAC;IAC3E,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;IACpC,OAAO,CAAC,IAAI,CAAoC;IAEhD,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAYlC,OAAO,CAAC,MAAM,CAAC,qBAAqB;gBAYxB,GAAG,EAAE,YAAY;IAI7B,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,EACxB,sBAAsB,CAAC,EAAE,OAAO,GAAG,IAAI,EACvC,IAAI,CAAC,EAAE,UAAU,GAAG,IAAI,GACvB,MAAM,CAAC,IAAI,GAAG,IAAI;IAgBrB,UAAU,CACR,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,uBAAuB,EAAE,OAAO,GAAG,IAAI,GACtC,MAAM,CAAC,IAAI,GAAG,IAAI;IAIrB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,GAAG,SAAS;IAMpD,eAAe,IAAI,YAAY;IAS/B,MAAM,IAAI,qBAAqB;IAc/B,MAAM,CAAC,QAAQ,CAAC,qBAAqB,EAAE,qBAAqB;IAW5D;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAyC1B,OAAO,CAAC,mBAAmB;IA0B3B,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI;CAQnC;AAED,cAAM,6BAA8B,SAAQ,KAAK;IAC/C,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sBAAsB,EAAE,OAAO,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;gBAG3B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,EAChB,sBAAsB,EAAE,OAAO,EAC/B,aAAa,EAAE,aAAa;CAsB/B"}
|
355
node_modules/jest-haste-map/build/ModuleMap.js
generated
vendored
Normal file
355
node_modules/jest-haste-map/build/ModuleMap.js
generated
vendored
Normal file
|
@ -0,0 +1,355 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var fastPath = _interopRequireWildcard(require('./lib/fast_path'));
|
||||
|
||||
var _constants = _interopRequireDefault(require('./constants'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return (
|
||||
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
|
||||
);
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError('Invalid attempt to destructure non-iterable instance');
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
try {
|
||||
for (
|
||||
var _i = arr[Symbol.iterator](), _s;
|
||||
!(_n = (_s = _i.next()).done);
|
||||
_n = true
|
||||
) {
|
||||
_arr.push(_s.value);
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i['return'] != null) _i['return']();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
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 EMPTY_OBJ = {};
|
||||
const EMPTY_MAP = new Map();
|
||||
|
||||
class ModuleMap {
|
||||
static mapToArrayRecursive(map) {
|
||||
let arr = Array.from(map);
|
||||
|
||||
if (arr[0] && arr[0][1] instanceof Map) {
|
||||
arr = arr.map(el => [el[0], this.mapToArrayRecursive(el[1])]);
|
||||
}
|
||||
|
||||
return arr;
|
||||
}
|
||||
|
||||
static mapFromArrayRecursive(arr) {
|
||||
if (arr[0] && Array.isArray(arr[1])) {
|
||||
arr = arr.map(el => [el[0], this.mapFromArrayRecursive(el[1])]);
|
||||
}
|
||||
|
||||
return new Map(arr);
|
||||
}
|
||||
|
||||
constructor(raw) {
|
||||
_defineProperty(this, '_raw', void 0);
|
||||
|
||||
_defineProperty(this, 'json', void 0);
|
||||
|
||||
this._raw = raw;
|
||||
}
|
||||
|
||||
getModule(name, platform, supportsNativePlatform, type) {
|
||||
if (type == null) {
|
||||
type = _constants.default.MODULE;
|
||||
}
|
||||
|
||||
const module = this._getModuleMetadata(
|
||||
name,
|
||||
platform,
|
||||
!!supportsNativePlatform
|
||||
);
|
||||
|
||||
if (module && module[_constants.default.TYPE] === type) {
|
||||
const modulePath = module[_constants.default.PATH];
|
||||
return modulePath && fastPath.resolve(this._raw.rootDir, modulePath);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
getPackage(name, platform, _supportsNativePlatform) {
|
||||
return this.getModule(name, platform, null, _constants.default.PACKAGE);
|
||||
}
|
||||
|
||||
getMockModule(name) {
|
||||
const mockPath =
|
||||
this._raw.mocks.get(name) || this._raw.mocks.get(name + '/index');
|
||||
|
||||
return mockPath && fastPath.resolve(this._raw.rootDir, mockPath);
|
||||
}
|
||||
|
||||
getRawModuleMap() {
|
||||
return {
|
||||
duplicates: this._raw.duplicates,
|
||||
map: this._raw.map,
|
||||
mocks: this._raw.mocks,
|
||||
rootDir: this._raw.rootDir
|
||||
};
|
||||
}
|
||||
|
||||
toJSON() {
|
||||
if (!this.json) {
|
||||
this.json = {
|
||||
duplicates: ModuleMap.mapToArrayRecursive(this._raw.duplicates),
|
||||
map: Array.from(this._raw.map),
|
||||
mocks: Array.from(this._raw.mocks),
|
||||
rootDir: this._raw.rootDir
|
||||
};
|
||||
}
|
||||
|
||||
return this.json;
|
||||
}
|
||||
|
||||
static fromJSON(serializableModuleMap) {
|
||||
return new ModuleMap({
|
||||
duplicates: ModuleMap.mapFromArrayRecursive(
|
||||
serializableModuleMap.duplicates
|
||||
),
|
||||
map: new Map(serializableModuleMap.map),
|
||||
mocks: new Map(serializableModuleMap.mocks),
|
||||
rootDir: serializableModuleMap.rootDir
|
||||
});
|
||||
}
|
||||
/**
|
||||
* When looking up a module's data, we walk through each eligible platform for
|
||||
* the query. For each platform, we want to check if there are known
|
||||
* duplicates for that name+platform pair. The duplication logic normally
|
||||
* removes elements from the `map` object, but we want to check upfront to be
|
||||
* extra sure. If metadata exists both in the `duplicates` object and the
|
||||
* `map`, this would be a bug.
|
||||
*/
|
||||
|
||||
_getModuleMetadata(name, platform, supportsNativePlatform) {
|
||||
const map = this._raw.map.get(name) || EMPTY_OBJ;
|
||||
const dupMap = this._raw.duplicates.get(name) || EMPTY_MAP;
|
||||
|
||||
if (platform != null) {
|
||||
this._assertNoDuplicates(
|
||||
name,
|
||||
platform,
|
||||
supportsNativePlatform,
|
||||
dupMap.get(platform)
|
||||
);
|
||||
|
||||
if (map[platform] != null) {
|
||||
return map[platform];
|
||||
}
|
||||
}
|
||||
|
||||
if (supportsNativePlatform) {
|
||||
this._assertNoDuplicates(
|
||||
name,
|
||||
_constants.default.NATIVE_PLATFORM,
|
||||
supportsNativePlatform,
|
||||
dupMap.get(_constants.default.NATIVE_PLATFORM)
|
||||
);
|
||||
|
||||
if (map[_constants.default.NATIVE_PLATFORM]) {
|
||||
return map[_constants.default.NATIVE_PLATFORM];
|
||||
}
|
||||
}
|
||||
|
||||
this._assertNoDuplicates(
|
||||
name,
|
||||
_constants.default.GENERIC_PLATFORM,
|
||||
supportsNativePlatform,
|
||||
dupMap.get(_constants.default.GENERIC_PLATFORM)
|
||||
);
|
||||
|
||||
if (map[_constants.default.GENERIC_PLATFORM]) {
|
||||
return map[_constants.default.GENERIC_PLATFORM];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
_assertNoDuplicates(name, platform, supportsNativePlatform, relativePathSet) {
|
||||
if (relativePathSet == null) {
|
||||
return;
|
||||
} // Force flow refinement
|
||||
|
||||
const previousSet = relativePathSet;
|
||||
const duplicates = new Map();
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = previousSet[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const _step$value = _slicedToArray(_step.value, 2),
|
||||
relativePath = _step$value[0],
|
||||
type = _step$value[1];
|
||||
|
||||
const duplicatePath = fastPath.resolve(this._raw.rootDir, relativePath);
|
||||
duplicates.set(duplicatePath, type);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new DuplicateHasteCandidatesError(
|
||||
name,
|
||||
platform,
|
||||
supportsNativePlatform,
|
||||
duplicates
|
||||
);
|
||||
}
|
||||
|
||||
static create(rootDir) {
|
||||
return new ModuleMap({
|
||||
duplicates: new Map(),
|
||||
map: new Map(),
|
||||
mocks: new Map(),
|
||||
rootDir
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = ModuleMap;
|
||||
|
||||
_defineProperty(ModuleMap, 'DuplicateHasteCandidatesError', void 0);
|
||||
|
||||
class DuplicateHasteCandidatesError extends Error {
|
||||
constructor(name, platform, supportsNativePlatform, duplicatesSet) {
|
||||
const platformMessage = getPlatformMessage(platform);
|
||||
super(
|
||||
`The name \`${name}\` was looked up in the Haste module map. It ` +
|
||||
`cannot be resolved, because there exists several different ` +
|
||||
`files, or packages, that provide a module for ` +
|
||||
`that particular name and platform. ${platformMessage} You must ` +
|
||||
`delete or blacklist files until there remains only one of these:\n\n` +
|
||||
Array.from(duplicatesSet)
|
||||
.map(
|
||||
([dupFilePath, dupFileType]) =>
|
||||
` * \`${dupFilePath}\` (${getTypeMessage(dupFileType)})\n`
|
||||
)
|
||||
.sort()
|
||||
.join('')
|
||||
);
|
||||
|
||||
_defineProperty(this, 'hasteName', void 0);
|
||||
|
||||
_defineProperty(this, 'platform', void 0);
|
||||
|
||||
_defineProperty(this, 'supportsNativePlatform', void 0);
|
||||
|
||||
_defineProperty(this, 'duplicatesSet', void 0);
|
||||
|
||||
this.hasteName = name;
|
||||
this.platform = platform;
|
||||
this.supportsNativePlatform = supportsNativePlatform;
|
||||
this.duplicatesSet = duplicatesSet;
|
||||
}
|
||||
}
|
||||
|
||||
function getPlatformMessage(platform) {
|
||||
if (platform === _constants.default.GENERIC_PLATFORM) {
|
||||
return 'The platform is generic (no extension).';
|
||||
}
|
||||
|
||||
return `The platform extension is \`${platform}\`.`;
|
||||
}
|
||||
|
||||
function getTypeMessage(type) {
|
||||
switch (type) {
|
||||
case _constants.default.MODULE:
|
||||
return 'module';
|
||||
|
||||
case _constants.default.PACKAGE:
|
||||
return 'package';
|
||||
}
|
||||
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
ModuleMap.DuplicateHasteCandidatesError = DuplicateHasteCandidatesError;
|
9
node_modules/jest-haste-map/build/blacklist.d.ts
generated
vendored
Normal file
9
node_modules/jest-haste-map/build/blacklist.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
declare const extensions: Set<string>;
|
||||
export default extensions;
|
||||
//# sourceMappingURL=blacklist.d.ts.map
|
1
node_modules/jest-haste-map/build/blacklist.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/blacklist.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"blacklist.d.ts","sourceRoot":"","sources":["../src/blacklist.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,QAAA,MAAM,UAAU,EAAE,GAAG,CAAC,MAAM,CA0C1B,CAAC;AAEH,eAAe,UAAU,CAAC"}
|
58
node_modules/jest-haste-map/build/blacklist.js
generated
vendored
Normal file
58
node_modules/jest-haste-map/build/blacklist.js
generated
vendored
Normal file
|
@ -0,0 +1,58 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
// This list is compiled after the MDN list of the most common MIME types (see
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/
|
||||
// Complete_list_of_MIME_types).
|
||||
//
|
||||
// Only MIME types starting with "image/", "video/", "audio/" and "font/" are
|
||||
// reflected in the list. Adding "application/" is too risky since some text
|
||||
// file formats (like ".js" and ".json") have an "application/" MIME type.
|
||||
//
|
||||
const extensions = new Set([
|
||||
// JSONs are never haste modules, except for "package.json", which is handled.
|
||||
'.json', // Image extensions.
|
||||
'.bmp',
|
||||
'.gif',
|
||||
'.ico',
|
||||
'.jpeg',
|
||||
'.jpg',
|
||||
'.png',
|
||||
'.svg',
|
||||
'.tiff',
|
||||
'.tif',
|
||||
'.webp', // Video extensions.
|
||||
'.avi',
|
||||
'.mp4',
|
||||
'.mpeg',
|
||||
'.mpg',
|
||||
'.ogv',
|
||||
'.webm',
|
||||
'.3gp',
|
||||
'.3g2', // Audio extensions.
|
||||
'.aac',
|
||||
'.midi',
|
||||
'.mid',
|
||||
'.mp3',
|
||||
'.oga',
|
||||
'.wav',
|
||||
'.3gp',
|
||||
'.3g2', // Font extensions.
|
||||
'.eot',
|
||||
'.otf',
|
||||
'.ttf',
|
||||
'.woff',
|
||||
'.woff2'
|
||||
]);
|
||||
var _default = extensions;
|
||||
exports.default = _default;
|
10
node_modules/jest-haste-map/build/constants.d.ts
generated
vendored
Normal file
10
node_modules/jest-haste-map/build/constants.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* 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 { HType } from './types';
|
||||
declare const constants: HType;
|
||||
export default constants;
|
||||
//# sourceMappingURL=constants.d.ts.map
|
1
node_modules/jest-haste-map/build/constants.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/constants.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAYH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAE9B,QAAA,MAAM,SAAS,EAAE,KAuBhB,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
50
node_modules/jest-haste-map/build/constants.js
generated
vendored
Normal file
50
node_modules/jest-haste-map/build/constants.js
generated
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
/*
|
||||
* This file exports a set of constants that are used for Jest's haste map
|
||||
* serialization. On very large repositories, the haste map cache becomes very
|
||||
* large to the point where it is the largest overhead in starting up Jest.
|
||||
*
|
||||
* This constant key map allows to keep the map smaller without having to build
|
||||
* a custom serialization library.
|
||||
*/
|
||||
const constants = {
|
||||
/* dependency serialization */
|
||||
DEPENDENCY_DELIM: '\0',
|
||||
|
||||
/* file map attributes */
|
||||
ID: 0,
|
||||
MTIME: 1,
|
||||
SIZE: 2,
|
||||
VISITED: 3,
|
||||
DEPENDENCIES: 4,
|
||||
SHA1: 5,
|
||||
|
||||
/* module map attributes */
|
||||
PATH: 0,
|
||||
TYPE: 1,
|
||||
|
||||
/* module types */
|
||||
MODULE: 0,
|
||||
PACKAGE: 1,
|
||||
|
||||
/* platforms */
|
||||
GENERIC_PLATFORM: 'g',
|
||||
NATIVE_PLATFORM: 'native'
|
||||
};
|
||||
var _default = constants;
|
||||
exports.default = _default;
|
13
node_modules/jest-haste-map/build/crawlers/node.d.ts
generated
vendored
Normal file
13
node_modules/jest-haste-map/build/crawlers/node.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* 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 { InternalHasteMap, CrawlerOptions } from '../types';
|
||||
declare const _default: (options: CrawlerOptions) => Promise<{
|
||||
removedFiles: Map<string, [string, number, number, 0 | 1, string, string | null | undefined]>;
|
||||
hasteMap: InternalHasteMap;
|
||||
}>;
|
||||
export = _default;
|
||||
//# sourceMappingURL=node.d.ts.map
|
1
node_modules/jest-haste-map/build/crawlers/node.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/crawlers/node.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/crawlers/node.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,EAEL,gBAAgB,EAChB,cAAc,EAEf,MAAM,UAAU,CAAC;;;;;AAsHlB,kBA6CE"}
|
267
node_modules/jest-haste-map/build/crawlers/node.js
generated
vendored
Normal file
267
node_modules/jest-haste-map/build/crawlers/node.js
generated
vendored
Normal file
|
@ -0,0 +1,267 @@
|
|||
'use strict';
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _child_process() {
|
||||
const data = require('child_process');
|
||||
|
||||
_child_process = function _child_process() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _constants = _interopRequireDefault(require('../constants'));
|
||||
|
||||
var fastPath = _interopRequireWildcard(require('../lib/fast_path'));
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return (
|
||||
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
|
||||
);
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError('Invalid attempt to destructure non-iterable instance');
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
try {
|
||||
for (
|
||||
var _i = arr[Symbol.iterator](), _s;
|
||||
!(_n = (_s = _i.next()).done);
|
||||
_n = true
|
||||
) {
|
||||
_arr.push(_s.value);
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i['return'] != null) _i['return']();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
function find(roots, extensions, ignore, callback) {
|
||||
const result = [];
|
||||
let activeCalls = 0;
|
||||
|
||||
function search(directory) {
|
||||
activeCalls++;
|
||||
|
||||
_fs().default.readdir(directory, (err, names) => {
|
||||
activeCalls--;
|
||||
|
||||
if (err) {
|
||||
callback(result);
|
||||
return;
|
||||
}
|
||||
|
||||
names.forEach(file => {
|
||||
file = _path().default.join(directory, file);
|
||||
|
||||
if (ignore(file)) {
|
||||
return;
|
||||
}
|
||||
|
||||
activeCalls++;
|
||||
|
||||
_fs().default.lstat(file, (err, stat) => {
|
||||
activeCalls--;
|
||||
|
||||
if (!err && stat && !stat.isSymbolicLink()) {
|
||||
if (stat.isDirectory()) {
|
||||
search(file);
|
||||
} else {
|
||||
const ext = _path()
|
||||
.default.extname(file)
|
||||
.substr(1);
|
||||
|
||||
if (extensions.indexOf(ext) !== -1) {
|
||||
result.push([file, stat.mtime.getTime(), stat.size]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (activeCalls === 0) {
|
||||
callback(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
if (activeCalls === 0) {
|
||||
callback(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if (roots.length > 0) {
|
||||
roots.forEach(search);
|
||||
} else {
|
||||
callback(result);
|
||||
}
|
||||
}
|
||||
|
||||
function findNative(roots, extensions, ignore, callback) {
|
||||
const args = Array.from(roots);
|
||||
args.push('-type', 'f');
|
||||
|
||||
if (extensions.length) {
|
||||
args.push('(');
|
||||
}
|
||||
|
||||
extensions.forEach((ext, index) => {
|
||||
if (index) {
|
||||
args.push('-o');
|
||||
}
|
||||
|
||||
args.push('-iname');
|
||||
args.push('*.' + ext);
|
||||
});
|
||||
|
||||
if (extensions.length) {
|
||||
args.push(')');
|
||||
}
|
||||
|
||||
const child = (0, _child_process().spawn)('find', args);
|
||||
let stdout = '';
|
||||
|
||||
if (child.stdout === null) {
|
||||
throw new Error(
|
||||
'stdout is null - this should never happen. Please open up an issue at https://github.com/facebook/jest'
|
||||
);
|
||||
}
|
||||
|
||||
child.stdout.setEncoding('utf-8');
|
||||
child.stdout.on('data', data => (stdout += data));
|
||||
child.stdout.on('close', () => {
|
||||
const lines = stdout
|
||||
.trim()
|
||||
.split('\n')
|
||||
.filter(x => !ignore(x));
|
||||
const result = [];
|
||||
let count = lines.length;
|
||||
|
||||
if (!count) {
|
||||
callback([]);
|
||||
} else {
|
||||
lines.forEach(path => {
|
||||
_fs().default.stat(path, (err, stat) => {
|
||||
if (!err && stat) {
|
||||
result.push([path, stat.mtime.getTime(), stat.size]);
|
||||
}
|
||||
|
||||
if (--count === 0) {
|
||||
callback(result);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = function nodeCrawl(options) {
|
||||
const data = options.data,
|
||||
extensions = options.extensions,
|
||||
forceNodeFilesystemAPI = options.forceNodeFilesystemAPI,
|
||||
ignore = options.ignore,
|
||||
rootDir = options.rootDir,
|
||||
roots = options.roots;
|
||||
return new Promise(resolve => {
|
||||
const callback = list => {
|
||||
const files = new Map();
|
||||
const removedFiles = new Map(data.files);
|
||||
list.forEach(fileData => {
|
||||
const _fileData = _slicedToArray(fileData, 3),
|
||||
filePath = _fileData[0],
|
||||
mtime = _fileData[1],
|
||||
size = _fileData[2];
|
||||
|
||||
const relativeFilePath = fastPath.relative(rootDir, filePath);
|
||||
const existingFile = data.files.get(relativeFilePath);
|
||||
|
||||
if (existingFile && existingFile[_constants.default.MTIME] === mtime) {
|
||||
files.set(relativeFilePath, existingFile);
|
||||
} else {
|
||||
// See ../constants.js; SHA-1 will always be null and fulfilled later.
|
||||
files.set(relativeFilePath, ['', mtime, size, 0, '', null]);
|
||||
}
|
||||
|
||||
removedFiles.delete(relativeFilePath);
|
||||
});
|
||||
data.files = files;
|
||||
resolve({
|
||||
hasteMap: data,
|
||||
removedFiles
|
||||
});
|
||||
};
|
||||
|
||||
if (forceNodeFilesystemAPI || process.platform === 'win32') {
|
||||
find(roots, extensions, ignore, callback);
|
||||
} else {
|
||||
findNative(roots, extensions, ignore, callback);
|
||||
}
|
||||
});
|
||||
};
|
14
node_modules/jest-haste-map/build/crawlers/watchman.d.ts
generated
vendored
Normal file
14
node_modules/jest-haste-map/build/crawlers/watchman.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,14 @@
|
|||
/**
|
||||
* 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 { InternalHasteMap, CrawlerOptions } from '../types';
|
||||
declare const _default: (options: CrawlerOptions) => Promise<{
|
||||
changedFiles?: Map<string, [string, number, number, 0 | 1, string, string | null | undefined]> | undefined;
|
||||
removedFiles: Map<string, [string, number, number, 0 | 1, string, string | null | undefined]>;
|
||||
hasteMap: InternalHasteMap;
|
||||
}>;
|
||||
export = _default;
|
||||
//# sourceMappingURL=watchman.d.ts.map
|
1
node_modules/jest-haste-map/build/crawlers/watchman.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/crawlers/watchman.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"watchman.d.ts","sourceRoot":"","sources":["../../src/crawlers/watchman.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAQH,OAAO,EACL,gBAAgB,EAChB,cAAc,EAGf,MAAM,UAAU,CAAC;;;;;;AAclB,kBAwOE"}
|
588
node_modules/jest-haste-map/build/crawlers/watchman.js
generated
vendored
Normal file
588
node_modules/jest-haste-map/build/crawlers/watchman.js
generated
vendored
Normal file
|
@ -0,0 +1,588 @@
|
|||
'use strict';
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fbWatchman() {
|
||||
const data = _interopRequireDefault(require('fb-watchman'));
|
||||
|
||||
_fbWatchman = function _fbWatchman() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var fastPath = _interopRequireWildcard(require('../lib/fast_path'));
|
||||
|
||||
var _normalizePathSep = _interopRequireDefault(
|
||||
require('../lib/normalizePathSep')
|
||||
);
|
||||
|
||||
var _constants = _interopRequireDefault(require('../constants'));
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return (
|
||||
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
|
||||
);
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError('Invalid attempt to destructure non-iterable instance');
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
try {
|
||||
for (
|
||||
var _i = arr[Symbol.iterator](), _s;
|
||||
!(_n = (_s = _i.next()).done);
|
||||
_n = true
|
||||
) {
|
||||
_arr.push(_s.value);
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i['return'] != null) _i['return']();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
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 watchmanURL =
|
||||
'https://facebook.github.io/watchman/docs/troubleshooting.html';
|
||||
|
||||
function WatchmanError(error) {
|
||||
error.message =
|
||||
`Watchman error: ${error.message.trim()}. Make sure watchman ` +
|
||||
`is running for this project. See ${watchmanURL}.`;
|
||||
return error;
|
||||
}
|
||||
|
||||
module.exports =
|
||||
/*#__PURE__*/
|
||||
(function() {
|
||||
var _watchmanCrawl = _asyncToGenerator(function*(options) {
|
||||
const fields = ['name', 'exists', 'mtime_ms', 'size'];
|
||||
const data = options.data,
|
||||
extensions = options.extensions,
|
||||
ignore = options.ignore,
|
||||
rootDir = options.rootDir,
|
||||
roots = options.roots;
|
||||
const defaultWatchExpression = [
|
||||
'allof',
|
||||
['type', 'f'],
|
||||
['anyof', ...extensions.map(extension => ['suffix', extension])]
|
||||
];
|
||||
const clocks = data.clocks;
|
||||
const client = new (_fbWatchman()).default.Client();
|
||||
let clientError;
|
||||
client.on('error', error => (clientError = WatchmanError(error))); // TODO: type better than `any`
|
||||
|
||||
const cmd = (...args) =>
|
||||
new Promise((resolve, reject) =>
|
||||
client.command(args, (error, result) =>
|
||||
error ? reject(WatchmanError(error)) : resolve(result)
|
||||
)
|
||||
);
|
||||
|
||||
if (options.computeSha1) {
|
||||
const _ref = yield cmd('list-capabilities'),
|
||||
capabilities = _ref.capabilities;
|
||||
|
||||
if (capabilities.indexOf('field-content.sha1hex') !== -1) {
|
||||
fields.push('content.sha1hex');
|
||||
}
|
||||
}
|
||||
|
||||
function getWatchmanRoots(_x2) {
|
||||
return _getWatchmanRoots.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _getWatchmanRoots() {
|
||||
_getWatchmanRoots = _asyncToGenerator(function*(roots) {
|
||||
const watchmanRoots = new Map();
|
||||
yield Promise.all(
|
||||
roots.map(
|
||||
/*#__PURE__*/
|
||||
(function() {
|
||||
var _ref2 = _asyncToGenerator(function*(root) {
|
||||
const response = yield cmd('watch-project', root);
|
||||
const existing = watchmanRoots.get(response.watch); // A root can only be filtered if it was never seen with a
|
||||
// relative_path before.
|
||||
|
||||
const canBeFiltered = !existing || existing.length > 0;
|
||||
|
||||
if (canBeFiltered) {
|
||||
if (response.relative_path) {
|
||||
watchmanRoots.set(
|
||||
response.watch,
|
||||
(existing || []).concat(response.relative_path)
|
||||
);
|
||||
} else {
|
||||
// Make the filter directories an empty array to signal that this
|
||||
// root was already seen and needs to be watched for all files or
|
||||
// directories.
|
||||
watchmanRoots.set(response.watch, []);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return function(_x4) {
|
||||
return _ref2.apply(this, arguments);
|
||||
};
|
||||
})()
|
||||
)
|
||||
);
|
||||
return watchmanRoots;
|
||||
});
|
||||
return _getWatchmanRoots.apply(this, arguments);
|
||||
}
|
||||
|
||||
function queryWatchmanForDirs(_x3) {
|
||||
return _queryWatchmanForDirs.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _queryWatchmanForDirs() {
|
||||
_queryWatchmanForDirs = _asyncToGenerator(function*(
|
||||
rootProjectDirMappings
|
||||
) {
|
||||
const files = new Map();
|
||||
let isFresh = false;
|
||||
yield Promise.all(
|
||||
Array.from(rootProjectDirMappings).map(
|
||||
/*#__PURE__*/
|
||||
(function() {
|
||||
var _ref3 = _asyncToGenerator(function*([
|
||||
root,
|
||||
directoryFilters
|
||||
]) {
|
||||
const expression = Array.from(defaultWatchExpression);
|
||||
const glob = [];
|
||||
|
||||
if (directoryFilters.length > 0) {
|
||||
expression.push([
|
||||
'anyof',
|
||||
...directoryFilters.map(dir => ['dirname', dir])
|
||||
]);
|
||||
var _iteratorNormalCompletion2 = true;
|
||||
var _didIteratorError2 = false;
|
||||
var _iteratorError2 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator2 = directoryFilters[Symbol.iterator](),
|
||||
_step2;
|
||||
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion2 = true
|
||||
) {
|
||||
const directory = _step2.value;
|
||||
var _iteratorNormalCompletion3 = true;
|
||||
var _didIteratorError3 = false;
|
||||
var _iteratorError3 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator3 = extensions[Symbol.iterator](),
|
||||
_step3;
|
||||
!(_iteratorNormalCompletion3 = (_step3 = _iterator3.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion3 = true
|
||||
) {
|
||||
const extension = _step3.value;
|
||||
glob.push(`${directory}/**/*.${extension}`);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError3 = true;
|
||||
_iteratorError3 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (
|
||||
!_iteratorNormalCompletion3 &&
|
||||
_iterator3.return != null
|
||||
) {
|
||||
_iterator3.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError3) {
|
||||
throw _iteratorError3;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError2 = true;
|
||||
_iteratorError2 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (
|
||||
!_iteratorNormalCompletion2 &&
|
||||
_iterator2.return != null
|
||||
) {
|
||||
_iterator2.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError2) {
|
||||
throw _iteratorError2;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var _iteratorNormalCompletion4 = true;
|
||||
var _didIteratorError4 = false;
|
||||
var _iteratorError4 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator4 = extensions[Symbol.iterator](), _step4;
|
||||
!(_iteratorNormalCompletion4 = (_step4 = _iterator4.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion4 = true
|
||||
) {
|
||||
const extension = _step4.value;
|
||||
glob.push(`**/*.${extension}`);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError4 = true;
|
||||
_iteratorError4 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (
|
||||
!_iteratorNormalCompletion4 &&
|
||||
_iterator4.return != null
|
||||
) {
|
||||
_iterator4.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError4) {
|
||||
throw _iteratorError4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const relativeRoot = fastPath.relative(rootDir, root);
|
||||
const query = clocks.has(relativeRoot) // Use the `since` generator if we have a clock available
|
||||
? {
|
||||
expression,
|
||||
fields,
|
||||
since: clocks.get(relativeRoot)
|
||||
} // Otherwise use the `glob` filter
|
||||
: {
|
||||
expression,
|
||||
fields,
|
||||
glob
|
||||
};
|
||||
const response = yield cmd('query', root, query);
|
||||
|
||||
if ('warning' in response) {
|
||||
console.warn('watchman warning: ', response.warning);
|
||||
}
|
||||
|
||||
isFresh = isFresh || response.is_fresh_instance;
|
||||
files.set(root, response);
|
||||
});
|
||||
|
||||
return function(_x5) {
|
||||
return _ref3.apply(this, arguments);
|
||||
};
|
||||
})()
|
||||
)
|
||||
);
|
||||
return {
|
||||
files,
|
||||
isFresh
|
||||
};
|
||||
});
|
||||
return _queryWatchmanForDirs.apply(this, arguments);
|
||||
}
|
||||
|
||||
let files = data.files;
|
||||
let removedFiles = new Map();
|
||||
const changedFiles = new Map();
|
||||
let watchmanFiles;
|
||||
let isFresh = false;
|
||||
|
||||
try {
|
||||
const watchmanRoots = yield getWatchmanRoots(roots);
|
||||
const watchmanFileResults = yield queryWatchmanForDirs(watchmanRoots); // Reset the file map if watchman was restarted and sends us a list of
|
||||
// files.
|
||||
|
||||
if (watchmanFileResults.isFresh) {
|
||||
files = new Map();
|
||||
removedFiles = new Map(data.files);
|
||||
isFresh = true;
|
||||
}
|
||||
|
||||
watchmanFiles = watchmanFileResults.files;
|
||||
} finally {
|
||||
client.end();
|
||||
}
|
||||
|
||||
if (clientError) {
|
||||
throw clientError;
|
||||
} // TODO: remove non-null
|
||||
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = watchmanFiles[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const _step$value = _slicedToArray(_step.value, 2),
|
||||
watchRoot = _step$value[0],
|
||||
response = _step$value[1];
|
||||
|
||||
const fsRoot = (0, _normalizePathSep.default)(watchRoot);
|
||||
const relativeFsRoot = fastPath.relative(rootDir, fsRoot);
|
||||
clocks.set(relativeFsRoot, response.clock);
|
||||
var _iteratorNormalCompletion5 = true;
|
||||
var _didIteratorError5 = false;
|
||||
var _iteratorError5 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator5 = response.files[Symbol.iterator](), _step5;
|
||||
!(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done);
|
||||
_iteratorNormalCompletion5 = true
|
||||
) {
|
||||
const fileData = _step5.value;
|
||||
const filePath =
|
||||
fsRoot +
|
||||
_path().default.sep +
|
||||
(0, _normalizePathSep.default)(fileData.name);
|
||||
const relativeFilePath = fastPath.relative(rootDir, filePath);
|
||||
const existingFileData = data.files.get(relativeFilePath); // If watchman is fresh, the removed files map starts with all files
|
||||
// and we remove them as we verify they still exist.
|
||||
|
||||
if (isFresh && existingFileData && fileData.exists) {
|
||||
removedFiles.delete(relativeFilePath);
|
||||
}
|
||||
|
||||
if (!fileData.exists) {
|
||||
// No need to act on files that do not exist and were not tracked.
|
||||
if (existingFileData) {
|
||||
files.delete(relativeFilePath); // If watchman is not fresh, we will know what specific files were
|
||||
// deleted since we last ran and can track only those files.
|
||||
|
||||
if (!isFresh) {
|
||||
removedFiles.set(relativeFilePath, existingFileData);
|
||||
}
|
||||
}
|
||||
} else if (!ignore(filePath)) {
|
||||
const mtime =
|
||||
typeof fileData.mtime_ms === 'number'
|
||||
? fileData.mtime_ms
|
||||
: fileData.mtime_ms.toNumber();
|
||||
const size = fileData.size;
|
||||
let sha1hex = fileData['content.sha1hex'];
|
||||
|
||||
if (typeof sha1hex !== 'string' || sha1hex.length !== 40) {
|
||||
sha1hex = null;
|
||||
}
|
||||
|
||||
let nextData;
|
||||
|
||||
if (
|
||||
existingFileData &&
|
||||
existingFileData[_constants.default.MTIME] === mtime
|
||||
) {
|
||||
nextData = existingFileData;
|
||||
} else if (
|
||||
existingFileData &&
|
||||
sha1hex &&
|
||||
existingFileData[_constants.default.SHA1] === sha1hex
|
||||
) {
|
||||
nextData = [
|
||||
existingFileData[0],
|
||||
mtime,
|
||||
existingFileData[2],
|
||||
existingFileData[3],
|
||||
existingFileData[4],
|
||||
existingFileData[5]
|
||||
];
|
||||
} else {
|
||||
// See ../constants.ts
|
||||
nextData = ['', mtime, size, 0, '', sha1hex];
|
||||
}
|
||||
|
||||
const mappings = options.mapper
|
||||
? options.mapper(filePath)
|
||||
: null;
|
||||
|
||||
if (mappings) {
|
||||
var _iteratorNormalCompletion6 = true;
|
||||
var _didIteratorError6 = false;
|
||||
var _iteratorError6 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator6 = mappings[Symbol.iterator](), _step6;
|
||||
!(_iteratorNormalCompletion6 = (_step6 = _iterator6.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion6 = true
|
||||
) {
|
||||
const absoluteVirtualFilePath = _step6.value;
|
||||
|
||||
if (!ignore(absoluteVirtualFilePath)) {
|
||||
const relativeVirtualFilePath = fastPath.relative(
|
||||
rootDir,
|
||||
absoluteVirtualFilePath
|
||||
);
|
||||
files.set(relativeVirtualFilePath, nextData);
|
||||
changedFiles.set(relativeVirtualFilePath, nextData);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError6 = true;
|
||||
_iteratorError6 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (
|
||||
!_iteratorNormalCompletion6 &&
|
||||
_iterator6.return != null
|
||||
) {
|
||||
_iterator6.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError6) {
|
||||
throw _iteratorError6;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
files.set(relativeFilePath, nextData);
|
||||
changedFiles.set(relativeFilePath, nextData);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError5 = true;
|
||||
_iteratorError5 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
||||
_iterator5.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError5) {
|
||||
throw _iteratorError5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data.files = files;
|
||||
return {
|
||||
changedFiles: isFresh ? undefined : changedFiles,
|
||||
hasteMap: data,
|
||||
removedFiles
|
||||
};
|
||||
});
|
||||
|
||||
function watchmanCrawl(_x) {
|
||||
return _watchmanCrawl.apply(this, arguments);
|
||||
}
|
||||
|
||||
return watchmanCrawl;
|
||||
})();
|
9
node_modules/jest-haste-map/build/getMockName.d.ts
generated
vendored
Normal file
9
node_modules/jest-haste-map/build/getMockName.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
declare const getMockName: (filePath: string) => string;
|
||||
export default getMockName;
|
||||
//# sourceMappingURL=getMockName.d.ts.map
|
1
node_modules/jest-haste-map/build/getMockName.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/getMockName.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"getMockName.d.ts","sourceRoot":"","sources":["../src/getMockName.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,QAAA,MAAM,WAAW,8BAKhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
38
node_modules/jest-haste-map/build/getMockName.js
generated
vendored
Normal file
38
node_modules/jest-haste-map/build/getMockName.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
'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 _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
const MOCKS_PATTERN = _path().default.sep + '__mocks__' + _path().default.sep;
|
||||
|
||||
const getMockName = filePath => {
|
||||
const mockPath = filePath.split(MOCKS_PATTERN)[1];
|
||||
return mockPath
|
||||
.substring(0, mockPath.lastIndexOf(_path().default.extname(mockPath)))
|
||||
.replace(/\\/g, '/');
|
||||
};
|
||||
|
||||
var _default = getMockName;
|
||||
exports.default = _default;
|
192
node_modules/jest-haste-map/build/index.d.ts
generated
vendored
Normal file
192
node_modules/jest-haste-map/build/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,192 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import EventEmitter from 'events';
|
||||
import { Config } from '@jest/types';
|
||||
import H from './constants';
|
||||
import HasteFS from './HasteFS';
|
||||
import HasteModuleMap, { SerializableModuleMap as HasteSerializableModuleMap } from './ModuleMap';
|
||||
import { ChangeEvent, HasteMap as InternalHasteMapObject, HasteRegExp, InternalHasteMap, Mapper } from './types';
|
||||
declare type HType = typeof H;
|
||||
declare type Options = {
|
||||
cacheDirectory?: string;
|
||||
computeDependencies?: boolean;
|
||||
computeSha1?: boolean;
|
||||
console?: Console;
|
||||
dependencyExtractor?: string;
|
||||
extensions: Array<string>;
|
||||
forceNodeFilesystemAPI?: boolean;
|
||||
hasteImplModulePath?: string;
|
||||
ignorePattern?: HasteRegExp;
|
||||
mapper?: Mapper;
|
||||
maxWorkers: number;
|
||||
mocksPattern?: string;
|
||||
name: string;
|
||||
platforms: Array<string>;
|
||||
providesModuleNodeModules?: Array<string>;
|
||||
resetCache?: boolean;
|
||||
retainAllFiles: boolean;
|
||||
rootDir: string;
|
||||
roots: Array<string>;
|
||||
skipPackageJson?: boolean;
|
||||
throwOnModuleCollision?: boolean;
|
||||
useWatchman?: boolean;
|
||||
watch?: boolean;
|
||||
};
|
||||
declare namespace HasteMap {
|
||||
type ModuleMap = HasteModuleMap;
|
||||
type SerializableModuleMap = HasteSerializableModuleMap;
|
||||
type FS = HasteFS;
|
||||
type HasteMapObject = InternalHasteMapObject;
|
||||
type HasteChangeEvent = ChangeEvent;
|
||||
}
|
||||
/**
|
||||
* HasteMap is a JavaScript implementation of Facebook's haste module system.
|
||||
*
|
||||
* This implementation is inspired by https://github.com/facebook/node-haste
|
||||
* and was built with for high-performance in large code repositories with
|
||||
* hundreds of thousands of files. This implementation is scalable and provides
|
||||
* predictable performance.
|
||||
*
|
||||
* Because the haste map creation and synchronization is critical to startup
|
||||
* performance and most tasks are blocked by I/O this class makes heavy use of
|
||||
* synchronous operations. It uses worker processes for parallelizing file
|
||||
* access and metadata extraction.
|
||||
*
|
||||
* The data structures created by `jest-haste-map` can be used directly from the
|
||||
* cache without further processing. The metadata objects in the `files` and
|
||||
* `map` objects contain cross-references: a metadata object from one can look
|
||||
* up the corresponding metadata object in the other map. Note that in most
|
||||
* projects, the number of files will be greater than the number of haste
|
||||
* modules one module can refer to many files based on platform extensions.
|
||||
*
|
||||
* type HasteMap = {
|
||||
* clocks: WatchmanClocks,
|
||||
* files: {[filepath: string]: FileMetaData},
|
||||
* map: {[id: string]: ModuleMapItem},
|
||||
* mocks: {[id: string]: string},
|
||||
* }
|
||||
*
|
||||
* // Watchman clocks are used for query synchronization and file system deltas.
|
||||
* type WatchmanClocks = {[filepath: string]: string};
|
||||
*
|
||||
* type FileMetaData = {
|
||||
* id: ?string, // used to look up module metadata objects in `map`.
|
||||
* mtime: number, // check for outdated files.
|
||||
* size: number, // size of the file in bytes.
|
||||
* visited: boolean, // whether the file has been parsed or not.
|
||||
* dependencies: Array<string>, // all relative dependencies of this file.
|
||||
* sha1: ?string, // SHA-1 of the file, if requested via options.
|
||||
* };
|
||||
*
|
||||
* // Modules can be targeted to a specific platform based on the file name.
|
||||
* // Example: platform.ios.js and Platform.android.js will both map to the same
|
||||
* // `Platform` module. The platform should be specified during resolution.
|
||||
* type ModuleMapItem = {[platform: string]: ModuleMetaData};
|
||||
*
|
||||
* //
|
||||
* type ModuleMetaData = {
|
||||
* path: string, // the path to look up the file object in `files`.
|
||||
* type: string, // the module type (either `package` or `module`).
|
||||
* };
|
||||
*
|
||||
* Note that the data structures described above are conceptual only. The actual
|
||||
* implementation uses arrays and constant keys for metadata storage. Instead of
|
||||
* `{id: 'flatMap', mtime: 3421, size: 42, visited: true, dependencies: []}` the real
|
||||
* representation is similar to `['flatMap', 3421, 42, 1, []]` to save storage space
|
||||
* and reduce parse and write time of a big JSON blob.
|
||||
*
|
||||
* The HasteMap is created as follows:
|
||||
* 1. read data from the cache or create an empty structure.
|
||||
*
|
||||
* 2. crawl the file system.
|
||||
* * empty cache: crawl the entire file system.
|
||||
* * cache available:
|
||||
* * if watchman is available: get file system delta changes.
|
||||
* * if watchman is unavailable: crawl the entire file system.
|
||||
* * build metadata objects for every file. This builds the `files` part of
|
||||
* the `HasteMap`.
|
||||
*
|
||||
* 3. parse and extract metadata from changed files.
|
||||
* * this is done in parallel over worker processes to improve performance.
|
||||
* * the worst case is to parse all files.
|
||||
* * the best case is no file system access and retrieving all data from
|
||||
* the cache.
|
||||
* * the average case is a small number of changed files.
|
||||
*
|
||||
* 4. serialize the new `HasteMap` in a cache file.
|
||||
* Worker processes can directly access the cache through `HasteMap.read()`.
|
||||
*
|
||||
*/
|
||||
declare class HasteMap extends EventEmitter {
|
||||
private _buildPromise;
|
||||
private _cachePath;
|
||||
private _changeInterval?;
|
||||
private _console;
|
||||
private _options;
|
||||
private _watchers;
|
||||
private _whitelist;
|
||||
private _worker;
|
||||
constructor(options: Options);
|
||||
static getCacheFilePath(tmpdir: Config.Path, name: string, ...extra: Array<string>): string;
|
||||
getCacheFilePath(): string;
|
||||
build(): Promise<InternalHasteMapObject>;
|
||||
/**
|
||||
* 1. read data from the cache or create an empty structure.
|
||||
*/
|
||||
read(): InternalHasteMap;
|
||||
readModuleMap(): HasteModuleMap;
|
||||
/**
|
||||
* 2. crawl the file system.
|
||||
*/
|
||||
private _buildFileMap;
|
||||
/**
|
||||
* 3. parse and extract metadata from changed files.
|
||||
*/
|
||||
private _processFile;
|
||||
private _buildHasteMap;
|
||||
private _cleanup;
|
||||
/**
|
||||
* 4. serialize the new `HasteMap` in a cache file.
|
||||
*/
|
||||
private _persist;
|
||||
/**
|
||||
* Creates workers or parses files and extracts metadata in-process.
|
||||
*/
|
||||
private _getWorker;
|
||||
private _crawl;
|
||||
/**
|
||||
* Watch mode
|
||||
*/
|
||||
private _watch;
|
||||
/**
|
||||
* This function should be called when the file under `filePath` is removed
|
||||
* or changed. When that happens, we want to figure out if that file was
|
||||
* part of a group of files that had the same ID. If it was, we want to
|
||||
* remove it from the group. Furthermore, if there is only one file
|
||||
* remaining in the group, then we want to restore that single file as the
|
||||
* correct resolution for its ID, and cleanup the duplicates index.
|
||||
*/
|
||||
private _recoverDuplicates;
|
||||
end(): Promise<void>;
|
||||
/**
|
||||
* Helpers
|
||||
*/
|
||||
private _ignore;
|
||||
private _isNodeModulesDir;
|
||||
private _createEmptyMap;
|
||||
static H: HType;
|
||||
static DuplicateError: typeof DuplicateError;
|
||||
static ModuleMap: typeof HasteModuleMap;
|
||||
}
|
||||
declare class DuplicateError extends Error {
|
||||
mockPath1: string;
|
||||
mockPath2: string;
|
||||
constructor(mockPath1: string, mockPath2: string);
|
||||
}
|
||||
export = HasteMap;
|
||||
//# sourceMappingURL=index.d.ts.map
|
1
node_modules/jest-haste-map/build/index.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/index.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAIH,OAAO,YAAY,MAAM,QAAQ,CAAC;AAMlC,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AAMnC,OAAO,CAAC,MAAM,aAAa,CAAC;AAC5B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,cAAc,EAAE,EACrB,qBAAqB,IAAI,0BAA0B,EACpD,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,WAAW,EAGX,QAAQ,IAAI,sBAAsB,EAClC,WAAW,EACX,gBAAgB,EAChB,MAAM,EAOP,MAAM,SAAS,CAAC;AAEjB,aAAK,KAAK,GAAG,OAAO,CAAC,CAAC;AAEtB,aAAK,OAAO,GAAG;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,yBAAyB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACrB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAiCF,kBAAU,QAAQ,CAAC;IACjB,KAAY,SAAS,GAAG,cAAc,CAAC;IACvC,KAAY,qBAAqB,GAAG,0BAA0B,CAAC;IAC/D,KAAY,EAAE,GAAG,OAAO,CAAC;IACzB,KAAY,cAAc,GAAG,sBAAsB,CAAC;IACpD,KAAY,gBAAgB,GAAG,WAAW,CAAC;CAC5C;AAyCD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6EG;AAEH,cAAM,QAAS,SAAQ,YAAY;IACjC,OAAO,CAAC,aAAa,CAAyC;IAC9D,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,eAAe,CAAC,CAAiB;IACzC,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,OAAO,CAAyB;gBAE5B,OAAO,EAAE,OAAO;IAiF5B,MAAM,CAAC,gBAAgB,CACrB,MAAM,EAAE,MAAM,CAAC,IAAI,EACnB,IAAI,EAAE,MAAM,EACZ,GAAG,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,GACtB,MAAM;IAQT,gBAAgB,IAAI,MAAM;IAI1B,KAAK,IAAI,OAAO,CAAC,sBAAsB,CAAC;IA2CxC;;OAEG;IACH,IAAI,IAAI,gBAAgB;IAYxB,aAAa,IAAI,cAAc;IAU/B;;OAEG;YACW,aAAa;IAe3B;;OAEG;IACH,OAAO,CAAC,YAAY;YAsNN,cAAc;IAyD5B,OAAO,CAAC,QAAQ;IAYhB;;OAEG;IACH,OAAO,CAAC,QAAQ;IAIhB;;OAEG;IACH,OAAO,CAAC,UAAU;IAiBlB,OAAO,CAAC,MAAM;IA8Cd;;OAEG;IACH,OAAO,CAAC,MAAM;IA6Md;;;;;;;OAOG;IACH,OAAO,CAAC,kBAAkB;IAgD1B,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAgBpB;;OAEG;IACH,OAAO,CAAC,OAAO;IAaf,OAAO,CAAC,iBAAiB;IAsBzB,OAAO,CAAC,eAAe;IAUvB,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC;IAChB,MAAM,CAAC,cAAc,EAAE,OAAO,cAAc,CAAC;IAC7C,MAAM,CAAC,SAAS,EAAE,OAAO,cAAc,CAAC;CACzC;AAED,cAAM,cAAe,SAAQ,KAAK;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;gBAEN,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAMjD;AAcD,SAAS,QAAQ,CAAC"}
|
1393
node_modules/jest-haste-map/build/index.js
generated
vendored
Normal file
1393
node_modules/jest-haste-map/build/index.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
46
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts
generated
vendored
Normal file
46
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
/**
|
||||
* 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.
|
||||
*
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import { EventEmitter } from 'events';
|
||||
import anymatch from 'anymatch';
|
||||
import { Watcher } from 'fsevents';
|
||||
/**
|
||||
* Export `FSEventsWatcher` class.
|
||||
* Watches `dir`.
|
||||
*/
|
||||
declare class FSEventsWatcher extends EventEmitter {
|
||||
readonly root: string;
|
||||
readonly ignored?: anymatch.Matcher;
|
||||
readonly glob: Array<string>;
|
||||
readonly dot: boolean;
|
||||
readonly hasIgnore: boolean;
|
||||
readonly doIgnore: (path: string) => boolean;
|
||||
readonly watcher: Watcher;
|
||||
private _tracked;
|
||||
static isSupported(): boolean;
|
||||
private static normalizeProxy;
|
||||
private static recReaddir;
|
||||
constructor(dir: string, opts: {
|
||||
root: string;
|
||||
ignored?: anymatch.Matcher;
|
||||
glob: string | Array<string>;
|
||||
dot: boolean;
|
||||
});
|
||||
/**
|
||||
* End watching.
|
||||
*/
|
||||
close(callback?: () => void): void;
|
||||
private isFileIncluded;
|
||||
private handleEvent;
|
||||
/**
|
||||
* Emit events.
|
||||
*/
|
||||
private _emit;
|
||||
}
|
||||
export = FSEventsWatcher;
|
||||
//# sourceMappingURL=FSEventsWatcher.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"FSEventsWatcher.d.ts","sourceRoot":"","sources":["../../src/lib/FSEventsWatcher.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAIH,OAAO,EAAC,YAAY,EAAC,MAAM,QAAQ,CAAC;AACpC,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAC,OAAO,EAAC,MAAM,UAAU,CAAC;AAsBjC;;;GAGG;AACH,cAAM,eAAgB,SAAQ,YAAY;IACxC,SAAgB,IAAI,EAAE,MAAM,CAAC;IAC7B,SAAgB,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC3C,SAAgB,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACpC,SAAgB,GAAG,EAAE,OAAO,CAAC;IAC7B,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC,SAAgB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACpD,SAAgB,OAAO,EAAE,OAAO,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAc;IAE9B,MAAM,CAAC,WAAW;IAIlB,OAAO,CAAC,MAAM,CAAC,cAAc;IAO7B,OAAO,CAAC,MAAM,CAAC,UAAU;gBAqBvB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC;QAC3B,IAAI,EAAE,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;QAC7B,GAAG,EAAE,OAAO,CAAC;KACd;IAqCH;;OAEG;IACH,KAAK,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI;IAQ3B,OAAO,CAAC,cAAc;IAStB,OAAO,CAAC,WAAW;IAgCnB;;OAEG;IACH,OAAO,CAAC,KAAK;CAId;AAED,SAAS,eAAe,CAAC"}
|
248
node_modules/jest-haste-map/build/lib/FSEventsWatcher.js
generated
vendored
Normal file
248
node_modules/jest-haste-map/build/lib/FSEventsWatcher.js
generated
vendored
Normal file
|
@ -0,0 +1,248 @@
|
|||
'use strict';
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _events() {
|
||||
const data = require('events');
|
||||
|
||||
_events = function _events() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _anymatch() {
|
||||
const data = _interopRequireDefault(require('anymatch'));
|
||||
|
||||
_anymatch = function _anymatch() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _micromatch() {
|
||||
const data = _interopRequireDefault(require('micromatch'));
|
||||
|
||||
_micromatch = function _micromatch() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _walker() {
|
||||
const data = _interopRequireDefault(require('walker'));
|
||||
|
||||
_walker = function _walker() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
let fsevents;
|
||||
|
||||
try {
|
||||
fsevents = require('fsevents');
|
||||
} catch (e) {
|
||||
// Optional dependency, only supported on Darwin.
|
||||
}
|
||||
|
||||
const CHANGE_EVENT = 'change';
|
||||
const DELETE_EVENT = 'delete';
|
||||
const ADD_EVENT = 'add';
|
||||
const ALL_EVENT = 'all';
|
||||
|
||||
/**
|
||||
* Export `FSEventsWatcher` class.
|
||||
* Watches `dir`.
|
||||
*/
|
||||
class FSEventsWatcher extends _events().EventEmitter {
|
||||
static isSupported() {
|
||||
return fsevents !== undefined;
|
||||
}
|
||||
|
||||
static normalizeProxy(callback) {
|
||||
return (filepath, stats) =>
|
||||
callback(_path().default.normalize(filepath), stats);
|
||||
}
|
||||
|
||||
static recReaddir(
|
||||
dir,
|
||||
dirCallback,
|
||||
fileCallback,
|
||||
endCallback,
|
||||
errorCallback,
|
||||
ignored
|
||||
) {
|
||||
(0, _walker().default)(dir)
|
||||
.filterDir(
|
||||
currentDir => !ignored || !(0, _anymatch().default)(ignored, currentDir)
|
||||
)
|
||||
.on('dir', FSEventsWatcher.normalizeProxy(dirCallback))
|
||||
.on('file', FSEventsWatcher.normalizeProxy(fileCallback))
|
||||
.on('error', errorCallback)
|
||||
.on('end', () => {
|
||||
endCallback();
|
||||
});
|
||||
}
|
||||
|
||||
constructor(dir, opts) {
|
||||
if (!fsevents) {
|
||||
throw new Error(
|
||||
'`fsevents` unavailable (this watcher can only be used on Darwin)'
|
||||
);
|
||||
}
|
||||
|
||||
super();
|
||||
|
||||
_defineProperty(this, 'root', void 0);
|
||||
|
||||
_defineProperty(this, 'ignored', void 0);
|
||||
|
||||
_defineProperty(this, 'glob', void 0);
|
||||
|
||||
_defineProperty(this, 'dot', void 0);
|
||||
|
||||
_defineProperty(this, 'hasIgnore', void 0);
|
||||
|
||||
_defineProperty(this, 'doIgnore', void 0);
|
||||
|
||||
_defineProperty(this, 'watcher', void 0);
|
||||
|
||||
_defineProperty(this, '_tracked', void 0);
|
||||
|
||||
this.dot = opts.dot || false;
|
||||
this.ignored = opts.ignored;
|
||||
this.glob = Array.isArray(opts.glob) ? opts.glob : [opts.glob];
|
||||
this.hasIgnore =
|
||||
Boolean(opts.ignored) && !(Array.isArray(opts) && opts.length > 0);
|
||||
this.doIgnore = opts.ignored
|
||||
? (0, _anymatch().default)(opts.ignored)
|
||||
: () => false;
|
||||
this.root = _path().default.resolve(dir);
|
||||
this.watcher = fsevents(this.root);
|
||||
this.watcher.start().on('change', this.handleEvent.bind(this));
|
||||
this._tracked = new Set();
|
||||
FSEventsWatcher.recReaddir(
|
||||
this.root,
|
||||
filepath => {
|
||||
this._tracked.add(filepath);
|
||||
},
|
||||
filepath => {
|
||||
this._tracked.add(filepath);
|
||||
},
|
||||
this.emit.bind(this, 'ready'),
|
||||
this.emit.bind(this, 'error'),
|
||||
this.ignored
|
||||
);
|
||||
}
|
||||
/**
|
||||
* End watching.
|
||||
*/
|
||||
|
||||
close(callback) {
|
||||
this.watcher.stop();
|
||||
this.removeAllListeners();
|
||||
|
||||
if (typeof callback === 'function') {
|
||||
process.nextTick(callback.bind(null, null, true));
|
||||
}
|
||||
}
|
||||
|
||||
isFileIncluded(relativePath) {
|
||||
if (this.doIgnore(relativePath)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return this.glob.length
|
||||
? _micromatch().default.some(relativePath, this.glob, {
|
||||
dot: this.dot
|
||||
})
|
||||
: this.dot || _micromatch().default.some(relativePath, '**/*');
|
||||
}
|
||||
|
||||
handleEvent(filepath) {
|
||||
const relativePath = _path().default.relative(this.root, filepath);
|
||||
|
||||
if (!this.isFileIncluded(relativePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
_fs().default.lstat(filepath, (error, stat) => {
|
||||
if (error && error.code !== 'ENOENT') {
|
||||
this.emit('error', error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
// Ignore files that aren't tracked and don't exist.
|
||||
if (!this._tracked.has(filepath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this._emit(DELETE_EVENT, relativePath);
|
||||
|
||||
this._tracked.delete(filepath);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (this._tracked.has(filepath)) {
|
||||
this._emit(CHANGE_EVENT, relativePath, stat);
|
||||
} else {
|
||||
this._tracked.add(filepath);
|
||||
|
||||
this._emit(ADD_EVENT, relativePath, stat);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* Emit events.
|
||||
*/
|
||||
|
||||
_emit(type, file, stat) {
|
||||
this.emit(type, file, this.root, stat);
|
||||
this.emit(ALL_EVENT, type, file, this.root, stat);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = FSEventsWatcher;
|
400
node_modules/jest-haste-map/build/lib/WatchmanWatcher.js
generated
vendored
Normal file
400
node_modules/jest-haste-map/build/lib/WatchmanWatcher.js
generated
vendored
Normal file
|
@ -0,0 +1,400 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = WatchmanWatcher;
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _assert() {
|
||||
const data = _interopRequireDefault(require('assert'));
|
||||
|
||||
_assert = function _assert() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _events() {
|
||||
const data = require('events');
|
||||
|
||||
_events = function _events() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fbWatchman() {
|
||||
const data = _interopRequireDefault(require('fb-watchman'));
|
||||
|
||||
_fbWatchman = function _fbWatchman() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _common() {
|
||||
const data = _interopRequireDefault(require('sane/src/common'));
|
||||
|
||||
_common = function _common() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _recrawlWarningDedupe() {
|
||||
const data = _interopRequireDefault(
|
||||
require('sane/src/utils/recrawl-warning-dedupe')
|
||||
);
|
||||
|
||||
_recrawlWarningDedupe = function _recrawlWarningDedupe() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
const CHANGE_EVENT = _common().default.CHANGE_EVENT;
|
||||
|
||||
const DELETE_EVENT = _common().default.DELETE_EVENT;
|
||||
|
||||
const ADD_EVENT = _common().default.ADD_EVENT;
|
||||
|
||||
const ALL_EVENT = _common().default.ALL_EVENT;
|
||||
|
||||
const SUB_NAME = 'sane-sub';
|
||||
/**
|
||||
* Watches `dir`.
|
||||
*
|
||||
* @class PollWatcher
|
||||
* @param String dir
|
||||
* @param {Object} opts
|
||||
* @public
|
||||
*/
|
||||
|
||||
function WatchmanWatcher(dir, opts) {
|
||||
_common().default.assignOptions(this, opts);
|
||||
|
||||
this.root = _path().default.resolve(dir);
|
||||
this.init();
|
||||
} // eslint-disable-next-line no-proto
|
||||
|
||||
WatchmanWatcher.prototype.__proto__ = _events().EventEmitter.prototype;
|
||||
/**
|
||||
* Run the watchman `watch` command on the root and subscribe to changes.
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
|
||||
WatchmanWatcher.prototype.init = function() {
|
||||
if (this.client) {
|
||||
this.client.removeAllListeners();
|
||||
}
|
||||
|
||||
const self = this;
|
||||
this.client = new (_fbWatchman()).default.Client();
|
||||
this.client.on('error', error => {
|
||||
self.emit('error', error);
|
||||
});
|
||||
this.client.on('subscription', this.handleChangeEvent.bind(this));
|
||||
this.client.on('end', () => {
|
||||
console.warn('[sane] Warning: Lost connection to watchman, reconnecting..');
|
||||
self.init();
|
||||
});
|
||||
this.watchProjectInfo = null;
|
||||
|
||||
function getWatchRoot() {
|
||||
return self.watchProjectInfo ? self.watchProjectInfo.root : self.root;
|
||||
}
|
||||
|
||||
function onCapability(error, resp) {
|
||||
if (handleError(self, error)) {
|
||||
// The Watchman watcher is unusable on this system, we cannot continue
|
||||
return;
|
||||
}
|
||||
|
||||
handleWarning(resp);
|
||||
self.capabilities = resp.capabilities;
|
||||
|
||||
if (self.capabilities.relative_root) {
|
||||
self.client.command(['watch-project', getWatchRoot()], onWatchProject);
|
||||
} else {
|
||||
self.client.command(['watch', getWatchRoot()], onWatch);
|
||||
}
|
||||
}
|
||||
|
||||
function onWatchProject(error, resp) {
|
||||
if (handleError(self, error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleWarning(resp);
|
||||
self.watchProjectInfo = {
|
||||
relativePath: resp.relative_path ? resp.relative_path : '',
|
||||
root: resp.watch
|
||||
};
|
||||
self.client.command(['clock', getWatchRoot()], onClock);
|
||||
}
|
||||
|
||||
function onWatch(error, resp) {
|
||||
if (handleError(self, error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleWarning(resp);
|
||||
self.client.command(['clock', getWatchRoot()], onClock);
|
||||
}
|
||||
|
||||
function onClock(error, resp) {
|
||||
if (handleError(self, error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleWarning(resp);
|
||||
const options = {
|
||||
fields: ['name', 'exists', 'new'],
|
||||
since: resp.clock
|
||||
}; // If the server has the wildmatch capability available it supports
|
||||
// the recursive **/*.foo style match and we can offload our globs
|
||||
// to the watchman server. This saves both on data size to be
|
||||
// communicated back to us and compute for evaluating the globs
|
||||
// in our node process.
|
||||
|
||||
if (self.capabilities.wildmatch) {
|
||||
if (self.globs.length === 0) {
|
||||
if (!self.dot) {
|
||||
// Make sure we honor the dot option if even we're not using globs.
|
||||
options.expression = [
|
||||
'match',
|
||||
'**',
|
||||
'wholename',
|
||||
{
|
||||
includedotfiles: false
|
||||
}
|
||||
];
|
||||
}
|
||||
} else {
|
||||
options.expression = ['anyof'];
|
||||
|
||||
for (const i in self.globs) {
|
||||
options.expression.push([
|
||||
'match',
|
||||
self.globs[i],
|
||||
'wholename',
|
||||
{
|
||||
includedotfiles: self.dot
|
||||
}
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (self.capabilities.relative_root) {
|
||||
options.relative_root = self.watchProjectInfo.relativePath;
|
||||
}
|
||||
|
||||
self.client.command(
|
||||
['subscribe', getWatchRoot(), SUB_NAME, options],
|
||||
onSubscribe
|
||||
);
|
||||
}
|
||||
|
||||
function onSubscribe(error, resp) {
|
||||
if (handleError(self, error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
handleWarning(resp);
|
||||
self.emit('ready');
|
||||
}
|
||||
|
||||
self.client.capabilityCheck(
|
||||
{
|
||||
optional: ['wildmatch', 'relative_root']
|
||||
},
|
||||
onCapability
|
||||
);
|
||||
};
|
||||
/**
|
||||
* Handles a change event coming from the subscription.
|
||||
*
|
||||
* @param {Object} resp
|
||||
* @private
|
||||
*/
|
||||
|
||||
WatchmanWatcher.prototype.handleChangeEvent = function(resp) {
|
||||
_assert().default.equal(
|
||||
resp.subscription,
|
||||
SUB_NAME,
|
||||
'Invalid subscription event.'
|
||||
);
|
||||
|
||||
if (resp.is_fresh_instance) {
|
||||
this.emit('fresh_instance');
|
||||
}
|
||||
|
||||
if (resp.is_fresh_instance) {
|
||||
this.emit('fresh_instance');
|
||||
}
|
||||
|
||||
if (Array.isArray(resp.files)) {
|
||||
resp.files.forEach(this.handleFileChange, this);
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Handles a single change event record.
|
||||
*
|
||||
* @param {Object} changeDescriptor
|
||||
* @private
|
||||
*/
|
||||
|
||||
WatchmanWatcher.prototype.handleFileChange = function(changeDescriptor) {
|
||||
const self = this;
|
||||
let absPath;
|
||||
let relativePath;
|
||||
|
||||
if (this.capabilities.relative_root) {
|
||||
relativePath = changeDescriptor.name;
|
||||
absPath = _path().default.join(
|
||||
this.watchProjectInfo.root,
|
||||
this.watchProjectInfo.relativePath,
|
||||
relativePath
|
||||
);
|
||||
} else {
|
||||
absPath = _path().default.join(this.root, changeDescriptor.name);
|
||||
relativePath = changeDescriptor.name;
|
||||
}
|
||||
|
||||
if (
|
||||
!(self.capabilities.wildmatch && !this.hasIgnore) &&
|
||||
!_common().default.isFileIncluded(
|
||||
this.globs,
|
||||
this.dot,
|
||||
this.doIgnore,
|
||||
relativePath
|
||||
)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!changeDescriptor.exists) {
|
||||
self.emitEvent(DELETE_EVENT, relativePath, self.root);
|
||||
} else {
|
||||
_fs().default.lstat(absPath, (error, stat) => {
|
||||
// Files can be deleted between the event and the lstat call
|
||||
// the most reliable thing to do here is to ignore the event.
|
||||
if (error && error.code === 'ENOENT') {
|
||||
return;
|
||||
}
|
||||
|
||||
if (handleError(self, error)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const eventType = changeDescriptor.new ? ADD_EVENT : CHANGE_EVENT; // Change event on dirs are mostly useless.
|
||||
|
||||
if (!(eventType === CHANGE_EVENT && stat.isDirectory())) {
|
||||
self.emitEvent(eventType, relativePath, self.root, stat);
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Dispatches the event.
|
||||
*
|
||||
* @param {string} eventType
|
||||
* @param {string} filepath
|
||||
* @param {string} root
|
||||
* @param {fs.Stat} stat
|
||||
* @private
|
||||
*/
|
||||
|
||||
WatchmanWatcher.prototype.emitEvent = function(
|
||||
eventType,
|
||||
filepath,
|
||||
root,
|
||||
stat
|
||||
) {
|
||||
this.emit(eventType, filepath, root, stat);
|
||||
this.emit(ALL_EVENT, eventType, filepath, root, stat);
|
||||
};
|
||||
/**
|
||||
* Closes the watcher.
|
||||
*
|
||||
* @param {function} callback
|
||||
* @private
|
||||
*/
|
||||
|
||||
WatchmanWatcher.prototype.close = function(callback) {
|
||||
this.client.removeAllListeners();
|
||||
this.client.end();
|
||||
callback && callback(null, true);
|
||||
};
|
||||
/**
|
||||
* Handles an error and returns true if exists.
|
||||
*
|
||||
* @param {WatchmanWatcher} self
|
||||
* @param {Error} error
|
||||
* @private
|
||||
*/
|
||||
|
||||
function handleError(self, error) {
|
||||
if (error != null) {
|
||||
self.emit('error', error);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Handles a warning in the watchman resp object.
|
||||
*
|
||||
* @param {object} resp
|
||||
* @private
|
||||
*/
|
||||
|
||||
function handleWarning(resp) {
|
||||
if ('warning' in resp) {
|
||||
if (_recrawlWarningDedupe().default.isRecrawlWarningDupe(resp.warning)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
console.warn(resp.warning);
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
8
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts
generated
vendored
Normal file
8
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare function extract(code: string): Set<string>;
|
||||
//# sourceMappingURL=dependencyExtractor.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"dependencyExtractor.d.ts","sourceRoot":"","sources":["../../src/lib/dependencyExtractor.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAuEH,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAgBjD"}
|
100
node_modules/jest-haste-map/build/lib/dependencyExtractor.js
generated
vendored
Normal file
100
node_modules/jest-haste-map/build/lib/dependencyExtractor.js
generated
vendored
Normal file
|
@ -0,0 +1,100 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.extract = extract;
|
||||
|
||||
var _isRegExpSupported = _interopRequireDefault(require('./isRegExpSupported'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
// Negative look behind is only supported in Node 9+
|
||||
const NOT_A_DOT = (0, _isRegExpSupported.default)('(?<!\\.\\s*)')
|
||||
? '(?<!\\.\\s*)'
|
||||
: '(?:^|[^.]\\s*)';
|
||||
|
||||
const CAPTURE_STRING_LITERAL = pos => `([\`'"])([^'"\`]*?)(?:\\${pos})`;
|
||||
|
||||
const WORD_SEPARATOR = '\\b';
|
||||
const LEFT_PARENTHESIS = '\\(';
|
||||
const RIGHT_PARENTHESIS = '\\)';
|
||||
const WHITESPACE = '\\s*';
|
||||
const OPTIONAL_COMMA = '(:?,\\s*)?';
|
||||
|
||||
function createRegExp(parts, flags) {
|
||||
return new RegExp(parts.join(''), flags);
|
||||
}
|
||||
|
||||
function alternatives(...parts) {
|
||||
return `(?:${parts.join('|')})`;
|
||||
}
|
||||
|
||||
function functionCallStart(...names) {
|
||||
return [
|
||||
NOT_A_DOT,
|
||||
WORD_SEPARATOR,
|
||||
alternatives(...names),
|
||||
WHITESPACE,
|
||||
LEFT_PARENTHESIS,
|
||||
WHITESPACE
|
||||
];
|
||||
}
|
||||
|
||||
const BLOCK_COMMENT_RE = /\/\*[^]*?\*\//g;
|
||||
const LINE_COMMENT_RE = /\/\/.*/g;
|
||||
const REQUIRE_OR_DYNAMIC_IMPORT_RE = createRegExp(
|
||||
[
|
||||
...functionCallStart('require', 'import'),
|
||||
CAPTURE_STRING_LITERAL(1),
|
||||
WHITESPACE,
|
||||
OPTIONAL_COMMA,
|
||||
RIGHT_PARENTHESIS
|
||||
],
|
||||
'g'
|
||||
);
|
||||
const IMPORT_OR_EXPORT_RE = createRegExp(
|
||||
[
|
||||
'\\b(?:import|export)\\s+(?!type(?:of)?\\s+)[^\'"]+\\s+from\\s+',
|
||||
CAPTURE_STRING_LITERAL(1)
|
||||
],
|
||||
'g'
|
||||
);
|
||||
const JEST_EXTENSIONS_RE = createRegExp(
|
||||
[
|
||||
...functionCallStart(
|
||||
'require\\s*\\.\\s*(?:requireActual|requireMock)',
|
||||
'jest\\s*\\.\\s*(?:requireActual|requireMock|genMockFromModule)'
|
||||
),
|
||||
CAPTURE_STRING_LITERAL(1),
|
||||
WHITESPACE,
|
||||
OPTIONAL_COMMA,
|
||||
RIGHT_PARENTHESIS
|
||||
],
|
||||
'g'
|
||||
);
|
||||
|
||||
function extract(code) {
|
||||
const dependencies = new Set();
|
||||
|
||||
const addDependency = (match, _, dep) => {
|
||||
dependencies.add(dep);
|
||||
return match;
|
||||
};
|
||||
|
||||
code
|
||||
.replace(BLOCK_COMMENT_RE, '')
|
||||
.replace(LINE_COMMENT_RE, '')
|
||||
.replace(IMPORT_OR_EXPORT_RE, addDependency)
|
||||
.replace(REQUIRE_OR_DYNAMIC_IMPORT_RE, addDependency)
|
||||
.replace(JEST_EXTENSIONS_RE, addDependency);
|
||||
return dependencies;
|
||||
}
|
9
node_modules/jest-haste-map/build/lib/fast_path.d.ts
generated
vendored
Normal file
9
node_modules/jest-haste-map/build/lib/fast_path.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export declare function relative(rootDir: string, filename: string): string;
|
||||
export declare function resolve(rootDir: string, relativeFilename: string): string;
|
||||
//# sourceMappingURL=fast_path.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/fast_path.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/fast_path.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"fast_path.d.ts","sourceRoot":"","sources":["../../src/lib/fast_path.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIlE;AAMD,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAIzE"}
|
43
node_modules/jest-haste-map/build/lib/fast_path.js
generated
vendored
Normal file
43
node_modules/jest-haste-map/build/lib/fast_path.js
generated
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.relative = relative;
|
||||
exports.resolve = resolve;
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
// rootDir and filename must be absolute paths (resolved)
|
||||
function relative(rootDir, filename) {
|
||||
return filename.indexOf(rootDir + _path().default.sep) === 0
|
||||
? filename.substr(rootDir.length + 1)
|
||||
: _path().default.relative(rootDir, filename);
|
||||
}
|
||||
|
||||
const INDIRECTION_FRAGMENT = '..' + _path().default.sep; // rootDir must be an absolute path and relativeFilename must be simple
|
||||
// (e.g.: foo/bar or ../foo/bar, but never ./foo or foo/../bar)
|
||||
|
||||
function resolve(rootDir, relativeFilename) {
|
||||
return relativeFilename.indexOf(INDIRECTION_FRAGMENT) === 0
|
||||
? _path().default.resolve(rootDir, relativeFilename)
|
||||
: rootDir + _path().default.sep + relativeFilename;
|
||||
}
|
8
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts
generated
vendored
Normal file
8
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export default function getPlatformExtension(file: string, platforms?: Array<string>): string | null;
|
||||
//# sourceMappingURL=getPlatformExtension.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"getPlatformExtension.d.ts","sourceRoot":"","sources":["../../src/lib/getPlatformExtension.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,GACxB,MAAM,GAAG,IAAI,CAaf"}
|
31
node_modules/jest-haste-map/build/lib/getPlatformExtension.js
generated
vendored
Normal file
31
node_modules/jest-haste-map/build/lib/getPlatformExtension.js
generated
vendored
Normal file
|
@ -0,0 +1,31 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = getPlatformExtension;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
const SUPPORTED_PLATFORM_EXTS = new Set(['android', 'ios', 'native', 'web']); // Extract platform extension: index.ios.js -> ios
|
||||
|
||||
function getPlatformExtension(file, platforms) {
|
||||
const last = file.lastIndexOf('.');
|
||||
const secondToLast = file.lastIndexOf('.', last - 1);
|
||||
|
||||
if (secondToLast === -1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const platform = file.substring(secondToLast + 1, last); // If an overriding platform array is passed, check that first
|
||||
|
||||
if (platforms && platforms.indexOf(platform) !== -1) {
|
||||
return platform;
|
||||
}
|
||||
|
||||
return SUPPORTED_PLATFORM_EXTS.has(platform) ? platform : null;
|
||||
}
|
8
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts
generated
vendored
Normal file
8
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
export default function isRegExpSupported(value: string): boolean;
|
||||
//# sourceMappingURL=isRegExpSupported.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"isRegExpSupported.d.ts","sourceRoot":"","sources":["../../src/lib/isRegExpSupported.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAQhE"}
|
22
node_modules/jest-haste-map/build/lib/isRegExpSupported.js
generated
vendored
Normal file
22
node_modules/jest-haste-map/build/lib/isRegExpSupported.js
generated
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = isRegExpSupported;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
function isRegExpSupported(value) {
|
||||
try {
|
||||
// eslint-disable-next-line no-new
|
||||
new RegExp(value);
|
||||
return true;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
9
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts
generated
vendored
Normal file
9
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
declare let normalizePathSep: (string: string) => string;
|
||||
export default normalizePathSep;
|
||||
//# sourceMappingURL=normalizePathSep.d.ts.map
|
1
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"normalizePathSep.d.ts","sourceRoot":"","sources":["../../src/lib/normalizePathSep.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,QAAA,IAAI,gBAAgB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC;AAOjD,eAAe,gBAAgB,CAAC"}
|
37
node_modules/jest-haste-map/build/lib/normalizePathSep.js
generated
vendored
Normal file
37
node_modules/jest-haste-map/build/lib/normalizePathSep.js
generated
vendored
Normal file
|
@ -0,0 +1,37 @@
|
|||
'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 _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
let normalizePathSep;
|
||||
|
||||
if (_path().default.sep === '/') {
|
||||
normalizePathSep = filePath => filePath;
|
||||
} else {
|
||||
normalizePathSep = filePath => filePath.replace(/\//g, _path().default.sep);
|
||||
}
|
||||
|
||||
var _default = normalizePathSep;
|
||||
exports.default = _default;
|
4
node_modules/jest-haste-map/build/persistence.d.ts
generated
vendored
Normal file
4
node_modules/jest-haste-map/build/persistence.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
import { Persistence } from './types';
|
||||
declare let chosenModule: Persistence;
|
||||
export default chosenModule;
|
||||
//# sourceMappingURL=persistence.d.ts.map
|
1
node_modules/jest-haste-map/build/persistence.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/persistence.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../src/persistence.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAIpC,QAAA,IAAI,YAAY,EAAE,WAAW,CAAC;AAQ9B,eAAe,YAAY,CAAC"}
|
19
node_modules/jest-haste-map/build/persistence.js
generated
vendored
Normal file
19
node_modules/jest-haste-map/build/persistence.js
generated
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
// Try to load SQLite persistence, but fall back to file persistence when SQLite
|
||||
let chosenModule;
|
||||
|
||||
try {
|
||||
require.resolve('better-sqlite3');
|
||||
|
||||
chosenModule = require('./persistence/sqlite').default;
|
||||
} catch (_unused) {
|
||||
chosenModule = require('./persistence/file').default;
|
||||
}
|
||||
|
||||
var _default = chosenModule;
|
||||
exports.default = _default;
|
9
node_modules/jest-haste-map/build/persistence/file.d.ts
generated
vendored
Normal file
9
node_modules/jest-haste-map/build/persistence/file.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
import { InternalHasteMap, Persistence } from '../types';
|
||||
declare class FilePersistence implements Persistence {
|
||||
write(cachePath: string, internalHasteMap: InternalHasteMap): void;
|
||||
read(cachePath: string): InternalHasteMap;
|
||||
getType(): string;
|
||||
}
|
||||
declare const _default: FilePersistence;
|
||||
export default _default;
|
||||
//# sourceMappingURL=file.d.ts.map
|
1
node_modules/jest-haste-map/build/persistence/file.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/persistence/file.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../src/persistence/file.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAE,WAAW,EAAC,MAAM,UAAU,CAAC;AAEvD,cAAM,eAAgB,YAAW,WAAW;IAC1C,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,IAAI;IAIlE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAIzC,OAAO;CAGR;;AAED,wBAAqC"}
|
38
node_modules/jest-haste-map/build/persistence/file.js
generated
vendored
Normal file
38
node_modules/jest-haste-map/build/persistence/file.js
generated
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _jestSerializer() {
|
||||
const data = _interopRequireDefault(require('jest-serializer'));
|
||||
|
||||
_jestSerializer = function _jestSerializer() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
class FilePersistence {
|
||||
write(cachePath, internalHasteMap) {
|
||||
_jestSerializer().default.writeFileSync(cachePath, internalHasteMap);
|
||||
}
|
||||
|
||||
read(cachePath) {
|
||||
return _jestSerializer().default.readFileSync(cachePath);
|
||||
}
|
||||
|
||||
getType() {
|
||||
return 'file';
|
||||
}
|
||||
}
|
||||
|
||||
var _default = new FilePersistence();
|
||||
|
||||
exports.default = _default;
|
BIN
node_modules/jest-haste-map/build/persistence/mock-data.v8
generated
vendored
Normal file
BIN
node_modules/jest-haste-map/build/persistence/mock-data.v8
generated
vendored
Normal file
Binary file not shown.
10
node_modules/jest-haste-map/build/persistence/sqlite.d.ts
generated
vendored
Normal file
10
node_modules/jest-haste-map/build/persistence/sqlite.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
import { InternalHasteMap, Persistence, FileData } from '../types';
|
||||
declare class SQLitePersistence implements Persistence {
|
||||
read(cachePath: string): InternalHasteMap;
|
||||
write(cachePath: string, internalHasteMap: InternalHasteMap, removedFiles: FileData, changedFiles?: FileData): void;
|
||||
private getDatabase;
|
||||
getType(): string;
|
||||
}
|
||||
declare const _default: SQLitePersistence;
|
||||
export default _default;
|
||||
//# sourceMappingURL=sqlite.d.ts.map
|
1
node_modules/jest-haste-map/build/persistence/sqlite.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/persistence/sqlite.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"sqlite.d.ts","sourceRoot":"","sources":["../../src/persistence/sqlite.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,QAAQ,EAGT,MAAM,UAAU,CAAC;AAGlB,cAAM,iBAAkB,YAAW,WAAW;IAC5C,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,gBAAgB;IAkGzC,KAAK,CACH,SAAS,EAAE,MAAM,EACjB,gBAAgB,EAAE,gBAAgB,EAClC,YAAY,EAAE,QAAQ,EACtB,YAAY,CAAC,EAAE,QAAQ,GACtB,IAAI;IA6HP,OAAO,CAAC,WAAW;IAoDnB,OAAO;CAGR;;AAED,wBAAuC"}
|
718
node_modules/jest-haste-map/build/persistence/sqlite.js
generated
vendored
Normal file
718
node_modules/jest-haste-map/build/persistence/sqlite.js
generated
vendored
Normal file
|
@ -0,0 +1,718 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _v() {
|
||||
const data = _interopRequireDefault(require('v8'));
|
||||
|
||||
_v = function _v() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _fs() {
|
||||
const data = _interopRequireDefault(require('fs'));
|
||||
|
||||
_fs = function _fs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _betterSqlite() {
|
||||
const data = _interopRequireDefault(require('better-sqlite3'));
|
||||
|
||||
_betterSqlite = function _betterSqlite() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _constants = _interopRequireDefault(require('../constants'));
|
||||
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
|
||||
function _slicedToArray(arr, i) {
|
||||
return (
|
||||
_arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest()
|
||||
);
|
||||
}
|
||||
|
||||
function _nonIterableRest() {
|
||||
throw new TypeError('Invalid attempt to destructure non-iterable instance');
|
||||
}
|
||||
|
||||
function _iterableToArrayLimit(arr, i) {
|
||||
var _arr = [];
|
||||
var _n = true;
|
||||
var _d = false;
|
||||
var _e = undefined;
|
||||
try {
|
||||
for (
|
||||
var _i = arr[Symbol.iterator](), _s;
|
||||
!(_n = (_s = _i.next()).done);
|
||||
_n = true
|
||||
) {
|
||||
_arr.push(_s.value);
|
||||
if (i && _arr.length === i) break;
|
||||
}
|
||||
} catch (err) {
|
||||
_d = true;
|
||||
_e = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_n && _i['return'] != null) _i['return']();
|
||||
} finally {
|
||||
if (_d) throw _e;
|
||||
}
|
||||
}
|
||||
return _arr;
|
||||
}
|
||||
|
||||
function _arrayWithHoles(arr) {
|
||||
if (Array.isArray(arr)) return arr;
|
||||
}
|
||||
|
||||
class SQLitePersistence {
|
||||
read(cachePath) {
|
||||
// Get database, throw if does not exist.
|
||||
const db = this.getDatabase(cachePath, true); // Create empty map to populate.
|
||||
|
||||
const internalHasteMap = {
|
||||
files: new Map(),
|
||||
map: new Map(),
|
||||
mocks: new Map(),
|
||||
duplicates: new Map(),
|
||||
clocks: new Map()
|
||||
}; // Fetch files.
|
||||
|
||||
const filesArr = db.prepare(`SELECT * FROM files`).all();
|
||||
var _iteratorNormalCompletion = true;
|
||||
var _didIteratorError = false;
|
||||
var _iteratorError = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator = filesArr[Symbol.iterator](), _step;
|
||||
!(_iteratorNormalCompletion = (_step = _iterator.next()).done);
|
||||
_iteratorNormalCompletion = true
|
||||
) {
|
||||
const file = _step.value;
|
||||
internalHasteMap.files.set(file.filePath, [
|
||||
file.id,
|
||||
file.mtime,
|
||||
file.size,
|
||||
file.visited,
|
||||
file.dependencies,
|
||||
file.sha1
|
||||
]);
|
||||
} // Fetch map.
|
||||
} catch (err) {
|
||||
_didIteratorError = true;
|
||||
_iteratorError = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
||||
_iterator.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError) {
|
||||
throw _iteratorError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const mapsArr = db.prepare(`SELECT * FROM map`).all();
|
||||
var _iteratorNormalCompletion2 = true;
|
||||
var _didIteratorError2 = false;
|
||||
var _iteratorError2 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator2 = mapsArr[Symbol.iterator](), _step2;
|
||||
!(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done);
|
||||
_iteratorNormalCompletion2 = true
|
||||
) {
|
||||
const map = _step2.value;
|
||||
const mapItem = {};
|
||||
|
||||
if (map.genericPath !== null && map.genericType !== null) {
|
||||
mapItem[_constants.default.GENERIC_PLATFORM] = [
|
||||
map.genericPath,
|
||||
map.genericType
|
||||
];
|
||||
}
|
||||
|
||||
if (map.nativePath !== null && map.nativeType !== null) {
|
||||
mapItem[_constants.default.NATIVE_PLATFORM] = [
|
||||
map.nativePath,
|
||||
map.nativeType
|
||||
];
|
||||
}
|
||||
|
||||
if (map.iosPath !== null && map.iosType !== null) {
|
||||
mapItem[_constants.default.IOS_PLATFORM] = [map.iosPath, map.iosType];
|
||||
}
|
||||
|
||||
if (map.androidPath !== null && map.androidType !== null) {
|
||||
mapItem[_constants.default.ANDROID_PLATFORM] = [
|
||||
map.androidPath,
|
||||
map.androidType
|
||||
];
|
||||
}
|
||||
|
||||
internalHasteMap.map.set(map.name, mapItem);
|
||||
} // Fetch mocks.
|
||||
} catch (err) {
|
||||
_didIteratorError2 = true;
|
||||
_iteratorError2 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
||||
_iterator2.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError2) {
|
||||
throw _iteratorError2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const mocksArr = db.prepare(`SELECT * FROM mocks`).all();
|
||||
var _iteratorNormalCompletion3 = true;
|
||||
var _didIteratorError3 = false;
|
||||
var _iteratorError3 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator3 = mocksArr[Symbol.iterator](), _step3;
|
||||
!(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done);
|
||||
_iteratorNormalCompletion3 = true
|
||||
) {
|
||||
const mock = _step3.value;
|
||||
internalHasteMap.mocks.set(mock.name, mock.filePath);
|
||||
} // Fetch duplicates.
|
||||
} catch (err) {
|
||||
_didIteratorError3 = true;
|
||||
_iteratorError3 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
||||
_iterator3.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError3) {
|
||||
throw _iteratorError3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const duplicatesArr = db.prepare(`SELECT * FROM duplicates`).all();
|
||||
var _iteratorNormalCompletion4 = true;
|
||||
var _didIteratorError4 = false;
|
||||
var _iteratorError4 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator4 = duplicatesArr[Symbol.iterator](), _step4;
|
||||
!(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done);
|
||||
_iteratorNormalCompletion4 = true
|
||||
) {
|
||||
const duplicate = _step4.value;
|
||||
internalHasteMap.duplicates.set(
|
||||
name,
|
||||
_v().default.deserialize(new Buffer(duplicate.serialized))
|
||||
);
|
||||
} // Fetch clocks.
|
||||
} catch (err) {
|
||||
_didIteratorError4 = true;
|
||||
_iteratorError4 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
||||
_iterator4.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError4) {
|
||||
throw _iteratorError4;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const clocksArr = db.prepare(`SELECT * FROM clocks`).all();
|
||||
var _iteratorNormalCompletion5 = true;
|
||||
var _didIteratorError5 = false;
|
||||
var _iteratorError5 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator5 = clocksArr[Symbol.iterator](), _step5;
|
||||
!(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done);
|
||||
_iteratorNormalCompletion5 = true
|
||||
) {
|
||||
const clock = _step5.value;
|
||||
internalHasteMap.clocks.set(clock.relativeRoot, clock.since);
|
||||
} // Close database connection,
|
||||
} catch (err) {
|
||||
_didIteratorError5 = true;
|
||||
_iteratorError5 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
||||
_iterator5.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError5) {
|
||||
throw _iteratorError5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
db.close();
|
||||
return internalHasteMap;
|
||||
}
|
||||
|
||||
write(cachePath, internalHasteMap, removedFiles, changedFiles) {
|
||||
const db = this.getDatabase(cachePath, false);
|
||||
db.transaction(() => {
|
||||
// Incrementally update files.
|
||||
const runFileStmt = (stmt, [filePath, file]) => {
|
||||
stmt.run(
|
||||
filePath,
|
||||
file[_constants.default.ID],
|
||||
file[_constants.default.MTIME],
|
||||
file[_constants.default.SIZE],
|
||||
file[_constants.default.VISITED],
|
||||
file[_constants.default.DEPENDENCIES],
|
||||
file[_constants.default.SHA1]
|
||||
);
|
||||
};
|
||||
|
||||
if (changedFiles !== undefined) {
|
||||
const removeFileStmt = db.prepare(`DELETE FROM files WHERE filePath=?`);
|
||||
var _iteratorNormalCompletion6 = true;
|
||||
var _didIteratorError6 = false;
|
||||
var _iteratorError6 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator6 = removedFiles.keys()[Symbol.iterator](), _step6;
|
||||
!(_iteratorNormalCompletion6 = (_step6 = _iterator6.next()).done);
|
||||
_iteratorNormalCompletion6 = true
|
||||
) {
|
||||
const filePath = _step6.value;
|
||||
removeFileStmt.run(filePath);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError6 = true;
|
||||
_iteratorError6 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion6 && _iterator6.return != null) {
|
||||
_iterator6.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError6) {
|
||||
throw _iteratorError6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const upsertFileStmt = db.prepare(
|
||||
`INSERT OR REPLACE INTO files (filePath, id, mtime, size, visited, dependencies, sha1) VALUES (?, ?, ?, ?, ?, ?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion7 = true;
|
||||
var _didIteratorError7 = false;
|
||||
var _iteratorError7 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator7 = changedFiles[Symbol.iterator](), _step7;
|
||||
!(_iteratorNormalCompletion7 = (_step7 = _iterator7.next()).done);
|
||||
_iteratorNormalCompletion7 = true
|
||||
) {
|
||||
const changedFile = _step7.value;
|
||||
runFileStmt(upsertFileStmt, changedFile);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError7 = true;
|
||||
_iteratorError7 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion7 && _iterator7.return != null) {
|
||||
_iterator7.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError7) {
|
||||
throw _iteratorError7;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
db.exec('DELETE FROM files');
|
||||
const insertFileStmt = db.prepare(
|
||||
`INSERT INTO files (filePath, id, mtime, size, visited, dependencies, sha1) VALUES (?, ?, ?, ?, ?, ?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion8 = true;
|
||||
var _didIteratorError8 = false;
|
||||
var _iteratorError8 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator8 = internalHasteMap.files[Symbol.iterator](), _step8;
|
||||
!(_iteratorNormalCompletion8 = (_step8 = _iterator8.next()).done);
|
||||
_iteratorNormalCompletion8 = true
|
||||
) {
|
||||
const file = _step8.value;
|
||||
runFileStmt(insertFileStmt, file);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError8 = true;
|
||||
_iteratorError8 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion8 && _iterator8.return != null) {
|
||||
_iterator8.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError8) {
|
||||
throw _iteratorError8;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Incrementally update map.
|
||||
|
||||
const runMapStmt = (stmt, [name, mapItem]) => {
|
||||
stmt.run(
|
||||
name,
|
||||
mapItem[_constants.default.GENERIC_PLATFORM] || [null, null],
|
||||
mapItem[_constants.default.NATIVE_PLATFORM] || [null, null],
|
||||
mapItem[_constants.default.IOS_PLATFORM] || [null, null],
|
||||
mapItem[_constants.default.ANDROID_PLATFORM] || [null, null]
|
||||
);
|
||||
};
|
||||
|
||||
if (changedFiles !== undefined) {
|
||||
const removeMapItemStmt = db.prepare(`DELETE FROM map WHERE name=?`);
|
||||
var _iteratorNormalCompletion9 = true;
|
||||
var _didIteratorError9 = false;
|
||||
var _iteratorError9 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator9 = removedFiles.values()[Symbol.iterator](), _step9;
|
||||
!(_iteratorNormalCompletion9 = (_step9 = _iterator9.next()).done);
|
||||
_iteratorNormalCompletion9 = true
|
||||
) {
|
||||
const file = _step9.value;
|
||||
removeMapItemStmt.run(file[_constants.default.ID]);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError9 = true;
|
||||
_iteratorError9 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion9 && _iterator9.return != null) {
|
||||
_iterator9.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError9) {
|
||||
throw _iteratorError9;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const upsertFileStmt = db.prepare(
|
||||
`INSERT OR REPLACE INTO map (name, genericPath, genericType, nativePath, nativeType) VALUES (?, ?, ?, ?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion10 = true;
|
||||
var _didIteratorError10 = false;
|
||||
var _iteratorError10 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator10 = changedFiles.values()[Symbol.iterator](), _step10;
|
||||
!(_iteratorNormalCompletion10 = (_step10 = _iterator10.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion10 = true
|
||||
) {
|
||||
const changedFile = _step10.value;
|
||||
|
||||
if (changedFile[_constants.default.MODULE]) {
|
||||
const mapItem = internalHasteMap.map.get(
|
||||
changedFile[_constants.default.MODULE]
|
||||
);
|
||||
runMapStmt(upsertFileStmt, [
|
||||
changedFile[_constants.default.MODULE],
|
||||
mapItem
|
||||
]);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError10 = true;
|
||||
_iteratorError10 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion10 && _iterator10.return != null) {
|
||||
_iterator10.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError10) {
|
||||
throw _iteratorError10;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
db.exec('DELETE FROM map');
|
||||
const insertMapItem = db.prepare(
|
||||
`INSERT INTO map (name, genericPath, genericType, nativePath, nativeType, iosPath, iosType, androidPath, androidType) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion11 = true;
|
||||
var _didIteratorError11 = false;
|
||||
var _iteratorError11 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator11 = internalHasteMap.map[Symbol.iterator](), _step11;
|
||||
!(_iteratorNormalCompletion11 = (_step11 = _iterator11.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion11 = true
|
||||
) {
|
||||
const mapItem = _step11.value;
|
||||
runMapStmt(insertMapItem, mapItem);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError11 = true;
|
||||
_iteratorError11 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion11 && _iterator11.return != null) {
|
||||
_iterator11.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError11) {
|
||||
throw _iteratorError11;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Replace mocks.
|
||||
|
||||
db.exec('DELETE FROM mocks');
|
||||
const insertMock = db.prepare(
|
||||
`INSERT INTO mocks (name, filePath) VALUES (?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion12 = true;
|
||||
var _didIteratorError12 = false;
|
||||
var _iteratorError12 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator12 = internalHasteMap.mocks[Symbol.iterator](), _step12;
|
||||
!(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done);
|
||||
_iteratorNormalCompletion12 = true
|
||||
) {
|
||||
const _step12$value = _slicedToArray(_step12.value, 2),
|
||||
name = _step12$value[0],
|
||||
filePath = _step12$value[1];
|
||||
|
||||
insertMock.run(name, filePath);
|
||||
} // Incrementally update duplicates.
|
||||
} catch (err) {
|
||||
_didIteratorError12 = true;
|
||||
_iteratorError12 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
|
||||
_iterator12.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError12) {
|
||||
throw _iteratorError12;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (changedFiles === undefined) {
|
||||
const insertDuplicateStmt = db.prepare(
|
||||
`INSERT INTO duplicates (name, serialized) VALUES (?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion13 = true;
|
||||
var _didIteratorError13 = false;
|
||||
var _iteratorError13 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator13 = internalHasteMap.duplicates[Symbol.iterator](),
|
||||
_step13;
|
||||
!(_iteratorNormalCompletion13 = (_step13 = _iterator13.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion13 = true
|
||||
) {
|
||||
const _step13$value = _slicedToArray(_step13.value, 2),
|
||||
name = _step13$value[0],
|
||||
duplicate = _step13$value[1];
|
||||
|
||||
insertDuplicateStmt.run(name, _v().default.serialize(duplicate));
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError13 = true;
|
||||
_iteratorError13 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion13 && _iterator13.return != null) {
|
||||
_iterator13.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError13) {
|
||||
throw _iteratorError13;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (removedFiles.size) {
|
||||
const upsertDuplicateStmt = db.prepare(
|
||||
`INSERT OR REPLACE INTO duplicates (name, serialized) VALUES (?, ?)`
|
||||
);
|
||||
const deleteDuplicateStmt = db.prepare(
|
||||
`DELETE FROM duplicates WHERE name=?`
|
||||
);
|
||||
var _iteratorNormalCompletion14 = true;
|
||||
var _didIteratorError14 = false;
|
||||
var _iteratorError14 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator14 = removedFiles.values()[Symbol.iterator](), _step14;
|
||||
!(_iteratorNormalCompletion14 = (_step14 = _iterator14.next())
|
||||
.done);
|
||||
_iteratorNormalCompletion14 = true
|
||||
) {
|
||||
const file = _step14.value;
|
||||
const moduleID = file[_constants.default.ID];
|
||||
const duplicate = internalHasteMap.duplicates.get(moduleID);
|
||||
|
||||
if (duplicate) {
|
||||
upsertDuplicateStmt.run(name, _v().default.serialize(duplicate));
|
||||
} else {
|
||||
deleteDuplicateStmt.run(name);
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError14 = true;
|
||||
_iteratorError14 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion14 && _iterator14.return != null) {
|
||||
_iterator14.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError14) {
|
||||
throw _iteratorError14;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Replace clocks.
|
||||
|
||||
db.exec('DELETE FROM clocks');
|
||||
const insertClock = db.prepare(
|
||||
`INSERT INTO clocks (relativeRoot, since) VALUES (?, ?)`
|
||||
);
|
||||
var _iteratorNormalCompletion15 = true;
|
||||
var _didIteratorError15 = false;
|
||||
var _iteratorError15 = undefined;
|
||||
|
||||
try {
|
||||
for (
|
||||
var _iterator15 = internalHasteMap.clocks[Symbol.iterator](), _step15;
|
||||
!(_iteratorNormalCompletion15 = (_step15 = _iterator15.next()).done);
|
||||
_iteratorNormalCompletion15 = true
|
||||
) {
|
||||
const _step15$value = _slicedToArray(_step15.value, 2),
|
||||
relativeRoot = _step15$value[0],
|
||||
since = _step15$value[1];
|
||||
|
||||
insertClock.run(relativeRoot, since);
|
||||
}
|
||||
} catch (err) {
|
||||
_didIteratorError15 = true;
|
||||
_iteratorError15 = err;
|
||||
} finally {
|
||||
try {
|
||||
if (!_iteratorNormalCompletion15 && _iterator15.return != null) {
|
||||
_iterator15.return();
|
||||
}
|
||||
} finally {
|
||||
if (_didIteratorError15) {
|
||||
throw _iteratorError15;
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
db.close();
|
||||
}
|
||||
|
||||
getDatabase(cachePath, mustExist) {
|
||||
const dbExists = _fs().default.existsSync(cachePath);
|
||||
|
||||
if (dbExists === false && mustExist) {
|
||||
throw new Error(`Haste SQLite DB does not exist at ${cachePath}`);
|
||||
}
|
||||
|
||||
const db = (0, _betterSqlite().default)(cachePath, {
|
||||
fileMustExist: dbExists
|
||||
});
|
||||
|
||||
if (dbExists === false) {
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS files(
|
||||
filePath text PRIMARY KEY,
|
||||
id text NOT NULL,
|
||||
mtime integer NOT NULL,
|
||||
size integer NOT NULL,
|
||||
visited integer NOT NULL,
|
||||
dependencies text NOT NULL,
|
||||
sha1 text
|
||||
);`);
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS map(
|
||||
name text NOT NULL,
|
||||
genericPath text,
|
||||
genericType integer,
|
||||
nativePath text,
|
||||
nativeType integer,
|
||||
iosPath text,
|
||||
iosType integer,
|
||||
androidPath text,
|
||||
androidType integer
|
||||
);`);
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS mocks(
|
||||
name text PRIMARY KEY,
|
||||
filePath text NOT NULL
|
||||
);`);
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS duplicates(
|
||||
name text PRIMARY KEY,
|
||||
serialized text NOT NULL
|
||||
);`);
|
||||
db.exec(`CREATE TABLE IF NOT EXISTS clocks(
|
||||
relativeRoot text,
|
||||
since text
|
||||
);`);
|
||||
}
|
||||
|
||||
return db;
|
||||
}
|
||||
|
||||
getType() {
|
||||
return 'sqlite';
|
||||
}
|
||||
}
|
||||
|
||||
var _default = new SQLitePersistence();
|
||||
|
||||
exports.default = _default;
|
98
node_modules/jest-haste-map/build/types.d.ts
generated
vendored
Normal file
98
node_modules/jest-haste-map/build/types.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,98 @@
|
|||
/**
|
||||
* 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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
import fs from 'fs';
|
||||
import { Config } from '@jest/types';
|
||||
import ModuleMap from './ModuleMap';
|
||||
import HasteFS from './HasteFS';
|
||||
export declare type IgnoreMatcher = (item: string) => boolean;
|
||||
export declare type Mapper = (item: string) => Array<string> | null;
|
||||
export declare type WorkerMessage = {
|
||||
computeDependencies: boolean;
|
||||
computeSha1: boolean;
|
||||
dependencyExtractor?: string;
|
||||
rootDir: string;
|
||||
filePath: string;
|
||||
hasteImplModulePath?: string;
|
||||
};
|
||||
export declare type WorkerMetadata = {
|
||||
dependencies: Array<string> | undefined | null;
|
||||
id: string | undefined | null;
|
||||
module: ModuleMetaData | undefined | null;
|
||||
sha1: string | undefined | null;
|
||||
};
|
||||
export declare type CrawlerOptions = {
|
||||
computeSha1: boolean;
|
||||
data: InternalHasteMap;
|
||||
extensions: Array<string>;
|
||||
forceNodeFilesystemAPI: boolean;
|
||||
ignore: IgnoreMatcher;
|
||||
mapper?: Mapper | null;
|
||||
rootDir: string;
|
||||
roots: Array<string>;
|
||||
};
|
||||
export declare type HasteImpl = {
|
||||
getHasteName(filePath: Config.Path): string | undefined;
|
||||
};
|
||||
export declare type FileData = Map<Config.Path, FileMetaData>;
|
||||
export declare type FileMetaData = [string, number, number, 0 | 1, string, string | null | undefined];
|
||||
export declare type MockData = Map<string, Config.Path>;
|
||||
export declare type ModuleMapData = Map<string, ModuleMapItem>;
|
||||
export declare type WatchmanClocks = Map<Config.Path, string>;
|
||||
export declare type HasteRegExp = RegExp | ((str: string) => boolean);
|
||||
export declare type DuplicatesSet = Map<string, /* type */ number>;
|
||||
export declare type DuplicatesIndex = Map<string, Map<string, DuplicatesSet>>;
|
||||
export declare type InternalHasteMap = {
|
||||
clocks: WatchmanClocks;
|
||||
duplicates: DuplicatesIndex;
|
||||
files: FileData;
|
||||
map: ModuleMapData;
|
||||
mocks: MockData;
|
||||
};
|
||||
export declare type HasteMap = {
|
||||
hasteFS: HasteFS;
|
||||
moduleMap: ModuleMap;
|
||||
__hasteMapForTest?: InternalHasteMap | null;
|
||||
};
|
||||
export declare type RawModuleMap = {
|
||||
rootDir: Config.Path;
|
||||
duplicates: DuplicatesIndex;
|
||||
map: ModuleMapData;
|
||||
mocks: MockData;
|
||||
};
|
||||
declare type ModuleMapItem = {
|
||||
[platform: string]: ModuleMetaData;
|
||||
};
|
||||
export declare type ModuleMetaData = [Config.Path, /* type */ number];
|
||||
export declare type HType = {
|
||||
ID: 0;
|
||||
MTIME: 1;
|
||||
SIZE: 2;
|
||||
VISITED: 3;
|
||||
DEPENDENCIES: 4;
|
||||
SHA1: 5;
|
||||
PATH: 0;
|
||||
TYPE: 1;
|
||||
MODULE: 0;
|
||||
PACKAGE: 1;
|
||||
GENERIC_PLATFORM: 'g';
|
||||
NATIVE_PLATFORM: 'native';
|
||||
DEPENDENCY_DELIM: '\0';
|
||||
};
|
||||
export declare type HTypeValue = HType[keyof HType];
|
||||
export declare type EventsQueue = Array<{
|
||||
filePath: Config.Path;
|
||||
stat: fs.Stats | undefined;
|
||||
type: string;
|
||||
}>;
|
||||
export declare type ChangeEvent = {
|
||||
eventsQueue: EventsQueue;
|
||||
hasteFS: HasteFS;
|
||||
moduleMap: ModuleMap;
|
||||
};
|
||||
export {};
|
||||
//# sourceMappingURL=types.d.ts.map
|
1
node_modules/jest-haste-map/build/types.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/types.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;;AAEH,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAC,MAAM,EAAC,MAAM,aAAa,CAAC;AACnC,OAAO,SAAS,MAAM,aAAa,CAAC;AACpC,OAAO,OAAO,MAAM,WAAW,CAAC;AAEhC,oBAAY,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AACtD,oBAAY,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,KAAK,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5D,oBAAY,aAAa,GAAG;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC;IAC/C,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;IAC9B,MAAM,EAAE,cAAc,GAAG,SAAS,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAC;CACjC,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,WAAW,EAAE,OAAO,CAAC;IACrB,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,sBAAsB,EAAE,OAAO,CAAC;IAChC,MAAM,EAAE,aAAa,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CACtB,CAAC;AAEF,oBAAY,SAAS,GAAG;IACtB,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;CACzD,CAAC;AAEF,oBAAY,QAAQ,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;AAEtD,oBAAY,YAAY,GAAG,CAChB,MAAM,EACH,MAAM,EACP,MAAM,EACH,CAAC,GAAG,CAAC,EACA,MAAM,EACd,MAAM,GAAG,IAAI,GAAG,SAAS,CACrC,CAAC;AAEF,oBAAY,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;AAChD,oBAAY,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AACvD,oBAAY,cAAc,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtD,oBAAY,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC;AAE9D,oBAAY,aAAa,GAAG,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;AAC3D,oBAAY,eAAe,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC;AAEtE,oBAAY,gBAAgB,GAAG;IAC7B,MAAM,EAAE,cAAc,CAAC;IACvB,UAAU,EAAE,eAAe,CAAC;IAC5B,KAAK,EAAE,QAAQ,CAAC;IAChB,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;IACrB,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC7C,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC;IACrB,UAAU,EAAE,eAAe,CAAC;IAC5B,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,QAAQ,CAAC;CACjB,CAAC;AAEF,aAAK,aAAa,GAAG;IAAC,CAAC,QAAQ,EAAE,MAAM,GAAG,cAAc,CAAA;CAAC,CAAC;AAC1D,oBAAY,cAAc,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC;AAE9D,oBAAY,KAAK,GAAG;IAClB,EAAE,EAAE,CAAC,CAAC;IACN,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAAE,CAAC,CAAC;IACR,OAAO,EAAE,CAAC,CAAC;IACX,YAAY,EAAE,CAAC,CAAC;IAChB,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,CAAC,CAAC;IACR,IAAI,EAAE,CAAC,CAAC;IACR,MAAM,EAAE,CAAC,CAAC;IACV,OAAO,EAAE,CAAC,CAAC;IACX,gBAAgB,EAAE,GAAG,CAAC;IACtB,eAAe,EAAE,QAAQ,CAAC;IAC1B,gBAAgB,EAAE,IAAI,CAAC;CACxB,CAAC;AAEF,oBAAY,UAAU,GAAG,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC;AAE5C,oBAAY,WAAW,GAAG,KAAK,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC;IACtB,IAAI,EAAE,EAAE,CAAC,KAAK,GAAG,SAAS,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,CAAC;AAEH,oBAAY,WAAW,GAAG;IACxB,WAAW,EAAE,WAAW,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC;CACtB,CAAC"}
|
1
node_modules/jest-haste-map/build/types.js
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/types.js
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
'use strict';
|
10
node_modules/jest-haste-map/build/worker.d.ts
generated
vendored
Normal file
10
node_modules/jest-haste-map/build/worker.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
/**
|
||||
* 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 { WorkerMessage, WorkerMetadata } from './types';
|
||||
export declare function worker(data: WorkerMessage): Promise<WorkerMetadata>;
|
||||
export declare function getSha1(data: WorkerMessage): Promise<WorkerMetadata>;
|
||||
//# sourceMappingURL=worker.d.ts.map
|
1
node_modules/jest-haste-map/build/worker.d.ts.map
generated
vendored
Normal file
1
node_modules/jest-haste-map/build/worker.d.ts.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAY,aAAa,EAAE,cAAc,EAAC,MAAM,SAAS,CAAC;AAiBjE,wBAAsB,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAwEzE;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC,CAW1E"}
|
230
node_modules/jest-haste-map/build/worker.js
generated
vendored
Normal file
230
node_modules/jest-haste-map/build/worker.js
generated
vendored
Normal file
|
@ -0,0 +1,230 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.worker = worker;
|
||||
exports.getSha1 = getSha1;
|
||||
|
||||
function _crypto() {
|
||||
const data = _interopRequireDefault(require('crypto'));
|
||||
|
||||
_crypto = function _crypto() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _path() {
|
||||
const data = _interopRequireDefault(require('path'));
|
||||
|
||||
_path = function _path() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _gracefulFs() {
|
||||
const data = _interopRequireDefault(require('graceful-fs'));
|
||||
|
||||
_gracefulFs = function _gracefulFs() {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _blacklist = _interopRequireDefault(require('./blacklist'));
|
||||
|
||||
var _constants = _interopRequireDefault(require('./constants'));
|
||||
|
||||
var dependencyExtractor = _interopRequireWildcard(
|
||||
require('./lib/dependencyExtractor')
|
||||
);
|
||||
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
} else {
|
||||
var newObj = {};
|
||||
if (obj != null) {
|
||||
for (var key in obj) {
|
||||
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc =
|
||||
Object.defineProperty && Object.getOwnPropertyDescriptor
|
||||
? Object.getOwnPropertyDescriptor(obj, key)
|
||||
: {};
|
||||
if (desc.get || desc.set) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
return newObj;
|
||||
}
|
||||
}
|
||||
|
||||
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 PACKAGE_JSON = _path().default.sep + 'package.json';
|
||||
let hasteImpl = null;
|
||||
let hasteImplModulePath = null;
|
||||
|
||||
function sha1hex(content) {
|
||||
return _crypto()
|
||||
.default.createHash('sha1')
|
||||
.update(content)
|
||||
.digest('hex');
|
||||
}
|
||||
|
||||
function worker(_x) {
|
||||
return _worker.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _worker() {
|
||||
_worker = _asyncToGenerator(function*(data) {
|
||||
if (
|
||||
data.hasteImplModulePath &&
|
||||
data.hasteImplModulePath !== hasteImplModulePath
|
||||
) {
|
||||
if (hasteImpl) {
|
||||
throw new Error('jest-haste-map: hasteImplModulePath changed');
|
||||
}
|
||||
|
||||
hasteImplModulePath = data.hasteImplModulePath;
|
||||
hasteImpl = require(hasteImplModulePath);
|
||||
}
|
||||
|
||||
let content;
|
||||
let dependencies;
|
||||
let id;
|
||||
let module;
|
||||
let sha1;
|
||||
const computeDependencies = data.computeDependencies,
|
||||
computeSha1 = data.computeSha1,
|
||||
rootDir = data.rootDir,
|
||||
filePath = data.filePath;
|
||||
|
||||
const getContent = () => {
|
||||
if (content === undefined) {
|
||||
content = _gracefulFs().default.readFileSync(filePath, 'utf8');
|
||||
}
|
||||
|
||||
return content;
|
||||
};
|
||||
|
||||
if (filePath.endsWith(PACKAGE_JSON)) {
|
||||
// Process a package.json that is returned as a PACKAGE type with its name.
|
||||
try {
|
||||
const fileData = JSON.parse(getContent());
|
||||
|
||||
if (fileData.name) {
|
||||
const relativeFilePath = _path().default.relative(rootDir, filePath);
|
||||
|
||||
id = fileData.name;
|
||||
module = [relativeFilePath, _constants.default.PACKAGE];
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error(`Cannot parse ${filePath} as JSON: ${err.message}`);
|
||||
}
|
||||
} else if (
|
||||
!_blacklist.default.has(filePath.substr(filePath.lastIndexOf('.')))
|
||||
) {
|
||||
// Process a random file that is returned as a MODULE.
|
||||
if (hasteImpl) {
|
||||
id = hasteImpl.getHasteName(filePath);
|
||||
}
|
||||
|
||||
if (computeDependencies) {
|
||||
const content = getContent();
|
||||
dependencies = Array.from(
|
||||
data.dependencyExtractor
|
||||
? require(data.dependencyExtractor).extract(
|
||||
content,
|
||||
filePath,
|
||||
dependencyExtractor.extract
|
||||
)
|
||||
: dependencyExtractor.extract(content)
|
||||
);
|
||||
}
|
||||
|
||||
if (id) {
|
||||
const relativeFilePath = _path().default.relative(rootDir, filePath);
|
||||
|
||||
module = [relativeFilePath, _constants.default.MODULE];
|
||||
}
|
||||
} // If a SHA-1 is requested on update, compute it.
|
||||
|
||||
if (computeSha1) {
|
||||
sha1 = sha1hex(
|
||||
getContent() || _gracefulFs().default.readFileSync(filePath)
|
||||
);
|
||||
}
|
||||
|
||||
return {
|
||||
dependencies,
|
||||
id,
|
||||
module,
|
||||
sha1
|
||||
};
|
||||
});
|
||||
return _worker.apply(this, arguments);
|
||||
}
|
||||
|
||||
function getSha1(_x2) {
|
||||
return _getSha.apply(this, arguments);
|
||||
}
|
||||
|
||||
function _getSha() {
|
||||
_getSha = _asyncToGenerator(function*(data) {
|
||||
const sha1 = data.computeSha1
|
||||
? sha1hex(_gracefulFs().default.readFileSync(data.filePath))
|
||||
: null;
|
||||
return {
|
||||
dependencies: undefined,
|
||||
id: undefined,
|
||||
module: undefined,
|
||||
sha1
|
||||
};
|
||||
});
|
||||
return _getSha.apply(this, arguments);
|
||||
}
|
48
node_modules/jest-haste-map/package.json
generated
vendored
Normal file
48
node_modules/jest-haste-map/package.json
generated
vendored
Normal file
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "jest-haste-map",
|
||||
"version": "24.8.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/facebook/jest.git",
|
||||
"directory": "packages/jest-haste-map"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "build/index.js",
|
||||
"types": "build/index.d.ts",
|
||||
"dependencies": {
|
||||
"@jest/types": "^24.8.0",
|
||||
"anymatch": "^2.0.0",
|
||||
"fb-watchman": "^2.0.0",
|
||||
"graceful-fs": "^4.1.15",
|
||||
"invariant": "^2.2.4",
|
||||
"jest-serializer": "^24.4.0",
|
||||
"jest-util": "^24.8.0",
|
||||
"jest-worker": "^24.6.0",
|
||||
"micromatch": "^3.1.10",
|
||||
"sane": "^4.0.3",
|
||||
"walker": "^1.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/anymatch": "^1.3.1",
|
||||
"@types/fb-watchman": "^2.0.0",
|
||||
"@types/fsevents": "^1.1.0",
|
||||
"@types/graceful-fs": "^4.1.2",
|
||||
"@types/invariant": "^2.2.29",
|
||||
"@types/micromatch": "^3.1.0",
|
||||
"@types/sane": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"fsevents": "^1.2.7"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "845728f24b3ef41e450595c384e9b5c9fdf248a4"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.1.tgz"
|
||||
,"_integrity": "sha512-SwaxMGVdAZk3ernAx2Uv2sorA7jm3Kx+lR0grp6rMmnY06Kn/urtKx1LPN2mGTea4fCT38impYT28FfcLUhX0g=="
|
||||
,"_from": "jest-haste-map@24.8.1"
|
||||
}
|
13
node_modules/jest-haste-map/tsconfig.json
generated
vendored
Normal file
13
node_modules/jest-haste-map/tsconfig.json
generated
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": "src",
|
||||
"outDir": "build"
|
||||
},
|
||||
"references": [
|
||||
{"path": "../jest-worker"},
|
||||
{"path": "../jest-serializer"},
|
||||
{"path": "../jest-util"},
|
||||
{"path": "../jest-types"}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue