// nuxt.config.ts
import { fileURLToPath } from "node:url";

export default defineNuxtConfig({
  compatibilityDate: "2025-07-15",
  devtools: { enabled: true },
  modules: ["@nuxt/ui", "@pinia/nuxt", "@nuxt/icon"],
  css: ["@/assets/css/main.css"],
  imports: {
    dirs: ["stores", "composables", "apis"],
  },

  icon: {
    serverBundle: {
      collections: ["lucide", "system-uicons", "meteor-icons"],
    },
  },

  ui: {
    icons: {
      collections: ["lucide", "system-uicons", "meteor-icons"],
    },
  },
  components: [
    {
      path: "~/components/auto-import",
      extensions: ["vue"],
      pathPrefix: false,
    },
  ],
  runtimeConfig: {
    public: {
      ...import.meta.env,
      system: import.meta.env.NUXT_PUBLIC_SYSTEM,
    },
  },
  alias: {
    //  مسیرهای اصلی با @
    "@": fileURLToPath(new URL("./app", import.meta.url)), // srcDir
    "@@": fileURLToPath(new URL(".", import.meta.url)), // rootDir

    //  پوشه‌های داخل app/
    "@/components": fileURLToPath(new URL("./app/components", import.meta.url)),
    "@/composables": fileURLToPath(
      new URL("./app/composables", import.meta.url),
    ),
    "@/layouts": fileURLToPath(new URL("./app/layouts", import.meta.url)),
    "@/pages": fileURLToPath(new URL("./app/pages", import.meta.url)),
    "@/types": fileURLToPath(new URL("./app/types", import.meta.url)),
    "@/plugins": fileURLToPath(new URL("./app/plugins", import.meta.url)),
    "@/middleware": fileURLToPath(new URL("./app/middleware", import.meta.url)),
    "@/modules": fileURLToPath(new URL("./app/modules", import.meta.url)),
    "@/json": fileURLToPath(new URL("./app/json", import.meta.url)),
    "@/manuals": fileURLToPath(new URL("./app/manuals", import.meta.url)),
    "@/stores": fileURLToPath(new URL("./app/stores", import.meta.url)),

    //  assets
    "@/assets": fileURLToPath(new URL("./app/assets", import.meta.url)),
    "@/images": fileURLToPath(new URL("./app/assets/images", import.meta.url)),
    "@/styles": fileURLToPath(new URL("./app/assets/styles", import.meta.url)), // یا style
    "@/fonts": fileURLToPath(new URL("./app/assets/fonts", import.meta.url)),

    //  public (در rootDir)
    "@/public": fileURLToPath(new URL("./public", import.meta.url)),

    //  .nuxt (داخل rootDir)
    "@/build": fileURLToPath(new URL("./.nuxt", import.meta.url)),
    "@/internal/nuxt/paths": fileURLToPath(
      new URL("./.nuxt/paths.mjs", import.meta.url),
    ),

    //  shared (اگر وجود داشته باشد — در rootDir)
    "@/shared": fileURLToPath(new URL("./shared", import.meta.url)),
  },
  fonts: {
    providers: false,
  },
});
