Skip to content
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
33 changes: 33 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": ["@typescript-eslint", "react"],
"settings": {
"react": {
"version": "detect"
}
},
"rules": {
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],
"react/prop-types": "off",
"react/display-name": "off"
}
}
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
lint-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Install tfx-cli
run: npm install -g tfx-cli

- name: Run lint
run: bun run lint

- name: Check formatting
run: bun run format:check

- name: Build (verify compilation)
run: bun run package-dev
env:
CI: true
72 changes: 72 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish Extension

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
publish_target:
description: "Publish target"
required: true
default: "dev"
type: choice
options:
- dev
- release

jobs:
build-and-publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Bun
uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Install dependencies
run: bun install

- name: Install tfx-cli
run: npm install -g tfx-cli

- name: Run lint
run: bun run lint

- name: Check formatting
run: bun run format:check

- name: Determine build type
id: build-type
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "type=${{ github.event.inputs.publish_target }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.ref }}" == *"-dev"* ]]; then
echo "type=dev" >> $GITHUB_OUTPUT
else
echo "type=release" >> $GITHUB_OUTPUT
fi

- name: Build development package
if: steps.build-type.outputs.type == 'dev'
run: bun run package-dev

- name: Build release package
if: steps.build-type.outputs.type == 'release'
run: bun run package-release

- name: Publish to Marketplace
run: |
npx tfx-cli extension publish \
--vsix knowall-ai.zaplie-devops*.vsix \
--token ${{ secrets.MARKETPLACE_PAT }}

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: vsix-package
path: "*.vsix"
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules
scripts/*.js
typings
dist
build
test
.baseDir.ts
js
*.vsix
file.tslint
.DS_Store
*.log
8 changes: 8 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"semi": true,
"trailingComma": "es5",
"singleQuote": false,
"printWidth": 100,
"tabWidth": 2,
"useTabs": false
}
80 changes: 80 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Zaplie for DevOps - Claude Code Context

This is an Azure DevOps extension that enables Bitcoin Lightning tipping (zaps) on work items.

## Project Overview

- **Type**: Azure DevOps Extension (VSIX)
- **Framework**: React 18 + TypeScript 5 + Fluent UI v9
- **Build System**: Webpack 5 + Gulp 4
- **Package Manager**: Bun

## Key Commands

```bash
# Install dependencies
bun install

# Build dev package (creates VSIX)
bun run package-dev

# Build release package
bun run package-release

# Lint
bun run lint

# Format
bun run format
```

## Architecture

### Entry Points

- `scripts/zapAction.tsx` - Work item context menu action (Zap dialog)
- `scripts/settings.tsx` - Organization settings hub (Lightning address config)

### Services

- `scripts/services/graphService.ts` - Microsoft Graph API for Lightning address storage
- `scripts/services/lightningService.ts` - LNURL-pay invoice fetching
- `scripts/services/workItemService.ts` - Azure DevOps REST API operations

### Components

- `scripts/components/ZapDialog.tsx` - Main zap dialog
- `scripts/components/AmountSelector.tsx` - Satoshi amount selection
- `scripts/components/QRCodeDisplay.tsx` - Lightning invoice QR code
- `scripts/components/SettingsForm.tsx` - Lightning address settings

## Extension Manifest

The `vss-extension.json` defines two contributions:

1. **zap-work-item-action** - Context menu action on work items
2. **zaplie-settings-hub** - Organization settings page

## Lightning Address Storage

Uses Microsoft Graph user profile extensions:
- Extension name: `zaplie.knowall.ai`
- Shared across all Zaplie apps (ZapDesk, Zaplie for DevOps)

## Testing

1. Build with `bun run package-dev`
2. Upload VSIX to Azure DevOps organization
3. Navigate to a work item with an assignee
4. Click "Zap" from context menu

## CI/CD

- `.github/workflows/ci.yml` - Lint, format, build on push/PR to main
- `.github/workflows/publish.yml` - Publish to marketplace on version tags

## Important Notes

- The VSS SDK uses PromiseLike (not Promise), so use `.then(success, error)` instead of `.catch()`
- Fluent UI v9 `makeStyles` doesn't support nested selectors like `&:hover`
- The extension bundles React 18 (doesn't use host's React 16)
123 changes: 122 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
# zaplie-devops
# Zaplie for DevOps

Azure DevOps extension for Bitcoin Lightning tipping (zaps) on work items.

## Overview

Zaplie enables team members to send Bitcoin Lightning tips to each other directly from Azure DevOps work items. Recognize great work with sats!

## Features

- Zap work item assignees from the context menu
- Preset amounts: 100, 500, 1000, 5000 sats
- Custom amount support
- QR code for Lightning wallet scanning
- Automatic comment posting on zap confirmation
- Settings hub for Lightning address configuration

## Installation

### From Marketplace

Install from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=knowall-ai.zaplie-devops)

### From Source

```bash
# Install dependencies
bun install

# Build development package
bun run package-dev

# Upload VSIX to your organization
```

## Development

### Prerequisites

- Bun (or Node.js 18+)
- tfx-cli (`npm install -g tfx-cli`)

### Commands

```bash
# Install dependencies
bun install

# Build dev package
bun run package-dev

# Build release package
bun run package-release

# Lint
bun run lint

# Format check
bun run format:check

# Format fix
bun run format

# Type check
bun run typecheck
```

### Project Structure

```
zaplie-devops/
β”œβ”€β”€ scripts/
β”‚ β”œβ”€β”€ components/ # React components
β”‚ β”œβ”€β”€ services/ # API services
β”‚ β”œβ”€β”€ types/ # TypeScript types
β”‚ β”œβ”€β”€ utils/ # Utilities
β”‚ β”œβ”€β”€ zapAction.tsx # Zap dialog entry point
β”‚ └── settings.tsx # Settings hub entry point
β”œβ”€β”€ styles/ # SCSS styles
β”œβ”€β”€ img/ # Extension icons
β”œβ”€β”€ docs/ # Documentation
β”œβ”€β”€ vss-extension.json # Extension manifest
└── package.json
```

## Configuration

### User Setup

1. Go to Organization Settings β†’ Zaplie Settings
2. Enter your Lightning address
3. Test and save

### CI/CD

Add `MARKETPLACE_PAT` secret to your GitHub repository for automated publishing.

### Images

**Note:** The `img/logo.png` (128x128) and `img/zap-icon.png` (16x16) are placeholder images. Replace them with actual Lightning bolt graphics before publishing to the marketplace.

## Documentation

- [Solution Design](docs/SOLUTION_DESIGN.adoc)
- [Deployment Guide](docs/DEPLOY.adoc)
- [Troubleshooting](docs/TROUBLESHOOTING.adoc)

## Tech Stack

- React 18
- TypeScript 5
- Fluent UI v9
- Webpack 5
- qrcode.react

## License

MIT

## Author

[Knowall AI](https://knowall.ai)
Loading
Loading