Skip to content

Commit 62643c4

Browse files
committed
Prettier to biome, fixed themes, slimmed down configs and packages
1 parent 11c7a67 commit 62643c4

28 files changed

+248
-293
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,4 @@ jobs:
3333

3434
- name: Install dependencies
3535
working-directory: ${{ matrix.dir }}
36-
run: bun lint
37-
38-
- name: Prepare Pull Request Payload artifact
39-
id: prepare-artifact
40-
if: always() && github.event_name == 'pull_request'
41-
continue-on-error: true
42-
run: cat $GITHUB_EVENT_PATH | jq '.pull_request' > pull_request_payload.json
43-
44-
- name: Upload a Build Artifact
45-
if: always() && steps.prepare-artifact.outcome == 'success'
46-
continue-on-error: true
47-
uses: actions/upload-artifact@v2
48-
with:
49-
name: pull-request-payload
50-
path: pull_request_payload.json
36+
run: bun ci

.pre-commit-config.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.6.0
4+
hooks:
5+
- id: check-case-conflict
6+
- id: check-merge-conflict
7+
- id: check-toml
8+
- id: check-yaml
9+
- id: check-json
10+
- id: trailing-whitespace
11+
args: [--markdown-linebreak-ext=md]
12+
- id: mixed-line-ending
13+
args: [--fix=lf]
14+
- id: end-of-file-fixer
15+
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.6.0
18+
hooks:
19+
- id: check-ast
20+
- id: trailing-whitespace
21+
- id: check-toml
22+
- id: end-of-file-fixer
23+
24+
- repo: https://github.com/asottile/add-trailing-comma
25+
rev: v3.1.0
26+
hooks:
27+
- id: add-trailing-comma
28+
29+
- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
30+
rev: v2.13.0
31+
hooks:
32+
- id: pretty-format-yaml
33+
args:
34+
- --autofix
35+
- --preserve-quotes
36+
- --indent=2

site/.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

site/.eslintrc.cjs

Lines changed: 0 additions & 16 deletions
This file was deleted.

site/.pre-commit-config.yaml

Lines changed: 0 additions & 26 deletions
This file was deleted.

site/.prettierrc

Lines changed: 0 additions & 7 deletions
This file was deleted.

site/app.config.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
export default defineAppConfig({
22
globals: {
3-
title: 'site',
3+
title: "site",
44
},
55
ui: {
6-
primary: 'red',
7-
gray: 'cool',
6+
primary: "red",
7+
gray: "cool",
88
container: {
9-
constrained: 'max-w-2xl',
9+
constrained: "max-w-2xl",
1010
},
1111
},
12-
})
12+
});

site/app.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<script setup lang="ts">
22
useHead({
3-
meta: [
4-
{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
5-
],
3+
meta: [{ name: "viewport", content: "width=device-width, initial-scale=1" }],
64
htmlAttrs: {
7-
lang: 'en'
8-
}
9-
})
10-
5+
lang: "en",
6+
},
7+
});
118
</script>
129

1310
<template>

site/biome.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.7.2/schema.json",
3+
"organizeImports": { "enabled": true },
4+
"linter": { "enabled": true, "rules": { "recommended": true } },
5+
"vcs": {
6+
"enabled": true,
7+
"clientKind": "git",
8+
"useIgnoreFile": true
9+
},
10+
"formatter": { "indentStyle": "space", "indentWidth": 2 }
11+
}

site/bun.lockb

-183 KB
Binary file not shown.

site/components/App/Header.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ defineProps({
1313
title: {
1414
type: String,
1515
required: true,
16-
}
17-
})
16+
},
17+
});
1818
</script>

site/components/App/Navbar.vue

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,25 +37,25 @@
3737
</template>
3838

3939
<script setup>
40-
import { useFixedHeader } from 'vue-use-fixed-header'
41-
const headerRef = ref(null)
42-
const { styles } = useFixedHeader(headerRef)
40+
import { useFixedHeader } from "vue-use-fixed-header";
41+
const headerRef = ref(null);
42+
const { styles } = useFixedHeader(headerRef);
4343
4444
const items = [
4545
{
46-
name: 'Home',
47-
path: '/',
48-
icon: 'solar:home-smile-outline',
46+
name: "Home",
47+
path: "/",
48+
icon: "solar:home-smile-outline",
4949
},
5050
{
51-
name: 'Blog',
52-
path: '/posts',
53-
icon: 'solar:document-add-outline',
51+
name: "Blog",
52+
path: "/posts",
53+
icon: "solar:document-add-outline",
5454
},
5555
{
56-
name: 'Showcase',
57-
path: '/showcase',
58-
icon: 'solar:folder-with-files-outline',
56+
name: "Showcase",
57+
path: "/showcase",
58+
icon: "solar:folder-with-files-outline",
5959
},
60-
]
60+
];
6161
</script>

site/components/App/PostCard.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ defineProps({
1919
type: Object,
2020
required: true,
2121
},
22-
})
22+
});
2323
2424
const getReadableDate = (dateString) => {
25-
const date = new Date(dateString)
26-
return date.toLocaleDateString('en-US', {
27-
year: '2-digit',
28-
month: '2-digit',
29-
day: '2-digit',
30-
})
31-
}
25+
const date = new Date(dateString);
26+
return date.toLocaleDateString("en-US", {
27+
year: "2-digit",
28+
month: "2-digit",
29+
day: "2-digit",
30+
});
31+
};
3232
</script>

site/components/App/ProjectCard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,5 @@ defineProps({
2525
type: Object,
2626
required: true,
2727
},
28-
})
28+
});
2929
</script>

site/components/App/ThemeToggle.vue

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,25 @@
1-
<script setup>
2-
const colorMode = useColorMode()
1+
<script setup lang="ts">
2+
const colorMode = useColorMode();
33
4-
const isDark = computed({
5-
get() {
6-
return colorMode.value === 'dark'
7-
},
8-
set() {
9-
colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'
10-
},
11-
})
4+
const onClick = () => {
5+
const values = ["system", "light", "dark"];
6+
const index = values.indexOf(colorMode.preference);
7+
const next = (index + 1) % values.length;
8+
9+
colorMode.preference = values[next];
10+
};
1211
</script>
1312

1413
<template>
15-
<UTooltip text="Toggle theme" :ui="{ popper: { strategy: 'absolute' } }">
16-
<button
17-
class="relative px-3 py-4 flex items-center justify-center transition hover:text-primary-500 dark:hover:text-primary-400"
18-
@click="isDark = !isDark"
19-
>
20-
<Icon
21-
aria-hidden="true"
22-
:name="isDark ? 'solar:sun-2-outline' : 'solar:moon-outline'"
23-
class="w-5 h-5"
24-
/>
25-
<span class="sr-only">Toggle theme</span>
26-
</button>
27-
</UTooltip>
14+
<button
15+
aria-label="Color Mode"
16+
@click="onClick"
17+
class="absolute px-3 py-4 flex items-center justify-center transition hover:text-primary-500 dark:hover:text-primary-400"
18+
>
19+
<ColorScheme placeholder="...">
20+
<Icon v-if="colorMode.preference === 'dark'" name="uil:moon" />
21+
<Icon v-else-if="colorMode.preference === 'light'" name="uil:sun" />
22+
<Icon v-else name="uil:desktop" />
23+
</ColorScheme>
24+
</button>
2825
</template>

site/components/App/ToDoTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defineProps({
44
type: Object,
55
required: true,
66
},
7-
})
7+
});
88
</script>
99

1010
<template>

site/components/App/UsesHeader.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ defineProps({
1616
type: String,
1717
required: true,
1818
},
19-
})
19+
});
2020
</script>

site/components/Motionable.vue

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
<script setup lang="ts">
2-
import { useMotions } from '@vueuse/motion'
2+
import { useMotions } from "@vueuse/motion";
33
44
interface MotionableProps {
5-
as?: string | object;
6-
name: string;
7-
show?: boolean;
5+
as?: string | object;
6+
name: string;
7+
show?: boolean;
88
}
99
1010
const props = withDefaults(defineProps<MotionableProps>(), {
11-
as: 'div',
12-
show: true,
13-
})
11+
as: "div",
12+
show: true,
13+
});
1414
15-
const motions = useMotions()
16-
const leaved = ref(!props.show)
15+
const motions = useMotions();
16+
const leaved = ref(!props.show);
1717
1818
watch(
19-
() => props.show,
20-
async (newShow) => {
21-
const motion = motions[props.name]
22-
23-
if (motion && motion.isAnimating.value) {
24-
motion.stop('leave')
25-
26-
if (newShow) {
27-
motion.apply('enter')
28-
}
29-
}
30-
31-
if (!newShow) {
32-
leaved.value = false
33-
34-
motion.leave(() => {
35-
leaved.value = true
36-
})
37-
}
38-
},
39-
)
19+
() => props.show,
20+
async (newShow) => {
21+
const motion = motions[props.name];
22+
23+
if (motion?.isAnimating.value) {
24+
motion.stop("leave");
25+
26+
if (newShow) {
27+
motion.apply("enter");
28+
}
29+
}
30+
31+
if (!newShow) {
32+
leaved.value = false;
33+
34+
motion.leave(() => {
35+
leaved.value = true;
36+
});
37+
}
38+
},
39+
);
4040
</script>
4141
<template>
4242
<component :is="as" v-if="show || !leaved" v-motion="name">

site/components/navigation/MenuItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
2-
import type { NavigationItem } from '~/types/navigation'
2+
import type { NavigationItem } from "~/types/navigation";
33
44
defineProps<{
55
item: NavigationItem;
6-
}>()
6+
}>();
77
</script>
88
<template>
99
<NuxtLink

0 commit comments

Comments
 (0)