mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2025-05-21 05:24:45 +00:00
.
This commit is contained in:
parent
9fff29ba6c
commit
00c3b50fca
7278 changed files with 0 additions and 1778943 deletions
46
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts
generated
vendored
46
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts
generated
vendored
|
@ -1,46 +0,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.
|
||||
*
|
||||
*/
|
||||
/// <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
1
node_modules/jest-haste-map/build/lib/FSEventsWatcher.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
248
node_modules/jest-haste-map/build/lib/FSEventsWatcher.js
generated
vendored
|
@ -1,248 +0,0 @@
|
|||
'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
400
node_modules/jest-haste-map/build/lib/WatchmanWatcher.js
generated
vendored
|
@ -1,400 +0,0 @@
|
|||
'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
8
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts
generated
vendored
|
@ -1,8 +0,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.
|
||||
*/
|
||||
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
1
node_modules/jest-haste-map/build/lib/dependencyExtractor.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
100
node_modules/jest-haste-map/build/lib/dependencyExtractor.js
generated
vendored
|
@ -1,100 +0,0 @@
|
|||
'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
9
node_modules/jest-haste-map/build/lib/fast_path.d.ts
generated
vendored
|
@ -1,9 +0,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.
|
||||
*/
|
||||
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
1
node_modules/jest-haste-map/build/lib/fast_path.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
43
node_modules/jest-haste-map/build/lib/fast_path.js
generated
vendored
|
@ -1,43 +0,0 @@
|
|||
'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
8
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts
generated
vendored
|
@ -1,8 +0,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.
|
||||
*/
|
||||
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
1
node_modules/jest-haste-map/build/lib/getPlatformExtension.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
31
node_modules/jest-haste-map/build/lib/getPlatformExtension.js
generated
vendored
|
@ -1,31 +0,0 @@
|
|||
'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
8
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts
generated
vendored
|
@ -1,8 +0,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.
|
||||
*/
|
||||
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
1
node_modules/jest-haste-map/build/lib/isRegExpSupported.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
22
node_modules/jest-haste-map/build/lib/isRegExpSupported.js
generated
vendored
|
@ -1,22 +0,0 @@
|
|||
'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
9
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts
generated
vendored
|
@ -1,9 +0,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.
|
||||
*/
|
||||
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
1
node_modules/jest-haste-map/build/lib/normalizePathSep.d.ts.map
generated
vendored
|
@ -1 +0,0 @@
|
|||
{"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
37
node_modules/jest-haste-map/build/lib/normalizePathSep.js
generated
vendored
|
@ -1,37 +0,0 @@
|
|||
'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;
|
Loading…
Add table
Add a link
Reference in a new issue