@idealyst/tooling 1.2.24 → 1.2.25

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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/fileClassifier.ts","../../src/utils/importParser.ts","../../src/rules/reactNativePrimitives.ts","../../src/rules/reactDomPrimitives.ts"],"sourcesContent":["import { FileType } from '../types';\nimport * as path from 'path';\n\n/**\n * Extension patterns for classification\n * Order matters - more specific patterns should come first\n */\nconst EXTENSION_PATTERNS: Array<{ pattern: RegExp; type: FileType }> = [\n // Platform-specific component files\n { pattern: /\\.web\\.(tsx|jsx)$/, type: 'web' },\n { pattern: /\\.native\\.(tsx|jsx)$/, type: 'native' },\n { pattern: /\\.ios\\.(tsx|jsx)$/, type: 'native' },\n { pattern: /\\.android\\.(tsx|jsx)$/, type: 'native' },\n\n // Style files (can be .ts or .tsx)\n { pattern: /\\.styles?\\.(tsx?|jsx?)$/, type: 'styles' },\n\n // Type definition files\n { pattern: /\\.types?\\.(ts|tsx)$/, type: 'types' },\n { pattern: /types\\.(ts|tsx)$/, type: 'types' },\n { pattern: /\\.d\\.ts$/, type: 'types' },\n\n // Shared component files (generic .tsx/.jsx without platform suffix)\n { pattern: /\\.(tsx|jsx)$/, type: 'shared' },\n];\n\n/**\n * Files that should be classified as 'other' regardless of extension\n */\nconst EXCLUDED_PATTERNS: RegExp[] = [\n /\\.test\\.(tsx?|jsx?)$/,\n /\\.spec\\.(tsx?|jsx?)$/,\n /\\.stories\\.(tsx?|jsx?)$/,\n /\\.config\\.(ts|js)$/,\n /index\\.(ts|tsx|js|jsx)$/,\n];\n\n/**\n * Classifies a file based on its path and extension\n *\n * @param filePath - The file path to classify\n * @returns The file type classification\n *\n * @example\n * classifyFile('Button.tsx') // 'shared'\n * classifyFile('Button.web.tsx') // 'web'\n * classifyFile('Button.native.tsx') // 'native'\n * classifyFile('Button.styles.tsx') // 'styles'\n * classifyFile('types.ts') // 'types'\n */\nexport function classifyFile(filePath: string): FileType {\n const fileName = path.basename(filePath);\n\n // Check if this file should be excluded from component analysis\n for (const pattern of EXCLUDED_PATTERNS) {\n if (pattern.test(fileName)) {\n return 'other';\n }\n }\n\n // Match against extension patterns\n for (const { pattern, type } of EXTENSION_PATTERNS) {\n if (pattern.test(fileName)) {\n return type;\n }\n }\n\n return 'other';\n}\n\n/**\n * Checks if a file is a component file that should be analyzed\n *\n * @param filePath - The file path to check\n * @returns True if the file is a component file (.tsx or .jsx)\n */\nexport function isComponentFile(filePath: string): boolean {\n const fileType = classifyFile(filePath);\n return fileType === 'shared' || fileType === 'web' || fileType === 'native';\n}\n\n/**\n * Checks if a file is a shared (cross-platform) component file\n * These are the files that should NOT contain platform-specific imports\n *\n * @param filePath - The file path to check\n * @returns True if the file is a shared component file\n */\nexport function isSharedFile(filePath: string): boolean {\n return classifyFile(filePath) === 'shared';\n}\n\n/**\n * Checks if a file is platform-specific\n *\n * @param filePath - The file path to check\n * @returns True if the file is web or native specific\n */\nexport function isPlatformSpecificFile(filePath: string): boolean {\n const fileType = classifyFile(filePath);\n return fileType === 'web' || fileType === 'native';\n}\n\n/**\n * Gets the expected platform for a file\n *\n * @param filePath - The file path to check\n * @returns The expected platform, or null for shared/other files\n */\nexport function getExpectedPlatform(filePath: string): 'web' | 'native' | null {\n const fileType = classifyFile(filePath);\n if (fileType === 'web') return 'web';\n if (fileType === 'native') return 'native';\n return null;\n}\n\n/**\n * Extracts the base component name from a file path\n *\n * @param filePath - The file path\n * @returns The base component name without platform suffix or extension\n *\n * @example\n * getBaseName('Button.web.tsx') // 'Button'\n * getBaseName('Button.native.tsx') // 'Button'\n * getBaseName('Button.tsx') // 'Button'\n */\nexport function getBaseName(filePath: string): string {\n const fileName = path.basename(filePath);\n return fileName\n .replace(/\\.(web|native|ios|android)\\.(tsx|jsx|ts|js)$/, '')\n .replace(/\\.styles?\\.(tsx|jsx|ts|js)$/, '')\n .replace(/\\.types?\\.(tsx|ts)$/, '')\n .replace(/\\.(tsx|jsx|ts|js)$/, '');\n}\n","import * as ts from 'typescript';\nimport { ImportInfo, Platform } from '../types';\nimport { REACT_NATIVE_SOURCES, REACT_DOM_SOURCES } from '../rules';\n\n/**\n * Options for import parsing\n */\nexport interface ImportParserOptions {\n /** Additional sources to treat as React Native */\n additionalNativeSources?: string[];\n /** Additional sources to treat as React DOM */\n additionalDomSources?: string[];\n}\n\n/**\n * Determines the platform for a given import source\n */\nexport function getPlatformForSource(\n source: string,\n options?: ImportParserOptions\n): Platform {\n const nativeSources = new Set([\n ...REACT_NATIVE_SOURCES,\n ...(options?.additionalNativeSources ?? []),\n ]);\n\n const domSources = new Set([\n ...REACT_DOM_SOURCES,\n ...(options?.additionalDomSources ?? []),\n ]);\n\n // Check for exact matches first\n if (nativeSources.has(source)) return 'react-native';\n if (domSources.has(source)) return 'react-dom';\n\n // Check for prefix matches (e.g., 'react-native-xxx')\n if (source.startsWith('react-native')) return 'react-native';\n if (source.startsWith('react-dom')) return 'react-dom';\n\n return 'neutral';\n}\n\n/**\n * Parses import statements from TypeScript/JavaScript source code\n *\n * @param sourceCode - The source code to parse\n * @param filePath - Optional file path for better error messages\n * @param options - Parser options\n * @returns Array of import information\n */\nexport function parseImports(\n sourceCode: string,\n filePath: string = 'unknown.tsx',\n options?: ImportParserOptions\n): ImportInfo[] {\n const imports: ImportInfo[] = [];\n\n // Create a source file from the code\n const sourceFile = ts.createSourceFile(\n filePath,\n sourceCode,\n ts.ScriptTarget.Latest,\n true,\n filePath.endsWith('.tsx') || filePath.endsWith('.jsx')\n ? ts.ScriptKind.TSX\n : ts.ScriptKind.TS\n );\n\n // Walk the AST to find import declarations\n const visit = (node: ts.Node): void => {\n if (ts.isImportDeclaration(node)) {\n const importInfo = parseImportDeclaration(node, sourceFile, options);\n imports.push(...importInfo);\n }\n\n // Also check for require() calls\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === 'require' &&\n node.arguments.length === 1 &&\n ts.isStringLiteral(node.arguments[0])\n ) {\n const source = node.arguments[0].text;\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(\n node.getStart()\n );\n\n imports.push({\n name: 'require',\n source,\n platform: getPlatformForSource(source, options),\n line: line + 1,\n column: character + 1,\n isDefault: false,\n isNamespace: true,\n isTypeOnly: false,\n });\n }\n\n ts.forEachChild(node, visit);\n };\n\n visit(sourceFile);\n\n return imports;\n}\n\n/**\n * Parses a single import declaration into ImportInfo objects\n */\nfunction parseImportDeclaration(\n node: ts.ImportDeclaration,\n sourceFile: ts.SourceFile,\n options?: ImportParserOptions\n): ImportInfo[] {\n const imports: ImportInfo[] = [];\n\n // Get the module specifier (the source)\n if (!ts.isStringLiteral(node.moduleSpecifier)) {\n return imports;\n }\n\n const source = node.moduleSpecifier.text;\n const platform = getPlatformForSource(source, options);\n const isTypeOnly = node.importClause?.isTypeOnly ?? false;\n\n const importClause = node.importClause;\n if (!importClause) {\n // Side-effect import: import 'module'\n return imports;\n }\n\n // Default import: import X from 'module'\n if (importClause.name) {\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(\n importClause.name.getStart()\n );\n\n imports.push({\n name: importClause.name.text,\n source,\n platform,\n line: line + 1,\n column: character + 1,\n isDefault: true,\n isNamespace: false,\n isTypeOnly,\n });\n }\n\n // Named and namespace imports\n const namedBindings = importClause.namedBindings;\n if (namedBindings) {\n if (ts.isNamespaceImport(namedBindings)) {\n // Namespace import: import * as X from 'module'\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(\n namedBindings.name.getStart()\n );\n\n imports.push({\n name: namedBindings.name.text,\n source,\n platform,\n line: line + 1,\n column: character + 1,\n isDefault: false,\n isNamespace: true,\n isTypeOnly,\n });\n } else if (ts.isNamedImports(namedBindings)) {\n // Named imports: import { X, Y as Z } from 'module'\n for (const element of namedBindings.elements) {\n const { line, character } = sourceFile.getLineAndCharacterOfPosition(\n element.name.getStart()\n );\n\n const importedName = element.propertyName?.text ?? element.name.text;\n const localName = element.name.text;\n\n imports.push({\n name: localName,\n originalName: element.propertyName ? importedName : undefined,\n source,\n platform,\n line: line + 1,\n column: character + 1,\n isDefault: false,\n isNamespace: false,\n isTypeOnly: isTypeOnly || element.isTypeOnly,\n });\n }\n }\n }\n\n return imports;\n}\n\n/**\n * Filters imports to only those from platform-specific sources\n */\nexport function filterPlatformImports(\n imports: ImportInfo[],\n platform?: Platform\n): ImportInfo[] {\n return imports.filter((imp) => {\n if (imp.platform === 'neutral') return false;\n if (platform && imp.platform !== platform) return false;\n return true;\n });\n}\n\n/**\n * Gets all unique import sources from a list of imports\n */\nexport function getUniqueSources(imports: ImportInfo[]): string[] {\n return [...new Set(imports.map((imp) => imp.source))];\n}\n\n/**\n * Groups imports by their source module\n */\nexport function groupImportsBySource(\n imports: ImportInfo[]\n): Map<string, ImportInfo[]> {\n const grouped = new Map<string, ImportInfo[]>();\n\n for (const imp of imports) {\n const existing = grouped.get(imp.source) ?? [];\n existing.push(imp);\n grouped.set(imp.source, existing);\n }\n\n return grouped;\n}\n","import { PrimitiveRule, PrimitiveRuleSet } from '../types';\n\n/**\n * Module sources that indicate React Native platform\n */\nexport const REACT_NATIVE_SOURCES = [\n 'react-native',\n 'react-native-web',\n 'react-native-gesture-handler',\n 'react-native-reanimated',\n 'react-native-safe-area-context',\n 'react-native-screens',\n 'react-native-svg',\n '@react-native-vector-icons/material-design-icons',\n '@react-native-vector-icons/common',\n '@react-native-community/async-storage',\n '@react-native-picker/picker',\n 'expo',\n 'expo-constants',\n 'expo-linking',\n 'expo-status-bar',\n] as const;\n\n/**\n * Core React Native view primitives\n */\nconst CORE_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'View',\n source: 'react-native',\n platform: 'react-native',\n description: 'Basic container component',\n },\n {\n name: 'Text',\n source: 'react-native',\n platform: 'react-native',\n description: 'Text display component',\n },\n {\n name: 'Image',\n source: 'react-native',\n platform: 'react-native',\n description: 'Image display component',\n },\n {\n name: 'ImageBackground',\n source: 'react-native',\n platform: 'react-native',\n description: 'Background image container',\n },\n {\n name: 'ScrollView',\n source: 'react-native',\n platform: 'react-native',\n description: 'Scrollable container',\n },\n {\n name: 'FlatList',\n source: 'react-native',\n platform: 'react-native',\n description: 'Performant list component',\n },\n {\n name: 'SectionList',\n source: 'react-native',\n platform: 'react-native',\n description: 'Sectioned list component',\n },\n {\n name: 'VirtualizedList',\n source: 'react-native',\n platform: 'react-native',\n description: 'Base virtualized list',\n },\n];\n\n/**\n * Interactive/touchable primitives\n */\nconst INTERACTIVE_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'TouchableOpacity',\n source: 'react-native',\n platform: 'react-native',\n description: 'Touch with opacity feedback',\n },\n {\n name: 'TouchableHighlight',\n source: 'react-native',\n platform: 'react-native',\n description: 'Touch with highlight feedback',\n },\n {\n name: 'TouchableWithoutFeedback',\n source: 'react-native',\n platform: 'react-native',\n description: 'Touch without visual feedback',\n },\n {\n name: 'TouchableNativeFeedback',\n source: 'react-native',\n platform: 'react-native',\n description: 'Android ripple feedback',\n },\n {\n name: 'Pressable',\n source: 'react-native',\n platform: 'react-native',\n description: 'Modern press handler component',\n },\n {\n name: 'Button',\n source: 'react-native',\n platform: 'react-native',\n description: 'Basic button component',\n },\n];\n\n/**\n * Input primitives\n */\nconst INPUT_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'TextInput',\n source: 'react-native',\n platform: 'react-native',\n description: 'Text input field',\n },\n {\n name: 'Switch',\n source: 'react-native',\n platform: 'react-native',\n description: 'Toggle switch component',\n },\n {\n name: 'Slider',\n source: 'react-native',\n platform: 'react-native',\n description: 'Slider input (deprecated)',\n },\n];\n\n/**\n * Modal and overlay primitives\n */\nconst MODAL_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'Modal',\n source: 'react-native',\n platform: 'react-native',\n description: 'Modal overlay component',\n },\n {\n name: 'Alert',\n source: 'react-native',\n platform: 'react-native',\n description: 'Native alert dialog',\n },\n {\n name: 'ActionSheetIOS',\n source: 'react-native',\n platform: 'react-native',\n description: 'iOS action sheet',\n },\n {\n name: 'StatusBar',\n source: 'react-native',\n platform: 'react-native',\n description: 'Status bar controller',\n },\n];\n\n/**\n * Animation primitives\n */\nconst ANIMATION_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'Animated',\n source: 'react-native',\n platform: 'react-native',\n description: 'Animation library namespace',\n },\n {\n name: 'Easing',\n source: 'react-native',\n platform: 'react-native',\n description: 'Easing functions',\n },\n {\n name: 'LayoutAnimation',\n source: 'react-native',\n platform: 'react-native',\n description: 'Layout animation controller',\n },\n];\n\n/**\n * Platform and device primitives\n */\nconst PLATFORM_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'Platform',\n source: 'react-native',\n platform: 'react-native',\n description: 'Platform detection utility',\n },\n {\n name: 'Dimensions',\n source: 'react-native',\n platform: 'react-native',\n description: 'Screen dimensions utility',\n },\n {\n name: 'PixelRatio',\n source: 'react-native',\n platform: 'react-native',\n description: 'Pixel ratio utility',\n },\n {\n name: 'Appearance',\n source: 'react-native',\n platform: 'react-native',\n description: 'Color scheme detection',\n },\n {\n name: 'useColorScheme',\n source: 'react-native',\n platform: 'react-native',\n description: 'Color scheme hook',\n },\n {\n name: 'useWindowDimensions',\n source: 'react-native',\n platform: 'react-native',\n description: 'Window dimensions hook',\n },\n];\n\n/**\n * Event handling primitives\n */\nconst EVENT_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'BackHandler',\n source: 'react-native',\n platform: 'react-native',\n description: 'Android back button handler',\n },\n {\n name: 'Keyboard',\n source: 'react-native',\n platform: 'react-native',\n description: 'Keyboard event handler',\n },\n {\n name: 'PanResponder',\n source: 'react-native',\n platform: 'react-native',\n description: 'Gesture responder system',\n },\n {\n name: 'Linking',\n source: 'react-native',\n platform: 'react-native',\n description: 'Deep linking utility',\n },\n {\n name: 'AppState',\n source: 'react-native',\n platform: 'react-native',\n description: 'App lifecycle state',\n },\n];\n\n/**\n * Safety primitives\n */\nconst SAFETY_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'SafeAreaView',\n source: 'react-native',\n platform: 'react-native',\n description: 'Safe area inset container',\n },\n {\n name: 'KeyboardAvoidingView',\n source: 'react-native',\n platform: 'react-native',\n description: 'Keyboard avoidance container',\n },\n];\n\n/**\n * Accessibility primitives\n */\nconst ACCESSIBILITY_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'AccessibilityInfo',\n source: 'react-native',\n platform: 'react-native',\n description: 'Accessibility information API',\n },\n];\n\n/**\n * Style primitives\n */\nconst STYLE_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'StyleSheet',\n source: 'react-native',\n platform: 'react-native',\n description: 'Style sheet creator',\n },\n];\n\n/**\n * All React Native primitives combined\n */\nexport const REACT_NATIVE_PRIMITIVES: PrimitiveRule[] = [\n ...CORE_PRIMITIVES,\n ...INTERACTIVE_PRIMITIVES,\n ...INPUT_PRIMITIVES,\n ...MODAL_PRIMITIVES,\n ...ANIMATION_PRIMITIVES,\n ...PLATFORM_PRIMITIVES,\n ...EVENT_PRIMITIVES,\n ...SAFETY_PRIMITIVES,\n ...ACCESSIBILITY_PRIMITIVES,\n ...STYLE_PRIMITIVES,\n];\n\n/**\n * Set of primitive names for quick lookup\n */\nexport const REACT_NATIVE_PRIMITIVE_NAMES = new Set(\n REACT_NATIVE_PRIMITIVES.map((p) => p.name)\n);\n\n/**\n * Complete rule set for React Native\n */\nexport const REACT_NATIVE_RULE_SET: PrimitiveRuleSet = {\n platform: 'react-native',\n primitives: REACT_NATIVE_PRIMITIVES,\n sources: [...REACT_NATIVE_SOURCES],\n};\n\n/**\n * Check if a name is a React Native primitive\n */\nexport function isReactNativePrimitive(name: string): boolean {\n return REACT_NATIVE_PRIMITIVE_NAMES.has(name);\n}\n\n/**\n * Get primitive info by name\n */\nexport function getReactNativePrimitive(name: string): PrimitiveRule | undefined {\n return REACT_NATIVE_PRIMITIVES.find((p) => p.name === name);\n}\n","import { PrimitiveRule, PrimitiveRuleSet } from '../types';\n\n/**\n * Module sources that indicate React DOM platform\n */\nexport const REACT_DOM_SOURCES = [\n 'react-dom',\n 'react-dom/client',\n 'react-dom/server',\n] as const;\n\n/**\n * React DOM API primitives\n * These are functions/components that are React DOM specific\n */\nconst DOM_API_PRIMITIVES: PrimitiveRule[] = [\n {\n name: 'createPortal',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Render children into a different DOM node',\n },\n {\n name: 'flushSync',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Force synchronous DOM updates',\n },\n {\n name: 'createRoot',\n source: 'react-dom/client',\n platform: 'react-dom',\n description: 'Create a React root for rendering',\n },\n {\n name: 'hydrateRoot',\n source: 'react-dom/client',\n platform: 'react-dom',\n description: 'Hydrate server-rendered content',\n },\n {\n name: 'render',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Legacy render function (deprecated)',\n },\n {\n name: 'hydrate',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Legacy hydrate function (deprecated)',\n },\n {\n name: 'unmountComponentAtNode',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Legacy unmount function (deprecated)',\n },\n {\n name: 'findDOMNode',\n source: 'react-dom',\n platform: 'react-dom',\n description: 'Find DOM node (deprecated)',\n },\n];\n\n/**\n * Intrinsic HTML elements that indicate web-only code\n * These are JSX intrinsic elements that only exist in DOM\n *\n * Note: These are detected via JSX usage, not imports\n * This list is for reference and specialized detection\n */\nexport const HTML_INTRINSIC_ELEMENTS = [\n // Document structure\n 'html',\n 'head',\n 'body',\n 'main',\n 'header',\n 'footer',\n 'nav',\n 'aside',\n 'article',\n 'section',\n\n // Content sectioning\n 'div',\n 'span',\n 'p',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n\n // Text content\n 'a',\n 'strong',\n 'em',\n 'code',\n 'pre',\n 'blockquote',\n 'br',\n 'hr',\n\n // Lists\n 'ul',\n 'ol',\n 'li',\n 'dl',\n 'dt',\n 'dd',\n\n // Tables\n 'table',\n 'thead',\n 'tbody',\n 'tfoot',\n 'tr',\n 'th',\n 'td',\n 'caption',\n 'colgroup',\n 'col',\n\n // Forms\n 'form',\n 'input',\n 'textarea',\n 'select',\n 'option',\n 'optgroup',\n 'button',\n 'label',\n 'fieldset',\n 'legend',\n 'datalist',\n 'output',\n 'progress',\n 'meter',\n\n // Media\n 'img',\n 'video',\n 'audio',\n 'source',\n 'track',\n 'picture',\n 'figure',\n 'figcaption',\n 'canvas',\n 'svg',\n 'iframe',\n 'embed',\n 'object',\n\n // Interactive\n 'details',\n 'summary',\n 'dialog',\n 'menu',\n\n // Scripting\n 'script',\n 'noscript',\n 'template',\n 'slot',\n] as const;\n\n/**\n * All React DOM primitives (API functions)\n */\nexport const REACT_DOM_PRIMITIVES: PrimitiveRule[] = [...DOM_API_PRIMITIVES];\n\n/**\n * Set of primitive names for quick lookup\n */\nexport const REACT_DOM_PRIMITIVE_NAMES = new Set(\n REACT_DOM_PRIMITIVES.map((p) => p.name)\n);\n\n/**\n * Set of HTML intrinsic element names for quick lookup\n */\nexport const HTML_ELEMENT_NAMES: Set<string> = new Set(HTML_INTRINSIC_ELEMENTS);\n\n/**\n * Complete rule set for React DOM\n */\nexport const REACT_DOM_RULE_SET: PrimitiveRuleSet = {\n platform: 'react-dom',\n primitives: REACT_DOM_PRIMITIVES,\n sources: [...REACT_DOM_SOURCES],\n};\n\n/**\n * Check if a name is a React DOM primitive (API function)\n */\nexport function isReactDomPrimitive(name: string): boolean {\n return REACT_DOM_PRIMITIVE_NAMES.has(name);\n}\n\n/**\n * Check if a name is an HTML intrinsic element\n */\nexport function isHtmlElement(name: string): boolean {\n return HTML_ELEMENT_NAMES.has(name);\n}\n\n/**\n * Get primitive info by name\n */\nexport function getReactDomPrimitive(name: string): PrimitiveRule | undefined {\n return REACT_DOM_PRIMITIVES.find((p) => p.name === name);\n}\n"],"mappings":";AACA,YAAY,UAAU;AAMtB,IAAM,qBAAiE;AAAA;AAAA,EAErE,EAAE,SAAS,qBAAqB,MAAM,MAAM;AAAA,EAC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A,EAClC;AAEA,SAAO;AACT;","names":[]}
@@ -0,0 +1,40 @@
1
+ import { Plugin } from 'vite';
2
+ import { I as IdealystDocsPluginOptions, C as ComponentRegistry } from './types-CrlxbLFJ.js';
3
+
4
+ /**
5
+ * Idealyst Docs Vite Plugin
6
+ *
7
+ * Generates a component registry at build time by analyzing TypeScript source.
8
+ * Replaces placeholder exports from @idealyst/tooling with actual generated values.
9
+ *
10
+ * Usage:
11
+ * ```ts
12
+ * // vite.config.ts
13
+ * import { idealystDocsPlugin } from '@idealyst/tooling';
14
+ *
15
+ * export default defineConfig({
16
+ * plugins: [
17
+ * idealystDocsPlugin({
18
+ * componentPaths: ['../../packages/components/src'],
19
+ * themePath: '../../packages/theme/src/lightTheme.ts',
20
+ * }),
21
+ * ],
22
+ * });
23
+ * ```
24
+ *
25
+ * Then in your app:
26
+ * ```ts
27
+ * import { componentRegistry, componentNames, getComponentsByCategory } from '@idealyst/tooling';
28
+ * ```
29
+ */
30
+
31
+ /**
32
+ * Create the Idealyst Docs Vite plugin.
33
+ */
34
+ declare function idealystDocsPlugin(options: IdealystDocsPluginOptions): Plugin;
35
+ /**
36
+ * Standalone function to generate registry (for MCP server or CLI).
37
+ */
38
+ declare function generateComponentRegistry(options: IdealystDocsPluginOptions): ComponentRegistry;
39
+
40
+ export { generateComponentRegistry, idealystDocsPlugin };