瀏覽代碼

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
Connor Prussin 1 年之前
父節點
當前提交
5e2edf27a0

+ 3 - 5
.envrc

@@ -1,9 +1,7 @@
 #!/usr/bin/env bash
 # the shebang is ignored, but nice for editors
 
-if type -P lorri &>/dev/null; then
-  eval "$(lorri direnv)"
-elif type -P nix-shell &>/dev/null; then
-  echo 'while direnv evaluated .envrc, could not find the command "lorri" [https://github.com/nix-community/lorri]'
-  use nix
+if ! has nix_direnv_version || ! nix_direnv_version 3.0.5; then
+    source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.5/direnvrc" "sha256-RuwIS+QKFj/T9M2TFXScjBsLR6V3A17YVoEW/Q6AZ1w="
 fi
+use flake

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

@@ -13,7 +13,7 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/setup-node@v4
         with:
-          node-version: 18
+          node-version-file: "package.json"
       - uses: pnpm/action-setup@v4
         name: Install pnpm
         with:

+ 2 - 2
.github/workflows/ci-typescript.yml

@@ -26,11 +26,11 @@ jobs:
       - uses: actions/checkout@v4
       - uses: actions/setup-node@v4
         with:
-          node-version: 18
+          node-version-file: "package.json"
       - uses: pnpm/action-setup@v4
         name: Install pnpm
         with:
-          run_install: "args: [--frozen-lockfile]"
+          run_install: true
       - name: Build
         run: pnpm exec lerna run build
       - name: Test

+ 1 - 1
.github/workflows/publish-js.yml

@@ -12,7 +12,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: actions/setup-node@v4
         with:
-          node-version: "18"
+          node-version-file: "package.json"
       - uses: pnpm/action-setup@v4
         name: Install pnpm
         with:

+ 1 - 0
.gitignore

@@ -20,3 +20,4 @@ tsconfig.tsbuildinfo
 __pycache__
 .DS_Store
 .vercel
+.direnv

+ 1 - 0
.npmrc

@@ -1 +1,2 @@
 engine-strict=true
+package-manager-strict=true

+ 1 - 0
.nvmrc

@@ -0,0 +1 @@
+v18.19.1

+ 2 - 2
Dockerfile.node

@@ -1,4 +1,4 @@
-FROM node:18.20-slim@sha256:1da7652745e9ba5de396e436aa086588ea50d532540fa3147fbc1957c43a46ab as builder-base
+FROM node:18.19.1-slim@sha256:246bf34b0c7cf8d9ff7cbe0c1ff44b178051f06c432c8e7df1645f1bd20b0352 as builder-base
 WORKDIR /usr/src/pyth
 ENV PNPM_HOME="/pnpm"
 ENV PATH="$PNPM_HOME:$PATH"
@@ -7,7 +7,7 @@ COPY ./ .
 RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
 
 
-FROM node:18.20-alpine@sha256:6937be95129321422103452e2883021cc4a96b63c32d7947187fcb25df84fc3f as runner-base
+FROM node:18.19.1-alpine@sha256:c7620fdecfefb96813da62519897808775230386f4c8482e972e37b8b18cb460 as runner-base
 WORKDIR /srv
 ENV NODE_ENV production
 RUN addgroup --system --gid 1001 pyth && adduser --system --uid 1001 pyth -g pyth && chown pyth:pyth .

+ 128 - 0
flake.lock

@@ -0,0 +1,128 @@
+{
+  "nodes": {
+    "flake-utils": {
+      "inputs": {
+        "systems": "systems"
+      },
+      "locked": {
+        "lastModified": 1710146030,
+        "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "flake-utils_2": {
+      "inputs": {
+        "systems": "systems_2"
+      },
+      "locked": {
+        "lastModified": 1710146030,
+        "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
+        "type": "github"
+      },
+      "original": {
+        "owner": "numtide",
+        "repo": "flake-utils",
+        "type": "github"
+      }
+    },
+    "mkCli": {
+      "inputs": {
+        "flake-utils": "flake-utils_2",
+        "nixpkgs": "nixpkgs"
+      },
+      "locked": {
+        "lastModified": 1718314200,
+        "narHash": "sha256-LF3cIhaKeolcAS1jLRAiObBV6Tx2cg6SQDwrt7bI4eo=",
+        "owner": "cprussin",
+        "repo": "mkCli",
+        "rev": "cbb77a72dd2dde97a7c48ce2a10d5105e0d7934f",
+        "type": "github"
+      },
+      "original": {
+        "owner": "cprussin",
+        "repo": "mkCli",
+        "type": "github"
+      }
+    },
+    "nixpkgs": {
+      "locked": {
+        "lastModified": 1718310279,
+        "narHash": "sha256-OfRCrNPMLlElYIUAWIOGAvJ5XDT/WpOXj6Ymfttj6Lk=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "5dde575c3c4afb618781387b0db6d1c08a206c92",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "nixpkgs_2": {
+      "locked": {
+        "lastModified": 1718328702,
+        "narHash": "sha256-T0jv+XnSv60Z67ZxSzLea6Oy+lCQIaGDYHY4dk6ExRg=",
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "rev": "2a8fbc2227dabb3827a1b98d18660672e138e9ef",
+        "type": "github"
+      },
+      "original": {
+        "owner": "NixOS",
+        "repo": "nixpkgs",
+        "type": "github"
+      }
+    },
+    "root": {
+      "inputs": {
+        "flake-utils": "flake-utils",
+        "mkCli": "mkCli",
+        "nixpkgs": "nixpkgs_2"
+      }
+    },
+    "systems": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    },
+    "systems_2": {
+      "locked": {
+        "lastModified": 1681028828,
+        "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
+        "owner": "nix-systems",
+        "repo": "default",
+        "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-systems",
+        "repo": "default",
+        "type": "github"
+      }
+    }
+  },
+  "root": "root",
+  "version": 7
+}

+ 67 - 0
flake.nix

@@ -0,0 +1,67 @@
+{
+  inputs = {
+    nixpkgs.url = "github:NixOS/nixpkgs";
+    flake-utils.url = "github:numtide/flake-utils";
+    mkCli.url = "github:cprussin/mkCli";
+  };
+
+  outputs = {
+    nixpkgs,
+    flake-utils,
+    mkCli,
+    ...
+  }: (
+    flake-utils.lib.eachDefaultSystem
+    (
+      system: let
+        nodejs-overlay = _: prev: {
+          nodejs = prev.nodejs_18;
+        };
+
+        cli-overlay = _: prev: {
+          cli = prev.lib.mkCli "cli" {
+            _noAll = true;
+
+            install = "${prev.pnpm}/bin/pnpm i";
+
+            test = {
+              nix = {
+                lint = "${prev.statix}/bin/statix check --ignore node_modules .";
+                dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules .";
+                format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules --check .";
+              };
+            };
+
+            fix = {
+              nix = {
+                lint = "${prev.statix}/bin/statix fix --ignore node_modules .";
+                dead-code = "${prev.deadnix}/bin/deadnix --exclude ./node_modules -e .";
+                format = "${prev.alejandra}/bin/alejandra --exclude ./node_modules .";
+              };
+            };
+          };
+        };
+
+        pkgs = import nixpkgs {
+          inherit system;
+          overlays = [mkCli.overlays.default cli-overlay nodejs-overlay];
+          config = {};
+        };
+      in {
+        devShells.default = pkgs.mkShell {
+          buildInputs = [
+            pkgs.cargo
+            pkgs.cli
+            pkgs.git
+            pkgs.libusb
+            pkgs.nodejs
+            pkgs.pkg-config
+            pkgs.pnpm
+            pkgs.pre-commit
+            pkgs.python3
+          ];
+        };
+      }
+    )
+  );
+}

+ 5 - 0
governance/xc_admin/packages/xc_admin_frontend/next-env.d.ts

@@ -0,0 +1,5 @@
+/// <reference types="next" />
+/// <reference types="next/image-types/global" />
+
+// NOTE: This file should not be edited
+// see https://nextjs.org/docs/basic-features/typescript for more information.

+ 8 - 10
package.json

@@ -1,17 +1,15 @@
 {
-  "name": "root",
-  "packageManager": "pnpm@8.15.5",
-  "dependencies": {
-    "pre-commit": "^1.2.2",
-    "prettier": "2.7.1"
+  "private": true,
+  "packageManager": "pnpm@9.2.0",
+  "engines": {
+    "node": "^18.19.1",
+    "pnpm": "^9.2.0"
   },
   "devDependencies": {
-    "lerna": "^6.4.1"
-  },
-  "engines": {
-    "node": ">=18.0.0 <19.0.0"
+    "lerna": "^6.4.1",
+    "pre-commit": "^1.2.2",
+    "prettier": "2.7.1"
   },
-  "version": "0.0.1",
   "pnpm": {
     "overrides": {
       "@injectivelabs/sdk-ts@1.10.72>@injectivelabs/token-metadata": "1.10.42",

File diff suppressed because it is too large
+ 146 - 147
pnpm-lock.yaml


+ 0 - 69
shell.nix

@@ -1,69 +0,0 @@
-{
-  sources ? import ./sources.nix,
-  nixpkgs ? sources.nixpkgs,
-  niv ? sources.niv,
-  mkCli ? sources.mkCli,
-}: let
-  niv-overlay = self: _: {
-    niv = self.symlinkJoin {
-      name = "niv";
-      paths = [niv];
-      buildInputs = [self.makeWrapper];
-      postBuild = ''
-        wrapProgram $out/bin/niv \
-          --add-flags "--sources-file ${toString ./sources.json}"
-      '';
-    };
-  };
-
-  mkCli-overlay = import "${mkCli}/overlay.nix";
-
-  nodejs-overlay = _: super: {
-    nodejs = super.nodejs_18;
-  };
-
-  pkgs = import nixpkgs {
-    overlays = [
-      niv-overlay
-      mkCli-overlay
-      nodejs-overlay
-    ];
-    config = {};
-  };
-
-  cli = pkgs.lib.mkCli "cli" {
-    _noAll = true;
-
-    install = "${pkgs.nodePackages.pnpm}/bin/pnpm i";
-
-    test = {
-      nix = {
-        lint = "${pkgs.statix}/bin/statix check --ignore node_modules .";
-        dead-code = "${pkgs.deadnix}/bin/deadnix --exclude ./node_modules .";
-        format = "${pkgs.alejandra}/bin/alejandra --exclude ./node_modules --check .";
-      };
-    };
-
-    fix = {
-      nix = {
-        lint = "${pkgs.statix}/bin/statix fix --ignore node_modules .";
-        dead-code = "${pkgs.deadnix}/bin/deadnix --exclude ./node_modules -e .";
-        format = "${pkgs.alejandra}/bin/alejandra --exclude ./node_modules .";
-      };
-    };
-  };
-in
-  pkgs.mkShell {
-    FORCE_COLOR = 1;
-    buildInputs = [
-      cli
-      pkgs.git
-      pkgs.niv
-      pkgs.nodejs
-      pkgs.python3
-      pkgs.pkg-config
-      pkgs.nodePackages.pnpm
-      pkgs.cargo
-      pkgs.pre-commit
-    ];
-  }

+ 0 - 26
sources.json

@@ -1,26 +0,0 @@
-{
-  "mkCli": {
-    "branch": "main",
-    "description": "Simple development environment cli generator for nix",
-    "homepage": null,
-    "owner": "cprussin",
-    "repo": "mkCli",
-    "rev": "3d356fd26d59dcfdccf47160e78f9389f150fc2c",
-    "sha256": "1d3cy916sayj00v0gqvb0w49kdy05w1nl3pl81f6rp7gr9k6svl1",
-    "type": "tarball",
-    "url": "https://github.com/cprussin/mkCli/archive/3d356fd26d59dcfdccf47160e78f9389f150fc2c.tar.gz",
-    "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
-  },
-  "nixpkgs": {
-    "branch": "nixpkgs-unstable",
-    "description": "A read-only mirror of NixOS/nixpkgs tracking the released channels. Send issues and PRs to",
-    "homepage": "https://github.com/NixOS/nixpkgs",
-    "owner": "NixOS",
-    "repo": "nixpkgs",
-    "rev": "31f40991012489e858517ec20102f033e4653afb",
-    "sha256": "0k953cl402d83pciaqhh85zc77x7jqwh86rc81k0fdh1gwqfqnqy",
-    "type": "tarball",
-    "url": "https://github.com/NixOS/nixpkgs/archive/31f40991012489e858517ec20102f033e4653afb.tar.gz",
-    "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
-  }
-}

+ 0 - 11
sources.nix

@@ -1,11 +0,0 @@
-let
-  nivSrc = fetchTarball {
-    url = "https://github.com/nmattia/niv/tarball/ecabfde837ccfb392ccca235f96bfcf4bb8ab186";
-    sha256 = "1aij19grvzbxj0dal49bsnhq1lc23nrglv6p0f00gwznl6109snj";
-  };
-  sources = import "${nivSrc}/nix/sources.nix" {
-    sourcesFile = ./sources.json;
-  };
-  niv = import nivSrc {};
-in
-  niv // sources

Some files were not shown because too many files changed in this diff