Skip to content

Commit 6623b28

Browse files
committed
chore: add conventional commits, update workflows, clean up code
- Add commitlint with husky for conventional commit enforcement - Add commit-lint GitHub workflow for PR validation - Update publish.yml to latest version (v6 artifact action, Bluesky notify) - Add CLAUDE.md project documentation - Remove commented legacy Couchbase SDK 2.x code from UI files - Rename window caption from "Couchbase Studio" to "Couchbase Explorer" - Add CLAUDE.local.md to .gitignore
1 parent 64af585 commit 6623b28

File tree

11 files changed

+267
-82
lines changed

11 files changed

+267
-82
lines changed

.claude/settings.local.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"permissions": {
3+
"allow": [
4+
"Bash(cat:*)",
5+
"Bash(gh label:*)",
6+
"Bash(gh issue create:*)",
7+
"Bash(gh issue list:*)"
8+
]
9+
}
10+
}

.commitlintrc.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Commitlint configuration for conventional commits
2+
# Based on: https://www.conventionalcommits.org/
3+
4+
extends:
5+
- '@commitlint/config-conventional'
6+
7+
rules:
8+
# Type enum - allowed commit types
9+
type-enum:
10+
- 2 # Level: error
11+
- always
12+
- # Allowed types:
13+
- feat # New feature
14+
- fix # Bug fix
15+
- docs # Documentation only changes
16+
- style # Code style changes (formatting, missing semi-colons, etc)
17+
- refactor # Code refactoring (neither fixes a bug nor adds a feature)
18+
- perf # Performance improvements
19+
- test # Adding or updating tests
20+
- build # Changes to build system or dependencies
21+
- ci # CI/CD configuration changes
22+
- chore # Other changes that don't modify src or test files
23+
- revert # Revert a previous commit
24+
25+
# Type case should be lowercase
26+
type-case:
27+
- 2
28+
- always
29+
- lower-case
30+
31+
# Type must not be empty
32+
type-empty:
33+
- 2
34+
- never
35+
36+
# Scope case should be lowercase
37+
scope-case:
38+
- 2
39+
- always
40+
- lower-case
41+
42+
# Subject must not be empty
43+
subject-empty:
44+
- 2
45+
- never
46+
47+
# Subject must not end with a period
48+
subject-full-stop:
49+
- 2
50+
- never
51+
- '.'
52+
53+
# Disable subject-case to allow uppercase abbreviations (PR, API, CLI, etc.)
54+
subject-case:
55+
- 0
56+
57+
# Header (first line) max length
58+
header-max-length:
59+
- 2
60+
- always
61+
- 72
62+
63+
# Body should have a blank line before it
64+
body-leading-blank:
65+
- 1 # Warning level
66+
- always
67+
68+
# Footer should have a blank line before it
69+
footer-leading-blank:
70+
- 1 # Warning level
71+
- always
72+
73+
# Body max line length
74+
body-max-line-length:
75+
- 1 # Warning level
76+
- always
77+
- 100
78+
79+
# Help URL shown in error messages
80+
helpUrl: 'https://www.conventionalcommits.org/'

.github/workflows/commit-lint.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Lint Commit Messages
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited, reopened, synchronize]
6+
7+
permissions:
8+
contents: read
9+
pull-requests: read
10+
11+
jobs:
12+
lint-pr-title:
13+
name: Lint PR Title
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: '20'
23+
24+
- name: Install commitlint
25+
run: |
26+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
27+
28+
- name: Validate PR title
29+
env:
30+
PR_TITLE: ${{ github.event.pull_request.title }}
31+
run: |
32+
echo "Validating PR title: $PR_TITLE"
33+
echo "$PR_TITLE" | npx commitlint --verbose
34+
35+
commitlint:
36+
name: Lint Commit Messages
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout code
40+
uses: actions/checkout@v4
41+
with:
42+
fetch-depth: 0 # Fetch all history for all branches and tags
43+
44+
- name: Setup Node.js
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: '20'
48+
49+
- name: Install commitlint
50+
run: |
51+
npm install --save-dev @commitlint/[email protected] @commitlint/[email protected]
52+
53+
- name: Validate PR commits
54+
run: |
55+
# Get the base branch (usually main)
56+
BASE_SHA=$(git merge-base origin/${{ github.base_ref }} HEAD)
57+
58+
# Lint all commits in the PR
59+
npx commitlint --from $BASE_SHA --to HEAD --verbose

.github/workflows/publish.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,41 @@ name: Publish to VS Marketplace
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: write
8+
actions: read
9+
610
jobs:
711
publish:
812
runs-on: windows-latest
13+
outputs:
14+
version: ${{ steps.artifact_manifest.outputs.version }}
915
steps:
1016
- name: Checkout
1117
uses: actions/checkout@v4
12-
18+
1319
- name: 1. Download artifact
1420
id: download-artifact
15-
uses: dawidd6/action-download-artifact@v2
21+
uses: dawidd6/action-download-artifact@v6
1622
with:
17-
github_token: ${{ secrets.GH_SECRET }}
1823
workflow: release_build_and_deploy.yml
1924
workflow_conclusion: success
20-
25+
2126
- name: 2. Parse Artifact Manifest
2227
id: artifact_manifest
2328
uses: ActionsTools/read-json-action@main
2429
with:
2530
file_path: ./artifact/CodingWithCalvin.CouchbaseExplorer.info
26-
31+
2732
- name: 3. Create Tag & Release
2833
uses: ncipollo/[email protected]
2934
with:
3035
artifacts: ./artifact/CodingWithCalvin.CouchbaseExplorer.vsix
3136
generateReleaseNotes: true
3237
makeLatest: true
33-
token: ${{ secrets.GH_SECRET }}
3438
commit: ${{ steps.artifact_manifest.outputs.sha }}
3539
tag: ${{ steps.artifact_manifest.outputs.version }}
36-
40+
3741
- name: 4. Publish Release to Marketplace
3842
if: success()
3943
uses: CodingWithCalvin/GHA-VSMarketplacePublisher@v1
@@ -42,4 +46,16 @@ jobs:
4246
publish-manifest-path: ./resources/extension.manifest.json
4347
vsix-path: ./artifact/CodingWithCalvin.CouchbaseExplorer.vsix
4448

49+
notify:
50+
needs: publish
51+
uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main
52+
with:
53+
post_text: |
54+
🚀 Couchbase Explorer v${{ needs.publish.outputs.version }} for #VisualStudio has been released!
55+
56+
[Check out the release notes here!](https://github.com/${{ github.repository }}/releases/tag/${{ needs.publish.outputs.version }})
4557
58+
Marketplace: https://marketplace.visualstudio.com/items?itemName=CodingWithCalvin.VS-CouchbaseExplorer
59+
secrets:
60+
BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }}
61+
BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,3 +286,6 @@ __pycache__/
286286
*.btm.cs
287287
*.odx.cs
288288
*.xsd.cs
289+
290+
# Claude Code local settings
291+
CLAUDE.local.md

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no -- commitlint --edit $1

CLAUDE.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Critical Rules
6+
7+
**These rules override all other instructions:**
8+
9+
1. **NEVER commit directly to main** - Always create a feature branch and submit a pull request
10+
2. **Conventional commits** - Format: `type(scope): description`
11+
3. **GitHub Issues for TODOs** - Use `gh` CLI to manage issues, no local TODO files. Use conventional commit format for issue titles
12+
4. **Pull Requests** - Use the conventional commit format for PR titles as you do for commits
13+
5. **Working an issue** - When working an issue, always create a new branch from an updated main branch
14+
6. **Branch Names** - Use the conventional commit `type` as the first prefix, and `scope` as the second, then a short description: `feat/ui/connection-dialog`
15+
7. **Check branch status before pushing** - Verify the remote tracking branch still exists before pushing. If a PR was merged/deleted, create a new branch from main instead
16+
8. **WPF for all UI** - All UI must be implemented using WPF (XAML/C#). No web-based technologies (HTML, JavaScript, WebView)
17+
18+
---
19+
20+
## Project Overview
21+
22+
VS-CouchbaseExplorer is a Visual Studio 2022 extension for browsing and querying Couchbase Server and Capella databases. The extension is currently in preview/beta status.
23+
24+
## Build Commands
25+
26+
```bash
27+
# Restore NuGet packages
28+
nuget restore src/CodingWithCalvin.CouchbaseExplorer.sln
29+
30+
# Build (Release, x64)
31+
msbuild src/CodingWithCalvin.CouchbaseExplorer/CodingWithCalvin.CouchbaseExplorer.csproj /p:configuration=Release /p:platform=x64 /p:DeployExtension=False
32+
```
33+
34+
The `/p:DeployExtension=False` flag prevents auto-deployment during CI builds. Remove it for local development to auto-deploy to the VS experimental instance.
35+
36+
## Architecture
37+
38+
### VS Extension Pattern
39+
40+
The extension follows the standard Visual Studio SDK pattern:
41+
42+
1. **CouchbaseExplorerPackage** (AsyncPackage) - Entry point that registers with VS and initializes the extension
43+
2. **CouchbaseExplorerWindowCommand** - Command handler that responds to menu clicks and shows the tool window
44+
3. **CouchbaseExplorerWindow** (ToolWindowPane) - Dockable tool window container
45+
4. **CouchbaseExplorerWindowControl** (WPF UserControl) - XAML-based UI with TreeView for server/bucket hierarchy
46+
47+
### Key Files
48+
49+
- `VSCommandTable.vsct` - Defines menu commands, groups, and placement in VS menus
50+
- `source.extension.vsixmanifest` - VSIX package metadata (version, dependencies, assets)
51+
- `CouchbaseExplorerPackage.cs` - Package initialization and service registration
52+
53+
### Data Layer
54+
55+
Uses **CouchbaseNetClient 3.5.2** for cluster connections, authentication, and N1QL queries.
56+
57+
## Technology Stack
58+
59+
- .NET Framework 4.8
60+
- Visual Studio SDK 17.9 (VS 2022)
61+
- WPF for UI
62+
- MSBuild + NuGet for builds
63+
- VSIX packaging format
64+
65+
## CI/CD
66+
67+
GitHub Actions workflows in `.github/workflows/`:
68+
- `release_build_and_deploy.yml` - Builds on PR and main branch push, creates VSIX artifact
69+
- `publish.yml` - Manual trigger to publish to VS Marketplace
70+
71+
## Development Prerequisites
72+
73+
- Visual Studio 2022 with "Visual Studio extension development" workload
74+
- Extensibility Essentials 2022 extension (for template support)
75+
- A Couchbase Server or Capella instance for testing

package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "vs-couchbaseexplorer",
3+
"version": "0.0.0",
4+
"private": true,
5+
"description": "Development dependencies for VS-CouchbaseExplorer - conventional commits tooling",
6+
"scripts": {
7+
"prepare": "husky"
8+
},
9+
"devDependencies": {
10+
"@commitlint/cli": "^19.0.0",
11+
"@commitlint/config-conventional": "^19.0.0",
12+
"husky": "^9.0.0"
13+
}
14+
}

src/CodingWithCalvin.CouchbaseExplorer/CouchbaseExplorerWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ public class CouchbaseExplorerWindow : ToolWindowPane
99
public CouchbaseExplorerWindow()
1010
: base(null)
1111
{
12-
this.Caption = "Couchbase Studio";
12+
this.Caption = "Couchbase Explorer";
1313
this.Content = new CouchbaseExplorerWindowControl();
1414
}
1515
}

src/CodingWithCalvin.CouchbaseExplorer/CouchbaseExplorerWindowControl.xaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,7 @@
1313
<StackPanel Orientation="Vertical">
1414
<TextBlock Margin="10" HorizontalAlignment="Center">Couchbase Explorer</TextBlock>
1515
<TreeView x:Name="ServersTreeView" Height="240">
16-
17-
<TreeView.ContextMenu>
18-
<ContextMenu Name="ContextMenu">
19-
<!--<MenuItem Name="QueryAll" Header="Query All" Click="QueryAll_OnClick"></MenuItem>-->
20-
</ContextMenu>
21-
</TreeView.ContextMenu>
22-
23-
</TreeView>
24-
<StackPanel Orientation="Horizontal">
25-
<!--<Button Content="Click me!" Click="button1_Click" Height="28" x:Name="button1" />-->
26-
<!--<Button Content="Add Localhost" Click="addServerButton_Click" Height="28" x:Name="addServerButton" />-->
27-
</StackPanel>
16+
</TreeView>
2817
</StackPanel>
2918
</Grid>
3019
</UserControl>

0 commit comments

Comments
 (0)