Skip to content

Commit 0cb0724

Browse files
committed
Add GitHub Actions workflow for automated release process and technical documentation
1 parent 63fb69d commit 0cb0724

3 files changed

Lines changed: 313 additions & 55 deletions

File tree

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Create Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*' # This will catch both v3.2.1 and v3.2.1-beta.1 format
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Compile
27+
run: npm run compile
28+
29+
- name: Package Extension
30+
run: |
31+
npm install -g @vscode/vsce
32+
vsce package
33+
34+
- name: Get version info
35+
id: get_version
36+
run: |
37+
TAG=${GITHUB_REF#refs/tags/v}
38+
echo "VERSION=${TAG}" >> $GITHUB_OUTPUT
39+
if [[ $TAG == *-beta* ]]; then
40+
echo "TYPE=beta" >> $GITHUB_OUTPUT
41+
else
42+
echo "TYPE=release" >> $GITHUB_OUTPUT
43+
fi
44+
45+
- name: Create Release
46+
uses: softprops/action-gh-release@v1
47+
with:
48+
files: "*.vsix"
49+
draft: false
50+
prerelease: ${{ steps.get_version.outputs.TYPE == 'beta' }}
51+
name: "${{ steps.get_version.outputs.TYPE == 'beta' && 'Beta Release' || 'Release' }} ${{ steps.get_version.outputs.VERSION }}"
52+
body: |
53+
${{ steps.get_version.outputs.TYPE == 'beta' && '🧪 Beta Release' || '🚀 Release' }} ${{ steps.get_version.outputs.VERSION }}
54+
55+
${{ steps.get_version.outputs.TYPE == 'beta' && '⚠️ This is a beta release for testing purposes. Please report any issues.' || '✅ This is a stable release.' }}
56+
57+
For a full list of changes, please see the [CHANGELOG](CHANGELOG.md).
58+
token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 47 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,48 +26,6 @@ Simple Coding Time Tracker is a powerful extension for Visual Studio Code that h
2626
- Save Interval: Customize how often your coding time data is saved (default: 5 seconds)
2727
- Inactivity Timeout: Set how long to wait before stopping the timer when no activity is detected (default: 5 minutes)
2828

29-
## Screenshots
30-
### Coding time summary
31-
The summary page provides a detailed report of your coding activity with interactive charts and visualizations:
32-
- Project distribution chart showing time allocation across projects
33-
- Daily activity timeline with interactive tooltips
34-
- 3-month activity heatmap for long-term pattern analysis
35-
- Theme-aware visualizations that adapt to your VS Code theme
36-
- Advanced search and filtering capabilities
37-
38-
![Coding Summary ](./images/coding_summary.png)
39-
40-
#### Dark theme
41-
![Coding Summary Dark Theme](./images/summry_blck.png)
42-
43-
#### Filtering options
44-
![Filter](./images/filter_summry.png)
45-
46-
#### Status Bar
47-
Status bar resets to zero at midnight each day and hence shows the coding time for the current day.
48-
![Status Bar](./images/statusbar.png)
49-
50-
#### Tooltip
51-
Tooltip shows the total coding time weekly, monthly and all time basis.
52-
![Tooltip](./images/tooltip.png)
53-
54-
#### Automatic Pause/Resume
55-
When the user is inactive for a period of time, the timer automatically pauses and resumes when the user starts typing again coding again.
56-
![Pause/Resume icon](./images/paused_time.png)
57-
58-
It is configurable from the settings. Default value is 5 minutes.
59-
![Settings](./images/settings.png)
60-
61-
62-
### All Command Palette Commands
63-
There are total 3 commands in the command palette available for this extension.
64-
65-
1. SCTT: Show Coding Time Summary
66-
2. SCTT: Reset Coding Timer for Today
67-
3. SCTT: Reset All Coding Timers
68-
69-
![All Command Palette Commands](./images/commands.png)
70-
7129
## Installation
7230

7331
1. Open Visual Studio Code
@@ -79,16 +37,6 @@ There are total 3 commands in the command palette available for this extension.
7937

8038
Once installed, the extension will automatically start tracking your coding time. You can view your current session time in the status bar at the bottom of the VSCode window.
8139

82-
## Feature Details
83-
84-
1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P on macOS)
85-
2. Search for "SCTT: Show Coding Time Summary"
86-
3. Explore your coding statistics through interactive visualizations:
87-
- View project distribution in the Project Summary chart
88-
- Track daily patterns in the Activity Timeline
89-
- Analyze long-term trends in the Activity Heatmap
90-
- All charts automatically adapt to your VS Code theme
91-
9240
### Using Search & Filters
9341

9442
1. In the summary view, locate the search form
@@ -126,6 +74,52 @@ The extension provides the following commands through the Command Palette:
12674
- **Reset All Timers** (`SCTT: Reset All Coding Timers`):
12775
Resets all coding time trackers with a confirmation prompt to prevent unintended resets.
12876

77+
## Screenshots
78+
79+
### Coding time summary
80+
The summary page provides a detailed report of your coding activity with interactive charts and visualizations:
81+
- Project distribution chart showing time allocation across projects
82+
- Daily activity timeline with interactive tooltips
83+
- 3-month activity heatmap for long-term pattern analysis
84+
- Theme-aware visualizations that adapt to your VS Code theme
85+
- Advanced search and filtering capabilities
86+
87+
![Coding Summary](./images/coding_summary.png)
88+
89+
#### Dark theme
90+
![Coding Summary Dark Theme](./images/summry_blck.png)
91+
92+
#### Filtering options
93+
![Filter](./images/filter_summry.png)
94+
95+
#### Status Bar
96+
Status bar resets to zero at midnight each day and hence shows the coding time for the current day.
97+
![Status Bar](./images/statusbar.png)
98+
99+
#### Tooltip
100+
Tooltip shows the total coding time weekly, monthly and all time basis.
101+
![Tooltip](./images/tooltip.png)
102+
103+
#### Automatic Pause/Resume
104+
When the user is inactive for a period of time, the timer automatically pauses and resumes when the user starts typing again coding again.
105+
![Pause/Resume icon](./images/paused_time.png)
106+
107+
It is configurable from the settings. Default value is 5 minutes.
108+
![Settings](./images/settings.png)
109+
110+
### All Command Palette Commands
111+
There are total 3 commands in the command palette available for this extension.
112+
113+
1. SCTT: Show Coding Time Summary
114+
2. SCTT: Reset Coding Timer for Today
115+
3. SCTT: Reset All Coding Timers
116+
117+
![All Command Palette Commands](./images/commands.png)
118+
119+
## Technical Documentation
120+
121+
For technical details about development, release process, and internal architecture, please see [TECHNICAL.md](TECHNICAL.md).
122+
129123
## Changelog
130124

131125
### [0.3.0] - 2025-04-14
@@ -157,9 +151,7 @@ The extension provides the following commands through the Command Palette:
157151
- Detailed summary view
158152
- Data persistence
159153

160-
## Feedback and Contributions
161-
162-
We welcome feedback and contributions! If you encounter any issues or have suggestions for improvements, please open an issue on our GitHub repository.
154+
## Contributing
163155

164156
For developers interested in contributing to the project, please check out our [CONTRIBUTING.md](CONTRIBUTING.md) file for guidelines and instructions.
165157

TECHNICAL.md

Lines changed: 208 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,208 @@
1+
# Technical Documentation
2+
3+
This document contains technical details about the Simple Coding Time Tracker VS Code extension, including development setup, release processes, and internal architecture.
4+
5+
## Development Setup
6+
7+
### Prerequisites
8+
- Node.js 18 or higher
9+
- Visual Studio Code
10+
- Git
11+
12+
### Project Structure
13+
```
14+
vsc-ext-coding-time-tracker/
15+
├── src/ # Source code
16+
│ ├── extension.ts # Main extension file
17+
│ ├── statusBar.ts # Status bar functionality
18+
│ ├── summaryView.ts # Summary view implementation
19+
│ ├── timeTracker.ts # Time tracking logic
20+
│ ├── database.ts # Database operations
21+
│ └── utils.ts # Utility functions
22+
├── scripts/ # Development scripts
23+
│ └── generate-test-data.js # Test data generation
24+
├── .github/workflows/ # GitHub Actions workflows
25+
│ ├── release.yml # Release automation
26+
│ └── publish.yml # Marketplace publishing
27+
└── images/ # Documentation images
28+
```
29+
30+
## Release Process
31+
32+
The extension uses GitHub Actions to automate the release process. There are two types of releases supported:
33+
34+
### Beta Releases
35+
36+
Beta releases are pre-release versions used for testing new features or changes before a stable release.
37+
38+
To create a beta release:
39+
```bash
40+
git tag v<version>-beta.<number>
41+
git push origin v<version>-beta.<number>
42+
```
43+
44+
Example:
45+
```bash
46+
git tag v3.2.1-beta.1
47+
git push origin v3.2.1-beta.1
48+
```
49+
50+
For multiple beta releases of the same version, increment the beta number:
51+
- v3.2.1-beta.1
52+
- v3.2.1-beta.2
53+
- v3.2.1-beta.3
54+
55+
### Production Releases
56+
57+
Production releases are stable versions ready for general use.
58+
59+
To create a production release:
60+
```bash
61+
git tag v<version>
62+
git push origin v<version>
63+
```
64+
65+
Example:
66+
```bash
67+
git tag v3.2.1
68+
git push origin v3.2.1
69+
```
70+
71+
### Automated Actions
72+
73+
When a tag is pushed, the following automated actions are performed:
74+
75+
1. **Build Process**:
76+
- Checks out the code
77+
- Sets up Node.js environment
78+
- Installs dependencies
79+
- Compiles the TypeScript code
80+
- Packages the VS Code extension (.vsix file)
81+
82+
2. **Release Creation**:
83+
- Creates a GitHub release
84+
- Attaches the .vsix package to the release
85+
- Sets appropriate release metadata:
86+
- For beta releases:
87+
- Marked as "pre-release"
88+
- Tagged with "🧪 Beta Release"
89+
- Includes beta warning message
90+
- For production releases:
91+
- Marked as full release
92+
- Tagged with "🚀 Release"
93+
- Includes stable release message
94+
- Links to CHANGELOG.md for detailed changes
95+
96+
3. **Extension Publishing**:
97+
- Automatically publishes the extension to the Visual Studio Code Marketplace
98+
- Updates the extension version and metadata
99+
100+
### Best Practices
101+
102+
- Create beta releases from feature branches when testing new functionality
103+
- Create production releases only from the main branch
104+
- Always update the CHANGELOG.md before creating a new release
105+
- Keep version numbers consistent between beta and production releases
106+
- Follow semantic versioning (MAJOR.MINOR.PATCH)
107+
- Test beta releases thoroughly before creating a production release
108+
109+
### Release Files
110+
111+
The release process is defined in two GitHub Actions workflow files:
112+
113+
1. `.github/workflows/release.yml`: Handles the release creation process
114+
2. `.github/workflows/publish.yml`: Handles publishing to the VS Code Marketplace
115+
116+
## Internal Architecture
117+
118+
### Core Components
119+
120+
1. **Extension Entry Point (`extension.ts`)**
121+
- Activates the extension
122+
- Initializes core components
123+
- Registers VS Code commands
124+
- Handles workspace events
125+
126+
2. **Time Tracker (`timeTracker.ts`)**
127+
- Core time tracking logic
128+
- Activity detection
129+
- Session management
130+
- Project identification
131+
132+
3. **Database (`database.ts`)**
133+
- Data persistence layer
134+
- Time entry storage
135+
- Summary data generation
136+
- Search functionality
137+
138+
4. **Status Bar (`statusBar.ts`)**
139+
- Real-time time display
140+
- Activity status indication
141+
- Quick access to commands
142+
- Tooltip information
143+
144+
5. **Summary View (`summaryView.ts`)**
145+
- Interactive data visualization
146+
- Chart rendering
147+
- Search and filtering
148+
- Data export
149+
150+
6. **Utilities (`utils.ts`)**
151+
- Time formatting
152+
- Data processing
153+
- Helper functions
154+
155+
### Data Flow
156+
157+
1. User activity triggers events in VS Code
158+
2. TimeTracker processes these events and tracks active time
159+
3. Data is periodically saved to the Database
160+
4. StatusBar updates in real-time
161+
5. SummaryView queries the Database for visualization
162+
163+
### Configuration Options
164+
165+
The extension supports several configuration options in `package.json`:
166+
167+
```json
168+
{
169+
"simpleCodingTimeTracker.saveInterval": {
170+
"type": "number",
171+
"default": 5,
172+
"description": "Interval in seconds to save the current coding session"
173+
},
174+
"simpleCodingTimeTracker.inactivityTimeout": {
175+
"type": "number",
176+
"default": 300,
177+
"description": "Time in seconds of inactivity before tracking stops"
178+
}
179+
}
180+
```
181+
182+
## Contributing
183+
184+
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md).
185+
186+
## Testing
187+
188+
### Generate Test Data
189+
190+
The extension includes a script to generate test data for development: [ON PROGRESS]
191+
192+
```bash
193+
npm run generate-test-data
194+
```
195+
196+
This will create sample time entries for the last 90 days with varied projects and durations.
197+
198+
### Manual Testing Checklist
199+
200+
Before submitting a pull request:
201+
202+
1. Verify time tracking starts/stops correctly
203+
2. Check status bar updates
204+
3. Test inactivity detection
205+
4. Validate data persistence
206+
5. Check summary view visualizations
207+
6. Test search and filtering
208+
7. Verify theme compatibility

0 commit comments

Comments
 (0)