Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rewrite and convert to typescript #3

Merged
merged 24 commits into from
Feb 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"env": {
"node": true,
"commonjs": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 12
},
"plugins": ["@typescript-eslint", "jest"],
"rules": {}
}
10 changes: 7 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build
name: Build & Test
on:
push:

Expand All @@ -10,5 +10,9 @@ jobs:
uses: actions/checkout@v2
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Type Check
run: npm run check
- name: Lint
run: npm run lint
- name: Test
run: npm test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
dist
src/data/msr.db
*.db
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.yml
*.yaml
*.json
15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"arrowParens": "always",
"bracketSpacing": true,
"bracketSameLine": true,
"singleQuote": true,

"trailingComma": "all",
"tabWidth": 4,
"printWidth": 120,
"overrides": [
{
"files": ["*.js", "*.yaml"]
}
]
}
3 changes: 3 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
37 changes: 29 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# dit
> *A frictionless task logging and reporting tool in NodeJS*

> _A frictionless task logging and reporting tool in NodeJS_

## TL;DR
I built a tool that cut my time spent on required work reports from **3.5 hours per month** to **3.5 *minutes* per month**, saving me almost *40 hours per year.*

I built a tool that cut my time spent on required work reports from **3.5 hours per month** to **3.5 _minutes_ per month**, saving me almost _40 hours per year._

## The Problem(s)

1. At the end of each working day I needed to report 3-4 things I had completed or was working on that day.
1. At the end of the month I needed to compile a simple report of my key accomplishments for that month.

Expand All @@ -19,36 +24,44 @@ The monthly report was an even bigger ordeal. My process consisted of:

All in all, this usually took about half an hour to do.

Altogether, these two tasks would cost me over 3 hours a month on average. (*10 mins daily x 18 working days = 180 minutes + 20 minutes monthly, 1 time a month = 200 minutes = **~3 hours and 20 minutes** *per month.*)
Altogether, these two tasks would cost me over 3 hours a month on average. (*10 mins daily x 18 working days = 180 minutes + 20 minutes monthly, 1 time a month = 200 minutes = **~3 hours and 20 minutes** *per month.\*)

## Solution

I wanted a solution that was always at my fingertips. When I'm working I always have a terminal window open in VS Code to run my `git` and `npm` commands, so having another 3-letter console command would be perfect - no need to even leave my workspace!
I wanted a solution that was always at my fingertips. When I'm working I always have a terminal window open in VS Code to run my `git` and `npm` commands, so having another 3-letter console command would be perfect - no need to even leave my workspace!

Even better, it would store all those daily entries and spit them back out for me at the end of the month - no more digging through a months worth of sent emails!

## Result

It takes me ~7 seconds to add an entry. On average I do that 3 times per day, so 21 seconds. Getting my end-of-day output and pasting into an email and sending takes ~12 seconds. Daily cost = ~35 seconds (rounding up)

At the end of the month, it takes ~9 seconds to generate my output and paste into an email. The duplicates are already removed, so add another 3 minutes for filtering down to the highlights.

In total, I now spend about **3 minutes and 45 seconds** *per month* on my required reporting, **98.1% less time**. I'm saving **11,656** seconds every month - that's **38.9 hours saved per year.**
In total, I now spend about **3 minutes and 45 seconds** _per month_ on my required reporting, **98.1% less time**. I'm saving **11,656** seconds every month - that's **38.9 hours saved per year.**

# Usage

## Add an Entry

```bash
dit add 'Completed some task'
```

Output:

```bash
[{ rowid: 1 }]
```

## List all Entries

```bash
dit all
dit all
```

Output:

```
[
{
Expand All @@ -58,19 +71,27 @@ Output:
}
]
```

## Get End-of-Day Report

```bash
dit eod
```
Output: *(this gets added to the clipboard for quick pasting!)*

Output: _(this gets added to the clipboard for quick pasting!)_

```
Completed some task. Completed another task. Still working on X task.
```

## Get End-of-Month Report

```bash
dit eom
```
Output: *(this gets added to the clipboard for quick pasting!)*

Output: _(this gets added to the clipboard for quick pasting!)_

```
- Completed some task.
- Completed another task.
Expand Down
4 changes: 0 additions & 4 deletions ditrc.json

This file was deleted.

7 changes: 7 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const config = {
verbose: true,
preset: 'ts-jest',
testEnvironment: 'node',
testRegex: 'test.ts',
};
export default config;
Loading
Loading