Skip to content

Commit f106ab0

Browse files
committed
🎉 feat: JSX and detect html tag automatically
1 parent f48f8c9 commit f106ab0

File tree

8 files changed

+623
-42
lines changed

8 files changed

+623
-42
lines changed

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# 0.6.1 - 8 Sep 2023
2+
Improvement:
3+
- Add support for JSX
4+
- Match any html tag
5+
6+
# 0.6.0 - 6 Aug 2023
7+
Improvement:
8+
- Add support for Elysia 0.6
9+
10+
# 0.6.0-rc.0 - 6 Aug 2023
11+
Improvement:
12+
- Add support for Elysia 0.6
13+
114
# 0.5.0 - 15 May 2023
215
- Add support for Elysia 0.5
316
- Add CommonJS support

bun.lockb

16.4 KB
Binary file not shown.
Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Elysia } from 'elysia'
2+
import { html } from '../src/index'
23

3-
import html from '../src/index'
4-
5-
const page = `<!DOCTYPE HTML>
4+
const page = `
65
<html lang="en">
76
<head>
87
<title>Hello World</title>
@@ -12,8 +11,20 @@ const page = `<!DOCTYPE HTML>
1211
</body>
1312
</html>`
1413

14+
const jsx = (
15+
<html lang="en">
16+
<head>
17+
<title>Hello World</title>
18+
</head>
19+
<body>
20+
<h1>Hello World</h1>
21+
</body>
22+
</html>
23+
)
24+
1525
const app = new Elysia()
1626
.use(html())
1727
.get('/', () => page)
28+
.get('/jsx', () => jsx)
1829
.get('/html', ({ html }) => html(page))
1930
.listen(8080)

package.json

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@elysiajs/html",
3-
"version": "0.5.2",
3+
"version": "0.6.1",
44
"description": "Plugin for Elysia that add support for returning html",
55
"author": {
66
"name": "saltyAom",
@@ -28,21 +28,29 @@
2828
"bugs": "https://github.com/elysiajs/elysia-html/issues",
2929
"license": "MIT",
3030
"scripts": {
31-
"dev": "bun run --hot example/index.ts",
31+
"dev": "bun run --watch example/index.tsx",
3232
"test": "bun wiptest && npm run test:node",
3333
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
3434
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
3535
"release": "npm run build && npm run test && npm publish --access public"
3636
},
3737
"peerDependencies": {
38-
"elysia": ">= 0.5.12"
38+
"elysia": ">= 0.6.0"
3939
},
4040
"devDependencies": {
41-
"@types/node": "^20.1.4",
42-
"bun-types": "^0.5.8",
43-
"elysia": "0.5.12",
44-
"eslint": "^8.40.0",
45-
"rimraf": "4.3",
46-
"typescript": "^5.0.4"
41+
"@types/node": "^20.5.9",
42+
"@types/react": "^18.2.21",
43+
"bun-types": "^0.8.1",
44+
"elysia": "0.6.19",
45+
"eslint": "^8.48.0",
46+
"hono": "^3.5.8",
47+
"rimraf": "4.3.1",
48+
"typescript": "^5.2.2"
49+
},
50+
"dependencies": {
51+
"@types/sanitize-html": "^2.9.0",
52+
"react": "^18.2.0",
53+
"sanitize-html": "^2.11.0",
54+
"typed-html": "^3.0.1"
4755
}
4856
}

0 commit comments

Comments
 (0)