Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
parent
a10d84bc2e
commit
7ad2aa66bb
7655 changed files with 1763577 additions and 14 deletions
25
node_modules/jest-watcher/build/lib/Prompt.d.ts
generated
vendored
Normal file
25
node_modules/jest-watcher/build/lib/Prompt.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
/**
|
||||
* 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 type { ScrollOptions } from '../types';
|
||||
export default class Prompt {
|
||||
private _entering;
|
||||
private _value;
|
||||
private _onChange;
|
||||
private _onSuccess;
|
||||
private _onCancel;
|
||||
private _offset;
|
||||
private _promptLength;
|
||||
private _selection;
|
||||
constructor();
|
||||
private _onResize;
|
||||
enter(onChange: (pattern: string, options: ScrollOptions) => void, onSuccess: (pattern: string) => void, onCancel: () => void): void;
|
||||
setPromptLength(length: number): void;
|
||||
setPromptSelection(selected: string): void;
|
||||
put(key: string): void;
|
||||
abort(): void;
|
||||
isEntering(): boolean;
|
||||
}
|
157
node_modules/jest-watcher/build/lib/Prompt.js
generated
vendored
Normal file
157
node_modules/jest-watcher/build/lib/Prompt.js
generated
vendored
Normal file
|
@ -0,0 +1,157 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _constants() {
|
||||
const data = require('../constants');
|
||||
|
||||
_constants = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
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 Prompt {
|
||||
constructor() {
|
||||
_defineProperty(this, '_entering', void 0);
|
||||
|
||||
_defineProperty(this, '_value', void 0);
|
||||
|
||||
_defineProperty(this, '_onChange', void 0);
|
||||
|
||||
_defineProperty(this, '_onSuccess', void 0);
|
||||
|
||||
_defineProperty(this, '_onCancel', void 0);
|
||||
|
||||
_defineProperty(this, '_offset', void 0);
|
||||
|
||||
_defineProperty(this, '_promptLength', void 0);
|
||||
|
||||
_defineProperty(this, '_selection', void 0);
|
||||
|
||||
_defineProperty(this, '_onResize', () => {
|
||||
this._onChange();
|
||||
});
|
||||
|
||||
// Copied from `enter` to satisfy TS
|
||||
this._entering = true;
|
||||
this._value = '';
|
||||
this._selection = null;
|
||||
this._offset = -1;
|
||||
this._promptLength = 0;
|
||||
|
||||
this._onChange = () => {};
|
||||
|
||||
this._onSuccess = () => {};
|
||||
|
||||
this._onCancel = () => {};
|
||||
}
|
||||
|
||||
enter(onChange, onSuccess, onCancel) {
|
||||
this._entering = true;
|
||||
this._value = '';
|
||||
this._onSuccess = onSuccess;
|
||||
this._onCancel = onCancel;
|
||||
this._selection = null;
|
||||
this._offset = -1;
|
||||
this._promptLength = 0;
|
||||
|
||||
this._onChange = () =>
|
||||
onChange(this._value, {
|
||||
max: 10,
|
||||
offset: this._offset
|
||||
});
|
||||
|
||||
this._onChange();
|
||||
|
||||
process.stdout.on('resize', this._onResize);
|
||||
}
|
||||
|
||||
setPromptLength(length) {
|
||||
this._promptLength = length;
|
||||
}
|
||||
|
||||
setPromptSelection(selected) {
|
||||
this._selection = selected;
|
||||
}
|
||||
|
||||
put(key) {
|
||||
switch (key) {
|
||||
case _constants().KEYS.ENTER:
|
||||
this._entering = false;
|
||||
|
||||
this._onSuccess(this._selection || this._value);
|
||||
|
||||
this.abort();
|
||||
break;
|
||||
|
||||
case _constants().KEYS.ESCAPE:
|
||||
this._entering = false;
|
||||
|
||||
this._onCancel(this._value);
|
||||
|
||||
this.abort();
|
||||
break;
|
||||
|
||||
case _constants().KEYS.ARROW_DOWN:
|
||||
this._offset = Math.min(this._offset + 1, this._promptLength - 1);
|
||||
|
||||
this._onChange();
|
||||
|
||||
break;
|
||||
|
||||
case _constants().KEYS.ARROW_UP:
|
||||
this._offset = Math.max(this._offset - 1, -1);
|
||||
|
||||
this._onChange();
|
||||
|
||||
break;
|
||||
|
||||
case _constants().KEYS.ARROW_LEFT:
|
||||
case _constants().KEYS.ARROW_RIGHT:
|
||||
break;
|
||||
|
||||
default:
|
||||
this._value =
|
||||
key === _constants().KEYS.BACKSPACE
|
||||
? this._value.slice(0, -1)
|
||||
: this._value + key;
|
||||
this._offset = -1;
|
||||
this._selection = null;
|
||||
|
||||
this._onChange();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
abort() {
|
||||
this._entering = false;
|
||||
this._value = '';
|
||||
process.stdout.removeListener('resize', this._onResize);
|
||||
}
|
||||
|
||||
isEntering() {
|
||||
return this._entering;
|
||||
}
|
||||
}
|
||||
|
||||
exports.default = Prompt;
|
8
node_modules/jest-watcher/build/lib/colorize.d.ts
generated
vendored
Normal file
8
node_modules/jest-watcher/build/lib/colorize.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.
|
||||
*/
|
||||
declare const _default: (str: string, start: number, end: number) => string;
|
||||
export default _default;
|
33
node_modules/jest-watcher/build/lib/colorize.js
generated
vendored
Normal file
33
node_modules/jest-watcher/build/lib/colorize.js
generated
vendored
Normal file
|
@ -0,0 +1,33 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
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.
|
||||
*/
|
||||
var _default = (str, start, end) =>
|
||||
_chalk().default.dim(str.slice(0, start)) +
|
||||
_chalk().default.reset(str.slice(start, end)) +
|
||||
_chalk().default.dim(str.slice(end));
|
||||
|
||||
exports.default = _default;
|
8
node_modules/jest-watcher/build/lib/formatTestNameByPattern.d.ts
generated
vendored
Normal file
8
node_modules/jest-watcher/build/lib/formatTestNameByPattern.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.
|
||||
*/
|
||||
declare const _default: (testName: string, pattern: string, width: number) => string;
|
||||
export default _default;
|
83
node_modules/jest-watcher/build/lib/formatTestNameByPattern.js
generated
vendored
Normal file
83
node_modules/jest-watcher/build/lib/formatTestNameByPattern.js
generated
vendored
Normal file
|
@ -0,0 +1,83 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
var _colorize = _interopRequireDefault(require('./colorize'));
|
||||
|
||||
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 DOTS = '...';
|
||||
const ENTER = '⏎';
|
||||
|
||||
var _default = (testName, pattern, width) => {
|
||||
const inlineTestName = testName.replace(/(\r\n|\n|\r)/gm, ENTER);
|
||||
let regexp;
|
||||
|
||||
try {
|
||||
regexp = new RegExp(pattern, 'i');
|
||||
} catch {
|
||||
return _chalk().default.dim(inlineTestName);
|
||||
}
|
||||
|
||||
const match = inlineTestName.match(regexp);
|
||||
|
||||
if (!match) {
|
||||
return _chalk().default.dim(inlineTestName);
|
||||
}
|
||||
|
||||
const startPatternIndex = Math.max(match.index || 0, 0);
|
||||
const endPatternIndex = startPatternIndex + match[0].length;
|
||||
|
||||
if (inlineTestName.length <= width) {
|
||||
return (0, _colorize.default)(
|
||||
inlineTestName,
|
||||
startPatternIndex,
|
||||
endPatternIndex
|
||||
);
|
||||
}
|
||||
|
||||
const slicedTestName = inlineTestName.slice(0, width - DOTS.length);
|
||||
|
||||
if (startPatternIndex < slicedTestName.length) {
|
||||
if (endPatternIndex > slicedTestName.length) {
|
||||
return (0, _colorize.default)(
|
||||
slicedTestName + DOTS,
|
||||
startPatternIndex,
|
||||
slicedTestName.length + DOTS.length
|
||||
);
|
||||
} else {
|
||||
return (0, _colorize.default)(
|
||||
slicedTestName + DOTS,
|
||||
Math.min(startPatternIndex, slicedTestName.length),
|
||||
endPatternIndex
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return `${_chalk().default.dim(slicedTestName)}${_chalk().default.reset(
|
||||
DOTS
|
||||
)}`;
|
||||
};
|
||||
|
||||
exports.default = _default;
|
9
node_modules/jest-watcher/build/lib/patternModeHelpers.d.ts
generated
vendored
Normal file
9
node_modules/jest-watcher/build/lib/patternModeHelpers.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.
|
||||
*/
|
||||
/// <reference types="node" />
|
||||
export declare const printPatternCaret: (pattern: string, pipe: NodeJS.WritableStream) => void;
|
||||
export declare const printRestoredPatternCaret: (pattern: string, currentUsageRows: number, pipe: NodeJS.WritableStream) => void;
|
68
node_modules/jest-watcher/build/lib/patternModeHelpers.js
generated
vendored
Normal file
68
node_modules/jest-watcher/build/lib/patternModeHelpers.js
generated
vendored
Normal file
|
@ -0,0 +1,68 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.printRestoredPatternCaret = exports.printPatternCaret = void 0;
|
||||
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _ansiEscapes() {
|
||||
const data = _interopRequireDefault(require('ansi-escapes'));
|
||||
|
||||
_ansiEscapes = function () {
|
||||
return data;
|
||||
};
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
function _stringLength() {
|
||||
const data = _interopRequireDefault(require('string-length'));
|
||||
|
||||
_stringLength = function () {
|
||||
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 printPatternCaret = (pattern, pipe) => {
|
||||
const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`;
|
||||
pipe.write(_ansiEscapes().default.eraseDown);
|
||||
pipe.write(inputText);
|
||||
pipe.write(_ansiEscapes().default.cursorSavePosition);
|
||||
};
|
||||
|
||||
exports.printPatternCaret = printPatternCaret;
|
||||
|
||||
const printRestoredPatternCaret = (pattern, currentUsageRows, pipe) => {
|
||||
const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`;
|
||||
pipe.write(
|
||||
_ansiEscapes().default.cursorTo(
|
||||
(0, _stringLength().default)(inputText),
|
||||
currentUsageRows - 1
|
||||
)
|
||||
);
|
||||
pipe.write(_ansiEscapes().default.cursorRestorePosition);
|
||||
};
|
||||
|
||||
exports.printRestoredPatternCaret = printRestoredPatternCaret;
|
12
node_modules/jest-watcher/build/lib/scroll.d.ts
generated
vendored
Normal file
12
node_modules/jest-watcher/build/lib/scroll.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
import type { ScrollOptions } from '../types';
|
||||
export default function scroll(size: number, { offset, max }: ScrollOptions): {
|
||||
end: number;
|
||||
index: number;
|
||||
start: number;
|
||||
};
|
34
node_modules/jest-watcher/build/lib/scroll.js
generated
vendored
Normal file
34
node_modules/jest-watcher/build/lib/scroll.js
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = scroll;
|
||||
|
||||
/**
|
||||
* 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 scroll(size, {offset, max}) {
|
||||
let start = 0;
|
||||
let index = Math.min(offset, size);
|
||||
const halfScreen = max / 2;
|
||||
|
||||
if (index <= halfScreen) {
|
||||
start = 0;
|
||||
} else {
|
||||
if (size >= max) {
|
||||
start = Math.min(index - halfScreen - 1, size - max);
|
||||
}
|
||||
|
||||
index = Math.min(index - start, size);
|
||||
}
|
||||
|
||||
return {
|
||||
end: Math.min(size, start + max),
|
||||
index,
|
||||
start
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue