UNPKG

meld

Version:

Meld: A template language for LLM prompts

38 lines (31 loc) 1.65 kB
# Meld Project Guidelines ## Build & Test Commands ```bash npm run build # Build the project npm run test # Run all tests npm test <file_path> # Run specific test file (e.g. npm test cli/priority-cli.test.ts) npm run test:watch # Run tests in watch mode npm run test:coverage # Run tests with coverage npm run lint # Run ESLint npm run dev # Build in watch mode ``` ## Code Style - **Imports**: Use paths aliases (@core/, @services/, etc.) as defined in tsconfig.json - **Structure**: Use interface-first design (I[Name]Service interfaces + implementation) - **Services**: Follow dependency injection pattern (initialize() with dependencies) - **Formatting**: 2-space indentation, single quotes, semicolons - **Types**: Strict type checking enabled, always provide explicit return types - **Error Handling**: Use specialized MeldError classes (MeldDirectiveError, MeldParseError, etc.) - **Naming**: PascalCase for classes/interfaces, camelCase for methods/variables - **Tests**: Organize with setup/cleanup pattern, mock process.exit in CLI tests - **CLI Testing**: Use setupCliTest() helper for consistent CLI test setup # Tests To ensure consistency in writing tests, please refer to `docs/dev/TESTS.md` and refer to how other tests are using mocks and `TestContext`. # Additional reading Useful context can be found in these files: - Target UX: `docs/dev/UX.md` - Architecture: `docs/dev/ARCHITECTURE.md` - AST » transformation pipeline: `docs/dev/PIPELINE.md` - API documentation: `docs/dev/API.md` - Path handling: `docs/dev/PATHS.md` - Error testing patterns: `docs/dev/ERROR_TESTING_PATTERNS.md`