Thank you for your interest in contributing! This document covers the JSON Toolbox and other developer utilities.
Be respectful, constructive, and inclusive. We welcome contributors of all skill levels.
- Search existing issues to avoid duplicates
- Use the bug report template
- Include:
- Steps to reproduce
- Expected vs actual behavior
- Browser/Node.js version
- Sample input (if applicable)
- Search existing issues
- Use the feature request template
- Include:
- Use case description
- Proposed solution
- Alternative approaches considered
- Fork the repository
- Create a feature branch:
feature/your-feature-name - Make changes following code style guide
- Test your changes
- Submit a pull request
- PHP 7.4+ (for local development server)
- Node.js 16+ (for CLI development)
- Git
# Clone repository
git clone https://github.com/retea-se/mackan.eu.git
cd mackan.eu
# Start local server
php -S localhost:8000
# Open in browser
open http://localhost:8000/tools/json/cd tools/json/cli
# Run tests
node test/smoke.js
node test/parity.js
# Build bundle
node build/bundle.js- ES2020+ syntax
- No external dependencies in core modules
- Pure functions where possible
- JSDoc comments for public APIs
/**
* Parse CSV string to array of objects.
* @param {string} input - CSV string
* @param {Object} params - Parser options
* @param {boolean} params.header - First row is header
* @returns {Array} Parsed data
*/
function parseCsv(input, params = {}) {
// ...
}- PSR-12 style
- Minimal dependencies
- Security-first (no user data transmitted)
- Designsystem: Scanline + Monospace + Flat Grid. Se
docs/DESIGN_SYSTEM_SCANLINE.mdi huvudrepot. - Tre byggstenar: scanline-textur (CRT-linjer), monospace-etiketter (JetBrains Mono), flat grid (whitespace-separation)
- Accent:
#5ba3d9(en enda farg). Inga border-left-accent-kort. - Design tokens in
:root - BEM-like naming
- Mobile-first responsive
Follow Conventional Commits:
type(scope): description
feat(json-toolbox): add NDJSON support
fix(csv): handle empty rows correctly
docs(cli): update installation instructions
chore(build): update bundle script
Types: feat, fix, docs, style, refactor, test, chore
tools/json/
├── index.php # Main page
├── script.js # Core orchestration
├── style.css # Styles
├── modules/ # Feature modules
│ ├── csv.js
│ ├── format.js
│ └── ...
├── operators/ # Pipeline operators
│ ├── index.js
│ └── ...
├── cli/ # CLI implementation
│ ├── bin/
│ ├── lib/
│ ├── dist/
│ └── test/
└── vendor/ # Self-hosted dependencies
- Create operator in
operators/<namespace>.js - Register in
operators/index.js - Add corresponding CLI operator in
cli/lib/operators/ - Add tests in
cli/test/ - Document in
OPERATORS.md
- Pure function (no side effects)
- Deterministic output
- Defined input/output types
- Parameter schema with defaults
- Error handling
// operators/example.js
export const myOperator = {
name: 'example.myop',
inputType: 'string',
outputType: 'array',
params: {
option: { type: 'boolean', default: false }
},
run(input, params) {
// Transform input
return result;
}
};- Manual testing in Chrome/Firefox
- Check console for errors
- Test both light/dark themes
- Test Swedish/English
cd tools/json/cli
# Smoke tests (all operators)
node test/smoke.js
# Parity tests (browser-CLI match)
node test/parity.js
# Golden tests (expected output)
node test/golden.jsAdd test cases to cli/test/data/ and update test files.
- Branch naming:
feature/,fix/,docs/ - PR title: Follow conventional commits format
- Description: Include context and testing done
- Review: Wait for maintainer review
- Merge: Squash and merge preferred
- Code follows style guide
- Tests pass
- Documentation updated
- No console errors
- Works in both browser and CLI (if applicable)
| Label | Description |
|---|---|
bug |
Something isn't working |
enhancement |
New feature or improvement |
cli |
CLI-specific |
docs |
Documentation |
pipeline |
Pipeline engine |
interop |
Format conversion |
good-first-issue |
Good for newcomers |
Releases are managed by maintainers:
- Update version in files
- Update CHANGELOG
- Create release branch
- PR to main
- Tag release
- Create GitHub release
- Open an issue with
questionlabel - Check existing documentation
- Review closed issues for similar questions
By contributing, you agree that your contributions will be licensed under the MIT License.