jira-report-tui 1.0.7 → 1.0.10
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/README.md +32 -7
- package/bin/{jira-report → jira-report-darwin-amd64} +0 -0
- package/bin/jira-report-darwin-arm64 +0 -0
- package/bin/jira-report-linux-amd64 +0 -0
- package/bin/jira-report-linux-arm64 +0 -0
- package/{jira-report → bin/jira-report-windows-amd64.exe} +0 -0
- package/bin/jira-report-windows-arm64.exe +0 -0
- package/package.json +5 -3
- package/test-cache.sh +107 -0
- package/.github/workflows/build.yml +0 -80
- package/.github/workflows/publish.yml +0 -71
package/README.md
CHANGED
|
@@ -114,6 +114,7 @@ Location: /home/user/.jira-daily-report.json
|
|
|
114
114
|
✅ **Worklog Enrichment** - Shows task details with time logged
|
|
115
115
|
✅ **Dark Theme** - Beautiful terminal UI
|
|
116
116
|
✅ **Single Binary** - No dependencies
|
|
117
|
+
✅ **Smart Caching** - Instant startup with cached data (enabled by default)
|
|
117
118
|
|
|
118
119
|
---
|
|
119
120
|
|
|
@@ -126,15 +127,34 @@ Location: `~/.jira-daily-report.json`
|
|
|
126
127
|
"jiraServer": "https://your-domain.atlassian.net",
|
|
127
128
|
"username": "you@example.com",
|
|
128
129
|
"apiToken": "your-jira-api-token",
|
|
129
|
-
"tempoApiToken": "your-tempo-
|
|
130
|
+
"tempoApiToken": "your-tempo-token",
|
|
130
131
|
"whoAmI": "your-account-id",
|
|
131
132
|
"autoClipboard": false,
|
|
132
|
-
"theme": "dark"
|
|
133
|
+
"theme": "dark",
|
|
134
|
+
"cacheEnabled": true,
|
|
135
|
+
"cacheTTL": 60
|
|
133
136
|
}
|
|
134
137
|
```
|
|
135
138
|
|
|
136
139
|
**Security**: File permissions are set to `0600` (owner read/write only)
|
|
137
140
|
|
|
141
|
+
### Cache Configuration
|
|
142
|
+
|
|
143
|
+
- **`cacheEnabled`**: Enable/disable caching (default: `true`)
|
|
144
|
+
- **`cacheTTL`**: Cache time-to-live in minutes (default: `60`)
|
|
145
|
+
- **Cache file**: `~/.jira-daily-report-cache.json` (auto-managed)
|
|
146
|
+
|
|
147
|
+
**Environment Variables:**
|
|
148
|
+
```bash
|
|
149
|
+
export JIRA_CACHE_ENABLED=true # Enable/disable cache
|
|
150
|
+
export JIRA_CACHE_TTL=60 # Cache TTL in minutes
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
**How it works:**
|
|
154
|
+
1. First launch: Fetches fresh data from APIs (~500ms)
|
|
155
|
+
2. Subsequent launches: Shows cached data instantly (~50ms), then refreshes in background
|
|
156
|
+
3. Cache indicator: Shows `📦 Xm old` in status bar when using cached data
|
|
157
|
+
|
|
138
158
|
---
|
|
139
159
|
|
|
140
160
|
## Install
|
|
@@ -156,11 +176,16 @@ cd go-tui
|
|
|
156
176
|
|
|
157
177
|
## Performance
|
|
158
178
|
|
|
159
|
-
| Metric | TypeScript | Go | Improvement |
|
|
160
|
-
|
|
161
|
-
| Startup | ~500ms | **~50ms** | **10x faster** |
|
|
162
|
-
| Navigation | ~200ms | **<10ms** | **20x faster** |
|
|
163
|
-
| Memory | ~100MB | **~20MB** | **5x less** |
|
|
179
|
+
| Metric | TypeScript | Go (Cold Start) | Go (Cached) | Best Improvement |
|
|
180
|
+
|--------|-----------|-----------------|-------------|------------------|
|
|
181
|
+
| Startup | ~500ms | ~500ms | **~50ms** | **10x faster** |
|
|
182
|
+
| Navigation | ~200ms | **<10ms** | **<10ms** | **20x faster** |
|
|
183
|
+
| Memory | ~100MB | **~20MB** | **~20MB** | **5x less** |
|
|
184
|
+
|
|
185
|
+
**Cache Performance:**
|
|
186
|
+
- ⚡ **First launch**: ~500ms (fetches from API)
|
|
187
|
+
- 🚀 **Cached launch**: ~50ms (10x faster)
|
|
188
|
+
- 🔄 **Background refresh**: Data updates seamlessly without blocking UI
|
|
164
189
|
|
|
165
190
|
---
|
|
166
191
|
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jira-report-tui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Fast, performant terminal interface for managing Jira tasks and logging time to Tempo - 20x faster than TypeScript version",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"jira-report": "cli.js"
|
|
7
|
+
"jira-report-tui": "cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "./build-all.sh",
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
"node": ">=14.0.0"
|
|
40
40
|
},
|
|
41
41
|
"os": [
|
|
42
|
-
"linux"
|
|
42
|
+
"linux",
|
|
43
|
+
"darwin",
|
|
44
|
+
"win32"
|
|
43
45
|
],
|
|
44
46
|
"cpu": [
|
|
45
47
|
"x64",
|
package/test-cache.sh
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
set -e
|
|
4
|
+
|
|
5
|
+
CACHE_FILE="$HOME/.jira-daily-report-cache.json"
|
|
6
|
+
BINARY="./bin/jira-report"
|
|
7
|
+
|
|
8
|
+
echo "🧪 Testing Cache Functionality"
|
|
9
|
+
echo "================================"
|
|
10
|
+
echo ""
|
|
11
|
+
|
|
12
|
+
echo "1️⃣ Testing Cold Start (No Cache)"
|
|
13
|
+
echo "-----------------------------------"
|
|
14
|
+
rm -f "$CACHE_FILE"
|
|
15
|
+
echo "Cache file removed: $CACHE_FILE"
|
|
16
|
+
echo "Expected: App should load fresh data from API"
|
|
17
|
+
echo "Run: $BINARY tui"
|
|
18
|
+
echo "Press Ctrl+C to exit after verifying data loads"
|
|
19
|
+
echo ""
|
|
20
|
+
read -p "Press Enter to continue..."
|
|
21
|
+
|
|
22
|
+
echo ""
|
|
23
|
+
echo "2️⃣ Testing Cache Creation"
|
|
24
|
+
echo "-----------------------------------"
|
|
25
|
+
if [ ! -f "$CACHE_FILE" ]; then
|
|
26
|
+
echo "❌ Cache file was not created: $CACHE_FILE"
|
|
27
|
+
exit 1
|
|
28
|
+
fi
|
|
29
|
+
echo "✅ Cache file exists: $CACHE_FILE"
|
|
30
|
+
ls -lh "$CACHE_FILE"
|
|
31
|
+
echo "Cache permissions:"
|
|
32
|
+
stat -c "%a %n" "$CACHE_FILE" || stat -f "%A %N" "$CACHE_FILE"
|
|
33
|
+
echo ""
|
|
34
|
+
|
|
35
|
+
echo "3️⃣ Testing Cache Contents"
|
|
36
|
+
echo "-----------------------------------"
|
|
37
|
+
echo "First few lines of cache:"
|
|
38
|
+
head -20 "$CACHE_FILE"
|
|
39
|
+
echo ""
|
|
40
|
+
read -p "Press Enter to continue..."
|
|
41
|
+
|
|
42
|
+
echo ""
|
|
43
|
+
echo "4️⃣ Testing Warm Start (With Valid Cache)"
|
|
44
|
+
echo "-----------------------------------"
|
|
45
|
+
echo "Expected: App should show cached data immediately, then refresh"
|
|
46
|
+
echo "Look for: '📦 Loaded from cache' message in status bar"
|
|
47
|
+
echo "Run: $BINARY tui"
|
|
48
|
+
echo "Press Ctrl+C to exit after verifying cache loads"
|
|
49
|
+
echo ""
|
|
50
|
+
read -p "Press Enter to continue..."
|
|
51
|
+
|
|
52
|
+
echo ""
|
|
53
|
+
echo "5️⃣ Testing Cache Expiration"
|
|
54
|
+
echo "-----------------------------------"
|
|
55
|
+
echo "Modifying cache to be expired (1 hour ago)..."
|
|
56
|
+
|
|
57
|
+
TEMP_CACHE=$(mktemp)
|
|
58
|
+
jq '.expiresAt = (now - 3600 | strftime("%Y-%m-%dT%H:%M:%S.000Z"))' "$CACHE_FILE" > "$TEMP_CACHE"
|
|
59
|
+
mv "$TEMP_CACHE" "$CACHE_FILE"
|
|
60
|
+
|
|
61
|
+
echo "✅ Cache modified to be expired"
|
|
62
|
+
echo "Expected: App should ignore expired cache and load fresh data"
|
|
63
|
+
echo "Run: $BINARY tui"
|
|
64
|
+
echo "Press Ctrl+C to exit after verifying"
|
|
65
|
+
echo ""
|
|
66
|
+
read -p "Press Enter to continue..."
|
|
67
|
+
|
|
68
|
+
echo ""
|
|
69
|
+
echo "6️⃣ Testing Corrupted Cache"
|
|
70
|
+
echo "-----------------------------------"
|
|
71
|
+
echo "Corrupting cache file..."
|
|
72
|
+
echo "CORRUPTED" > "$CACHE_FILE"
|
|
73
|
+
echo "✅ Cache corrupted"
|
|
74
|
+
echo "Expected: App should handle error gracefully and load fresh data"
|
|
75
|
+
echo "Run: $BINARY tui"
|
|
76
|
+
echo "Press Ctrl+C to exit after verifying"
|
|
77
|
+
echo ""
|
|
78
|
+
read -p "Press Enter to continue..."
|
|
79
|
+
|
|
80
|
+
echo ""
|
|
81
|
+
echo "7️⃣ Testing Cache Disabled"
|
|
82
|
+
echo "-----------------------------------"
|
|
83
|
+
rm -f "$CACHE_FILE"
|
|
84
|
+
echo "Cache file removed"
|
|
85
|
+
echo "Expected: App should not create cache file when disabled"
|
|
86
|
+
echo "Run: JIRA_CACHE_ENABLED=false $BINARY tui"
|
|
87
|
+
echo "Press Ctrl+C to exit after verifying"
|
|
88
|
+
echo ""
|
|
89
|
+
read -p "Press Enter to continue..."
|
|
90
|
+
|
|
91
|
+
if [ -f "$CACHE_FILE" ]; then
|
|
92
|
+
echo "❌ Cache file was created despite being disabled!"
|
|
93
|
+
exit 1
|
|
94
|
+
fi
|
|
95
|
+
echo "✅ Cache file was not created (as expected)"
|
|
96
|
+
|
|
97
|
+
echo ""
|
|
98
|
+
echo "✅ All cache tests completed!"
|
|
99
|
+
echo ""
|
|
100
|
+
echo "Manual verification checklist:"
|
|
101
|
+
echo " □ Cold start shows loading spinner"
|
|
102
|
+
echo " □ Warm start shows cached data instantly"
|
|
103
|
+
echo " □ Cache age indicator appears in status bar"
|
|
104
|
+
echo " □ Fresh data replaces cache after background fetch"
|
|
105
|
+
echo " □ Expired cache is ignored"
|
|
106
|
+
echo " □ Corrupted cache is handled gracefully"
|
|
107
|
+
echo " □ Cache can be disabled via config"
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
name: Build and Test
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [ main, develop ]
|
|
6
|
-
pull_request:
|
|
7
|
-
branches: [ main, develop ]
|
|
8
|
-
|
|
9
|
-
jobs:
|
|
10
|
-
build:
|
|
11
|
-
runs-on: ubuntu-latest
|
|
12
|
-
|
|
13
|
-
steps:
|
|
14
|
-
- name: Checkout code
|
|
15
|
-
uses: actions/checkout@v4
|
|
16
|
-
|
|
17
|
-
- name: Set up Go
|
|
18
|
-
uses: actions/setup-go@v5
|
|
19
|
-
with:
|
|
20
|
-
go-version: '1.21'
|
|
21
|
-
cache-dependency-path: go-tui/go.sum
|
|
22
|
-
|
|
23
|
-
- name: Download dependencies
|
|
24
|
-
working-directory: ./go-tui
|
|
25
|
-
run: go mod download
|
|
26
|
-
|
|
27
|
-
- name: Build for Linux
|
|
28
|
-
working-directory: ./go-tui
|
|
29
|
-
run: go build -o bin/jira-report ./cmd/jira-report
|
|
30
|
-
|
|
31
|
-
- name: Verify binary
|
|
32
|
-
working-directory: ./go-tui
|
|
33
|
-
run: ./bin/jira-report --help
|
|
34
|
-
|
|
35
|
-
- name: Build all platforms
|
|
36
|
-
working-directory: ./go-tui
|
|
37
|
-
run: |
|
|
38
|
-
chmod +x build-all.sh
|
|
39
|
-
./build-all.sh
|
|
40
|
-
|
|
41
|
-
- name: Upload artifacts
|
|
42
|
-
uses: actions/upload-artifact@v4
|
|
43
|
-
with:
|
|
44
|
-
name: jira-report-binaries
|
|
45
|
-
path: go-tui/bin/jira-report-*
|
|
46
|
-
retention-days: 7
|
|
47
|
-
|
|
48
|
-
test-npm-package:
|
|
49
|
-
runs-on: ubuntu-latest
|
|
50
|
-
needs: build
|
|
51
|
-
|
|
52
|
-
steps:
|
|
53
|
-
- name: Checkout code
|
|
54
|
-
uses: actions/checkout@v4
|
|
55
|
-
|
|
56
|
-
- name: Set up Go
|
|
57
|
-
uses: actions/setup-go@v5
|
|
58
|
-
with:
|
|
59
|
-
go-version: '1.21'
|
|
60
|
-
cache-dependency-path: go-tui/go.sum
|
|
61
|
-
|
|
62
|
-
- name: Set up Node.js
|
|
63
|
-
uses: actions/setup-node@v4
|
|
64
|
-
with:
|
|
65
|
-
node-version: '18'
|
|
66
|
-
|
|
67
|
-
- name: Build binaries
|
|
68
|
-
working-directory: ./go-tui
|
|
69
|
-
run: |
|
|
70
|
-
chmod +x build-all.sh
|
|
71
|
-
./build-all.sh
|
|
72
|
-
|
|
73
|
-
- name: Test npm package
|
|
74
|
-
working-directory: ./go-tui
|
|
75
|
-
run: |
|
|
76
|
-
npm pack
|
|
77
|
-
mkdir -p /tmp/test-install
|
|
78
|
-
cd /tmp/test-install
|
|
79
|
-
npm install $GITHUB_WORKSPACE/go-tui/jira-report-tui-*.tgz
|
|
80
|
-
npx jira-report --help
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
name: Publish to npm
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
tags:
|
|
6
|
-
- 'v*.*.*'
|
|
7
|
-
workflow_dispatch:
|
|
8
|
-
inputs:
|
|
9
|
-
version:
|
|
10
|
-
description: 'Version to publish (e.g., 1.0.0)'
|
|
11
|
-
required: true
|
|
12
|
-
type: string
|
|
13
|
-
|
|
14
|
-
jobs:
|
|
15
|
-
build-and-publish:
|
|
16
|
-
runs-on: ubuntu-latest
|
|
17
|
-
|
|
18
|
-
steps:
|
|
19
|
-
- name: Checkout code
|
|
20
|
-
uses: actions/checkout@v4
|
|
21
|
-
|
|
22
|
-
- name: Set up Go
|
|
23
|
-
uses: actions/setup-go@v5
|
|
24
|
-
with:
|
|
25
|
-
go-version: '1.21'
|
|
26
|
-
cache-dependency-path: go-tui/go.sum
|
|
27
|
-
|
|
28
|
-
- name: Set up Node.js
|
|
29
|
-
uses: actions/setup-node@v4
|
|
30
|
-
with:
|
|
31
|
-
node-version: '18'
|
|
32
|
-
registry-url: 'https://registry.npmjs.org'
|
|
33
|
-
|
|
34
|
-
- name: Build binaries for all platforms
|
|
35
|
-
working-directory: ./go-tui
|
|
36
|
-
run: |
|
|
37
|
-
chmod +x build-all.sh
|
|
38
|
-
./build-all.sh
|
|
39
|
-
|
|
40
|
-
- name: Update version in package.json
|
|
41
|
-
if: github.event_name == 'workflow_dispatch'
|
|
42
|
-
working-directory: ./go-tui
|
|
43
|
-
run: |
|
|
44
|
-
npm version ${{ github.event.inputs.version }} --no-git-tag-version
|
|
45
|
-
|
|
46
|
-
- name: Extract version from tag
|
|
47
|
-
if: github.event_name == 'push'
|
|
48
|
-
id: extract_version
|
|
49
|
-
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
|
|
50
|
-
|
|
51
|
-
- name: Update version from tag
|
|
52
|
-
if: github.event_name == 'push'
|
|
53
|
-
working-directory: ./go-tui
|
|
54
|
-
run: |
|
|
55
|
-
npm version ${{ steps.extract_version.outputs.VERSION }} --no-git-tag-version
|
|
56
|
-
|
|
57
|
-
- name: Publish to npm
|
|
58
|
-
working-directory: ./go-tui
|
|
59
|
-
run: npm publish --access public
|
|
60
|
-
env:
|
|
61
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
62
|
-
|
|
63
|
-
- name: Create GitHub Release
|
|
64
|
-
if: github.event_name == 'push'
|
|
65
|
-
uses: softprops/action-gh-release@v1
|
|
66
|
-
with:
|
|
67
|
-
generate_release_notes: true
|
|
68
|
-
files: |
|
|
69
|
-
go-tui/bin/jira-report-*
|
|
70
|
-
env:
|
|
71
|
-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|