Skip to content

Commit 83c626c

Browse files
committed
Initial commit
0 parents  commit 83c626c

20 files changed

+751
-0
lines changed

.envrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export DIRENV_WARN_TIMEOUT=20s
2+
3+
eval "$(devenv direnvrc)"
4+
5+
use devenv

.gitignore

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Devenv
2+
.devenv*
3+
devenv.local.nix
4+
5+
# direnv
6+
.direnv
7+
8+
# pre-commit
9+
.pre-commit-config.yaml
10+
# Created by https://www.toptal.com/developers/gitignore/api/rust
11+
# Edit at https://www.toptal.com/developers/gitignore?templates=rust
12+
13+
### Rust ###
14+
# Generated by Cargo
15+
# will have compiled files and executables
16+
debug/
17+
target/
18+
19+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
20+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
21+
Cargo.lock
22+
23+
# These are backup files generated by rustfmt
24+
**/*.rs.bk
25+
26+
# MSVC Windows builds of rustc generate these, which store debugging information
27+
*.pdb
28+
29+
# End of https://www.toptal.com/developers/gitignore/api/rust
30+
dist
31+
node_modules

.vscode/settings.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"rust-analyzer.procMacro.ignored": {
3+
"leptos_macro": [
4+
// optional:
5+
// "component",
6+
"server"
7+
],
8+
},
9+
// if code that is cfg-gated for the `ssr` feature is shown as inactive,
10+
// you may want to tell rust-analyzer to enable the `ssr` feature by default
11+
//
12+
// you can also use `rust-analyzer.cargo.allFeatures` to enable all features
13+
// "rust-analyzer.cargo.features": ["ssr"]
14+
"rust-analyzer.cargo.allFeatures": true,
15+
"emmet.includeLanguages": {
16+
"rust": "html",
17+
"*.rs": "html"
18+
},
19+
"tailwindCSS.includeLanguages": {
20+
"rust": "html",
21+
"*.rs": "html"
22+
},
23+
"files.associations": {
24+
"*.rs": "rust"
25+
},
26+
"editor.quickSuggestions": {
27+
"other": "on",
28+
"comments": "on",
29+
"strings": true
30+
},
31+
"css.validate": false,
32+
}

Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "leptos-tutorial"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
7+
console_error_panic_hook = "0.1.7"
8+
leptos = { version = "0.7.7", features = ["csr"] }
9+
leptos_meta = "0.7.8"
10+
leptos_router = "0.7.8"
11+
12+
13+
[[example]]
14+
name = "main"

Trunk.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[build]
2+
dist = "dist"
3+
[serve]
4+
port = 8080

devenv.lock

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1741670053,
7+
"owner": "cachix",
8+
"repo": "devenv",
9+
"rev": "47abb5dfd5b7824a0979ef86f3986aea48847312",
10+
"type": "github"
11+
},
12+
"original": {
13+
"dir": "src/modules",
14+
"owner": "cachix",
15+
"repo": "devenv",
16+
"type": "github"
17+
}
18+
},
19+
"fenix": {
20+
"inputs": {
21+
"nixpkgs": [
22+
"nixpkgs"
23+
],
24+
"rust-analyzer-src": "rust-analyzer-src"
25+
},
26+
"locked": {
27+
"lastModified": 1741761224,
28+
"owner": "nix-community",
29+
"repo": "fenix",
30+
"rev": "585b58faf23d956dc0c2aa819dc099c9f93200a0",
31+
"type": "github"
32+
},
33+
"original": {
34+
"owner": "nix-community",
35+
"repo": "fenix",
36+
"type": "github"
37+
}
38+
},
39+
"flake-compat": {
40+
"flake": false,
41+
"locked": {
42+
"lastModified": 1733328505,
43+
"owner": "edolstra",
44+
"repo": "flake-compat",
45+
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
46+
"type": "github"
47+
},
48+
"original": {
49+
"owner": "edolstra",
50+
"repo": "flake-compat",
51+
"type": "github"
52+
}
53+
},
54+
"git-hooks": {
55+
"inputs": {
56+
"flake-compat": "flake-compat",
57+
"gitignore": "gitignore",
58+
"nixpkgs": [
59+
"nixpkgs"
60+
]
61+
},
62+
"locked": {
63+
"lastModified": 1741379162,
64+
"owner": "cachix",
65+
"repo": "git-hooks.nix",
66+
"rev": "b5a62751225b2f62ff3147d0a334055ebadcd5cc",
67+
"type": "github"
68+
},
69+
"original": {
70+
"owner": "cachix",
71+
"repo": "git-hooks.nix",
72+
"type": "github"
73+
}
74+
},
75+
"gitignore": {
76+
"inputs": {
77+
"nixpkgs": [
78+
"git-hooks",
79+
"nixpkgs"
80+
]
81+
},
82+
"locked": {
83+
"lastModified": 1709087332,
84+
"owner": "hercules-ci",
85+
"repo": "gitignore.nix",
86+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
87+
"type": "github"
88+
},
89+
"original": {
90+
"owner": "hercules-ci",
91+
"repo": "gitignore.nix",
92+
"type": "github"
93+
}
94+
},
95+
"nixpkgs": {
96+
"locked": {
97+
"lastModified": 1733477122,
98+
"owner": "cachix",
99+
"repo": "devenv-nixpkgs",
100+
"rev": "7bd9e84d0452f6d2e63b6e6da29fe73fac951857",
101+
"type": "github"
102+
},
103+
"original": {
104+
"owner": "cachix",
105+
"ref": "rolling",
106+
"repo": "devenv-nixpkgs",
107+
"type": "github"
108+
}
109+
},
110+
"root": {
111+
"inputs": {
112+
"devenv": "devenv",
113+
"fenix": "fenix",
114+
"git-hooks": "git-hooks",
115+
"nixpkgs": "nixpkgs",
116+
"pre-commit-hooks": [
117+
"git-hooks"
118+
]
119+
}
120+
},
121+
"rust-analyzer-src": {
122+
"flake": false,
123+
"locked": {
124+
"lastModified": 1741703184,
125+
"owner": "rust-lang",
126+
"repo": "rust-analyzer",
127+
"rev": "8d01570b5e812a49daa1f08404269f6ea5dd73a1",
128+
"type": "github"
129+
},
130+
"original": {
131+
"owner": "rust-lang",
132+
"ref": "nightly",
133+
"repo": "rust-analyzer",
134+
"type": "github"
135+
}
136+
}
137+
},
138+
"root": "root",
139+
"version": 7
140+
}

devenv.nix

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{ pkgs, lib, ... }:
2+
3+
{
4+
packages = with pkgs; [
5+
rustup
6+
trunk
7+
cargo-watch
8+
cargo-leptos
9+
leptosfmt
10+
];
11+
12+
scripts.leptos.exec = ''
13+
cargo-leptos "$@"
14+
'';
15+
16+
languages.rust = {
17+
enable = true;
18+
# https://devenv.sh/reference/options/#languagesrustchannel
19+
channel = "stable";
20+
# channel = "nightly";
21+
22+
components = [ "rustc" "cargo" "clippy" "rustfmt" "rust-analyzer" "rust-std" "rust-src" ];
23+
targets = [ "wasm32-unknown-unknown" ];
24+
};
25+
26+
languages.javascript = {
27+
enable = true;
28+
npm.enable = true;
29+
};
30+
31+
# pre-commit.hooks = {
32+
# rustfmt.enable = true;
33+
# clippy.enable = true;
34+
# };
35+
36+
}

devenv.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
inputs:
2+
fenix:
3+
url: github:nix-community/fenix
4+
inputs:
5+
nixpkgs:
6+
follows: nixpkgs
7+
nixpkgs:
8+
url: github:cachix/devenv-nixpkgs/rolling

0 commit comments

Comments
 (0)