diff --git a/docs/bun.lockb b/docs/bun.lockb index f4d1a8e..18f4147 100755 Binary files a/docs/bun.lockb and b/docs/bun.lockb differ diff --git a/docs/package.json b/docs/package.json index e5d182e..a742e39 100644 --- a/docs/package.json +++ b/docs/package.json @@ -11,17 +11,17 @@ }, "devDependencies": { "@tailwindcss/typography": "^0.5.12", - "@types/node": "^20.11.30", + "@types/node": "^20.12.7", "@vercel/analytics": "^1.2.2", "autoprefixer": "^10.4.19", "domco": "../dist/domco", - "drab": "^5.3.6", + "drab": "^5.4.0", "prettier": "^3.2.5", - "prettier-plugin-tailwindcss": "^0.5.13", - "robino": "^0.1.0", + "prettier-plugin-tailwindcss": "^0.5.14", + "robino": "^0.2.0", "tailwindcss": "^3.4.3", - "typescript": "^5.4.3", - "uico": "^0.2.2", - "vite": "^5.2.7" + "typescript": "^5.4.5", + "uico": "^0.2.4", + "vite": "^5.2.9" } } diff --git a/docs/src/+config.ts b/docs/src/+config.ts index 73d8592..05429c2 100644 --- a/docs/src/+config.ts +++ b/docs/src/+config.ts @@ -1,12 +1,12 @@ import type { Config } from "domco"; -import { process } from "robino/util/md"; +import { processMarkdown } from "robino/util/md"; import fs from "fs/promises"; export const config: Config = { build: async ({ document }, { params }) => { params; const md = await fs.readFile("../README.md", "utf-8"); - const { html } = await process(md); + const { html } = await processMarkdown(md); const article = document.querySelector("article"); if (article) article.innerHTML = html; }, diff --git a/docs/src/docs/learn/+config.ts b/docs/src/docs/learn/+config.ts index d763ae0..374498f 100644 --- a/docs/src/docs/learn/+config.ts +++ b/docs/src/docs/learn/+config.ts @@ -1,11 +1,11 @@ import type { Config } from "domco"; -import { process } from "robino/util/md"; +import { processMarkdown } from "robino/util/md"; import fs from "node:fs/promises"; export const config: Config = { build: async ({ document }) => { const md = await fs.readFile(`src/docs/learn/index.md`, "utf-8"); - const { html } = await process(md); + const { html } = await processMarkdown(md); const article = document.querySelector("article"); if (article) article.innerHTML = html; }, diff --git a/docs/src/docs/modules/+config.ts b/docs/src/docs/modules/+config.ts index de769d8..c3c2476 100644 --- a/docs/src/docs/modules/+config.ts +++ b/docs/src/docs/modules/+config.ts @@ -1,11 +1,11 @@ import type { Config } from "domco"; -import { process } from "robino/util/md"; +import { processMarkdown } from "robino/util/md"; import fs from "node:fs/promises"; export const config: Config = { build: async ({ document }) => { const md = await fs.readFile(`../packages/domco/docs/modules.md`, "utf-8"); - const { html } = await process(md); + const { html } = await processMarkdown(md); const article = document.querySelector("article"); if (article) article.innerHTML = html; }, diff --git a/docs/src/test/[slug]/+config.ts b/docs/src/test/[slug]/+config.ts index e72b62a..4d720c2 100644 --- a/docs/src/test/[slug]/+config.ts +++ b/docs/src/test/[slug]/+config.ts @@ -1,16 +1,23 @@ // src/posts/[slug]/index.build.ts import { Config } from "domco"; -const params = [ - { slug: "first-post" }, - { slug: "second-post" }, - { slug: "third-post" }, -] as const; +/** + * Generates an array of objects with slugs from 1 to n. + * @param count The number of objects to generate. + * @returns An array of objects with slug properties. + */ +const generateSlugs = (count: number) => { + const params = []; + for (let i = 1; i <= count; i++) { + params.push({ slug: `${i}-post` }); + } + return params; +}; -export const config: Config = { - params, +export const config: Config = { + params: generateSlugs(2), build: ({ document }, { params }) => { const h1 = document.querySelector("h1"); - if (h1) h1.textContent = params.slug; // "first-post" | "second-post" | "third-post" + if (h1) h1.textContent = params.slug as string; }, }; diff --git a/packages/create-domco/bun.lockb b/packages/create-domco/bun.lockb index f1c8a38..333c05f 100755 Binary files a/packages/create-domco/bun.lockb and b/packages/create-domco/bun.lockb differ diff --git a/packages/create-domco/package.json b/packages/create-domco/package.json index 3384683..030f0b3 100644 --- a/packages/create-domco/package.json +++ b/packages/create-domco/package.json @@ -1,7 +1,7 @@ { "name": "create-domco", "description": "Create a new domco project", - "version": "0.0.38", + "version": "0.0.39", "type": "module", "types": "./index.d.ts", "main": "./index.js", @@ -27,11 +27,11 @@ "which-pm-runs": "^1.1.0" }, "devDependencies": { - "@types/node": "^20.11.20", + "@types/node": "^20.12.7", "@types/which-pm-runs": "^1.0.2", "prettier": "^3.2.5", - "robino": "^0.1.0", - "typescript": "^5.3.3" + "robino": "^0.2.0", + "typescript": "^5.4.5" }, "prettier": "robino/config/prettier" } diff --git a/packages/create-domco/template/index.ts b/packages/create-domco/template/index.ts index a67fb8b..1773e7e 100644 --- a/packages/create-domco/template/index.ts +++ b/packages/create-domco/template/index.ts @@ -1,4 +1,4 @@ -const domcoVersion = "0.5.4"; +const domcoVersion = "0.5.5"; export const getFiles = (options: { lang: string; @@ -26,18 +26,18 @@ export const getFiles = (options: { } }, "devDependencies": { - "@types/node": "^20.11.30", + "@types/node": "^20.12.7", "domco": "^${domcoVersion}",${prettier ? `\n\t\t"prettier": "^3.2.5",` : ""}${ prettier && tailwind - ? `\n\t\t"prettier-plugin-tailwindcss": "^0.5.13",` + ? `\n\t\t"prettier-plugin-tailwindcss": "^0.5.14",` : "" }${ tailwind ? `\n\t\t"tailwindcss": "^3.4.3",\n\t\t"autoprefixer": "^10.4.19",` : "" } - "typescript": "^5.3.3", - "vite": "^5.2.7" + "typescript": "^5.4.5", + "vite": "^5.2.9" } } `, diff --git a/packages/domco/bun.lockb b/packages/domco/bun.lockb index 9e9bec6..daa50ae 100755 Binary files a/packages/domco/bun.lockb and b/packages/domco/bun.lockb differ diff --git a/packages/domco/docs/modules.md b/packages/domco/docs/modules.md index 0a109c2..9a4cdac 100644 --- a/packages/domco/docs/modules.md +++ b/packages/domco/docs/modules.md @@ -56,7 +56,7 @@ export const config: Config = { #### Defined in -[types/index.ts:55](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/types/index.ts#L55) +[types/index.ts:55](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/types/index.ts#L55) ___ @@ -87,7 +87,7 @@ ___ #### Defined in -[types/index.ts:3](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/types/index.ts#L3) +[types/index.ts:3](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/types/index.ts#L3) ___ @@ -112,7 +112,7 @@ Context about the current page to utilize during the build. #### Defined in -[types/index.ts:16](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/types/index.ts#L16) +[types/index.ts:16](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/types/index.ts#L16) ___ @@ -137,7 +137,7 @@ ___ #### Defined in -[types/index.ts:69](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/types/index.ts#L69) +[types/index.ts:69](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/types/index.ts#L69) ___ @@ -147,7 +147,7 @@ ___ #### Defined in -[types/index.ts:67](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/types/index.ts#L67) +[types/index.ts:67](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/types/index.ts#L67) ## Functions @@ -188,4 +188,4 @@ export const config: Config = { #### Defined in -[helpers/addBlocks/index.ts:26](https://github.com/rossrobino/domco/blob/e31f172/packages/domco/helpers/addBlocks/index.ts#L26) +[helpers/addBlocks/index.ts:26](https://github.com/rossrobino/domco/blob/fd0be7bff9d3a3f5e06d1741a20d9eab79e187cb/packages/domco/helpers/addBlocks/index.ts#L26) diff --git a/packages/domco/package.json b/packages/domco/package.json index e833696..d44f371 100644 --- a/packages/domco/package.json +++ b/packages/domco/package.json @@ -1,7 +1,7 @@ { "name": "domco", "description": "Build-Time Rendering Without Templates", - "version": "0.5.4", + "version": "0.5.5", "type": "module", "keywords": [ "vite-plugin", @@ -39,20 +39,20 @@ "license": "MIT", "devDependencies": { "@types/html-minifier-terser": "^7.0.2", - "@types/node": "^20.11.20", - "@types/web": "^0.0.140", + "@types/node": "^20.12.7", + "@types/web": "^0.0.143", "prettier": "^3.2.5", - "robino": "^0.1.0", - "typedoc": "^0.25.8", + "robino": "^0.2.0", + "typedoc": "^0.25.13", "typedoc-plugin-markdown": "^3.17.1", - "typescript": "^5.3.3" + "typescript": "^5.4.5" }, "dependencies": { "@types/jsdom": "^21.1.6", - "esbuild": "^0.20.1", + "esbuild": "^0.20.2", "html-minifier-terser": "^7.2.0", "jsdom": "^24.0.0", - "vite": "^5.1.4" + "vite": "^5.2.9" }, "prettier": "robino/config/prettier" }