fuma 0.1.2 → 0.1.4
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/README.md +12 -10
- package/dist/server/sse.d.ts +0 -2
- package/dist/ui/Icon.svelte +1 -1
- package/dist/ui/ToggleMode.svelte +19 -0
- package/dist/ui/ToggleMode.svelte.d.ts +14 -0
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/index.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,9 @@ echo "Enter mysql username : " && read mysql_username
|
|
|
10
10
|
|
|
11
11
|
pn create svelte@latest $project_name
|
|
12
12
|
cd $project_name
|
|
13
|
+
px svelte-add@latest tailwindcss --tailwindcss-daisyui
|
|
13
14
|
pn install
|
|
14
15
|
pn install fuma prisma lucia oslo @lucia-auth/adapter-prisma
|
|
15
|
-
px svelte-add@latest tailwindcss --tailwindcss-daisyui
|
|
16
16
|
sed -i "s|\}'\],|\}', './node_modules/**/fuma/dist/**/*.svelte'\],|g" tailwind.config.cjs
|
|
17
17
|
sed -i 's|"singleQuote": true,|"singleQuote": true,\n\t"semi": false,|g' .prettierrc
|
|
18
18
|
|
|
@@ -21,8 +21,8 @@ px prisma init --datasource-provider mysql
|
|
|
21
21
|
|
|
22
22
|
mkdir -p ./src/lib/server
|
|
23
23
|
source="https://raw.githubusercontent.com/peufo/fuma/main"
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
curl "$source/prisma/schema.prisma" -o ./prisma/schema.prisma
|
|
25
|
+
curl "$source/src/lib/server/prisma.ts" -o ./src/lib/server/prisma.ts
|
|
26
26
|
|
|
27
27
|
echo "DATABASE_URL=\"mysql://$mysql_username@localhost:3306/$project_name\"" > .env
|
|
28
28
|
cp .env .env.example
|
|
@@ -39,13 +39,15 @@ node -e "\
|
|
|
39
39
|
# Authentication
|
|
40
40
|
auth="src/routes/auth"
|
|
41
41
|
mkdir -p "./$auth"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
curl "$source/src/app.d.ts" -o ./src/app.d.ts
|
|
43
|
+
curl "$source/src/hooks.server.ts" -o ./src/hooks.server.ts
|
|
44
|
+
curl "$source/src/lib/server/auth.ts" -o ./src/lib/server/auth.ts
|
|
45
|
+
curl "$source/$auth/+page.svelte" -o "./$auth/+page.svelte"
|
|
46
|
+
curl "$source/$auth/+page.server.ts" -o "./$auth/+page.server.ts"
|
|
47
|
+
|
|
48
|
+
sed -i 's|import Login .*|import { Login } from "fuma"|g' "./$auth/+page.svelte"
|
|
49
|
+
sed -i 's|$lib/validation/zod.js|fuma|g' "./$auth/+page.server.ts"
|
|
50
|
+
sed -i 's|$lib/server/index.js|fuma/server|g' "./$auth/+page.server.ts"
|
|
49
51
|
|
|
50
52
|
git init && git add -A && git commit -m "Initial commit"
|
|
51
53
|
```
|
package/dist/server/sse.d.ts
CHANGED
package/dist/ui/Icon.svelte
CHANGED
|
@@ -32,7 +32,7 @@ onMount(() => {
|
|
|
32
32
|
});
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
|
-
<i bind:this={icon} class="grid place-content-center {klass}" {style}>
|
|
35
|
+
<i bind:this={icon} class="grid place-content-center fill-base-content {klass}" {style}>
|
|
36
36
|
<svg
|
|
37
37
|
xmlns="http://www.w3.org/2000/svg"
|
|
38
38
|
width={size}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script>import { browser } from "$app/environment";
|
|
2
|
+
import { ModeWatcher, toggleMode, mode } from "mode-watcher";
|
|
3
|
+
import { Icon } from "../index.js";
|
|
4
|
+
import { mdiWeatherNight, mdiWhiteBalanceSunny } from "@mdi/js";
|
|
5
|
+
mode.subscribe((_mode) => {
|
|
6
|
+
if (!browser)
|
|
7
|
+
return;
|
|
8
|
+
const [html] = document.getElementsByTagName("html");
|
|
9
|
+
if (!html || !_mode)
|
|
10
|
+
return;
|
|
11
|
+
html.setAttribute("data-theme", _mode);
|
|
12
|
+
});
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<ModeWatcher />
|
|
16
|
+
|
|
17
|
+
<button class="btn btn-square btn-sm" on:click={toggleMode}>
|
|
18
|
+
<Icon path={$mode === 'light' ? mdiWhiteBalanceSunny : mdiWeatherNight} />
|
|
19
|
+
</button>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: Record<string, never>;
|
|
4
|
+
events: {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
};
|
|
7
|
+
slots: {};
|
|
8
|
+
};
|
|
9
|
+
export type ToggleModeProps = typeof __propDef.props;
|
|
10
|
+
export type ToggleModeEvents = typeof __propDef.events;
|
|
11
|
+
export type ToggleModeSlots = typeof __propDef.slots;
|
|
12
|
+
export default class ToggleMode extends SvelteComponent<ToggleModeProps, ToggleModeEvents, ToggleModeSlots> {
|
|
13
|
+
}
|
|
14
|
+
export {};
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export { default as Pagination } from './Pagination.svelte';
|
|
|
13
13
|
export { default as Placeholder } from './Placeholder.svelte';
|
|
14
14
|
export { default as PlaceholderImage } from './PlaceholderImage.svelte';
|
|
15
15
|
export { default as Login } from './Login.svelte';
|
|
16
|
+
export { default as ToggleMode } from './ToggleMode.svelte';
|
|
17
|
+
export * from 'mode-watcher';
|
package/dist/ui/index.js
CHANGED
|
@@ -13,3 +13,5 @@ export { default as Pagination } from './Pagination.svelte';
|
|
|
13
13
|
export { default as Placeholder } from './Placeholder.svelte';
|
|
14
14
|
export { default as PlaceholderImage } from './PlaceholderImage.svelte';
|
|
15
15
|
export { default as Login } from './Login.svelte';
|
|
16
|
+
export { default as ToggleMode } from './ToggleMode.svelte';
|
|
17
|
+
export * from 'mode-watcher';
|