Skip to content

Commit 5bd35a4

Browse files
authored
Merge pull request #8 from TypedUseCase/feature/update-dependencies
Update domain resolver
2 parents 9474859 + ab506a9 commit 5bd35a4

6 files changed

Lines changed: 29 additions & 27 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<!-- There is always Unreleased section on the top. Subsections (Add, Changed, Fix, Removed) should be Add as needed. -->
44
## Unreleased
5+
- Update dependencies
56

67
## 4.1.0 - 2021-08-12
78
- Update dependencies

paket.dependencies

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source https://api.nuget.org/v3/index.json
55
nuget FSharp.Core ~> 5.0
66
nuget FSharp.Data ~> 4.1
77
nuget MF.ConsoleApplication ~> 2.0
8-
nuget Tuc.DomainResolver ~> 2.1
8+
nuget Tuc.DomainResolver ~> 3.0
99

1010
nuget Expecto
1111
nuget YoloDev.Expecto.TestSdk

paket.lock

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -583,12 +583,12 @@ NUGET
583583
System.Runtime.Handles (>= 4.3)
584584
System.Windows.Extensions (5.0)
585585
System.Drawing.Common (>= 5.0)
586-
Tuc.DomainResolver (2.1)
586+
Tuc.DomainResolver (3.0.1)
587587
FSharp.Compiler.Service (>= 40.0)
588588
FSharp.Core (>= 5.0.2)
589589
FSharp.Data (>= 4.2.2)
590590
MF.ConsoleApplication (>= 2.0)
591-
YoloDev.Expecto.TestSdk (0.12.5)
591+
YoloDev.Expecto.TestSdk (0.12.6)
592592
Expecto (>= 9.0 < 10.0)
593593
FSharp.Core (>= 4.6)
594594
System.Collections.Immutable (>= 1.5 < 5.1)
@@ -769,21 +769,21 @@ NUGET
769769
Microsoft.Build.Tasks.Core (>= 16.4) - restriction: >= netstandard2.0
770770
Microsoft.Build.Utilities.Core (>= 16.4) - restriction: >= netstandard2.0
771771
Newtonsoft.Json (13.0.1) - restriction: >= netstandard2.0
772-
NuGet.Common (5.10) - restriction: >= netstandard2.0
773-
NuGet.Frameworks (>= 5.10) - restriction: || (>= net45) (>= netstandard2.0)
774-
NuGet.Configuration (5.10) - restriction: >= netstandard2.0
775-
NuGet.Common (>= 5.10) - restriction: || (>= net45) (>= netstandard2.0)
772+
NuGet.Common (5.11) - restriction: >= netstandard2.0
773+
NuGet.Frameworks (>= 5.11) - restriction: || (>= net45) (>= netstandard2.0)
774+
NuGet.Configuration (5.11) - restriction: >= netstandard2.0
775+
NuGet.Common (>= 5.11) - restriction: || (>= net45) (>= netstandard2.0)
776776
System.Security.Cryptography.ProtectedData (>= 4.4) - restriction: && (< net45) (>= netstandard2.0)
777-
NuGet.Frameworks (5.10) - restriction: >= netstandard2.0
778-
NuGet.Packaging (5.10) - restriction: >= netstandard2.0
777+
NuGet.Frameworks (5.11) - restriction: >= netstandard2.0
778+
NuGet.Packaging (5.11) - restriction: >= netstandard2.0
779779
Newtonsoft.Json (>= 9.0.1) - restriction: >= netstandard2.0
780-
NuGet.Configuration (>= 5.10) - restriction: >= netstandard2.0
781-
NuGet.Versioning (>= 5.10) - restriction: >= netstandard2.0
780+
NuGet.Configuration (>= 5.11) - restriction: >= netstandard2.0
781+
NuGet.Versioning (>= 5.11) - restriction: >= netstandard2.0
782782
System.Security.Cryptography.Cng (>= 5.0) - restriction: || (&& (< net472) (>= netstandard2.0)) (>= net50)
783783
System.Security.Cryptography.Pkcs (>= 5.0) - restriction: || (&& (< net472) (>= netstandard2.0)) (>= net50)
784-
NuGet.Protocol (5.10) - restriction: >= netstandard2.0
785-
NuGet.Packaging (>= 5.10) - restriction: >= netstandard2.0
786-
NuGet.Versioning (5.10) - restriction: >= netstandard2.0
784+
NuGet.Protocol (5.11) - restriction: >= netstandard2.0
785+
NuGet.Packaging (>= 5.11) - restriction: >= netstandard2.0
786+
NuGet.Versioning (5.11) - restriction: >= netstandard2.0
787787
System.Buffers (4.5.1) - restriction: || (&& (>= monoandroid) (>= net50) (< netcoreapp2.0)) (&& (>= monoandroid) (< netcoreapp2.0) (>= netstandard2.0)) (&& (< monoandroid) (< net45) (< netcoreapp2.0) (>= netstandard2.0)) (&& (< monoandroid) (< net46) (< netcoreapp2.0) (>= netstandard2.0) (< netstandard2.1) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (>= net50) (< netcoreapp2.0) (< xamarintvos) (< xamarinwatchos)) (&& (< monoandroid) (< netstandard1.1) (>= netstandard2.0) (< win8)) (&& (>= monotouch) (>= net50)) (&& (>= monotouch) (>= netstandard2.0)) (&& (>= net461) (>= net50)) (&& (>= net461) (>= netstandard2.0)) (>= net472) (&& (>= net50) (< netstandard2.0) (>= xamarintvos)) (&& (>= net50) (< netstandard2.0) (>= xamarinwatchos)) (&& (< netstandard1.1) (>= netstandard2.0) (>= win8)) (&& (>= netstandard2.0) (>= uap10.1)) (&& (>= netstandard2.0) (>= xamarintvos)) (&& (>= netstandard2.0) (>= xamarinwatchos)) (>= xamarinios) (>= xamarinmac)
788788
System.CodeDom (5.0) - restriction: && (< net472) (>= netstandard2.0)
789789
System.Collections.Immutable (5.0) - restriction: >= netstandard2.0

src/ErrorHandling/Result.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ module internal AsyncResult =
473473
/// The `asyncResult` computation expression is available globally without qualification
474474
/// See https://github.com/cmeeren/Cvdm.ErrorHandling/blob/master/src/Cvdm.ErrorHandling/AsyncResultBuilder.fs
475475
[<AutoOpen>]
476-
module AsyncResultComputationExpression =
476+
module internal AsyncResultComputationExpression =
477477
type AsyncResultBuilder() =
478478
member __.Return (value: 'Success): AsyncResult<'Success, 'Error> =
479479
async.Return <| result.Return value

src/Tuc/Parser/Parser.fs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Parser =
1717
Lines: Line list
1818
}
1919

20-
type private ParseLines<'TucItem> = MF.ConsoleApplication.Output -> IndentationLevel -> Line list -> Result<ParseResult<'TucItem>, ParseError list>
20+
type private ParseLines<'TucItem> = MF.ConsoleApplication.Output -> IndentationLevel -> Line list -> Result<ParseResult<'TucItem>, Tuc.ParseError list>
2121

2222
[<RequireQualifiedAccess>]
2323
module private KeyWords =
@@ -97,7 +97,7 @@ module Parser =
9797

9898
[<RequireQualifiedAccess>]
9999
module private Participants =
100-
type private ParseParticipants = MF.ConsoleApplication.Output -> DomainTypes -> IndentationLevel -> Line list -> Result<ParsedParticipant list, ParseError list>
100+
type private ParseParticipants = MF.ConsoleApplication.Output -> DomainTypes -> IndentationLevel -> Line list -> Result<ParsedParticipant list, Tuc.ParseError list>
101101

102102
[<RequireQualifiedAccess>]
103103
module private Participants =
@@ -334,7 +334,7 @@ module Parser =
334334
| error -> error
335335
)
336336

337-
let private parseParticipant location (domainTypes: DomainTypes) indentationLevel lines line: Result<ParsedParticipant * Line list, ParseError list> =
337+
let private parseParticipant location (domainTypes: DomainTypes) indentationLevel lines line: Result<ParsedParticipant * Line list, Tuc.ParseError list> =
338338
let participantIndentation = indentationLevel |> IndentationLevel.indentation
339339

340340
match line with
@@ -475,7 +475,7 @@ module Parser =
475475
[<RequireQualifiedAccess>]
476476
module private Parts =
477477
type private Participants = Participants of Map<string, ActiveParticipant>
478-
type private ParseParts = MF.ConsoleApplication.Output -> ParsedTucName -> Participants -> DomainTypes -> IndentationLevel -> Line list -> Result<ParsedTucPart list, ParseError>
478+
type private ParseParts = MF.ConsoleApplication.Output -> ParsedTucName -> Participants -> DomainTypes -> IndentationLevel -> Line list -> Result<ParsedTucPart list, Tuc.ParseError>
479479

480480
let private (|IsParticipant|_|) (Participants participants) token =
481481
participants |> Map.tryFind token
@@ -1324,7 +1324,7 @@ module Parser =
13241324
| [] -> Ok ()
13251325
| wrongLines -> Error <| WrongIndentationLevel (indentationLevel, wrongLines |> List.map RawLine.valuei)
13261326

1327-
let rec parseLines (output: MF.ConsoleApplication.Output) location domainTypes indentationLevel (tucAcc: Result<ParsedTuc, ParseError list> list) = function
1327+
let rec parseLines (output: MF.ConsoleApplication.Output) location domainTypes indentationLevel (tucAcc: Result<ParsedTuc, Tuc.ParseError list> list) = function
13281328
| [] ->
13291329
match tucAcc with
13301330
| [] -> Error [ MissingTucName ]

tests/Tuc/ParserTest.fs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ module Common =
4242
type Case = {
4343
Description: string
4444
Tuc: string
45-
Expected: Result<ParsedTuc list, ParseError list>
45+
Expected: Result<ParsedTuc list, Tuc.ParseError list>
4646
}
4747

4848
let case path description tuc expected =
@@ -70,20 +70,21 @@ module Common =
7070
| Ok _, Error error -> failtestf "%s - Success was expected, but it results in error.\n%A" description error
7171

7272
module Domain =
73-
open Tuc.Domain
7473
open ErrorHandling
7574

7675
let private parseDomain output domain =
7776
result {
7877
let! resolvedTypes =
7978
domain
8079
|> Parser.parse output
81-
|> List.singleton
82-
|> Resolver.resolve output
80+
|> Resolver.resolveOneAsync output
81+
|> Async.RunSynchronously
82+
|> Result.mapError (function
83+
| AsyncResolveError.UnresolvedTypes types -> types
84+
| _ -> []
85+
)
8386

84-
return!
85-
resolvedTypes
86-
|> Checker.check output
87+
return! resolvedTypes |> Checker.check output
8788
}
8889
|> orFail (List.map TypeName.value >> String.concat "\n - " >> sprintf "Unresolved types:\n%s")
8990

0 commit comments

Comments
 (0)