Skip to content

Commit 8fc39fa

Browse files
authored
refactor: extract SVGKit into standalone package swift-svgkit (#70)
Replace the local SVGKit module with the newly published DesignPipe/swift-svgkit package (0.1.0). The module name stays `SVGKit`, so all `import SVGKit` statements remain unchanged. - Add swift-svgkit remote dependency to Package.swift - Update ExFigCLI, AndroidExport, ExFig-Android to use .product() - Remove local SVGKit target and SVGKitTests test target - Delete Sources/SVGKit/ and Tests/SVGKitTests/ (8 + 27 files) - Update CLAUDE.md architecture (14 → 13 modules) and dependencies
1 parent 3b588ad commit 8fc39fa

40 files changed

Lines changed: 32 additions & 11180 deletions

CLAUDE.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ pkl eval --format json <file.pkl> # Package URI requires published package
9797

9898
## Architecture
9999

100-
Fourteen modules in `Sources/`:
100+
Thirteen modules in `Sources/`:
101101

102102
| Module | Purpose |
103103
| --------------- | --------------------------------------------------------- |
@@ -113,7 +113,6 @@ Fourteen modules in `Sources/`:
113113
| `AndroidExport` | Android export (XML resources, Compose, Vector Drawables) |
114114
| `FlutterExport` | Flutter export (Dart code, SVG/PNG assets) |
115115
| `WebExport` | Web/React export (CSS variables, JSX icons) |
116-
| `SVGKit` | SVG parsing, ImageVector/VectorDrawable generation |
117116
| `JinjaSupport` | Shared Jinja2 template rendering across Export modules |
118117

119118
**Data flow:** CLI -> PKL config parsing -> FigmaAPI fetch -> ExFigCore processing -> Platform plugin -> Export module -> File write
@@ -315,22 +314,23 @@ NooraUI.formatLink("url", useColors: true) // underlined primary
315314

316315
## Dependencies
317316

318-
| Package | Version | Purpose |
319-
| --------------------- | ------- | ------------------------------- |
320-
| swift-argument-parser | 1.5.0+ | CLI framework |
321-
| swift-collections | 1.2.x | Ordered collections |
322-
| swift-jinja | 2.0.0+ | Jinja2 template engine |
323-
| XcodeProj | 8.27.0+ | Xcode project manipulation |
324-
| swift-log | 1.6.0+ | Logging |
325-
| Rainbow | 4.2.0+ | Terminal colors |
326-
| libwebp | 1.4.1+ | WebP encoding |
327-
| libpng | 1.6.45+ | PNG decoding |
328-
| swift-custom-dump | 1.3.0+ | Test assertions |
329-
| Noora | 0.54.0+ | Terminal UI design system |
330-
| swift-resvg | 0.45.1 | SVG parsing/rendering |
331-
| swift-docc-plugin | 1.4.5+ | DocC documentation |
332-
| swift-yyjson | 0.5.0+ | High-performance JSON codec |
333-
| pkl-swift | 0.8.0+ | PKL config evaluation & codegen |
317+
| Package | Version | Purpose |
318+
| --------------------- | ------- | -------------------------------------------------- |
319+
| swift-argument-parser | 1.5.0+ | CLI framework |
320+
| swift-collections | 1.2.x | Ordered collections |
321+
| swift-jinja | 2.0.0+ | Jinja2 template engine |
322+
| XcodeProj | 8.27.0+ | Xcode project manipulation |
323+
| swift-log | 1.6.0+ | Logging |
324+
| Rainbow | 4.2.0+ | Terminal colors |
325+
| libwebp | 1.4.1+ | WebP encoding |
326+
| libpng | 1.6.45+ | PNG decoding |
327+
| swift-custom-dump | 1.3.0+ | Test assertions |
328+
| Noora | 0.54.0+ | Terminal UI design system |
329+
| swift-svgkit | 0.1.0+ | SVG parsing, ImageVector/VectorDrawable generation |
330+
| swift-resvg | 0.45.1 | SVG parsing/rendering |
331+
| swift-docc-plugin | 1.4.5+ | DocC documentation |
332+
| swift-yyjson | 0.5.0+ | High-performance JSON codec |
333+
| pkl-swift | 0.8.0+ | PKL config evaluation & codegen |
334334

335335
## Troubleshooting
336336

Package.resolved

Lines changed: 10 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ let package = Package(
2626
.package(url: "https://github.com/alexey1312/swift-resvg.git", exact: "0.45.1-swift.3"),
2727
.package(url: "https://github.com/mattt/swift-yyjson", from: "0.5.0"),
2828
.package(url: "https://github.com/apple/pkl-swift", from: "0.8.0"),
29+
.package(url: "https://github.com/DesignPipe/swift-svgkit.git", from: "0.1.0"),
2930
],
3031
targets: [
3132
// Main target
@@ -39,7 +40,7 @@ let package = Package(
3940
"AndroidExport",
4041
"FlutterExport",
4142
"WebExport",
42-
"SVGKit",
43+
.product(name: "SVGKit", package: "swift-svgkit"),
4344
"ExFig-iOS",
4445
"ExFig-Android",
4546
"ExFig-Flutter",
@@ -109,22 +110,12 @@ let package = Package(
109110
]
110111
),
111112

112-
// SVG parsing and code generation
113-
.target(
114-
name: "SVGKit",
115-
dependencies: [
116-
.product(name: "Logging", package: "swift-log"),
117-
.product(name: "Resvg", package: "swift-resvg"),
118-
],
119-
exclude: ["CLAUDE.md", "AGENTS.md"]
120-
),
121-
122113
// Exports resources to Android project
123114
.target(
124115
name: "AndroidExport",
125116
dependencies: [
126117
"ExFigCore",
127-
"SVGKit",
118+
.product(name: "SVGKit", package: "swift-svgkit"),
128119
"JinjaSupport",
129120
.product(name: "OrderedCollections", package: "swift-collections"),
130121
],
@@ -180,7 +171,7 @@ let package = Package(
180171
"ExFigCore",
181172
"ExFigConfig",
182173
"AndroidExport",
183-
"SVGKit",
174+
.product(name: "SVGKit", package: "swift-svgkit"),
184175
],
185176
exclude: ["CLAUDE.md", "AGENTS.md"]
186177
),
@@ -271,10 +262,6 @@ let package = Package(
271262
"WebExport", .product(name: "CustomDump", package: "swift-custom-dump"),
272263
]
273264
),
274-
.testTarget(
275-
name: "SVGKitTests",
276-
dependencies: ["SVGKit", .product(name: "CustomDump", package: "swift-custom-dump")]
277-
),
278265

279266
// MARK: - Plugin Tests
280267

Sources/SVGKit/AGENTS.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

Sources/SVGKit/CLAUDE.md

Lines changed: 0 additions & 56 deletions
This file was deleted.

0 commit comments

Comments
 (0)