miolo 3.0.0-beta.225 → 3.0.0-beta.227
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 +2 -1
- package/template/jsconfig.json +11 -9
- package/template/package.json +4 -3
- package/template/src/cli/components/ui/patched/button.jsx +3 -0
- package/template/src/cli/context/data/DataProvider.jsx +6 -7
- package/template/src/cli/context/data/useDataContext.mjs +3 -1
- package/template/src/cli/context/session/SessionProvider.jsx +6 -0
- package/template/src/cli/context/session/useSessionContext.mjs +2 -0
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.227",
|
|
4
4
|
"description": "all-in-one koa-based server",
|
|
5
5
|
"author": "Donato Lorenzo <donato@afialapis.com>",
|
|
6
6
|
"contributors": [
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"scripts": {
|
|
39
39
|
"lint": "biome check ./src ./bin --reporter=github",
|
|
40
40
|
"lint:fix": "biome check --write ./src ./bin --reporter=github",
|
|
41
|
+
"lint:types": "tsc -p jsconfig.json --noEmit",
|
|
41
42
|
"reset": "rm -fr package-lock.json npm-lock.yaml && npm i",
|
|
42
43
|
"prepare-template": "node bin/create/prepare-template.mjs",
|
|
43
44
|
"dist": "npm run prepare-template",
|
package/template/jsconfig.json
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"jsx": "react-jsx",
|
|
4
|
+
"checkJs": false,
|
|
3
5
|
"target": "ES6",
|
|
4
6
|
"module": "ES6",
|
|
5
7
|
"moduleResolution": "bundler",
|
|
6
8
|
"allowSyntheticDefaultImports": true,
|
|
7
|
-
"
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"maxNodeModuleJsDepth": 2,
|
|
8
11
|
"paths": {
|
|
9
|
-
"#cli/*": ["./cli/*"],
|
|
10
|
-
"#ns/*": ["./ns/*"],
|
|
11
|
-
"#server/*": ["./server/*"],
|
|
12
|
-
"#static/*": ["./static/*"]
|
|
12
|
+
"#cli/*": ["./src/cli/*"],
|
|
13
|
+
"#ns/*": ["./src/ns/*"],
|
|
14
|
+
"#server/*": ["./src/server/*"],
|
|
15
|
+
"#static/*": ["./src/static/*"],
|
|
16
|
+
"*": ["./src/*"]
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
|
-
"exclude": [
|
|
16
|
-
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
+
"exclude": ["node_modules", "build", "docker", "db"]
|
|
20
|
+
}
|
package/template/package.json
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"reset": "rm -fr node_modules package-lock.json npm-lock.yaml && npm i",
|
|
10
10
|
"lint": "biome check ./src --reporter=github",
|
|
11
11
|
"lint:fix": "biome check --write ./src --reporter=github",
|
|
12
|
+
"lint:types": "tsc -p jsconfig.json --noEmit",
|
|
12
13
|
"dev": "npx miolo dev",
|
|
13
14
|
"deb": "npx miolo deb",
|
|
14
15
|
"create-bin": "npx miolo create-bin",
|
|
@@ -45,9 +46,9 @@
|
|
|
45
46
|
"intre": "^3.0.0-beta.4",
|
|
46
47
|
"joi": "^18.2.3",
|
|
47
48
|
"lucide-react": "^1.24.0",
|
|
48
|
-
"miolo-cli": "^3.0.0-beta.
|
|
49
|
+
"miolo-cli": "^3.0.0-beta.227",
|
|
49
50
|
"miolo-model": "file:../miolo-model",
|
|
50
|
-
"miolo-react": "^3.0.0-beta.
|
|
51
|
+
"miolo-react": "^3.0.0-beta.227",
|
|
51
52
|
"next-themes": "^0.4.6",
|
|
52
53
|
"radix-ui": "^1.6.2",
|
|
53
54
|
"react": "^19.2.7",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
},
|
|
63
64
|
"devDependencies": {
|
|
64
65
|
"@biomejs/biome": "2.5.3",
|
|
65
|
-
"miolo": "^3.0.0-beta.
|
|
66
|
+
"miolo": "^3.0.0-beta.227",
|
|
66
67
|
"sass-embedded": "^1.100.0"
|
|
67
68
|
},
|
|
68
69
|
"overrides": {
|
|
@@ -30,6 +30,9 @@ const buttonVariants = cva(
|
|
|
30
30
|
}
|
|
31
31
|
)
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* @param {import("react").ButtonHTMLAttributes<HTMLButtonElement> & import("class-variance-authority").VariantProps<typeof buttonVariants> & { asChild?: boolean }} props
|
|
35
|
+
*/
|
|
33
36
|
function Button({ className, variant, size, asChild = false, ...props }) {
|
|
34
37
|
const Comp = asChild ? Slot : "button"
|
|
35
38
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
import { useCallback, useState } from "react"
|
|
2
4
|
import useSessionContext from "#cli/context/session/useSessionContext.mjs"
|
|
3
5
|
import TodoList from "#ns/models/TodoList.mjs"
|
|
4
6
|
import DataContext from "./DataContext.jsx"
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
|
-
* @typedef {import('#ns/models/TodoList.mjs').default} TodoList
|
|
8
9
|
* @typedef {import('#ns/models/Todo.mjs').default} Todo
|
|
9
10
|
*
|
|
10
11
|
* @typedef {Object} DataContextData
|
|
@@ -18,10 +19,8 @@ import DataContext from "./DataContext.jsx"
|
|
|
18
19
|
*/
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
|
-
* @param {Object} props
|
|
22
|
-
* @param {
|
|
23
|
-
* @returns {React.ReactNode} The provider.
|
|
24
|
-
* @public
|
|
22
|
+
* @param {Object} props
|
|
23
|
+
* @param {any} props.children
|
|
25
24
|
*/
|
|
26
25
|
const DataProvider = ({ children }) => {
|
|
27
26
|
const [breads, setBreads] = useState([])
|
|
@@ -35,10 +34,10 @@ const DataProvider = ({ children }) => {
|
|
|
35
34
|
url: "/api/todo/list",
|
|
36
35
|
params: { options: { limit: 4 } },
|
|
37
36
|
model: TodoList,
|
|
38
|
-
modifier: (data) => data.sort((a, b) => b.created_at - a.created_at)
|
|
37
|
+
modifier: (/** @type {TodoList} */ data) => data.sort((a, b) => b.created_at - a.created_at)
|
|
39
38
|
})
|
|
40
39
|
|
|
41
|
-
const setTitle = useCallback((title) => {
|
|
40
|
+
const setTitle = useCallback((/** @type {string} */ title) => {
|
|
42
41
|
if (document) {
|
|
43
42
|
document.title = title
|
|
44
43
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
import { useContext } from "react"
|
|
2
4
|
import DataContext from "./DataContext.jsx"
|
|
3
5
|
|
|
4
6
|
/**
|
|
5
|
-
* @typedef {import('./
|
|
7
|
+
* @typedef {import('./DataProvider.jsx').DataContextData} DataContextData
|
|
6
8
|
* @returns {DataContextData}
|
|
7
9
|
*/
|
|
8
10
|
const useDataContext = () => useContext(DataContext)
|
|
@@ -1,8 +1,14 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
1
3
|
import { useMioloContext } from "miolo-react"
|
|
2
4
|
import { useEffect, useState } from "react"
|
|
3
5
|
import makePermissioner from "./makePermissioner.mjs"
|
|
4
6
|
import SessionContext from "./SessionContext.mjs"
|
|
5
7
|
|
|
8
|
+
/**
|
|
9
|
+
* @param {Object} props
|
|
10
|
+
* @param {any} props.children
|
|
11
|
+
*/
|
|
6
12
|
const SessionProvider = ({ children }) => {
|
|
7
13
|
const { user, ...props } = useMioloContext()
|
|
8
14
|
//const [session, setSession] = useState(new Session(user))
|