@kosdev-code/kos-ui-cli 2.1.38 → 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.
- package/package.json +5 -6
- package/src/lib/cli.mjs +34 -10
- package/src/lib/generators/component/index.mjs +1230 -27
- package/src/lib/generators/component/index.mjs.map +7 -0
- package/src/lib/generators/model/add-future.mjs +1449 -43
- package/src/lib/generators/model/add-future.mjs.map +7 -0
- package/src/lib/generators/model/companion.mjs +1465 -56
- package/src/lib/generators/model/companion.mjs.map +7 -0
- package/src/lib/generators/model/container.mjs +1234 -45
- package/src/lib/generators/model/container.mjs.map +7 -0
- package/src/lib/generators/model/context.mjs +1102 -35
- package/src/lib/generators/model/context.mjs.map +7 -0
- package/src/lib/generators/model/hook.mjs +1097 -33
- package/src/lib/generators/model/hook.mjs.map +7 -0
- package/src/lib/generators/model/model.mjs +1411 -39
- package/src/lib/generators/model/model.mjs.map +7 -0
- package/src/lib/generators/plugin/index.mjs +1275 -74
- package/src/lib/generators/plugin/index.mjs.map +7 -0
- package/src/lib/generators/project/splash.mjs +691 -21
- package/src/lib/generators/project/splash.mjs.map +7 -0
- package/src/lib/utils/dev-config.mjs +7 -12
- package/src/lib/utils/nx-context.mjs +584 -170
- package/src/lib/utils/nx-context.mjs.map +7 -0
- package/README.md +0 -484
- package/src/index.d.ts +0 -2
- package/src/index.d.ts.map +0 -1
- package/src/index.js +0 -1
- package/src/index.js.map +0 -1
|
@@ -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/json-utils.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/kos-config.ts", "../../../../../../../packages/kos-codegen-core/src/lib/template-resolver.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/normalize-options.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/update-model-index.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/generate-component.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-codegen-core/src/lib/generators/component/utils/file-generator.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/utils/kos-config-builder.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/utils/localization.ts", "../../../../../../../packages/kos-codegen-core/src/lib/generators/component/utils/validation.ts", "../../../../../../../packages/kos-ui-cli/src/lib/utils/nx-context.mjs", "../../../../../../../packages/kos-ui-cli/src/lib/utils/cache.mjs", "../../../../../../../packages/kos-ui-cli/src/lib/utils/validators.mjs", "../../../../../../../packages/kos-ui-cli/src/lib/generators/plugin/index.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 * JSON read/write/update utilities operating on a CodegenFileSystem.\n *\n * Replaces @nx/devkit readJson, writeJson, updateJson.\n */\nimport type { CodegenFileSystem } from \"./codegen-filesystem\";\n\n/**\n * Read and parse a JSON file from the filesystem.\n *\n * @param codegenFs - Filesystem abstraction\n * @param filePath - Path relative to workspace root\n * @returns Parsed JSON object\n * @throws If the file does not exist or contains invalid JSON\n */\nexport function readJson<T = Record<string, unknown>>(\n codegenFs: CodegenFileSystem,\n filePath: string\n): T {\n const content = codegenFs.read(filePath);\n if (content === null) {\n throw new Error(`File not found: ${filePath}`);\n }\n return JSON.parse(content) as T;\n}\n\n/**\n * Serialize and write a JSON object to the filesystem.\n *\n * @param codegenFs - Filesystem abstraction\n * @param filePath - Path relative to workspace root\n * @param value - Object to serialize\n */\nexport function writeJson<T = Record<string, unknown>>(\n codegenFs: CodegenFileSystem,\n filePath: string,\n value: T\n): void {\n codegenFs.write(filePath, JSON.stringify(value, null, 2) + \"\\n\");\n}\n\n/**\n * Read a JSON file, apply a transformation, and write it back.\n *\n * @param codegenFs - Filesystem abstraction\n * @param filePath - Path relative to workspace root\n * @param updater - Function that receives the parsed object and returns the updated object\n */\nexport function updateJson<T = Record<string, unknown>>(\n codegenFs: CodegenFileSystem,\n filePath: string,\n updater: (json: T) => T\n): void {\n const current = readJson<T>(codegenFs, filePath);\n const updated = updater(current);\n writeJson(codegenFs, filePath, updated);\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", "/**\n * KOS project and model configuration utilities.\n *\n * Reads and writes .kos.json files through CodegenFileSystem.\n * Ported from kos-nx-plugin/src/utils/project-utils.ts.\n */\nimport * as path from \"path\";\nimport type { CodegenFileSystem } from \"./codegen-filesystem\";\nimport {\n findProjectByName,\n findProjectForPath,\n type ProjectConfiguration,\n} from \"./project-discovery\";\nimport { readJson, updateJson } from \"./json-utils\";\nimport { dashCase } from \"./name-utils\";\nimport { getCodegenLogger } from \"./logger\";\n\nexport interface KosModelConfiguration {\n name: string;\n type: string;\n singleton: boolean;\n container?: boolean;\n}\n\nexport interface KosProjectConfiguration {\n name: string;\n type: string;\n version: string;\n models: Record<string, KosModelConfiguration>;\n generator?: {\n internal?: boolean;\n defaults?: {\n model?: { folder?: string };\n components?: { folder?: string };\n };\n };\n}\n\nexport function getCurrentDirectoryName(cwd: string): string | undefined {\n return cwd.split(\"/\").pop();\n}\n\n/**\n * Find the project that contains the given working directory.\n */\nexport function getProject(\n codegenFs: CodegenFileSystem,\n cwd: string\n): ProjectConfiguration | undefined {\n return findProjectForPath(codegenFs.root, cwd);\n}\n\n/**\n * Read .kos.json for a project, creating a default if it doesn't exist.\n */\nexport function getKosProjectConfiguration(\n codegenFs: CodegenFileSystem,\n projectName: string,\n projects?: Map<string, ProjectConfiguration>\n): KosProjectConfiguration | undefined {\n const project = findProjectByName(codegenFs.root, projectName, projects);\n if (!project) return undefined;\n\n const configPath = path.join(project.root, \".kos.json\");\n if (!codegenFs.exists(configPath)) {\n const defaultConfig: KosProjectConfiguration = {\n name: `${dashCase(projectName)}-model`,\n type: \"kos.model\",\n version: \"0.1.0\",\n models: {},\n generator: { defaults: { model: { folder: \"\" } } },\n };\n codegenFs.write(configPath, JSON.stringify(defaultConfig, null, 2));\n }\n\n const content = codegenFs.read(configPath);\n return content ? JSON.parse(content) : undefined;\n}\n\n/**\n * Read a specific model's configuration from .kos.json.\n */\nexport function getKosModelConfiguration(\n codegenFs: CodegenFileSystem,\n projectName: string,\n modelName: string,\n projects?: Map<string, ProjectConfiguration>\n): KosModelConfiguration | undefined {\n const kosConfig = getKosProjectConfiguration(\n codegenFs,\n projectName,\n projects\n );\n return kosConfig?.models?.[modelName];\n}\n\n/**\n * Read a specific property from a model's configuration.\n */\nexport function getKosModelConfigProp(params: {\n codegenFs: CodegenFileSystem;\n project: string;\n modelName: string;\n prop: string;\n projects?: Map<string, ProjectConfiguration>;\n}): any {\n const config = getKosModelConfiguration(\n params.codegenFs,\n params.project,\n params.modelName,\n params.projects\n );\n return config ? (config as any)[params.prop] : undefined;\n}\n\n/**\n * Add a model entry to a project's .kos.json.\n */\nexport function addKosModelConfiguration(params: {\n codegenFs: CodegenFileSystem;\n projectName: string;\n projectRoot: string;\n modelName: string;\n singleton: boolean;\n container?: boolean;\n}): void {\n const logger = getCodegenLogger();\n const kosConfigPath = path.join(params.projectRoot, \".kos.json\");\n\n if (!params.codegenFs.exists(kosConfigPath)) {\n logger.info(`Creating .kos.json in ${params.projectRoot}`);\n const defaultConfig = {\n name: params.projectName,\n type: \"kos.model\",\n version: \"0.1.0\",\n models: {},\n generator: { defaults: { model: { folder: \"\" } } },\n };\n params.codegenFs.write(\n kosConfigPath,\n JSON.stringify(defaultConfig, null, 2) + \"\\n\"\n );\n }\n\n updateJson(params.codegenFs, kosConfigPath, (json: any) => {\n json.models = {\n ...json.models,\n [params.modelName]: {\n name: params.modelName,\n type: `${params.modelName}-model`,\n singleton: !!params.singleton,\n container: !!params.container,\n },\n };\n return json;\n });\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 * Normalize generator options \u2014 resolves project references and generates\n * all case variants for template substitution.\n *\n * Ported from kos-nx-plugin/src/generators/kos-model/lib/normalize-options.ts.\n */\nimport * as path from \"path\";\nimport type { CodegenFileSystem } from \"../codegen-filesystem\";\nimport { readJson } from \"../json-utils\";\nimport { normalizeAllValues } from \"../normalize-values\";\nimport {\n findProjectByName,\n type ProjectConfiguration,\n} from \"../project-discovery\";\n\nexport interface KosBaseGeneratorOptions {\n name: string;\n modelProject: string;\n registrationProject?: string;\n skipRegistration?: boolean;\n modelDirectory: string;\n companion?: boolean;\n companionModel?: string;\n companionModelProject?: string;\n companionPattern?: \"composition\" | \"decorator\";\n}\n\nexport type NormalizedOptions<T extends KosBaseGeneratorOptions> = T & {\n nameDashCase: string;\n nameProperCase: string;\n nameCamelCase: string;\n namePascalCase: string;\n nameConstantCase: string;\n nameLowerCase: string;\n companionModelDashCase: string;\n companionModelProperCase: string;\n companionModelCamelCase: string;\n companionModelPascalCase: string;\n companionModelConstantCase: string;\n companionModelLowerCase: string;\n registrationProject: string;\n importPath: string;\n template: string;\n [key: string]: any;\n};\n\n/**\n * Normalize generator options by resolving the model project and generating\n * all name variants for template substitution.\n *\n * @param codegenFs - Filesystem abstraction\n * @param options - Raw generator options\n * @param projects - Optional pre-computed project map\n */\nexport function normalizeOptions<T extends KosBaseGeneratorOptions>(\n codegenFs: CodegenFileSystem,\n options: T,\n projects?: Map<string, ProjectConfiguration>\n): NormalizedOptions<T> {\n const toNormalize: Record<string, string> = {\n name: options.name,\n };\n\n if ((options as any).modelName) {\n toNormalize.modelName = (options as any).modelName;\n }\n\n if (options.companionModel) {\n toNormalize.companionModel = options.companionModel;\n }\n\n const normalizedValues = normalizeAllValues(toNormalize);\n const modelProject = options.modelProject;\n const registrationProject = options.registrationProject || \"\";\n const useModelProject = modelProject !== \"__NONE__\";\n\n let importPath = \"\";\n if (useModelProject) {\n const modelProjectConfig = findProjectByName(\n codegenFs.root,\n modelProject,\n projects\n );\n if (modelProjectConfig) {\n const pkgJsonPath = path.join(modelProjectConfig.root, \"package.json\");\n try {\n const pkgJson = readJson<{ name: string }>(codegenFs, pkgJsonPath);\n importPath = pkgJson.name || \"\";\n } catch {\n importPath = \"\";\n }\n }\n }\n\n // Provide safe defaults for optional boolean fields that templates reference\n // directly. Without explicit values, EJS throws ReferenceError for variables\n // that are simply absent from the options object (undefined keys are omitted\n // by the spread, which is different from being present-but-false).\n const booleanDefaults: Partial<KosBaseGeneratorOptions> = {\n companion: false,\n skipRegistration: false,\n };\n\n return {\n ...booleanDefaults,\n ...options,\n ...normalizedValues,\n modelProject,\n importPath,\n registrationProject,\n template: \"\",\n } as NormalizedOptions<T>;\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 * Core component generator \u2014 framework-agnostic.\n *\n * Replaces the Nx-coupled logic from kos-nx-plugin kos-component generator.\n * Uses CodegenFileSystem instead of @nx/devkit Tree.\n */\nimport * as path from \"path\";\nimport type { CodegenFileSystem } from \"../../codegen-filesystem\";\nimport { getKosProjectConfiguration } from \"../../kos-config\";\nimport type { ProjectConfiguration } from \"../../project-discovery\";\nimport { findProjectByName } from \"../../project-discovery\";\nimport { normalizeOptions } from \"../normalize-options\";\nimport { PluginHandlerFactory } from \"./plugin-handlers/factory\";\nimport {\n ComponentOptions,\n CONTRIBUTION_TYPE_MAP,\n NormalizedComponentOptions,\n} from \"./types\";\nimport { generateComponentFiles } from \"./utils/file-generator\";\nimport { KosConfigBuilder } from \"./utils/kos-config-builder\";\nimport { updateLocalization } from \"./utils/localization\";\nimport { validateOptions } from \"./utils/validation\";\n\nexport type { ComponentOptions } from \"./types\";\n\n/**\n * Generate a KOS component using the framework-agnostic CodegenFileSystem.\n *\n * @param codegenFs - Filesystem abstraction (NxTreeAdapter or DirectFileSystem)\n * @param templateDir - Absolute path to the template base directory\n * @param options - Component generator options\n * @param projects - Optional pre-computed project map (avoids rescan)\n */\nexport function generateComponent(\n codegenFs: CodegenFileSystem,\n templateDir: string,\n options: ComponentOptions,\n projects?: Map<string, ProjectConfiguration>\n): void {\n // Step 1: Validate options\n validateOptions(codegenFs, options, projects);\n\n // Step 2: Normalize options\n const normalized = prepareOptions(codegenFs, options, projects);\n\n // Step 3: Get project configuration\n const projectConfig = findProjectByName(\n codegenFs.root,\n normalized.appProject,\n projects\n );\n\n if (!projectConfig) {\n throw new Error(\n `Project \"${normalized.appProject}\" not found in workspace`\n );\n }\n\n const projectRoot = projectConfig.sourceRoot;\n\n if (!projectRoot) {\n throw new Error(\n `No source root found for project ${normalized.appProject}`\n );\n }\n\n // Step 4: Generate component files\n generateFiles(codegenFs, templateDir, projectRoot, normalized);\n\n // Step 5: Update plugin configuration if needed\n if (options.pluginType) {\n updatePluginConfiguration(codegenFs, projectConfig, normalized);\n }\n}\n\n/**\n * Prepares and normalizes options\n */\nfunction prepareOptions(\n codegenFs: CodegenFileSystem,\n options: ComponentOptions,\n projects?: Map<string, ProjectConfiguration>\n): NormalizedComponentOptions {\n const normalized = normalizeOptions(\n codegenFs,\n {\n ...options,\n modelProject: \"__NONE__\",\n },\n projects\n ) as unknown as NormalizedComponentOptions;\n\n // Get KOS configuration for component location\n const kosConfig = getKosProjectConfiguration(\n codegenFs,\n options.appProject,\n projects\n );\n\n const componentLocation =\n (kosConfig?.generator?.defaults as any)?.component?.folder || \"\";\n\n // Set component directory and type\n normalized.appDirectory = options.appDirectory || componentLocation;\n normalized.type =\n CONTRIBUTION_TYPE_MAP[options.pluginType || \"\"] || options.type;\n\n // Pass through contributionKey for custom plugin types\n if (options.contributionKey) {\n normalized.contributionKey = options.contributionKey;\n }\n\n return normalized;\n}\n\n/**\n * Generates component files from templates\n */\nfunction generateFiles(\n codegenFs: CodegenFileSystem,\n templateDir: string,\n projectRoot: string,\n options: NormalizedComponentOptions\n): void {\n // Get appropriate handler\n const handler = PluginHandlerFactory.createHandler(options.pluginType);\n const templatePath = handler.getTemplatePath();\n\n // Determine target path\n const targetPath = path.join(\n projectRoot,\n options.appDirectory,\n options.type,\n options.nameDashCase\n );\n\n // Generate files\n generateComponentFiles(\n codegenFs,\n templateDir,\n templatePath,\n targetPath,\n options\n );\n}\n\n/**\n * Updates plugin configuration in .kos.json\n */\nfunction updatePluginConfiguration(\n codegenFs: CodegenFileSystem,\n projectConfig: ProjectConfiguration,\n options: NormalizedComponentOptions\n): void {\n const kosConfigPath = path.join(projectConfig.root, \".kos.json\");\n\n if (!codegenFs.exists(kosConfigPath)) {\n console.warn(`No .kos.json found at ${kosConfigPath}`);\n return;\n }\n\n // Get handler and create configuration\n const handler = PluginHandlerFactory.createHandler(options.pluginType);\n const pluginConfig = handler.createConfiguration(options);\n\n // Update .kos.json using builder\n const builder = KosConfigBuilder.create();\n builder.addPluginConfiguration(pluginConfig);\n builder.applyToFile(codegenFs, kosConfigPath);\n\n // Update localization if needed\n if (handler.requiresLocalization() && projectConfig.sourceRoot) {\n updateLocalization(\n codegenFs,\n projectConfig.sourceRoot,\n options,\n handler.getContributionKey()\n );\n }\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", "import * as path from \"path\";\nimport type { CodegenFileSystem } from \"../../../codegen-filesystem\";\nimport { generateFilesFromTemplates } from \"../../../generate-files\";\nimport { NormalizedComponentOptions } from \"../types\";\n\n/**\n * Generates component files from templates.\n *\n * @param codegenFs - Filesystem abstraction\n * @param templateBaseDir - Absolute path to the base template directory\n * @param templateSubPath - Sub-path from handler (e.g., \"cui\", \"files\")\n * @param targetPath - Destination path relative to workspace root\n * @param options - Normalized component options for template substitution\n */\nexport function generateComponentFiles(\n codegenFs: CodegenFileSystem,\n templateBaseDir: string,\n templateSubPath: string,\n targetPath: string,\n options: NormalizedComponentOptions\n): void {\n generateFilesFromTemplates(\n codegenFs,\n path.join(templateBaseDir, templateSubPath),\n targetPath,\n options\n );\n\n // Handle CSS file deletion if needed\n if (options.useEmotionCss) {\n deleteCssFile(codegenFs, targetPath, options);\n }\n}\n\n/**\n * Deletes the CSS file when using Emotion CSS\n */\nfunction deleteCssFile(\n codegenFs: CodegenFileSystem,\n targetPath: string,\n options: NormalizedComponentOptions\n): void {\n const cssPath = path.join(targetPath, `${options.nameDashCase}.css`);\n\n if (codegenFs.exists(cssPath)) {\n codegenFs.delete(cssPath);\n }\n}\n", "import type { CodegenFileSystem } from \"../../../codegen-filesystem\";\nimport { updateJson } from \"../../../json-utils\";\nimport { PluginConfiguration } from \"../types\";\n\n/**\n * Builder for constructing and updating .kos.json configuration\n */\nexport class KosConfigBuilder {\n private contributions: Record<string, any[]> = {};\n private experiences: Record<string, any> = {};\n private views: Record<string, any[]> = {};\n\n /**\n * Adds plugin configuration to the builder\n */\n addPluginConfiguration(config: PluginConfiguration): this {\n // Merge contributions\n Object.entries(config.contributions).forEach(([key, value]) => {\n this.contributions[key] = [...(this.contributions[key] || []), ...value];\n });\n\n // Merge experiences\n Object.assign(this.experiences, config.experiences);\n\n // Merge views\n if (config.views) {\n Object.entries(config.views).forEach(([key, value]) => {\n this.views[key] = [...(this.views[key] || []), ...value];\n });\n }\n\n return this;\n }\n\n /**\n * Applies the built configuration to the .kos.json file\n */\n applyToFile(codegenFs: CodegenFileSystem, kosConfigPath: string): void {\n updateJson(codegenFs, kosConfigPath, (json: any) => {\n // Initialize the deep structure if it doesn't exist\n const structure = this.initializeStructure(json);\n\n // Merge contributions\n Object.entries(this.contributions).forEach(([key, value]) => {\n structure.contributes[key] = [\n ...(structure.contributes[key] || []),\n ...value,\n ];\n });\n\n // Merge experiences\n structure.contributes.experiences = {\n ...structure.contributes.experiences,\n ...this.experiences,\n };\n\n // Merge views\n if (Object.keys(this.views).length > 0) {\n structure.contributes.views = structure.contributes.views || {};\n\n Object.entries(this.views).forEach(([key, value]) => {\n structure.contributes.views[key] = [\n ...(structure.contributes.views[key] || []),\n ...value,\n ];\n });\n }\n\n return json;\n });\n }\n\n /**\n * Initializes the deep JSON structure\n */\n private initializeStructure(json: any): any {\n json.kos ??= {};\n json.kos.ui ??= {};\n json.kos.ui.plugin ??= {};\n json.kos.ui.plugin.contributes ??= {};\n\n return json.kos.ui.plugin;\n }\n\n /**\n * Creates a new builder instance\n */\n static create(): KosConfigBuilder {\n return new KosConfigBuilder();\n }\n}\n", "import * as path from \"path\";\nimport type { CodegenFileSystem } from \"../../../codegen-filesystem\";\nimport { updateJson } from \"../../../json-utils\";\nimport { NormalizedComponentOptions } from \"../types\";\n\n/**\n * Updates localization files for plugin components\n */\nexport function updateLocalization(\n codegenFs: CodegenFileSystem,\n projectRoot: string,\n options: NormalizedComponentOptions,\n pluginType: string\n): void {\n const localePath = path.join(\n projectRoot,\n \"assets\",\n \"locales\",\n \"en\",\n `${options.appProject}.json`\n );\n\n if (!codegenFs.exists(localePath)) {\n console.warn(`Locale file not found: ${localePath}`);\n return;\n }\n\n updateJson(codegenFs, localePath, (json: any) => {\n // Ensure nested structure exists\n json[options.appProject] = json[options.appProject] || {};\n json[options.appProject][options.nameCamelCase] =\n json[options.appProject][options.nameCamelCase] || {};\n\n // Add localization entry\n json[options.appProject][options.nameCamelCase][pluginType] = {\n ...json[options.appProject][options.nameCamelCase][pluginType],\n title: options.nameCamelCase,\n };\n\n return json;\n });\n}\n", "import type { CodegenFileSystem } from \"../../../codegen-filesystem\";\nimport {\n findProjectByName,\n type ProjectConfiguration,\n} from \"../../../project-discovery\";\nimport { PluginHandlerFactory } from \"../plugin-handlers/factory\";\nimport type { ComponentOptions } from \"../types\";\n\nexport class ValidationError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ValidationError\";\n }\n}\n\n/**\n * Validates generator options\n */\nexport function validateOptions(\n codegenFs: CodegenFileSystem,\n options: ComponentOptions,\n projects?: Map<string, ProjectConfiguration>\n): void {\n // Validate required fields\n if (!options.name) {\n throw new ValidationError(\"Component name is required\");\n }\n\n if (!options.appProject) {\n throw new ValidationError(\"App project is required\");\n }\n\n // Validate project exists\n const project = findProjectByName(codegenFs.root, options.appProject, projects);\n if (!project) {\n throw new ValidationError(\n `Project \"${options.appProject}\" not found in workspace`\n );\n }\n\n // Validate plugin type if provided\n if (\n options.pluginType &&\n !PluginHandlerFactory.isValidPluginType(options.pluginType)\n ) {\n console.warn(\n `Unknown plugin type \"${options.pluginType}\". ` +\n `Component will be generated with default configuration.`\n );\n }\n\n // Validate group is provided for setting type\n if (options.pluginType === \"setting\" && !options.group) {\n throw new ValidationError(\n \"Settings group is required for setting plugin type\"\n );\n }\n}\n\n/**\n * Validates file paths\n */\nexport function validateFilePath(\n codegenFs: CodegenFileSystem,\n filePath: string\n): boolean {\n return codegenFs.exists(filePath);\n}\n\n/**\n * Safe JSON update with error handling\n */\nexport function safeJsonUpdate<T = any>(\n operation: () => T,\n fallback: T,\n errorMessage?: string\n): T {\n try {\n return operation();\n } catch (error) {\n if (errorMessage) {\n console.error(errorMessage, error);\n }\n return fallback;\n }\n}\n", "// utils/nx-context.mjs\nimport { existsSync, readFileSync, readdirSync, statSync } from \"fs\";\nimport path from \"path\";\nimport { fileURLToPath } from \"url\";\nimport { getCached, setCached } from \"./cache.mjs\";\nimport { discoverProjects, findProjectByName } from \"@kosdev-code/kos-codegen-core\";\n\nconst __dirname = path.dirname(fileURLToPath(import.meta.url));\n\nfunction findKosJsonFiles(dir = process.cwd(), files = []) {\n try {\n const entries = readdirSync(dir);\n \n for (const entry of entries) {\n // Skip common directories that won't have .kos.json files\n // BUT don't skip .kos.json files themselves!\n if (entry === 'node_modules' || entry === '.git' || entry === '.nx' || \n entry === 'dist' || entry === 'coverage' || entry === '.vscode' ||\n entry === '.idea' || (entry.startsWith('.') && entry !== '.kos.json')) {\n continue;\n }\n \n const fullPath = path.join(dir, entry);\n \n try {\n const stat = statSync(fullPath);\n \n if (stat.isFile() && entry === '.kos.json') {\n files.push(fullPath);\n } else if (stat.isDirectory()) {\n // Only recurse into directories that might contain projects\n // Skip common build/temp directories\n if (entry !== 'tmp' && entry !== 'temp' && entry !== 'build') {\n findKosJsonFiles(fullPath, files);\n }\n }\n } catch (error) {\n // Skip files/directories we can't access\n continue;\n }\n }\n } catch (error) {\n // Skip directories we can't read\n }\n \n return files;\n}\n\nlet _workspaceDetected;\n\nexport async function detectWorkspace(startDir = process.cwd()) {\n if (_workspaceDetected !== undefined) return _workspaceDetected;\n\n let dir = startDir;\n while (dir !== path.dirname(dir)) {\n if (existsSync(path.join(dir, \"nx.json\"))) {\n _workspaceDetected = true;\n return true;\n }\n dir = path.dirname(dir);\n }\n\n _workspaceDetected = false;\n return false;\n}\nexport async function getAllProjects() {\n const cached = getCached(\"allProjects\");\n if (cached) return cached;\n\n const projectMap = discoverProjects(process.cwd());\n const projects = Array.from(projectMap.keys());\n setCached(\"allProjects\", projects);\n return projects;\n}\n\nexport async function getLibraryProjects() {\n const cached = getCached(\"libraryProjects\");\n if (cached) return cached;\n\n const projectMap = discoverProjects(process.cwd());\n const projects = Array.from(projectMap.values())\n .filter((p) => p.projectType === \"library\")\n .map((p) => p.name);\n setCached(\"libraryProjects\", projects);\n return projects;\n}\n\nexport async function getPluginProjects() {\n const cached = getCached(\"pluginProjects\");\n if (cached) return cached;\n\n const all = await getAllProjects();\n const filtered = all.filter(\n (p) => p.includes(\"plugin\") || p.includes(\"extension\")\n );\n setCached(\"pluginProjects\", filtered);\n return filtered;\n}\n\nexport async function getAllKosProjects() {\n const cached = getCached(\"allKosProjects\");\n if (cached) return cached;\n\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Discovering KOS projects by scanning .kos.json files...`);\n }\n \n // In an NX workspace, focus on common project directories first\n const projectDirs = ['apps', 'libs', 'packages'];\n const kosJsonFiles = [];\n const workspaceRoot = process.cwd();\n \n // First scan common project directories\n for (const dir of projectDirs) {\n const dirPath = path.join(workspaceRoot, dir);\n if (existsSync(dirPath)) {\n findKosJsonFiles(dirPath, kosJsonFiles);\n }\n }\n \n // Also check the workspace root for any .kos.json files\n const rootKosJson = path.join(workspaceRoot, '.kos.json');\n if (existsSync(rootKosJson)) {\n kosJsonFiles.push(rootKosJson);\n }\n \n // If we didn't find any in the common directories, fall back to full scan\n if (kosJsonFiles.length === 0) {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] No .kos.json files found in common directories, performing full workspace scan...`);\n }\n findKosJsonFiles(workspaceRoot, kosJsonFiles);\n }\n \n const kosProjects = [];\n\n for (const kosJsonPath of kosJsonFiles) {\n try {\n const kosConfig = JSON.parse(readFileSync(kosJsonPath, \"utf-8\"));\n const projectDir = path.dirname(kosJsonPath);\n \n // Try to determine the project name by looking for project.json\n let projectName = null;\n const projectJsonPath = path.join(projectDir, 'project.json');\n \n if (existsSync(projectJsonPath)) {\n try {\n const projectJson = JSON.parse(readFileSync(projectJsonPath, \"utf-8\"));\n projectName = projectJson.name;\n } catch (error) {\n // If we can't read project.json, use directory name as fallback\n projectName = path.basename(projectDir);\n }\n } else {\n // Use directory name as fallback\n projectName = path.basename(projectDir);\n }\n\n // Skip root-type configurations as they are not projects\n if (kosConfig.type === 'root') {\n continue;\n }\n\n kosProjects.push({\n name: projectName,\n path: projectDir,\n kosJsonPath,\n config: kosConfig,\n projectType: kosConfig.generator?.projectType\n });\n } catch (error) {\n console.warn(`[kos-cli] Error reading ${kosJsonPath}: ${error.message}`);\n }\n }\n\n setCached(\"allKosProjects\", kosProjects);\n return kosProjects;\n}\n\nexport async function getProjectsByType(targetType) {\n const cacheKey = `projectsByType:${targetType}`;\n const cached = getCached(cacheKey);\n if (cached) return cached;\n\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Filtering projects for ${targetType} projectType...`);\n }\n const allKosProjects = await getAllKosProjects();\n const filteredProjects = [];\n\n for (const kosProject of allKosProjects) {\n const projectType = kosProject.projectType;\n \n // Handle both string and array formats for projectType\n const hasTargetType = Array.isArray(projectType) \n ? projectType.includes(targetType)\n : projectType === targetType;\n \n if (hasTargetType) {\n filteredProjects.push(kosProject.name);\n }\n }\n\n setCached(cacheKey, filteredProjects);\n return filteredProjects;\n}\n\nexport async function getModelProjects() {\n return await getProjectsByType(\"model\");\n}\n\nexport async function getUIProjects() {\n return await getProjectsByType(\"ui\");\n}\n\nexport async function getModelComponentProjects() {\n return await getProjectsByType(\"model-component\");\n}\n\nexport async function getI18nProjects() {\n return await getProjectsByType(\"i18n\");\n}\n\n\nexport async function getProjectsByTypeWithFallback(targetType, fallbackFunction = getLibraryProjects) {\n const filteredProjects = await getProjectsByType(targetType);\n \n if (filteredProjects.length > 0) {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Found ${filteredProjects.length} ${targetType} projects`);\n }\n return filteredProjects;\n } else {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] No ${targetType} projects found, showing fallback projects`);\n }\n return await fallbackFunction();\n }\n}\n\nexport async function getModelProjectsWithFallback() {\n return await getProjectsByTypeWithFallback(\"model\", getLibraryProjects);\n}\n\nexport async function getModelComponentProjectsWithFallback() {\n return await getProjectsByTypeWithFallback(\"model-component\", getAllProjects);\n}\n\nexport async function getProjectsByMultipleTypes(targetTypes) {\n const cacheKey = `projectsByMultipleTypes:${targetTypes.join(',')}`;\n const cached = getCached(cacheKey);\n if (cached) return cached;\n\n console.warn(`[kos-cli] Filtering projects for projectTypes: ${targetTypes.join(', ')}...`);\n const allKosProjects = await getAllKosProjects();\n const filteredProjects = [];\n\n for (const kosProject of allKosProjects) {\n const projectType = kosProject.projectType;\n \n // Handle both string and array formats for projectType\n const hasAnyTargetType = targetTypes.some(targetType => {\n return Array.isArray(projectType) \n ? projectType.includes(targetType)\n : projectType === targetType;\n });\n \n if (hasAnyTargetType) {\n filteredProjects.push(kosProject.name);\n }\n }\n\n setCached(cacheKey, filteredProjects);\n return filteredProjects;\n}\n\nexport async function getComponentCompatibleProjects() {\n return await getProjectsByMultipleTypes([\"ui\", \"splash\", \"model-component\"]);\n}\n\nexport async function getComponentCompatibleProjectsWithFallback() {\n const componentProjects = await getComponentCompatibleProjects();\n \n if (componentProjects.length > 0) {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Found ${componentProjects.length} component-compatible projects`);\n }\n return componentProjects;\n } else {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] No component-compatible projects found, showing all projects`);\n }\n return await getAllProjects();\n }\n}\n\nexport async function getI18nProjectsWithFallback() {\n return await getProjectsByTypeWithFallback(\"i18n\", getAllProjects);\n}\n\nexport async function getPluginProjectsWithFallback() {\n // First try type-based filtering\n const pluginProjectsByType = await getProjectsByType(\"plugin\");\n if (pluginProjectsByType.length > 0) {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Found ${pluginProjectsByType.length} plugin projects by type`);\n }\n return pluginProjectsByType;\n }\n \n // Fall back to existing name-based filtering\n const pluginProjectsByName = await getPluginProjects();\n if (pluginProjectsByName.length > 0) {\n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Found ${pluginProjectsByName.length} plugin projects by name`);\n }\n return pluginProjectsByName;\n }\n \n // Final fallback to all projects\n console.warn(`[kos-cli] No plugin projects found, showing all projects`);\n return await getAllProjects();\n}\n\nexport async function getAllModels() {\n const cached = getCached(\"allModels\");\n if (cached) return cached;\n \n if (process.env.KOS_CLI_QUIET !== \"true\") {\n console.warn(`[kos-cli] Scanning for models in KOS projects...`);\n }\n const allKosProjects = await getAllKosProjects();\n const models = [];\n\n for (const kosProject of allKosProjects) {\n if (kosProject.config.models) {\n Object.keys(kosProject.config.models).forEach((model) => {\n models.push({ model: model, project: kosProject.name });\n });\n }\n }\n\n // Sort models by project name first, then by model name\n models.sort((a, b) => {\n if (a.project === b.project) {\n return a.model.localeCompare(b.model);\n } else {\n return a.project.localeCompare(b.project);\n }\n });\n\n setCached(\"allModels\", models);\n return models;\n}\n\nexport async function getWorkspaceDefaults() {\n const cached = getCached(\"workspaceDefaults\");\n if (cached) return cached;\n\n const workspaceRoot = process.cwd();\n const rootKosJsonPath = path.join(workspaceRoot, '.kos.json');\n \n if (existsSync(rootKosJsonPath)) {\n try {\n const rootConfig = JSON.parse(readFileSync(rootKosJsonPath, \"utf-8\"));\n if (rootConfig.type === 'root' && rootConfig.generator?.defaults) {\n setCached(\"workspaceDefaults\", rootConfig.generator.defaults);\n return rootConfig.generator.defaults;\n }\n } catch (error) {\n console.warn(`[kos-cli] Error reading workspace defaults: ${error.message}`);\n }\n }\n \n setCached(\"workspaceDefaults\", {});\n return {};\n}\n\nexport async function getDefaultProjectForType(projectType) {\n const defaults = await getWorkspaceDefaults();\n return defaults[projectType] || null;\n}\n\nexport async function getProjectDetails(projectName) {\n const cacheKey = `projectDetails:${projectName}`;\n const cached = getCached(cacheKey);\n if (cached) return cached;\n\n const details = findProjectByName(process.cwd(), projectName);\n if (!details) {\n throw new Error(`Project \"${projectName}\" not found in workspace`);\n }\n setCached(cacheKey, details);\n return details;\n}\n", "// utils/cache.mjs\nimport crypto from \"crypto\";\nimport fs from \"fs\";\nimport os from \"os\";\nimport path from \"path\";\n\n// Default to project-local cache; can swap to global using `getGlobalCachePath()`\nconst CACHE_PATH = path.resolve(\".nx/cli-cache.json\");\nconst CACHE_TTL = 600 * 1000;\nconst ARGS = process.argv;\nconst DISABLE_CACHE =\n process.env.DISABLE_CACHE === \"true\" || process.env.REFRESH === \"true\";\n\nlet _cache = {}; // in-memory cache\nlet _loaded = false;\n\nconst DEFAULT_TRACKED_FILES = [\n \"workspace.json\",\n \"nx.json\",\n \"project.json\",\n \"tsconfig.base.json\",\n \"package.json\",\n];\n\nfunction ensureCacheDir() {\n const dir = path.dirname(CACHE_PATH);\n if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });\n}\n\nfunction loadCacheFromDisk() {\n if (_loaded) return;\n _loaded = true;\n try {\n if (fs.existsSync(CACHE_PATH)) {\n const data = fs.readFileSync(CACHE_PATH, \"utf-8\");\n _cache = JSON.parse(data);\n }\n } catch (err) {\n console.warn(\"Failed to load CLI cache:\", err);\n _cache = {};\n }\n}\n\nfunction saveCacheToDisk() {\n try {\n ensureCacheDir();\n fs.writeFileSync(CACHE_PATH, JSON.stringify(_cache, null, 2));\n } catch (err) {\n console.warn(\"Failed to save CLI cache:\", err);\n }\n}\n\nfunction isFresh(entry, ttl = CACHE_TTL) {\n if (!entry || !entry.timestamp) return false;\n return Date.now() - entry.timestamp < ttl;\n}\n\nexport function getCached(key, ttl = CACHE_TTL) {\n if (DISABLE_CACHE) return null;\n loadCacheFromDisk();\n const entry = _cache[key];\n if (isFresh(entry, ttl)) return entry.data;\n return null;\n}\n\nexport function setCached(key, data) {\n loadCacheFromDisk();\n _cache[key] = {\n data,\n timestamp: Date.now(),\n };\n saveCacheToDisk();\n}\n\nexport function clearCache(key) {\n loadCacheFromDisk();\n if (key) {\n delete _cache[key];\n } else {\n _cache = {};\n }\n saveCacheToDisk();\n}\n\nexport function getGlobalCachePath() {\n return path.join(os.homedir(), \".kos-cli-cache.json\");\n}\n\nexport function hashFiles(filePaths = DEFAULT_TRACKED_FILES) {\n const hash = crypto.createHash(\"sha256\");\n for (const file of filePaths) {\n if (fs.existsSync(file)) {\n hash.update(fs.readFileSync(file));\n }\n }\n return hash.digest(\"hex\");\n}\n\nexport function getHashedCache(key, filePaths = DEFAULT_TRACKED_FILES) {\n if (DISABLE_CACHE) return null;\n loadCacheFromDisk();\n const entry = _cache[key];\n const currentHash = hashFiles(filePaths);\n if (entry && entry.hash === currentHash) {\n return entry.data;\n }\n return null;\n}\n\nexport function setHashedCache(key, data, filePaths = DEFAULT_TRACKED_FILES) {\n loadCacheFromDisk();\n const hash = hashFiles(filePaths);\n _cache[key] = { data, hash, timestamp: Date.now() };\n saveCacheToDisk();\n}\n\nexport function markCacheDirty(reason = \"manual\") {\n _loaded = false;\n _cache = {};\n if (fs.existsSync(CACHE_PATH)) {\n fs.unlinkSync(CACHE_PATH);\n console.debug(`Cache invalidated due to ${reason}: ${CACHE_PATH} deleted`);\n }\n}\n\nexport function shouldInvalidateFromMeta(metadata = {}) {\n return metadata?.invalidateCache === true;\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/plugin/plugin.mjs\n\nimport {\n DirectFileSystem,\n formatFiles,\n generateComponent,\n getTemplateDir,\n TrackingFileSystem,\n} from \"@kosdev-code/kos-codegen-core\";\nimport { getPluginProjectsWithFallback } from \"../../utils/nx-context.mjs\";\nimport { required } from \"../../utils/validators.mjs\";\nexport const metadata = [\n {\n key: \"pluginComponent\",\n name: \"KOS UI Plugin Component\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n extensionPoint: \"extensionPoint\",\n },\n },\n {\n key: \"plugin:cui\",\n name: \"KOS UI Plugin CUI Configuration\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n },\n },\n {\n key: \"plugin:setup\",\n name: \"KOS UI Plugin Setup Step\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n },\n },\n {\n key: \"plugin:utility\",\n name: \"KOS UI Plugin Utility\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n },\n },\n {\n key: \"plugin:setting\",\n name: \"KOS UI Plugin Setting\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n group: \"group\",\n },\n },\n {\n key: \"plugin:nav\",\n name: \"KOS UI Plugin Navigation View\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n },\n },\n {\n key: \"plugin:cp\",\n name: \"KOS UI Plugin Control Pour\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n },\n },\n {\n key: \"plugin:custom\",\n name: \"KOS UI Plugin Custom (User-Specified Contribution)\",\n namedArguments: {\n name: \"componentName\",\n componentName: \"componentName\",\n project: \"componentProject\",\n componentProject: \"componentProject\",\n contributionKey: \"contributionKey\",\n },\n },\n];\n\nexport default async function (plop) {\n const pluginProjects = await getPluginProjectsWithFallback();\n\n plop.setActionType(\"createPluginComponent\", async function (answers) {\n const cwd = process.cwd();\n const codegenFs = new TrackingFileSystem(new DirectFileSystem(cwd));\n\n const pluginType = answers.extensionPoint;\n\n const options = {\n name: answers.componentName,\n appProject: answers.componentProject,\n type: \"components\",\n pluginType: pluginType,\n useEmotionCss: false,\n appDirectory: \"\",\n modelDirectory: \"\",\n };\n\n // Add group for settings plugin type\n if (answers.group) {\n options.group = answers.group;\n }\n\n // Add contributionKey for custom plugin types\n if (pluginType === \"custom\" && answers.contributionKey) {\n options.contributionKey = answers.contributionKey;\n }\n\n generateComponent(codegenFs, getTemplateDir(\"kos-component\"), options);\n\n await formatFiles(codegenFs.root, codegenFs.writtenPaths);\n\n return `Component ${answers.componentName} created in ${answers.componentProject}`;\n });\n const pluginPrompts = [\n {\n type: \"input\",\n name: \"componentName\",\n message: \"Enter the name of the component\",\n validate: required,\n },\n {\n type: \"list\",\n name: \"componentProject\",\n message: \"Which project should the component be created in?\",\n choices: pluginProjects,\n },\n ];\n\n const pluginTypes = [\n { key: \"plugin:cui\", name: \"cui\" },\n { key: \"plugin:setup\", name: \"setup\" },\n { key: \"plugin:utility\", name: \"utility\" },\n { key: \"plugin:setting\", name: \"setting\" },\n { key: \"plugin:nav\", name: \"nav\" },\n { key: \"plugin:cp\", name: \"controlPour\" },\n { key: \"plugin:custom\", name: \"custom\" },\n ];\n\n // Generic plugin component\n plop.setGenerator(\"pluginComponent\", {\n description: \"Create a new KOS Plugin Component\",\n prompts: [\n ...pluginPrompts,\n {\n type: \"list\",\n name: \"extensionPoint\",\n message: \"What type of extension point is the plugin supporting?\",\n choices: pluginTypes.map((pt) => pt.name),\n },\n ],\n actions: [{ type: \"createPluginComponent\" }],\n });\n\n // Specific plugin type aliases\n for (const { key, name } of pluginTypes) {\n const prompts = [\n ...pluginPrompts,\n ...(name === \"setting\"\n ? [\n {\n type: \"input\",\n name: \"group\",\n message: \"Which settings group should the setting be located?\",\n },\n ]\n : []),\n ...(name === \"custom\"\n ? [\n {\n type: \"input\",\n name: \"contributionKey\",\n message:\n \"What contribution key should be used in .kos.json? (e.g., 'menus', 'panels', 'commands', etc.)\",\n validate: required,\n },\n ]\n : []),\n {\n type: \"input\",\n name: \"extensionPoint\",\n message: \"Hidden extensionPoint\",\n default: name,\n when: false, // hide from CLI\n },\n ];\n\n plop.setGenerator(key, {\n description: `Create a new KOS ${\n name[0].toUpperCase() + name.slice(1)\n } Plugin Component`,\n prompts,\n actions: [\n { type: \"createPluginComponent\", data: { extensionPoint: name } },\n ],\n });\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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MAAM;AAAA;AAAA,MACR;AAAA,IACF;AAEA,SAAK,aAAa,KAAK;AAAA,MACrB,aAAa,oBACX,KAAK,CAAC,EAAE,YAAY,IAAI,KAAK,MAAM,CAAC,CACtC;AAAA,MACA;AAAA,MACA,SAAS;AAAA,QACP,EAAE,MAAM,yBAAyB,MAAM,EAAE,gBAAgB,KAAK,EAAE;AAAA,MAClE;AAAA,IACF,CAAC;AAAA,EACH;AACF;",
|
|
6
|
+
"names": ["fs", "path", "fs", "path", "fs", "path", "path", "path", "fs", "path", "path", "path", "path", "existsSync", "readFileSync", "readdirSync", "path", "fs", "path", "path", "fs", "__dirname", "path", "readdirSync", "path", "existsSync", "readFileSync"]
|
|
7
|
+
}
|