Coralite v0.1.1
Coralite’s first public release of its HTML module static site generator introduces foundational features for building and rendering static websites, with a focus on component-based architecture and metadata extraction.
This initial version includes core functionality for parsing templates, resolving components, and handling token replacements, alongside improvements to configuration management and testing infrastructure. Below are key highlights from this release:
Core Functionality #
- Introduced support for rendering custom HTML elements through the
evalComputedTokens
function, enabling dynamic attribute replacements during template processing. - Resolved issues with package.json parsing in older Node.js versions by updating compatibility checks for
Dirent
usage. - Implemented a global types file to standardise type definitions across modules, ensuring consistent development and maintenance practices.
Testing Infrastructure #
- Expanded test coverage for component rendering, token replacement logic, and metadata extraction from documents.
- Refactored test fixtures to use consistent naming conventions (e.g., replacing placeholder names with standardised identifiers).
- Updated testing scripts to ensure compatibility with async operations in token evaluation functions.
Configuration Management #
- Introduced a CLI command structure to manage script execution via
commander
, enhancing user interaction and argument handling. - Added support for excluding specific files during HTML parsing, providing greater control over template processing workflows.
- Improved configuration resolution for JSON files, ensuring correct path resolution across different project structures.
Rendering Pipeline #
- Optimised rendering logic to correctly merge components into documents using the
mergeComponentToDocument
function. - Enhanced regex patterns for identifying custom elements with multiple dashes, improving accuracy in template parsing.
- Fixed issues where undefined values during token replacement could disrupt rendering workflows.
Token Handling and Metadata Extraction #
- Generalised context parameters for token resolution, enabling more flexible attribute value replacements across templates.
- Implemented metadata extraction from HTML documents using a dedicated
getMetadataFromDocument
function, supporting structured data retrieval. - Refactored token parsing logic to use consistent naming conventions (e.g., renaming
evalComputedAttributes
toevalComputedTokens
).
Code Quality and Tooling #
- Integrated ESLint for code linting and style enforcement, ensuring adherence to best practices.
- Updated file naming conventions to use kebab-case for consistency with modern web standards.
- Resolved typos and configuration errors in package.json files across the project’s dependency tree.
Get the release #
npm install coralite@0.1.1
This release lays the groundwork for a robust static site generation workflow, with further enhancements planned for component rendering, performance optimisations, and advanced metadata handling in future versions.
Related posts
- Coralite v0.11.3 - 18 June 25
- Coralite v0.11.2 - 15 June 25
- Coralite v0.11.1 - 5 June 25