Skip to content

Improve documentation to mention new Civet features#53

Merged
edemaine merged 2 commits intomainfrom
civet-docs
Apr 4, 2026
Merged

Improve documentation to mention new Civet features#53
edemaine merged 2 commits intomainfrom
civet-docs

Conversation

@edemaine
Copy link
Copy Markdown
Collaborator

@edemaine edemaine commented Apr 2, 2026

No description provided.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 2, 2026

Greptile Summary

This PR significantly expands the Hera documentation to cover Civet (and TypeScript) as first-class handler languages, adding new sections on CJS/ESM loaders, the esbuild plugin, VS Code/LSP configuration, and a full API + Options reference. It also fixes a long-standing typo ("programatic" → "programmatic") and adds a missing return in a parseInt code example.

Key changes:

  • Quickstart now shows --require loader commands for TypeScript and Civet, and documents passing language: to heraPlugin(...).
  • Definitions / Code Blocks sections updated to mention JavaScript, TypeScript, and Civet as valid handler languages.
  • CJS/ESM loaders section expanded with Civet-specific examples and improved cross-references to loader-examples/.
  • New sections added: "esbuild plugin", "Editor tooling", and "API / Options" with a full compile() option table.
  • lsp/README.md gains a Configuration section documenting hera.language with VS Code settings and package.json examples.
  • Bug: The newly added Civet CJS example uses { parse } = require(...) without a declaration keyword, which is a JavaScript syntax error.
  • Minor: The TypeScript hyperlink uses http:// while Civet's uses https://; consider making both HTTPS.

Confidence Score: 4/5

Safe to merge after fixing the syntax error in the Civet CJS code example.

Changes are documentation-only with no impact on runtime code. The content is accurate and well-structured. One P1 issue exists: the newly added Civet CJS snippet contains { parse } = require(...) without a const/let/var declaration, which is a JavaScript syntax error that would mislead readers. Two minor style issues also present. Fixing the syntax error warrants a small deduction from a perfect score.

README.md — the Civet CJS custom-loader example (around line 430) has a syntax error that should be corrected before merge.

Important Files Changed

Filename Overview
README.md Major documentation expansion covering TypeScript/Civet loaders, esbuild plugin, editor tooling, and API reference; fixes "programatic" typo and adds missing return in code example, but introduces a syntax error in the new Civet CJS example ({ parse } = require(...) missing declaration keyword).
lsp/README.md Adds a new Configuration section documenting the hera.language setting with supported values and JSON examples for VS Code and package.json; content is accurate and consistent with README.md.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[.hera grammar file] --> B{Handler language?}
    B -->|javascript| C[register / register/esm / register/cjs]
    B -->|typescript| D[register/tsc / register/tsc/esm / register/tsc/cjs]
    B -->|civet| E[register/civet / register/civet/esm / register/civet/cjs]

    C --> F[Node.js --require / --import]
    D --> F
    E --> F

    A --> G{Build tool?}
    G -->|esbuild| H["heraPlugin({ language })"]
    H --> I[Bundle output]

    A --> J{Editor tooling?}
    J -->|VS Code / LSP| K["hera.language setting"]
    K --> L[Syntax highlighting + diagnostics]
Loading

Reviews (1): Last reviewed commit: "Improve documentation to mention new Civ..." | Re-trigger Greptile

@STRd6
Copy link
Copy Markdown
Collaborator

STRd6 commented Apr 4, 2026

I don't think the language toggle is hooked up yet but I plan to soon

@edemaine edemaine merged commit c84f117 into main Apr 4, 2026
4 checks passed
@edemaine edemaine deleted the civet-docs branch April 4, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants