diff --git a/app.vue b/app/app.vue similarity index 100% rename from app.vue rename to app/app.vue diff --git a/components/app-footer.vue b/app/components/app-footer.vue similarity index 100% rename from components/app-footer.vue rename to app/components/app-footer.vue diff --git a/components/app-header.vue b/app/components/app-header.vue similarity index 100% rename from components/app-header.vue rename to app/components/app-header.vue diff --git a/components/color-scheme-switcher.vue b/app/components/color-scheme-switcher.vue similarity index 100% rename from components/color-scheme-switcher.vue rename to app/components/color-scheme-switcher.vue diff --git a/components/content/prose-a.vue b/app/components/content/prose-a.vue similarity index 100% rename from components/content/prose-a.vue rename to app/components/content/prose-a.vue diff --git a/components/content/prose-img.vue b/app/components/content/prose-img.vue similarity index 100% rename from components/content/prose-img.vue rename to app/components/content/prose-img.vue diff --git a/components/error-boundary.vue b/app/components/error-boundary.vue similarity index 100% rename from components/error-boundary.vue rename to app/components/error-boundary.vue diff --git a/components/imprint.vue b/app/components/imprint.vue similarity index 100% rename from components/imprint.vue rename to app/components/imprint.vue diff --git a/components/locale-switcher.vue b/app/components/locale-switcher.vue similarity index 100% rename from components/locale-switcher.vue rename to app/components/locale-switcher.vue diff --git a/components/main-content.vue b/app/components/main-content.vue similarity index 100% rename from components/main-content.vue rename to app/components/main-content.vue diff --git a/components/skip-link.vue b/app/components/skip-link.vue similarity index 100% rename from components/skip-link.vue rename to app/components/skip-link.vue diff --git a/components/ui/centered.vue b/app/components/ui/centered.vue similarity index 100% rename from components/ui/centered.vue rename to app/components/ui/centered.vue diff --git a/components/ui/page-title.vue b/app/components/ui/page-title.vue similarity index 100% rename from components/ui/page-title.vue rename to app/components/ui/page-title.vue diff --git a/composables/use-locale.ts b/app/composables/use-locale.ts similarity index 100% rename from composables/use-locale.ts rename to app/composables/use-locale.ts diff --git a/composables/use-page-metadata.ts b/app/composables/use-page-metadata.ts similarity index 100% rename from composables/use-page-metadata.ts rename to app/composables/use-page-metadata.ts diff --git a/composables/use-translations.ts b/app/composables/use-translations.ts similarity index 100% rename from composables/use-translations.ts rename to app/composables/use-translations.ts diff --git a/config/i18n.config.ts b/app/config/i18n.config.ts similarity index 100% rename from config/i18n.config.ts rename to app/config/i18n.config.ts diff --git a/config/imprint.config.ts b/app/config/imprint.config.ts similarity index 100% rename from config/imprint.config.ts rename to app/config/imprint.config.ts diff --git a/error.vue b/app/error.vue similarity index 100% rename from error.vue rename to app/error.vue diff --git a/layouts/default.vue b/app/layouts/default.vue similarity index 100% rename from layouts/default.vue rename to app/layouts/default.vue diff --git a/messages/de.json b/app/messages/de.json similarity index 100% rename from messages/de.json rename to app/messages/de.json diff --git a/messages/en.json b/app/messages/en.json similarity index 100% rename from messages/en.json rename to app/messages/en.json diff --git a/pages/imprint.vue b/app/pages/imprint.vue similarity index 100% rename from pages/imprint.vue rename to app/pages/imprint.vue diff --git a/pages/index.vue b/app/pages/index.vue similarity index 100% rename from pages/index.vue rename to app/pages/index.vue diff --git a/styles/index.css b/app/styles/index.css similarity index 100% rename from styles/index.css rename to app/styles/index.css diff --git a/types/i18n.d.ts b/app/types/i18n.d.ts similarity index 100% rename from types/i18n.d.ts rename to app/types/i18n.d.ts diff --git a/utils/analytics.ts b/app/utils/analytics.ts similarity index 100% rename from utils/analytics.ts rename to app/utils/analytics.ts diff --git a/utils/safe-json-ld-replacer.ts b/app/utils/safe-json-ld-replacer.ts similarity index 100% rename from utils/safe-json-ld-replacer.ts rename to app/utils/safe-json-ld-replacer.ts diff --git a/e2e/lib/fixtures/imprint-page.ts b/e2e/lib/fixtures/imprint-page.ts index 5c76d83..a852a8d 100644 --- a/e2e/lib/fixtures/imprint-page.ts +++ b/e2e/lib/fixtures/imprint-page.ts @@ -1,7 +1,7 @@ import type { Locator, Page } from "@playwright/test"; import { defaultLocale, type Locale } from "@/config/i18n.config"; -import type { I18n } from "@/e2e/lib/fixtures/i18n"; +import type { I18n } from "~/e2e/lib/fixtures/i18n"; export class ImprintPage { readonly page: Page; diff --git a/e2e/lib/fixtures/index-page.ts b/e2e/lib/fixtures/index-page.ts index 73c78b9..72e6cd3 100644 --- a/e2e/lib/fixtures/index-page.ts +++ b/e2e/lib/fixtures/index-page.ts @@ -1,7 +1,7 @@ import type { Locator, Page } from "@playwright/test"; import { defaultLocale, type Locale } from "@/config/i18n.config"; -import type { I18n } from "@/e2e/lib/fixtures/i18n"; +import type { I18n } from "~/e2e/lib/fixtures/i18n"; export class IndexPage { readonly page: Page; diff --git a/e2e/lib/test.ts b/e2e/lib/test.ts index 6269f13..ac258da 100644 --- a/e2e/lib/test.ts +++ b/e2e/lib/test.ts @@ -1,10 +1,10 @@ import { test as base } from "@playwright/test"; import { defaultLocale, type Locale } from "@/config/i18n.config"; -import { type AccessibilityScanner, createAccessibilityScanner } from "@/e2e/lib/fixtures/a11y"; -import { createI18n, type I18n, type WithI18n } from "@/e2e/lib/fixtures/i18n"; -import { ImprintPage } from "@/e2e/lib/fixtures/imprint-page"; -import { IndexPage } from "@/e2e/lib/fixtures/index-page"; +import { type AccessibilityScanner, createAccessibilityScanner } from "~/e2e/lib/fixtures/a11y"; +import { createI18n, type I18n, type WithI18n } from "~/e2e/lib/fixtures/i18n"; +import { ImprintPage } from "~/e2e/lib/fixtures/imprint-page"; +import { IndexPage } from "~/e2e/lib/fixtures/index-page"; interface Fixtures { createAccessibilityScanner: () => Promise; diff --git a/e2e/tests/app/analytics.test.ts b/e2e/tests/app/analytics.test.ts index 4596f5b..6d7e082 100644 --- a/e2e/tests/app/analytics.test.ts +++ b/e2e/tests/app/analytics.test.ts @@ -1,6 +1,6 @@ import { createUrl } from "@acdh-oeaw/lib"; -import { expect, test } from "@/e2e/lib/test"; +import { expect, test } from "~/e2e/lib/test"; if (process.env.NUXT_PUBLIC_MATOMO_BASE_URL && process.env.NUXT_PUBLIC_MATOMO_ID) { const baseUrl = String( diff --git a/e2e/tests/app/app.test.ts b/e2e/tests/app/app.test.ts index a7d8420..99908d2 100644 --- a/e2e/tests/app/app.test.ts +++ b/e2e/tests/app/app.test.ts @@ -1,7 +1,7 @@ import { createUrl } from "@acdh-oeaw/lib"; import { defaultLocale, locales } from "@/config/i18n.config"; -import { expect, test } from "@/e2e/lib/test"; +import { expect, test } from "~/e2e/lib/test"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const baseUrl = process.env.NUXT_PUBLIC_APP_BASE_URL!; diff --git a/e2e/tests/app/i18n.test.ts b/e2e/tests/app/i18n.test.ts index 39a8eb4..5455a5b 100644 --- a/e2e/tests/app/i18n.test.ts +++ b/e2e/tests/app/i18n.test.ts @@ -1,7 +1,7 @@ import { createUrl } from "@acdh-oeaw/lib"; import { locales } from "@/config/i18n.config"; -import { expect, test } from "@/e2e/lib/test"; +import { expect, test } from "~/e2e/lib/test"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const baseUrl = process.env.NUXT_PUBLIC_APP_BASE_URL!; diff --git a/e2e/tests/app/metadata.test.ts b/e2e/tests/app/metadata.test.ts index d42f570..28c324c 100644 --- a/e2e/tests/app/metadata.test.ts +++ b/e2e/tests/app/metadata.test.ts @@ -1,8 +1,8 @@ import { createUrl } from "@acdh-oeaw/lib"; import { locales } from "@/config/i18n.config"; -import { expect, test } from "@/e2e/lib/test"; import { escape } from "@/utils/safe-json-ld-replacer"; +import { expect, test } from "~/e2e/lib/test"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const baseUrl = process.env.NUXT_PUBLIC_APP_BASE_URL!; diff --git a/e2e/tests/pages/imprint.test.ts b/e2e/tests/pages/imprint.test.ts index c1fd315..17300f7 100644 --- a/e2e/tests/pages/imprint.test.ts +++ b/e2e/tests/pages/imprint.test.ts @@ -1,5 +1,5 @@ import { locales } from "@/config/i18n.config"; -import { expect, test } from "@/e2e/lib/test"; +import { expect, test } from "~/e2e/lib/test"; test.describe("imprint page", () => { test("should have document title", async ({ createImprintPage }) => { diff --git a/e2e/tests/pages/index.test.ts b/e2e/tests/pages/index.test.ts index e5b4c0a..dca8ae4 100644 --- a/e2e/tests/pages/index.test.ts +++ b/e2e/tests/pages/index.test.ts @@ -1,5 +1,5 @@ import { locales } from "@/config/i18n.config"; -import { expect, test } from "@/e2e/lib/test"; +import { expect, test } from "~/e2e/lib/test"; test.describe("index page", () => { test("should have document title", async ({ createIndexPage }) => { diff --git a/e2e/tsconfig.json b/e2e/tsconfig.json index 045e168..cc14792 100644 --- a/e2e/tsconfig.json +++ b/e2e/tsconfig.json @@ -4,7 +4,8 @@ "compilerOptions": { "baseUrl": "..", "paths": { - "@/*": ["./*"] + "@/*": ["./app/*"], + "~/*": ["./*"] } } } diff --git a/nuxt.config.ts b/nuxt.config.ts index e01f54f..e337da1 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,13 +1,14 @@ import { fileURLToPath } from "node:url"; -import { defaultLocale, localesMap } from "./config/i18n.config"; +import { defaultLocale, localesMap } from "./app/config/i18n.config"; // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const baseUrl = process.env.NUXT_PUBLIC_APP_BASE_URL!; export default defineNuxtConfig({ alias: { - "@": fileURLToPath(new URL("./", import.meta.url)), + "@": fileURLToPath(new URL("./app/", import.meta.url)), + "~": fileURLToPath(new URL("./", import.meta.url)), }, app: { layoutTransition: false, @@ -94,7 +95,8 @@ export default defineNuxtConfig({ compilerOptions: { baseUrl: ".", paths: { - "@/*": ["./*"], + "@/*": ["./app/*"], + "~/*": ["./*"], }, }, }, diff --git a/server/routes/sitemap.xml.get.ts b/server/routes/sitemap.xml.get.ts index 68be260..e84ab6b 100644 --- a/server/routes/sitemap.xml.get.ts +++ b/server/routes/sitemap.xml.get.ts @@ -9,7 +9,7 @@ import { locales } from "@/config/i18n.config"; const baseUrl = v.parse(v.pipe(v.string(), v.url()), process.env.NUXT_PUBLIC_APP_BASE_URL); // eslint-disable-next-line import/no-named-as-default-member -const paths = fg.globSync("./**/*.vue", { cwd: join(process.cwd(), "pages") }); +const paths = fg.globSync("./**/*.vue", { cwd: join(process.cwd(), "app", "pages") }); const routes: Array = []; diff --git a/tailwind.config.ts b/tailwind.config.ts index 9ca30be..44b94c1 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -4,14 +4,7 @@ import type { Config } from "tailwindcss"; const preset = createPreset(); const config = { - content: [ - "./app.vue", - "./error.vue", - "./components/**/*.@(css|ts|vue)", - "./content/**/*.md", - "./layouts/**/*.@(css|ts|vue)", - "./pages/**/*.@(css|ts|vue)", - ], + content: ["./app/**/*.@(css|ts|vue)", "./content/**/*.md"], presets: [preset], } satisfies Config;