@kimesh/shadcn 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # @kimesh/shadcn
2
+
3
+ Part of the [Kimesh](https://github.com/kimesh/kimesh) framework.
package/augment.d.ts ADDED
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Global module augmentation for @kimesh/shadcn
3
+ * This file is referenced by dist/index.d.mts via triple-slash directive
4
+ */
5
+
6
+ /**
7
+ * Configuration options for @kimesh/shadcn module
8
+ */
9
+ export interface KimeshShadcnConfig {
10
+ prefix?: string;
11
+ componentDir?: string | { path: string; prefix?: string } | (string | { path: string; prefix?: string })[];
12
+ scanLayers?: "app" | "all" | string[];
13
+ debug?: boolean;
14
+ }
15
+
16
+ declare module "@kimesh/kit" {
17
+ interface KimeshModuleOptions {
18
+ shadcn?: KimeshShadcnConfig;
19
+ }
20
+ }
21
+
22
+ // Re-export to make this a module (required for augmentation)
23
+ export {};
@@ -0,0 +1,162 @@
1
+ import * as _kimesh_kit0 from "@kimesh/kit";
2
+
3
+ //#region src/types.d.ts
4
+ /**
5
+ * @kimesh/shadcn - Type Definitions
6
+ *
7
+ * Configuration types for the shadcn-vue component module
8
+ */
9
+ /**
10
+ * Component directory configuration with optional prefix override
11
+ */
12
+ interface ComponentDirConfig {
13
+ /** Path to the component directory */
14
+ path: string;
15
+ /** Optional prefix override for this directory */
16
+ prefix?: string;
17
+ }
18
+ /**
19
+ * Component directory input - can be a string path or config object
20
+ */
21
+ type ComponentDirInput = string | ComponentDirConfig;
22
+ /**
23
+ * Component directory option - single or array of inputs
24
+ */
25
+ type ComponentDirOption = ComponentDirInput | ComponentDirInput[];
26
+ /**
27
+ * Normalized component directory with resolved prefix
28
+ */
29
+ interface NormalizedComponentDir {
30
+ /** Resolved path to the component directory */
31
+ path: string;
32
+ /** Resolved prefix to apply to components */
33
+ prefix: string;
34
+ }
35
+ /**
36
+ * Exported component information from barrel file
37
+ */
38
+ interface ExportedComponent {
39
+ /** Component export name (e.g., 'Button', 'Card') */
40
+ name: string;
41
+ /** Full prefixed name (e.g., 'UiButton', 'UiCard') */
42
+ prefixedName: string;
43
+ /** Resolved file path */
44
+ filePath: string;
45
+ /** Is default export? */
46
+ isDefault: boolean;
47
+ }
48
+ /**
49
+ * Scan result for a component directory
50
+ */
51
+ interface ScanResult {
52
+ /** Directory path that was scanned */
53
+ dirPath: string;
54
+ /** Prefix applied to components */
55
+ prefix: string;
56
+ /** Components found */
57
+ components: ExportedComponent[];
58
+ /** Scan duration in ms */
59
+ scanTimeMs: number;
60
+ }
61
+ /**
62
+ * Configuration options for @kimesh/shadcn module
63
+ *
64
+ * @example
65
+ * ```ts
66
+ * // kimesh.config.ts
67
+ * import { defineKmConfig } from '@kimesh/kit'
68
+ * import shadcn from '@kimesh/shadcn'
69
+ *
70
+ * export default defineKmConfig({
71
+ * modules: [
72
+ * shadcn,
73
+ * // or with options:
74
+ * [shadcn, { prefix: 'Ui', componentDir: './components/ui' }]
75
+ * ]
76
+ * })
77
+ * ```
78
+ */
79
+ interface KimeshShadcnConfig {
80
+ /**
81
+ * Prefix for all imported components.
82
+ * Set to empty string to disable prefix.
83
+ *
84
+ * @default "Ui"
85
+ */
86
+ prefix?: string;
87
+ /**
88
+ * Directory that the shadcn components live in.
89
+ * Supports Kimesh aliases (e.g., '@/components/ui').
90
+ *
91
+ * Can be:
92
+ * - A single string path
93
+ * - A config object with path and optional prefix
94
+ * - An array of paths/config objects for multiple directories
95
+ *
96
+ * @default "@/components/ui"
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * // Single directory
101
+ * componentDir: '@/components/ui'
102
+ *
103
+ * // Multiple directories with different prefixes
104
+ * componentDir: [
105
+ * { path: '@/components/ui', prefix: 'Ui' },
106
+ * { path: '@/components/app', prefix: 'App' }
107
+ * ]
108
+ * ```
109
+ */
110
+ componentDir?: ComponentDirOption;
111
+ /**
112
+ * Which layers to scan for shadcn components.
113
+ *
114
+ * - 'app': Only scan the host app layer (recommended, faster)
115
+ * - 'all': Scan all layers (use if layers share shadcn components)
116
+ * - string[]: Scan specific layers by name
117
+ *
118
+ * @default "app"
119
+ */
120
+ scanLayers?: "app" | "all" | string[];
121
+ /**
122
+ * Enable debug logging
123
+ *
124
+ * @default false
125
+ */
126
+ debug?: boolean;
127
+ }
128
+ //#endregion
129
+ //#region src/module.d.ts
130
+ /**
131
+ * @kimesh/shadcn module
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * // kimesh.config.ts
136
+ * import shadcn from '@kimesh/shadcn'
137
+ *
138
+ * export default defineKmConfig({
139
+ * modules: [
140
+ * shadcn,
141
+ * // or with options:
142
+ * [shadcn, { prefix: 'Ui', componentDir: './components/ui' }]
143
+ * ]
144
+ * })
145
+ * ```
146
+ */
147
+ declare const _default: _kimesh_kit0.KimeshModule<KimeshShadcnConfig>;
148
+ //#endregion
149
+ //#region src/scanner.d.ts
150
+ /**
151
+ * Scan a single component directory for shadcn components
152
+ * @param warnMissing - If true, warns when directory doesn't exist. Default: false
153
+ */
154
+ declare function scanComponentDir(normalizedDir: NormalizedComponentDir, root: string, debug?: boolean, warnMissing?: boolean): ScanResult;
155
+ /**
156
+ * Scan all component directories across layers
157
+ * @param warnMissing - If true, warns when directory doesn't exist. Default: false
158
+ */
159
+ declare function scanAllDirs(dirs: NormalizedComponentDir[], root: string, debug?: boolean, warnMissing?: boolean): ScanResult[];
160
+ //#endregion
161
+ export { type ComponentDirConfig, type ComponentDirInput, type ComponentDirOption, type ExportedComponent, type KimeshShadcnConfig, type NormalizedComponentDir, type ScanResult, _default as default, _default as shadcnModule, scanAllDirs, scanComponentDir };
162
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types.ts","../src/module.ts","../src/scanner.ts"],"mappings":";;;;AASA;AAWA;AAKA;AAKA;;AArBA;AAWA;UAXiB,kBAAA;EAAA;EAAA,IAAA;EAAA;EAAA,MAAA;AAAA;AAAA;AAWjB;AAKA;AAhBiB,KAWL,iBAAA,YAA6B,kBAAA;AAAA;AAKzC;AAKA;AAVyC,KAK7B,kBAAA,GAAqB,iBAAA,GAAoB,iBAAA;AAAA;AAKrD;AAWA;AAhBqD,UAKpC,sBAAA;EAAA;EAAA,IAAA;EAAA;EAAA,MAAA;AAAA;AAAA;AAWjB;AAiBA;AA5BiB,UAWA,iBAAA;EAAA;EAAA,IAAA;EAAA;EAAA,YAAA;EAAA;EAAA,QAAA;EAAA;EAAA,SAAA;AAAA;AAAA;AAiBjB;AAgCA;AAjDiB,UAiBA,UAAA;EAAA;EAAA,OAAA;EAAA;EAAA,MAAA;EAAA;EAAA,UAAA,EAQH,iBAAA;EAAA;EAAA,UAAA;AAAA;AAAA;AAwBd;;;;AChEiB;;;;ACqIjB;AAwFA;;;;;;;;AFrLc,UAwBG,kBAAA;EAAA;;;;AChEA;;EDgEA,MAAA;EAAA;;;;AChEA;;;;ACqIjB;AAwFA;;;;;;;;;;;;;;EF7JiB,YAAA,GAgCA,kBAAA;EAAA;;;;AChGA;;;;ACqIjB;EFrCiB,UAAA;EAAA;;;;AChGA;EDgGA,KAAA;AAAA;;;;AChGA;;;;ACqIjB;AAwFA;;;;;;;;;;;cD7NiB,QAAA,EAAA,YAAA,CAAA,YAAA,CAAA,kBAAA;;;;ACqIjB;AAwFA;;iBAxFgB,gBAAA,CAAA,aAAA,EACC,sBAAA,EAAA,IAAA,UAAA,KAAA,YAAA,WAAA,aAId,UAAA;AAAA;AAmFH;;;AAnFG,iBAmFa,WAAA,CAAA,IAAA,EACR,sBAAA,IAAA,IAAA,UAAA,KAAA,YAAA,WAAA,aAIL,UAAA"}
package/dist/index.mjs ADDED
@@ -0,0 +1,331 @@
1
+ import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import Components from "unplugin-vue-components/vite";
3
+ import { addTypeTemplate, addVitePlugin, defineKimeshModule } from "@kimesh/kit";
4
+ import { consola } from "consola";
5
+ import { join, resolve } from "node:path";
6
+ import { parseSync } from "oxc-parser";
7
+
8
+ //#region src/scanner.ts
9
+ /**
10
+ * @kimesh/shadcn - OXC Barrel File Scanner
11
+ *
12
+ * Parses index.ts barrel files using OXC to extract named exports.
13
+ * This follows the shadcn-vue pattern where each component folder
14
+ * has an index.ts that re-exports Vue components.
15
+ */
16
+ const logger$1 = consola.withTag("kimesh:shadcn:scanner");
17
+ /**
18
+ * File extensions to try when resolving barrel files
19
+ */
20
+ const BARREL_EXTENSIONS = [
21
+ ".ts",
22
+ ".js",
23
+ ".mts",
24
+ ".mjs"
25
+ ];
26
+ /**
27
+ * Check if a name looks like a PascalCase component name
28
+ * Components typically start with uppercase
29
+ */
30
+ function isPascalCase(name) {
31
+ return /^[A-Z][a-zA-Z0-9]*$/.test(name);
32
+ }
33
+ /**
34
+ * Check if a path ends with /src or is a src directory
35
+ */
36
+ function isAlreadySrcPath$1(p) {
37
+ return p.endsWith("/src") || p.endsWith("\\src");
38
+ }
39
+ /**
40
+ * Resolve path with support for @ alias
41
+ * Note: For Kimesh layers, root might already be the src/ directory
42
+ */
43
+ function resolveWithAlias(inputPath, root) {
44
+ if (inputPath.startsWith("@/")) {
45
+ if (isAlreadySrcPath$1(root)) return resolve(root, inputPath.slice(2));
46
+ return resolve(root, "src", inputPath.slice(2));
47
+ }
48
+ if (inputPath.startsWith("./") || inputPath.startsWith("../")) return resolve(root, inputPath);
49
+ if (inputPath.startsWith("/")) return inputPath;
50
+ return resolve(root, inputPath);
51
+ }
52
+ /**
53
+ * Find the barrel file (index.ts/js) in a directory
54
+ */
55
+ function findBarrelFile(dir) {
56
+ for (const ext of BARREL_EXTENSIONS) {
57
+ const filePath = join(dir, `index${ext}`);
58
+ if (existsSync(filePath)) return filePath;
59
+ }
60
+ return null;
61
+ }
62
+ /**
63
+ * Parse barrel file using OXC and extract PascalCase named exports
64
+ */
65
+ function parseBarrelExports(filePath, debug = false) {
66
+ try {
67
+ const exportedNames = parseSync(filePath, readFileSync(filePath, { encoding: "utf8" }), { sourceType: "module" }).program.body.filter((node) => node.type === "ExportNamedDeclaration").flatMap((node) => {
68
+ const names = [];
69
+ if (node.specifiers) for (const specifier of node.specifiers) {
70
+ const exported = specifier.exported;
71
+ const exportedName = exported?.type === "Identifier" ? exported.name : exported?.value;
72
+ if (exportedName && typeof exportedName === "string" && isPascalCase(exportedName)) names.push(exportedName);
73
+ }
74
+ if (node.declaration) {
75
+ const decl = node.declaration;
76
+ if (decl.type === "VariableDeclaration" && decl.declarations) {
77
+ for (const d of decl.declarations) if (d.id?.type === "Identifier" && isPascalCase(d.id.name)) names.push(d.id.name);
78
+ } else if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
79
+ const name = decl.id?.name;
80
+ if (name && isPascalCase(name)) names.push(name);
81
+ }
82
+ }
83
+ return names;
84
+ }).filter(Boolean);
85
+ if (debug) {
86
+ logger$1.debug(`Parsed ${filePath}: found ${exportedNames.length} exports`);
87
+ logger$1.debug(`Exports: ${exportedNames.join(", ")}`);
88
+ }
89
+ return exportedNames;
90
+ } catch (err) {
91
+ if (err instanceof Error) logger$1.warn(`Failed to parse ${filePath}: ${err.message}`);
92
+ return [];
93
+ }
94
+ }
95
+ /**
96
+ * Scan a single component directory for shadcn components
97
+ * @param warnMissing - If true, warns when directory doesn't exist. Default: false
98
+ */
99
+ function scanComponentDir(normalizedDir, root, debug = false, warnMissing = false) {
100
+ const startTime = performance.now();
101
+ const { path: dirPath, prefix } = normalizedDir;
102
+ const resolvedPath = resolveWithAlias(dirPath, root);
103
+ if (debug) logger$1.debug(`Scanning directory: ${resolvedPath} (prefix: ${prefix})`);
104
+ const components = [];
105
+ if (!existsSync(resolvedPath)) {
106
+ if (warnMissing) logger$1.warn(`Component directory does not exist: ${resolvedPath}`);
107
+ else if (debug) logger$1.debug(`Component directory does not exist: ${resolvedPath} (skipping)`);
108
+ return {
109
+ dirPath: resolvedPath,
110
+ prefix,
111
+ components,
112
+ scanTimeMs: performance.now() - startTime
113
+ };
114
+ }
115
+ try {
116
+ const entries = readdirSync(resolvedPath, { withFileTypes: true });
117
+ for (const entry of entries) {
118
+ if (!entry.isDirectory()) continue;
119
+ const componentDir = join(resolvedPath, entry.name);
120
+ const barrelFile = findBarrelFile(componentDir);
121
+ if (!barrelFile) {
122
+ if (debug) logger$1.debug(`No barrel file found in ${componentDir}`);
123
+ continue;
124
+ }
125
+ const exports = parseBarrelExports(barrelFile, debug);
126
+ for (const exportName of exports) components.push({
127
+ name: exportName,
128
+ prefixedName: `${prefix}${exportName}`,
129
+ filePath: barrelFile,
130
+ isDefault: false
131
+ });
132
+ }
133
+ if (debug) logger$1.debug(`Found ${components.length} components in ${resolvedPath}`);
134
+ } catch (err) {
135
+ if (err instanceof Error) logger$1.warn(`Error scanning ${resolvedPath}: ${err.message}`);
136
+ }
137
+ return {
138
+ dirPath: resolvedPath,
139
+ prefix,
140
+ components,
141
+ scanTimeMs: performance.now() - startTime
142
+ };
143
+ }
144
+ /**
145
+ * Scan all component directories across layers
146
+ * @param warnMissing - If true, warns when directory doesn't exist. Default: false
147
+ */
148
+ function scanAllDirs(dirs, root, debug = false, warnMissing = false) {
149
+ return dirs.map((dir) => scanComponentDir(dir, root, debug, warnMissing));
150
+ }
151
+
152
+ //#endregion
153
+ //#region src/module.ts
154
+ /**
155
+ * @kimesh/shadcn - Module Implementation (v2)
156
+ *
157
+ * Kimesh module for shadcn-vue component optimization.
158
+ * Scans component directories, parses barrel files with OXC,
159
+ * and integrates with Kimesh's component system.
160
+ */
161
+ const logger = consola.withTag("kimesh:shadcn");
162
+ /**
163
+ * Type guard for ComponentDirConfig
164
+ */
165
+ function isComponentDirConfig(value) {
166
+ return typeof value === "object" && value !== null && "path" in value;
167
+ }
168
+ /**
169
+ * Normalize component directory configuration
170
+ */
171
+ function normalizeComponentDirs(componentDir, fallbackPrefix) {
172
+ return (Array.isArray(componentDir) ? componentDir : [componentDir]).filter((dir) => Boolean(dir)).map((dir) => {
173
+ if (typeof dir === "string") return {
174
+ path: dir,
175
+ prefix: fallbackPrefix
176
+ };
177
+ if (isComponentDirConfig(dir)) return {
178
+ path: dir.path,
179
+ prefix: dir.prefix ?? fallbackPrefix
180
+ };
181
+ throw new Error("Invalid componentDir entry");
182
+ });
183
+ }
184
+ /**
185
+ * Check if a path ends with /src
186
+ */
187
+ function isAlreadySrcPath(p) {
188
+ return p.endsWith("/src") || p.endsWith("\\src");
189
+ }
190
+ /**
191
+ * Resolve path with @ alias support
192
+ */
193
+ function resolvePath(inputPath, root) {
194
+ if (inputPath.startsWith("@/")) {
195
+ if (isAlreadySrcPath(root)) return `${root}/${inputPath.slice(2)}`;
196
+ return `${root}/src/${inputPath.slice(2)}`;
197
+ }
198
+ if (inputPath.startsWith("./") || inputPath.startsWith("../")) return `${root}/${inputPath}`;
199
+ if (inputPath.startsWith("/")) return inputPath;
200
+ return `${root}/${inputPath}`;
201
+ }
202
+ /**
203
+ * Create a component resolver
204
+ */
205
+ function createShadcnResolver(componentMap, debug = false) {
206
+ return {
207
+ type: "component",
208
+ resolve: (name) => {
209
+ const entry = componentMap.get(name);
210
+ if (entry) {
211
+ if (debug) logger.debug(`Resolved ${name} -> ${entry.name} from ${entry.filePath}`);
212
+ return {
213
+ name: entry.name,
214
+ from: entry.filePath,
215
+ as: name
216
+ };
217
+ }
218
+ }
219
+ };
220
+ }
221
+ /**
222
+ * Generate .d.ts content for component types
223
+ */
224
+ function generateComponentTypes(componentMap) {
225
+ const lines = [
226
+ "/* eslint-disable */",
227
+ "// @ts-nocheck",
228
+ "/* prettier-ignore */",
229
+ "",
230
+ "// Auto-generated by @kimesh/shadcn",
231
+ "// DO NOT EDIT",
232
+ "",
233
+ "export {}",
234
+ "",
235
+ "declare module \"vue\" {",
236
+ " export interface GlobalComponents {"
237
+ ];
238
+ const sortedComponents = [...componentMap.entries()].sort((a, b) => a[0].localeCompare(b[0]));
239
+ for (const [prefixedName, { name, filePath }] of sortedComponents) lines.push(` ${prefixedName}: typeof import('${filePath}')['${name}']`);
240
+ lines.push(" }");
241
+ lines.push("}");
242
+ lines.push("");
243
+ return lines.join("\n");
244
+ }
245
+ /**
246
+ * @kimesh/shadcn module
247
+ *
248
+ * @example
249
+ * ```typescript
250
+ * // kimesh.config.ts
251
+ * import shadcn from '@kimesh/shadcn'
252
+ *
253
+ * export default defineKmConfig({
254
+ * modules: [
255
+ * shadcn,
256
+ * // or with options:
257
+ * [shadcn, { prefix: 'Ui', componentDir: './components/ui' }]
258
+ * ]
259
+ * })
260
+ * ```
261
+ */
262
+ var module_default = defineKimeshModule({
263
+ meta: {
264
+ name: "@kimesh/shadcn",
265
+ version: "2.0.0",
266
+ configKey: "shadcn"
267
+ },
268
+ defaults: {
269
+ prefix: "Ui",
270
+ componentDir: "@/components/ui",
271
+ scanLayers: "app",
272
+ debug: false
273
+ },
274
+ async setup(options, kimesh) {
275
+ const { prefix = "Ui", componentDir = "@/components/ui", scanLayers = "app", debug = false } = options;
276
+ const normalizedDirs = normalizeComponentDirs(componentDir, prefix);
277
+ const componentMap = /* @__PURE__ */ new Map();
278
+ const shouldScanLayer = (layer) => {
279
+ if (scanLayers === "all") return true;
280
+ if (scanLayers === "app") return layer.isApp;
281
+ if (Array.isArray(scanLayers)) return scanLayers.includes(layer.name);
282
+ return false;
283
+ };
284
+ const layersToScan = kimesh.layers.filter(shouldScanLayer);
285
+ if (debug) logger.info(`Scanning ${layersToScan.length} layer(s): ${layersToScan.map((l) => l.name).join(", ")}`);
286
+ for (const layer of layersToScan) {
287
+ const layerRoot = layer.path;
288
+ if (debug) logger.info(`Scanning layer: ${layer.name} at ${layerRoot}`);
289
+ const scanResults = scanAllDirs(normalizedDirs, layerRoot, debug);
290
+ for (const result of scanResults) {
291
+ if (!existsSync(resolvePath(normalizedDirs.find((d) => d.path === result.dirPath)?.path || result.dirPath, layerRoot))) {
292
+ if (debug) logger.debug(`Skipping ${result.dirPath} for layer ${layer.name}`);
293
+ continue;
294
+ }
295
+ for (const component of result.components) {
296
+ if (componentMap.has(component.prefixedName)) {
297
+ if (debug) logger.debug(`Component ${component.prefixedName} already registered`);
298
+ continue;
299
+ }
300
+ componentMap.set(component.prefixedName, {
301
+ name: component.name,
302
+ filePath: component.filePath
303
+ });
304
+ if (debug) logger.debug(`Registered: ${component.prefixedName} -> ${component.name}`);
305
+ }
306
+ if (result.components.length > 0) logger.success(`@kimesh/shadcn: Registered ${result.components.length} components from ${layer.name} (${result.scanTimeMs.toFixed(2)}ms)`);
307
+ }
308
+ }
309
+ logger.info(`@kimesh/shadcn: Total ${componentMap.size} components with prefix "${prefix}"`);
310
+ if (componentMap.size > 0) {
311
+ addVitePlugin(Components({
312
+ resolvers: [createShadcnResolver(componentMap, debug)],
313
+ dirs: [],
314
+ dts: false,
315
+ include: [/\.vue$/, /\.vue\?vue/],
316
+ deep: true,
317
+ collapseSamePrefixes: true,
318
+ version: 3
319
+ }));
320
+ addTypeTemplate({
321
+ filename: "shadcn-components.d.ts",
322
+ getContents: () => generateComponentTypes(componentMap)
323
+ });
324
+ if (debug) logger.info("Components available:", Array.from(componentMap.keys()).join(", "));
325
+ }
326
+ }
327
+ });
328
+
329
+ //#endregion
330
+ export { module_default as default, module_default as shadcnModule, scanAllDirs, scanComponentDir };
331
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":["logger","isAlreadySrcPath"],"sources":["../src/scanner.ts","../src/module.ts"],"sourcesContent":["/**\n * @kimesh/shadcn - OXC Barrel File Scanner\n *\n * Parses index.ts barrel files using OXC to extract named exports.\n * This follows the shadcn-vue pattern where each component folder\n * has an index.ts that re-exports Vue components.\n */\n\nimport { existsSync, readdirSync, readFileSync } from \"node:fs\";\nimport { join, resolve } from \"node:path\";\nimport { parseSync } from \"oxc-parser\";\nimport { consola } from \"consola\";\nimport type {\n ExportedComponent,\n NormalizedComponentDir,\n ScanResult,\n} from \"./types\";\n\nconst logger = consola.withTag(\"kimesh:shadcn:scanner\");\n\n/**\n * File extensions to try when resolving barrel files\n */\nconst BARREL_EXTENSIONS = [\".ts\", \".js\", \".mts\", \".mjs\"];\n\n/**\n * Check if a name looks like a PascalCase component name\n * Components typically start with uppercase\n */\nfunction isPascalCase(name: string): boolean {\n return /^[A-Z][a-zA-Z0-9]*$/.test(name);\n}\n\n/**\n * Check if a path ends with /src or is a src directory\n */\nfunction isAlreadySrcPath(p: string): boolean {\n return p.endsWith(\"/src\") || p.endsWith(\"\\\\src\");\n}\n\n/**\n * Resolve path with support for @ alias\n * Note: For Kimesh layers, root might already be the src/ directory\n */\nfunction resolveWithAlias(inputPath: string, root: string): string {\n // Handle @ alias (common in Vue/Vite projects)\n if (inputPath.startsWith(\"@/\")) {\n // If root already ends with /src, don't add it again\n if (isAlreadySrcPath(root)) {\n return resolve(root, inputPath.slice(2));\n }\n return resolve(root, \"src\", inputPath.slice(2));\n }\n\n // Handle relative paths\n if (inputPath.startsWith(\"./\") || inputPath.startsWith(\"../\")) {\n return resolve(root, inputPath);\n }\n\n // Absolute path\n if (inputPath.startsWith(\"/\")) {\n return inputPath;\n }\n\n // Relative to root\n return resolve(root, inputPath);\n}\n\n/**\n * Find the barrel file (index.ts/js) in a directory\n */\nfunction findBarrelFile(dir: string): string | null {\n for (const ext of BARREL_EXTENSIONS) {\n const filePath = join(dir, `index${ext}`);\n if (existsSync(filePath)) {\n return filePath;\n }\n }\n return null;\n}\n\n/**\n * Parse barrel file using OXC and extract PascalCase named exports\n */\nfunction parseBarrelExports(\n filePath: string,\n debug: boolean = false\n): string[] {\n try {\n const content = readFileSync(filePath, { encoding: \"utf8\" });\n const ast = parseSync(filePath, content, {\n sourceType: \"module\",\n });\n\n // Extract named exports\n const exportedNames: string[] = ast.program.body\n .filter((node: any) => node.type === \"ExportNamedDeclaration\")\n .flatMap((node: any) => {\n const names: string[] = [];\n\n // Handle re-exports: export { Foo, Bar } from './foo'\n if (node.specifiers) {\n for (const specifier of node.specifiers) {\n // exported can be Identifier or StringLiteral\n const exported = specifier.exported;\n const exportedName =\n exported?.type === \"Identifier\" ? exported.name : exported?.value; // StringLiteral has value\n if (\n exportedName &&\n typeof exportedName === \"string\" &&\n isPascalCase(exportedName)\n ) {\n names.push(exportedName);\n }\n }\n }\n\n // Handle direct exports: export const Foo = ...\n if (node.declaration) {\n const decl = node.declaration;\n if (decl.type === \"VariableDeclaration\" && decl.declarations) {\n for (const d of decl.declarations) {\n if (d.id?.type === \"Identifier\" && isPascalCase(d.id.name)) {\n names.push(d.id.name);\n }\n }\n } else if (\n decl.type === \"FunctionDeclaration\" ||\n decl.type === \"ClassDeclaration\"\n ) {\n const name = decl.id?.name;\n if (name && isPascalCase(name)) {\n names.push(name);\n }\n }\n }\n\n return names;\n })\n .filter(Boolean);\n\n if (debug) {\n logger.debug(`Parsed ${filePath}: found ${exportedNames.length} exports`);\n logger.debug(`Exports: ${exportedNames.join(\", \")}`);\n }\n\n return exportedNames;\n } catch (err) {\n if (err instanceof Error) {\n logger.warn(`Failed to parse ${filePath}: ${err.message}`);\n }\n return [];\n }\n}\n\n/**\n * Scan a single component directory for shadcn components\n * @param warnMissing - If true, warns when directory doesn't exist. Default: false\n */\nexport function scanComponentDir(\n normalizedDir: NormalizedComponentDir,\n root: string,\n debug: boolean = false,\n warnMissing: boolean = false\n): ScanResult {\n const startTime = performance.now();\n const { path: dirPath, prefix } = normalizedDir;\n\n // Resolve the component directory path\n const resolvedPath = resolveWithAlias(dirPath, root);\n\n if (debug) {\n logger.debug(`Scanning directory: ${resolvedPath} (prefix: ${prefix})`);\n }\n\n const components: ExportedComponent[] = [];\n\n // Check if directory exists - silently skip if missing (layers may not have shadcn)\n if (!existsSync(resolvedPath)) {\n if (warnMissing) {\n logger.warn(`Component directory does not exist: ${resolvedPath}`);\n } else if (debug) {\n logger.debug(\n `Component directory does not exist: ${resolvedPath} (skipping)`\n );\n }\n return {\n dirPath: resolvedPath,\n prefix,\n components,\n scanTimeMs: performance.now() - startTime,\n };\n }\n\n try {\n // List all subdirectories (each is a component folder)\n const entries = readdirSync(resolvedPath, { withFileTypes: true });\n\n for (const entry of entries) {\n if (!entry.isDirectory()) {\n continue;\n }\n\n const componentDir = join(resolvedPath, entry.name);\n const barrelFile = findBarrelFile(componentDir);\n\n if (!barrelFile) {\n if (debug) {\n logger.debug(`No barrel file found in ${componentDir}`);\n }\n continue;\n }\n\n // Parse the barrel file for exports\n const exports = parseBarrelExports(barrelFile, debug);\n\n for (const exportName of exports) {\n components.push({\n name: exportName,\n prefixedName: `${prefix}${exportName}`,\n filePath: barrelFile,\n isDefault: false,\n });\n }\n }\n\n if (debug) {\n logger.debug(`Found ${components.length} components in ${resolvedPath}`);\n }\n } catch (err) {\n if (err instanceof Error) {\n logger.warn(`Error scanning ${resolvedPath}: ${err.message}`);\n }\n }\n\n return {\n dirPath: resolvedPath,\n prefix,\n components,\n scanTimeMs: performance.now() - startTime,\n };\n}\n\n/**\n * Scan all component directories across layers\n * @param warnMissing - If true, warns when directory doesn't exist. Default: false\n */\nexport function scanAllDirs(\n dirs: NormalizedComponentDir[],\n root: string,\n debug: boolean = false,\n warnMissing: boolean = false\n): ScanResult[] {\n return dirs.map((dir) => scanComponentDir(dir, root, debug, warnMissing));\n}\n","/**\n * @kimesh/shadcn - Module Implementation (v2)\n *\n * Kimesh module for shadcn-vue component optimization.\n * Scans component directories, parses barrel files with OXC,\n * and integrates with Kimesh's component system.\n */\n\nimport { existsSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport type { ComponentResolver } from \"unplugin-vue-components\";\nimport Components from \"unplugin-vue-components/vite\";\nimport {\n defineKimeshModule,\n addVitePlugin,\n addTypeTemplate,\n type Kimesh,\n type VitePlugin,\n} from \"@kimesh/kit\";\nimport { consola } from \"consola\";\nimport type {\n ComponentDirConfig,\n ComponentDirInput,\n ComponentDirOption,\n KimeshShadcnConfig,\n NormalizedComponentDir,\n} from \"./types\";\nimport { scanAllDirs } from \"./scanner\";\n\nconst logger = consola.withTag(\"kimesh:shadcn\");\n\n/**\n * Type guard for ComponentDirConfig\n */\nfunction isComponentDirConfig(value: unknown): value is ComponentDirConfig {\n return typeof value === \"object\" && value !== null && \"path\" in value;\n}\n\n/**\n * Normalize component directory configuration\n */\nfunction normalizeComponentDirs(\n componentDir: ComponentDirOption,\n fallbackPrefix: string\n): NormalizedComponentDir[] {\n const dirs = Array.isArray(componentDir) ? componentDir : [componentDir];\n\n return dirs\n .filter((dir): dir is ComponentDirInput => Boolean(dir))\n .map((dir) => {\n if (typeof dir === \"string\") {\n return { path: dir, prefix: fallbackPrefix };\n }\n if (isComponentDirConfig(dir)) {\n return { path: dir.path, prefix: dir.prefix ?? fallbackPrefix };\n }\n throw new Error(\"Invalid componentDir entry\");\n });\n}\n\n/**\n * Check if a path ends with /src\n */\nfunction isAlreadySrcPath(p: string): boolean {\n return p.endsWith(\"/src\") || p.endsWith(\"\\\\src\");\n}\n\n/**\n * Resolve path with @ alias support\n */\nfunction resolvePath(inputPath: string, root: string): string {\n if (inputPath.startsWith(\"@/\")) {\n if (isAlreadySrcPath(root)) {\n return `${root}/${inputPath.slice(2)}`;\n }\n return `${root}/src/${inputPath.slice(2)}`;\n }\n if (inputPath.startsWith(\"./\") || inputPath.startsWith(\"../\")) {\n return `${root}/${inputPath}`;\n }\n if (inputPath.startsWith(\"/\")) {\n return inputPath;\n }\n return `${root}/${inputPath}`;\n}\n\n/**\n * Create a component resolver\n */\nfunction createShadcnResolver(\n componentMap: Map<string, { name: string; filePath: string }>,\n debug: boolean = false\n): ComponentResolver {\n return {\n type: \"component\",\n resolve: (name: string) => {\n const entry = componentMap.get(name);\n if (entry) {\n if (debug) {\n logger.debug(`Resolved ${name} -> ${entry.name} from ${entry.filePath}`);\n }\n return {\n name: entry.name,\n from: entry.filePath,\n as: name,\n };\n }\n return undefined;\n },\n };\n}\n\n/**\n * Generate .d.ts content for component types\n */\nfunction generateComponentTypes(\n componentMap: Map<string, { name: string; filePath: string }>\n): string {\n const lines: string[] = [\n \"/* eslint-disable */\",\n \"// @ts-nocheck\",\n \"/* prettier-ignore */\",\n \"\",\n \"// Auto-generated by @kimesh/shadcn\",\n \"// DO NOT EDIT\",\n \"\",\n \"export {}\",\n \"\",\n 'declare module \"vue\" {',\n \" export interface GlobalComponents {\",\n ];\n\n const sortedComponents = [...componentMap.entries()].sort((a, b) =>\n a[0].localeCompare(b[0])\n );\n\n for (const [prefixedName, { name, filePath }] of sortedComponents) {\n lines.push(` ${prefixedName}: typeof import('${filePath}')['${name}']`);\n }\n\n lines.push(\" }\");\n lines.push(\"}\");\n lines.push(\"\");\n\n return lines.join(\"\\n\");\n}\n\n/**\n * @kimesh/shadcn module\n *\n * @example\n * ```typescript\n * // kimesh.config.ts\n * import shadcn from '@kimesh/shadcn'\n *\n * export default defineKmConfig({\n * modules: [\n * shadcn,\n * // or with options:\n * [shadcn, { prefix: 'Ui', componentDir: './components/ui' }]\n * ]\n * })\n * ```\n */\nexport default defineKimeshModule<KimeshShadcnConfig>({\n meta: {\n name: \"@kimesh/shadcn\",\n version: \"2.0.0\",\n configKey: \"shadcn\",\n },\n\n defaults: {\n prefix: \"Ui\",\n componentDir: \"@/components/ui\",\n scanLayers: \"app\",\n debug: false,\n },\n\n async setup(options, kimesh) {\n const {\n prefix = \"Ui\",\n componentDir = \"@/components/ui\",\n scanLayers = \"app\",\n debug = false,\n } = options;\n\n const normalizedDirs = normalizeComponentDirs(componentDir, prefix);\n const componentMap = new Map<string, { name: string; filePath: string }>();\n\n // Determine which layers to scan\n const shouldScanLayer = (layer: (typeof kimesh.layers)[0]): boolean => {\n if (scanLayers === \"all\") return true;\n if (scanLayers === \"app\") return layer.isApp;\n if (Array.isArray(scanLayers)) return scanLayers.includes(layer.name);\n return false;\n };\n\n const layersToScan = kimesh.layers.filter(shouldScanLayer);\n\n if (debug) {\n logger.info(\n `Scanning ${layersToScan.length} layer(s): ${layersToScan\n .map((l) => l.name)\n .join(\", \")}`\n );\n }\n\n // Scan layers for shadcn components\n for (const layer of layersToScan) {\n const layerRoot = layer.path;\n\n if (debug) {\n logger.info(`Scanning layer: ${layer.name} at ${layerRoot}`);\n }\n\n const scanResults = scanAllDirs(normalizedDirs, layerRoot, debug);\n\n for (const result of scanResults) {\n const layerComponentDir = resolvePath(\n normalizedDirs.find((d) => d.path === result.dirPath)?.path ||\n result.dirPath,\n layerRoot\n );\n\n if (!existsSync(layerComponentDir)) {\n if (debug) {\n logger.debug(`Skipping ${result.dirPath} for layer ${layer.name}`);\n }\n continue;\n }\n\n for (const component of result.components) {\n if (componentMap.has(component.prefixedName)) {\n if (debug) {\n logger.debug(\n `Component ${component.prefixedName} already registered`\n );\n }\n continue;\n }\n\n componentMap.set(component.prefixedName, {\n name: component.name,\n filePath: component.filePath,\n });\n\n if (debug) {\n logger.debug(\n `Registered: ${component.prefixedName} -> ${component.name}`\n );\n }\n }\n\n if (result.components.length > 0) {\n logger.success(\n `@kimesh/shadcn: Registered ${result.components.length} components from ${layer.name} (${result.scanTimeMs.toFixed(2)}ms)`\n );\n }\n }\n }\n\n logger.info(\n `@kimesh/shadcn: Total ${componentMap.size} components with prefix \"${prefix}\"`\n );\n\n // Add component resolver via unplugin-vue-components\n if (componentMap.size > 0) {\n const resolver = createShadcnResolver(componentMap, debug);\n\n const componentsPlugin = Components({\n resolvers: [resolver],\n dirs: [],\n dts: false,\n include: [/\\.vue$/, /\\.vue\\?vue/],\n deep: true,\n collapseSamePrefixes: true,\n version: 3,\n }) as unknown as VitePlugin;\n\n addVitePlugin(componentsPlugin);\n\n // Generate type declarations using template system\n addTypeTemplate({\n filename: \"shadcn-components.d.ts\",\n getContents: () => generateComponentTypes(componentMap),\n });\n\n if (debug) {\n logger.info(\n \"Components available:\",\n Array.from(componentMap.keys()).join(\", \")\n );\n }\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAMA,WAAS,QAAQ,QAAQ,wBAAwB;;;;AAKvD,MAAM,oBAAoB;CAAC;CAAO;CAAO;CAAQ;CAAO;;;;;AAMxD,SAAS,aAAa,M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Aa,OAAO,GAAG;AAazB,iBAVyB,WAAW;IAClC,WAAW,CAHI,qBAAqB,cAAc,MAAM,CAGnC;IACrB,MAAM,EAAE;IACR,KAAK;IACL,SAAS,CAAC,UAAU,aAAa;IACjC,MAAM;IACN,sBAAsB;IACtB,SAAS;IACV,CAAC,CAE6B;AAG/B,mBAAgB;IACd,UAAU;IACV,mBAAmB,uBAAuB,aAAa;IACxD,CAAC;AAEF,OAAI,MACF,QAAO,KACL,yBACA,MAAM,KAAK,aAAa,MAAM,CAAC,CAAC,KAAK,KAAK,CAC3C;;;CAIR,CAAC"}
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "@kimesh/shadcn",
3
+ "version": "0.0.1",
4
+ "description": "shadcn-vue component module for Kimesh framework",
5
+ "type": "module",
6
+ "main": "./dist/index.mjs",
7
+ "types": "./dist/index.d.mts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.mts",
11
+ "import": "./dist/index.mjs",
12
+ "default": "./dist/index.mjs"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist",
17
+ "augment.d.ts"
18
+ ],
19
+ "scripts": {
20
+ "build": "tsdown",
21
+ "dev": "tsdown --watch",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest"
24
+ },
25
+ "dependencies": {
26
+ "consola": "^3.4.2",
27
+ "oxc-parser": "^0.108.0"
28
+ },
29
+ "peerDependencies": {
30
+ "@kimesh/kit": "0.0.1",
31
+ "unplugin-vue-components": "^28.0.0 || ^29.0.0"
32
+ },
33
+ "devDependencies": {
34
+ "@kimesh/kit": "0.0.1",
35
+ "tsdown": "^0.20.0-beta.3",
36
+ "typescript": "^5.9.3",
37
+ "unplugin-vue-components": "^28.7.0"
38
+ },
39
+ "keywords": [
40
+ "kimesh",
41
+ "shadcn",
42
+ "shadcn-vue",
43
+ "vue",
44
+ "components",
45
+ "auto-import"
46
+ ],
47
+ "author": "",
48
+ "license": "MIT"
49
+ }