Skip to content

Commit 4265a9b

Browse files
committed
fix: (registry) update import paths for ShadcnRegistry and RegistryComponent
1 parent fbef9d7 commit 4265a9b

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

apps/website/src/components/registry/build-registry.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ShadcnRegistry } from "@/types/registry";
1+
import type { ShadcnRegistry } from "@code-blocks/registry";
22

33
import chalk from "chalk";
44
import { RegistryData } from "./data";
@@ -83,7 +83,9 @@ const main = () => {
8383
minute: "2-digit",
8484
});
8585

86-
log(chalk.green(`|- ✅ shadcn build completed successfully (${currentDate})`));
86+
log(
87+
chalk.green(`|- ✅ shadcn build completed successfully (${currentDate})`),
88+
);
8789
} catch (error) {
8890
console.log(
8991
chalk.red.bold(

apps/website/src/types/registry.ts

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,9 @@
11
import type { Languages } from "@/utils/shiki/highlight";
2-
import type { ComponentType, LazyExoticComponent } from "react";
3-
4-
// https://ui.shadcn.com/docs/registry/registry-item-json#type
5-
export type RegistryType =
6-
| "registry:ui"
7-
| "registry:hook"
8-
| "registry:block"
9-
| "registry:lib"
10-
| "registry:file"
11-
| "registry:component";
12-
13-
export type RegistryGroup = "shiki" | "sugar-high" | "blocks";
142

15-
export interface ShadcnRegistry {
16-
name: string;
17-
title?: string;
18-
type: RegistryType;
19-
target?: string;
20-
dependencies?: string[];
21-
devDependencies?: string[];
22-
registryDependencies?: string[];
23-
files?: {
24-
path: string;
25-
target?: string;
26-
type: RegistryType;
27-
}[];
28-
}
3+
import type { BaseRegistry } from "@code-blocks/registry";
4+
import type { ComponentType, LazyExoticComponent } from "react";
295

30-
export interface RegistryComponent {
31-
title: string;
6+
export interface RegistryComponent extends BaseRegistry {
327
fileType: Languages;
33-
shadcnRegistry: ShadcnRegistry;
34-
fileSource: string;
35-
group?: RegistryGroup;
368
reactComponent?: LazyExoticComponent<ComponentType>;
37-
exampleFileSource?: string;
389
}

apps/website/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
],
2222
"paths": {
2323
"@/*": ["./src/*"],
24-
"content-collections": ["./.content-collections/generated"]
24+
"content-collections": ["./.content-collections/generated"],
25+
"@code-blocks/registry": ["../../packages/registry/src/index.ts"]
2526
}
2627
},
2728
"include": [

0 commit comments

Comments
 (0)