miolo 3.0.0-beta.166 → 3.0.0-beta.167
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/bin/build/server/aliases.mjs +1 -1
- package/bin/create/auth.mjs +3 -3
- package/bin/create/copy.mjs +2 -2
- package/bin/create/index.mjs +6 -6
- package/bin/create/validation.mjs +4 -6
- package/package.json +12 -12
- package/src/engines/schema/index.mjs +15 -3
- package/src/index.mjs +4 -3
- package/src/middleware/routes/router/queries/attachQueriesRoutes.mjs +20 -3
- package/template/biome.json +1 -1
- package/template/package.json +6 -6
- package/template/src/cli/components/ui/avatar.jsx +1 -1
- package/template/src/cli/components/ui/breadcrumb.jsx +3 -3
- package/template/src/cli/components/ui/card.jsx +1 -1
- package/template/src/cli/components/ui/collapsible.jsx +1 -1
- package/template/src/cli/components/ui/dropdown-menu.jsx +5 -5
- package/template/src/cli/components/ui/field.jsx +2 -2
- package/template/src/cli/components/ui/pagination.jsx +3 -3
- package/template/src/cli/components/ui/patched/alert.jsx +1 -1
- package/template/src/cli/components/ui/sheet.jsx +3 -3
- package/template/src/cli/components/ui/table.jsx +1 -1
- package/template/src/cli/components/ui/tooltip.jsx +1 -1
- package/template/src/cli/layout/nav-user.jsx +1 -1
- package/template/src/server/utils/crypt.mjs +1 -1
- package/template/src/static/style/skeleton.css +1 -7
|
@@ -109,4 +109,4 @@ function getRollupPluginForResolvingAliases(pkgPath) {
|
|
|
109
109
|
return [plugin]
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
export {
|
|
112
|
+
export { getBabelPluginForResolvingAliases, getRollupPluginForResolvingAliases, hasAliases }
|
package/bin/create/auth.mjs
CHANGED
|
@@ -4,8 +4,8 @@ import path from "node:path"
|
|
|
4
4
|
/**
|
|
5
5
|
* Updates server/miolo/index.mjs with correct auth import
|
|
6
6
|
*/
|
|
7
|
-
export function updateServerIndex(destPath,
|
|
8
|
-
if (
|
|
7
|
+
export function updateServerIndex(destPath, authType) {
|
|
8
|
+
if (authType === "passport") return
|
|
9
9
|
|
|
10
10
|
const serverIndexPath = path.join(destPath, "src/server/miolo/index.mjs")
|
|
11
11
|
|
|
@@ -17,7 +17,7 @@ export function updateServerIndex(destPath, authMethod) {
|
|
|
17
17
|
let content = fs.readFileSync(serverIndexPath, "utf8")
|
|
18
18
|
|
|
19
19
|
// Replace the auth import line
|
|
20
|
-
content = content.replaceAll("passport",
|
|
20
|
+
content = content.replaceAll("passport", authType)
|
|
21
21
|
|
|
22
22
|
fs.writeFileSync(serverIndexPath, content, "utf8")
|
|
23
23
|
}
|
package/bin/create/copy.mjs
CHANGED
|
@@ -59,7 +59,7 @@ export function transformContent(content, appName) {
|
|
|
59
59
|
* Copies a directory recursively with transformations
|
|
60
60
|
*/
|
|
61
61
|
export function copyDirectory(src, dest, appName, options = {}) {
|
|
62
|
-
const {
|
|
62
|
+
const { authType } = options
|
|
63
63
|
|
|
64
64
|
// Create destination if it doesn't exist
|
|
65
65
|
if (!fs.existsSync(dest)) {
|
|
@@ -85,7 +85,7 @@ export function copyDirectory(src, dest, appName, options = {}) {
|
|
|
85
85
|
fs.mkdirSync(destPath, { recursive: true })
|
|
86
86
|
|
|
87
87
|
// Copy only the selected auth file
|
|
88
|
-
const authFile = `${
|
|
88
|
+
const authFile = `${authType}.mjs`
|
|
89
89
|
const srcAuthFile = path.join(srcPath, authFile)
|
|
90
90
|
const destAuthFile = path.join(destPath, authFile)
|
|
91
91
|
|
package/bin/create/index.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { copyTemplate } from "./copy.mjs"
|
|
|
7
7
|
import { updateDockerFiles } from "./docker.mjs"
|
|
8
8
|
import { updateEnvFile } from "./pkgjson.mjs"
|
|
9
9
|
// Import modular functions
|
|
10
|
-
import { validateAppName,
|
|
10
|
+
import { validateAppName, validateAuthType } from "./validation.mjs"
|
|
11
11
|
|
|
12
12
|
const __filename = fileURLToPath(import.meta.url)
|
|
13
13
|
const __dirname = path.dirname(__filename)
|
|
@@ -23,10 +23,10 @@ export default async function create(appName, options = {}) {
|
|
|
23
23
|
validateAppName(appName)
|
|
24
24
|
|
|
25
25
|
// Parse options
|
|
26
|
-
const { port, auth:
|
|
26
|
+
const { port, auth: authType = "passport", dest = `./${appName}` } = options
|
|
27
27
|
|
|
28
28
|
// Validate auth method
|
|
29
|
-
|
|
29
|
+
validateAuthType(authType)
|
|
30
30
|
|
|
31
31
|
// Get source path (template or miolo-sample for development)
|
|
32
32
|
// In development (monorepo), use miolo-sample directly
|
|
@@ -61,13 +61,13 @@ export default async function create(appName, options = {}) {
|
|
|
61
61
|
|
|
62
62
|
console.log("[miolo] Copying template from:", sourcePath)
|
|
63
63
|
console.log("[miolo] Creating app at:", destPath)
|
|
64
|
-
console.log("[miolo] Auth method:",
|
|
64
|
+
console.log("[miolo] Auth method:", authType)
|
|
65
65
|
if (port) {
|
|
66
66
|
console.log("[miolo] Port:", port)
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// Copy template files
|
|
70
|
-
copyTemplate(sourcePath, destPath, appName, {
|
|
70
|
+
copyTemplate(sourcePath, destPath, appName, { authType })
|
|
71
71
|
|
|
72
72
|
console.log("[miolo] Template copied successfully")
|
|
73
73
|
|
|
@@ -80,7 +80,7 @@ export default async function create(appName, options = {}) {
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
// Update server/miolo/index.mjs with correct auth import
|
|
83
|
-
updateServerIndex(destPath,
|
|
83
|
+
updateServerIndex(destPath, authType)
|
|
84
84
|
|
|
85
85
|
// Install dependencies
|
|
86
86
|
console.log("[miolo] Installing dependencies...")
|
|
@@ -18,12 +18,10 @@ export function validateAppName(name) {
|
|
|
18
18
|
/**
|
|
19
19
|
* Validates auth method
|
|
20
20
|
*/
|
|
21
|
-
export function
|
|
22
|
-
const
|
|
23
|
-
if (!
|
|
24
|
-
throw new Error(
|
|
25
|
-
`Invalid auth method: ${authMethod}. Valid options: ${validAuthMethods.join(", ")}`
|
|
26
|
-
)
|
|
21
|
+
export function validateAuthType(authType) {
|
|
22
|
+
const validAuthTypes = ["passport", "basic", "guest"]
|
|
23
|
+
if (!validAuthTypes.includes(authType)) {
|
|
24
|
+
throw new Error(`Invalid auth type: ${authType}. Valid options: ${validAuthTypes.join(", ")}`)
|
|
27
25
|
}
|
|
28
26
|
return true
|
|
29
27
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miolo",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.167",
|
|
4
4
|
"description": "all-in-one koa-based server",
|
|
5
5
|
"author": "Donato Lorenzo <donato@afialapis.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@babel/plugin-proposal-decorators": "^7.29.0",
|
|
48
|
-
"@babel/preset-env": "^7.29.
|
|
48
|
+
"@babel/preset-env": "^7.29.2",
|
|
49
49
|
"@babel/preset-react": "^7.28.5",
|
|
50
|
-
"@dotenvx/dotenvx": "^1.
|
|
50
|
+
"@dotenvx/dotenvx": "^1.57.0",
|
|
51
51
|
"@koa/bodyparser": "^6.1.0",
|
|
52
52
|
"@koa/cors": "^5.0.0",
|
|
53
|
-
"@koa/router": "^15.
|
|
53
|
+
"@koa/router": "^15.4.0",
|
|
54
54
|
"@maxmind/geoip2-node": "^6.3.4",
|
|
55
55
|
"@rollup/plugin-alias": "^6.0.0",
|
|
56
56
|
"@rollup/plugin-babel": "^7.0.0",
|
|
@@ -58,9 +58,9 @@
|
|
|
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",
|
|
61
|
-
"@tailwindcss/postcss": "^4.2.
|
|
62
|
-
"@tailwindcss/vite": "^4.2.
|
|
63
|
-
"@vitejs/plugin-react": "^
|
|
61
|
+
"@tailwindcss/postcss": "^4.2.2",
|
|
62
|
+
"@tailwindcss/vite": "^4.2.2",
|
|
63
|
+
"@vitejs/plugin-react": "^6.0.1",
|
|
64
64
|
"autoprefixer": "^10.4.27",
|
|
65
65
|
"cacheiro": "^0.5.0-beta.11",
|
|
66
66
|
"calustra": "^1.0.0-beta.14",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"joi": "^18.0.2",
|
|
74
74
|
"jwt-simple": "^0.5.6",
|
|
75
75
|
"koa": "^3.1.2",
|
|
76
|
-
"koa-compress": "^5.2.
|
|
76
|
+
"koa-compress": "^5.2.1",
|
|
77
77
|
"koa-connect": "^2.1.1",
|
|
78
78
|
"koa-favicon": "^2.1.0",
|
|
79
79
|
"koa-mount": "^4.2.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"koa-ratelimit": "^6.0.0",
|
|
83
83
|
"koa-session": "^7.0.2",
|
|
84
84
|
"koa-static": "^5.0.0",
|
|
85
|
-
"nanoid": "^5.1.
|
|
86
|
-
"nodemailer": "^8.0.
|
|
85
|
+
"nanoid": "^5.1.7",
|
|
86
|
+
"nodemailer": "^8.0.3",
|
|
87
87
|
"passport-google-oauth20": "^2.0.0",
|
|
88
88
|
"passport-local": "^1.0.0",
|
|
89
89
|
"rollup": "^4.59.0",
|
|
@@ -92,9 +92,9 @@
|
|
|
92
92
|
"socket.io": "^4.8.3",
|
|
93
93
|
"socket.io-client": "^4.8.3",
|
|
94
94
|
"statuses": "^2.0.2",
|
|
95
|
-
"tailwindcss": "^4.2.
|
|
95
|
+
"tailwindcss": "^4.2.2",
|
|
96
96
|
"tinguir": "^0.0.7",
|
|
97
|
-
"vite": "^
|
|
97
|
+
"vite": "^8.0.1",
|
|
98
98
|
"winston": "^3.19.0",
|
|
99
99
|
"winston-daily-rotate-file": "^5.0.0",
|
|
100
100
|
"yargs-parser": "^22.0.0"
|
|
@@ -30,9 +30,21 @@ export function with_miolo_schema(fn, schema) {
|
|
|
30
30
|
|
|
31
31
|
// check parsed value is ok
|
|
32
32
|
if (!v?.value) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
const description = schema.describe()
|
|
34
|
+
|
|
35
|
+
// Check if schema was deliberately set to allow only null
|
|
36
|
+
// schema = Joi.any().allow(null)
|
|
37
|
+
const isOnlyNull =
|
|
38
|
+
description.type === "any" &&
|
|
39
|
+
description.allow &&
|
|
40
|
+
description.allow.length === 1 &&
|
|
41
|
+
description.allow[0] === null
|
|
42
|
+
|
|
43
|
+
if (!isOnlyNull) {
|
|
44
|
+
error = `Schema returned unknown result for ${fn.name}: ${JSON.stringify(v)}`
|
|
45
|
+
ctx.miolo.logger.silly(`[validation][${fn.name}] ${error}`)
|
|
46
|
+
throw new Error(error)
|
|
47
|
+
}
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
return await fn(ctx, v.value)
|
package/src/index.mjs
CHANGED
|
@@ -6,16 +6,17 @@ import { init_parser as miolo_parser } from "./engines/parser/index.mjs"
|
|
|
6
6
|
import { with_miolo_schema } from "./engines/schema/index.mjs"
|
|
7
7
|
import { miolo } from "./server.mjs"
|
|
8
8
|
import { miolo_cron } from "./server-cron.mjs"
|
|
9
|
+
|
|
9
10
|
// import { getConnection as miolo_db_connection_sqlite} from 'calustra/conn-sqlite'
|
|
10
11
|
|
|
11
12
|
export {
|
|
12
13
|
miolo,
|
|
14
|
+
miolo_cacher,
|
|
13
15
|
miolo_cron,
|
|
16
|
+
miolo_db_connection_pg,
|
|
17
|
+
miolo_db_drop_connections,
|
|
14
18
|
miolo_emailer,
|
|
15
19
|
miolo_logger,
|
|
16
20
|
miolo_parser,
|
|
17
|
-
miolo_cacher,
|
|
18
|
-
miolo_db_connection_pg,
|
|
19
|
-
miolo_db_drop_connections,
|
|
20
21
|
with_miolo_schema
|
|
21
22
|
}
|
|
@@ -108,9 +108,26 @@ function attachQueriesRoutes(router, queriesConfigs, logger) {
|
|
|
108
108
|
ctx.miolo.logger.silly(`[router] Schema validated data for ${url} successfully`)
|
|
109
109
|
ctx.request.body = v.value
|
|
110
110
|
} else {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
111
|
+
const description = route.schema.describe()
|
|
112
|
+
|
|
113
|
+
// Check if schema was deliberately set to allow only null
|
|
114
|
+
// schema = Joi.any().allow(null)
|
|
115
|
+
const isOnlyNull =
|
|
116
|
+
description.type === "any" &&
|
|
117
|
+
description.allow &&
|
|
118
|
+
description.allow.length === 1 &&
|
|
119
|
+
description.allow[0] === null
|
|
120
|
+
|
|
121
|
+
if (isOnlyNull) {
|
|
122
|
+
ctx.miolo.logger.silly(
|
|
123
|
+
`[router] Schema allowed null param to ${url} successfully`
|
|
124
|
+
)
|
|
125
|
+
ctx.request.body = v.value
|
|
126
|
+
} else {
|
|
127
|
+
ctx.miolo.logger.warn(
|
|
128
|
+
`[router] Schema returned unknown result for ${url}: ${JSON.stringify(v)}. Let's ignore it.`
|
|
129
|
+
)
|
|
130
|
+
}
|
|
114
131
|
}
|
|
115
132
|
} catch (error) {
|
|
116
133
|
ctx.miolo.logger.error(
|
package/template/biome.json
CHANGED
package/template/package.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@radix-ui/react-slot": "^1.2.4",
|
|
37
37
|
"@radix-ui/react-tooltip": "^1.2.8",
|
|
38
38
|
"@stepperize/react": "^6.1.0",
|
|
39
|
-
"@tailwindcss/postcss": "^4.2.
|
|
39
|
+
"@tailwindcss/postcss": "^4.2.2",
|
|
40
40
|
"@tanstack/react-table": "^8.21.3",
|
|
41
41
|
"class-variance-authority": "^0.7.1",
|
|
42
42
|
"clsx": "^2.1.1",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"intre": "^3.0.0-beta.4",
|
|
45
45
|
"joi": "^18.0.2",
|
|
46
46
|
"lucide-react": "^0.577.0",
|
|
47
|
-
"miolo-cli": "^3.0.0-beta.
|
|
47
|
+
"miolo-cli": "^3.0.0-beta.167",
|
|
48
48
|
"miolo-model": "file:../miolo-model",
|
|
49
|
-
"miolo-react": "^3.0.0-beta.
|
|
49
|
+
"miolo-react": "^3.0.0-beta.167",
|
|
50
50
|
"next-themes": "^0.4.6",
|
|
51
51
|
"radix-ui": "^1.4.3",
|
|
52
52
|
"react": "^19.2.4",
|
|
@@ -60,9 +60,9 @@
|
|
|
60
60
|
"tw-animate-css": "^1.4.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@biomejs/biome": "2.4.
|
|
64
|
-
"miolo": "^3.0.0-beta.
|
|
65
|
-
"sass-embedded": "^1.
|
|
63
|
+
"@biomejs/biome": "2.4.8",
|
|
64
|
+
"miolo": "^3.0.0-beta.167",
|
|
65
|
+
"sass-embedded": "^1.98.0"
|
|
66
66
|
},
|
|
67
67
|
"overrides": {
|
|
68
68
|
"@babel/runtime": "^7.28.6",
|
|
@@ -88,10 +88,10 @@ function BreadcrumbEllipsis({ className, ...props }) {
|
|
|
88
88
|
|
|
89
89
|
export {
|
|
90
90
|
Breadcrumb,
|
|
91
|
-
|
|
91
|
+
BreadcrumbEllipsis,
|
|
92
92
|
BreadcrumbItem,
|
|
93
93
|
BreadcrumbLink,
|
|
94
|
+
BreadcrumbList,
|
|
94
95
|
BreadcrumbPage,
|
|
95
|
-
BreadcrumbSeparator
|
|
96
|
-
BreadcrumbEllipsis
|
|
96
|
+
BreadcrumbSeparator
|
|
97
97
|
}
|
|
@@ -13,4 +13,4 @@ function CollapsibleContent({ ...props }) {
|
|
|
13
13
|
return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export { Collapsible,
|
|
16
|
+
export { Collapsible, CollapsibleContent, CollapsibleTrigger }
|
|
@@ -162,18 +162,18 @@ function DropdownMenuSubContent({ className, ...props }) {
|
|
|
162
162
|
|
|
163
163
|
export {
|
|
164
164
|
DropdownMenu,
|
|
165
|
-
|
|
166
|
-
DropdownMenuTrigger,
|
|
165
|
+
DropdownMenuCheckboxItem,
|
|
167
166
|
DropdownMenuContent,
|
|
168
167
|
DropdownMenuGroup,
|
|
169
|
-
DropdownMenuLabel,
|
|
170
168
|
DropdownMenuItem,
|
|
171
|
-
|
|
169
|
+
DropdownMenuLabel,
|
|
170
|
+
DropdownMenuPortal,
|
|
172
171
|
DropdownMenuRadioGroup,
|
|
173
172
|
DropdownMenuRadioItem,
|
|
174
173
|
DropdownMenuSeparator,
|
|
175
174
|
DropdownMenuShortcut,
|
|
176
175
|
DropdownMenuSub,
|
|
176
|
+
DropdownMenuSubContent,
|
|
177
177
|
DropdownMenuSubTrigger,
|
|
178
|
-
|
|
178
|
+
DropdownMenuTrigger
|
|
179
179
|
}
|
|
@@ -205,13 +205,13 @@ function FieldError({ className, children, errors, ...props }) {
|
|
|
205
205
|
|
|
206
206
|
export {
|
|
207
207
|
Field,
|
|
208
|
-
|
|
208
|
+
FieldContent,
|
|
209
209
|
FieldDescription,
|
|
210
210
|
FieldError,
|
|
211
211
|
FieldGroup,
|
|
212
|
+
FieldLabel,
|
|
212
213
|
FieldLegend,
|
|
213
214
|
FieldSeparator,
|
|
214
215
|
FieldSet,
|
|
215
|
-
FieldContent,
|
|
216
216
|
FieldTitle
|
|
217
217
|
}
|
|
@@ -91,9 +91,9 @@ function PaginationEllipsis({ className, ...props }) {
|
|
|
91
91
|
export {
|
|
92
92
|
Pagination,
|
|
93
93
|
PaginationContent,
|
|
94
|
-
|
|
94
|
+
PaginationEllipsis,
|
|
95
95
|
PaginationItem,
|
|
96
|
-
|
|
96
|
+
PaginationLink,
|
|
97
97
|
PaginationNext,
|
|
98
|
-
|
|
98
|
+
PaginationPrevious
|
|
99
99
|
}
|
|
@@ -105,11 +105,11 @@ function SheetDescription({ className, ...props }) {
|
|
|
105
105
|
|
|
106
106
|
export {
|
|
107
107
|
Sheet,
|
|
108
|
-
SheetTrigger,
|
|
109
108
|
SheetClose,
|
|
110
109
|
SheetContent,
|
|
111
|
-
|
|
110
|
+
SheetDescription,
|
|
112
111
|
SheetFooter,
|
|
112
|
+
SheetHeader,
|
|
113
113
|
SheetTitle,
|
|
114
|
-
|
|
114
|
+
SheetTrigger
|
|
115
115
|
}
|
|
@@ -28,13 +28,7 @@
|
|
|
28
28
|
.skeleton-loading button,
|
|
29
29
|
.skeleton-loading a,
|
|
30
30
|
.skeleton-loading .skeleton-apply {
|
|
31
|
-
@apply
|
|
32
|
-
bg-gray-200
|
|
33
|
-
dark:bg-gray-700
|
|
34
|
-
rounded-md
|
|
35
|
-
text-transparent
|
|
36
|
-
relative
|
|
37
|
-
overflow-hidden;
|
|
31
|
+
@apply bg-gray-200 dark:bg-gray-700 rounded-md text-transparent relative overflow-hidden;
|
|
38
32
|
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
|
39
33
|
pointer-events: none; /* Para deshabilitar la interacción */
|
|
40
34
|
}
|