diff --git a/packages/primitives-nuxt/package.json b/packages/primitives-nuxt/package.json index 4ffd9c18c..354b43d56 100644 --- a/packages/primitives-nuxt/package.json +++ b/packages/primitives-nuxt/package.json @@ -1,7 +1,7 @@ { "name": "@oku-ui/primitives-nuxt", "type": "module", - "version": "0.2.0", + "version": "0.2.2", "description": "Oku Primitives for Nuxt Module", "license": "MIT", "funding": "https://github.com/sponsors/productdevbook", diff --git a/packages/primitives-nuxt/src/module.ts b/packages/primitives-nuxt/src/module.ts index 57b2b8533..15ac73fad 100644 --- a/packages/primitives-nuxt/src/module.ts +++ b/packages/primitives-nuxt/src/module.ts @@ -17,6 +17,7 @@ export default defineNuxtModule({ checkbox: true, }, splash: true, + autoInstall: true, }, async setup(options, nuxt) { const resolver = createResolver(import.meta.url) @@ -24,14 +25,19 @@ export default defineNuxtModule({ let isInstall = false - const data = await getMainPackageJSON(nuxt) - if (data) { - const { isInstall: install } = await installPackage({ - packageJson: data, - rootDir, - installComponents: options.installComponents, - }) - isInstall = install + if (options.autoInstall) { + const data = await getMainPackageJSON(nuxt) + if (data) { + const { isInstall: install } = await installPackage({ + packageJson: data, + rootDir, + installComponents: options.installComponents, + }) + isInstall = install + } + } + else { + isInstall = true } if (isInstall) { @@ -56,7 +62,7 @@ export default defineNuxtModule({ addComponent({ name: component, export: component, - filePath: `@oku-ui/${key}`, + filePath: '@oku-ui/primitives', }) }) }) diff --git a/packages/primitives-nuxt/src/types.ts b/packages/primitives-nuxt/src/types.ts index 94e6f3b69..6a7536920 100644 --- a/packages/primitives-nuxt/src/types.ts +++ b/packages/primitives-nuxt/src/types.ts @@ -46,4 +46,5 @@ export interface ModuleOptions { * @default true */ splash?: boolean + autoInstall?: boolean }