Files
automaker/libs/spec-parser/src/index.ts
Stefan de Vogelaere c4652190eb feat: add three viewing modes for app specification (#566)
* feat: add three viewing modes for app specification

Introduces View, Edit, and Source modes for the spec page:

- View: Clean read-only display with cards, badges, and accordions
- Edit: Structured form-based editor for all spec fields
- Source: Raw XML editor for advanced users

Also adds @automaker/spec-parser shared package for XML parsing
between server and client.

* fix: address PR review feedback

- Replace array index keys with stable UUIDs in array-field-editor,
  features-section, and roadmap-section components
- Replace regex-based XML parsing with fast-xml-parser for robustness
- Simplify renderContent logic in spec-view by removing dead code paths

* fix: convert git+ssh URLs to https in package-lock.json

* fix: address PR review feedback for spec visualiser

- Remove unused RefreshCw import from spec-view.tsx
- Add explicit parsedSpec check in renderContent for robustness
- Hide save button in view mode since it's read-only
- Remove GripVertical drag handles since drag-and-drop is not implemented
- Rename Map imports to MapIcon to avoid shadowing global Map
- Escape tagName in xml-utils.ts RegExp functions for safety
- Add aria-label attributes for accessibility on mode tabs

* fix: address additional PR review feedback

- Fix Textarea controlled/uncontrolled warning with default value
- Preserve IDs in useEffect sync to avoid unnecessary remounts
- Consolidate lucide-react imports
- Add JSDoc note about tag attributes limitation in xml-utils.ts
- Remove redundant disabled prop from SpecModeTabs
2026-01-18 23:45:43 +01:00

27 lines
830 B
TypeScript

/**
* @automaker/spec-parser
*
* XML spec parser for AutoMaker - parses and generates app_spec.txt XML.
* This package provides utilities for:
* - Parsing XML spec content into SpecOutput objects
* - Converting SpecOutput objects back to XML
* - Validating spec data
*/
// Re-export types from @automaker/types for convenience
export type { SpecOutput } from '@automaker/types';
// XML utilities
export { escapeXml, unescapeXml, extractXmlSection, extractXmlElements } from './xml-utils.js';
// XML to Spec parsing
export { xmlToSpec } from './xml-to-spec.js';
export type { ParseResult } from './xml-to-spec.js';
// Spec to XML conversion
export { specToXml } from './spec-to-xml.js';
// Validation
export { validateSpec, isValidSpecXml } from './validate.js';
export type { ValidationResult } from './validate.js';