diff --git a/api-monorepo/apps/backend/.env.example b/api-monorepo/apps/backend/.env.example index dfd7278..a57cc8a 100644 --- a/api-monorepo/apps/backend/.env.example +++ b/api-monorepo/apps/backend/.env.example @@ -6,13 +6,16 @@ NODE_ENV=development # App LOG_LEVEL=info -APP_KEY=zKXHe-Ahdb7aPK1ylAJlRgTefktEaACi +APP_KEY= APP_URL=http://${HOST}:${PORT} # Session SESSION_DRIVER=cookie +# Database (file name inside ./tmp) +DB_DATABASE=db.sqlite3 + #-------------------------------------------------------------------- # CORS (configure allowed origins for API access) #-------------------------------------------------------------------- -# CORS_ORIGIN=http://localhost:5173,http://localhost:3000 +# CORS_ORIGIN=http://localhost:5173,http://localhost:3000 \ No newline at end of file diff --git a/api-monorepo/apps/backend/.env.test b/api-monorepo/apps/backend/.env.test index 28d2da0..23ce22f 100644 --- a/api-monorepo/apps/backend/.env.test +++ b/api-monorepo/apps/backend/.env.test @@ -1 +1,5 @@ SESSION_DRIVER=memory + +# Dedicated test database. The test runner migrates and truncates it, +# so it must never point at the development database. +DB_DATABASE=test.sqlite3 diff --git a/api-monorepo/apps/backend/config/database.ts b/api-monorepo/apps/backend/config/database.ts index 751937b..0ebbb50 100644 --- a/api-monorepo/apps/backend/config/database.ts +++ b/api-monorepo/apps/backend/config/database.ts @@ -1,3 +1,4 @@ +import env from '#start/env' import app from '@adonisjs/core/services/app' import { defineConfig } from '@adonisjs/lucid' @@ -15,7 +16,7 @@ const dbConfig = defineConfig({ client: 'better-sqlite3', connection: { - filename: app.tmpPath('db.sqlite3'), + filename: app.tmpPath(env.get('DB_DATABASE')), }, /** diff --git a/api-monorepo/apps/backend/database/schema.ts b/api-monorepo/apps/backend/database/schema.ts index 521fa3a..e1e2811 100644 --- a/api-monorepo/apps/backend/database/schema.ts +++ b/api-monorepo/apps/backend/database/schema.ts @@ -8,18 +8,7 @@ import { BaseModel, column } from '@adonisjs/lucid/orm' import { DateTime } from 'luxon' export class AuthAccessTokenSchema extends BaseModel { - static $columns = [ - 'abilities', - 'createdAt', - 'expiresAt', - 'hash', - 'id', - 'lastUsedAt', - 'name', - 'tokenableId', - 'type', - 'updatedAt', - ] as const + static $columns = ['abilities', 'createdAt', 'expiresAt', 'hash', 'id', 'lastUsedAt', 'name', 'tokenableId', 'type', 'updatedAt'] as const $columns = AuthAccessTokenSchema.$columns @column() declare abilities: string diff --git a/api-monorepo/apps/backend/providers/api_provider.ts b/api-monorepo/apps/backend/providers/api_provider.ts index 8e4e00c..873eb95 100644 --- a/api-monorepo/apps/backend/providers/api_provider.ts +++ b/api-monorepo/apps/backend/providers/api_provider.ts @@ -29,7 +29,12 @@ class ApiSerializer extends BaseSerializer<{ 'Invalid pagination metadata. Expected metadata to contain Lucid pagination keys' ) } - return metaData + + /** + * The type guard of `@adonisjs/http-transformers` does not list + * `pageName`, which Lucid 22.5 added, so the value is cast. + */ + return metaData as SimplePaginatorMetaKeys } } diff --git a/api-monorepo/apps/backend/start/env.ts b/api-monorepo/apps/backend/start/env.ts index b9252b0..8b9cac0 100644 --- a/api-monorepo/apps/backend/start/env.ts +++ b/api-monorepo/apps/backend/start/env.ts @@ -24,4 +24,7 @@ export default await Env.create(new URL('../', import.meta.url), { // Session SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const), + + // Database + DB_DATABASE: Env.schema.string(), }) diff --git a/api-monorepo/apps/backend/tests/bootstrap.ts b/api-monorepo/apps/backend/tests/bootstrap.ts index bee79df..cce0702 100644 --- a/api-monorepo/apps/backend/tests/bootstrap.ts +++ b/api-monorepo/apps/backend/tests/bootstrap.ts @@ -41,7 +41,7 @@ export const plugins: Config['plugins'] = [ * The teardown functions are executed after all the tests */ export const runnerHooks: Required> = { - setup: [], + setup: [() => testUtils.db().migrate()], teardown: [], } diff --git a/api/.env.example b/api/.env.example index dfd7278..a57cc8a 100644 --- a/api/.env.example +++ b/api/.env.example @@ -6,13 +6,16 @@ NODE_ENV=development # App LOG_LEVEL=info -APP_KEY=zKXHe-Ahdb7aPK1ylAJlRgTefktEaACi +APP_KEY= APP_URL=http://${HOST}:${PORT} # Session SESSION_DRIVER=cookie +# Database (file name inside ./tmp) +DB_DATABASE=db.sqlite3 + #-------------------------------------------------------------------- # CORS (configure allowed origins for API access) #-------------------------------------------------------------------- -# CORS_ORIGIN=http://localhost:5173,http://localhost:3000 +# CORS_ORIGIN=http://localhost:5173,http://localhost:3000 \ No newline at end of file diff --git a/api/.env.test b/api/.env.test index 28d2da0..23ce22f 100644 --- a/api/.env.test +++ b/api/.env.test @@ -1 +1,5 @@ SESSION_DRIVER=memory + +# Dedicated test database. The test runner migrates and truncates it, +# so it must never point at the development database. +DB_DATABASE=test.sqlite3 diff --git a/api/config/database.ts b/api/config/database.ts index 9d20219..3063daa 100644 --- a/api/config/database.ts +++ b/api/config/database.ts @@ -1,3 +1,4 @@ +import env from '#start/env' import app from '@adonisjs/core/services/app' import { defineConfig } from '@adonisjs/lucid' @@ -15,7 +16,7 @@ const dbConfig = defineConfig({ client: 'better-sqlite3', connection: { - filename: app.tmpPath('db.sqlite3'), + filename: app.tmpPath(env.get('DB_DATABASE')), }, /** diff --git a/api/database/schema.ts b/api/database/schema.ts index 521fa3a..e1e2811 100644 --- a/api/database/schema.ts +++ b/api/database/schema.ts @@ -8,18 +8,7 @@ import { BaseModel, column } from '@adonisjs/lucid/orm' import { DateTime } from 'luxon' export class AuthAccessTokenSchema extends BaseModel { - static $columns = [ - 'abilities', - 'createdAt', - 'expiresAt', - 'hash', - 'id', - 'lastUsedAt', - 'name', - 'tokenableId', - 'type', - 'updatedAt', - ] as const + static $columns = ['abilities', 'createdAt', 'expiresAt', 'hash', 'id', 'lastUsedAt', 'name', 'tokenableId', 'type', 'updatedAt'] as const $columns = AuthAccessTokenSchema.$columns @column() declare abilities: string diff --git a/api/providers/api_provider.ts b/api/providers/api_provider.ts index 8e4e00c..873eb95 100644 --- a/api/providers/api_provider.ts +++ b/api/providers/api_provider.ts @@ -29,7 +29,12 @@ class ApiSerializer extends BaseSerializer<{ 'Invalid pagination metadata. Expected metadata to contain Lucid pagination keys' ) } - return metaData + + /** + * The type guard of `@adonisjs/http-transformers` does not list + * `pageName`, which Lucid 22.5 added, so the value is cast. + */ + return metaData as SimplePaginatorMetaKeys } } diff --git a/api/start/env.ts b/api/start/env.ts index b9252b0..8b9cac0 100644 --- a/api/start/env.ts +++ b/api/start/env.ts @@ -24,4 +24,7 @@ export default await Env.create(new URL('../', import.meta.url), { // Session SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const), + + // Database + DB_DATABASE: Env.schema.string(), }) diff --git a/api/tests/bootstrap.ts b/api/tests/bootstrap.ts index bee79df..cce0702 100644 --- a/api/tests/bootstrap.ts +++ b/api/tests/bootstrap.ts @@ -41,7 +41,7 @@ export const plugins: Config['plugins'] = [ * The teardown functions are executed after all the tests */ export const runnerHooks: Required> = { - setup: [], + setup: [() => testUtils.db().migrate()], teardown: [], } diff --git a/hypermedia/.env.example b/hypermedia/.env.example index 3a49872..4cdfcbc 100644 --- a/hypermedia/.env.example +++ b/hypermedia/.env.example @@ -6,8 +6,11 @@ NODE_ENV=development # App LOG_LEVEL=info -APP_KEY=zKXHe-Ahdb7aPK1ylAJlRgTefktEaACi +APP_KEY= APP_URL=http://${HOST}:${PORT} # Session SESSION_DRIVER=cookie + +# Database (file name inside ./tmp) +DB_DATABASE=db.sqlite3 \ No newline at end of file diff --git a/hypermedia/.env.test b/hypermedia/.env.test index 28d2da0..23ce22f 100644 --- a/hypermedia/.env.test +++ b/hypermedia/.env.test @@ -1 +1,5 @@ SESSION_DRIVER=memory + +# Dedicated test database. The test runner migrates and truncates it, +# so it must never point at the development database. +DB_DATABASE=test.sqlite3 diff --git a/hypermedia/config/database.ts b/hypermedia/config/database.ts index 5b6408c..9c0ead5 100644 --- a/hypermedia/config/database.ts +++ b/hypermedia/config/database.ts @@ -1,3 +1,4 @@ +import env from '#start/env' import app from '@adonisjs/core/services/app' import { defineConfig } from '@adonisjs/lucid' @@ -19,7 +20,7 @@ const dbConfig = defineConfig({ sqlite: { client: 'better-sqlite3', connection: { - filename: app.tmpPath('db.sqlite3'), + filename: app.tmpPath(env.get('DB_DATABASE')), }, useNullAsDefault: true, migrations: { diff --git a/hypermedia/package.json b/hypermedia/package.json index 80f22db..2bd6182 100644 --- a/hypermedia/package.json +++ b/hypermedia/package.json @@ -40,7 +40,6 @@ "@adonisjs/eslint-config": "^3.1.0", "@adonisjs/prettier-config": "^1.5.0", "@adonisjs/tsconfig": "^2.0.0", - "@iconify-json/lucide": "^1.2.136", "@japa/assert": "^4.2.0", "@japa/browser-client": "^2.3.0", "@japa/plugin-adonisjs": "^5.2.0", @@ -66,6 +65,7 @@ "@adonisjs/shield": "^9.0.0", "@adonisjs/static": "^2.0.1", "@adonisjs/vite": "^6.0.2", + "@iconify-json/lucide": "^1.2.136", "@vinejs/vine": "^4.4.0", "better-sqlite3": "^13.0.3", "edge-iconify": "^2.0.2", diff --git a/hypermedia/pnpm-lock.yaml b/hypermedia/pnpm-lock.yaml index 9bee510..2bf75c3 100644 --- a/hypermedia/pnpm-lock.yaml +++ b/hypermedia/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: '@adonisjs/vite': specifier: ^6.0.2 version: 6.0.2(@adonisjs/assembler@8.5.2(typescript@6.0.3))(@adonisjs/core@7.5.2(@adonisjs/assembler@8.5.2(typescript@6.0.3))(@vinejs/vine@4.4.0)(edge.js@6.5.1)(pino-pretty@13.1.3)(youch@4.1.1))(@adonisjs/shield@9.0.0(298c5efd6f1726f321266efb866d649a))(edge.js@6.5.1)(vite@8.3.0(@types/node@26.6.2)) + '@iconify-json/lucide': + specifier: ^1.2.136 + version: 1.2.136 '@vinejs/vine': specifier: ^4.4.0 version: 4.4.0 @@ -60,9 +63,6 @@ importers: '@adonisjs/tsconfig': specifier: ^2.0.0 version: 2.0.0 - '@iconify-json/lucide': - specifier: ^1.2.136 - version: 1.2.136 '@japa/assert': specifier: ^4.2.0 version: 4.2.0(@japa/runner@5.3.0) diff --git a/hypermedia/resources/views/components/checkbox/group.edge b/hypermedia/resources/views/components/checkbox/group.edge index 6233ddb..f896b5a 100644 --- a/hypermedia/resources/views/components/checkbox/group.edge +++ b/hypermedia/resources/views/components/checkbox/group.edge @@ -3,7 +3,7 @@ name: `${fieldKey}[]`, id: $props.get('id') ?? fieldKey, groupCounter: 0, - oldValue: old(fieldKey) || '', + oldValue: old(fieldKey), errors: flashMessages.get('inputErrorsBag', {})[fieldKey], hasErrors: fieldKey in flashMessages.get('inputErrorsBag', {}), }) diff --git a/hypermedia/resources/views/components/field/root.edge b/hypermedia/resources/views/components/field/root.edge index 79854bf..d11bd28 100644 --- a/hypermedia/resources/views/components/field/root.edge +++ b/hypermedia/resources/views/components/field/root.edge @@ -21,7 +21,7 @@ @inject({ name: fieldKey, id: $props.get('id') ?? fieldKey, - oldValue: old(fieldKey) || '', + oldValue: old(fieldKey), errors: flashMessages.get('inputErrorsBag', {})[fieldKey], hasErrors: fieldKey in flashMessages.get('inputErrorsBag', {}), }) diff --git a/hypermedia/resources/views/components/input/control.edge b/hypermedia/resources/views/components/input/control.edge index 075bec5..4fbea1e 100644 --- a/hypermedia/resources/views/components/input/control.edge +++ b/hypermedia/resources/views/components/input/control.edge @@ -1,6 +1,6 @@ @let(useOldValue = !['password', 'file', 'checkbox', 'radio'].includes($props.get('type'))) @let(inputValue = useOldValue - ? $context.oldValue || $props.get('value') || '' + ? $context.oldValue === undefined ? $props.get('value') ?? '' : $context.oldValue ?? '' : $props.get('value') || '') @let(classes = ['field__input']) diff --git a/hypermedia/resources/views/components/radio/group.edge b/hypermedia/resources/views/components/radio/group.edge index 37a0126..e41b2fd 100644 --- a/hypermedia/resources/views/components/radio/group.edge +++ b/hypermedia/resources/views/components/radio/group.edge @@ -3,7 +3,7 @@ name: fieldKey, id: $props.get('id') ?? fieldKey, groupCounter: 0, - oldValue: old(fieldKey) || '', + oldValue: old(fieldKey), errors: flashMessages.get('inputErrorsBag', {})[fieldKey], hasErrors: fieldKey in flashMessages.get('inputErrorsBag', {}), }) diff --git a/hypermedia/resources/views/components/textarea/control.edge b/hypermedia/resources/views/components/textarea/control.edge index e92f784..76223fc 100644 --- a/hypermedia/resources/views/components/textarea/control.edge +++ b/hypermedia/resources/views/components/textarea/control.edge @@ -12,4 +12,4 @@ 'aria-describedby': $context.hasErrors ? `${$context.id}-error` : '', }) .toAttrs() -}}>{{{ $context.oldValue || $props.get('value') || '' }}} +}}>{{{ $context.oldValue === undefined ? $props.get('value') ?? '' : $context.oldValue ?? '' }}} diff --git a/hypermedia/start/env.ts b/hypermedia/start/env.ts index b9252b0..8b9cac0 100644 --- a/hypermedia/start/env.ts +++ b/hypermedia/start/env.ts @@ -24,4 +24,7 @@ export default await Env.create(new URL('../', import.meta.url), { // Session SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const), + + // Database + DB_DATABASE: Env.schema.string(), }) diff --git a/hypermedia/tests/bootstrap.ts b/hypermedia/tests/bootstrap.ts index 94881c4..3202da9 100644 --- a/hypermedia/tests/bootstrap.ts +++ b/hypermedia/tests/bootstrap.ts @@ -33,7 +33,7 @@ export const plugins: Config['plugins'] = [ * The teardown functions are executed after all the tests */ export const runnerHooks: Required> = { - setup: [], + setup: [() => testUtils.db().migrate()], teardown: [], } diff --git a/inertia-react/.env.example b/inertia-react/.env.example index 3a49872..4cdfcbc 100644 --- a/inertia-react/.env.example +++ b/inertia-react/.env.example @@ -6,8 +6,11 @@ NODE_ENV=development # App LOG_LEVEL=info -APP_KEY=zKXHe-Ahdb7aPK1ylAJlRgTefktEaACi +APP_KEY= APP_URL=http://${HOST}:${PORT} # Session SESSION_DRIVER=cookie + +# Database (file name inside ./tmp) +DB_DATABASE=db.sqlite3 \ No newline at end of file diff --git a/inertia-react/.env.test b/inertia-react/.env.test index 28d2da0..23ce22f 100644 --- a/inertia-react/.env.test +++ b/inertia-react/.env.test @@ -1 +1,5 @@ SESSION_DRIVER=memory + +# Dedicated test database. The test runner migrates and truncates it, +# so it must never point at the development database. +DB_DATABASE=test.sqlite3 diff --git a/inertia-react/config/database.ts b/inertia-react/config/database.ts index df87cb9..a3863a9 100644 --- a/inertia-react/config/database.ts +++ b/inertia-react/config/database.ts @@ -1,3 +1,4 @@ +import env from '#start/env' import app from '@adonisjs/core/services/app' import { defineConfig } from '@adonisjs/lucid' @@ -18,7 +19,7 @@ const dbConfig = defineConfig({ /** * Database file location. */ - filename: app.tmpPath('db.sqlite3'), + filename: app.tmpPath(env.get('DB_DATABASE')), }, /** diff --git a/inertia-react/inertia/components/nav_link.tsx b/inertia-react/inertia/components/nav_link.tsx index dafd765..e38758d 100644 --- a/inertia-react/inertia/components/nav_link.tsx +++ b/inertia-react/inertia/components/nav_link.tsx @@ -1,16 +1,18 @@ import { urlFor } from '~/client' import { usePage } from '@inertiajs/react' -import { type LucideIcon } from 'lucide-react' -import { type ReactNode } from 'react' import { Link } from '@adonisjs/inertia/react' +import { type ComponentProps, type ReactNode } from 'react' -export type NavRoute = Parameters[0] +type LinkRoute = NonNullable['route']> -export type NavItem = { - label: string - route: NavRoute - icon?: LucideIcon -} +/** + * The props of a route `Link`, so `routeParams` is checked against the + * route, plus `exact`. + */ +type NavLinkProps = Extract< + Parameters>[0], + { route: Route } +> & { exact?: boolean; className?: string; children: ReactNode } /** * A link that marks itself with `aria-current="page"` when the current URL @@ -18,25 +20,28 @@ export type NavItem = { * "Settings" link stays active on "/settings/security". Pass `exact` to * only match the route itself. */ -export default function NavLink({ - route, +export default function NavLink({ exact = false, - className, - children, -}: { - route: NavRoute - exact?: boolean - className?: string - children: ReactNode -}) { + ...props +}: NavLinkProps) { const { url } = usePage() - const href = urlFor(route) + + /** + * Inside this generic function TypeScript can't tie `routeParams` to + * `route`, so the two calls below are cast. Each caller's props are + * still checked against its route. + */ + const href = (urlFor as (route: string, params?: unknown) => string)( + props.route, + props.routeParams + ) const path = url.split('?')[0] const isActive = exact ? path === href : path === href || path.startsWith(`${href}/`) return ( - - {children} - + )} + aria-current={isActive ? 'page' : undefined} + /> ) } diff --git a/inertia-react/inertia/layouts/app.tsx b/inertia-react/inertia/layouts/app.tsx index cd883e9..30eb860 100644 --- a/inertia-react/inertia/layouts/app.tsx +++ b/inertia-react/inertia/layouts/app.tsx @@ -4,13 +4,7 @@ import { House, LogOut } from 'lucide-react' import { Form } from '@adonisjs/inertia/react' import FlashToasts from '~/components/flash_toasts' import ThemeToggle from '~/components/theme_toggle' -import NavLink, { type NavItem } from '~/components/nav_link' - -/** - * Top-level app navigation. Add an entry here for every new area of your - * app, and it shows up in the navigation bar with its active state handled. - */ -const nav: NavItem[] = [{ label: 'Dashboard', route: 'dashboard', icon: House }] +import NavLink from '~/components/nav_link' export default function AppLayout({ children }: { children: ReactNode }) { return ( @@ -31,12 +25,14 @@ export default function AppLayout({ children }: { children: ReactNode }) { diff --git a/inertia-react/inertia/layouts/settings.tsx b/inertia-react/inertia/layouts/settings.tsx index a64e246..1648dd0 100644 --- a/inertia-react/inertia/layouts/settings.tsx +++ b/inertia-react/inertia/layouts/settings.tsx @@ -1,14 +1,5 @@ import Page from '~/components/page' import { type ReactNode } from 'react' -import NavLink, { type NavItem } from '~/components/nav_link' - -/** - * The pages of the settings area, listed in the sidebar. Register a route - * for each page and add it here, for example: - * - * `{ label: 'Profile', route: 'settings.profile', icon: User }` - */ -const items: NavItem[] = [] /** * Renders the settings heading, a sidebar of links and a card holding the @@ -21,12 +12,15 @@ export default function SettingsLayout({ children }: { children: ReactNode }) {
{children}
diff --git a/inertia-react/providers/api_provider.ts b/inertia-react/providers/api_provider.ts index 8e4e00c..873eb95 100644 --- a/inertia-react/providers/api_provider.ts +++ b/inertia-react/providers/api_provider.ts @@ -29,7 +29,12 @@ class ApiSerializer extends BaseSerializer<{ 'Invalid pagination metadata. Expected metadata to contain Lucid pagination keys' ) } - return metaData + + /** + * The type guard of `@adonisjs/http-transformers` does not list + * `pageName`, which Lucid 22.5 added, so the value is cast. + */ + return metaData as SimplePaginatorMetaKeys } } diff --git a/inertia-react/start/env.ts b/inertia-react/start/env.ts index b9252b0..8b9cac0 100644 --- a/inertia-react/start/env.ts +++ b/inertia-react/start/env.ts @@ -24,4 +24,7 @@ export default await Env.create(new URL('../', import.meta.url), { // Session SESSION_DRIVER: Env.schema.enum(['cookie', 'memory', 'database'] as const), + + // Database + DB_DATABASE: Env.schema.string(), }) diff --git a/inertia-react/tests/bootstrap.ts b/inertia-react/tests/bootstrap.ts index c613051..bb7eb40 100644 --- a/inertia-react/tests/bootstrap.ts +++ b/inertia-react/tests/bootstrap.ts @@ -33,7 +33,7 @@ export const plugins: Config['plugins'] = [ * The teardown functions are executed after all the tests */ export const runnerHooks: Required> = { - setup: [], + setup: [() => testUtils.db().migrate()], teardown: [], } diff --git a/inertia-vue/.env.example b/inertia-vue/.env.example index 3a49872..4cdfcbc 100644 --- a/inertia-vue/.env.example +++ b/inertia-vue/.env.example @@ -6,8 +6,11 @@ NODE_ENV=development # App LOG_LEVEL=info -APP_KEY=zKXHe-Ahdb7aPK1ylAJlRgTefktEaACi +APP_KEY= APP_URL=http://${HOST}:${PORT} # Session SESSION_DRIVER=cookie + +# Database (file name inside ./tmp) +DB_DATABASE=db.sqlite3 \ No newline at end of file diff --git a/inertia-vue/.env.test b/inertia-vue/.env.test index 28d2da0..23ce22f 100644 --- a/inertia-vue/.env.test +++ b/inertia-vue/.env.test @@ -1 +1,5 @@ SESSION_DRIVER=memory + +# Dedicated test database. The test runner migrates and truncates it, +# so it must never point at the development database. +DB_DATABASE=test.sqlite3 diff --git a/inertia-vue/config/database.ts b/inertia-vue/config/database.ts index df87cb9..a3863a9 100644 --- a/inertia-vue/config/database.ts +++ b/inertia-vue/config/database.ts @@ -1,3 +1,4 @@ +import env from '#start/env' import app from '@adonisjs/core/services/app' import { defineConfig } from '@adonisjs/lucid' @@ -18,7 +19,7 @@ const dbConfig = defineConfig({ /** * Database file location. */ - filename: app.tmpPath('db.sqlite3'), + filename: app.tmpPath(env.get('DB_DATABASE')), }, /** diff --git a/inertia-vue/inertia/components/nav_link.vue b/inertia-vue/inertia/components/nav_link.vue index 037c6f4..4cf9e53 100644 --- a/inertia-vue/inertia/components/nav_link.vue +++ b/inertia-vue/inertia/components/nav_link.vue @@ -1,31 +1,43 @@ - - - diff --git a/inertia-vue/inertia/layouts/app.vue b/inertia-vue/inertia/layouts/app.vue index 569906d..8193511 100644 --- a/inertia-vue/inertia/layouts/app.vue +++ b/inertia-vue/inertia/layouts/app.vue @@ -4,13 +4,7 @@ import { Form } from '@adonisjs/inertia/vue' import Logo from '~/components/logo.vue' import FlashToasts from '~/components/flash_toasts.vue' import ThemeToggle from '~/components/theme_toggle.vue' -import NavLink, { type NavItem } from '~/components/nav_link.vue' - -/** - * Top-level app navigation. Add an entry here for every new area of your - * app, and it shows up in the navigation bar with its active state handled. - */ -const nav: NavItem[] = [{ label: 'Dashboard', route: 'dashboard', icon: House }] +import NavLink from '~/components/nav_link.vue'