Repository navigation
Releases: theoriginalbit/SwiftStructureKit
Releases · theoriginalbit/SwiftStructureKit
Release list
Documentation catalog
Added a DocC documentation archive.
Expressions, Extensions, and a Better Renderer
Note
The package now requires Swift tools version 6.1 to be available.
New source-generation capabilities
- Describe
extensions, including added conformances, genericwhererequirements, members, and default access levels. - Represent new expressions; tuple, member-access, function calls, and
if/else if/elseexpressions. - Render
try,await,throw,break, andcontinuestatements. - Add generic parameters to typealiases.
Tweaks
- Initialisers and conveniences for
guard,if, andreturnthat were erroneouslyinternalhave now been made public.
More correct and consistent output
- Render special
Doublevalues such as infinity and NaN as valid Swift expressions. - Sanitise identifiers according to their syntactic position, improving output for keywords and other special identifiers.
- Improve whitespace and punctuation handling, including compacting empty blocks, and fix protocol subscript rendering.
- Remove duplicate generic parameters, conformances, type constraints, type-alias composition types, and attributes while preserving their first occurrence.
- Rendering hot paths are now more efficient.
Migration notes
- The dependency on
swift-collectionshas been removed1.- Public collection APIs that used
OrderedSetnow use arrays; duplicate entries are still omitted from rendered output.
- Public collection APIs that used
TypeMemberDescriptorandTypeMembersBuilderare replaced byDeclarationDescriptorandDeclarationBuilder.SwiftFile.declarationsnow usesTopLevelDeclarationDescriptorso it can include extensions which are only valid at the file scope; update code that explicitly constructs or switches over these values.- Replace
.stored(isMutable: true, ...)/.stored(isMutable: false, ...)with.stored(.var, ...)/.stored(.let, ...). - Replace
ProtocolAssociatedtypeDescriptor(..., sameTypeAs: ...)withdefaultType:for associated-type defaults. AccessModifierDescriptor.openwas removed until class descriptors are added.
-
Generic parameters, conformances, and type compositions have changed from
OrderedSettoArray. ↩
Declarative Swift Source Generation
The first stable release of SwiftStructureKit, a lightweight library for building and rendering Swift source code with a declarative API.
Features
- Build Swift files containing imports, structs, protocols, enums, functions, properties, and type aliases.
- Describe statements, types, attributes, comments, and diagnostic directives.
- Render generated source directly to a file or to
Data. - Choose spaces or tabs for indentation.