Skip to content

Commit 5e2edf2

Browse files
committed
Upgrade pnpm
This PR does a few related changes: - Upgrades pnpm to 9.3.0 (latest) - Locks the pnpm and node versions via the `engines` field of `package.json` - Sets the `package-manager-strict`, `package-manager-version-strict` options for pnpm to enforce that the correct pnpm version is in use - Configures github actions to use the node version from the `engines` field - Upgrades nix shell configuration - Moves nix config over to using flakes
1 parent ffbc51f commit 5e2edf2

File tree

16 files changed

+20078
-15073
lines changed

16 files changed

+20078
-15073
lines changed

.envrc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#!/usr/bin/env bash
22
# the shebang is ignored, but nice for editors
33

4-
if type -P lorri &>/dev/null; then
5-
eval "$(lorri direnv)"
6-
elif type -P nix-shell &>/dev/null; then
7-
echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]'
8-
use nix
4+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
5+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
96
fi
7+
use flake

.github/workflows/ci-hermes-client-api-types.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v4
1414
- uses: actions/setup-node@v4
1515
with:
16-
node-version: 18
16+
node-version-file: "package.json"
1717
- uses: pnpm/action-setup@v4
1818
name: Install pnpm
1919
with:

.github/workflows/ci-typescript.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ jobs:
2626
- uses: actions/checkout@v4
2727
- uses: actions/setup-node@v4
2828
with:
29-
node-version: 18
29+
node-version-file: "package.json"
3030
- uses: pnpm/action-setup@v4
3131
name: Install pnpm
3232
with:
33-
run_install: "args: [--frozen-lockfile]"
33+
run_install: true
3434
- name: Build
3535
run: pnpm exec lerna run build
3636
- name: Test

.github/workflows/publish-js.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v2
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: "18"
15+
node-version-file: "package.json"
1616
- uses: pnpm/action-setup@v4
1717
name: Install pnpm
1818
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ tsconfig.tsbuildinfo
2020
__pycache__
2121
.DS_Store
2222
.vercel
23+
.direnv

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
engine-strict=true
2+
package-manager-strict=true

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.19.1

Dockerfile.node

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:18.20-slim@sha256:1da7652745e9ba5de396e436aa086588ea50d532540fa3147fbc1957c43a46ab as builder-base
1+
FROM node:18.19.1-slim@sha256:246bf34b0c7cf8d9ff7cbe0c1ff44b178051f06c432c8e7df1645f1bd20b0352 as builder-base
22
WORKDIR /usr/src/pyth
33
ENV PNPM_HOME="/pnpm"
44
ENV PATH="$PNPM_HOME:$PATH"
@@ -7,7 +7,7 @@ COPY ./ .
77
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
88

99

10-
FROM node:18.20-alpine@sha256:6937be95129321422103452e2883021cc4a96b63c32d7947187fcb25df84fc3f as runner-base
10+
FROM node:18.19.1-alpine@sha256:c7620fdecfefb96813da62519897808775230386f4c8482e972e37b8b18cb460 as runner-base
1111
WORKDIR /srv
1212
ENV NODE_ENV production
1313
RUN addgroup --system --gid 1001 pyth && adduser --system --uid 1001 pyth -g pyth && chown pyth:pyth .

flake.lock

Lines changed: 128 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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
mkCli.url = "github:cprussin/mkCli";
6+
};
7+
8+
outputs = {
9+
nixpkgs,
10+
flake-utils,
11+
mkCli,
12+
...
13+
}: (
14+
flake-utils.lib.eachDefaultSystem
15+
(
16+
system: let
17+
nodejs-overlay = _: prev: {
18+
nodejs = prev.nodejs_18;
19+
};
20+
21+
cli-overlay = _: prev: {
22+
cli = prev.lib.mkCli "cli" {
23+
_noAll = true;
24+
25+
install = "${prev.pnpm}/bin/pnpm i";
26+
27+
test = {
28+
nix = {
29+
lint = "${prev.statix}/bin/statix check --ignore node_modules .";
30+
dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules .";
31+
format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules --check .";
32+
};
33+
};
34+
35+
fix = {
36+
nix = {
37+
lint = "${prev.statix}/bin/statix fix --ignore node_modules .";
38+
dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules -e .";
39+
format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules .";
40+
};
41+
};
42+
};
43+
};
44+
45+
pkgs = import nixpkgs {
46+
inherit system;
47+
overlays = [mkCli.overlays.default cli-overlay nodejs-overlay];
48+
config = {};
49+
};
50+
in {
51+
devShells.default = pkgs.mkShell {
52+
buildInputs = [
53+
pkgs.cargo
54+
pkgs.cli
55+
pkgs.git
56+
pkgs.libusb
57+
pkgs.nodejs
58+
pkgs.pkg-config
59+
pkgs.pnpm
60+
pkgs.pre-commit
61+
pkgs.python3
62+
];
63+
};
64+
}
65+
)
66+
);
67+
}

0 commit comments

Comments
 (0)