Skip to content

Commit 7dcecad

Browse files
committed
fix(cli): do not install baseStyle when adding registry:theme
from shadcn
1 parent ac32df5 commit 7dcecad

File tree

1 file changed

+8
-3
lines changed
  • packages/cli/src/commands

1 file changed

+8
-3
lines changed

packages/cli/src/commands/add.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable prefer-const */
2+
import type { registryItemTypeSchema } from '@/src/registry/schema'
23
import { Command } from 'commander'
34
import path from 'pathe'
45
import prompts from 'prompts'
@@ -89,11 +90,12 @@ export const add = new Command()
8990
hasNewRegistries = newRegistries.length > 0
9091
}
9192

93+
let itemType: z.infer<typeof registryItemTypeSchema> | undefined
9294
if (components.length > 0) {
9395
const [registryItem] = await getRegistryItems([components[0]], {
9496
config: initialConfig,
9597
})
96-
const itemType = registryItem?.type
98+
itemType = registryItem?.type
9799

98100
if (isUniversalRegistryItem(registryItem)) {
99101
await addComponents(components, initialConfig, options)
@@ -173,7 +175,7 @@ export const add = new Command()
173175
isNewProject: false,
174176
srcDir: options.srcDir,
175177
cssVariables: options.cssVariables,
176-
baseStyle: true,
178+
baseStyle: itemType !== 'registry:theme',
177179
components: options.components,
178180
})
179181
}
@@ -234,7 +236,10 @@ export const add = new Command()
234236
config = updatedConfig
235237

236238
if (!initHasRun) {
237-
await addComponents(options.components, config, options)
239+
await addComponents(options.components, config, {
240+
...options,
241+
baseStyle: itemType !== 'registry:theme',
242+
})
238243
}
239244

240245
// If we're adding a single component and it's from the v0 registry,

0 commit comments

Comments
 (0)