Skip to content

Commit f21daf6

Browse files
Add fields in step (#154)
* add fields for progressing in event * comments in PR
1 parent 752b2f7 commit f21daf6

File tree

8 files changed

+54
-26
lines changed

8 files changed

+54
-26
lines changed

project/Component/NefModels/Events/CleanEvent.swift renamed to project/Component/NefClean/Models/CleanEvent.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum CleanEvent {
24
case cleaningPlayground(String)
35
}

project/Component/NefModels/Events/CompilerEvent.swift renamed to project/Component/NefCompiler/Models/CompilerEvent.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum CompilerEvent {
24
case buildingWorkspace(String)
35
case buildingPlayground(String)

project/Component/NefModels/Events/JekyllEvent.swift renamed to project/Component/NefJekyll/Models/JekyllEvent.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum JekyllEvent {
24
case buildingMainPage(String)
35
case buildingSidebar(String)

project/Component/NefModels/ProgressReport.swift

+7
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ public enum ProgressEventStatus {
3737

3838
public protocol CustomProgressDescription {
3939
var progressDescription: String { get }
40+
var currentStep: UInt { get }
41+
var totalSteps: UInt { get }
42+
}
43+
44+
public extension CustomProgressDescription {
45+
var currentStep: UInt { 1 }
46+
var totalSteps: UInt { 1 }
4047
}
4148

4249
public struct ProgressEvent<A: CustomProgressDescription> {

project/Component/NefModels/Events/PlaygroundEvent.swift renamed to project/Component/NefPlayground/Models/PlaygroundEvent.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum PlaygroundEvent {
24
case downloadingTemplate(String)
35
case resolvingDependencies(String)

project/Component/NefModels/Events/RenderEvent.swift renamed to project/Component/NefRender/Models/RenderEvent.swift

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum RenderEvent {
24
case processingPage(String)
35
case gettingPagesFromPlayground(String)

project/Component/NefModels/Events/PlaygroundBookEvent.swift renamed to project/Component/NefSwiftPlayground/Models/PlaygroundBookEvent.swift

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import NefModels
2+
13
public enum PlaygroundBookEvent {
24
case cleanup
35
case creatingStructure(String)
@@ -21,4 +23,21 @@ extension PlaygroundBookEvent: CustomProgressDescription {
2123
return "Building Swift Playground..."
2224
}
2325
}
26+
27+
public var currentStep: UInt {
28+
switch self {
29+
case .cleanup:
30+
return 1
31+
case .creatingStructure:
32+
return 2
33+
case .downloadingDependencies:
34+
return 3
35+
case .gettingModules:
36+
return 4
37+
case .buildingPlayground:
38+
return 5
39+
}
40+
}
41+
42+
public var totalSteps: UInt { 5 }
2443
}

project/nef.xcodeproj/project.pbxproj

+18-26
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
11C9DFB524332B8300E906E4 /* ProgressReport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFB424332B8300E906E4 /* ProgressReport.swift */; };
1111
11C9DFB9243331DB00E906E4 /* IO+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFB8243331DB00E906E4 /* IO+Extensions.swift */; };
1212
11C9DFBB2433350900E906E4 /* ConsoleReport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFBA2433350900E906E4 /* ConsoleReport.swift */; };
13-
11EDF458243611590092E959 /* CleanEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFB624332F5900E906E4 /* CleanEvent.swift */; };
14-
11EDF4592436117A0092E959 /* CompilerEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFBC243383FB00E906E4 /* CompilerEvent.swift */; };
15-
11EDF45A243611A00092E959 /* JekyllEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFC2243475C700E906E4 /* JekyllEvent.swift */; };
16-
11EDF45B243611BF0092E959 /* RenderEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFBE2433931D00E906E4 /* RenderEvent.swift */; };
17-
11EDF45C243611E30092E959 /* PlaygroundEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFC424347A9F00E906E4 /* PlaygroundEvent.swift */; };
18-
11EDF45D243611F50092E959 /* PlaygroundBookEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11A8D65524347F3E0058A71C /* PlaygroundBookEvent.swift */; };
1913
11EDF4642436342C0092E959 /* Bow in Frameworks */ = {isa = PBXBuildFile; productRef = 11EDF4632436342C0092E959 /* Bow */; };
2014
11EDF4662436342C0092E959 /* BowEffects in Frameworks */ = {isa = PBXBuildFile; productRef = 11EDF4652436342C0092E959 /* BowEffects */; };
2115
11EDF4702437195C0092E959 /* OutcomeReport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11EDF46F2437195C0092E959 /* OutcomeReport.swift */; };
@@ -71,6 +65,12 @@
7165
8B3CB8C122D3963B00919F36 /* NefModels.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B3CB84022D3929B00919F36 /* NefModels.h */; settings = {ATTRIBUTES = (Public, ); }; };
7266
8B3CB8C222D3964000919F36 /* CarbonAPI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB83A22D3929B00919F36 /* CarbonAPI.swift */; };
7367
8B3CB8C822D3987500919F36 /* CoreCarbon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B3CB8C722D3987500919F36 /* CoreCarbon.swift */; };
68+
8B433224243C991800EB3C7E /* PlaygroundBookEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11A8D65524347F3E0058A71C /* PlaygroundBookEvent.swift */; };
69+
8B433225243C992000EB3C7E /* CleanEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFB624332F5900E906E4 /* CleanEvent.swift */; };
70+
8B433226243C992D00EB3C7E /* CompilerEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFBC243383FB00E906E4 /* CompilerEvent.swift */; };
71+
8B433227243C993200EB3C7E /* JekyllEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFC2243475C700E906E4 /* JekyllEvent.swift */; };
72+
8B433228243C993A00EB3C7E /* PlaygroundEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFC424347A9F00E906E4 /* PlaygroundEvent.swift */; };
73+
8B433229243C994900EB3C7E /* RenderEvent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 11C9DFBE2433931D00E906E4 /* RenderEvent.swift */; };
7474
8B43934323F4069C00177B88 /* NefCompilerSystem.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B0286DB23E078D10033ECBA /* NefCompilerSystem.swift */; };
7575
8B444F1823FED31400975C8C /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8B444F1723FED31400975C8C /* main.swift */; };
7676
8B444F2323FED5AC00975C8C /* _Playground.h in Headers */ = {isa = PBXBuildFile; fileRef = 8B444F2123FED5AB00975C8C /* _Playground.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -662,19 +662,6 @@
662662
/* End PBXFrameworksBuildPhase section */
663663

664664
/* Begin PBXGroup section */
665-
11EDF4572436112D0092E959 /* Events */ = {
666-
isa = PBXGroup;
667-
children = (
668-
11C9DFB624332F5900E906E4 /* CleanEvent.swift */,
669-
11C9DFBC243383FB00E906E4 /* CompilerEvent.swift */,
670-
11C9DFC2243475C700E906E4 /* JekyllEvent.swift */,
671-
11A8D65524347F3E0058A71C /* PlaygroundBookEvent.swift */,
672-
11C9DFC424347A9F00E906E4 /* PlaygroundEvent.swift */,
673-
11C9DFBE2433931D00E906E4 /* RenderEvent.swift */,
674-
);
675-
path = Events;
676-
sourceTree = "<group>";
677-
};
678665
8B0286E223E079650033ECBA /* Compiler */ = {
679666
isa = PBXGroup;
680667
children = (
@@ -817,7 +804,6 @@
817804
8B3CB83E22D3929B00919F36 /* NefModels */ = {
818805
isa = PBXGroup;
819806
children = (
820-
11EDF4572436112D0092E959 /* Events */,
821807
8B3CB84222D3929B00919F36 /* CarbonModel.swift */,
822808
8B7E807A23DA1CCB00D4F6BD /* CarbonView.swift */,
823809
8BD6977923F6E9F6000A512F /* PlaygroundDependencies.swift */,
@@ -1109,6 +1095,7 @@
11091095
8B5812532403D71900587211 /* Models */ = {
11101096
isa = PBXGroup;
11111097
children = (
1098+
11C9DFB624332F5900E906E4 /* CleanEvent.swift */,
11121099
8B5812542403D73100587211 /* CleanEnvironment.swift */,
11131100
);
11141101
path = Models;
@@ -1249,6 +1236,7 @@
12491236
8BA1EF4E23D62BF200B33CD0 /* Models */ = {
12501237
isa = PBXGroup;
12511238
children = (
1239+
11C9DFBE2433931D00E906E4 /* RenderEvent.swift */,
12521240
8BA1EF4F23D62BF200B33CD0 /* RenderEnvironment.swift */,
12531241
);
12541242
path = Models;
@@ -1351,6 +1339,7 @@
13511339
8BD4E33523881F88002DECDB /* Models */ = {
13521340
isa = PBXGroup;
13531341
children = (
1342+
11A8D65524347F3E0058A71C /* PlaygroundBookEvent.swift */,
13541343
8B46C409238D689800437659 /* Module.swift */,
13551344
8B46C40C238D71C900437659 /* Package.swift */,
13561345
8B46C41A238D8A0000437659 /* PlaygroundBookResolutionPath.swift */,
@@ -1386,6 +1375,7 @@
13861375
8BD6727323DF243300631D62 /* Models */ = {
13871376
isa = PBXGroup;
13881377
children = (
1378+
11C9DFBC243383FB00E906E4 /* CompilerEvent.swift */,
13891379
8B02870023E1D4640033ECBA /* CompilerSystemEnvironment.swift */,
13901380
8BD6727423DF244E00631D62 /* RenderCompilerEnvironment.swift */,
13911381
);
@@ -1450,6 +1440,7 @@
14501440
8BD6978923FAAA55000A512F /* Models */ = {
14511441
isa = PBXGroup;
14521442
children = (
1443+
11C9DFC424347A9F00E906E4 /* PlaygroundEvent.swift */,
14531444
8BD6978A23FAAA63000A512F /* PlaygroundEnvironment.swift */,
14541445
);
14551446
path = Models;
@@ -1476,6 +1467,7 @@
14761467
8BE9D5C623D0856600332D75 /* Models */ = {
14771468
isa = PBXGroup;
14781469
children = (
1470+
11C9DFC2243475C700E906E4 /* JekyllEvent.swift */,
14791471
8BE9D5C723D0857200332D75 /* RenderJekyllEnvironment.swift */,
14801472
);
14811473
path = Models;
@@ -2263,6 +2255,7 @@
22632255
files = (
22642256
8BE9D5C923D0857600332D75 /* RenderJekyllEnvironment.swift in Sources */,
22652257
8B12D7A422D6238300D05A70 /* NefJekyll.swift in Sources */,
2258+
8B433227243C993200EB3C7E /* JekyllEvent.swift in Sources */,
22662259
);
22672260
runOnlyForDeploymentPostprocessing = 0;
22682261
};
@@ -2310,15 +2303,9 @@
23102303
8B46C422238EBD9300437659 /* PlaygroundExcludeItem.swift in Sources */,
23112304
8BD697A223FC48D8000A512F /* PlaygroundPlatform.swift in Sources */,
23122305
11C9DFB524332B8300E906E4 /* ProgressReport.swift in Sources */,
2313-
11EDF4592436117A0092E959 /* CompilerEvent.swift in Sources */,
2314-
11EDF45B243611BF0092E959 /* RenderEvent.swift in Sources */,
23152306
8B3CB8C022D3963B00919F36 /* CarbonModel.swift in Sources */,
2316-
11EDF45D243611F50092E959 /* PlaygroundBookEvent.swift in Sources */,
23172307
8BD6978823FAA902000A512F /* PlaygroundDependencies.swift in Sources */,
2318-
11EDF458243611590092E959 /* CleanEvent.swift in Sources */,
2319-
11EDF45C243611E30092E959 /* PlaygroundEvent.swift in Sources */,
23202308
8B7E807C23DA1CCF00D4F6BD /* CarbonView.swift in Sources */,
2321-
11EDF45A243611A00092E959 /* JekyllEvent.swift in Sources */,
23222309
);
23232310
runOnlyForDeploymentPostprocessing = 0;
23242311
};
@@ -2328,6 +2315,7 @@
23282315
files = (
23292316
8B51C7A123CCC9CD003EE485 /* Render.swift in Sources */,
23302317
8BA1EF5823D62BFA00B33CD0 /* RenderEnvironment.swift in Sources */,
2318+
8B433229243C994900EB3C7E /* RenderEvent.swift in Sources */,
23312319
8BA1EF5623D62BFA00B33CD0 /* MarkdownError.swift in Sources */,
23322320
);
23332321
runOnlyForDeploymentPostprocessing = 0;
@@ -2345,6 +2333,7 @@
23452333
isa = PBXSourcesBuildPhase;
23462334
buildActionMask = 2147483647;
23472335
files = (
2336+
8B433225243C992000EB3C7E /* CleanEvent.swift in Sources */,
23482337
8B5812652403D8BE00587211 /* CleanError.swift in Sources */,
23492338
8B5812562403D73700587211 /* CleanEnvironment.swift in Sources */,
23502339
8B5812572403D73700587211 /* Clean.swift in Sources */,
@@ -2446,6 +2435,7 @@
24462435
isa = PBXSourcesBuildPhase;
24472436
buildActionMask = 2147483647;
24482437
files = (
2438+
8B433224243C991800EB3C7E /* PlaygroundBookEvent.swift in Sources */,
24492439
8B46C417238D889700437659 /* PlaygroundBook.swift in Sources */,
24502440
8BD6F707238C268E00DD93C4 /* PlaygroundEnvironment.swift in Sources */,
24512441
8B46C412238D87F200437659 /* Assets.swift in Sources */,
@@ -2471,6 +2461,7 @@
24712461
8BD6727623DF245300631D62 /* RenderCompilerEnvironment.swift in Sources */,
24722462
8BD6727223DF0AAE00631D62 /* NefCompiler.swift in Sources */,
24732463
8B43934323F4069C00177B88 /* NefCompilerSystem.swift in Sources */,
2464+
8B433226243C992D00EB3C7E /* CompilerEvent.swift in Sources */,
24742465
8B02870223E1D4670033ECBA /* CompilerSystemEnvironment.swift in Sources */,
24752466
8BD6727C23DF381D00631D62 /* CompilerSystemError.swift in Sources */,
24762467
8BD6727A23DF249900631D62 /* CompilerSystem.swift in Sources */,
@@ -2494,6 +2485,7 @@
24942485
8BD6978B23FAAA63000A512F /* PlaygroundEnvironment.swift in Sources */,
24952486
8BD6978123FAA7DE000A512F /* Playground.swift in Sources */,
24962487
8BD6978423FAA84F000A512F /* PlaygroundError.swift in Sources */,
2488+
8B433228243C993A00EB3C7E /* PlaygroundEvent.swift in Sources */,
24972489
);
24982490
runOnlyForDeploymentPostprocessing = 0;
24992491
};

0 commit comments

Comments
 (0)