feat: initial commit
This commit is contained in:
21
node_modules/jest-watcher/LICENSE
generated
vendored
Normal file
21
node_modules/jest-watcher/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
35
node_modules/jest-watcher/build/BaseWatchPlugin.js
generated
vendored
Normal file
35
node_modules/jest-watcher/build/BaseWatchPlugin.js
generated
vendored
Normal file
@ -0,0 +1,35 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
class BaseWatchPlugin {
|
||||
_stdin;
|
||||
_stdout;
|
||||
constructor({stdin, stdout}) {
|
||||
this._stdin = stdin;
|
||||
this._stdout = stdout;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
apply(_hooks) {}
|
||||
getUsageInfo(_globalConfig) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||
onKey(_key) {}
|
||||
run(_globalConfig, _updateConfigAndRun) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
var _default = BaseWatchPlugin;
|
||||
exports.default = _default;
|
63
node_modules/jest-watcher/build/JestHooks.js
generated
vendored
Normal file
63
node_modules/jest-watcher/build/JestHooks.js
generated
vendored
Normal file
@ -0,0 +1,63 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
class JestHooks {
|
||||
_listeners;
|
||||
_subscriber;
|
||||
_emitter;
|
||||
constructor() {
|
||||
this._listeners = {
|
||||
onFileChange: [],
|
||||
onTestRunComplete: [],
|
||||
shouldRunTestSuite: []
|
||||
};
|
||||
this._subscriber = {
|
||||
onFileChange: fn => {
|
||||
this._listeners.onFileChange.push(fn);
|
||||
},
|
||||
onTestRunComplete: fn => {
|
||||
this._listeners.onTestRunComplete.push(fn);
|
||||
},
|
||||
shouldRunTestSuite: fn => {
|
||||
this._listeners.shouldRunTestSuite.push(fn);
|
||||
}
|
||||
};
|
||||
this._emitter = {
|
||||
onFileChange: fs =>
|
||||
this._listeners.onFileChange.forEach(listener => listener(fs)),
|
||||
onTestRunComplete: results =>
|
||||
this._listeners.onTestRunComplete.forEach(listener =>
|
||||
listener(results)
|
||||
),
|
||||
shouldRunTestSuite: async testSuiteInfo => {
|
||||
const result = await Promise.all(
|
||||
this._listeners.shouldRunTestSuite.map(listener =>
|
||||
listener(testSuiteInfo)
|
||||
)
|
||||
);
|
||||
return result.every(Boolean);
|
||||
}
|
||||
};
|
||||
}
|
||||
isUsed(hook) {
|
||||
return this._listeners[hook]?.length > 0;
|
||||
}
|
||||
getSubscriber() {
|
||||
return this._subscriber;
|
||||
}
|
||||
getEmitter() {
|
||||
return this._emitter;
|
||||
}
|
||||
}
|
||||
var _default = JestHooks;
|
||||
exports.default = _default;
|
74
node_modules/jest-watcher/build/PatternPrompt.js
generated
vendored
Normal file
74
node_modules/jest-watcher/build/PatternPrompt.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function _ansiEscapes() {
|
||||
const data = _interopRequireDefault(require('ansi-escapes'));
|
||||
_ansiEscapes = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
_chalk = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _jestUtil() {
|
||||
const data = require('jest-util');
|
||||
_jestUtil = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const {CLEAR} = _jestUtil().specialChars;
|
||||
const usage = entity =>
|
||||
`\n${_chalk().default.bold('Pattern Mode Usage')}\n` +
|
||||
` ${_chalk().default.dim('\u203A Press')} Esc ${_chalk().default.dim(
|
||||
'to exit pattern mode.'
|
||||
)}\n` +
|
||||
` ${_chalk().default.dim('\u203A Press')} Enter ` +
|
||||
`${_chalk().default.dim(`to filter by a ${entity} regex pattern.`)}\n` +
|
||||
'\n';
|
||||
const usageRows = usage('').split('\n').length;
|
||||
class PatternPrompt {
|
||||
_currentUsageRows;
|
||||
constructor(_pipe, _prompt, _entityName = '') {
|
||||
this._pipe = _pipe;
|
||||
this._prompt = _prompt;
|
||||
this._entityName = _entityName;
|
||||
this._currentUsageRows = usageRows;
|
||||
}
|
||||
run(onSuccess, onCancel, options) {
|
||||
this._pipe.write(_ansiEscapes().default.cursorHide);
|
||||
this._pipe.write(CLEAR);
|
||||
if (options && options.header) {
|
||||
this._pipe.write(`${options.header}\n`);
|
||||
this._currentUsageRows = usageRows + options.header.split('\n').length;
|
||||
} else {
|
||||
this._currentUsageRows = usageRows;
|
||||
}
|
||||
this._pipe.write(usage(this._entityName));
|
||||
this._pipe.write(_ansiEscapes().default.cursorShow);
|
||||
this._prompt.enter(this._onChange.bind(this), onSuccess, onCancel);
|
||||
}
|
||||
_onChange(_pattern, _options) {
|
||||
this._pipe.write(_ansiEscapes().default.eraseLine);
|
||||
this._pipe.write(_ansiEscapes().default.cursorLeft);
|
||||
}
|
||||
}
|
||||
exports.default = PatternPrompt;
|
45
node_modules/jest-watcher/build/TestWatcher.js
generated
vendored
Normal file
45
node_modules/jest-watcher/build/TestWatcher.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
function _emittery() {
|
||||
const data = _interopRequireDefault(require('emittery'));
|
||||
_emittery = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
class TestWatcher extends _emittery().default {
|
||||
state;
|
||||
_isWatchMode;
|
||||
constructor({isWatchMode}) {
|
||||
super();
|
||||
this.state = {
|
||||
interrupted: false
|
||||
};
|
||||
this._isWatchMode = isWatchMode;
|
||||
}
|
||||
async setState(state) {
|
||||
Object.assign(this.state, state);
|
||||
await this.emit('change', this.state);
|
||||
}
|
||||
isInterrupted() {
|
||||
return this.state.interrupted;
|
||||
}
|
||||
isWatchMode() {
|
||||
return this._isWatchMode;
|
||||
}
|
||||
}
|
||||
exports.default = TestWatcher;
|
27
node_modules/jest-watcher/build/constants.js
generated
vendored
Normal file
27
node_modules/jest-watcher/build/constants.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.KEYS = void 0;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
const isWindows = process.platform === 'win32';
|
||||
const KEYS = {
|
||||
ARROW_DOWN: '\u001b[B',
|
||||
ARROW_LEFT: '\u001b[D',
|
||||
ARROW_RIGHT: '\u001b[C',
|
||||
ARROW_UP: '\u001b[A',
|
||||
BACKSPACE: Buffer.from(isWindows ? '08' : '7f', 'hex').toString(),
|
||||
CONTROL_C: '\u0003',
|
||||
CONTROL_D: '\u0004',
|
||||
CONTROL_U: '\u0015',
|
||||
ENTER: '\r',
|
||||
ESCAPE: '\u001b'
|
||||
};
|
||||
exports.KEYS = KEYS;
|
222
node_modules/jest-watcher/build/index.d.ts
generated
vendored
Normal file
222
node_modules/jest-watcher/build/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,222 @@
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* 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 type {AggregatedResult} from '@jest/test-result';
|
||||
import type {Config} from '@jest/types';
|
||||
import Emittery = require('emittery');
|
||||
|
||||
export declare type AllowedConfigOptions = Partial<
|
||||
Pick<
|
||||
Config.GlobalConfig,
|
||||
| 'bail'
|
||||
| 'changedSince'
|
||||
| 'collectCoverage'
|
||||
| 'collectCoverageFrom'
|
||||
| 'coverageDirectory'
|
||||
| 'coverageReporters'
|
||||
| 'findRelatedTests'
|
||||
| 'nonFlagArgs'
|
||||
| 'notify'
|
||||
| 'notifyMode'
|
||||
| 'onlyFailures'
|
||||
| 'reporters'
|
||||
| 'testNamePattern'
|
||||
| 'testPathPattern'
|
||||
| 'updateSnapshot'
|
||||
| 'verbose'
|
||||
> & {
|
||||
mode: 'watch' | 'watchAll';
|
||||
}
|
||||
>;
|
||||
|
||||
declare type AvailableHooks =
|
||||
| 'onFileChange'
|
||||
| 'onTestRunComplete'
|
||||
| 'shouldRunTestSuite';
|
||||
|
||||
export declare abstract class BaseWatchPlugin implements WatchPlugin {
|
||||
protected _stdin: NodeJS.ReadStream;
|
||||
protected _stdout: NodeJS.WriteStream;
|
||||
constructor({
|
||||
stdin,
|
||||
stdout,
|
||||
}: {
|
||||
stdin: NodeJS.ReadStream;
|
||||
stdout: NodeJS.WriteStream;
|
||||
});
|
||||
apply(_hooks: JestHookSubscriber): void;
|
||||
getUsageInfo(_globalConfig: Config.GlobalConfig): UsageData | null;
|
||||
onKey(_key: string): void;
|
||||
run(
|
||||
_globalConfig: Config.GlobalConfig,
|
||||
_updateConfigAndRun: UpdateConfigCallback,
|
||||
): Promise<void | boolean>;
|
||||
}
|
||||
|
||||
declare type FileChange = (fs: JestHookExposedFS) => void;
|
||||
|
||||
export declare class JestHook {
|
||||
private readonly _listeners;
|
||||
private readonly _subscriber;
|
||||
private readonly _emitter;
|
||||
constructor();
|
||||
isUsed(hook: AvailableHooks): boolean;
|
||||
getSubscriber(): Readonly<JestHookSubscriber>;
|
||||
getEmitter(): Readonly<JestHookEmitter>;
|
||||
}
|
||||
|
||||
export declare type JestHookEmitter = {
|
||||
onFileChange: (fs: JestHookExposedFS) => void;
|
||||
onTestRunComplete: (results: AggregatedResult) => void;
|
||||
shouldRunTestSuite: (
|
||||
testSuiteInfo: TestSuiteInfo,
|
||||
) => Promise<boolean> | boolean;
|
||||
};
|
||||
|
||||
declare type JestHookExposedFS = {
|
||||
projects: Array<{
|
||||
config: Config.ProjectConfig;
|
||||
testPaths: Array<string>;
|
||||
}>;
|
||||
};
|
||||
|
||||
export declare type JestHookSubscriber = {
|
||||
onFileChange: (fn: FileChange) => void;
|
||||
onTestRunComplete: (fn: TestRunComplete) => void;
|
||||
shouldRunTestSuite: (fn: ShouldRunTestSuite) => void;
|
||||
};
|
||||
|
||||
export declare const KEYS: {
|
||||
ARROW_DOWN: string;
|
||||
ARROW_LEFT: string;
|
||||
ARROW_RIGHT: string;
|
||||
ARROW_UP: string;
|
||||
BACKSPACE: string;
|
||||
CONTROL_C: string;
|
||||
CONTROL_D: string;
|
||||
CONTROL_U: string;
|
||||
ENTER: string;
|
||||
ESCAPE: string;
|
||||
};
|
||||
|
||||
export declare abstract class PatternPrompt {
|
||||
protected _pipe: NodeJS.WritableStream;
|
||||
protected _prompt: Prompt;
|
||||
protected _entityName: string;
|
||||
protected _currentUsageRows: number;
|
||||
constructor(
|
||||
_pipe: NodeJS.WritableStream,
|
||||
_prompt: Prompt,
|
||||
_entityName?: string,
|
||||
);
|
||||
run(
|
||||
onSuccess: (value: string) => void,
|
||||
onCancel: () => void,
|
||||
options?: {
|
||||
header: string;
|
||||
},
|
||||
): void;
|
||||
protected _onChange(_pattern: string, _options: ScrollOptions_2): void;
|
||||
}
|
||||
|
||||
export declare function printPatternCaret(
|
||||
pattern: string,
|
||||
pipe: NodeJS.WritableStream,
|
||||
): void;
|
||||
|
||||
export declare function printRestoredPatternCaret(
|
||||
pattern: string,
|
||||
currentUsageRows: number,
|
||||
pipe: NodeJS.WritableStream,
|
||||
): void;
|
||||
|
||||
export declare class Prompt {
|
||||
private _entering;
|
||||
private _value;
|
||||
private _onChange;
|
||||
private _onSuccess;
|
||||
private _onCancel;
|
||||
private _offset;
|
||||
private _promptLength;
|
||||
private _selection;
|
||||
constructor();
|
||||
private readonly _onResize;
|
||||
enter(
|
||||
onChange: (pattern: string, options: ScrollOptions_2) => void,
|
||||
onSuccess: (pattern: string) => void,
|
||||
onCancel: () => void,
|
||||
): void;
|
||||
setPromptLength(length: number): void;
|
||||
setPromptSelection(selected: string): void;
|
||||
put(key: string): void;
|
||||
abort(): void;
|
||||
isEntering(): boolean;
|
||||
}
|
||||
|
||||
declare type ScrollOptions_2 = {
|
||||
offset: number;
|
||||
max: number;
|
||||
};
|
||||
export {ScrollOptions_2 as ScrollOptions};
|
||||
|
||||
declare type ShouldRunTestSuite = (
|
||||
testSuiteInfo: TestSuiteInfo,
|
||||
) => Promise<boolean>;
|
||||
|
||||
declare type State = {
|
||||
interrupted: boolean;
|
||||
};
|
||||
|
||||
declare type TestRunComplete = (results: AggregatedResult) => void;
|
||||
|
||||
declare type TestSuiteInfo = {
|
||||
config: Config.ProjectConfig;
|
||||
duration?: number;
|
||||
testPath: string;
|
||||
};
|
||||
|
||||
export declare class TestWatcher extends Emittery<{
|
||||
change: State;
|
||||
}> {
|
||||
state: State;
|
||||
private readonly _isWatchMode;
|
||||
constructor({isWatchMode}: {isWatchMode: boolean});
|
||||
setState(state: State): Promise<void>;
|
||||
isInterrupted(): boolean;
|
||||
isWatchMode(): boolean;
|
||||
}
|
||||
|
||||
export declare type UpdateConfigCallback = (
|
||||
config?: AllowedConfigOptions,
|
||||
) => void;
|
||||
|
||||
export declare type UsageData = {
|
||||
key: string;
|
||||
prompt: string;
|
||||
};
|
||||
|
||||
export declare interface WatchPlugin {
|
||||
isInternal?: boolean;
|
||||
apply?: (hooks: JestHookSubscriber) => void;
|
||||
getUsageInfo?: (globalConfig: Config.GlobalConfig) => UsageData | null;
|
||||
onKey?: (value: string) => void;
|
||||
run?: (
|
||||
globalConfig: Config.GlobalConfig,
|
||||
updateConfigAndRun: UpdateConfigCallback,
|
||||
) => Promise<void | boolean>;
|
||||
}
|
||||
|
||||
export declare interface WatchPluginClass {
|
||||
new (options: {
|
||||
config: Record<string, unknown>;
|
||||
stdin: NodeJS.ReadStream;
|
||||
stdout: NodeJS.WriteStream;
|
||||
}): WatchPlugin;
|
||||
}
|
||||
|
||||
export {};
|
74
node_modules/jest-watcher/build/index.js
generated
vendored
Normal file
74
node_modules/jest-watcher/build/index.js
generated
vendored
Normal file
@ -0,0 +1,74 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
var _exportNames = {
|
||||
BaseWatchPlugin: true,
|
||||
JestHook: true,
|
||||
PatternPrompt: true,
|
||||
TestWatcher: true,
|
||||
Prompt: true
|
||||
};
|
||||
Object.defineProperty(exports, 'BaseWatchPlugin', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _BaseWatchPlugin.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'JestHook', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _JestHooks.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'PatternPrompt', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _PatternPrompt.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'Prompt', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _Prompt.default;
|
||||
}
|
||||
});
|
||||
Object.defineProperty(exports, 'TestWatcher', {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _TestWatcher.default;
|
||||
}
|
||||
});
|
||||
var _BaseWatchPlugin = _interopRequireDefault(require('./BaseWatchPlugin'));
|
||||
var _JestHooks = _interopRequireDefault(require('./JestHooks'));
|
||||
var _PatternPrompt = _interopRequireDefault(require('./PatternPrompt'));
|
||||
var _TestWatcher = _interopRequireDefault(require('./TestWatcher'));
|
||||
var _constants = require('./constants');
|
||||
Object.keys(_constants).forEach(function (key) {
|
||||
if (key === 'default' || key === '__esModule') return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _constants[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _constants[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
var _Prompt = _interopRequireDefault(require('./lib/Prompt'));
|
||||
var _patternModeHelpers = require('./lib/patternModeHelpers');
|
||||
Object.keys(_patternModeHelpers).forEach(function (key) {
|
||||
if (key === 'default' || key === '__esModule') return;
|
||||
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
||||
if (key in exports && exports[key] === _patternModeHelpers[key]) return;
|
||||
Object.defineProperty(exports, key, {
|
||||
enumerable: true,
|
||||
get: function () {
|
||||
return _patternModeHelpers[key];
|
||||
}
|
||||
});
|
||||
});
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {default: obj};
|
||||
}
|
113
node_modules/jest-watcher/build/lib/Prompt.js
generated
vendored
Normal file
113
node_modules/jest-watcher/build/lib/Prompt.js
generated
vendored
Normal file
@ -0,0 +1,113 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _constants = require('../constants');
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
class Prompt {
|
||||
_entering;
|
||||
_value;
|
||||
_onChange;
|
||||
_onSuccess;
|
||||
_onCancel;
|
||||
_offset;
|
||||
_promptLength;
|
||||
_selection;
|
||||
constructor() {
|
||||
// Copied from `enter` to satisfy TS
|
||||
this._entering = true;
|
||||
this._value = '';
|
||||
this._selection = null;
|
||||
this._offset = -1;
|
||||
this._promptLength = 0;
|
||||
|
||||
/* eslint-disable @typescript-eslint/no-empty-function */
|
||||
this._onChange = () => {};
|
||||
this._onSuccess = () => {};
|
||||
this._onCancel = () => {};
|
||||
/* eslint-enable */
|
||||
}
|
||||
|
||||
_onResize = () => {
|
||||
this._onChange();
|
||||
};
|
||||
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;
|
||||
case _constants.KEYS.CONTROL_U:
|
||||
this._value = '';
|
||||
this._offset = -1;
|
||||
this._selection = null;
|
||||
this._onChange();
|
||||
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;
|
30
node_modules/jest-watcher/build/lib/colorize.js
generated
vendored
Normal file
30
node_modules/jest-watcher/build/lib/colorize.js
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = colorize;
|
||||
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) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
function colorize(str, start, end) {
|
||||
return (
|
||||
_chalk().default.dim(str.slice(0, start)) +
|
||||
_chalk().default.reset(str.slice(start, end)) +
|
||||
_chalk().default.dim(str.slice(end))
|
||||
);
|
||||
}
|
67
node_modules/jest-watcher/build/lib/formatTestNameByPattern.js
generated
vendored
Normal file
67
node_modules/jest-watcher/build/lib/formatTestNameByPattern.js
generated
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = formatTestNameByPattern;
|
||||
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) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* 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 = '⏎';
|
||||
function formatTestNameByPattern(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
|
||||
)}`;
|
||||
}
|
54
node_modules/jest-watcher/build/lib/patternModeHelpers.js
generated
vendored
Normal file
54
node_modules/jest-watcher/build/lib/patternModeHelpers.js
generated
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.printPatternCaret = printPatternCaret;
|
||||
exports.printRestoredPatternCaret = printRestoredPatternCaret;
|
||||
function _ansiEscapes() {
|
||||
const data = _interopRequireDefault(require('ansi-escapes'));
|
||||
_ansiEscapes = function () {
|
||||
return data;
|
||||
};
|
||||
return data;
|
||||
}
|
||||
function _chalk() {
|
||||
const data = _interopRequireDefault(require('chalk'));
|
||||
_chalk = 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) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
|
||||
function printPatternCaret(pattern, pipe) {
|
||||
const inputText = `${_chalk().default.dim(' pattern \u203A')} ${pattern}`;
|
||||
pipe.write(_ansiEscapes().default.eraseDown);
|
||||
pipe.write(inputText);
|
||||
pipe.write(_ansiEscapes().default.cursorSavePosition);
|
||||
}
|
||||
function 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);
|
||||
}
|
31
node_modules/jest-watcher/build/lib/scroll.js
generated
vendored
Normal file
31
node_modules/jest-watcher/build/lib/scroll.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', {
|
||||
value: true
|
||||
});
|
||||
exports.default = scroll;
|
||||
/**
|
||||
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||||
*
|
||||
* 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
|
||||
};
|
||||
}
|
1
node_modules/jest-watcher/build/types.js
generated
vendored
Normal file
1
node_modules/jest-watcher/build/types.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
'use strict';
|
248
node_modules/jest-watcher/node_modules/ansi-escapes/index.d.ts
generated
vendored
Normal file
248
node_modules/jest-watcher/node_modules/ansi-escapes/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,248 @@
|
||||
/// <reference types="node"/>
|
||||
import {LiteralUnion} from 'type-fest';
|
||||
|
||||
declare namespace ansiEscapes {
|
||||
interface ImageOptions {
|
||||
/**
|
||||
The width is given as a number followed by a unit, or the word `'auto'`.
|
||||
|
||||
- `N`: N character cells.
|
||||
- `Npx`: N pixels.
|
||||
- `N%`: N percent of the session's width or height.
|
||||
- `auto`: The image's inherent size will be used to determine an appropriate dimension.
|
||||
*/
|
||||
readonly width?: LiteralUnion<'auto', number | string>;
|
||||
|
||||
/**
|
||||
The height is given as a number followed by a unit, or the word `'auto'`.
|
||||
|
||||
- `N`: N character cells.
|
||||
- `Npx`: N pixels.
|
||||
- `N%`: N percent of the session's width or height.
|
||||
- `auto`: The image's inherent size will be used to determine an appropriate dimension.
|
||||
*/
|
||||
readonly height?: LiteralUnion<'auto', number | string>;
|
||||
|
||||
readonly preserveAspectRatio?: boolean;
|
||||
}
|
||||
|
||||
interface AnnotationOptions {
|
||||
/**
|
||||
Nonzero number of columns to annotate.
|
||||
|
||||
Default: The remainder of the line.
|
||||
*/
|
||||
readonly length?: number;
|
||||
|
||||
/**
|
||||
Starting X coordinate.
|
||||
|
||||
Must be used with `y` and `length`.
|
||||
|
||||
Default: The cursor position
|
||||
*/
|
||||
readonly x?: number;
|
||||
|
||||
/**
|
||||
Starting Y coordinate.
|
||||
|
||||
Must be used with `x` and `length`.
|
||||
|
||||
Default: Cursor position.
|
||||
*/
|
||||
readonly y?: number;
|
||||
|
||||
/**
|
||||
Create a "hidden" annotation.
|
||||
|
||||
Annotations created this way can be shown using the "Show Annotations" iTerm command.
|
||||
*/
|
||||
readonly isHidden?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare const ansiEscapes: {
|
||||
/**
|
||||
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
|
||||
*/
|
||||
cursorTo(x: number, y?: number): string;
|
||||
|
||||
/**
|
||||
Set the position of the cursor relative to its current position.
|
||||
*/
|
||||
cursorMove(x: number, y?: number): string;
|
||||
|
||||
/**
|
||||
Move cursor up a specific amount of rows.
|
||||
|
||||
@param count - Count of rows to move up. Default is `1`.
|
||||
*/
|
||||
cursorUp(count?: number): string;
|
||||
|
||||
/**
|
||||
Move cursor down a specific amount of rows.
|
||||
|
||||
@param count - Count of rows to move down. Default is `1`.
|
||||
*/
|
||||
cursorDown(count?: number): string;
|
||||
|
||||
/**
|
||||
Move cursor forward a specific amount of rows.
|
||||
|
||||
@param count - Count of rows to move forward. Default is `1`.
|
||||
*/
|
||||
cursorForward(count?: number): string;
|
||||
|
||||
/**
|
||||
Move cursor backward a specific amount of rows.
|
||||
|
||||
@param count - Count of rows to move backward. Default is `1`.
|
||||
*/
|
||||
cursorBackward(count?: number): string;
|
||||
|
||||
/**
|
||||
Move cursor to the left side.
|
||||
*/
|
||||
cursorLeft: string;
|
||||
|
||||
/**
|
||||
Save cursor position.
|
||||
*/
|
||||
cursorSavePosition: string;
|
||||
|
||||
/**
|
||||
Restore saved cursor position.
|
||||
*/
|
||||
cursorRestorePosition: string;
|
||||
|
||||
/**
|
||||
Get cursor position.
|
||||
*/
|
||||
cursorGetPosition: string;
|
||||
|
||||
/**
|
||||
Move cursor to the next line.
|
||||
*/
|
||||
cursorNextLine: string;
|
||||
|
||||
/**
|
||||
Move cursor to the previous line.
|
||||
*/
|
||||
cursorPrevLine: string;
|
||||
|
||||
/**
|
||||
Hide cursor.
|
||||
*/
|
||||
cursorHide: string;
|
||||
|
||||
/**
|
||||
Show cursor.
|
||||
*/
|
||||
cursorShow: string;
|
||||
|
||||
/**
|
||||
Erase from the current cursor position up the specified amount of rows.
|
||||
|
||||
@param count - Count of rows to erase.
|
||||
*/
|
||||
eraseLines(count: number): string;
|
||||
|
||||
/**
|
||||
Erase from the current cursor position to the end of the current line.
|
||||
*/
|
||||
eraseEndLine: string;
|
||||
|
||||
/**
|
||||
Erase from the current cursor position to the start of the current line.
|
||||
*/
|
||||
eraseStartLine: string;
|
||||
|
||||
/**
|
||||
Erase the entire current line.
|
||||
*/
|
||||
eraseLine: string;
|
||||
|
||||
/**
|
||||
Erase the screen from the current line down to the bottom of the screen.
|
||||
*/
|
||||
eraseDown: string;
|
||||
|
||||
/**
|
||||
Erase the screen from the current line up to the top of the screen.
|
||||
*/
|
||||
eraseUp: string;
|
||||
|
||||
/**
|
||||
Erase the screen and move the cursor the top left position.
|
||||
*/
|
||||
eraseScreen: string;
|
||||
|
||||
/**
|
||||
Scroll display up one line.
|
||||
*/
|
||||
scrollUp: string;
|
||||
|
||||
/**
|
||||
Scroll display down one line.
|
||||
*/
|
||||
scrollDown: string;
|
||||
|
||||
/**
|
||||
Clear the terminal screen. (Viewport)
|
||||
*/
|
||||
clearScreen: string;
|
||||
|
||||
/**
|
||||
Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
|
||||
*/
|
||||
clearTerminal: string;
|
||||
|
||||
/**
|
||||
Output a beeping sound.
|
||||
*/
|
||||
beep: string;
|
||||
|
||||
/**
|
||||
Create a clickable link.
|
||||
|
||||
[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support.
|
||||
*/
|
||||
link(text: string, url: string): string;
|
||||
|
||||
/**
|
||||
Display an image.
|
||||
|
||||
_Currently only supported on iTerm2 >=3_
|
||||
|
||||
See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
|
||||
|
||||
@param buffer - Buffer of an image. Usually read in with `fs.readFile()`.
|
||||
*/
|
||||
image(buffer: Buffer, options?: ansiEscapes.ImageOptions): string;
|
||||
|
||||
iTerm: {
|
||||
/**
|
||||
[Inform iTerm2](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).
|
||||
|
||||
@param cwd - Current directory. Default: `process.cwd()`.
|
||||
*/
|
||||
setCwd(cwd?: string): string;
|
||||
|
||||
/**
|
||||
An annotation looks like this when shown:
|
||||
|
||||

|
||||
|
||||
See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information.
|
||||
|
||||
@param message - The message to display within the annotation. The `|` character is disallowed and will be stripped.
|
||||
@returns An escape code which will create an annotation when printed in iTerm2.
|
||||
*/
|
||||
annotation(message: string, options?: ansiEscapes.AnnotationOptions): string;
|
||||
};
|
||||
|
||||
// TODO: remove this in the next major version
|
||||
default: typeof ansiEscapes;
|
||||
};
|
||||
|
||||
export = ansiEscapes;
|
157
node_modules/jest-watcher/node_modules/ansi-escapes/index.js
generated
vendored
Normal file
157
node_modules/jest-watcher/node_modules/ansi-escapes/index.js
generated
vendored
Normal file
@ -0,0 +1,157 @@
|
||||
'use strict';
|
||||
const ansiEscapes = module.exports;
|
||||
// TODO: remove this in the next major version
|
||||
module.exports.default = ansiEscapes;
|
||||
|
||||
const ESC = '\u001B[';
|
||||
const OSC = '\u001B]';
|
||||
const BEL = '\u0007';
|
||||
const SEP = ';';
|
||||
const isTerminalApp = process.env.TERM_PROGRAM === 'Apple_Terminal';
|
||||
|
||||
ansiEscapes.cursorTo = (x, y) => {
|
||||
if (typeof x !== 'number') {
|
||||
throw new TypeError('The `x` argument is required');
|
||||
}
|
||||
|
||||
if (typeof y !== 'number') {
|
||||
return ESC + (x + 1) + 'G';
|
||||
}
|
||||
|
||||
return ESC + (y + 1) + ';' + (x + 1) + 'H';
|
||||
};
|
||||
|
||||
ansiEscapes.cursorMove = (x, y) => {
|
||||
if (typeof x !== 'number') {
|
||||
throw new TypeError('The `x` argument is required');
|
||||
}
|
||||
|
||||
let ret = '';
|
||||
|
||||
if (x < 0) {
|
||||
ret += ESC + (-x) + 'D';
|
||||
} else if (x > 0) {
|
||||
ret += ESC + x + 'C';
|
||||
}
|
||||
|
||||
if (y < 0) {
|
||||
ret += ESC + (-y) + 'A';
|
||||
} else if (y > 0) {
|
||||
ret += ESC + y + 'B';
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
|
||||
ansiEscapes.cursorUp = (count = 1) => ESC + count + 'A';
|
||||
ansiEscapes.cursorDown = (count = 1) => ESC + count + 'B';
|
||||
ansiEscapes.cursorForward = (count = 1) => ESC + count + 'C';
|
||||
ansiEscapes.cursorBackward = (count = 1) => ESC + count + 'D';
|
||||
|
||||
ansiEscapes.cursorLeft = ESC + 'G';
|
||||
ansiEscapes.cursorSavePosition = isTerminalApp ? '\u001B7' : ESC + 's';
|
||||
ansiEscapes.cursorRestorePosition = isTerminalApp ? '\u001B8' : ESC + 'u';
|
||||
ansiEscapes.cursorGetPosition = ESC + '6n';
|
||||
ansiEscapes.cursorNextLine = ESC + 'E';
|
||||
ansiEscapes.cursorPrevLine = ESC + 'F';
|
||||
ansiEscapes.cursorHide = ESC + '?25l';
|
||||
ansiEscapes.cursorShow = ESC + '?25h';
|
||||
|
||||
ansiEscapes.eraseLines = count => {
|
||||
let clear = '';
|
||||
|
||||
for (let i = 0; i < count; i++) {
|
||||
clear += ansiEscapes.eraseLine + (i < count - 1 ? ansiEscapes.cursorUp() : '');
|
||||
}
|
||||
|
||||
if (count) {
|
||||
clear += ansiEscapes.cursorLeft;
|
||||
}
|
||||
|
||||
return clear;
|
||||
};
|
||||
|
||||
ansiEscapes.eraseEndLine = ESC + 'K';
|
||||
ansiEscapes.eraseStartLine = ESC + '1K';
|
||||
ansiEscapes.eraseLine = ESC + '2K';
|
||||
ansiEscapes.eraseDown = ESC + 'J';
|
||||
ansiEscapes.eraseUp = ESC + '1J';
|
||||
ansiEscapes.eraseScreen = ESC + '2J';
|
||||
ansiEscapes.scrollUp = ESC + 'S';
|
||||
ansiEscapes.scrollDown = ESC + 'T';
|
||||
|
||||
ansiEscapes.clearScreen = '\u001Bc';
|
||||
|
||||
ansiEscapes.clearTerminal = process.platform === 'win32' ?
|
||||
`${ansiEscapes.eraseScreen}${ESC}0f` :
|
||||
// 1. Erases the screen (Only done in case `2` is not supported)
|
||||
// 2. Erases the whole screen including scrollback buffer
|
||||
// 3. Moves cursor to the top-left position
|
||||
// More info: https://www.real-world-systems.com/docs/ANSIcode.html
|
||||
`${ansiEscapes.eraseScreen}${ESC}3J${ESC}H`;
|
||||
|
||||
ansiEscapes.beep = BEL;
|
||||
|
||||
ansiEscapes.link = (text, url) => {
|
||||
return [
|
||||
OSC,
|
||||
'8',
|
||||
SEP,
|
||||
SEP,
|
||||
url,
|
||||
BEL,
|
||||
text,
|
||||
OSC,
|
||||
'8',
|
||||
SEP,
|
||||
SEP,
|
||||
BEL
|
||||
].join('');
|
||||
};
|
||||
|
||||
ansiEscapes.image = (buffer, options = {}) => {
|
||||
let ret = `${OSC}1337;File=inline=1`;
|
||||
|
||||
if (options.width) {
|
||||
ret += `;width=${options.width}`;
|
||||
}
|
||||
|
||||
if (options.height) {
|
||||
ret += `;height=${options.height}`;
|
||||
}
|
||||
|
||||
if (options.preserveAspectRatio === false) {
|
||||
ret += ';preserveAspectRatio=0';
|
||||
}
|
||||
|
||||
return ret + ':' + buffer.toString('base64') + BEL;
|
||||
};
|
||||
|
||||
ansiEscapes.iTerm = {
|
||||
setCwd: (cwd = process.cwd()) => `${OSC}50;CurrentDir=${cwd}${BEL}`,
|
||||
|
||||
annotation: (message, options = {}) => {
|
||||
let ret = `${OSC}1337;`;
|
||||
|
||||
const hasX = typeof options.x !== 'undefined';
|
||||
const hasY = typeof options.y !== 'undefined';
|
||||
if ((hasX || hasY) && !(hasX && hasY && typeof options.length !== 'undefined')) {
|
||||
throw new Error('`x`, `y` and `length` must be defined when `x` or `y` is defined');
|
||||
}
|
||||
|
||||
message = message.replace(/\|/g, '');
|
||||
|
||||
ret += options.isHidden ? 'AddHiddenAnnotation=' : 'AddAnnotation=';
|
||||
|
||||
if (options.length > 0) {
|
||||
ret +=
|
||||
(hasX ?
|
||||
[message, options.length, options.x, options.y] :
|
||||
[options.length, message]).join('|');
|
||||
} else {
|
||||
ret += message;
|
||||
}
|
||||
|
||||
return ret + BEL;
|
||||
}
|
||||
};
|
9
node_modules/jest-watcher/node_modules/ansi-escapes/license
generated
vendored
Normal file
9
node_modules/jest-watcher/node_modules/ansi-escapes/license
generated
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
57
node_modules/jest-watcher/node_modules/ansi-escapes/package.json
generated
vendored
Normal file
57
node_modules/jest-watcher/node_modules/ansi-escapes/package.json
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "ansi-escapes",
|
||||
"version": "4.3.2",
|
||||
"description": "ANSI escape codes for manipulating the terminal",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/ansi-escapes",
|
||||
"funding": "https://github.com/sponsors/sindresorhus",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "https://sindresorhus.com"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"keywords": [
|
||||
"ansi",
|
||||
"terminal",
|
||||
"console",
|
||||
"cli",
|
||||
"string",
|
||||
"tty",
|
||||
"escape",
|
||||
"escapes",
|
||||
"formatting",
|
||||
"shell",
|
||||
"xterm",
|
||||
"log",
|
||||
"logging",
|
||||
"command-line",
|
||||
"text",
|
||||
"vt100",
|
||||
"sequence",
|
||||
"control",
|
||||
"code",
|
||||
"codes",
|
||||
"cursor",
|
||||
"iterm",
|
||||
"iterm2"
|
||||
],
|
||||
"dependencies": {
|
||||
"type-fest": "^0.21.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^13.7.7",
|
||||
"ava": "^2.1.0",
|
||||
"tsd": "^0.14.0",
|
||||
"xo": "^0.25.3"
|
||||
}
|
||||
}
|
245
node_modules/jest-watcher/node_modules/ansi-escapes/readme.md
generated
vendored
Normal file
245
node_modules/jest-watcher/node_modules/ansi-escapes/readme.md
generated
vendored
Normal file
@ -0,0 +1,245 @@
|
||||
# ansi-escapes
|
||||
|
||||
> [ANSI escape codes](http://www.termsys.demon.co.uk/vtansi.htm) for manipulating the terminal
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install ansi-escapes
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const ansiEscapes = require('ansi-escapes');
|
||||
|
||||
// Moves the cursor two rows up and to the left
|
||||
process.stdout.write(ansiEscapes.cursorUp(2) + ansiEscapes.cursorLeft);
|
||||
//=> '\u001B[2A\u001B[1000D'
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
### cursorTo(x, y?)
|
||||
|
||||
Set the absolute position of the cursor. `x0` `y0` is the top left of the screen.
|
||||
|
||||
### cursorMove(x, y?)
|
||||
|
||||
Set the position of the cursor relative to its current position.
|
||||
|
||||
### cursorUp(count)
|
||||
|
||||
Move cursor up a specific amount of rows. Default is `1`.
|
||||
|
||||
### cursorDown(count)
|
||||
|
||||
Move cursor down a specific amount of rows. Default is `1`.
|
||||
|
||||
### cursorForward(count)
|
||||
|
||||
Move cursor forward a specific amount of columns. Default is `1`.
|
||||
|
||||
### cursorBackward(count)
|
||||
|
||||
Move cursor backward a specific amount of columns. Default is `1`.
|
||||
|
||||
### cursorLeft
|
||||
|
||||
Move cursor to the left side.
|
||||
|
||||
### cursorSavePosition
|
||||
|
||||
Save cursor position.
|
||||
|
||||
### cursorRestorePosition
|
||||
|
||||
Restore saved cursor position.
|
||||
|
||||
### cursorGetPosition
|
||||
|
||||
Get cursor position.
|
||||
|
||||
### cursorNextLine
|
||||
|
||||
Move cursor to the next line.
|
||||
|
||||
### cursorPrevLine
|
||||
|
||||
Move cursor to the previous line.
|
||||
|
||||
### cursorHide
|
||||
|
||||
Hide cursor.
|
||||
|
||||
### cursorShow
|
||||
|
||||
Show cursor.
|
||||
|
||||
### eraseLines(count)
|
||||
|
||||
Erase from the current cursor position up the specified amount of rows.
|
||||
|
||||
### eraseEndLine
|
||||
|
||||
Erase from the current cursor position to the end of the current line.
|
||||
|
||||
### eraseStartLine
|
||||
|
||||
Erase from the current cursor position to the start of the current line.
|
||||
|
||||
### eraseLine
|
||||
|
||||
Erase the entire current line.
|
||||
|
||||
### eraseDown
|
||||
|
||||
Erase the screen from the current line down to the bottom of the screen.
|
||||
|
||||
### eraseUp
|
||||
|
||||
Erase the screen from the current line up to the top of the screen.
|
||||
|
||||
### eraseScreen
|
||||
|
||||
Erase the screen and move the cursor the top left position.
|
||||
|
||||
### scrollUp
|
||||
|
||||
Scroll display up one line.
|
||||
|
||||
### scrollDown
|
||||
|
||||
Scroll display down one line.
|
||||
|
||||
### clearScreen
|
||||
|
||||
Clear the terminal screen. (Viewport)
|
||||
|
||||
### clearTerminal
|
||||
|
||||
Clear the whole terminal, including scrollback buffer. (Not just the visible part of it)
|
||||
|
||||
### beep
|
||||
|
||||
Output a beeping sound.
|
||||
|
||||
### link(text, url)
|
||||
|
||||
Create a clickable link.
|
||||
|
||||
[Supported terminals.](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda) Use [`supports-hyperlinks`](https://github.com/jamestalmage/supports-hyperlinks) to detect link support.
|
||||
|
||||
### image(filePath, options?)
|
||||
|
||||
Display an image.
|
||||
|
||||
*Currently only supported on iTerm2 >=3*
|
||||
|
||||
See [term-img](https://github.com/sindresorhus/term-img) for a higher-level module.
|
||||
|
||||
#### input
|
||||
|
||||
Type: `Buffer`
|
||||
|
||||
Buffer of an image. Usually read in with `fs.readFile()`.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### width
|
||||
##### height
|
||||
|
||||
Type: `string | number`
|
||||
|
||||
The width and height are given as a number followed by a unit, or the word "auto".
|
||||
|
||||
- `N`: N character cells.
|
||||
- `Npx`: N pixels.
|
||||
- `N%`: N percent of the session's width or height.
|
||||
- `auto`: The image's inherent size will be used to determine an appropriate dimension.
|
||||
|
||||
##### preserveAspectRatio
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
### iTerm.setCwd(path?)
|
||||
|
||||
Type: `string`\
|
||||
Default: `process.cwd()`
|
||||
|
||||
[Inform iTerm2](https://www.iterm2.com/documentation-escape-codes.html) of the current directory to help semantic history and enable [Cmd-clicking relative paths](https://coderwall.com/p/b7e82q/quickly-open-files-in-iterm-with-cmd-click).
|
||||
|
||||
### iTerm.annotation(message, options?)
|
||||
|
||||
Creates an escape code to display an "annotation" in iTerm2.
|
||||
|
||||
An annotation looks like this when shown:
|
||||
|
||||
<img src="https://user-images.githubusercontent.com/924465/64382136-b60ac700-cfe9-11e9-8a35-9682e8dc4b72.png" width="500">
|
||||
|
||||
See the [iTerm Proprietary Escape Codes documentation](https://iterm2.com/documentation-escape-codes.html) for more information.
|
||||
|
||||
#### message
|
||||
|
||||
Type: `string`
|
||||
|
||||
The message to display within the annotation.
|
||||
|
||||
The `|` character is disallowed and will be stripped.
|
||||
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### length
|
||||
|
||||
Type: `number`\
|
||||
Default: The remainder of the line
|
||||
|
||||
Nonzero number of columns to annotate.
|
||||
|
||||
##### x
|
||||
|
||||
Type: `number`\
|
||||
Default: Cursor position
|
||||
|
||||
Starting X coordinate.
|
||||
|
||||
Must be used with `y` and `length`.
|
||||
|
||||
##### y
|
||||
|
||||
Type: `number`\
|
||||
Default: Cursor position
|
||||
|
||||
Starting Y coordinate.
|
||||
|
||||
Must be used with `x` and `length`.
|
||||
|
||||
##### isHidden
|
||||
|
||||
Type: `boolean`\
|
||||
Default: `false`
|
||||
|
||||
Create a "hidden" annotation.
|
||||
|
||||
Annotations created this way can be shown using the "Show Annotations" iTerm command.
|
||||
|
||||
## Related
|
||||
|
||||
- [ansi-styles](https://github.com/chalk/ansi-styles) - ANSI escape codes for styling strings in the terminal
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<b>
|
||||
<a href="https://tidelift.com/subscription/pkg/npm-ansi-escapes?utm_source=npm-ansi-escapes&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
|
||||
</b>
|
||||
<br>
|
||||
<sub>
|
||||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
|
||||
</sub>
|
||||
</div>
|
41
node_modules/jest-watcher/package.json
generated
vendored
Normal file
41
node_modules/jest-watcher/package.json
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "jest-watcher",
|
||||
"description": "Delightful JavaScript Testing.",
|
||||
"version": "29.7.0",
|
||||
"main": "./build/index.js",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./build/index.d.ts",
|
||||
"default": "./build/index.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/test-result": "^29.7.0",
|
||||
"@jest/types": "^29.6.3",
|
||||
"@types/node": "*",
|
||||
"ansi-escapes": "^4.2.1",
|
||||
"chalk": "^4.0.0",
|
||||
"emittery": "^0.13.1",
|
||||
"jest-util": "^29.7.0",
|
||||
"string-length": "^4.0.1"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/jestjs/jest.git",
|
||||
"directory": "packages/jest-watcher"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/jestjs/jest/issues"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^14.15.0 || ^16.10.0 || >=18.0.0"
|
||||
},
|
||||
"homepage": "https://jestjs.io/",
|
||||
"license": "MIT",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"gitHead": "4e56991693da7cd4c3730dc3579a1dd1403ee630"
|
||||
}
|
Reference in New Issue
Block a user