diff --git a/README.md b/README.md index 16b9de0..b836e9d 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,11 @@ deno run --allow-net main.tsx Resulting `index.html`: ```html -

Hello, World!

This is a paragraph.

@fartlabs/htx + +

Hello, World!

+

This is a paragraph.

+ @fartlabs/htx + ``` ## Contribute diff --git a/cli/codegen.ts b/cli/codegen.ts index 8aca3e8..62d15cd 100644 --- a/cli/codegen.ts +++ b/cli/codegen.ts @@ -1,5 +1,5 @@ import { Project } from "ts-morph"; -import { getDescriptors, toDocs } from "@fartlabs/ht/cli/codegen.ts"; +import { getDescriptors, toDocs } from "@fartlabs/ht/cli/codegen"; if (import.meta.main) { const project = new Project(); @@ -65,7 +65,6 @@ if (import.meta.main) { undefined, { overwrite: true }, ); - modFile.addStatements(`export * from "./special/mod.ts";`); for (const descriptor of descriptors) { modFile.addStatements(`export * from "./${descriptor.tag}.tsx";`); } @@ -78,6 +77,8 @@ if (import.meta.main) { denoConfig.exports = { ".": "./mod.ts", "./jsx-runtime": "./jsx-runtime.ts", + "./render": "./render.ts", + "./global-attributes": "./global-attributes.ts", ...Object.fromEntries(descriptors.map((descriptor) => [ `./${descriptor.tag}`, `./${descriptor.tag}.tsx`, @@ -86,9 +87,10 @@ if (import.meta.main) { await Deno.writeTextFile("./deno.json", JSON.stringify(denoConfig, null, 2)); // Run `deno fmt` on the generated files. - const command = new Deno.Command(Deno.execPath(), { - args: ["fmt", "./"], - }); + const command = new Deno.Command( + Deno.execPath(), + { args: ["fmt", "./"] }, + ); const output = await command.output(); if (!output.success) { throw new Error(new TextDecoder().decode(output.stderr)); diff --git a/css.ts b/css.ts new file mode 100644 index 0000000..5b6ea78 --- /dev/null +++ b/css.ts @@ -0,0 +1 @@ +export * from "@fartlabs/ht/css.ts"; diff --git a/deno.json b/deno.json index ba45508..040d60f 100644 --- a/deno.json +++ b/deno.json @@ -1,9 +1,9 @@ { "lock": false, "name": "@fartlabs/htx", - "version": "0.0.7", + "version": "0.0.9", "imports": { - "@fartlabs/ht": "jsr:@fartlabs/ht@^0.0.7", + "@fartlabs/ht": "jsr:@fartlabs/ht@^0.0.9", "@fartlabs/jsonx": "jsr:@fartlabs/jsonx@^0.0.11", "ts-morph": "npm:ts-morph@^24.0.0" }, @@ -18,6 +18,8 @@ "exports": { ".": "./mod.ts", "./jsx-runtime": "./jsx-runtime.ts", + "./render": "./render.ts", + "./global-attributes": "./global-attributes.ts", "./a": "./a.tsx", "./abbr": "./abbr.tsx", "./acronym": "./acronym.tsx", diff --git a/global-attributes.ts b/global-attributes.ts new file mode 100644 index 0000000..5e5711e --- /dev/null +++ b/global-attributes.ts @@ -0,0 +1 @@ +export * from "@fartlabs/ht/lib/global-attributes"; diff --git a/mod.ts b/mod.ts index 4f77a2e..c8c12da 100644 --- a/mod.ts +++ b/mod.ts @@ -1,4 +1,3 @@ -export * from "./special/mod.ts"; export * from "./a.tsx"; export * from "./abbr.tsx"; export * from "./acronym.tsx"; diff --git a/render.ts b/render.ts new file mode 100644 index 0000000..116792b --- /dev/null +++ b/render.ts @@ -0,0 +1 @@ +export * from "@fartlabs/ht/lib/render"; diff --git a/special/mod.ts b/special/mod.ts deleted file mode 100644 index 10c38f7..0000000 --- a/special/mod.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./text_node.ts"; diff --git a/special/text_node.ts b/special/text_node.ts deleted file mode 100644 index fe6fb64..0000000 --- a/special/text_node.ts +++ /dev/null @@ -1,6 +0,0 @@ -/** - * TextNode component renders a text node. A text node is a string of text that is not an element. - */ -export function TextNode(props: { children?: string[] } = {}): string { - return props.children?.join("") ?? ""; -}