mirror of
https://github.com/pockethost/pockethost.git
synced 2025-03-30 15:08:30 +00:00
Lint fix
This commit is contained in:
parent
a0fe228c81
commit
fd2d9ae826
2
.github/workflows/pockethost.yaml
vendored
2
.github/workflows/pockethost.yaml
vendored
@ -16,4 +16,4 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: yarn
|
||||
- run: yarn prettier:check
|
||||
- run: yarn lint
|
||||
|
@ -1 +1,2 @@
|
||||
.svelte-kit
|
||||
.svelte-kit
|
||||
dist
|
@ -5,8 +5,8 @@
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"prettier:check": "prettier -c \"./**/*.ts\"",
|
||||
"prettier:fix": "prettier -w \"./**/*.ts\"",
|
||||
"lint": "prettier -c \"./**/*.ts\"",
|
||||
"lint:fix": "prettier -w \"./**/*.ts\"",
|
||||
"build": "concurrently 'yarn build:pocketbase' 'yarn build:daemon' 'yarn build:www'",
|
||||
"build:pocketbase": "cd packages/pocketbase && yarn build",
|
||||
"build:daemon": "cd packages/daemon && yarn build",
|
||||
|
@ -1,42 +1,40 @@
|
||||
import { emitter, NativePocketBaseEvents } from './index'
|
||||
// import { emitter, NativePocketBaseEvents } from './index'
|
||||
|
||||
// export const CoreMiddleware = {
|
||||
// requireAdminOrUserAuth: () => 'RequireAdminOrUserAuth',
|
||||
// }
|
||||
|
||||
export const CoreMiddleware = {
|
||||
requireAdminOrUserAuth: () => 'RequireAdminOrUserAuth',
|
||||
}
|
||||
// export type JsMiddlewareToken = string
|
||||
|
||||
export type JsMiddlewareToken = string
|
||||
// export type JsHttpRoutePath = string
|
||||
|
||||
export type JsHttpRoutePath = string
|
||||
// export type JsAddRouteConfig = {
|
||||
// method: HttpMethods
|
||||
// path: JsHttpRoutePath
|
||||
// handler: (context: HttpRequestContext) => void
|
||||
// middlewares: JsMiddlewareToken[]
|
||||
// }
|
||||
|
||||
export type JsAddRouteConfig = {
|
||||
method: HttpMethods
|
||||
path: JsHttpRoutePath
|
||||
handler: (context: HttpRequestContext) => void
|
||||
middlewares: JsMiddlewareToken[]
|
||||
}
|
||||
// export type OnBeforeServeEvent = {
|
||||
// Router: {
|
||||
// addRoute: (config: JsAddRouteConfig) => void
|
||||
// }
|
||||
// }
|
||||
|
||||
export type OnBeforeServeEvent = {
|
||||
Router: {
|
||||
addRoute: (config: JsAddRouteConfig) => void
|
||||
}
|
||||
}
|
||||
// export const onBeforeServe = (cb: (e: OnBeforeServeEvent) => void) => {
|
||||
// emitter.on(NativePocketBaseEvents.OnBeforeServe, cb)
|
||||
// }
|
||||
|
||||
export const onBeforeServe = (cb: (e: OnBeforeServeEvent) => void) => {
|
||||
emitter.on(NativePocketBaseEvents.OnBeforeServe, cb)
|
||||
}
|
||||
|
||||
|
||||
export const dispatchObBeforeServe = ()=>{
|
||||
case NativePocketBaseEvents.OnBeforeServe:
|
||||
const e: OnBeforeServeEvent = {
|
||||
Router: {
|
||||
addRoute: (config) => {
|
||||
const packed = pack(config)
|
||||
console.log(`Sending config back ${packed}`)
|
||||
__go_addRoute(packed)
|
||||
},
|
||||
},
|
||||
}
|
||||
emitter.emit(eventName, e)
|
||||
}
|
||||
// export const dispatchObBeforeServe = ()=>{
|
||||
// case NativePocketBaseEvents.OnBeforeServe:
|
||||
// const e: OnBeforeServeEvent = {
|
||||
// Router: {
|
||||
// addRoute: (config) => {
|
||||
// const packed = pack(config)
|
||||
// console.log(`Sending config back ${packed}`)
|
||||
// __go_addRoute(packed)
|
||||
// },
|
||||
// },
|
||||
// }
|
||||
// emitter.emit(eventName, e)
|
||||
// }
|
||||
|
Loading…
x
Reference in New Issue
Block a user