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

@betterer/tasks

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@betterer/tasks - 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/tasks
## [5.3.3](https://github.com/phenomnomnominal/betterer/compare/v5.3.2...v5.3.3) (2022-05-11)

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

3

dist/error-log.d.ts

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

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

@@ -4,0 +5,0 @@ * @public `props` type for {@link BettererErrorLog | `<BettererErrorLog/>`}.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BettererErrorLog = void 0;
const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const errors_1 = require("@betterer/errors");
const ink_1 = require("ink");
const render_1 = require("@betterer/render");
/**

@@ -21,12 +19,12 @@ * @public Ink component for rendering a {@link @betterer/errors#BettererError | `BettererError` }

}
return (react_1.default.createElement(react_1.default.Fragment, null,
react_1.default.createElement(ink_1.Box, { flexDirection: "column", paddingTop: 1 },
react_1.default.createElement(ink_1.Box, null,
react_1.default.createElement(ink_1.Text, { color: "redBright" }, "Error: "),
react_1.default.createElement(ink_1.Text, null, error.message)),
error.stack ? (react_1.default.createElement(ink_1.Box, { paddingLeft: 2 },
react_1.default.createElement(ink_1.Text, null, processStack(error.stack)))) : null,
details.map((detail, index) => (react_1.default.createElement(ink_1.Box, { key: index, paddingTop: 1 },
react_1.default.createElement(ink_1.Text, null, detail.trim()))))),
errors.map((error, index) => (react_1.default.createElement(BettererErrorLog, { key: index, error: error })))));
return (render_1.React.createElement(render_1.React.Fragment, null,
render_1.React.createElement(render_1.Box, { flexDirection: "column", paddingTop: 1 },
render_1.React.createElement(render_1.Box, null,
render_1.React.createElement(render_1.Text, { color: "redBright" }, "Error: "),
render_1.React.createElement(render_1.Text, null, error.message)),
error.stack ? (render_1.React.createElement(render_1.Box, { paddingLeft: 2 },
render_1.React.createElement(render_1.Text, null, processStack(error.stack)))) : null,
details.map((detail, index) => (render_1.React.createElement(render_1.Box, { key: index, paddingTop: 1 },
render_1.React.createElement(render_1.Text, null, detail.trim()))))),
errors.map((error, index) => (render_1.React.createElement(BettererErrorLog, { key: index, error: error })))));
};

@@ -33,0 +31,0 @@ exports.BettererErrorLog = BettererErrorLog;

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

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

@@ -3,0 +4,0 @@ * @public Ink component for rendering an ASCII version of the {@link https://github.com/phenomnomnominal/betterer | **Betterer**}

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BettererLogo = 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 LOGO = `

@@ -19,5 +17,5 @@ \\ | / _ _ _

const BettererLogo = function BettererLogo() {
return react_1.default.createElement(ink_1.Text, { color: "yellowBright" }, LOGO);
return render_1.React.createElement(render_1.Text, { color: "yellowBright" }, LOGO);
};
exports.BettererLogo = BettererLogo;
//# sourceMappingURL=logo.js.map

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

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

@@ -3,0 +4,0 @@ export interface BettererTaskStatusProps {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.BettererTaskStatus = void 0;
const tslib_1 = require("tslib");
const ink_1 = require("ink");
const react_1 = (0, tslib_1.__importDefault)(require("react"));
const render_1 = require("@betterer/render");
const BettererTaskStatus = function BettererTaskStatus({ name, status }) {
const [indicator, colour, message] = status;
return (react_1.default.createElement(ink_1.Text, null,
return (render_1.React.createElement(render_1.Text, null,
indicator,
react_1.default.createElement(ink_1.Text, { color: colour },
render_1.React.createElement(render_1.Text, { color: colour },
" ",

@@ -13,0 +11,0 @@ name,

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

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

@@ -3,0 +4,0 @@ /**

@@ -5,6 +5,5 @@ "use strict";

const tslib_1 = require("tslib");
const react_1 = (0, tslib_1.__importStar)(require("react"));
const logger_1 = require("@betterer/logger");
const render_1 = require("@betterer/render");
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
const ink_1 = require("ink");
const error_log_1 = require("../error-log");

@@ -19,3 +18,3 @@ const status_1 = require("./status");

*/
exports.BettererTaskLogger = (0, react_1.memo)(function BettererTaskLogger(props) {
exports.BettererTaskLogger = (0, render_1.memo)(function BettererTaskLogger(props) {
const { name, task } = props;

@@ -25,3 +24,3 @@ const [tasksState] = (0, useTasksState_1.useTasks)();

const { error, logs, status } = taskState;
(0, react_1.useEffect)(() => {
(0, render_1.useEffect)(() => {
void (async () => {

@@ -83,6 +82,6 @@ taskApi.reset();

}, [name, task, taskApi]);
return (react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
status && react_1.default.createElement(status_1.BettererTaskStatus, { name: name, status: status }),
tasksState.endTime != null && logs.length ? (react_1.default.createElement(ink_1.Box, { flexDirection: "column" }, logs.map((log, index) => (react_1.default.createElement(ink_1.Text, { key: index }, prependLogBlock(log)))))) : null,
error && react_1.default.createElement(error_log_1.BettererErrorLog, { error: error })));
return (render_1.React.createElement(render_1.Box, { flexDirection: "column" },
status && render_1.React.createElement(status_1.BettererTaskStatus, { name: name, status: status }),
tasksState.endTime != null && logs.length ? (render_1.React.createElement(render_1.Box, { flexDirection: "column" }, logs.map((log, index) => (render_1.React.createElement(render_1.Text, { key: index }, prependLogBlock(log)))))) : null,
error && render_1.React.createElement(error_log_1.BettererErrorLog, { error: error })));
});

@@ -89,0 +88,0 @@ function prependLogBlock(log) {

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

import { FC } from 'react';
/// <reference types="react" />
import { FC } from '@betterer/render';
import { BettererTasksDone, BettererTasksStatusUpdate } from './types';

@@ -3,0 +4,0 @@ /**

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

@@ -14,9 +12,9 @@ const useTasksState_1 = require("./useTasksState");

*/
exports.BettererTasksLogger = (0, react_1.memo)(function BettererTasksLogger(props) {
exports.BettererTasksLogger = (0, render_1.memo)(function BettererTasksLogger(props) {
const { children, done = () => void 0, exit = true, name, update = defaultUpdate } = props;
const app = (0, ink_1.useApp)();
const app = (0, render_1.useApp)();
const [time, clear] = (0, useTimer_1.useTimer)();
const [state, tasks] = (0, useTasksState_1.useTasksState)();
const { startTime, endTime, errors } = state;
(0, react_1.useEffect)(() => {
(0, render_1.useEffect)(() => {
if (endTime != null) {

@@ -41,5 +39,5 @@ clear();

}
return (react_1.default.createElement(useTasksState_1.BettererTasksContext.Provider, { value: [state, tasks] },
react_1.default.createElement(ink_1.Box, { flexDirection: "column" },
react_1.default.createElement(status_1.BettererTaskStatus, { name: `${name} (${getTime(startTime, endTime || time)}ms)`, status: status }),
return (render_1.React.createElement(useTasksState_1.BettererTasksContext.Provider, { value: [state, tasks] },
render_1.React.createElement(render_1.Box, { flexDirection: "column" },
render_1.React.createElement(status_1.BettererTaskStatus, { name: `${name} (${getTime(startTime, endTime || time)}ms)`, status: status }),
children)));

@@ -46,0 +44,0 @@ });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTasks = exports.BettererTasksContext = exports.useTasksState = void 0;
const react_1 = require("react");
const errors_1 = require("@betterer/errors");
const render_1 = require("@betterer/render");
const utils_1 = require("../utils");
function useTasksState() {
const [state, dispatch] = (0, react_1.useReducer)(reducer, getInitialState());
const api = (0, react_1.useRef)({
const [state, dispatch] = (0, render_1.useReducer)(reducer, getInitialState());
const api = (0, render_1.useRef)({
error(error) {

@@ -32,5 +32,5 @@ dispatch({ type: 'error', data: error });

}
exports.BettererTasksContext = (0, react_1.createContext)(null);
exports.BettererTasksContext = (0, render_1.createContext)(null);
function useTasks() {
const context = (0, react_1.useContext)(exports.BettererTasksContext);
const context = (0, render_1.useContext)(exports.BettererTasksContext);
if (context === null) {

@@ -37,0 +37,0 @@ throw new errors_1.BettererError('Trying to use `BettererTasksContext` before it was created` 🔥');

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTaskState = void 0;
const react_1 = require("react");
const render_1 = require("@betterer/render");
const useTasksState_1 = require("./useTasksState");

@@ -14,5 +14,5 @@ const INITIAL_STATE = {

function useTaskState() {
const [state, dispatch] = (0, react_1.useReducer)(reducer, INITIAL_STATE);
const [state, dispatch] = (0, render_1.useReducer)(reducer, INITIAL_STATE);
const [, tasks] = (0, useTasksState_1.useTasks)();
const api = (0, react_1.useRef)({
const api = (0, render_1.useRef)({
reset() {

@@ -19,0 +19,0 @@ dispatch({ type: 'reset' });

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTimer = void 0;
const react_1 = require("react");
const render_1 = require("@betterer/render");
const utils_1 = require("../utils");
const DEFAULT_TASK_TIME_INTERVAL = 100;
function useTimer() {
const timer = (0, react_1.useRef)(null);
const [time, setTime] = (0, react_1.useState)((0, utils_1.getPreciseTime)());
const updateTime = (0, react_1.useCallback)(() => {
const timer = (0, render_1.useRef)(null);
const [time, setTime] = (0, render_1.useState)((0, utils_1.getPreciseTime)());
const updateTime = (0, render_1.useCallback)(() => {
setTime((0, utils_1.getPreciseTime)());
}, []);
const clearTime = (0, react_1.useCallback)(() => {
const clearTime = (0, render_1.useCallback)(() => {
if (timer.current) {

@@ -18,3 +18,3 @@ clearInterval(timer.current);

}, []);
(0, react_1.useEffect)(() => {
(0, render_1.useEffect)(() => {
if (process.env.CI) {

@@ -21,0 +21,0 @@ return;

{
"name": "@betterer/tasks",
"description": "task runner and loggerr for @betterer/betterer",
"version": "5.3.3",
"version": "5.3.4",
"license": "MIT",

@@ -32,10 +32,8 @@ "publishConfig": {

"@betterer/errors": "^5.3.0",
"@betterer/logger": "^5.3.3",
"@betterer/logger": "^5.3.4",
"@betterer/render": "^5.3.4",
"chalk": "^4.1.2",
"ink": "^3.0.9",
"react": ">=16.8.4 || >=17.0.0",
"react-dom": ">=16.8.4 || >=17.0.0",
"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

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