diff --git a/.github/workflows/actions.yaml b/.github/workflows/actions.yaml index 69047a5..0120a52 100644 --- a/.github/workflows/actions.yaml +++ b/.github/workflows/actions.yaml @@ -46,5 +46,11 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: denoland/setup-deno@v2 + with: + deno-version: v2.x + + - run: deno task tsc + - name: Publish package - run: npx jsr publish + run: deno publish diff --git a/.gitignore b/.gitignore index f6f5c18..554bea6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ /.vscode /coverage /docs +/node_modules +/dist diff --git a/.hooks/pre-commit b/.hooks/pre-commit new file mode 100755 index 0000000..b5576b8 --- /dev/null +++ b/.hooks/pre-commit @@ -0,0 +1,6 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/hook.sh" + +deno fmt --check +deno lint +deno test --allow-all --doc diff --git a/deno.json b/deno.json index 483f83b..6dc4724 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@sander/html", - "version": "0.1.6", + "version": "0.1.10", "license": "MIT", "exports": "./mod.ts", "tasks": { @@ -9,12 +9,16 @@ "doc": "deno doc --html html.ts", "coverage": "rm -Rf ./coverage && deno test --coverage && deno coverage ./coverage", "coverage:html": "rm -Rf ./coverage && deno test --coverage && deno coverage ./coverage --html", - "embed:example": "deno run -A embed_example.ts" + "embed:example": "deno run -A embed_example.ts", + "tsc": "deno run -A npm:typescript/tsc --project tsconfig.json && deno fmt dist", + "hook": "deno run --allow-read --allow-run --allow-write https://deno.land/x/deno_hooks@0.1.1/mod.ts" }, "authors": [ "Sander Hahn " ], "imports": { - "@std/assert": "jsr:@std/assert@^1.0.10" - } + "@std/assert": "jsr:@std/assert@^1.0.10", + "typescript": "npm:typescript@^5.7.3" + }, + "nodeModulesDir": "auto" } diff --git a/deno.lock b/deno.lock index f2401c9..a14a83d 100644 --- a/deno.lock +++ b/deno.lock @@ -3,7 +3,9 @@ "specifiers": { "jsr:@std/assert@*": "1.0.10", "jsr:@std/assert@^1.0.10": "1.0.10", - "jsr:@std/internal@^1.0.5": "1.0.5" + "jsr:@std/internal@^1.0.5": "1.0.5", + "npm:typescript@*": "5.7.3", + "npm:typescript@^5.7.3": "5.7.3" }, "jsr": { "@std/assert@1.0.10": { @@ -16,9 +18,15 @@ "integrity": "54a546004f769c1ac9e025abd15a76b6671ddc9687e2313b67376125650dc7ba" } }, + "npm": { + "typescript@5.7.3": { + "integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==" + } + }, "workspace": { "dependencies": [ - "jsr:@std/assert@^1.0.10" + "jsr:@std/assert@^1.0.10", + "npm:typescript@^5.7.3" ] } } diff --git a/mod.ts b/mod.ts index 0fdd3c2..4903686 100644 --- a/mod.ts +++ b/mod.ts @@ -1 +1,9 @@ -export { html, type HtmlNode, tag, type ToHtml } from "./html.ts"; +export { + comment, + escapeHtml, + html, + type HtmlNode, + raw, + tag, + type ToHtml, +} from "./html.ts"; diff --git a/package.json b/package.json new file mode 100644 index 0000000..b9accf1 --- /dev/null +++ b/package.json @@ -0,0 +1,12 @@ +{ + "name": "@sander/html", + "type": "module", + "main": "./dist/html.js", + "exports": { + ".": { + "import": "./dist/html.js", + "require": "./dist/html.js", + "types": "./dist/html.d.ts" + } + } +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..353694d --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "compilerOptions": { + "strict": true, + "sourceMap": true, + "declaration": true, + "declarationMap": true, + "target": "ES2021", + "lib": [ + "ES2021", + "ES2016.Array.Include", + "DOM" + ], + "module": "ESNext", + "outDir": "./dist", + "allowSyntheticDefaultImports": true + }, + "include": [ + "**/*.ts" + ], + "exclude": [ + "node_modules", + "dist", + "mod.ts", + "**/*_test.ts", + "**/*example.ts" + ] +}