-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
105 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
import { Elysia } from 'elysia' | ||
import { html } from '../src' | ||
|
||
new Elysia() | ||
.use(html()) | ||
.get('/0.7', () => <h1>Hello World</h1>) | ||
const app = new Elysia() | ||
.use(html({ autoDetect: true })) | ||
.get('/a', ({ html }) => html(`<h1>Hello World</h1>`)) | ||
.compile() | ||
|
||
console.log(app.routes[0]?.composed?.toString()) | ||
|
||
app.handle(new Request('http://localhost:8080/a')) | ||
.then((x) => x.text()) | ||
.then(console.log) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,78 @@ | ||
{ | ||
"name": "@elysiajs/html", | ||
"version": "0.8.0-rc.1", | ||
"description": "Plugin for Elysia that add support for returning html", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "[email protected]" | ||
"name": "@elysiajs/html", | ||
"version": "0.8.0-rc.0", | ||
"description": "Plugin for Elysia that add support for returning html", | ||
"author": { | ||
"name": "saltyAom", | ||
"url": "https://github.com/SaltyAom", | ||
"email": "[email protected]" | ||
}, | ||
"main": "./dist/index.js", | ||
"exports": { | ||
".": { | ||
"bun": "./dist/index.js", | ||
"node": "./dist/cjs/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
"main": "./dist/index.js", | ||
"exports": { | ||
".": { | ||
"bun": "./dist/index.js", | ||
"node": "./dist/cjs/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"import": "./dist/index.js", | ||
"default": "./dist/index.js" | ||
}, | ||
"./htmx": { | ||
"bun": "./dist/html.js", | ||
"node": "./dist/cjs/htmx.js", | ||
"require": "./dist/cjs/htmx.js", | ||
"import": "./dist/htmx.js", | ||
"default": "./dist/htmx.js" | ||
}, | ||
"./hotwire": { | ||
"bun": "./dist/hotwire.js", | ||
"node": "./dist/cjs/hotwire.js", | ||
"require": "./dist/cjs/hotwire.js", | ||
"import": "./dist/hotwire.js", | ||
"default": "./dist/hotwire.js" | ||
} | ||
"./htmx": { | ||
"bun": "./dist/html.js", | ||
"node": "./dist/cjs/htmx.js", | ||
"require": "./dist/cjs/htmx.js", | ||
"import": "./dist/htmx.js", | ||
"default": "./dist/htmx.js" | ||
}, | ||
"types": "./src/index.ts", | ||
"keywords": [ | ||
"elysia", | ||
"html" | ||
], | ||
"homepage": "https://github.com/elysiajs/elysia-html", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-html" | ||
}, | ||
"bugs": "https://github.com/elysiajs/elysia-html/issues", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --watch example/index.tsx", | ||
"test": "bun test && npm run test:node", | ||
"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", | ||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json", | ||
"release": "npm run build && npm run test && npm publish --access public", | ||
"format": "prettier --write ." | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 0.8.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"@elysiajs/stream": "^0.7.2", | ||
"@types/node": "^20.7.2", | ||
"bun-types": "^1.0.3", | ||
"elysia": "0.8.0-rc.0", | ||
"eslint": "^8.50.0", | ||
"rimraf": "^5.0.5", | ||
"typescript": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@kitajs/html": "^3.0.2", | ||
"@kitajs/ts-html-plugin": "^1.2.0" | ||
"./hotwire": { | ||
"bun": "./dist/hotwire.js", | ||
"node": "./dist/cjs/hotwire.js", | ||
"require": "./dist/cjs/hotwire.js", | ||
"import": "./dist/hotwire.js", | ||
"default": "./dist/hotwire.js" | ||
} | ||
}, | ||
"types": "./src/index.ts", | ||
"keywords": [ | ||
"elysia", | ||
"html" | ||
], | ||
"homepage": "https://github.com/elysiajs/elysia-html", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/elysiajs/elysia-html" | ||
}, | ||
"bugs": "https://github.com/elysiajs/elysia-html/issues", | ||
"license": "MIT", | ||
"scripts": { | ||
"dev": "bun run --watch example/index.tsx", | ||
"test": "bun test && npm run test:node", | ||
"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", | ||
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json", | ||
"release": "npm run build && npm run test && npm publish --access public", | ||
"format": "prettier --write ." | ||
}, | ||
"peerDependencies": { | ||
"elysia": ">= 0.8.0-rc.0" | ||
}, | ||
"devDependencies": { | ||
"@elysiajs/stream": "^0.7.2", | ||
"@types/node": "^20.7.2", | ||
"bun-types": "^1.0.3", | ||
"elysia": "0.8.0-rc.2", | ||
"eslint": "^8.50.0", | ||
"rimraf": "^5.0.5", | ||
"typescript": "^5.2.2" | ||
}, | ||
"dependencies": { | ||
"@kitajs/html": "^3.0.2", | ||
"@kitajs/ts-html-plugin": "^1.2.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"@kitajs/html": { | ||
"optional": true | ||
}, | ||
"peerDependenciesMeta": { | ||
"@kitajs/html": { | ||
"optional": true | ||
}, | ||
"@kitajs/ts-html-plugin": { | ||
"optional": true | ||
} | ||
"@kitajs/ts-html-plugin": { | ||
"optional": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters