Skip to content

Commit da2c438

Browse files
KKirstenPrzemyslaw-Wosko
authored andcommitted
Migrate from Crayon to Chalk since project was renamed
1 parent 668b0d0 commit da2c438

File tree

10 files changed

+43
-46
lines changed

10 files changed

+43
-46
lines changed

Package.resolved

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

Package.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let package = Package(
1414
dependencies: [
1515
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"),
1616
.package(url: "https://github.com/tuist/xcodeproj.git", from: "7.1.0"),
17-
.package(url: "https://github.com/jianstm/Crayon", from: "0.0.3"),
17+
.package(url: "https://github.com/luoxiu/Chalk", from: "0.0.4"),
1818
.package(url: "https://github.com/kylef/Commander", from: "0.8.0"),
1919
.package(url: "https://github.com/kylef/PathKit", from: "1.0.0"),
2020
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"),
@@ -34,7 +34,7 @@ let package = Package(
3434
name: "SwiftyMockyCLICore",
3535
dependencies: [
3636
"ShellOut",
37-
"Crayon",
37+
"Chalk",
3838
"XcodeProj",
3939
"PathKit",
4040
"Yams",
@@ -57,7 +57,7 @@ let package = Package(
5757
],
5858
dependencies: [
5959
.package(url: "https://github.com/JohnSundell/ShellOut.git", from: "2.0.0"),
60-
.package(url: "https://github.com/jianstm/Crayon", from: "0.0.3"),
60+
.package(url: "https://github.com/luoxiu/Chalk", from: "0.0.4"),
6161
.package(url: "https://github.com/kylef/Commander", from: "0.8.0"),
6262
.package(url: "https://github.com/kylef/PathKit", from: "1.0.0"),
6363
.package(url: "https://github.com/jpsim/Yams.git", from: "2.0.0"),
@@ -76,7 +76,7 @@ let package = Package(
7676
name: "SwiftyMockyCLICore",
7777
dependencies: [
7878
"ShellOut",
79-
"Crayon",
79+
"Chalk",
8080
"PathKit",
8181
"Yams",
8282
],

Sources/SwiftyMockyCLICore/Commands/GenerationController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import ShellOut
33
import PathKit
44
import Commander
55
import Yams
6-
import Crayon
76

87
public protocol GenerationCommand: AutoMockable {
98

Sources/SwiftyMockyCLICore/Commands/MacOS/MigrationController.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import Yams
33
import PathKit
44
import Commander
55
import XcodeProj
6-
import Crayon
76

87
// MARK: - Migration
98

Sources/SwiftyMockyCLICore/Commands/MacOS/ProjectSetupController.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Yams
33
import PathKit
44
import Commander
55
import XcodeProj
6-
import Crayon
6+
import Chalk
77

88
// MARK: - Project Setup
99

@@ -47,7 +47,7 @@ public class ProjectSetupController {
4747
.forEach {
4848
let exists = $1.mockName != nil
4949
let prefix = "\(exists ? "":"☑️ ") \($0 + 1))"
50-
let infix = "\(crayon.bold.on($1.name))"
50+
let infix = "\(ck.bold.on($1.name))"
5151
let suffix = exists ? " - already defined in \'\($1.mockName!)\'" : ""
5252
Message.just("\(prefix) \(infix) \(suffix)")
5353
}
@@ -119,19 +119,19 @@ public class ProjectSetupController {
119119
Message.actionHeader("\(target.name) - adding Mock configuration...")
120120
}
121121

122-
Message.infoPoint("Targets set to: \(crayon.bold.on(target.name))")
122+
Message.infoPoint("Targets set to: \(ck.bold.on(target.name))")
123123

124124
let output = "./" + defaultOutput(for: target).string
125-
Message.infoPoint("Default output set to: \(crayon.bold.on(output))")
125+
Message.infoPoint("Default output set to: \(ck.bold.on(output))")
126126

127127
let sources = "./" + defaultSources(for: target).string
128-
Message.infoPoint("Default sources directory: \(crayon.bold.on(sources))")
128+
Message.infoPoint("Default sources directory: \(ck.bold.on(sources))")
129129

130130
let testable = defaultTestable(for: target)
131-
Message.infoPoint("Default testable module: \(crayon.bold.on(testable.joined(separator: ",")))")
131+
Message.infoPoint("Default testable module: \(ck.bold.on(testable.joined(separator: ",")))")
132132

133133
let imports = defaultImports(for: target)
134-
Message.infoPoint("Default testable module: \(crayon.bold.on(imports.joined(separator: ",")))")
134+
Message.infoPoint("Default testable module: \(ck.bold.on(imports.joined(separator: ",")))")
135135

136136
guard force || !mockfile.isSetup(target: target) else {
137137
throw MockyError.overrideWarning

Sources/SwiftyMockyCLICore/InteractiveOptions/AddingOption.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import Crayon
2+
import Chalk
33

44
// MARK: - Setup policy
55

@@ -32,9 +32,9 @@ enum AddingOption: RawRepresentable, SelectableOption {
3232
var title: String {
3333
switch self {
3434
case .only(let value):
35-
return crayon.underline.on("\(value)") + ""
35+
return ck.underline.on("\(value)") + ""
3636
default:
37-
return crayon.underline.on("\(rawValue.first!)".uppercased()) + "\(rawValue.dropFirst())"
37+
return ck.underline.on("\(rawValue.first!)".uppercased()) + "\(rawValue.dropFirst())"
3838
}
3939
}
4040

Sources/SwiftyMockyCLICore/InteractiveOptions/Booloption.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import Crayon
2+
import Chalk
33

44
public enum BoolOption: RawRepresentable, SelectableOption {
55
public typealias RawValue = String
@@ -14,7 +14,7 @@ public enum BoolOption: RawRepresentable, SelectableOption {
1414
}
1515
}
1616
public var title: String {
17-
return crayon.underline.on("\(rawValue.first!)".uppercased()) + "\(rawValue.dropFirst())"
17+
return ck.underline.on("\(rawValue.first!)".uppercased()) + "\(rawValue.dropFirst())"
1818
}
1919

2020
public init?(rawValue: String) {

Sources/SwiftyMockyCLICore/InteractiveOptions/ProjectOption.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import Crayon
2+
import Chalk
33
import PathKit
44

55
public struct ProjectPathOption: RawRepresentable, SelectableOption {
@@ -10,7 +10,7 @@ public struct ProjectPathOption: RawRepresentable, SelectableOption {
1010
public var rawValue: String
1111
public var title: String {
1212
if rawValue == ProjectPathOption.projects.first?.string {
13-
let formatted = crayon.underline.on("\(Path(rawValue).lastComponentWithoutExtension)")
13+
let formatted = ck.underline.on("\(Path(rawValue).lastComponentWithoutExtension)")
1414
return "\(formatted)"
1515
}
1616
return Path(rawValue).lastComponentWithoutExtension

Sources/SwiftyMockyCLICore/InteractiveOptions/SelectableOption.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import Foundation
2-
import Crayon
32

43
public protocol SelectableOption: RawRepresentable {
54
var title: String { get }

Sources/SwiftyMockyCLICore/Utils/Message.swift

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Foundation
2-
import Crayon
2+
import Chalk
33

44
public enum Message {
55
public static var indentString = " "
@@ -40,45 +40,45 @@ public enum Message {
4040
public static func header(_ message: String) {
4141
empty()
4242
count += 1
43-
let styled = crayon.bold.on("\(count). \(message)")
43+
let styled = ck.bold.on("\(count). \(message)")
4444
just("\(styled)")
4545
}
4646

4747
public static func subheader(_ message: String) {
48-
let styled = crayon.bold.on(message)
48+
let styled = ck.bold.on(message)
4949
just("\(styled)")
5050
}
5151

5252
public static func actionHeader(_ message: String) {
53-
let styled = crayon.bold.bg(.darkGreen).whiteBright.on(message)
53+
let styled = ck.bold.bg(.darkGreen).whiteBright.on(message)
5454
just("\(styled)")
5555
}
5656

5757
public static func infoPoint(_ message: String) {
58-
let styled = crayon.bold.on(" -> \(message)")
58+
let styled = ck.bold.on(" -> \(message)")
5959
just("\(styled)")
6060
}
6161

6262
public static func success(_ message: String) {
63-
just("\(crayon.greenBright.on(message))")
63+
just("\(ck.greenBright.on(message))")
6464
}
6565

6666
public static func ok(_ message: String) {
67-
let styled = crayon.greenBright.on(" + \(message)")
67+
let styled = ck.greenBright.on(" + \(message)")
6868
just("\(styled)")
6969
}
7070

7171
public static func nok(_ message: String) {
72-
let styled = crayon.red.on(" - \(message)")
72+
let styled = ck.red.on(" - \(message)")
7373
just("\(styled)")
7474
}
7575

7676
public static func failure(_ message: String) {
77-
just("\(crayon.bold.red.on(message))")
77+
just("\(ck.bold.red.on(message))")
7878
}
7979

8080
public static func warning(_ message: String) {
81-
just("⚠️ \(crayon.bold.yellow.on(message))")
81+
just("⚠️ \(ck.bold.yellow.on(message))")
8282
}
8383

8484
public static func resolutions(_ messages: String..., title: String = "Possible solutions:") {
@@ -87,25 +87,25 @@ public enum Message {
8787

8888
public static func resolutions(array messages: [String], title: String = "Possible solutions:") {
8989
indent()
90-
just("\(crayon.underline.gray.on(title))")
90+
just("\(ck.underline.gray.on(title))")
9191
messages.forEach {
92-
let styled = crayon.gray.on(" - \($0)")
92+
let styled = ck.gray.on(" - \($0)")
9393
just("\(styled)")
9494
}
9595
unindent()
9696
}
9797

9898
public static func hint(_ message: String) {
99-
just("\(crayon.underline.gray.on(message))")
99+
just("\(ck.underline.gray.on(message))")
100100
}
101101

102102
// MARK: - Misc
103103

104104
public static func swiftyMockyLabel(_ message: String) {
105105
let bar = String(repeating: "", count: message.count + 2)
106-
print(crayon.bold.on("\(bar)"))
107-
print(crayon.bold.on("\(message)"))
108-
print(crayon.bold.on("\(bar)"))
106+
print(ck.bold.on("\(bar)"))
107+
print(ck.bold.on("\(message)"))
108+
print(ck.bold.on("\(bar)"))
109109
print("")
110110
}
111111
}

0 commit comments

Comments
 (0)