npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@q300z/codeforge

v1.7.0

Published

Industrial JSON to HTML Render Engine with Design Tokens and Multi-page support

Readme

🚀 CodeForge - Traducteur JSON → HTML

Tests Status

🎯 Objectif

CodeForge est une bibliothèque robuste dont la mission est de traduire une structure de données JSON en code HTML sémantique et accessible. Elle agit comme une couche de projection pure qui transforme un arbre déclaratif (le "Quoi") en un document web structuré (le "Comment"), en utilisant la puissance native du navigateur (Cascade CSS et Variables CSS).


✨ Fonctionnalités Clés

  • 🔌 Adaptateur Intelligent : Détecte et transforme automatiquement les formats tiers (ex: ScreenDraft) en structure native CodeForge.
  • 🎨 Système de Style Hybride : Supporte les Design Tokens (via CSS Variables) et les propriétés de mise en page natives (width, height, z-index, etc.).
  • 📍 Positionnement Absolu : Support natif des coordonnées x et y pour un rendu de type "Canvas".
  • ♿ Accessibilité (A11y) Native : Injection automatique des rôles ARIA, descriptions audio et gestion des balises sémantiques.
  • 📦 Sortie Autonome : Option pour injecter le CSS directement dans le HTML (--inline) pour des fichiers 100% portables.

🛠 Utilisation

Installation

npm install @q300z/codeforge

En tant que bibliothèque (Lib)

1. Génération de site (SSG)

import { buildSite } from "@q300z/codeforge";

// Génère un site complet avec CSS inline
await buildSite("./structure.json", "./dist", { inlineCss: true });

2. Utilisation des Builders (Design Pattern)

import { SiteBuilder, PageBuilder, HeroBuilder, ButtonBuilder } from "@q300z/codeforge";

const site = new SiteBuilder("Mon App")
  .addPage("index", new PageBuilder("home")
    .addChild(new HeroBuilder("h1").withTitle("Hello World"))
    .addChild(new ButtonBuilder("b1").withLabel("Cliquez-ici").withXY(50, 100))
  )
  .build();

En tant qu'outil (CLI)

# Utilisation standard
npx codeforge ./data/site.json ./generated

# Avec auto-détection ScreenDraft et CSS inline
npx codeforge ./data/screendraft.json ./dist --inline

# Mode surveillance (Watch)
npx codeforge ./data/site.json ./generated --watch

⌨️ Commandes

| Commande | Description | | :--- | :--- | | npm run dev | Lance le build lib + génération + serveur Vite. | | npm run build | Compile la lib et génère le showcase complet. | | npm run lint | Vérifie le code TypeScript (ESLint) et CSS (Stylelint). | | npm run test:a11y | Lance l'audit d'accessibilité automatisé avec pa11y-ci. | | npm run test:screendraft | Teste le pipeline complet d'import ScreenDraft → Rendu. |


🧪 Qualité & Tests

Le projet suit des standards de qualité industriels :

  • Tests Unitaires : Couverture globale > 80% (Composants > 95%).
  • Tests E2E : Validation des scénarios de navigation et du rendu visuel avec Playwright.
  • Accessibilité : Validation WCAG 2.0 AA sur toutes les pages générées.
  • Style CSS : Validation et formatage automatique via Stylelint.
npm test              # Tests unitaires
npm run test:e2e      # Tests Playwright
npm run test:a11y     # Audit Accessibilité

🏗 Architecture (SOLID)

CodeForge est construit sur des principes modulaires :

  1. Registry : Dictionnaire centralisé des composants.
  2. Factory : Création typée et sécurisée de nouveaux composants.
  3. Builders : Interface fluide pour construire des structures JSON sans erreurs.
  4. Adapters : Couche de compatibilité pour les sources de données externes.

Note : Le fichier data/site.json sert de référence pour les tests. Toute modification majeure doit être répercutée dans les tests E2E.