Permalink
Browse files

🚧 A bunch of in-progress changes

  • Loading branch information...
1 parent 6888898 commit 54ef2efa234dcab6cb8998b2a2d525a72a92b359 @andreyvit andreyvit committed Jul 2, 2016
Showing with 654 additions and 66 deletions.
  1. +4 βˆ’0 LRAbstractModel/.gitignore
  2. +5 βˆ’0 LRAbstractModel/Package.swift
  3. +5 βˆ’0 LRAbstractModel/Sources/LRAbstractModel.swift
  4. +4 βˆ’0 LRPresentation/.gitignore
  5. +9 βˆ’0 LRPresentation/Package.swift
  6. +4 βˆ’0 LRPresentation/Sources/LRPresentation.swift
  7. +4 βˆ’0 LRPresentationModel/.gitignore
  8. +5 βˆ’0 LRPresentationModel/Package.swift
  9. +52 βˆ’0 LRPresentationModel/Sources/AProject.swift
  10. +25 βˆ’0 LRPresentationModel/Sources/Aspect.swift
  11. +21 βˆ’0 LRPresentationModel/Sources/ChangeBus.swift
  12. +15 βˆ’0 LRPresentationModel/Sources/Dispatcher.swift
  13. +36 βˆ’0 LRPresentationModel/Sources/Identity.swift
  14. +25 βˆ’0 LRPresentationModel/Sources/ObjectId.swift
  15. +5 βˆ’0 LRPresentationModel/Sources/Project.swift
  16. +23 βˆ’0 LRPresentationModel/Sources/Tag.swift
  17. +81 βˆ’0 LRPresentationModel/Sources/TreeItems.swift
  18. +9 βˆ’1 LRProjectKit/LRProjectKit.xcodeproj/project.pbxproj
  19. +8 βˆ’1 LRProjectKit/Source/Project.swift
  20. +20 βˆ’0 LRProjectKit/Source/ProjectList.swift
  21. +4 βˆ’0 LRProjectKit/Source/Workspace.swift
  22. +31 βˆ’13 LiveReload/LiveReload.xcodeproj/project.pbxproj
  23. +2 βˆ’0 LiveReload/Source/Application/App.swift
  24. +1 βˆ’0 LiveReload/Source/Application/AppDelegate.swift
  25. +6 βˆ’2 LiveReload/Source/Presentation/MainWindowController.swift
  26. +84 βˆ’0 LiveReload/Source/Presentation/TreePane/TreeItems.swift
  27. +7 βˆ’15 LiveReload/Source/Presentation/{ β†’ TreePane}/TreePaneViewController.swift
  28. +71 βˆ’0 LiveReload/Source/ViewModel/SpecificTreeItems.swift
  29. +0 βˆ’34 LiveReload/Source/ViewModel/TreeItems.swift
  30. +4 βˆ’0 Uniflow/.gitignore
  31. +5 βˆ’0 Uniflow/Package.swift
  32. +7 βˆ’0 Uniflow/Sources/Diff.swift
  33. +5 βˆ’0 Uniflow/Sources/Identifiable.swift
  34. +33 βˆ’0 Uniflow/Sources/Identity.swift
  35. +23 βˆ’0 Uniflow/Sources/Tag.swift
  36. +11 βˆ’0 Uniflow/Sources/Updatable.swift
@@ -0,0 +1,4 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
@@ -0,0 +1,5 @@
+import PackageDescription
+
+let package = Package(
+ name: "LRAbstractModel"
+)
@@ -0,0 +1,5 @@
+import Foundation
+
+struct LRAbstractModel {
+ var text = "Hello, World!" as NSString
+}
@@ -0,0 +1,4 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
@@ -0,0 +1,9 @@
+import PackageDescription
+
+let package = Package(
+ name: "LRPresentation"
+
+ // dependencies: [
+ // .Package(url: "../LRPresentationModel", majorVersion: 1)
+ // ]
+)
@@ -0,0 +1,4 @@
+struct LRPresentation {
+
+ var text = "Hello, World!"
+}
@@ -0,0 +1,4 @@
+.DS_Store
+/.build
+/Packages
+/*.xcodeproj
@@ -0,0 +1,5 @@
+import PackageDescription
+
+let package = Package(
+ name: "LRPresentationModel"
+)
@@ -0,0 +1,52 @@
+import Foundation
+
+public protocol UniqueIdentifiable {
+
+ var uniqueIdentifier: String { get }
+
+}
+
+public struct VFolder: UniqueObject {
+
+ public let uniqueIdentifier: String
+
+ public var displayName: String
+
+ public var subfolders: [VFolder] = []
+
+ public var rules: [ARule] = []
+
+ public init(uniqueIdentifier: String, displayName: String) {
+ self.uniqueIdentifier = uniqueIdentifier
+ self.displayName = displayName
+ }
+
+}
+
+public struct VRule: class, UniqueObject {
+
+ var isTogglable: Bool { get }
+
+ var dispayName: String { get }
+
+}
+
+public protocol AOption: class {
+}
+
+public struct VFolder: UniqueObject {
+
+ public let uniqueIdentifier: String
+
+ public var displayName: String
+
+ public var subfolders: [VFolder] = []
+
+ public var rules: [ARule] = []
+
+ public init(uniqueIdentifier: String, displayName: String) {
+ self.uniqueIdentifier = uniqueIdentifier
+ self.displayName = displayName
+ }
+
+}
@@ -0,0 +1,25 @@
+import Foundation
+
+public class Aspect {
+
+ public let tag: Tag
+ public let name: String
+
+ public init(_ tag: Tag, _ name: String) {
+ self.tag = tag
+ self.name = name
+ }
+
+}
+
+extension Aspect: Hashable {
+
+ public var hashValue: Int {
+ return tag.hashValue ^ name.hashValue
+ }
+
+}
+
+public func ==(lhs: Aspect, rhs: Aspect) -> Bool {
+ return (lhs.tag == rhs.tag) && (lhs.name == rhs.name)
+}
@@ -0,0 +1,21 @@
+import Foundation
+
+public class ChangeBus {
+
+ func post(tag: Tag, id: ObjectId) {
+
+ }
+
+ func subscribe(identity: Identity) -> Subscription {
+ return Subscription()
+ }
+
+}
+
+public class FlatNamespace {
+
+}
+
+public class TreeNamespace<N> {
+
+}
@@ -0,0 +1,15 @@
+import Foundation
+
+public protocol Dispatcher: class {
+
+ public func execute(operation: Operation)
+
+}
+
+public protocol Operation: class {
+
+ public func execute() {
+
+ }
+
+}
@@ -0,0 +1,36 @@
+import Foundation
+
+// immutable & unique
+public protocol Identity: class {
+
+// var tags: [Tag] { get }
+
+}
+
+public extension Identity {
+
+ public var hashValue: Int {
+ return ObjectIdentifier(self).hashValue
+ }
+
+}
+
+public func ==(lhs: Identity, rhs: Identity) -> Bool {
+ return lhs === rhs
+}
+
+public class SimpleIdentity: Identity {
+
+ public let tags: [Tag]
+
+ public init(tags: [Tag]) {
+ self.tags = tags
+ }
+
+}
+
+public protocol Identifiable {
+
+ var identity: Identity { get }
+
+}
@@ -0,0 +1,25 @@
+import Foundation
+
+public struct ObjectId {
+
+ public let key: String
+
+ public init(_ key: String) {
+ self.key = key
+ }
+
+ public convenience init() {
+ self.init(NSUUID().UUIDString)
+ }
+
+}
+
+extension ObjectId: Hashable {
+ public var hashValue: Int {
+ return key.hashValue
+ }
+}
+
+public func ==(lhs: ObjectId, rhs: ObjectId) -> Bool {
+ return (lhs.key == rhs.key)
+}
@@ -0,0 +1,5 @@
+import Foundation
+
+public protocol AProject {
+
+}
@@ -0,0 +1,23 @@
+import Foundation
+
+public class Tag {
+
+ public static let root = Tag("<root>")
+
+ public let name: String
+
+ public init(_ name: String) {
+ self.name = name
+ }
+
+}
+
+extension Tag: Hashable {
+ public var hashValue: Int {
+ return name.hashValue
+ }
+}
+
+public func ==(lhs: Tag, rhs: Tag) -> Bool {
+ return (lhs.name == rhs.name)
+}
@@ -0,0 +1,81 @@
+import Cocoa
+import LRProjectKit
+
+public protocol TreeItem: class {
+
+ var hasChildren: Bool { get }
+
+ var children: [TreeItem] { get }
+
+ var isExpandable: Bool { get }
+
+ var isSelectable: Bool { get }
+
+ var isGroupItem: Bool { get }
+
+}
+
+extension TreeItem {
+
+ public var hasChildren: Bool {
+ return !children.isEmpty
+ }
+
+ public var isExpandable: Bool {
+ return hasChildren
+ }
+
+ public var isSelectable: Bool {
+ return true
+ }
+
+ public var isGroupItem: Bool {
+ return false
+ }
+
+}
+
+public class RootTreeItem: TreeItem {
+
+ public let projectsHeader = ProjectsHeaderTreeItem()
+
+ public var children: [TreeItem] {
+ return [projectsHeader]
+ }
+
+}
+
+public class ProjectsHeaderTreeItem: TreeItem {
+
+ public var projectItems: [ProjectTreeItem] = [
+ ProjectTreeItem(project: Project(rootURL: NSURL.fileURLWithPath("/Users/andreyvit/dev"))),
+ ProjectTreeItem(project: Project(rootURL: NSURL.fileURLWithPath("/Users/andreyvit/Sites"))),
+ ]
+
+ public var children: [TreeItem] {
+ return projectItems.map { $0 as TreeItem }
+ }
+
+ public var isGroupItem: Bool {
+ return true
+ }
+
+}
+
+public class ProjectTreeItem: TreeItem {
+
+ public let project: Project
+
+ public init(project: Project) {
+ self.project = project
+ }
+
+ public var hasChildren: Bool {
+ return false
+ }
+
+ public var children: [TreeItem] {
+ return []
+ }
+
+}
@@ -22,6 +22,8 @@
431CCDC81BD8374300FA3E7D /* Plugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43994D6D1BD37730003D034E /* Plugin.swift */; };
435916861BDA177C00708C73 /* PromiseKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 435916841BDA177100708C73 /* PromiseKit.framework */; };
435916A71BDA20F300708C73 /* PluginTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 435916A61BDA20F300708C73 /* PluginTests.swift */; };
+ 43635BA51D0BF68C0036EF0F /* Uniflow.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43635BA41D0BF68C0036EF0F /* Uniflow.framework */; };
+ 43635BA71D0BFA5F0036EF0F /* ProjectList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 43635BA61D0BFA5F0036EF0F /* ProjectList.swift */; };
438DF5BE1CC0E1CC0019154B /* StorageKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438DF5BD1CC0E1CC0019154B /* StorageKit.swift */; };
438DF5C01CC0E3170019154B /* TimeGuard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438DF5BF1CC0E3170019154B /* TimeGuard.swift */; };
438F86AC1BEC3F8B00B91940 /* TestHelpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 438F86AA1BEC3F6900B91940 /* TestHelpers.swift */; };
@@ -61,9 +63,11 @@
43101EB31BE14FE500DB3ED3 /* Processor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Processor.swift; sourceTree = "<group>"; };
43101EB51BE1500000DB3ED3 /* Group.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Group.swift; sourceTree = "<group>"; };
43101EB71BE150BB00DB3ED3 /* StdUpdateReason.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StdUpdateReason.swift; sourceTree = "<group>"; };
- 435916841BDA177100708C73 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = PromiseKit.framework; path = "../../../../Library/Developer/Xcode/DerivedData/LiveReload-hkzvlfkmaipqkuafsrljbdycmyql/Build/Products/Debug/PromiseKit.framework"; sourceTree = "<group>"; };
+ 435916841BDA177100708C73 /* PromiseKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = PromiseKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
435916A61BDA20F300708C73 /* PluginTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PluginTests.swift; sourceTree = "<group>"; };
435916A81BDA214000708C73 /* TestFixtures */ = {isa = PBXFileReference; lastKnownFileType = folder; path = TestFixtures; sourceTree = "<group>"; };
+ 43635BA41D0BF68C0036EF0F /* Uniflow.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Uniflow.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 43635BA61D0BFA5F0036EF0F /* ProjectList.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ProjectList.swift; sourceTree = "<group>"; };
438DF5BD1CC0E1CC0019154B /* StorageKit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StorageKit.swift; sourceTree = "<group>"; };
438DF5BF1CC0E3170019154B /* TimeGuard.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TimeGuard.swift; sourceTree = "<group>"; };
438F86AA1BEC3F6900B91940 /* TestHelpers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TestHelpers.swift; sourceTree = "<group>"; };
@@ -108,6 +112,7 @@
43994D6A1BD35691003D034E /* FSMonitoringKit.framework in Frameworks */,
43994D6B1BD35691003D034E /* LRActionKit.framework in Frameworks */,
43994D6C1BD35691003D034E /* PackageManagerKit.framework in Frameworks */,
+ 43635BA51D0BF68C0036EF0F /* Uniflow.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -160,6 +165,7 @@
isa = PBXGroup;
children = (
43994D541BD35526003D034E /* Workspace.swift */,
+ 43635BA61D0BFA5F0036EF0F /* ProjectList.swift */,
43994D521BD3522F003D034E /* Project.swift */,
43994D561BD35544003D034E /* PluginManager.swift */,
43994D7D1BD50E0F003D034E /* PluginContext.swift */,
@@ -198,6 +204,7 @@
43994D581BD3566A003D034E /* Frameworks */ = {
isa = PBXGroup;
children = (
+ 43635BA41D0BF68C0036EF0F /* Uniflow.framework */,
435916841BDA177100708C73 /* PromiseKit.framework */,
43994D591BD35691003D034E /* ATPathSpec.framework */,
43994D5A1BD35691003D034E /* ATVersionKit.framework */,
@@ -333,6 +340,7 @@
43101EB01BE14FA400DB3ED3 /* Message.swift in Sources */,
438DF5C01CC0E3170019154B /* TimeGuard.swift in Sources */,
43101EAE1BE14F8900DB3ED3 /* Request.swift in Sources */,
+ 43635BA71D0BFA5F0036EF0F /* ProjectList.swift in Sources */,
43101E931BE05DF600DB3ED3 /* OpSite.swift in Sources */,
43101EB21BE14FC800DB3ED3 /* Processable.swift in Sources */,
);
Oops, something went wrong.

0 comments on commit 54ef2ef

Please sign in to comment.