Skip to content

Commit

Permalink
refactor(preview):
Browse files Browse the repository at this point in the history
1. update version of dependencies
2. refactor on start function and on stop function
  • Loading branch information
trylovetom committed Jan 23, 2024
1 parent 5f98449 commit 1fdea43
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 22 deletions.
Binary file modified bun.lockb
Binary file not shown.
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "elysiajs-nuxt",
"version": "0.3.10",
"version": "0.3.11",
"license": "MIT",
"author": "CHANG, TZU-YEN <[email protected]> (https://github.com/trylovetom)",
"homepage": "https://github.com/trylovetom/elysiajs-nuxt",
Expand All @@ -20,22 +20,22 @@
"tool:lint": "prettier '**/*' --check --ignore-unknown && eslint '**/*.{js,jsx,ts,tsx,vue}'"
},
"peerDependencies": {
"elysia": "^0.8.8",
"nuxt": "^3.9.1",
"elysia": "^0.8.9",
"nuxt": "^3.9.3",
"typescript": "^5.3.3"
},
"devDependencies": {
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@types/bun": "latest",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"elysia": "^0.8.8",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"elysia": "^0.8.9",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"eslint-plugin-prettier": "^5.1.3",
"nitropack": "^2.8.1",
"nuxt": "^3.9.1",
"prettier": "^3.1.1",
"nuxt": "^3.9.3",
"prettier": "^3.2.4",
"prettier-package-json": "^2.8.0",
"typescript": "^5.3.3"
},
Expand Down
Binary file modified preview/bun.lockb
Binary file not shown.
14 changes: 7 additions & 7 deletions preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
"tool:lint": "prettier '**/*' --check --ignore-unknown && eslint '**/*.{js,jsx,ts,tsx,vue}'"
},
"dependencies": {
"elysia": "^0.8.8",
"elysia": "^0.8.9",
"elysiajs-nuxt": "link:elysiajs-nuxt"
},
"devDependencies": {
"@elysiajs/eden": "^0.8.0",
"@nuxt/devtools": "^1.0.6",
"@elysiajs/eden": "^0.8.1",
"@nuxt/devtools": "^1.0.8",
"@nuxtjs/eslint-config-typescript": "^12.1.0",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"@typescript-eslint/eslint-plugin": "^6.19.1",
"@typescript-eslint/parser": "^6.19.1",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.2",
"nuxt": "^3.9.1",
"eslint-plugin-prettier": "^5.1.3",
"nuxt": "^3.9.3",
"prettier-package-json": "^2.8.0",
"typescript": "^5.3.3"
}
Expand Down
10 changes: 4 additions & 6 deletions preview/src-server/index.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
import { Elysia } from 'elysia'
import elysiaNuxt from 'elysiajs-nuxt'

const detail = `[${import.meta.file}]:`
const application = new Elysia()
.onStart(function onStart(app) {
.onStart(function onStart({ server }) {
const startAt = new Date()
console.info(
`[${import.meta.file}]: server started at ${startAt.toISOString()} (${app
.server?.hostname}:${app.server?.port}).`
`${detail} server started at ${startAt.toISOString()} (${server?.url}).`
)
})
.onStop(function onStop() {
const startAt = new Date()
console.info(
`[${import.meta.file}]: server stop at ${startAt.toISOString()}.`
)
console.info(`${detail} server stop at ${startAt.toISOString()}.`)
})
.use(elysiaNuxt)
.get('/api/message', () => ({ message: 'THIS IS THE WAY!' }))
Expand Down

0 comments on commit 1fdea43

Please sign in to comment.