Skip to content
This repository was archived by the owner on Sep 6, 2018. It is now read-only.

Commit 140e50b

Browse files
committed
Add migration guide
1 parent 5ae9034 commit 140e50b

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
## Master
66

7+
Due to the removal of legacy code, there are a few breaking changes in this new version that affect both template writers as well as developers. We've provided a migration guide to help you through these changes, which you can find here:
8+
[Migration Guide for 2.0](https://github.com/SwiftGen/SwiftGenKit/blob/master/Documentation/MigrationGuide.md#swiftgenkit-20-swiftgen-50)
9+
710
### Bug Fixes
811

912
* Fixed color's hex value rounding error.
@@ -18,6 +21,7 @@
1821
* Removed deprecated variables. See [SwiftGenKit#5](https://github.com/SwiftGen/SwiftGenKit/issues/5) for more information.
1922
[David Jennes](https://github.com/djbe)
2023
[#35](https://github.com/SwiftGen/templates/issues/35)
24+
[#42](https://github.com/SwiftGen/templates/issues/42)
2125

2226
### New Features
2327

Documentation/MigrationGuide.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## SwiftGenKit 2.0 (SwiftGen 5.0)
2+
3+
### For template writers:
4+
5+
#### Colors
6+
7+
- `enumName`: has been replaced by `param.enumName`, should provide default value.
8+
- For each `color`:
9+
- `rgb` and `rgba`: can be composed from the other components.
10+
11+
#### Fonts
12+
13+
- `enumName`: has been replaced by `param.enumName`, should provide default value.
14+
- For each `font`:
15+
- `fontName`: has been replaced by the `name` property.
16+
17+
#### Images
18+
19+
- `enumName`: has been replaced by `param.enumName`, should provide default value.
20+
- `images`: just old, `catalogs` contains the structured information.
21+
22+
#### Storyboards
23+
24+
- `extraImports`: replaced by `modules` (https://github.com/AliSoftware/SwiftGen/pull/243)
25+
- `sceneEnumName`: has been replaced by `param.sceneEnumName`, should provide default value.
26+
- `segueEnumName`: has been replaced by `param.segueEnumName`, should provide default value.
27+
- For each `scene`:
28+
- `isBaseViewController`: removed. You can replace it with a test for `baseType == "ViewController"`.
29+
30+
#### Strings
31+
32+
- `enumName`: has been replaced by `param.enumName`, should provide default value.
33+
- `strings` and `structuredStrings`: replaced by `tables` array, where each table has a structured `levels` property.
34+
- `tableName`: replaced by `tables` array, where each table has a `name` property.
35+
- for each `level`:
36+
- `subenums`: renamed to `children`.
37+
- for each `string`:
38+
- `keytail`: renamed to `name`.
39+
- `params` structure with the `names`, `typednames`, `types`, `count` and `declarations` arrays: removed.
40+
- These have been replaced by `types` which is an array of types. The previous variables
41+
can now be reconstructed using template tags now that Stencil has become more powerful.
42+
43+
### For developers using SwiftGenKit as a dependency:
44+
45+
Previously the parser context generation method (`stencilContext()`) accepted parameters such as `enumName`, this has been removed in favor of the `--param` system. Templates will automatically receive a `param` object with parameters from the CLI invocation, and should provide default values in case no value was present in the invocation.

0 commit comments

Comments
 (0)