Skip to content

Commit 900812f

Browse files
authored
Merge pull request #12 from mhayes853/standalone-file
Standalone File
2 parents 6942b0e + 5b88226 commit 900812f

File tree

9 files changed

+270
-309
lines changed

9 files changed

+270
-309
lines changed

Package.resolved

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

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ The library ships with UUID v7 support to popular libraries in the ecosystem, ea
9090
Additionally, `UUIDV7` conforms to `EntityIdentifierConvertible` from AppIntents, which is available without a need to specify a trait when building for Apple platforms.
9191

9292
## Installation
93-
You can add Swift UUIDV7 to an Xcode project by adding it to your project as a package.
93+
### Standalone File
94+
If you do not want to add Swift UUIDV7 as a package dependency, you can copy the contents of [`Sources/UUIDV7/UUIDV7.swift`](./Sources/UUIDV7/UUIDV7.swift) directly into your project as a standalone file.
95+
96+
### Swift Package Manager / Xcode
97+
If you want integrations, package traits, and dependency-managed updates, add Swift UUIDV7 to your project as a package.
9498

9599
> [https://github.com/mhayes853/swift-uuidv7](https://github.com/mhayes853/swift-uuidv7)
96100

Sources/UUIDV7/Internal/Lock.swift

Lines changed: 0 additions & 134 deletions
This file was deleted.

Sources/UUIDV7/Internal/MonotonicityState.swift

Lines changed: 0 additions & 42 deletions
This file was deleted.

Sources/UUIDV7/Internal/RandomUUIDBytesGenerator.swift

Lines changed: 0 additions & 66 deletions
This file was deleted.

Sources/UUIDV7/UUIDBytes.swift

Lines changed: 0 additions & 12 deletions
This file was deleted.

Sources/UUIDV7/UUIDV7+Dependencies.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
/// See ``Dependencies/DependencyValues/uuidv7`` for more information.
8080
public struct UUIDV7Generator: Sendable {
8181
private let uuid: @Sendable () -> UUIDV7
82-
82+
8383
/// Initializes a UUID generator that generates a ``UUIDV7`` from a closure.
8484
///
8585
/// - Parameter uuid: A closure that returns a `UUIDV7` when called.
@@ -155,7 +155,7 @@
155155
public static func incrementing(
156156
from timeIntervalSince1970: @autoclosure @escaping @Sendable () -> TimeInterval
157157
) -> Self {
158-
let count = Lock(UInt32(0))
158+
let count = _UUIDV7Lock(UInt32(0))
159159
return Self {
160160
count.withLock { count in
161161
defer { count += 1 }
@@ -179,7 +179,7 @@
179179
@Dependency(\.uuidv7) var uuidv7
180180
return .v7(uuidv7)
181181
}
182-
182+
183183
/// A generator that returns raw UUIDs generated by a specified ``UUIDV7Generator``.
184184
///
185185
/// - Parameter generator: The generator to use.

0 commit comments

Comments
 (0)