Commit 6f22b8b
authored
feat(core): Abstract design data sources behind per-asset-type protocols (#75)
* feat(core): abstract design data sources behind per-asset-type protocols
Introduce ColorsSource, ComponentsSource, and TypographySource protocols
in ExFigCore to decouple the export pipeline from Figma-specific loaders.
This lays the foundation for supporting alternative design tools (Penpot,
Sketch, Tokens Studio) without modifying the export infrastructure.
- Add DesignSourceKind enum and ColorsSourceConfig protocol pattern
- Refactor ColorsSourceInput to use sourceKind + sourceConfig
- Extract FigmaColorsSource, TokensFileColorsSource, FigmaComponentsSource,
FigmaTypographySource from context implementations
- Add SourceFactory for centralized source dispatch
- Add sourceKind field to PKL schemas (FrameSource, VariablesSource)
- Update all context impls, plugin exports, and entry bridges
* chore(openspec): archive design-source-abstraction, sync specs
Sync 4 delta specs to main: design-source-protocol (new),
source-dispatch (new), configuration (updated),
tokens-file-source (updated). Archive completed change.
* fix(core): wire SourceFactory into production path, restore lost warnings
ColorsExportContextImpl now uses per-call SourceFactory dispatch instead of
injected colorsSource, enabling per-entry sourceKind in multi-source configs.
Fixes tokens-file colors export which was broken by hardcoded FigmaColorsSource.
- Remove FigmaColorsSource injection from all 4 PluginColorsExport methods
- Add ignoredModeNames to TokensFileColorsConfig for dark mode field warnings
- Make unsupportedSourceKind error asset-type-aware with correct recovery hints
- Add spinnerLabel to ColorsSourceInput for informative progress messages
- Add 16 tests: SourceKindBridging, explicit override, ignoredModeNames, errors1 parent 8fbb61f commit 6f22b8b
59 files changed
Lines changed: 1631 additions & 828 deletions
File tree
- Sources
- ExFig-Android
- Config
- Export
- ExFig-Flutter
- Config
- Export
- ExFig-Web
- Config
- Export
- ExFig-iOS
- Config
- Export
- ExFigCLI
- Context
- Resources/Schemas
- Source
- Subcommands/Export
- ExFigConfig
- Generated
- ExFigCore
- Protocol
- Tests/ExFigTests/Input
- openspec
- changes
- archive/2026-03-21-design-source-abstraction
- specs
- configuration
- design-source-protocol
- source-dispatch
- tokens-file-source
- design-source-abstraction
- specs
- configuration
- design-source-protocol
- source-dispatch
- tokens-file-source
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments