Skip to content

Commit a93defc

Browse files
author
Nikita Korobeinikov
authored
Prepare 7.1 (#136)
* update Local package in SPM example * update 7.1 mentions and roadmap for 7.2 * update version * update example project xcode version * update changelog * remove deprecated swift version file to pass pod lint * add release guide * update version of example project * add short commands to fast update versions in config * update release guide * add command for publishing lib * fix checking yml in danger file * add description of working with danger * fix readme * fix readme inside danger support package * post merge * post merge * update changelog * fix package resolved in spm example
1 parent 149f65e commit a93defc

File tree

21 files changed

+427
-222
lines changed

21 files changed

+427
-222
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,4 @@ Example/Pods
6969
Podfile.lock
7070
.DS_Store
7171
.bundle/
72+
*.back

.swift-version

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

CHANGELOG.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
## 7.0.0 Refactoring
1+
## 7.1.0 SPM support and new plagins
22
### Added
3-
- `Animator` protocol to isolate deprecated `begin/end updates`
4-
- `PluginAction` protocol to handle simple actions with collection events
5-
- `FeaturePlugin` protocol to extend collection manager with features quickly
6-
- `CollectionBuilder` struct to build `CollectionManager`
7-
- `TableBuilder` struct to build `TableManager`
8-
- `rddm` namespace to quick access to manager builders
3+
- Swift Package Manager support with example
4+
- example of usage `CompositionalLayout`
5+
- example of usage `DifferenceKit`
6+
- `DiffableTableDataSource` implementing `UICollectionTableDataSource`
7+
- `DiffableCollectionDataSource` implementing `UICollectionDiffableDataSource`
8+
- `CollectionSwipeActionsConfigurationPlugin` to support `UISwipeActionsConfiguration` in collection with list appearance
9+
- `DragAndDroppable` to support drag'n'drop from iOS 11 in table and collection
910

1011
### Updated
1112

12-
- required `var view: CollectionType!` of `DataDisplayManager` protocol instead of required constructor
13-
- abstract `Delegate` and `DataSource` is properties of `DataDisplayManager`
13+
- code style and linter issues fixes
14+
- documentation and typos
1415

1516
### Deprecated
1617

1718
- `BaseTableDataDisplayManager` class replaced with `ManualTableManager`
18-
- `PaginableBaseTableDataDisplayManager` class will be removed at **7.1.**. Use `TableLastCellIsVisiblePlugin` instead.
19-
- `ExtendableBaseTableDataDisplayManager` class will be removed at **7.1**. Part of `BaseTableManager` now.
19+
- `PaginableBaseTableDataDisplayManager` class will be removed at **8.0.**. Use `TableLastCellIsVisiblePlugin` instead.
20+
- `ExtendableBaseTableDataDisplayManager` class will be removed at **8.0**. Part of `BaseTableManager` now.
2021
- `GravityTableDataDisplayManager` class replaced with `GravityTableManager`
21-
- `FoldingTableDataDisplayManager` class will be removed at **7.1.**. Use `TableFoldablePlugin` instead.
22-
- `GravityFoldingTableDataDisplayManager` class will be removed at **7.1.**. Use composition of `GravityTableManager` and `TableFoldablePlugin`
23-
- `SizableCollectionDataDisplayManager` class will be removed at **7.1.**. Part of `BaseCollectionManager`
22+
- `FoldingTableDataDisplayManager` class will be removed at **8.0.**. Use `TableFoldablePlugin` instead.
23+
- `GravityFoldingTableDataDisplayManager` class will be removed at **8.0.**. Use composition of `GravityTableManager` and `TableFoldablePlugin`
24+
- `SizableCollectionDataDisplayManager` class will be removed at **8.0.**. Part of `BaseCollectionManager`
2425
- `BaseCollectionDataDisplayManager` replaced with `BaseCollectionManager`
25-
- `SelectableItem`, `DisplayableFlow`, `MovableGenerator` and other item protocols will be removed at **7.1.**. Replaced with `{ability}ableItem` for example `SelectableItem`
26+
- `SelectableItem`, `DisplayableFlow`, `MovableGenerator` and other item protocols will be removed at **8.0.**. Replaced with `{ability}ableItem` for example `SelectableItem`

DangerSupport/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DangerSupport/DangerRDDM.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
// This is stub file to edit danger file in xcode

DangerSupport/Dangerfile.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Danger
2+
import Foundation
3+
4+
let danger = Danger()
5+
6+
if danger.github.pullRequest.title.starts(with: "[WIP]") {
7+
danger.fail("WIP means work in progress. In other words author wants merge freeze ❄️")
8+
}
9+
10+
let editedFiles = danger.git.createdFiles + danger.git.modifiedFiles
11+
12+
if editedFiles.contains(where: { fileName in
13+
let fileExtension = URL(fileURLWithPath: fileName).pathExtension
14+
return fileExtension == "yml"
15+
}) {
16+
warn("The .yml file has been modified. Keep `changelog.md` up to date.")
17+
}
18+
19+
var violations = [SwiftLintViolation]()
20+
21+
violations.append(contentsOf: SwiftLint.lint(configFile: ".swiftlint.yml"))
22+
23+
switch violations.count {
24+
case 0:
25+
danger.message("Great! We didn't found any violations in your changes. Congratulations 🎉")
26+
case 1..<20:
27+
danger.warn("Oops! We have found some issues. It's better to fix them to keep code clean ")
28+
default:
29+
danger.fail("Omg. Your code smells bad. Please fix issues above")
30+
}

DangerSupport/Package.resolved

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"object": {
3+
"pins": [
4+
{
5+
"package": "Logger",
6+
"repositoryURL": "https://github.com/shibapm/Logger",
7+
"state": {
8+
"branch": null,
9+
"revision": "53c3ecca5abe8cf46697e33901ee774236d94cce",
10+
"version": "0.2.3"
11+
}
12+
},
13+
{
14+
"package": "OctoKit",
15+
"repositoryURL": "https://github.com/nerdishbynature/octokit.swift",
16+
"state": {
17+
"branch": null,
18+
"revision": "9521cdff919053868ab13cd08a228f7bc1bde2a9",
19+
"version": "0.11.0"
20+
}
21+
},
22+
{
23+
"package": "RequestKit",
24+
"repositoryURL": "https://github.com/nerdishbynature/RequestKit.git",
25+
"state": {
26+
"branch": null,
27+
"revision": "fd5e9e99aada7432170366c9e95967011ce13bad",
28+
"version": "2.4.0"
29+
}
30+
},
31+
{
32+
"package": "danger-swift",
33+
"repositoryURL": "https://github.com/danger/swift.git",
34+
"state": {
35+
"branch": null,
36+
"revision": "1af1f9ef49a858b457c0dd8c87c92c3d493037c6",
37+
"version": "3.10.1"
38+
}
39+
},
40+
{
41+
"package": "Version",
42+
"repositoryURL": "https://github.com/mxcl/Version",
43+
"state": {
44+
"branch": null,
45+
"revision": "200046c93f6d5d78a6d72bfd9c0b27a95e9c0a2b",
46+
"version": "1.2.0"
47+
}
48+
}
49+
]
50+
},
51+
"version": 1
52+
}

DangerSupport/Package.swift

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// swift-tools-version:5.3
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let package = Package(
7+
name: "DangerRDDM",
8+
products: [
9+
// Products define the executables and libraries a package produces, and make them visible to other packages.
10+
.library(
11+
name: "DangerDepsRDDM",
12+
type: .dynamic,
13+
targets: ["DangerDependencies"])
14+
],
15+
dependencies: [
16+
// Dependencies declare other packages that this package depends on.
17+
.package(name: "danger-swift", url: "https://github.com/danger/swift.git", from: "3.3.0")
18+
],
19+
targets: [
20+
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
21+
// Targets can depend on other targets in this package, and on products in packages this package depends on.
22+
.target(
23+
name: "DangerDependencies",
24+
dependencies: [
25+
.product(name: "Danger", package: "danger-swift")
26+
],
27+
path: ".",
28+
exclude: ["Readme.md"],
29+
sources: ["DangerRDDM.swift"]
30+
)
31+
]
32+
)

DangerSupport/Readme.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
We use [danger-swift](https://github.com/danger/swift) to improve our code review.
3+
4+
If you want to edit some danger rules - please read this overview.
5+
6+
- [x] Run `cd DangerSupport`
7+
- [x] Run `swift build`
8+
- [x] Run `swift run danger-swfit edit`
9+
10+
After all yo will get xcode opened.
11+
12+
You have full access to `Danger.DSL` to work with git data.
13+
Also you can use `Foundation` and other standart swift libraries to make some cool custom rules.
14+
15+
- [x] Press enter to finish editing of config file.
16+
- [x] At the end just copy and replace *Dangerfile.swift* to the root of the project.
17+
18+
Next pull request will use new rules.
19+
20+
That is all.

Dangerfile.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Danger
2+
import Foundation
23

34
let danger = Danger()
45

@@ -8,8 +9,11 @@ if danger.github.pullRequest.title.starts(with: "[WIP]") {
89

910
let editedFiles = danger.git.createdFiles + danger.git.modifiedFiles
1011

11-
if editedFiles.contains(where: { $0 == ".yml" }) {
12-
warn("The .yml file has been modified. Dependency changes must be consistent.")
12+
if editedFiles.contains(where: { fileName in
13+
let fileExtension = URL(fileURLWithPath: fileName).pathExtension
14+
return fileExtension == "yml"
15+
}) {
16+
warn("The .yml file has been modified. Keep `changelog.md` up to date.")
1317
}
1418

1519
var violations = [SwiftLintViolation]()

Documentation/MigrationGuide.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# 7.0.0 MigrationGuide
1+
# 7.x.x MigrationGuide
22

33
## Deprecations
44

55
### Item protocols
66

7-
`SelectableItem`, `DisplayableFlow`, `MovableGenerator` had a similar idea but not unified format. Thats why we introduced pattern `{ability}ableItem` and renamed all old protocols. We will remove old protocols in version *7.1.0*.
7+
`SelectableItem`, `DisplayableFlow`, `MovableGenerator` had a similar idea but not unified format. Thats why we introduced pattern `{ability}ableItem` and renamed all old protocols. We will remove old protocols in version *8.0.0*.
88

99
| Old | New |
1010
| ------------------- | ------------------- |
@@ -17,7 +17,7 @@
1717
### Managers
1818

1919
Long-named managers like `BaseTableDataDisplayManager` or `PaginableBaseTableDataDisplayManager` marked as deprecated.
20-
Make attention to this deprecation warnings, because we will remove this managers in version *7.1.0*.
20+
Make attention to this deprecation warnings, because we will remove this managers in version *8.0.0*.
2121

2222
If you have inherite from `BaseTableDataDisplayManager` or other deprecated managers
2323

Documentation/ReleaseGuide.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Release guide
2+
3+
This document contains steps needed for preparing release of new version of library.
4+
5+
## Check stability of develop branch
6+
7+
- [x] Framework is building without any errors
8+
- [x] Example project for pods version is building without any errors
9+
- [x] Example project for swift package manager version is building without any errors
10+
- [x] Branch is not contain any unfinished work like: partially implemented plugins or not tested platform support
11+
12+
## Update versions
13+
14+
- [x] Run command `make versionUpdate value={version number}` in terminal
15+
- [x] Update Changelog.md
16+
17+
This will update versions in `project.yml` files
18+
19+
## Lint library
20+
21+
- [x] Run command `make lintLib` in terminal
22+
23+
This will check that library is ready for delievering through cocoapods.
24+
25+
If this command found some **errors** than you must **resolve** them.
26+
27+
## Publish library
28+
29+
- [x] Merge version updates to branch `develop`
30+
- [x] Merge `develop` to `master`
31+
- [x] Create tag with version number from previous step
32+
- [x] Create release on Github with copy of changes from changelog.md
33+
- [x] Run command `make publishLib` in terminal to publish in cocoapods
34+
35+
At last step you should have authorized access to push new version.
36+
Request the confirmation from project owner.

Documentation/Roadmap/ROADMAP.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
1-
# Дорожная карта для 7.1
1+
# Дорожная карта для 7.2
22

33
## Цели
44

55
### Доделать
66

7-
- Поддержать использование DiffKit-а и DiffableDataSource
87
- Покрыть тестами всю логику
98

109
### Поддержать
1110

12-
- Рассказать студии. Поделиться планами
13-
- Внедрять на новые проекты
1411
- Создать канал для реакции на баги и консультацию по использованию
1512
- Написать цикл публичных статей
1613
- Поддерживать документацию
1714

1815
### Расширить
1916

20-
- Написать новые плагины или подтянуть с проектов
2117
- Сделать спеку с типовыми ячейками
2218

2319
### Улучшить

0 commit comments

Comments
 (0)