Skip to content

Latest commit

 

History

History
140 lines (96 loc) · 3.72 KB

File metadata and controls

140 lines (96 loc) · 3.72 KB

Contributing to Frappe Theme

Thank you for your interest in contributing! This document explains how to get started, what standards we follow, and how to get your changes merged.


Table of Contents


Code of Conduct

This project follows the Contributor Covenant Code of Conduct. By participating you agree to uphold it. Report unacceptable behaviour to devlprnitish@gmail.com.


How to Contribute

Reporting bugs

  1. Search existing issues first.
  2. If none matches, open a Bug Report using the issue template.
  3. Include: Frappe version, Python version, steps to reproduce, expected vs actual behaviour, and a screenshot if relevant.

Suggesting features

Open a Feature Request issue. Describe the problem you want solved and your proposed solution. Discuss before opening a PR for large changes.

Submitting code

  • Bug fixes and documentation improvements: open a PR directly.
  • New features: open an issue first and wait for maintainer feedback.

Development Setup

# 1. Fork & clone inside your bench
cd /path/to/bench
git clone https://github.com/<your-fork>/frappe-theme apps/frappe_theme

# 2. Install the app
bench --site <dev-site> install-app frappe_theme
bench build --app frappe_theme

# 3. Install pre-commit (run once)
cd apps/frappe_theme
pip install pre-commit
pre-commit install

# 4. Create a feature branch
git checkout -b feat/my-improvement

Commit Message Convention

We follow Conventional Commits:

<type>(<scope>): <short summary>

[optional body]

[optional footer]

Types: feat, fix, docs, style, refactor, test, chore

Examples:

feat(sidebar): add icon hover animation
fix(js): prevent duplicate buttons after clear_custom_buttons
docs: add screenshot to README
chore: bump pre-commit hooks

Pull Request Process

  1. Ensure pre-commit run --all-files passes with no errors.
  2. If you changed the DocType JSON, export it:
    bench --site <dev-site> export-fixtures --app frappe_theme
  3. Update CHANGELOG.md under the [Unreleased] section.
  4. Fill in the PR template completely.
  5. Link the related issue with Closes #<number>.
  6. A maintainer will review within a few business days.

Coding Standards

Python

  • Formatter: ruff format (tab indentation, double quotes, line length 110)
  • Linter: ruff check (see pyproject.toml for active rules)
  • Type annotations encouraged for all new public functions
  • No bare except: — catch specific exceptions

JavaScript

  • Formatter: Prettier (via pre-commit)
  • Linter: ESLint (see .eslintrc)
  • Use var / function declarations consistent with the existing IIFE pattern
  • CSS injection: add new <style> IDs to the STYLE_* constants at the top of each file
  • Avoid jQuery except where Frappe events require it

DocType JSON

  • Always export using bench export-fixtures — never edit JSON by hand after initial creation
  • Keep "modified" timestamp in sync

Adding Screenshots

Screenshots make the project much more approachable. To add them:

  1. Take a screenshot showing the settings form or a themed Desk.
  2. Place the image in docs/screenshots/ (create the folder if needed).
  3. Reference it in the README table under Screenshots.
  4. Submit the PR — we will merge screenshot-only PRs quickly.