@kimesh/shadcn 0.1.0-nightly.20260119170404 → 0.1.0-nightly.20260120063147

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/dist/index.d.mts CHANGED
@@ -158,5 +158,4 @@ declare function scanComponentDir(normalizedDir: NormalizedComponentDir, root: s
158
158
  */
159
159
  declare function scanAllDirs(dirs: NormalizedComponentDir[], root: string, debug?: boolean, warnMissing?: boolean): ScanResult[];
160
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
161
+ export { type ComponentDirConfig, type ComponentDirInput, type ComponentDirOption, type ExportedComponent, type KimeshShadcnConfig, type NormalizedComponentDir, type ScanResult, _default as default, _default as shadcnModule, scanAllDirs, scanComponentDir };
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import { existsSync, readFileSync, readdirSync } from "node:fs";
2
+ import { join, resolve } from "node:path";
2
3
  import Components from "unplugin-vue-components/vite";
3
4
  import { addTypeTemplate, addVitePlugin, defineKimeshModule } from "@kimesh/kit";
4
5
  import { consola } from "consola";
5
- import { join, resolve } from "node:path";
6
6
  import { parseSync } from "oxc-parser";
7
7
 
8
8
  //#region src/scanner.ts
@@ -327,5 +327,4 @@ var module_default = defineKimeshModule({
327
327
  });
328
328
 
329
329
  //#endregion
330
- export { module_default as default, module_default as shadcnModule, scanAllDirs, scanComponentDir };
331
- //# sourceMappingURL=index.mjs.map
330
+ export { module_default as default, module_default as shadcnModule, scanAllDirs, scanComponentDir };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kimesh/shadcn",
3
- "version": "0.1.0-nightly.20260119170404",
3
+ "version": "0.1.0-nightly.20260120063147",
4
4
  "description": "shadcn-vue component module for Kimesh framework",
5
5
  "type": "module",
6
6
  "main": "./dist/index.mjs",
@@ -27,11 +27,11 @@
27
27
  "oxc-parser": "^0.108.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "@kimesh/kit": "0.1.0-nightly.20260119170404",
30
+ "@kimesh/kit": "0.1.0-nightly.20260120063147",
31
31
  "unplugin-vue-components": "^28.0.0 || ^29.0.0"
32
32
  },
33
33
  "devDependencies": {
34
- "@kimesh/kit": "0.1.0-nightly.20260119170404",
34
+ "@kimesh/kit": "0.1.0-nightly.20260120063147",
35
35
  "tsdown": "^0.20.0-beta.3",
36
36
  "typescript": "^5.9.3",
37
37
  "unplugin-vue-components": "^28.7.0"
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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,MAAuB;AAC3C,QAAO,sBAAsB,KAAK,KAAK;;;;;AAMzC,SAASC,mBAAiB,GAAoB;AAC5C,QAAO,EAAE,SAAS,OAAO,IAAI,EAAE,SAAS,QAAQ;;;;;;AAOlD,SAAS,iBAAiB,WAAmB,MAAsB;AAEjE,KAAI,UAAU,WAAW,KAAK,EAAE;AAE9B,MAAIA,mBAAiB,KAAK,CACxB,QAAO,QAAQ,MAAM,UAAU,MAAM,EAAE,CAAC;AAE1C,SAAO,QAAQ,MAAM,OAAO,UAAU,MAAM,EAAE,CAAC;;AAIjD,KAAI,UAAU,WAAW,KAAK,IAAI,UAAU,WAAW,MAAM,CA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