Skip to content

Commit 411a446

Browse files
committed
Add nix setup for development and upgrade node
1 parent 278d96a commit 411a446

File tree

6 files changed

+103
-4
lines changed

6 files changed

+103
-4
lines changed

.envrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
use flake
2+
3+
source_env_if_exists .envrc.local

.github/actions/setup-test-env/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ runs:
88
- name: Install Node.js
99
uses: actions/setup-node@v3
1010
with:
11-
node-version: 16
11+
node-version: 21
1212

1313
- uses: pnpm/action-setup@v2
1414
name: Install pnpm
1515
id: pnpm-install
1616
with:
17-
version: 7
17+
version: 8
1818
run_install: false
1919

2020
- name: Get pnpm store directory

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
.direnv
12
dist
23
node_modules
34
yarn.lock
45
vscode-profile*
56
isolate-*
6-
flamegraph.html
7+
flamegraph.html
8+
*.perf

Benchmarking.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ node --prof-process isolate-*.log
3535
You can postprocess the generated `isolate-0x<something>.log` file into the data `flamegraph` expects, and then feed it to `flamegraph` to see a visual breakdown of performance. You can do that in one command like so:
3636

3737
```shell
38-
node --prof-process --preprocess -j isolate-*.log | p flamebearer
38+
node --prof-process --preprocess -j isolate-*.log | pnpm flamebearer
3939
```
4040

4141
#### CPU profiling with VSCode

flake.lock

Lines changed: 61 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
description = "mobx-quick-tree development environment";
3+
4+
inputs = {
5+
flake-utils.url = "github:numtide/flake-utils";
6+
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
7+
};
8+
9+
outputs = { self, flake-utils, nixpkgs }:
10+
(flake-utils.lib.eachSystem [
11+
"x86_64-linux"
12+
"x86_64-darwin"
13+
"aarch64-darwin"
14+
]
15+
(system: nixpkgs.lib.fix (flake:
16+
let
17+
pkgs = nixpkgs.legacyPackages.${system};
18+
in
19+
rec {
20+
21+
packages =
22+
rec {
23+
bash = pkgs.bash;
24+
nodejs = pkgs.nodejs_21;
25+
pnpm = pkgs.nodejs_21.pkgs.pnpm;
26+
};
27+
28+
devShell = pkgs.mkShell {
29+
packages = builtins.attrValues packages;
30+
};
31+
}
32+
)));
33+
}

0 commit comments

Comments
 (0)