Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
rastreus committed Feb 18, 2024
0 parents commit d915db8
Show file tree
Hide file tree
Showing 50 changed files with 5,742 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": 1,
"isRoot": true,
"tools": {
"fable": {
"version": "4.12.2",
"commands": [
"fable"
]
},
"paket": {
"version": "8.0.3",
"commands": [
"paket"
]
}
}
}
74 changes: 74 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
root=true

[*]
indent_style=space
indent_size=4
charset=utf-8
trim_trailing_whitespace=true
insert_final_newline=true

[*.{js,jsx,json,yml,yaml}]
indent_size = 2

# Microsoft .NET properties
csharp_new_line_before_members_in_object_initializers=false
csharp_preferred_modifier_order=public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
csharp_style_var_elsewhere=true:suggestion
csharp_style_var_for_built_in_types=true:suggestion
csharp_style_var_when_type_is_apparent=true:suggestion
dotnet_style_parentheses_in_arithmetic_binary_operators=never_if_unnecessary:none
dotnet_style_parentheses_in_other_binary_operators=never_if_unnecessary:none
dotnet_style_parentheses_in_relational_binary_operators=never_if_unnecessary:none
dotnet_style_predefined_type_for_locals_parameters_members=true:suggestion
dotnet_style_predefined_type_for_member_access=true:suggestion
dotnet_style_qualification_for_event=false:suggestion
dotnet_style_qualification_for_field=false:suggestion
dotnet_style_qualification_for_method=false:suggestion
dotnet_style_qualification_for_property=false:suggestion
dotnet_style_require_accessibility_modifiers=for_non_interface_members:suggestion

# ReSharper properties
resharper_use_indent_from_vs=false

# ReSharper inspection severities
resharper_arrange_redundant_parentheses_highlighting=hint
resharper_arrange_this_qualifier_highlighting=hint
resharper_arrange_type_member_modifiers_highlighting=hint
resharper_arrange_type_modifiers_highlighting=hint
resharper_built_in_type_reference_style_for_member_access_highlighting=hint
resharper_built_in_type_reference_style_highlighting=hint
resharper_redundant_base_qualifier_highlighting=warning
resharper_suggest_var_or_type_built_in_types_highlighting=hint
resharper_suggest_var_or_type_elsewhere_highlighting=hint
resharper_suggest_var_or_type_simple_types_highlighting=hint
resharper_web_config_module_not_resolved_highlighting=warning
resharper_web_config_type_not_resolved_highlighting=warning
resharper_web_config_wrong_module_highlighting=warning

[*.{appxmanifest,asax,ascx,aspx,build,cg,cginc,compute,cs,cshtml,dtd,fsi,fsscript,fsx,hlsl,hlsli,hlslinc,master,ml,mli,nuspec,razor,resw,resx,skin,usf,ush,vb,xaml,xamlx,xoml,xsd}]
indent_style=space
indent_size=4
tab_width=4

[*.{fs,fsx}]
indent_style=space
indent_size=4
tab_width=4
max_line_length=150
fsharp_space_before_parameter = true
fsharp_space_around_coma = true
fsharp_space_around_semicolon = true
fsharp_space_around_delimiter = true
fsharp_space_before_semicolon = false
fsharp_space_after_semicolon = true
fsharp_space_before_class_constructor =false
fsharp_space_before_member =false
fsharp_space_before_colon =false
fsharp_space_after_comma =true
fsharp_max_array_or_list_width = 40
fsharp_array_or_list_multiline_formatter = character_width

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false
26 changes: 26 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

.fake
.paket
paket-files
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.11.1
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"tauri-apps.tauri-vscode",
"rust-lang.rust-analyzer",
"ionide.ionide-fsharp",
"ms-dotnettools.csharp",
"editorconfig.editorconfig"
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"FSharp.inlayHints.typeAnnotations": false,
"editor.inlayHints.enabled": "offUnlessPressed",
"files.exclude": {
"**/._*": true,
"**/*.fs.js.map": true,
"**/*.fs.js": true,
"**/*.jsx.map": true,
"**/*.jsx": true
}
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Russell Dillin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
33 changes: 33 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Tauri + Fable (React)

![Tauri Fable](./img/tauri-fable-dark.png#gh-dark-mode-only)
![Tauri Fable](./img/tauri-fable-light.png#gh-light-mode-only)

This template should help get you started developing with Tauri and Fable (React) in Vite.

_This template is a simple, minimalistic port of the `pnpm create tauri-app` React template for Fable._

## Recommended IDE Setup

- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) + [Ionide for F#](https://marketplace.visualstudio.com/items?itemName=ionide.ionide-fsharp)

### Dependencies

* [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/8.0)
+ [Fable](https://fable.io)
+ [Paket](https://fsprojects.github.io/Paket/)
* [Node.js (20.x LTS)](https://nodejs.org/en)
+ [pnpm](https://pnpm.io)
* [Rust](https://www.rust-lang.org)

### Development

* Install .NET dependencies:
+ `dotnet tool restore`
+ `dotnet paket install`
* Install JavaScript dependencies:
+ `corepack enable`
+ `corepack use pnpm@latest`
+ `pnpm install`
* Build: `dotnet build src/Src.fsproj`
* Dev: `pnpm tauri dev`
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.200",
"rollForward": "latestMinor"
}
}
Binary file added img/tauri-fable-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/tauri-fable-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TauriFable</title>
</head>
<body>
<div id="root"></div>
<script type="text/javascript">
var global = global || window;
</script>
<script type="module" src="/src/Main.jsx"></script>
</body>
</html>
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "tauri-fable",
"private": true,
"version": "0.1.0",
"type": "module",
"packageManager": "[email protected]",
"engines": {
"node": ">=20",
"pnpm": ">=8"
},
"scripts": {
"dev": "dotnet fable watch ./src -e .jsx --sourceMaps --configuration Debug --run vite --mode development",
"build": "dotnet fable ./src -e .jsx --noCache --configuration Release --define FABLE_COMPILER --run vite build --mode production",
"preview": "vite preview",
"tauri": "tauri"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"@tauri-apps/api": "^1.5.2"
},
"devDependencies": {
"@vitejs/plugin-react": "^4.2.1",
"vite": "^5.1.3",
"@tauri-apps/cli": "^1.5.8"
}
}
12 changes: 12 additions & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version 8.0.3
source https://api.nuget.org/v3/index.json

group Src
source https://api.nuget.org/v3/index.json
framework: net8.0
storage: none

nuget FSharp.Core == 8.0.200
nuget Fable.Core ~> 4
nuget Fable.Promise == 3.2.0
nuget Feliz >= 2.7.0
47 changes: 47 additions & 0 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@


GROUP Src
STORAGE: NONE
RESTRICTION: == net8.0
NUGET
remote: https://api.nuget.org/v3/index.json
Fable.AST (4.4)
Fable.Browser.Blob (1.3)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.Dom (2.16)
Fable.Browser.Blob (>= 1.3)
Fable.Browser.Event (>= 1.5)
Fable.Browser.WebStorage (>= 1.2)
Fable.Core (>= 3.2.8)
FSharp.Core (>= 4.7.2)
Fable.Browser.Event (1.5)
Fable.Browser.Gamepad (>= 1.1)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.Gamepad (1.2)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Browser.WebStorage (1.2)
Fable.Browser.Event (>= 1.5)
Fable.Core (>= 3.0)
FSharp.Core (>= 4.7.2)
Fable.Core (4.3)
Fable.Promise (3.2)
Fable.Core (>= 3.7.1)
FSharp.Core (>= 4.7.2)
Fable.React.Types (18.3)
Fable.Browser.Dom (>= 2.4.4)
Fable.Core (>= 3.2.7)
FSharp.Core (>= 4.7.2)
Fable.ReactDom.Types (18.2)
Fable.React.Types (>= 18.3)
FSharp.Core (>= 4.7.2)
Feliz (2.7)
Fable.ReactDom.Types (>= 18.2)
Feliz.CompilerPlugins (>= 2.2)
FSharp.Core (>= 4.7.2)
Feliz.CompilerPlugins (2.2)
Fable.AST (>= 4.2.1)
FSharp.Core (>= 4.7.2)
FSharp.Core (8.0.200)
Loading

0 comments on commit d915db8

Please sign in to comment.