Skip to content

Commit

Permalink
chore(deps): Update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jul 8, 2024
1 parent d0b9249 commit 617d946
Show file tree
Hide file tree
Showing 9 changed files with 1,221 additions and 510 deletions.
1,658 changes: 1,189 additions & 469 deletions package-lock.json

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,29 @@
"@darkobits/saffron": "~0.32.17",
"@types/yargs-unparser": "^2.0.3",
"boxen": "^7.1.1",
"callsites": "~4.1.0",
"callsites": "~4.2.0",
"deepmerge": "^4.3.1",
"errno": "^1.0.0",
"execa": "~8.0.1",
"execa": "~9.3.0",
"kebabcase-keys": "^1.0.0",
"micromatch": "^4.0.5",
"micromatch": "^4.0.7",
"npm-run-path": "~5.3.0",
"ow": "~1.1.1",
"p-all": "~5.0.0",
"p-series": "~3.0.0",
"ramda": "^0.29.1",
"ramda": "^0.30.1",
"read-package-up": "^11.0.0",
"which": "^4.0.0",
"yargs-unparser": "^2.0.0"
},
"devDependencies": {
"@darkobits/ts": "~0.20.7",
"@darkobits/ts": "~0.20.9",
"@types/is-ci": "^3.0.4",
"@types/kebabcase-keys": "^1.0.5",
"@types/micromatch": "^4.0.6",
"@types/micromatch": "^4.0.9",
"@types/node-emoji": "^1.8.2",
"@types/ramda": "^0.29.11",
"@types/which": "^3.0.3",
"@types/ramda": "^0.30.1",
"@types/which": "^3.0.4",
"is-ci": "^3.0.1"
}
}
2 changes: 0 additions & 2 deletions src/bin/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@ import { parseError, heroLog } from 'lib/utils';

import type { CLIArguments, UserConfigurationExport } from 'etc/types';


const chalk = log.chalk;


cli.command<CLIArguments, UserConfigurationExport>({
command: '* [query]',
description: 'Run the script matched by the provided query.',
Expand Down
5 changes: 2 additions & 3 deletions src/etc/types/CommandExecutor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { CommandBuilderOptions } from './CommandBuilderOptions';
import type { ExecaChildProcess } from 'execa';

import type { ResultPromise } from 'execa';

export interface CommandExecutorOptions extends Omit<CommandBuilderOptions, 'preserveArgumentCasing' | 'prefix'> {
/**
Expand All @@ -25,4 +24,4 @@ export interface CommandExecutorOptions extends Omit<CommandBuilderOptions, 'pre
* Signature of a command executor. Returns an execa invocation using different
* strategies.
*/
export type CommandExecutor = (options: CommandExecutorOptions) => ExecaChildProcess;
export type CommandExecutor = (options: CommandExecutorOptions) => ResultPromise<typeof options>;
16 changes: 3 additions & 13 deletions src/etc/types/CommandOptions.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { Options as ExecaOptions, NodeOptions as ExecaNodeOptions } from 'execa';
import type {
Options as ExecaOptions
} from 'execa';
import type log from 'lib/log';


type Primitive = string | number | boolean;


/**
* Defines how arguments are specified for commands.
*/
Expand Down Expand Up @@ -63,20 +63,10 @@ export interface CommonCommandOptions {
timing?: boolean;
}


/**
* Options that may be provided to `command`. Accepts all `CommonCommandOptions`
* and all Execa options.
*
* See: See: https://github.com/sindresorhus/execa#execafile-arguments-options
*/
export type CommandOptions = CommonCommandOptions & ExecaOptions;


/**
* Options that may be provided to `command.node`. Accepts all
* `CommonCommandOptions` and all ExecaNode options.
*
* See: See: https://github.com/sindresorhus/execa#execanodescriptpath-arguments-options
*/
export type CommandOptionsNode = CommonCommandOptions & ExecaNodeOptions;
7 changes: 3 additions & 4 deletions src/etc/types/CommandThunk.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import type { IS_COMMAND_THUNK } from 'etc/constants';
import type { ExecaReturnValue } from 'execa';

import type { Options as ExecaOptions, ResultPromise } from 'execa';

/**
* Return type of `command`.
*/
export interface CommandThunk {
(): Promise<ExecaReturnValue>;
export interface CommandThunk<O extends ExecaOptions = ExecaOptions> {
(): ResultPromise<O>;
[IS_COMMAND_THUNK]: true;
}
2 changes: 1 addition & 1 deletion src/etc/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export type { CLIArguments } from './CliArguments';
export type { CommandBuilderOptions } from './CommandBuilderOptions';
export type { CommandDescriptor } from './CommandDescriptor';
export type { CommandExecutor, CommandExecutorOptions } from './CommandExecutor';
export type { CommandOptions, CommandOptionsNode, CommandArguments } from './CommandOptions';
export type { CommandOptions, CommandArguments } from './CommandOptions';
export type { CommandThunk } from './CommandThunk';

export type { UserConfigurationFn } from './UserConfigurationFn';
Expand Down
5 changes: 3 additions & 2 deletions src/lib/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import type {
CommandExecutor,
CommandExecutorOptions,
CommandOptions,
CommandOptionsNode,
CommandThunk,
UserConfigurationExport
} from 'etc/types';
Expand Down Expand Up @@ -168,6 +167,8 @@ export function printCommandInfo(context: SaffronHandlerContext<CLIArguments, Us
right: 1,
bottom: 0
},
// Makes the box full-width, auto height.
fullscreen: width => [width, 0],
margin: 0,
borderColor: '#242424'
}));
Expand Down Expand Up @@ -420,7 +421,7 @@ export function command(executable: string, opts: CommandOptions = {}) {
*
* See: https://github.com/sindresorhus/execa#execanodescriptpath-arguments-options
*/
command.node = (nodeScript: string, opts: CommandOptionsNode = {}) => {
command.node = (nodeScript: string, opts: CommandOptions = {}) => {
ow(nodeScript, 'nodeScript', ow.string);

// Get the name of the package that defined this command.
Expand Down
19 changes: 11 additions & 8 deletions src/lib/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function resolveInstructionToThunk(value: Instruction): Thunk {
// up in the registry.
if (typeof value === 'function') {
if (isThunk(value)) return value;
throw new TypeError('[resolveInstructionToThunk] Provided function is not a command, function, or script.');
throw new TypeError('[resolveInstructionToThunk] Provided value is not a command, function, or script.');
}

// If the user provided a string, parse it and look-up the indicated command,
Expand Down Expand Up @@ -234,12 +234,15 @@ export function printScriptInfo(context: SaffronHandlerContext<CLIArguments, Use

console.log(boxen(finalDescription, {
title,
borderStyle: 'round',
padding: {
top: 0,
left: 1,
right: 1,
bottom: 0
},
// Makes the box full-width, auto height.
fullscreen: width => [width, 0],
margin: 0,
borderColor: '#242424'
}));
Expand All @@ -253,16 +256,16 @@ export function printScriptInfo(context: SaffronHandlerContext<CLIArguments, Use
if (groupsUsed) {
const groupedScripts = R.groupBy<ScriptDescriptor>(descriptor => descriptor.options.group ?? 'Other', allScripts);

R.forEachObjIndexed((scriptConfigs, groupName) => {
for (const [groupName, scriptConfigs] of Object.entries(groupedScripts)) {
if (!scriptConfigs) return;

console.log('');
console.log(`${chalk.bold(groupName)}\n`);
R.forEach(printScript, scriptConfigs);
}, groupedScripts);
const groupHasVisibleScripts = scriptConfigs.some(script => !script.options.hidden);
if (!groupHasVisibleScripts) return;
console.log(`\n${chalk.bold(groupName)}\n`);
scriptConfigs.forEach(printScript);
}
} else {
console.log('');
R.forEach(printScript, allScripts);
allScripts.forEach(printScript);
}

console.log('');
Expand Down

0 comments on commit 617d946

Please sign in to comment.