Skip to content

Commit 8bd833f

Browse files
authored
Merge pull request #1 from mi-examples/pp-2572
PP-2572
2 parents 963362d + 7a3bb34 commit 8bd833f

39 files changed

Lines changed: 4139 additions & 634 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description: Generate PR messages in markdown format for easy copy-paste to GitHub
3+
globs: *.md,*.mdc
4+
---
5+
6+
# PR Message Generation Rules
7+
8+
When generating PR messages, always follow these formatting guidelines for optimal GitHub compatibility.
9+
10+
## Emoji Guidelines
11+
- 🚀 for new features
12+
- 🔧 for fixes/improvements
13+
- ⚡ for performance optimizations
14+
- 🔐 for security/auth features
15+
- 🧹 for cleanup/maintenance
16+
- 📊 for metrics/analytics
17+
- 🧪 for testing
18+
- 🔄 for breaking changes
19+
- ✅ for completion/readiness
20+
21+
## Content Requirements
22+
- Always include a clear summary
23+
- List specific technical improvements
24+
- Mention file counts and code changes
25+
- Include commit references
26+
- Specify breaking changes or compatibility
27+
- Use bullet points for readability
28+
- Keep language professional but engaging
29+
30+
## GitHub Compatibility
31+
- Use proper markdown headers (##, ###)
32+
- Include horizontal rules (---) for separation
33+
- Use bold text (**text**) for emphasis
34+
- Use code blocks for technical details
35+
- Ensure proper line breaks for readability
36+
- Use checkboxes for status indicators

.cursorrules

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# pp-dev - Cursor Rules
2+
3+
## Commit Message Guidelines
4+
5+
### Format: `<type>(<scope>): <subject>`
6+
- Use imperative mood ("add" not "added")
7+
- Don't capitalize first letter
8+
- No period at the end
9+
- Keep subject concise (50 chars or less)
10+
11+
### Commit Types (choose one):
12+
- **`feat`** - A new feature (triggers MINOR version bump)
13+
- **`fix`** - A bug fix (triggers PATCH version bump)
14+
- **`docs`** - Documentation only changes (NO version bump)
15+
- **`style`** - Code style changes, formatting, etc (NO version bump)
16+
- **`refactor`** - Code refactoring, no functional changes (NO version bump)
17+
- **`perf`** - Performance improvements (NO version bump)
18+
- **`test`** - Adding or updating tests (NO version bump)
19+
- **`chore`** - Maintenance tasks, dependencies, etc (NO version bump)
20+
- **`ci`** - CI/CD configuration changes (NO version bump)
21+
- **`build`** - Build system or external dependency changes (NO version bump)
22+
23+
### Scopes (optional, but recommended):
24+
- **`api`** - API-related changes
25+
- **`auth`** - Authentication/authorization changes
26+
- **`cli`** - CLI-related changes
27+
- **`ui`** - User interface changes (client toolbar)
28+
- **`build`** - Build system changes
29+
- **`ci`** - CI/CD changes
30+
- **`deps`** - Dependency updates
31+
- **`docs`** - Documentation changes
32+
- **`test`** - Testing changes
33+
- **`utils`** - Utility functions
34+
- **`config`** - Configuration changes
35+
- **`plugin`** - Vite plugin changes
36+
- **`middleware`** - Middleware changes
37+
38+
### Examples:
39+
```bash
40+
feat(api): add new authentication middleware
41+
fix(cli): resolve memory leak in data processing
42+
docs(readme): update installation instructions
43+
style: format code according to prettier rules
44+
refactor(utils): extract common validation functions
45+
perf(build): optimize bundle size
46+
test(e2e): add comprehensive login test suite
47+
chore(deps): update all dependencies to latest versions
48+
ci(github): add semantic-release workflow
49+
build(rollup): optimize bundle configuration
50+
```
51+
52+
### Breaking Changes:
53+
```bash
54+
feat(api): change response format structure
55+
56+
BREAKING CHANGE: API now returns data in different structure.
57+
All existing clients must be updated to handle new format.
58+
```
59+
60+
### Body and Footer Guidelines:
61+
- **Body**: Explain WHAT and WHY, not HOW
62+
- **Breaking Changes**: Start footer with "BREAKING CHANGE: <description>"
63+
64+
### Important Notes:
65+
- Only `feat`, `fix`, and `BREAKING CHANGE` trigger version bumps
66+
- Use scopes to indicate which area is affected
67+
- Be descriptive but concise
68+
- Reference related issues when possible
69+
- Follow the [Conventional Commits](https://www.conventionalcommits.org/) specification
70+
71+
## General Development Guidelines
72+
73+
### Code Quality:
74+
- Always aim for clean, maintainable architecture
75+
- Focus on areas of the code relevant to the task
76+
- Do not touch code unrelated to the task
77+
- Avoid making major changes to working patterns unless explicitly instructed
78+
- Think about what other methods and areas might be affected by changes
79+
80+
### Semantic Release:
81+
- This project uses semantic-release for automated versioning
82+
- All releases go through Pull Requests (no direct pushes to main)
83+
- Commit messages determine version bumps automatically
84+
- Follow conventional commit format strictly for proper releases
85+
86+
### Project Structure:
87+
- `src/` - Source code
88+
- `src/api/` - MI API integration
89+
- `src/cli.ts` - CLI entry point
90+
- `src/client/` - Browser toolbar client
91+
- `src/lib/` - Core library functions
92+
- `src/plugins/` - Vite plugins
93+
- `bin/` - CLI binary
94+
- `tests/` - E2E tests
95+
- `dist/` - Build output

.dockerignore

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Node modules
2+
node_modules/
3+
*/node_modules/
4+
**/node_modules/
5+
6+
# Build outputs
7+
dist/
8+
build/
9+
.next/
10+
out/
11+
12+
# Logs
13+
*.log
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
18+
# Runtime data
19+
pids
20+
*.pid
21+
*.seed
22+
*.pid.lock
23+
24+
# Coverage directory used by tools like istanbul
25+
coverage/
26+
*.lcov
27+
28+
# nyc test coverage
29+
.nyc_output
30+
31+
# Dependency directories
32+
jspm_packages/
33+
34+
# Optional npm cache directory
35+
.npm
36+
37+
# Optional eslint cache
38+
.eslintcache
39+
40+
# Optional REPL history
41+
.node_repl_history
42+
43+
# Output of 'npm pack' (except the one we need for tests)
44+
*.tgz
45+
!metricinsights-pp-dev-latest.tgz
46+
47+
# Yarn Integrity file
48+
.yarn-integrity
49+
50+
# dotenv environment variables file
51+
.env
52+
.env.test
53+
.env.local
54+
.env.development.local
55+
.env.test.local
56+
.env.production.local
57+
58+
# parcel-bundler cache (https://parceljs.org/)
59+
.cache
60+
.parcel-cache
61+
62+
# next.js build output
63+
.next
64+
65+
# nuxt.js build output
66+
.nuxt
67+
68+
# vuepress build output
69+
.vuepress/dist
70+
71+
# Serverless directories
72+
.serverless/
73+
74+
# FuseBox cache
75+
.fusebox/
76+
77+
# DynamoDB Local files
78+
.dynamodb/
79+
80+
# TernJS port file
81+
.tern-port
82+
83+
# Stores VSCode versions used for testing VSCode extensions
84+
.vscode-test
85+
86+
# IDE files
87+
.vscode/
88+
.idea/
89+
*.swp
90+
*.swo
91+
*~
92+
93+
# OS generated files
94+
.DS_Store
95+
.DS_Store?
96+
._*
97+
.Spotlight-V100
98+
.Trashes
99+
ehthumbs.db
100+
Thumbs.db
101+
102+
# Git
103+
.git/
104+
.gitignore
105+
106+
# Docker
107+
Dockerfile*
108+
docker-compose*
109+
.dockerignore
110+
111+
# Test results
112+
test-results/

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,4 +58,3 @@ jobs:
5858
- name: Run E2E tests
5959
run: npx playwright test
6060
continue-on-error: true
61-

.github/workflows/release-beta.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Beta Release
2+
3+
on:
4+
push:
5+
branches: [develop]
6+
7+
permissions:
8+
contents: write
9+
issues: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-beta:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
persist-credentials: false
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 22
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build
32+
run: npm run build
33+
34+
- name: Verify build output
35+
run: |
36+
if [[ ! -d "dist" ]]; then
37+
echo "Build failed: dist directory not found"
38+
exit 1
39+
fi
40+
echo "Build verification passed"
41+
42+
- name: Configure Git
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
run: |
46+
git config user.name "github-actions[bot]"
47+
git config user.email "github-actions[bot]@users.noreply.github.com"
48+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
49+
git fetch --all --tags
50+
51+
- name: Release Beta
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54+
run: npx semantic-release

.github/workflows/release.yml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
1-
name: Release
1+
name: Production Release
22

33
on:
44
push:
5-
branches: [main, develop]
5+
tags:
6+
- 'v*'
67

78
permissions:
89
contents: write
9-
issues: write
10-
pull-requests: write
1110

1211
jobs:
1312
release:
@@ -17,7 +16,6 @@ jobs:
1716
uses: actions/checkout@v4
1817
with:
1918
fetch-depth: 0
20-
persist-credentials: false
2119

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

27+
- name: Extract version from tag
28+
id: version
29+
run: |
30+
VERSION=${GITHUB_REF_NAME#v}
31+
echo "version=$VERSION" >> $GITHUB_OUTPUT
32+
echo "Releasing version: $VERSION"
33+
2934
- name: Install dependencies
3035
run: npm ci
3136

@@ -40,10 +45,19 @@ jobs:
4045
fi
4146
echo "Build verification passed"
4247
43-
- name: Release
48+
- name: Update package version
49+
run: npm version ${{ steps.version.outputs.version }} --no-git-tag-version
50+
51+
- name: Publish to npm
4452
env:
45-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4753
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
48-
run: npx semantic-release
54+
run: npm publish --access public
4955

56+
- name: Create GitHub Release
57+
uses: softprops/action-gh-release@v1
58+
with:
59+
tag_name: ${{ github.ref_name }}
60+
name: Release ${{ github.ref_name }}
61+
generate_release_notes: true
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)