Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Use Node.js 22
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24

- name: Install Dependencies
run: npm install -g pnpm && pnpm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy-site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
uses: actions/checkout@v4

# Test
- name: Use Node.js 22
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24

- name: Install Dependencies
run: npm install -g pnpm && pnpm install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
with:
ref: ${{ github.event.release.target_commitish }}

- name: Use Node.js 22
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 22
node-version: 24

- name: Install Dependencies
run: npm install -g pnpm && pnpm install
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

strategy:
matrix:
node-version: [20, 22]
node-version: [20, 22, 24]

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ yarn.lock
package-lock.json
site/README.md
dist-site/
pnpm-lock.yaml

# AI
.claude
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
24
52 changes: 52 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Agent Guidelines for Ecto

Ecto is a modern template consolidation engine that provides a unified interface for working with multiple popular template engines (EJS, Markdown, Pug, Nunjucks, Mustache, Handlebars, and Liquid).

## Project Overview

- **Purpose**: Simplify template rendering by providing a single API for multiple template engines with automatic engine selection based on file extensions
- **Architecture**: TypeScript library with a plugin architecture - `Ecto` coordinates engines, `BaseEngine` provides common functionality, individual engine classes handle specific template formats
- **Key Dependencies**: `ejs`, `pug`, `nunjucks`, `liquidjs`, `@jaredwray/fumanchu` (Handlebars/Mustache), `writr` (Markdown), `cacheable` (caching), `hookified` (events/hooks)

## Development Commands

- Use `pnpm` instead of `npm` for all package management commands
- `pnpm build` - Build TypeScript to ESM with type declarations
- `pnpm test` - Run linting and tests with coverage
- `pnpm lint` - Run Biome linter with auto-fix
- `pnpm clean` - Remove dist, coverage, node_modules, and lock files

## Code Quality Requirements

- Always run `pnpm test` to verify tests pass before completing changes
- All new code must have corresponding tests
- Follow existing code patterns in `src/ecto.ts` for the main class
- Use Biome for linting and formatting (configured in the project)
- TypeScript strict mode is enabled

## Project Structure

- `src/ecto.ts` - Main Ecto class (core engine coordinator)
- `src/base-engine.ts` - Base class for all engines
- `src/engine-interface.ts` - TypeScript interface for engine implementations
- `src/engine-map.ts` - Manages file extension to engine mappings
- `src/engines/` - Individual engine implementations (ejs, handlebars, liquid, markdown, nunjucks, pug)
- `test/` - Vitest test files

## Engine Mapping

- `.ejs` → EJS
- `.md`, `.markdown` → Markdown
- `.pug`, `.jade` → Pug
- `.njk` → Nunjucks
- `.mustache` → Mustache
- `.handlebars`, `.hbs`, `.hjs` → Handlebars
- `.liquid` → Liquid

## Key Considerations

- Async and sync rendering methods are available (`render`/`renderSync`, `renderFromFile`/`renderFromFileSync`)
- FrontMatter support is built-in for Markdown files
- Caching is available via the `cacheable` library for performance optimization
- Hooks system allows intercepting and modifying data during rendering
- Custom engines can be created by implementing the `EngineInterface`
1 change: 1 addition & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
Loading
Loading