Skip to content

Commit be5b1bb

Browse files
committed
feat: remove restricted blocks
1 parent 52de23b commit be5b1bb

1 file changed

Lines changed: 0 additions & 44 deletions

File tree

  • packages/shadcn/src/commands

packages/shadcn/src/commands/add.ts

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -78,50 +78,6 @@ export const add = new Command()
7878
})
7979
}
8080

81-
// Check for restricted component prefixes with base- or radix- styles.
82-
const restrictedComponentPrefixes = [
83-
"sidebar-",
84-
"login-",
85-
"signup-",
86-
"otp-",
87-
"calendar-",
88-
]
89-
const restrictedStylePrefixes = ["base-", "radix-"]
90-
91-
if (components.length > 0) {
92-
if (initialConfig?.style) {
93-
const isRestrictedStyle = restrictedStylePrefixes.some((prefix) =>
94-
initialConfig?.style.startsWith(prefix)
95-
)
96-
97-
if (isRestrictedStyle) {
98-
const restrictedComponents = components.filter(
99-
(component: string) =>
100-
restrictedComponentPrefixes.some((prefix) =>
101-
component.startsWith(prefix)
102-
)
103-
)
104-
105-
if (restrictedComponents.length) {
106-
logger.warn(
107-
`The ${highlighter.info(
108-
restrictedComponents
109-
.map((component: string) => component)
110-
.join(", ")
111-
)} component(s) are not available for the ${highlighter.info(
112-
initialConfig.style
113-
)} style yet. They are coming soon.`
114-
)
115-
logger.warn(
116-
"In the meantime, you can visit the blocks page on https://ui.shadcn.com/blocks and copy the code."
117-
)
118-
logger.break()
119-
process.exit(1)
120-
}
121-
}
122-
}
123-
}
124-
12581
let hasNewRegistries = false
12682
if (components.length > 0) {
12783
const { config: updatedConfig, newRegistries } =

0 commit comments

Comments
 (0)