@oamm/textor 1.0.13 → 1.0.14

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.
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../../src/utils/config.js","../../src/commands/init.js","../../src/utils/naming.js","../../src/utils/filesystem.js","../../src/utils/patterns.js","../../src/utils/templates.js","../../src/utils/state.js","../../src/utils/git.js","../../src/commands/add-section.js","../../src/commands/remove-section.js","../../src/utils/refactor.js","../../src/commands/move-section.js","../../src/commands/create-component.js","../../src/commands/remove-component.js","../../src/commands/list-sections.js","../../src/commands/validate-state.js","../../src/utils/status.js","../../src/commands/status.js","../../src/commands/sync.js","../../src/commands/adopt.js","../../src/commands/upgrade-config.js","../../src/commands/normalize-state.js","../../src/commands/prune-missing.js","../../src/commands/rename.js"],"sourcesContent":["import { readFile, writeFile, mkdir } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\n\nconst CONFIG_DIR = '.textor';\nconst CONFIG_FILE = 'config.json';\nexport const CURRENT_CONFIG_VERSION = 2;\n\n/**\n * @typedef {Object} TextorConfig\n * @property {number} configVersion\n * @property {Object} paths\n * @property {string} paths.pages\n * @property {string} paths.features\n * @property {string} paths.components\n * @property {string} paths.layouts\n * @property {Object} routing\n * @property {string} routing.mode\n * @property {string} routing.indexFile\n * @property {Object} importAliases\n * @property {string} importAliases.layouts\n * @property {string} importAliases.features\n * @property {Object} naming\n * @property {string} naming.routeExtension\n * @property {string} naming.featureExtension\n * @property {string} naming.componentExtension\n * @property {string} naming.hookExtension\n * @property {string} naming.testExtension\n * @property {Object} signatures\n * @property {string} signatures.astro\n * @property {string} signatures.typescript\n * @property {string} signatures.javascript\n * @property {Object} features\n * @property {string} features.framework\n * @property {string} features.entry\n * @property {boolean} features.createSubComponentsDir\n * @property {boolean} features.createScriptsDir\n * @property {string} features.scriptsIndexFile\n * @property {string} features.layout\n * @property {Object} features.layoutProps\n * @property {Object} components\n * @property {boolean} components.createSubComponentsDir\n * @property {boolean} components.createContext\n * @property {boolean} components.createHook\n * @property {boolean} components.createTests\n * @property {boolean} components.createConfig\n * @property {boolean} components.createConstants\n * @property {boolean} components.createTypes\n * @property {Object} formatting\n * @property {string} formatting.tool\n * @property {Object} filePatterns\n * @property {Object} filePatterns.features\n * @property {Object} filePatterns.components\n * @property {Object} git\n * @property {boolean} git.requireCleanRepo\n * @property {boolean} git.stageChanges\n * @property {Object} presets\n * @property {string} defaultPreset\n */\n\n/**\n * Default configuration for Textor\n * @type {TextorConfig}\n */\nexport const DEFAULT_CONFIG = {\n configVersion: CURRENT_CONFIG_VERSION,\n paths: {\n pages: 'src/pages',\n features: 'src/features',\n components: 'src/components',\n layouts: 'src/layouts'\n },\n routing: {\n mode: 'flat', // 'flat' | 'nested'\n indexFile: 'index.astro'\n },\n importAliases: {},\n naming: {\n routeExtension: '.astro',\n featureExtension: '.astro',\n componentExtension: '.tsx',\n hookExtension: '.ts',\n testExtension: '.test.tsx'\n },\n signatures: {\n astro: '<!-- @generated by Textor -->',\n typescript: '// @generated by Textor',\n javascript: '// @generated by Textor',\n tsx: '// @generated by Textor'\n },\n features: {\n framework: 'astro',\n entry: 'pascal', // 'index' | 'pascal'\n createSubComponentsDir: true,\n createScriptsDir: true,\n scriptsIndexFile: 'scripts/index.ts',\n createApi: false,\n createServices: false,\n createSchemas: false,\n createHooks: false,\n createContext: false,\n createTests: false,\n createTypes: false,\n createReadme: false,\n createStories: false,\n createIndex: false,\n layout: 'Main',\n layoutProps: {}\n },\n components: {\n framework: 'react',\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true,\n createApi: false,\n createServices: false,\n createSchemas: false,\n createReadme: false,\n createStories: false\n },\n formatting: {\n tool: 'none' // 'prettier' | 'biome' | 'none'\n },\n filePatterns: {\n features: {\n index: 'index.ts',\n types: 'index.ts',\n api: 'index.ts',\n services: 'index.ts',\n schemas: 'index.ts',\n hook: '{{hookName}}{{hookExtension}}',\n context: '{{componentName}}Context.tsx',\n test: '{{componentName}}{{testExtension}}',\n readme: 'README.md',\n stories: '{{componentName}}.stories.tsx'\n },\n components: {\n index: 'index.ts',\n types: 'index.ts',\n api: 'index.ts',\n services: 'index.ts',\n schemas: 'index.ts',\n hook: '{{hookName}}{{hookExtension}}',\n context: '{{componentName}}Context.tsx',\n test: '{{componentName}}{{testExtension}}',\n config: 'index.ts',\n constants: 'index.ts',\n readme: 'README.md',\n stories: '{{componentName}}.stories.tsx'\n }\n },\n hashing: {\n normalization: 'normalizeEOL', // 'none' | 'normalizeEOL' | 'stripGeneratedRegions'\n useMarkers: false\n },\n git: {\n requireCleanRepo: false,\n stageChanges: false\n },\n kindRules: [],\n presets: {\n minimal: {\n features: {\n createSubComponentsDir: false,\n createScriptsDir: false\n },\n components: {\n createSubComponentsDir: false,\n createContext: false,\n createHook: false,\n createTests: false,\n createConfig: false,\n createConstants: false,\n createTypes: false\n }\n },\n standard: {\n features: {\n createSubComponentsDir: true,\n createScriptsDir: true\n },\n components: {\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true\n }\n },\n senior: {\n features: {\n createSubComponentsDir: true,\n createScriptsDir: true,\n createApi: true,\n createServices: true,\n createSchemas: true,\n createHooks: true,\n createContext: true,\n createTests: true,\n createTypes: true,\n createReadme: true,\n createStories: true,\n createIndex: true\n },\n components: {\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true,\n createApi: true,\n createServices: true,\n createSchemas: true,\n createReadme: true,\n createStories: true\n }\n }\n },\n defaultPreset: 'standard'\n};\n\n/**\n * Gets the absolute path to the .textor directory.\n * @returns {string}\n */\nexport function getConfigDir() {\n return path.join(process.cwd(), CONFIG_DIR);\n}\n\n/**\n * Gets the absolute path to the config.json file.\n * @returns {string}\n */\nexport function getConfigPath() {\n return path.join(getConfigDir(), CONFIG_FILE);\n}\n\n/**\n * Checks if the configuration file exists.\n * @returns {boolean}\n */\nexport function configExists() {\n return existsSync(getConfigPath());\n}\n\n/**\n * Loads the configuration from config.json and merges it with DEFAULT_CONFIG.\n * @returns {Promise<TextorConfig>}\n * @throws {Error} If configuration not found or invalid\n */\nexport async function loadConfig() {\n const configPath = getConfigPath();\n \n if (!existsSync(configPath)) {\n throw new Error(\n `Textor configuration not found at ${configPath}\\n` +\n `Run 'textor init' to create it.`\n );\n }\n\n try {\n const content = await readFile(configPath, 'utf-8');\n const config = JSON.parse(content);\n const merged = mergeConfig(DEFAULT_CONFIG, config);\n validateConfig(merged);\n return merged;\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new Error(`Failed to parse config: Invalid JSON at ${configPath}`);\n }\n throw new Error(`Failed to load config: ${error.message}`);\n }\n}\n\n/**\n * Saves the configuration to config.json.\n * @param {TextorConfig} config Configuration to save\n * @param {boolean} [force=false] Whether to overwrite existing config\n * @returns {Promise<string>} Path to the saved config file\n * @throws {Error} If config exists and force is false\n */\nexport async function saveConfig(config, force = false) {\n const configPath = getConfigPath();\n \n if (existsSync(configPath) && !force) {\n throw new Error(\n `Configuration already exists at ${configPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n\n validateConfig(config);\n\n const configDir = getConfigDir();\n if (!existsSync(configDir)) {\n await mkdir(configDir, { recursive: true });\n }\n\n await writeFile(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf-8');\n return configPath;\n}\n\nexport function mergeConfig(defaults, config) {\n return deepMerge(defaults, config);\n}\n\nexport function normalizeConfigVersion(config) {\n if (!config || typeof config !== 'object') return config;\n if (typeof config.configVersion !== 'number') {\n return { ...config, configVersion: 1 };\n }\n return config;\n}\n\nexport function applyConfigMigrations(config) {\n let current = normalizeConfigVersion(config);\n let version = current.configVersion || 1;\n let migrated = { ...current };\n\n while (version < CURRENT_CONFIG_VERSION) {\n if (version === 1) {\n migrated = { ...migrated, configVersion: 2 };\n version = 2;\n continue;\n }\n break;\n }\n\n if (migrated.configVersion !== CURRENT_CONFIG_VERSION) {\n migrated.configVersion = CURRENT_CONFIG_VERSION;\n }\n\n return migrated;\n}\n\n/**\n * Deeply merges source object into target object.\n * @param {Object} target \n * @param {Object} source \n * @returns {Object} Merged object\n */\nfunction deepMerge(target, source) {\n const result = { ...target };\n \n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(target[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n }\n \n return result;\n}\n\n/**\n * Validates the configuration object structure.\n * @param {any} config \n * @throws {Error} If config is invalid\n */\nexport function validateConfig(config) {\n if (!config || typeof config !== 'object') {\n throw new Error('Invalid configuration: must be an object');\n }\n\n if (config.configVersion !== undefined && typeof config.configVersion !== 'number') {\n throw new Error('Invalid configuration: \"configVersion\" must be a number');\n }\n\n const requiredSections = ['paths', 'naming', 'signatures', 'importAliases'];\n for (const section of requiredSections) {\n if (!config[section] || typeof config[section] !== 'object') {\n throw new Error(`Invalid configuration: missing or invalid \"${section}\" section`);\n }\n }\n\n if (config.kindRules && !Array.isArray(config.kindRules)) {\n throw new Error('Invalid configuration: \"kindRules\" must be an array');\n }\n\n if (config.filePatterns && typeof config.filePatterns !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns\" must be an object');\n }\n if (config.filePatterns?.features && typeof config.filePatterns.features !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns.features\" must be an object');\n }\n if (config.filePatterns?.components && typeof config.filePatterns.components !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns.components\" must be an object');\n }\n\n // Validate paths are strings\n for (const [key, value] of Object.entries(config.paths)) {\n if (typeof value !== 'string') {\n throw new Error(`Invalid configuration: \"paths.${key}\" must be a string`);\n }\n }\n\n // Validate naming extensions start with dot\n for (const [key, value] of Object.entries(config.naming)) {\n if (typeof value === 'string' && !value.startsWith('.') && value !== '') {\n throw new Error(`Invalid configuration: \"naming.${key}\" should start with a dot (e.g., \".astro\")`);\n }\n }\n}\n\n/**\n * Resolves a configured path key to an absolute path.\n * @param {TextorConfig} config \n * @param {keyof TextorConfig['paths']} pathKey \n * @returns {string}\n */\nexport function resolvePath(config, pathKey) {\n const configuredPath = config.paths[pathKey];\n if (!configuredPath) {\n throw new Error(`Path \"${pathKey}\" not found in configuration`);\n }\n return path.resolve(process.cwd(), configuredPath);\n}\n\n/**\n * Merges CLI options, preset defaults, and global config.\n * @param {Object} cmdOptions \n * @param {TextorConfig} config \n * @param {'features' | 'components'} type \n */\nexport function getEffectiveOptions(cmdOptions, config, type) {\n const presetName = cmdOptions.preset || config.defaultPreset || 'standard';\n const preset = config.presets[presetName] || config.presets['standard'] || {};\n const presetTypeOptions = preset[type] || {};\n const configTypeOptions = config[type] || {};\n\n const merged = { ...configTypeOptions, ...presetTypeOptions };\n\n // Explicit CLI flags should override\n // Commander uses camelCase for flags like --no-sub-components-dir -> subComponentsDir\n for (const key in merged) {\n if (cmdOptions[key] !== undefined) {\n merged[key] = cmdOptions[key];\n } else if (key.startsWith('create')) {\n // Try mapping short flags to \"create\" prefix\n // e.g., CLI --api (cmdOptions.api) -> config createApi\n const shortKey = key.slice(6).charAt(0).toLowerCase() + key.slice(7);\n if (cmdOptions[shortKey] !== undefined) {\n merged[key] = cmdOptions[shortKey];\n }\n }\n }\n\n return merged;\n}\n","import { DEFAULT_CONFIG, saveConfig } from '../utils/config.js';\n\nexport async function initCommand(options) {\n try {\n const configPath = await saveConfig(DEFAULT_CONFIG, options.force);\n const quiet = options?.quiet || process.env.NODE_ENV === 'test' || process.env.TEXTOR_QUIET === '1';\n\n if (!quiet) {\n console.log('Textor configuration created at:', configPath);\n console.log('\\nDefault configuration:');\n console.log(JSON.stringify(DEFAULT_CONFIG, null, 2));\n console.log('\\nYou can now use Textor commands like:');\n console.log(' textor add-section /users users/catalog --layout Main');\n }\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n","import path from 'path';\n\nexport function toPascalCase(input) {\n return input\n .split(/[/\\\\_-]/)\n .filter(Boolean)\n .map(segment => {\n if (segment === segment.toUpperCase() && segment.length > 1) {\n segment = segment.toLowerCase();\n }\n return segment.charAt(0).toUpperCase() + segment.slice(1);\n })\n .join('');\n}\n\nexport function toCamelCase(input) {\n const pascal = toPascalCase(input);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\nexport function toKebabCase(input) {\n return input\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .replace(/[_\\s/\\\\-]+/g, '-')\n .toLowerCase()\n .replace(/^-+|-+$/g, '');\n}\n\nexport function toSnakeCase(input) {\n return toKebabCase(input).replace(/-/g, '_');\n}\n\nexport function toScreamingSnakeCase(input) {\n return toSnakeCase(input).toUpperCase();\n}\n\nexport function getFeatureComponentName(featurePath) {\n return toPascalCase(featurePath);\n}\n\nexport function getHookName(componentName) {\n return 'use' + componentName;\n}\n\nexport function getHookFunctionName(componentName) {\n return 'use' + componentName;\n}\n\nexport function getHookFileName(componentName, extension = '.ts') {\n return getHookFunctionName(componentName) + extension;\n}\n\nexport function normalizeComponentName(name) {\n return toPascalCase(name);\n}\n\nexport function normalizeRoute(route) {\n if (!route) return null;\n let normalized = route.trim();\n \n if (!normalized.startsWith('/')) {\n normalized = '/' + normalized;\n }\n \n if (normalized.length > 1 && normalized.endsWith('/')) {\n normalized = normalized.slice(0, -1);\n }\n \n return normalized;\n}\n\nexport function routeToFilePath(route, options = {}) {\n const { extension = '.astro', mode = 'flat', indexFile = 'index.astro' } = options;\n if (!route) return null;\n const normalized = normalizeRoute(route);\n \n if (normalized === '/') {\n return indexFile;\n }\n \n const routePath = normalized.slice(1);\n if (mode === 'nested') {\n return path.join(routePath, indexFile);\n }\n \n return routePath + extension;\n}\n\nexport function featureToDirectoryPath(featurePath) {\n return featurePath.replace(/^\\/+/, '').replace(/\\/+$/, '');\n}\n\nexport function getFeatureFileName(featurePath, options = {}) {\n const { extension = '.astro', strategy = 'index' } = options;\n if (strategy === 'pascal') {\n return getFeatureComponentName(featurePath) + extension;\n }\n return 'index' + extension;\n}\n\n/**\n * Calculates a relative import path from one file to another.\n * @param {string} fromFile The absolute path of the file containing the import\n * @param {string} toFile The absolute path of the file being imported\n * @returns {string} The relative import path\n */\nexport function getRelativeImportPath(fromFile, toFile) {\n let relativePath = path.relative(path.dirname(fromFile), toFile);\n \n // Convert backslashes to forward slashes for imports\n relativePath = relativePath.split(path.sep).join('/');\n \n // Ensure it starts with ./ or ../\n if (!relativePath.startsWith('.')) {\n relativePath = './' + relativePath;\n }\n \n return relativePath;\n}\n","import { readFile, writeFile, mkdir, unlink, rmdir, rename, readdir, stat, rm } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\nimport { createHash } from 'crypto';\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\nimport { toPascalCase } from './naming.js';\n\nconst execAsync = promisify(exec);\n\nexport function calculateHash(content, normalization = 'normalizeEOL') {\n let normalizedContent = content;\n \n if (normalization === 'stripGeneratedRegions') {\n // Extract all content between :begin and :end markers\n const beginMarker = /@generated by Textor:begin/g;\n const endMarker = /@generated by Textor:end/g;\n \n const regions = [];\n let match;\n const beginIndices = [];\n while ((match = beginMarker.exec(content)) !== null) {\n beginIndices.push(match.index + match[0].length);\n }\n \n const endIndices = [];\n while ((match = endMarker.exec(content)) !== null) {\n endIndices.push(match.index);\n }\n \n if (beginIndices.length > 0 && beginIndices.length === endIndices.length) {\n for (let i = 0; i < beginIndices.length; i++) {\n regions.push(content.slice(beginIndices[i], endIndices[i]));\n }\n normalizedContent = regions.join('\\n');\n }\n // Fall back to full content if markers are missing or mismatched\n }\n\n if (normalization === 'normalizeEOL' || normalization === 'stripGeneratedRegions') {\n normalizedContent = normalizedContent.replace(/\\r\\n/g, '\\n');\n }\n \n return createHash('sha256').update(normalizedContent).digest('hex');\n}\n\nexport async function isTextorGenerated(filePath, customSignatures = []) {\n if (!existsSync(filePath)) {\n return false;\n }\n\n try {\n const content = await readFile(filePath, 'utf-8');\n const signatures = ['@generated by Textor', ...customSignatures];\n return signatures.some(sig => content.includes(sig));\n } catch {\n return false;\n }\n}\n\nexport async function verifyFileIntegrity(filePath, expectedHash, options = {}) {\n const { \n force = false, \n acceptChanges = false, \n normalization = 'normalizeEOL',\n owner = null,\n actualOwner = null,\n signatures = []\n } = options;\n \n if (force) return { valid: true };\n\n if (owner && actualOwner && owner !== actualOwner) {\n return {\n valid: false,\n reason: 'wrong-owner',\n message: `Refusing to operate on ${filePath} - owned by ${actualOwner}, but requested by ${owner}. Use --force to override.`\n };\n }\n\n const isGenerated = await isTextorGenerated(filePath, signatures);\n if (!isGenerated) {\n return { \n valid: false, \n reason: 'not-generated', \n message: `Refusing to operate on ${filePath} - not generated by Textor. Use --force to override.` \n };\n }\n\n if (!expectedHash) {\n return {\n valid: false,\n reason: 'not-in-state',\n message: `Refusing to operate on ${filePath} - not found in Textor state. Use --force to override.`\n };\n }\n\n if (!acceptChanges) {\n const content = await readFile(filePath, 'utf-8');\n const currentHash = calculateHash(content, normalization);\n if (currentHash !== expectedHash) {\n return {\n valid: false,\n reason: 'hash-mismatch',\n message: `Refusing to operate on ${filePath} - content has been modified. Use --accept-changes or --force to override.`\n };\n }\n }\n\n return { valid: true };\n}\n\nexport async function safeDelete(filePath, options = {}) {\n const { force = false, expectedHash = null, acceptChanges = false, owner = null, actualOwner = null, signatures = [] } = options;\n \n if (!existsSync(filePath)) {\n return { deleted: false, reason: 'not-found' };\n }\n \n const integrity = await verifyFileIntegrity(filePath, expectedHash, { \n force, \n acceptChanges,\n owner,\n actualOwner,\n signatures\n });\n if (!integrity.valid) {\n return { deleted: false, reason: integrity.reason, message: integrity.message };\n }\n\n await unlink(filePath);\n return { deleted: true };\n}\n\nexport async function ensureNotExists(filePath, force = false) {\n if (existsSync(filePath)) {\n if (!force) {\n throw new Error(\n `File already exists: ${filePath}\\n` +\n `Use --force to overwrite.`\n );\n }\n }\n}\n\nexport async function ensureDir(dirPath) {\n await mkdir(dirPath, { recursive: true });\n}\n\nasync function isSafeToDeleteDir(dirPath, stateFiles = {}, options = {}) {\n try {\n const files = await readdir(dirPath);\n \n const results = await Promise.all(\n files.map(async file => {\n const filePath = path.join(dirPath, file);\n const stats = await stat(filePath);\n \n if (stats.isDirectory()) {\n return await isSafeToDeleteDir(filePath, stateFiles, options);\n }\n \n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n const fileState = stateFiles[normalizedPath];\n const integrity = await verifyFileIntegrity(filePath, fileState?.hash, {\n ...options,\n actualOwner: fileState?.owner,\n signatures: options.signatures || []\n });\n return integrity.valid;\n })\n );\n\n return results.every(Boolean);\n } catch {\n return false;\n }\n}\n\nexport async function safeDeleteDir(dirPath, options = {}) {\n const { force = false, stateFiles = {} } = options;\n if (!existsSync(dirPath)) {\n return { deleted: false, reason: 'not-found' };\n }\n\n const isSafe = force || await isSafeToDeleteDir(dirPath, stateFiles, options);\n \n if (isSafe) {\n await rm(dirPath, { recursive: true, force: true });\n return { deleted: true };\n }\n\n return {\n deleted: false,\n reason: 'contains-non-generated-or-modified',\n message: `Directory contains non-generated or modified files: ${dirPath}. Use --force to override.`\n };\n}\n\nexport async function writeFileWithSignature(filePath, content, signature, normalization = 'normalizeEOL') {\n await ensureDir(path.dirname(filePath));\n \n let finalContent = signature + '\\n' + content;\n \n if (signature.includes(':begin')) {\n const endSignature = signature.replace(':begin', ':end');\n finalContent = signature + '\\n' + content + '\\n' + endSignature;\n }\n\n await writeFile(filePath, finalContent, 'utf-8');\n \n return calculateHash(finalContent, normalization);\n}\n\nexport function getSignature(config, type) {\n const base = config.signatures[type] || config.signatures.typescript;\n if (config.hashing?.useMarkers) {\n return base.replace('Textor', 'Textor:begin');\n }\n return base;\n}\n\nexport async function updateSignature(filePath, oldPath, newPath) {\n if (!existsSync(filePath)) {\n return;\n }\n\n let content = await readFile(filePath, 'utf-8');\n \n content = content.replace(\n new RegExp(oldPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n newPath\n );\n \n await writeFile(filePath, content, 'utf-8');\n}\n\nexport async function safeMove(fromPath, toPath, options = {}) {\n const { \n force = false, \n expectedHash = null, \n acceptChanges = false, \n normalization = 'normalizeEOL',\n owner = null,\n actualOwner = null\n } = options;\n \n if (!existsSync(fromPath)) {\n throw new Error(`Source file not found: ${fromPath}`);\n }\n\n if (path.resolve(fromPath) === path.resolve(toPath)) {\n const content = await readFile(toPath, 'utf-8');\n return calculateHash(content, normalization);\n }\n\n if (existsSync(toPath) && !force) {\n throw new Error(\n `Destination already exists: ${toPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n\n const integrity = await verifyFileIntegrity(fromPath, expectedHash, { \n force, \n acceptChanges, \n normalization,\n owner,\n actualOwner,\n signatures: options.signatures || []\n });\n if (!integrity.valid) {\n throw new Error(integrity.message);\n }\n\n await ensureDir(path.dirname(toPath));\n await rename(fromPath, toPath);\n \n await updateSignature(toPath, fromPath, toPath);\n \n // Return new hash because updateSignature might have changed it\n const content = await readFile(toPath, 'utf-8');\n return calculateHash(content, normalization);\n}\n\nexport async function isEmptyDir(dirPath) {\n if (!existsSync(dirPath)) {\n return true;\n }\n\n const files = await readdir(dirPath);\n return files.length === 0;\n}\n\nexport async function scanDirectory(dir, fileSet) {\n const files = await readdir(dir);\n for (const file of files) {\n const fullPath = path.join(dir, file);\n const stats = await stat(fullPath);\n if (stats.isDirectory()) {\n if (file === 'node_modules' || file === '.git' || file === '.textor') continue;\n await scanDirectory(fullPath, fileSet);\n } else {\n const relativePath = path.relative(process.cwd(), fullPath).replace(/\\\\/g, '/');\n fileSet.add(relativePath);\n }\n }\n}\n\nexport function inferKind(filePath, config) {\n const normalizedFilePath = path.resolve(filePath).replace(/\\\\/g, '/');\n const relativeFromCwd = path.relative(process.cwd(), normalizedFilePath).replace(/\\\\/g, '/');\n\n // Check kindRules first (precedence)\n if (config.kindRules && Array.isArray(config.kindRules)) {\n for (const rule of config.kindRules) {\n if (rule.match && rule.kind) {\n // Simple glob-to-regex conversion for ** and *\n const regexStr = rule.match\n .replace(/[.+^${}()|[\\]\\\\]/g, '\\\\$&') // Escape regex special chars\n .replace(/\\*\\*/g, '(.+)') // ** matches anything\n .replace(/\\*/g, '([^/]+)'); // * matches one segment\n \n const regex = new RegExp(`^${regexStr}$`);\n if (regex.test(relativeFromCwd) || regex.test(normalizedFilePath)) {\n return rule.kind;\n }\n }\n }\n }\n\n const pagesRoot = path.resolve(process.cwd(), config.paths.pages || 'src/pages').replace(/\\\\/g, '/');\n const featuresRoot = path.resolve(process.cwd(), config.paths.features || 'src/features').replace(/\\\\/g, '/');\n const componentsRoot = path.resolve(process.cwd(), config.paths.components || 'src/components').replace(/\\\\/g, '/');\n\n const ext = path.extname(normalizedFilePath);\n\n if (normalizedFilePath.startsWith(pagesRoot)) {\n if (ext === '.ts' || ext === '.js') return 'endpoint';\n return 'route';\n }\n\n if (normalizedFilePath.startsWith(featuresRoot)) {\n const relativePath = path.relative(featuresRoot, normalizedFilePath).replace(/\\\\/g, '/');\n const parts = relativePath.split('/');\n \n // If it's directly in the features root\n if (parts.length === 1) return 'feature';\n\n const fileName = parts[parts.length - 1];\n const featureDir = path.dirname(relativePath).replace(/\\\\/g, '/');\n \n // Main feature file can be FeatureName.astro or index.astro\n const featureName = toPascalCase(featureDir);\n const possiblePascalName = featureName + (config.naming.featureExtension || '.astro');\n const possibleIndexName = 'index' + (config.naming.featureExtension || '.astro');\n \n if (path.dirname(relativePath) !== '.' && (fileName === possiblePascalName || fileName === possibleIndexName)) {\n // It's in the top level of its feature directory\n if (parts.length === (featureDir.split('/').length + 1)) {\n return 'feature';\n }\n }\n \n return 'feature-file';\n }\n\n if (normalizedFilePath.startsWith(componentsRoot)) {\n const relativePath = path.relative(componentsRoot, normalizedFilePath).replace(/\\\\/g, '/');\n const parts = relativePath.split('/');\n \n if (parts.length === 1) return 'component';\n \n const componentDir = parts[0];\n const fileName = parts[parts.length - 1];\n const componentName = toPascalCase(componentDir);\n \n const possibleComponentName = componentName + (config.naming.componentExtension || '.tsx');\n const possibleIndexName = 'index' + (config.naming.componentExtension || '.tsx');\n \n if (parts.length === 2 && (fileName === possibleComponentName || fileName === possibleIndexName)) {\n return 'component';\n }\n \n return 'component-file';\n }\n\n return 'unknown';\n}\n\n/**\n * Safely joins path segments and ensures the result is within the basePath.\n * @param {string} basePath The base directory that must contain the result\n * @param {...string} segments Path segments to join\n * @returns {string} The joined path\n * @throws {Error} If a path traversal attempt is detected\n */\nexport function secureJoin(basePath, ...segments) {\n const joinedPath = path.join(basePath, ...segments);\n const resolvedBase = path.resolve(basePath);\n const resolvedJoined = path.resolve(joinedPath);\n \n const relative = path.relative(resolvedBase, resolvedJoined);\n \n if (relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`Security error: Path traversal attempt detected: ${joinedPath} is outside of ${basePath}`);\n }\n \n return joinedPath;\n}\n\nexport async function cleanupEmptyDirs(dirPath, rootPath) {\n const normalizedDir = path.resolve(dirPath);\n const normalizedRoot = path.resolve(rootPath);\n \n if (normalizedDir === normalizedRoot || !normalizedDir.startsWith(normalizedRoot)) {\n return;\n }\n\n if (await isEmptyDir(normalizedDir)) {\n await rmdir(normalizedDir);\n await cleanupEmptyDirs(path.dirname(normalizedDir), rootPath);\n }\n}\n\n/**\n * Formats a list of files using the specified tool.\n * @param {string[]} filePaths \n * @param {'prettier' | 'biome' | 'none'} tool \n */\nexport async function formatFiles(filePaths, tool) {\n if (tool === 'none' || !filePaths.length) return;\n \n // Quote paths to handle spaces\n const paths = filePaths.map(p => `\"${p}\"`).join(' ');\n \n if (tool === 'prettier') {\n try {\n await execAsync(`npx prettier --write ${paths}`);\n } catch (error) {\n // Silently fail if prettier is not available or fails\n }\n } else if (tool === 'biome') {\n try {\n await execAsync(`npx biome format --write ${paths}`);\n } catch (error) {\n // Silently fail\n }\n }\n}\n","import { secureJoin } from './filesystem.js';\n\nexport function renderNamePattern(pattern, data = {}, label = 'pattern') {\n if (typeof pattern !== 'string') return null;\n const trimmed = pattern.trim();\n if (!trimmed) return null;\n\n const missing = new Set();\n const rendered = trimmed.replace(/{{\\s*([a-zA-Z0-9_]+)\\s*}}/g, (match, key) => {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n missing.add(key);\n return '';\n }\n return String(data[key]);\n });\n\n if (missing.size > 0) {\n throw new Error(\n `Invalid ${label}: missing values for ${Array.from(missing).join(', ')}`\n );\n }\n\n return rendered;\n}\n\nexport function resolvePatternedPath(baseDir, pattern, data, fallback, label) {\n const fileName = renderNamePattern(pattern, data, label) || fallback;\n if (!fileName) {\n throw new Error(`Invalid ${label}: resolved to empty file name`);\n }\n return secureJoin(baseDir, fileName);\n}\n","import { existsSync, readFileSync } from 'fs';\nimport path from 'path';\nimport { toPascalCase, toCamelCase, toKebabCase, toSnakeCase, toScreamingSnakeCase } from './naming.js';\n\nexport function enrichData(data) {\n const enriched = { ...data };\n const nameKeys = ['componentName', 'featureComponentName', 'layoutName'];\n for (const key of nameKeys) {\n if (data[key] && typeof data[key] === 'string') {\n enriched[`${key}Camel`] = toCamelCase(data[key]);\n enriched[`${key}Kebab`] = toKebabCase(data[key]);\n enriched[`${key}Snake`] = toSnakeCase(data[key]);\n enriched[`${key}Upper`] = toScreamingSnakeCase(data[key]);\n enriched[`${key}Pascal`] = toPascalCase(data[key]);\n }\n }\n return enriched;\n}\n\nfunction getTemplateOverride(templateName, extension, data = {}) {\n const overridePath = path.join(process.cwd(), '.textor', 'templates', `${templateName}${extension}`);\n if (existsSync(overridePath)) {\n let content = readFileSync(overridePath, 'utf-8');\n const finalData = enrichData(data);\n for (const [key, value] of Object.entries(finalData)) {\n const replacement = () => value || '';\n content = content.replace(new RegExp(`{{${key}}}`, 'g'), replacement);\n content = content.replace(new RegExp(`__${key}__`, 'g'), replacement);\n }\n return content;\n }\n return null;\n}\n\n/**\n * Route Template Variables:\n * - layoutName: The name of the layout component\n * - layoutImportPath: Path to import the layout\n * - featureImportPath: Path to import the feature component\n * - featureComponentName: Name of the feature component\n * - layoutProps: Optional properties for the layout\n */\nexport function generateRouteTemplate(layoutName, layoutImportPath, featureImportPath, featureComponentName, extension = '.astro', layoutProps = {}) {\n const override = getTemplateOverride('route', extension, {\n layoutName,\n layoutImportPath,\n featureImportPath,\n featureComponentName,\n ...layoutProps\n });\n if (override) return override;\n\n if (layoutName === 'none') {\n return `---\nimport ${featureComponentName} from '${featureImportPath}';\n---\n\n<${featureComponentName} />\n`;\n }\n\n const propsStr = Object.entries(layoutProps)\n .map(([key, value]) => {\n if (typeof value === 'string' && value.startsWith('{') && value.endsWith('}')) {\n return `${key}=${value}`;\n }\n if (typeof value === 'string') {\n return `${key}=\"${value}\"`;\n }\n return `${key}={${JSON.stringify(value)}}`;\n })\n .join(' ');\n\n const layoutOpening = propsStr ? `<${layoutName} ${propsStr}>` : `<${layoutName}>`;\n\n return `---\nimport ${layoutName} from '${layoutImportPath}';\nimport ${featureComponentName} from '${featureImportPath}';\n---\n\n${layoutOpening}\n <${featureComponentName} />\n</${layoutName}>\n`;\n}\n\nexport function mergeRouteTemplate(existingContent, featureImportPath, featureComponentName, layoutName) {\n let content = existingContent;\n \n // 1. Add import\n const importLine = `import ${featureComponentName} from '${featureImportPath}';`;\n if (!content.includes(importLine)) {\n // Find the second --- which marks the end of frontmatter\n const lines = content.split('\\n');\n let frontMatterEndLine = -1;\n let dashCount = 0;\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim() === '---') {\n dashCount++;\n if (dashCount === 2) {\n frontMatterEndLine = i;\n break;\n }\n }\n }\n\n if (frontMatterEndLine !== -1) {\n lines.splice(frontMatterEndLine, 0, importLine);\n content = lines.join('\\n');\n } else if (content.includes('---')) {\n // If only one --- found, maybe it's just the start? \n // But standard Astro has two. \n // Fallback: insert at the beginning if no frontmatter end found\n content = importLine + '\\n' + content;\n }\n }\n\n // 2. Add component usage\n const componentTag = `<${featureComponentName} />`;\n if (!content.includes(componentTag)) {\n if (layoutName && layoutName !== 'none') {\n const layoutEndTag = `</${layoutName}>`;\n if (content.includes(layoutEndTag)) {\n const lines = content.split('\\n');\n let layoutEndLine = -1;\n for (let i = lines.length - 1; i >= 0; i--) {\n if (lines[i].includes(layoutEndTag)) {\n layoutEndLine = i;\n break;\n }\n }\n if (layoutEndLine !== -1) {\n lines.splice(layoutEndLine, 0, ` ${componentTag}`);\n content = lines.join('\\n');\n }\n } else {\n // Layout might be self-closing or missing end tag? \n // If it's Textor generated it should have it.\n content += `\\n${componentTag}\\n`;\n }\n } else {\n content += `\\n${componentTag}\\n`;\n }\n }\n\n return content;\n}\n\n/**\n * Feature Template Variables:\n * - componentName: Name of the feature component\n * - scriptImportPath: Path to the feature's client-side script\n */\nexport function generateFeatureTemplate(componentName, scriptImportPath, framework = 'astro', extension) {\n const templateExtension = extension || (framework === 'astro' ? '.astro' : '.tsx');\n const override = getTemplateOverride('feature', templateExtension, { componentName, scriptImportPath });\n if (override) return override;\n\n if (framework === 'react') {\n return `export type ${componentName}Props = {\n // Add props here\n}\n\nexport default function ${componentName}({ }: ${componentName}Props) {\n return (\n <div className=\"${componentName.toLowerCase()}\">\n <h1>${componentName}</h1>\n </div>\n );\n}\n`;\n }\n\n const scriptTag = scriptImportPath ? `\\n<script src=\"${scriptImportPath}\"></script>` : '';\n\n return `---\n// Feature: ${componentName}\n---\n\n<div class=\"${componentName.toLowerCase()}\">\n <h1>${componentName}</h1>\n</div>${scriptTag}\n`;\n}\n\n/**\n * Scripts Index Template (no variables)\n */\nexport function generateScriptsIndexTemplate() {\n const override = getTemplateOverride('scripts-index', '.ts');\n if (override) return override;\n\n return `export {};\n`;\n}\n\n/**\n * Component Template Variables:\n * - componentName: Name of the component\n */\nexport function generateComponentTemplate(componentName, framework = 'react', extension) {\n const templateExtension = extension || (framework === 'astro' ? '.astro' : '.tsx');\n const override = getTemplateOverride('component', templateExtension, { componentName });\n if (override) return override;\n\n if (framework === 'react') {\n return `export type ${componentName}Props = {\n // Add props here\n}\n\nexport default function ${componentName}({ }: ${componentName}Props) {\n return (\n <div className=\"${componentName.toLowerCase()}\">\n {/* ${componentName} implementation */}\n </div>\n );\n}\n`;\n }\n\n return `---\nexport type Props = {\n // Add props here\n}\n\nconst props = Astro.props;\n---\n\n<div class=\"${componentName.toLowerCase()}\">\n <!-- ${componentName} implementation -->\n</div>\n`;\n}\n\n/**\n * Hook Template Variables:\n * - componentName: Name of the component\n * - hookName: Name of the hook function (e.g., useButton)\n */\nexport function generateHookTemplate(componentName, hookName) {\n const override = getTemplateOverride('hook', '.ts', { componentName, hookName });\n if (override) return override;\n\n return `import { useState } from 'react';\n\nexport function ${hookName}() {\n // Add hook logic here\n \n return {\n // Return hook values\n };\n}\n`;\n}\n\n/**\n * Context Template Variables:\n * - componentName: Name of the component\n */\nexport function generateContextTemplate(componentName) {\n const override = getTemplateOverride('context', '.tsx', { componentName });\n if (override) return override;\n\n return `import { createContext, useContext } from 'react';\n\n//@ts-ignore\ntype ${componentName}ContextValue = {\n // Add context value types here\n}\n\nconst ${componentName}Context = createContext<${componentName}ContextValue | undefined>(undefined);\n\nexport function ${componentName}Provider({ children }: { children: React.ReactNode }) {\n const value: ${componentName}ContextValue = {\n // Provide context values\n };\n\n return (\n <${componentName}Context.Provider value={value}>\n {children}\n </${componentName}Context.Provider>\n );\n}\n\nexport function use${componentName}Context() {\n const context = useContext(${componentName}Context);\n if (context === undefined) {\n throw new Error('use${componentName}Context must be used within ${componentName}Provider');\n }\n return context;\n}\n`;\n}\n\n/**\n * Test Template Variables:\n * - componentName: Name of the component\n * - componentPath: Relative path to the component file\n */\nexport function generateTestTemplate(componentName, componentPath) {\n const override = getTemplateOverride('test', '.tsx', { componentName, componentPath });\n if (override) return override;\n\n return `import { describe, it, expect } from 'vitest';\nimport { render, screen } from '@testing-library/react';\nimport ${componentName} from '${componentPath}';\n\ndescribe('${componentName}', () => {\n it('renders without crashing', () => {\n render(<${componentName} />);\n expect(screen.getByText('${componentName}')).toBeInTheDocument();\n });\n});\n`;\n}\n\n/**\n * Config Template Variables:\n * - componentName: Name of the component\n */\nexport function generateConfigTemplate(componentName) {\n const override = getTemplateOverride('config', '.ts', { componentName });\n if (override) return override;\n\n return `export const ${componentName}Config = {\n // Add configuration here\n};\n`;\n}\n\n/**\n * Constants Template Variables:\n * - componentName: Name of the component\n */\nexport function generateConstantsTemplate(componentName) {\n const override = getTemplateOverride('constants', '.ts', { componentName });\n if (override) return override;\n\n return `export const ${componentName.toUpperCase()}_CONSTANTS = {\n // Add constants here\n};\n`;\n}\n\n/**\n * Index Template Variables:\n * - componentName: Name of the component\n * - componentExtension: File extension of the component\n */\nexport function generateIndexTemplate(componentName, componentExtension) {\n const override = getTemplateOverride('index', '.ts', { componentName, componentExtension });\n if (override) return override;\n\n if (componentExtension === '.astro') {\n return `export * from './types';\n`;\n }\n\n return `export { default as ${componentName} } from './${componentName}${componentExtension}';\nexport * from './types';\n`;\n}\n\n/**\n * Types Template Variables:\n * - componentName: Name of the component\n */\nexport function generateTypesTemplate(componentName) {\n const override = getTemplateOverride('types', '.ts', { componentName });\n if (override) return override;\n\n return `export type ${componentName}Props = {\n // Add props types here\n};\n`;\n}\n\n/**\n * API Template Variables:\n * - componentName: Name of the component\n */\nexport function generateApiTemplate(componentName) {\n const override = getTemplateOverride('api', '.ts', { componentName });\n if (override) return override;\n\n return `export function GET({ params, request }) {\n return new Response(\n JSON.stringify({\n name: \"${componentName}\",\n url: \"https://astro.build/\",\n }),\n );\n}\n`;\n}\n\n/**\n * Endpoint Template Variables:\n * - componentName: Name of the component\n */\nexport function generateEndpointTemplate(componentName) {\n const override = getTemplateOverride('endpoint', '.ts', { componentName });\n if (override) return override;\n\n return `export function GET({ params, request }) {\n return new Response(\n JSON.stringify({\n name: \"${componentName}\",\n url: \"https://astro.build/\",\n }),\n );\n}\n`;\n}\n\n/**\n * Service Template Variables:\n * - componentName: Name of the component\n */\nexport function generateServiceTemplate(componentName) {\n const override = getTemplateOverride('service', '.ts', { componentName });\n if (override) return override;\n\n return `// ${componentName} business logic and transformers\nexport async function get${componentName}Data() {\n // Encapsulated logic for data processing\n return [];\n}\n\nexport function transform${componentName}Data(data: any) {\n // Domain-specific data transformations\n return data;\n}\n`;\n}\n\n/**\n * Schema Template Variables:\n * - componentName: Name of the component\n */\nexport function generateSchemaTemplate(componentName) {\n const override = getTemplateOverride('schema', '.ts', { componentName });\n if (override) return override;\n\n return `import { z } from 'zod';\n\nexport const ${componentName}Schema = z.object({\n id: z.string().uuid(),\n createdAt: z.string().datetime(),\n updatedAt: z.string().datetime().optional(),\n});\n\nexport type ${componentName} = z.infer<typeof ${componentName}Schema>;\n`;\n}\n\n/**\n * Readme Template Variables:\n * - componentName: Name of the component\n */\nexport function generateReadmeTemplate(componentName) {\n const override = getTemplateOverride('readme', '.md', { componentName });\n if (override) return override;\n\n return `# ${componentName}\n\n## Description\nBrief description of what this feature/component does.\n\n## Props/Usage\nHow to use this and what are its requirements.\n`;\n}\n\n/**\n * Stories Template Variables:\n * - componentName: Name of the component\n * - componentPath: Relative path to the component file\n */\nexport function generateStoriesTemplate(componentName, componentPath) {\n const override = getTemplateOverride('stories', '.tsx', { componentName, componentPath });\n if (override) return override;\n\n return `import type { Meta, StoryObj } from '@storybook/react';\nimport ${componentName} from '${componentPath}';\n\nconst meta: Meta<typeof ${componentName}> = {\n title: 'Components/${componentName}',\n component: ${componentName},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof ${componentName}>;\n\nexport const Default: Story = {\n args: {\n // Default props\n },\n};\n`;\n}\n","import { readFile, mkdir, rename, open } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\n\nconst CONFIG_DIR = '.textor';\nconst STATE_FILE = 'state.json';\n\nexport function getStatePath() {\n return path.join(process.cwd(), CONFIG_DIR, STATE_FILE);\n}\n\nexport async function loadState() {\n const statePath = getStatePath();\n if (!existsSync(statePath)) {\n return { sections: [], components: [], files: {} };\n }\n\n try {\n const content = await readFile(statePath, 'utf-8');\n const state = JSON.parse(content);\n if (!state.files) state.files = {};\n normalizeStatePaths(state);\n return state;\n } catch (error) {\n return { sections: [], components: [], files: {} };\n }\n}\n\nlet saveQueue = Promise.resolve();\n\nexport async function saveState(state) {\n const result = saveQueue.then(async () => {\n const statePath = getStatePath();\n const dir = path.dirname(statePath);\n if (!existsSync(dir)) {\n await mkdir(dir, { recursive: true });\n }\n \n const tempPath = statePath + '.' + Math.random().toString(36).slice(2) + '.tmp';\n const content = JSON.stringify(state, null, 2);\n \n const handle = await open(tempPath, 'w');\n await handle.writeFile(content, 'utf-8');\n await handle.sync();\n await handle.close();\n\n await rename(tempPath, statePath);\n });\n \n saveQueue = result.catch(() => {});\n return result;\n}\n\nexport async function registerFile(filePath, { kind, template, hash, templateVersion = '1.0.0', owner = null }) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n \n state.files[normalizedPath] = {\n kind,\n template,\n hash,\n templateVersion,\n owner,\n timestamp: new Date().toISOString()\n };\n \n await saveState(state);\n}\n\nexport async function unregisterFile(filePath) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n delete state.files[normalizedPath];\n await saveState(state);\n}\n\nexport async function getFileData(filePath) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n return state.files[normalizedPath];\n}\n\nexport async function addSectionToState(section) {\n const state = await loadState();\n const normalizedSection = { ...section };\n if (normalizedSection.featurePath) {\n normalizedSection.featurePath = normalizeStatePath(normalizedSection.featurePath);\n }\n // Avoid duplicates by route AND by featurePath\n if (normalizedSection.route) {\n state.sections = state.sections.filter(s => s.route !== normalizedSection.route || s.featurePath !== normalizedSection.featurePath);\n } else {\n state.sections = state.sections.filter(s => s.featurePath !== normalizedSection.featurePath || s.route);\n }\n state.sections.push(normalizedSection);\n await saveState(state);\n}\n\nexport async function removeSectionFromState(route) {\n const state = await loadState();\n state.sections = state.sections.filter(s => s.route !== route && s.name !== route);\n await saveState(state);\n}\n\nexport async function updateSectionInState(oldRoute, newSection) {\n const state = await loadState();\n const normalizedSection = { ...newSection };\n if (normalizedSection.featurePath) {\n normalizedSection.featurePath = normalizeStatePath(normalizedSection.featurePath);\n }\n state.sections = state.sections.filter(s => s.route !== oldRoute);\n state.sections.push(normalizedSection);\n await saveState(state);\n}\n\nexport async function addComponentToState(component) {\n const state = await loadState();\n const normalizedComponent = { ...component };\n if (normalizedComponent.path) {\n normalizedComponent.path = normalizeStatePath(normalizedComponent.path);\n }\n // Avoid duplicates by name\n state.components = state.components.filter(c => c.name !== normalizedComponent.name);\n state.components.push(normalizedComponent);\n await saveState(state);\n}\n\nfunction normalizeStatePath(filePath) {\n if (!filePath || typeof filePath !== 'string') return filePath;\n const relative = path.isAbsolute(filePath)\n ? path.relative(process.cwd(), filePath)\n : filePath;\n return relative.replace(/\\\\/g, '/');\n}\n\nfunction normalizeStatePaths(state) {\n if (!state || typeof state !== 'object') return;\n if (Array.isArray(state.sections)) {\n state.sections = state.sections.map(section => {\n if (!section || typeof section !== 'object') return section;\n if (!section.featurePath) return section;\n const normalized = normalizeStatePath(section.featurePath);\n if (normalized === section.featurePath) return section;\n return { ...section, featurePath: normalized };\n });\n }\n if (Array.isArray(state.components)) {\n state.components = state.components.map(component => {\n if (!component || typeof component !== 'object') return component;\n if (!component.path) return component;\n const normalized = normalizeStatePath(component.path);\n if (normalized === component.path) return component;\n return { ...component, path: normalized };\n });\n }\n}\n\nexport async function removeComponentFromState(name) {\n const state = await loadState();\n state.components = state.components.filter(c => c.name !== name);\n await saveState(state);\n}\n\nexport function findSection(state, identifier) {\n return state.sections.find(s => s.route === identifier || s.name === identifier || s.featurePath === identifier);\n}\n\nexport function findComponent(state, name) {\n return state.components.find(c => c.name === name);\n}\n\nexport function reconstructComponents(files, config) {\n const componentsRoot = (config.paths.components || 'src/components').replace(/\\\\/g, '/');\n const components = new Map();\n\n for (const filePath in files) {\n const normalizedPath = filePath.replace(/\\\\/g, '/');\n if (normalizedPath === componentsRoot || normalizedPath.startsWith(componentsRoot + '/')) {\n const relativePath = normalizedPath === componentsRoot ? '' : normalizedPath.slice(componentsRoot.length + 1);\n if (relativePath === '') continue; // skip the root itself if it's in files for some reason\n \n const parts = relativePath.split('/');\n if (parts.length >= 1) {\n const componentName = parts[0];\n const componentPath = `${componentsRoot}/${componentName}`;\n if (!components.has(componentName)) {\n components.set(componentName, {\n name: componentName,\n path: componentPath\n });\n }\n // Attribute ownership\n if (!files[filePath].owner) {\n files[filePath].owner = componentName;\n }\n }\n }\n }\n\n return Array.from(components.values());\n}\n\nexport function reconstructSections(state, config) {\n const pagesRoot = (config.paths.pages || 'src/pages').replace(/\\\\/g, '/');\n const featuresRoot = (config.paths.features || 'src/features').replace(/\\\\/g, '/');\n const files = state.files;\n \n // Keep existing sections if their files still exist\n const validSections = (state.sections || []).filter(section => {\n // Check if route file exists in state.files\n const routeFile = Object.keys(files).find(f => {\n const normalizedF = f.replace(/\\\\/g, '/');\n const routePath = section.route === '/' ? 'index' : section.route.slice(1);\n return normalizedF.startsWith(pagesRoot + '/' + routePath + '.') || \n normalizedF === pagesRoot + '/' + routePath + '/index.astro'; // nested mode\n });\n\n // Check if feature directory has at least one file in state.files\n const hasFeatureFiles = Object.keys(files).some(f => \n f.replace(/\\\\/g, '/').startsWith(section.featurePath.replace(/\\\\/g, '/') + '/')\n );\n\n return routeFile && hasFeatureFiles;\n });\n\n const sections = new Map();\n validSections.forEach(s => sections.set(s.route, s));\n\n // Try to discover new sections\n for (const filePath in files) {\n const normalizedPath = filePath.replace(/\\\\/g, '/');\n if (normalizedPath.startsWith(pagesRoot + '/')) {\n const relativePath = normalizedPath.slice(pagesRoot.length + 1);\n const route = '/' + relativePath.replace(/\\.(astro|ts|js|tsx|jsx)$/, '').replace(/\\/index$/, '');\n const finalRoute = route === '' ? '/' : route;\n\n if (!sections.has(finalRoute)) {\n // Try to find a matching feature by name\n const routeName = path.basename(finalRoute === '/' ? 'index' : finalRoute).toLowerCase();\n // Look for a directory in features with same name or similar\n const possibleFeaturePath = Object.keys(files).find(f => {\n const nf = f.replace(/\\\\/g, '/');\n if (!nf.startsWith(featuresRoot + '/')) return false;\n const relToFeatures = nf.slice(featuresRoot.length + 1);\n const segments = relToFeatures.toLowerCase().split('/');\n return segments.includes(routeName);\n });\n\n if (possibleFeaturePath) {\n const relToFeatures = path.dirname(path.relative(featuresRoot, possibleFeaturePath)).replace(/\\\\/g, '/');\n const featurePath = relToFeatures === '.' ? featuresRoot : `${featuresRoot}/${relToFeatures}`;\n const featureName = path.basename(featurePath);\n\n sections.set(finalRoute, {\n name: featureName,\n route: finalRoute,\n featurePath: featurePath,\n extension: path.extname(filePath)\n });\n\n // Attribute ownership to discovered files\n if (!files[filePath].owner) files[filePath].owner = finalRoute;\n for (const f in files) {\n if (f.startsWith(featurePath + '/') || f === featurePath) {\n if (!files[f].owner) files[f].owner = finalRoute;\n }\n }\n }\n }\n }\n }\n\n return Array.from(sections.values());\n}\n","import { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\nexport async function isRepoClean() {\n try {\n const { stdout } = await execAsync('git status --porcelain');\n return stdout.trim() === '';\n } catch (error) {\n // If not a git repo, we consider it clean or at least we can't check\n return true;\n }\n}\n\nexport async function stageFiles(filePaths) {\n if (!filePaths.length) return;\n try {\n const paths = filePaths.map(p => `\"${p}\"`).join(' ');\n await execAsync(`git add ${paths}`);\n } catch (error) {\n // Ignore errors if git is not available\n }\n}\n","import path from 'path';\nimport { rename, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath, getEffectiveOptions } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getFeatureFileName,\n getFeatureComponentName,\n getRelativeImportPath,\n getHookFileName,\n getHookFunctionName\n} from '../utils/naming.js';\nimport { \n calculateHash,\n ensureNotExists, \n isTextorGenerated,\n writeFileWithSignature,\n getSignature,\n ensureDir,\n secureJoin,\n formatFiles\n} from '../utils/filesystem.js';\nimport { resolvePatternedPath } from '../utils/patterns.js';\nimport { \n generateRouteTemplate, \n mergeRouteTemplate,\n generateFeatureTemplate,\n generateScriptsIndexTemplate,\n generateHookTemplate,\n generateContextTemplate,\n generateTestTemplate,\n generateIndexTemplate,\n generateTypesTemplate,\n generateApiTemplate,\n generateEndpointTemplate,\n generateServiceTemplate,\n generateSchemaTemplate,\n generateReadmeTemplate,\n generateStoriesTemplate,\n enrichData\n} from '../utils/templates.js';\nimport { addSectionToState, registerFile, loadState, saveState } from '../utils/state.js';\nimport { stageFiles } from '../utils/git.js';\n\nexport async function addSectionCommand(route, featurePath, options) {\n try {\n const config = await loadConfig();\n\n // Handle optional route\n if (typeof featurePath === 'object' || featurePath === undefined) {\n options = featurePath || options || {};\n featurePath = route;\n route = null;\n }\n \n const effectiveOptions = getEffectiveOptions(options, config, 'features');\n \n const normalizedRoute = normalizeRoute(route);\n const normalizedFeaturePath = featureToDirectoryPath(featurePath);\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const layoutsRoot = resolvePath(config, 'layouts');\n \n const routeExtension = options.endpoint ? '.ts' : config.naming.routeExtension;\n \n // Check if we should use nested mode even if config says flat\n // (because the directory already exists, suggesting it should be an index file)\n let effectiveRoutingMode = config.routing.mode;\n if (normalizedRoute && effectiveRoutingMode === 'flat') {\n const routeDirName = routeToFilePath(normalizedRoute, {\n extension: '',\n mode: 'flat'\n });\n const routeDirPath = secureJoin(pagesRoot, routeDirName);\n if (existsSync(routeDirPath)) {\n effectiveRoutingMode = 'nested';\n }\n }\n\n const routeFileName = normalizedRoute ? routeToFilePath(normalizedRoute, {\n extension: routeExtension,\n mode: effectiveRoutingMode,\n indexFile: config.routing.indexFile\n }) : null;\n \n const featureComponentName = getFeatureComponentName(normalizedFeaturePath);\n const featureFileName = getFeatureFileName(normalizedFeaturePath, {\n extension: config.naming.featureExtension,\n strategy: effectiveOptions.entry\n });\n \n const routeFilePath = routeFileName ? secureJoin(pagesRoot, routeFileName) : null;\n const featureDirPath = secureJoin(featuresRoot, normalizedFeaturePath);\n const featureFilePath = secureJoin(featureDirPath, featureFileName);\n const scriptsIndexPath = secureJoin(featureDirPath, config.features.scriptsIndexFile);\n const subComponentsDir = secureJoin(featureDirPath, 'sub-components');\n const testsDir = secureJoin(featureDirPath, '__tests__');\n const contextDirInside = secureJoin(featureDirPath, 'context');\n const hooksDirInside = secureJoin(featureDirPath, 'hooks');\n const typesDirInside = secureJoin(featureDirPath, 'types');\n const apiDirInside = secureJoin(featureDirPath, 'api');\n const servicesDirInside = secureJoin(featureDirPath, 'services');\n const schemasDirInside = secureJoin(featureDirPath, 'schemas');\n \n const {\n framework,\n layout,\n layoutProps: configLayoutProps,\n createSubComponentsDir: shouldCreateSubComponentsDir,\n createScriptsDir: shouldCreateScriptsDir,\n createApi: shouldCreateApi,\n createServices: shouldCreateServices,\n createSchemas: shouldCreateSchemas,\n createHooks: shouldCreateHooks,\n createContext: shouldCreateContext,\n createTests: shouldCreateTests,\n createTypes: shouldCreateTypes,\n createReadme: shouldCreateReadme,\n createStories: shouldCreateStories,\n createIndex: shouldCreateIndex\n } = effectiveOptions;\n\n const featurePatterns = config.filePatterns?.features || {};\n const patternData = {\n componentName: featureComponentName,\n hookName: getHookFunctionName(featureComponentName),\n hookExtension: config.naming.hookExtension,\n testExtension: config.naming.testExtension,\n featureExtension: config.naming.featureExtension,\n componentExtension: config.naming.componentExtension\n };\n\n const indexFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.index,\n patternData,\n 'index.ts',\n 'filePatterns.features.index'\n );\n const contextFilePath = resolvePatternedPath(\n contextDirInside,\n featurePatterns.context,\n patternData,\n `${featureComponentName}Context.tsx`,\n 'filePatterns.features.context'\n );\n const hookFilePath = resolvePatternedPath(\n hooksDirInside,\n featurePatterns.hook,\n patternData,\n getHookFileName(featureComponentName, config.naming.hookExtension),\n 'filePatterns.features.hook'\n );\n const testFilePath = resolvePatternedPath(\n testsDir,\n featurePatterns.test,\n patternData,\n `${featureComponentName}${config.naming.testExtension}`,\n 'filePatterns.features.test'\n );\n const typesFilePath = resolvePatternedPath(\n typesDirInside,\n featurePatterns.types,\n patternData,\n 'index.ts',\n 'filePatterns.features.types'\n );\n const apiFilePath = resolvePatternedPath(\n apiDirInside,\n featurePatterns.api,\n patternData,\n 'index.ts',\n 'filePatterns.features.api'\n );\n const servicesFilePath = resolvePatternedPath(\n servicesDirInside,\n featurePatterns.services,\n patternData,\n 'index.ts',\n 'filePatterns.features.services'\n );\n const schemasFilePath = resolvePatternedPath(\n schemasDirInside,\n featurePatterns.schemas,\n patternData,\n 'index.ts',\n 'filePatterns.features.schemas'\n );\n const readmeFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.readme,\n patternData,\n 'README.md',\n 'filePatterns.features.readme'\n );\n const storiesFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.stories,\n patternData,\n `${featureComponentName}.stories.tsx`,\n 'filePatterns.features.stories'\n );\n\n const routeParts = normalizedRoute ? normalizedRoute.split('/').filter(Boolean) : [];\n const reorganizations = [];\n\n if (normalizedRoute && routeParts.length > 1 && config.routing.mode === 'flat') {\n const possibleExtensions = ['.astro', '.ts', '.js', '.md', '.mdx', '.html'];\n for (let i = 1; i < routeParts.length; i++) {\n const parentRoute = '/' + routeParts.slice(0, i).join('/');\n \n for (const ext of possibleExtensions) {\n const parentRouteFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'flat'\n });\n const parentRouteFilePath = secureJoin(pagesRoot, parentRouteFileName);\n \n if (existsSync(parentRouteFilePath)) {\n const indexFile = ext === '.astro' ? config.routing.indexFile : `index${ext}`;\n const newParentRouteFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'nested',\n indexFile: indexFile\n });\n const newParentRouteFilePath = secureJoin(pagesRoot, newParentRouteFileName);\n \n if (!existsSync(newParentRouteFilePath)) {\n reorganizations.push({\n from: parentRouteFilePath,\n to: newParentRouteFilePath,\n route: parentRoute\n });\n }\n }\n }\n }\n }\n\n if (options.dryRun) {\n console.log('Dry run - would create:');\n if (routeFilePath) console.log(` Route: ${routeFilePath}`);\n console.log(` Feature: ${featureFilePath}`);\n\n for (const reorg of reorganizations) {\n console.log(` Reorganize: ${reorg.from} -> ${reorg.to}`);\n }\n \n if (shouldCreateIndex) console.log(` Index: ${indexFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n if (shouldCreateScriptsDir) console.log(` Scripts: ${scriptsIndexPath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateHooks) console.log(` Hooks: ${hookFilePath}`);\n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n \n return;\n }\n\n if (reorganizations.length > 0) {\n const state = await loadState();\n for (const reorg of reorganizations) {\n await ensureDir(path.dirname(reorg.to));\n await rename(reorg.from, reorg.to);\n \n const oldRelative = path.relative(process.cwd(), reorg.from).replace(/\\\\/g, '/');\n const newRelative = path.relative(process.cwd(), reorg.to).replace(/\\\\/g, '/');\n \n if (state.files[oldRelative]) {\n state.files[newRelative] = { ...state.files[oldRelative] };\n delete state.files[oldRelative];\n }\n\n // Update imports in the moved file\n await updateImportsInFile(reorg.to, reorg.from, reorg.to);\n \n // Update hash in state after import updates\n if (state.files[newRelative]) {\n const content = await readFile(reorg.to, 'utf-8');\n state.files[newRelative].hash = calculateHash(content, config.hashing?.normalization);\n }\n \n console.log(`✓ Reorganized ${oldRelative} to ${newRelative}`);\n }\n await saveState(state);\n }\n\n if (routeFilePath) {\n if (existsSync(routeFilePath)) {\n const configSignatures = Object.values(config.signatures || {});\n const isGenerated = await isTextorGenerated(routeFilePath, configSignatures);\n if (!isGenerated && !options.force) {\n if (routeFilePath.endsWith('.astro')) {\n console.log(`⚠ File already exists and is not managed by Textor. Adopting and merging: ${routeFilePath}`);\n } else {\n throw new Error(`File already exists: ${routeFilePath}\\nUse --force to overwrite.`);\n }\n }\n }\n }\n\n await ensureNotExists(featureFilePath, options.force);\n \n if (shouldCreateIndex) await ensureNotExists(indexFilePath, options.force);\n if (shouldCreateContext) await ensureNotExists(contextFilePath, options.force);\n if (shouldCreateHooks) await ensureNotExists(hookFilePath, options.force);\n if (shouldCreateTests) await ensureNotExists(testFilePath, options.force);\n if (shouldCreateTypes) await ensureNotExists(typesFilePath, options.force);\n if (shouldCreateApi) await ensureNotExists(apiFilePath, options.force);\n if (shouldCreateServices) await ensureNotExists(servicesFilePath, options.force);\n if (shouldCreateSchemas) await ensureNotExists(schemasFilePath, options.force);\n if (shouldCreateReadme) await ensureNotExists(readmeFilePath, options.force);\n if (shouldCreateStories) await ensureNotExists(storiesFilePath, options.force);\n if (shouldCreateScriptsDir) await ensureNotExists(scriptsIndexPath, options.force);\n \n let layoutImportPath = null;\n const cliProps = options.prop || {};\n const rawLayoutProps = { ...configLayoutProps, ...cliProps };\n const layoutProps = {};\n \n // Resolve variables in layoutProps\n const substitutionData = enrichData({\n componentName: featureComponentName,\n layoutName: layout,\n featureComponentName: featureComponentName\n });\n\n for (const [key, value] of Object.entries(rawLayoutProps)) {\n if (typeof value === 'string') {\n let resolvedValue = value;\n for (const [varKey, varValue] of Object.entries(substitutionData)) {\n const regex = new RegExp(`{{${varKey}}}`, 'g');\n resolvedValue = resolvedValue.replace(regex, varValue);\n const underscoreRegex = new RegExp(`__${varKey}__`, 'g');\n resolvedValue = resolvedValue.replace(underscoreRegex, varValue);\n }\n layoutProps[key] = resolvedValue;\n } else {\n layoutProps[key] = value;\n }\n }\n\n if (routeFilePath && layout !== 'none') {\n if (config.importAliases.layouts) {\n layoutImportPath = `${config.importAliases.layouts}/${layout}.astro`;\n } else {\n const layoutFilePath = secureJoin(layoutsRoot, `${layout}.astro`);\n layoutImportPath = getRelativeImportPath(routeFilePath, layoutFilePath);\n }\n }\n\n let featureImportPath = null;\n if (routeFilePath) {\n if (config.importAliases.features) {\n const entryPart = effectiveOptions.entry === 'index' ? '/index' : `/${featureComponentName}`;\n // In Astro, we can often omit the extension for .tsx files, but not for .astro files if using aliases sometimes.\n // However, to be safe, we use the configured extension.\n featureImportPath = `${config.importAliases.features}/${normalizedFeaturePath}${entryPart}${config.naming.featureExtension}`;\n } else {\n const relativeFeatureFile = getRelativeImportPath(routeFilePath, featureFilePath);\n // Remove extension for import if it's not an .astro file\n if (config.naming.featureExtension === '.astro') {\n featureImportPath = relativeFeatureFile;\n } else {\n featureImportPath = relativeFeatureFile.replace(/\\.[^/.]+$/, '');\n }\n }\n }\n \n let scriptImportPath;\n if (shouldCreateScriptsDir) {\n scriptImportPath = getRelativeImportPath(featureFilePath, scriptsIndexPath);\n }\n\n let routeContent;\n let routeSignature;\n \n if (routeFilePath) {\n if (options.endpoint) {\n routeContent = generateEndpointTemplate(featureComponentName);\n routeSignature = getSignature(config, 'typescript');\n } else {\n routeSignature = getSignature(config, 'astro');\n \n if (existsSync(routeFilePath)) {\n const existingContent = await readFile(routeFilePath, 'utf-8');\n // Strip existing signature if present\n let contentToMerge = existingContent;\n if (existingContent.startsWith(routeSignature)) {\n contentToMerge = existingContent.slice(routeSignature.length).trimStart();\n } else {\n // Check for generic signature if specific one doesn't match\n const genericSignature = '@generated by Textor';\n if (existingContent.includes(genericSignature)) {\n const lines = existingContent.split('\\n');\n if (lines[0].includes(genericSignature)) {\n lines.shift();\n contentToMerge = lines.join('\\n').trimStart();\n }\n }\n }\n \n routeContent = mergeRouteTemplate(\n contentToMerge,\n featureImportPath,\n featureComponentName,\n layout\n );\n } else {\n routeContent = generateRouteTemplate(\n layout,\n layoutImportPath,\n featureImportPath,\n featureComponentName,\n routeExtension,\n layoutProps\n );\n }\n }\n }\n \n const featureContent = generateFeatureTemplate(featureComponentName, scriptImportPath, framework, config.naming.featureExtension);\n \n const writtenFiles = [];\n\n if (routeFilePath) {\n const routeHash = await writeFileWithSignature(\n routeFilePath,\n routeContent,\n routeSignature,\n config.hashing?.normalization\n );\n await registerFile(routeFilePath, { \n kind: 'route', \n template: options.endpoint ? 'endpoint' : 'route', \n hash: routeHash,\n owner: normalizedRoute \n });\n writtenFiles.push(routeFilePath);\n }\n\n await ensureDir(featureDirPath);\n \n if (shouldCreateSubComponentsDir) await ensureDir(subComponentsDir);\n if (shouldCreateApi) await ensureDir(apiDirInside);\n if (shouldCreateServices) await ensureDir(servicesDirInside);\n if (shouldCreateSchemas) await ensureDir(schemasDirInside);\n if (shouldCreateHooks) await ensureDir(hooksDirInside);\n if (shouldCreateContext) await ensureDir(contextDirInside);\n if (shouldCreateTests) await ensureDir(testsDir);\n if (shouldCreateTypes) await ensureDir(typesDirInside);\n\n const featureSignature = getSignature(config, config.naming.featureExtension === '.astro' ? 'astro' : 'tsx');\n\n const featureHash = await writeFileWithSignature(\n featureFilePath,\n featureContent,\n featureSignature,\n config.hashing?.normalization\n );\n await registerFile(featureFilePath, { \n kind: 'feature', \n template: 'feature', \n hash: featureHash,\n owner: normalizedRoute \n });\n writtenFiles.push(featureFilePath);\n\n if (shouldCreateScriptsDir) {\n const hash = await writeFileWithSignature(\n scriptsIndexPath,\n generateScriptsIndexTemplate(),\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(scriptsIndexPath, { \n kind: 'feature-file', \n template: 'scripts-index', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(scriptsIndexPath);\n }\n\n if (shouldCreateIndex) {\n const indexContent = generateIndexTemplate(featureComponentName, config.naming.featureExtension);\n const hash = await writeFileWithSignature(\n indexFilePath,\n indexContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(indexFilePath, { \n kind: 'feature-file', \n template: 'index', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(indexFilePath);\n }\n\n if (shouldCreateApi) {\n const apiContent = generateApiTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n apiFilePath, \n apiContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(apiFilePath, { \n kind: 'feature-file', \n template: 'api', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(apiFilePath);\n }\n\n if (shouldCreateServices) {\n const servicesContent = generateServiceTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n servicesFilePath, \n servicesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(servicesFilePath, { \n kind: 'feature-file', \n template: 'service', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(servicesFilePath);\n }\n\n if (shouldCreateSchemas) {\n const schemasContent = generateSchemaTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n schemasFilePath, \n schemasContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(schemasFilePath, { \n kind: 'feature-file', \n template: 'schema', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(schemasFilePath);\n }\n\n if (shouldCreateHooks) {\n const hookName = getHookFunctionName(featureComponentName);\n const hookContent = generateHookTemplate(featureComponentName, hookName);\n const hash = await writeFileWithSignature(\n hookFilePath, \n hookContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(hookFilePath, { \n kind: 'feature-file', \n template: 'hook', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(hookFilePath);\n }\n\n if (shouldCreateContext) {\n const contextContent = generateContextTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n contextFilePath, \n contextContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(contextFilePath, { \n kind: 'feature-file', \n template: 'context', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(contextFilePath);\n }\n\n if (shouldCreateTests) {\n const relativeFeaturePath = `./${path.basename(featureFilePath)}`;\n const testContent = generateTestTemplate(featureComponentName, relativeFeaturePath);\n const hash = await writeFileWithSignature(\n testFilePath, \n testContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(testFilePath, { \n kind: 'feature-file', \n template: 'test', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(testFilePath);\n }\n\n if (shouldCreateTypes) {\n const typesContent = generateTypesTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n typesFilePath, \n typesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(typesFilePath, { \n kind: 'feature-file', \n template: 'types', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(typesFilePath);\n }\n\n if (shouldCreateReadme) {\n const readmeContent = generateReadmeTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n readmeFilePath, \n readmeContent, \n getSignature(config, 'astro'),\n config.hashing?.normalization\n );\n await registerFile(readmeFilePath, { \n kind: 'feature-file', \n template: 'readme', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(readmeFilePath);\n }\n\n if (shouldCreateStories) {\n const relativePath = `./${path.basename(featureFilePath)}`;\n const storiesContent = generateStoriesTemplate(featureComponentName, relativePath);\n const hash = await writeFileWithSignature(\n storiesFilePath, \n storiesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(storiesFilePath, { \n kind: 'feature-file', \n template: 'stories', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(storiesFilePath);\n }\n \n // Formatting\n if (config.formatting.tool !== 'none') {\n await formatFiles(writtenFiles, config.formatting.tool);\n }\n\n console.log('✓ Section created successfully:');\n if (routeFilePath) console.log(` Route: ${routeFilePath}`);\n console.log(` Feature: ${featureFilePath}`);\n \n if (shouldCreateIndex) console.log(` Index: ${indexFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n if (shouldCreateScriptsDir) console.log(` Scripts: ${scriptsIndexPath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateHooks) console.log(` Hooks: ${hookFilePath}`);\n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n \n await addSectionToState({\n name: options.name || featureComponentName,\n route: normalizedRoute,\n featurePath: normalizedFeaturePath,\n layout: layout,\n extension: routeExtension\n });\n\n if (config.git?.stageChanges) {\n await stageFiles(writtenFiles);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n","import path from 'path';\nimport { rename, readFile, writeFile, readdir } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getRelativeImportPath\n} from '../utils/naming.js';\nimport { \n calculateHash,\n safeDelete, \n safeDeleteDir,\n cleanupEmptyDirs,\n secureJoin \n} from '../utils/filesystem.js';\nimport { loadState, findSection, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\n\nexport async function removeSectionCommand(route, featurePath, options) {\n try {\n const config = await loadConfig();\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n \n let section = findSection(state, route);\n if (!section && featurePath) {\n section = findSection(state, featurePath);\n }\n\n const targetRoute = section ? section.route : route;\n const targetFeaturePath = section ? section.featurePath : featurePath;\n\n if (!targetFeaturePath) {\n throw new Error(`Section not found for identifier: ${route}. Please provide both route and featurePath.`);\n }\n \n const normalizedRoute = normalizeRoute(targetRoute);\n const normalizedFeaturePath = featureToDirectoryPath(targetFeaturePath);\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const configSignatures = Object.values(config.signatures || {});\n\n // Find route file in state if possible\n let routeFilePath = null;\n const routeRelPath = Object.keys(state.files).find(f => {\n const data = state.files[f];\n return data.kind === 'route' && data.owner === normalizedRoute;\n });\n\n if (routeRelPath) {\n routeFilePath = path.resolve(process.cwd(), routeRelPath);\n } else {\n const routeExtension = (section && section.extension) || config.naming.routeExtension;\n const routeFileName = routeToFilePath(normalizedRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n routeFilePath = secureJoin(pagesRoot, routeFileName);\n }\n \n const featureDirPath = secureJoin(featuresRoot, normalizedFeaturePath);\n \n const deletedFiles = [];\n const skippedFiles = [];\n const deletedDirs = [];\n \n if (options.dryRun) {\n console.log('Dry run - would delete:');\n \n if (!options.keepRoute) {\n console.log(` Route: ${routeFilePath}`);\n }\n \n if (!options.keepFeature) {\n console.log(` Feature: ${featureDirPath}/`);\n }\n \n return;\n }\n \n if (!options.keepRoute) {\n const normalizedPath = path.relative(process.cwd(), routeFilePath).replace(/\\\\/g, '/');\n const fileState = state.files[normalizedPath];\n const result = await safeDelete(routeFilePath, {\n force: options.force,\n expectedHash: fileState?.hash,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: normalizedRoute,\n actualOwner: fileState?.owner,\n signatures: configSignatures\n });\n \n if (result.deleted) {\n deletedFiles.push(routeFilePath);\n delete state.files[normalizedPath];\n } else if (result.message) {\n skippedFiles.push({ path: routeFilePath, reason: result.message });\n }\n }\n \n if (!options.keepFeature) {\n const result = await safeDeleteDir(featureDirPath, {\n force: options.force,\n stateFiles: state.files,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: normalizedRoute,\n signatures: configSignatures\n });\n \n if (result.deleted) {\n deletedDirs.push(featureDirPath);\n // Unregister all files that were in this directory\n const dirPrefix = path.relative(process.cwd(), featureDirPath).replace(/\\\\/g, '/') + '/';\n for (const f in state.files) {\n if (f.startsWith(dirPrefix)) {\n delete state.files[f];\n }\n }\n } else if (result.message) {\n skippedFiles.push({ path: featureDirPath, reason: result.message });\n }\n }\n \n if (!options.keepRoute && deletedFiles.includes(routeFilePath)) {\n await cleanupEmptyDirs(path.dirname(routeFilePath), pagesRoot);\n }\n \n if (!options.keepFeature && deletedDirs.includes(featureDirPath)) {\n await cleanupEmptyDirs(path.dirname(featureDirPath), featuresRoot);\n }\n \n if (deletedFiles.length > 0 || deletedDirs.length > 0) {\n console.log('✓ Deleted:');\n deletedFiles.forEach(file => console.log(` ${file}`));\n deletedDirs.forEach(dir => console.log(` ${dir}/`));\n }\n \n if (skippedFiles.length > 0) {\n console.log('\\n⚠ Skipped:');\n skippedFiles.forEach(item => {\n console.log(` ${item.path}`);\n console.log(` Reason: ${item.reason}`);\n });\n }\n \n if (deletedFiles.length === 0 && deletedDirs.length === 0 && skippedFiles.length === 0) {\n if (section) {\n console.log(`✓ Section ${normalizedRoute} removed from state (files were already missing on disk).`);\n state.sections = state.sections.filter(s => s.route !== normalizedRoute);\n await saveState(state);\n } else {\n console.log('No files to delete.');\n }\n } else {\n // Reorganization (Flattening)\n if (!options.keepRoute && deletedFiles.length > 0 && config.routing.mode === 'flat') {\n const routeParts = normalizedRoute.split('/').filter(Boolean);\n if (routeParts.length > 1) {\n for (let i = routeParts.length - 1; i >= 1; i--) {\n const parentRoute = '/' + routeParts.slice(0, i).join('/');\n const parentDirName = routeParts.slice(0, i).join('/');\n const parentDirPath = secureJoin(pagesRoot, parentDirName);\n \n if (existsSync(parentDirPath)) {\n const filesInDir = await readdir(parentDirPath);\n \n if (filesInDir.length === 1) {\n const loneFile = filesInDir[0];\n const ext = path.extname(loneFile);\n const indexFile = ext === '.astro' ? config.routing.indexFile : `index${ext}`;\n \n if (loneFile === indexFile) {\n const loneFilePath = path.join(parentDirPath, loneFile);\n const oldRelative = path.relative(process.cwd(), loneFilePath).replace(/\\\\/g, '/');\n\n if (state.files[oldRelative] && state.files[oldRelative].kind === 'route') {\n const flatFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'flat'\n });\n const flatFilePath = secureJoin(pagesRoot, flatFileName);\n \n if (!existsSync(flatFilePath)) {\n await rename(loneFilePath, flatFilePath);\n \n const newRelative = path.relative(process.cwd(), flatFilePath).replace(/\\\\/g, '/');\n \n state.files[newRelative] = { ...state.files[oldRelative] };\n delete state.files[oldRelative];\n \n await updateImportsInFile(flatFilePath, loneFilePath, flatFilePath);\n\n // Update hash in state after import updates\n const content = await readFile(flatFilePath, 'utf-8');\n state.files[newRelative].hash = calculateHash(content, config.hashing?.normalization);\n\n console.log(`✓ Reorganized ${oldRelative} to ${newRelative} (flattened)`);\n await cleanupEmptyDirs(parentDirPath, pagesRoot);\n }\n }\n }\n }\n }\n }\n }\n }\n\n state.sections = state.sections.filter(s => s.route !== normalizedRoute);\n await saveState(state);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n","import path from 'path';\nimport { readdir, stat, rmdir, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { safeMove, ensureDir, scanDirectory, calculateHash } from './filesystem.js';\nimport { getRelativeImportPath } from './naming.js';\nimport { resolvePath } from './config.js';\n\n/**\n * Updates relative imports in a file after it has been moved.\n */\nexport async function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n\n/**\n * Moves a directory and its contents, renaming files and updating internal content/imports.\n */\nexport async function moveDirectory(fromPath, toPath, state, config, options = {}) {\n const { fromName, toName, owner = null, signatures = [] } = options;\n \n if (!existsSync(fromPath)) {\n throw new Error(`Source directory not found: ${fromPath}`);\n }\n \n if (existsSync(toPath) && !options.force) {\n throw new Error(\n `Destination already exists: ${toPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n \n await ensureDir(toPath);\n \n const entries = await readdir(fromPath);\n \n for (const entry of entries) {\n let targetEntry = entry;\n \n // Rename files if they match the component name\n if (fromName && toName && fromName !== toName) {\n if (entry.includes(fromName)) {\n targetEntry = entry.replace(fromName, toName);\n }\n }\n \n const fromEntryPath = path.join(fromPath, entry);\n const toEntryPath = path.join(toPath, targetEntry);\n \n const stats = await stat(fromEntryPath);\n \n if (stats.isDirectory()) {\n await moveDirectory(fromEntryPath, toEntryPath, state, config, options);\n } else {\n const normalizedFromRelative = path.relative(process.cwd(), fromEntryPath).replace(/\\\\/g, '/');\n const fileState = state.files[normalizedFromRelative];\n \n const newHash = await safeMove(fromEntryPath, toEntryPath, {\n force: options.force,\n expectedHash: fileState?.hash,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner,\n actualOwner: fileState?.owner,\n signatures\n });\n \n // Update internal content (signatures, component names) if renaming\n if (fromName && toName && fromName !== toName) {\n let content = await readFile(toEntryPath, 'utf-8');\n let hasChanged = false;\n \n // Simple replacement of component names\n if (content.includes(fromName)) {\n content = content.replace(new RegExp(fromName, 'g'), toName);\n hasChanged = true;\n }\n \n // Also handle lowercase class names if any\n const fromLower = fromName.toLowerCase();\n const toLower = toName.toLowerCase();\n if (content.includes(fromLower)) {\n content = content.replace(new RegExp(fromLower, 'g'), toLower);\n hasChanged = true;\n }\n\n if (hasChanged) {\n await writeFile(toEntryPath, content, 'utf-8');\n // Re-calculate hash after content update\n const updatedHash = calculateHash(content, config.hashing?.normalization);\n \n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: updatedHash };\n delete state.files[normalizedFromRelative];\n }\n } else {\n // Update state for each file moved normally\n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: newHash };\n delete state.files[normalizedFromRelative];\n }\n }\n } else {\n // Update state for each file moved normally\n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: newHash };\n delete state.files[normalizedFromRelative];\n }\n }\n }\n }\n \n const remainingFiles = await readdir(fromPath);\n if (remainingFiles.length === 0) {\n await rmdir(fromPath);\n }\n}\n\n/**\n * Scans the project and replaces imports of a moved/renamed item.\n */\nexport async function scanAndReplaceImports(config, state, fromInfo, toInfo, options) {\n const { fromPath: fromItemPath, fromName, type } = fromInfo;\n const { toPath: toItemPath, toName } = toInfo;\n \n const allFiles = new Set();\n await scanDirectory(process.cwd(), allFiles);\n \n const rootPath = resolvePath(config, type === 'component' ? 'components' : 'features');\n \n for (const relPath of allFiles) {\n const fullPath = path.resolve(process.cwd(), relPath);\n \n // Skip the moved directory itself\n const toFullPath = path.resolve(toItemPath);\n if (fullPath.startsWith(toFullPath)) continue;\n\n let content = await readFile(fullPath, 'utf-8');\n let changed = false;\n\n const aliasBase = config.importAliases[type === 'component' ? 'components' : 'features'];\n const ext = type === 'component' ? '' : (config.naming.featureExtension === '.astro' ? '.astro' : '');\n\n if (aliasBase) {\n const oldAlias = `${aliasBase}/${fromItemPath}`;\n const newAlias = `${aliasBase}/${toItemPath}`;\n \n const oldFullImport = `from '${oldAlias}/${fromName}${ext}'`;\n const newFullImport = `from '${newAlias}/${toName}${ext}'`;\n \n if (content.includes(oldFullImport)) {\n content = content.replace(new RegExp(oldFullImport.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newFullImport);\n changed = true;\n } else if (content.includes(oldAlias)) {\n content = content.replace(new RegExp(oldAlias.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newAlias);\n changed = true;\n }\n } else {\n const oldDir = path.resolve(rootPath, fromItemPath);\n const newDir = path.resolve(rootPath, toItemPath);\n \n const oldRelPath = getRelativeImportPath(fullPath, oldDir);\n const newRelPath = getRelativeImportPath(fullPath, newDir);\n \n const oldImport = `'${oldRelPath}/${fromName}${ext}'`;\n const newImport = `'${newRelPath}/${toName}${ext}'`;\n \n if (content.includes(oldImport)) {\n content = content.replace(new RegExp(oldImport.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newImport);\n changed = true;\n }\n }\n\n if (fromName !== toName && changed) {\n content = content.replace(new RegExp(`\\\\b${fromName}\\\\b`, 'g'), toName);\n }\n\n if (changed) {\n if (options.dryRun) {\n console.log(` [Scan] Would update imports in ${relPath}`);\n } else {\n await writeFile(fullPath, content, 'utf-8');\n console.log(` [Scan] Updated imports in ${relPath}`);\n \n if (state.files[relPath]) {\n state.files[relPath].hash = calculateHash(content, config.hashing?.normalization);\n }\n }\n }\n }\n}\n","import path from 'path';\nimport { readdir, stat, rmdir, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getFeatureComponentName,\n getRelativeImportPath \n} from '../utils/naming.js';\nimport { \n calculateHash,\n safeMove,\n ensureDir,\n updateSignature,\n cleanupEmptyDirs,\n secureJoin,\n scanDirectory\n} from '../utils/filesystem.js';\nimport { loadState, findSection, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\nimport { \n updateImportsInFile,\n moveDirectory,\n scanAndReplaceImports\n} from '../utils/refactor.js';\n\n/**\n * Move a section (route + feature).\n * \n * SCOPE GUARANTEES:\n * - Automatically updates imports in the moved route file.\n * - Automatically updates internal imports/references within the moved feature directory.\n * - Repo-wide scan for import updates is available via the --scan flag.\n * \n * NON-GOALS (What it won't rewrite):\n * - String literals (unless they match the component name exactly in a JSX context).\n * - Markdown documentation (except for those registered in state).\n * - Dynamic imports with complex template literals.\n */\nexport async function moveSectionCommand(fromRoute, fromFeature, toRoute, toFeature, options) {\n try {\n const config = await loadConfig();\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n\n let actualFromRoute = fromRoute;\n let actualFromFeature = fromFeature;\n let actualToRoute = toRoute;\n let actualToFeature = toFeature;\n\n // Shift arguments if using state or if called with fewer arguments\n if (!toRoute && fromRoute && fromFeature) {\n // textor move-section /old-route /new-route\n actualFromRoute = fromRoute;\n actualToRoute = fromFeature;\n actualFromFeature = undefined;\n actualToFeature = undefined;\n }\n\n // Lookup missing info from state\n if (actualFromRoute && !actualFromFeature) {\n const section = findSection(state, actualFromRoute);\n if (section) {\n actualFromFeature = section.featurePath;\n }\n } else if (!actualFromRoute && actualFromFeature) {\n const section = findSection(state, actualFromFeature);\n if (section) {\n actualFromRoute = section.route;\n }\n }\n\n // If toFeature is not provided, try to derive it from the new route if route moved\n if (!actualToFeature && actualToRoute && actualFromRoute && actualFromRoute !== actualToRoute && actualFromFeature) {\n const oldRouteParts = actualFromRoute.split('/').filter(Boolean);\n const newRouteParts = actualToRoute.split('/').filter(Boolean);\n const oldFeatureParts = actualFromFeature.split('/').filter(Boolean);\n \n let match = true;\n for (let i = 0; i < oldRouteParts.length; i++) {\n const routePart = oldRouteParts[i].toLowerCase();\n const featurePart = oldFeatureParts[i] ? oldFeatureParts[i].toLowerCase() : null;\n \n if (featurePart !== routePart) {\n match = false;\n break;\n }\n }\n \n if (match && oldRouteParts.length > 0) {\n actualToFeature = [...newRouteParts, ...oldFeatureParts.slice(oldRouteParts.length)].join('/');\n } else {\n actualToFeature = actualFromFeature;\n }\n } else if (!actualToFeature) {\n actualToFeature = actualFromFeature;\n }\n\n if (!actualToRoute) {\n actualToRoute = actualFromRoute;\n }\n\n \n const isRouteOnly = options.keepFeature || (!actualToFeature && actualToRoute && !actualFromFeature);\n \n if (isRouteOnly && !actualToRoute) {\n throw new Error('Destination route required for route-only move');\n }\n \n const normalizedFromRoute = normalizeRoute(actualFromRoute);\n const normalizedToRoute = normalizeRoute(actualToRoute);\n const normalizedFromFeature = actualFromFeature ? featureToDirectoryPath(actualFromFeature) : null;\n const normalizedToFeature = actualToFeature ? featureToDirectoryPath(actualToFeature) : null;\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const configSignatures = Object.values(config.signatures || {});\n \n const fromSection = findSection(state, actualFromRoute);\n const routeExtension = (fromSection && fromSection.extension) || config.naming.routeExtension;\n \n const fromRouteFile = routeToFilePath(normalizedFromRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n const toRouteFile = routeToFilePath(normalizedToRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n \n const fromRoutePath = fromRouteFile ? secureJoin(pagesRoot, fromRouteFile) : null;\n const toRoutePath = toRouteFile ? secureJoin(pagesRoot, toRouteFile) : null;\n \n const movedFiles = [];\n \n if (options.dryRun) {\n console.log('Dry run - would move:');\n if (fromRoutePath && toRoutePath && fromRoutePath !== toRoutePath) {\n console.log(` Route: ${fromRoutePath} -> ${toRoutePath}`);\n }\n \n if (!isRouteOnly && normalizedFromFeature && normalizedToFeature) {\n const fromFeaturePath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeaturePath = secureJoin(featuresRoot, normalizedToFeature);\n console.log(` Feature: ${fromFeaturePath} -> ${toFeaturePath}`);\n }\n \n return;\n }\n \n let normalizedToRouteRelative = null;\n if (fromRoutePath && toRoutePath) {\n const normalizedFromRouteRelative = path.relative(process.cwd(), fromRoutePath).replace(/\\\\/g, '/');\n const routeFileState = state.files[normalizedFromRouteRelative];\n\n const newRouteHash = await safeMove(fromRoutePath, toRoutePath, {\n force: options.force,\n expectedHash: routeFileState?.hash,\n acceptChanges: options.acceptChanges,\n owner: normalizedFromRoute,\n actualOwner: routeFileState?.owner,\n signatures: configSignatures\n });\n \n if (fromRoutePath !== toRoutePath) {\n movedFiles.push({ from: fromRoutePath, to: toRoutePath });\n }\n \n // Update state for moved route file\n normalizedToRouteRelative = path.relative(process.cwd(), toRoutePath).replace(/\\\\/g, '/');\n if (routeFileState) {\n state.files[normalizedToRouteRelative] = { ...routeFileState, hash: newRouteHash };\n if (fromRoutePath !== toRoutePath) {\n delete state.files[normalizedFromRouteRelative];\n }\n }\n \n // Update imports in the route file (even if it didn't move, as feature might have)\n const targetFeature = normalizedToFeature || normalizedFromFeature;\n if (targetFeature && existsSync(toRoutePath)) {\n const fromFeatureDirPath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeatureDirPath = secureJoin(featuresRoot, targetFeature);\n const fromFeatureComponentName = getFeatureComponentName(normalizedFromFeature);\n const toFeatureComponentName = getFeatureComponentName(targetFeature);\n\n // First, update all relative imports in the file because it moved (or stayed)\n await updateImportsInFile(toRoutePath, fromRoutePath, toRoutePath);\n\n let content = await readFile(toRoutePath, 'utf-8');\n let changed = false;\n\n // Update component name in JSX tags\n if (fromFeatureComponentName !== toFeatureComponentName) {\n content = content.replace(\n new RegExp(`<${fromFeatureComponentName}`, 'g'),\n `<${toFeatureComponentName}`\n );\n content = content.replace(\n new RegExp(`</${fromFeatureComponentName}`, 'g'),\n `</${toFeatureComponentName}`\n );\n changed = true;\n }\n\n if (config.importAliases.features) {\n const oldAliasPath = `${config.importAliases.features}/${normalizedFromFeature}`;\n const newAliasPath = `${config.importAliases.features}/${targetFeature}`;\n \n // Flexible regex to match import identifier and path with alias\n const importRegex = new RegExp(`(import\\\\s+)(${fromFeatureComponentName})(\\\\s+from\\\\s+['\"])${oldAliasPath}(/[^'\"]+)?(['\"])`, 'g');\n \n if (importRegex.test(content)) {\n content = content.replace(importRegex, (match, p1, p2, p3, subPath, p5) => {\n let newSubPath = subPath || '';\n if (subPath && subPath.includes(fromFeatureComponentName)) {\n newSubPath = subPath.replace(fromFeatureComponentName, toFeatureComponentName);\n }\n return `${p1}${toFeatureComponentName}${p3}${newAliasPath}${newSubPath}${p5}`;\n });\n changed = true;\n } else if (content.includes(oldAliasPath)) {\n // Fallback for path only replacement\n content = content.replace(new RegExp(oldAliasPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newAliasPath);\n changed = true;\n }\n } else {\n const oldRelativeDir = getRelativeImportPath(toRoutePath, fromFeatureDirPath);\n const newRelativeDir = getRelativeImportPath(toRoutePath, toFeatureDirPath);\n \n // Flexible regex for relative imports\n const relImportRegex = new RegExp(`(import\\\\s+)(${fromFeatureComponentName})(\\\\s+from\\\\s+['\"])${oldRelativeDir}(/[^'\"]+)?(['\"])`, 'g');\n \n if (relImportRegex.test(content)) {\n content = content.replace(relImportRegex, (match, p1, p2, p3, subPath, p5) => {\n let newSubPath = subPath || '';\n if (subPath && subPath.includes(fromFeatureComponentName)) {\n newSubPath = subPath.replace(fromFeatureComponentName, toFeatureComponentName);\n }\n return `${p1}${toFeatureComponentName}${p3}${newRelativeDir}${newSubPath}${p5}`;\n });\n changed = true;\n }\n }\n\n if (changed) {\n await writeFile(toRoutePath, content, 'utf-8');\n // Update hash in state after changes\n if (state.files[normalizedToRouteRelative]) {\n state.files[normalizedToRouteRelative].hash = calculateHash(content, config.hashing?.normalization);\n }\n }\n }\n }\n \n if (!isRouteOnly && normalizedFromFeature && normalizedToFeature && normalizedFromFeature !== normalizedToFeature) {\n const fromFeaturePath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeaturePath = secureJoin(featuresRoot, normalizedToFeature);\n \n const fromFeatureComponentName = getFeatureComponentName(normalizedFromFeature);\n const toFeatureComponentName = getFeatureComponentName(normalizedToFeature);\n \n if (existsSync(fromFeaturePath)) {\n await moveDirectory(fromFeaturePath, toFeaturePath, state, config, {\n ...options,\n fromName: fromFeatureComponentName,\n toName: toFeatureComponentName,\n owner: normalizedFromRoute,\n signatures: configSignatures\n });\n movedFiles.push({ from: fromFeaturePath, to: toFeaturePath });\n \n await cleanupEmptyDirs(path.dirname(fromFeaturePath), featuresRoot);\n }\n }\n\n if (options.scan && (normalizedFromFeature || normalizedToFeature)) {\n await scanAndReplaceImports(config, state, {\n fromPath: normalizedFromFeature,\n fromName: getFeatureComponentName(normalizedFromFeature),\n type: 'feature'\n }, {\n toPath: normalizedToFeature || normalizedFromFeature,\n toName: getFeatureComponentName(normalizedToFeature || normalizedFromFeature)\n }, options);\n }\n \n if (fromRoutePath && toRoutePath && fromRoutePath !== toRoutePath) {\n await cleanupEmptyDirs(path.dirname(fromRoutePath), pagesRoot);\n }\n \n console.log('✓ Moved:');\n movedFiles.forEach(item => {\n console.log(` ${item.from}`);\n console.log(` -> ${item.to}`);\n });\n\n if (movedFiles.length > 0) {\n const existingSection = fromSection;\n \n // Update ownership in state if route moved\n if (normalizedFromRoute && normalizedToRoute && normalizedFromRoute !== normalizedToRoute) {\n for (const f in state.files) {\n if (state.files[f].owner === normalizedFromRoute) {\n state.files[f].owner = normalizedToRoute;\n }\n }\n }\n\n // Update section data in state\n state.sections = state.sections.filter(s => s.route !== normalizedFromRoute);\n state.sections.push({\n name: existingSection ? existingSection.name : getFeatureComponentName(normalizedToFeature || normalizedFromFeature),\n route: normalizedToRoute,\n featurePath: normalizedToFeature || normalizedFromFeature,\n layout: existingSection ? existingSection.layout : 'Main',\n extension: routeExtension\n });\n \n await saveState(state);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\n\n\n","import path from 'path';\nimport { loadConfig, resolvePath, getEffectiveOptions } from '../utils/config.js';\nimport { \n normalizeComponentName,\n getHookFileName,\n getHookFunctionName \n} from '../utils/naming.js';\nimport { \n ensureNotExists, \n writeFileWithSignature,\n getSignature,\n ensureDir,\n secureJoin,\n formatFiles \n} from '../utils/filesystem.js';\nimport { resolvePatternedPath } from '../utils/patterns.js';\nimport {\n generateComponentTemplate,\n generateHookTemplate,\n generateContextTemplate,\n generateTestTemplate,\n generateConfigTemplate,\n generateConstantsTemplate,\n generateIndexTemplate,\n generateTypesTemplate,\n generateApiTemplate,\n generateServiceTemplate,\n generateSchemaTemplate,\n generateReadmeTemplate,\n generateStoriesTemplate\n} from '../utils/templates.js';\nimport { addComponentToState, registerFile } from '../utils/state.js';\nimport { stageFiles } from '../utils/git.js';\n\nexport async function createComponentCommand(componentName, options) {\n try {\n const config = await loadConfig();\n const effectiveOptions = getEffectiveOptions(options, config, 'components');\n \n const normalizedName = normalizeComponentName(componentName);\n \n const componentsRoot = resolvePath(config, 'components');\n \n const componentDir = secureJoin(componentsRoot, normalizedName);\n const subComponentsDir = secureJoin(componentDir, 'sub-components');\n const testsDir = secureJoin(componentDir, '__tests__');\n const configDirInside = secureJoin(componentDir, 'config');\n const constantsDirInside = secureJoin(componentDir, 'constants');\n const contextDirInside = secureJoin(componentDir, 'context');\n const hooksDirInside = secureJoin(componentDir, 'hooks');\n const typesDirInside = secureJoin(componentDir, 'types');\n const apiDirInside = secureJoin(componentDir, 'api');\n const servicesDirInside = secureJoin(componentDir, 'services');\n const schemasDirInside = secureJoin(componentDir, 'schemas');\n \n const {\n framework,\n createContext: shouldCreateContext,\n createHook: shouldCreateHook,\n createTests: shouldCreateTests,\n createConfig: shouldCreateConfig,\n createConstants: shouldCreateConstants,\n createTypes: shouldCreateTypes,\n createSubComponentsDir: shouldCreateSubComponentsDir,\n createApi: shouldCreateApi,\n createServices: shouldCreateServices,\n createSchemas: shouldCreateSchemas,\n createReadme: shouldCreateReadme,\n createStories: shouldCreateStories\n } = effectiveOptions;\n\n const componentPatterns = config.filePatterns?.components || {};\n const patternData = {\n componentName: normalizedName,\n hookName: getHookFunctionName(normalizedName),\n hookExtension: config.naming.hookExtension,\n testExtension: config.naming.testExtension,\n componentExtension: config.naming.componentExtension,\n featureExtension: config.naming.featureExtension\n };\n \n const componentFilePath = path.join(componentDir, `${normalizedName}${config.naming.componentExtension}`);\n const indexFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.index,\n patternData,\n 'index.ts',\n 'filePatterns.components.index'\n );\n const contextFilePath = resolvePatternedPath(\n contextDirInside,\n componentPatterns.context,\n patternData,\n `${normalizedName}Context.tsx`,\n 'filePatterns.components.context'\n );\n const hookFilePath = resolvePatternedPath(\n hooksDirInside,\n componentPatterns.hook,\n patternData,\n getHookFileName(normalizedName, config.naming.hookExtension),\n 'filePatterns.components.hook'\n );\n const testFilePath = resolvePatternedPath(\n testsDir,\n componentPatterns.test,\n patternData,\n `${normalizedName}${config.naming.testExtension}`,\n 'filePatterns.components.test'\n );\n const configFilePath = resolvePatternedPath(\n configDirInside,\n componentPatterns.config,\n patternData,\n 'index.ts',\n 'filePatterns.components.config'\n );\n const constantsFilePath = resolvePatternedPath(\n constantsDirInside,\n componentPatterns.constants,\n patternData,\n 'index.ts',\n 'filePatterns.components.constants'\n );\n const typesFilePath = resolvePatternedPath(\n typesDirInside,\n componentPatterns.types,\n patternData,\n 'index.ts',\n 'filePatterns.components.types'\n );\n const apiFilePath = resolvePatternedPath(\n apiDirInside,\n componentPatterns.api,\n patternData,\n 'index.ts',\n 'filePatterns.components.api'\n );\n const servicesFilePath = resolvePatternedPath(\n servicesDirInside,\n componentPatterns.services,\n patternData,\n 'index.ts',\n 'filePatterns.components.services'\n );\n const schemasFilePath = resolvePatternedPath(\n schemasDirInside,\n componentPatterns.schemas,\n patternData,\n 'index.ts',\n 'filePatterns.components.schemas'\n );\n const readmeFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.readme,\n patternData,\n 'README.md',\n 'filePatterns.components.readme'\n );\n const storiesFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.stories,\n patternData,\n `${normalizedName}.stories.tsx`,\n 'filePatterns.components.stories'\n );\n \n if (options.dryRun) {\n console.log('Dry run - would create:');\n console.log(` Component: ${componentFilePath}`);\n console.log(` Index: ${indexFilePath}`);\n \n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateHook) console.log(` Hook: ${hookFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateConfig) console.log(` Config: ${configFilePath}`);\n if (shouldCreateConstants) console.log(` Constants: ${constantsFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n \n return;\n }\n \n await ensureNotExists(componentFilePath, options.force);\n await ensureNotExists(indexFilePath, options.force);\n \n if (shouldCreateContext) await ensureNotExists(contextFilePath, options.force);\n if (shouldCreateHook) await ensureNotExists(hookFilePath, options.force);\n if (shouldCreateTests) await ensureNotExists(testFilePath, options.force);\n if (shouldCreateConfig) await ensureNotExists(configFilePath, options.force);\n if (shouldCreateConstants) await ensureNotExists(constantsFilePath, options.force);\n if (shouldCreateTypes) await ensureNotExists(typesFilePath, options.force);\n if (shouldCreateApi) await ensureNotExists(apiFilePath, options.force);\n if (shouldCreateServices) await ensureNotExists(servicesFilePath, options.force);\n if (shouldCreateSchemas) await ensureNotExists(schemasFilePath, options.force);\n if (shouldCreateReadme) await ensureNotExists(readmeFilePath, options.force);\n if (shouldCreateStories) await ensureNotExists(storiesFilePath, options.force);\n \n await ensureDir(componentDir);\n \n if (shouldCreateSubComponentsDir) await ensureDir(subComponentsDir);\n if (shouldCreateContext) await ensureDir(contextDirInside);\n if (shouldCreateHook) await ensureDir(hooksDirInside);\n if (shouldCreateTests) await ensureDir(testsDir);\n if (shouldCreateConfig) await ensureDir(configDirInside);\n if (shouldCreateConstants) await ensureDir(constantsDirInside);\n if (shouldCreateTypes) await ensureDir(typesDirInside);\n if (shouldCreateApi) await ensureDir(apiDirInside);\n if (shouldCreateServices) await ensureDir(servicesDirInside);\n if (shouldCreateSchemas) await ensureDir(schemasDirInside);\n \n const componentContent = generateComponentTemplate(normalizedName, framework, config.naming.componentExtension);\n const signature = getSignature(config, config.naming.componentExtension === '.astro' ? 'astro' : 'tsx');\n\n const componentHash = await writeFileWithSignature(\n componentFilePath,\n componentContent,\n signature,\n config.hashing?.normalization\n );\n await registerFile(componentFilePath, { \n kind: 'component', \n template: 'component', \n hash: componentHash,\n owner: normalizedName \n });\n \n const writtenFiles = [componentFilePath];\n\n const indexContent = generateIndexTemplate(normalizedName, config.naming.componentExtension);\n const indexHash = await writeFileWithSignature(\n indexFilePath,\n indexContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(indexFilePath, { \n kind: 'component-file', \n template: 'index', \n hash: indexHash,\n owner: normalizedName \n });\n writtenFiles.push(indexFilePath);\n \n if (shouldCreateTypes) {\n const typesContent = generateTypesTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n typesFilePath,\n typesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(typesFilePath, { \n kind: 'component-file', \n template: 'types', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(typesFilePath);\n }\n \n if (shouldCreateContext) {\n const contextContent = generateContextTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n contextFilePath,\n contextContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(contextFilePath, { \n kind: 'component-file', \n template: 'context', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(contextFilePath);\n }\n \n if (shouldCreateHook) {\n const hookName = getHookFunctionName(normalizedName);\n const hookContent = generateHookTemplate(normalizedName, hookName);\n const hash = await writeFileWithSignature(\n hookFilePath,\n hookContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(hookFilePath, { \n kind: 'component-file', \n template: 'hook', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(hookFilePath);\n }\n \n if (shouldCreateTests) {\n const relativeComponentPath = `../${normalizedName}${config.naming.componentExtension}`;\n const testContent = generateTestTemplate(normalizedName, relativeComponentPath);\n const hash = await writeFileWithSignature(\n testFilePath,\n testContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(testFilePath, { \n kind: 'component-file', \n template: 'test', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(testFilePath);\n }\n \n if (shouldCreateConfig) {\n const configContent = generateConfigTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n configFilePath,\n configContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(configFilePath, { \n kind: 'component-file', \n template: 'config', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(configFilePath);\n }\n \n if (shouldCreateConstants) {\n const constantsContent = generateConstantsTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n constantsFilePath,\n constantsContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(constantsFilePath, { \n kind: 'component-file', \n template: 'constants', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(constantsFilePath);\n }\n\n if (shouldCreateApi) {\n const apiContent = generateApiTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n apiFilePath,\n apiContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(apiFilePath, { \n kind: 'component-file', \n template: 'api', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(apiFilePath);\n }\n\n if (shouldCreateServices) {\n const servicesContent = generateServiceTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n servicesFilePath,\n servicesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(servicesFilePath, { \n kind: 'component-file', \n template: 'service', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(servicesFilePath);\n }\n\n if (shouldCreateSchemas) {\n const schemasContent = generateSchemaTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n schemasFilePath,\n schemasContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(schemasFilePath, { \n kind: 'component-file', \n template: 'schema', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(schemasFilePath);\n }\n\n if (shouldCreateReadme) {\n const readmeContent = generateReadmeTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n readmeFilePath,\n readmeContent,\n getSignature(config, 'astro'),\n config.hashing?.normalization\n );\n await registerFile(readmeFilePath, { \n kind: 'component-file', \n template: 'readme', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(readmeFilePath);\n }\n\n if (shouldCreateStories) {\n const relativePath = `./${normalizedName}${config.naming.componentExtension}`;\n const storiesContent = generateStoriesTemplate(normalizedName, relativePath);\n const hash = await writeFileWithSignature(\n storiesFilePath,\n storiesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(storiesFilePath, { \n kind: 'component-file', \n template: 'stories', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(storiesFilePath);\n }\n \n // Formatting\n if (config.formatting.tool !== 'none') {\n await formatFiles(writtenFiles, config.formatting.tool);\n }\n \n console.log('✓ Component created successfully:');\n console.log(` Component: ${componentFilePath}`);\n console.log(` Index: ${indexFilePath}`);\n \n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateHook) console.log(` Hook: ${hookFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateConfig) console.log(` Config: ${configFilePath}`);\n if (shouldCreateConstants) console.log(` Constants: ${constantsFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n \n await addComponentToState({\n name: normalizedName,\n path: componentDir\n });\n\n if (config.git?.stageChanges) {\n await stageFiles(writtenFiles);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import { loadConfig } from '../utils/config.js';\nimport { \n safeDeleteDir,\n cleanupEmptyDirs,\n secureJoin \n} from '../utils/filesystem.js';\nimport { loadState, findComponent, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\nimport path from 'path';\n\nexport async function removeComponentCommand(identifier, options) {\n try {\n const config = await loadConfig();\n const configSignatures = Object.values(config.signatures || {});\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n \n const component = findComponent(state, identifier);\n let componentDir;\n\n if (component) {\n componentDir = path.resolve(process.cwd(), component.path);\n } else {\n // Fallback: try to guess path if not in state\n const componentsRoot = path.resolve(process.cwd(), config.paths.components);\n componentDir = secureJoin(componentsRoot, identifier);\n }\n \n if (options.dryRun) {\n console.log('Dry run - would delete:');\n console.log(` Component directory: ${componentDir}/`);\n return;\n }\n \n const result = await safeDeleteDir(componentDir, {\n force: options.force,\n stateFiles: state.files,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: identifier,\n signatures: configSignatures\n });\n \n if (result.deleted || (result.reason === 'not-found' && component)) {\n if (result.deleted) {\n console.log(`✓ Deleted component: ${componentDir}/`);\n await cleanupEmptyDirs(path.dirname(componentDir), path.join(process.cwd(), config.paths.components));\n } else {\n console.log(`✓ Component ${identifier} removed from state (directory was already missing on disk).`);\n }\n \n // Unregister files\n const relComponentPath = path.relative(process.cwd(), componentDir).replace(/\\\\/g, '/');\n const dirPrefix = relComponentPath + '/';\n for (const f in state.files) {\n if (f.startsWith(dirPrefix)) {\n delete state.files[f];\n }\n }\n state.components = state.components.filter(c => c.name !== identifier && c.path !== relComponentPath);\n await saveState(state);\n } else if (result.message) {\n console.log(`⚠ Skipped: ${componentDir}`);\n console.log(` Reason: ${result.message}`);\n } else {\n console.log(`Component not found at ${componentDir}`);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readdir, stat, readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { isTextorGenerated } from '../utils/filesystem.js';\nimport { loadState } from '../utils/state.js';\n\nexport async function listSectionsCommand() {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const pagesRoot = resolvePath(config, 'pages');\n \n console.log('Managed Sections:');\n \n if (!existsSync(pagesRoot)) {\n console.log(' No pages directory found.');\n } else {\n const extensions = [config.naming.routeExtension, '.ts', '.js'];\n const signatures = Object.values(config.signatures || {});\n const sections = await findGeneratedFiles(pagesRoot, extensions, signatures);\n \n if (sections.length === 0) {\n console.log(' No Textor-managed sections found.');\n } else {\n for (const section of sections) {\n const relativePath = path.relative(pagesRoot, section).replace(/\\\\/g, '/');\n const route = '/' + relativePath\n .replace(/\\.[^/.]+$/, ''); // Remove extension\n \n const stateSection = state.sections.find(s => s.route === route);\n const name = stateSection ? stateSection.name : route;\n \n console.log(` - ${name} [${route}] (${relativePath})`);\n \n if (stateSection) {\n console.log(` Feature: ${stateSection.featurePath}`);\n console.log(` Layout: ${stateSection.layout}`);\n \n // Check for senior architecture folders/files\n const featuresRoot = resolvePath(config, 'features');\n const featureDir = path.join(featuresRoot, stateSection.featurePath);\n const capabilities = [];\n \n const checkDir = (subDir, label) => {\n if (existsSync(path.join(featureDir, subDir))) capabilities.push(label);\n };\n \n checkDir('api', 'API');\n checkDir('services', 'Services');\n checkDir('schemas', 'Schemas');\n checkDir('hooks', 'Hooks');\n checkDir('context', 'Context');\n checkDir('types', 'Types');\n checkDir('scripts', 'Scripts');\n checkDir('sub-components', 'Sub-components');\n checkDir('__tests__', 'Tests');\n \n if (existsSync(path.join(featureDir, 'README.md'))) capabilities.push('Docs');\n \n const storiesFile = (await readdir(featureDir).catch(() => []))\n .find(f => f.endsWith('.stories.tsx') || f.endsWith('.stories.jsx'));\n if (storiesFile) capabilities.push('Stories');\n\n if (capabilities.length > 0) {\n console.log(` Architecture: ${capabilities.join(', ')}`);\n }\n } else {\n // Try to extract feature path from the file content\n const content = await readFile(section, 'utf-8');\n const featureImportMatch = content.match(/import\\s+\\w+\\s+from\\s+'([^']+)'/g);\n if (featureImportMatch) {\n for (const match of featureImportMatch) {\n const pathMatch = match.match(/'([^']+)'/);\n if (pathMatch) {\n console.log(` Import: ${pathMatch[1]}`);\n }\n }\n }\n }\n }\n }\n }\n\n if (state.components && state.components.length > 0) {\n console.log('\\nManaged Components:');\n for (const component of state.components) {\n console.log(` - ${component.name} (${path.relative(process.cwd(), component.path)})`);\n \n const componentDir = component.path;\n const capabilities = [];\n \n const checkDir = (subDir, label) => {\n if (existsSync(path.join(componentDir, subDir))) capabilities.push(label);\n };\n \n checkDir('api', 'API');\n checkDir('services', 'Services');\n checkDir('schemas', 'Schemas');\n checkDir('hooks', 'Hooks');\n checkDir('context', 'Context');\n checkDir('types', 'Types');\n checkDir('sub-components', 'Sub-components');\n checkDir('__tests__', 'Tests');\n checkDir('config', 'Config');\n checkDir('constants', 'Constants');\n \n if (existsSync(path.join(componentDir, 'README.md'))) capabilities.push('Docs');\n \n const storiesFile = (await readdir(componentDir).catch(() => []))\n .find(f => f.endsWith('.stories.tsx') || f.endsWith('.stories.jsx'));\n if (storiesFile) capabilities.push('Stories');\n\n if (capabilities.length > 0) {\n console.log(` Architecture: ${capabilities.join(', ')}`);\n }\n }\n }\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n\nasync function findGeneratedFiles(dir, extensions, signatures) {\n const results = [];\n const entries = await readdir(dir);\n const exts = Array.isArray(extensions) ? extensions : [extensions];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry);\n const stats = await stat(fullPath);\n\n if (stats.isDirectory()) {\n results.push(...await findGeneratedFiles(fullPath, exts, signatures));\n } else if (exts.some(ext => entry.endsWith(ext))) {\n if (await isTextorGenerated(fullPath, signatures)) {\n results.push(fullPath);\n }\n }\n }\n\n return results;\n}\n","import path from 'path';\nimport { readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig } from '../utils/config.js';\nimport { loadState, saveState } from '../utils/state.js';\nimport { calculateHash, isTextorGenerated } from '../utils/filesystem.js';\n\nexport async function validateStateCommand(options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const results = {\n missing: [],\n modified: [],\n valid: 0\n };\n\n const files = Object.keys(state.files);\n \n for (const relativePath of files) {\n const fullPath = path.join(process.cwd(), relativePath);\n const fileData = state.files[relativePath];\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n \n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n \n if (currentHash !== fileData.hash) {\n results.modified.push({\n path: relativePath,\n newHash: currentHash\n });\n } else {\n results.valid++;\n }\n }\n\n console.log('State Validation Results:');\n console.log(` Valid files: ${results.valid}`);\n \n if (results.missing.length > 0) {\n console.log(`\\n Missing files: ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n \n if (results.modified.length > 0) {\n console.log(`\\n Modified files: ${results.modified.length}`);\n results.modified.forEach(f => console.log(` - ${f.path}`));\n }\n \n if (options.fix) {\n let fixedCount = 0;\n const signatures = Object.values(config.signatures || {});\n \n // Fix modified files if they still have the Textor signature\n for (const mod of results.modified) {\n const fullPath = path.join(process.cwd(), mod.path);\n if (await isTextorGenerated(fullPath, signatures)) {\n state.files[mod.path].hash = mod.newHash;\n fixedCount++;\n }\n }\n \n // Remove missing files from state\n for (const miss of results.missing) {\n delete state.files[miss];\n fixedCount++;\n }\n \n if (fixedCount > 0) {\n await saveState(state);\n console.log(`\\n✓ Fixed ${fixedCount} entries in state.`);\n } else {\n console.log('\\nNothing to fix or missing signatures on modified files.');\n }\n } else if (results.missing.length > 0 || results.modified.length > 0) {\n console.log('\\nRun with --fix to synchronize state with reality (requires Textor signature to be present).');\n } else {\n console.log('\\n✓ State is perfectly in sync.');\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n","import path from 'path';\nimport { existsSync } from 'fs';\nimport { readFile } from 'fs/promises';\nimport { resolvePath } from './config.js';\nimport { calculateHash, isTextorGenerated, scanDirectory } from './filesystem.js';\n\n/**\n * Computes the drift between the state and the actual files on disk.\n * \n * @param {import('./config.js').TextorConfig} config \n * @param {Object} state \n * @returns {Promise<{\n * missing: string[],\n * modified: string[],\n * untracked: string[],\n * orphaned: string[],\n * synced: number\n * }>}\n */\nexport async function getProjectStatus(config, state) {\n const results = {\n missing: [],\n modified: [],\n untracked: [], // Has signature, not in state\n orphaned: [], // No signature, not in state\n synced: 0\n };\n\n const roots = [\n resolvePath(config, 'pages'),\n resolvePath(config, 'features'),\n resolvePath(config, 'components')\n ].map(p => path.resolve(p));\n\n const diskFiles = new Set();\n const configSignatures = Object.values(config.signatures || {});\n\n for (const root of roots) {\n if (existsSync(root)) {\n await scanDirectory(root, diskFiles);\n }\n }\n\n // 1. Check state files against disk\n for (const relativePath in state.files) {\n const fullPath = path.join(process.cwd(), relativePath);\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n\n // It exists on disk, so it's not untracked/orphaned\n diskFiles.delete(relativePath);\n\n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n const fileData = state.files[relativePath];\n\n if (currentHash !== fileData.hash) {\n results.modified.push(relativePath);\n } else {\n results.synced++;\n }\n }\n\n // 2. Check remaining disk files\n for (const relativePath of diskFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n \n if (isGenerated) {\n results.untracked.push(relativePath);\n } else {\n results.orphaned.push(relativePath);\n }\n }\n\n return results;\n}\n","import { loadConfig } from '../utils/config.js';\nimport { loadState } from '../utils/state.js';\nimport { getProjectStatus } from '../utils/status.js';\n\nexport async function statusCommand() {\n try {\n const config = await loadConfig();\n const state = await loadState();\n \n const results = await getProjectStatus(config, state);\n\n // Reporting\n console.log('Textor Status Report:');\n console.log(` Synced files: ${results.synced}`);\n \n if (results.modified.length > 0) {\n console.log(`\\n MODIFIED (In state, but content changed): ${results.modified.length}`);\n results.modified.forEach(f => console.log(` ~ ${f}`));\n }\n \n if (results.missing.length > 0) {\n console.log(`\\n MISSING (In state, but not on disk): ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n\n if (results.untracked.length > 0) {\n console.log(`\\n UNTRACKED (On disk with signature, not in state): ${results.untracked.length}`);\n results.untracked.forEach(f => console.log(` + ${f}`));\n }\n\n if (results.orphaned.length > 0) {\n console.log(`\\n ORPHANED (On disk without signature, in managed folder): ${results.orphaned.length}`);\n results.orphaned.forEach(f => console.log(` ? ${f}`));\n }\n\n if (results.modified.length === 0 && results.missing.length === 0 && results.untracked.length === 0) {\n console.log('\\n✓ Project is perfectly synchronized with state.');\n } else {\n console.log('\\nUse \"textor sync\" to reconcile state with disk.');\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { calculateHash, isTextorGenerated, scanDirectory, inferKind } from '../utils/filesystem.js';\n\nexport async function syncCommand(options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const results = {\n added: [],\n updated: [],\n missing: [],\n untouched: 0\n };\n\n const roots = [\n resolvePath(config, 'pages'),\n resolvePath(config, 'features'),\n resolvePath(config, 'components')\n ].map(p => path.resolve(p));\n\n const managedFiles = new Set();\n const configSignatures = Object.values(config.signatures || {});\n\n for (const root of roots) {\n if (existsSync(root)) {\n await scanDirectory(root, managedFiles);\n } else {\n const relativeRoot = path.relative(process.cwd(), root).replace(/\\\\/g, '/');\n console.log(` Warning: Managed directory not found: ${relativeRoot}`);\n }\n }\n\n const stateFiles = Object.keys(state.files);\n let changed = false;\n \n // 1. Check files in state\n for (const relativePath of stateFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n\n managedFiles.delete(relativePath); // Remove from managedFiles so we don't process it again in step 2\n\n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n const fileData = state.files[relativePath];\n\n if (currentHash !== fileData.hash) {\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n if (isGenerated || options.force) {\n results.updated.push({ path: relativePath, newHash: currentHash });\n }\n } else {\n results.untouched++;\n }\n }\n\n // 2. Check files on disk not in state\n let ignoredCount = 0;\n for (const relativePath of managedFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n \n if (isGenerated || options.includeAll) {\n const content = await readFile(fullPath, 'utf-8');\n const hash = calculateHash(content, config.hashing?.normalization);\n results.added.push({ path: relativePath, hash });\n } else {\n ignoredCount++;\n }\n }\n\n if (results.added.length > 0 || results.updated.length > 0 || results.missing.length > 0) {\n changed = true;\n }\n\n // Reporting\n console.log('Sync Analysis:');\n console.log(` Untouched files: ${results.untouched}`);\n \n if (ignoredCount > 0 && !options.includeAll) {\n console.log(` Ignored non-generated files: ${ignoredCount} (use --include-all to track them)`);\n }\n \n if (results.added.length > 0) {\n console.log(`\\n New files to track: ${results.added.length}`);\n results.added.forEach(f => console.log(` + ${f.path}`));\n }\n \n if (results.updated.length > 0) {\n console.log(`\\n Modified files to update: ${results.updated.length}`);\n results.updated.forEach(f => console.log(` ~ ${f.path}`));\n }\n \n if (results.missing.length > 0) {\n console.log(`\\n Missing files to remove from state: ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n\n if (options.dryRun) {\n console.log('\\nDry run: no changes applied.');\n return;\n }\n\n if (results.added.length > 0) {\n for (const file of results.added) {\n state.files[file.path] = {\n kind: inferKind(file.path, config),\n hash: file.hash,\n timestamp: new Date().toISOString(),\n synced: true\n };\n }\n }\n\n if (results.updated.length > 0) {\n for (const file of results.updated) {\n state.files[file.path].hash = file.newHash;\n state.files[file.path].timestamp = new Date().toISOString();\n state.files[file.path].synced = true;\n }\n }\n\n if (results.missing.length > 0) {\n for (const relPath of results.missing) {\n delete state.files[relPath];\n }\n }\n\n if (changed) {\n // 3. Reconstruct components and sections\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n\n await saveState(state);\n console.log(`\\n✓ State synchronized successfully (${results.added.length} added, ${results.updated.length} updated, ${results.missing.length} removed).`);\n } else {\n // Even if no files changed, check if metadata needs reconstruction\n const newComponents = reconstructComponents(state.files, config);\n const newSections = reconstructSections(state, config);\n \n const componentsEqual = JSON.stringify(newComponents) === JSON.stringify(state.components || []);\n const sectionsEqual = JSON.stringify(newSections) === JSON.stringify(state.sections || []);\n\n if (!componentsEqual || !sectionsEqual) {\n state.components = newComponents;\n state.sections = newSections;\n await saveState(state);\n console.log('\\n✓ Metadata (components/sections) reconstructed.');\n } else {\n console.log('\\n✓ Everything is already in sync.');\n }\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readFile, writeFile, stat } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { calculateHash, scanDirectory, inferKind } from '../utils/filesystem.js';\n\nexport async function adoptCommand(identifier, options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n\n const roots = {\n pages: resolvePath(config, 'pages'),\n features: resolvePath(config, 'features'),\n components: resolvePath(config, 'components')\n };\n\n let filesToAdopt = [];\n\n if (!identifier && options.all) {\n // Adopt all untracked files in all roots\n const managedFiles = new Set();\n for (const root of Object.values(roots)) {\n if (existsSync(root)) {\n await scanDirectory(root, managedFiles);\n }\n }\n filesToAdopt = Array.from(managedFiles).filter(f => !state.files[f]);\n } else if (identifier) {\n const untrackedFiles = new Set();\n \n // 1. Try as direct path\n const fullPath = path.resolve(process.cwd(), identifier);\n if (existsSync(fullPath)) {\n await scanDirectoryOrFile(fullPath, untrackedFiles, state);\n }\n \n // 2. Try as component name\n const compPath = path.join(roots.components, identifier);\n if (existsSync(compPath)) {\n await scanDirectoryOrFile(compPath, untrackedFiles, state);\n }\n\n // 3. Try as feature name\n const featPath = path.join(roots.features, identifier);\n if (existsSync(featPath)) {\n await scanDirectoryOrFile(featPath, untrackedFiles, state);\n }\n \n // 4. Try as route or page name\n const cleanRoute = identifier.startsWith('/') ? identifier.slice(1) : identifier;\n const pagePath = path.join(roots.pages, cleanRoute + (config.naming?.routeExtension || '.astro'));\n if (existsSync(pagePath)) {\n await scanDirectoryOrFile(pagePath, untrackedFiles, state);\n }\n const nestedPagePath = path.join(roots.pages, cleanRoute, config.routing?.indexFile || 'index.astro');\n if (existsSync(nestedPagePath)) {\n await scanDirectoryOrFile(nestedPagePath, untrackedFiles, state);\n }\n\n filesToAdopt = Array.from(untrackedFiles);\n\n if (filesToAdopt.length === 0 && !existsSync(fullPath)) {\n throw new Error(`Could not find any untracked files for identifier: ${identifier}`);\n }\n } else {\n throw new Error('Please provide a path/identifier or use --all');\n }\n\n // Filter to ensure all files are within managed roots\n const rootPaths = Object.values(roots).map(p => path.resolve(p));\n filesToAdopt = filesToAdopt.filter(relPath => {\n const fullPath = path.resolve(process.cwd(), relPath);\n return rootPaths.some(root => fullPath.startsWith(root));\n });\n\n if (filesToAdopt.length === 0) {\n console.log('No untracked files found to adopt.');\n return;\n }\n\n console.log(`Found ${filesToAdopt.length} files to adopt...`);\n let adoptedCount = 0;\n\n for (const relPath of filesToAdopt) {\n const success = await adoptFile(relPath, config, state, options);\n if (success) adoptedCount++;\n }\n\n if (adoptedCount > 0 && !options.dryRun) {\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n await saveState(state);\n console.log(`\\n✓ Successfully adopted ${adoptedCount} files.`);\n } else if (options.dryRun) {\n console.log(`\\nDry run: would adopt ${adoptedCount} files.`);\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function adoptFile(relPath, config, state, options) {\n const fullPath = path.join(process.cwd(), relPath);\n const content = await readFile(fullPath, 'utf-8');\n \n const ext = path.extname(relPath);\n let signature = '';\n if (ext === '.astro') signature = config.signatures.astro;\n else if (ext === '.ts' || ext === '.tsx') signature = config.signatures.typescript;\n else if (ext === '.js' || ext === '.jsx') signature = config.signatures.javascript;\n\n let finalContent = content;\n const shouldAddSignature = signature && !content.includes(signature) && options.signature !== false;\n\n if (shouldAddSignature) {\n if (options.dryRun) {\n console.log(` ~ Would add signature to ${relPath}`);\n } else {\n finalContent = signature + '\\n' + content;\n await writeFile(fullPath, finalContent, 'utf-8');\n console.log(` + Added signature and adopting: ${relPath}`);\n }\n } else {\n if (options.dryRun) {\n if (signature && !content.includes(signature) && options.signature === false) {\n console.log(` + Would adopt without signature (explicitly requested): ${relPath}`);\n } else {\n console.log(` + Would adopt (already has signature or no signature for ext): ${relPath}`);\n }\n } else {\n if (signature && !content.includes(signature) && options.signature === false) {\n console.log(` + Adopting without signature (explicitly requested): ${relPath}`);\n } else {\n console.log(` + Adopting: ${relPath}`);\n }\n }\n }\n\n if (!options.dryRun) {\n const hash = calculateHash(finalContent, config.hashing?.normalization);\n state.files[relPath] = {\n kind: inferKind(relPath, config),\n hash: hash,\n timestamp: new Date().toISOString(),\n synced: true,\n hasSignature: options.signature !== false\n };\n }\n\n return true;\n}\n\nasync function scanDirectoryOrFile(fullPath, fileSet, state) {\n if ((await stat(fullPath)).isDirectory()) {\n const dirFiles = new Set();\n await scanDirectory(fullPath, dirFiles);\n for (const f of dirFiles) {\n if (!state.files[f]) fileSet.add(f);\n }\n } else {\n const relPath = path.relative(process.cwd(), fullPath).replace(/\\\\/g, '/');\n if (!state.files[relPath]) {\n fileSet.add(relPath);\n }\n }\n}\n","import { readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport {\n DEFAULT_CONFIG,\n CURRENT_CONFIG_VERSION,\n applyConfigMigrations,\n mergeConfig,\n getConfigPath,\n validateConfig\n} from '../utils/config.js';\n\nexport async function upgradeConfigCommand(options) {\n try {\n const configPath = getConfigPath();\n\n if (!existsSync(configPath)) {\n throw new Error(\n `Textor configuration not found at ${configPath}\\n` +\n `Run 'textor init' to create it.`\n );\n }\n\n const rawContent = await readFile(configPath, 'utf-8');\n const rawConfig = JSON.parse(rawContent);\n const migrated = applyConfigMigrations(rawConfig);\n const merged = mergeConfig(DEFAULT_CONFIG, migrated);\n merged.configVersion = CURRENT_CONFIG_VERSION;\n\n validateConfig(merged);\n\n if (options.dryRun) {\n console.log('Dry run - upgraded configuration:');\n console.log(JSON.stringify(merged, null, 2));\n return;\n }\n\n await writeFile(configPath, JSON.stringify(merged, null, 2) + '\\n', 'utf-8');\n\n console.log('Configuration upgraded successfully.');\n console.log(` Version: ${rawConfig.configVersion || 1} -> ${CURRENT_CONFIG_VERSION}`);\n console.log(` Path: ${configPath}`);\n } catch (error) {\n if (error instanceof SyntaxError) {\n console.error('Error: Failed to parse config: Invalid JSON');\n } else {\n console.error('Error:', error.message);\n }\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import { loadState, saveState } from '../utils/state.js';\n\nexport async function normalizeStateCommand(options) {\n try {\n const state = await loadState();\n\n if (options.dryRun) {\n console.log('Dry run - normalized state:');\n console.log(JSON.stringify(state, null, 2));\n return;\n }\n\n await saveState(state);\n console.log('State normalized successfully.');\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import readline from 'readline';\nimport { loadConfig } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { getProjectStatus } from '../utils/status.js';\n\n/**\n * Removes missing references from Textor state.\n * @param {Object} options \n * @param {boolean} options.dryRun \n * @param {boolean} options.yes \n */\nexport async function pruneMissingCommand(options = {}) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n \n const results = await getProjectStatus(config, state);\n \n if (results.missing.length === 0) {\n console.log('No missing references found.');\n return;\n }\n\n console.log(`Found ${results.missing.length} missing references:`);\n results.missing.forEach(f => console.log(` - ${f}`));\n\n if (options.dryRun) {\n console.log('\\nDry run: no changes applied to state.');\n return;\n }\n\n if (!options.yes && options.interactive !== false && process.stdin.isTTY && process.env.NODE_ENV !== 'test') {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n const confirmed = await new Promise(resolve => {\n rl.question('\\nDo you want to proceed with pruning? (y/N) ', (answer) => {\n rl.close();\n resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');\n });\n });\n\n if (!confirmed) {\n console.log('Aborted.');\n return;\n }\n }\n\n for (const relPath of results.missing) {\n delete state.files[relPath];\n }\n\n // Reconstruct metadata\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n\n await saveState(state);\n console.log(`\\n✓ Successfully removed ${results.missing.length} missing references from state.`);\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, findComponent, findSection, saveState } from '../utils/state.js';\nimport { \n normalizeComponentName, \n normalizeRoute, \n featureToDirectoryPath \n} from '../utils/naming.js';\nimport { moveDirectory, scanAndReplaceImports } from '../utils/refactor.js';\nimport { moveSectionCommand } from './move-section.js';\nimport { cleanupEmptyDirs } from '../utils/filesystem.js';\n\n/**\n * Dispatcher for rename commands.\n */\nexport async function renameCommand(type, oldName, newName, options) {\n try {\n if (!type || !oldName || !newName) {\n throw new Error('Usage: textor rename <route|feature|component> <oldName> <newName>');\n }\n\n if (type === 'route' || type === 'path') {\n const normalizedOld = normalizeRoute(oldName);\n const normalizedNew = normalizeRoute(newName);\n // By default, move-section will try to move the feature if it matches the route.\n // For a simple \"rename route\", we might want to keep that behavior or not.\n // Usually \"rename route\" means just the URL/file.\n return await moveSectionCommand(normalizedOld, undefined, normalizedNew, undefined, options);\n }\n \n if (type === 'feature') {\n const state = await loadState();\n const normalizedOld = featureToDirectoryPath(oldName);\n const normalizedNew = featureToDirectoryPath(newName);\n \n const section = findSection(state, normalizedOld);\n \n if (section) {\n // If it's a managed section, move it using section logic\n return await moveSectionCommand(section.route, section.featurePath, section.route, normalizedNew, options);\n } else {\n // Standalone feature move\n return await moveSectionCommand(undefined, normalizedOld, undefined, normalizedNew, options);\n }\n }\n \n if (type === 'component') {\n return await renameComponent(oldName, newName, options);\n }\n \n throw new Error(`Unknown rename type: ${type}. Supported types: route, feature, component.`);\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\n/**\n * Specialized logic for renaming shared components.\n */\nasync function renameComponent(oldName, newName, options) {\n const config = await loadConfig();\n const state = await loadState();\n \n const normalizedOldName = normalizeComponentName(oldName);\n const normalizedNewName = normalizeComponentName(newName);\n \n const component = findComponent(state, normalizedOldName);\n \n const componentsRoot = resolvePath(config, 'components');\n const fromPath = component \n ? path.resolve(process.cwd(), component.path) \n : path.join(componentsRoot, normalizedOldName);\n \n const toPath = path.join(componentsRoot, normalizedNewName);\n \n if (options.dryRun) {\n console.log(`Dry run - would rename component: ${normalizedOldName} -> ${normalizedNewName}`);\n console.log(` Path: ${fromPath} -> ${toPath}`);\n return;\n }\n \n const signatures = Object.values(config.signatures || {});\n \n await moveDirectory(fromPath, toPath, state, config, {\n ...options,\n fromName: normalizedOldName,\n toName: normalizedNewName,\n signatures\n });\n \n if (options.scan) {\n await scanAndReplaceImports(config, state, {\n fromPath: normalizedOldName,\n fromName: normalizedOldName,\n type: 'component'\n }, {\n toPath: normalizedNewName,\n toName: normalizedNewName\n }, options);\n }\n \n await cleanupEmptyDirs(path.dirname(fromPath), componentsRoot);\n \n // Update state metadata\n if (component) {\n component.name = normalizedNewName;\n component.path = path.relative(process.cwd(), toPath).replace(/\\\\/g, '/');\n }\n \n await saveState(state);\n console.log(`✓ Renamed component ${normalizedOldName} to ${normalizedNewName}`);\n}\n"],"names":["CONFIG_DIR","existsSync","readFile","mkdir","writeFile","execAsync","promisify","exec","createHash","unlink","readdir","stat","rm","rename","rmdir","readFileSync","open","updateImportsInFile"],"mappings":";;;;;;;;;;AAIA,MAAMA,YAAU,GAAG,SAAS;AAC5B,MAAM,WAAW,GAAG,aAAa;AAC1B,MAAM,sBAAsB,GAAG,CAAC;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDG;AAEH;;;AAGG;AACI,MAAM,cAAc,GAAG;AAC5B,IAAA,aAAa,EAAE,sBAAsB;AACrC,IAAA,KAAK,EAAE;A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AAS,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;IAC3E;AAEA,IAAA,MAAM,SAAS,CAAC,KAAK,CAAC;IACtB,OAAO,CAAC,GAAG,CAAC,CAAA,oBAAA,EAAuB,iBAAiB,CAAA,IAAA,EAAO,iBAAiB,CAAA,CAAE,CAAC;AACjF;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../../src/utils/config.js","../../src/commands/init.js","../../src/utils/naming.js","../../src/utils/filesystem.js","../../src/utils/patterns.js","../../src/utils/templates.js","../../src/utils/state.js","../../src/utils/git.js","../../src/commands/add-section.js","../../src/commands/remove-section.js","../../src/utils/refactor.js","../../src/commands/move-section.js","../../src/commands/create-component.js","../../src/commands/remove-component.js","../../src/commands/list-sections.js","../../src/commands/validate-state.js","../../src/utils/status.js","../../src/commands/status.js","../../src/commands/sync.js","../../src/commands/adopt.js","../../src/commands/upgrade-config.js","../../src/commands/normalize-state.js","../../src/commands/prune-missing.js","../../src/commands/rename.js","../../src/commands/add-item.js"],"sourcesContent":["import { readFile, writeFile, mkdir } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\n\nconst CONFIG_DIR = '.textor';\nconst CONFIG_FILE = 'config.json';\nexport const CURRENT_CONFIG_VERSION = 2;\n\n/**\n * @typedef {Object} TextorConfig\n * @property {number} configVersion\n * @property {Object} paths\n * @property {string} paths.pages\n * @property {string} paths.features\n * @property {string} paths.components\n * @property {string} paths.layouts\n * @property {Object} routing\n * @property {string} routing.mode\n * @property {string} routing.indexFile\n * @property {Object} importAliases\n * @property {string} importAliases.layouts\n * @property {string} importAliases.features\n * @property {Object} naming\n * @property {string} naming.routeExtension\n * @property {string} naming.featureExtension\n * @property {string} naming.componentExtension\n * @property {string} naming.hookExtension\n * @property {string} naming.testExtension\n * @property {Object} signatures\n * @property {string} signatures.astro\n * @property {string} signatures.typescript\n * @property {string} signatures.javascript\n * @property {Object} features\n * @property {string} features.framework\n * @property {string} features.entry\n * @property {boolean} features.createSubComponentsDir\n * @property {boolean} features.createScriptsDir\n * @property {string} features.scriptsIndexFile\n * @property {string} features.layout\n * @property {Object} features.layoutProps\n * @property {Object} components\n * @property {boolean} components.createSubComponentsDir\n * @property {boolean} components.createContext\n * @property {boolean} components.createHook\n * @property {boolean} components.createTests\n * @property {boolean} components.createConfig\n * @property {boolean} components.createConstants\n * @property {boolean} components.createTypes\n * @property {Object} formatting\n * @property {string} formatting.tool\n * @property {Object} filePatterns\n * @property {Object} filePatterns.features\n * @property {Object} filePatterns.components\n * @property {Object} git\n * @property {boolean} git.requireCleanRepo\n * @property {boolean} git.stageChanges\n * @property {Object} presets\n * @property {string} defaultPreset\n */\n\n/**\n * Default configuration for Textor\n * @type {TextorConfig}\n */\nexport const DEFAULT_CONFIG = {\n configVersion: CURRENT_CONFIG_VERSION,\n paths: {\n pages: 'src/pages',\n features: 'src/features',\n components: 'src/components',\n layouts: 'src/layouts'\n },\n routing: {\n mode: 'flat', // 'flat' | 'nested'\n indexFile: 'index.astro'\n },\n importAliases: {},\n naming: {\n routeExtension: '.astro',\n featureExtension: '.astro',\n componentExtension: '.tsx',\n hookExtension: '.ts',\n testExtension: '.test.tsx'\n },\n signatures: {\n astro: '<!-- @generated by Textor -->',\n typescript: '// @generated by Textor',\n javascript: '// @generated by Textor',\n tsx: '// @generated by Textor'\n },\n features: {\n framework: 'astro',\n entry: 'pascal', // 'index' | 'pascal'\n createSubComponentsDir: true,\n createScriptsDir: true,\n scriptsIndexFile: 'scripts/index.ts',\n createApi: false,\n createServices: false,\n createSchemas: false,\n createHooks: false,\n createContext: false,\n createTests: false,\n createTypes: false,\n createReadme: false,\n createStories: false,\n createIndex: false,\n layout: 'Main',\n layoutProps: {}\n },\n components: {\n framework: 'react',\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true,\n createApi: false,\n createServices: false,\n createSchemas: false,\n createReadme: false,\n createStories: false\n },\n formatting: {\n tool: 'none' // 'prettier' | 'biome' | 'none'\n },\n filePatterns: {\n features: {\n index: 'index.ts',\n types: 'index.ts',\n api: 'index.ts',\n services: 'index.ts',\n schemas: 'index.ts',\n hook: '{{hookName}}{{hookExtension}}',\n context: '{{componentName}}Context.tsx',\n test: '{{componentName}}{{testExtension}}',\n readme: 'README.md',\n stories: '{{componentName}}.stories.tsx'\n },\n components: {\n index: 'index.ts',\n types: 'index.ts',\n api: 'index.ts',\n services: 'index.ts',\n schemas: 'index.ts',\n hook: '{{hookName}}{{hookExtension}}',\n context: '{{componentName}}Context.tsx',\n test: '{{componentName}}{{testExtension}}',\n config: 'index.ts',\n constants: 'index.ts',\n readme: 'README.md',\n stories: '{{componentName}}.stories.tsx'\n }\n },\n hashing: {\n normalization: 'normalizeEOL', // 'none' | 'normalizeEOL' | 'stripGeneratedRegions'\n useMarkers: false\n },\n git: {\n requireCleanRepo: false,\n stageChanges: false\n },\n kindRules: [],\n presets: {\n minimal: {\n features: {\n createSubComponentsDir: false,\n createScriptsDir: false\n },\n components: {\n createSubComponentsDir: false,\n createContext: false,\n createHook: false,\n createTests: false,\n createConfig: false,\n createConstants: false,\n createTypes: false\n }\n },\n standard: {\n features: {\n createSubComponentsDir: true,\n createScriptsDir: true\n },\n components: {\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true\n }\n },\n senior: {\n features: {\n createSubComponentsDir: true,\n createScriptsDir: true,\n createApi: true,\n createServices: true,\n createSchemas: true,\n createHooks: true,\n createContext: true,\n createTests: true,\n createTypes: true,\n createReadme: true,\n createStories: true,\n createIndex: true\n },\n components: {\n createSubComponentsDir: true,\n createContext: true,\n createHook: true,\n createTests: true,\n createConfig: true,\n createConstants: true,\n createTypes: true,\n createApi: true,\n createServices: true,\n createSchemas: true,\n createReadme: true,\n createStories: true\n }\n }\n },\n defaultPreset: 'standard'\n};\n\n/**\n * Gets the absolute path to the .textor directory.\n * @returns {string}\n */\nexport function getConfigDir() {\n return path.join(process.cwd(), CONFIG_DIR);\n}\n\n/**\n * Gets the absolute path to the config.json file.\n * @returns {string}\n */\nexport function getConfigPath() {\n return path.join(getConfigDir(), CONFIG_FILE);\n}\n\n/**\n * Checks if the configuration file exists.\n * @returns {boolean}\n */\nexport function configExists() {\n return existsSync(getConfigPath());\n}\n\n/**\n * Loads the configuration from config.json and merges it with DEFAULT_CONFIG.\n * @returns {Promise<TextorConfig>}\n * @throws {Error} If configuration not found or invalid\n */\nexport async function loadConfig() {\n const configPath = getConfigPath();\n \n if (!existsSync(configPath)) {\n throw new Error(\n `Textor configuration not found at ${configPath}\\n` +\n `Run 'textor init' to create it.`\n );\n }\n\n try {\n const content = await readFile(configPath, 'utf-8');\n const config = JSON.parse(content);\n const merged = mergeConfig(DEFAULT_CONFIG, config);\n validateConfig(merged);\n return merged;\n } catch (error) {\n if (error instanceof SyntaxError) {\n throw new Error(`Failed to parse config: Invalid JSON at ${configPath}`);\n }\n throw new Error(`Failed to load config: ${error.message}`);\n }\n}\n\n/**\n * Saves the configuration to config.json.\n * @param {TextorConfig} config Configuration to save\n * @param {boolean} [force=false] Whether to overwrite existing config\n * @returns {Promise<string>} Path to the saved config file\n * @throws {Error} If config exists and force is false\n */\nexport async function saveConfig(config, force = false) {\n const configPath = getConfigPath();\n \n if (existsSync(configPath) && !force) {\n throw new Error(\n `Configuration already exists at ${configPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n\n validateConfig(config);\n\n const configDir = getConfigDir();\n if (!existsSync(configDir)) {\n await mkdir(configDir, { recursive: true });\n }\n\n await writeFile(configPath, JSON.stringify(config, null, 2) + '\\n', 'utf-8');\n return configPath;\n}\n\nexport function mergeConfig(defaults, config) {\n return deepMerge(defaults, config);\n}\n\nexport function normalizeConfigVersion(config) {\n if (!config || typeof config !== 'object') return config;\n if (typeof config.configVersion !== 'number') {\n return { ...config, configVersion: 1 };\n }\n return config;\n}\n\nexport function applyConfigMigrations(config) {\n let current = normalizeConfigVersion(config);\n let version = current.configVersion || 1;\n let migrated = { ...current };\n\n while (version < CURRENT_CONFIG_VERSION) {\n if (version === 1) {\n migrated = { ...migrated, configVersion: 2 };\n version = 2;\n continue;\n }\n break;\n }\n\n if (migrated.configVersion !== CURRENT_CONFIG_VERSION) {\n migrated.configVersion = CURRENT_CONFIG_VERSION;\n }\n\n return migrated;\n}\n\n/**\n * Deeply merges source object into target object.\n * @param {Object} target \n * @param {Object} source \n * @returns {Object} Merged object\n */\nfunction deepMerge(target, source) {\n const result = { ...target };\n \n for (const key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n if (source[key] && typeof source[key] === 'object' && !Array.isArray(source[key])) {\n result[key] = deepMerge(target[key] || {}, source[key]);\n } else {\n result[key] = source[key];\n }\n }\n }\n \n return result;\n}\n\n/**\n * Validates the configuration object structure.\n * @param {any} config \n * @throws {Error} If config is invalid\n */\nexport function validateConfig(config) {\n if (!config || typeof config !== 'object') {\n throw new Error('Invalid configuration: must be an object');\n }\n\n if (config.configVersion !== undefined && typeof config.configVersion !== 'number') {\n throw new Error('Invalid configuration: \"configVersion\" must be a number');\n }\n\n const requiredSections = ['paths', 'naming', 'signatures', 'importAliases'];\n for (const section of requiredSections) {\n if (!config[section] || typeof config[section] !== 'object') {\n throw new Error(`Invalid configuration: missing or invalid \"${section}\" section`);\n }\n }\n\n if (config.kindRules && !Array.isArray(config.kindRules)) {\n throw new Error('Invalid configuration: \"kindRules\" must be an array');\n }\n\n if (config.filePatterns && typeof config.filePatterns !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns\" must be an object');\n }\n if (config.filePatterns?.features && typeof config.filePatterns.features !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns.features\" must be an object');\n }\n if (config.filePatterns?.components && typeof config.filePatterns.components !== 'object') {\n throw new Error('Invalid configuration: \"filePatterns.components\" must be an object');\n }\n\n // Validate paths are strings\n for (const [key, value] of Object.entries(config.paths)) {\n if (typeof value !== 'string') {\n throw new Error(`Invalid configuration: \"paths.${key}\" must be a string`);\n }\n }\n\n // Validate naming extensions start with dot\n for (const [key, value] of Object.entries(config.naming)) {\n if (typeof value === 'string' && !value.startsWith('.') && value !== '') {\n throw new Error(`Invalid configuration: \"naming.${key}\" should start with a dot (e.g., \".astro\")`);\n }\n }\n}\n\n/**\n * Resolves a configured path key to an absolute path.\n * @param {TextorConfig} config \n * @param {keyof TextorConfig['paths']} pathKey \n * @returns {string}\n */\nexport function resolvePath(config, pathKey) {\n const configuredPath = config.paths[pathKey];\n if (!configuredPath) {\n throw new Error(`Path \"${pathKey}\" not found in configuration`);\n }\n return path.resolve(process.cwd(), configuredPath);\n}\n\n/**\n * Merges CLI options, preset defaults, and global config.\n * @param {Object} cmdOptions \n * @param {TextorConfig} config \n * @param {'features' | 'components'} type \n */\nexport function getEffectiveOptions(cmdOptions, config, type) {\n const presetName = cmdOptions.preset || config.defaultPreset || 'standard';\n const preset = config.presets[presetName] || config.presets['standard'] || {};\n const presetTypeOptions = preset[type] || {};\n const configTypeOptions = config[type] || {};\n\n const merged = { ...configTypeOptions, ...presetTypeOptions };\n\n // Explicit CLI flags should override\n // Commander uses camelCase for flags like --no-sub-components-dir -> subComponentsDir\n for (const key in merged) {\n if (cmdOptions[key] !== undefined) {\n merged[key] = cmdOptions[key];\n } else if (key.startsWith('create')) {\n // Try mapping short flags to \"create\" prefix\n // e.g., CLI --api (cmdOptions.api) -> config createApi\n const shortKey = key.slice(6).charAt(0).toLowerCase() + key.slice(7);\n if (cmdOptions[shortKey] !== undefined) {\n merged[key] = cmdOptions[shortKey];\n }\n }\n }\n\n return merged;\n}\n","import { DEFAULT_CONFIG, saveConfig } from '../utils/config.js';\n\nexport async function initCommand(options) {\n try {\n const configPath = await saveConfig(DEFAULT_CONFIG, options.force);\n const quiet = options?.quiet || process.env.NODE_ENV === 'test' || process.env.TEXTOR_QUIET === '1';\n\n if (!quiet) {\n console.log('Textor configuration created at:', configPath);\n console.log('\\nDefault configuration:');\n console.log(JSON.stringify(DEFAULT_CONFIG, null, 2));\n console.log('\\nYou can now use Textor commands like:');\n console.log(' textor add-section /users users/catalog --layout Main');\n }\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n","import path from 'path';\n\nexport function toPascalCase(input) {\n return input\n .split(/[/\\\\_-]/)\n .filter(Boolean)\n .map(segment => {\n if (segment === segment.toUpperCase() && segment.length > 1) {\n segment = segment.toLowerCase();\n }\n return segment.charAt(0).toUpperCase() + segment.slice(1);\n })\n .join('');\n}\n\nexport function toCamelCase(input) {\n const pascal = toPascalCase(input);\n return pascal.charAt(0).toLowerCase() + pascal.slice(1);\n}\n\nexport function toKebabCase(input) {\n return input\n .replace(/([a-z0-9])([A-Z])/g, '$1-$2')\n .replace(/([A-Z])([A-Z][a-z])/g, '$1-$2')\n .replace(/[_\\s/\\\\-]+/g, '-')\n .toLowerCase()\n .replace(/^-+|-+$/g, '');\n}\n\nexport function toSnakeCase(input) {\n return toKebabCase(input).replace(/-/g, '_');\n}\n\nexport function toScreamingSnakeCase(input) {\n return toSnakeCase(input).toUpperCase();\n}\n\nexport function getFeatureComponentName(featurePath) {\n return toPascalCase(featurePath);\n}\n\nexport function getHookName(componentName) {\n return 'use' + componentName;\n}\n\nexport function getHookFunctionName(componentName) {\n return 'use' + componentName;\n}\n\nexport function getHookFileName(componentName, extension = '.ts') {\n return getHookFunctionName(componentName) + extension;\n}\n\nexport function normalizeComponentName(name) {\n return toPascalCase(name);\n}\n\nexport function normalizeRoute(route) {\n if (!route) return null;\n let normalized = route.trim();\n \n if (!normalized.startsWith('/')) {\n normalized = '/' + normalized;\n }\n \n if (normalized.length > 1 && normalized.endsWith('/')) {\n normalized = normalized.slice(0, -1);\n }\n \n return normalized;\n}\n\nexport function routeToFilePath(route, options = {}) {\n const { extension = '.astro', mode = 'flat', indexFile = 'index.astro' } = options;\n if (!route) return null;\n const normalized = normalizeRoute(route);\n \n if (normalized === '/') {\n return indexFile;\n }\n \n const routePath = normalized.slice(1);\n if (mode === 'nested') {\n return path.join(routePath, indexFile);\n }\n \n return routePath + extension;\n}\n\nexport function featureToDirectoryPath(featurePath) {\n return featurePath.replace(/^\\/+/, '').replace(/\\/+$/, '');\n}\n\nexport function getFeatureFileName(featurePath, options = {}) {\n const { extension = '.astro', strategy = 'index' } = options;\n if (strategy === 'pascal') {\n return getFeatureComponentName(featurePath) + extension;\n }\n return 'index' + extension;\n}\n\n/**\n * Calculates a relative import path from one file to another.\n * @param {string} fromFile The absolute path of the file containing the import\n * @param {string} toFile The absolute path of the file being imported\n * @returns {string} The relative import path\n */\nexport function getRelativeImportPath(fromFile, toFile) {\n let relativePath = path.relative(path.dirname(fromFile), toFile);\n \n // Convert backslashes to forward slashes for imports\n relativePath = relativePath.split(path.sep).join('/');\n \n // Ensure it starts with ./ or ../\n if (!relativePath.startsWith('.')) {\n relativePath = './' + relativePath;\n }\n \n return relativePath;\n}\n","import { readFile, writeFile, mkdir, unlink, rmdir, rename, readdir, stat, rm } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\nimport { createHash } from 'crypto';\nimport { exec } from 'child_process';\nimport { promisify } from 'util';\nimport { toPascalCase } from './naming.js';\n\nconst execAsync = promisify(exec);\n\nexport function calculateHash(content, normalization = 'normalizeEOL') {\n let normalizedContent = content;\n \n if (normalization === 'stripGeneratedRegions') {\n // Extract all content between :begin and :end markers\n const beginMarker = /@generated by Textor:begin/g;\n const endMarker = /@generated by Textor:end/g;\n \n const regions = [];\n let match;\n const beginIndices = [];\n while ((match = beginMarker.exec(content)) !== null) {\n beginIndices.push(match.index + match[0].length);\n }\n \n const endIndices = [];\n while ((match = endMarker.exec(content)) !== null) {\n endIndices.push(match.index);\n }\n \n if (beginIndices.length > 0 && beginIndices.length === endIndices.length) {\n for (let i = 0; i < beginIndices.length; i++) {\n regions.push(content.slice(beginIndices[i], endIndices[i]));\n }\n normalizedContent = regions.join('\\n');\n }\n // Fall back to full content if markers are missing or mismatched\n }\n\n if (normalization === 'normalizeEOL' || normalization === 'stripGeneratedRegions') {\n normalizedContent = normalizedContent.replace(/\\r\\n/g, '\\n');\n }\n \n return createHash('sha256').update(normalizedContent).digest('hex');\n}\n\nexport async function isTextorGenerated(filePath, customSignatures = []) {\n if (!existsSync(filePath)) {\n return false;\n }\n\n try {\n const content = await readFile(filePath, 'utf-8');\n const signatures = ['@generated by Textor', ...customSignatures];\n return signatures.some(sig => content.includes(sig));\n } catch {\n return false;\n }\n}\n\nexport async function verifyFileIntegrity(filePath, expectedHash, options = {}) {\n const { \n force = false, \n acceptChanges = false, \n normalization = 'normalizeEOL',\n owner = null,\n actualOwner = null,\n signatures = []\n } = options;\n \n if (force) return { valid: true };\n\n if (owner && actualOwner && owner !== actualOwner) {\n return {\n valid: false,\n reason: 'wrong-owner',\n message: `Refusing to operate on ${filePath} - owned by ${actualOwner}, but requested by ${owner}. Use --force to override.`\n };\n }\n\n const isGenerated = await isTextorGenerated(filePath, signatures);\n if (!isGenerated) {\n return { \n valid: false, \n reason: 'not-generated', \n message: `Refusing to operate on ${filePath} - not generated by Textor. Use --force to override.` \n };\n }\n\n if (!expectedHash) {\n return {\n valid: false,\n reason: 'not-in-state',\n message: `Refusing to operate on ${filePath} - not found in Textor state. Use --force to override.`\n };\n }\n\n if (!acceptChanges) {\n const content = await readFile(filePath, 'utf-8');\n const currentHash = calculateHash(content, normalization);\n if (currentHash !== expectedHash) {\n return {\n valid: false,\n reason: 'hash-mismatch',\n message: `Refusing to operate on ${filePath} - content has been modified. Use --accept-changes or --force to override.`\n };\n }\n }\n\n return { valid: true };\n}\n\nexport async function safeDelete(filePath, options = {}) {\n const { force = false, expectedHash = null, acceptChanges = false, owner = null, actualOwner = null, signatures = [] } = options;\n \n if (!existsSync(filePath)) {\n return { deleted: false, reason: 'not-found' };\n }\n \n const integrity = await verifyFileIntegrity(filePath, expectedHash, { \n force, \n acceptChanges,\n owner,\n actualOwner,\n signatures\n });\n if (!integrity.valid) {\n return { deleted: false, reason: integrity.reason, message: integrity.message };\n }\n\n await unlink(filePath);\n return { deleted: true };\n}\n\nexport async function ensureNotExists(filePath, force = false) {\n if (existsSync(filePath)) {\n if (!force) {\n throw new Error(\n `File already exists: ${filePath}\\n` +\n `Use --force to overwrite.`\n );\n }\n }\n}\n\nexport async function ensureDir(dirPath) {\n await mkdir(dirPath, { recursive: true });\n}\n\nasync function isSafeToDeleteDir(dirPath, stateFiles = {}, options = {}) {\n try {\n const files = await readdir(dirPath);\n \n const results = await Promise.all(\n files.map(async file => {\n const filePath = path.join(dirPath, file);\n const stats = await stat(filePath);\n \n if (stats.isDirectory()) {\n return await isSafeToDeleteDir(filePath, stateFiles, options);\n }\n \n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n const fileState = stateFiles[normalizedPath];\n const integrity = await verifyFileIntegrity(filePath, fileState?.hash, {\n ...options,\n actualOwner: fileState?.owner,\n signatures: options.signatures || []\n });\n return integrity.valid;\n })\n );\n\n return results.every(Boolean);\n } catch {\n return false;\n }\n}\n\nexport async function safeDeleteDir(dirPath, options = {}) {\n const { force = false, stateFiles = {} } = options;\n if (!existsSync(dirPath)) {\n return { deleted: false, reason: 'not-found' };\n }\n\n const isSafe = force || await isSafeToDeleteDir(dirPath, stateFiles, options);\n \n if (isSafe) {\n await rm(dirPath, { recursive: true, force: true });\n return { deleted: true };\n }\n\n return {\n deleted: false,\n reason: 'contains-non-generated-or-modified',\n message: `Directory contains non-generated or modified files: ${dirPath}. Use --force to override.`\n };\n}\n\nexport async function writeFileWithSignature(filePath, content, signature, normalization = 'normalizeEOL') {\n await ensureDir(path.dirname(filePath));\n \n let finalContent = signature + '\\n' + content;\n \n if (signature.includes(':begin')) {\n const endSignature = signature.replace(':begin', ':end');\n finalContent = signature + '\\n' + content + '\\n' + endSignature;\n }\n\n await writeFile(filePath, finalContent, 'utf-8');\n \n return calculateHash(finalContent, normalization);\n}\n\nexport function getSignature(config, type) {\n const base = config.signatures[type] || config.signatures.typescript;\n if (config.hashing?.useMarkers) {\n return base.replace('Textor', 'Textor:begin');\n }\n return base;\n}\n\nexport async function updateSignature(filePath, oldPath, newPath) {\n if (!existsSync(filePath)) {\n return;\n }\n\n let content = await readFile(filePath, 'utf-8');\n \n content = content.replace(\n new RegExp(oldPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'),\n newPath\n );\n \n await writeFile(filePath, content, 'utf-8');\n}\n\nexport async function safeMove(fromPath, toPath, options = {}) {\n const { \n force = false, \n expectedHash = null, \n acceptChanges = false, \n normalization = 'normalizeEOL',\n owner = null,\n actualOwner = null\n } = options;\n \n if (!existsSync(fromPath)) {\n throw new Error(`Source file not found: ${fromPath}`);\n }\n\n if (path.resolve(fromPath) === path.resolve(toPath)) {\n const content = await readFile(toPath, 'utf-8');\n return calculateHash(content, normalization);\n }\n\n if (existsSync(toPath) && !force) {\n throw new Error(\n `Destination already exists: ${toPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n\n const integrity = await verifyFileIntegrity(fromPath, expectedHash, { \n force, \n acceptChanges, \n normalization,\n owner,\n actualOwner,\n signatures: options.signatures || []\n });\n if (!integrity.valid) {\n throw new Error(integrity.message);\n }\n\n await ensureDir(path.dirname(toPath));\n await rename(fromPath, toPath);\n \n await updateSignature(toPath, fromPath, toPath);\n \n // Return new hash because updateSignature might have changed it\n const content = await readFile(toPath, 'utf-8');\n return calculateHash(content, normalization);\n}\n\nexport async function isEmptyDir(dirPath) {\n if (!existsSync(dirPath)) {\n return true;\n }\n\n const files = await readdir(dirPath);\n return files.length === 0;\n}\n\nexport async function scanDirectory(dir, fileSet) {\n const files = await readdir(dir);\n for (const file of files) {\n const fullPath = path.join(dir, file);\n const stats = await stat(fullPath);\n if (stats.isDirectory()) {\n if (file === 'node_modules' || file === '.git' || file === '.textor') continue;\n await scanDirectory(fullPath, fileSet);\n } else {\n const relativePath = path.relative(process.cwd(), fullPath).replace(/\\\\/g, '/');\n fileSet.add(relativePath);\n }\n }\n}\n\nexport function inferKind(filePath, config) {\n const normalizedFilePath = path.resolve(filePath).replace(/\\\\/g, '/');\n const relativeFromCwd = path.relative(process.cwd(), normalizedFilePath).replace(/\\\\/g, '/');\n\n // Check kindRules first (precedence)\n if (config.kindRules && Array.isArray(config.kindRules)) {\n for (const rule of config.kindRules) {\n if (rule.match && rule.kind) {\n // Simple glob-to-regex conversion for ** and *\n const regexStr = rule.match\n .replace(/[.+^${}()|[\\]\\\\]/g, '\\\\$&') // Escape regex special chars\n .replace(/\\*\\*/g, '(.+)') // ** matches anything\n .replace(/\\*/g, '([^/]+)'); // * matches one segment\n \n const regex = new RegExp(`^${regexStr}$`);\n if (regex.test(relativeFromCwd) || regex.test(normalizedFilePath)) {\n return rule.kind;\n }\n }\n }\n }\n\n const pagesRoot = path.resolve(process.cwd(), config.paths.pages || 'src/pages').replace(/\\\\/g, '/');\n const featuresRoot = path.resolve(process.cwd(), config.paths.features || 'src/features').replace(/\\\\/g, '/');\n const componentsRoot = path.resolve(process.cwd(), config.paths.components || 'src/components').replace(/\\\\/g, '/');\n\n const ext = path.extname(normalizedFilePath);\n\n if (normalizedFilePath.startsWith(pagesRoot)) {\n if (ext === '.ts' || ext === '.js') return 'endpoint';\n return 'route';\n }\n\n if (normalizedFilePath.startsWith(featuresRoot)) {\n const relativePath = path.relative(featuresRoot, normalizedFilePath).replace(/\\\\/g, '/');\n const parts = relativePath.split('/');\n \n // If it's directly in the features root\n if (parts.length === 1) return 'feature';\n\n const fileName = parts[parts.length - 1];\n const featureDir = path.dirname(relativePath).replace(/\\\\/g, '/');\n \n // Main feature file can be FeatureName.astro or index.astro\n const featureName = toPascalCase(featureDir);\n const possiblePascalName = featureName + (config.naming.featureExtension || '.astro');\n const possibleIndexName = 'index' + (config.naming.featureExtension || '.astro');\n \n if (path.dirname(relativePath) !== '.' && (fileName === possiblePascalName || fileName === possibleIndexName)) {\n // It's in the top level of its feature directory\n if (parts.length === (featureDir.split('/').length + 1)) {\n return 'feature';\n }\n }\n \n return 'feature-file';\n }\n\n if (normalizedFilePath.startsWith(componentsRoot)) {\n const relativePath = path.relative(componentsRoot, normalizedFilePath).replace(/\\\\/g, '/');\n const parts = relativePath.split('/');\n \n if (parts.length === 1) return 'component';\n \n const componentDir = parts[0];\n const fileName = parts[parts.length - 1];\n const componentName = toPascalCase(componentDir);\n \n const possibleComponentName = componentName + (config.naming.componentExtension || '.tsx');\n const possibleIndexName = 'index' + (config.naming.componentExtension || '.tsx');\n \n if (parts.length === 2 && (fileName === possibleComponentName || fileName === possibleIndexName)) {\n return 'component';\n }\n \n return 'component-file';\n }\n\n return 'unknown';\n}\n\n/**\n * Safely joins path segments and ensures the result is within the basePath.\n * @param {string} basePath The base directory that must contain the result\n * @param {...string} segments Path segments to join\n * @returns {string} The joined path\n * @throws {Error} If a path traversal attempt is detected\n */\nexport function secureJoin(basePath, ...segments) {\n const joinedPath = path.join(basePath, ...segments);\n const resolvedBase = path.resolve(basePath);\n const resolvedJoined = path.resolve(joinedPath);\n \n const relative = path.relative(resolvedBase, resolvedJoined);\n \n if (relative.startsWith('..') || path.isAbsolute(relative)) {\n throw new Error(`Security error: Path traversal attempt detected: ${joinedPath} is outside of ${basePath}`);\n }\n \n return joinedPath;\n}\n\nexport async function cleanupEmptyDirs(dirPath, rootPath) {\n const normalizedDir = path.resolve(dirPath);\n const normalizedRoot = path.resolve(rootPath);\n \n if (normalizedDir === normalizedRoot || !normalizedDir.startsWith(normalizedRoot)) {\n return;\n }\n\n if (await isEmptyDir(normalizedDir)) {\n await rmdir(normalizedDir);\n await cleanupEmptyDirs(path.dirname(normalizedDir), rootPath);\n }\n}\n\n/**\n * Formats a list of files using the specified tool.\n * @param {string[]} filePaths \n * @param {'prettier' | 'biome' | 'none'} tool \n */\nexport async function formatFiles(filePaths, tool) {\n if (tool === 'none' || !filePaths.length) return;\n \n // Quote paths to handle spaces\n const paths = filePaths.map(p => `\"${p}\"`).join(' ');\n \n if (tool === 'prettier') {\n try {\n await execAsync(`npx prettier --write ${paths}`);\n } catch (error) {\n // Silently fail if prettier is not available or fails\n }\n } else if (tool === 'biome') {\n try {\n await execAsync(`npx biome format --write ${paths}`);\n } catch (error) {\n // Silently fail\n }\n }\n}\n","import { secureJoin } from './filesystem.js';\n\nexport function renderNamePattern(pattern, data = {}, label = 'pattern') {\n if (typeof pattern !== 'string') return null;\n const trimmed = pattern.trim();\n if (!trimmed) return null;\n\n const missing = new Set();\n const rendered = trimmed.replace(/{{\\s*([a-zA-Z0-9_]+)\\s*}}/g, (match, key) => {\n if (!Object.prototype.hasOwnProperty.call(data, key)) {\n missing.add(key);\n return '';\n }\n return String(data[key]);\n });\n\n if (missing.size > 0) {\n throw new Error(\n `Invalid ${label}: missing values for ${Array.from(missing).join(', ')}`\n );\n }\n\n return rendered;\n}\n\nexport function resolvePatternedPath(baseDir, pattern, data, fallback, label) {\n const fileName = renderNamePattern(pattern, data, label) || fallback;\n if (!fileName) {\n throw new Error(`Invalid ${label}: resolved to empty file name`);\n }\n return secureJoin(baseDir, fileName);\n}\n","import { existsSync, readFileSync } from 'fs';\nimport path from 'path';\nimport { toPascalCase, toCamelCase, toKebabCase, toSnakeCase, toScreamingSnakeCase } from './naming.js';\n\nexport function enrichData(data) {\n const enriched = { ...data };\n const nameKeys = ['componentName', 'featureComponentName', 'layoutName'];\n for (const key of nameKeys) {\n if (data[key] && typeof data[key] === 'string') {\n enriched[`${key}Camel`] = toCamelCase(data[key]);\n enriched[`${key}Kebab`] = toKebabCase(data[key]);\n enriched[`${key}Snake`] = toSnakeCase(data[key]);\n enriched[`${key}Upper`] = toScreamingSnakeCase(data[key]);\n enriched[`${key}Pascal`] = toPascalCase(data[key]);\n }\n }\n return enriched;\n}\n\nfunction getTemplateOverride(templateName, extension, data = {}) {\n const overridePath = path.join(process.cwd(), '.textor', 'templates', `${templateName}${extension}`);\n if (existsSync(overridePath)) {\n let content = readFileSync(overridePath, 'utf-8');\n const finalData = enrichData(data);\n for (const [key, value] of Object.entries(finalData)) {\n const replacement = () => value || '';\n content = content.replace(new RegExp(`{{${key}}}`, 'g'), replacement);\n content = content.replace(new RegExp(`__${key}__`, 'g'), replacement);\n }\n return content;\n }\n return null;\n}\n\n/**\n * Route Template Variables:\n * - layoutName: The name of the layout component\n * - layoutImportPath: Path to import the layout\n * - featureImportPath: Path to import the feature component\n * - featureComponentName: Name of the feature component\n * - layoutProps: Optional properties for the layout\n */\nexport function generateRouteTemplate(layoutName, layoutImportPath, featureImportPath, featureComponentName, extension = '.astro', layoutProps = {}) {\n const override = getTemplateOverride('route', extension, {\n layoutName,\n layoutImportPath,\n featureImportPath,\n featureComponentName,\n ...layoutProps\n });\n if (override) return override;\n\n if (layoutName === 'none') {\n return `---\nimport ${featureComponentName} from '${featureImportPath}';\n---\n\n<${featureComponentName} />\n`;\n }\n\n const propsStr = Object.entries(layoutProps)\n .map(([key, value]) => {\n if (typeof value === 'string' && value.startsWith('{') && value.endsWith('}')) {\n return `${key}=${value}`;\n }\n if (typeof value === 'string') {\n return `${key}=\"${value}\"`;\n }\n return `${key}={${JSON.stringify(value)}}`;\n })\n .join(' ');\n\n const layoutOpening = propsStr ? `<${layoutName} ${propsStr}>` : `<${layoutName}>`;\n\n return `---\nimport ${layoutName} from '${layoutImportPath}';\nimport ${featureComponentName} from '${featureImportPath}';\n---\n\n${layoutOpening}\n <${featureComponentName} />\n</${layoutName}>\n`;\n}\n\nexport function mergeRouteTemplate(existingContent, featureImportPath, featureComponentName, layoutName) {\n let content = existingContent;\n \n // 1. Add import\n const importLine = `import ${featureComponentName} from '${featureImportPath}';`;\n if (!content.includes(importLine)) {\n // Find the second --- which marks the end of frontmatter\n const lines = content.split('\\n');\n let frontMatterEndLine = -1;\n let dashCount = 0;\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trim() === '---') {\n dashCount++;\n if (dashCount === 2) {\n frontMatterEndLine = i;\n break;\n }\n }\n }\n\n if (frontMatterEndLine !== -1) {\n lines.splice(frontMatterEndLine, 0, importLine);\n content = lines.join('\\n');\n } else if (content.includes('---')) {\n // If only one --- found, maybe it's just the start? \n // But standard Astro has two. \n // Fallback: insert at the beginning if no frontmatter end found\n content = importLine + '\\n' + content;\n }\n }\n\n // 2. Add component usage\n const componentTag = `<${featureComponentName} />`;\n if (!content.includes(componentTag)) {\n if (layoutName && layoutName !== 'none') {\n const layoutEndTag = `</${layoutName}>`;\n if (content.includes(layoutEndTag)) {\n const lines = content.split('\\n');\n let layoutEndLine = -1;\n for (let i = lines.length - 1; i >= 0; i--) {\n if (lines[i].includes(layoutEndTag)) {\n layoutEndLine = i;\n break;\n }\n }\n if (layoutEndLine !== -1) {\n lines.splice(layoutEndLine, 0, ` ${componentTag}`);\n content = lines.join('\\n');\n }\n } else {\n // Layout might be self-closing or missing end tag? \n // If it's Textor generated it should have it.\n content += `\\n${componentTag}\\n`;\n }\n } else {\n content += `\\n${componentTag}\\n`;\n }\n }\n\n return content;\n}\n\n/**\n * Feature Template Variables:\n * - componentName: Name of the feature component\n * - scriptImportPath: Path to the feature's client-side script\n */\nexport function generateFeatureTemplate(componentName, scriptImportPath, framework = 'astro', extension) {\n const templateExtension = extension || (framework === 'astro' ? '.astro' : '.tsx');\n const override = getTemplateOverride('feature', templateExtension, { componentName, scriptImportPath });\n if (override) return override;\n\n if (framework === 'react') {\n return `export type ${componentName}Props = {\n // Add props here\n}\n\nexport default function ${componentName}({ }: ${componentName}Props) {\n return (\n <div className=\"${componentName.toLowerCase()}\">\n <h1>${componentName}</h1>\n </div>\n );\n}\n`;\n }\n\n const scriptTag = scriptImportPath ? `\\n<script src=\"${scriptImportPath}\"></script>` : '';\n\n return `---\n// Feature: ${componentName}\n---\n\n<div class=\"${componentName.toLowerCase()}\">\n <h1>${componentName}</h1>\n</div>${scriptTag}\n`;\n}\n\n/**\n * Scripts Index Template (no variables)\n */\nexport function generateScriptsIndexTemplate() {\n const override = getTemplateOverride('scripts-index', '.ts');\n if (override) return override;\n\n return `export {};\n`;\n}\n\n/**\n * Component Template Variables:\n * - componentName: Name of the component\n */\nexport function generateComponentTemplate(componentName, framework = 'react', extension) {\n const templateExtension = extension || (framework === 'astro' ? '.astro' : '.tsx');\n const override = getTemplateOverride('component', templateExtension, { componentName });\n if (override) return override;\n\n if (framework === 'react') {\n return `export type ${componentName}Props = {\n // Add props here\n}\n\nexport default function ${componentName}({ }: ${componentName}Props) {\n return (\n <div className=\"${componentName.toLowerCase()}\">\n {/* ${componentName} implementation */}\n </div>\n );\n}\n`;\n }\n\n return `---\nexport type Props = {\n // Add props here\n}\n\nconst props = Astro.props;\n---\n\n<div class=\"${componentName.toLowerCase()}\">\n <!-- ${componentName} implementation -->\n</div>\n`;\n}\n\n/**\n * Hook Template Variables:\n * - componentName: Name of the component\n * - hookName: Name of the hook function (e.g., useButton)\n */\nexport function generateHookTemplate(componentName, hookName) {\n const override = getTemplateOverride('hook', '.ts', { componentName, hookName });\n if (override) return override;\n\n return `import { useState } from 'react';\n\nexport function ${hookName}() {\n // Add hook logic here\n \n return {\n // Return hook values\n };\n}\n`;\n}\n\n/**\n * Context Template Variables:\n * - componentName: Name of the component\n */\nexport function generateContextTemplate(componentName) {\n const override = getTemplateOverride('context', '.tsx', { componentName });\n if (override) return override;\n\n return `import { createContext, useContext } from 'react';\n\n//@ts-ignore\ntype ${componentName}ContextValue = {\n // Add context value types here\n}\n\nconst ${componentName}Context = createContext<${componentName}ContextValue | undefined>(undefined);\n\nexport function ${componentName}Provider({ children }: { children: React.ReactNode }) {\n const value: ${componentName}ContextValue = {\n // Provide context values\n };\n\n return (\n <${componentName}Context.Provider value={value}>\n {children}\n </${componentName}Context.Provider>\n );\n}\n\nexport function use${componentName}Context() {\n const context = useContext(${componentName}Context);\n if (context === undefined) {\n throw new Error('use${componentName}Context must be used within ${componentName}Provider');\n }\n return context;\n}\n`;\n}\n\n/**\n * Test Template Variables:\n * - componentName: Name of the component\n * - componentPath: Relative path to the component file\n */\nexport function generateTestTemplate(componentName, componentPath) {\n const override = getTemplateOverride('test', '.tsx', { componentName, componentPath });\n if (override) return override;\n\n return `import { describe, it, expect } from 'vitest';\nimport { render, screen } from '@testing-library/react';\nimport ${componentName} from '${componentPath}';\n\ndescribe('${componentName}', () => {\n it('renders without crashing', () => {\n render(<${componentName} />);\n expect(screen.getByText('${componentName}')).toBeInTheDocument();\n });\n});\n`;\n}\n\n/**\n * Config Template Variables:\n * - componentName: Name of the component\n */\nexport function generateConfigTemplate(componentName) {\n const override = getTemplateOverride('config', '.ts', { componentName });\n if (override) return override;\n\n return `export const ${componentName}Config = {\n // Add configuration here\n};\n`;\n}\n\n/**\n * Constants Template Variables:\n * - componentName: Name of the component\n */\nexport function generateConstantsTemplate(componentName) {\n const override = getTemplateOverride('constants', '.ts', { componentName });\n if (override) return override;\n\n return `export const ${componentName.toUpperCase()}_CONSTANTS = {\n // Add constants here\n};\n`;\n}\n\n/**\n * Index Template Variables:\n * - componentName: Name of the component\n * - componentExtension: File extension of the component\n */\nexport function generateIndexTemplate(componentName, componentExtension) {\n const override = getTemplateOverride('index', '.ts', { componentName, componentExtension });\n if (override) return override;\n\n if (componentExtension === '.astro') {\n return `export * from './types';\n`;\n }\n\n return `export { default as ${componentName} } from './${componentName}${componentExtension}';\nexport * from './types';\n`;\n}\n\n/**\n * Types Template Variables:\n * - componentName: Name of the component\n */\nexport function generateTypesTemplate(componentName) {\n const override = getTemplateOverride('types', '.ts', { componentName });\n if (override) return override;\n\n return `export type ${componentName}Props = {\n // Add props types here\n};\n`;\n}\n\n/**\n * API Template Variables:\n * - componentName: Name of the component\n */\nexport function generateApiTemplate(componentName) {\n const override = getTemplateOverride('api', '.ts', { componentName });\n if (override) return override;\n\n return `export function GET({ params, request }) {\n return new Response(\n JSON.stringify({\n name: \"${componentName}\",\n url: \"https://astro.build/\",\n }),\n );\n}\n`;\n}\n\n/**\n * Endpoint Template Variables:\n * - componentName: Name of the component\n */\nexport function generateEndpointTemplate(componentName) {\n const override = getTemplateOverride('endpoint', '.ts', { componentName });\n if (override) return override;\n\n return `export function GET({ params, request }) {\n return new Response(\n JSON.stringify({\n name: \"${componentName}\",\n url: \"https://astro.build/\",\n }),\n );\n}\n`;\n}\n\n/**\n * Service Template Variables:\n * - componentName: Name of the component\n */\nexport function generateServiceTemplate(componentName) {\n const override = getTemplateOverride('service', '.ts', { componentName });\n if (override) return override;\n\n return `// ${componentName} business logic and transformers\nexport async function get${componentName}Data() {\n // Encapsulated logic for data processing\n return [];\n}\n\nexport function transform${componentName}Data(data: any) {\n // Domain-specific data transformations\n return data;\n}\n`;\n}\n\n/**\n * Schema Template Variables:\n * - componentName: Name of the component\n */\nexport function generateSchemaTemplate(componentName) {\n const override = getTemplateOverride('schema', '.ts', { componentName });\n if (override) return override;\n\n return `import { z } from 'zod';\n\nexport const ${componentName}Schema = z.object({\n id: z.string().uuid(),\n createdAt: z.string().datetime(),\n updatedAt: z.string().datetime().optional(),\n});\n\nexport type ${componentName} = z.infer<typeof ${componentName}Schema>;\n`;\n}\n\n/**\n * Readme Template Variables:\n * - componentName: Name of the component\n */\nexport function generateReadmeTemplate(componentName) {\n const override = getTemplateOverride('readme', '.md', { componentName });\n if (override) return override;\n\n return `# ${componentName}\n\n## Description\nBrief description of what this feature/component does.\n\n## Props/Usage\nHow to use this and what are its requirements.\n`;\n}\n\n/**\n * Stories Template Variables:\n * - componentName: Name of the component\n * - componentPath: Relative path to the component file\n */\nexport function generateStoriesTemplate(componentName, componentPath) {\n const override = getTemplateOverride('stories', '.tsx', { componentName, componentPath });\n if (override) return override;\n\n return `import type { Meta, StoryObj } from '@storybook/react';\nimport ${componentName} from '${componentPath}';\n\nconst meta: Meta<typeof ${componentName}> = {\n title: 'Components/${componentName}',\n component: ${componentName},\n};\n\nexport default meta;\ntype Story = StoryObj<typeof ${componentName}>;\n\nexport const Default: Story = {\n args: {\n // Default props\n },\n};\n`;\n}\n","import { readFile, mkdir, rename, open } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport path from 'path';\n\nconst CONFIG_DIR = '.textor';\nconst STATE_FILE = 'state.json';\n\nexport function getStatePath() {\n return path.join(process.cwd(), CONFIG_DIR, STATE_FILE);\n}\n\nexport async function loadState() {\n const statePath = getStatePath();\n if (!existsSync(statePath)) {\n return { sections: [], components: [], files: {} };\n }\n\n try {\n const content = await readFile(statePath, 'utf-8');\n const state = JSON.parse(content);\n if (!state.files) state.files = {};\n normalizeStatePaths(state);\n return state;\n } catch (error) {\n return { sections: [], components: [], files: {} };\n }\n}\n\nlet saveQueue = Promise.resolve();\n\nexport async function saveState(state) {\n const result = saveQueue.then(async () => {\n const statePath = getStatePath();\n const dir = path.dirname(statePath);\n if (!existsSync(dir)) {\n await mkdir(dir, { recursive: true });\n }\n \n const tempPath = statePath + '.' + Math.random().toString(36).slice(2) + '.tmp';\n const content = JSON.stringify(state, null, 2);\n \n const handle = await open(tempPath, 'w');\n await handle.writeFile(content, 'utf-8');\n await handle.sync();\n await handle.close();\n\n await rename(tempPath, statePath);\n });\n \n saveQueue = result.catch(() => {});\n return result;\n}\n\nexport async function registerFile(filePath, { kind, template, hash, templateVersion = '1.0.0', owner = null }) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n \n state.files[normalizedPath] = {\n kind,\n template,\n hash,\n templateVersion,\n owner,\n timestamp: new Date().toISOString()\n };\n \n await saveState(state);\n}\n\nexport async function unregisterFile(filePath) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n delete state.files[normalizedPath];\n await saveState(state);\n}\n\nexport async function getFileData(filePath) {\n const state = await loadState();\n const normalizedPath = path.relative(process.cwd(), filePath).replace(/\\\\/g, '/');\n return state.files[normalizedPath];\n}\n\nexport async function addSectionToState(section) {\n const state = await loadState();\n const normalizedSection = { ...section };\n if (normalizedSection.featurePath) {\n normalizedSection.featurePath = normalizeStatePath(normalizedSection.featurePath);\n }\n // Avoid duplicates by route AND by featurePath\n if (normalizedSection.route) {\n state.sections = state.sections.filter(s => s.route !== normalizedSection.route || s.featurePath !== normalizedSection.featurePath);\n } else {\n state.sections = state.sections.filter(s => s.featurePath !== normalizedSection.featurePath || s.route);\n }\n state.sections.push(normalizedSection);\n await saveState(state);\n}\n\nexport async function removeSectionFromState(route) {\n const state = await loadState();\n state.sections = state.sections.filter(s => s.route !== route && s.name !== route);\n await saveState(state);\n}\n\nexport async function updateSectionInState(oldRoute, newSection) {\n const state = await loadState();\n const normalizedSection = { ...newSection };\n if (normalizedSection.featurePath) {\n normalizedSection.featurePath = normalizeStatePath(normalizedSection.featurePath);\n }\n state.sections = state.sections.filter(s => s.route !== oldRoute);\n state.sections.push(normalizedSection);\n await saveState(state);\n}\n\nexport async function addComponentToState(component) {\n const state = await loadState();\n const normalizedComponent = { ...component };\n if (normalizedComponent.path) {\n normalizedComponent.path = normalizeStatePath(normalizedComponent.path);\n }\n // Avoid duplicates by name\n state.components = state.components.filter(c => c.name !== normalizedComponent.name);\n state.components.push(normalizedComponent);\n await saveState(state);\n}\n\nfunction normalizeStatePath(filePath) {\n if (!filePath || typeof filePath !== 'string') return filePath;\n const relative = path.isAbsolute(filePath)\n ? path.relative(process.cwd(), filePath)\n : filePath;\n return relative.replace(/\\\\/g, '/');\n}\n\nfunction normalizeStatePaths(state) {\n if (!state || typeof state !== 'object') return;\n if (Array.isArray(state.sections)) {\n state.sections = state.sections.map(section => {\n if (!section || typeof section !== 'object') return section;\n if (!section.featurePath) return section;\n const normalized = normalizeStatePath(section.featurePath);\n if (normalized === section.featurePath) return section;\n return { ...section, featurePath: normalized };\n });\n }\n if (Array.isArray(state.components)) {\n state.components = state.components.map(component => {\n if (!component || typeof component !== 'object') return component;\n if (!component.path) return component;\n const normalized = normalizeStatePath(component.path);\n if (normalized === component.path) return component;\n return { ...component, path: normalized };\n });\n }\n}\n\nexport async function removeComponentFromState(name) {\n const state = await loadState();\n state.components = state.components.filter(c => c.name !== name);\n await saveState(state);\n}\n\nexport function findSection(state, identifier) {\n return state.sections.find(s => s.route === identifier || s.name === identifier || s.featurePath === identifier);\n}\n\nexport function findComponent(state, name) {\n return state.components.find(c => c.name === name);\n}\n\nexport function reconstructComponents(files, config) {\n const componentsRoot = (config.paths.components || 'src/components').replace(/\\\\/g, '/');\n const components = new Map();\n\n for (const filePath in files) {\n const normalizedPath = filePath.replace(/\\\\/g, '/');\n if (normalizedPath === componentsRoot || normalizedPath.startsWith(componentsRoot + '/')) {\n const relativePath = normalizedPath === componentsRoot ? '' : normalizedPath.slice(componentsRoot.length + 1);\n if (relativePath === '') continue; // skip the root itself if it's in files for some reason\n \n const parts = relativePath.split('/');\n if (parts.length >= 1) {\n const componentName = parts[0];\n const componentPath = `${componentsRoot}/${componentName}`;\n if (!components.has(componentName)) {\n components.set(componentName, {\n name: componentName,\n path: componentPath\n });\n }\n // Attribute ownership\n if (!files[filePath].owner) {\n files[filePath].owner = componentName;\n }\n }\n }\n }\n\n return Array.from(components.values());\n}\n\nexport function reconstructSections(state, config) {\n const pagesRoot = (config.paths.pages || 'src/pages').replace(/\\\\/g, '/');\n const featuresRoot = (config.paths.features || 'src/features').replace(/\\\\/g, '/');\n const files = state.files;\n \n // Keep existing sections if their files still exist\n const validSections = (state.sections || []).filter(section => {\n // Check if route file exists in state.files\n const routeFile = Object.keys(files).find(f => {\n const normalizedF = f.replace(/\\\\/g, '/');\n const routePath = section.route === '/' ? 'index' : section.route.slice(1);\n return normalizedF.startsWith(pagesRoot + '/' + routePath + '.') || \n normalizedF === pagesRoot + '/' + routePath + '/index.astro'; // nested mode\n });\n\n // Check if feature directory has at least one file in state.files\n const hasFeatureFiles = Object.keys(files).some(f => \n f.replace(/\\\\/g, '/').startsWith(section.featurePath.replace(/\\\\/g, '/') + '/')\n );\n\n return routeFile && hasFeatureFiles;\n });\n\n const sections = new Map();\n validSections.forEach(s => sections.set(s.route, s));\n\n // Try to discover new sections\n for (const filePath in files) {\n const normalizedPath = filePath.replace(/\\\\/g, '/');\n if (normalizedPath.startsWith(pagesRoot + '/')) {\n const relativePath = normalizedPath.slice(pagesRoot.length + 1);\n const route = '/' + relativePath.replace(/\\.(astro|ts|js|tsx|jsx)$/, '').replace(/\\/index$/, '');\n const finalRoute = route === '' ? '/' : route;\n\n if (!sections.has(finalRoute)) {\n // Try to find a matching feature by name\n const routeName = path.basename(finalRoute === '/' ? 'index' : finalRoute).toLowerCase();\n // Look for a directory in features with same name or similar\n const possibleFeaturePath = Object.keys(files).find(f => {\n const nf = f.replace(/\\\\/g, '/');\n if (!nf.startsWith(featuresRoot + '/')) return false;\n const relToFeatures = nf.slice(featuresRoot.length + 1);\n const segments = relToFeatures.toLowerCase().split('/');\n return segments.includes(routeName);\n });\n\n if (possibleFeaturePath) {\n const relToFeatures = path.dirname(path.relative(featuresRoot, possibleFeaturePath)).replace(/\\\\/g, '/');\n const featurePath = relToFeatures === '.' ? featuresRoot : `${featuresRoot}/${relToFeatures}`;\n const featureName = path.basename(featurePath);\n\n sections.set(finalRoute, {\n name: featureName,\n route: finalRoute,\n featurePath: featurePath,\n extension: path.extname(filePath)\n });\n\n // Attribute ownership to discovered files\n if (!files[filePath].owner) files[filePath].owner = finalRoute;\n for (const f in files) {\n if (f.startsWith(featurePath + '/') || f === featurePath) {\n if (!files[f].owner) files[f].owner = finalRoute;\n }\n }\n }\n }\n }\n }\n\n return Array.from(sections.values());\n}\n","import { exec } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(exec);\n\nexport async function isRepoClean() {\n try {\n const { stdout } = await execAsync('git status --porcelain');\n return stdout.trim() === '';\n } catch (error) {\n // If not a git repo, we consider it clean or at least we can't check\n return true;\n }\n}\n\nexport async function stageFiles(filePaths) {\n if (!filePaths.length) return;\n try {\n const paths = filePaths.map(p => `\"${p}\"`).join(' ');\n await execAsync(`git add ${paths}`);\n } catch (error) {\n // Ignore errors if git is not available\n }\n}\n","import path from 'path';\nimport { rename, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath, getEffectiveOptions } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getFeatureFileName,\n getFeatureComponentName,\n getRelativeImportPath,\n getHookFileName,\n getHookFunctionName\n} from '../utils/naming.js';\nimport { \n calculateHash,\n ensureNotExists, \n isTextorGenerated,\n writeFileWithSignature,\n getSignature,\n ensureDir,\n secureJoin,\n formatFiles\n} from '../utils/filesystem.js';\nimport { resolvePatternedPath } from '../utils/patterns.js';\nimport { \n generateRouteTemplate, \n mergeRouteTemplate,\n generateFeatureTemplate,\n generateScriptsIndexTemplate,\n generateHookTemplate,\n generateContextTemplate,\n generateTestTemplate,\n generateIndexTemplate,\n generateTypesTemplate,\n generateApiTemplate,\n generateEndpointTemplate,\n generateServiceTemplate,\n generateSchemaTemplate,\n generateReadmeTemplate,\n generateStoriesTemplate,\n enrichData\n} from '../utils/templates.js';\nimport { addSectionToState, registerFile, loadState, saveState } from '../utils/state.js';\nimport { stageFiles } from '../utils/git.js';\n\nexport async function addSectionCommand(route, featurePath, options) {\n try {\n const config = await loadConfig();\n\n // Handle optional route\n if (typeof featurePath === 'object' || featurePath === undefined) {\n options = featurePath || options || {};\n featurePath = route;\n route = null;\n }\n \n const effectiveOptions = getEffectiveOptions(options, config, 'features');\n \n const normalizedRoute = normalizeRoute(route);\n const normalizedFeaturePath = featureToDirectoryPath(featurePath);\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const layoutsRoot = resolvePath(config, 'layouts');\n \n const routeExtension = options.endpoint ? '.ts' : config.naming.routeExtension;\n \n // Check if we should use nested mode even if config says flat\n // (because the directory already exists, suggesting it should be an index file)\n let effectiveRoutingMode = config.routing.mode;\n if (normalizedRoute && effectiveRoutingMode === 'flat') {\n const routeDirName = routeToFilePath(normalizedRoute, {\n extension: '',\n mode: 'flat'\n });\n const routeDirPath = secureJoin(pagesRoot, routeDirName);\n if (existsSync(routeDirPath)) {\n effectiveRoutingMode = 'nested';\n }\n }\n\n const routeFileName = normalizedRoute ? routeToFilePath(normalizedRoute, {\n extension: routeExtension,\n mode: effectiveRoutingMode,\n indexFile: config.routing.indexFile\n }) : null;\n \n const featureComponentName = getFeatureComponentName(normalizedFeaturePath);\n const featureFileName = getFeatureFileName(normalizedFeaturePath, {\n extension: config.naming.featureExtension,\n strategy: effectiveOptions.entry\n });\n \n const routeFilePath = routeFileName ? secureJoin(pagesRoot, routeFileName) : null;\n const featureDirPath = secureJoin(featuresRoot, normalizedFeaturePath);\n const featureFilePath = secureJoin(featureDirPath, featureFileName);\n const scriptsIndexPath = secureJoin(featureDirPath, config.features.scriptsIndexFile);\n const subComponentsDir = secureJoin(featureDirPath, 'sub-components');\n const testsDir = secureJoin(featureDirPath, '__tests__');\n const contextDirInside = secureJoin(featureDirPath, 'context');\n const hooksDirInside = secureJoin(featureDirPath, 'hooks');\n const typesDirInside = secureJoin(featureDirPath, 'types');\n const apiDirInside = secureJoin(featureDirPath, 'api');\n const servicesDirInside = secureJoin(featureDirPath, 'services');\n const schemasDirInside = secureJoin(featureDirPath, 'schemas');\n \n const {\n framework,\n layout,\n layoutProps: configLayoutProps,\n createSubComponentsDir: shouldCreateSubComponentsDir,\n createScriptsDir: shouldCreateScriptsDir,\n createApi: shouldCreateApi,\n createServices: shouldCreateServices,\n createSchemas: shouldCreateSchemas,\n createHooks: shouldCreateHooks,\n createContext: shouldCreateContext,\n createTests: shouldCreateTests,\n createTypes: shouldCreateTypes,\n createReadme: shouldCreateReadme,\n createStories: shouldCreateStories,\n createIndex: shouldCreateIndex\n } = effectiveOptions;\n\n const featurePatterns = config.filePatterns?.features || {};\n const patternData = {\n componentName: featureComponentName,\n hookName: getHookFunctionName(featureComponentName),\n hookExtension: config.naming.hookExtension,\n testExtension: config.naming.testExtension,\n featureExtension: config.naming.featureExtension,\n componentExtension: config.naming.componentExtension\n };\n\n const indexFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.index,\n patternData,\n 'index.ts',\n 'filePatterns.features.index'\n );\n const contextFilePath = resolvePatternedPath(\n contextDirInside,\n featurePatterns.context,\n patternData,\n `${featureComponentName}Context.tsx`,\n 'filePatterns.features.context'\n );\n const hookFilePath = resolvePatternedPath(\n hooksDirInside,\n featurePatterns.hook,\n patternData,\n getHookFileName(featureComponentName, config.naming.hookExtension),\n 'filePatterns.features.hook'\n );\n const testFilePath = resolvePatternedPath(\n testsDir,\n featurePatterns.test,\n patternData,\n `${featureComponentName}${config.naming.testExtension}`,\n 'filePatterns.features.test'\n );\n const typesFilePath = resolvePatternedPath(\n typesDirInside,\n featurePatterns.types,\n patternData,\n 'index.ts',\n 'filePatterns.features.types'\n );\n const apiFilePath = resolvePatternedPath(\n apiDirInside,\n featurePatterns.api,\n patternData,\n 'index.ts',\n 'filePatterns.features.api'\n );\n const servicesFilePath = resolvePatternedPath(\n servicesDirInside,\n featurePatterns.services,\n patternData,\n 'index.ts',\n 'filePatterns.features.services'\n );\n const schemasFilePath = resolvePatternedPath(\n schemasDirInside,\n featurePatterns.schemas,\n patternData,\n 'index.ts',\n 'filePatterns.features.schemas'\n );\n const readmeFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.readme,\n patternData,\n 'README.md',\n 'filePatterns.features.readme'\n );\n const storiesFilePath = resolvePatternedPath(\n featureDirPath,\n featurePatterns.stories,\n patternData,\n `${featureComponentName}.stories.tsx`,\n 'filePatterns.features.stories'\n );\n\n const routeParts = normalizedRoute ? normalizedRoute.split('/').filter(Boolean) : [];\n const reorganizations = [];\n\n if (normalizedRoute && routeParts.length > 1 && config.routing.mode === 'flat') {\n const possibleExtensions = ['.astro', '.ts', '.js', '.md', '.mdx', '.html'];\n for (let i = 1; i < routeParts.length; i++) {\n const parentRoute = '/' + routeParts.slice(0, i).join('/');\n \n for (const ext of possibleExtensions) {\n const parentRouteFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'flat'\n });\n const parentRouteFilePath = secureJoin(pagesRoot, parentRouteFileName);\n \n if (existsSync(parentRouteFilePath)) {\n const indexFile = ext === '.astro' ? config.routing.indexFile : `index${ext}`;\n const newParentRouteFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'nested',\n indexFile: indexFile\n });\n const newParentRouteFilePath = secureJoin(pagesRoot, newParentRouteFileName);\n \n if (!existsSync(newParentRouteFilePath)) {\n reorganizations.push({\n from: parentRouteFilePath,\n to: newParentRouteFilePath,\n route: parentRoute\n });\n }\n }\n }\n }\n }\n\n if (options.dryRun) {\n console.log('Dry run - would create:');\n if (routeFilePath) console.log(` Route: ${routeFilePath}`);\n console.log(` Feature: ${featureFilePath}`);\n\n for (const reorg of reorganizations) {\n console.log(` Reorganize: ${reorg.from} -> ${reorg.to}`);\n }\n \n if (shouldCreateIndex) console.log(` Index: ${indexFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n if (shouldCreateScriptsDir) console.log(` Scripts: ${scriptsIndexPath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateHooks) console.log(` Hooks: ${hookFilePath}`);\n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n \n return;\n }\n\n if (reorganizations.length > 0) {\n const state = await loadState();\n for (const reorg of reorganizations) {\n await ensureDir(path.dirname(reorg.to));\n await rename(reorg.from, reorg.to);\n \n const oldRelative = path.relative(process.cwd(), reorg.from).replace(/\\\\/g, '/');\n const newRelative = path.relative(process.cwd(), reorg.to).replace(/\\\\/g, '/');\n \n if (state.files[oldRelative]) {\n state.files[newRelative] = { ...state.files[oldRelative] };\n delete state.files[oldRelative];\n }\n\n // Update imports in the moved file\n await updateImportsInFile(reorg.to, reorg.from, reorg.to);\n \n // Update hash in state after import updates\n if (state.files[newRelative]) {\n const content = await readFile(reorg.to, 'utf-8');\n state.files[newRelative].hash = calculateHash(content, config.hashing?.normalization);\n }\n \n console.log(`✓ Reorganized ${oldRelative} to ${newRelative}`);\n }\n await saveState(state);\n }\n\n if (routeFilePath) {\n if (existsSync(routeFilePath)) {\n const configSignatures = Object.values(config.signatures || {});\n const isGenerated = await isTextorGenerated(routeFilePath, configSignatures);\n if (!isGenerated && !options.force) {\n if (routeFilePath.endsWith('.astro')) {\n console.log(`⚠ File already exists and is not managed by Textor. Adopting and merging: ${routeFilePath}`);\n } else {\n throw new Error(`File already exists: ${routeFilePath}\\nUse --force to overwrite.`);\n }\n }\n }\n }\n\n const featureExists = existsSync(featureFilePath);\n if (featureExists && !options.force) {\n console.log(`ℹ Feature already exists at ${featureFilePath}. Entering additive mode.`);\n }\n\n // Check sub-items only if not in force mode\n if (!options.force) {\n if (shouldCreateIndex && existsSync(indexFilePath)) console.log(` - Skipping existing index: ${indexFilePath}`);\n if (shouldCreateContext && existsSync(contextFilePath)) console.log(` - Skipping existing context: ${contextFilePath}`);\n if (shouldCreateHooks && existsSync(hookFilePath)) console.log(` - Skipping existing hook: ${hookFilePath}`);\n if (shouldCreateTests && existsSync(testFilePath)) console.log(` - Skipping existing test: ${testFilePath}`);\n if (shouldCreateTypes && existsSync(typesFilePath)) console.log(` - Skipping existing types: ${typesFilePath}`);\n if (shouldCreateApi && existsSync(apiFilePath)) console.log(` - Skipping existing api: ${apiFilePath}`);\n if (shouldCreateServices && existsSync(servicesFilePath)) console.log(` - Skipping existing services: ${servicesFilePath}`);\n if (shouldCreateSchemas && existsSync(schemasFilePath)) console.log(` - Skipping existing schemas: ${schemasFilePath}`);\n if (shouldCreateReadme && existsSync(readmeFilePath)) console.log(` - Skipping existing readme: ${readmeFilePath}`);\n if (shouldCreateStories && existsSync(storiesFilePath)) console.log(` - Skipping existing stories: ${storiesFilePath}`);\n if (shouldCreateScriptsDir && existsSync(scriptsIndexPath)) console.log(` - Skipping existing scripts: ${scriptsIndexPath}`);\n }\n \n let layoutImportPath = null;\n const cliProps = options.prop || {};\n const rawLayoutProps = { ...configLayoutProps, ...cliProps };\n const layoutProps = {};\n \n // Resolve variables in layoutProps\n const substitutionData = enrichData({\n componentName: featureComponentName,\n layoutName: layout,\n featureComponentName: featureComponentName\n });\n\n for (const [key, value] of Object.entries(rawLayoutProps)) {\n if (typeof value === 'string') {\n let resolvedValue = value;\n for (const [varKey, varValue] of Object.entries(substitutionData)) {\n const regex = new RegExp(`{{${varKey}}}`, 'g');\n resolvedValue = resolvedValue.replace(regex, varValue);\n const underscoreRegex = new RegExp(`__${varKey}__`, 'g');\n resolvedValue = resolvedValue.replace(underscoreRegex, varValue);\n }\n layoutProps[key] = resolvedValue;\n } else {\n layoutProps[key] = value;\n }\n }\n\n if (routeFilePath && layout !== 'none') {\n if (config.importAliases.layouts) {\n layoutImportPath = `${config.importAliases.layouts}/${layout}.astro`;\n } else {\n const layoutFilePath = secureJoin(layoutsRoot, `${layout}.astro`);\n layoutImportPath = getRelativeImportPath(routeFilePath, layoutFilePath);\n }\n }\n\n let featureImportPath = null;\n if (routeFilePath) {\n if (config.importAliases.features) {\n const entryPart = effectiveOptions.entry === 'index' ? '/index' : `/${featureComponentName}`;\n // In Astro, we can often omit the extension for .tsx files, but not for .astro files if using aliases sometimes.\n // However, to be safe, we use the configured extension.\n featureImportPath = `${config.importAliases.features}/${normalizedFeaturePath}${entryPart}${config.naming.featureExtension}`;\n } else {\n const relativeFeatureFile = getRelativeImportPath(routeFilePath, featureFilePath);\n // Remove extension for import if it's not an .astro file\n if (config.naming.featureExtension === '.astro') {\n featureImportPath = relativeFeatureFile;\n } else {\n featureImportPath = relativeFeatureFile.replace(/\\.[^/.]+$/, '');\n }\n }\n }\n \n let scriptImportPath;\n if (shouldCreateScriptsDir) {\n scriptImportPath = getRelativeImportPath(featureFilePath, scriptsIndexPath);\n }\n\n let routeContent;\n let routeSignature;\n \n if (routeFilePath) {\n if (options.endpoint) {\n routeContent = generateEndpointTemplate(featureComponentName);\n routeSignature = getSignature(config, 'typescript');\n } else {\n routeSignature = getSignature(config, 'astro');\n \n if (existsSync(routeFilePath)) {\n const existingContent = await readFile(routeFilePath, 'utf-8');\n // Strip existing signature if present\n let contentToMerge = existingContent;\n if (existingContent.startsWith(routeSignature)) {\n contentToMerge = existingContent.slice(routeSignature.length).trimStart();\n } else {\n // Check for generic signature if specific one doesn't match\n const genericSignature = '@generated by Textor';\n if (existingContent.includes(genericSignature)) {\n const lines = existingContent.split('\\n');\n if (lines[0].includes(genericSignature)) {\n lines.shift();\n contentToMerge = lines.join('\\n').trimStart();\n }\n }\n }\n \n routeContent = mergeRouteTemplate(\n contentToMerge,\n featureImportPath,\n featureComponentName,\n layout\n );\n } else {\n routeContent = generateRouteTemplate(\n layout,\n layoutImportPath,\n featureImportPath,\n featureComponentName,\n routeExtension,\n layoutProps\n );\n }\n }\n }\n \n const featureContent = generateFeatureTemplate(featureComponentName, scriptImportPath, framework, config.naming.featureExtension);\n \n const writtenFiles = [];\n\n if (routeFilePath) {\n const routeHash = await writeFileWithSignature(\n routeFilePath,\n routeContent,\n routeSignature,\n config.hashing?.normalization\n );\n await registerFile(routeFilePath, { \n kind: 'route', \n template: options.endpoint ? 'endpoint' : 'route', \n hash: routeHash,\n owner: normalizedRoute \n });\n writtenFiles.push(routeFilePath);\n }\n\n await ensureDir(featureDirPath);\n \n if (shouldCreateSubComponentsDir) await ensureDir(subComponentsDir);\n if (shouldCreateApi) await ensureDir(apiDirInside);\n if (shouldCreateServices) await ensureDir(servicesDirInside);\n if (shouldCreateSchemas) await ensureDir(schemasDirInside);\n if (shouldCreateHooks) await ensureDir(hooksDirInside);\n if (shouldCreateContext) await ensureDir(contextDirInside);\n if (shouldCreateTests) await ensureDir(testsDir);\n if (shouldCreateTypes) await ensureDir(typesDirInside);\n\n const featureSignature = getSignature(config, config.naming.featureExtension === '.astro' ? 'astro' : 'tsx');\n\n if (!featureExists || options.force) {\n const featureHash = await writeFileWithSignature(\n featureFilePath,\n featureContent,\n featureSignature,\n config.hashing?.normalization\n );\n await registerFile(featureFilePath, { \n kind: 'feature', \n template: 'feature', \n hash: featureHash,\n owner: normalizedRoute \n });\n writtenFiles.push(featureFilePath);\n }\n\n if (shouldCreateScriptsDir && (!existsSync(scriptsIndexPath) || options.force)) {\n const hash = await writeFileWithSignature(\n scriptsIndexPath,\n generateScriptsIndexTemplate(),\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(scriptsIndexPath, { \n kind: 'feature-file', \n template: 'scripts-index', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(scriptsIndexPath);\n }\n\n if (shouldCreateIndex && (!existsSync(indexFilePath) || options.force)) {\n const indexContent = generateIndexTemplate(featureComponentName, config.naming.featureExtension);\n const hash = await writeFileWithSignature(\n indexFilePath,\n indexContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(indexFilePath, { \n kind: 'feature-file', \n template: 'index', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(indexFilePath);\n }\n\n if (shouldCreateApi && (!existsSync(apiFilePath) || options.force)) {\n const apiContent = generateApiTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n apiFilePath, \n apiContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(apiFilePath, { \n kind: 'feature-file', \n template: 'api', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(apiFilePath);\n }\n\n if (shouldCreateServices && (!existsSync(servicesFilePath) || options.force)) {\n const servicesContent = generateServiceTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n servicesFilePath, \n servicesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(servicesFilePath, { \n kind: 'feature-file', \n template: 'service', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(servicesFilePath);\n }\n\n if (shouldCreateSchemas && (!existsSync(schemasFilePath) || options.force)) {\n const schemasContent = generateSchemaTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n schemasFilePath, \n schemasContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(schemasFilePath, { \n kind: 'feature-file', \n template: 'schema', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(schemasFilePath);\n }\n\n if (shouldCreateHooks && (!existsSync(hookFilePath) || options.force)) {\n const hookName = getHookFunctionName(featureComponentName);\n const hookContent = generateHookTemplate(featureComponentName, hookName);\n const hash = await writeFileWithSignature(\n hookFilePath, \n hookContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(hookFilePath, { \n kind: 'feature-file', \n template: 'hook', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(hookFilePath);\n }\n\n if (shouldCreateContext && (!existsSync(contextFilePath) || options.force)) {\n const contextContent = generateContextTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n contextFilePath, \n contextContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(contextFilePath, { \n kind: 'feature-file', \n template: 'context', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(contextFilePath);\n }\n\n if (shouldCreateTests && (!existsSync(testFilePath) || options.force)) {\n const relativeFeaturePath = `./${path.basename(featureFilePath)}`;\n const testContent = generateTestTemplate(featureComponentName, relativeFeaturePath);\n const hash = await writeFileWithSignature(\n testFilePath, \n testContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(testFilePath, { \n kind: 'feature-file', \n template: 'test', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(testFilePath);\n }\n\n if (shouldCreateTypes && (!existsSync(typesFilePath) || options.force)) {\n const typesContent = generateTypesTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n typesFilePath, \n typesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(typesFilePath, { \n kind: 'feature-file', \n template: 'types', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(typesFilePath);\n }\n\n if (shouldCreateReadme && (!existsSync(readmeFilePath) || options.force)) {\n const readmeContent = generateReadmeTemplate(featureComponentName);\n const hash = await writeFileWithSignature(\n readmeFilePath, \n readmeContent, \n getSignature(config, 'astro'),\n config.hashing?.normalization\n );\n await registerFile(readmeFilePath, { \n kind: 'feature-file', \n template: 'readme', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(readmeFilePath);\n }\n\n if (shouldCreateStories && (!existsSync(storiesFilePath) || options.force)) {\n const relativePath = `./${path.basename(featureFilePath)}`;\n const storiesContent = generateStoriesTemplate(featureComponentName, relativePath);\n const hash = await writeFileWithSignature(\n storiesFilePath, \n storiesContent, \n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(storiesFilePath, { \n kind: 'feature-file', \n template: 'stories', \n hash,\n owner: normalizedRoute \n });\n writtenFiles.push(storiesFilePath);\n }\n \n // Formatting\n if (config.formatting.tool !== 'none') {\n await formatFiles(writtenFiles, config.formatting.tool);\n }\n\n console.log('✓ Section created successfully:');\n if (routeFilePath) console.log(` Route: ${routeFilePath}`);\n console.log(` Feature: ${featureFilePath}`);\n \n if (shouldCreateIndex) console.log(` Index: ${indexFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n if (shouldCreateScriptsDir) console.log(` Scripts: ${scriptsIndexPath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateHooks) console.log(` Hooks: ${hookFilePath}`);\n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n \n await addSectionToState({\n name: options.name || featureComponentName,\n route: normalizedRoute,\n featurePath: normalizedFeaturePath,\n layout: layout,\n extension: routeExtension\n });\n\n if (config.git?.stageChanges) {\n await stageFiles(writtenFiles);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n","import path from 'path';\nimport { rename, readFile, writeFile, readdir } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getRelativeImportPath\n} from '../utils/naming.js';\nimport { \n calculateHash,\n safeDelete, \n safeDeleteDir,\n cleanupEmptyDirs,\n secureJoin \n} from '../utils/filesystem.js';\nimport { loadState, findSection, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\n\nexport async function removeSectionCommand(route, featurePath, options) {\n try {\n const config = await loadConfig();\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n \n let section = findSection(state, route);\n if (!section && featurePath) {\n section = findSection(state, featurePath);\n }\n\n const targetRoute = section ? section.route : route;\n const targetFeaturePath = section ? section.featurePath : featurePath;\n\n if (!targetFeaturePath) {\n throw new Error(`Section not found for identifier: ${route}. Please provide both route and featurePath.`);\n }\n \n const normalizedRoute = normalizeRoute(targetRoute);\n const normalizedFeaturePath = featureToDirectoryPath(targetFeaturePath);\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const configSignatures = Object.values(config.signatures || {});\n\n // Find route file in state if possible\n let routeFilePath = null;\n const routeRelPath = Object.keys(state.files).find(f => {\n const data = state.files[f];\n return data.kind === 'route' && data.owner === normalizedRoute;\n });\n\n if (routeRelPath) {\n routeFilePath = path.resolve(process.cwd(), routeRelPath);\n } else {\n const routeExtension = (section && section.extension) || config.naming.routeExtension;\n const routeFileName = routeToFilePath(normalizedRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n routeFilePath = secureJoin(pagesRoot, routeFileName);\n }\n \n const featureDirPath = secureJoin(featuresRoot, normalizedFeaturePath);\n \n const deletedFiles = [];\n const skippedFiles = [];\n const deletedDirs = [];\n \n if (options.dryRun) {\n console.log('Dry run - would delete:');\n \n if (!options.keepRoute) {\n console.log(` Route: ${routeFilePath}`);\n }\n \n if (!options.keepFeature) {\n console.log(` Feature: ${featureDirPath}/`);\n }\n \n return;\n }\n \n if (!options.keepRoute) {\n const normalizedPath = path.relative(process.cwd(), routeFilePath).replace(/\\\\/g, '/');\n const fileState = state.files[normalizedPath];\n const result = await safeDelete(routeFilePath, {\n force: options.force,\n expectedHash: fileState?.hash,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: normalizedRoute,\n actualOwner: fileState?.owner,\n signatures: configSignatures\n });\n \n if (result.deleted) {\n deletedFiles.push(routeFilePath);\n delete state.files[normalizedPath];\n } else if (result.message) {\n skippedFiles.push({ path: routeFilePath, reason: result.message });\n }\n }\n \n if (!options.keepFeature) {\n const result = await safeDeleteDir(featureDirPath, {\n force: options.force,\n stateFiles: state.files,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: normalizedRoute,\n signatures: configSignatures\n });\n \n if (result.deleted) {\n deletedDirs.push(featureDirPath);\n // Unregister all files that were in this directory\n const dirPrefix = path.relative(process.cwd(), featureDirPath).replace(/\\\\/g, '/') + '/';\n for (const f in state.files) {\n if (f.startsWith(dirPrefix)) {\n delete state.files[f];\n }\n }\n } else if (result.message) {\n skippedFiles.push({ path: featureDirPath, reason: result.message });\n }\n }\n \n if (!options.keepRoute && deletedFiles.includes(routeFilePath)) {\n await cleanupEmptyDirs(path.dirname(routeFilePath), pagesRoot);\n }\n \n if (!options.keepFeature && deletedDirs.includes(featureDirPath)) {\n await cleanupEmptyDirs(path.dirname(featureDirPath), featuresRoot);\n }\n \n if (deletedFiles.length > 0 || deletedDirs.length > 0) {\n console.log('✓ Deleted:');\n deletedFiles.forEach(file => console.log(` ${file}`));\n deletedDirs.forEach(dir => console.log(` ${dir}/`));\n }\n \n if (skippedFiles.length > 0) {\n console.log('\\n⚠ Skipped:');\n skippedFiles.forEach(item => {\n console.log(` ${item.path}`);\n console.log(` Reason: ${item.reason}`);\n });\n }\n \n if (deletedFiles.length === 0 && deletedDirs.length === 0 && skippedFiles.length === 0) {\n if (section) {\n console.log(`✓ Section ${normalizedRoute} removed from state (files were already missing on disk).`);\n state.sections = state.sections.filter(s => s.route !== normalizedRoute);\n await saveState(state);\n } else {\n console.log('No files to delete.');\n }\n } else {\n // Reorganization (Flattening)\n if (!options.keepRoute && deletedFiles.length > 0 && config.routing.mode === 'flat') {\n const routeParts = normalizedRoute.split('/').filter(Boolean);\n if (routeParts.length > 1) {\n for (let i = routeParts.length - 1; i >= 1; i--) {\n const parentRoute = '/' + routeParts.slice(0, i).join('/');\n const parentDirName = routeParts.slice(0, i).join('/');\n const parentDirPath = secureJoin(pagesRoot, parentDirName);\n \n if (existsSync(parentDirPath)) {\n const filesInDir = await readdir(parentDirPath);\n \n if (filesInDir.length === 1) {\n const loneFile = filesInDir[0];\n const ext = path.extname(loneFile);\n const indexFile = ext === '.astro' ? config.routing.indexFile : `index${ext}`;\n \n if (loneFile === indexFile) {\n const loneFilePath = path.join(parentDirPath, loneFile);\n const oldRelative = path.relative(process.cwd(), loneFilePath).replace(/\\\\/g, '/');\n\n if (state.files[oldRelative] && state.files[oldRelative].kind === 'route') {\n const flatFileName = routeToFilePath(parentRoute, {\n extension: ext,\n mode: 'flat'\n });\n const flatFilePath = secureJoin(pagesRoot, flatFileName);\n \n if (!existsSync(flatFilePath)) {\n await rename(loneFilePath, flatFilePath);\n \n const newRelative = path.relative(process.cwd(), flatFilePath).replace(/\\\\/g, '/');\n \n state.files[newRelative] = { ...state.files[oldRelative] };\n delete state.files[oldRelative];\n \n await updateImportsInFile(flatFilePath, loneFilePath, flatFilePath);\n\n // Update hash in state after import updates\n const content = await readFile(flatFilePath, 'utf-8');\n state.files[newRelative].hash = calculateHash(content, config.hashing?.normalization);\n\n console.log(`✓ Reorganized ${oldRelative} to ${newRelative} (flattened)`);\n await cleanupEmptyDirs(parentDirPath, pagesRoot);\n }\n }\n }\n }\n }\n }\n }\n }\n\n state.sections = state.sections.filter(s => s.route !== normalizedRoute);\n await saveState(state);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n","import path from 'path';\nimport { readdir, stat, rmdir, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { safeMove, ensureDir, scanDirectory, calculateHash } from './filesystem.js';\nimport { getRelativeImportPath } from './naming.js';\nimport { resolvePath } from './config.js';\n\n/**\n * Updates relative imports in a file after it has been moved.\n */\nexport async function updateImportsInFile(filePath, oldFilePath, newFilePath) {\n if (!existsSync(filePath)) return;\n \n let content = await readFile(filePath, 'utf-8');\n const oldDir = path.dirname(oldFilePath);\n const newDir = path.dirname(newFilePath);\n \n if (oldDir === newDir) return;\n \n // Find all relative imports\n const relativeImportRegex = /from\\s+['\"](\\.\\.?\\/[^'\"]+)['\"]/g;\n let match;\n const replacements = [];\n \n while ((match = relativeImportRegex.exec(content)) !== null) {\n const relativePath = match[1];\n const absoluteTarget = path.resolve(oldDir, relativePath);\n const newRelativePath = getRelativeImportPath(newFilePath, absoluteTarget);\n \n replacements.push({\n full: match[0],\n oldRel: relativePath,\n newRel: newRelativePath\n });\n }\n \n for (const repl of replacements) {\n content = content.replace(repl.full, `from '${repl.newRel}'`);\n }\n \n await writeFile(filePath, content, 'utf-8');\n}\n\n/**\n * Moves a directory and its contents, renaming files and updating internal content/imports.\n */\nexport async function moveDirectory(fromPath, toPath, state, config, options = {}) {\n const { fromName, toName, owner = null, signatures = [] } = options;\n \n if (!existsSync(fromPath)) {\n throw new Error(`Source directory not found: ${fromPath}`);\n }\n \n if (existsSync(toPath) && !options.force) {\n throw new Error(\n `Destination already exists: ${toPath}\\n` +\n `Use --force to overwrite.`\n );\n }\n \n await ensureDir(toPath);\n \n const entries = await readdir(fromPath);\n \n for (const entry of entries) {\n let targetEntry = entry;\n \n // Rename files if they match the component name\n if (fromName && toName && fromName !== toName) {\n if (entry.includes(fromName)) {\n targetEntry = entry.replace(fromName, toName);\n }\n }\n \n const fromEntryPath = path.join(fromPath, entry);\n const toEntryPath = path.join(toPath, targetEntry);\n \n const stats = await stat(fromEntryPath);\n \n if (stats.isDirectory()) {\n await moveDirectory(fromEntryPath, toEntryPath, state, config, options);\n } else {\n const normalizedFromRelative = path.relative(process.cwd(), fromEntryPath).replace(/\\\\/g, '/');\n const fileState = state.files[normalizedFromRelative];\n \n const newHash = await safeMove(fromEntryPath, toEntryPath, {\n force: options.force,\n expectedHash: fileState?.hash,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner,\n actualOwner: fileState?.owner,\n signatures\n });\n \n // Update internal content (signatures, component names) if renaming\n if (fromName && toName && fromName !== toName) {\n let content = await readFile(toEntryPath, 'utf-8');\n let hasChanged = false;\n \n // Simple replacement of component names\n if (content.includes(fromName)) {\n content = content.replace(new RegExp(fromName, 'g'), toName);\n hasChanged = true;\n }\n \n // Also handle lowercase class names if any\n const fromLower = fromName.toLowerCase();\n const toLower = toName.toLowerCase();\n if (content.includes(fromLower)) {\n content = content.replace(new RegExp(fromLower, 'g'), toLower);\n hasChanged = true;\n }\n\n if (hasChanged) {\n await writeFile(toEntryPath, content, 'utf-8');\n // Re-calculate hash after content update\n const updatedHash = calculateHash(content, config.hashing?.normalization);\n \n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: updatedHash };\n delete state.files[normalizedFromRelative];\n }\n } else {\n // Update state for each file moved normally\n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: newHash };\n delete state.files[normalizedFromRelative];\n }\n }\n } else {\n // Update state for each file moved normally\n const normalizedToRelative = path.relative(process.cwd(), toEntryPath).replace(/\\\\/g, '/');\n if (fileState) {\n state.files[normalizedToRelative] = { ...fileState, hash: newHash };\n delete state.files[normalizedFromRelative];\n }\n }\n }\n }\n \n const remainingFiles = await readdir(fromPath);\n if (remainingFiles.length === 0) {\n await rmdir(fromPath);\n }\n}\n\n/**\n * Scans the project and replaces imports of a moved/renamed item.\n */\nexport async function scanAndReplaceImports(config, state, fromInfo, toInfo, options) {\n const { fromPath: fromItemPath, fromName, type } = fromInfo;\n const { toPath: toItemPath, toName } = toInfo;\n \n const allFiles = new Set();\n await scanDirectory(process.cwd(), allFiles);\n \n const rootPath = resolvePath(config, type === 'component' ? 'components' : 'features');\n \n for (const relPath of allFiles) {\n const fullPath = path.resolve(process.cwd(), relPath);\n \n // Skip the moved directory itself\n const toFullPath = path.resolve(toItemPath);\n if (fullPath.startsWith(toFullPath)) continue;\n\n let content = await readFile(fullPath, 'utf-8');\n let changed = false;\n\n const aliasBase = config.importAliases[type === 'component' ? 'components' : 'features'];\n const ext = type === 'component' ? '' : (config.naming.featureExtension === '.astro' ? '.astro' : '');\n\n if (aliasBase) {\n const oldAlias = `${aliasBase}/${fromItemPath}`;\n const newAlias = `${aliasBase}/${toItemPath}`;\n \n const oldFullImport = `from '${oldAlias}/${fromName}${ext}'`;\n const newFullImport = `from '${newAlias}/${toName}${ext}'`;\n \n if (content.includes(oldFullImport)) {\n content = content.replace(new RegExp(oldFullImport.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newFullImport);\n changed = true;\n } else if (content.includes(oldAlias)) {\n content = content.replace(new RegExp(oldAlias.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newAlias);\n changed = true;\n }\n } else {\n const oldDir = path.resolve(rootPath, fromItemPath);\n const newDir = path.resolve(rootPath, toItemPath);\n \n const oldRelPath = getRelativeImportPath(fullPath, oldDir);\n const newRelPath = getRelativeImportPath(fullPath, newDir);\n \n const oldImport = `'${oldRelPath}/${fromName}${ext}'`;\n const newImport = `'${newRelPath}/${toName}${ext}'`;\n \n if (content.includes(oldImport)) {\n content = content.replace(new RegExp(oldImport.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newImport);\n changed = true;\n }\n }\n\n if (fromName !== toName && changed) {\n content = content.replace(new RegExp(`\\\\b${fromName}\\\\b`, 'g'), toName);\n }\n\n if (changed) {\n if (options.dryRun) {\n console.log(` [Scan] Would update imports in ${relPath}`);\n } else {\n await writeFile(fullPath, content, 'utf-8');\n console.log(` [Scan] Updated imports in ${relPath}`);\n \n if (state.files[relPath]) {\n state.files[relPath].hash = calculateHash(content, config.hashing?.normalization);\n }\n }\n }\n }\n}\n","import path from 'path';\nimport { readdir, stat, rmdir, readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { \n normalizeRoute, \n routeToFilePath, \n featureToDirectoryPath,\n getFeatureComponentName,\n getRelativeImportPath \n} from '../utils/naming.js';\nimport { \n calculateHash,\n safeMove,\n ensureDir,\n updateSignature,\n cleanupEmptyDirs,\n secureJoin,\n scanDirectory\n} from '../utils/filesystem.js';\nimport { loadState, findSection, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\nimport { \n updateImportsInFile,\n moveDirectory,\n scanAndReplaceImports\n} from '../utils/refactor.js';\n\n/**\n * Move a section (route + feature).\n * \n * SCOPE GUARANTEES:\n * - Automatically updates imports in the moved route file.\n * - Automatically updates internal imports/references within the moved feature directory.\n * - Repo-wide scan for import updates is available via the --scan flag.\n * \n * NON-GOALS (What it won't rewrite):\n * - String literals (unless they match the component name exactly in a JSX context).\n * - Markdown documentation (except for those registered in state).\n * - Dynamic imports with complex template literals.\n */\nexport async function moveSectionCommand(fromRoute, fromFeature, toRoute, toFeature, options) {\n try {\n const config = await loadConfig();\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n\n let actualFromRoute = fromRoute;\n let actualFromFeature = fromFeature;\n let actualToRoute = toRoute;\n let actualToFeature = toFeature;\n\n // Shift arguments if using state or if called with fewer arguments\n if (!toRoute && fromRoute && fromFeature) {\n // textor move-section /old-route /new-route\n actualFromRoute = fromRoute;\n actualToRoute = fromFeature;\n actualFromFeature = undefined;\n actualToFeature = undefined;\n }\n\n // Lookup missing info from state\n if (actualFromRoute && !actualFromFeature) {\n const section = findSection(state, actualFromRoute);\n if (section) {\n actualFromFeature = section.featurePath;\n }\n } else if (!actualFromRoute && actualFromFeature) {\n const section = findSection(state, actualFromFeature);\n if (section) {\n actualFromRoute = section.route;\n }\n }\n\n // If toFeature is not provided, try to derive it from the new route if route moved\n if (!actualToFeature && actualToRoute && actualFromRoute && actualFromRoute !== actualToRoute && actualFromFeature) {\n const oldRouteParts = actualFromRoute.split('/').filter(Boolean);\n const newRouteParts = actualToRoute.split('/').filter(Boolean);\n const oldFeatureParts = actualFromFeature.split('/').filter(Boolean);\n \n let match = true;\n for (let i = 0; i < oldRouteParts.length; i++) {\n const routePart = oldRouteParts[i].toLowerCase();\n const featurePart = oldFeatureParts[i] ? oldFeatureParts[i].toLowerCase() : null;\n \n if (featurePart !== routePart) {\n match = false;\n break;\n }\n }\n \n if (match && oldRouteParts.length > 0) {\n actualToFeature = [...newRouteParts, ...oldFeatureParts.slice(oldRouteParts.length)].join('/');\n } else {\n actualToFeature = actualFromFeature;\n }\n } else if (!actualToFeature) {\n actualToFeature = actualFromFeature;\n }\n\n if (!actualToRoute) {\n actualToRoute = actualFromRoute;\n }\n\n \n const isRouteOnly = options.keepFeature || (!actualToFeature && actualToRoute && !actualFromFeature);\n \n if (isRouteOnly && !actualToRoute) {\n throw new Error('Destination route required for route-only move');\n }\n \n const normalizedFromRoute = normalizeRoute(actualFromRoute);\n const normalizedToRoute = normalizeRoute(actualToRoute);\n const normalizedFromFeature = actualFromFeature ? featureToDirectoryPath(actualFromFeature) : null;\n const normalizedToFeature = actualToFeature ? featureToDirectoryPath(actualToFeature) : null;\n \n const pagesRoot = resolvePath(config, 'pages');\n const featuresRoot = resolvePath(config, 'features');\n const configSignatures = Object.values(config.signatures || {});\n \n const fromSection = findSection(state, actualFromRoute);\n const routeExtension = (fromSection && fromSection.extension) || config.naming.routeExtension;\n \n const fromRouteFile = routeToFilePath(normalizedFromRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n const toRouteFile = routeToFilePath(normalizedToRoute, {\n extension: routeExtension,\n mode: config.routing.mode,\n indexFile: config.routing.indexFile\n });\n \n const fromRoutePath = fromRouteFile ? secureJoin(pagesRoot, fromRouteFile) : null;\n const toRoutePath = toRouteFile ? secureJoin(pagesRoot, toRouteFile) : null;\n \n const movedFiles = [];\n \n if (options.dryRun) {\n console.log('Dry run - would move:');\n if (fromRoutePath && toRoutePath && fromRoutePath !== toRoutePath) {\n console.log(` Route: ${fromRoutePath} -> ${toRoutePath}`);\n }\n \n if (!isRouteOnly && normalizedFromFeature && normalizedToFeature) {\n const fromFeaturePath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeaturePath = secureJoin(featuresRoot, normalizedToFeature);\n console.log(` Feature: ${fromFeaturePath} -> ${toFeaturePath}`);\n }\n \n return;\n }\n \n let normalizedToRouteRelative = null;\n if (fromRoutePath && toRoutePath) {\n const normalizedFromRouteRelative = path.relative(process.cwd(), fromRoutePath).replace(/\\\\/g, '/');\n const routeFileState = state.files[normalizedFromRouteRelative];\n\n const newRouteHash = await safeMove(fromRoutePath, toRoutePath, {\n force: options.force,\n expectedHash: routeFileState?.hash,\n acceptChanges: options.acceptChanges,\n owner: normalizedFromRoute,\n actualOwner: routeFileState?.owner,\n signatures: configSignatures\n });\n \n if (fromRoutePath !== toRoutePath) {\n movedFiles.push({ from: fromRoutePath, to: toRoutePath });\n }\n \n // Update state for moved route file\n normalizedToRouteRelative = path.relative(process.cwd(), toRoutePath).replace(/\\\\/g, '/');\n if (routeFileState) {\n state.files[normalizedToRouteRelative] = { ...routeFileState, hash: newRouteHash };\n if (fromRoutePath !== toRoutePath) {\n delete state.files[normalizedFromRouteRelative];\n }\n }\n \n // Update imports in the route file (even if it didn't move, as feature might have)\n const targetFeature = normalizedToFeature || normalizedFromFeature;\n if (targetFeature && existsSync(toRoutePath)) {\n const fromFeatureDirPath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeatureDirPath = secureJoin(featuresRoot, targetFeature);\n const fromFeatureComponentName = getFeatureComponentName(normalizedFromFeature);\n const toFeatureComponentName = getFeatureComponentName(targetFeature);\n\n // First, update all relative imports in the file because it moved (or stayed)\n await updateImportsInFile(toRoutePath, fromRoutePath, toRoutePath);\n\n let content = await readFile(toRoutePath, 'utf-8');\n let changed = false;\n\n // Update component name in JSX tags\n if (fromFeatureComponentName !== toFeatureComponentName) {\n content = content.replace(\n new RegExp(`<${fromFeatureComponentName}`, 'g'),\n `<${toFeatureComponentName}`\n );\n content = content.replace(\n new RegExp(`</${fromFeatureComponentName}`, 'g'),\n `</${toFeatureComponentName}`\n );\n changed = true;\n }\n\n if (config.importAliases.features) {\n const oldAliasPath = `${config.importAliases.features}/${normalizedFromFeature}`;\n const newAliasPath = `${config.importAliases.features}/${targetFeature}`;\n \n // Flexible regex to match import identifier and path with alias\n const importRegex = new RegExp(`(import\\\\s+)(${fromFeatureComponentName})(\\\\s+from\\\\s+['\"])${oldAliasPath}(/[^'\"]+)?(['\"])`, 'g');\n \n if (importRegex.test(content)) {\n content = content.replace(importRegex, (match, p1, p2, p3, subPath, p5) => {\n let newSubPath = subPath || '';\n if (subPath && subPath.includes(fromFeatureComponentName)) {\n newSubPath = subPath.replace(fromFeatureComponentName, toFeatureComponentName);\n }\n return `${p1}${toFeatureComponentName}${p3}${newAliasPath}${newSubPath}${p5}`;\n });\n changed = true;\n } else if (content.includes(oldAliasPath)) {\n // Fallback for path only replacement\n content = content.replace(new RegExp(oldAliasPath.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&'), 'g'), newAliasPath);\n changed = true;\n }\n } else {\n const oldRelativeDir = getRelativeImportPath(toRoutePath, fromFeatureDirPath);\n const newRelativeDir = getRelativeImportPath(toRoutePath, toFeatureDirPath);\n \n // Flexible regex for relative imports\n const relImportRegex = new RegExp(`(import\\\\s+)(${fromFeatureComponentName})(\\\\s+from\\\\s+['\"])${oldRelativeDir}(/[^'\"]+)?(['\"])`, 'g');\n \n if (relImportRegex.test(content)) {\n content = content.replace(relImportRegex, (match, p1, p2, p3, subPath, p5) => {\n let newSubPath = subPath || '';\n if (subPath && subPath.includes(fromFeatureComponentName)) {\n newSubPath = subPath.replace(fromFeatureComponentName, toFeatureComponentName);\n }\n return `${p1}${toFeatureComponentName}${p3}${newRelativeDir}${newSubPath}${p5}`;\n });\n changed = true;\n }\n }\n\n if (changed) {\n await writeFile(toRoutePath, content, 'utf-8');\n // Update hash in state after changes\n if (state.files[normalizedToRouteRelative]) {\n state.files[normalizedToRouteRelative].hash = calculateHash(content, config.hashing?.normalization);\n }\n }\n }\n }\n \n if (!isRouteOnly && normalizedFromFeature && normalizedToFeature && normalizedFromFeature !== normalizedToFeature) {\n const fromFeaturePath = secureJoin(featuresRoot, normalizedFromFeature);\n const toFeaturePath = secureJoin(featuresRoot, normalizedToFeature);\n \n const fromFeatureComponentName = getFeatureComponentName(normalizedFromFeature);\n const toFeatureComponentName = getFeatureComponentName(normalizedToFeature);\n \n if (existsSync(fromFeaturePath)) {\n await moveDirectory(fromFeaturePath, toFeaturePath, state, config, {\n ...options,\n fromName: fromFeatureComponentName,\n toName: toFeatureComponentName,\n owner: normalizedFromRoute,\n signatures: configSignatures\n });\n movedFiles.push({ from: fromFeaturePath, to: toFeaturePath });\n \n await cleanupEmptyDirs(path.dirname(fromFeaturePath), featuresRoot);\n }\n }\n\n if (options.scan && (normalizedFromFeature || normalizedToFeature)) {\n await scanAndReplaceImports(config, state, {\n fromPath: normalizedFromFeature,\n fromName: getFeatureComponentName(normalizedFromFeature),\n type: 'feature'\n }, {\n toPath: normalizedToFeature || normalizedFromFeature,\n toName: getFeatureComponentName(normalizedToFeature || normalizedFromFeature)\n }, options);\n }\n \n if (fromRoutePath && toRoutePath && fromRoutePath !== toRoutePath) {\n await cleanupEmptyDirs(path.dirname(fromRoutePath), pagesRoot);\n }\n \n console.log('✓ Moved:');\n movedFiles.forEach(item => {\n console.log(` ${item.from}`);\n console.log(` -> ${item.to}`);\n });\n\n if (movedFiles.length > 0) {\n const existingSection = fromSection;\n \n // Update ownership in state if route moved\n if (normalizedFromRoute && normalizedToRoute && normalizedFromRoute !== normalizedToRoute) {\n for (const f in state.files) {\n if (state.files[f].owner === normalizedFromRoute) {\n state.files[f].owner = normalizedToRoute;\n }\n }\n }\n\n // Update section data in state\n state.sections = state.sections.filter(s => s.route !== normalizedFromRoute);\n state.sections.push({\n name: existingSection ? existingSection.name : getFeatureComponentName(normalizedToFeature || normalizedFromFeature),\n route: normalizedToRoute,\n featurePath: normalizedToFeature || normalizedFromFeature,\n layout: existingSection ? existingSection.layout : 'Main',\n extension: routeExtension\n });\n \n await saveState(state);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\n\n\n","import path from 'path';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath, getEffectiveOptions } from '../utils/config.js';\nimport { \n normalizeComponentName,\n getHookFileName,\n getHookFunctionName \n} from '../utils/naming.js';\nimport { \n ensureNotExists, \n writeFileWithSignature,\n getSignature,\n ensureDir,\n secureJoin,\n formatFiles \n} from '../utils/filesystem.js';\nimport { resolvePatternedPath } from '../utils/patterns.js';\nimport {\n generateComponentTemplate,\n generateHookTemplate,\n generateContextTemplate,\n generateTestTemplate,\n generateConfigTemplate,\n generateConstantsTemplate,\n generateIndexTemplate,\n generateTypesTemplate,\n generateApiTemplate,\n generateServiceTemplate,\n generateSchemaTemplate,\n generateReadmeTemplate,\n generateStoriesTemplate\n} from '../utils/templates.js';\nimport { addComponentToState, registerFile } from '../utils/state.js';\nimport { stageFiles } from '../utils/git.js';\n\nexport async function createComponentCommand(componentName, options) {\n try {\n const config = await loadConfig();\n const effectiveOptions = getEffectiveOptions(options, config, 'components');\n \n const normalizedName = normalizeComponentName(componentName);\n \n const componentsRoot = resolvePath(config, 'components');\n \n const componentDir = secureJoin(componentsRoot, normalizedName);\n const subComponentsDir = secureJoin(componentDir, 'sub-components');\n const testsDir = secureJoin(componentDir, '__tests__');\n const configDirInside = secureJoin(componentDir, 'config');\n const constantsDirInside = secureJoin(componentDir, 'constants');\n const contextDirInside = secureJoin(componentDir, 'context');\n const hooksDirInside = secureJoin(componentDir, 'hooks');\n const typesDirInside = secureJoin(componentDir, 'types');\n const apiDirInside = secureJoin(componentDir, 'api');\n const servicesDirInside = secureJoin(componentDir, 'services');\n const schemasDirInside = secureJoin(componentDir, 'schemas');\n \n const {\n framework,\n createContext: shouldCreateContext,\n createHook: shouldCreateHook,\n createTests: shouldCreateTests,\n createConfig: shouldCreateConfig,\n createConstants: shouldCreateConstants,\n createTypes: shouldCreateTypes,\n createSubComponentsDir: shouldCreateSubComponentsDir,\n createApi: shouldCreateApi,\n createServices: shouldCreateServices,\n createSchemas: shouldCreateSchemas,\n createReadme: shouldCreateReadme,\n createStories: shouldCreateStories\n } = effectiveOptions;\n\n const componentPatterns = config.filePatterns?.components || {};\n const patternData = {\n componentName: normalizedName,\n hookName: getHookFunctionName(normalizedName),\n hookExtension: config.naming.hookExtension,\n testExtension: config.naming.testExtension,\n componentExtension: config.naming.componentExtension,\n featureExtension: config.naming.featureExtension\n };\n \n const componentFilePath = path.join(componentDir, `${normalizedName}${config.naming.componentExtension}`);\n const indexFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.index,\n patternData,\n 'index.ts',\n 'filePatterns.components.index'\n );\n const contextFilePath = resolvePatternedPath(\n contextDirInside,\n componentPatterns.context,\n patternData,\n `${normalizedName}Context.tsx`,\n 'filePatterns.components.context'\n );\n const hookFilePath = resolvePatternedPath(\n hooksDirInside,\n componentPatterns.hook,\n patternData,\n getHookFileName(normalizedName, config.naming.hookExtension),\n 'filePatterns.components.hook'\n );\n const testFilePath = resolvePatternedPath(\n testsDir,\n componentPatterns.test,\n patternData,\n `${normalizedName}${config.naming.testExtension}`,\n 'filePatterns.components.test'\n );\n const configFilePath = resolvePatternedPath(\n configDirInside,\n componentPatterns.config,\n patternData,\n 'index.ts',\n 'filePatterns.components.config'\n );\n const constantsFilePath = resolvePatternedPath(\n constantsDirInside,\n componentPatterns.constants,\n patternData,\n 'index.ts',\n 'filePatterns.components.constants'\n );\n const typesFilePath = resolvePatternedPath(\n typesDirInside,\n componentPatterns.types,\n patternData,\n 'index.ts',\n 'filePatterns.components.types'\n );\n const apiFilePath = resolvePatternedPath(\n apiDirInside,\n componentPatterns.api,\n patternData,\n 'index.ts',\n 'filePatterns.components.api'\n );\n const servicesFilePath = resolvePatternedPath(\n servicesDirInside,\n componentPatterns.services,\n patternData,\n 'index.ts',\n 'filePatterns.components.services'\n );\n const schemasFilePath = resolvePatternedPath(\n schemasDirInside,\n componentPatterns.schemas,\n patternData,\n 'index.ts',\n 'filePatterns.components.schemas'\n );\n const readmeFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.readme,\n patternData,\n 'README.md',\n 'filePatterns.components.readme'\n );\n const storiesFilePath = resolvePatternedPath(\n componentDir,\n componentPatterns.stories,\n patternData,\n `${normalizedName}.stories.tsx`,\n 'filePatterns.components.stories'\n );\n \n if (options.dryRun) {\n console.log('Dry run - would create:');\n console.log(` Component: ${componentFilePath}`);\n console.log(` Index: ${indexFilePath}`);\n \n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateHook) console.log(` Hook: ${hookFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateConfig) console.log(` Config: ${configFilePath}`);\n if (shouldCreateConstants) console.log(` Constants: ${constantsFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n \n return;\n }\n \n const componentExists = existsSync(componentFilePath);\n if (componentExists && !options.force) {\n console.log(`ℹ Component already exists at ${componentFilePath}. Entering additive mode.`);\n }\n\n // Check sub-items only if not in force mode\n if (!options.force) {\n if (existsSync(indexFilePath)) console.log(` - Skipping existing index: ${indexFilePath}`);\n if (shouldCreateContext && existsSync(contextFilePath)) console.log(` - Skipping existing context: ${contextFilePath}`);\n if (shouldCreateHook && existsSync(hookFilePath)) console.log(` - Skipping existing hook: ${hookFilePath}`);\n if (shouldCreateTests && existsSync(testFilePath)) console.log(` - Skipping existing test: ${testFilePath}`);\n if (shouldCreateConfig && existsSync(configFilePath)) console.log(` - Skipping existing config: ${configFilePath}`);\n if (shouldCreateConstants && existsSync(constantsFilePath)) console.log(` - Skipping existing constants: ${constantsFilePath}`);\n if (shouldCreateTypes && existsSync(typesFilePath)) console.log(` - Skipping existing types: ${typesFilePath}`);\n if (shouldCreateApi && existsSync(apiFilePath)) console.log(` - Skipping existing api: ${apiFilePath}`);\n if (shouldCreateServices && existsSync(servicesFilePath)) console.log(` - Skipping existing services: ${servicesFilePath}`);\n if (shouldCreateSchemas && existsSync(schemasFilePath)) console.log(` - Skipping existing schemas: ${schemasFilePath}`);\n if (shouldCreateReadme && existsSync(readmeFilePath)) console.log(` - Skipping existing readme: ${readmeFilePath}`);\n if (shouldCreateStories && existsSync(storiesFilePath)) console.log(` - Skipping existing stories: ${storiesFilePath}`);\n }\n \n await ensureDir(componentDir);\n \n if (shouldCreateSubComponentsDir) await ensureDir(subComponentsDir);\n if (shouldCreateContext) await ensureDir(contextDirInside);\n if (shouldCreateHook) await ensureDir(hooksDirInside);\n if (shouldCreateTests) await ensureDir(testsDir);\n if (shouldCreateConfig) await ensureDir(configDirInside);\n if (shouldCreateConstants) await ensureDir(constantsDirInside);\n if (shouldCreateTypes) await ensureDir(typesDirInside);\n if (shouldCreateApi) await ensureDir(apiDirInside);\n if (shouldCreateServices) await ensureDir(servicesDirInside);\n if (shouldCreateSchemas) await ensureDir(schemasDirInside);\n \n const componentContent = generateComponentTemplate(normalizedName, framework, config.naming.componentExtension);\n const signature = getSignature(config, config.naming.componentExtension === '.astro' ? 'astro' : 'tsx');\n\n const writtenFiles = [];\n\n if (!componentExists || options.force) {\n const componentHash = await writeFileWithSignature(\n componentFilePath,\n componentContent,\n signature,\n config.hashing?.normalization\n );\n await registerFile(componentFilePath, { \n kind: 'component', \n template: 'component', \n hash: componentHash,\n owner: normalizedName \n });\n writtenFiles.push(componentFilePath);\n }\n \n if (!existsSync(indexFilePath) || options.force) {\n const indexContent = generateIndexTemplate(normalizedName, config.naming.componentExtension);\n const indexHash = await writeFileWithSignature(\n indexFilePath,\n indexContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(indexFilePath, { \n kind: 'component-file', \n template: 'index', \n hash: indexHash,\n owner: normalizedName \n });\n writtenFiles.push(indexFilePath);\n }\n \n if (shouldCreateTypes && (!existsSync(typesFilePath) || options.force)) {\n const typesContent = generateTypesTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n typesFilePath,\n typesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(typesFilePath, { \n kind: 'component-file', \n template: 'types', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(typesFilePath);\n }\n \n if (shouldCreateContext && (!existsSync(contextFilePath) || options.force)) {\n const contextContent = generateContextTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n contextFilePath,\n contextContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(contextFilePath, { \n kind: 'component-file', \n template: 'context', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(contextFilePath);\n }\n \n if (shouldCreateHook && (!existsSync(hookFilePath) || options.force)) {\n const hookName = getHookFunctionName(normalizedName);\n const hookContent = generateHookTemplate(normalizedName, hookName);\n const hash = await writeFileWithSignature(\n hookFilePath,\n hookContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(hookFilePath, { \n kind: 'component-file', \n template: 'hook', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(hookFilePath);\n }\n \n if (shouldCreateTests && (!existsSync(testFilePath) || options.force)) {\n const relativeComponentPath = `../${normalizedName}${config.naming.componentExtension}`;\n const testContent = generateTestTemplate(normalizedName, relativeComponentPath);\n const hash = await writeFileWithSignature(\n testFilePath,\n testContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(testFilePath, { \n kind: 'component-file', \n template: 'test', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(testFilePath);\n }\n \n if (shouldCreateConfig && (!existsSync(configFilePath) || options.force)) {\n const configContent = generateConfigTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n configFilePath,\n configContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(configFilePath, { \n kind: 'component-file', \n template: 'config', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(configFilePath);\n }\n \n if (shouldCreateConstants && (!existsSync(constantsFilePath) || options.force)) {\n const constantsContent = generateConstantsTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n constantsFilePath,\n constantsContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(constantsFilePath, { \n kind: 'component-file', \n template: 'constants', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(constantsFilePath);\n }\n\n if (shouldCreateApi && (!existsSync(apiFilePath) || options.force)) {\n const apiContent = generateApiTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n apiFilePath,\n apiContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(apiFilePath, { \n kind: 'component-file', \n template: 'api', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(apiFilePath);\n }\n\n if (shouldCreateServices && (!existsSync(servicesFilePath) || options.force)) {\n const servicesContent = generateServiceTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n servicesFilePath,\n servicesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(servicesFilePath, { \n kind: 'component-file', \n template: 'service', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(servicesFilePath);\n }\n\n if (shouldCreateSchemas && (!existsSync(schemasFilePath) || options.force)) {\n const schemasContent = generateSchemaTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n schemasFilePath,\n schemasContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(schemasFilePath, { \n kind: 'component-file', \n template: 'schema', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(schemasFilePath);\n }\n\n if (shouldCreateReadme && (!existsSync(readmeFilePath) || options.force)) {\n const readmeContent = generateReadmeTemplate(normalizedName);\n const hash = await writeFileWithSignature(\n readmeFilePath,\n readmeContent,\n getSignature(config, 'astro'),\n config.hashing?.normalization\n );\n await registerFile(readmeFilePath, { \n kind: 'component-file', \n template: 'readme', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(readmeFilePath);\n }\n\n if (shouldCreateStories && (!existsSync(storiesFilePath) || options.force)) {\n const relativePath = `./${normalizedName}${config.naming.componentExtension}`;\n const storiesContent = generateStoriesTemplate(normalizedName, relativePath);\n const hash = await writeFileWithSignature(\n storiesFilePath,\n storiesContent,\n getSignature(config, 'typescript'),\n config.hashing?.normalization\n );\n await registerFile(storiesFilePath, { \n kind: 'component-file', \n template: 'stories', \n hash,\n owner: normalizedName \n });\n writtenFiles.push(storiesFilePath);\n }\n \n // Formatting\n if (config.formatting.tool !== 'none') {\n await formatFiles(writtenFiles, config.formatting.tool);\n }\n \n console.log('✓ Component created successfully:');\n console.log(` Component: ${componentFilePath}`);\n console.log(` Index: ${indexFilePath}`);\n \n if (shouldCreateContext) console.log(` Context: ${contextFilePath}`);\n if (shouldCreateHook) console.log(` Hook: ${hookFilePath}`);\n if (shouldCreateTests) console.log(` Tests: ${testFilePath}`);\n if (shouldCreateConfig) console.log(` Config: ${configFilePath}`);\n if (shouldCreateConstants) console.log(` Constants: ${constantsFilePath}`);\n if (shouldCreateTypes) console.log(` Types: ${typesFilePath}`);\n if (shouldCreateApi) console.log(` Api: ${apiFilePath}`);\n if (shouldCreateServices) console.log(` Services: ${servicesFilePath}`);\n if (shouldCreateSchemas) console.log(` Schemas: ${schemasFilePath}`);\n if (shouldCreateReadme) console.log(` Readme: ${readmeFilePath}`);\n if (shouldCreateStories) console.log(` Stories: ${storiesFilePath}`);\n if (shouldCreateSubComponentsDir) console.log(` Sub-components: ${subComponentsDir}/`);\n \n await addComponentToState({\n name: normalizedName,\n path: componentDir\n });\n\n if (config.git?.stageChanges) {\n await stageFiles(writtenFiles);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import { loadConfig } from '../utils/config.js';\nimport { \n safeDeleteDir,\n cleanupEmptyDirs,\n secureJoin \n} from '../utils/filesystem.js';\nimport { loadState, findComponent, saveState } from '../utils/state.js';\nimport { isRepoClean } from '../utils/git.js';\nimport path from 'path';\n\nexport async function removeComponentCommand(identifier, options) {\n try {\n const config = await loadConfig();\n const configSignatures = Object.values(config.signatures || {});\n\n if (config.git?.requireCleanRepo && !await isRepoClean()) {\n throw new Error('Git repository is not clean. Please commit or stash your changes before proceeding.');\n }\n\n const state = await loadState();\n \n const component = findComponent(state, identifier);\n let componentDir;\n\n if (component) {\n componentDir = path.resolve(process.cwd(), component.path);\n } else {\n // Fallback: try to guess path if not in state\n const componentsRoot = path.resolve(process.cwd(), config.paths.components);\n componentDir = secureJoin(componentsRoot, identifier);\n }\n \n if (options.dryRun) {\n console.log('Dry run - would delete:');\n console.log(` Component directory: ${componentDir}/`);\n return;\n }\n \n const result = await safeDeleteDir(componentDir, {\n force: options.force,\n stateFiles: state.files,\n acceptChanges: options.acceptChanges,\n normalization: config.hashing?.normalization,\n owner: identifier,\n signatures: configSignatures\n });\n \n if (result.deleted || (result.reason === 'not-found' && component)) {\n if (result.deleted) {\n console.log(`✓ Deleted component: ${componentDir}/`);\n await cleanupEmptyDirs(path.dirname(componentDir), path.join(process.cwd(), config.paths.components));\n } else {\n console.log(`✓ Component ${identifier} removed from state (directory was already missing on disk).`);\n }\n \n // Unregister files\n const relComponentPath = path.relative(process.cwd(), componentDir).replace(/\\\\/g, '/');\n const dirPrefix = relComponentPath + '/';\n for (const f in state.files) {\n if (f.startsWith(dirPrefix)) {\n delete state.files[f];\n }\n }\n state.components = state.components.filter(c => c.name !== identifier && c.path !== relComponentPath);\n await saveState(state);\n } else if (result.message) {\n console.log(`⚠ Skipped: ${componentDir}`);\n console.log(` Reason: ${result.message}`);\n } else {\n console.log(`Component not found at ${componentDir}`);\n }\n \n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readdir, stat, readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { isTextorGenerated } from '../utils/filesystem.js';\nimport { loadState } from '../utils/state.js';\n\nexport async function listSectionsCommand() {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const pagesRoot = resolvePath(config, 'pages');\n \n console.log('Managed Sections:');\n \n if (!existsSync(pagesRoot)) {\n console.log(' No pages directory found.');\n } else {\n const extensions = [config.naming.routeExtension, '.ts', '.js'];\n const signatures = Object.values(config.signatures || {});\n const sections = await findGeneratedFiles(pagesRoot, extensions, signatures);\n \n if (sections.length === 0) {\n console.log(' No Textor-managed sections found.');\n } else {\n for (const section of sections) {\n const relativePath = path.relative(pagesRoot, section).replace(/\\\\/g, '/');\n const route = '/' + relativePath\n .replace(/\\.[^/.]+$/, ''); // Remove extension\n \n const stateSection = state.sections.find(s => s.route === route);\n const name = stateSection ? stateSection.name : route;\n \n console.log(` - ${name} [${route}] (${relativePath})`);\n \n if (stateSection) {\n console.log(` Feature: ${stateSection.featurePath}`);\n console.log(` Layout: ${stateSection.layout}`);\n \n // Check for senior architecture folders/files\n const featuresRoot = resolvePath(config, 'features');\n const featureDir = path.join(featuresRoot, stateSection.featurePath);\n const capabilities = [];\n \n const checkDir = (subDir, label) => {\n if (existsSync(path.join(featureDir, subDir))) capabilities.push(label);\n };\n \n checkDir('api', 'API');\n checkDir('services', 'Services');\n checkDir('schemas', 'Schemas');\n checkDir('hooks', 'Hooks');\n checkDir('context', 'Context');\n checkDir('types', 'Types');\n checkDir('scripts', 'Scripts');\n checkDir('sub-components', 'Sub-components');\n checkDir('__tests__', 'Tests');\n \n if (existsSync(path.join(featureDir, 'README.md'))) capabilities.push('Docs');\n \n const storiesFile = (await readdir(featureDir).catch(() => []))\n .find(f => f.endsWith('.stories.tsx') || f.endsWith('.stories.jsx'));\n if (storiesFile) capabilities.push('Stories');\n\n if (capabilities.length > 0) {\n console.log(` Architecture: ${capabilities.join(', ')}`);\n }\n } else {\n // Try to extract feature path from the file content\n const content = await readFile(section, 'utf-8');\n const featureImportMatch = content.match(/import\\s+\\w+\\s+from\\s+'([^']+)'/g);\n if (featureImportMatch) {\n for (const match of featureImportMatch) {\n const pathMatch = match.match(/'([^']+)'/);\n if (pathMatch) {\n console.log(` Import: ${pathMatch[1]}`);\n }\n }\n }\n }\n }\n }\n }\n\n if (state.components && state.components.length > 0) {\n console.log('\\nManaged Components:');\n for (const component of state.components) {\n console.log(` - ${component.name} (${path.relative(process.cwd(), component.path)})`);\n \n const componentDir = component.path;\n const capabilities = [];\n \n const checkDir = (subDir, label) => {\n if (existsSync(path.join(componentDir, subDir))) capabilities.push(label);\n };\n \n checkDir('api', 'API');\n checkDir('services', 'Services');\n checkDir('schemas', 'Schemas');\n checkDir('hooks', 'Hooks');\n checkDir('context', 'Context');\n checkDir('types', 'Types');\n checkDir('sub-components', 'Sub-components');\n checkDir('__tests__', 'Tests');\n checkDir('config', 'Config');\n checkDir('constants', 'Constants');\n \n if (existsSync(path.join(componentDir, 'README.md'))) capabilities.push('Docs');\n \n const storiesFile = (await readdir(componentDir).catch(() => []))\n .find(f => f.endsWith('.stories.tsx') || f.endsWith('.stories.jsx'));\n if (storiesFile) capabilities.push('Stories');\n\n if (capabilities.length > 0) {\n console.log(` Architecture: ${capabilities.join(', ')}`);\n }\n }\n }\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n\nasync function findGeneratedFiles(dir, extensions, signatures) {\n const results = [];\n const entries = await readdir(dir);\n const exts = Array.isArray(extensions) ? extensions : [extensions];\n\n for (const entry of entries) {\n const fullPath = path.join(dir, entry);\n const stats = await stat(fullPath);\n\n if (stats.isDirectory()) {\n results.push(...await findGeneratedFiles(fullPath, exts, signatures));\n } else if (exts.some(ext => entry.endsWith(ext))) {\n if (await isTextorGenerated(fullPath, signatures)) {\n results.push(fullPath);\n }\n }\n }\n\n return results;\n}\n","import path from 'path';\nimport { readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig } from '../utils/config.js';\nimport { loadState, saveState } from '../utils/state.js';\nimport { calculateHash, isTextorGenerated } from '../utils/filesystem.js';\n\nexport async function validateStateCommand(options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const results = {\n missing: [],\n modified: [],\n valid: 0\n };\n\n const files = Object.keys(state.files);\n \n for (const relativePath of files) {\n const fullPath = path.join(process.cwd(), relativePath);\n const fileData = state.files[relativePath];\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n \n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n \n if (currentHash !== fileData.hash) {\n results.modified.push({\n path: relativePath,\n newHash: currentHash\n });\n } else {\n results.valid++;\n }\n }\n\n console.log('State Validation Results:');\n console.log(` Valid files: ${results.valid}`);\n \n if (results.missing.length > 0) {\n console.log(`\\n Missing files: ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n \n if (results.modified.length > 0) {\n console.log(`\\n Modified files: ${results.modified.length}`);\n results.modified.forEach(f => console.log(` - ${f.path}`));\n }\n \n if (options.fix) {\n let fixedCount = 0;\n const signatures = Object.values(config.signatures || {});\n \n // Fix modified files if they still have the Textor signature\n for (const mod of results.modified) {\n const fullPath = path.join(process.cwd(), mod.path);\n if (await isTextorGenerated(fullPath, signatures)) {\n state.files[mod.path].hash = mod.newHash;\n fixedCount++;\n }\n }\n \n // Remove missing files from state\n for (const miss of results.missing) {\n delete state.files[miss];\n fixedCount++;\n }\n \n if (fixedCount > 0) {\n await saveState(state);\n console.log(`\\n✓ Fixed ${fixedCount} entries in state.`);\n } else {\n console.log('\\nNothing to fix or missing signatures on modified files.');\n }\n } else if (results.missing.length > 0 || results.modified.length > 0) {\n console.log('\\nRun with --fix to synchronize state with reality (requires Textor signature to be present).');\n } else {\n console.log('\\n✓ State is perfectly in sync.');\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n process.exit(1);\n }\n}\n","import path from 'path';\nimport { existsSync } from 'fs';\nimport { readFile } from 'fs/promises';\nimport { resolvePath } from './config.js';\nimport { calculateHash, isTextorGenerated, scanDirectory } from './filesystem.js';\n\n/**\n * Computes the drift between the state and the actual files on disk.\n * \n * @param {import('./config.js').TextorConfig} config \n * @param {Object} state \n * @returns {Promise<{\n * missing: string[],\n * modified: string[],\n * untracked: string[],\n * orphaned: string[],\n * synced: number\n * }>}\n */\nexport async function getProjectStatus(config, state) {\n const results = {\n missing: [],\n modified: [],\n untracked: [], // Has signature, not in state\n orphaned: [], // No signature, not in state\n synced: 0\n };\n\n const roots = [\n resolvePath(config, 'pages'),\n resolvePath(config, 'features'),\n resolvePath(config, 'components')\n ].map(p => path.resolve(p));\n\n const diskFiles = new Set();\n const configSignatures = Object.values(config.signatures || {});\n\n for (const root of roots) {\n if (existsSync(root)) {\n await scanDirectory(root, diskFiles);\n }\n }\n\n // 1. Check state files against disk\n for (const relativePath in state.files) {\n const fullPath = path.join(process.cwd(), relativePath);\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n\n // It exists on disk, so it's not untracked/orphaned\n diskFiles.delete(relativePath);\n\n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n const fileData = state.files[relativePath];\n\n if (currentHash !== fileData.hash) {\n results.modified.push(relativePath);\n } else {\n results.synced++;\n }\n }\n\n // 2. Check remaining disk files\n for (const relativePath of diskFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n \n if (isGenerated) {\n results.untracked.push(relativePath);\n } else {\n results.orphaned.push(relativePath);\n }\n }\n\n return results;\n}\n","import { loadConfig } from '../utils/config.js';\nimport { loadState } from '../utils/state.js';\nimport { getProjectStatus } from '../utils/status.js';\n\nexport async function statusCommand() {\n try {\n const config = await loadConfig();\n const state = await loadState();\n \n const results = await getProjectStatus(config, state);\n\n // Reporting\n console.log('Textor Status Report:');\n console.log(` Synced files: ${results.synced}`);\n \n if (results.modified.length > 0) {\n console.log(`\\n MODIFIED (In state, but content changed): ${results.modified.length}`);\n results.modified.forEach(f => console.log(` ~ ${f}`));\n }\n \n if (results.missing.length > 0) {\n console.log(`\\n MISSING (In state, but not on disk): ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n\n if (results.untracked.length > 0) {\n console.log(`\\n UNTRACKED (On disk with signature, not in state): ${results.untracked.length}`);\n results.untracked.forEach(f => console.log(` + ${f}`));\n }\n\n if (results.orphaned.length > 0) {\n console.log(`\\n ORPHANED (On disk without signature, in managed folder): ${results.orphaned.length}`);\n results.orphaned.forEach(f => console.log(` ? ${f}`));\n }\n\n if (results.modified.length === 0 && results.missing.length === 0 && results.untracked.length === 0) {\n console.log('\\n✓ Project is perfectly synchronized with state.');\n } else {\n console.log('\\nUse \"textor sync\" to reconcile state with disk.');\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { calculateHash, isTextorGenerated, scanDirectory, inferKind } from '../utils/filesystem.js';\n\nexport async function syncCommand(options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n const results = {\n added: [],\n updated: [],\n missing: [],\n untouched: 0\n };\n\n const roots = [\n resolvePath(config, 'pages'),\n resolvePath(config, 'features'),\n resolvePath(config, 'components')\n ].map(p => path.resolve(p));\n\n const managedFiles = new Set();\n const configSignatures = Object.values(config.signatures || {});\n\n for (const root of roots) {\n if (existsSync(root)) {\n await scanDirectory(root, managedFiles);\n } else {\n const relativeRoot = path.relative(process.cwd(), root).replace(/\\\\/g, '/');\n console.log(` Warning: Managed directory not found: ${relativeRoot}`);\n }\n }\n\n const stateFiles = Object.keys(state.files);\n let changed = false;\n \n // 1. Check files in state\n for (const relativePath of stateFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n \n if (!existsSync(fullPath)) {\n results.missing.push(relativePath);\n continue;\n }\n\n managedFiles.delete(relativePath); // Remove from managedFiles so we don't process it again in step 2\n\n const content = await readFile(fullPath, 'utf-8');\n const currentHash = calculateHash(content, config.hashing?.normalization);\n const fileData = state.files[relativePath];\n\n if (currentHash !== fileData.hash) {\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n if (isGenerated || options.force) {\n results.updated.push({ path: relativePath, newHash: currentHash });\n }\n } else {\n results.untouched++;\n }\n }\n\n // 2. Check files on disk not in state\n let ignoredCount = 0;\n for (const relativePath of managedFiles) {\n const fullPath = path.join(process.cwd(), relativePath);\n const isGenerated = await isTextorGenerated(fullPath, configSignatures);\n \n if (isGenerated || options.includeAll) {\n const content = await readFile(fullPath, 'utf-8');\n const hash = calculateHash(content, config.hashing?.normalization);\n results.added.push({ path: relativePath, hash });\n } else {\n ignoredCount++;\n }\n }\n\n if (results.added.length > 0 || results.updated.length > 0 || results.missing.length > 0) {\n changed = true;\n }\n\n // Reporting\n console.log('Sync Analysis:');\n console.log(` Untouched files: ${results.untouched}`);\n \n if (ignoredCount > 0 && !options.includeAll) {\n console.log(` Ignored non-generated files: ${ignoredCount} (use --include-all to track them)`);\n }\n \n if (results.added.length > 0) {\n console.log(`\\n New files to track: ${results.added.length}`);\n results.added.forEach(f => console.log(` + ${f.path}`));\n }\n \n if (results.updated.length > 0) {\n console.log(`\\n Modified files to update: ${results.updated.length}`);\n results.updated.forEach(f => console.log(` ~ ${f.path}`));\n }\n \n if (results.missing.length > 0) {\n console.log(`\\n Missing files to remove from state: ${results.missing.length}`);\n results.missing.forEach(f => console.log(` - ${f}`));\n }\n\n if (options.dryRun) {\n console.log('\\nDry run: no changes applied.');\n return;\n }\n\n if (results.added.length > 0) {\n for (const file of results.added) {\n state.files[file.path] = {\n kind: inferKind(file.path, config),\n hash: file.hash,\n timestamp: new Date().toISOString(),\n synced: true\n };\n }\n }\n\n if (results.updated.length > 0) {\n for (const file of results.updated) {\n state.files[file.path].hash = file.newHash;\n state.files[file.path].timestamp = new Date().toISOString();\n state.files[file.path].synced = true;\n }\n }\n\n if (results.missing.length > 0) {\n for (const relPath of results.missing) {\n delete state.files[relPath];\n }\n }\n\n if (changed) {\n // 3. Reconstruct components and sections\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n\n await saveState(state);\n console.log(`\\n✓ State synchronized successfully (${results.added.length} added, ${results.updated.length} updated, ${results.missing.length} removed).`);\n } else {\n // Even if no files changed, check if metadata needs reconstruction\n const newComponents = reconstructComponents(state.files, config);\n const newSections = reconstructSections(state, config);\n \n const componentsEqual = JSON.stringify(newComponents) === JSON.stringify(state.components || []);\n const sectionsEqual = JSON.stringify(newSections) === JSON.stringify(state.sections || []);\n\n if (!componentsEqual || !sectionsEqual) {\n state.components = newComponents;\n state.sections = newSections;\n await saveState(state);\n console.log('\\n✓ Metadata (components/sections) reconstructed.');\n } else {\n console.log('\\n✓ Everything is already in sync.');\n }\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { readFile, writeFile, stat } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { calculateHash, scanDirectory, inferKind } from '../utils/filesystem.js';\n\nexport async function adoptCommand(identifier, options) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n\n const roots = {\n pages: resolvePath(config, 'pages'),\n features: resolvePath(config, 'features'),\n components: resolvePath(config, 'components')\n };\n\n let filesToAdopt = [];\n\n if (!identifier && options.all) {\n // Adopt all untracked files in all roots\n const managedFiles = new Set();\n for (const root of Object.values(roots)) {\n if (existsSync(root)) {\n await scanDirectory(root, managedFiles);\n }\n }\n filesToAdopt = Array.from(managedFiles).filter(f => !state.files[f]);\n } else if (identifier) {\n const untrackedFiles = new Set();\n \n // 1. Try as direct path\n const fullPath = path.resolve(process.cwd(), identifier);\n if (existsSync(fullPath)) {\n await scanDirectoryOrFile(fullPath, untrackedFiles, state);\n }\n \n // 2. Try as component name\n const compPath = path.join(roots.components, identifier);\n if (existsSync(compPath)) {\n await scanDirectoryOrFile(compPath, untrackedFiles, state);\n }\n\n // 3. Try as feature name\n const featPath = path.join(roots.features, identifier);\n if (existsSync(featPath)) {\n await scanDirectoryOrFile(featPath, untrackedFiles, state);\n }\n \n // 4. Try as route or page name\n const cleanRoute = identifier.startsWith('/') ? identifier.slice(1) : identifier;\n const pagePath = path.join(roots.pages, cleanRoute + (config.naming?.routeExtension || '.astro'));\n if (existsSync(pagePath)) {\n await scanDirectoryOrFile(pagePath, untrackedFiles, state);\n }\n const nestedPagePath = path.join(roots.pages, cleanRoute, config.routing?.indexFile || 'index.astro');\n if (existsSync(nestedPagePath)) {\n await scanDirectoryOrFile(nestedPagePath, untrackedFiles, state);\n }\n\n filesToAdopt = Array.from(untrackedFiles);\n\n if (filesToAdopt.length === 0 && !existsSync(fullPath)) {\n throw new Error(`Could not find any untracked files for identifier: ${identifier}`);\n }\n } else {\n throw new Error('Please provide a path/identifier or use --all');\n }\n\n // Filter to ensure all files are within managed roots\n const rootPaths = Object.values(roots).map(p => path.resolve(p));\n filesToAdopt = filesToAdopt.filter(relPath => {\n const fullPath = path.resolve(process.cwd(), relPath);\n return rootPaths.some(root => fullPath.startsWith(root));\n });\n\n if (filesToAdopt.length === 0) {\n console.log('No untracked files found to adopt.');\n return;\n }\n\n console.log(`Found ${filesToAdopt.length} files to adopt...`);\n let adoptedCount = 0;\n\n for (const relPath of filesToAdopt) {\n const success = await adoptFile(relPath, config, state, options);\n if (success) adoptedCount++;\n }\n\n if (adoptedCount > 0 && !options.dryRun) {\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n await saveState(state);\n console.log(`\\n✓ Successfully adopted ${adoptedCount} files.`);\n } else if (options.dryRun) {\n console.log(`\\nDry run: would adopt ${adoptedCount} files.`);\n }\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\nasync function adoptFile(relPath, config, state, options) {\n const fullPath = path.join(process.cwd(), relPath);\n const content = await readFile(fullPath, 'utf-8');\n \n const ext = path.extname(relPath);\n let signature = '';\n if (ext === '.astro') signature = config.signatures.astro;\n else if (ext === '.ts' || ext === '.tsx') signature = config.signatures.typescript;\n else if (ext === '.js' || ext === '.jsx') signature = config.signatures.javascript;\n\n let finalContent = content;\n const shouldAddSignature = signature && !content.includes(signature) && options.signature !== false;\n\n if (shouldAddSignature) {\n if (options.dryRun) {\n console.log(` ~ Would add signature to ${relPath}`);\n } else {\n finalContent = signature + '\\n' + content;\n await writeFile(fullPath, finalContent, 'utf-8');\n console.log(` + Added signature and adopting: ${relPath}`);\n }\n } else {\n if (options.dryRun) {\n if (signature && !content.includes(signature) && options.signature === false) {\n console.log(` + Would adopt without signature (explicitly requested): ${relPath}`);\n } else {\n console.log(` + Would adopt (already has signature or no signature for ext): ${relPath}`);\n }\n } else {\n if (signature && !content.includes(signature) && options.signature === false) {\n console.log(` + Adopting without signature (explicitly requested): ${relPath}`);\n } else {\n console.log(` + Adopting: ${relPath}`);\n }\n }\n }\n\n if (!options.dryRun) {\n const hash = calculateHash(finalContent, config.hashing?.normalization);\n state.files[relPath] = {\n kind: inferKind(relPath, config),\n hash: hash,\n timestamp: new Date().toISOString(),\n synced: true,\n hasSignature: options.signature !== false\n };\n }\n\n return true;\n}\n\nasync function scanDirectoryOrFile(fullPath, fileSet, state) {\n if ((await stat(fullPath)).isDirectory()) {\n const dirFiles = new Set();\n await scanDirectory(fullPath, dirFiles);\n for (const f of dirFiles) {\n if (!state.files[f]) fileSet.add(f);\n }\n } else {\n const relPath = path.relative(process.cwd(), fullPath).replace(/\\\\/g, '/');\n if (!state.files[relPath]) {\n fileSet.add(relPath);\n }\n }\n}\n","import { readFile, writeFile } from 'fs/promises';\nimport { existsSync } from 'fs';\nimport {\n DEFAULT_CONFIG,\n CURRENT_CONFIG_VERSION,\n applyConfigMigrations,\n mergeConfig,\n getConfigPath,\n validateConfig\n} from '../utils/config.js';\n\nexport async function upgradeConfigCommand(options) {\n try {\n const configPath = getConfigPath();\n\n if (!existsSync(configPath)) {\n throw new Error(\n `Textor configuration not found at ${configPath}\\n` +\n `Run 'textor init' to create it.`\n );\n }\n\n const rawContent = await readFile(configPath, 'utf-8');\n const rawConfig = JSON.parse(rawContent);\n const migrated = applyConfigMigrations(rawConfig);\n const merged = mergeConfig(DEFAULT_CONFIG, migrated);\n merged.configVersion = CURRENT_CONFIG_VERSION;\n\n validateConfig(merged);\n\n if (options.dryRun) {\n console.log('Dry run - upgraded configuration:');\n console.log(JSON.stringify(merged, null, 2));\n return;\n }\n\n await writeFile(configPath, JSON.stringify(merged, null, 2) + '\\n', 'utf-8');\n\n console.log('Configuration upgraded successfully.');\n console.log(` Version: ${rawConfig.configVersion || 1} -> ${CURRENT_CONFIG_VERSION}`);\n console.log(` Path: ${configPath}`);\n } catch (error) {\n if (error instanceof SyntaxError) {\n console.error('Error: Failed to parse config: Invalid JSON');\n } else {\n console.error('Error:', error.message);\n }\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import { loadState, saveState } from '../utils/state.js';\n\nexport async function normalizeStateCommand(options) {\n try {\n const state = await loadState();\n\n if (options.dryRun) {\n console.log('Dry run - normalized state:');\n console.log(JSON.stringify(state, null, 2));\n return;\n }\n\n await saveState(state);\n console.log('State normalized successfully.');\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import readline from 'readline';\nimport { loadConfig } from '../utils/config.js';\nimport { loadState, saveState, reconstructComponents, reconstructSections } from '../utils/state.js';\nimport { getProjectStatus } from '../utils/status.js';\n\n/**\n * Removes missing references from Textor state.\n * @param {Object} options \n * @param {boolean} options.dryRun \n * @param {boolean} options.yes \n */\nexport async function pruneMissingCommand(options = {}) {\n try {\n const config = await loadConfig();\n const state = await loadState();\n \n const results = await getProjectStatus(config, state);\n \n if (results.missing.length === 0) {\n console.log('No missing references found.');\n return;\n }\n\n console.log(`Found ${results.missing.length} missing references:`);\n results.missing.forEach(f => console.log(` - ${f}`));\n\n if (options.dryRun) {\n console.log('\\nDry run: no changes applied to state.');\n return;\n }\n\n if (!options.yes && options.interactive !== false && process.stdin.isTTY && process.env.NODE_ENV !== 'test') {\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout\n });\n\n const confirmed = await new Promise(resolve => {\n rl.question('\\nDo you want to proceed with pruning? (y/N) ', (answer) => {\n rl.close();\n resolve(answer.toLowerCase() === 'y' || answer.toLowerCase() === 'yes');\n });\n });\n\n if (!confirmed) {\n console.log('Aborted.');\n return;\n }\n }\n\n for (const relPath of results.missing) {\n delete state.files[relPath];\n }\n\n // Reconstruct metadata\n state.components = reconstructComponents(state.files, config);\n state.sections = reconstructSections(state, config);\n\n await saveState(state);\n console.log(`\\n✓ Successfully removed ${results.missing.length} missing references from state.`);\n\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n","import path from 'path';\nimport { loadConfig, resolvePath } from '../utils/config.js';\nimport { loadState, findComponent, findSection, saveState } from '../utils/state.js';\nimport { \n normalizeComponentName, \n normalizeRoute, \n featureToDirectoryPath \n} from '../utils/naming.js';\nimport { moveDirectory, scanAndReplaceImports } from '../utils/refactor.js';\nimport { moveSectionCommand } from './move-section.js';\nimport { cleanupEmptyDirs } from '../utils/filesystem.js';\n\n/**\n * Dispatcher for rename commands.\n */\nexport async function renameCommand(type, oldName, newName, options) {\n try {\n if (!type || !oldName || !newName) {\n throw new Error('Usage: textor rename <route|feature|component> <oldName> <newName>');\n }\n\n if (type === 'route' || type === 'path') {\n const normalizedOld = normalizeRoute(oldName);\n const normalizedNew = normalizeRoute(newName);\n // By default, move-section will try to move the feature if it matches the route.\n // For a simple \"rename route\", we might want to keep that behavior or not.\n // Usually \"rename route\" means just the URL/file.\n return await moveSectionCommand(normalizedOld, undefined, normalizedNew, undefined, options);\n }\n \n if (type === 'feature') {\n const state = await loadState();\n const normalizedOld = featureToDirectoryPath(oldName);\n const normalizedNew = featureToDirectoryPath(newName);\n \n const section = findSection(state, normalizedOld);\n \n if (section) {\n // If it's a managed section, move it using section logic\n return await moveSectionCommand(section.route, section.featurePath, section.route, normalizedNew, options);\n } else {\n // Standalone feature move\n return await moveSectionCommand(undefined, normalizedOld, undefined, normalizedNew, options);\n }\n }\n \n if (type === 'component') {\n return await renameComponent(oldName, newName, options);\n }\n \n throw new Error(`Unknown rename type: ${type}. Supported types: route, feature, component.`);\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n\n/**\n * Specialized logic for renaming shared components.\n */\nasync function renameComponent(oldName, newName, options) {\n const config = await loadConfig();\n const state = await loadState();\n \n const normalizedOldName = normalizeComponentName(oldName);\n const normalizedNewName = normalizeComponentName(newName);\n \n const component = findComponent(state, normalizedOldName);\n \n const componentsRoot = resolvePath(config, 'components');\n const fromPath = component \n ? path.resolve(process.cwd(), component.path) \n : path.join(componentsRoot, normalizedOldName);\n \n const toPath = path.join(componentsRoot, normalizedNewName);\n \n if (options.dryRun) {\n console.log(`Dry run - would rename component: ${normalizedOldName} -> ${normalizedNewName}`);\n console.log(` Path: ${fromPath} -> ${toPath}`);\n return;\n }\n \n const signatures = Object.values(config.signatures || {});\n \n await moveDirectory(fromPath, toPath, state, config, {\n ...options,\n fromName: normalizedOldName,\n toName: normalizedNewName,\n signatures\n });\n \n if (options.scan) {\n await scanAndReplaceImports(config, state, {\n fromPath: normalizedOldName,\n fromName: normalizedOldName,\n type: 'component'\n }, {\n toPath: normalizedNewName,\n toName: normalizedNewName\n }, options);\n }\n \n await cleanupEmptyDirs(path.dirname(fromPath), componentsRoot);\n \n // Update state metadata\n if (component) {\n component.name = normalizedNewName;\n component.path = path.relative(process.cwd(), toPath).replace(/\\\\/g, '/');\n }\n \n await saveState(state);\n console.log(`✓ Renamed component ${normalizedOldName} to ${normalizedNewName}`);\n}\n","import { loadState, findSection, findComponent } from '../utils/state.js';\nimport { addSectionCommand } from './add-section.js';\nimport { createComponentCommand } from './create-component.js';\n\n/**\n * Add a new item (hook, api, service, etc.) to an existing feature or component.\n * \n * @param {string} itemType The type of item to add (e.g., 'api', 'hook', 'service')\n * @param {string} targetName The name of the feature or component\n * @param {Object} options Additional options from Commander\n */\nexport async function addItemCommand(itemType, targetName, options) {\n try {\n const state = await loadState();\n \n // Normalize itemType\n let normalizedItem = itemType.toLowerCase();\n if (normalizedItem === 'test') normalizedItem = 'tests';\n if (normalizedItem === 'service') normalizedItem = 'services';\n if (normalizedItem === 'schema') normalizedItem = 'schemas';\n if (normalizedItem === 'hook') normalizedItem = 'hooks'; // for add-section\n\n // Try to find as section (feature) first\n let section = findSection(state, targetName);\n let component = findComponent(state, targetName);\n \n // If not found by exact name, try to find by featurePath or part of it\n if (!section && !component) {\n section = state.sections.find(s => s.featurePath === targetName || s.featurePath.endsWith('/' + targetName));\n }\n\n if (!section && !component) {\n throw new Error(`Target not found in state: \"${targetName}\". Please use \"add-section\" or \"create-component\" directly if it's not managed by Textor.`);\n }\n\n const flags = { [normalizedItem]: true };\n // Also set singular for create-component which uses 'hook'\n if (normalizedItem === 'hooks') flags.hook = true;\n\n if (section) {\n console.log(`ℹ Adding ${normalizedItem} to feature: ${section.featurePath}`);\n return await addSectionCommand(undefined, section.featurePath, { ...options, ...flags });\n }\n \n if (component) {\n console.log(`ℹ Adding ${normalizedItem} to component: ${component.name}`);\n // For create-component, we might need to be careful with flags that are on by default\n // but getEffectiveOptions should handle it if we pass them explicitly as true.\n return await createComponentCommand(component.name, { ...options, ...flags });\n }\n } catch (error) {\n console.error('Error:', error.message);\n if (typeof process.exit === 'function' && process.env.NODE_ENV !== 'test') {\n process.exit(1);\n }\n throw error;\n }\n}\n"],"names":["CONFIG_DIR","existsSync","readFile","mkdir","writeFile","execAsync","promisify","exec","createHash","unlink","readdir","stat","rm","rename","rmdir","readFileSync","open","updateImportsInFile"],"mappings":";;;;;;;;;;AAIA,MAAMA,YAAU,GAAG,SAAS;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