3.4 KiB
Contributing to Gram
Thank you for your interest in contributing to Gram. Gram is an open-source declarative recipe DSL and toolset designed to code recipes. Contributions of all kinds — bug reports, documentation fixes, syntax proposals, example .gram recipes, and code improvements — are welcome.
Development Platforms
Primary development, issue tracking, and pull requests take place on the main Forgejo instance:
- Primary Forge: git.gram-lang.org/gram-lang/gram
- Mirrors: GitHub and Codeberg
Contributions and discussions are accepted on any of these platforms.
Getting Started
Local development of the monorepo requires Bun.
Prerequisites and Setup
-
Clone the repository and install dependencies:
git clone https://git.gram-lang.org/gram-lang/gram.git cd gram bun install -
Start the development server for the documentation website and playground:
bun run dev
Project Layout
The repository is structured as a monorepo under packages/:
| Package | Purpose |
|---|---|
parser |
Ohm.js grammar definition and AST generation |
kitchen |
Compiler translating the AST into structured JSON and warnings |
format |
Canonical source code formatter for .gram files |
analyzer |
Physical layer resolving mass normalization, unit conversion, and nutrition |
renderer |
Display engine converting compiled JSON to HTML, Markdown, or Gantt charts |
cli |
Command-line interface (gram) |
i18n |
Localization layer for units, categories, and prompts |
language-server |
LSP implementation for editor integration |
vscode-extension |
Visual Studio Code extension built on the language server |
docs |
Documentation website and web playground |
Submitting Contributions
Reporting Issues
If you encounter a bug or unexpected behavior, open an issue with a clear description, minimal steps or a .gram snippet to reproduce it, and the expected versus actual behavior.
Syntax Proposals (RFCs)
Gram defines a language specification. Changes or additions to syntax have broad implications across the compiler and tooling. Before submitting code for syntax modifications, please open an issue or discussion tagged as an RFC to discuss the proposal and design goals.
Code Guidelines & Quality Checks
Before submitting a pull request, ensure your changes adhere to project standards:
- Formatting & Linting: Run
bun run lint:fixto format code using Biome. - Type Checking: Run
bun run typecheckacross all packages. - Tests: Run unit tests with
bun test. If updating syntax or AST output intentionally, update test snapshots where applicable (bun test --update-snapshots). - Conformance: Run
bun run conformanceto ensure compiler output remains consistent. - Changesets: If your change modifies public package APIs or behavior, create a changeset by running
bun run change.
Use of AI Assistance
AI tools may be used to assist in writing code or documentation. Contributors submitting AI-assisted work are expected to review, understand, and verify their submissions to ensure they meet the project's quality and architectural standards.
License
By contributing to Gram, you agree that your contributions will be licensed under the GPL-3.0 License.