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

Net5.0 & fable3 #415

Merged
merged 89 commits into from
Jun 28, 2021
Merged
Show file tree
Hide file tree
Changes from 72 commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
05112fa
Upgrade to .NET 5. Call build.fsx using FSI instead of fake-cli
theprash Nov 13, 2020
68d9187
Upgrade default template to Fable 3
theprash Nov 13, 2020
d67f07b
Pass arguments directly to FAKE
theprash Nov 16, 2020
60f96ac
Use latest stable paket
theprash Nov 16, 2020
fe2747a
Update minimal to Fable 3 as per https://github.com/MangelMaxime/fulm…
theimowski Oct 23, 2020
a58c88d
use .fs.js
theimowski Dec 7, 2020
57b2f54
Move minimal to net5.0; remove Elmish
theimowski Dec 7, 2020
ddf75e7
Make minimal more minimal
theimowski Dec 7, 2020
9cb250a
update travis to net5.0
theimowski Dec 8, 2020
5049c40
ignore files from nupkg
theimowski Dec 8, 2020
1a3dca0
Update paket to 6.0.0 beta
theimowski Dec 8, 2020
03ee2c2
Paket update
theimowski Dec 9, 2020
af5bc09
Use Build.fsproj instead of build.fsx
theimowski Dec 11, 2020
237d282
Merge branch 'master' into net5.0-fable3
theimowski Jan 23, 2021
bfe4e68
Eclude all obj and bin from template nupkg
theimowski Jan 23, 2021
d6a4066
Default: update Saturn, Giraffe and Fable.Remoting to latest prerelease
theimowski Jan 23, 2021
799b7b0
Move build project to root directory
theimowski Jan 23, 2021
c63a622
Default: correct docs
theimowski Jan 23, 2021
285e151
Minimal: update Saturn to latest preview and remove Thoth.Json.Serial…
theimowski Jan 23, 2021
be06336
Fix tests
theimowski Jan 25, 2021
38920b2
Use Feliz instead of Fable.Elmish.React
theimowski Jan 26, 2021
655ecf5
Update fake-cli tool for template
theimowski Jan 26, 2021
433d54d
Try dotnet paket restore before running tests
theimowski Jan 26, 2021
a7fb723
Update Content/default/.config/dotnet-tools.json
theimowski Jan 27, 2021
0ddf209
Use net5.0 for building template
theimowski Jan 27, 2021
61434ed
Trigger Travis build
theimowski Jan 28, 2021
5515710
Update travis.yml
theimowski Jan 28, 2021
d7ab65d
Remove travis addons
theimowski Jan 28, 2021
0233026
Paket update
theimowski Feb 15, 2021
3b45c37
Update minimal dependencies
theimowski Feb 15, 2021
c0f5876
Travis - try running on 3 OS
theimowski Feb 15, 2021
9062169
Remove windows from travis
theimowski Feb 15, 2021
605ab4a
Use Async.StartChild for timeout
theimowski Feb 16, 2021
e892d06
Ignore lines that timeout after 30 seconds
theimowski Feb 16, 2021
9b96119
Invoke the tests without expecto
theimowski Feb 20, 2021
4e0bd02
Improve logging
theimowski Feb 20, 2021
e2ad405
Test devops YAML
isaacabraham Feb 21, 2021
85bdb2c
Update badge
isaacabraham Feb 21, 2021
e6298d2
Make Tests work on windows
olivercoad Feb 22, 2021
e83f8e7
Merge pull request #426 from olivercoad/tests-on-windows
theimowski Feb 22, 2021
9268ff3
Replace Thoth.Fetch with Fable.Fetch - closes #424
theimowski Feb 22, 2021
522a39b
Use text instead of json in minimal sample - #424
theimowski Feb 23, 2021
d190cb0
Minimal - move Shared to global namespace - #closes #425
theimowski Feb 23, 2021
577f42b
Default - move Shared to global namespace - #425
theimowski Feb 23, 2021
48eec45
Revert "Default - move Shared to global namespace - #425"
theimowski Feb 24, 2021
b8d5476
Revert "Minimal - move Shared to global namespace - #closes #425"
theimowski Feb 24, 2021
348911a
Move App.fs to Client.fs for minimal
theimowski Feb 24, 2021
8542390
ignore .fable dir
theimowski Feb 24, 2021
804cfd0
3.0.0-beta001
theimowski Feb 24, 2021
73768f4
Format with Fantomas
nojaf Feb 26, 2021
7e20c77
Removed fsharp_space_before_colon setting.
nojaf Feb 26, 2021
0d94c10
Change unit tests
nojaf Feb 26, 2021
d5aac89
Add FAKE targets to build
nojaf Feb 26, 2021
4bf7dd4
Remove additional FAKE targets.
nojaf Feb 26, 2021
1154faa
Scope formatting to src folder.
nojaf Feb 26, 2021
d4fda05
Merge pull request #428 from nojaf/fantomas
theimowski Feb 26, 2021
5d48615
Use dotnet function for Format FAKE target
theimowski Feb 26, 2021
064e897
Update CONTRIBUTING.md
theimowski Mar 14, 2021
2812128
Bumpl elliptic from 6.5.3 to 6.5.4
theimowski Mar 14, 2021
102289d
Use root path for saturnframework docs
theimowski Mar 14, 2021
3209490
Remove shortcut from CSS link type - fixes #430
theimowski Mar 14, 2021
a08bd5b
Run paket update - fixes #434
theimowski Mar 14, 2021
1c96c10
3.0.0-beta002
theimowski Mar 14, 2021
f3d46a4
Replace Dotnet.exec with direct dotnet call
theimowski Mar 27, 2021
ccf4ea2
Update fable
theimowski Mar 30, 2021
50a9aa1
Fix npm audit warning and update lockversion to 2
theimowski Mar 30, 2021
a754390
paket update
theimowski Mar 30, 2021
912117e
Add Helpers to Build projecT
theimowski Mar 30, 2021
660cc1c
beta003
theimowski Apr 6, 2021
6a2d048
Fix typo
theimowski Apr 15, 2021
dd63b5b
Bring back tryFindFileOnPath for npm
theimowski Apr 15, 2021
0251d8c
beta004
theimowski Apr 15, 2021
b8bdbe7
Add dotnet fable clean
theprash May 7, 2021
ea33625
Merge pull request #443 from theprash/net5.0-fable3
theimowski May 14, 2021
7701d69
Update default packages
theimowski May 29, 2021
758dccc
Remove babel
theimowski May 29, 2021
0d71572
Update css-loader
theimowski May 29, 2021
d21bca9
Bump minimal npm packages
theimowski May 29, 2021
0f63969
Update minimal nuget deps
theimowski May 29, 2021
0340ec3
Clean fs.js only for src directory
theimowski May 29, 2021
42425ee
Add back sass dependency
theimowski May 30, 2021
d3217f4
paket update - use stable Fable.Remoting.Giraffe
theimowski Jun 4, 2021
1eb94dc
update npm dependencies
theimowski Jun 4, 2021
61d6dfe
Update paket deps include Farmer.
isaacabraham Jun 19, 2021
7eefecb
NPM audit fix
isaacabraham Jun 19, 2021
27d8354
Merge pull request #453 from SAFE-Stack/update-deps
theimowski Jun 21, 2021
1b28e1e
Remove 'prerelease' from Saturn dependency
theimowski Jun 21, 2021
e1eb5ca
Merge remote-tracking branch 'origin/master' into net5.0-fable3
isaacabraham Jun 24, 2021
4a9f367
3.0.0-beta005
theimowski Jun 28, 2021
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
8 changes: 1 addition & 7 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
"version": 1,
"isRoot": true,
"tools": {
"fake-cli": {
"version": "5.19.1",
"commands": [
"fake"
]
},
"paket": {
"version": "5.242.2",
"version": "6.0.0-beta8",
"commands": [
"paket"
]
Expand Down
12 changes: 9 additions & 3 deletions .paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir>

<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT' ">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>

<!-- Disable automagic references for F# DotNet SDK -->
<!-- This will not do anything for other project types -->
<!-- see https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1002-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>

Expand Down Expand Up @@ -130,7 +136,7 @@
<!-- Parse our simple 'paket.restore.cached' json ...-->
<PaketRestoreCachedSplitObject Include="$([System.Text.RegularExpressions.Regex]::Split(`$(PaketRestoreCachedContents)`, `{|}|,`))"></PaketRestoreCachedSplitObject>
<!-- Keep Key, Value ItemGroup-->
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
Condition=" $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `&quot;: &quot;`).Length) &gt; 1 ">
<Key>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``))</Key>
<Value>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``))</Value>
Expand Down Expand Up @@ -163,7 +169,7 @@
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Error Text="Stop build because of PAKET_ERROR_ON_MSBUILD_EXEC and we need a full restore (hashes don't match)" Condition=" '$(PAKET_ERROR_ON_MSBUILD_EXEC)' == 'true' AND '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true'" />
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" />

<!-- Step 2 Detect project specific changes -->
<ItemGroup>
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
Expand Down
26 changes: 6 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,15 @@
language: csharp
sudo: required
dist: xenial
dotnet: 3.1.300
dotnet: 5.0.100
mono: none

addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- libstdc++-4.9-dev
- libunwind8-dev
os:
- linux
- osx

before_install:
- nvm install 10.12.0
- nvm use 10.12.0
# Yarn
- curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- sudo apt-get update && sudo apt-get install yarn

cache:
directories:
- $HOME/.yarn-cache

script:
- dotnet tool restore
- dotnet fake build -t tests
- dotnet paket restore
- dotnet run --project tests/tests.fsproj
21 changes: 13 additions & 8 deletions build.fsx → Build.fs
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#r "paket: groupref build //"
#load "./.fake/build.fsx/intellisense.fsx"

#if !FAKE
#r "netstandard"
#endif

open System

open Fake.Core
Expand All @@ -14,6 +7,9 @@ open Fake.IO.FileSystemOperators
open Fake.IO.Globbing.Operators
open Fake.Tools

let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ]
Context.setExecutionContext (Context.RuntimeContext.Fake execContext)

let templatePath = "./Content/.template.config/template.json"
let templateProj = "SAFE.Template.proj"
let templateName = "SAFE-Stack Web App"
Expand Down Expand Up @@ -115,4 +111,13 @@ open Fake.Core.TargetOperators
==> "Push"
==> "Release"

Target.runOrDefaultWithArguments "Install"
[<EntryPoint>]
let main args =
try
match args with
| [| target |] -> Target.runOrDefault target
| _ -> Target.runOrDefault "Install"
0
with e ->
printfn "%A" e
1
13 changes: 13 additions & 0 deletions Build.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<Compile Include="Build.fs" />
</ItemGroup>

<Import Project=".paket\Paket.Restore.targets" />
</Project>
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To test your changes simply navigate to `Content\minimal` or `Content\default` a

## Testing template bundle

To build whole template invoke `dotnet fake build` - default target is `Install`, which will build the template and invoke `dotnet new -i <<repo-path>>/nupkg/SAFE.Template.<<version>>.nupkg`
To build whole template invoke `dotnet run -p Build.fsproj` - default target is `Install`, which will build the template and invoke `dotnet new -i <<repo-path>>/nupkg/SAFE.Template.<<version>>.nupkg`

You can now test the local build of template using `dotnet new SAFE`

Expand Down
2 changes: 1 addition & 1 deletion Content/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"Fable",
"Elmish"
],
"name": "SAFE-Stack Web App v2.2.2",
"name": "SAFE-Stack Web App v3.0.0-beta004",
"tags": {
"language": "F#",
"type": "project"
Expand Down
14 changes: 10 additions & 4 deletions Content/default/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,21 @@
"isRoot": true,
"tools": {
"paket": {
"version": "6.0.0-alpha014",
"version": "6.0.0-beta8",
"commands": [
"paket"
]
},
"fake-cli": {
"version": "5.19.1",
"fable": {
"version": "3.1.12",
"commands": [
"fake"
"fable"
]
},
"fantomas-tool": {
"version": "4.4.0",
"commands": [
"fantomas"
]
}
}
Expand Down
6 changes: 5 additions & 1 deletion Content/default/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,8 @@ indent_style = space
indent_size = 4
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = false
insert_final_newline = false

[src/Client/*.fs]
# Feliz style
fsharp_single_argument_web_mode=true
1 change: 1 addition & 0 deletions Content/default/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.fable/
*.fs.js
.fake/
.farmer/
.idea/
Expand Down
12 changes: 9 additions & 3 deletions Content/default/.paket/Paket.Restore.targets
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' AND Exists('$(PaketRootPath)paket.bootstrapper.exe')">$(PaketRootPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExePath Condition=" '$(PaketBootStrapperExePath)' == '' ">$(PaketToolsPath)paket.bootstrapper.exe</PaketBootStrapperExePath>
<PaketBootStrapperExeDir Condition=" Exists('$(PaketBootStrapperExePath)') " >$([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\</PaketBootStrapperExeDir>

<PaketBootStrapperCommand Condition=" '$(OS)' == 'Windows_NT' ">"$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>
<PaketBootStrapperCommand Condition=" '$(OS)' != 'Windows_NT' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)"</PaketBootStrapperCommand>

<!-- Disable automagic references for F# DotNet SDK -->
<!-- This will not do anything for other project types -->
<!-- see https://github.com/fsharp/fslang-design/blob/master/tooling/FST-1002-fsharp-in-dotnet-sdk.md -->
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
<DisableImplicitSystemValueTupleReference>true</DisableImplicitSystemValueTupleReference>

<!-- Disable Paket restore under NCrunch build -->
<PaketRestoreDisabled Condition="'$(NCrunch)' == '1'">True</PaketRestoreDisabled>

Expand Down Expand Up @@ -130,7 +136,7 @@
<!-- Parse our simple 'paket.restore.cached' json ...-->
<PaketRestoreCachedSplitObject Include="$([System.Text.RegularExpressions.Regex]::Split(`$(PaketRestoreCachedContents)`, `{|}|,`))"></PaketRestoreCachedSplitObject>
<!-- Keep Key, Value ItemGroup-->
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
<PaketRestoreCachedKeyValue Include="@(PaketRestoreCachedSplitObject)"
Condition=" $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `&quot;: &quot;`).Length) &gt; 1 ">
<Key>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``))</Key>
<Value>$([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``))</Value>
Expand Down Expand Up @@ -163,7 +169,7 @@
<Exec Command='$(PaketBootStrapperCommand)' Condition=" '$(PaketBootstrapperStyle)' == 'classic' AND Exists('$(PaketBootStrapperExePath)') AND !(Exists('$(PaketExePath)'))" ContinueOnError="false" />
<Error Text="Stop build because of PAKET_ERROR_ON_MSBUILD_EXEC and we need a full restore (hashes don't match)" Condition=" '$(PAKET_ERROR_ON_MSBUILD_EXEC)' == 'true' AND '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true'" />
<Exec Command='$(PaketCommand) restore' Condition=" '$(PaketRestoreRequired)' == 'true' AND '$(PaketDisableGlobalRestore)' != 'true' " ContinueOnError="false" />

<!-- Step 2 Detect project specific changes -->
<ItemGroup>
<MyTargetFrameworks Condition="'$(TargetFramework)' != '' " Include="$(TargetFramework)"></MyTargetFrameworks>
Expand Down
79 changes: 79 additions & 0 deletions Content/default/Build.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
open Fake.Core
open Fake.IO
open Farmer
open Farmer.Builders

open Helpers

initializeContext()

let sharedPath = Path.getFullName "src/Shared"
let serverPath = Path.getFullName "src/Server"
let clientPath = Path.getFullName "src/Client"
let deployPath = Path.getFullName "deploy"
let sharedTestsPath = Path.getFullName "tests/Shared"
let serverTestsPath = Path.getFullName "tests/Server"
let clientTestsPath = Path.getFullName "tests/Client"

Target.create "Clean" (fun _ -> Shell.cleanDir deployPath)

Target.create "InstallClient" (fun _ -> run npm "install" ".")

Target.create "Bundle" (fun _ ->
[ "server", dotnet $"publish -c Release -o \"{deployPath}\"" serverPath
"client", dotnet "fable --run webpack -p" clientPath ]
|> runParallel
)

Target.create "Azure" (fun _ ->
let web = webApp {
name "SAFE.App"
zip_deploy "deploy"
}
let deployment = arm {
location Location.WestEurope
add_resource web
}

deployment
|> Deploy.execute "SAFE.App" Deploy.NoParameters
|> ignore
)

Target.create "Run" (fun _ ->
run dotnet "build" sharedPath
[ "server", dotnet "watch run" serverPath
"client", dotnet "fable watch --run webpack-dev-server" clientPath ]
|> runParallel
)

Target.create "RunTests" (fun _ ->
run dotnet "build" sharedTestsPath
[ "server", dotnet "watch run" serverTestsPath
"client", dotnet "fable watch --run webpack-dev-server --config ../../webpack.tests.config.js" clientTestsPath ]
|> runParallel
)

Target.create "Format" (fun _ ->
run dotnet "fantomas . -r" "src"
)

open Fake.Core.TargetOperators

let dependencies = [
"Clean"
==> "InstallClient"
==> "Bundle"
==> "Azure"

"Clean"
==> "InstallClient"
==> "Run"

"Clean"
==> "InstallClient"
==> "RunTests"
]

[<EntryPoint>]
let main args = runOrDefault args
11 changes: 11 additions & 0 deletions Content/default/Build.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Compile Include="Helpers.fs" />
<Compile Include="Build.fs" />
</ItemGroup>
<Import Project=".paket\Paket.Restore.targets" />
</Project>
Loading