@kosdev-code/kos-ui-cli 2.1.39 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../packages/kos-codegen-core/src/lib/codegen-filesystem.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generate-files.ts", "../../../../../../../packages/kos-codegen-core/src/lib/logger.ts", "../../../../../../../packages/kos-codegen-core/src/lib/project-discovery.ts", "../../../../../../../packages/kos-codegen-core/src/lib/format-files.ts", "../../../../../../../packages/kos-codegen-core/src/lib/name-utils.ts", "../../../../../../../packages/kos-codegen-core/src/lib/normalize-values.ts", "../../../../../../../packages/kos-codegen-core/src/lib/template-resolver.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/generate-splash-project.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/update-model-index.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/types.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/base.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/control-pour-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/cui-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/custom-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/default-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/nav-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/setting-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/setup-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/trouble-action-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/utility-handler.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/plugin-handlers/factory.ts", "../../../../../../../packages/kos-ui-cli/src/lib/utils/action-factory.mjs", "../../../../../../../packages/kos-ui-cli/src/lib/utils/validators.mjs", "../../../../../../../packages/kos-ui-cli/src/lib/generators/project/splash.mjs"],
4
+ "sourcesContent": ["import * as fs from \"fs\";\nimport * as path from \"path\";\n\n/**\n * Abstraction over a filesystem for code generation.\n *\n * Mirrors the subset of the Nx Tree API that generators actually use,\n * enabling the same generator logic to run against the real filesystem\n * (CLI, VS Code extension) or an in-memory tree (Nx adapter).\n */\nexport interface CodegenFileSystem {\n /** Workspace root directory (absolute path). */\n readonly root: string;\n\n /** Read a file relative to the workspace root. Returns null if not found. */\n read(filePath: string): string | null;\n\n /** Write a file relative to the workspace root. Creates parent dirs as needed. */\n write(filePath: string, content: string): void;\n\n /** Check whether a file exists relative to the workspace root. */\n exists(filePath: string): boolean;\n\n /** Delete a file relative to the workspace root. No-op if not found. */\n delete(filePath: string): void;\n\n /** List all files under a directory (relative to root), returned as root-relative paths. */\n listFiles(dirPath: string): string[];\n}\n\n/**\n * CodegenFileSystem wrapper that records absolute paths of every file written.\n * Wrap any CodegenFileSystem to collect written paths for post-generation steps\n * such as formatting.\n *\n * @example\n * const fs = new TrackingFileSystem(new DirectFileSystem(cwd));\n * generateModel({ codegenFs: fs, ... });\n * await formatFiles(fs.root, fs.writtenPaths);\n */\nexport class TrackingFileSystem implements CodegenFileSystem {\n private readonly inner: CodegenFileSystem;\n private readonly _writtenPaths: string[] = [];\n\n constructor(inner: CodegenFileSystem) {\n this.inner = inner;\n }\n\n get root(): string {\n return this.inner.root;\n }\n\n get writtenPaths(): string[] {\n return [...this._writtenPaths];\n }\n\n read(filePath: string): string | null {\n return this.inner.read(filePath);\n }\n\n write(filePath: string, content: string): void {\n this.inner.write(filePath, content);\n this._writtenPaths.push(\n path.isAbsolute(filePath) ? filePath : path.join(this.inner.root, filePath)\n );\n }\n\n exists(filePath: string): boolean {\n return this.inner.exists(filePath);\n }\n\n delete(filePath: string): void {\n this.inner.delete(filePath);\n }\n\n listFiles(dirPath: string): string[] {\n return this.inner.listFiles(dirPath);\n }\n}\n\n/**\n * CodegenFileSystem backed by the real Node.js filesystem.\n * All paths passed to interface methods are relative to the workspace root.\n */\nexport class DirectFileSystem implements CodegenFileSystem {\n readonly root: string;\n\n constructor(workspaceRoot: string) {\n this.root = path.resolve(workspaceRoot);\n }\n\n read(filePath: string): string | null {\n const abs = this.resolve(filePath);\n try {\n return fs.readFileSync(abs, \"utf-8\");\n } catch {\n return null;\n }\n }\n\n write(filePath: string, content: string): void {\n const abs = this.resolve(filePath);\n fs.mkdirSync(path.dirname(abs), { recursive: true });\n fs.writeFileSync(abs, content, \"utf-8\");\n }\n\n exists(filePath: string): boolean {\n return fs.existsSync(this.resolve(filePath));\n }\n\n delete(filePath: string): void {\n const abs = this.resolve(filePath);\n try {\n fs.unlinkSync(abs);\n } catch {\n // no-op if file doesn't exist\n }\n }\n\n listFiles(dirPath: string): string[] {\n const abs = this.resolve(dirPath);\n if (!fs.existsSync(abs)) {\n return [];\n }\n return this.walkDir(abs).map((file) => path.relative(this.root, file));\n }\n\n private resolve(filePath: string): string {\n if (path.isAbsolute(filePath)) {\n return filePath;\n }\n return path.join(this.root, filePath);\n }\n\n private walkDir(dir: string): string[] {\n const results: string[] = [];\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n results.push(...this.walkDir(full));\n } else {\n results.push(full);\n }\n }\n return results;\n }\n}\n", "/**\n * EJS-based file generation \u2014 replaces @nx/devkit generateFiles().\n *\n * Walks a source template directory, processes each file through EJS,\n * interpolates __var__ tokens in filenames, strips .template suffixes,\n * and writes results via a CodegenFileSystem.\n */\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport * as ejs from \"ejs\";\nimport type { CodegenFileSystem } from \"./codegen-filesystem\";\nimport { getCodegenLogger } from \"./logger\";\n\n/**\n * Generate files from a template directory into a destination path.\n *\n * Behavior matches @nx/devkit generateFiles():\n * - Walks `srcFolder` recursively\n * - For each file, replaces `__propName__` in the filename using `substitutions`\n * - Strips `.template` suffix from filenames\n * - Processes file contents through EJS with `substitutions` as data\n * - Writes the result to `destFolder` (relative to fs.root) via the CodegenFileSystem\n *\n * @param codegenFs - Target filesystem abstraction\n * @param srcFolder - Absolute path to the template directory\n * @param destFolder - Destination path relative to the filesystem root\n * @param substitutions - Key-value pairs for EJS and filename interpolation\n */\nexport function generateFilesFromTemplates(\n codegenFs: CodegenFileSystem,\n srcFolder: string,\n destFolder: string,\n substitutions: Record<string, any>\n): void {\n const logger = getCodegenLogger();\n const templateFiles = walkTemplateDir(srcFolder);\n\n for (const templateFile of templateFiles) {\n const relPath = path.relative(srcFolder, templateFile);\n\n // Interpolate __var__ tokens in the path segments\n let destRelPath = interpolateFilename(relPath, substitutions);\n\n // Strip .template suffix\n if (destRelPath.endsWith(\".template\")) {\n destRelPath = destRelPath.slice(0, -\".template\".length);\n }\n\n const destPath = path.join(destFolder, destRelPath);\n\n // Templates are read from the real filesystem (package assets),\n // while outputs are written through CodegenFileSystem.\n const rawContent = fs.readFileSync(templateFile, \"utf-8\");\n const rendered = ejs.render(rawContent, substitutions, {\n filename: templateFile, // for EJS error messages and includes\n });\n\n logger.debug(`Generating ${destPath}`);\n codegenFs.write(destPath, rendered);\n }\n}\n\n/**\n * Replace `__propName__` tokens in a file path with values from substitutions.\n * E.g., `__nameDashCase__-model.ts` with `{ nameDashCase: \"my-widget\" }` becomes\n * `my-widget-model.ts`.\n */\nfunction interpolateFilename(\n filePath: string,\n substitutions: Record<string, any>\n): string {\n return filePath.replace(/__([^_]+)__/g, (match, key: string) => {\n if (key in substitutions) {\n return String(substitutions[key]);\n }\n return match; // leave unmatched tokens as-is\n });\n}\n\nfunction walkTemplateDir(dir: string): string[] {\n const results: string[] = [];\n const entries = fs.readdirSync(dir, { withFileTypes: true });\n for (const entry of entries) {\n const full = path.join(dir, entry.name);\n if (entry.isDirectory()) {\n results.push(...walkTemplateDir(full));\n } else {\n results.push(full);\n }\n }\n return results;\n}\n", "/**\n * Settable logger interface for kos-codegen-core.\n *\n * Consumers (CLI, VS Code extension, Nx adapter) set their own logger\n * via setCodegenLogger(). Defaults to silent no-op.\n */\nexport interface CodegenLogger {\n debug(message: string, ...args: unknown[]): void;\n info(message: string, ...args: unknown[]): void;\n warn(message: string, ...args: unknown[]): void;\n error(message: string, ...args: unknown[]): void;\n}\n\nconst noopLogger: CodegenLogger = {\n debug: () => {},\n info: () => {},\n warn: () => {},\n error: () => {},\n};\n\nlet activeLogger: CodegenLogger = noopLogger;\n\nexport function setCodegenLogger(logger: CodegenLogger): void {\n activeLogger = logger;\n}\n\nexport function getCodegenLogger(): CodegenLogger {\n return activeLogger;\n}\n", "/**\n * Nx-free project discovery \u2014 scans for project.json files in the workspace.\n *\n * Replaces @nx/devkit readProjectConfiguration, getProjects, readNxJson.\n * Based on the pattern in kos-model-extension/src/utils/workspace-scanner.ts.\n */\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport fg from \"fast-glob\";\nimport { getCodegenLogger } from \"./logger\";\n\nexport interface ProjectConfiguration {\n name: string;\n root: string;\n sourceRoot: string;\n projectType?: \"library\" | \"application\";\n targets?: Record<string, unknown>;\n tags?: string[];\n}\n\n/**\n * Discover all projects in the workspace by scanning for project.json files.\n *\n * @param workspaceRoot - Absolute path to the workspace root\n * @returns Map of project name to ProjectConfiguration\n */\nexport function discoverProjects(\n workspaceRoot: string\n): Map<string, ProjectConfiguration> {\n const logger = getCodegenLogger();\n const projects = new Map<string, ProjectConfiguration>();\n\n const projectJsonPaths = fg.sync(\"**/project.json\", {\n cwd: workspaceRoot,\n ignore: [\"**/node_modules/**\", \"**/dist/**\", \"**/.git/**\"],\n absolute: false,\n });\n\n for (const relPath of projectJsonPaths) {\n const absPath = path.join(workspaceRoot, relPath);\n try {\n const raw = fs.readFileSync(absPath, \"utf-8\");\n const json = JSON.parse(raw);\n const projectRoot = path.dirname(relPath);\n const name = json.name ?? path.basename(projectRoot);\n\n const config: ProjectConfiguration = {\n name,\n root: projectRoot,\n sourceRoot: json.sourceRoot ?? path.join(projectRoot, \"src\"),\n projectType: json.projectType,\n targets: json.targets,\n tags: json.tags,\n };\n\n projects.set(name, config);\n logger.debug(`Discovered project: ${name} at ${projectRoot}`);\n } catch (err) {\n logger.warn(`Failed to parse ${absPath}: ${err}`);\n }\n }\n\n logger.info(`Discovered ${projects.size} projects`);\n return projects;\n}\n\n/**\n * Find a single project by name.\n *\n * Note: This rescans the workspace on every call. If you need to look up\n * multiple projects, call discoverProjects() once and query the returned Map.\n *\n * @param workspaceRoot - Absolute path to the workspace root\n * @param projectName - The project name to look up\n * @param projects - Optional pre-computed project map (avoids rescan)\n * @returns ProjectConfiguration or undefined if not found\n */\nexport function findProjectByName(\n workspaceRoot: string,\n projectName: string,\n projects?: Map<string, ProjectConfiguration>\n): ProjectConfiguration | undefined {\n const map = projects ?? discoverProjects(workspaceRoot);\n return map.get(projectName);\n}\n\n/**\n * Find the project that contains a given file path.\n * Walks up from the file path looking for the nearest project.json.\n *\n * @param workspaceRoot - Absolute path to the workspace root\n * @param filePath - Absolute path to a file within the workspace\n * @returns ProjectConfiguration or undefined if not within any project\n */\nexport function findProjectForPath(\n workspaceRoot: string,\n filePath: string\n): ProjectConfiguration | undefined {\n const resolved = path.resolve(workspaceRoot);\n let dir = path.dirname(path.resolve(filePath));\n\n while (dir.startsWith(resolved) && dir !== resolved) {\n const projectJsonPath = path.join(dir, \"project.json\");\n if (fs.existsSync(projectJsonPath)) {\n try {\n const raw = fs.readFileSync(projectJsonPath, \"utf-8\");\n const json = JSON.parse(raw);\n const projectRoot = path.relative(resolved, dir);\n const name = json.name ?? path.basename(dir);\n\n return {\n name,\n root: projectRoot,\n sourceRoot: json.sourceRoot ?? path.join(projectRoot, \"src\"),\n projectType: json.projectType,\n targets: json.targets,\n tags: json.tags,\n };\n } catch {\n return undefined;\n }\n }\n dir = path.dirname(dir);\n }\n\n return undefined;\n}\n\n/**\n * Read the workspace-level nx.json configuration.\n *\n * @param workspaceRoot - Absolute path to the workspace root\n * @returns Parsed nx.json contents, or empty object if not found\n */\nexport function readNxJson(\n workspaceRoot: string\n): Record<string, unknown> {\n const nxJsonPath = path.join(workspaceRoot, \"nx.json\");\n try {\n const raw = fs.readFileSync(nxJsonPath, \"utf-8\");\n return JSON.parse(raw);\n } catch {\n return {};\n }\n}\n", "/**\n * Format files using Prettier \u2014 replaces @nx/devkit formatFiles().\n *\n * Resolves the Prettier config from the workspace root and formats\n * all files tracked by a CodegenFileSystem that match supported extensions.\n */\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport prettier from \"prettier\";\nimport { getCodegenLogger } from \"./logger\";\n\nconst FORMATTABLE_EXTENSIONS = new Set([\n \".ts\",\n \".tsx\",\n \".js\",\n \".jsx\",\n \".json\",\n \".css\",\n \".scss\",\n \".md\",\n \".yaml\",\n \".yml\",\n \".html\",\n]);\n\n/**\n * Format files at the given paths using Prettier.\n *\n * @param workspaceRoot - Absolute path to the workspace root (for Prettier config resolution)\n * @param filePaths - Absolute paths of files to format\n */\nexport async function formatFiles(\n workspaceRoot: string,\n filePaths: string[]\n): Promise<void> {\n const logger = getCodegenLogger();\n\n for (const filePath of filePaths) {\n const ext = path.extname(filePath);\n if (!FORMATTABLE_EXTENSIONS.has(ext)) {\n continue;\n }\n\n try {\n const content = fs.readFileSync(filePath, \"utf-8\");\n const options = await prettier.resolveConfig(filePath, {\n editorconfig: true,\n });\n const formatted = await prettier.format(content, {\n ...options,\n filepath: filePath,\n });\n fs.writeFileSync(filePath, formatted, \"utf-8\");\n logger.debug(`Formatted ${path.relative(workspaceRoot, filePath)}`);\n } catch (err) {\n logger.warn(`Failed to format ${filePath}: ${err}`);\n }\n }\n}\n", "/**\n * String case-conversion utilities.\n *\n * Pure functions with no external dependencies.\n * Ported from kos-nx-plugin/src/utils/name-utils.ts (minus the logger calls).\n */\n\nexport function dashCase(input: string): string {\n return input\n .replace(/\\s+/g, \"-\")\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .toLowerCase();\n}\n\nexport function camelCase(input: string): string {\n if (input.length === 0) return \"\";\n const words = input.split(/-|\\s+/);\n if (words.length > 0 && words[0].length > 0) {\n words[0] = words[0].charAt(0).toLowerCase() + words[0].slice(1);\n }\n for (let i = 1; i < words.length; i++) {\n words[i] = words[i].charAt(0).toUpperCase() + words[i].slice(1);\n }\n return words.join(\"\");\n}\n\nexport function pascalCase(input: string): string {\n if (input.length === 0) return \"\";\n const cc = camelCase(input);\n return cc[0].toUpperCase() + cc.slice(1);\n}\n\nexport function properCase(input: string): string {\n const words = input\n .toLowerCase()\n .replaceAll(\"-\", \" \")\n .split(\" \")\n .filter(Boolean);\n for (let i = 0; i < words.length; i++) {\n words[i] = words[i][0].toUpperCase() + words[i].slice(1);\n }\n return words.join(\"\");\n}\n\n/**\n * Convert to CONSTANT_CASE. Expects space-separated or dash-separated input.\n * camelCase input is not split (e.g. \"myWidget\" becomes \"MYWIDGET\").\n */\nexport function constantCase(input: string): string {\n if (input.length === 0) return \"\";\n return input\n .toUpperCase()\n .split(/[\\s-]+/)\n .filter(Boolean)\n .join(\"_\");\n}\n", "/**\n * Option normalization \u2014 generates all case variants for every string property.\n *\n * Given `{ name: \"my-widget\" }`, produces:\n * ```\n * {\n * name: \"my-widget\",\n * nameCamelCase: \"myWidget\",\n * namePascalCase: \"MyWidget\",\n * nameDashCase: \"my-widget\",\n * nameProperCase: \"MyWidget\",\n * nameConstantCase: \"MY_WIDGET\",\n * nameLowerCase: \"my-widget\",\n * }\n * ```\n *\n * Ported from kos-nx-plugin/src/utils/normalize-value.ts.\n */\nimport {\n camelCase,\n constantCase,\n dashCase,\n pascalCase,\n properCase,\n} from \"./name-utils\";\n\ntype NormalizedFunctions =\n | \"CamelCase\"\n | \"ConstantCase\"\n | \"DashCase\"\n | \"PascalCase\"\n | \"ProperCase\"\n | \"LowerCase\";\n\ntype NormalizedValue<Type extends Record<string, string>> = {\n [k in Type as `${Extract<keyof Type, string>}${NormalizedFunctions}`]: string;\n};\n\ntype Normalized<T extends string> = {\n [k in T as `${T}${NormalizedFunctions}`]: string;\n};\n\nconst normalizeValue = <T extends string>(\n optionsName: T,\n value: string\n): Normalized<T> & { [k in T]: string } =>\n ({\n [`${camelCase(optionsName)}CamelCase`]: camelCase(value),\n [`${camelCase(optionsName)}ConstantCase`]: constantCase(value),\n [`${camelCase(optionsName)}DashCase`]: dashCase(value),\n [`${camelCase(optionsName)}PascalCase`]: pascalCase(value),\n [`${camelCase(optionsName)}ProperCase`]: properCase(value),\n [`${camelCase(optionsName)}LowerCase`]: value.toLowerCase(),\n [`${optionsName}`]: value,\n }) as Normalized<T> & { [k in T]: string };\n\nexport const normalizeAllValues = <T extends Record<string, any>>(\n options: T\n): NormalizedValue<T> & T => {\n let normalizedValues = {} as NormalizedValue<T> & T;\n for (const key in options) {\n if (Object.prototype.hasOwnProperty.call(options, key)) {\n const element = options[key];\n const newOptions =\n typeof element !== \"string\" || element === \"\"\n ? { [key]: element }\n : normalizeValue(key, element);\n\n normalizedValues = {\n ...normalizedValues,\n ...newOptions,\n };\n }\n }\n return normalizedValues;\n};\n", "import * as path from \"path\";\nimport * as fs from \"fs\";\n\n/**\n * Finds the root directory containing the templates/ directory.\n *\n * Resolution order:\n * 1. KOS_TEMPLATE_BASE_DIR env var \u2014 set by kos-ui-cli when running as a\n * bundled ESM package (where __dirname is unavailable).\n * 2. Walk up from __dirname looking for this package's package.json \u2014 works\n * in CJS context (tsc-compiled output or direct Node.js require).\n */\nfunction findPackageRoot(): string {\n if (process.env.KOS_TEMPLATE_BASE_DIR) {\n return process.env.KOS_TEMPLATE_BASE_DIR;\n }\n\n // CJS context: walk up from __dirname to find our package.json\n let dir = __dirname;\n while (dir !== path.dirname(dir)) {\n const pkgPath = path.join(dir, \"package.json\");\n if (fs.existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(fs.readFileSync(pkgPath, \"utf-8\"));\n if (pkg.name === \"@kosdev-code/kos-codegen-core\") {\n return dir;\n }\n } catch {\n // Not valid JSON, keep looking\n }\n }\n dir = path.dirname(dir);\n }\n // Fallback: assume source layout (src/lib/ -> package root)\n return path.resolve(__dirname, \"..\", \"..\");\n}\n\n/**\n * Resolves the absolute path to a generator's template directory.\n * Templates are stored in the `templates/` directory at the package root.\n *\n * @param generatorName - The generator name matching a subdirectory under templates/\n * @returns Absolute path to the template directory for the given generator\n */\nexport function getTemplateDir(generatorName: string): string {\n return path.join(findPackageRoot(), \"templates\", generatorName);\n}\n", "/**\n * Core generator: Splash project.\n *\n * Creates a splash screen project structure and associated tooling scripts.\n * Framework-agnostic \u2014 operates through CodegenFileSystem.\n */\nimport * as path from \"path\";\nimport type { CodegenFileSystem } from \"../codegen-filesystem\";\nimport { generateFilesFromTemplates } from \"../generate-files\";\nimport { normalizeAllValues } from \"../normalize-values\";\n\nexport interface SplashProjectOptions {\n name: string;\n}\n\n/**\n * Generate a splash project with its associated tooling.\n *\n * @param codegenFs - Target filesystem\n * @param templateDir - Absolute path to the template directory containing\n * `project/` and `tools/` subdirectories\n * @param options - Generator options\n */\nexport function generateSplashProject(\n codegenFs: CodegenFileSystem,\n templateDir: string,\n options: SplashProjectOptions\n): void {\n const normalized = normalizeAllValues(options);\n\n const projectRoot = `splash/${normalized.nameDashCase}`;\n const toolsRoot = path.join(\"tools\", \"scripts\");\n\n generateFilesFromTemplates(\n codegenFs,\n path.join(templateDir, \"project\"),\n projectRoot,\n normalized\n );\n\n generateFilesFromTemplates(\n codegenFs,\n path.join(templateDir, \"tools\"),\n toolsRoot,\n normalized\n );\n}\n", "/**\n * TypeScript AST-based index.ts updater.\n *\n * Adds `export * from './path'` declarations to a barrel file using\n * the TypeScript compiler API for proper AST manipulation.\n *\n * Ported from kos-nx-plugin/src/generators/kos-model/lib/utils/ts-visitor.ts.\n */\nimport * as ts from \"typescript\";\nimport type { CodegenFileSystem } from \"../codegen-filesystem\";\nimport { getCodegenLogger } from \"../logger\";\n\n/**\n * Add an export-all declaration to an index.ts file using TS AST.\n *\n * @param codegenFs - Filesystem abstraction\n * @param indexPath - Path to the index.ts file (relative to root)\n * @param modelPath - Relative path to export (e.g. 'models/my-model')\n */\nexport function updateModelIndex(\n codegenFs: CodegenFileSystem,\n indexPath: string,\n modelPath: string\n): void {\n const logger = getCodegenLogger();\n\n if (!indexPath) return;\n\n const content = codegenFs.read(indexPath);\n if (content === null) {\n logger.warn(`Index file not found: ${indexPath}`);\n return;\n }\n\n logger.info(`Updating ${indexPath} \u2014 adding export for ${modelPath}`);\n\n const sourceFile = ts.createSourceFile(\n indexPath,\n content,\n ts.ScriptTarget.Latest,\n true\n );\n\n const exportDeclaration = ts.factory.createExportDeclaration(\n undefined,\n false,\n undefined,\n ts.factory.createStringLiteral(`./${modelPath}`)\n );\n\n const updatedSourceFile = ts.factory.updateSourceFile(sourceFile, [\n ...sourceFile.statements,\n exportDeclaration,\n ]);\n\n const printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed });\n const newContents = printer.printFile(updatedSourceFile);\n\n codegenFs.write(indexPath, newContents);\n}\n", "/**\n * Type definitions for KOS Component Generator\n */\n\n// Plugin type constants\nexport const PLUGIN_TYPES = {\n CUI: \"cui\",\n UTILITY: \"utility\",\n TROUBLE_ACTION: \"troubleAction\",\n SETUP: \"setup\",\n SETTING: \"setting\",\n NAV: \"nav\",\n CONTROL_POUR: \"controlPour\",\n CUSTOM: \"custom\",\n} as const;\n\nexport type PluginType = (typeof PLUGIN_TYPES)[keyof typeof PLUGIN_TYPES];\n\n// Contribution type mapping\nexport const CONTRIBUTION_TYPE_MAP: Record<string, string> = {\n [PLUGIN_TYPES.SETUP]: \"setup\",\n [PLUGIN_TYPES.CUI]: \"cui\",\n [PLUGIN_TYPES.UTILITY]: \"utility\",\n [PLUGIN_TYPES.SETTING]: \"setting\",\n [PLUGIN_TYPES.NAV]: \"nav\",\n [PLUGIN_TYPES.TROUBLE_ACTION]: \"trouble-action\",\n [PLUGIN_TYPES.CONTROL_POUR]: \"control-pour\",\n [PLUGIN_TYPES.CUSTOM]: \"custom\",\n};\n\n// Plugin types that require localization\nexport const LOCALIZED_PLUGIN_TYPES: ReadonlySet<string> = new Set([\n PLUGIN_TYPES.CUI,\n PLUGIN_TYPES.UTILITY,\n PLUGIN_TYPES.SETUP,\n PLUGIN_TYPES.SETTING,\n PLUGIN_TYPES.NAV,\n PLUGIN_TYPES.CONTROL_POUR,\n PLUGIN_TYPES.TROUBLE_ACTION,\n PLUGIN_TYPES.CUSTOM,\n]);\n\n// Configuration interfaces\nexport interface ExperienceConfig {\n id: string;\n component: string;\n location: string;\n}\n\nexport interface PluginContribution {\n id: string;\n title: string;\n namespace: string;\n experienceId?: string;\n [key: string]: any; // Allow plugin-specific properties\n}\n\nexport interface PluginConfiguration {\n contributions: Record<string, PluginContribution[]>;\n experiences: Record<string, ExperienceConfig>;\n views?: Record<string, any[]>;\n}\n\nexport interface NormalizedComponentOptions {\n name: string;\n nameDashCase: string;\n nameCamelCase: string;\n namePascalCase: string;\n nameLowerCase: string;\n appProject: string;\n group?: string;\n pluginType?: string;\n type: string;\n appDirectory: string;\n useEmotionCss?: boolean;\n contributionKey?: string; // User-specified contribution key for custom plugins\n}\n\n// Component generator input options\nexport interface ComponentOptions {\n name: string;\n type: \"components\" | \"features\";\n useEmotionCss: boolean;\n appProject: string;\n appDirectory: string;\n modelDirectory: string;\n group?: string;\n pluginType?: string;\n contributionKey?: string;\n registrationProject?: string;\n skipRegistration?: boolean;\n companion?: boolean;\n companionModel?: string;\n companionModelProject?: string;\n companionPattern?: \"composition\" | \"decorator\";\n}\n\n// JSON path constants for .kos.json structure\nexport const KOS_JSON_PATHS = {\n PLUGIN_ROOT: \"kosdev.ddk.ncui.plugin\",\n CONTRIBUTES: \"kosdev.ddk.ncui.plugin.contributes\",\n EXPERIENCES: \"kosdev.ddk.ncui.plugin.contributes.experiences\",\n VIEWS: \"kosdev.ddk.ncui.plugin.contributes.views\",\n TAB_VIEW: \"ddk.ncui.settings.tabView\",\n} as const;\n", "import {\n ExperienceConfig,\n NormalizedComponentOptions,\n PluginConfiguration,\n PluginContribution,\n} from \"../types\";\n\n/**\n * Base interface for plugin-specific handlers\n */\nexport interface PluginHandler {\n /**\n * Creates the plugin-specific configuration\n */\n createConfiguration(options: NormalizedComponentOptions): PluginConfiguration;\n\n /**\n * Returns the contribution key for this plugin type\n */\n getContributionKey(): string;\n\n /**\n * Checks if this plugin type requires localization\n */\n requiresLocalization(): boolean;\n\n /**\n * Gets the template source path for this plugin type\n */\n getTemplatePath(): string;\n}\n\n/**\n * Base implementation with common functionality\n */\nexport abstract class BasePluginHandler implements PluginHandler {\n protected abstract pluginType: string;\n protected abstract contributionKey: string;\n protected abstract requiresI18n: boolean;\n\n abstract createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration;\n\n getContributionKey(): string {\n return this.contributionKey;\n }\n\n requiresLocalization(): boolean {\n return this.requiresI18n;\n }\n\n getTemplatePath(): string {\n return this.contributionKey;\n }\n\n /**\n * Helper to create experience configuration\n */\n protected createExperience(\n options: NormalizedComponentOptions,\n experienceId: string\n ): ExperienceConfig {\n const compPath = this.getComponentPath(options);\n\n return {\n id: experienceId,\n component: options.namePascalCase,\n location: `./src/${compPath}`,\n };\n }\n\n /**\n * Helper to get component path\n */\n protected getComponentPath(options: NormalizedComponentOptions): string {\n return `${options.appDirectory}/${this.contributionKey}/${options.nameDashCase}/${options.nameDashCase}.tsx`;\n }\n\n /**\n * Helper to create config prefix\n */\n protected getConfigPrefix(options: NormalizedComponentOptions): string {\n return `${options.appProject}.${options.nameCamelCase}`;\n }\n}\n", "import {\n NormalizedComponentOptions,\n PLUGIN_TYPES,\n PluginConfiguration,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class ControlPourPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.CONTROL_POUR;\n protected contributionKey = \"control-pour\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.controlPour.experience`;\n\n const contribution = {\n id: `${configPrefix}.controlPour`,\n title: `${configPrefix}.controlPour.title`,\n namespace: options.appProject,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n controlPour: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PLUGIN_TYPES,\n PluginConfiguration,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class CuiPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.CUI;\n protected contributionKey = \"cui\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.cui.experience`;\n\n const contribution = {\n id: configPrefix,\n title: `${configPrefix}.cui.title`,\n namespace: options.appProject,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n cui: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PLUGIN_TYPES,\n PluginConfiguration,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class CustomPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.CUSTOM;\n protected contributionKey = \"custom\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.${\n options.contributionKey || \"custom\"\n }.experience`;\n\n // Get the user-specified contribution key or default to 'custom'\n const userContributionKey = options.contributionKey || \"custom\";\n\n const contribution = {\n id: configPrefix,\n title: `${configPrefix}.${userContributionKey}.title`,\n namespace: options.appProject,\n experienceId,\n // TODO: Add additional fields as required by the plugin-explorer specification\n // Refer to the plugin-explorer documentation for your specific contribution type\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n [userContributionKey]: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n\n override getTemplatePath(): string {\n // Use the generic 'custom' template path\n return this.contributionKey || \"custom\";\n }\n\n protected override getComponentPath(options: NormalizedComponentOptions): string {\n // Use the user-specified contribution key for the path if available\n const pathKey = options.contributionKey || \"custom\";\n return `${options.appDirectory}/${pathKey}/${options.nameDashCase}/${options.nameDashCase}.tsx`;\n }\n}\n", "import { NormalizedComponentOptions, PluginConfiguration } from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\n/**\n * Default handler for non-plugin components\n */\nexport class DefaultComponentHandler extends BasePluginHandler {\n protected pluginType = \"component\";\n protected contributionKey = \"components\";\n protected requiresI18n = false;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const compPath = this.getComponentPath(options);\n\n const viewConfig = {\n id: `${options.appProject}.${options.nameCamelCase}`,\n title: \"ddk.ncui.config.title\",\n namespace: options.appProject,\n component: options.namePascalCase,\n location: `./src/${compPath}`,\n };\n\n return {\n contributions: {},\n experiences: {},\n views: {\n [this.getTabViewKey()]: [viewConfig],\n },\n };\n }\n\n private getTabViewKey(): string {\n return \"ddk.ncui.settings.tabView\";\n }\n\n override getTemplatePath(): string {\n return \"files\"; // Default template path\n }\n}\n", "import {\n NormalizedComponentOptions,\n PluginConfiguration,\n PLUGIN_TYPES,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class NavPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.NAV;\n protected contributionKey = \"nav\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.nav.experience`;\n\n const contribution = {\n id: `${configPrefix}.nav`,\n title: `${configPrefix}.nav.title`,\n namespace: options.appProject,\n navDescriptor: options.nameLowerCase,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n navViews: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PluginConfiguration,\n PLUGIN_TYPES,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class SettingPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.SETTING;\n protected contributionKey = \"setting\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.settings.experience`;\n\n const contribution = {\n id: `${configPrefix}.setting`,\n title: `${configPrefix}.setting.title`,\n namespace: options.appProject,\n settingsGroup: options.group || \"general\",\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n settings: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PluginConfiguration,\n PLUGIN_TYPES,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class SetupPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.SETUP;\n protected contributionKey = \"setup\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.setup.experience`;\n\n const contribution = {\n id: `${configPrefix}.setup`,\n title: `${configPrefix}.setup.title`,\n namespace: options.appProject,\n setupDescriptor: options.nameCamelCase,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n setupStep: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PluginConfiguration,\n PLUGIN_TYPES,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class TroubleActionPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.TROUBLE_ACTION;\n protected contributionKey = \"trouble-action\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.troubleAction.experience`;\n\n const contribution = {\n id: `${configPrefix}.troubleAction`,\n title: `${configPrefix}.troubleAction.title`,\n namespace: options.appProject,\n troubleType: options.nameCamelCase,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n troubleActions: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import {\n NormalizedComponentOptions,\n PluginConfiguration,\n PLUGIN_TYPES,\n} from \"../types\";\nimport { BasePluginHandler } from \"./base\";\n\nexport class UtilityPluginHandler extends BasePluginHandler {\n protected pluginType = PLUGIN_TYPES.UTILITY;\n protected contributionKey = \"utility\";\n protected requiresI18n = true;\n\n createConfiguration(\n options: NormalizedComponentOptions\n ): PluginConfiguration {\n const configPrefix = this.getConfigPrefix(options);\n const experienceId = `${configPrefix}.util.experience`;\n\n const contribution = {\n id: `${configPrefix}.util`,\n title: `${configPrefix}.utility.title`,\n namespace: options.appProject,\n utilDescriptor: options.nameCamelCase,\n experienceId,\n };\n\n const experience = this.createExperience(options, experienceId);\n\n return {\n contributions: {\n utilities: [contribution],\n },\n experiences: {\n [experienceId]: experience,\n },\n };\n }\n}\n", "import { PLUGIN_TYPES } from \"../types\";\nimport { PluginHandler } from \"./base\";\nimport { ControlPourPluginHandler } from \"./control-pour-handler\";\nimport { CuiPluginHandler } from \"./cui-handler\";\nimport { CustomPluginHandler } from \"./custom-handler\";\nimport { DefaultComponentHandler } from \"./default-handler\";\nimport { NavPluginHandler } from \"./nav-handler\";\nimport { SettingPluginHandler } from \"./setting-handler\";\nimport { SetupPluginHandler } from \"./setup-handler\";\nimport { TroubleActionPluginHandler } from \"./trouble-action-handler\";\nimport { UtilityPluginHandler } from \"./utility-handler\";\n\n/**\n * Factory for creating plugin-specific handlers\n */\nexport class PluginHandlerFactory {\n private static handlers: Map<string, new () => PluginHandler> = new Map<\n string,\n new () => PluginHandler\n >([\n [PLUGIN_TYPES.CUI, CuiPluginHandler],\n [PLUGIN_TYPES.UTILITY, UtilityPluginHandler],\n [PLUGIN_TYPES.SETTING, SettingPluginHandler],\n [PLUGIN_TYPES.SETUP, SetupPluginHandler],\n [PLUGIN_TYPES.NAV, NavPluginHandler],\n [PLUGIN_TYPES.CONTROL_POUR, ControlPourPluginHandler],\n [PLUGIN_TYPES.TROUBLE_ACTION, TroubleActionPluginHandler],\n [PLUGIN_TYPES.CUSTOM, CustomPluginHandler],\n ]);\n\n static createHandler(pluginType?: string): PluginHandler {\n if (!pluginType) {\n return new DefaultComponentHandler();\n }\n\n const HandlerClass = this.handlers.get(pluginType);\n\n if (!HandlerClass) {\n console.warn(\n `No handler found for plugin type: ${pluginType}. Using default handler.`\n );\n return new DefaultComponentHandler();\n }\n\n return new HandlerClass();\n }\n\n static isValidPluginType(type: string): boolean {\n return this.handlers.has(type);\n }\n}\n", "export const actionFactory = (action, metadata) => {\n return () => {\n const _actions = [{ type: action }];\n if (metadata.invalidateCache) {\n _actions.push({ type: \"clearCache\" });\n }\n return _actions;\n };\n};\n", "// utils/validators.mjs\n\n/**\n * Validator that ensures a value is not empty.\n * @param {string} value\n * @returns {true|string}\n */\nexport function required(value) {\n return value && value.trim() !== \"\" ? true : \"This field is required.\";\n}\n", "// generators/project/splash.mjs\nimport {\n DirectFileSystem,\n formatFiles,\n generateSplashProject,\n getTemplateDir,\n TrackingFileSystem,\n} from \"@kosdev-code/kos-codegen-core\";\nimport { actionFactory } from \"../../utils/action-factory.mjs\";\nimport { required } from \"../../utils/validators.mjs\";\n\nexport const metadata = {\n key: \"project:splash\",\n name: \"KOS Splash Screen Project\",\n invalidateCache: true,\n namedArguments: { name: \"name\" },\n};\nexport default async function (plop) {\n plop.setActionType(\"createSplashProject\", async function (answers) {\n const cwd = process.cwd();\n const codegenFs = new TrackingFileSystem(new DirectFileSystem(cwd));\n\n generateSplashProject(codegenFs, getTemplateDir(\"kos-splash-project\"), {\n name: answers.name,\n });\n\n await formatFiles(codegenFs.root, codegenFs.writtenPaths);\n\n return `Splash page project ${answers.name} created.`;\n });\n\n plop.setGenerator(\"project:splash\", {\n description: \"Create a new KOS Splash Page Project\",\n prompts: [\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the name of the splash project?\",\n validate: required,\n },\n ],\n actions: actionFactory(\"createSplashProject\", metadata),\n });\n}\n"],
5
+ "mappings": ";AAAA,YAAY,QAAQ;AACpB,YAAY,UAAU;AAuCf,IAAM,qBAAN,MAAsD;AAAA,EAC1C;AAAA,EACA,gBAA0B,CAAC;AAAA,EAE5C,YAAY,OAA0B;AACpC,SAAK,QAAQ;AAAA,EACf;AAAA,EAEA,IAAI,OAAe;AACjB,WAAO,KAAK,MAAM;AAAA,EACpB;AAAA,EAEA,IAAI,eAAyB;AAC3B,WAAO,CAAC,GAAG,KAAK,aAAa;AAAA,EAC/B;AAAA,EAEA,KAAK,UAAiC;AACpC,WAAO,KAAK,MAAM,KAAK,QAAQ;AAAA,EACjC;AAAA,EAEA,MAAM,UAAkB,SAAuB;AAC7C,SAAK,MAAM,MAAM,UAAU,OAAO;AAClC,SAAK,cAAc;AAAA,MACZ,gBAAW,QAAQ,IAAI,WAAgB,UAAK,KAAK,MAAM,MAAM,QAAQ;AAAA,IAC5E;AAAA,EACF;AAAA,EAEA,OAAO,UAA2B;AAChC,WAAO,KAAK,MAAM,OAAO,QAAQ;AAAA,EACnC;AAAA,EAEA,OAAO,UAAwB;AAC7B,SAAK,MAAM,OAAO,QAAQ;AAAA,EAC5B;AAAA,EAEA,UAAU,SAA2B;AACnC,WAAO,KAAK,MAAM,UAAU,OAAO;AAAA,EACrC;AACF;AAMO,IAAM,mBAAN,MAAoD;AAAA,EAChD;AAAA,EAET,YAAY,eAAuB;AACjC,SAAK,OAAY,aAAQ,aAAa;AAA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fs", "path", "metadata"]
7
+ }
@@ -1,4 +1,5 @@
1
1
  // utils/dev-config.mjs
2
+ import { execSync } from "child_process";
2
3
  import { existsSync, readFileSync } from "fs";
3
4
  import path from "path";
4
5
 
@@ -97,18 +98,12 @@ export function filterPlugins(hostPlugins, options = {}) {
97
98
  * @returns {boolean} True if project exists
98
99
  */
99
100
  export function checkProjectExists(projectName) {
100
- const workspaceRoot = process.cwd();
101
-
102
- // Check common project locations
103
- const appPath = path.join(workspaceRoot, 'apps', projectName, 'project.json');
104
- const libPath = path.join(workspaceRoot, 'libs', projectName, 'project.json');
105
- const pluginPath = path.join(workspaceRoot, 'plugins', projectName, 'project.json');
106
- const packagesPath = path.join(workspaceRoot, 'packages', projectName, 'project.json');
107
-
108
- return existsSync(appPath) ||
109
- existsSync(libPath) ||
110
- existsSync(pluginPath) ||
111
- existsSync(packagesPath);
101
+ try {
102
+ execSync(`npx nx show project ${projectName} --json`, { stdio: "pipe" });
103
+ return true;
104
+ } catch {
105
+ return false;
106
+ }
112
107
  }
113
108
 
114
109
  /**