bunki 0.19.6 → 0.21.0

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.
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { SiteConfig } from "./types";
1
+ import type { SiteConfig } from "./types";
2
2
  export declare const DEFAULT_CONTENT_DIR: string;
3
3
  export declare const DEFAULT_OUTPUT_DIR: string;
4
4
  export declare const DEFAULT_TEMPLATES_DIR: string;
@@ -17,7 +17,7 @@ export declare function generateRSSFeed(site: Site, config: SiteConfig): string;
17
17
  * @param pageSize - Items per page for pagination
18
18
  * @returns Sitemap XML content
19
19
  */
20
- export declare function generateSitemap(site: Site, config: SiteConfig, pageSize?: number): string;
20
+ export declare function generateSitemap(site: Site, config: SiteConfig, _pageSize?: number): string;
21
21
  /**
22
22
  * Generate sitemap index XML (for large sites)
23
23
  * @param config - Site configuration
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
- export * from "./types";
2
- export { PAGINATION, FILES, SEO, CACHE, DATE } from "./constants";
1
+ export { configExists, createDefaultConfig, DEFAULT_CONFIG_FILE, DEFAULT_CONTENT_DIR, DEFAULT_OUTPUT_DIR, DEFAULT_TEMPLATES_DIR, loadConfig, saveConfig, } from "./config";
2
+ export { CACHE, DATE, FILES, PAGINATION, SEO } from "./constants";
3
3
  export { parseMarkdownDirectory } from "./parser";
4
4
  export { startServer } from "./server";
5
5
  export { SiteGenerator } from "./site-generator";
6
- export { configExists, createDefaultConfig, DEFAULT_CONFIG_FILE, DEFAULT_CONTENT_DIR, DEFAULT_OUTPUT_DIR, DEFAULT_TEMPLATES_DIR, loadConfig, saveConfig, } from "./config";
6
+ export * from "./types";
7
7
  export { copyFile, ensureDir, fileExists, findFilesByPattern, getBaseFilename, readFileAsText, } from "./utils/file-utils";
8
- export { convertMarkdownToHtml, extractExcerpt, parseMarkdownFile, } from "./utils/markdown-utils";
9
- export { createTemplateEngine } from "./utils/template-engine";
10
- export { generateCollectionSchemas, generateHomeBreadcrumbs, } from "./utils/schema-factory";
11
8
  export { DEFAULT_IMAGES_DIR, uploadImages } from "./utils/image-uploader";
9
+ export { convertMarkdownToHtml, extractExcerpt, parseMarkdownFile, } from "./utils/markdown-utils";
12
10
  export { createUploader } from "./utils/s3-uploader";
11
+ export { generateCollectionSchemas, generateHomeBreadcrumbs, } from "./utils/schema-factory";
12
+ export { createTemplateEngine } from "./utils/template-engine";
package/dist/parser.d.ts CHANGED
@@ -1,5 +1,9 @@
1
- import { Post, CDNConfig } from "./types";
1
+ import type { CDNConfig, Post } from "./types";
2
2
  import { type ParseError } from "./utils/markdown-utils";
3
+ interface ParsedMarkdownFile {
4
+ post: Post;
5
+ filePath: string;
6
+ }
3
7
  export interface ParseResult {
4
8
  posts: Post[];
5
9
  errors: ParseError[];
@@ -8,8 +12,6 @@ export interface ParseResult {
8
12
  * Parse specific markdown files (for incremental builds)
9
13
  * Returns both posts and their file paths for cache updates
10
14
  */
11
- export declare function parseMarkdownFiles(filePaths: string[], cdnConfig?: CDNConfig): Promise<Array<{
12
- post: Post;
13
- filePath: string;
14
- }>>;
15
+ export declare function parseMarkdownFiles(filePaths: string[], cdnConfig?: CDNConfig): Promise<ParsedMarkdownFile[]>;
15
16
  export declare function parseMarkdownDirectory(contentDir: string, strictMode?: boolean, cdnConfig?: CDNConfig): Promise<Post[]>;
17
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,6 +1,48 @@
1
1
  /**
2
2
  * Post object representing a single markdown file
3
3
  */
4
+ export type JsonPrimitive = string | number | boolean | null;
5
+ export type JsonValue = JsonPrimitive | JsonObject | JsonValue[];
6
+ export interface JsonObject {
7
+ [key: string]: JsonValue;
8
+ }
9
+ export type TemplateValue = JsonValue | object | undefined;
10
+ export interface TemplateObject {
11
+ [key: string]: TemplateValue;
12
+ }
13
+ export interface FrontmatterLocation {
14
+ name?: string;
15
+ address?: string;
16
+ latitude?: number;
17
+ longitude?: number;
18
+ lat?: number;
19
+ lng?: number;
20
+ }
21
+ export interface FrontmatterBusiness {
22
+ type: string;
23
+ name: string;
24
+ address: string;
25
+ latitude?: number;
26
+ longitude?: number;
27
+ lat: number;
28
+ lng: number;
29
+ cuisine?: string;
30
+ priceRange?: string;
31
+ telephone?: string;
32
+ url?: string;
33
+ openingHours?: string;
34
+ }
35
+ export type FrontmatterBusinessInput = FrontmatterBusiness | FrontmatterBusiness[];
36
+ export interface Frontmatter {
37
+ title?: string;
38
+ date?: string;
39
+ excerpt?: string;
40
+ tags?: string[];
41
+ seoTitle?: string;
42
+ category?: string;
43
+ location?: FrontmatterLocation;
44
+ business?: FrontmatterBusinessInput;
45
+ }
4
46
  export interface Location {
5
47
  /** Name of the location */
6
48
  name: string;
@@ -111,6 +153,12 @@ export interface SiteConfig {
111
153
  baseUrl: string;
112
154
  /** Site identifier (used for metadata) */
113
155
  domain: string;
156
+ /** Optional author name used by config templates and feeds */
157
+ author?: string;
158
+ /** Optional content directory override */
159
+ contentDir?: string;
160
+ /** Optional templates directory override */
161
+ templatesDir?: string;
114
162
  /** Optional public URL for the bucket */
115
163
  publicUrl?: string;
116
164
  /** Optional S3 client configuration (accessKeyId, secretAccessKey, bucket, etc.) */
@@ -142,8 +190,13 @@ export interface SiteConfig {
142
190
  * When set, `bunki images:push --content-assets` uses this config for uploads.
143
191
  */
144
192
  contentAssets?: ContentAssetsConfig;
145
- /** Additional custom configuration options */
146
- [key: string]: any;
193
+ /** Resolved site metadata used by loaders and generators */
194
+ site?: {
195
+ title: string;
196
+ description: string;
197
+ url: string;
198
+ author: string;
199
+ };
147
200
  }
148
201
  /**
149
202
  * Options for initializing the site generator
@@ -2,8 +2,8 @@
2
2
  * Change detection for incremental builds
3
3
  * Determines which files have changed and what needs to be rebuilt
4
4
  */
5
- import type { BuildCache } from "./build-cache";
6
5
  import type { Post } from "../types";
6
+ import type { BuildCache } from "./build-cache";
7
7
  export interface ChangeSet {
8
8
  /** Posts that were added or modified */
9
9
  changedPosts: string[];
@@ -29,7 +29,7 @@ export declare function detectChanges(currentFiles: string[], cache: BuildCache,
29
29
  /**
30
30
  * Determine affected tags from changed posts
31
31
  */
32
- export declare function getAffectedTags(changedPosts: Post[], allPosts: Post[]): Set<string>;
32
+ export declare function getAffectedTags(changedPosts: Post[], _allPosts: Post[]): Set<string>;
33
33
  /**
34
34
  * Check if index pages need regeneration
35
35
  */
@@ -1,4 +1,4 @@
1
- import { CSSConfig } from "../types";
1
+ import type { CSSConfig } from "../types";
2
2
  export interface CSSProcessorOptions {
3
3
  /** CSS configuration */
4
4
  css: CSSConfig;
@@ -1,4 +1,4 @@
1
- import { ImageUploadOptions } from "../types";
1
+ import type { ImageUploadOptions } from "../types";
2
2
  export declare const DEFAULT_IMAGES_DIR: string;
3
3
  export declare const DEFAULT_CONTENT_DIR: string;
4
4
  export declare function uploadImages(options?: ImageUploadOptions): Promise<Record<string, string>>;
@@ -15,15 +15,14 @@
15
15
  * @see https://schema.org/
16
16
  * @see https://developers.google.com/search/docs/appearance/structured-data/intro-structured-data
17
17
  */
18
- import type { Post, SiteConfig } from "../types.js";
18
+ import type { JsonObject, Post, SiteConfig } from "../types.js";
19
19
  /**
20
20
  * Base Schema.org Thing type
21
21
  */
22
- interface SchemaOrgThing {
22
+ type SchemaOrgThing = JsonObject & {
23
23
  "@context": "https://schema.org";
24
24
  "@type": string;
25
- [key: string]: any;
26
- }
25
+ };
27
26
  /**
28
27
  * Options for generating BlogPosting JSON-LD
29
28
  */
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Frontmatter and business location validators
3
3
  */
4
+ import type { Frontmatter, FrontmatterBusinessInput } from "../../types";
4
5
  export interface ValidationError {
5
6
  file: string;
6
7
  type: "yaml" | "missing_field" | "file_not_found" | "unknown" | "validation";
@@ -14,18 +15,18 @@ export interface ValidationError {
14
15
  * @param filePath - File path for error reporting
15
16
  * @returns ValidationError if invalid, null if valid
16
17
  */
17
- export declare function validateBusinessLocation(business: unknown, filePath: string): ValidationError | null;
18
+ export declare function validateBusinessLocation(business: FrontmatterBusinessInput | null | undefined, filePath: string): ValidationError | null;
18
19
  /**
19
20
  * Validate that tags don't contain spaces (must use hyphens)
20
21
  * @param tags - Array of tag strings
21
22
  * @param filePath - File path for error reporting
22
23
  * @returns ValidationError if invalid, null if valid
23
24
  */
24
- export declare function validateTags(tags: string[], filePath: string): ValidationError | null;
25
+ export declare function validateTags(tags: Frontmatter["tags"] | null | undefined, filePath: string): ValidationError | null;
25
26
  /**
26
27
  * Check for deprecated 'location' field (should use 'business' instead)
27
28
  * @param data - Frontmatter data
28
29
  * @param filePath - File path for error reporting
29
30
  * @returns ValidationError if found, null otherwise
30
31
  */
31
- export declare function checkDeprecatedLocationField(data: Record<string, unknown>, filePath: string): ValidationError | null;
32
+ export declare function checkDeprecatedLocationField(data: Frontmatter | null | undefined, filePath: string): ValidationError | null;
@@ -2,11 +2,11 @@
2
2
  * Markdown utilities - Main export file
3
3
  * Re-exports from modular components for backward compatibility
4
4
  */
5
- import type { Post, CDNConfig } from "../types";
5
+ import type { CDNConfig, Post } from "../types";
6
6
  import { convertMarkdownToHtml, extractExcerpt, setNoFollowExceptions } from "./markdown/parser";
7
7
  import type { ValidationError } from "./markdown/validators";
8
- export { setNoFollowExceptions, extractExcerpt, convertMarkdownToHtml };
9
8
  export type { ValidationError as ParseError };
9
+ export { convertMarkdownToHtml, extractExcerpt, setNoFollowExceptions };
10
10
  export interface ParseMarkdownResult {
11
11
  post: Post | null;
12
12
  error: ValidationError | null;
@@ -1,17 +1,7 @@
1
1
  /**
2
2
  * Pagination utilities
3
3
  */
4
- export interface PaginationData {
5
- currentPage: number;
6
- totalPages: number;
7
- hasNextPage: boolean;
8
- hasPrevPage: boolean;
9
- nextPage: number | null;
10
- prevPage: number | null;
11
- pageSize: number;
12
- totalItems: number;
13
- pagePath: string;
14
- }
4
+ import type { PaginationData } from "../types";
15
5
  /**
16
6
  * Create pagination data for a list of items
17
7
  * @param items - Array of items to paginate
@@ -20,7 +10,7 @@ export interface PaginationData {
20
10
  * @param pagePath - Base path for pagination (e.g., "/", "/tags/tech/")
21
11
  * @returns Pagination data object
22
12
  */
23
- export declare function createPagination(items: readonly unknown[], currentPage: number, pageSize: number, pagePath: string): PaginationData;
13
+ export declare function createPagination<T>(items: readonly T[], currentPage: number, pageSize: number, pagePath: string): PaginationData;
24
14
  /**
25
15
  * Get paginated slice of items for a specific page
26
16
  * @param items - Array of items to paginate
@@ -28,7 +18,7 @@ export declare function createPagination(items: readonly unknown[], currentPage:
28
18
  * @param pageSize - Number of items per page
29
19
  * @returns Slice of items for the requested page
30
20
  */
31
- export declare function getPaginatedItems<T>(items: T[], page: number, pageSize: number): T[];
21
+ export declare function getPaginatedItems<T>(items: readonly T[], page: number, pageSize: number): T[];
32
22
  /**
33
23
  * Calculate total number of pages needed for items
34
24
  * @param totalItems - Total number of items
@@ -1,4 +1,4 @@
1
- import { ImageUploader, S3Config, SiteConfig, Uploader } from "../types";
1
+ import type { ImageUploader, S3Config, SiteConfig, Uploader } from "../types";
2
2
  /**
3
3
  * Bun-native S3 uploader implementation
4
4
  */
@@ -2,7 +2,7 @@
2
2
  * Schema generation factory
3
3
  * Simplifies creation of JSON-LD structured data for common page types
4
4
  */
5
- import type { SiteConfig, Post } from "../types";
5
+ import type { Post, SiteConfig } from "../types";
6
6
  /**
7
7
  * Options for generating collection page schemas (tag pages, year archives, etc.)
8
8
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bunki",
3
- "version": "0.19.6",
3
+ "version": "0.21.0",
4
4
  "description": "An opinionated static site generator built with Bun featuring PostCSS integration and modern web development workflows",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -12,10 +12,11 @@
12
12
  "test": "bun test",
13
13
  "test:coverage": "bun test --coverage --coverage-reporter=lcov",
14
14
  "test:watch": "bun test --watch",
15
- "format": "prettier --write .",
16
- "format:check": "prettier --check .",
15
+ "format": "biome format --write .",
16
+ "format:check": "biome format --check .",
17
+ "lint": "biome check .",
18
+ "lint:fix": "biome check --write .",
17
19
  "prepare": "husky",
18
- "lint-staged": "lint-staged",
19
20
  "typecheck": "bun tsc --noEmit",
20
21
  "clean": "rm -rf dist coverage",
21
22
  "prepack": "bun run clean && bun run build",
@@ -47,29 +48,28 @@
47
48
  },
48
49
  "homepage": "https://github.com/kahwee/bunki#readme",
49
50
  "dependencies": {
50
- "commander": "^14.0.3",
51
+ "commander": "^15.0.0",
51
52
  "gray-matter": "^4.0.3",
52
53
  "highlight.js": "^11.11.1",
53
- "marked": "17.0.5",
54
+ "marked": "^18.0.5",
54
55
  "marked-alert": "^2.1.2",
55
- "marked-highlight": "^2.2.3",
56
+ "marked-highlight": "^2.2.4",
56
57
  "nunjucks": "^3.2.4",
57
- "postcss": "^8.5.8",
58
+ "postcss": "^8.5.15",
58
59
  "postcss-cli": "^11.0.1",
59
- "sanitize-html": "2.17.2",
60
- "slugify": "^1.6.8"
60
+ "sanitize-html": "^2.17.5",
61
+ "slugify": "^1.6.9"
61
62
  },
62
63
  "devDependencies": {
63
- "@tailwindcss/postcss": "^4.2.2",
64
+ "@biomejs/biome": "^2.5.0",
65
+ "@tailwindcss/postcss": "^4.3.1",
64
66
  "@types/nunjucks": "^3.2.6",
65
67
  "@types/sanitize-html": "^2.16.1",
66
- "autoprefixer": "^10.4.27",
67
- "bun-types": "^1.3.11",
68
+ "autoprefixer": "^10.5.0",
69
+ "bun-types": "^1.3.14",
68
70
  "husky": "^9.1.7",
69
- "lint-staged": "^16.4.0",
70
- "prettier": "^3.8.1",
71
- "tailwindcss": "^4.2.2",
72
- "typescript": "^6.0.2"
71
+ "tailwindcss": "^4.3.1",
72
+ "typescript": "^6.0.3"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "postcss": "^8.0.0"
@@ -96,9 +96,6 @@
96
96
  "type": "github",
97
97
  "url": "https://github.com/sponsors/kahwee"
98
98
  },
99
- "lint-staged": {
100
- "**/*": "prettier --write --ignore-unknown"
101
- },
102
99
  "exports": {
103
100
  ".": {
104
101
  "types": "./dist/index.d.ts",