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

lowercased parameters and updated sources #94

Merged
merged 2 commits into from
May 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
34 changes: 17 additions & 17 deletions Content/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"identity": "SAFE.Template",
"shortName": "SAFE",
"symbols": {
"Server": {
"server": {
"type": "parameter",
"dataType": "choice",
"defaultValue": "saturn",
Expand All @@ -29,7 +29,7 @@
}
]
},
"Fulma": {
"fulma": {
"type": "parameter",
"dataType": "choice",
"defaultValue": "basic",
Expand Down Expand Up @@ -64,19 +64,19 @@
}
]
},
"Remoting": {
"remoting": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false",
"description": "adds Fable.Remoting to server and client"
},
"NPM": {
"npm": {
"type": "parameter",
"dataType": "bool",
"defaultValue": "false",
"description": "use NPM instead of default Yarn for JS package management"
},
"Deploy": {
"deploy": {
"type": "parameter",
"dataType": "choice",
"defaultValue": "none",
Expand All @@ -102,66 +102,66 @@
"modifiers": [
{
"exclude": "**/ServerSuave.fs",
"condition": "(Server != \"suave\")"
"condition": "(server != \"suave\")"
},
{
"rename": { "ServerSuave.fs": "Server.fs" }
},
{
"exclude": "**/Suaveweb.config",
"condition": "(Server != \"suave\") || (Deploy != \"azure\")"
"condition": "(server != \"suave\") || (deploy != \"azure\")"
},
{
"rename": { "Suaveweb.config": "web.config" }
},
{
"exclude": "**/SuaveAzure.fs",
"condition": "(Server != \"suave\") || (Deploy != \"azure\")"
"condition": "(server != \"suave\") || (deploy != \"azure\")"
},
{
"rename": { "SuaveAzure.fs": "Azure.fs" }
},
{
"exclude": "**/ServerGiraffe.fs",
"condition": "(Server != \"giraffe\")"
"condition": "(server != \"giraffe\")"
},
{
"rename": { "ServerGiraffe.fs": "Server.fs" }
},
{
"exclude": "**/ServerSaturn.fs",
"condition": "(Server != \"saturn\")"
"condition": "(server != \"saturn\")"
},
{
"rename": { "ServerSaturn.fs": "Server.fs" }
},
{
"exclude": "**/admin.css",
"condition": "(Fulma != \"admin\")"
"condition": "(fulma != \"admin\")"
},
{
"exclude": "**/hero.css",
"condition": "(Fulma != \"hero\")"
"condition": "(fulma != \"hero\")"
},
{
"exclude": "**/landing.css",
"condition": "(Fulma != \"landing\")"
"condition": "(fulma != \"landing\")"
},
{
"exclude": "**/login.css",
"condition": "(Fulma != \"login\")"
"condition": "(fulma != \"login\")"
},
{
"exclude": "Dockerfile",
"condition": "(Deploy != \"docker\")"
"condition": "(deploy != \"docker\")"
},
{
"exclude": "arm-template.json",
"condition": "(Deploy != \"azure\")"
"condition": "(deploy != \"azure\")"
},
{
"exclude": "yarn.lock",
"condition": "(NPM)"
"condition": "(npm)"
}
]
}
Expand Down
14 changes: 7 additions & 7 deletions Content/build.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#r @"packages/build/FAKE/tools/FakeLib.dll"
//#if (Deploy == "azure")
//#if (deploy == "azure")
#r "netstandard"
#I "packages/build/Microsoft.Rest.ClientRuntime.Azure/lib/net452"
#load ".paket/load/netcoreapp2.1/Build/build.group.fsx"
Expand All @@ -21,7 +21,7 @@ let platformTool tool winTool =
match tryFindFileOnPath tool with Some t -> t | _ -> failwithf "%s not found" tool

let nodeTool = platformTool "node" "node.exe"
//#if (NPM)
//#if (npm)
let npmTool = platformTool "npm" "npm.cmd"
//#else
let yarnTool = platformTool "yarn" "yarn.cmd"
Expand Down Expand Up @@ -49,7 +49,7 @@ Target "InstallDotNetCore" (fun _ ->
Target "InstallClient" (fun _ ->
printfn "Node version:"
run nodeTool "--version" __SOURCE_DIRECTORY__
//#if (NPM)
//#if (npm)
printfn "Npm version:"
run npmTool "--version" __SOURCE_DIRECTORY__
run npmTool "install" __SOURCE_DIRECTORY__
Expand Down Expand Up @@ -88,7 +88,7 @@ Target "Run" (fun () ->
|> ignore
)

//#if (Deploy == "docker")
//#if (deploy == "docker")
Target "Bundle" (fun _ ->
let serverDir = deployDir </> "Server"
let clientDir = deployDir </> "Client"
Expand All @@ -113,7 +113,7 @@ Target "Docker" (fun _ ->
)

//#endif
//#if (Deploy == "azure")
//#if (deploy == "azure")
Target "Bundle" (fun () ->
run dotnetCli (sprintf "publish %s -c release -o %s" serverPath deployDir) __SOURCE_DIRECTORY__
CopyDir (deployDir </> "public") (clientPath </> "public") allFiles
Expand Down Expand Up @@ -178,10 +178,10 @@ Target "AppService" (fun _ ->
==> "InstallDotNetCore"
==> "InstallClient"
==> "Build"
//#if (Deploy == "docker")
//#if (deploy == "docker")
==> "Bundle"
==> "Docker"
//#elseif (Deploy == "azure")
//#elseif (deploy == "azure")
==> "Bundle"
==> "ArmTemplate"
==> "AppService"
Expand Down
20 changes: 10 additions & 10 deletions Content/paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ group Server
source https://api.nuget.org/v3/index.json

nuget FSharp.Core
//#if (Server == "suave")
//#if (server == "suave")
nuget Suave
//#elseif (Server == "giraffe")
//#elseif (server == "giraffe")
nuget Giraffe ~> 1
nuget Microsoft.AspNetCore
nuget Microsoft.AspNetCore.StaticFiles
//#elseif (Server == "saturn")
//#elseif (server == "saturn")
nuget Saturn
//#endif
//#if (!Remoting && Server != "suave")
//#if (!remoting && server != "suave")
nuget Fable.JsonConverter
//#elseif (Remoting && Server == "suave")
//#elseif (remoting && server == "suave")
nuget Fable.Remoting.Suave ~> 2.6
//#elseif (Remoting && Server != "suave")
//#elseif (remoting && server != "suave")
nuget Fable.Remoting.Giraffe ~> 2.6
//#endif
//#if (Deploy == "azure")
//#if (deploy == "azure")
nuget Microsoft.ApplicationInsights.AspNetCore ~> 2.2
nuget WindowsAzure.Storage
//#endif
Expand All @@ -34,10 +34,10 @@ group Client
nuget Fable.Elmish.Debugger
nuget Fable.Elmish.React
nuget Fable.Elmish.HMR
//#if (Remoting)
//#if (remoting)
nuget Fable.Remoting.Client ~> 2.4
//#endif
//#if (Fulma != "none")
//#if (fulma != "none")
nuget Fulma
//#endif

Expand All @@ -48,7 +48,7 @@ group Build
generate_load_scripts: true

nuget FAKE
//#if (Deploy == "azure")
//#if (deploy == "azure")
nuget Microsoft.Azure.Management.ResourceManager.Fluent 1.4.1
github CompositionalIT/fshelpers src/FsHelpers/ArmHelper/ArmHelper.fs
//#endif
32 changes: 16 additions & 16 deletions Content/src/Client/Client.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ open Fable.PowerPack.Fetch

open Shared

#if (Fulma != "none")
#if (fulma != "none")
open Fulma
#endif

#if (Fulma == "admin" || Fulma == "cover" || Fulma == "hero" || Fulma == "landing" || Fulma == "login")
#if (fulma == "admin" || fulma == "cover" || fulma == "hero" || fulma == "landing" || fulma == "login")
open Fulma.FontAwesome
#endif

Expand All @@ -25,7 +25,7 @@ type Msg =
| Init of Result<Counter, exn>


#if (Remoting)
#if (remoting)
module Server =

open Shared
Expand All @@ -42,7 +42,7 @@ module Server =
let init () : Model * Cmd<Msg> =
let model = None
let cmd =
#if Remoting
#if remoting
Cmd.ofAsync
Server.api.getInitCounter
()
Expand Down Expand Up @@ -74,22 +74,22 @@ let safeComponents =

let components =
[
#if (Server == "suave")
#if (server == "suave")
"Suave", "http://suave.io"
#elseif (Server == "giraffe")
#elseif (server == "giraffe")
"Giraffe", "https://github.com/giraffe-fsharp/Giraffe"
#elseif (Server == "saturn")
#elseif (server == "saturn")
"Saturn", "https://saturnframework.github.io/docs/"
#endif
"Fable", "http://fable.io"
"Elmish", "https://fable-elmish.github.io/"
#if (Fulma != "none")
#if (fulma != "none")
"Fulma", "https://mangelmaxime.github.io/Fulma"
#endif
#if (Fulma == "admin" || Fulma == "cover" || Fulma == "hero" || Fulma == "landing" || Fulma == "login")
#if (fulma == "admin" || fulma == "cover" || fulma == "hero" || fulma == "landing" || fulma == "login")
"Bulma\u00A0Templates", "https://dansup.github.io/bulma-templates/"
#endif
#if (Remoting)
#if (remoting)
"Fable.Remoting", "https://zaid-ajaj.github.io/Fable.Remoting/"
#endif
]
Expand All @@ -106,7 +106,7 @@ let show = function
| Some x -> string x
| None -> "Loading..."

#if (Fulma == "none")
#if (fulma == "none")
let view (model : Model) (dispatch : Msg -> unit) =
div []
[ h1 [] [ str "SAFE Template" ]
Expand All @@ -116,7 +116,7 @@ let view (model : Model) (dispatch : Msg -> unit) =
div [] [ str (show model) ]
button [ OnClick (fun _ -> dispatch Increment) ] [ str "+" ]
safeComponents ]
#elseif (Fulma == "basic")
#elseif (fulma == "basic")
let button txt onClick =
Button.button
[ Button.IsFullWidth
Expand All @@ -141,7 +141,7 @@ let view (model : Model) (dispatch : Msg -> unit) =
Footer.footer [ ]
[ Content.content [ Content.Modifiers [ Modifier.TextAlignment (Screen.All, TextAlignment.Centered) ] ]
[ safeComponents ] ] ]
#elseif (Fulma == "admin")
#elseif (fulma == "admin")
let navBrand =
Navbar.navbar [ Navbar.Color IsWhite ]
[ Container.container [ ]
Expand Down Expand Up @@ -351,7 +351,7 @@ let view (model : Model) (dispatch : Msg -> unit) =
hero
info
columns model dispatch ] ] ] ]
#elseif (Fulma == "cover")
#elseif (fulma == "cover")
let navBrand =
Navbar.Brand.div [ ]
[ Navbar.Item.a
Expand Down Expand Up @@ -434,7 +434,7 @@ let view (model : Model) (dispatch : Msg -> unit) =
[ li [ ]
[ a [ ]
[ str "And this at the bottom" ] ] ] ] ] ] ]
#elseif (Fulma == "hero")
#elseif (fulma == "hero")
let navBrand =
Navbar.Brand.div [ ]
[ Navbar.Item.a
Expand Down Expand Up @@ -641,7 +641,7 @@ let view (model : Model) (dispatch : Msg -> unit) =

footer [ ClassName "footer" ]
[ footerContainer ] ]
#elseif (Fulma == "landing")
#elseif (fulma == "landing")
let navBrand =
Navbar.Brand.div [ ]
[ Navbar.Item.a
Expand Down
4 changes: 2 additions & 2 deletions Content/src/Client/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ group Client
Fable.Elmish.HMR
Fable.Core
dotnet-fable
//#if (Fulma != "none")
//#if (fulma != "none")
Fulma
//#endif
//#if (Remoting)
//#if (remoting)
Fable.Remoting.Client
//#endif
14 changes: 7 additions & 7 deletions Content/src/Client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@
<head>
<title>SAFE Template</title>
<meta charset="utf-8">
<!--#if (Fulma != "none")

<!--#if (fulma != "none")
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.6.1/css/bulma.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
#endif-->
<!--#if (Fulma == "admin")

<!--#if (fulma == "admin")
<link rel="stylesheet" type="text/css" href="admin.css">
#endif-->
<!--#if (Fulma == "hero")
<!--#if (fulma == "hero")
<link rel="stylesheet" type="text/css" href="hero.css">
#endif-->
<!--#if (Fulma == "landing")
<!--#if (fulma == "landing")
<link rel="stylesheet" type="text/css" href="landing.css">
#endif-->
<!--#if (Fulma == "login")
<!--#if (fulma == "login")
<link rel="stylesheet" type="text/css" href="login.css">
#endif-->
<link rel="shortcut icon" type="image/png" href="/Images/safe_favicon.png"/>
Expand Down
Loading