uilint 0.2.32 → 0.2.34

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.
@@ -121,6 +121,9 @@ function transformImportSpecifier(specifier, utilFile) {
121
121
  }
122
122
  return trimmed;
123
123
  }
124
+ var REEXPORTED_PACKAGES = {
125
+ "oxc-resolver": ["ResolverFactory"]
126
+ };
124
127
  function transformRuleContent(content) {
125
128
  let transformed = content;
126
129
  transformed = transformed.replace(
@@ -144,6 +147,24 @@ function transformRuleContent(content) {
144
147
  return match;
145
148
  }
146
149
  );
150
+ for (const [pkgName, exports] of Object.entries(REEXPORTED_PACKAGES)) {
151
+ const escapedPkgName = pkgName.replace(/-/g, "\\-");
152
+ const regex = new RegExp(
153
+ `import\\s+{([^}]+)}\\s+from\\s+["']${escapedPkgName}["'];?`,
154
+ "g"
155
+ );
156
+ transformed = transformed.replace(regex, (match, imports) => {
157
+ const importNames = imports.split(",").map((s) => s.trim());
158
+ const allReexported = importNames.every((name) => {
159
+ const originalName = name.split(/\s+as\s+/)[0].trim();
160
+ return exports.includes(originalName);
161
+ });
162
+ if (allReexported) {
163
+ return `import { ${imports} } from "uilint-eslint";`;
164
+ }
165
+ return match;
166
+ });
167
+ }
147
168
  return transformed;
148
169
  }
149
170
  function isDirectoryBasedRule(rulesDir, ruleId) {
@@ -478,4 +499,4 @@ export {
478
499
  createPlan,
479
500
  getMissingRules
480
501
  };
481
- //# sourceMappingURL=plan-E7ZMQPPE.js.map
502
+ //# sourceMappingURL=plan-QVR3RBLG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/install/plan.ts","../src/utils/rule-loader.ts"],"sourcesContent":["/**\n * Plan phase - pure function generating InstallPlan from state + choices\n *\n * This function has NO I/O whatsoever. It takes the analyzed ProjectState,\n * user choices, and options, then returns an InstallPlan describing exactly\n * what actions to take.\n */\n\nimport { join } from \"path\";\nimport type { RuleMetadata } from \"uilint-eslint\";\nimport type {\n ProjectState,\n UserChoices,\n InstallPlan,\n InstallAction,\n DependencyInstall,\n PlanOptions,\n} from \"./types.js\";\nimport { GENSTYLEGUIDE_COMMAND_MD } from \"./constants.js\";\nimport { toInstallSpecifier } from \"./versioning.js\";\nimport { loadSkill } from \"../../utils/skill-loader.js\";\nimport { loadSelectedRules } from \"../../utils/rule-loader.js\";\nimport { detectPackageManager } from \"../../utils/package-manager.js\";\n\n/**\n * Create the install plan from project state and user choices\n *\n * @param state - The analyzed project state\n * @param choices - User's installation choices\n * @param options - Planning options (force, etc.)\n * @returns InstallPlan with all actions and dependencies\n */\nexport function createPlan(\n state: ProjectState,\n choices: UserChoices,\n options: PlanOptions = {}\n): InstallPlan {\n const actions: InstallAction[] = [];\n const dependencies: DependencyInstall[] = [];\n\n const { force = false } = options;\n const { items } = choices;\n\n // Ensure .cursor directory exists if needed\n const needsCursorDir =\n items.includes(\"genstyleguide\") || items.includes(\"skill\");\n\n if (needsCursorDir && !state.cursorDir.exists) {\n actions.push({\n type: \"create_directory\",\n path: state.cursorDir.path,\n });\n }\n\n // =========================================================================\n // Genstyleguide Command\n // =========================================================================\n if (items.includes(\"genstyleguide\")) {\n const commandsDir = join(state.cursorDir.path, \"commands\");\n\n actions.push({\n type: \"create_directory\",\n path: commandsDir,\n });\n\n actions.push({\n type: \"create_file\",\n path: join(commandsDir, \"genstyleguide.md\"),\n content: GENSTYLEGUIDE_COMMAND_MD,\n });\n }\n\n // =========================================================================\n // Agent Skill Installation\n // =========================================================================\n if (items.includes(\"skill\")) {\n const skillsDir = join(state.cursorDir.path, \"skills\");\n\n // Create skills directory\n actions.push({\n type: \"create_directory\",\n path: skillsDir,\n });\n\n // Load and install the ui-consistency-enforcer skill\n try {\n const skill = loadSkill(\"ui-consistency-enforcer\");\n const skillDir = join(skillsDir, skill.name);\n\n // Create skill directory\n actions.push({\n type: \"create_directory\",\n path: skillDir,\n });\n\n // Create all skill files\n for (const file of skill.files) {\n const filePath = join(skillDir, file.relativePath);\n\n // Ensure subdirectories exist (e.g., references/)\n const fileDir = join(\n skillDir,\n file.relativePath.split(\"/\").slice(0, -1).join(\"/\")\n );\n if (fileDir !== skillDir && file.relativePath.includes(\"/\")) {\n actions.push({\n type: \"create_directory\",\n path: fileDir,\n });\n }\n\n actions.push({\n type: \"create_file\",\n path: filePath,\n content: file.content,\n });\n }\n } catch {\n // Skill not found - skip silently (shouldn't happen in normal install)\n }\n }\n\n // =========================================================================\n // Next.js Overlay Installation\n // =========================================================================\n if (items.includes(\"next\") && choices.next) {\n const { projectPath, detection, targetFile, createProviders } =\n choices.next;\n\n // Install Next.js routes\n actions.push({\n type: \"install_next_routes\",\n projectPath,\n appRoot: detection.appRoot,\n });\n\n // Install React overlay dependencies using the package manager for this specific target\n dependencies.push({\n packagePath: projectPath,\n packageManager: detectPackageManager(projectPath),\n packages: [\n toInstallSpecifier(\"uilint-react\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n toInstallSpecifier(\"uilint-core\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n \"jsx-loc-plugin\",\n ],\n });\n\n // Inject <uilint-devtools /> web component into React\n // Use targetFile or createProviders if specified by the user\n actions.push({\n type: \"inject_react\",\n projectPath,\n appRoot: detection.appRoot,\n targetFile,\n createProviders,\n });\n\n // Inject jsx-loc-plugin into next.config\n actions.push({\n type: \"inject_next_config\",\n projectPath,\n });\n }\n\n // =========================================================================\n // Vite Overlay Installation\n // =========================================================================\n if (items.includes(\"vite\") && choices.vite) {\n const { projectPath, detection } = choices.vite;\n\n // Install React overlay dependencies using the package manager for this specific target\n dependencies.push({\n packagePath: projectPath,\n packageManager: detectPackageManager(projectPath),\n packages: [\n toInstallSpecifier(\"uilint-react\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n toInstallSpecifier(\"uilint-core\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n \"jsx-loc-plugin\",\n ],\n });\n\n // Inject <uilint-devtools /> web component into React entry\n actions.push({\n type: \"inject_react\",\n projectPath,\n appRoot: detection.entryRoot,\n mode: \"vite\",\n });\n\n // Inject jsx-loc-plugin into vite.config\n actions.push({\n type: \"inject_vite_config\",\n projectPath,\n });\n }\n\n // =========================================================================\n // ESLint Plugin Installation\n // =========================================================================\n if (items.includes(\"eslint\") && choices.eslint) {\n const { packagePaths, selectedRules } = choices.eslint;\n\n for (const pkgPath of packagePaths) {\n const pkgInfo = state.packages.find((p) => p.path === pkgPath);\n\n // Create .uilint/rules directory alongside the target app (not at workspace root)\n const rulesDir = join(pkgPath, \".uilint\", \"rules\");\n actions.push({\n type: \"create_directory\",\n path: rulesDir,\n });\n\n // Load and copy rule files into this target package\n // Use TypeScript rule files if the ESLint config is TypeScript (.ts)\n // This ensures the imports match the actual rule files being copied\n const isTypeScriptConfig =\n pkgInfo?.eslintConfigPath?.endsWith(\".ts\") ?? false;\n const ruleFiles = loadSelectedRules(\n selectedRules.map((r) => r.id),\n {\n typescript: isTypeScriptConfig,\n }\n );\n for (const ruleFile of ruleFiles) {\n // For directory-based rules, create the directory structure first\n if (ruleFile.additionalFiles && ruleFile.additionalFiles.length > 0) {\n // Create rule directory (e.g., .uilint/rules/no-mixed-component-libraries/)\n const ruleDir = join(rulesDir, ruleFile.ruleId);\n actions.push({\n type: \"create_directory\",\n path: ruleDir,\n });\n\n // Create lib/ subdirectory if any files are in lib/\n const hasLibFiles = ruleFile.additionalFiles.some((f) =>\n f.relativePath.includes(\"/lib/\")\n );\n if (hasLibFiles) {\n actions.push({\n type: \"create_directory\",\n path: join(ruleDir, \"lib\"),\n });\n }\n }\n\n // Copy implementation file\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, ruleFile.implementation.relativePath),\n content: ruleFile.implementation.content,\n });\n\n // Copy additional files for directory-based rules\n if (ruleFile.additionalFiles) {\n for (const additionalFile of ruleFile.additionalFiles) {\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, additionalFile.relativePath),\n content: additionalFile.content,\n });\n }\n }\n\n // Copy test file if it exists (only for TypeScript configs)\n if (ruleFile.test && isTypeScriptConfig) {\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, ruleFile.test.relativePath),\n content: ruleFile.test.content,\n });\n }\n }\n\n // Install dependencies using the package manager for this specific target\n const packagesToInstall = [\n toInstallSpecifier(\"uilint-eslint\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: pkgPath,\n }),\n \"typescript-eslint\",\n ];\n\n // If require-test-coverage rule is selected, add coverage package and config\n const hasCoverageRule = selectedRules.some(\n (r) => r.id === \"require-test-coverage\"\n );\n if (hasCoverageRule) {\n packagesToInstall.push(\"@vitest/coverage-v8\");\n\n // Add action to inject coverage config into vitest.config.ts\n actions.push({\n type: \"inject_vitest_coverage\",\n projectPath: pkgPath,\n });\n }\n\n dependencies.push({\n packagePath: pkgPath,\n packageManager: detectPackageManager(pkgPath),\n packages: packagesToInstall,\n });\n\n // Inject ESLint rules (will reference local .uilint/rules/ files)\n if (pkgInfo?.eslintConfigPath) {\n actions.push({\n type: \"inject_eslint\",\n packagePath: pkgPath,\n configPath: pkgInfo.eslintConfigPath,\n rules: selectedRules,\n hasExistingRules: pkgInfo.hasUilintRules,\n });\n }\n\n // Add .uilint to tsconfig.json exclude to prevent build errors\n // The rule files are loaded by ESLint at runtime, not compiled with the app\n actions.push({\n type: \"inject_tsconfig\",\n projectPath: pkgPath,\n });\n }\n\n // Add .uilint/.cache to .gitignore at workspace root\n const gitignorePath = join(state.workspaceRoot, \".gitignore\");\n actions.push({\n type: \"append_to_file\",\n path: gitignorePath,\n content: \"\\n# UILint cache\\n.uilint/.cache\\n\",\n ifNotContains: \".uilint/.cache\",\n });\n }\n\n return { actions, dependencies };\n}\n\n/**\n * Get the list of rules that are missing from a package's ESLint config\n */\nexport function getMissingRules(\n configuredRuleIds: string[],\n selectedRules: RuleMetadata[]\n): RuleMetadata[] {\n const configuredSet = new Set(configuredRuleIds);\n return selectedRules.filter((rule) => !configuredSet.has(rule.id));\n}\n","/**\n * Rule Loader Utility\n *\n * Loads ESLint rule source files from the uilint-eslint package for installation\n * into user projects. Rules are copied to .uilint/rules/ in the target project.\n */\n\nimport { readFileSync, existsSync, readdirSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { createRequire } from \"module\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst require = createRequire(import.meta.url);\n\nfunction findNodeModulesPackageRoot(\n pkgName: string,\n startDir: string\n): string | null {\n let dir = startDir;\n while (true) {\n const candidate = join(dir, \"node_modules\", pkgName);\n if (existsSync(join(candidate, \"package.json\"))) return candidate;\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nfunction getUilintEslintPackageRoot(): string {\n // Prefer a filesystem-based lookup first. This avoids Node resolution edge\n // cases with package.json \"exports\" (especially ESM-only packages), and works\n // well for monorepos + pnpm where node_modules contains symlinks.\n //\n // Search upwards from process.cwd() (the user's project) and from this file\n // location (for test/dev environments).\n const fromCwd = findNodeModulesPackageRoot(\"uilint-eslint\", process.cwd());\n if (fromCwd) return fromCwd;\n\n const fromHere = findNodeModulesPackageRoot(\"uilint-eslint\", __dirname);\n if (fromHere) return fromHere;\n\n // Last resort: try resolver-based lookup.\n try {\n const entry = require.resolve(\"uilint-eslint\"); // typically .../dist/index.js\n const entryDir = dirname(entry); // typically .../dist\n return dirname(entryDir); // package root\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(\n `Unable to locate uilint-eslint in node_modules (searched upwards from cwd and uilint's install path).\\n` +\n `Resolver error: ${msg}\\n` +\n `Fix: ensure uilint-eslint is installed in the target project (or workspace) and try again.`\n );\n }\n}\n\n/**\n * Represents a file for a rule (implementation or test)\n */\nexport interface RuleFile {\n /** Relative path within the rules directory (e.g., \"no-arbitrary-tailwind.ts\") */\n relativePath: string;\n /** File content */\n content: string;\n}\n\n/**\n * Represents a complete rule ready for installation\n */\nexport interface RuleFiles {\n /** Rule identifier (e.g., \"no-arbitrary-tailwind\") */\n ruleId: string;\n /** Implementation file (main entry point - index.ts for directory rules, or single file) */\n implementation: RuleFile;\n /** Additional files for directory-based rules (lib/ utilities, etc.) */\n additionalFiles?: RuleFile[];\n /** Test file (if exists) */\n test?: RuleFile;\n}\n\n/**\n * Get the path to the uilint-eslint package source directory\n */\nfunction getUilintEslintSrcDir(): string {\n // In development: packages/uilint-eslint/src/\n // In production (installed): node_modules/uilint-eslint/src/\n\n // Try workspace/dev path first (repo layout)\n const devPath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"uilint-eslint\",\n \"src\"\n );\n if (existsSync(devPath)) return devPath;\n\n // Try from installed package root (works with \"exports\")\n const pkgRoot = getUilintEslintPackageRoot();\n const srcPath = join(pkgRoot, \"src\");\n if (existsSync(srcPath)) return srcPath;\n\n throw new Error(\n 'Could not find uilint-eslint \"src/\" directory. If you are using a published install of uilint-eslint, ensure it includes source files, or run a JS-only rules install.'\n );\n}\n\n/**\n * Get the path to the uilint-eslint package dist directory\n */\nfunction getUilintEslintDistDir(): string {\n // In development: packages/uilint-eslint/dist/\n // In production (installed): node_modules/uilint-eslint/dist/\n\n // Try workspace/dev path first (repo layout)\n const devPath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"uilint-eslint\",\n \"dist\"\n );\n if (existsSync(devPath)) return devPath;\n\n // Try from installed package root (works with \"exports\")\n const pkgRoot = getUilintEslintPackageRoot();\n const distPath = join(pkgRoot, \"dist\");\n if (existsSync(distPath)) return distPath;\n\n throw new Error(\n 'Could not find uilint-eslint \"dist/\" directory. This is a bug in uilint installation.'\n );\n}\n\n/**\n * All utilities that are exported from uilint-eslint and can be imported.\n * When adding a new utility to uilint-eslint that rules may import,\n * add it here AND export it from uilint-eslint/src/index.ts.\n *\n * Rules can also declare their dependencies via the `internalDependencies`\n * field in defineRuleMeta() - this serves as documentation and can be\n * used for validation.\n */\nconst EXPORTED_UTILITIES = [\n \"create-rule\",\n \"cache\",\n \"styleguide-loader\",\n \"import-graph\",\n \"component-parser\",\n \"export-resolver\",\n \"coverage-aggregator\",\n \"dependency-graph\",\n \"file-categorizer\",\n \"jsx-coverage-analyzer\",\n];\n\n/**\n * Maps internal export names to their uilint-eslint export names.\n * Some exports are renamed when re-exported from the main package\n * to avoid naming conflicts.\n *\n * Format: \"utilFile:internalName\" -> \"externalName\"\n */\nconst EXPORT_RENAMES: Record<string, string> = {\n \"import-graph:clearCache\": \"clearImportGraphCache\",\n};\n\n/**\n * Transform an import specifier, applying any necessary renames.\n * Handles both simple imports (foo) and aliased imports (foo as bar).\n */\nfunction transformImportSpecifier(specifier: string, utilFile: string): string {\n const trimmed = specifier.trim();\n\n // Check for aliased import: \"localName as alias\"\n const aliasMatch = trimmed.match(/^(\\w+)\\s+as\\s+(\\w+)$/);\n if (aliasMatch) {\n const [, localName, alias] = aliasMatch;\n const renameKey = `${utilFile}:${localName}`;\n const externalName = EXPORT_RENAMES[renameKey];\n if (externalName) {\n // If the alias matches the external name, simplify to just the name\n if (alias === externalName) {\n return externalName;\n }\n // Otherwise, use the external name with the original alias\n return `${externalName} as ${alias}`;\n }\n // No rename needed, keep original\n return trimmed;\n }\n\n // Simple import: check if it needs renaming\n const renameKey = `${utilFile}:${trimmed}`;\n const externalName = EXPORT_RENAMES[renameKey];\n if (externalName) {\n return externalName;\n }\n\n return trimmed;\n}\n\n/**\n * Transform rule content to fix imports for copied location\n * Changes imports from \"../utils/...\" or \"../../utils/...\" to \"uilint-eslint\"\n */\nfunction transformRuleContent(content: string): string {\n let transformed = content;\n\n // Replace all relative utility imports with uilint-eslint imports\n // Pattern: import { ... } from \"../utils/create-rule.js\" or \"../../utils/create-rule.js\"\n // This handles any combination of imports like { createRule, defineRuleMeta }\n transformed = transformed.replace(\n /import\\s+{([^}]+)}\\s+from\\s+[\"'](?:\\.\\.\\/)+utils\\/([^\"']+)\\.js[\"'];?/g,\n (match, imports, utilFile) => {\n if (EXPORTED_UTILITIES.includes(utilFile)) {\n // Transform each import specifier\n const specifiers = imports.split(\",\").map((s: string) =>\n transformImportSpecifier(s, utilFile)\n );\n return `import { ${specifiers.join(\", \")} } from \"uilint-eslint\";`;\n }\n return match; // Keep original if not a known utility\n }\n );\n\n // Also handle default imports: import createRule from \"../utils/create-rule.js\"\n transformed = transformed.replace(\n /import\\s+(\\w+)\\s+from\\s+[\"'](?:\\.\\.\\/)+utils\\/([^\"']+)\\.js[\"'];?/g,\n (match, importName, utilFile) => {\n if (EXPORTED_UTILITIES.includes(utilFile)) {\n return `import { ${importName} } from \"uilint-eslint\";`;\n }\n return match;\n }\n );\n\n return transformed;\n}\n\n/**\n * Check if a rule is directory-based (has index.ts/index.js) or single-file\n */\nfunction isDirectoryBasedRule(rulesDir: string, ruleId: string): boolean {\n const ruleDir = join(rulesDir, ruleId);\n return existsSync(ruleDir) && existsSync(join(ruleDir, \"index.ts\"));\n}\n\n/**\n * Load all files from a directory-based rule\n */\nfunction loadDirectoryRule(\n rulesDir: string,\n ruleId: string\n): { files: RuleFile[]; testFile?: RuleFile } {\n const ruleDir = join(rulesDir, ruleId);\n const files: RuleFile[] = [];\n let testFile: RuleFile | undefined;\n\n function collectFiles(dir: string, relativeTo: string): void {\n const entries = readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n const relativePath = join(relativeTo, entry.name);\n\n if (entry.isDirectory()) {\n collectFiles(fullPath, relativePath);\n } else if (entry.name.endsWith(\".ts\")) {\n if (entry.name.endsWith(\".test.ts\")) {\n // Handle test file separately\n testFile = {\n relativePath,\n content: transformRuleContent(readFileSync(fullPath, \"utf-8\")),\n };\n } else {\n files.push({\n relativePath,\n content: transformRuleContent(readFileSync(fullPath, \"utf-8\")),\n });\n }\n }\n }\n }\n\n collectFiles(ruleDir, ruleId);\n return { files, testFile };\n}\n\n/**\n * Load a specific rule by ID\n */\nexport function loadRule(\n ruleId: string,\n options: { typescript: boolean } = { typescript: true }\n): RuleFiles {\n const { typescript } = options;\n const extension = typescript ? \".ts\" : \".js\";\n\n if (typescript) {\n // Load TypeScript source files\n const rulesDir = join(getUilintEslintSrcDir(), \"rules\");\n\n // Check if this is a directory-based rule\n if (isDirectoryBasedRule(rulesDir, ruleId)) {\n const { files, testFile } = loadDirectoryRule(rulesDir, ruleId);\n\n if (files.length === 0) {\n throw new Error(`Rule \"${ruleId}\" directory exists but contains no TypeScript files`);\n }\n\n // Find the index.ts as the main implementation\n const indexFile = files.find((f) => f.relativePath === join(ruleId, \"index.ts\"));\n if (!indexFile) {\n throw new Error(`Rule \"${ruleId}\" directory missing index.ts`);\n }\n\n return {\n ruleId,\n implementation: indexFile,\n additionalFiles: files.filter((f) => f !== indexFile),\n test: testFile,\n };\n }\n\n // Single-file rule\n const implPath = join(rulesDir, `${ruleId}.ts`);\n const testPath = join(rulesDir, `${ruleId}.test.ts`);\n\n if (!existsSync(implPath)) {\n throw new Error(`Rule \"${ruleId}\" not found at ${implPath}`);\n }\n\n const rawContent = readFileSync(implPath, \"utf-8\");\n const transformedContent = transformRuleContent(rawContent);\n\n const implementation: RuleFile = {\n relativePath: `${ruleId}.ts`,\n content: transformedContent,\n };\n\n const test: RuleFile | undefined = existsSync(testPath)\n ? {\n relativePath: `${ruleId}.test.ts`,\n content: transformRuleContent(readFileSync(testPath, \"utf-8\")),\n }\n : undefined;\n\n return {\n ruleId,\n implementation,\n test,\n };\n } else {\n // Load compiled JavaScript files\n const rulesDir = join(getUilintEslintDistDir(), \"rules\");\n const implPath = join(rulesDir, `${ruleId}.js`);\n\n if (!existsSync(implPath)) {\n throw new Error(\n `Rule \"${ruleId}\" not found at ${implPath}. ` +\n `For JavaScript-only projects, uilint-eslint must be built to include compiled rule files in dist/rules/. ` +\n `If you're developing uilint-eslint, run 'pnpm build' in packages/uilint-eslint. ` +\n `If you're using a published package, ensure it includes the dist/ directory.`\n );\n }\n\n // Compiled JS files don't need transformation - they already use uilint-eslint imports\n const content = readFileSync(implPath, \"utf-8\");\n\n const implementation: RuleFile = {\n relativePath: `${ruleId}.js`,\n content,\n };\n\n // Test files are not compiled, so we don't copy them for JS projects\n return {\n ruleId,\n implementation,\n };\n }\n}\n\n/**\n * Load multiple rules by their IDs\n */\nexport function loadSelectedRules(\n ruleIds: string[],\n options: { typescript: boolean } = { typescript: true }\n): RuleFiles[] {\n return ruleIds.map((id) => loadRule(id, options));\n}\n\n/**\n * Get the list of available rule IDs from the registry\n */\nexport function getAvailableRuleIds(): string[] {\n try {\n // Import the rule registry from uilint-eslint\n const { ruleRegistry } = require(\"uilint-eslint\");\n return ruleRegistry.map((rule: { id: string }) => rule.id);\n } catch {\n // Fallback: try to read from filesystem\n const rulesDir = join(getUilintEslintSrcDir(), \"rules\");\n if (!existsSync(rulesDir)) {\n return [];\n }\n\n // This is a fallback - ideally we'd use the registry\n // But if we can't import it, we can at least try to list files\n const files = readdirSync(rulesDir);\n return files\n .filter((f: string) => f.endsWith(\".ts\") && !f.endsWith(\".test.ts\"))\n .map((f: string) => f.replace(\".ts\", \"\"));\n }\n}\n"],"mappings":";;;;;;;;;;;AAQA,SAAS,QAAAA,aAAY;;;ACDrB,SAAS,cAAc,YAAY,mBAAmB;AACtD,SAAS,MAAM,eAAe;AAC9B,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;AAE9B,IAAM,aAAa,cAAc,YAAY,GAAG;AAChD,IAAM,YAAY,QAAQ,UAAU;AACpC,IAAMC,WAAU,cAAc,YAAY,GAAG;AAE7C,SAAS,2BACP,SACA,UACe;AACf,MAAI,MAAM;AACV,SAAO,MAAM;AACX,UAAM,YAAY,KAAK,KAAK,gBAAgB,OAAO;AACnD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AkB;AAC7B,gBAAQ,KAAK;AAAA,UACX,MAAM;AAAA,UACN,aAAa;AAAA,UACb,YAAY,QAAQ;AAAA,UACpB,OAAO;AAAA,UACP,kBAAkB,QAAQ;AAAA,QAC5B,CAAC;AAAA,MACH;AAIA,cAAQ,KAAK;AAAA,QACX,MAAM;AAAA,QACN,aAAa;AAAA,MACf,CAAC;AAAA,IACH;AAGA,UAAM,gBAAgBA,MAAK,MAAM,eAAe,YAAY;AAC5D,YAAQ,KAAK;AAAA,MACX,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,eAAe;AAAA,IACjB,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS,aAAa;AACjC;AAKO,SAAS,gBACd,mBACA,eACgB;AAChB,QAAM,gBAAgB,IAAI,IAAI,iBAAiB;AAC/C,SAAO,cAAc,OAAO,CAAC,SAAS,CAAC,cAAc,IAAI,KAAK,EAAE,CAAC;AACnE;","names":["join","require","renameKey","externalName","join"]}
1
+ {"version":3,"sources":["../src/commands/install/plan.ts","../src/utils/rule-loader.ts"],"sourcesContent":["/**\n * Plan phase - pure function generating InstallPlan from state + choices\n *\n * This function has NO I/O whatsoever. It takes the analyzed ProjectState,\n * user choices, and options, then returns an InstallPlan describing exactly\n * what actions to take.\n */\n\nimport { join } from \"path\";\nimport type { RuleMetadata } from \"uilint-eslint\";\nimport type {\n ProjectState,\n UserChoices,\n InstallPlan,\n InstallAction,\n DependencyInstall,\n PlanOptions,\n} from \"./types.js\";\nimport { GENSTYLEGUIDE_COMMAND_MD } from \"./constants.js\";\nimport { toInstallSpecifier } from \"./versioning.js\";\nimport { loadSkill } from \"../../utils/skill-loader.js\";\nimport { loadSelectedRules } from \"../../utils/rule-loader.js\";\nimport { detectPackageManager } from \"../../utils/package-manager.js\";\n\n/**\n * Create the install plan from project state and user choices\n *\n * @param state - The analyzed project state\n * @param choices - User's installation choices\n * @param options - Planning options (force, etc.)\n * @returns InstallPlan with all actions and dependencies\n */\nexport function createPlan(\n state: ProjectState,\n choices: UserChoices,\n options: PlanOptions = {}\n): InstallPlan {\n const actions: InstallAction[] = [];\n const dependencies: DependencyInstall[] = [];\n\n const { force = false } = options;\n const { items } = choices;\n\n // Ensure .cursor directory exists if needed\n const needsCursorDir =\n items.includes(\"genstyleguide\") || items.includes(\"skill\");\n\n if (needsCursorDir && !state.cursorDir.exists) {\n actions.push({\n type: \"create_directory\",\n path: state.cursorDir.path,\n });\n }\n\n // =========================================================================\n // Genstyleguide Command\n // =========================================================================\n if (items.includes(\"genstyleguide\")) {\n const commandsDir = join(state.cursorDir.path, \"commands\");\n\n actions.push({\n type: \"create_directory\",\n path: commandsDir,\n });\n\n actions.push({\n type: \"create_file\",\n path: join(commandsDir, \"genstyleguide.md\"),\n content: GENSTYLEGUIDE_COMMAND_MD,\n });\n }\n\n // =========================================================================\n // Agent Skill Installation\n // =========================================================================\n if (items.includes(\"skill\")) {\n const skillsDir = join(state.cursorDir.path, \"skills\");\n\n // Create skills directory\n actions.push({\n type: \"create_directory\",\n path: skillsDir,\n });\n\n // Load and install the ui-consistency-enforcer skill\n try {\n const skill = loadSkill(\"ui-consistency-enforcer\");\n const skillDir = join(skillsDir, skill.name);\n\n // Create skill directory\n actions.push({\n type: \"create_directory\",\n path: skillDir,\n });\n\n // Create all skill files\n for (const file of skill.files) {\n const filePath = join(skillDir, file.relativePath);\n\n // Ensure subdirectories exist (e.g., references/)\n const fileDir = join(\n skillDir,\n file.relativePath.split(\"/\").slice(0, -1).join(\"/\")\n );\n if (fileDir !== skillDir && file.relativePath.includes(\"/\")) {\n actions.push({\n type: \"create_directory\",\n path: fileDir,\n });\n }\n\n actions.push({\n type: \"create_file\",\n path: filePath,\n content: file.content,\n });\n }\n } catch {\n // Skill not found - skip silently (shouldn't happen in normal install)\n }\n }\n\n // =========================================================================\n // Next.js Overlay Installation\n // =========================================================================\n if (items.includes(\"next\") && choices.next) {\n const { projectPath, detection, targetFile, createProviders } =\n choices.next;\n\n // Install Next.js routes\n actions.push({\n type: \"install_next_routes\",\n projectPath,\n appRoot: detection.appRoot,\n });\n\n // Install React overlay dependencies using the package manager for this specific target\n dependencies.push({\n packagePath: projectPath,\n packageManager: detectPackageManager(projectPath),\n packages: [\n toInstallSpecifier(\"uilint-react\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n toInstallSpecifier(\"uilint-core\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n \"jsx-loc-plugin\",\n ],\n });\n\n // Inject <uilint-devtools /> web component into React\n // Use targetFile or createProviders if specified by the user\n actions.push({\n type: \"inject_react\",\n projectPath,\n appRoot: detection.appRoot,\n targetFile,\n createProviders,\n });\n\n // Inject jsx-loc-plugin into next.config\n actions.push({\n type: \"inject_next_config\",\n projectPath,\n });\n }\n\n // =========================================================================\n // Vite Overlay Installation\n // =========================================================================\n if (items.includes(\"vite\") && choices.vite) {\n const { projectPath, detection } = choices.vite;\n\n // Install React overlay dependencies using the package manager for this specific target\n dependencies.push({\n packagePath: projectPath,\n packageManager: detectPackageManager(projectPath),\n packages: [\n toInstallSpecifier(\"uilint-react\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n toInstallSpecifier(\"uilint-core\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: projectPath,\n }),\n \"jsx-loc-plugin\",\n ],\n });\n\n // Inject <uilint-devtools /> web component into React entry\n actions.push({\n type: \"inject_react\",\n projectPath,\n appRoot: detection.entryRoot,\n mode: \"vite\",\n });\n\n // Inject jsx-loc-plugin into vite.config\n actions.push({\n type: \"inject_vite_config\",\n projectPath,\n });\n }\n\n // =========================================================================\n // ESLint Plugin Installation\n // =========================================================================\n if (items.includes(\"eslint\") && choices.eslint) {\n const { packagePaths, selectedRules } = choices.eslint;\n\n for (const pkgPath of packagePaths) {\n const pkgInfo = state.packages.find((p) => p.path === pkgPath);\n\n // Create .uilint/rules directory alongside the target app (not at workspace root)\n const rulesDir = join(pkgPath, \".uilint\", \"rules\");\n actions.push({\n type: \"create_directory\",\n path: rulesDir,\n });\n\n // Load and copy rule files into this target package\n // Use TypeScript rule files if the ESLint config is TypeScript (.ts)\n // This ensures the imports match the actual rule files being copied\n const isTypeScriptConfig =\n pkgInfo?.eslintConfigPath?.endsWith(\".ts\") ?? false;\n const ruleFiles = loadSelectedRules(\n selectedRules.map((r) => r.id),\n {\n typescript: isTypeScriptConfig,\n }\n );\n for (const ruleFile of ruleFiles) {\n // For directory-based rules, create the directory structure first\n if (ruleFile.additionalFiles && ruleFile.additionalFiles.length > 0) {\n // Create rule directory (e.g., .uilint/rules/no-mixed-component-libraries/)\n const ruleDir = join(rulesDir, ruleFile.ruleId);\n actions.push({\n type: \"create_directory\",\n path: ruleDir,\n });\n\n // Create lib/ subdirectory if any files are in lib/\n const hasLibFiles = ruleFile.additionalFiles.some((f) =>\n f.relativePath.includes(\"/lib/\")\n );\n if (hasLibFiles) {\n actions.push({\n type: \"create_directory\",\n path: join(ruleDir, \"lib\"),\n });\n }\n }\n\n // Copy implementation file\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, ruleFile.implementation.relativePath),\n content: ruleFile.implementation.content,\n });\n\n // Copy additional files for directory-based rules\n if (ruleFile.additionalFiles) {\n for (const additionalFile of ruleFile.additionalFiles) {\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, additionalFile.relativePath),\n content: additionalFile.content,\n });\n }\n }\n\n // Copy test file if it exists (only for TypeScript configs)\n if (ruleFile.test && isTypeScriptConfig) {\n actions.push({\n type: \"create_file\",\n path: join(rulesDir, ruleFile.test.relativePath),\n content: ruleFile.test.content,\n });\n }\n }\n\n // Install dependencies using the package manager for this specific target\n const packagesToInstall = [\n toInstallSpecifier(\"uilint-eslint\", {\n preferWorkspaceProtocol: state.packageManager === \"pnpm\",\n workspaceRoot: state.workspaceRoot,\n targetProjectPath: pkgPath,\n }),\n \"typescript-eslint\",\n ];\n\n // If require-test-coverage rule is selected, add coverage package and config\n const hasCoverageRule = selectedRules.some(\n (r) => r.id === \"require-test-coverage\"\n );\n if (hasCoverageRule) {\n packagesToInstall.push(\"@vitest/coverage-v8\");\n\n // Add action to inject coverage config into vitest.config.ts\n actions.push({\n type: \"inject_vitest_coverage\",\n projectPath: pkgPath,\n });\n }\n\n dependencies.push({\n packagePath: pkgPath,\n packageManager: detectPackageManager(pkgPath),\n packages: packagesToInstall,\n });\n\n // Inject ESLint rules (will reference local .uilint/rules/ files)\n if (pkgInfo?.eslintConfigPath) {\n actions.push({\n type: \"inject_eslint\",\n packagePath: pkgPath,\n configPath: pkgInfo.eslintConfigPath,\n rules: selectedRules,\n hasExistingRules: pkgInfo.hasUilintRules,\n });\n }\n\n // Add .uilint to tsconfig.json exclude to prevent build errors\n // The rule files are loaded by ESLint at runtime, not compiled with the app\n actions.push({\n type: \"inject_tsconfig\",\n projectPath: pkgPath,\n });\n }\n\n // Add .uilint/.cache to .gitignore at workspace root\n const gitignorePath = join(state.workspaceRoot, \".gitignore\");\n actions.push({\n type: \"append_to_file\",\n path: gitignorePath,\n content: \"\\n# UILint cache\\n.uilint/.cache\\n\",\n ifNotContains: \".uilint/.cache\",\n });\n }\n\n return { actions, dependencies };\n}\n\n/**\n * Get the list of rules that are missing from a package's ESLint config\n */\nexport function getMissingRules(\n configuredRuleIds: string[],\n selectedRules: RuleMetadata[]\n): RuleMetadata[] {\n const configuredSet = new Set(configuredRuleIds);\n return selectedRules.filter((rule) => !configuredSet.has(rule.id));\n}\n","/**\n * Rule Loader Utility\n *\n * Loads ESLint rule source files from the uilint-eslint package for installation\n * into user projects. Rules are copied to .uilint/rules/ in the target project.\n */\n\nimport { readFileSync, existsSync, readdirSync } from \"fs\";\nimport { join, dirname } from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { createRequire } from \"module\";\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\nconst require = createRequire(import.meta.url);\n\nfunction findNodeModulesPackageRoot(\n pkgName: string,\n startDir: string\n): string | null {\n let dir = startDir;\n while (true) {\n const candidate = join(dir, \"node_modules\", pkgName);\n if (existsSync(join(candidate, \"package.json\"))) return candidate;\n const parent = dirname(dir);\n if (parent === dir) break;\n dir = parent;\n }\n return null;\n}\n\nfunction getUilintEslintPackageRoot(): string {\n // Prefer a filesystem-based lookup first. This avoids Node resolution edge\n // cases with package.json \"exports\" (especially ESM-only packages), and works\n // well for monorepos + pnpm where node_modules contains symlinks.\n //\n // Search upwards from process.cwd() (the user's project) and from this file\n // location (for test/dev environments).\n const fromCwd = findNodeModulesPackageRoot(\"uilint-eslint\", process.cwd());\n if (fromCwd) return fromCwd;\n\n const fromHere = findNodeModulesPackageRoot(\"uilint-eslint\", __dirname);\n if (fromHere) return fromHere;\n\n // Last resort: try resolver-based lookup.\n try {\n const entry = require.resolve(\"uilint-eslint\"); // typically .../dist/index.js\n const entryDir = dirname(entry); // typically .../dist\n return dirname(entryDir); // package root\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(\n `Unable to locate uilint-eslint in node_modules (searched upwards from cwd and uilint's install path).\\n` +\n `Resolver error: ${msg}\\n` +\n `Fix: ensure uilint-eslint is installed in the target project (or workspace) and try again.`\n );\n }\n}\n\n/**\n * Represents a file for a rule (implementation or test)\n */\nexport interface RuleFile {\n /** Relative path within the rules directory (e.g., \"no-arbitrary-tailwind.ts\") */\n relativePath: string;\n /** File content */\n content: string;\n}\n\n/**\n * Represents a complete rule ready for installation\n */\nexport interface RuleFiles {\n /** Rule identifier (e.g., \"no-arbitrary-tailwind\") */\n ruleId: string;\n /** Implementation file (main entry point - index.ts for directory rules, or single file) */\n implementation: RuleFile;\n /** Additional files for directory-based rules (lib/ utilities, etc.) */\n additionalFiles?: RuleFile[];\n /** Test file (if exists) */\n test?: RuleFile;\n}\n\n/**\n * Get the path to the uilint-eslint package source directory\n */\nfunction getUilintEslintSrcDir(): string {\n // In development: packages/uilint-eslint/src/\n // In production (installed): node_modules/uilint-eslint/src/\n\n // Try workspace/dev path first (repo layout)\n const devPath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"uilint-eslint\",\n \"src\"\n );\n if (existsSync(devPath)) return devPath;\n\n // Try from installed package root (works with \"exports\")\n const pkgRoot = getUilintEslintPackageRoot();\n const srcPath = join(pkgRoot, \"src\");\n if (existsSync(srcPath)) return srcPath;\n\n throw new Error(\n 'Could not find uilint-eslint \"src/\" directory. If you are using a published install of uilint-eslint, ensure it includes source files, or run a JS-only rules install.'\n );\n}\n\n/**\n * Get the path to the uilint-eslint package dist directory\n */\nfunction getUilintEslintDistDir(): string {\n // In development: packages/uilint-eslint/dist/\n // In production (installed): node_modules/uilint-eslint/dist/\n\n // Try workspace/dev path first (repo layout)\n const devPath = join(\n __dirname,\n \"..\",\n \"..\",\n \"..\",\n \"..\",\n \"uilint-eslint\",\n \"dist\"\n );\n if (existsSync(devPath)) return devPath;\n\n // Try from installed package root (works with \"exports\")\n const pkgRoot = getUilintEslintPackageRoot();\n const distPath = join(pkgRoot, \"dist\");\n if (existsSync(distPath)) return distPath;\n\n throw new Error(\n 'Could not find uilint-eslint \"dist/\" directory. This is a bug in uilint installation.'\n );\n}\n\n/**\n * All utilities that are exported from uilint-eslint and can be imported.\n * When adding a new utility to uilint-eslint that rules may import,\n * add it here AND export it from uilint-eslint/src/index.ts.\n *\n * Rules can also declare their dependencies via the `internalDependencies`\n * field in defineRuleMeta() - this serves as documentation and can be\n * used for validation.\n */\nconst EXPORTED_UTILITIES = [\n \"create-rule\",\n \"cache\",\n \"styleguide-loader\",\n \"import-graph\",\n \"component-parser\",\n \"export-resolver\",\n \"coverage-aggregator\",\n \"dependency-graph\",\n \"file-categorizer\",\n \"jsx-coverage-analyzer\",\n];\n\n/**\n * Maps internal export names to their uilint-eslint export names.\n * Some exports are renamed when re-exported from the main package\n * to avoid naming conflicts.\n *\n * Format: \"utilFile:internalName\" -> \"externalName\"\n */\nconst EXPORT_RENAMES: Record<string, string> = {\n \"import-graph:clearCache\": \"clearImportGraphCache\",\n};\n\n/**\n * Transform an import specifier, applying any necessary renames.\n * Handles both simple imports (foo) and aliased imports (foo as bar).\n */\nfunction transformImportSpecifier(specifier: string, utilFile: string): string {\n const trimmed = specifier.trim();\n\n // Check for aliased import: \"localName as alias\"\n const aliasMatch = trimmed.match(/^(\\w+)\\s+as\\s+(\\w+)$/);\n if (aliasMatch) {\n const [, localName, alias] = aliasMatch;\n const renameKey = `${utilFile}:${localName}`;\n const externalName = EXPORT_RENAMES[renameKey];\n if (externalName) {\n // If the alias matches the external name, simplify to just the name\n if (alias === externalName) {\n return externalName;\n }\n // Otherwise, use the external name with the original alias\n return `${externalName} as ${alias}`;\n }\n // No rename needed, keep original\n return trimmed;\n }\n\n // Simple import: check if it needs renaming\n const renameKey = `${utilFile}:${trimmed}`;\n const externalName = EXPORT_RENAMES[renameKey];\n if (externalName) {\n return externalName;\n }\n\n return trimmed;\n}\n\n/**\n * External packages that are re-exported from uilint-eslint.\n * When rules import these packages directly, transform them to import from uilint-eslint instead.\n * This ensures the dependencies are resolved correctly when rules are copied to user projects.\n */\nconst REEXPORTED_PACKAGES: Record<string, string[]> = {\n \"oxc-resolver\": [\"ResolverFactory\"],\n};\n\n/**\n * Transform rule content to fix imports for copied location\n * Changes imports from \"../utils/...\" or \"../../utils/...\" to \"uilint-eslint\"\n * Also transforms external package imports that are re-exported from uilint-eslint\n */\nfunction transformRuleContent(content: string): string {\n let transformed = content;\n\n // Replace all relative utility imports with uilint-eslint imports\n // Pattern: import { ... } from \"../utils/create-rule.js\" or \"../../utils/create-rule.js\"\n // This handles any combination of imports like { createRule, defineRuleMeta }\n transformed = transformed.replace(\n /import\\s+{([^}]+)}\\s+from\\s+[\"'](?:\\.\\.\\/)+utils\\/([^\"']+)\\.js[\"'];?/g,\n (match, imports, utilFile) => {\n if (EXPORTED_UTILITIES.includes(utilFile)) {\n // Transform each import specifier\n const specifiers = imports.split(\",\").map((s: string) =>\n transformImportSpecifier(s, utilFile)\n );\n return `import { ${specifiers.join(\", \")} } from \"uilint-eslint\";`;\n }\n return match; // Keep original if not a known utility\n }\n );\n\n // Also handle default imports: import createRule from \"../utils/create-rule.js\"\n transformed = transformed.replace(\n /import\\s+(\\w+)\\s+from\\s+[\"'](?:\\.\\.\\/)+utils\\/([^\"']+)\\.js[\"'];?/g,\n (match, importName, utilFile) => {\n if (EXPORTED_UTILITIES.includes(utilFile)) {\n return `import { ${importName} } from \"uilint-eslint\";`;\n }\n return match;\n }\n );\n\n // Transform external package imports that are re-exported from uilint-eslint\n // Pattern: import { ResolverFactory } from \"oxc-resolver\"\n for (const [pkgName, exports] of Object.entries(REEXPORTED_PACKAGES)) {\n const escapedPkgName = pkgName.replace(/-/g, \"\\\\-\");\n const regex = new RegExp(\n `import\\\\s+{([^}]+)}\\\\s+from\\\\s+[\"']${escapedPkgName}[\"'];?`,\n \"g\"\n );\n transformed = transformed.replace(regex, (match, imports) => {\n const importNames = imports.split(\",\").map((s: string) => s.trim());\n // Only transform if all imported names are re-exported from uilint-eslint\n const allReexported = importNames.every((name: string) => {\n // Handle \"Foo as Bar\" syntax - extract the original name\n const originalName = name.split(/\\s+as\\s+/)[0].trim();\n return exports.includes(originalName);\n });\n if (allReexported) {\n return `import { ${imports} } from \"uilint-eslint\";`;\n }\n return match;\n });\n }\n\n return transformed;\n}\n\n/**\n * Check if a rule is directory-based (has index.ts/index.js) or single-file\n */\nfunction isDirectoryBasedRule(rulesDir: string, ruleId: string): boolean {\n const ruleDir = join(rulesDir, ruleId);\n return existsSync(ruleDir) && existsSync(join(ruleDir, \"index.ts\"));\n}\n\n/**\n * Load all files from a directory-based rule\n */\nfunction loadDirectoryRule(\n rulesDir: string,\n ruleId: string\n): { files: RuleFile[]; testFile?: RuleFile } {\n const ruleDir = join(rulesDir, ruleId);\n const files: RuleFile[] = [];\n let testFile: RuleFile | undefined;\n\n function collectFiles(dir: string, relativeTo: string): void {\n const entries = readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n const relativePath = join(relativeTo, entry.name);\n\n if (entry.isDirectory()) {\n collectFiles(fullPath, relativePath);\n } else if (entry.name.endsWith(\".ts\")) {\n if (entry.name.endsWith(\".test.ts\")) {\n // Handle test file separately\n testFile = {\n relativePath,\n content: transformRuleContent(readFileSync(fullPath, \"utf-8\")),\n };\n } else {\n files.push({\n relativePath,\n content: transformRuleContent(readFileSync(fullPath, \"utf-8\")),\n });\n }\n }\n }\n }\n\n collectFiles(ruleDir, ruleId);\n return { files, testFile };\n}\n\n/**\n * Load a specific rule by ID\n */\nexport function loadRule(\n ruleId: string,\n options: { typescript: boolean } = { typescript: true }\n): RuleFiles {\n const { typescript } = options;\n const extension = typescript ? \".ts\" : \".js\";\n\n if (typescript) {\n // Load TypeScript source files\n const rulesDir = join(getUilintEslintSrcDir(), \"rules\");\n\n // Check if this is a directory-based rule\n if (isDirectoryBasedRule(rulesDir, ruleId)) {\n const { files, testFile } = loadDirectoryRule(rulesDir, ruleId);\n\n if (files.length === 0) {\n throw new Error(`Rule \"${ruleId}\" directory exists but contains no TypeScript files`);\n }\n\n // Find the index.ts as the main implementation\n const indexFile = files.find((f) => f.relativePath === join(ruleId, \"index.ts\"));\n if (!indexFile) {\n throw new Error(`Rule \"${ruleId}\" directory missing index.ts`);\n }\n\n return {\n ruleId,\n implementation: indexFile,\n additionalFiles: files.filter((f) => f !== indexFile),\n test: testFile,\n };\n }\n\n // Single-file rule\n const implPath = join(rulesDir, `${ruleId}.ts`);\n const testPath = join(rulesDir, `${ruleId}.test.ts`);\n\n if (!existsSync(implPath)) {\n throw new Error(`Rule \"${ruleId}\" not found at ${implPath}`);\n }\n\n const rawContent = readFileSync(implPath, \"utf-8\");\n const transformedContent = transformRuleContent(rawContent);\n\n const implementation: RuleFile = {\n relativePath: `${ruleId}.ts`,\n content: transformedContent,\n };\n\n const test: RuleFile | undefined = existsSync(testPath)\n ? {\n relativePath: `${ruleId}.test.ts`,\n content: transformRuleContent(readFileSync(testPath, \"utf-8\")),\n }\n : undefined;\n\n return {\n ruleId,\n implementation,\n test,\n };\n } else {\n // Load compiled JavaScript files\n const rulesDir = join(getUilintEslintDistDir(), \"rules\");\n const implPath = join(rulesDir, `${ruleId}.js`);\n\n if (!existsSync(implPath)) {\n throw new Error(\n `Rule \"${ruleId}\" not found at ${implPath}. ` +\n `For JavaScript-only projects, uilint-eslint must be built to include compiled rule files in dist/rules/. ` +\n `If you're developing uilint-eslint, run 'pnpm build' in packages/uilint-eslint. ` +\n `If you're using a published package, ensure it includes the dist/ directory.`\n );\n }\n\n // Compiled JS files don't need transformation - they already use uilint-eslint imports\n const content = readFileSync(implPath, \"utf-8\");\n\n const implementation: RuleFile = {\n relativePath: `${ruleId}.js`,\n content,\n };\n\n // Test files are not compiled, so we don't copy them for JS projects\n return {\n ruleId,\n implementation,\n };\n }\n}\n\n/**\n * Load multiple rules by their IDs\n */\nexport function loadSelectedRules(\n ruleIds: string[],\n options: { typescript: boolean } = { typescript: true }\n): RuleFiles[] {\n return ruleIds.map((id) => loadRule(id, options));\n}\n\n/**\n * Get the list of available rule IDs from the registry\n */\nexport function getAvailableRuleIds(): string[] {\n try {\n // Import the rule registry from uilint-eslint\n const { ruleRegistry } = require(\"uilint-eslint\");\n return ruleRegistry.map((rule: { id: string }) => rule.id);\n } catch {\n // Fallback: try to read from filesystem\n const rulesDir = join(getUilintEslintSrcDir(), \"rules\");\n if (!existsSync(rulesDir)) {\n return [];\n }\n\n // This is a fallback - ideally we'd use the registry\n // But if we can't import it, we can at least try to list files\n const files = readdirSync(rulesDir);\n return files\n .filter((f: string) => f.endsWith(\".ts\") && !f.endsWith(\".test.ts\"))\n .map((f: string) => f.replace(\".ts\", \"\"));\n }\n}\n"],"mappings":";;;;;;;;;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,MAAK,MAAM,eAAe,YAAY;AAC5D,YAAQ,KAAK;AAAA,MACX,MAAM;AAAA,MACN,MAAM;AAAA,MACN,SAAS;AAAA,MACT,eAAe;AAAA,IACjB,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,SAAS,aAAa;AACjC;AAKO,SAAS,gBACd,mBACA,eACgB;AAChB,QAAM,gBAAgB,IAAI,IAAI,iBAAiB;AAC/C,SAAO,cAAc,OAAO,CAAC,SAAS,CAAC,cAAc,IAAI,KAAK,EAAE,CAAC;AACnE;","names":["join","require","renameKey","externalName","join"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uilint",
3
- "version": "0.2.32",
3
+ "version": "0.2.34",
4
4
  "description": "CLI for UILint - AI-powered UI consistency checking",
5
5
  "author": "Peter Suggate",
6
6
  "repository": {
@@ -48,9 +48,9 @@
48
48
  "react": "^19.2.3",
49
49
  "typescript": "^5.9.3",
50
50
  "ws": "^8.19.0",
51
- "uilint-core": "0.2.32",
52
- "uilint-eslint": "0.2.32",
53
- "uilint-duplicates": "0.2.32"
51
+ "uilint-duplicates": "0.2.34",
52
+ "uilint-core": "0.2.34",
53
+ "uilint-eslint": "0.2.34"
54
54
  },
55
55
  "optionalDependencies": {
56
56
  "@langfuse/client": "^4.5.1",
@@ -66,7 +66,7 @@
66
66
  "ink-testing-library": "^4.0.0",
67
67
  "tsup": "^8.5.1",
68
68
  "vitest": "^4.0.17",
69
- "uilint-react": "0.2.32"
69
+ "uilint-react": "0.2.34"
70
70
  },
71
71
  "keywords": [
72
72
  "cli",