@uniformdev/transformer 1.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/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +2399 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +320 -0
- package/dist/index.js +1116 -0
- package/dist/index.js.map +1 -0
- package/package.json +69 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/errors.ts","../src/core/services/file-system.service.ts","../src/core/services/component.service.ts","../src/core/services/composition.service.ts","../src/core/services/property-propagator.service.ts","../src/core/services/slot-renamer.service.ts","../src/core/services/component-renamer.service.ts","../src/cli/logger.ts"],"sourcesContent":["export class TransformError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'TransformError';\n }\n}\n\nexport class ComponentNotFoundError extends TransformError {\n constructor(componentType: string, path?: string) {\n const pathInfo = path ? ` (searched: ${path})` : '';\n super(`Component not found: ${componentType}${pathInfo}`);\n this.name = 'ComponentNotFoundError';\n }\n}\n\nexport class PropertyNotFoundError extends TransformError {\n constructor(propertyName: string, componentType: string) {\n super(`Property \"${propertyName}\" not found on component \"${componentType}\"`);\n this.name = 'PropertyNotFoundError';\n }\n}\n\nexport class InvalidYamlError extends TransformError {\n constructor(filePath: string, details?: string) {\n const detailsInfo = details ? `: ${details}` : '';\n super(`Invalid YAML file: ${filePath}${detailsInfo}`);\n this.name = 'InvalidYamlError';\n }\n}\n\nexport class FileNotFoundError extends TransformError {\n constructor(filePath: string) {\n super(`File not found: ${filePath}`);\n this.name = 'FileNotFoundError';\n }\n}\n\nexport class DuplicateIdError extends TransformError {\n constructor(id: string, arrayProperty: string, filePath: string) {\n super(`Duplicate id \"${id}\" in array \"${arrayProperty}\" of file: ${filePath}`);\n this.name = 'DuplicateIdError';\n }\n}\n\nexport class ComponentAlreadyExistsError extends TransformError {\n constructor(componentType: string, path?: string) {\n const pathInfo = path ? ` (searched: ${path})` : '';\n super(`Component type \"${componentType}\" already exists${pathInfo}`);\n this.name = 'ComponentAlreadyExistsError';\n }\n}\n\nexport class SlotNotFoundError extends TransformError {\n constructor(slotId: string, componentType: string) {\n super(`Slot \"${slotId}\" does not exist on component \"${componentType}\"`);\n this.name = 'SlotNotFoundError';\n }\n}\n\nexport class SlotAlreadyExistsError extends TransformError {\n constructor(slotId: string, componentType: string) {\n super(`Slot \"${slotId}\" already exists on component \"${componentType}\"`);\n this.name = 'SlotAlreadyExistsError';\n }\n}\n","import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport { glob } from 'glob';\nimport * as YAML from 'yaml';\nimport { InvalidYamlError, FileNotFoundError } from '../errors.js';\n\nexport class FileSystemService {\n private isJsonFile(filePath: string): boolean {\n return filePath.toLowerCase().endsWith('.json');\n }\n\n async readFile<T>(filePath: string): Promise<T> {\n if (!fs.existsSync(filePath)) {\n throw new FileNotFoundError(filePath);\n }\n\n try {\n const content = fs.readFileSync(filePath, 'utf-8');\n if (this.isJsonFile(filePath)) {\n return JSON.parse(content) as T;\n }\n return YAML.parse(content) as T;\n } catch (error) {\n if (error instanceof FileNotFoundError) {\n throw error;\n }\n const message = error instanceof Error ? error.message : String(error);\n throw new InvalidYamlError(filePath, message);\n }\n }\n\n async writeFile<T>(filePath: string, data: T): Promise<void> {\n const dir = path.dirname(filePath);\n if (!fs.existsSync(dir)) {\n fs.mkdirSync(dir, { recursive: true });\n }\n\n let content: string;\n if (this.isJsonFile(filePath)) {\n content = JSON.stringify(data, null, 2);\n } else {\n content = YAML.stringify(data, {\n lineWidth: 0,\n defaultKeyType: 'PLAIN',\n defaultStringType: 'QUOTE_DOUBLE',\n });\n }\n fs.writeFileSync(filePath, content, 'utf-8');\n }\n\n async readYamlFile<T>(filePath: string): Promise<T> {\n return this.readFile<T>(filePath);\n }\n\n async writeYamlFile<T>(filePath: string, data: T): Promise<void> {\n return this.writeFile(filePath, data);\n }\n\n async findFiles(directory: string, pattern: string): Promise<string[]> {\n const fullPattern = path.join(directory, pattern).replace(/\\\\/g, '/');\n return glob(fullPattern);\n }\n\n async fileExists(filePath: string): Promise<boolean> {\n return fs.existsSync(filePath);\n }\n\n resolvePath(...segments: string[]): string {\n return path.resolve(...segments);\n }\n\n joinPath(...segments: string[]): string {\n return path.join(...segments);\n }\n\n getBasename(filePath: string, ext?: string): string {\n return path.basename(filePath, ext);\n }\n\n async renameFile(oldPath: string, newPath: string): Promise<void> {\n fs.renameSync(oldPath, newPath);\n }\n\n deleteFile(filePath: string): void {\n fs.unlinkSync(filePath);\n }\n\n getExtension(filePath: string): string {\n return path.extname(filePath);\n }\n\n getDirname(filePath: string): string {\n return path.dirname(filePath);\n }\n}\n","import { ComponentDefinition, Parameter } from '../types/index.js';\nimport { ComponentNotFoundError, PropertyNotFoundError } from '../errors.js';\nimport { FileSystemService } from './file-system.service.js';\n\nexport interface FindOptions {\n strict?: boolean;\n}\n\nexport class ComponentService {\n constructor(private fileSystem: FileSystemService) {}\n\n private compareIds(id1: string, id2: string, strict: boolean): boolean {\n if (strict) {\n return id1 === id2;\n }\n return id1.toLowerCase() === id2.toLowerCase();\n }\n\n async loadComponent(\n componentsDir: string,\n componentType: string,\n options: FindOptions = {}\n ): Promise<{ component: ComponentDefinition; filePath: string }> {\n const { strict = false } = options;\n\n // First try exact match\n const jsonPath = this.fileSystem.joinPath(componentsDir, `${componentType}.json`);\n const yamlPath = this.fileSystem.joinPath(componentsDir, `${componentType}.yaml`);\n const ymlPath = this.fileSystem.joinPath(componentsDir, `${componentType}.yml`);\n\n if (await this.fileSystem.fileExists(jsonPath)) {\n const component = await this.fileSystem.readFile<ComponentDefinition>(jsonPath);\n return { component, filePath: jsonPath };\n }\n if (await this.fileSystem.fileExists(yamlPath)) {\n const component = await this.fileSystem.readFile<ComponentDefinition>(yamlPath);\n return { component, filePath: yamlPath };\n }\n if (await this.fileSystem.fileExists(ymlPath)) {\n const component = await this.fileSystem.readFile<ComponentDefinition>(ymlPath);\n return { component, filePath: ymlPath };\n }\n\n // If not strict, try case-insensitive search\n if (!strict) {\n const files = await this.fileSystem.findFiles(componentsDir, '*.{json,yaml,yml}');\n for (const filePath of files) {\n const basename = this.fileSystem.getBasename(filePath);\n const nameWithoutExt = basename.replace(/\\.(json|yaml|yml)$/i, '');\n if (nameWithoutExt.toLowerCase() === componentType.toLowerCase()) {\n const component = await this.fileSystem.readFile<ComponentDefinition>(filePath);\n return { component, filePath };\n }\n }\n }\n\n throw new ComponentNotFoundError(componentType, componentsDir);\n }\n\n async saveComponent(filePath: string, component: ComponentDefinition): Promise<void> {\n await this.fileSystem.writeFile(filePath, component);\n }\n\n findParameter(\n component: ComponentDefinition,\n parameterName: string,\n options: FindOptions = {}\n ): Parameter | undefined {\n const { strict = false } = options;\n return component.parameters?.find((p) => this.compareIds(p.id, parameterName, strict));\n }\n\n isGroupParameter(parameter: Parameter): boolean {\n return parameter.type === 'group';\n }\n\n resolveGroupParameters(\n component: ComponentDefinition,\n groupParameter: Parameter,\n options: FindOptions = {}\n ): Parameter[] {\n if (!this.isGroupParameter(groupParameter)) {\n return [groupParameter];\n }\n\n const childrenIds = groupParameter.typeConfig?.childrenParams ?? [];\n const resolved: Parameter[] = [];\n\n for (const childId of childrenIds) {\n const childParam = this.findParameter(component, childId, options);\n if (childParam) {\n resolved.push(childParam);\n }\n }\n\n return resolved;\n }\n\n resolveProperties(\n component: ComponentDefinition,\n propertyNames: string[],\n options: FindOptions = {}\n ): { parameters: Parameter[]; notFound: string[] } {\n const parameters: Parameter[] = [];\n const notFound: string[] = [];\n const seenIds = new Set<string>();\n\n for (const name of propertyNames) {\n const param = this.findParameter(component, name, options);\n if (!param) {\n notFound.push(name);\n continue;\n }\n\n if (this.isGroupParameter(param)) {\n const groupParams = this.resolveGroupParameters(component, param, options);\n for (const gp of groupParams) {\n if (!seenIds.has(gp.id)) {\n seenIds.add(gp.id);\n parameters.push(gp);\n }\n }\n } else {\n if (!seenIds.has(param.id)) {\n seenIds.add(param.id);\n parameters.push(param);\n }\n }\n }\n\n return { parameters, notFound };\n }\n\n addParameterToComponent(\n component: ComponentDefinition,\n parameter: Parameter,\n options: FindOptions = {}\n ): ComponentDefinition {\n const { strict = false } = options;\n if (!component.parameters) {\n component.parameters = [];\n }\n\n const existingIndex = component.parameters.findIndex((p) =>\n this.compareIds(p.id, parameter.id, strict)\n );\n if (existingIndex >= 0) {\n component.parameters[existingIndex] = { ...parameter };\n } else {\n component.parameters.push({ ...parameter });\n }\n\n return component;\n }\n\n ensureGroupExists(\n component: ComponentDefinition,\n groupId: string,\n groupName?: string,\n options: FindOptions = {}\n ): ComponentDefinition {\n const { strict = false } = options;\n if (!component.parameters) {\n component.parameters = [];\n }\n\n const existing = component.parameters.find((p) => this.compareIds(p.id, groupId, strict));\n if (existing) {\n return component;\n }\n\n const groupParam: Parameter = {\n id: groupId,\n name: groupName ?? groupId,\n type: 'group',\n typeConfig: {\n childrenParams: [],\n },\n };\n\n component.parameters.push(groupParam);\n return component;\n }\n\n addParameterToGroup(\n component: ComponentDefinition,\n groupId: string,\n parameterId: string,\n options: FindOptions = {}\n ): ComponentDefinition {\n const { strict = false } = options;\n const group = component.parameters?.find((p) => this.compareIds(p.id, groupId, strict));\n if (!group || !this.isGroupParameter(group)) {\n throw new PropertyNotFoundError(groupId, component.id);\n }\n\n if (!group.typeConfig) {\n group.typeConfig = { childrenParams: [] };\n }\n if (!group.typeConfig.childrenParams) {\n group.typeConfig.childrenParams = [];\n }\n\n // Check if already exists (case-insensitive if not strict)\n const alreadyExists = group.typeConfig.childrenParams.some((id) =>\n this.compareIds(id, parameterId, strict)\n );\n\n if (!alreadyExists) {\n group.typeConfig.childrenParams.push(parameterId);\n }\n\n return component;\n }\n\n removeParameter(\n component: ComponentDefinition,\n parameterId: string,\n options: FindOptions = {}\n ): ComponentDefinition {\n const { strict = false } = options;\n if (!component.parameters) {\n return component;\n }\n\n component.parameters = component.parameters.filter(\n (p) => !this.compareIds(p.id, parameterId, strict)\n );\n\n // Also remove from any groups that reference this parameter\n for (const param of component.parameters) {\n if (this.isGroupParameter(param) && param.typeConfig?.childrenParams) {\n param.typeConfig.childrenParams = param.typeConfig.childrenParams.filter(\n (id) => !this.compareIds(id, parameterId, strict)\n );\n }\n }\n\n return component;\n }\n\n removeEmptyGroups(component: ComponentDefinition): ComponentDefinition {\n if (!component.parameters) {\n return component;\n }\n\n component.parameters = component.parameters.filter((p) => {\n if (!this.isGroupParameter(p)) {\n return true;\n }\n const children = p.typeConfig?.childrenParams ?? [];\n return children.length > 0;\n });\n\n return component;\n }\n}\n","import { Composition, ComponentInstance, ParameterValue } from '../types/index.js';\nimport { FileSystemService } from './file-system.service.js';\n\nexport interface FindOptions {\n strict?: boolean;\n}\n\nexport interface FoundComponentInstance {\n instance: ComponentInstance;\n instanceId: string;\n path: string[];\n}\n\nexport class CompositionService {\n constructor(private fileSystem: FileSystemService) {}\n\n private compareTypes(type1: string, type2: string, strict: boolean): boolean {\n if (strict) {\n return type1 === type2;\n }\n return type1.toLowerCase() === type2.toLowerCase();\n }\n\n async loadComposition(filePath: string): Promise<Composition> {\n return this.fileSystem.readFile<Composition>(filePath);\n }\n\n async saveComposition(filePath: string, composition: Composition): Promise<void> {\n await this.fileSystem.writeFile(filePath, composition);\n }\n\n async findCompositionsByType(\n compositionsDir: string,\n compositionType: string,\n options: FindOptions = {}\n ): Promise<{ composition: Composition; filePath: string }[]> {\n const { strict = false } = options;\n const files = await this.fileSystem.findFiles(compositionsDir, '**/*.{json,yaml,yml}');\n const results: { composition: Composition; filePath: string }[] = [];\n\n for (const filePath of files) {\n try {\n const composition = await this.loadComposition(filePath);\n if (\n composition.composition?.type &&\n this.compareTypes(composition.composition.type, compositionType, strict)\n ) {\n results.push({ composition, filePath });\n }\n } catch {\n // Skip invalid files\n }\n }\n\n return results;\n }\n\n findComponentInstances(\n composition: Composition,\n componentType: string,\n options: FindOptions = {}\n ): FoundComponentInstance[] {\n const { strict = false } = options;\n const results: FoundComponentInstance[] = [];\n this.searchSlots(composition.composition.slots ?? {}, componentType, [], results, strict);\n return results;\n }\n\n private searchSlots(\n slots: Record<string, ComponentInstance[]>,\n componentType: string,\n currentPath: string[],\n results: FoundComponentInstance[],\n strict: boolean\n ): void {\n for (const [slotName, instances] of Object.entries(slots)) {\n if (!Array.isArray(instances)) continue;\n\n for (let i = 0; i < instances.length; i++) {\n const instance = instances[i];\n const instancePath = [...currentPath, slotName, String(i)];\n\n if (this.compareTypes(instance.type, componentType, strict)) {\n const instanceId = instance._id ?? `${componentType}-${results.length}`;\n results.push({\n instance,\n instanceId,\n path: instancePath,\n });\n }\n\n if (instance.slots) {\n this.searchSlots(instance.slots, componentType, instancePath, results, strict);\n }\n }\n }\n }\n\n getRootOverrides(composition: Composition): Record<string, ParameterValue> {\n const rootId = composition.composition._id;\n // Check _overrides first (newer format), then fall back to direct parameters (older format)\n const overrides = composition.composition._overrides?.[rootId]?.parameters;\n if (overrides && Object.keys(overrides).length > 0) {\n return overrides;\n }\n // Fall back to direct parameters on the composition root\n return (composition.composition as { parameters?: Record<string, ParameterValue> }).parameters ?? {};\n }\n\n getInstanceOverrides(\n composition: Composition,\n instanceId: string\n ): Record<string, ParameterValue> {\n return composition.composition._overrides?.[instanceId]?.parameters ?? {};\n }\n\n setInstanceOverride(\n composition: Composition,\n instanceId: string,\n parameterId: string,\n value: ParameterValue\n ): Composition {\n if (!composition.composition._overrides) {\n composition.composition._overrides = {};\n }\n if (!composition.composition._overrides[instanceId]) {\n composition.composition._overrides[instanceId] = {};\n }\n if (!composition.composition._overrides[instanceId].parameters) {\n composition.composition._overrides[instanceId].parameters = {};\n }\n\n composition.composition._overrides[instanceId].parameters![parameterId] = value;\n return composition;\n }\n\n setInstanceOverrides(\n composition: Composition,\n instanceId: string,\n parameters: Record<string, ParameterValue>\n ): Composition {\n for (const [paramId, value] of Object.entries(parameters)) {\n this.setInstanceOverride(composition, instanceId, paramId, value);\n }\n return composition;\n }\n\n /**\n * Sets parameters directly on a component instance (preferred approach).\n * This modifies the instance object in-place.\n */\n setInstanceParameters(\n instance: ComponentInstance,\n parameters: Record<string, ParameterValue>\n ): void {\n if (!instance.parameters) {\n instance.parameters = {};\n }\n for (const [paramId, value] of Object.entries(parameters)) {\n instance.parameters[paramId] = value;\n }\n }\n\n /**\n * Deletes parameters from root overrides.\n * Returns true if any parameters were deleted.\n */\n deleteRootOverrides(\n composition: Composition,\n parameterIds: string[],\n options: FindOptions = {}\n ): boolean {\n const { strict = false } = options;\n const rootId = composition.composition._id;\n let deleted = false;\n\n // Check _overrides first (newer format)\n const overrides = composition.composition._overrides?.[rootId]?.parameters;\n if (overrides) {\n for (const paramId of parameterIds) {\n for (const key of Object.keys(overrides)) {\n if (strict ? key === paramId : key.toLowerCase() === paramId.toLowerCase()) {\n delete overrides[key];\n deleted = true;\n }\n }\n }\n }\n\n // Also check direct parameters on root (older format)\n const rootParams = (composition.composition as { parameters?: Record<string, ParameterValue> })\n .parameters;\n if (rootParams) {\n for (const paramId of parameterIds) {\n for (const key of Object.keys(rootParams)) {\n if (strict ? key === paramId : key.toLowerCase() === paramId.toLowerCase()) {\n delete rootParams[key];\n deleted = true;\n }\n }\n }\n }\n\n return deleted;\n }\n}\n","import { ParameterValue } from '../types/index.js';\nimport { PropertyNotFoundError } from '../errors.js';\nimport { ComponentService } from './component.service.js';\nimport { CompositionService } from './composition.service.js';\nimport { FileSystemService } from './file-system.service.js';\nimport { Logger } from '../../cli/logger.js';\n\nexport interface PropagateOptions {\n rootDir: string;\n componentsDir: string;\n compositionsDir: string;\n compositionType: string;\n property: string;\n targetComponentType: string;\n targetGroup: string;\n whatIf: boolean;\n strict: boolean;\n deleteSourceParameter: boolean;\n}\n\nexport interface PropagateResult {\n modifiedComponents: number;\n modifiedCompositions: number;\n propagatedInstances: number;\n}\n\nexport class PropertyPropagatorService {\n constructor(\n private fileSystem: FileSystemService,\n private componentService: ComponentService,\n private compositionService: CompositionService,\n private logger: Logger\n ) {}\n\n async propagate(options: PropagateOptions): Promise<PropagateResult> {\n const {\n rootDir,\n componentsDir,\n compositionsDir,\n compositionType,\n property,\n targetComponentType,\n targetGroup,\n whatIf,\n strict,\n deleteSourceParameter,\n } = options;\n\n const findOptions = { strict };\n const fullComponentsDir = this.fileSystem.resolvePath(rootDir, componentsDir);\n const fullCompositionsDir = this.fileSystem.resolvePath(rootDir, compositionsDir);\n\n // Step 1: Load source component (compositionType)\n this.logger.info(`Loading component: ${compositionType}`);\n const { component: sourceComponent, filePath: sourceFilePath } =\n await this.componentService.loadComponent(fullComponentsDir, compositionType, findOptions);\n\n // Step 2: Load target component\n this.logger.info(`Loading component: ${targetComponentType}`);\n const { component: targetComponent, filePath: targetFilePath } =\n await this.componentService.loadComponent(fullComponentsDir, targetComponentType, findOptions);\n\n // Step 3: Parse and resolve properties\n const propertyNames = property.split('|').map((p) => p.trim());\n const { parameters: resolvedParams, notFound } = this.componentService.resolveProperties(\n sourceComponent,\n propertyNames,\n findOptions\n );\n\n if (notFound.length > 0) {\n throw new PropertyNotFoundError(notFound.join(', '), compositionType);\n }\n\n const resolvedNames = resolvedParams.map((p) => p.id);\n const groupSources = propertyNames.filter((name) => {\n const param = this.componentService.findParameter(sourceComponent, name, findOptions);\n return param && this.componentService.isGroupParameter(param);\n });\n\n if (groupSources.length > 0) {\n this.logger.info(\n `Resolved properties: ${resolvedNames.join(', ')} (from ${groupSources.join(', ')})`\n );\n } else {\n this.logger.info(`Resolved properties: ${resolvedNames.join(', ')}`);\n }\n\n // Step 4: Modify target component\n let modifiedComponent = { ...targetComponent };\n let componentModified = false;\n\n // Ensure target group exists\n const existingGroup = this.componentService.findParameter(\n modifiedComponent,\n targetGroup,\n findOptions\n );\n if (!existingGroup) {\n this.logger.action(whatIf, 'CREATE', `Group \"${targetGroup}\" on ${targetComponentType}`);\n modifiedComponent = this.componentService.ensureGroupExists(\n modifiedComponent,\n targetGroup,\n undefined,\n findOptions\n );\n componentModified = true;\n }\n\n // Copy parameter definitions to target\n for (const param of resolvedParams) {\n const existingParam = this.componentService.findParameter(\n modifiedComponent,\n param.id,\n findOptions\n );\n if (!existingParam) {\n this.logger.action(\n whatIf,\n 'COPY',\n `Parameter \"${param.id}\" → ${targetComponentType}.${targetGroup}`\n );\n modifiedComponent = this.componentService.addParameterToComponent(\n modifiedComponent,\n param,\n findOptions\n );\n modifiedComponent = this.componentService.addParameterToGroup(\n modifiedComponent,\n targetGroup,\n param.id,\n findOptions\n );\n componentModified = true;\n } else {\n this.logger.info(`Parameter \"${param.id}\" already exists on ${targetComponentType}`);\n // Ensure it's in the group\n const group = this.componentService.findParameter(\n modifiedComponent,\n targetGroup,\n findOptions\n );\n if (group && this.componentService.isGroupParameter(group)) {\n // Check if param is already in group (case-insensitive if not strict)\n const isInGroup = group.typeConfig?.childrenParams?.some((id) =>\n strict ? id === param.id : id.toLowerCase() === param.id.toLowerCase()\n );\n if (!isInGroup) {\n modifiedComponent = this.componentService.addParameterToGroup(\n modifiedComponent,\n targetGroup,\n param.id,\n findOptions\n );\n componentModified = true;\n }\n }\n }\n }\n\n // Save modified component\n if (componentModified && !whatIf) {\n await this.componentService.saveComponent(targetFilePath, modifiedComponent);\n }\n\n // Step 5: Propagate values in compositions\n const compositions = await this.compositionService.findCompositionsByType(\n fullCompositionsDir,\n compositionType,\n findOptions\n );\n\n let modifiedCompositions = 0;\n let propagatedInstances = 0;\n\n for (const { composition, filePath } of compositions) {\n const rootOverrides = this.compositionService.getRootOverrides(composition);\n const instances = this.compositionService.findComponentInstances(\n composition,\n targetComponentType,\n findOptions\n );\n\n if (instances.length === 0) {\n continue;\n }\n\n // Build the values to propagate\n const valuesToPropagate: Record<string, ParameterValue> = {};\n for (const param of resolvedParams) {\n if (rootOverrides[param.id]) {\n valuesToPropagate[param.id] = rootOverrides[param.id];\n }\n }\n\n if (Object.keys(valuesToPropagate).length === 0) {\n continue;\n }\n\n let compositionModified = false;\n const relativePath = filePath.replace(fullCompositionsDir, '').replace(/^[/\\\\]/, '');\n const instanceUpdates: string[] = [];\n\n for (const { instance, instanceId } of instances) {\n const instanceName = instance._id ?? instanceId;\n // Set parameters directly on the instance (preferred over _overrides)\n this.compositionService.setInstanceParameters(instance, valuesToPropagate);\n compositionModified = true;\n propagatedInstances++;\n instanceUpdates.push(\n `${targetComponentType} \"${instanceName}\": ${Object.keys(valuesToPropagate).join(', ')}`\n );\n }\n\n if (compositionModified) {\n this.logger.action(whatIf, 'UPDATE', `composition/${relativePath}`);\n for (const update of instanceUpdates) {\n this.logger.detail(`→ ${update}`);\n }\n\n if (!whatIf) {\n await this.compositionService.saveComposition(filePath, composition);\n }\n modifiedCompositions++;\n }\n }\n\n // Step 6: Delete source parameters if requested\n let sourceComponentModified = false;\n if (deleteSourceParameter) {\n let modifiedSource = { ...sourceComponent };\n\n // Delete the resolved parameters from source component\n for (const param of resolvedParams) {\n this.logger.action(whatIf, 'DELETE', `Parameter \"${param.id}\" from ${compositionType}`);\n modifiedSource = this.componentService.removeParameter(modifiedSource, param.id, findOptions);\n sourceComponentModified = true;\n }\n\n // Also delete any groups that are now empty\n const beforeGroupCount = modifiedSource.parameters?.filter((p) =>\n this.componentService.isGroupParameter(p)\n ).length ?? 0;\n modifiedSource = this.componentService.removeEmptyGroups(modifiedSource);\n const afterGroupCount = modifiedSource.parameters?.filter((p) =>\n this.componentService.isGroupParameter(p)\n ).length ?? 0;\n if (afterGroupCount < beforeGroupCount) {\n const removedCount = beforeGroupCount - afterGroupCount;\n this.logger.action(\n whatIf,\n 'DELETE',\n `${removedCount} empty group(s) from ${compositionType}`\n );\n }\n\n if (sourceComponentModified && !whatIf) {\n await this.componentService.saveComponent(sourceFilePath, modifiedSource);\n }\n\n // Delete parameter values from root overrides in compositions\n for (const { composition, filePath } of compositions) {\n const relativePath = filePath.replace(fullCompositionsDir, '').replace(/^[/\\\\]/, '');\n const deleted = this.compositionService.deleteRootOverrides(\n composition,\n resolvedNames,\n findOptions\n );\n if (deleted) {\n this.logger.action(whatIf, 'DELETE', `Root overrides from composition/${relativePath}`);\n this.logger.detail(`→ Removed: ${resolvedNames.join(', ')}`);\n if (!whatIf) {\n await this.compositionService.saveComposition(filePath, composition);\n }\n }\n }\n }\n\n return {\n modifiedComponents: (componentModified ? 1 : 0) + (sourceComponentModified ? 1 : 0),\n modifiedCompositions,\n propagatedInstances,\n };\n }\n}\n","import { ComponentInstance, Composition } from '../types/index.js';\nimport { SlotNotFoundError, SlotAlreadyExistsError, TransformError } from '../errors.js';\nimport { ComponentService } from './component.service.js';\nimport { FileSystemService } from './file-system.service.js';\nimport { Logger } from '../../cli/logger.js';\n\nexport interface RenameSlotInternalOptions {\n rootDir: string;\n componentsDir: string;\n compositionsDir: string;\n compositionPatternsDir: string;\n componentPatternsDir: string;\n componentType: string;\n slotId: string;\n newSlotId: string;\n newSlotName?: string;\n whatIf: boolean;\n strict: boolean;\n}\n\nexport interface RenameSlotResult {\n componentDefinitionUpdated: boolean;\n compositionsModified: number;\n compositionPatternsModified: number;\n componentPatternsModified: number;\n instancesRenamed: number;\n}\n\nexport class SlotRenamerService {\n constructor(\n private fileSystem: FileSystemService,\n private componentService: ComponentService,\n private logger: Logger\n ) {}\n\n private compareIds(id1: string, id2: string, strict: boolean): boolean {\n if (strict) {\n return id1 === id2;\n }\n return id1.toLowerCase() === id2.toLowerCase();\n }\n\n async rename(options: RenameSlotInternalOptions): Promise<RenameSlotResult> {\n const {\n rootDir,\n componentsDir,\n compositionsDir,\n compositionPatternsDir,\n componentPatternsDir,\n componentType,\n slotId,\n newSlotId,\n newSlotName,\n whatIf,\n strict,\n } = options;\n\n const findOptions = { strict };\n const fullComponentsDir = this.fileSystem.resolvePath(rootDir, componentsDir);\n const fullCompositionsDir = this.fileSystem.resolvePath(rootDir, compositionsDir);\n const fullCompositionPatternsDir = this.fileSystem.resolvePath(rootDir, compositionPatternsDir);\n const fullComponentPatternsDir = this.fileSystem.resolvePath(rootDir, componentPatternsDir);\n\n // Validate: newSlotId must differ from slotId\n if (this.compareIds(slotId, newSlotId, strict)) {\n throw new TransformError('New slot ID is the same as the current slot ID');\n }\n\n // Step 1: Load and validate component definition\n this.logger.info(`Loading component: ${componentType}`);\n const { component, filePath: componentFilePath } =\n await this.componentService.loadComponent(fullComponentsDir, componentType, findOptions);\n\n if (!component.slots || component.slots.length === 0) {\n throw new SlotNotFoundError(slotId, componentType);\n }\n\n const slotIndex = component.slots.findIndex((s) =>\n this.compareIds(s.id, slotId, strict)\n );\n if (slotIndex === -1) {\n throw new SlotNotFoundError(slotId, componentType);\n }\n\n const existingNewSlot = component.slots.find((s) =>\n this.compareIds(s.id, newSlotId, strict)\n );\n if (existingNewSlot) {\n throw new SlotAlreadyExistsError(newSlotId, componentType);\n }\n\n // Step 2: Rename the slot in the component definition\n this.logger.action(\n whatIf,\n 'UPDATE',\n `Slot \"${slotId}\" → \"${newSlotId}\" in component/${this.fileSystem.getBasename(componentFilePath)}`\n );\n\n component.slots[slotIndex].id = newSlotId;\n if (newSlotName !== undefined) {\n component.slots[slotIndex].name = newSlotName;\n }\n\n if (!whatIf) {\n await this.componentService.saveComponent(componentFilePath, component);\n }\n\n // Step 3: Rename slot keys in compositions\n const compositionsResult = await this.renameSlotInDirectory(\n fullCompositionsDir,\n componentType,\n slotId,\n newSlotId,\n whatIf,\n strict,\n 'composition'\n );\n\n // Step 4: Rename slot keys in composition patterns\n const compositionPatternsResult = await this.renameSlotInDirectory(\n fullCompositionPatternsDir,\n componentType,\n slotId,\n newSlotId,\n whatIf,\n strict,\n 'compositionPattern'\n );\n\n // Step 5: Rename slot keys in component patterns\n const componentPatternsResult = await this.renameSlotInDirectory(\n fullComponentPatternsDir,\n componentType,\n slotId,\n newSlotId,\n whatIf,\n strict,\n 'componentPattern'\n );\n\n // Summary\n const totalFiles =\n compositionsResult.filesModified +\n compositionPatternsResult.filesModified +\n componentPatternsResult.filesModified;\n const totalInstances =\n compositionsResult.instancesRenamed +\n compositionPatternsResult.instancesRenamed +\n componentPatternsResult.instancesRenamed;\n\n this.logger.info('');\n this.logger.info(\n `Summary: 1 component definition, ${totalFiles} file(s) (${totalInstances} instance(s)) updated.`\n );\n\n return {\n componentDefinitionUpdated: true,\n compositionsModified: compositionsResult.filesModified,\n compositionPatternsModified: compositionPatternsResult.filesModified,\n componentPatternsModified: componentPatternsResult.filesModified,\n instancesRenamed: totalInstances,\n };\n }\n\n private async renameSlotInDirectory(\n directory: string,\n componentType: string,\n oldSlotId: string,\n newSlotId: string,\n whatIf: boolean,\n strict: boolean,\n label: string\n ): Promise<{ filesModified: number; instancesRenamed: number }> {\n let files: string[];\n try {\n files = await this.fileSystem.findFiles(directory, '**/*.{json,yaml,yml}');\n } catch {\n // Directory may not exist\n return { filesModified: 0, instancesRenamed: 0 };\n }\n\n if (files.length === 0) {\n return { filesModified: 0, instancesRenamed: 0 };\n }\n\n let filesModified = 0;\n let instancesRenamed = 0;\n\n for (const filePath of files) {\n let composition: Composition;\n try {\n composition = await this.fileSystem.readFile<Composition>(filePath);\n } catch {\n continue;\n }\n\n if (!composition?.composition) {\n continue;\n }\n\n const count = this.renameSlotInTree(\n composition.composition,\n componentType,\n oldSlotId,\n newSlotId,\n strict\n );\n\n if (count > 0) {\n const relativePath = filePath.replace(directory, '').replace(/^[/\\\\]/, '');\n this.logger.action(\n whatIf,\n 'UPDATE',\n `${label}/${relativePath} (${count} instance(s) of ${componentType})`\n );\n\n if (!whatIf) {\n await this.fileSystem.writeFile(filePath, composition);\n }\n filesModified++;\n instancesRenamed += count;\n }\n }\n\n return { filesModified, instancesRenamed };\n }\n\n private renameSlotInTree(\n node: { type: string; slots?: Record<string, ComponentInstance[]>; [key: string]: unknown },\n componentType: string,\n oldSlotId: string,\n newSlotId: string,\n strict: boolean\n ): number {\n let count = 0;\n\n // Check if this node's type matches the target component type\n if (this.compareIds(node.type, componentType, strict) && node.slots) {\n const result = this.renameSlotKey(node.slots, oldSlotId, newSlotId, strict);\n if (result.renamed) {\n node.slots = result.slots;\n count++;\n }\n }\n\n // Recurse into all slots\n if (node.slots) {\n for (const slotInstances of Object.values(node.slots)) {\n if (!Array.isArray(slotInstances)) continue;\n for (const instance of slotInstances) {\n count += this.renameSlotInTree(instance, componentType, oldSlotId, newSlotId, strict);\n }\n }\n }\n\n return count;\n }\n\n private renameSlotKey(\n slots: Record<string, ComponentInstance[]>,\n oldSlotId: string,\n newSlotId: string,\n strict: boolean\n ): { renamed: boolean; slots: Record<string, ComponentInstance[]> } {\n const matchingKey = Object.keys(slots).find((key) =>\n this.compareIds(key, oldSlotId, strict)\n );\n\n if (!matchingKey) {\n return { renamed: false, slots };\n }\n\n // Rebuild object preserving key order, replacing the old key with the new one\n const newSlots: Record<string, ComponentInstance[]> = {};\n for (const key of Object.keys(slots)) {\n if (key === matchingKey) {\n newSlots[newSlotId] = slots[key];\n } else {\n newSlots[key] = slots[key];\n }\n }\n\n return { renamed: true, slots: newSlots };\n }\n}\n","import { ComponentDefinition, ComponentInstance, Composition } from '../types/index.js';\nimport { ComponentAlreadyExistsError, ComponentNotFoundError, TransformError } from '../errors.js';\nimport { ComponentService } from './component.service.js';\nimport { FileSystemService } from './file-system.service.js';\nimport { Logger } from '../../cli/logger.js';\n\nexport interface RenameComponentInternalOptions {\n rootDir: string;\n componentsDir: string;\n compositionsDir: string;\n compositionPatternsDir: string;\n componentPatternsDir: string;\n componentType: string;\n newComponentType: string;\n newComponentName?: string;\n whatIf: boolean;\n strict: boolean;\n}\n\nexport interface RenameComponentResult {\n componentRenamed: boolean;\n fileRenamed: boolean;\n allowedComponentsUpdated: number;\n compositionsModified: number;\n compositionPatternsModified: number;\n componentPatternsModified: number;\n instancesRenamed: number;\n}\n\nexport class ComponentRenamerService {\n constructor(\n private fileSystem: FileSystemService,\n private componentService: ComponentService,\n private logger: Logger\n ) {}\n\n private compareIds(id1: string, id2: string, strict: boolean): boolean {\n if (strict) {\n return id1 === id2;\n }\n return id1.toLowerCase() === id2.toLowerCase();\n }\n\n async rename(options: RenameComponentInternalOptions): Promise<RenameComponentResult> {\n const {\n rootDir,\n componentsDir,\n compositionsDir,\n compositionPatternsDir,\n componentPatternsDir,\n componentType,\n newComponentType,\n newComponentName,\n whatIf,\n strict,\n } = options;\n\n const fullComponentsDir = this.fileSystem.resolvePath(rootDir, componentsDir);\n const fullCompositionsDir = this.fileSystem.resolvePath(rootDir, compositionsDir);\n const fullCompositionPatternsDir = this.fileSystem.resolvePath(rootDir, compositionPatternsDir);\n const fullComponentPatternsDir = this.fileSystem.resolvePath(rootDir, componentPatternsDir);\n const findOptions = { strict };\n\n // Validate: newComponentType must differ from componentType\n if (this.compareIds(componentType, newComponentType, strict)) {\n throw new TransformError('New component type is the same as the current component type');\n }\n\n // Step 1: Load and validate source component\n this.logger.info(`Loading component: ${componentType}`);\n const { component, filePath: componentFilePath } =\n await this.componentService.loadComponent(fullComponentsDir, componentType, findOptions);\n\n // Step 2: Check target does not already exist\n let targetExists = false;\n try {\n await this.componentService.loadComponent(fullComponentsDir, newComponentType, findOptions);\n targetExists = true;\n } catch (error) {\n if (!(error instanceof ComponentNotFoundError)) {\n throw error;\n }\n }\n if (targetExists) {\n throw new ComponentAlreadyExistsError(newComponentType, fullComponentsDir);\n }\n\n // Step 3: Update the component definition id (and optionally name)\n this.logger.action(\n whatIf,\n 'UPDATE',\n `Component ID \"${componentType}\" → \"${newComponentType}\" in component/${this.fileSystem.getBasename(componentFilePath)}`\n );\n component.id = newComponentType;\n if (newComponentName !== undefined) {\n component.name = newComponentName;\n }\n\n if (!whatIf) {\n await this.componentService.saveComponent(componentFilePath, component);\n }\n\n // Step 4: Rename the component file\n const ext = this.fileSystem.getExtension(componentFilePath);\n const dir = this.fileSystem.getDirname(componentFilePath);\n const newFilePath = this.fileSystem.joinPath(dir, `${newComponentType}${ext}`);\n let fileRenamed = false;\n\n if (componentFilePath !== newFilePath) {\n this.logger.action(\n whatIf,\n 'RENAME',\n `component/${this.fileSystem.getBasename(componentFilePath)} → component/${this.fileSystem.getBasename(newFilePath)}`\n );\n if (!whatIf) {\n await this.fileSystem.renameFile(componentFilePath, newFilePath);\n }\n fileRenamed = true;\n }\n\n // Step 5: Update allowedComponents on other component definitions\n const allowedComponentsUpdated = await this.updateAllowedComponents(\n fullComponentsDir,\n componentType,\n newComponentType,\n componentFilePath,\n whatIf,\n strict\n );\n\n // Step 6: Update type fields in compositions\n const compositionsResult = await this.renameTypeInDirectory(\n fullCompositionsDir,\n componentType,\n newComponentType,\n whatIf,\n strict,\n 'composition'\n );\n\n // Step 7: Update type fields in composition patterns\n const compositionPatternsResult = await this.renameTypeInDirectory(\n fullCompositionPatternsDir,\n componentType,\n newComponentType,\n whatIf,\n strict,\n 'compositionPattern'\n );\n\n // Step 8: Update type fields in component patterns\n const componentPatternsResult = await this.renameTypeInDirectory(\n fullComponentPatternsDir,\n componentType,\n newComponentType,\n whatIf,\n strict,\n 'componentPattern'\n );\n\n // Summary\n const totalCompositionFiles =\n compositionsResult.filesModified +\n compositionPatternsResult.filesModified +\n componentPatternsResult.filesModified;\n const totalInstances =\n compositionsResult.instancesRenamed +\n compositionPatternsResult.instancesRenamed +\n componentPatternsResult.instancesRenamed;\n\n this.logger.info('');\n this.logger.info(\n `Summary: 1 component renamed, ${allowedComponentsUpdated} component(s) with allowedComponents updated, ` +\n `${totalCompositionFiles} composition file(s) (${totalInstances} instance(s)) updated.`\n );\n\n return {\n componentRenamed: true,\n fileRenamed,\n allowedComponentsUpdated,\n compositionsModified: compositionsResult.filesModified,\n compositionPatternsModified: compositionPatternsResult.filesModified,\n componentPatternsModified: componentPatternsResult.filesModified,\n instancesRenamed: totalInstances,\n };\n }\n\n private async updateAllowedComponents(\n componentsDir: string,\n oldType: string,\n newType: string,\n sourceFilePath: string,\n whatIf: boolean,\n strict: boolean\n ): Promise<number> {\n let files: string[];\n try {\n files = await this.fileSystem.findFiles(componentsDir, '*.{json,yaml,yml}');\n } catch {\n return 0;\n }\n\n let updatedCount = 0;\n\n for (const filePath of files) {\n // Skip the source component file itself (it was already saved with the new id)\n if (filePath === sourceFilePath) continue;\n\n let comp: ComponentDefinition;\n try {\n comp = await this.fileSystem.readFile<ComponentDefinition>(filePath);\n } catch {\n continue;\n }\n\n if (!comp.slots || comp.slots.length === 0) continue;\n\n let fileModified = false;\n for (const slot of comp.slots) {\n if (!slot.allowedComponents) continue;\n\n for (let i = 0; i < slot.allowedComponents.length; i++) {\n if (this.compareIds(slot.allowedComponents[i], oldType, strict)) {\n slot.allowedComponents[i] = newType;\n fileModified = true;\n }\n }\n }\n\n if (fileModified) {\n this.logger.action(\n whatIf,\n 'UPDATE',\n `allowedComponents in component/${this.fileSystem.getBasename(filePath)}: ${oldType} → ${newType}`\n );\n if (!whatIf) {\n await this.fileSystem.writeFile(filePath, comp);\n }\n updatedCount++;\n }\n }\n\n return updatedCount;\n }\n\n private async renameTypeInDirectory(\n directory: string,\n oldType: string,\n newType: string,\n whatIf: boolean,\n strict: boolean,\n label: string\n ): Promise<{ filesModified: number; instancesRenamed: number }> {\n let files: string[];\n try {\n files = await this.fileSystem.findFiles(directory, '**/*.{json,yaml,yml}');\n } catch {\n return { filesModified: 0, instancesRenamed: 0 };\n }\n\n if (files.length === 0) {\n return { filesModified: 0, instancesRenamed: 0 };\n }\n\n let filesModified = 0;\n let instancesRenamed = 0;\n\n for (const filePath of files) {\n let composition: Composition;\n try {\n composition = await this.fileSystem.readFile<Composition>(filePath);\n } catch {\n continue;\n }\n\n if (!composition?.composition) continue;\n\n const count = this.renameTypeInTree(composition.composition, oldType, newType, strict);\n\n if (count > 0) {\n const relativePath = filePath.replace(directory, '').replace(/^[/\\\\]/, '');\n this.logger.action(\n whatIf,\n 'UPDATE',\n `${label}/${relativePath} (${count} instance(s))`\n );\n\n if (!whatIf) {\n await this.fileSystem.writeFile(filePath, composition);\n }\n filesModified++;\n instancesRenamed += count;\n }\n }\n\n return { filesModified, instancesRenamed };\n }\n\n private renameTypeInTree(\n node: { type: string; slots?: Record<string, ComponentInstance[]>; [key: string]: unknown },\n oldType: string,\n newType: string,\n strict: boolean\n ): number {\n let count = 0;\n\n // Check this node's type\n if (this.compareIds(node.type, oldType, strict)) {\n node.type = newType;\n count++;\n }\n\n // Recurse into all slots\n if (node.slots) {\n for (const slotInstances of Object.values(node.slots)) {\n if (!Array.isArray(slotInstances)) continue;\n for (const instance of slotInstances) {\n count += this.renameTypeInTree(instance, oldType, newType, strict);\n }\n }\n }\n\n return count;\n }\n}\n","import chalk from 'chalk';\n\nexport class Logger {\n info(message: string): void {\n console.log(`${chalk.blue('[INFO]')} ${message}`);\n }\n\n success(message: string): void {\n console.log(`${chalk.green('[DONE]')} ${message}`);\n }\n\n error(message: string): void {\n console.log(`${chalk.red('[ERROR]')} ${message}`);\n }\n\n warn(message: string): void {\n console.log(`${chalk.yellow('[WARN]')} ${message}`);\n }\n\n action(whatIf: boolean, actionType: string, message: string): void {\n const prefix = whatIf ? chalk.yellow('[WOULD]') : chalk.green(`[${actionType}]`);\n console.log(`${prefix} ${message}`);\n }\n\n detail(message: string): void {\n console.log(` ${chalk.gray(message)}`);\n }\n}\n"],"mappings":";AAAO,IAAM,iBAAN,cAA6B,MAAM;AAAA,EACxC,YAAY,SAAiB;AAC3B,UAAM,OAAO;AACb,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,yBAAN,cAAqC,eAAe;AAAA,EACzD,YAAY,eAAuBA,OAAe;AAChD,UAAM,WAAWA,QAAO,eAAeA,KAAI,MAAM;AACjD,UAAM,wBAAwB,aAAa,GAAG,QAAQ,EAAE;AACxD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,wBAAN,cAAoC,eAAe;AAAA,EACxD,YAAY,cAAsB,eAAuB;AACvD,UAAM,aAAa,YAAY,6BAA6B,aAAa,GAAG;AAC5E,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAAM,mBAAN,cAA+B,eAAe;AAAA,EACnD,YAAY,UAAkB,SAAkB;AAC9C,UAAM,cAAc,UAAU,KAAK,OAAO,KAAK;AAC/C,UAAM,sBAAsB,QAAQ,GAAG,WAAW,EAAE;AACpD,SAAK,OAAO;AAAA,EACd;AACF;AAEO,IAA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DED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@uniformdev/transformer",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool for transforming Uniform.dev serialization files offline",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"uniform-transform": "./dist/cli/index.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.js",
|
|
14
|
+
"types": "./dist/index.d.ts"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"README.md"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup",
|
|
24
|
+
"dev": "tsx src/cli/index.ts",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"test:e2e": "vitest run --config vitest.e2e.config.ts",
|
|
28
|
+
"test:coverage": "vitest run --coverage",
|
|
29
|
+
"lint": "eslint --ext .ts src tests",
|
|
30
|
+
"format": "prettier --write .",
|
|
31
|
+
"prepublishOnly": "npm run build"
|
|
32
|
+
},
|
|
33
|
+
"keywords": [
|
|
34
|
+
"uniform",
|
|
35
|
+
"uniform.dev",
|
|
36
|
+
"cli",
|
|
37
|
+
"transform",
|
|
38
|
+
"content",
|
|
39
|
+
"cms"
|
|
40
|
+
],
|
|
41
|
+
"author": "Uniform <https://uniform.dev>",
|
|
42
|
+
"license": "MIT",
|
|
43
|
+
"repository": {
|
|
44
|
+
"type": "git",
|
|
45
|
+
"url": "https://github.com/uniform-collab/transformer.git"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"chalk": "^5.3.0",
|
|
49
|
+
"commander": "^12.1.0",
|
|
50
|
+
"glob": "^10.3.10",
|
|
51
|
+
"yaml": "^2.4.1",
|
|
52
|
+
"zod": "^3.22.4"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/node": "^20.11.24",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
|
57
|
+
"@typescript-eslint/parser": "^7.18.0",
|
|
58
|
+
"@vitest/coverage-v8": "^1.3.1",
|
|
59
|
+
"eslint": "^8.57.0",
|
|
60
|
+
"prettier": "^3.2.5",
|
|
61
|
+
"tsup": "^8.0.2",
|
|
62
|
+
"tsx": "^4.7.1",
|
|
63
|
+
"typescript": "^5.4.2",
|
|
64
|
+
"vitest": "^1.3.1"
|
|
65
|
+
},
|
|
66
|
+
"engines": {
|
|
67
|
+
"node": ">=18"
|
|
68
|
+
}
|
|
69
|
+
}
|