Thank you for your interest in contributing! This guide will help you get started.
- Node.js 18+ (20 LTS recommended)
- npm 9+
- Git
- A code editor (VS Code recommended)
All development scripts work on:
- Windows 10/11
- macOS 12+ (Monterey and later)
- Linux (Ubuntu, Debian, Fedora, etc.)
No PowerShell, Bash, or platform-specific tools required!
-
Fork and clone the repository:
git clone https://github.com/your-username/cybertec-pev-panel.git cd cybertec-pev-panel -
Install dependencies:
npm install
-
Start development server:
npm run dev
-
Run tests:
npm test
# Production build
npm run build
# Development build with watch mode
npm run dev# Interactive test runner
npm test
# CI mode (all tests, no watch)
npm run test:ci# Lint code
npm run lint
# Fix linting issues automatically
npm run lint:fix
# Format code with Prettier
npm run format
# Type check
npm run typecheck# Remove build artifacts
npm run cleancybertec-pev-panel/
├── src/
│ ├── components/ # React components
│ ├── services/ # Business logic
│ ├── types/ # TypeScript types
│ ├── utils/ # Utility functions
│ ├── module.ts # Plugin entry point
│ └── plugin.json # Plugin metadata
├── scripts/
│ ├── build.js # OS-agnostic build script
│ ├── clean.js # OS-agnostic clean script
│ └── package.js # OS-agnostic packaging script
├── tests/ # Test files
├── .github/
│ └── workflows/ # GitHub Actions
└── specs/ # Feature specifications
git checkout -b feature/your-feature-name- Write clean, readable code
- Follow existing code style
- Add tests for new features
- Update documentation
# Run all checks
npm run lint
npm run typecheck
npm run test:ci
npm run buildgit add .
git commit -m "Description of your changes"We use conventional commits:
feat:- New featurefix:- Bug fixdocs:- Documentation changesstyle:- Code style changes (formatting, etc.)refactor:- Code refactoringtest:- Test changeschore:- Build process or auxiliary tool changes
git push origin feature/your-feature-nameThen create a pull request on GitHub.
All build, test, and packaging scripts are written in Node.js instead of shell scripts to ensure they work identically on Windows, macOS, and Linux.
When adding new scripts:
- Use Node.js instead of bash/PowerShell
- Use path.join() for file paths
- Use fs promises for async operations
- Test on multiple platforms if possible
Example:
const path = require('path');
const fs = require('fs');
// ✅ Good - works everywhere
const filePath = path.join(__dirname, 'dist', 'plugin.json');
// ❌ Bad - Unix only
const filePath = __dirname + '/dist/plugin.json';
// ❌ Bad - Windows only
const filePath = __dirname + '\\dist\\plugin.json';GitHub Actions workflows run on Ubuntu Linux. All scripts are guaranteed to work there because they use Node.js.
npm testTests are located in tests/ and use Jest.
npm run e2eEnd-to-end tests use Cypress and Grafana's e2e framework.
-
Start Grafana with Docker:
npm run server
-
Add a PostgreSQL data source
-
Create a panel with EXPLAIN query
-
Select "Postgres Explain Visualizer" visualization
- TypeScript: Strict mode enabled
- ESLint: Grafana's official config
- Prettier: For consistent formatting
- Line length: 120 characters
Run npm run format before committing.
When adding features:
- Update
src/README.md - Add JSDoc comments to functions
- Update type definitions
- Add examples if applicable
Releases are automated via GitHub Actions:
- Update version in
src/plugin.json - Commit:
git commit -am "Release v1.2.0" - Tag:
git tag v1.2.0 - Push:
git push origin main --tags
GitHub Actions will:
- Build the plugin
- Run all tests
- Sign the plugin (if configured)
- Create GitHub Release
- Upload artifacts
- Issues: Check existing issues or create a new one
- Discussions: Ask questions in GitHub Discussions
- Documentation: See
src/README.mdand.github/workflows/README.md
Be respectful and inclusive. We follow the Contributor Covenant.
By contributing, you agree that your contributions will be licensed under the Apache License 2.0.