Skip to content

Commit

Permalink
upgrade @ryanatkn/belt@0.24 and fix task timings
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanatkn committed Jul 2, 2024
1 parent 87fae76 commit 9dc0a5f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/silver-oranges-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ryanatkn/gro": minor
---

upgrade `@ryanatkn/belt@0.24` and fix task timings
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"typescript"
],
"dependencies": {
"@ryanatkn/belt": "^0.23.0",
"@ryanatkn/belt": "^0.24.1",
"chokidar": "^3.6.0",
"dotenv": "^16.4.5",
"es-module-lexer": "^1.5.4",
Expand Down
10 changes: 9 additions & 1 deletion src/lib/invoke_task.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,26 @@ import type {Gro_Config} from './config.js';
* Precise error messages are especially difficult and
* there are some subtle differences in the complex logical branches.
* The comments describe each condition.
*
* @param task_name - The name of the task to invoke.
* @param args - The CLI args to pass to the task.
* @param config - The Gro configuration.
* @param initial_timings - The timings to use for the top-level task, `null` for composed tasks.
*/
export const invoke_task = async (
task_name: Raw_Input_Path,
args: Args | undefined,
config: Gro_Config,
timings = new Timings(),
initial_timings: Timings | null = null,
): Promise<void> => {
const log = new System_Logger(print_log_label(task_name || 'gro'));
log.info('invoking', task_name ? cyan(task_name) : 'gro');

const timings = initial_timings ?? new Timings();

const total_timing = create_stopwatch();
const finish = () => {
if (!initial_timings) return; // print timings only for the top-level task
print_timings(timings, log);
log.info(`🕒 ${print_ms(total_timing())}`);
};
Expand Down
2 changes: 1 addition & 1 deletion src/lib/package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const package_json = {
'typescript',
],
dependencies: {
'@ryanatkn/belt': '^0.23.0',
'@ryanatkn/belt': '^0.24.1',
chokidar: '^3.6.0',
dotenv: '^16.4.5',
'es-module-lexer': '^1.5.4',
Expand Down

0 comments on commit 9dc0a5f

Please sign in to comment.