dashboard ioc fix

This commit is contained in:
Ben Allfree 2024-10-04 06:06:50 -07:00
parent 4c43f9edc5
commit c13a493e5b
5 changed files with 13 additions and 20 deletions

View File

@ -6,7 +6,7 @@
"scripts": { "scripts": {
"check:types": "svelte-check", "check:types": "svelte-check",
"preview": "npx http-server@latest ../../dist/dashboard -P \"http://localhost:8080?\"", "preview": "npx http-server@latest ../../dist/dashboard -P \"http://localhost:8080?\"",
"dev": "vite dev --force --host=0.0.0.0 --port=5174", "dev": "vite dev",
"build": "NODE_ENV=production vite build", "build": "NODE_ENV=production vite build",
"lint": "prettier --check .", "lint": "prettier --check .",
"format": "prettier --write ." "format": "prettier --write ."

View File

@ -9,7 +9,7 @@ import { InstanceFields } from 'pockethost/common'
// The apex domain of this whole operation. // The apex domain of this whole operation.
export const PUBLIC_APEX_DOMAIN = export const PUBLIC_APEX_DOMAIN =
import.meta.env.PUBLIC_APEX_DOMAIN || `pockethost.lvh.me` import.meta.env.PUBLIC_APEX_DOMAIN || `pockethost.io`
// The domain name where this dashboard lives // The domain name where this dashboard lives
export const PUBLIC_APP_URL = export const PUBLIC_APP_URL =

View File

@ -1,12 +0,0 @@
import { LoggerService, LogLevelName } from 'pockethost/common'
import { PUBLIC_DEBUG } from './env'
// Initiate the logging service
// TODO: Document this
try {
LoggerService()
} catch {
LoggerService({
level: PUBLIC_DEBUG ? LogLevelName.Debug : LogLevelName.Info,
})
}

View File

@ -1,19 +1,23 @@
import { PUBLIC_DEBUG } from '$src/env'
import { client } from '$src/pocketbase-client' import { client } from '$src/pocketbase-client'
import consoleLogger from '@pockethost/plugin-console-logger'
import { import {
ConsoleLogger,
LogLevelName,
SubscriptionType, SubscriptionType,
UserFields, UserFields,
loadPlugins, ioc,
type InstanceFields, type InstanceFields,
type InstanceId, type InstanceId,
type UnsubscribeFunc, type UnsubscribeFunc,
} from 'pockethost/common' } from 'pockethost/common'
import { writable } from 'svelte/store' import { writable } from 'svelte/store'
// TODO: Removing this will cause the app to crash
// Theres a reference inside of `createPocketbaseClient.ts` that needs the information that comes from this file
import '../services'
loadPlugins([consoleLogger]) ioc(
`logger`,
new ConsoleLogger({
level: PUBLIC_DEBUG ? LogLevelName.Debug : LogLevelName.Info,
}),
)
const { onAuthChange } = client() const { onAuthChange } = client()

View File

@ -12,6 +12,7 @@ const config: UserConfig = {
server: { server: {
port: 5174, port: 5174,
strictPort: true, strictPort: true,
host: 'app.pockethost.lvh.me',
hmr: { hmr: {
clientPort: 5174, clientPort: 5174,
}, },