From 0ab40f242c0c20e884f31012004f00afa911ae00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Fri, 28 Nov 2025 17:25:27 +0100 Subject: [PATCH 01/12] Remove Windows SDK from Swift setup in workflow Removed Windows SDK component from setup step. --- .github/workflows/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cebe2280..3549b96d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,6 @@ jobs: steps: - uses: SwiftyLab/setup-swift@latest - with: - visual-studio-components: Microsoft.VisualStudio.Component.Windows11SDK.22621 - uses: actions/checkout@v4 - name: Install Linux dependencies From f47ff5377be19e45ef0d792cbaf428e942aa7a9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Sat, 29 Nov 2025 16:01:23 +0100 Subject: [PATCH 02/12] Update Cadova package version to 0.2.1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c4c2c6e..e1be4e66 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ let package = Package( name: "<#name#>", platforms: [.macOS(.v14)], dependencies: [ - .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.2.0")), + .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.2.1")), ], targets: [ .executableTarget( From 39ce9b07a9d8282a7802e9df59c787944573cfc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Mon, 8 Dec 2025 19:18:21 +0100 Subject: [PATCH 03/12] Update Cadova package version to 0.3.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e1be4e66..c2148feb 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ let package = Package( name: "<#name#>", platforms: [.macOS(.v14)], dependencies: [ - .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.2.1")), + .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.3.0")), ], targets: [ .executableTarget( From 49766088e84d1b0d66c6dc0a8140eca787961ef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Tue, 30 Dec 2025 18:08:31 +0100 Subject: [PATCH 04/12] Update Cadova dependency version to 0.4.0 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c2148feb..2511beef 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ let package = Package( name: "<#name#>", platforms: [.macOS(.v14)], dependencies: [ - .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.3.0")), + .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.4.0")), ], targets: [ .executableTarget( From 8588da86a54eada5f5d790bce4d6228b4aa9da34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Fri, 2 Jan 2026 14:24:05 +0100 Subject: [PATCH 05/12] Enhance README with example and version update Added an example code snippet and updated Cadova version in README. --- README.md | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2511beef..03a94694 100644 --- a/README.md +++ b/README.md @@ -7,12 +7,36 @@ Cadova models are written entirely in Swift, making them easy to version, reuse, Cadova runs on macOS, Windows, and Linux. To get started, read the [Getting Started guide](https://github.com/tomasf/Cadova/wiki/Getting-Started). -More documentation is available in the [Wiki](https://github.com/tomasf/Cadova/wiki). Read [What is Cadova?](https://github.com/tomasf/Cadova/wiki/What-is-Cadova%3F) for an introduction. For code examples, see [Examples](https://github.com/tomasf/Cadova/wiki/Examples). +More documentation is available in the [Wiki](https://github.com/tomasf/Cadova/wiki). Read [What is Cadova?](https://github.com/tomasf/Cadova/wiki/What-is-Cadova%3F) for an introduction. [![Swift](https://github.com/tomasf/Cadova/actions/workflows/main.yml/badge.svg)](https://github.com/tomasf/Cadova/actions/workflows/main.yml) ![Platforms](https://img.shields.io/badge/Platforms-macOS_|_Linux_|_Windows-cc9529?logo=swift&logoColor=white) -## Related Projects +## Example + + +```swift +await Model("Hex key holder") { + let height = 20.0 + let spacing = 8.0 + Stack(.x, spacing: spacing) { + for size in stride(from: 1.5, through: 5.0, by: 0.5) { + RegularPolygon(sideCount: 6, widthAcrossFlats: size) + } + }.measuringBounds { holes, bounds in + Stadium(bounds.size + spacing * 2) + .extruded(height: height) + .subtracting { + holes.aligned(at: .centerX) + .extruded(height: height) + .translated(z: 2) + } + } +} +``` +For more code examples, see [Examples](https://github.com/tomasf/Cadova/wiki/Examples). + +# Related Projects * [Cadova Viewer](https://github.com/tomasf/CadovaViewer) - A native macOS 3MF viewer application * [Helical](https://github.com/tomasf/Helical) - A Cadova library providing customizable threads, screws, bolts, nuts and related parts. @@ -39,7 +63,7 @@ let package = Package( name: "<#name#>", platforms: [.macOS(.v14)], dependencies: [ - .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.4.0")), + .package(url: "https://github.com/tomasf/Cadova.git", .upToNextMinor(from: "0.4.1")), ], targets: [ .executableTarget( From b6f87bec25386eba1544e93ec8a96d5170adb0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Fri, 2 Jan 2026 14:24:29 +0100 Subject: [PATCH 06/12] Adjust image width in example section Updated image width in README example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 03a94694..1b319242 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ More documentation is available in the [Wiki](https://github.com/tomasf/Cadova/w ![Platforms](https://img.shields.io/badge/Platforms-macOS_|_Linux_|_Windows-cc9529?logo=swift&logoColor=white) ## Example - + ```swift await Model("Hex key holder") { From b2562f30da6ce33acd5a71dce5da1de1546404cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Fri, 2 Jan 2026 14:24:52 +0100 Subject: [PATCH 07/12] Update image width in README example Adjusted image width in README example. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1b319242..b0532692 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ More documentation is available in the [Wiki](https://github.com/tomasf/Cadova/w ![Platforms](https://img.shields.io/badge/Platforms-macOS_|_Linux_|_Windows-cc9529?logo=swift&logoColor=white) ## Example - + ```swift await Model("Hex key holder") { From 9cc0bd7017b716e0411565521fa940c68c8e53fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Franz=C3=A9n?= Date: Fri, 2 Jan 2026 15:12:12 +0100 Subject: [PATCH 08/12] Replace freetype-spm with Apus in dependencies Updated the list of dependencies in the README. [no ci] --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index b0532692..d2b3ad51 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,7 @@ For more code examples, see [Examples](https://github.com/tomasf/Cadova/wiki/Exa * [Cadova Viewer](https://github.com/tomasf/CadovaViewer) - A native macOS 3MF viewer application * [Helical](https://github.com/tomasf/Helical) - A Cadova library providing customizable threads, screws, bolts, nuts and related parts. -Cadova uses [Manifold-Swift](https://github.com/tomasf/manifold-swift), [ThreeMF](https://github.com/tomasf/ThreeMF), -[freetype-spm](https://github.com/tomasf/freetype-spm) and [FindFont](https://github.com/tomasf/FindFont). +Cadova uses [Manifold-Swift](https://github.com/tomasf/manifold-swift), [Apus](https://github.com/tomasf/Apus) and [ThreeMF](https://github.com/tomasf/ThreeMF). ## Versioning and Stability From fa0660147c6c8edbbb7a946c90eda10e70f560c7 Mon Sep 17 00:00:00 2001 From: Daniel Kennett Date: Wed, 7 Jan 2026 13:27:53 +0100 Subject: [PATCH 09/12] Initial work on allowing Model to output to Data --- .../Concrete Layer/Build/Model/Model.swift | 85 ++++++++++++++----- .../Build/Project/Project.swift | 2 +- 2 files changed, 63 insertions(+), 24 deletions(-) diff --git a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift index 0771d99f..fc3c3074 100644 --- a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift +++ b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift @@ -17,6 +17,11 @@ import Foundation public struct Model: Sendable { let name: String + public struct InMemoryFile: Sendable { + let pathExtension: String + let contents: Data + } + private let directives: @Sendable () -> [BuildDirective] private let options: ModelOptions @@ -67,7 +72,6 @@ public struct Model: Sendable { /// } /// ``` /// - @discardableResult public init( _ name: String, options: ModelOptions..., @@ -76,21 +80,67 @@ public struct Model: Sendable { self.name = name directives = content self.options = .init(options) + } - if ModelContext.current.isCollectingModels == false { - if let url = await build() { - try? Platform.revealFiles([url]) - } + public func writeToFile( + in directory: URL? = nil, + environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, + context: EvaluationContext? = nil, + interitedOptions: ModelOptions? = nil + ) async -> URL? { + let result = await buildToFile(environment: inheritedEnvironment, context: context ?? .init(), + options: interitedOptions, URL: directory) + if let result { + try? Platform.revealFiles([result]) } + + return result } - internal func build( + public func generateInMemoryFile( environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, - context: EvaluationContext = .init(), - options inheritedOptions: ModelOptions? = nil, + context: EvaluationContext? = nil, + interitedOptions: ModelOptions? = nil + ) async -> InMemoryFile? { + return await buildToData(environment: inheritedEnvironment, context: context ?? .init(), options: interitedOptions) + } + + private func buildToFile( + environment inheritedEnvironment: EnvironmentValues, + context: EvaluationContext, + options inheritedOptions: ModelOptions?, URL directory: URL? = nil ) async -> URL? { logger.info("Generating \"\(name)\"...") + + guard let file = await buildToData(environment: inheritedEnvironment, + context: context, options: inheritedOptions) else { return nil } + + let baseURL: URL + if let parent = directory { + baseURL = parent.appendingPathComponent(name, isDirectory: false) + } else { + baseURL = URL(expandingFilePath: name) + } + + let url = baseURL.appendingPathExtension(file.pathExtension) + let fileExisted = FileManager().fileExists(atPath: url.path(percentEncoded: false)) + + do { + try file.contents.write(to: url) + logger.info("Wrote model to \(url.path)") + } catch { + logger.error("Failed to save model file to \(url.path): \(error.descriptiveString)") + } + + return fileExisted ? nil : url + } + + private func buildToData( + environment inheritedEnvironment: EnvironmentValues, + context: EvaluationContext, + options inheritedOptions: ModelOptions? + ) async -> InMemoryFile? { let directives = inheritedEnvironment.whileCurrent { self.directives() @@ -109,13 +159,6 @@ public struct Model: Sendable { mutatingEnvironment.modelOptions = localOptions let environment = mutatingEnvironment - let baseURL: URL - if let parent = directory { - baseURL = parent.appendingPathComponent(name, isDirectory: false) - } else { - baseURL = URL(expandingFilePath: name) - } - let geometries3D = directives.compactMap(\.geometry3D) let geometries2D = directives.compactMap(\.geometry2D) let provider: OutputDataProvider @@ -146,17 +189,13 @@ public struct Model: Sendable { return nil } - let url = baseURL.appendingPathExtension(provider.fileExtension) - let fileExisted = FileManager().fileExists(atPath: url.path(percentEncoded: false)) - do { - try await provider.writeOutput(to: url, context: context) - logger.info("Wrote model to \(url.path)") + let fileContents: Data = try await provider.generateOutput(context: context) + return InMemoryFile(pathExtension: provider.fileExtension, contents: fileContents) } catch { - logger.error("Failed to save model file to \(url.path): \(error.descriptiveString)") + logger.error("Cadova caught an error while generating \(provider.fileExtension) model \"\(name)\":\nšŸ›‘ \(error)\n") + return nil } - - return fileExisted ? nil : url } private func generateResult( diff --git a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift index 2c2aeae5..393354fa 100644 --- a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift +++ b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift @@ -89,7 +89,7 @@ public func Project( let constantEnvironment = environment let urls = await models.asyncCompactMap { model in - await model.build(environment: constantEnvironment, context: context, options: combinedOptions, URL: url) + await model.writeToFile(in: url, environment: constantEnvironment, context: context, interitedOptions: combinedOptions) } try? Platform.revealFiles(urls) } From c06009aa7292609f134ad08ddd0d4b40b59ec2aa Mon Sep 17 00:00:00 2001 From: Daniel Kennett Date: Wed, 7 Jan 2026 13:49:56 +0100 Subject: [PATCH 10/12] =?UTF-8?q?Don=E2=80=99t=20reveal=20files=20twice=20?= =?UTF-8?q?when=20using=20Project?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Cadova/Concrete Layer/Build/Model/Model.swift | 5 +++-- Sources/Cadova/Concrete Layer/Build/Project/Project.swift | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift index fc3c3074..77220f78 100644 --- a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift +++ b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift @@ -86,11 +86,12 @@ public struct Model: Sendable { in directory: URL? = nil, environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, - interitedOptions: ModelOptions? = nil + interitedOptions: ModelOptions? = nil, + revealInSystemFileBrowser: Bool = true ) async -> URL? { let result = await buildToFile(environment: inheritedEnvironment, context: context ?? .init(), options: interitedOptions, URL: directory) - if let result { + if revealInSystemFileBrowser, let result { try? Platform.revealFiles([result]) } diff --git a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift index 393354fa..1bd0510c 100644 --- a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift +++ b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift @@ -89,7 +89,8 @@ public func Project( let constantEnvironment = environment let urls = await models.asyncCompactMap { model in - await model.writeToFile(in: url, environment: constantEnvironment, context: context, interitedOptions: combinedOptions) + await model.writeToFile(in: url, environment: constantEnvironment, context: context, + interitedOptions: combinedOptions, revealInSystemFileBrowser: false) } try? Platform.revealFiles(urls) } From 916a8eccc3f24bc9ce000da2dbf16320508047b9 Mon Sep 17 00:00:00 2001 From: Daniel Kennett Date: Wed, 14 Jan 2026 15:25:49 +0100 Subject: [PATCH 11/12] Adjust API as discussed, adding writeToFile() and writeToDirectory() --- .../Concrete Layer/Build/Model/Model.swift | 45 ++++++++++++++----- .../Build/Project/Project.swift | 4 +- 2 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift index 77220f78..2f35bbd0 100644 --- a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift +++ b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift @@ -18,7 +18,7 @@ public struct Model: Sendable { let name: String public struct InMemoryFile: Sendable { - let pathExtension: String + let suggestedFileName: String let contents: Data } @@ -75,22 +75,48 @@ public struct Model: Sendable { public init( _ name: String, options: ModelOptions..., + automaticallyWriteToDisk: Bool = true, @ModelContentBuilder content: @Sendable @escaping () -> [BuildDirective] ) async { self.name = name directives = content self.options = .init(options) + + if automaticallyWriteToDisk && ModelContext.current.isCollectingModels == false { + let _ = await writeToDirectory(revealInSystemFileBrowser: true) + } } public func writeToFile( - in directory: URL? = nil, + _ fileUrl: URL, + environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, + context: EvaluationContext? = nil, + interitedOptions: ModelOptions? = nil, + revealInSystemFileBrowser: Bool = false + ) async throws { + guard let file = await buildToData(environment: inheritedEnvironment, context: context ?? .init(), + options: interitedOptions) else { throw CocoaError(.fileWriteUnknown) } + do { + try file.contents.write(to: fileUrl) + logger.info("Wrote model to \(fileUrl.path)") + if revealInSystemFileBrowser { + try? Platform.revealFiles([fileUrl]) + } + } catch { + logger.error("Failed to save model file to \(fileUrl.path): \(error.descriptiveString)") + throw error + } + } + + public func writeToDirectory( + _ directoryUrl: URL? = nil, environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, interitedOptions: ModelOptions? = nil, - revealInSystemFileBrowser: Bool = true + revealInSystemFileBrowser: Bool = false ) async -> URL? { let result = await buildToFile(environment: inheritedEnvironment, context: context ?? .init(), - options: interitedOptions, URL: directory) + options: interitedOptions, URL: directoryUrl) if revealInSystemFileBrowser, let result { try? Platform.revealFiles([result]) } @@ -98,7 +124,7 @@ public struct Model: Sendable { return result } - public func generateInMemoryFile( + public func generateData( environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, interitedOptions: ModelOptions? = nil @@ -117,14 +143,13 @@ public struct Model: Sendable { guard let file = await buildToData(environment: inheritedEnvironment, context: context, options: inheritedOptions) else { return nil } - let baseURL: URL + let url: URL if let parent = directory { - baseURL = parent.appendingPathComponent(name, isDirectory: false) + url = parent.appendingPathComponent(file.suggestedFileName, isDirectory: false) } else { - baseURL = URL(expandingFilePath: name) + url = URL(expandingFilePath: file.suggestedFileName) } - let url = baseURL.appendingPathExtension(file.pathExtension) let fileExisted = FileManager().fileExists(atPath: url.path(percentEncoded: false)) do { @@ -192,7 +217,7 @@ public struct Model: Sendable { do { let fileContents: Data = try await provider.generateOutput(context: context) - return InMemoryFile(pathExtension: provider.fileExtension, contents: fileContents) + return InMemoryFile(suggestedFileName: "\(name).\(provider.fileExtension)", contents: fileContents) } catch { logger.error("Cadova caught an error while generating \(provider.fileExtension) model \"\(name)\":\nšŸ›‘ \(error)\n") return nil diff --git a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift index 1bd0510c..fa4cc0db 100644 --- a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift +++ b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift @@ -89,8 +89,8 @@ public func Project( let constantEnvironment = environment let urls = await models.asyncCompactMap { model in - await model.writeToFile(in: url, environment: constantEnvironment, context: context, - interitedOptions: combinedOptions, revealInSystemFileBrowser: false) + await model.writeToDirectory(url, environment: constantEnvironment, context: context, + interitedOptions: combinedOptions, revealInSystemFileBrowser: false) } try? Platform.revealFiles(urls) } From 52d0d63e8f4cb2035eb13d39d5452af2c068e499 Mon Sep 17 00:00:00 2001 From: Daniel Kennett Date: Wed, 14 Jan 2026 15:34:02 +0100 Subject: [PATCH 12/12] Fix typo --- .../Cadova/Concrete Layer/Build/Group/Group.swift | 2 +- .../Cadova/Concrete Layer/Build/Model/Model.swift | 12 ++++++------ .../Concrete Layer/Build/Project/Project.swift | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/Cadova/Concrete Layer/Build/Group/Group.swift b/Sources/Cadova/Concrete Layer/Build/Group/Group.swift index 5261a546..fb80a2c5 100644 --- a/Sources/Cadova/Concrete Layer/Build/Group/Group.swift +++ b/Sources/Cadova/Concrete Layer/Build/Group/Group.swift @@ -125,7 +125,7 @@ public struct Group: Sendable { outputDirectory, environment: environment, context: context, - interitedOptions: combinedOptions + inheritedOptions: combinedOptions ) { urls.append(url) } diff --git a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift index 1dfa7d18..12ccf281 100644 --- a/Sources/Cadova/Concrete Layer/Build/Model/Model.swift +++ b/Sources/Cadova/Concrete Layer/Build/Model/Model.swift @@ -91,11 +91,11 @@ public struct Model: Sendable { _ fileUrl: URL, environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, - interitedOptions: ModelOptions? = nil, + inheritedOptions: ModelOptions? = nil, revealInSystemFileBrowser: Bool = false ) async throws { guard let file = await buildToData(environment: inheritedEnvironment, context: context ?? .init(), - options: interitedOptions) else { throw CocoaError(.fileWriteUnknown) } + options: inheritedOptions) else { throw CocoaError(.fileWriteUnknown) } do { try file.contents.write(to: fileUrl) logger.info("Wrote model to \(fileUrl.path)") @@ -112,11 +112,11 @@ public struct Model: Sendable { _ directoryUrl: URL? = nil, environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, - interitedOptions: ModelOptions? = nil, + inheritedOptions: ModelOptions? = nil, revealInSystemFileBrowser: Bool = false ) async -> URL? { let result = await buildToFile(environment: inheritedEnvironment, context: context ?? .init(), - options: interitedOptions, URL: directoryUrl) + options: inheritedOptions, URL: directoryUrl) if revealInSystemFileBrowser, let result { try? Platform.revealFiles([result]) } @@ -127,9 +127,9 @@ public struct Model: Sendable { public func generateData( environment inheritedEnvironment: EnvironmentValues = .defaultEnvironment, context: EvaluationContext? = nil, - interitedOptions: ModelOptions? = nil + inheritedOptions: ModelOptions? = nil ) async -> InMemoryFile? { - return await buildToData(environment: inheritedEnvironment, context: context ?? .init(), options: interitedOptions) + return await buildToData(environment: inheritedEnvironment, context: context ?? .init(), options: inheritedOptions) } private func buildToFile( diff --git a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift index 95b146f4..908b43ab 100644 --- a/Sources/Cadova/Concrete Layer/Build/Project/Project.swift +++ b/Sources/Cadova/Concrete Layer/Build/Project/Project.swift @@ -93,7 +93,7 @@ public func Project( for model in models { if let modelUrl = await model.writeToDirectory(url, environment: constantEnvironment, context: context, - interitedOptions: combinedOptions, revealInSystemFileBrowser: false) { + inheritedOptions: combinedOptions, revealInSystemFileBrowser: false) { urls.append(modelUrl) } }