Skip to content

build: use yarn berry #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Lint
# TODO: Add proper linting command
run: yarn format
Expand All @@ -31,6 +31,6 @@ jobs:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable
- name: Test
run: yarn test
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
node-version: 20
cache: yarn
- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install --immutable

- name: Package
run: yarn run package
Expand Down
17 changes: 14 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
# Flakes
.direnv/

# Node dependencies
node_modules/
# Yarn Berry
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Intermediate files
syntaxes/source.tmLanguage.json

# Build artifacts
out/
*.vsix
syntaxes/source.tmLanguage.json

# Logs
yarn-error.log

# Misc
.DS_Store

# No longer needed
node_modules/
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
42 changes: 38 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 21 additions & 31 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
{
description = "Template for a direnv shell, with NodeJS";
description = "nix-direnv shell for developing Source Academy's VS Code extension";

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

outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
in
{
devShells.${system}.default = pkgs.mkShell {
packages = with pkgs; [
nodejs_20
(yarn.override {
nodejs = nodejs_20;
})

# The following is only needed by js-slang, to remove in the future
# Additional libs needed by yarn when installing
pkg-config
xorg.libX11
xorg.libXi
libGL

python310
xorg.libXext

gcc11
];
};
};
outputs = {
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
devShells.default = pkgs.mkShell {
packages = with pkgs; [
# For dev ease of use, follow NodeJS version in source-academy/frontend
nodejs_20
(yarn-berry.override {nodejs = nodejs_20;})
];
};
}
);
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
"download-lsp": "node scripts/lsp.js",
"format": "yarn prettier . --write",
"vscode:prepublish": "yarn run download-lsp && yarn run build",
"package": "vsce package",
"package": "vsce package --no-dependencies",
"test:syntax": "yarn run build:syntax && vscode-tmgrammar-test ./tests/syntaxes/*",
"test": "yarn test:syntax"
},
Expand Down
Loading