Skip to content

Commit 6633282

Browse files
committed
fix compiler directives #603
1 parent 235cbf4 commit 6633282

11 files changed

Lines changed: 19 additions & 16 deletions

File tree

src/ARCtrl/JsonIO/Decode.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Decode =
1111
#if FABLE_COMPILER_PYTHON
1212
Thoth.Json.Python.Decode.helpers
1313
#endif
14-
#if FABLE_COMPILER_JAVASCRIPT
14+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1515
Thoth.Json.JavaScript.Decode.helpers
1616
#endif
1717
#if !FABLE_COMPILER
@@ -22,7 +22,7 @@ module Decode =
2222
#if FABLE_COMPILER_PYTHON
2323
match Thoth.Json.Python.Decode.fromString decoder s with
2424
#endif
25-
#if FABLE_COMPILER_JAVASCRIPT
25+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
2626
match Thoth.Json.JavaScript.Decode.fromString decoder s with
2727
#endif
2828
#if !FABLE_COMPILER

src/ARCtrl/JsonIO/Encode.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open Fable.Core
77
//#if FABLE_COMPILER_PYTHON
88
//open Fable.Core.PyInterop
99
//#endif
10-
//#if FABLE_COMPILER_JAVASCRIPT
10+
//#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1111
//open Fable.Core.JsInterop
1212
//#endif
1313

@@ -18,7 +18,7 @@ module Encode =
1818
#if FABLE_COMPILER_PYTHON
1919
Thoth.Json.Python.Encode.toString spaces value
2020
#endif
21-
#if FABLE_COMPILER_JAVASCRIPT
21+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
2222
Thoth.Json.JavaScript.Encode.toString spaces value
2323
#endif
2424
#if !FABLE_COMPILER

src/ARCtrl/Template.Web.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let getTemplates(url: string option) =
1414
return mapResult
1515
}
1616

17-
#if FABLE_COMPILER_JAVASCRIPT
17+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1818

1919
/// <summary>
2020
/// This class is used to make async functions more accessible from JavaScript.

src/ARCtrl/WebRequest/WebRequest.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let downloadFile url =
1818
| _ -> failwithf "Status %d => %s" statusCode responseText
1919
}
2020
#endif
21-
#if FABLE_COMPILER_JAVASCRIPT
21+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
2222

2323
if ARCtrl.WebRequestHelpers.NodeJs.isNode() then
2424
// From here: https://github.com/fable-compiler/fable3-samples/blob/25ea2404b28c897988b144f0141bc116da292679/nodejs/src/App.fs#L7

src/Contract/Contract.fs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ namespace ARCtrl.Contract
33
open Fable.Core
44
open Fable.Core.JsInterop
55

6-
#if FABLE_COMPILER_JAVASCRIPT
6+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
77
[<StringEnum>]
88
#endif
99
[<RequireQualifiedAccess>]
@@ -31,7 +31,7 @@ type CLITool =
3131

3232
static member create(name,arguments) = {Name = name; Arguments = arguments}
3333

34-
#if FABLE_COMPILER_JAVASCRIPT
34+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
3535
[<Erase>]
3636
#endif
3737
[<RequireQualifiedAccess>]
@@ -79,7 +79,7 @@ type Contract =
7979
/// The actual DTO, as discriminate union.
8080
DTO: DTO option
8181
}
82-
#if FABLE_COMPILER_JAVASCRIPT
82+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
8383
[<NamedParams(fromIndex=2)>]
8484
#endif
8585
static member create(op, path, ?dtoType, ?dto) = {Operation= op; Path = path; DTOType = dtoType; DTO = dto}

src/Json/Encode.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ open Fable.Core
77
#if FABLE_COMPILER_PYTHON
88
open Fable.Core.PyInterop
99
#endif
10-
#if FABLE_COMPILER_JAVASCRIPT
10+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1111
open Fable.Core.JsInterop
1212
#endif
1313

tests/Json/JsonSchema.Tests.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ let tests_ProcessParameterValue =
131131

132132
let main =
133133
testList "JsonSchema-Validation" [
134-
#if FABLE_COMPILER_JAVASCRIPT
134+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
135135
tests_FableBindings
136136
#endif
137137
#if !FABLE_COMPILER_PYTHON

tests/Json/Validation/JsonSchemaValidation.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ module Validation =
9292
async {
9393
try
9494
#endif
95-
#if FABLE_COMPILER_JAVASCRIPT
95+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
9696
let! isValid, errorList = Fable.validate (schemaURL) (objectString)
9797
#endif
9898
#if !FABLE_COMPILER

tests/Speedtest/PerformanceReport.fs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ open ARCtrl.Json
66
open ARCtrl.Spreadsheet
77
open Fable.Core
88

9-
#if FABLE_COMPILER_JAVASCRIPT
9+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1010
open Node.Api
1111
#endif
1212

@@ -15,7 +15,7 @@ open Fable.Python.Builtins
1515
#endif
1616

1717
let writeFile (path : string) (content : string) =
18-
#if FABLE_COMPILER_JAVASCRIPT
18+
#if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
1919
fs.writeFileSync(path,content)
2020
#endif
2121
#if FABLE_COMPILER_PYTHON
@@ -441,6 +441,9 @@ let lang =
441441
#if !FABLE_COMPILER
442442
"FSharp"
443443
#endif
444+
#if FABLE_COMPILER_TYPESCRIPT
445+
"TypeScript"
446+
#endif
444447

445448
let runReport cpu =
446449
let report = createMarkdownPerformanceReport lang cpu

tests/Speedtest/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ let main argv =
6666
#endif
6767
else
6868
//let argumentNumber =
69-
// #if FABLE_COMPILER_JAVASCRIPT
69+
// #if FABLE_COMPILER_JAVASCRIPT || FABLE_COMPILER_TYPESCRIPT
7070
// 1
7171
// #else
7272
// 0

0 commit comments

Comments
 (0)