Skip to content

Commit 847e8bf

Browse files
authored
Merge pull request #623 from lichess-org/devenv
devenv
2 parents 218badc + d6515e8 commit 847e8bf

6 files changed

Lines changed: 136 additions & 0 deletions

File tree

.envrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
export DIRENV_WARN_TIMEOUT=20s
4+
5+
eval "$(devenv direnvrc)"
6+
7+
use devenv

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Devenv
2+
.devenv*
3+
devenv.local.nix
4+
devenv.local.yaml
5+
6+
# direnv
7+
.direnv
8+
9+
# pre-commit
10+
.pre-commit-config.yaml

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ pnpm install
1111
pnpm dev
1212
```
1313

14+
or with `devenv`
15+
16+
```shell
17+
devenv up
18+
```
19+
1420
Then open the URL printed in the terminal (usually `http://localhost:5173`).
1521

1622
Make modifications to any of the schema yaml files, and the page will rebuild and reload automatically.
@@ -23,6 +29,12 @@ pnpm lint
2329
pnpm scalar-lint
2430
```
2531

32+
or with `devenv`
33+
34+
```bash
35+
devenv tasks run api:check
36+
```
37+
2638
### Format the yaml files
2739

2840
```shell

devenv.lock

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"nodes": {
3+
"devenv": {
4+
"locked": {
5+
"dir": "src/modules",
6+
"lastModified": 1773867720,
7+
"narHash": "sha256-Z1SAMRSzrHiAlUnH/2IuN475vyWREWV8nDOeqb8GxhM=",
8+
"owner": "cachix",
9+
"repo": "devenv",
10+
"rev": "b97092200826a16ca0794df670d2dd6b5427c060",
11+
"type": "github"
12+
},
13+
"original": {
14+
"dir": "src/modules",
15+
"owner": "cachix",
16+
"repo": "devenv",
17+
"type": "github"
18+
}
19+
},
20+
"nixpkgs": {
21+
"inputs": {
22+
"nixpkgs-src": "nixpkgs-src"
23+
},
24+
"locked": {
25+
"lastModified": 1773704619,
26+
"narHash": "sha256-LKtmit8Sr81z8+N2vpIaN/fyiQJ8f7XJ6tMSKyDVQ9s=",
27+
"owner": "cachix",
28+
"repo": "devenv-nixpkgs",
29+
"rev": "906534d75b0e2fe74a719559dfb1ad3563485f43",
30+
"type": "github"
31+
},
32+
"original": {
33+
"owner": "cachix",
34+
"ref": "rolling",
35+
"repo": "devenv-nixpkgs",
36+
"type": "github"
37+
}
38+
},
39+
"nixpkgs-src": {
40+
"flake": false,
41+
"locked": {
42+
"lastModified": 1773597492,
43+
"narHash": "sha256-hQ284SkIeNaeyud+LS0WVLX+WL2rxcVZLFEaK0e03zg=",
44+
"owner": "NixOS",
45+
"repo": "nixpkgs",
46+
"rev": "a07d4ce6bee67d7c838a8a5796e75dff9caa21ef",
47+
"type": "github"
48+
},
49+
"original": {
50+
"owner": "NixOS",
51+
"ref": "nixpkgs-unstable",
52+
"repo": "nixpkgs",
53+
"type": "github"
54+
}
55+
},
56+
"root": {
57+
"inputs": {
58+
"devenv": "devenv",
59+
"nixpkgs": "nixpkgs"
60+
}
61+
}
62+
},
63+
"root": "root",
64+
"version": 7
65+
}

devenv.nix

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{ pkgs, lib, config, inputs, ... }:
2+
3+
{
4+
packages = [ pkgs.git ];
5+
6+
languages = {
7+
javascript = {
8+
enable = true;
9+
package = pkgs.nodejs_24;
10+
npm.enable = true;
11+
pnpm = {
12+
enable = true;
13+
};
14+
corepack.enable = true;
15+
};
16+
};
17+
18+
processes.serve = {
19+
exec = "pnpm run dev";
20+
cwd = "doc";
21+
};
22+
23+
enterShell = ''
24+
cd $DEVENV_ROOT/doc
25+
pnpm install
26+
'';
27+
28+
tasks = {
29+
"api:check" = {
30+
exec = ''
31+
pnpm run spectral
32+
pnpm run lint
33+
pnpm run scalar-lint
34+
pnpm run check-format
35+
'';
36+
cwd = "doc";
37+
};
38+
};
39+
}

devenv.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
inputs:
2+
nixpkgs:
3+
url: github:cachix/devenv-nixpkgs/rolling

0 commit comments

Comments
 (0)