Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@betterer/reporter

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betterer/reporter - npm Package Compare versions

Comparing version 5.3.3 to 5.3.4

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [5.3.4](https://github.com/phenomnomnominal/betterer/compare/v5.3.3...v5.3.4) (2022-05-12)
**Note:** Version bump only for package @betterer/reporter
## [5.3.3](https://github.com/phenomnomnominal/betterer/compare/v5.3.2...v5.3.3) (2022-05-11)

@@ -8,0 +16,0 @@

3

dist/components/config/Config.d.ts

@@ -0,3 +1,4 @@

/// <reference types="react" />
import { BettererContext } from '@betterer/betterer';
import { FC } from 'react';
import { FC } from '@betterer/render';
export declare type ConfigEditField = 'filters' | 'ignores' | null;

@@ -4,0 +5,0 @@ export interface ConfigProps {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Config = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const EditConfig_1 = require("./EditConfig");
const Config = function Config({ context, editField }) {
const [filters, setFilters] = (0, react_1.useState)(serialiseFilters(context.config));
const [ignores, setIgnores] = (0, react_1.useState)(serialiseIgnores(context.config));
const [filters, setFilters] = (0, render_1.useState)(serialiseFilters(context.config));
const [ignores, setIgnores] = (0, render_1.useState)(serialiseIgnores(context.config));
function updateFilters(newFilters) {

@@ -37,16 +35,16 @@ setFilters(newFilters);

}
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column", marginBottom: 1 },
editField == null && (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, null,
react_1.default.createElement(ink_1.Text, { color: "yellowBright" }, "Filters"),
react_1.default.createElement(ink_1.Text, null, " (press \"f\" to edit)"),
react_1.default.createElement(ink_1.Text, { color: "yellowBright" }, ": "),
filters.length ? react_1.default.createElement(ink_1.Text, null, filters) : react_1.default.createElement(ink_1.Text, { color: "gray" }, "No current filter patterns")),
react_1.default.createElement(ink_1.Box, null,
react_1.default.createElement(ink_1.Text, { color: "yellowBright" }, "Ignores"),
react_1.default.createElement(ink_1.Text, null, " (press \"i\" to edit)"),
react_1.default.createElement(ink_1.Text, { color: "yellowBright" }, ": "),
ignores.length ? react_1.default.createElement(ink_1.Text, null, ignores) : react_1.default.createElement(ink_1.Text, { color: "gray" }, "No current ignore patterns")))),
editField == 'filters' && (react_1.default.createElement(EditConfig_1.EditConfig, { name: "Filters", value: filters, onChange: updateFilters, onSubmit: submitFilters }, "Use RegExp patterns e.g. /my test/. Use \",\" to separate multiple filters.")),
editField == 'ignores' && (react_1.default.createElement(EditConfig_1.EditConfig, { name: "Ignores", value: ignores, onChange: updateIgnores, onSubmit: submitIgnores }, "Use glob patterns starting from CWD e.g. **/*.ts. Use \",\" to separate multiple ignores."))));
return (render_1.React.createElement(render_1.Box, { flexDirection: "column", marginBottom: 1 },
editField == null && (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, null,
render_1.React.createElement(render_1.Text, { color: "yellowBright" }, "Filters"),
render_1.React.createElement(render_1.Text, null, " (press \"f\" to edit)"),
render_1.React.createElement(render_1.Text, { color: "yellowBright" }, ": "),
filters.length ? render_1.React.createElement(render_1.Text, null, filters) : render_1.React.createElement(render_1.Text, { color: "gray" }, "No current filter patterns")),
render_1.React.createElement(render_1.Box, null,
render_1.React.createElement(render_1.Text, { color: "yellowBright" }, "Ignores"),
render_1.React.createElement(render_1.Text, null, " (press \"i\" to edit)"),
render_1.React.createElement(render_1.Text, { color: "yellowBright" }, ": "),
ignores.length ? render_1.React.createElement(render_1.Text, null, ignores) : render_1.React.createElement(render_1.Text, { color: "gray" }, "No current ignore patterns")))),
editField == 'filters' && (render_1.React.createElement(EditConfig_1.EditConfig, { name: "Filters", value: filters, onChange: updateFilters, onSubmit: submitFilters }, "Use RegExp patterns e.g. /my test/. Use \",\" to separate multiple filters.")),
editField == 'ignores' && (render_1.React.createElement(EditConfig_1.EditConfig, { name: "Ignores", value: ignores, onChange: updateIgnores, onSubmit: submitIgnores }, "Use glob patterns starting from CWD e.g. **/*.ts. Use \",\" to separate multiple ignores."))));
};

@@ -53,0 +51,0 @@ exports.Config = Config;

@@ -1,2 +0,3 @@

import { PropsWithChildren } from 'react';
/// <reference types="react" />
import { PropsWithChildren } from '@betterer/render';
export interface EditConfigProps<ValidatedConfigType> {

@@ -3,0 +4,0 @@ name: string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EditConfig = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const ink_text_input_1 = (0, tslib_1.__importDefault)(require("ink-text-input"));
const render_1 = require("@betterer/render");
function EditConfig(props) {
const { children, name, onChange, onSubmit, value } = props;
const [error, setError] = (0, react_1.useState)(null);
const [valid, setValid] = (0, react_1.useState)(null);
const [error, setError] = (0, render_1.useState)(null);
const [valid, setValid] = (0, render_1.useState)(null);
function change(newValue) {

@@ -22,14 +19,14 @@ const [valid, error] = onChange(newValue);

}
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
react_1.default.createElement(ink_1.Text, { color: "grey" },
return (render_1.React.createElement(render_1.Box, { flexDirection: "column" },
render_1.React.createElement(render_1.Text, { color: "grey" },
children,
" Press \"enter\" to confirm."),
react_1.default.createElement(ink_1.Box, null,
react_1.default.createElement(ink_1.Text, { color: error ? 'redBright' : 'yellowBright' },
render_1.React.createElement(render_1.Box, null,
render_1.React.createElement(render_1.Text, { color: error ? 'redBright' : 'yellowBright' },
name,
": "),
react_1.default.createElement(ink_text_input_1.default, { value: value, onChange: change, onSubmit: submit })),
react_1.default.createElement(ink_1.Box, null, error && react_1.default.createElement(ink_1.Text, null, error.message))));
render_1.React.createElement(render_1.TextInput, { value: value, onChange: change, onSubmit: submit })),
render_1.React.createElement(render_1.Box, null, error && render_1.React.createElement(render_1.Text, null, error.message))));
}
exports.EditConfig = EditConfig;
//# sourceMappingURL=EditConfig.js.map

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { BettererSuite } from '@betterer/betterer';
import { FC } from '@betterer/render';
export interface DefaultFilesProps {

@@ -4,0 +5,0 @@ suite: BettererSuite;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultFiles = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const messages_1 = require("../../messages");
exports.DefaultFiles = (0, react_1.memo)(function DefaultFiles(props) {
exports.DefaultFiles = (0, render_1.memo)(function DefaultFiles(props) {
const { suite, running } = props;
const { filePaths } = suite;
return (react_1.default.createElement(react_1.default.Fragment, null, filePaths.length ? (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, running ? (0, messages_1.filesChecking)(filePaths.length) : (0, messages_1.filesChecked)(filePaths.length))),
react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 }, filePaths.map((filePath) => (react_1.default.createElement(ink_1.Text, { key: filePath },
return (render_1.React.createElement(render_1.React.Fragment, null, filePaths.length ? (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, running ? (0, messages_1.filesChecking)(filePaths.length) : (0, messages_1.filesChecked)(filePaths.length))),
render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 }, filePaths.map((filePath) => (render_1.React.createElement(render_1.Text, { key: filePath },
"\u30FB ",

@@ -16,0 +14,0 @@ filePath)))))) : null));

@@ -1,4 +0,5 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
import { BettererReporterState } from '../../state';
export declare const DefaultReporter: FC<BettererReporterState>;
//# sourceMappingURL=DefaultReporter.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultReporter = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const render_1 = require("@betterer/render");
const suite_1 = require("../suite");
const DefaultFiles_1 = require("./DefaultFiles");
exports.DefaultReporter = (0, react_1.memo)(function DefaultReporter(props) {
exports.DefaultReporter = (0, render_1.memo)(function DefaultReporter(props) {
const { context, done, suiteSummary } = props;

@@ -14,6 +13,6 @@ const suite = props.suite || props.suiteSummary;

}
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(DefaultFiles_1.DefaultFiles, { suite: suite, running: !suiteSummary }),
react_1.default.createElement(suite_1.Suite, { context: context, suite: suite, suiteSummary: suiteSummary, done: done })));
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(DefaultFiles_1.DefaultFiles, { suite: suite, running: !suiteSummary }),
render_1.React.createElement(suite_1.Suite, { context: context, suite: suite, suiteSummary: suiteSummary, done: done })));
});
//# sourceMappingURL=DefaultReporter.js.map

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { BettererError } from '@betterer/errors';
import { FC } from '@betterer/render';
export interface ErrorProps {

@@ -4,0 +5,0 @@ error: BettererError;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Error = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const render_1 = require("@betterer/render");
const tasks_1 = require("@betterer/tasks");
const ink_1 = require("ink");
const Error = function Error({ error }) {
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 },
react_1.default.createElement(tasks_1.BettererLogo, null),
react_1.default.createElement(tasks_1.BettererErrorLog, { error: error })));
return (render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 },
render_1.React.createElement(tasks_1.BettererLogo, null),
render_1.React.createElement(tasks_1.BettererErrorLog, { error: error })));
};
exports.Error = Error;
//# sourceMappingURL=Error.js.map

@@ -1,4 +0,5 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
import { BettererReporterState } from '../state';
export declare const Reporter: FC<BettererReporterState>;
//# sourceMappingURL=Reporter.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Reporter = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const render_1 = require("@betterer/render");
const tasks_1 = require("@betterer/tasks");
const ink_1 = require("ink");
const default_1 = require("./default");

@@ -12,5 +10,5 @@ const watch_1 = require("./watch");

const { context } = props;
const { isRawModeSupported } = (0, ink_1.useStdin)();
const { isRawModeSupported } = (0, render_1.useStdin)();
isRawModeSupported &&
(0, ink_1.useInput)((input, key) => {
(0, render_1.useInput)((input, key) => {
if (key.ctrl && input === 'c') {

@@ -22,7 +20,7 @@ void context.stop();

const ReporterComponent = context.config.watch ? watch_1.WatchReporter : default_1.DefaultReporter;
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
react_1.default.createElement(tasks_1.BettererLogo, null),
react_1.default.createElement(ReporterComponent, Object.assign({}, props))));
return (render_1.React.createElement(render_1.Box, { flexDirection: "column" },
render_1.React.createElement(tasks_1.BettererLogo, null),
render_1.React.createElement(ReporterComponent, Object.assign({}, props))));
};
exports.Reporter = Reporter;
//# sourceMappingURL=Reporter.js.map

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { BettererContext, BettererSuite, BettererSuiteSummary } from '@betterer/betterer';
import { FC } from '@betterer/render';
import { BettererTasksDone } from '@betterer/tasks';

@@ -4,0 +5,0 @@ export interface SuiteProps {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Suite = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const render_1 = require("@betterer/render");
const tasks_1 = require("@betterer/tasks");
const ink_1 = require("ink");
const tasks_2 = require("./tasks");
const SuiteSummary_1 = require("./SuiteSummary");
exports.Suite = (0, react_1.memo)(function Runs({ context, suite, suiteSummary, done }) {
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 },
react_1.default.createElement(tasks_1.BettererTasksLogger, { name: "Betterer", update: update, exit: false, done: done }, suite.runs.map((run) => (react_1.default.createElement(tasks_1.BettererTaskLogger, { key: run.name, name: run.name, task: (0, tasks_2.useTask)(run) }))))),
suiteSummary ? react_1.default.createElement(SuiteSummary_1.SuiteSummary, { context: context, suiteSummary: suiteSummary }) : null));
exports.Suite = (0, render_1.memo)(function Runs({ context, suite, suiteSummary, done }) {
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 },
render_1.React.createElement(tasks_1.BettererTasksLogger, { name: "Betterer", update: update, exit: false, done: done }, suite.runs.map((run) => (render_1.React.createElement(tasks_1.BettererTaskLogger, { key: run.name, name: run.name, task: (0, tasks_2.useTask)(run) }))))),
suiteSummary ? render_1.React.createElement(SuiteSummary_1.SuiteSummary, { context: context, suiteSummary: suiteSummary }) : null));
});

@@ -16,0 +14,0 @@ function update(state) {

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { BettererContext, BettererSuiteSummary } from '@betterer/betterer';
import { FC } from '@betterer/render';
export interface SuiteSummaryProps {

@@ -4,0 +5,0 @@ context: BettererContext;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SuiteSummary = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const messages_1 = require("../../messages");

@@ -22,3 +20,3 @@ const TEXT_COLOURS = {

};
exports.SuiteSummary = (0, react_1.memo)(function SuiteSummary({ context, suiteSummary }) {
exports.SuiteSummary = (0, render_1.memo)(function SuiteSummary({ context, suiteSummary }) {
const better = suiteSummary.better.length;

@@ -34,26 +32,26 @@ const completed = suiteSummary.completed.length;

const worse = suiteSummary.worse.length;
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.checked }, (0, messages_1.testChecked)(tests(ran))),
neww ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.new }, (0, messages_1.testNew)(tests(neww))) : null,
better ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.better }, (0, messages_1.testBetter)(tests(better))) : null,
completed ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.completed }, (0, messages_1.testComplete)(tests(completed))) : null,
same ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.same }, (0, messages_1.testSame)(tests(same))) : null,
failed ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.failed }, (0, messages_1.testFailed)(tests(failed))) : null,
skipped ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.skipped }, (0, messages_1.testSkipped)(tests(skipped))) : null,
updated ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.updated }, (0, messages_1.testUpdated)(tests(updated))) : null,
worse ? (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.worse }, (0, messages_1.testWorse)(tests(worse)))),
!context.config.strict && react_1.default.createElement(ink_1.Text, null, (0, messages_1.updateInstructions)()))) : null,
expired ? react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.expired },
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 },
render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.checked }, (0, messages_1.testChecked)(tests(ran))),
neww ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.new }, (0, messages_1.testNew)(tests(neww))) : null,
better ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.better }, (0, messages_1.testBetter)(tests(better))) : null,
completed ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.completed }, (0, messages_1.testComplete)(tests(completed))) : null,
same ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.same }, (0, messages_1.testSame)(tests(same))) : null,
failed ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.failed }, (0, messages_1.testFailed)(tests(failed))) : null,
skipped ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.skipped }, (0, messages_1.testSkipped)(tests(skipped))) : null,
updated ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.updated }, (0, messages_1.testUpdated)(tests(updated))) : null,
worse ? (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.worse }, (0, messages_1.testWorse)(tests(worse)))),
!context.config.strict && render_1.React.createElement(render_1.Text, null, (0, messages_1.updateInstructions)()))) : null,
expired ? render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.expired },
(0, messages_1.testExpired)(tests(expired)),
")") : null),
context.config.ci && suiteSummary.changed.length ? (react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.changed }, (0, messages_1.unexpectedChanges)()),
react_1.default.createElement(ink_1.Box, { flexDirection: "column", padding: 1 }, suiteSummary.changed.map((name) => (react_1.default.createElement(ink_1.Text, { key: name },
context.config.ci && suiteSummary.changed.length ? (render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 },
render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.changed }, (0, messages_1.unexpectedChanges)()),
render_1.React.createElement(render_1.Box, { flexDirection: "column", padding: 1 }, suiteSummary.changed.map((name) => (render_1.React.createElement(render_1.Text, { key: name },
"\"",
name,
"\"")))),
react_1.default.createElement(ink_1.Text, { color: TEXT_COLOURS.changed }, (0, messages_1.unexpectedChangesInstructions)()))) : null));
render_1.React.createElement(render_1.Text, { color: TEXT_COLOURS.changed }, (0, messages_1.unexpectedChangesInstructions)()))) : null));
});

@@ -60,0 +58,0 @@ function tests(n) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useControls = void 0;
const react_1 = require("react");
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
function useControls(context) {
const { isRawModeSupported } = (0, ink_1.useStdin)();
const [editing, setEditing] = (0, react_1.useState)(null);
const { isRawModeSupported } = (0, render_1.useStdin)();
const [editing, setEditing] = (0, render_1.useState)(null);
const canEdit = isRawModeSupported;
const useEdit = canEdit ? ink_1.useInput : () => void 0;
const useEdit = canEdit ? render_1.useInput : () => void 0;
isRawModeSupported &&

@@ -12,0 +11,0 @@ useEdit((input, key) => {

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
export declare const WatchEnding: FC;
//# sourceMappingURL=WatchEnding.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchEnding = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const messages_1 = require("../../messages");
exports.WatchEnding = (0, react_1.memo)(function WatchEnding() {
return (react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, (0, messages_1.watchEnd)())));
exports.WatchEnding = (0, render_1.memo)(function WatchEnding() {
return (render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, (0, messages_1.watchEnd)())));
});
//# sourceMappingURL=WatchEnding.js.map

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { BettererContext, BettererSuite } from '@betterer/betterer';
import { FC } from '@betterer/render';
import { ConfigEditField } from '../config';

@@ -4,0 +5,0 @@ export interface WatchFilesProps {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchFiles = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const messages_1 = require("../../messages");
const config_1 = require("../config");
exports.WatchFiles = (0, react_1.memo)(function WatchFiles(props) {
exports.WatchFiles = (0, render_1.memo)(function WatchFiles(props) {
const { context, editField, suite, running } = props;
const { filePaths } = suite;
const isTestChange = context.config.configPaths.some((configPath) => filePaths.includes(configPath));
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(config_1.Config, { context: context, editField: editField }),
(filePaths === null || filePaths === void 0 ? void 0 : filePaths.length) ? (react_1.default.createElement(react_1.default.Fragment, null,
isTestChange ? (react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, (0, messages_1.testsChanged)()))) : (react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, running ? (0, messages_1.filesChecking)(filePaths.length) : (0, messages_1.filesChecked)(filePaths.length)))),
react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingBottom: 1 }, filePaths.map((filePath) => (react_1.default.createElement(ink_1.Text, { key: filePath },
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(config_1.Config, { context: context, editField: editField }),
(filePaths === null || filePaths === void 0 ? void 0 : filePaths.length) ? (render_1.React.createElement(render_1.React.Fragment, null,
isTestChange ? (render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, (0, messages_1.testsChanged)()))) : (render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, running ? (0, messages_1.filesChecking)(filePaths.length) : (0, messages_1.filesChecked)(filePaths.length)))),
render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingBottom: 1 }, filePaths.map((filePath) => (render_1.React.createElement(render_1.Text, { key: filePath },
"\u30FB ",

@@ -21,0 +19,0 @@ filePath)))))) : null));

@@ -1,3 +0,4 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
export declare const WatchInstructions: FC;
//# sourceMappingURL=WatchInstructions.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchInstructions = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
exports.WatchInstructions = (0, react_1.memo)(function WatchInstructions() {
return (react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, "(press \"q\" to quit)")));
const render_1 = require("@betterer/render");
exports.WatchInstructions = (0, render_1.memo)(function WatchInstructions() {
return (render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, "(press \"q\" to quit)")));
});
//# sourceMappingURL=WatchInstructions.js.map

@@ -1,4 +0,5 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
import { BettererReporterState } from '../../state';
export declare const WatchReporter: FC<BettererReporterState>;
//# sourceMappingURL=WatchReporter.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchReporter = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const render_1 = require("@betterer/render");
const suite_1 = require("../suite");

@@ -12,3 +11,3 @@ const WatchEnding_1 = require("./WatchEnding");

const useControls_1 = require("./useControls");
exports.WatchReporter = (0, react_1.memo)(function WatchReporter(props) {
exports.WatchReporter = (0, render_1.memo)(function WatchReporter(props) {
const { context, contextSummary, done, suiteSummary } = props;

@@ -18,12 +17,12 @@ const suite = props.suiteSummary || props.suite;

if (contextSummary) {
return react_1.default.createElement(WatchEnding_1.WatchEnding, null);
return render_1.React.createElement(WatchEnding_1.WatchEnding, null);
}
if (suite) {
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(WatchFiles_1.WatchFiles, { context: context, editField: editing, suite: suite, running: !suiteSummary }),
react_1.default.createElement(suite_1.Suite, { context: context, suite: suite, suiteSummary: suiteSummary, done: done }),
react_1.default.createElement(WatchInstructions_1.WatchInstructions, null)));
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(WatchFiles_1.WatchFiles, { context: context, editField: editing, suite: suite, running: !suiteSummary }),
render_1.React.createElement(suite_1.Suite, { context: context, suite: suite, suiteSummary: suiteSummary, done: done }),
render_1.React.createElement(WatchInstructions_1.WatchInstructions, null)));
}
return react_1.default.createElement(WatchStarting_1.WatchStarting, { context: context, editField: editing });
return render_1.React.createElement(WatchStarting_1.WatchStarting, { context: context, editField: editing });
});
//# sourceMappingURL=WatchReporter.js.map

@@ -1,2 +0,3 @@

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
import { BettererContext } from '@betterer/betterer';

@@ -3,0 +4,0 @@ import { ConfigEditField } from '../config';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WatchStarting = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const messages_1 = require("../../messages");
const config_1 = require("../config");
const WatchInstructions_1 = require("./WatchInstructions");
exports.WatchStarting = (0, react_1.memo)(function WatchStarting(props) {
exports.WatchStarting = (0, render_1.memo)(function WatchStarting(props) {
const { context, editField } = props;
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
react_1.default.createElement(config_1.Config, { context: context, editField: editField }),
react_1.default.createElement(ink_1.Box, { paddingBottom: 1 },
react_1.default.createElement(ink_1.Text, null, (0, messages_1.watchStart)())),
react_1.default.createElement(WatchInstructions_1.WatchInstructions, null)));
return (render_1.React.createElement(render_1.Box, { flexDirection: "column" },
render_1.React.createElement(config_1.Config, { context: context, editField: editField }),
render_1.React.createElement(render_1.Box, { paddingBottom: 1 },
render_1.React.createElement(render_1.Text, null, (0, messages_1.watchStart)())),
render_1.React.createElement(WatchInstructions_1.WatchInstructions, null)));
});
//# sourceMappingURL=WatchStarting.js.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.reporter = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
const components_1 = require("./components");

@@ -49,3 +47,3 @@ const state_1 = require("./state");

function renderError(error) {
(0, ink_1.render)(react_1.default.createElement(components_1.Error, { error: error }), RENDER_OPTIONS);
(0, render_1.render)(render_1.React.createElement(components_1.Error, { error: error }), RENDER_OPTIONS);
}

@@ -60,5 +58,5 @@ function createRenderer(context) {

console.clear();
const component = react_1.default.createElement(components_1.Reporter, Object.assign({}, state, { done: done }));
const component = render_1.React.createElement(components_1.Reporter, Object.assign({}, state, { done: done }));
if (!app) {
app = (0, ink_1.render)(component, RENDER_OPTIONS);
app = (0, render_1.render)(component, RENDER_OPTIONS);
}

@@ -65,0 +63,0 @@ else {

{
"name": "@betterer/reporter",
"description": "Default reporter @betterer/betterer",
"version": "5.3.3",
"version": "5.3.4",
"license": "MIT",

@@ -31,13 +31,10 @@ "publishConfig": {

"dependencies": {
"@betterer/betterer": "^5.3.3",
"@betterer/betterer": "^5.3.4",
"@betterer/errors": "^5.3.0",
"@betterer/logger": "^5.3.3",
"@betterer/tasks": "^5.3.3",
"ink": "^3.0.9",
"ink-text-input": "^4.0.1",
"react": ">=16.8.4 || >=17.0.0",
"react-dom": ">=16.8.4 || >=17.0.0",
"@betterer/logger": "^5.3.4",
"@betterer/render": "^5.3.4",
"@betterer/tasks": "^5.3.4",
"tslib": "^2.3.1"
},
"gitHead": "7e06654c3ecc3a1d0387f11b51d6ded0b5986cc5"
"gitHead": "25ae48d13d82cb5212736ce28693b142a5be6666"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc