Skip to content

Commit 4d1bf69

Browse files
author
eldcn
authored
Update README.md
1 parent 28fa37a commit 4d1bf69

1 file changed

Lines changed: 54 additions & 2 deletions

File tree

README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,61 @@ OPTIONS:
128128
-h, --help Show help information.
129129
```
130130

131-
## Example projects
131+
## ApodiniMigratorExample
132132

133-
See [Examples](https://github.com/Apodini/ApodiniMigrator)
133+
[ApodiniMigratorExample](https://github.com/Apodini/ApodiniMigratorExample) includes two different versions of an Apodini Web Service using `ApodiniMigrator` configuration. The corresponding documents of those versions can be found in the [ExampleDocuments](https://github.com/Apodini/ApodiniMigrator/tree/develop/Resources/ExampleDocuments) of this repository. In order to test out the functionalities of `migrator` CLI, a preconfigured Ruby script in the root of this repository can be used (see [migrator](https://github.com/Apodini/ApodiniMigrator/blob/develop/migrator))
134+
135+
In order to generate the intermediary client library for the initial version run the script with `generate` argument:
136+
137+
```console
138+
$ ./migrator generate
139+
info org.apodini.migrator : Starting generation of package QONECTIQ
140+
info org.apodini.migrator : Preparing project directories...
141+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/HTTP
142+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Utils
143+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Resources
144+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Endpoints
145+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Models
146+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Networking
147+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Tests
148+
info org.apodini.migrator : Package QONECTIQ was generated successfully. You can open the package via QONECTIQ/Package.swift
149+
```
150+
Each endpoint of the library can be accessed via the caseless enumeration `API` as follows:
151+
152+
```swift
153+
API.getEventWithID(id: UUID())
154+
.sink { completion in
155+
if case let .failure(error) = completion {
156+
print("Failed to get the event with error: \(error)")
157+
}
158+
} receiveValue: { event in
159+
print("Received event \(event.title)")
160+
}
161+
```
162+
163+
Migration guide can be generated via:
164+
165+
```console
166+
$ ./migrator compare
167+
info org.apodini.migrator : Starting generation of the migration guide...
168+
info org.apodini.migrator : Migration guide was generated successfully at /path/to/ApodiniMigrator/Resources/ExampleDocuments/migration_guide.json.
169+
```
170+
171+
Once the migration guide has been generate, use `migrate` argument to migrate the initial library:
172+
173+
```console
174+
$ ./migrator migrate
175+
info org.apodini.migrator : Starting migration of package QONECTIQ
176+
info org.apodini.migrator : Preparing project directories...
177+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/HTTP
178+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Utils
179+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Resources
180+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Endpoints
181+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Models
182+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Sources/QONECTIQ/Networking
183+
info org.apodini.migrator : Persisting content at Resources/QONECTIQ/Tests
184+
info org.apodini.migrator : Package QONECTIQ was migrated successfully. You can open the package via QONECTIQ/Package.swift
185+
```
134186

135187
## Contributing
136188
Contributions to this projects are welcome. Please make sure to read the [contribution guidelines](https://github.com/Apodini/.github/blob/release/CONTRIBUTING.md) first.

0 commit comments

Comments
 (0)