@beauraines/toggl-cli 0.10.13 → 0.10.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.10.14](https://github.com/beauraines/toggl-cli/compare/v0.10.13...v0.10.14) (2023-04-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * adds color to current time entry ([ec660a7](https://github.com/beauraines/toggl-cli/commit/ec660a7fe383167fe306b0c1438814242066458a))
11
+
5
12
  ### [0.10.13](https://github.com/beauraines/toggl-cli/compare/v0.10.12...v0.10.13) (2023-04-01)
6
13
 
7
14
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@beauraines/toggl-cli",
3
- "version": "0.10.13",
3
+ "version": "0.10.14",
4
4
  "description": "",
5
5
  "main": "cli.js",
6
6
  "bin": {
package/utils.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import Client from './client.js'
2
+ import chalk from 'chalk';
2
3
  import dayjs from 'dayjs'
3
4
  import utc from "dayjs/plugin/utc.js";
4
5
  import timezone from 'dayjs/plugin/timezone.js';
@@ -103,15 +104,15 @@ export const displayTimeEntry = async function (timeEntry) {
103
104
  if (!timeEntry) {
104
105
  console.log('There is no time entry running!')
105
106
  } else {
106
- console.info(`${timeEntry.description} #${timeEntry.id}`)
107
- console.info(`Billable: ${timeEntry.billable}`)
107
+ console.info(`${chalk.blueBright(timeEntry.description)} ${chalk.yellow('#'+timeEntry.id)}`)
108
+ console.info(`Billable: ${chalk.gray(timeEntry.billable)}`)
108
109
 
109
110
  // TODO this should be abstracted for reuse
110
111
  const startTime = dayjs.unix(timeEntry.duration * -1)
111
112
  const duration = dayjs().diff(startTime, 's')
112
113
  const durationFormatted = dayjs.duration(duration * 1000).format('H[h] m[m]')
113
114
 
114
- console.info(`Duration: ${durationFormatted}`)
115
+ console.info(`Duration: ${chalk.green(durationFormatted)}`)
115
116
 
116
117
  const projects = await getProjects(timeEntry.wid)
117
118
  const project = projects.find(x => x.id == timeEntry.pid)