From 5fef206e88cf456f2ab7fc138ddfb2f287e146fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helge=20He=C3=9F?= Date: Thu, 10 Oct 2024 15:03:27 +0200 Subject: [PATCH] Adjustments for Mustache 1.0.2 Minor API changes, bad semver. --- Package.swift | 5 +++-- Sources/express/Mustache.swift | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Package.swift b/Package.swift index cd38657..64389e5 100644 --- a/Package.swift +++ b/Package.swift @@ -19,7 +19,7 @@ let package = Package( .package(url: "https://github.com/Macro-swift/Macro.git", from: "1.0.2"), .package(url: "https://github.com/AlwaysRightInstitute/mustache.git", - from: "1.0.1") + from: "1.0.2") ], targets: [ @@ -44,7 +44,8 @@ let package = Package( .product(name: "MacroCore", package: "Macro"), .product(name: "fs", package: "Macro"), .product(name: "http", package: "Macro"), - "connect", "mime", "mustache" + "connect", "mime", + .product(name: "Mustache", package: "mustache") ], exclude: [ "README.md" ]), .target(name: "MacroExpress", dependencies: [ .product(name: "MacroCore", package: "Macro"), diff --git a/Sources/express/Mustache.swift b/Sources/express/Mustache.swift index 35cbd56..acff6d9 100644 --- a/Sources/express/Mustache.swift +++ b/Sources/express/Mustache.swift @@ -3,14 +3,14 @@ // Noze.io / Macro // // Created by Helge Heß on 02/06/16. -// Copyright © 2016-2020 ZeeZide GmbH. All rights reserved. +// Copyright © 2016-2024 ZeeZide GmbH. All rights reserved. // import func fs.readFile import func fs.readFileSync import enum fs.path import let MacroCore.console -import mustache +import Mustache let mustacheExpress : ExpressEngine = { path, options, done in fs.readFile(path, "utf8") { err, str in @@ -25,7 +25,7 @@ let mustacheExpress : ExpressEngine = { path, options, done in return } - let parser = MustacheParser() + var parser = MustacheParser() let tree = parser.parse(string: template) let ctx = ExpressMustacheContext(path: path, object: options) @@ -53,7 +53,7 @@ class ExpressMustacheContext : MustacheDefaultRenderingContext { return nil } - let parser = MustacheParser() + var parser = MustacheParser() let tree = parser.parse(string: template) return tree }