Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARC transilable async/promise based IO #479

Merged
merged 30 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
7e81c67
add basic FileSystemHelper functions for .NET
HLWeil Oct 16, 2024
fcc2756
add simple contractIO functions
HLWeil Oct 16, 2024
68cb0cb
small fix to xlsx controller
HLWeil Oct 16, 2024
98b1b99
add testObjects from ARCtrl.IO
HLWeil Oct 29, 2024
778eec2
add top level ARC IO functions
HLWeil Oct 29, 2024
45964a7
add IO tests from ARCtrl.IO
HLWeil Oct 29, 2024
d9b6f9e
rename testARC folder
HLWeil Oct 29, 2024
c27fdbf
add simple FileSystemHelper tests and small fixes
HLWeil Oct 29, 2024
83f8473
fix IO tests for .NET
HLWeil Oct 30, 2024
2693e40
finish up NET implementation of top level ARC IO
HLWeil Oct 30, 2024
1d1558e
start working on async arcIO
HLWeil Nov 1, 2024
eb10eaa
continue working on async IO
HLWeil Nov 18, 2024
a4a991a
switch all file system access to async/promise functionality
HLWeil Nov 20, 2024
cca43e8
add first wip version of js file system access
HLWeil Nov 21, 2024
a5c195b
some cleanup for js fs IO
HLWeil Nov 25, 2024
e72c01e
some more fixes for js file io
HLWeil Nov 21, 2024
7bc9e5a
add exceljs requirement and fix fileysystem helper file name
HLWeil Nov 21, 2024
1929830
further fixes for js file io
HLWeil Nov 22, 2024
02384d8
fix tests for dotnet again
HLWeil Nov 25, 2024
2478640
fix js base level IO tests
HLWeil Nov 25, 2024
4dd085a
fix js io helpers aganst basic tests
HLWeil Nov 26, 2024
c20e8c1
add preliminary promise catch mechanic for js io tests
HLWeil Nov 27, 2024
2b754f5
finish up first working version of javascript arc io
HLWeil Nov 28, 2024
a6438eb
start working on python arc IO
HLWeil Nov 28, 2024
ac29af6
finish up first version python arc io
HLWeil Nov 29, 2024
8c6d20d
finish up python io
HLWeil Dec 3, 2024
5c1f99e
finish up basic cross language IO and tests
HLWeil Dec 3, 2024
94714ba
add level synchronous IO functions for dotnet and python
HLWeil Dec 3, 2024
ce001af
fix test file path handling for js in linux
HLWeil Dec 4, 2024
3934047
remove second namespace definition in xlsx controller file
HLWeil Dec 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
"isRoot": true,
"tools": {
"fable": {
"version": "4.22.0",
"version": "4.24.0",
"commands": [
"fable"
]
],
"rollForward": false
}
}
}
235 changes: 235 additions & 0 deletions ARCtrl.JS.sln

Large diffs are not rendered by default.

235 changes: 235 additions & 0 deletions ARCtrl.Py.sln

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
<PackageVersion Include="Thoth.Json.JavaScript" Version="0.3.0" />
<PackageVersion Include="Thoth.Json.Python" Version="0.4.0" />
<PackageVersion Include="Thoth.Json.Newtonsoft" Version="0.2.0" />
<PackageVersion Include="FsSpreadsheet" Version="6.3.0-alpha.4" />
<PackageVersion Include="FsSpreadsheet" Version="6.3.1" />
<PackageVersion Include="FsSpreadsheet.NET" Version="6.3.1" />
<PackageVersion Include="FsSpreadsheet.Js" Version="6.3.1" />
<PackageVersion Include="FsSpreadsheet.Py" Version="6.3.1" />
<PackageVersion Include="YAMLicious" Version="0.0.3" />
<PackageVersion Include="DynamicObj" Version="4.0.3" />
<PackageVersion Include="Fable.SimpleHttp" Version="3.5.0" />
<PackageVersion Include="Fable.Fetch" Version="2.6.0" />
<PackageVersion Include="Fable.Node" Version="1.2.0" />
<PackageVersion Include="Fable.Promise" Version="3.2.0" />
<PackageVersion Include="Fable.Pyxpecto" Version="1.2.0" />
<PackageVersion Include="NJsonSchema" Version="10.8.0" />
</ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions build/BasicTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ let clean = BuildTask.create "Clean" [] {
++ "src/**/obj"
++ "tests/**/bin"
++ "tests/**/obj"
++ "tests/TestingUtils/TestResults"
++ "tests/**/py"
++ "tests/**/js"
++ "tests/Javascript/ARCtrl"
++ "tests/Python/ARCtrl"
++ "dist"
++ ProjectInfo.netPkgDir
|> Shell.cleanDirs
Expand Down
2 changes: 2 additions & 0 deletions build/PackageTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ module BundleJs =
"" // "fable-library.**/**"
|> Fake.IO.File.writeString false $"{ProjectInfo.npmPkgDir}/fable_modules/.npmignore"

System.IO.File.Copy(ProjectInfo.jsHelperFilePath, $"{ProjectInfo.npmPkgDir}/FileSystem.js", true) |> ignore

Fake.JavaScript.Npm.exec "pack" (fun o ->
{ o with
WorkingDirectory = ProjectInfo.npmPkgDir
Expand Down
3 changes: 3 additions & 0 deletions build/ProjectInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ let pyTestProjects =
"tests/Python"
]

let jsHelperFileName = "FileSystem.js"
let jsHelperFilePath = "src/ARCtrl/ContractIO/" + jsHelperFileName

let solutionFile = $"{project}.sln"

let configuration = "Release"
Expand Down
16 changes: 12 additions & 4 deletions build/TestTasks.fs
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,37 @@ module RunTests =
run npx $"cypress run --component -P {path}" ""
}

let runTestsJsNative = BuildTask.createFn "runTestsJSNative" [clean; build] (fun tp ->
let runTestsJsNative = BuildTask.createFn "runTestsJSNative" [clean] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start native JavaScript tests"
for path in ProjectInfo.jsTestProjects do
// transpile library for native access
run dotnet $"fable src/ARCtrl/ARCtrl.Javascript.fsproj -o {path}/ARCtrl --nocache" ""
System.IO.File.Copy(jsHelperFilePath, $"{path}/ARCtrl/{jsHelperFileName}") |> ignore
GenerateIndexJs.ARCtrl_generate($"{path}/ARCtrl")
run npx $"mocha {path} --timeout 20000" ""
else
Trace.traceImportant "Skipping JavaScript tests"
)

let runTestsJs = BuildTask.createFn "runTestsJS" [clean; build] (fun tp ->
let runTestsJs = BuildTask.createFn "runTestsJS" [clean] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start Js tests"
for path in ProjectInfo.testProjects do
// Setup test results directory after clean
System.IO.Directory.CreateDirectory("./tests/TestingUtils/TestResults/js") |> ignore
// transpile js files from fsharp code
run dotnet $"fable {path} -o {path}/js --nocache" ""

System.IO.File.Copy(jsHelperFilePath, $"{path}/js/{jsHelperFileName}") |> ignore
// run mocha in target path to execute tests
// "--timeout 20000" is used, because json schema validation takes a bit of time.
run node $"{path}/js/Main.js" ""
else
Trace.traceImportant "Skipping Js tests"
)

let runTestsPyNative = BuildTask.createFn "runTestsPyNative" [clean; build] (fun tp ->
let runTestsPyNative = BuildTask.createFn "runTestsPyNative" [clean] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start native Python tests"
for path in ProjectInfo.pyTestProjects do
Expand All @@ -57,10 +62,12 @@ module RunTests =
Trace.traceImportant "Skipping Python tests"
)

let runTestsPy = BuildTask.createFn "runTestsPy" [clean; build] (fun tp ->
let runTestsPy = BuildTask.createFn "runTestsPy" [clean] (fun tp ->
if tp.Context.Arguments |> List.exists (fun a -> a.ToLower() = skipTestsFlag.ToLower()) |> not then
Trace.traceImportant "Start Python tests"
for path in ProjectInfo.testProjects do
// Setup test results directory after clean
System.IO.Directory.CreateDirectory("./tests/TestingUtils/TestResults/py") |> ignore
//transpile py files from fsharp code
run dotnet $"fable {path} -o {path}/py --lang python --nocache" ""
// run pyxpecto in target path to execute tests in python
Expand Down Expand Up @@ -98,6 +105,7 @@ module RunTests =
run python $"{p}/py/main.py" ""
// transpile js files from fsharp code
run dotnet $"fable {p} -o {p}/js" ""
System.IO.File.Copy(jsHelperFilePath, $"{p}/js/{jsHelperFileName}") |> ignore
// run mocha in target path to execute tests
// "--timeout 20000" is used, because json schema validation takes a bit of time.
run node $"{p}/js/Main.js" ""
Expand Down
Loading
Loading