Thank you for your interest in contributing to YASGUI! We welcome contributions from the community to make YASGUI better for everyone.
This document provides guidelines for contributing to YASGUI, including information about our development process, coding standards, and particularly important information about plugin development.
- Code of Conduct
- Getting Started
- Plugin Development Policy
- Development Workflow
- Code Guidelines
- Testing
- Pull Requests
- Reporting Issues
- Community
We are committed to providing a welcoming and inclusive environment. Please be respectful and constructive in all interactions.
- Node.js: v20 LTS or higher
- npm: v10 or higher
- Git: For version control
-
Fork the Repository
Click the "Fork" button on the YASGUI GitHub repository to create your own fork.
-
Clone Your Fork
git clone https://github.com/YOUR-USERNAME/Yasgui.git cd Yasgui -
Install Dependencies
PUPPETEER_SKIP_DOWNLOAD=1 npm ci
Note: We use
PUPPETEER_SKIP_DOWNLOAD=1to skip downloading Chromium during installation. -
Build the Project
npm run build
This compiles TypeScript and bundles all packages. Build time is typically ~5 seconds.
-
Start the Development Server
npm run dev
Visit
http://localhost:4000to see YASGUI in action with hot module reloading.
IMPORTANT: This section describes our policy for plugin contributions.
YASGUI follows a strict plugin development policy to maintain a clean, maintainable codebase:
New plugins should be created in their own separate repositories. This policy ensures:
- Clean codebase: The core YASGUI repository stays focused on core functionality
- Separation of concerns: Each plugin manages its own lifecycle, tests, dependencies, and releases
- Independent versioning: Plugins can be versioned and released independently
- Easier maintenance: Plugin maintainers have full control over their code
- Better modularity: Users can choose which plugins to install
The following core plugins remain in the repository and should not be modified unless fixing bugs or making necessary improvements:
packages/yasr/src/plugins/boolean/- ASK query results (true/false)packages/yasr/src/plugins/error/- Error message displaypackages/yasr/src/plugins/response/- Raw response viewer
These are essential plugins that are tightly integrated with the core YASR functionality.
Our ecosystem already includes successful external plugins that serve as excellent examples:
- @matdata/yasgui-table-plugin - Table visualization
- @matdata/yasgui-graph-plugin - Graph/network visualization
- yasgui-geo-tg - Geographic data on maps
If you want to create a new plugin:
- Create a separate repository (e.g.,
yasr-my-custom-plugin) - Follow the plugin interface documented in our Developer Guide - Plugin Development
- Manage your own:
- Dependencies
- Tests
- Documentation
- Releases
- Issues
- Publish to npm for easy installation by users
- Share with the community by mentioning it in GitHub Discussions
All plugins must implement the following requirements:
π Help Reference & Download Functionality
helpReference: Provide a URL to documentation/help page for your plugindownload(): Implement download functionality to allow users to export results in appropriate formats
π Responsive Design
- Utilize 100% of available width and height of the parent element
- Define minimum usable dimensions when applicable (e.g., minimum width/height for proper visualization)
- Respond to layout changes: Support both vertical and horizontal orientations when the layout changes
- Handle resize events: Redraw or adjust visualization when container size changes
π¨ Theme Support
- Implement both dark and light mode support
- Use CSS custom properties for colors (e.g.,
--yasgui-bg-primary,--yasgui-text-primary) - Watch for theme changes using
MutationObserverondocument.documentElement - Smooth transitions between themes for better user experience
For detailed plugin development instructions and code examples, see the Developer Guide - Plugin Development section.
-
Create a feature branch from
main:git checkout -b feature/my-feature # or git checkout -b fix/my-bugfix -
Make your changes following our Code Guidelines
-
Test your changes:
# Build first (required before testing) npm run build # Run all tests npm test # Or run specific test types npm run unit-test # Unit tests only (works without Chrome) npm run puppeteer-test # E2E tests (requires Chrome)
-
Lint and format your code:
npm run util:lint # ESLint check npm run util:validateTs # TypeScript type checking npm run util:prettify # Auto-format with Prettier
Note: Pre-commit hooks will automatically format staged files.
-
Commit your changes using Conventional Commits:
git commit -m "feat: add new feature" git commit -m "fix: resolve issue with query execution" git commit -m "docs: update API documentation"
Commit types:
feat,fix,docs,style,refactor,test,chore -
Push to your fork:
git push origin feature/my-feature
-
Create a Pull Request on GitHub
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Define proper types - avoid
anywhen possible - Export types that are part of the public API
- Document complex types with JSDoc comments
- 2 spaces for indentation (enforced by Prettier)
- Semicolons are required
- Single quotes for strings
- Trailing commas in multi-line objects/arrays
- ESLint rules must pass (run
npm run util:lint)
- Use CSS custom properties for theming
- Support both light and dark themes
- Follow BEM naming when appropriate
- Keep specificity low - avoid deeply nested selectors
- Use existing CSS variables:
--yasgui-bg-primary,--yasgui-bg-secondary,--yasgui-bg-tertiary--yasgui-text-primary,--yasgui-text-secondary--yasgui-accent-color,--yasgui-border-color
Example:
.my-component {
background: var(--yasgui-bg-primary);
color: var(--yasgui-text-primary);
border: 1px solid var(--yasgui-border-color);
transition: background-color 0.3s ease, color 0.3s ease;
}- Update documentation when changing behavior
- Add JSDoc comments for public APIs
- Include examples for complex features
- Update README if adding major features
Always build before running tests - tests require compiled output:
npm run build
npm test-
Unit Tests: Test individual functions and components
npm run unit-test
-
E2E Tests: Test the full application (requires Chrome)
npm run puppeteer-test
- Test files should end with
-test.tsor.test.ts - Use Mocha and Chai (existing test framework)
- Follow existing test patterns in the
test/directory - Test both success and error cases
- Keep tests focused - one concept per test
Example test structure:
import { expect } from 'chai';
import MyClass from '../src/MyClass';
describe('MyClass', () => {
it('should do something correctly', () => {
const instance = new MyClass();
const result = instance.doSomething();
expect(result).to.equal('expected value');
});
});- β
Build succeeds:
npm run build - β
All tests pass:
npm test - β
Linting passes:
npm run util:lint - β
Type checking passes:
npm run util:validateTs - β
Code is formatted:
npm run util:prettify(or rely on pre-commit hooks) - β Documentation updated (if applicable)
- β Commits follow conventional format
Include in your pull request:
- Description of what the PR does
- Issue reference (if applicable): "Fixes #123" or "Closes #456"
- Testing performed - how you verified the changes
- Screenshots (if UI changes)
- Breaking changes (if any)
- Automated checks run on all PRs (GitHub Actions)
- Code review by maintainers
- Feedback addressed through additional commits
- Approval and merge by maintainers
- Keep PRs focused - one feature or fix per PR
- Small is better - easier to review and merge
- Respond to feedback promptly and constructively
- Rebase if needed to keep history clean (if requested)
When reporting a bug, include:
- Environment: Browser version, OS, Node.js version (if relevant)
- Steps to reproduce: Detailed steps to trigger the bug
- Expected behavior: What you expected to happen
- Actual behavior: What actually happened
- Console errors: Any error messages from browser console
- Sample query: A minimal SPARQL query that demonstrates the issue
Use the GitHub issue template if available.
When requesting a feature:
- Use case: Explain why this feature is needed
- Proposed solution: Describe how you envision it working
- Alternatives: Mention any alternative approaches you've considered
- Willingness to implement: Let us know if you're willing to work on it
- π User Guide - Comprehensive usage documentation
- π οΈ Developer Guide - API reference and integration guide
- π¬ GitHub Discussions - Ask questions and share ideas
- π Issue Tracker - Report bugs or request features
- Be respectful and considerate
- Search existing issues/discussions before posting
- Provide context and details
- Stay on topic
- Help others when you can
For reference, here's the repository structure:
Yasgui/
βββ packages/ # Monorepo packages (source code)
β βββ yasgui/ # Main package - integrates yasqe + yasr
β βββ yasqe/ # Query editor (CodeMirror-based)
β βββ yasr/ # Results viewer with plugin system
β β βββ src/plugins/ # β οΈ CORE PLUGINS ONLY - Keep as-is
β βββ utils/ # Shared utilities
βββ build/ # Build output (gitignored)
βββ dev/ # Development HTML pages for testing
βββ test/ # Test files
βββ docs/ # Markdown documentation
βββ .github/workflows/ # CI/CD pipelines
βββ CONTRIBUTING.md # This file
- Developer Guide - Complete API reference
- User Guide - End-user documentation
- Release Process - How releases are managed
If you have questions about contributing, please:
- Check the Developer Guide
- Search GitHub Discussions
- Open a new discussion if your question isn't answered
Thank you for contributing to YASGUI! π