Skip to content

Commit b875dfc

Browse files
committed
chore: (registry) initial registry package
1 parent be291fe commit b875dfc

File tree

6 files changed

+116
-0
lines changed

6 files changed

+116
-0
lines changed

packages/registry/eslint.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { defineConfig } from "eslint/config";
2+
3+
// Plugins:
4+
import { baseConfig } from "@code-blocks/eslint/base";
5+
6+
const eslintConfig = defineConfig(baseConfig);
7+
8+
export default eslintConfig;

packages/registry/package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "@code-blocks/registry",
3+
"type": "module",
4+
"version": "0.0.0",
5+
"private": true,
6+
"license": "MIT",
7+
"files": [
8+
"dist"
9+
],
10+
"exports": {
11+
".": "./dist/index.mjs",
12+
"./types": {
13+
"import": "./dist/types/index.mjs",
14+
"types": "./dist/types/index.d.mts"
15+
}
16+
},
17+
"main": "./dist/index.mjs",
18+
"module": "./dist/index.mjs",
19+
"types": "./dist/index.d.mts",
20+
"scripts": {
21+
"build": "eslint ./src && tsdown",
22+
"dev": "tsdown --watch",
23+
"typecheck": "tsc --noEmit",
24+
"prepublishOnly": "pnpm run build",
25+
"check:lint": "eslint ./src",
26+
"fix:lint": "eslint ./src --fix"
27+
},
28+
"devDependencies": {
29+
"@code-blocks/eslint": "workspace:*",
30+
"@types/node": "22.19.13",
31+
"bumpp": "10.4.1",
32+
"eslint": "9.39.3",
33+
"tsdown": "0.20.3",
34+
"typescript": "5.9.3"
35+
}
36+
}

packages/registry/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./types";
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
export type RegistryType =
2+
| "registry:ui"
3+
| "registry:hook"
4+
| "registry:block"
5+
| "registry:lib"
6+
| "registry:file"
7+
| "registry:component";
8+
9+
export type RegistryGroup = "shiki" | "sugar-high" | "blocks";
10+
11+
export interface ShadcnRegistry {
12+
name: string;
13+
title?: string;
14+
type: RegistryType;
15+
target?: string;
16+
dependencies?: string[];
17+
devDependencies?: string[];
18+
registryDependencies?: string[];
19+
files?: {
20+
path: string;
21+
target?: string;
22+
type: RegistryType;
23+
}[];
24+
}
25+
26+
export interface BaseRegistry {
27+
title: string;
28+
fileType: string;
29+
shadcnRegistry: ShadcnRegistry;
30+
fileSource: string;
31+
group?: RegistryGroup;
32+
exampleFileSource?: string;
33+
}

packages/registry/tsconfig.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"compilerOptions": {
3+
"target": "esnext",
4+
"lib": ["es2023"],
5+
"moduleDetection": "force",
6+
"module": "preserve",
7+
"moduleResolution": "bundler",
8+
"resolveJsonModule": true,
9+
"types": ["node"],
10+
"strict": true,
11+
"noUnusedLocals": true,
12+
"declaration": true,
13+
"emitDeclarationOnly": true,
14+
"esModuleInterop": true,
15+
"isolatedModules": true,
16+
"verbatimModuleSyntax": true,
17+
"skipLibCheck": true,
18+
"baseUrl": ".",
19+
"paths": {
20+
"@/*": ["./src/*"]
21+
}
22+
},
23+
"include": ["**/*.ts", "**/*.tsx"]
24+
}

packages/registry/tsdown.config.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { defineConfig, type UserConfig } from "tsdown";
2+
3+
export default defineConfig({
4+
entry: {
5+
index: "src/index.ts",
6+
"types/index": "src/types/index.ts",
7+
},
8+
format: ["esm"],
9+
dts: true,
10+
minify: true,
11+
treeshake: true,
12+
outDir: "dist",
13+
clean: true,
14+
}) as UserConfig;

0 commit comments

Comments
 (0)