diff --git a/src/steps/2.addModules/moduleConfigs/auth.ts b/src/configs/auth/index.ts similarity index 97% rename from src/steps/2.addModules/moduleConfigs/auth.ts rename to src/configs/auth/index.ts index 1f4b87e..99b7845 100644 --- a/src/steps/2.addModules/moduleConfigs/auth.ts +++ b/src/configs/auth/index.ts @@ -1,5 +1,5 @@ -import { generateModuleHTMLComponent, generateModuleHTMLSnippet } from "../generateModuleComponents" -import type { ModuleConfig } from "../moduleConfigs" +import { generateModuleHTMLComponent, generateModuleHTMLSnippet } from "../../generators/generateModuleComponents" +import type { PackageConfig } from "../index" const nuxtAuthServerFile = `import CredentialsProvider from 'next-auth/providers/credentials' import GithubProvider from 'next-auth/providers/github' @@ -78,7 +78,7 @@ const { status, data, signIn, signOut } = useAuth() ` -const auth: ModuleConfig = { +const auth: PackageConfig = { humanReadableName: "nuxt-auth", description: "Authentication via OAuth, Credentials and magic email flows. Wraps the popular NextAuth.js with 12k stars. See more: https://sidebase.io/nuxt-auth", dependencies: [ diff --git a/src/configs/index.ts b/src/configs/index.ts new file mode 100644 index 0000000..0fa1814 --- /dev/null +++ b/src/configs/index.ts @@ -0,0 +1,35 @@ +import type { NuxtConfig } from "@nuxt/schema" +import type { Dependency } from "../utils/addPackageDependency" +import prisma from "./prisma" +import auth from "./auth" +import trpc from "./trpc" +import tailwind from "./tailwind" +import naiveui from "./naiveui" + +export declare interface File { + path: string; + content: string; +} + +export declare interface PackageConfig { + humanReadableName: string + description: string + dependencies: Dependency[] + nuxtConfig: NuxtConfig + files: File[] + tasksPostInstall: string[] + indexVue?: { + html: string, + css?: string + js?: string, + } +} + +export type Packages = "prisma" | "auth" | "trpc" | "tailwind" | "naiveui" +export const packageConfigs: Record = { + "prisma": prisma, + "auth": auth, + "trpc": trpc, + "tailwind": tailwind, + "naiveui": naiveui +} diff --git a/src/steps/2.addModules/moduleConfigs/naiveui.ts b/src/configs/naiveui/index.ts similarity index 91% rename from src/steps/2.addModules/moduleConfigs/naiveui.ts rename to src/configs/naiveui/index.ts index 1b174bb..5b4345e 100644 --- a/src/steps/2.addModules/moduleConfigs/naiveui.ts +++ b/src/configs/naiveui/index.ts @@ -1,5 +1,5 @@ -import { generateModuleHTMLComponent, generateModuleHTMLSnippet } from "../generateModuleComponents" -import type { ModuleConfig } from "../moduleConfigs" +import { generateModuleHTMLComponent, generateModuleHTMLSnippet } from "../../generators/generateModuleComponents" +import type { PackageConfig } from "../index" const naiveDemoComponent = `