Skip to content

0.12.0

Choose a tag to compare

@mozharovsky mozharovsky released this 15 Jul 20:20
· 9 commits to main since this release
517a4ca

Added

  • Xcworkspace — a model over contents.xcworkspacedata, the file listing the projects a workspace shows. projectFilePaths() resolves every referenced .xcodeproj relative to the workspace's directory, with group locations composing through their enclosing groups, container locations anchoring at the workspace's directory, and absolute paths passing through, so tooling resolves the real project set instead of globbing directory trees. fileRefs() returns typed views with location access, addFileRef and removeFileRef edit the tree, parseWorkspaceLocation splits a location into kind and path, and Xcworkspace.create produces the document Xcode writes.
  • parseXcworkspace and buildXcworkspace — the same contract as schemes. An Xcode-written file rebuilds byte-identically, any other input reaches the canonical layout in one build, and malformed input fails with the new XcworkspaceParseError and XcworkspaceBuildError carrying line, column, and node path.
  • The shared XML node types ship as XmlDocument, XmlElement, XmlComment, and XmlNode, with isXmlElement and xmlElements. The Xcscheme* type names remain as aliases, so existing annotations keep compiling.
  • TextPosition — the XML-neutral position type every parse error now carries, with PbxprojErrorPosition kept as a documented alias.
  • Cross-library benchmarks for the XML dialect files in pnpm bench:compare and the README, measured against the one other npm package that parses and writes them.

Changed

  • Scheme and workspace files share one XML core, now strict about what XML cannot carry, symmetrically on parse and build. Only a real <?xml declaration is consumed, numeric character references validate their full digit run and the decoded code point against XML's character set, comment text rejects -- and a trailing -, and attribute values reject raw control characters, unpaired surrogates, and the U+FFFE and U+FFFF noncharacters. Every input the parser accepts is one the serializer reproduces, and the corpus sweep over hundreds of real files confirms the strictness rejects nothing Xcode writes.
  • The serializer validates and escapes attribute values in a single scan, returns the near-universal value with nothing to escape untouched, memoizes name validity and indentation, and resolves error paths only when a build actually fails. Scheme and workspace operations now measure fastest across the board, with parsing 3.9 to 4.3 times faster and building 1.1 to 1.4 times faster than the alternative.
  • Parse-error positions count all three line-ending conventions, so CR-only and CRLF sources report correct lines and columns.

Full Changelog: 0.11.0...0.12.0