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
36 changes: 36 additions & 0 deletions .cursor/rules/pr-message-format.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
description: Generate PR messages in markdown format for easy copy-paste to GitHub
globs: *.md,*.mdc
---

# PR Message Generation Rules

When generating PR messages, always follow these formatting guidelines for optimal GitHub compatibility.

## Emoji Guidelines
- 🚀 for new features
- 🔧 for fixes/improvements
- ⚡ for performance optimizations
- 🔐 for security/auth features
- 🧹 for cleanup/maintenance
- 📊 for metrics/analytics
- 🧪 for testing
- 🔄 for breaking changes
- ✅ for completion/readiness

## Content Requirements
- Always include a clear summary
- List specific technical improvements
- Mention file counts and code changes
- Include commit references
- Specify breaking changes or compatibility
- Use bullet points for readability
- Keep language professional but engaging

## GitHub Compatibility
- Use proper markdown headers (##, ###)
- Include horizontal rules (---) for separation
- Use bold text (**text**) for emphasis
- Use code blocks for technical details
- Ensure proper line breaks for readability
- Use checkboxes for status indicators
95 changes: 95 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# pp-dev - Cursor Rules

## Commit Message Guidelines

### Format: `<type>(<scope>): <subject>`
- Use imperative mood ("add" not "added")
- Don't capitalize first letter
- No period at the end
- Keep subject concise (50 chars or less)

### Commit Types (choose one):
- **`feat`** - A new feature (triggers MINOR version bump)
- **`fix`** - A bug fix (triggers PATCH version bump)
- **`docs`** - Documentation only changes (NO version bump)
- **`style`** - Code style changes, formatting, etc (NO version bump)
- **`refactor`** - Code refactoring, no functional changes (NO version bump)
- **`perf`** - Performance improvements (NO version bump)
- **`test`** - Adding or updating tests (NO version bump)
- **`chore`** - Maintenance tasks, dependencies, etc (NO version bump)
- **`ci`** - CI/CD configuration changes (NO version bump)
- **`build`** - Build system or external dependency changes (NO version bump)

### Scopes (optional, but recommended):
- **`api`** - API-related changes
- **`auth`** - Authentication/authorization changes
- **`cli`** - CLI-related changes
- **`ui`** - User interface changes (client toolbar)
- **`build`** - Build system changes
- **`ci`** - CI/CD changes
- **`deps`** - Dependency updates
- **`docs`** - Documentation changes
- **`test`** - Testing changes
- **`utils`** - Utility functions
- **`config`** - Configuration changes
- **`plugin`** - Vite plugin changes
- **`middleware`** - Middleware changes

### Examples:
```bash
feat(api): add new authentication middleware
fix(cli): resolve memory leak in data processing
docs(readme): update installation instructions
style: format code according to prettier rules
refactor(utils): extract common validation functions
perf(build): optimize bundle size
test(e2e): add comprehensive login test suite
chore(deps): update all dependencies to latest versions
ci(github): add semantic-release workflow
build(rollup): optimize bundle configuration
```

### Breaking Changes:
```bash
feat(api): change response format structure

BREAKING CHANGE: API now returns data in different structure.
All existing clients must be updated to handle new format.
```

### Body and Footer Guidelines:
- **Body**: Explain WHAT and WHY, not HOW
- **Breaking Changes**: Start footer with "BREAKING CHANGE: <description>"

### Important Notes:
- Only `feat`, `fix`, and `BREAKING CHANGE` trigger version bumps
- Use scopes to indicate which area is affected
- Be descriptive but concise
- Reference related issues when possible
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification

## General Development Guidelines

### Code Quality:
- Always aim for clean, maintainable architecture
- Focus on areas of the code relevant to the task
- Do not touch code unrelated to the task
- Avoid making major changes to working patterns unless explicitly instructed
- Think about what other methods and areas might be affected by changes

### Semantic Release:
- This project uses semantic-release for automated versioning
- All releases go through Pull Requests (no direct pushes to main)
- Commit messages determine version bumps automatically
- Follow conventional commit format strictly for proper releases

### Project Structure:
- `src/` - Source code
- `src/api/` - MI API integration
- `src/cli.ts` - CLI entry point
- `src/client/` - Browser toolbar client
- `src/lib/` - Core library functions
- `src/plugins/` - Vite plugins
- `bin/` - CLI binary
- `tests/` - E2E tests
- `dist/` - Build output
112 changes: 112 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
# Node modules
node_modules/
*/node_modules/
**/node_modules/

# Build outputs
dist/
build/
.next/
out/

# Logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# nyc test coverage
.nyc_output

# Dependency directories
jspm_packages/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack' (except the one we need for tests)
*.tgz
!metricinsights-pp-dev-latest.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test
.env.local
.env.development.local
.env.test.local
.env.production.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# next.js build output
.next

# nuxt.js build output
.nuxt

# vuepress build output
.vuepress/dist

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# IDE files
.vscode/
.idea/
*.swp
*.swo
*~

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# Git
.git/
.gitignore

# Docker
Dockerfile*
docker-compose*
.dockerignore

# Test results
test-results/
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ jobs:
- name: Run E2E tests
run: npx playwright test
continue-on-error: true

54 changes: 54 additions & 0 deletions .github/workflows/release-beta.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Beta Release

on:
push:
branches: [develop]

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release-beta:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Verify build output
run: |
if [[ ! -d "dist" ]]; then
echo "Build failed: dist directory not found"
exit 1
fi
echo "Build verification passed"

- name: Configure Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
git fetch --all --tags

- name: Release Beta
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release
32 changes: 23 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: Release
name: Production Release

on:
push:
branches: [main, develop]
tags:
- 'v*'

permissions:
contents: write
issues: write
pull-requests: write

jobs:
release:
Expand All @@ -17,7 +16,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -26,6 +24,13 @@ jobs:
registry-url: https://registry.npmjs.org/
cache: 'npm'

- name: Extract version from tag
id: version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Releasing version: $VERSION"

- name: Install dependencies
run: npm ci

Expand All @@ -40,10 +45,19 @@ jobs:
fi
echo "Build verification passed"

- name: Release
- name: Update package version
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version

- name: Publish to npm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
run: npm publish --access public

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: Release ${{ github.ref_name }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading
Loading