Initial commit: Developer Tools MVP with visual editor

- Complete React app with 7 developer tools
- JSON Tool with visual structured editor
- Serialize Tool with visual structured editor
- URL, Base64, CSV/JSON, Beautifier, Diff tools
- Responsive navigation with dropdown menu
- Dark/light mode toggle
- Mobile-responsive design with sticky header
- All tools working with copy/paste functionality
This commit is contained in:
dwindown
2025-08-02 09:31:26 +07:00
commit 7f2dd5260f
45657 changed files with 4730486 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
/**
* 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 { Config } from '@jest/types';
import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback, UsageData } from 'jest-watcher';
export default class FailedTestsInteractivePlugin extends BaseWatchPlugin {
private _failedTestAssertions?;
private readonly _manager;
apply(hooks: JestHookSubscriber): void;
getUsageInfo(): UsageData | null;
onKey(key: string): void;
run(_: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<void>;
private getFailedTestAssertions;
}

View File

@@ -0,0 +1,135 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function () {
return data;
};
return data;
}
var _FailedTestsInteractiveMode = _interopRequireDefault(
require('../FailedTestsInteractiveMode')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
class FailedTestsInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
constructor(...args) {
super(...args);
_defineProperty(this, '_failedTestAssertions', void 0);
_defineProperty(
this,
'_manager',
new _FailedTestsInteractiveMode.default(this._stdout)
);
}
apply(hooks) {
hooks.onTestRunComplete(results => {
this._failedTestAssertions = this.getFailedTestAssertions(results);
if (this._manager.isActive()) this._manager.updateWithResults(results);
});
}
getUsageInfo() {
var _this$_failedTestAsse;
if (
(_this$_failedTestAsse = this._failedTestAssertions) !== null &&
_this$_failedTestAsse !== void 0 &&
_this$_failedTestAsse.length
) {
return {
key: 'i',
prompt: 'run failing tests interactively'
};
}
return null;
}
onKey(key) {
if (this._manager.isActive()) {
this._manager.put(key);
}
}
run(_, updateConfigAndRun) {
return new Promise(resolve => {
if (
!this._failedTestAssertions ||
this._failedTestAssertions.length === 0
) {
resolve();
return;
}
this._manager.run(this._failedTestAssertions, failure => {
updateConfigAndRun({
mode: 'watch',
testNamePattern: failure ? `^${failure.fullName}$` : '',
testPathPattern:
(failure === null || failure === void 0 ? void 0 : failure.path) ||
''
});
if (!this._manager.isActive()) {
resolve();
}
});
});
}
getFailedTestAssertions(results) {
const failedTestPaths = [];
if (
// skip if no failed tests
results.numFailedTests === 0 || // skip if missing test results
!results.testResults || // skip if unmatched snapshots are present
results.snapshot.unmatched
) {
return failedTestPaths;
}
results.testResults.forEach(testResult => {
testResult.testResults.forEach(result => {
if (result.status === 'failed') {
failedTestPaths.push({
fullName: result.fullName,
path: testResult.testFilePath
});
}
});
});
return failedTestPaths;
}
}
exports.default = FailedTestsInteractivePlugin;

18
node_modules/@jest/core/build/plugins/Quit.d.ts generated vendored Normal file
View File

@@ -0,0 +1,18 @@
/**
* 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 { BaseWatchPlugin, UsageData } from 'jest-watcher';
declare class QuitPlugin extends BaseWatchPlugin {
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
run(): Promise<void>;
getUsageInfo(): UsageData;
}
export default QuitPlugin;

60
node_modules/@jest/core/build/plugins/Quit.js generated vendored Normal file
View File

@@ -0,0 +1,60 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = 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 QuitPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, 'isInternal', void 0);
this.isInternal = true;
}
async run() {
if (typeof this._stdin.setRawMode === 'function') {
this._stdin.setRawMode(false);
}
this._stdout.write('\n');
process.exit(0);
}
getUsageInfo() {
return {
key: 'q',
prompt: 'quit watch mode'
};
}
}
var _default = QuitPlugin;
exports.default = _default;

View File

@@ -0,0 +1,21 @@
/**
* 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 type { Config } from '@jest/types';
import { BaseWatchPlugin, Prompt, UpdateConfigCallback, UsageData } from 'jest-watcher';
declare class TestNamePatternPlugin extends BaseWatchPlugin {
_prompt: Prompt;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
getUsageInfo(): UsageData;
onKey(key: string): void;
run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<void>;
}
export default TestNamePatternPlugin;

View File

@@ -0,0 +1,91 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function () {
return data;
};
return data;
}
var _TestNamePatternPrompt = _interopRequireDefault(
require('../TestNamePatternPrompt')
);
var _activeFiltersMessage = _interopRequireDefault(
require('../lib/activeFiltersMessage')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
class TestNamePatternPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_prompt', void 0);
_defineProperty(this, 'isInternal', void 0);
this._prompt = new (_jestWatcher().Prompt)();
this.isInternal = true;
}
getUsageInfo() {
return {
key: 't',
prompt: 'filter by a test name regex pattern'
};
}
onKey(key) {
this._prompt.put(key);
}
run(globalConfig, updateConfigAndRun) {
return new Promise((res, rej) => {
const testNamePatternPrompt = new _TestNamePatternPrompt.default(
this._stdout,
this._prompt
);
testNamePatternPrompt.run(
value => {
updateConfigAndRun({
mode: 'watch',
testNamePattern: value
});
res();
},
rej,
{
header: (0, _activeFiltersMessage.default)(globalConfig)
}
);
});
}
}
var _default = TestNamePatternPlugin;
exports.default = _default;

View File

@@ -0,0 +1,21 @@
/**
* 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 type { Config } from '@jest/types';
import { BaseWatchPlugin, UpdateConfigCallback, UsageData } from 'jest-watcher';
declare class TestPathPatternPlugin extends BaseWatchPlugin {
private _prompt;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
getUsageInfo(): UsageData;
onKey(key: string): void;
run(globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<void>;
}
export default TestPathPatternPlugin;

View File

@@ -0,0 +1,91 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function () {
return data;
};
return data;
}
var _TestPathPatternPrompt = _interopRequireDefault(
require('../TestPathPatternPrompt')
);
var _activeFiltersMessage = _interopRequireDefault(
require('../lib/activeFiltersMessage')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
class TestPathPatternPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_prompt', void 0);
_defineProperty(this, 'isInternal', void 0);
this._prompt = new (_jestWatcher().Prompt)();
this.isInternal = true;
}
getUsageInfo() {
return {
key: 'p',
prompt: 'filter by a filename regex pattern'
};
}
onKey(key) {
this._prompt.put(key);
}
run(globalConfig, updateConfigAndRun) {
return new Promise((res, rej) => {
const testPathPatternPrompt = new _TestPathPatternPrompt.default(
this._stdout,
this._prompt
);
testPathPatternPrompt.run(
value => {
updateConfigAndRun({
mode: 'watch',
testPathPattern: value
});
res();
},
rej,
{
header: (0, _activeFiltersMessage.default)(globalConfig)
}
);
});
}
}
var _default = TestPathPatternPlugin;
exports.default = _default;

View File

@@ -0,0 +1,21 @@
/**
* 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 type { Config } from '@jest/types';
import { BaseWatchPlugin, JestHookSubscriber, UpdateConfigCallback, UsageData } from 'jest-watcher';
declare class UpdateSnapshotsPlugin extends BaseWatchPlugin {
private _hasSnapshotFailure;
isInternal: true;
constructor(options: {
stdin: NodeJS.ReadStream;
stdout: NodeJS.WriteStream;
});
run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: UpdateConfigCallback): Promise<boolean>;
apply(hooks: JestHookSubscriber): void;
getUsageInfo(): UsageData | null;
}
export default UpdateSnapshotsPlugin;

View File

@@ -0,0 +1,70 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = 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 UpdateSnapshotsPlugin extends _jestWatcher().BaseWatchPlugin {
constructor(options) {
super(options);
_defineProperty(this, '_hasSnapshotFailure', void 0);
_defineProperty(this, 'isInternal', void 0);
this.isInternal = true;
this._hasSnapshotFailure = false;
}
run(_globalConfig, updateConfigAndRun) {
updateConfigAndRun({
updateSnapshot: 'all'
});
return Promise.resolve(false);
}
apply(hooks) {
hooks.onTestRunComplete(results => {
this._hasSnapshotFailure = results.snapshot.failure;
});
}
getUsageInfo() {
if (this._hasSnapshotFailure) {
return {
key: 'u',
prompt: 'update failing snapshots'
};
}
return null;
}
}
var _default = UpdateSnapshotsPlugin;
exports.default = _default;

View File

@@ -0,0 +1,20 @@
/**
* 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 { AggregatedResult, AssertionLocation } from '@jest/test-result';
import type { Config } from '@jest/types';
import { BaseWatchPlugin, JestHookSubscriber, UsageData } from 'jest-watcher';
declare class UpdateSnapshotInteractivePlugin extends BaseWatchPlugin {
private _snapshotInteractiveMode;
private _failedSnapshotTestAssertions;
isInternal: true;
getFailedSnapshotTestAssertions(testResults: AggregatedResult): Array<AssertionLocation>;
apply(hooks: JestHookSubscriber): void;
onKey(key: string): void;
run(_globalConfig: Config.GlobalConfig, updateConfigAndRun: Function): Promise<void>;
getUsageInfo(): UsageData | null;
}
export default UpdateSnapshotInteractivePlugin;

View File

@@ -0,0 +1,138 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true
});
exports.default = void 0;
function _jestWatcher() {
const data = require('jest-watcher');
_jestWatcher = function () {
return data;
};
return data;
}
var _SnapshotInteractiveMode = _interopRequireDefault(
require('../SnapshotInteractiveMode')
);
function _interopRequireDefault(obj) {
return obj && obj.__esModule ? obj : {default: obj};
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
class UpdateSnapshotInteractivePlugin extends _jestWatcher().BaseWatchPlugin {
constructor(...args) {
super(...args);
_defineProperty(
this,
'_snapshotInteractiveMode',
new _SnapshotInteractiveMode.default(this._stdout)
);
_defineProperty(this, '_failedSnapshotTestAssertions', []);
_defineProperty(this, 'isInternal', true);
}
getFailedSnapshotTestAssertions(testResults) {
const failedTestPaths = [];
if (testResults.numFailedTests === 0 || !testResults.testResults) {
return failedTestPaths;
}
testResults.testResults.forEach(testResult => {
if (testResult.snapshot && testResult.snapshot.unmatched) {
testResult.testResults.forEach(result => {
if (result.status === 'failed') {
failedTestPaths.push({
fullName: result.fullName,
path: testResult.testFilePath
});
}
});
}
});
return failedTestPaths;
}
apply(hooks) {
hooks.onTestRunComplete(results => {
this._failedSnapshotTestAssertions =
this.getFailedSnapshotTestAssertions(results);
if (this._snapshotInteractiveMode.isActive()) {
this._snapshotInteractiveMode.updateWithResults(results);
}
});
}
onKey(key) {
if (this._snapshotInteractiveMode.isActive()) {
this._snapshotInteractiveMode.put(key);
}
}
run(_globalConfig, updateConfigAndRun) {
if (this._failedSnapshotTestAssertions.length) {
return new Promise(res => {
this._snapshotInteractiveMode.run(
this._failedSnapshotTestAssertions,
(assertion, shouldUpdateSnapshot) => {
updateConfigAndRun({
mode: 'watch',
testNamePattern: assertion ? `^${assertion.fullName}$` : '',
testPathPattern: assertion ? assertion.path : '',
updateSnapshot: shouldUpdateSnapshot ? 'all' : 'none'
});
if (!this._snapshotInteractiveMode.isActive()) {
res();
}
}
);
});
} else {
return Promise.resolve();
}
}
getUsageInfo() {
var _this$_failedSnapshot;
if (
((_this$_failedSnapshot = this._failedSnapshotTestAssertions) === null ||
_this$_failedSnapshot === void 0
? void 0
: _this$_failedSnapshot.length) > 0
) {
return {
key: 'i',
prompt: 'update failing snapshots interactively'
};
}
return null;
}
}
var _default = UpdateSnapshotInteractivePlugin;
exports.default = _default;