├── .gitattributes ├── .paket ├── paket.exe ├── paket.exe.config ├── paket.targets └── Paket.Restore.targets ├── src └── react │ ├── Content │ ├── src │ │ ├── Home │ │ │ ├── Types.fs │ │ │ ├── State.fs │ │ │ ├── State.fs.js │ │ │ ├── Types.fs.js │ │ │ ├── View.fs │ │ │ └── View.fs.js │ │ ├── Counter │ │ │ ├── Types.fs │ │ │ ├── State.fs │ │ │ ├── State.fs.js │ │ │ ├── Types.fs.js │ │ │ ├── View.fs │ │ │ └── View.fs.js │ │ ├── paket.references │ │ ├── Global.fs │ │ ├── Types.fs │ │ ├── Info │ │ │ ├── View.fs │ │ │ └── View.fs.js │ │ ├── vite.config.ts │ │ ├── index.html │ │ ├── Global.fs.js │ │ ├── dist │ │ │ └── index.html │ │ ├── FableElmishReactTemplate.fsproj │ │ ├── Types.fs.js │ │ ├── Navbar │ │ │ ├── View.fs │ │ │ └── View.fs.js │ │ ├── State.fs │ │ ├── App.fs │ │ ├── State.fs.js │ │ └── App.fs.js │ ├── public │ │ └── img │ │ │ ├── favicon-16x16.png │ │ │ └── favicon-32x32.png │ ├── sass │ │ └── main.sass │ ├── NuGet.Config │ ├── .config │ │ └── dotnet-tools.json │ ├── paket.dependencies │ ├── .editorconfig │ ├── package.json │ ├── .template.config │ │ └── template.json │ ├── FableElmishReactTemplate.sln │ ├── .vscode │ │ └── tasks.json │ ├── paket.lock │ ├── build.fsx │ ├── RELEASE_NOTES.md │ ├── .gitattributes │ ├── .gitignore │ ├── README.md │ └── .paket │ │ └── Paket.Restore.targets │ └── Fable.Template.Elmish.React.proj ├── NuGet.Config ├── .gitignore ├── LICENSE.md └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /.paket/paket.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elmish/templates/HEAD/.paket/paket.exe -------------------------------------------------------------------------------- /src/react/Content/src/Home/Types.fs: -------------------------------------------------------------------------------- 1 | module Home.Types 2 | 3 | type Model = string 4 | 5 | type Msg = 6 | | ChangeStr of string 7 | -------------------------------------------------------------------------------- /src/react/Content/public/img/favicon-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elmish/templates/HEAD/src/react/Content/public/img/favicon-16x16.png -------------------------------------------------------------------------------- /src/react/Content/public/img/favicon-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elmish/templates/HEAD/src/react/Content/public/img/favicon-32x32.png -------------------------------------------------------------------------------- /src/react/Content/src/Counter/Types.fs: -------------------------------------------------------------------------------- 1 | module Counter.Types 2 | 3 | type Model = int 4 | 5 | type Msg = 6 | | Increment 7 | | Decrement 8 | | Reset 9 | -------------------------------------------------------------------------------- /src/react/Content/src/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Elmish.React 4 | Fable.Elmish.Browser 5 | Fable.Elmish.Debugger 6 | Fable.Elmish.HMR 7 | Fable.FontAwesome.Free -------------------------------------------------------------------------------- /src/react/Content/src/Global.fs: -------------------------------------------------------------------------------- 1 | module Global 2 | 3 | type Page = 4 | | Home 5 | | Counter 6 | | About 7 | 8 | let toHash page = 9 | match page with 10 | | About -> "#about" 11 | | Counter -> "#counter" 12 | | Home -> "#home" 13 | -------------------------------------------------------------------------------- /src/react/Content/sass/main.sass: -------------------------------------------------------------------------------- 1 | @import '../node_modules/bulma/bulma' 2 | 3 | .twitter 4 | color: #55acee !important // Override bulma 5 | border-color: #55acee 6 | 7 | .github 8 | color: $black !important // Override bulma 9 | border-color: #202020 10 | -------------------------------------------------------------------------------- /src/react/Content/src/Home/State.fs: -------------------------------------------------------------------------------- 1 | module Home.State 2 | 3 | open Elmish 4 | open Types 5 | 6 | let init () : Model * Cmd = 7 | "", [] 8 | 9 | let update msg model : Model * Cmd = 10 | match msg with 11 | | ChangeStr str -> 12 | str, [] 13 | -------------------------------------------------------------------------------- /src/react/Content/src/Home/State.fs.js: -------------------------------------------------------------------------------- 1 | import { empty } from "../fable_modules/fable-library.4.1.4/List.js"; 2 | 3 | export function init() { 4 | return ["", empty()]; 5 | } 6 | 7 | export function update(msg, model) { 8 | return [msg.fields[0], empty()]; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /src/react/Content/src/Types.fs: -------------------------------------------------------------------------------- 1 | module App.Types 2 | 3 | open Global 4 | 5 | type Msg = 6 | | CounterMsg of Counter.Types.Msg 7 | | HomeMsg of Home.Types.Msg 8 | 9 | type Model = 10 | { CurrentPage: Page 11 | Counter: Counter.Types.Model 12 | Home: Home.Types.Model } 13 | -------------------------------------------------------------------------------- /NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/react/Content/NuGet.Config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/react/Content/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "fable": { 6 | "version": "4.1.4", 7 | "commands": [ 8 | "fable" 9 | ] 10 | }, 11 | "paket": { 12 | "version": "7.2.1", 13 | "commands": [ 14 | "paket" 15 | ] 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/react/Content/paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://api.nuget.org/v3/index.json 2 | 3 | framework: netcore3.1, netstandard2.0, netstandard2.1 4 | storage:none 5 | 6 | nuget Fable.FontAwesome.Free 7 | nuget FSharp.Core 8 | nuget Fable.Core 9 | nuget Fable.Elmish.React 10 | nuget Fable.Elmish.Browser 11 | nuget Fable.Elmish.Debugger 12 | nuget Fable.Elmish.HMR -------------------------------------------------------------------------------- /src/react/Content/src/Counter/State.fs: -------------------------------------------------------------------------------- 1 | module Counter.State 2 | 3 | open Elmish 4 | open Types 5 | 6 | let init () : Model * Cmd = 7 | 0, Cmd.none 8 | 9 | let update msg model = 10 | match msg with 11 | | Increment -> 12 | model + 1, Cmd.none 13 | | Decrement -> 14 | model - 1, Cmd.none 15 | | Reset -> 16 | 0, Cmd.none 17 | -------------------------------------------------------------------------------- /src/react/Content/src/Info/View.fs: -------------------------------------------------------------------------------- 1 | module Info.View 2 | 3 | open Fable.React 4 | open Fable.React.Props 5 | 6 | let root = 7 | div 8 | [ ClassName "content" ] 9 | [ h1 10 | [ ] 11 | [ str "About page" ] 12 | p 13 | [ ] 14 | [ str "This template is a simple application build with Fable + Elmish + React." ] ] 15 | -------------------------------------------------------------------------------- /src/react/Content/src/vite.config.ts: -------------------------------------------------------------------------------- 1 | import { defineConfig } from 'vite' 2 | import react from '@vitejs/plugin-react' 3 | 4 | // https://vitejs.dev/config/ 5 | export default defineConfig({ 6 | plugins: [react()], 7 | server: { 8 | watch: { 9 | ignored: [ 10 | "**/*.fs" 11 | ] 12 | } 13 | } 14 | }) 15 | -------------------------------------------------------------------------------- /src/react/Content/.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | insert_final_newline = true 9 | charset = utf-8 10 | trim_trailing_whitespace = true 11 | indent_style = space 12 | indent_size = 4 13 | 14 | [*.styl] 15 | indent_size = 4 16 | -------------------------------------------------------------------------------- /src/react/Content/src/Info/View.fs.js: -------------------------------------------------------------------------------- 1 | import * as react from "react"; 2 | 3 | export const root = (() => { 4 | const children_4 = [react.createElement("h1", {}, "About page"), react.createElement("p", {}, "This template is a simple application build with Fable + Elmish + React.")]; 5 | return react.createElement("div", { 6 | className: "content", 7 | }, ...children_4); 8 | })(); 9 | 10 | -------------------------------------------------------------------------------- /src/react/Content/src/Counter/State.fs.js: -------------------------------------------------------------------------------- 1 | import { Cmd_none } from "../fable_modules/Fable.Elmish.4.0.1/cmd.fs.js"; 2 | 3 | export function init() { 4 | return [0, Cmd_none()]; 5 | } 6 | 7 | export function update(msg, model) { 8 | switch (msg.tag) { 9 | case 1: 10 | return [model - 1, Cmd_none()]; 11 | case 2: 12 | return [0, Cmd_none()]; 13 | default: 14 | return [model + 1, Cmd_none()]; 15 | } 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/react/Content/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FableElmishReactTemplate", 3 | "version": "1.0.0", 4 | "description": "Simple Fable App", 5 | "keywords": [], 6 | "author": "", 7 | "license": "ISC", 8 | "dependencies": { 9 | "react": "^18.2.0", 10 | "react-dom": "^18.2.0", 11 | "remotedev": "^0.2.9" 12 | }, 13 | "devDependencies": { 14 | "@vitejs/plugin-react": "^4.7.0", 15 | "bulma": "^0.9.4", 16 | "sass": "^1.62.1", 17 | "vite": "^7.1.11" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # node.js 6 | # 7 | **/node_modules/ 8 | **/npm/ 9 | npm-debug.log 10 | samples/**/public 11 | 12 | /.vscode/ 13 | 14 | # F# 15 | .fake/ 16 | .paket/paket.exe 17 | packages/ 18 | build/ 19 | obj 20 | bin 21 | out 22 | 23 | # git 24 | *.orig 25 | samples/react-native/navigation/windows/ 26 | 27 | .vs 28 | 29 | # Ignore production files generated from webpack 30 | **/public/bundle.js 31 | **/public/bundle.js.map 32 | 33 | *.nupkg 34 | *.bak 35 | 36 | paket-files/ 37 | 38 | .ionide/ 39 | -------------------------------------------------------------------------------- /src/react/Content/.template.config/template.json: -------------------------------------------------------------------------------- 1 | { 2 | "author": "Maxime Mangel", 3 | "classifications": [ 4 | "Fable", 5 | "Elmish", 6 | "React" 7 | ], 8 | "name": "Fable.Elmish.React App", 9 | "tags": { 10 | "language": "F#", 11 | "type": "project" 12 | }, 13 | "identity": "Fable.Template.Elmish.React", 14 | "groupIdentity": "FableElmishReact", 15 | "shortName": "fable-elmish-react", 16 | "sourceName": "FableElmishReactTemplate", 17 | // This allows using the `-n` option to create a new directory 18 | "preferNameDirectory": true 19 | } 20 | -------------------------------------------------------------------------------- /src/react/Content/src/Home/Types.fs.js: -------------------------------------------------------------------------------- 1 | import { Union } from "../fable_modules/fable-library.4.1.4/Types.js"; 2 | import { union_type, string_type } from "../fable_modules/fable-library.4.1.4/Reflection.js"; 3 | 4 | export class Msg extends Union { 5 | constructor(Item) { 6 | super(); 7 | this.tag = 0; 8 | this.fields = [Item]; 9 | } 10 | cases() { 11 | return ["ChangeStr"]; 12 | } 13 | } 14 | 15 | export function Msg_$reflection() { 16 | return union_type("Home.Types.Msg", [], Msg, () => [[["Item", string_type]]]); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/react/Content/src/Counter/Types.fs.js: -------------------------------------------------------------------------------- 1 | import { Union } from "../fable_modules/fable-library.4.1.4/Types.js"; 2 | import { union_type } from "../fable_modules/fable-library.4.1.4/Reflection.js"; 3 | 4 | export class Msg extends Union { 5 | constructor(tag, fields) { 6 | super(); 7 | this.tag = tag; 8 | this.fields = fields; 9 | } 10 | cases() { 11 | return ["Increment", "Decrement", "Reset"]; 12 | } 13 | } 14 | 15 | export function Msg_$reflection() { 16 | return union_type("Counter.Types.Msg", [], Msg, () => [[], [], []]); 17 | } 18 | 19 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2016 fable-elmish contributors 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. -------------------------------------------------------------------------------- /src/react/Content/src/Home/View.fs: -------------------------------------------------------------------------------- 1 | module Home.View 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open Fable.React 6 | open Fable.React.Props 7 | open Types 8 | 9 | let root model dispatch = 10 | div 11 | [ ] 12 | [ p 13 | [ ClassName "control" ] 14 | [ input 15 | [ ClassName "input" 16 | Type "text" 17 | Placeholder "Type your name" 18 | DefaultValue model 19 | AutoFocus true 20 | OnChange (fun ev -> !!ev.target?value |> ChangeStr |> dispatch ) ] ] 21 | br [ ] 22 | span 23 | [ ] 24 | [ str (sprintf "Hello %s" model) ] ] 25 | -------------------------------------------------------------------------------- /src/react/Content/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Elmish Fable App 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/react/Content/src/Global.fs.js: -------------------------------------------------------------------------------- 1 | import { Union } from "./fable_modules/fable-library.4.1.4/Types.js"; 2 | import { union_type } from "./fable_modules/fable-library.4.1.4/Reflection.js"; 3 | 4 | export class Page extends Union { 5 | constructor(tag, fields) { 6 | super(); 7 | this.tag = tag; 8 | this.fields = fields; 9 | } 10 | cases() { 11 | return ["Home", "Counter", "About"]; 12 | } 13 | } 14 | 15 | export function Page_$reflection() { 16 | return union_type("Global.Page", [], Page, () => [[], [], []]); 17 | } 18 | 19 | export function toHash(page) { 20 | switch (page.tag) { 21 | case 1: 22 | return "#counter"; 23 | case 0: 24 | return "#home"; 25 | default: 26 | return "#about"; 27 | } 28 | } 29 | 30 | -------------------------------------------------------------------------------- /src/react/Content/src/Counter/View.fs: -------------------------------------------------------------------------------- 1 | module Counter.View 2 | 3 | open Fable.Core 4 | open Fable.React 5 | open Fable.React.Props 6 | open Types 7 | 8 | let simpleButton txt action dispatch = 9 | div 10 | [ ClassName "column is-narrow" ] 11 | [ a 12 | [ ClassName "button" 13 | OnClick (fun _ -> action |> dispatch) ] 14 | [ str txt ] ] 15 | 16 | let root model dispatch = 17 | div 18 | [ ClassName "columns is-vcentered" ] 19 | [ div [ ClassName "column" ] [ ] 20 | div 21 | [ ClassName "column is-narrow" 22 | Style 23 | [ CSSProp.Width "170px" ] ] 24 | [ str (sprintf "Counter value: %i" model) ] 25 | simpleButton "+1" Increment dispatch 26 | simpleButton "-1" Decrement dispatch 27 | simpleButton "Reset" Reset dispatch 28 | div [ ClassName "column" ] [ ] ] 29 | -------------------------------------------------------------------------------- /src/react/Content/src/dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Elmish Fable App 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/react/Content/src/Home/View.fs.js: -------------------------------------------------------------------------------- 1 | import * as react from "react"; 2 | import { Msg } from "./Types.fs.js"; 3 | import { printf, toText } from "../fable_modules/fable-library.4.1.4/String.js"; 4 | 5 | export function root(model, dispatch) { 6 | let children, children_2; 7 | const children_4 = [(children = [react.createElement("input", { 8 | className: "input", 9 | type: "text", 10 | placeholder: "Type your name", 11 | defaultValue: model, 12 | autoFocus: true, 13 | onChange: (ev) => { 14 | dispatch(new Msg(ev.target.value)); 15 | }, 16 | })], react.createElement("p", { 17 | className: "control", 18 | }, ...children)), react.createElement("br", {}), (children_2 = [toText(printf("Hello %s"))(model)], react.createElement("span", {}, ...children_2))]; 19 | return react.createElement("div", {}, ...children_4); 20 | } 21 | 22 | -------------------------------------------------------------------------------- /src/react/Content/FableElmishReactTemplate.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2012 4 | Project("{f2a71f9b-5d33-465a-a702-920d77279786}") = "FableElmishReactTemplate", "src/FableElmishReactTemplate.fsproj", "{E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|Any CPU = Debug|Any CPU 9 | Release|Any CPU = Release|Any CPU 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 13 | {E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Debug|Any CPU.Build.0 = Debug|Any CPU 14 | {E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Release|Any CPU.ActiveCfg = Release|Any CPU 15 | {E5DEFC96-37CF-4844-9C9E-CFA0A9A8AED3}.Release|Any CPU.Build.0 = Release|Any CPU 16 | EndGlobalSection 17 | EndGlobal 18 | -------------------------------------------------------------------------------- /src/react/Content/src/FableElmishReactTemplate.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/react/Content/.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Start", 8 | "type": "shell", 9 | "command": "dotnet", 10 | "args": ["fsi", "build.fsx", "--watch"], 11 | "isBackground": true, 12 | "problemMatcher": { 13 | "fileLocation": "absolute", 14 | "background": { 15 | "activeOnStart": true, 16 | "beginsPattern": { 17 | "regexp": "Started Fable compilation..." 18 | } 19 | }, 20 | "pattern": { 21 | "regexp": "^(.*)\\((\\d+),(\\d+)\\): \\((\\d+),(\\d+)\\) (warning|error) FABLE: (.*)$", 22 | "file": 1, 23 | "line": 2, 24 | "column": 3, 25 | "endLine": 4, 26 | "endColumn": 5, 27 | "severity": 6, 28 | "message": 7 29 | } 30 | } 31 | } 32 | ] 33 | } 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Elmish templates 2 | 3 | ## Templates 4 | 5 | This repository contains the following templates: 6 | 7 | | Name | Short Name | Description | 8 | |---|---|---| 9 | | Fable.Template.Elmish.React | fable-elmish-react | This template will help set up a minimal elmish application to start a new project | 10 | 11 | ## How to use ? 12 | 13 | :warning: You can't use `.` or `-` in your project name. We are already tracking [this issue](https://github.com/fable-elmish/templates/issues/7) and wait for a fix in [dotnet template](https://github.com/dotnet/templating/issues/402) :warning: 14 | 15 | ```bash 16 | # First we install the template using the is Name 17 | # For dotnet 1.x 18 | dotnet new -i Fable.Template.Elmish.React::* 19 | # For dotnet 2.x 20 | dotnet new -i Fable.Template.Elmish.React 21 | 22 | # Create a project called "awesome" using the Short Name of the template 23 | # If you want to use yarn instead of npm add --yarn at the end of the command 24 | dotnet new fable-elmish-react -n awesome -lang f# 25 | 26 | # Move into your new project directory 27 | cd awesome 28 | ``` 29 | 30 | ### Maintainers 31 | 32 | To release a new version: 33 | 34 | 1. Update the Release Notes 35 | 2. Update the version in `src/react/Fable.Template.Elmish.React.proj` 36 | 3. Run `dotnet fsi build.fsx` -------------------------------------------------------------------------------- /.paket/paket.exe.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | True 10 | 11 | 12 | 13 | 14 | 15 | 16 | True 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/react/Content/src/Types.fs.js: -------------------------------------------------------------------------------- 1 | import { Record, Union } from "./fable_modules/fable-library.4.1.4/Types.js"; 2 | import { Msg_$reflection as Msg_$reflection_1 } from "./Counter/Types.fs.js"; 3 | import { Msg_$reflection as Msg_$reflection_2 } from "./Home/Types.fs.js"; 4 | import { record_type, string_type, int32_type, union_type } from "./fable_modules/fable-library.4.1.4/Reflection.js"; 5 | import { Page_$reflection } from "./Global.fs.js"; 6 | 7 | export class Msg extends Union { 8 | constructor(tag, fields) { 9 | super(); 10 | this.tag = tag; 11 | this.fields = fields; 12 | } 13 | cases() { 14 | return ["CounterMsg", "HomeMsg"]; 15 | } 16 | } 17 | 18 | export function Msg_$reflection() { 19 | return union_type("App.Types.Msg", [], Msg, () => [[["Item", Msg_$reflection_1()]], [["Item", Msg_$reflection_2()]]]); 20 | } 21 | 22 | export class Model extends Record { 23 | constructor(CurrentPage, Counter, Home) { 24 | super(); 25 | this.CurrentPage = CurrentPage; 26 | this.Counter = (Counter | 0); 27 | this.Home = Home; 28 | } 29 | } 30 | 31 | export function Model_$reflection() { 32 | return record_type("App.Types.Model", [], Model, () => [["CurrentPage", Page_$reflection()], ["Counter", int32_type], ["Home", string_type]]); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /src/react/Content/src/Navbar/View.fs: -------------------------------------------------------------------------------- 1 | module Navbar.View 2 | 3 | open Fable.FontAwesome 4 | open Fable.React 5 | open Fable.React.Props 6 | 7 | let navButton classy href icon txt = 8 | p 9 | [ ClassName "control" ] 10 | [ a 11 | [ ClassName (sprintf "button %s" classy) 12 | Href href ] 13 | [ span 14 | [ ClassName "icon" ] 15 | [ Fa.i [ icon ] [] ] 16 | span 17 | [ ] 18 | [ str txt ] ] ] 19 | 20 | let navButtons = 21 | span 22 | [ ClassName "navbar-item" ] 23 | [ div 24 | [ ClassName "field is-grouped" ] 25 | [ navButton "twitter" "https://twitter.com/FableCompiler" Fa.Brand.Twitter "Twitter" 26 | navButton "github" "https://github.com/elmish/elmish" Fa.Brand.Github "Fork me" 27 | navButton "github" "https://gitter.im/fable-compiler/Fable" Fa.Brand.Gitter "Gitter" ] ] 28 | 29 | let root = 30 | nav 31 | [ ClassName "navbar is-dark" ] 32 | [ div 33 | [ ClassName "container" ] 34 | [ div 35 | [ ClassName "navbar-brand" ] 36 | [ h1 37 | [ ClassName "navbar-item title is-4" ] 38 | [ str "Elmish" ] ] 39 | div 40 | [ ClassName "navbar-end" ] 41 | [ navButtons ] ] ] 42 | -------------------------------------------------------------------------------- /src/react/Content/src/State.fs: -------------------------------------------------------------------------------- 1 | module App.State 2 | 3 | open Elmish 4 | open Elmish.Navigation 5 | open Elmish.UrlParser 6 | open Browser 7 | open Global 8 | open Types 9 | 10 | let pageParser: ParserPage,Page> = 11 | oneOf [ 12 | map About (s "about") 13 | map Counter (s "counter") 14 | map Home (s "home") 15 | ] 16 | 17 | let urlUpdate (result : Page option) model = 18 | match result with 19 | | None -> 20 | console.error("Error parsing url") 21 | model, Navigation.modifyUrl (toHash model.CurrentPage) 22 | | Some page -> 23 | { model with CurrentPage = page }, [] 24 | 25 | let init result = 26 | let (counter, counterCmd) = Counter.State.init() 27 | let (home, homeCmd) = Home.State.init() 28 | let (model, cmd) = 29 | urlUpdate result 30 | { CurrentPage = Home 31 | Counter = counter 32 | Home = home } 33 | 34 | model, Cmd.batch [ cmd 35 | Cmd.map CounterMsg counterCmd 36 | Cmd.map HomeMsg homeCmd ] 37 | 38 | let update msg model = 39 | match msg with 40 | | CounterMsg msg -> 41 | let (counter, counterCmd) = Counter.State.update msg model.Counter 42 | { model with Counter = counter }, Cmd.map CounterMsg counterCmd 43 | | HomeMsg msg -> 44 | let (home, homeCmd) = Home.State.update msg model.Home 45 | { model with Home = home }, Cmd.map HomeMsg homeCmd 46 | -------------------------------------------------------------------------------- /src/react/Content/src/Counter/View.fs.js: -------------------------------------------------------------------------------- 1 | import * as react from "react"; 2 | import { HTMLAttr } from "../fable_modules/Fable.React.9.3.0/Fable.React.Props.fs.js"; 3 | import { printf, toText } from "../fable_modules/fable-library.4.1.4/String.js"; 4 | import { keyValueList } from "../fable_modules/fable-library.4.1.4/MapUtil.js"; 5 | import { Msg } from "./Types.fs.js"; 6 | 7 | export function simpleButton(txt, action, dispatch) { 8 | const children_2 = [react.createElement("a", { 9 | className: "button", 10 | onClick: (_arg) => { 11 | dispatch(action); 12 | }, 13 | }, txt)]; 14 | return react.createElement("div", { 15 | className: "column is-narrow", 16 | }, ...children_2); 17 | } 18 | 19 | export function root(model, dispatch) { 20 | let props_2, children_2; 21 | const children_6 = [react.createElement("div", { 22 | className: "column", 23 | }), (props_2 = [new HTMLAttr(64, ["column is-narrow"]), ["style", { 24 | width: "170px", 25 | }]], (children_2 = [toText(printf("Counter value: %i"))(model)], react.createElement("div", keyValueList(props_2, 1), ...children_2))), simpleButton("+1", new Msg(0, []), dispatch), simpleButton("-1", new Msg(1, []), dispatch), simpleButton("Reset", new Msg(2, []), dispatch), react.createElement("div", { 26 | className: "column", 27 | })]; 28 | return react.createElement("div", { 29 | className: "columns is-vcentered", 30 | }, ...children_6); 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/react/Content/src/App.fs: -------------------------------------------------------------------------------- 1 | module App.View 2 | 3 | open Elmish 4 | open Elmish.Navigation 5 | open Elmish.UrlParser 6 | open Fable.Core 7 | open Fable.Core.JsInterop 8 | open Types 9 | open App.State 10 | open Global 11 | 12 | importSideEffects "../sass/main.sass" 13 | 14 | open Fable.React 15 | open Fable.React.Props 16 | 17 | let menuItem label page currentPage = 18 | li 19 | [ ] 20 | [ a 21 | [ classList [ "is-active", page = currentPage ] 22 | Href (toHash page) ] 23 | [ str label ] ] 24 | 25 | let menu currentPage = 26 | aside 27 | [ ClassName "menu" ] 28 | [ p 29 | [ ClassName "menu-label" ] 30 | [ str "General" ] 31 | ul 32 | [ ClassName "menu-list" ] 33 | [ menuItem "Home" Home currentPage 34 | menuItem "Counter sample" Counter currentPage 35 | menuItem "About" Page.About currentPage ] ] 36 | 37 | let root model dispatch = 38 | 39 | let pageHtml page = 40 | match page with 41 | | Page.About -> Info.View.root 42 | | Counter -> Counter.View.root model.Counter (CounterMsg >> dispatch) 43 | | Home -> Home.View.root model.Home (HomeMsg >> dispatch) 44 | 45 | div 46 | [] 47 | [ Navbar.View.root 48 | div 49 | [ ClassName "section" ] 50 | [ div 51 | [ ClassName "container" ] 52 | [ div 53 | [ ClassName "columns" ] 54 | [ div 55 | [ ClassName "column is-3" ] 56 | [ menu model.CurrentPage ] 57 | div 58 | [ ClassName "column" ] 59 | [ pageHtml model.CurrentPage ] ] ] ] ] 60 | 61 | open Elmish.React 62 | open Elmish.Debug 63 | open Elmish.HMR 64 | 65 | // App 66 | Program.mkProgram init update root 67 | |> Program.toNavigable (parseHash pageParser) urlUpdate 68 | //-:cnd:noEmit 69 | #if DEBUG 70 | |> Program.withDebugger 71 | #endif 72 | //+:cnd:noEmit 73 | |> Program.withReactBatched "elmish-app" 74 | |> Program.run 75 | -------------------------------------------------------------------------------- /src/react/Fable.Template.Elmish.React.proj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Simple elmish application using React as a renderer 4 | Maxime Mangel 5 | https://github.com/fable-elmish/elmish 6 | https://github.com/fable-elmish/fable-elmish.git 7 | fable;template;fsharp 8 | en-US 9 | Template 10 | true 11 | 0.8.0 12 | $(MSBuildProjectFullPath) 13 | true 14 | false 15 | netstandard2.0 16 | true 17 | README.md 18 | LICENSE.md 19 | 20 | 21 | 22 | Content/node_modules/**/*; 23 | Content/packages/**/*; 24 | Content/public/bundle.js*; 25 | Content/bin/**/*; 26 | Content/obj/**/*; 27 | Content/.fable/**/*; 28 | Content/deploy/**/*; 29 | Content/src/bin/**/*; 30 | Content/src/obj/**/*; 31 | Content/src/.fable/**/*; 32 | Content/src/fable_modules/**/*; 33 | Content/src/dist/**/*; 34 | Content/src/**/*.fs.js; 35 | Content/src/**/*.fs.js.map; 36 | 37 | 38 | 39 | 40 | Content\ 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/react/Content/src/State.fs.js: -------------------------------------------------------------------------------- 1 | import { oneOf, s, map } from "./fable_modules/Fable.Elmish.UrlParser.1.0.1/parser.fs.js"; 2 | import { toHash, Page } from "./Global.fs.js"; 3 | import { empty, ofArray } from "./fable_modules/fable-library.4.1.4/List.js"; 4 | import { Msg, Model } from "./Types.fs.js"; 5 | import { some } from "./fable_modules/fable-library.4.1.4/Option.js"; 6 | import { Navigation_modifyUrl } from "./fable_modules/Fable.Elmish.Browser.4.0.1/navigation.fs.js"; 7 | import { update as update_2, init as init_1 } from "./Counter/State.fs.js"; 8 | import { update as update_1, init as init_2 } from "./Home/State.fs.js"; 9 | import { Cmd_map, Cmd_batch } from "./fable_modules/Fable.Elmish.4.0.1/cmd.fs.js"; 10 | 11 | export const pageParser = (() => { 12 | const parsers = ofArray([map(new Page(2, []), s("about")), map(new Page(1, []), s("counter")), map(new Page(0, []), s("home"))]); 13 | return (state) => oneOf(parsers, state); 14 | })(); 15 | 16 | export function urlUpdate(result, model) { 17 | if (result != null) { 18 | return [new Model(result, model.Counter, model.Home), empty()]; 19 | } 20 | else { 21 | console.error(some("Error parsing url")); 22 | return [model, Navigation_modifyUrl(toHash(model.CurrentPage))]; 23 | } 24 | } 25 | 26 | export function init(result) { 27 | const patternInput = init_1(); 28 | const patternInput_1 = init_2(); 29 | const patternInput_2 = urlUpdate(result, new Model(new Page(0, []), patternInput[0], patternInput_1[0])); 30 | return [patternInput_2[0], Cmd_batch(ofArray([patternInput_2[1], Cmd_map((arg) => (new Msg(0, [arg])), patternInput[1]), Cmd_map((arg_1) => (new Msg(1, [arg_1])), patternInput_1[1])]))]; 31 | } 32 | 33 | export function update(msg, model) { 34 | if (msg.tag === 1) { 35 | const patternInput_1 = update_1(msg.fields[0], model.Home); 36 | return [new Model(model.CurrentPage, model.Counter, patternInput_1[0]), Cmd_map((arg_1) => (new Msg(1, [arg_1])), patternInput_1[1])]; 37 | } 38 | else { 39 | const patternInput = update_2(msg.fields[0], model.Counter); 40 | return [new Model(model.CurrentPage, patternInput[0], model.Home), Cmd_map((arg) => (new Msg(0, [arg])), patternInput[1])]; 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/react/Content/src/Navbar/View.fs.js: -------------------------------------------------------------------------------- 1 | import { printf, toText } from "../fable_modules/fable-library.4.1.4/String.js"; 2 | import { HTMLAttr } from "../fable_modules/Fable.React.9.3.0/Fable.React.Props.fs.js"; 3 | import { Fa_IconOption, Fa_i } from "../fable_modules/Fable.FontAwesome.3.0.0/FontAwesome.fs.js"; 4 | import { singleton } from "../fable_modules/fable-library.4.1.4/List.js"; 5 | import * as react from "react"; 6 | import { keyValueList } from "../fable_modules/fable-library.4.1.4/MapUtil.js"; 7 | 8 | export function navButton(classy, href, icon, txt) { 9 | let props_4, children_4, children; 10 | const children_6 = [(props_4 = [new HTMLAttr(64, [toText(printf("button %s"))(classy)]), new HTMLAttr(94, [href])], (children_4 = [(children = [Fa_i(singleton(icon), [])], react.createElement("span", { 11 | className: "icon", 12 | }, ...children)), react.createElement("span", {}, txt)], react.createElement("a", keyValueList(props_4, 1), ...children_4)))]; 13 | return react.createElement("p", { 14 | className: "control", 15 | }, ...children_6); 16 | } 17 | 18 | export const navButtons = (() => { 19 | let children; 20 | const children_2 = [(children = [navButton("twitter", "https://twitter.com/FableCompiler", new Fa_IconOption(11, ["fab fa-twitter"]), "Twitter"), navButton("github", "https://github.com/elmish/elmish", new Fa_IconOption(11, ["fab fa-github"]), "Fork me"), navButton("github", "https://gitter.im/fable-compiler/Fable", new Fa_IconOption(11, ["fab fa-gitter"]), "Gitter")], react.createElement("div", { 21 | className: "field is-grouped", 22 | }, ...children))]; 23 | return react.createElement("span", { 24 | className: "navbar-item", 25 | }, ...children_2); 26 | })(); 27 | 28 | export const root = (() => { 29 | let children_6, children_2; 30 | const children_8 = [(children_6 = [(children_2 = [react.createElement("h1", { 31 | className: "navbar-item title is-4", 32 | }, "Elmish")], react.createElement("div", { 33 | className: "navbar-brand", 34 | }, ...children_2)), react.createElement("div", { 35 | className: "navbar-end", 36 | }, navButtons)], react.createElement("div", { 37 | className: "container", 38 | }, ...children_6))]; 39 | return react.createElement("nav", { 40 | className: "navbar is-dark", 41 | }, ...children_8); 42 | })(); 43 | 44 | -------------------------------------------------------------------------------- /src/react/Content/paket.lock: -------------------------------------------------------------------------------- 1 | STORAGE: NONE 2 | RESTRICTION: || (== netcoreapp3.1) (== netstandard2.0) (== netstandard2.1) 3 | NUGET 4 | remote: https://api.nuget.org/v3/index.json 5 | Fable.Browser.Blob (1.3) 6 | Fable.Core (>= 3.0) 7 | FSharp.Core (>= 4.7.2) 8 | Fable.Browser.Dom (2.14) 9 | Fable.Browser.Blob (>= 1.3) 10 | Fable.Browser.Event (>= 1.5) 11 | Fable.Browser.WebStorage (>= 1.2) 12 | Fable.Core (>= 3.2.8) 13 | FSharp.Core (>= 4.7.2) 14 | Fable.Browser.Event (1.5) 15 | Fable.Browser.Gamepad (>= 1.1) 16 | Fable.Core (>= 3.0) 17 | FSharp.Core (>= 4.7.2) 18 | Fable.Browser.Gamepad (1.2) 19 | Fable.Core (>= 3.0) 20 | FSharp.Core (>= 4.7.2) 21 | Fable.Browser.WebStorage (1.2) 22 | Fable.Browser.Event (>= 1.5) 23 | Fable.Core (>= 3.0) 24 | FSharp.Core (>= 4.7.2) 25 | Fable.Core (4.0) 26 | Fable.Elmish (4.0.1) 27 | Fable.Core (>= 3.7.1) 28 | FSharp.Core (>= 4.7.2) 29 | Fable.Elmish.Browser (4.0.1) 30 | Fable.Browser.Dom (>= 2.10.1) 31 | Fable.Elmish (>= 4.0) 32 | Fable.Elmish.UrlParser (>= 1.0.1) 33 | FSharp.Core (>= 4.7.2) 34 | Fable.Elmish.Debugger (4.0) 35 | Fable.Elmish (>= 4.0) 36 | FSharp.Core (>= 6.0.7) 37 | Thoth.Json (>= 6.0) 38 | Fable.Elmish.HMR (7.0) 39 | Fable.Core (>= 3.7.1) 40 | Fable.Elmish.React (>= 4.0) 41 | FSharp.Core (>= 4.7.2) 42 | Fable.Elmish.React (4.0) 43 | Fable.Elmish (>= 4.0) 44 | Fable.ReactDom.Types (>= 18.0) 45 | FSharp.Core (>= 4.7.2) 46 | Fable.Elmish.UrlParser (1.0.1) 47 | FSharp.Core (>= 4.7.2) 48 | Fable.FontAwesome (3.0) 49 | Fable.Core (>= 3.7.1) 50 | Fable.React (>= 9.2) 51 | Fable.FontAwesome.Free (3.0) 52 | Fable.Core (>= 3.7.1) 53 | Fable.FontAwesome (>= 3.0) 54 | Fable.React (>= 9.2) 55 | Fable.React (9.3) 56 | Fable.React.Types (>= 18.3) 57 | Fable.ReactDom.Types (>= 18.2) 58 | FSharp.Core (>= 4.7.2) 59 | Fable.React.Types (18.3) 60 | Fable.Browser.Dom (>= 2.4.4) 61 | Fable.Core (>= 3.2.7) 62 | FSharp.Core (>= 4.7.2) 63 | Fable.ReactDom.Types (18.2) 64 | Fable.React.Types (>= 18.3) 65 | FSharp.Core (>= 4.7.2) 66 | FSharp.Core (7.0.300) 67 | Thoth.Json (10.1) 68 | Fable.Core (>= 3.1.6) 69 | FSharp.Core (>= 4.7.2) 70 | -------------------------------------------------------------------------------- /src/react/Content/build.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: Fun.Build, 0.3.8" 2 | #r "nuget: Fake.IO.FileSystem, 5.23.1" 3 | 4 | open Fun.Build 5 | open Fake.IO 6 | open Fake.IO.Globbing.Operators 7 | open Fake.IO.FileSystemOperators 8 | 9 | [] 10 | let SRC_DIR = "src" 11 | 12 | module Glob = 13 | 14 | let fableJs baseDir = 15 | baseDir 16 | "**/*.fs.js" 17 | 18 | let fableJsMap baseDir = 19 | baseDir 20 | "**/*.fs.js.map" 21 | 22 | pipeline "Client" { 23 | 24 | stage "Restore dependencies" { 25 | run "dotnet tool restore" 26 | run "npm install" 27 | } 28 | 29 | stage "Clean artifacts" { 30 | paralle 31 | 32 | run(fun _ -> 33 | [ SRC_DIR "bin"; SRC_DIR "obj"; SRC_DIR "dist" ] 34 | |> Shell.cleanDirs 35 | ) 36 | 37 | run(fun _ -> 38 | !!(Glob.fableJs SRC_DIR) 39 | ++ (Glob.fableJsMap SRC_DIR) 40 | |> Seq.iter Shell.rm 41 | ) 42 | } 43 | 44 | stage "Restore dependencies" { 45 | // This is to avoid errors from the IDE because 46 | // we deleted the obj and bin folder 47 | workingDir "src" 48 | 49 | run "dotnet build" 50 | // Accept exit code 0 and 1 because it can happen that the user 51 | // relaunches the build when having errors in the code 52 | acceptExitCodes [ 0; 1 ] 53 | // Hide the output in the console for the same reason 54 | // no need to afraid the user with non useful errors 55 | // If there are errors, the IDE will show them or the next steps will reveal them 56 | noStdRedirectForStep 57 | } 58 | 59 | stage "Watch" { 60 | workingDir "src" 61 | 62 | whenCmd { 63 | name "--watch" 64 | alias "-w" 65 | description "Watch for changes and rebuild" 66 | } 67 | 68 | paralle 69 | 70 | run "dotnet fable watch --sourceMaps" 71 | run "npx vite" 72 | } 73 | 74 | stage "Build" { 75 | workingDir "src" 76 | 77 | whenNot { 78 | whenCmd { 79 | name "--watch" 80 | alias "-w" 81 | description "Watch for changes and rebuild" 82 | } 83 | } 84 | 85 | run "dotnet fable" 86 | run "npx vite build" 87 | } 88 | 89 | runIfOnlySpecified false 90 | } 91 | 92 | tryPrintPipelineCommandHelp() 93 | -------------------------------------------------------------------------------- /src/react/Content/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.8.0 2 | 3 | * Add the problemMatcher patterns to support Fable 4 4 | 5 | ### 0.7.0 6 | 7 | * Upgrade to Fable 4 8 | * Upgrade to Fable.Elmish 4 9 | * Remove yarn support and keep only npm (makes maintenance easier) 10 | * Use Paket as a dotnet tool 11 | * Use Fun.Build as the build system 12 | 13 | ### 0.6.0 14 | 15 | ### 0.5.0 16 | 17 | * Update dependencies 18 | * Update to Fable.Core 3 19 | * Update paket.exe 20 | 21 | ### 0.4.0 22 | 23 | * Update dependencies 24 | * Update to Fable 2.1 25 | * Fix #3: Fix indentation and uppercase 26 | 27 | ### 0.3.5 28 | 29 | * Update paket.exe 30 | 31 | ### 0.3.4 32 | 33 | * Fix mistakes in the README 34 | * Add VSCode tasks 35 | * Fix IE11 support 36 | * Use source-map only during development 37 | * Update dependencies 38 | 39 | ### 0.3.3 40 | 41 | * Add Fable.Elmish.HMR 42 | 43 | ### 0.3.2 44 | 45 | * Fix #30: Upgrade dependencies, use Fable.React 1.2.0 46 | 47 | ### 0.3.1 48 | 49 | * Fix dotnet version in README 50 | 51 | ### 0.3.0 52 | 53 | * Go to netstandard2.0 54 | * Updates all deps (.Net & JS) 55 | 56 | ### 0.2.6 57 | 58 | * Include user choice between npm5 and yarn 59 | * Fix viewport (eg: for mobile) 60 | * Update dependencies to latest version 61 | * Better documention in the README.md 62 | * Webpack 3 63 | * Move project file into src 64 | 65 | ### 0.2.5 66 | 67 | * Use dotnet-fable as clitool 68 | * Fix Navbar display 69 | * Fix #15: Prevent template engine to process paket files 70 | * Do not emit: //+:cnd in App.fs 71 | 72 | ### 0.2.4 73 | 74 | * Update paket to latest version 75 | 76 | ### 0.2.3 77 | 78 | * Move RELEASE_NOTES into template directory 79 | * Fix #12: Could not download FSharp.Core 4.2 80 | 81 | ### 0.2.2 82 | 83 | * Update to Fable 1.0.8 84 | * Update npm packages to latest versions 85 | 86 | ### 0.2.0 87 | 88 | * Use Paket to resolve Fable deps 89 | * Change `GroupIdentity` to prevent conflict with *Fable simple* template 90 | 91 | ### 0.1.8 92 | 93 | * Simply `toHash` function. Remove `function` in favor of `match page with` 94 | * Remove `classList` helper. It's now present in `fable-react` 95 | * Set minimun version supported in package.json 96 | 97 | ### 0.1.7 98 | 99 | * Fix `fable-core` to use `next` version 100 | * Update react/*.proj file 101 | * Fix `DEBUG` conditional statement 102 | 103 | ### 0.1.6 104 | 105 | * Set all fable-dependencies to use `next` version 106 | * Fix nuget file. (There was node_modules inside of it.) 107 | * Fix void elements usage 108 | -------------------------------------------------------------------------------- /src/react/Content/.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /src/react/Content/src/App.fs.js: -------------------------------------------------------------------------------- 1 | import { Helpers_classList } from "./fable_modules/Fable.React.9.3.0/Fable.React.Helpers.fs.js"; 2 | import { equals } from "./fable_modules/fable-library.4.1.4/Util.js"; 3 | import { Page, toHash } from "./Global.fs.js"; 4 | import { HTMLAttr } from "./fable_modules/Fable.React.9.3.0/Fable.React.Props.fs.js"; 5 | import * as react from "react"; 6 | import { keyValueList } from "./fable_modules/fable-library.4.1.4/MapUtil.js"; 7 | import { root as root_1 } from "./Navbar/View.fs.js"; 8 | import { root as root_2 } from "./Counter/View.fs.js"; 9 | import { Msg } from "./Types.fs.js"; 10 | import { root as root_3 } from "./Home/View.fs.js"; 11 | import { root as root_4 } from "./Info/View.fs.js"; 12 | import { ProgramModule_run } from "./fable_modules/Fable.Elmish.HMR.7.0.0/../Fable.Elmish.4.0.1/program.fs.js"; 13 | import { Program_withReactBatched } from "./fable_modules/Fable.Elmish.HMR.7.0.0/../Fable.Elmish.React.4.0.0/react.fs.js"; 14 | import { ProgramModule_toNavigable } from "./fable_modules/Fable.Elmish.Browser.4.0.1/navigation.fs.js"; 15 | import { parseHash } from "./fable_modules/Fable.Elmish.Browser.4.0.1/parser.fs.js"; 16 | import { update, init, urlUpdate as urlUpdate_1, pageParser } from "./State.fs.js"; 17 | import { ProgramModule_mkProgram } from "./fable_modules/Fable.Elmish.4.0.1/program.fs.js"; 18 | import "../sass/main.sass"; 19 | 20 | 21 | export function menuItem(label, page, currentPage) { 22 | let props; 23 | const children_2 = [(props = [Helpers_classList([["is-active", equals(page, currentPage)]]), new HTMLAttr(94, [toHash(page)])], react.createElement("a", keyValueList(props, 1), label))]; 24 | return react.createElement("li", {}, ...children_2); 25 | } 26 | 27 | export function menu(currentPage) { 28 | let children_2; 29 | const children_4 = [react.createElement("p", { 30 | className: "menu-label", 31 | }, "General"), (children_2 = [menuItem("Home", new Page(0, []), currentPage), menuItem("Counter sample", new Page(1, []), currentPage), menuItem("About", new Page(2, []), currentPage)], react.createElement("ul", { 32 | className: "menu-list", 33 | }, ...children_2))]; 34 | return react.createElement("aside", { 35 | className: "menu", 36 | }, ...children_4); 37 | } 38 | 39 | export function root(model, dispatch) { 40 | let children_8, children_6, children_4, children, children_2, page; 41 | const children_10 = [root_1, (children_8 = [(children_6 = [(children_4 = [(children = [menu(model.CurrentPage)], react.createElement("div", { 42 | className: "column is-3", 43 | }, ...children)), (children_2 = [(page = model.CurrentPage, (page.tag === 1) ? root_2(model.Counter, (arg_1) => { 44 | dispatch(new Msg(0, [arg_1])); 45 | }) : ((page.tag === 0) ? root_3(model.Home, (arg_3) => { 46 | dispatch(new Msg(1, [arg_3])); 47 | }) : root_4))], react.createElement("div", { 48 | className: "column", 49 | }, ...children_2))], react.createElement("div", { 50 | className: "columns", 51 | }, ...children_4))], react.createElement("div", { 52 | className: "container", 53 | }, ...children_6))], react.createElement("div", { 54 | className: "section", 55 | }, ...children_8))]; 56 | return react.createElement("div", {}, ...children_10); 57 | } 58 | 59 | ProgramModule_run(Program_withReactBatched("elmish-app", ProgramModule_toNavigable((location) => parseHash(pageParser, location), urlUpdate_1, ProgramModule_mkProgram(init, update, root)))); 60 | 61 | -------------------------------------------------------------------------------- /src/react/Content/.gitignore: -------------------------------------------------------------------------------- 1 | public/bundle.js* 2 | 3 | # Node 4 | node_modules/ 5 | 6 | ## Ignore Visual Studio temporary files, build results, and 7 | ## files generated by popular Visual Studio add-ons. 8 | 9 | # User-specific files 10 | *.suo 11 | *.user 12 | *.sln.docstates 13 | 14 | # Xamarin Studio / monodevelop user-specific 15 | *.userprefs 16 | *.dll.mdb 17 | *.exe.mdb 18 | 19 | # JetBrains IDEs (e.g. JetBrains Rider) 20 | .idea/ 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Rr]elease/ 25 | x64/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | 29 | # MSTest test Results 30 | [Tt]est[Rr]esult*/ 31 | [Bb]uild[Ll]og.* 32 | 33 | *_i.c 34 | *_p.c 35 | *.ilk 36 | *.meta 37 | *.obj 38 | *.pch 39 | *.pdb 40 | *.pgc 41 | *.pgd 42 | *.rsp 43 | *.sbr 44 | *.tlb 45 | *.tli 46 | *.tlh 47 | *.tmp 48 | *.tmp_proj 49 | *.log 50 | *.vspscc 51 | *.vssscc 52 | .builds 53 | *.pidb 54 | *.log 55 | *.scc 56 | 57 | # Visual C++ cache files 58 | ipch/ 59 | *.aps 60 | *.ncb 61 | *.opensdf 62 | *.sdf 63 | *.cachefile 64 | 65 | # Visual Studio profiler 66 | *.psess 67 | *.vsp 68 | *.vspx 69 | 70 | # Other Visual Studio data 71 | .vs/ 72 | 73 | # Guidance Automation Toolkit 74 | *.gpState 75 | 76 | # ReSharper is a .NET coding add-in 77 | _ReSharper*/ 78 | *.[Rr]e[Ss]harper 79 | 80 | # TeamCity is a build add-in 81 | _TeamCity* 82 | 83 | # DotCover is a Code Coverage Tool 84 | *.dotCover 85 | 86 | # NCrunch 87 | *.ncrunch* 88 | .*crunch*.local.xml 89 | 90 | # Installshield output folder 91 | #[Ee]xpress/ 92 | 93 | # DocProject is a documentation generator add-in 94 | DocProject/buildhelp/ 95 | DocProject/Help/*.HxT 96 | DocProject/Help/*.HxC 97 | DocProject/Help/*.hhc 98 | DocProject/Help/*.hhk 99 | DocProject/Help/*.hhp 100 | DocProject/Help/Html2 101 | DocProject/Help/html 102 | 103 | # Click-Once directory 104 | publish/ 105 | 106 | # Publish Web Output 107 | *.Publish.xml 108 | 109 | # Enable nuget.exe in the .nuget folder (though normally executables are not tracked) 110 | !.nuget/NuGet.exe 111 | 112 | # Windows Azure Build Output 113 | csx 114 | *.build.csdef 115 | 116 | # Windows Store app package directory 117 | AppPackages/ 118 | 119 | # Others 120 | sql/ 121 | *.Cache 122 | ClientBin/ 123 | [Ss]tyle[Cc]op.* 124 | ~$* 125 | *~ 126 | *.dbmdl 127 | *.[Pp]ublish.xml 128 | *.pfx 129 | *.publishsettings 130 | 131 | # RIA/Silverlight projects 132 | Generated_Code/ 133 | 134 | # Backup & report files from converting an old project file to a newer 135 | # Visual Studio version. Backup files are not needed, because we have git ;-) 136 | _UpgradeReport_Files/ 137 | Backup*/ 138 | UpgradeLog*.XML 139 | UpgradeLog*.htm 140 | 141 | # SQL Server files 142 | App_Data/*.mdf 143 | App_Data/*.ldf 144 | 145 | 146 | #LightSwitch generated files 147 | GeneratedArtifacts/ 148 | _Pvt_Extensions/ 149 | ModelManifest.xml 150 | 151 | # ========================= 152 | # Windows detritus 153 | # ========================= 154 | 155 | # Windows image file caches 156 | Thumbs.db 157 | ehthumbs.db 158 | 159 | # Folder config file 160 | Desktop.ini 161 | 162 | # Recycle Bin used on file shares 163 | $RECYCLE.BIN/ 164 | 165 | # Mac desktop service store files 166 | .DS_Store 167 | 168 | # =================================================== 169 | # Exclude F# project specific directories and files 170 | # =================================================== 171 | 172 | # NuGet Packages Directory 173 | packages/ 174 | 175 | # Generated documentation folder 176 | docs/output/ 177 | 178 | # Temp folder used for publishing docs 179 | temp*/ 180 | 181 | # Test results produced by build 182 | TestResults.xml 183 | TestResult.xml 184 | 185 | # Nuget outputs 186 | nuget/*.nupkg 187 | release.cmd 188 | release.sh 189 | localpackages/ 190 | paket-files 191 | *.orig 192 | docs/content/license.md 193 | docs/content/release-notes.md 194 | .fake 195 | docs/tools/FSharp.Formatting.svclog 196 | .ionide.debug 197 | *.bak 198 | project.lock.json 199 | deploy/ 200 | obj 201 | bin 202 | out 203 | .fable 204 | -------------------------------------------------------------------------------- /.paket/paket.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | true 7 | $(MSBuildThisFileDirectory) 8 | $(MSBuildThisFileDirectory)..\ 9 | $(PaketRootPath)paket.lock 10 | $(PaketRootPath)paket-files\paket.restore.cached 11 | /Library/Frameworks/Mono.framework/Commands/mono 12 | mono 13 | 14 | 15 | 16 | 17 | $(PaketRootPath)paket.exe 18 | $(PaketToolsPath)paket.exe 19 | "$(PaketExePath)" 20 | $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" 21 | 22 | 23 | 24 | 25 | 26 | $(MSBuildProjectFullPath).paket.references 27 | 28 | 29 | 30 | 31 | $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references 32 | 33 | 34 | 35 | 36 | $(MSBuildProjectDirectory)\paket.references 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | $(PaketCommand) restore --references-file "$(PaketReferences)" 49 | 50 | RestorePackages; $(BuildDependsOn); 51 | 52 | 53 | 54 | true 55 | 56 | 57 | 58 | $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) 59 | $([System.IO.File]::ReadAllText('$(PaketLockFilePath)')) 60 | true 61 | false 62 | true 63 | 64 | 65 | 71 | 72 | 73 | -------------------------------------------------------------------------------- /src/react/Content/README.md: -------------------------------------------------------------------------------- 1 | # Fable.Elmish.React Template 2 | 3 | This template can be used to generate a simple web app with [Fable](http://fable.io/) and [Elmish](https://fable-elmish.github.io/). 4 | You can find more templates by searching `Fable.Template` packages in [Nuget](https://www.nuget.org). 5 | 6 | ## Requirements 7 | 8 | * [.NET 6](https://www.microsoft.com/net/download/core) or higher 9 | * [node.js](https://nodejs.org) 4.8.2 or higher 10 | * npm: JS package manager 11 | 12 | Although is not a Fable requirement, on macOS and Linux you'll need [Mono](http://www.mono-project.com/) for other F# tooling like Paket or editor support. 13 | 14 | ## Installing the template 15 | 16 | In a terminal, run `dotnet new -i Fable.Template.Elmish.React::*` to install or update the template to latest version. 17 | 18 | > In some shells you many need quotations: `dotnet new -i "Fable.Template.Elmish.React::*"`. If you use the dotnet core SDK version 2 or higher, you should only need to type `dotnet new -i Fable.Template.Elmish.React`. 19 | 20 | ## Creating a new project with the template 21 | 22 | In a terminal, run `dotnet new fable-elmish-react` to create a project in the current directory. Type `dotnet new fable-elmish-react -n awesome` instead to create a subfolder named `awesome` and put the new project there. 23 | 24 | > The project will have the name of the directory. You may get some issues if the directory name contains some special characters like hyphens 25 | 26 | ## Building and running the app 27 | 28 | Run `dotnet fsi build.fsx --watch` to start the development server. Whenever you modify a file, the server will be updated automatically. 29 | 30 | You can then access the app at http://localhost:3000. If the port is already used another port will be chosen automatically (look at your console to know which one). 31 | 32 | If you are using VS Code + [Ionide](http://ionide.io/), you can also use VSCode task runner. This also has the advantage that Fable-specific errors will be highlighted in the editor along with other F# errors. 33 | 34 | 1. Press `Ctrl+Shift+P` (Cmd+Shift+P on macOS) and type `Run task` to build the project. 35 | 2. Select `Tasks: Run Task` and press Enter. 36 | 3. Select `Start` and press Enter. 37 | 38 | Any modification you do to the F# code will be reflected in the web page after saving. 39 | 40 | When you want to build you application, run `dotnet fsi build.fsx`. You will find the result in the `src/dist/` folder. 41 | 42 | ## Project structure 43 | 44 | ### Paket 45 | 46 | [Paket](https://fsprojects.github.io/Paket/) is the package manager used for F# dependencies. It doesn't need a global installation, the binary is included in the `.paket` folder. Other Paket related files are: 47 | 48 | - **paket.dependencies**: contains all the dependencies in the repository. 49 | - **paket.references**: there should be one such a file next to each `.fsproj` file. 50 | - **paket.lock**: automatically generated, but should committed to source control, [see why](https://fsprojects.github.io/Paket/faq.html#Why-should-I-commit-the-lock-file). 51 | - **Nuget.Config**: prevents conflicts with Paket in machines with some Nuget configuration. 52 | 53 | > Paket dependencies will be installed in the `packages` directory. See [Paket website](https://fsprojects.github.io/Paket/) for more info. 54 | 55 | ### npm 56 | 57 | - **package.json**: contains the JS dependencies together with other info, like development scripts. 58 | - **package-lock.json**: is the lock file created by npm5. 59 | 60 | > JS dependencies will be installed in `node_modules`. See [npm](https://www.npmjs.com/) website for more info. 61 | 62 | ### Vite 63 | 64 | [Vite](https://vitejs.dev/) is a bundler, which links different JS sources into a single file making deployment much easier. It also offers other features, like a static dev server that can automatically refresh the browser upon changes in your code or a minifier for production release. Fable interacts with Vite like any JavaScript code. 65 | 66 | - **vite.config.ts**: is the configuration file for Vite. It allows you to set many things: like the path of the bundle, the port for the development server, etc. See [Vite website](https://vitejs.dev/) for more info. 67 | 68 | ### build.fsx 69 | 70 | `build.fsx` is a script which is responsible for controlling the build process. It use [Fun.Build](https://github.com/slaveOftime/Fun.Build). 71 | -------------------------------------------------------------------------------- /.paket/Paket.Restore.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 8 | 9 | true 10 | $(MSBuildThisFileDirectory) 11 | $(MSBuildThisFileDirectory)..\ 12 | $(PaketRootPath)paket-files\paket.restore.cached 13 | $(PaketRootPath)paket.lock 14 | /Library/Frameworks/Mono.framework/Commands/mono 15 | mono 16 | 17 | $(PaketRootPath)paket.exe 18 | $(PaketToolsPath)paket.exe 19 | "$(PaketExePath)" 20 | $(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" 21 | 22 | 23 | <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) 24 | dotnet "$(PaketExePath)" 25 | 26 | 27 | "$(PaketExePath)" 28 | 29 | $(PaketRootPath)paket.bootstrapper.exe 30 | $(PaketToolsPath)paket.bootstrapper.exe 31 | "$(PaketBootStrapperExePath)" 32 | $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" 33 | 34 | 35 | 36 | 37 | true 38 | true 39 | 40 | 41 | 42 | 43 | 44 | 45 | true 46 | $(NoWarn);NU1603 47 | 48 | 49 | 50 | 51 | /usr/bin/shasum $(PaketRestoreCacheFile) | /usr/bin/awk '{ print $1 }' 52 | /usr/bin/shasum $(PaketLockFilePath) | /usr/bin/awk '{ print $1 }' 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) 66 | $([System.IO.File]::ReadAllText('$(PaketLockFilePath)')) 67 | true 68 | false 69 | true 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | $(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).paket.references.cached 79 | 80 | $(MSBuildProjectFullPath).paket.references 81 | 82 | $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references 83 | 84 | $(MSBuildProjectDirectory)\paket.references 85 | $(MSBuildProjectDirectory)\obj\$(MSBuildProjectFile).$(TargetFramework).paket.resolved 86 | true 87 | references-file-or-cache-not-found 88 | 89 | 90 | 91 | 92 | $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)')) 93 | $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)')) 94 | references-file 95 | false 96 | 97 | 98 | 99 | 100 | false 101 | 102 | 103 | 104 | 105 | true 106 | target-framework '$(TargetFramework)' 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) 124 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) 125 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) 126 | 127 | 128 | %(PaketReferencesFileLinesInfo.PackageVersion) 129 | All 130 | 131 | 132 | 133 | 134 | $(MSBuildProjectDirectory)/obj/$(MSBuildProjectFile).paket.clitools 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0]) 144 | $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1]) 145 | 146 | 147 | %(PaketCliToolFileLinesInfo.PackageVersion) 148 | 149 | 150 | 151 | 155 | 156 | 157 | 158 | 159 | 160 | false 161 | 162 | 163 | 164 | 165 | 166 | <_NuspecFilesNewLocation Include="$(BaseIntermediateOutputPath)$(Configuration)\*.nuspec"/> 167 | 168 | 169 | 170 | $(MSBuildProjectDirectory)/$(MSBuildProjectFile) 171 | true 172 | false 173 | true 174 | $(BaseIntermediateOutputPath)$(Configuration) 175 | $(BaseIntermediateOutputPath) 176 | 177 | 178 | 179 | <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.nuspec"/> 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 232 | 233 | 274 | 275 | 276 | 277 | -------------------------------------------------------------------------------- /src/react/Content/.paket/Paket.Restore.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 8 | 9 | $(MSBuildVersion) 10 | 15.0.0 11 | false 12 | true 13 | 14 | true 15 | $(MSBuildThisFileDirectory) 16 | $(MSBuildThisFileDirectory)..\ 17 | $(PaketRootPath)paket-files\paket.restore.cached 18 | $(PaketRootPath)paket.lock 19 | classic 20 | proj 21 | assembly 22 | native 23 | /Library/Frameworks/Mono.framework/Commands/mono 24 | mono 25 | 26 | 27 | $(PaketRootPath)paket.bootstrapper.exe 28 | $(PaketToolsPath)paket.bootstrapper.exe 29 | $([System.IO.Path]::GetDirectoryName("$(PaketBootStrapperExePath)"))\ 30 | 31 | "$(PaketBootStrapperExePath)" 32 | $(MonoPath) --runtime=v4.0.30319 "$(PaketBootStrapperExePath)" 33 | 34 | 35 | 36 | 37 | true 38 | true 39 | 40 | 41 | True 42 | 43 | 44 | False 45 | 46 | $(BaseIntermediateOutputPath.TrimEnd('\').TrimEnd('\/')) 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | $(PaketRootPath)paket 56 | $(PaketToolsPath)paket 57 | 58 | 59 | 60 | 61 | 62 | $(PaketRootPath)paket.exe 63 | $(PaketToolsPath)paket.exe 64 | 65 | 66 | 67 | 68 | 69 | <_DotnetToolsJson Condition="Exists('$(PaketRootPath)/.config/dotnet-tools.json')">$([System.IO.File]::ReadAllText("$(PaketRootPath)/.config/dotnet-tools.json")) 70 | <_ConfigContainsPaket Condition=" '$(_DotnetToolsJson)' != ''">$(_DotnetToolsJson.Contains('"paket"')) 71 | <_ConfigContainsPaket Condition=" '$(_ConfigContainsPaket)' == ''">false 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | <_PaketCommand>dotnet paket 83 | 84 | 85 | 86 | 87 | 88 | $(PaketToolsPath)paket 89 | $(PaketBootStrapperExeDir)paket 90 | 91 | 92 | paket 93 | 94 | 95 | 96 | 97 | <_PaketExeExtension>$([System.IO.Path]::GetExtension("$(PaketExePath)")) 98 | <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(_PaketExeExtension)' == '.dll' ">dotnet "$(PaketExePath)" 99 | <_PaketCommand Condition=" '$(_PaketCommand)' == '' AND '$(OS)' != 'Windows_NT' AND '$(_PaketExeExtension)' == '.exe' ">$(MonoPath) --runtime=v4.0.30319 "$(PaketExePath)" 100 | <_PaketCommand Condition=" '$(_PaketCommand)' == '' ">"$(PaketExePath)" 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | true 122 | $(NoWarn);NU1603;NU1604;NU1605;NU1608 123 | false 124 | true 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | $([System.IO.File]::ReadAllText('$(PaketRestoreCacheFile)')) 134 | 135 | 136 | 137 | 138 | 139 | 141 | $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[0].Replace(`"`, ``).Replace(` `, ``)) 142 | $([System.Text.RegularExpressions.Regex]::Split(`%(Identity)`, `": "`)[1].Replace(`"`, ``).Replace(` `, ``)) 143 | 144 | 145 | 146 | 147 | %(PaketRestoreCachedKeyValue.Value) 148 | %(PaketRestoreCachedKeyValue.Value) 149 | 150 | 151 | 152 | 153 | true 154 | false 155 | true 156 | 157 | 158 | 162 | 163 | true 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | $(PaketIntermediateOutputPath)\$(MSBuildProjectFile).paket.references.cached 183 | 184 | $(MSBuildProjectFullPath).paket.references 185 | 186 | $(MSBuildProjectDirectory)\$(MSBuildProjectName).paket.references 187 | 188 | $(MSBuildProjectDirectory)\paket.references 189 | 190 | false 191 | true 192 | true 193 | references-file-or-cache-not-found 194 | 195 | 196 | 197 | 198 | $([System.IO.File]::ReadAllText('$(PaketReferencesCachedFilePath)')) 199 | $([System.IO.File]::ReadAllText('$(PaketOriginalReferencesFilePath)')) 200 | references-file 201 | false 202 | 203 | 204 | 205 | 206 | false 207 | 208 | 209 | 210 | 211 | true 212 | target-framework '$(TargetFramework)' or '$(TargetFrameworks)' files @(PaketResolvedFilePaths) 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | false 224 | true 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',').Length) 236 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[0]) 237 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[1]) 238 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[4]) 239 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[5]) 240 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[6]) 241 | $([System.String]::Copy('%(PaketReferencesFileLines.Identity)').Split(',')[7]) 242 | 243 | 244 | %(PaketReferencesFileLinesInfo.PackageVersion) 245 | All 246 | runtime 247 | $(ExcludeAssets);contentFiles 248 | $(ExcludeAssets);build;buildMultitargeting;buildTransitive 249 | true 250 | true 251 | 252 | 253 | 254 | 255 | $(PaketIntermediateOutputPath)/$(MSBuildProjectFile).paket.clitools 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[0]) 265 | $([System.String]::Copy('%(PaketCliToolFileLines.Identity)').Split(',')[1]) 266 | 267 | 268 | %(PaketCliToolFileLinesInfo.PackageVersion) 269 | 270 | 271 | 272 | 276 | 277 | 278 | 279 | 280 | 281 | false 282 | 283 | 284 | 285 | 286 | 287 | <_NuspecFilesNewLocation Include="$(PaketIntermediateOutputPath)\$(Configuration)\*.nuspec"/> 288 | 289 | 290 | 291 | 292 | 293 | $(MSBuildProjectDirectory)/$(MSBuildProjectFile) 294 | true 295 | false 296 | true 297 | false 298 | true 299 | false 300 | true 301 | false 302 | true 303 | false 304 | true 305 | $(PaketIntermediateOutputPath)\$(Configuration) 306 | $(PaketIntermediateOutputPath) 307 | 308 | 309 | 310 | <_NuspecFiles Include="$(AdjustedNuspecOutputPath)\*.$(PackageVersion.Split(`+`)[0]).nuspec"/> 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 370 | 371 | 420 | 421 | 466 | 467 | 511 | 512 | 555 | 556 | 557 | 558 | --------------------------------------------------------------------------------