Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a prettier for format #59

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:

- name: Run Pint
run: vendor/bin/pint

- name: Format Frontend
run: npm run format

# - name: Commit Changes
# uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
resources/views/mail/*
21 changes: 21 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"semi": true,
"singleQuote": true,
"singleAttributePerLine": false,
"htmlWhitespaceSensitivity": "css",
"printWidth": 150,
"plugins": [
"prettier-plugin-blade",
"prettier-plugin-tailwindcss",
"prettier-plugin-organize-imports"
],
"tabWidth": 4,
"overrides": [
{
"files": "**/*.yml",
"options": {
"tabWidth": 2
}
}
]
}
560 changes: 351 additions & 209 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite"
"dev": "vite",
"format": "prettier --write resources/",
"format:check": "prettier --check resources/"
},
"devDependencies": {
"prettier": "^3.5.3",
"prettier-plugin-blade": "^2.1.21",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.6.11"
},
"dependencies": {
"@tailwindcss/vite": "^4.0.7",
Expand Down
8 changes: 4 additions & 4 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
@custom-variant dark (&:where(.dark, .dark *));

@theme {
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
--font-sans:
'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meh


--color-zinc-50: #fafafa;
--color-zinc-100: #f5f5f5;
Expand Down Expand Up @@ -37,7 +38,6 @@
}

@layer base {

*,
::after,
::before,
Expand All @@ -52,13 +52,13 @@
}

[data-flux-label] {
@apply !mb-0 !leading-tight;
@apply !mb-0 !leading-tight;
}

input:focus[data-flux-control],
textarea:focus[data-flux-control],
select:focus[data-flux-control] {
@apply outline-hidden ring-2 ring-accent ring-offset-2 ring-offset-accent-foreground;
@apply ring-accent ring-offset-accent-foreground ring-2 ring-offset-2 outline-hidden;
}

/* \[:where(&)\]:size-4 {
Expand Down
6 changes: 3 additions & 3 deletions resources/views/components/app-logo-icon.blade.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 42" {{ $attributes }}>
<path
fill="currentColor"
fill-rule="evenodd"
<path
fill="currentColor"
fill-rule="evenodd"
clip-rule="evenodd"
d="M17.2 5.633 8.6.855 0 5.633v26.51l16.2 9 16.2-9v-8.442l7.6-4.223V9.856l-8.6-4.777-8.6 4.777V18.3l-5.6 3.111V5.633ZM38 18.301l-5.6 3.11v-6.157l5.6-3.11V18.3Zm-1.06-7.856-5.54 3.078-5.54-3.079 5.54-3.078 5.54 3.079ZM24.8 18.3v-6.157l5.6 3.111v6.158L24.8 18.3Zm-1 1.732 5.54 3.078-13.14 7.302-5.54-3.078 13.14-7.3v-.002Zm-16.2 7.89 7.6 4.222V38.3L2 30.966V7.92l5.6 3.111v16.892ZM8.6 9.3 3.06 6.222 8.6 3.143l5.54 3.08L8.6 9.3Zm21.8 15.51-13.2 7.334V38.3l13.2-7.334v-6.156ZM9.6 11.034l5.6-3.11v14.6l-5.6 3.11v-14.6Z"
/>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/app-logo.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="flex aspect-square size-8 items-center justify-center rounded-md bg-accent-content text-accent-foreground">
<div class="bg-accent-content text-accent-foreground flex aspect-square size-8 items-center justify-center rounded-md">
<x-app-logo-icon class="size-5 fill-current text-white dark:text-black" />
</div>
<div class="ml-1 grid flex-1 text-left text-sm">
Expand Down
15 changes: 6 additions & 9 deletions resources/views/components/layouts/app/header.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<flux:header container class="border-b border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.toggle class="lg:hidden" icon="bars-2" inset="left" />

<a href="{{ route('dashboard') }}" class="ml-2 mr-5 flex items-center space-x-2 lg:ml-0" wire:navigate>
<a href="{{ route('dashboard') }}" class="mr-5 ml-2 flex items-center space-x-2 lg:ml-0" wire:navigate>
<x-app-logo />
</a>

Expand Down Expand Up @@ -45,10 +45,7 @@ class="h-10 max-lg:hidden [&>div>svg]:size-5"

<!-- Desktop User Menu -->
<flux:dropdown position="top" align="end">
<flux:profile
class="cursor-pointer"
:initials="auth()->user()->initials()"
/>
<flux:profile class="cursor-pointer" :initials="auth()->user()->initials()" />

<flux:menu>
<flux:menu.radio.group>
Expand Down Expand Up @@ -89,7 +86,7 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
</flux:header>

<!-- Mobile Menu -->
<flux:sidebar stashable sticky class="lg:hidden border-r border-zinc-200 bg-zinc-50 dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar stashable sticky class="border-r border-zinc-200 bg-zinc-50 lg:hidden dark:border-zinc-700 dark:bg-zinc-900">
<flux:sidebar.toggle class="lg:hidden" icon="x-mark" />

<a href="{{ route('dashboard') }}" class="ml-1 flex items-center space-x-2" wire:navigate>
Expand All @@ -99,7 +96,7 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
<flux:navlist variant="outline">
<flux:navlist.group :heading="__('Platform')">
<flux:navlist.item icon="layout-grid" :href="route('dashboard')" :current="request()->routeIs('dashboard')" wire:navigate>
{{ __('Dashboard') }}
{{ __('Dashboard') }}
</flux:navlist.item>
</flux:navlist.group>
</flux:navlist>
Expand All @@ -108,11 +105,11 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200

<flux:navlist variant="outline">
<flux:navlist.item icon="folder-git-2" href="https://github.com/laravel/livewire-starter-kit" target="_blank">
{{ __('Repository') }}
{{ __('Repository') }}
</flux:navlist.item>

<flux:navlist.item icon="book-open-text" href="https://laravel.com/docs/starter-kits" target="_blank">
{{ __('Documentation') }}
{{ __('Documentation') }}
</flux:navlist.item>
</flux:navlist>
</flux:sidebar>
Expand Down
19 changes: 7 additions & 12 deletions resources/views/components/layouts/app/sidebar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,27 @@

<flux:navlist variant="outline">
<flux:navlist.group :heading="__('Platform')" class="grid">
<flux:navlist.item icon="home" :href="route('dashboard')" :current="request()->routeIs('dashboard')" wire:navigate>{{ __('Dashboard') }}</flux:navlist.item>
<flux:navlist.item icon="home" :href="route('dashboard')" :current="request()->routeIs('dashboard')" wire:navigate>
{{ __('Dashboard') }}
</flux:navlist.item>
</flux:navlist.group>
</flux:navlist>

<flux:spacer />

<flux:navlist variant="outline">
<flux:navlist.item icon="folder-git-2" href="https://github.com/laravel/livewire-starter-kit" target="_blank">
{{ __('Repository') }}
{{ __('Repository') }}
</flux:navlist.item>

<flux:navlist.item icon="book-open-text" href="https://laravel.com/docs/starter-kits" target="_blank">
{{ __('Documentation') }}
{{ __('Documentation') }}
</flux:navlist.item>
</flux:navlist>

<!-- Desktop User Menu -->
<flux:dropdown position="bottom" align="start">
<flux:profile
:name="auth()->user()->name"
:initials="auth()->user()->initials()"
icon-trailing="chevrons-up-down"
/>
<flux:profile :name="auth()->user()->name" :initials="auth()->user()->initials()" icon-trailing="chevrons-up-down" />

<flux:menu class="w-[220px]">
<flux:menu.radio.group>
Expand Down Expand Up @@ -82,10 +80,7 @@ class="flex h-full w-full items-center justify-center rounded-lg bg-neutral-200
<flux:spacer />

<flux:dropdown position="top" align="end">
<flux:profile
:initials="auth()->user()->initials()"
icon-trailing="chevron-down"
/>
<flux:profile :initials="auth()->user()->initials()" icon-trailing="chevron-down" />

<flux:menu>
<flux:menu.radio.group>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/layouts/auth/card.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</a>

<div class="flex flex-col gap-6">
<div class="rounded-xl border bg-white dark:bg-stone-950 dark:border-stone-800 text-stone-800 shadow-xs">
<div class="rounded-xl border bg-white text-stone-800 shadow-xs dark:border-stone-800 dark:bg-stone-950">
<div class="px-10 py-8">{{ $slot }}</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/layouts/auth/simple.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class="bg-background flex min-h-svh flex-col items-center justify-center gap-6 p-6 md:p-10">
<div class="flex w-full max-w-sm flex-col gap-2">
<a href="{{ route('home') }}" class="flex flex-col items-center gap-2 font-medium" wire:navigate>
<span class="flex h-9 w-9 mb-1 items-center justify-center rounded-md">
<span class="mb-1 flex h-9 w-9 items-center justify-center rounded-md">
<x-app-logo-icon class="size-9 fill-current text-black dark:text-white" />
</span>
<span class="sr-only">{{ config('app.name', 'Laravel') }}</span>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/flux/navlist/group.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
type="button"
class="group/disclosure-button mb-[2px] flex h-10 w-full items-center rounded-lg text-zinc-500 hover:bg-zinc-800/5 hover:text-zinc-800 lg:h-8 dark:text-white/80 dark:hover:bg-white/[7%] dark:hover:text-white"
>
<div class="pl-3 pr-4">
<div class="pr-4 pl-3">
<flux:icon.chevron-down class="hidden size-3! group-data-open/disclosure-button:block" />
<flux:icon.chevron-right class="block size-3! group-data-open/disclosure-button:hidden" />
</div>

<span class="text-sm font-medium leading-none">{{ $heading }}</span>
<span class="text-sm leading-none font-medium">{{ $heading }}</span>
</button>

<div class="relative hidden space-y-[2px] pl-7 data-open:block" @if ($expanded === true) data-open @endif>
Expand Down
10 changes: 6 additions & 4 deletions resources/views/livewire/auth/confirm-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ public function confirmPassword(): void
'password' => ['required', 'string'],
]);

if (! Auth::guard('web')->validate([
'email' => Auth::user()->email,
'password' => $this->password,
])) {
if (
! Auth::guard('web')->validate([
'email' => Auth::user()->email,
'password' => $this->password,
])
) {
throw ValidationException::withMessages([
'password' => __('auth.password'),
]);
Expand Down
9 changes: 1 addition & 8 deletions resources/views/livewire/auth/forgot-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ public function sendPasswordResetLink(): void

<form wire:submit="sendPasswordResetLink" class="flex flex-col gap-6">
<!-- Email Address -->
<flux:input
wire:model="email"
:label="__('Email Address')"
type="email"
required
autofocus
placeholder="[email protected]"
/>
<flux:input wire:model="email" :label="__('Email Address')" type="email" required autofocus placeholder="[email protected]" />

<flux:button variant="primary" type="submit" class="w-full">{{ __('Email password reset link') }}</flux:button>
</form>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/livewire/auth/login.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected function ensureIsNotRateLimited(): void
*/
protected function throttleKey(): string
{
return Str::transliterate(Str::lower($this->email).'|'.request()->ip());
return Str::transliterate(Str::lower($this->email) . '|' . request()->ip());
}
}; ?>

Expand Down Expand Up @@ -103,7 +103,7 @@ protected function throttleKey(): string
/>

@if (Route::has('password.request'))
<flux:link class="absolute right-0 top-0 text-sm" :href="route('password.request')" wire:navigate>
<flux:link class="absolute top-0 right-0 text-sm" :href="route('password.request')" wire:navigate>
{{ __('Forgot your password?') }}
</flux:link>
@endif
Expand Down
19 changes: 2 additions & 17 deletions resources/views/livewire/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,25 +43,10 @@ public function register(): void

<form wire:submit="register" class="flex flex-col gap-6">
<!-- Name -->
<flux:input
wire:model="name"
:label="__('Name')"
type="text"
required
autofocus
autocomplete="name"
:placeholder="__('Full name')"
/>
<flux:input wire:model="name" :label="__('Name')" type="text" required autofocus autocomplete="name" :placeholder="__('Full name')" />

<!-- Email Address -->
<flux:input
wire:model="email"
:label="__('Email address')"
type="email"
required
autocomplete="email"
placeholder="[email protected]"
/>
<flux:input wire:model="email" :label="__('Email address')" type="email" required autocomplete="email" placeholder="[email protected]" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for elements with many attributes is it not better to go on multiple lines? is there not a limit of characters per line?


<!-- Password -->
<flux:input
Expand Down
23 changes: 8 additions & 15 deletions resources/views/livewire/auth/reset-password.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,16 @@ public function resetPassword(): void
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$status = Password::reset(
$this->only('email', 'password', 'password_confirmation', 'token'),
function ($user) {
$user->forceFill([
$status = Password::reset($this->only('email', 'password', 'password_confirmation', 'token'), function ($user) {
$user
->forceFill([
'password' => Hash::make($this->password),
'remember_token' => Str::random(60),
])->save();
])
->save();

event(new PasswordReset($user));
}
);
event(new PasswordReset($user));
});

// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
Expand All @@ -76,13 +75,7 @@ function ($user) {

<form wire:submit="resetPassword" class="flex flex-col gap-6">
<!-- Email Address -->
<flux:input
wire:model="email"
:label="__('Email')"
type="email"
required
autocomplete="email"
/>
<flux:input wire:model="email" :label="__('Email')" type="email" required autocomplete="email" />

<!-- Password -->
<flux:input
Expand Down
4 changes: 2 additions & 2 deletions resources/views/livewire/auth/verify-email.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function logout(Logout $logout): void
</flux:text>

@if (session('status') == 'verification-link-sent')
<flux:text class="text-center font-medium !dark:text-green-400 !text-green-600">
<flux:text class="!dark:text-green-400 text-center font-medium !text-green-600">
{{ __('A new verification link has been sent to the email address you provided during registration.') }}
</flux:text>
@endif
Expand All @@ -50,7 +50,7 @@ public function logout(Logout $logout): void
{{ __('Resend verification email') }}
</flux:button>

<flux:link class="text-sm cursor-pointer" wire:click="logout">
<flux:link class="cursor-pointer text-sm" wire:click="logout">
{{ __('Log out') }}
</flux:link>
</div>
Expand Down
Loading
Loading