Skip to content

Commit fdf705a

Browse files
committed
build: use yarn berry
1 parent abc9b32 commit fdf705a

File tree

5 files changed

+3595
-2260
lines changed

5 files changed

+3595
-2260
lines changed

.gitignore

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,27 @@
11
# Flakes
22
.direnv/
33

4-
# Node dependencies
5-
node_modules/
4+
# Yarn Berry
5+
.pnp.*
6+
.yarn/*
7+
!.yarn/patches
8+
!.yarn/plugins
9+
!.yarn/releases
10+
!.yarn/sdks
11+
!.yarn/versions
12+
13+
# Intermediate files
14+
syntaxes/source.tmLanguage.json
615

716
# Build artifacts
817
out/
918
*.vsix
10-
syntaxes/source.tmLanguage.json
1119

1220
# Logs
1321
yarn-error.log
1422

1523
# Misc
1624
.DS_Store
25+
26+
# No longer needed
27+
node_modules/

.yarnrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
nodeLinker: node-modules

flake.lock

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

flake.nix

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,25 @@
11
{
2-
description = "Template for a direnv shell, with NodeJS";
2+
description = "nix-direnv shell for developing Source Academy's VS Code extension";
33

4-
inputs = {
5-
nixpkgs.url = "github:NixOS/nixpkgs/23.11";
6-
};
4+
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
5+
inputs.flake-utils.url = "github:numtide/flake-utils";
76

8-
outputs = { self, nixpkgs }:
9-
let
10-
system = "x86_64-linux";
11-
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
12-
in
13-
{
14-
devShells.${system}.default = pkgs.mkShell {
15-
packages = with pkgs; [
16-
nodejs_20
17-
(yarn.override {
18-
nodejs = nodejs_20;
19-
})
20-
21-
# The following is only needed by js-slang, to remove in the future
22-
# Additional libs needed by yarn when installing
23-
pkg-config
24-
xorg.libX11
25-
xorg.libXi
26-
libGL
27-
28-
python310
29-
xorg.libXext
30-
31-
gcc11
32-
];
33-
};
34-
};
7+
outputs = {
8+
nixpkgs,
9+
flake-utils,
10+
...
11+
}:
12+
flake-utils.lib.eachDefaultSystem (
13+
system: let
14+
pkgs = nixpkgs.legacyPackages.${system};
15+
in {
16+
devShells.default = pkgs.mkShell {
17+
packages = with pkgs; [
18+
# For dev ease of use, follow NodeJS version in source-academy/frontend
19+
nodejs_20
20+
(yarn-berry.override {nodejs = nodejs_20;})
21+
];
22+
};
23+
}
24+
);
3525
}

0 commit comments

Comments
 (0)