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

Laravel 11.x #135

Merged
merged 4 commits into from
Feb 14, 2025
Merged
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
6 changes: 0 additions & 6 deletions .prettierignore

This file was deleted.

12 changes: 0 additions & 12 deletions .prettierrc

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### TL;DR
### TL;DR

```bash
composer create-project justd/laravel your-project-name
Expand Down
80 changes: 80 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": ["vendor", "node_modules", "resources/js/ziggy.js"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off",
"noParameterAssign": "warn",
"useImportType": "error"
},
"complexity": {
"useArrowFunction": "error"
},
"a11y": {
"noSvgWithoutTitle": "off",
"useValidAnchor": "off",
"useSemanticElements": "off"
},
"correctness": {
"useHookAtTopLevel": "error",
"noUnusedImports": "error",
"useExhaustiveDependencies": "off",
"noChildrenProp": "off"
},
"suspicious": {
"noExplicitAny": "off",
"noArrayIndexKey": "off",
"noConsoleLog": "warn"
},
"nursery": {
"useSortedClasses": {
"level": "error",
"fix": "safe",
"options": {
"attributes": ["classList"],
"functions": ["cn", "twJoin", "tv", "composeRenderProps", "composeTailwindRenderProps"]
}
}
}
},
"ignore": []
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"indentWidth": 2,
"lineWidth": 100,
"ignore": []
},
"javascript": {
"formatter": {
"quoteStyle": "double",
"arrowParentheses": "always",
"bracketSameLine": false,
"bracketSpacing": true,
"jsxQuoteStyle": "double",
"quoteProperties": "asNeeded",
"semicolons": "asNeeded",
"trailingCommas": "all"
}
},
"json": {
"formatter": {
"trailingCommas": "none"
}
}
}
Binary file modified bun.lockb
Binary file not shown.
16 changes: 7 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"scripts": {
"dev": "vite",
"build": "tsc && vite build && vite build --ssr",
"format": "prettier --write .",
"format": "biome format --write resources/js && biome lint --fix resources/js",
"release": "export GITHUB_TOKEN=$(cat .github_token) && release-it",
"preview": "tsc && npm run build && php artisan inertia:start-ssr"
},
"devDependencies": {
"@biomejs/biome": "^1.9.4",
"@commitlint/cli": "^19.7.1",
"@commitlint/config-conventional": "^19.7.1",
"@inertiajs/react": "^2.0.3",
Expand All @@ -21,20 +22,17 @@
"axios": "^1.7.9",
"husky": "^9.1.7",
"laravel-vite-plugin": "^1.2.0",
"prettier": "^3.4.2",
"prettier-plugin-organize-imports": "^4.1.0",
"prettier-plugin-tailwindcss": "^0.6.11",
"release-it": "^17.11.0",
"tailwindcss": "^4.0.4",
"tailwindcss": "^4.0.6",
"typescript": "^5.7.3",
"vite-plugin-watch": "^0.3.1"
},
"dependencies": {
"@tailwindcss/vite": "^4.0.4",
"@types/node": "^22.13.1",
"@tailwindcss/vite": "^4.0.6",
"@types/node": "^22.13.4",
"clsx": "^2.1.1",
"justd-icons": "^1.10.24",
"motion": "^12.4.0",
"justd-icons": "^1.10.25",
"motion": "^12.4.2",
"react": "^19.0.0",
"react-aria-components": "^1.6.0",
"react-dom": "^19.0.0",
Expand Down
5 changes: 3 additions & 2 deletions resources/css/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
@variant dark (&:is(.dark *));

@theme {
--font-sans: 'Figtree', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
'Segoe UI Symbol', 'Noto Color Emoji';
--font-sans:
'Figtree', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
'Noto Color Emoji';

--color-border: var(--border);
--color-input: var(--input);
Expand Down
37 changes: 19 additions & 18 deletions resources/js/app.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
import '../css/app.css';
import './bootstrap';
import "../css/app.css"
import "./bootstrap"

import { Providers } from '@/components/providers';
import { Ziggy } from '@/ziggy';
import { createInertiaApp } from '@inertiajs/react';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { createRoot, hydrateRoot } from 'react-dom/client';
import { useRoute } from 'ziggy-js';
import { Providers } from "@/components/providers"
import { Ziggy } from "@/ziggy"
import { createInertiaApp } from "@inertiajs/react"
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers"
import { createRoot, hydrateRoot } from "react-dom/client"
import { useRoute } from "ziggy-js"

const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
const appName = import.meta.env.VITE_APP_NAME || "Laravel"

createInertiaApp({
title: (title) => (title ? title + ' / ' + appName : appName),
resolve: (name) => resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob('./pages/**/*.tsx')),
title: (title) => (title ? `${title} / ${appName}` : appName),
resolve: (name) =>
resolvePageComponent(`./pages/${name}.tsx`, import.meta.glob("./pages/**/*.tsx")),
setup({ el, App, props }) {
// @ts-expect-error
window.route = useRoute(Ziggy as any);
window.route = useRoute(Ziggy as any)
const appElement = (
<Providers>
<App {...props} />
</Providers>
);
)
if (import.meta.env.SSR) {
hydrateRoot(el, appElement);
return;
hydrateRoot(el, appElement)
return
}

createRoot(el).render(appElement);
createRoot(el).render(appElement)
},
progress: false
});
progress: false,
})
6 changes: 3 additions & 3 deletions resources/js/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import axios from 'axios';
import axios from "axios"

window.axios = axios;
window.axios = axios

window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
window.axios.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"
20 changes: 10 additions & 10 deletions resources/js/components/flash-message.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import { FlashMessageData } from '@/types/index';
import { usePage } from '@inertiajs/react';
import { useEffect } from 'react';
import { toast } from 'sonner';
import { Toast } from 'ui';
import type { FlashMessageData } from "@/types"
import { usePage } from "@inertiajs/react"
import { useEffect } from "react"
import { toast } from "sonner"
import { Toast } from "ui"

export function FlashMessage() {
const { flash_message } = usePage<{ flash_message: FlashMessageData }>().props;
const { flash_message } = usePage<{ flash_message: FlashMessageData }>().props
useEffect(() => {
if (flash_message && flash_message.message) {
(toast as any)[flash_message.type](flash_message.message);
if (flash_message?.message) {
;(toast as any)[flash_message.type](flash_message.message)
}
}, [flash_message]);
return <Toast />;
}, [flash_message])
return <Toast />
}
Loading