-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 14bbcfe
Showing
30 changed files
with
9,027 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 4 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
.fake/ | ||
.vs/ | ||
obj/ | ||
bin/ | ||
packages/ | ||
paket-files/ | ||
node_modules/ | ||
src/Client/public/js/ | ||
release.cmd | ||
release.sh | ||
.idea/ | ||
*.DotSettings.user | ||
deploy | ||
/src/Server/bar.jpg | ||
/tools/ | ||
/audio | ||
/.ionide/symbolCache.db | ||
/yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
cache: | ||
paths: | ||
- packages/ | ||
- node_modules/ | ||
|
||
stages: | ||
- build | ||
|
||
build:win: | ||
stage: build | ||
cache: | ||
key: "%CI_COMMIT_REF_NAME" | ||
script: | ||
# - .\dotnet-install.ps1 -InstallDir tools | ||
- IF EXIST build.cmd build.cmd Build | ||
tags: | ||
- Build | ||
- NodeJS | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
@echo off | ||
cls | ||
|
||
.paket\paket.exe restore | ||
if errorlevel 1 ( | ||
exit /b %errorlevel% | ||
) | ||
|
||
dotnet tool install --tool-path tools fake-cli | ||
tools\fake.exe build --target %* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
#r "paket: groupref build //" | ||
#load "./.fake/build.fsx/intellisense.fsx" | ||
|
||
#if !FAKE | ||
#r "netstandard" | ||
#r "Facades/netstandard" // https://github.com/ionide/ionide-vscode-fsharp/issues/839#issuecomment-396296095 | ||
#endif | ||
|
||
open System | ||
|
||
open Fake.Core | ||
open Fake.DotNet | ||
open Fake.IO | ||
|
||
let serverPath = Path.getFullName "./src/Server" | ||
let piServerPath = Path.getFullName "./src/PiServer" | ||
let clientPath = Path.getFullName "./src/Client" | ||
let deployDir = Path.getFullName "./deploy" | ||
|
||
let platformTool tool winTool = | ||
let tool = if Environment.isUnix then tool else winTool | ||
match Process.tryFindFileOnPath tool with | ||
| Some t -> t | ||
| _ -> | ||
let errorMsg = | ||
tool + " was not found in path. " + | ||
"Please install it and make sure it's available from your path. " + | ||
"See https://safe-stack.github.io/docs/quickstart/#install-pre-requisites for more info" | ||
failwith errorMsg | ||
|
||
let nodeTool = platformTool "node" "node.exe" | ||
let yarnTool = platformTool "yarn" "yarn.cmd" | ||
|
||
let install = lazy DotNet.install DotNet.Versions.FromGlobalJson | ||
|
||
let inline withWorkDir wd = | ||
DotNet.Options.lift install.Value | ||
>> DotNet.Options.withWorkingDirectory wd | ||
|
||
let runTool cmd args workingDir = | ||
let result = | ||
Process.execSimple (fun info -> | ||
{ info with | ||
FileName = cmd | ||
WorkingDirectory = workingDir | ||
Arguments = args }) | ||
TimeSpan.MaxValue | ||
if result <> 0 then failwithf "'%s %s' failed" cmd args | ||
|
||
let runDotNet cmd workingDir = | ||
let result = | ||
DotNet.exec (withWorkDir workingDir) cmd "" | ||
if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir | ||
|
||
let openBrowser url = | ||
let result = | ||
//https://github.com/dotnet/corefx/issues/10361 | ||
Process.execSimple (fun info -> | ||
{ info with | ||
FileName = url | ||
UseShellExecute = true }) | ||
TimeSpan.MaxValue | ||
if result <> 0 then failwithf "opening browser failed" | ||
|
||
Target.create "Clean" (fun _ -> | ||
Shell.cleanDirs [deployDir] | ||
) | ||
|
||
Target.create "InstallClient" (fun _ -> | ||
printfn "Node version:" | ||
runTool nodeTool "--version" __SOURCE_DIRECTORY__ | ||
printfn "Yarn version:" | ||
runTool yarnTool "--version" __SOURCE_DIRECTORY__ | ||
runTool yarnTool "install --frozen-lockfile" __SOURCE_DIRECTORY__ | ||
runDotNet "restore" clientPath | ||
) | ||
|
||
Target.create "RestoreServer" (fun _ -> | ||
runDotNet "restore" serverPath | ||
runDotNet "restore" piServerPath | ||
) | ||
|
||
Target.create "Build" (fun _ -> | ||
runDotNet "build" serverPath | ||
runDotNet "build" piServerPath | ||
runDotNet "fable webpack-cli -- --config src/Client/webpack.config.js -p" clientPath | ||
) | ||
|
||
Target.create "Run" (fun _ -> | ||
let server = async { | ||
runDotNet "watch run" serverPath | ||
} | ||
let piServer = async { | ||
runDotNet "watch run" piServerPath | ||
} | ||
let client = async { | ||
runDotNet "fable webpack-dev-server -- --config src/Client/webpack.config.js" clientPath | ||
} | ||
let browser = async { | ||
do! Async.Sleep 5000 | ||
openBrowser "http://localhost:8080" | ||
} | ||
|
||
[ server; piServer; client; browser ] | ||
|> Async.Parallel | ||
|> Async.RunSynchronously | ||
|> ignore | ||
) | ||
|
||
|
||
open Fake.Core.TargetOperators | ||
|
||
"Clean" | ||
==> "InstallClient" | ||
==> "Build" | ||
|
||
"Clean" | ||
==> "InstallClient" | ||
==> "RestoreServer" | ||
==> "Run" | ||
|
||
Target.runOrDefault "Build" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{ "sdk": { "version": "2.1.402" } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"private": true, | ||
"dependencies": { | ||
"@babel/polyfill": "7.0.0", | ||
"@babel/runtime": "7.1.2", | ||
"proj4": "^2.5.0", | ||
"react": "16.5.2", | ||
"react-bootstrap": "0.32.4", | ||
"react-dom": "16.5.2", | ||
"whatwg-fetch": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "7.1.2", | ||
"@babel/plugin-transform-runtime": "7.1.0", | ||
"@babel/preset-env": "7.1.0", | ||
"@babel/preset-react": "7.0.0", | ||
"babel-loader": "8.0.4", | ||
"concurrently": "4.0.1", | ||
"fable-loader": "2.0.0", | ||
"fable-utils": "1.2.0", | ||
"node-sass": "4.9.3", | ||
"remotedev": "0.2.7", | ||
"sass-loader": "7.1.0", | ||
"style-loader": "0.23.0", | ||
"terser-webpack-plugin": "^1.1.0", | ||
"webpack": "4.20.2", | ||
"webpack-cli": "^3.1.2", | ||
"webpack-dev-server": "3.1.9" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
group Server | ||
storage: none | ||
source https://api.nuget.org/v3/index.json | ||
|
||
nuget FSharp.Core | ||
nuget Saturn | ||
nuget Microsoft.AspNetCore.NodeServices | ||
|
||
group Client | ||
storage: none | ||
source https://api.nuget.org/v3/index.json | ||
|
||
nuget Fable.Core | ||
nuget Fable.Elmish.Debugger | ||
nuget Fable.Elmish.React | ||
nuget Fable.Elmish.HMR | ||
nuget Fulma | ||
|
||
clitool dotnet-fable | ||
|
||
group Build | ||
storage: none | ||
source https://api.nuget.org/v3/index.json | ||
|
||
nuget FSharp.Core 4.3.4 // https://github.com/fsharp/FAKE/issues/2001 | ||
nuget Fake.Core.Target | ||
nuget Fake.DotNet.Cli | ||
nuget Fake.IO.FileSystem | ||
|
||
|
||
group Test | ||
storage: none | ||
source https://api.nuget.org/v3/index.json | ||
|
||
nuget FSharp.Core | ||
nuget expecto | ||
nuget Expecto.FsCheck |
Oops, something went wrong.