buntic 0.0.0-stage → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -2
  3. package/dist/assets/cache.d.ts +10 -0
  4. package/dist/assets/image-processor.d.ts +39 -0
  5. package/dist/assets/photo-tag.d.ts +19 -0
  6. package/dist/builder/builder.d.ts +28 -0
  7. package/dist/builder/collisions.d.ts +10 -0
  8. package/dist/cli.d.ts +1 -0
  9. package/dist/cli.js +4205 -0
  10. package/dist/config.d.ts +11 -0
  11. package/dist/env.d.ts +18 -0
  12. package/dist/index.d.ts +30 -0
  13. package/dist/index.js +5060 -0
  14. package/dist/init.d.ts +15 -0
  15. package/dist/router/routes.d.ts +48 -0
  16. package/dist/runtime.d.ts +23 -0
  17. package/dist/seo/feeds.d.ts +11 -0
  18. package/dist/seo/metadata.d.ts +33 -0
  19. package/dist/seo/robots.d.ts +2 -0
  20. package/dist/seo/sitemap.d.ts +2 -0
  21. package/dist/server/dev-helpers.d.ts +29 -0
  22. package/dist/server/dev.d.ts +8 -0
  23. package/dist/storage/loader.d.ts +17 -0
  24. package/dist/storage/oras/adapter.d.ts +17 -0
  25. package/dist/storage/oras/auth.d.ts +46 -0
  26. package/dist/storage/oras/client.d.ts +83 -0
  27. package/dist/storage/oras/index.d.ts +6 -0
  28. package/dist/storage/oras/manifests.d.ts +42 -0
  29. package/dist/storage/oras/reference.d.ts +15 -0
  30. package/dist/storage/oras/types.d.ts +161 -0
  31. package/dist/template/css-graph.d.ts +49 -0
  32. package/dist/template/css-resolver.d.ts +19 -0
  33. package/dist/template/css-scoper.d.ts +12 -0
  34. package/dist/template/data-loader.d.ts +8 -0
  35. package/dist/template/directives.d.ts +13 -0
  36. package/dist/template/dsd-renderer.d.ts +23 -0
  37. package/dist/template/engine.d.ts +39 -0
  38. package/dist/template/html-scanner.d.ts +37 -0
  39. package/dist/template/scoped-css.d.ts +30 -0
  40. package/dist/template/svg-component.d.ts +32 -0
  41. package/dist/template/vfs.d.ts +57 -0
  42. package/dist/template/web-components.d.ts +91 -0
  43. package/dist/types.d.ts +152 -0
  44. package/dist/utils/html.d.ts +23 -0
  45. package/dist/utils/logger.d.ts +6 -0
  46. package/dist/utils/paths.d.ts +20 -0
  47. package/package.json +54 -4
  48. package/templates/blank/_gitignore +5 -0
  49. package/templates/blank/buntic.config.ts +15 -0
  50. package/templates/blank/src/layouts/main.html +14 -0
  51. package/templates/blank/src/pages/index.html +11 -0
  52. package/templates/blank/src/public/robots.txt +2 -0
  53. package/templates/blank/src/styles/main.css +40 -0
  54. package/templates/blank/tsconfig.json +21 -0
  55. package/templates/simple/README.md +35 -0
  56. package/templates/simple/_gitignore +5 -0
  57. package/templates/simple/buntic.config.ts +11 -0
  58. package/templates/simple/src/components/card.css +27 -0
  59. package/templates/simple/src/components/card.html +7 -0
  60. package/templates/simple/src/components/footer.css +14 -0
  61. package/templates/simple/src/components/footer.html +5 -0
  62. package/templates/simple/src/components/header.css +33 -0
  63. package/templates/simple/src/components/header.html +10 -0
  64. package/templates/simple/src/data/features.json +14 -0
  65. package/templates/simple/src/data/site.json +11 -0
  66. package/templates/simple/src/layouts/main.html +17 -0
  67. package/templates/simple/src/pages/about.html +16 -0
  68. package/templates/simple/src/pages/contact.html +13 -0
  69. package/templates/simple/src/pages/index.html +17 -0
  70. package/templates/simple/src/public/robots.txt +2 -0
  71. package/templates/simple/src/styles/main.css +67 -0
  72. package/templates/simple/tsconfig.json +21 -0
  73. package/templates/skills/buntic/SKILL.md +359 -0
  74. package/templates/skills/buntic/examples/README.md +177 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Buntic Authors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,136 @@
1
- # Temporary Holding Version
1
+ # ⚡ Buntic
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **Zero-dependency, blazing-fast static site generator native to Bun.**
4
+
5
+ Inspirado en la simplicidad de la web y el rendimiento de Bun, **Buntic** te permite construir sitios web modernos utilizando exclusivamente **HTML estándar, CSS, JavaScript/TypeScript, Web Components, SQL y almacenamiento en la nube**.
6
+
7
+ Sin extensiones de archivo propietarias, sin `node_modules` de cientos de megabytes, sin `package.json` obligatorio en tus sitios y con **cero dependencias externas**.
8
+
9
+ ---
10
+
11
+ ## ✨ Características Principales
12
+
13
+ - ⚡ **100% Nativo de Bun (`>=1.4.0`):** Aprovecha al máximo `Bun.build`, `Bun.serve`, `Bun.Image`, `Bun.S3Client`, `bun:sqlite`, `Bun.sql`, y `Bun.redis`.
14
+ - 📦 **Cero Dependencias Externas y Sin `package.json`:** Instala Buntic una sola vez de forma global y crea proyectos limpios con solo HTML, CSS, TypeScript y `tsconfig.json`.
15
+ - 🖼️ **Pipeline de Imágenes Nativo (`<photo>`):** Compresión automática a WebP a velocidad C++, cálculo de dimensiones anti-CLS y generación responsiva de `srcset` y `sizes`.
16
+ - 🗄️ **Storage Loaders Remotos (`storage/`):** Integración nativa con **Amazon S3 / R2 / MinIO** y servidores **OCI Registry / Docker Registry** vía `OrasClient` y `createOrasStorage` con versionado por tags y caché inmutable persistente por ETag/Digest en `.buntic/cache/images`.
17
+ - 🔍 **Suite SEO Out-of-the-Box:** Componente `<seo>`, generación dinámica de `sitemap.xml`, `robots.txt` configurable y feeds RSS 2.0 y Atom 1.0.
18
+ - 📱 **Tarjetas Sociales Automáticas:** Generación de tarjetas OpenGraph y Twitter Cards a tamaño estándar 1200x630 WebP a partir de imágenes locales o remotas en S3/OCI.
19
+ - 🚀 **Enrutamiento Dinámico, SQL y Redis:** Parámetros en rutas (`pages/[slug].html`), loaders `.data.ts`, integración directa con SQLite, PostgreSQL y Redis, y paginación declarativa.
20
+ - 📑 **Plantillas Estándar:** Usa `<layout>`, `<slot>`, `<each>` y `<if>` directamente en HTML estándar.
21
+ - 🧩 **Componentes SVG Nativos:** Inclusión inline con `<component src="...svg" />`, passthrough de atributos (`class`, `width`, `aria-*`), `<style scoped>`, CSS hermano co-ubicado (`.svg` + `.css`) y compatibilidad con DSD.
22
+ - 🎨 **Estilos Scoped Nativos:** Escribe `<style scoped>` dentro de cualquier elemento con sintaxis `&` o `:host`, deduplicación automática y cero FOUC.
23
+ - 🔄 **Live-Reload Integrado:** Servidor de desarrollo con WebSockets nativos y recarga en caliente automática.
24
+
25
+ ---
26
+
27
+ ## 🚀 Inicio Rápido
28
+
29
+ Requiere [Bun](https://bun.sh) `>=1.4.0`.
30
+
31
+ ### 1. Instalación Global (Recomendada — sin `package.json`)
32
+ ```bash
33
+ bun add -g buntic
34
+ ```
35
+
36
+ Crea un proyecto nuevo desde cualquier directorio:
37
+ ```bash
38
+ # Plantilla en blanco por defecto (blank)
39
+ buntic init mi-sitio
40
+
41
+ # O usando la plantilla multipágina (simple)
42
+ buntic init mi-sitio --template simple
43
+
44
+ cd mi-sitio
45
+ buntic dev
46
+ ```
47
+
48
+ `buntic init` genera un proyecto limpio **sin `package.json` ni `node_modules`**, incluyendo:
49
+ - `tsconfig.json` y definiciones de tipos locales en `.buntic/types/` (autocompletado completo para `import { defineConfig } from "buntic"` sin instalar dependencias en el proyecto).
50
+ - La skill de Buntic para agentes de IA en `.agents/skills/buntic/` (omitible con `--no-skills`).
51
+
52
+ ### 2. Ejecución directa con `bunx`
53
+ ```bash
54
+ bunx buntic init mi-sitio
55
+ bunx buntic dev mi-sitio
56
+ ```
57
+
58
+ ### 3. Uso local opcional en un proyecto con `package.json`
59
+ Si prefieres fijar la versión de Buntic por proyecto:
60
+ ```bash
61
+ bun add -d buntic
62
+ ```
63
+
64
+ ```json
65
+ {
66
+ "scripts": {
67
+ "dev": "buntic dev",
68
+ "build": "buntic build",
69
+ "clean": "buntic clean"
70
+ }
71
+ }
72
+ ```
73
+
74
+ ---
75
+
76
+ ## 📁 Estructura del Proyecto
77
+
78
+ Buntic auto-detecta tanto la estructura estándar recomendada con `src/` como la estructura plana en la raíz:
79
+
80
+ ```text
81
+ mi-sitio/
82
+ ├── src/ # Estructura recomendada (auto-detectada)
83
+ │ ├── pages/ # Rutas HTML (index.html -> /, [slug].html -> /:slug)
84
+ │ ├── layouts/ # Layouts reutilizables (main.html) con <slot>
85
+ │ ├── components/ # Componentes HTML y Web Components (counter.ts)
86
+ │ ├── data/ # Almacén de datos (SQLite, Postgres, JSON, TS)
87
+ │ ├── storage/ # Loaders de objetos remotos (S3, Cloudflare R2, MinIO, OCI)
88
+ │ ├── styles/ # Hojas de estilo globales (main.css)
89
+ │ └── public/ # Archivos estáticos copiados directamente a dist/
90
+ ├── .agents/skills/ # Skill de Buntic instalada por `buntic init`
91
+ ├── dist/ # Carpeta de salida compilada
92
+ ├── buntic.config.ts # Configuración de URLs, SEO, feeds y almacenamiento
93
+ └── tsconfig.json # Configuración TypeScript (tipos en .buntic/types/)
94
+ ```
95
+
96
+ ---
97
+
98
+ ## 📚 Documentación Técnica
99
+
100
+ ### 🚀 Primeros Pasos
101
+ - [Guía de Inicio Rápido](https://github.com/jloons/buntic/blob/main/docs/getting-started.md)
102
+ - [Referencia del CLI](https://github.com/jloons/buntic/blob/main/docs/cli.md)
103
+ - [Roadmap del Proyecto](https://github.com/jloons/buntic/blob/main/ROADMAP.md)
104
+ - [Ejemplo Simple (Plantillas y Web Components)](https://github.com/jloons/buntic/blob/main/examples/simple/README.md)
105
+ - [Ejemplo Catalog (OCI Registry, S3, Postgres, Redis y Podman)](https://github.com/jloons/buntic/blob/main/examples/catalog/README.md)
106
+
107
+ ### 🎨 Fundación y Plantillas (Fase 0)
108
+ - [Guía de Plantillas y Componentes](https://github.com/jloons/buntic/blob/main/docs/templating.md)
109
+ - [Estilos Scoped y Grafo de Dependencias CSS](https://github.com/jloons/buntic/blob/main/docs/scoped-css.md)
110
+ - [Web Components Nativos y Declarative Shadow DOM](https://github.com/jloons/buntic/blob/main/docs/web-components.md)
111
+
112
+ ### 📊 Enrutamiento y Datos (Fase 1)
113
+ - [Enrutamiento Basado en Archivos y Páginas Dinámicas](https://github.com/jloons/buntic/blob/main/docs/routing-and-pages.md)
114
+ - [Datos, Loaders y Variables de Entorno](https://github.com/jloons/buntic/blob/main/docs/data-and-loaders.md)
115
+ - [Motores SQL Nativos (`bun:sqlite` y `Bun.sql`)](https://github.com/jloons/buntic/blob/main/docs/databases-sql.md)
116
+ - [Sistema de Paginación Automática](https://github.com/jloons/buntic/blob/main/docs/pagination.md)
117
+
118
+ ### 🖼️ Assets, Cloud y SEO (Fase 2)
119
+ - [Optimización de Imágenes con `<photo>`](https://github.com/jloons/buntic/blob/main/docs/assets-and-images.md)
120
+ - [Storage Loaders Remotos (S3, R2, MinIO y OCI)](https://github.com/jloons/buntic/blob/main/docs/storage-loaders.md)
121
+ - [Suite SEO, Metadatos Sociales y Feeds](https://github.com/jloons/buntic/blob/main/docs/seo.md)
122
+
123
+ ---
124
+
125
+ ## 🧪 Pruebas
126
+
127
+ Ejecutar la suite completa de pruebas unitarias e integración:
128
+ ```bash
129
+ bun test
130
+ ```
131
+
132
+ ---
133
+
134
+ ## 📄 Licencia
135
+
136
+ [MIT](https://github.com/jloons/buntic/blob/main/LICENSE)
@@ -0,0 +1,10 @@
1
+ export declare class AssetCache {
2
+ private cacheDir;
3
+ constructor(cacheDir: string);
4
+ getCachePath(namespace: string, hash: string, ext?: string): string;
5
+ computeHash(parts: (string | number | undefined | null)[]): string;
6
+ has(namespace: string, hash: string, ext?: string): boolean;
7
+ get(namespace: string, hash: string, ext?: string): Promise<Uint8Array | null>;
8
+ set(namespace: string, hash: string, bytes: Uint8Array, ext?: string): Promise<string>;
9
+ clean(): Promise<void>;
10
+ }
@@ -0,0 +1,39 @@
1
+ import type { ResolvedConfig } from "../types.js";
2
+ import { AssetCache } from "./cache.js";
3
+ export interface ProcessedVariant {
4
+ bytes: Uint8Array;
5
+ width: number;
6
+ height: number;
7
+ hash: string;
8
+ }
9
+ export declare class ImageProcessor {
10
+ cache: AssetCache;
11
+ private ramCache;
12
+ constructor(config: ResolvedConfig);
13
+ getMetadata(bytes: Uint8Array): Promise<{
14
+ width: number;
15
+ height: number;
16
+ format: string;
17
+ }>;
18
+ processImage(options: {
19
+ bytes: Uint8Array;
20
+ namespace: string;
21
+ keyOrPath: string;
22
+ etagOrMtime?: string | number;
23
+ targetWidth?: number;
24
+ }): Promise<ProcessedVariant>;
25
+ processMultiWidths(options: {
26
+ bytes: Uint8Array;
27
+ namespace: string;
28
+ keyOrPath: string;
29
+ etagOrMtime?: string | number;
30
+ widths?: number[];
31
+ }): Promise<ProcessedVariant[]>;
32
+ processSocialImage(options: {
33
+ bytes: Uint8Array;
34
+ namespace: string;
35
+ keyOrPath: string;
36
+ etagOrMtime?: string | number;
37
+ }): Promise<ProcessedVariant>;
38
+ private getOrComputeVariant;
39
+ }
@@ -0,0 +1,19 @@
1
+ import type { ResolvedConfig } from "../types.js";
2
+ import { ImageProcessor } from "./image-processor.js";
3
+ import { StorageManager } from "../storage/loader.js";
4
+ export interface EmittedAsset {
5
+ outputPath: string;
6
+ url: string;
7
+ bytes: Uint8Array;
8
+ }
9
+ export declare class PhotoProcessor {
10
+ private config;
11
+ imageProcessor: ImageProcessor;
12
+ storageManager: StorageManager;
13
+ emittedAssets: Map<string, EmittedAsset>;
14
+ constructor(config: ResolvedConfig);
15
+ parseAttributes(attrString: string): Record<string, string>;
16
+ processHtml(html: string, templatePath: string): Promise<string>;
17
+ private resolveVariants;
18
+ private buildImgTag;
19
+ }
@@ -0,0 +1,28 @@
1
+ import type { ResolvedConfig } from "../types.js";
2
+ import { assertNoPublicCollisions, detectPublicCollisions, getDirectoryFiles, type PublicCollision } from "./collisions.js";
3
+ export { assertNoPublicCollisions, detectPublicCollisions, getDirectoryFiles, type PublicCollision, };
4
+ export interface BuildResult {
5
+ success: boolean;
6
+ pagesCount: number;
7
+ outputFiles: string[];
8
+ durationMs: number;
9
+ }
10
+ export interface BuildOptions {
11
+ cleanCache?: boolean;
12
+ }
13
+ export declare class Builder {
14
+ private config;
15
+ private engine;
16
+ private photoProcessor;
17
+ private seoEngine;
18
+ constructor(config: ResolvedConfig);
19
+ build(options?: BuildOptions): Promise<BuildResult>;
20
+ private prepareEmptyDir;
21
+ private stagePages;
22
+ private bundleStagedPages;
23
+ private postProcessHtmlPages;
24
+ private emitProcessedAssets;
25
+ private emitSeoArtifacts;
26
+ private warnUnusedWebComponents;
27
+ private normalizeRootPaths;
28
+ }
@@ -0,0 +1,10 @@
1
+ import type { PageRouteInfo, ResolvedConfig } from "../types.js";
2
+ export interface PublicCollision {
3
+ type: "route" | "reserved-dir";
4
+ publicPath: string;
5
+ conflictWith: string;
6
+ outputPath: string;
7
+ }
8
+ export declare function getDirectoryFiles(dir: string, baseDir?: string): string[];
9
+ export declare function detectPublicCollisions(config: ResolvedConfig, routes: PageRouteInfo[]): PublicCollision[];
10
+ export declare function assertNoPublicCollisions(config: ResolvedConfig, routes: PageRouteInfo[]): void;
package/dist/cli.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function runCLI(args: string[]): Promise<void>;