Skip to content

Commit

Permalink
fix(primitives-nuxt): all component install
Browse files Browse the repository at this point in the history
  • Loading branch information
productdevbook committed Sep 13, 2023
1 parent 1e2ae28 commit cdc0c42
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 178 deletions.
2 changes: 1 addition & 1 deletion packages/primitives-nuxt/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@oku-ui/primitives-nuxt",
"type": "module",
"version": "0.1.4",
"version": "0.1.5",
"description": "Oku Primitives for Nuxt Module",
"license": "MIT",
"funding": "https://github.com/sponsors/productdevbook",
Expand Down
9 changes: 5 additions & 4 deletions packages/primitives-nuxt/playground/nuxt.config.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
export default defineNuxtConfig({
modules: ['../src/module'],
// installComponents: {
// 'aspect-ratio': true,
// 'avatar': true,
// },
primitives: {
installComponents: {
'aspect-ratio': true,
'avatar': true,
},
installComponents: true,
},
devtools: { enabled: true },
})
1 change: 0 additions & 1 deletion packages/primitives-nuxt/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"@oku-ui/aspect-ratio": "workspace:^",
"@oku-ui/avatar": "workspace:^",
"@oku-ui/checkbox": "workspace:^",
"@oku-ui/hover-card": "workspace:^",
"@oku-ui/primitives": "workspace:^"
},
"devDependencies": {
Expand Down
9 changes: 8 additions & 1 deletion packages/primitives-nuxt/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,14 @@ export async function installPackage(settings: {
}
// Full package installation
else {
if (!Object.prototype.hasOwnProperty.call(settings.packageJson.dependencies, '@oku-ui/primitives') ?? !Object.prototype.hasOwnProperty.call(settings.packageJson.devDependencies, '@oku-ui/primitives')) {
if (
(settings.packageJson.dependencies
&& !Object.prototype.hasOwnProperty.call(settings.packageJson.dependencies, '@oku-ui/primitives')
)
?? (
settings.packageJson.devDependencies
&& !Object.prototype.hasOwnProperty.call(settings.packageJson.devDependencies, '@oku-ui/primitives')
)) {
consola.info('@oku-ui/primitives is not installed')
execSync('ni @oku-ui/primitives', {
cwd: settings.rootDir,
Expand Down

0 comments on commit cdc0c42

Please sign in to comment.