Skip to content

Commit 85726af

Browse files
committed
feat: ts-alias support
1 parent 40d9b07 commit 85726af

File tree

26 files changed

+344
-187
lines changed

26 files changed

+344
-187
lines changed

examples/simple-ts/.config/servers.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ servers:
55
plugin: '@ckenx/kenx-http'
66
key: 'default' # Optional value
77
HOST: 0.0.0.0
8-
PORT: '[env]:PORT'
9-
application: '[frameworks]:fastify-app'
8+
PORT: '[env]:HTTP_PORT'
9+
application: '[frameworks]:express-app'
1010

1111
# Socket.io server configurations
1212
- type: 'socketio'
@@ -22,11 +22,10 @@ servers:
2222
# Vite server configurations
2323
- type: 'vite'
2424
plugin: '@ckenx/kenx-vite'
25-
PORT: 8000
25+
HOST: 0.0.0.0
26+
PORT: '[env]:VITE_PORT'
2627
# bindTo: 'http:default'
27-
# adapter: '[databases]:redis-db'
28-
# options:
29-
# cookie: false
30-
# allowEIO3: true
31-
# serveClient: true
32-
# connectTimeout: 15000
28+
builder: true
29+
options:
30+
root: './src/views'
31+
appType: 'custom' # spa, mpa, custom

examples/simple-ts/.env.dev

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/simple-ts/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"@ckenx/kenx-mongodb": "*",
1919
"@ckenx/kenx-mysql": "*",
2020
"@ckenx/kenx-routing": "*",
21-
"@ckenx/kenx-socketio": "*"
21+
"@ckenx/kenx-socketio": "*",
22+
"@ckenx/kenx-vite": "*"
2223
}
2324
}

examples/simple-ts/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { ServerPlugin, DatabasePlugin } from '../../../packages/node/dist/types'
22
import type http from 'http'
33
import type io from 'socket.io'
4-
import routes from './routes'
4+
import routes from '#routes/index'
55

66
// Export const takeover = ['http', 'socketio', 'database:*']
77

@@ -36,7 +36,6 @@ export default async ( http: ServerPlugin<http.Server>, io: io.Server, databases
3636
// Add fastify middleware
3737
.use( async ( req: any, res: any ) => {
3838
console.log('-- Middleware --')
39-
4039
// Test session
4140
req.session.name = 'Bob'
4241
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<h1>Vite in %MODE% mode</h1>

examples/simple-ts/tsconfig.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010
"skipLibCheck": true,
1111
"resolveJsonModule": true,
1212
"forceConsistentCasingInFileNames": true,
13-
"moduleResolution": "node"
13+
"moduleResolution": "node",
14+
"baseUrl": "src",
15+
"paths": {
16+
"#routes/*": ["routes/*"]
17+
}
18+
},
19+
"ts-node": {
20+
"require": ["tsconfig-paths/register"]
1421
}
1522
}

0 commit comments

Comments
 (0)