Skip to content

Commit fa13dee

Browse files
committed
Adding updates to actions and code styles
1 parent f894fb0 commit fa13dee

28 files changed

+324
-371
lines changed

.github/workflows/lint.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
quality:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup PHP
20+
uses: shivammathur/setup-php@v2
21+
with:
22+
php-version: '8.2'
23+
24+
- name: Install Dependencies
25+
run: |
26+
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
27+
npm install
28+
29+
- name: Run Pint
30+
run: vendor/bin/pint
31+
32+
- name: Frontend Format Check
33+
run: npm run format
34+
35+
- name: Frontend Lint
36+
run: npm run lint
37+
38+
- name: Commit changes
39+
uses: stefanzweifel/git-auto-commit-action@v5
40+
with:
41+
commit_message: fix code style
42+
commit_options: '--no-verify'
43+
44+
# We need to run PHPStan after commiting changes as it does not auto-fix errors.
45+
- name: PHPStan
46+
run: ./vendor/bin/phpstan

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,4 @@
7575
},
7676
"minimum-stability": "dev",
7777
"prefer-stable": true
78-
}
78+
}

eslint.config.js

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
11
import js from '@eslint/js';
22
import prettier from 'eslint-config-prettier';
3+
import vue from 'eslint-plugin-vue';
34
import globals from 'globals';
45
import typescript from 'typescript-eslint';
5-
import vue from 'eslint-plugin-vue';
66

77
/** @type {import('eslint').Linter.Config[]} */
88
export default [
99
js.configs.recommended,
1010
...typescript.configs.recommended,
1111
{
1212
...vue.configs.flat.recommended,
13-
...vue.configs["flat/strongly-recommended"],
14-
...vue.configs["flat/essential"],
13+
...vue.configs['flat/strongly-recommended'],
14+
...vue.configs['flat/essential'],
1515
languageOptions: {
1616
globals: {
1717
...globals.browser,
1818
},
1919
},
2020
rules: {
21-
"vue/match-component-import-name": "warn",
22-
"vue/match-component-file-name": [
23-
"error",
21+
'vue/match-component-import-name': 'warn',
22+
'vue/match-component-file-name': [
23+
'error',
2424
{
25-
extensions: ["vue"],
25+
extensions: ['vue'],
2626
shouldMatchCase: true,
2727
},
2828
],
29-
"vue/component-definition-name-casing": ["error", "PascalCase"],
30-
"vue/block-tag-newline": [
31-
"warn",
29+
'vue/component-definition-name-casing': ['error', 'PascalCase'],
30+
'vue/block-tag-newline': [
31+
'warn',
3232
{
33-
singleline: "always",
34-
multiline: "always",
33+
singleline: 'always',
34+
multiline: 'always',
3535
maxEmptyLines: 0,
3636
},
3737
],
38-
"vue/html-self-closing": [
39-
"error",
38+
'vue/html-self-closing': [
39+
'error',
4040
{
4141
html: {
42-
void: "always",
43-
normal: "never",
44-
component: "always",
42+
void: 'always',
43+
normal: 'never',
44+
component: 'always',
4545
},
46-
svg: "always",
47-
math: "always",
46+
svg: 'always',
47+
math: 'always',
4848
},
4949
],
50-
"vue/require-default-prop": "off",
50+
'vue/require-default-prop': 'off',
5151
},
5252
},
5353
{
5454
plugins: {
55-
"@typescript-eslint": tseslint.plugin,
55+
'@typescript-eslint': tseslint.plugin,
5656
},
5757
languageOptions: {
5858
parser: tseslint.parser,
@@ -65,4 +65,4 @@ export default [
6565
ignores: ['vendor', 'node_modules', 'public', 'bootstrap/ssr', 'tailwind.config.js'],
6666
},
6767
prettier, // Turn off all rules that might conflict with Prettier
68-
];
68+
];

resources/css/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@
8383
body {
8484
@apply bg-background text-foreground;
8585
}
86-
}
86+
}

resources/js/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import '../css/app.css';
22

33
import { createInertiaApp } from '@inertiajs/vue3';
44
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
5-
import { createApp, h } from 'vue';
65
import type { DefineComponent } from 'vue';
6+
import { createApp, h } from 'vue';
77
import { ZiggyVue } from '../../vendor/tightenco/ziggy';
88
import { initializeTheme } from './composables/useAppearance';
99

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
<script setup lang="ts">
2-
import { SidebarInset } from '@/components/ui/sidebar'
3-
import { computed } from 'vue'
2+
import { SidebarInset } from '@/components/ui/sidebar';
3+
import { computed } from 'vue';
44
55
interface Props {
6-
variant?: 'header' | 'sidebar'
7-
class?: string
6+
variant?: 'header' | 'sidebar';
7+
class?: string;
88
}
99
10-
const props = defineProps<Props>()
11-
const className = computed(() => props.class)
10+
const props = defineProps<Props>();
11+
const className = computed(() => props.class);
1212
</script>
1313

1414
<template>
15-
<SidebarInset v-if="props.variant === 'sidebar'" :class="className">
16-
<slot />
17-
</SidebarInset>
18-
<main
19-
v-else
20-
class="flex h-full flex-1 flex-col gap-4 rounded-xl max-w-7xl mx-auto w-full"
21-
:class="className"
22-
>
23-
<slot />
24-
</main>
15+
<SidebarInset v-if="props.variant === 'sidebar'" :class="className">
16+
<slot />
17+
</SidebarInset>
18+
<main v-else class="mx-auto flex h-full w-full max-w-7xl flex-1 flex-col gap-4 rounded-xl" :class="className">
19+
<slot />
20+
</main>
2521
</template>
Lines changed: 43 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,42 @@
11
<script setup lang="ts">
2-
import { Link, usePage } from '@inertiajs/vue3'
3-
import type { BreadcrumbItem, NavItem } from '@/types'
4-
import AppLogo from '@/components/AppLogo.vue'
5-
import AppLogoIcon from '@/components/AppLogoIcon.vue'
6-
import { Button } from "@/components/ui/button"
7-
import {
8-
DropdownMenu,
9-
DropdownMenuContent,
10-
DropdownMenuTrigger,
11-
} from '@/components/ui/dropdown-menu'
12-
import {
13-
Tooltip,
14-
TooltipContent,
15-
TooltipProvider,
16-
TooltipTrigger,
17-
} from '@/components/ui/tooltip'
18-
import {
19-
Sheet,
20-
SheetContent,
21-
SheetHeader,
22-
SheetTrigger,
23-
} from '@/components/ui/sheet'
2+
import AppLogo from '@/components/AppLogo.vue';
3+
import AppLogoIcon from '@/components/AppLogoIcon.vue';
4+
import UserMenuContent from '@/components/UserMenuContent.vue';
5+
import { Button } from '@/components/ui/button';
6+
import { DropdownMenu, DropdownMenuContent, DropdownMenuTrigger } from '@/components/ui/dropdown-menu';
247
import {
258
NavigationMenu,
269
NavigationMenuItem,
2710
NavigationMenuLink,
2811
NavigationMenuList,
2912
navigationMenuTriggerStyle,
30-
} from '@/components/ui/navigation-menu'
31-
import { BookOpenText, ChevronDown, FolderGit2, LayoutGrid, Menu, Search } from 'lucide-vue-next'
32-
import UserMenuContent from '@/components/UserMenuContent.vue'
33-
import { getInitials } from '@/composables/useInitials'
34-
import { computed } from 'vue'
13+
} from '@/components/ui/navigation-menu';
14+
import { Sheet, SheetContent, SheetHeader, SheetTrigger } from '@/components/ui/sheet';
15+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip';
16+
import { getInitials } from '@/composables/useInitials';
17+
import type { BreadcrumbItem, NavItem } from '@/types';
18+
import { Link, usePage } from '@inertiajs/vue3';
19+
import { BookOpenText, ChevronDown, FolderGit2, LayoutGrid, Menu, Search } from 'lucide-vue-next';
20+
import { computed } from 'vue';
3521
3622
interface Props {
37-
breadcrumbs?: BreadcrumbItem[]
23+
breadcrumbs?: BreadcrumbItem[];
3824
}
3925
4026
const props = withDefaults(defineProps<Props>(), {
41-
breadcrumbs: () => []
42-
})
27+
breadcrumbs: () => [],
28+
});
4329
44-
const page = usePage()
45-
const auth = computed(() => page.props.auth)
30+
const page = usePage();
31+
const auth = computed(() => page.props.auth);
4632
4733
const isCurrentRoute = (url: string) => {
48-
return page.url === url
49-
}
34+
return page.url === url;
35+
};
5036
51-
const activeItemStyles = computed(() => (url: string) =>
52-
isCurrentRoute(url) ? 'bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100' : ''
53-
)
37+
const activeItemStyles = computed(
38+
() => (url: string) => (isCurrentRoute(url) ? 'bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100' : ''),
39+
);
5440
5541
const mainNavItems: NavItem[] = [
5642
{
@@ -77,13 +63,12 @@ const rightNavItems: NavItem[] = [
7763
<template>
7864
<div>
7965
<div class="border-b border-sidebar-border/80">
80-
<div class="flex h-16 items-center px-4 md:max-w-7xl mx-auto">
66+
<div class="mx-auto flex h-16 items-center px-4 md:max-w-7xl">
8167
<!-- Mobile Menu -->
8268
<div class="lg:hidden">
83-
8469
<Sheet>
8570
<SheetTrigger :as-child="true">
86-
<Button variant="ghost" size="icon" class="w-9 h-9 mr-2">
71+
<Button variant="ghost" size="icon" class="mr-2 h-9 w-9">
8772
<Menu class="h-5 w-5" />
8873
</Button>
8974
</SheetTrigger>
@@ -93,7 +78,7 @@ const rightNavItems: NavItem[] = [
9378
<AppLogoIcon class="size-6 fill-current text-black dark:text-white" />
9479
</SheetHeader>
9580
<div className="flex flex-col justify-between h-full space-y-4 py-6 flex-1">
96-
<nav class="space-y-1 -mx-3">
81+
<nav class="-mx-3 space-y-1">
9782
<Link
9883
v-for="item in mainNavItems"
9984
:key="item.title"
@@ -112,7 +97,7 @@ const rightNavItems: NavItem[] = [
11297
:href="item.url"
11398
target="_blank"
11499
rel="noopener noreferrer"
115-
class="flex items-center text-sm space-x-2 font-medium"
100+
class="flex items-center space-x-2 text-sm font-medium"
116101
>
117102
<component v-if="item.icon" :is="item.icon" class="h-5 w-5" />
118103
<span>{{ item.title }}</span>
@@ -128,10 +113,8 @@ const rightNavItems: NavItem[] = [
128113
</Link>
129114

130115
<!-- Desktop Menu -->
131-
<div class="hidden lg:flex lg:flex-1 h-full">
132-
133-
134-
<NavigationMenu class="flex h-full items-stretch ml-10">
116+
<div class="hidden h-full lg:flex lg:flex-1">
117+
<NavigationMenu class="ml-10 flex h-full items-stretch">
135118
<NavigationMenuList class="flex h-full items-stretch space-x-2">
136119
<NavigationMenuItem v-for="(item, index) in mainNavItems" :key="index" class="relative flex h-full items-center">
137120
<Link :href="item.url">
@@ -146,12 +129,11 @@ const rightNavItems: NavItem[] = [
146129
</NavigationMenuItem>
147130
</NavigationMenuList>
148131
</NavigationMenu>
149-
150132
</div>
151133

152134
<div class="ml-auto flex items-center space-x-2">
153135
<div class="relative flex items-center space-x-1">
154-
<Button variant="ghost" size="icon" class="w-9 h-9 cursor-pointer">
136+
<Button variant="ghost" size="icon" class="h-9 w-9 cursor-pointer">
155137
<Search class="h-5 w-5" />
156138
</Button>
157139

@@ -178,24 +160,18 @@ const rightNavItems: NavItem[] = [
178160

179161
<DropdownMenu>
180162
<DropdownMenuTrigger :as-child="true">
181-
<Button
182-
variant="ghost"
183-
size="icon"
184-
class="relative h-9 w-auto px-1 rounded-md"
185-
>
186-
<span><img
187-
v-if="auth.user?.avatar"
188-
:src="auth.user.avatar"
189-
:alt="auth.user.name"
190-
class="rounded-full"
191-
/>
192-
<span v-else class="flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-sm font-medium text-primary">
193-
{{ getInitials(auth.user?.name) }}
194-
</span>
163+
<Button variant="ghost" size="icon" class="relative h-9 w-auto rounded-md px-1">
164+
<span
165+
><img v-if="auth.user?.avatar" :src="auth.user.avatar" :alt="auth.user.name" class="rounded-full" />
166+
<span
167+
v-else
168+
class="flex h-7 w-7 items-center justify-center rounded-md bg-primary/10 text-sm font-medium text-primary"
169+
>
170+
{{ getInitials(auth.user?.name) }}
171+
</span>
195172
</span>
196-
<ChevronDown class="ml-auto size-4 mr-1" />
173+
<ChevronDown class="ml-auto mr-1 size-4" />
197174
</Button>
198-
199175
</DropdownMenuTrigger>
200176
<DropdownMenuContent align="end" class="w-56">
201177
<UserMenuContent :user="auth.user" />
@@ -204,10 +180,10 @@ const rightNavItems: NavItem[] = [
204180
</div>
205181
</div>
206182
</div>
207-
<div v-if="props.breadcrumbs.length > 1" class="w-full flex border-b border-sidebar-border/70">
208-
<div class="flex h-12 items-center justify-start w-full px-4 md:max-w-7xl mx-auto text-neutral-500">
183+
<div v-if="props.breadcrumbs.length > 1" class="flex w-full border-b border-sidebar-border/70">
184+
<div class="mx-auto flex h-12 w-full items-center justify-start px-4 text-neutral-500 md:max-w-7xl">
209185
<Breadcrumbs :breadcrumbs="props.breadcrumbs" />
210186
</div>
211187
</div>
212188
</div>
213-
</template>
189+
</template>

0 commit comments

Comments
 (0)