Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(cli,ums-lib): remove all v1.0 YAML support and address PR review …
…issues

Remove all v1.0 YAML file support from CLI and ums-lib, transitioning
fully to v2.0 TypeScript-only format. Address critical and high-priority
issues identified in PR #78 review comments.

**Breaking Changes:**
- v1.0 YAML files (.module.yml, .persona.yml) are no longer supported
- validate command now returns message that validation is not implemented
  for v2.0 (TypeScript provides compile-time type checking)
- parseModule and parsePersona exports removed from ums-lib

**Fixes:**
- Remove misleading "backward compatibility aliases" comment (parseModule/parsePersona)
- Fix unsafe type casting in inspect.ts by adding isCLIModule() type guard
- Fix division by zero bug in progress.ts ETA calculation
- Remove broken v1.0 YAML validation logic from validate command
- Remove v1.0 YAML module loading from module-discovery
- Remove v1.0 YAML support from file-operations (discoveryModuleFiles, isPersonaFile, validatePersonaFile)
- Remove v1.0 YAML detection functions from typescript-loader (detectUMSVersion, isYAMLUMSFile)

**Test Updates:**
- Update all test files to reflect v2.0 TypeScript-only support
- Remove obsolete validate.test.ts (validate command is now a stub)
- Fix test expectations for new error messages and behavior

All tests passing: CLI (184/184), ums-lib (164/164)

Addresses review comments from PR #78
  • Loading branch information
synthable committed Oct 13, 2025
commit a5b8c8f57463df36614158093f4f8d365818d004
4 changes: 0 additions & 4 deletions packages/copilot-instructions-cli/src/commands/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
import { writeOutputFile, readFromStdin } from '../utils/file-operations.js';
import { handleBuild } from './build.js';
import {
parsePersona,
renderMarkdown,
generateBuildReport,
resolvePersonaModules,
Expand Down Expand Up @@ -41,7 +40,6 @@ vi.mock('ora', () => {

// Mock pure functions from UMS library
vi.mock('ums-lib', () => ({
parsePersona: vi.fn(),
renderMarkdown: vi.fn(),
generateBuildReport: vi.fn(),
resolvePersonaModules: vi.fn(),
Expand Down Expand Up @@ -89,7 +87,6 @@ const mockExit = vi.spyOn(process, 'exit').mockImplementation(() => {

describe('build command', () => {
// Type-safe mocks
const mockParsePersona = vi.mocked(parsePersona);
const mockRenderMarkdown = vi.mocked(renderMarkdown);
const mockGenerateBuildReport = vi.mocked(generateBuildReport);
const mockResolvePersonaModules = vi.mocked(resolvePersonaModules);
Expand Down Expand Up @@ -181,7 +178,6 @@ describe('build command', () => {
});

mockLoadTypeScriptPersona.mockResolvedValue(mockPersona);
mockParsePersona.mockReturnValue(mockPersona);
mockRenderMarkdown.mockReturnValue(
'# Test Persona Instructions\\n\\nTest content'
);
Expand Down
12 changes: 7 additions & 5 deletions packages/copilot-instructions-cli/src/commands/inspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { handleError } from '../utils/error-handler.js';
import type { ModuleRegistry } from 'ums-lib';
import { createDiscoveryProgress } from '../utils/progress.js';
import { discoverAllModules } from '../utils/module-discovery.js';
import { getModuleMetadata } from '../types/cli-extensions.js';
import { getModuleMetadata, isCLIModule } from '../types/cli-extensions.js';

export interface InspectOptions {
verbose?: boolean;
Expand Down Expand Up @@ -107,9 +107,8 @@ function inspectSpecificModule(
console.log(chalk.gray(` Name: ${metadata.name}`));
console.log(chalk.gray(` Description: ${metadata.description}`));
console.log(chalk.gray(` Version: ${resolvedModule.version}`));
const filePath = (resolvedModule as { filePath?: string }).filePath;
if (filePath) {
console.log(chalk.gray(` File: ${filePath}`));
if (isCLIModule(resolvedModule) && resolvedModule.filePath) {
console.log(chalk.gray(` File: ${resolvedModule.filePath}`));
}
}
return;
Expand All @@ -125,7 +124,10 @@ function inspectSpecificModule(
if (format === 'json') {
const conflictData = conflicts.map((entry, index) => {
const metadata = getModuleMetadata(entry.module);
const filePath = (entry.module as { filePath?: string }).filePath;
const filePath =
isCLIModule(entry.module) && entry.module.filePath
? entry.module.filePath
: undefined;
return {
index: index + 1,
moduleId: entry.module.id,
Expand Down
239 changes: 0 additions & 239 deletions packages/copilot-instructions-cli/src/commands/validate.test.ts

This file was deleted.

Loading