miolo 3.0.0-beta.205 → 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.
@@ -28,7 +28,10 @@ export function transformPackageJson(content, appName) {
28
28
 
29
29
  // Then, replace file:../ references with npm versions
30
30
  const version = getMioloVersion()
31
- transformed = transformed.replace(/"file:\.\.\/(miolo-cli|miolo-react|miolo)"/g, `"${version}"`)
31
+ transformed = transformed.replace(
32
+ /"file:\.\.\/(miolo-cli|miolo-react|miolo-model|miolo)"/g,
33
+ `"${version}"`
34
+ )
32
35
 
33
36
  return transformed
34
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "miolo",
3
- "version": "3.0.0-beta.205",
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": [
@@ -44,17 +44,17 @@
44
44
  "prepublishOnly": "npm run lint && npm run dist"
45
45
  },
46
46
  "dependencies": {
47
- "@babel/plugin-proposal-decorators": "^7.29.0",
48
- "@babel/preset-env": "^7.29.5",
49
- "@babel/preset-react": "^7.28.5",
50
- "@dotenvx/dotenvx": "^1.67.0",
47
+ "@babel/plugin-proposal-decorators": "^7.29.7",
48
+ "@babel/preset-env": "^7.29.7",
49
+ "@babel/preset-react": "^7.29.7",
50
+ "@dotenvx/dotenvx": "^1.71.0",
51
51
  "@koa/bodyparser": "^6.1.0",
52
52
  "@koa/cors": "^5.0.0",
53
- "@koa/router": "^15.5.0",
53
+ "@koa/router": "^15.6.0",
54
54
  "@maxmind/geoip2-node": "^6.3.4",
55
55
  "@rollup/plugin-alias": "^6.0.0",
56
- "@rollup/plugin-babel": "^7.0.0",
57
- "@rollup/plugin-commonjs": "^29.0.2",
56
+ "@rollup/plugin-babel": "^7.1.0",
57
+ "@rollup/plugin-commonjs": "^29.0.3",
58
58
  "@rollup/plugin-json": "^6.1.0",
59
59
  "@rollup/plugin-node-resolve": "^16.0.3",
60
60
  "@rollup/plugin-replace": "^6.0.3",
@@ -83,10 +83,10 @@
83
83
  "koa-session": "^7.0.2",
84
84
  "koa-static": "^5.0.0",
85
85
  "nanoid": "^5.1.11",
86
- "nodemailer": "^8.0.8",
86
+ "nodemailer": "^8.0.10",
87
87
  "passport-google-oauth20": "^2.0.0",
88
88
  "passport-local": "^1.0.0",
89
- "rollup": "^4.60.4",
89
+ "rollup": "^4.61.0",
90
90
  "rollup-plugin-node-externals": "^9.0.1",
91
91
  "rollup-plugin-postcss": "^4.0.2",
92
92
  "socket.io": "^4.8.3",
@@ -94,7 +94,7 @@
94
94
  "statuses": "^2.0.2",
95
95
  "tailwindcss": "^4.3.0",
96
96
  "tinguir": "^0.0.7",
97
- "vite": "^8.0.14",
97
+ "vite": "^8.0.16",
98
98
  "winston": "^3.19.0",
99
99
  "winston-daily-rotate-file": "^5.0.0",
100
100
  "yargs-parser": "^22.0.0"
@@ -1,6 +1,6 @@
1
1
  import Joi from "joi"
2
2
 
3
- export function with_miolo_input_schema(fn, schema) {
3
+ export function with_miolo_input_schema(fn, schema, options) {
4
4
  return async (ctx, params) => {
5
5
  let error
6
6
 
@@ -14,7 +14,9 @@ export function with_miolo_input_schema(fn, schema) {
14
14
  // perform validation
15
15
  let v
16
16
  try {
17
- v = schema.validate(params)
17
+ v = schema.validate(params, {
18
+ ...(options || {})
19
+ })
18
20
  } catch (uerror) {
19
21
  error = `Unexpected error validating input data for ${fn.name}: ${uerror?.message || uerror}`
20
22
  ctx.miolo.logger.silly(`[validation][${fn.name}] ${error}`)
@@ -1,7 +1,7 @@
1
1
  import Joi from "joi"
2
2
  import { diffObjs } from "./diffObjs.mjs"
3
3
 
4
- export function with_miolo_output_schema(fn, schema) {
4
+ export function with_miolo_output_schema(fn, schema, options) {
5
5
  const fnName = fn?.name ? `[${fn.name}]` : ""
6
6
 
7
7
  return async (ctx, params) => {
@@ -20,7 +20,10 @@ export function with_miolo_output_schema(fn, schema) {
20
20
  // perform validation over the result
21
21
  let v
22
22
  try {
23
- v = schema.validate(result, { stripUnknown: true })
23
+ v = schema.validate(result, {
24
+ stripUnknown: true,
25
+ ...(options || {})
26
+ })
24
27
  } catch (uerror) {
25
28
  error = `Unexpected error validating output data for ${fn.name}: ${uerror?.message || uerror}`
26
29
  ctx.miolo.logger.silly(`[validation]${fnName} ${error}`)
@@ -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
@@ -44,15 +44,15 @@
44
44
  "farrapa": "^3.0.0-beta.10",
45
45
  "intre": "^3.0.0-beta.4",
46
46
  "joi": "^18.2.1",
47
- "lucide-react": "^1.16.0",
48
- "miolo-cli": "^3.0.0-beta.205",
47
+ "lucide-react": "^1.17.0",
48
+ "miolo-cli": "^3.0.0-beta.207",
49
49
  "miolo-model": "file:../miolo-model",
50
- "miolo-react": "^3.0.0-beta.205",
50
+ "miolo-react": "^3.0.0-beta.207",
51
51
  "next-themes": "^0.4.6",
52
52
  "radix-ui": "^1.4.3",
53
- "react": "^19.2.6",
54
- "react-dom": "^19.2.6",
55
- "react-router": "^7.15.1",
53
+ "react": "^19.2.7",
54
+ "react-dom": "^19.2.7",
55
+ "react-router": "^7.16.0",
56
56
  "recharts": "^3.8.1",
57
57
  "sonner": "^2.0.7",
58
58
  "tailwind": "^4.0.0",
@@ -61,8 +61,8 @@
61
61
  "tw-animate-css": "^1.4.0"
62
62
  },
63
63
  "devDependencies": {
64
- "@biomejs/biome": "2.4.15",
65
- "miolo": "^3.0.0-beta.205",
64
+ "@biomejs/biome": "2.4.16",
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
- }