miolo 3.0.0-beta.206 → 3.0.0-beta.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miolo",
3
- "version": "3.0.0-beta.206",
3
+ "version": "3.0.0-beta.207",
4
4
  "description": "all-in-one koa-based server",
5
5
  "author": "Donato Lorenzo <donato@afialapis.com>",
6
6
  "contributors": [
@@ -25,6 +25,7 @@ export async function init_ssr_render_middleware(app, config, devRender = undefi
25
25
  port: httpConfig?.port,
26
26
  catcher_url: httpConfig?.catcher_url,
27
27
  auth_method: ctx.session?.auth_method,
28
+ log_level: ctx.miolo.logger.level,
28
29
  login_url:
29
30
  ctx.session?.auth_method === "google"
30
31
  ? authConfig?.passport?.google_url_login
@@ -45,9 +45,9 @@
45
45
  "intre": "^3.0.0-beta.4",
46
46
  "joi": "^18.2.1",
47
47
  "lucide-react": "^1.17.0",
48
- "miolo-cli": "^3.0.0-beta.206",
48
+ "miolo-cli": "^3.0.0-beta.207",
49
49
  "miolo-model": "file:../miolo-model",
50
- "miolo-react": "^3.0.0-beta.206",
50
+ "miolo-react": "^3.0.0-beta.207",
51
51
  "next-themes": "^0.4.6",
52
52
  "radix-ui": "^1.4.3",
53
53
  "react": "^19.2.7",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  "devDependencies": {
64
64
  "@biomejs/biome": "2.4.16",
65
- "miolo": "^3.0.0-beta.206",
65
+ "miolo": "^3.0.0-beta.207",
66
66
  "sass-embedded": "^1.100.0"
67
67
  },
68
68
  "overrides": {
@@ -1,3 +1,4 @@
1
+ import { useMioloContext } from "miolo-react"
1
2
  import { useCallback, useEffect, useState } from "react"
2
3
  import useSessionContext from "#cli/context/session/useSessionContext.mjs"
3
4
  import useUIContext from "#cli/context/ui/useUIContext.mjs"
@@ -6,6 +7,7 @@ import TodosContext from "./TodosContext.jsx"
6
7
 
7
8
  const TodosProvider = ({ children }) => {
8
9
  // const [status, setStatus] = useState("loaded")
10
+ const { logger } = useMioloContext()
9
11
  const { useSsrData, fetcher, socket, authenticated } = useSessionContext()
10
12
  const { toast } = useUIContext()
11
13
  const [useCrud, setUseCrud] = useState(true)
@@ -152,14 +154,14 @@ const TodosProvider = ({ children }) => {
152
154
  setSocketInited(true)
153
155
 
154
156
  socket.on("connect", () => {
155
- console.log("Connected to server!")
157
+ logger.info("Connected to server!")
156
158
  })
157
159
 
158
160
  socket.on("todos-update", (data) => {
159
- console.log("TODOS UPDATED!!!")
160
- console.log(data)
161
+ logger.info("TODOS UPDATED!!!")
162
+ logger.info(data)
161
163
  })
162
- }, [socket, socketInited])
164
+ }, [socket, socketInited, logger])
163
165
 
164
166
  return (
165
167
  <TodosContext.Provider
@@ -1,38 +0,0 @@
1
- import { cyan, gray_light, red, yellow } from "tinguir"
2
-
3
- function _msg(msg, prefix) {
4
- const _m = typeof msg === "string" ? msg : JSON.stringify(msg || "")
5
- return `${prefix ? `[${prefix}]` : ""} ${_m}`
6
- }
7
-
8
- // export function mioloLog(msg, prefix = 'app') {
9
- // console.log(`\u001b[0;34m${_msg(msg, prefix)}\u001b[0;39m`)
10
- // }
11
- //
12
- // export function mioloLogDebug(msg, prefix = 'app') {
13
- // console.log(`\u001b[38;5;244m${_msg(msg, prefix)}\u001b[38;5;39m`)
14
- // }
15
- //
16
- // export function mioloWarn(msg, prefix = 'app') {
17
- // console.log(`\u001b[0;31m${_msg(msg, prefix)}\u001b[0;39m`)
18
- // }
19
- //
20
- // export function mioloError(msg, prefix = 'app') {
21
- // console.log(`\u001b[0;31m${_msg(msg, prefix)}\u001b[0;39m`)
22
- // }
23
-
24
- export function mioloLogDebug(msg, prefix = "app") {
25
- console.log(gray_light(_msg(msg, prefix)))
26
- }
27
-
28
- export function mioloLog(msg, prefix = "app") {
29
- console.log(cyan(_msg(msg, prefix)))
30
- }
31
-
32
- export function mioloWarn(msg, prefix = "app") {
33
- console.log(yellow(_msg(msg, prefix)))
34
- }
35
-
36
- export function mioloError(msg, prefix = "app") {
37
- console.log(red(_msg(msg, prefix)))
38
- }