diff --git a/.changeset/ten-lizards-tease.md b/.changeset/ten-lizards-tease.md new file mode 100644 index 00000000000..7588d86b02c --- /dev/null +++ b/.changeset/ten-lizards-tease.md @@ -0,0 +1,5 @@ +--- +"hardhat": patch +--- + +Added support for Node v24. diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 328746a761b..cee64bec707 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "image": "mcr.microsoft.com/devcontainers/base:bullseye", "features": { "ghcr.io/devcontainers/features/node:1": { - "version": "22" + "version": "23" } }, "postCreateCommand": "scripts/setup.sh", diff --git a/.github/actions/setup-env/action.yml b/.github/actions/setup-env/action.yml index f1d165f6855..d7297ec31cd 100644 --- a/.github/actions/setup-env/action.yml +++ b/.github/actions/setup-env/action.yml @@ -9,7 +9,7 @@ inputs: node-version: description: Version of node to install required: false - default: "22" + default: "23" cache-save: description: Whether to save the pnpm cache required: false diff --git a/.github/workflows/v-next-ci.yml b/.github/workflows/v-next-ci.yml index c9e96362d94..59bb1ad7aab 100644 --- a/.github/workflows/v-next-ci.yml +++ b/.github/workflows/v-next-ci.yml @@ -40,7 +40,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 23 - name: Run check run: node scripts/check-v-next-dependencies.js @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 23 - name: Run check run: node scripts/check-v-next-npm-scripts.js @@ -69,7 +69,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 23 - run: yq -p yaml -o json pnpm-lock.yaml | tee pnpm-lock.json - id: generate env: @@ -121,7 +121,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-env with: - node-version: 22 + node-version: 23 - name: Install dependencies run: pnpm install --frozen-lockfile --prefer-offline - name: Build @@ -206,7 +206,7 @@ jobs: - uses: actions/checkout@v4 - uses: ./.github/actions/setup-env with: - node-version: 22 + node-version: 23 - name: Install dependencies run: pnpm install --frozen-lockfile --prefer-offline - name: Build @@ -241,7 +241,7 @@ jobs: matrix: package: ${{ fromJson(needs.list-packages.outputs.packages) }} os: [ubuntu-latest, macos-13, macos-latest, windows-latest] - node: [22] + node: [23] name: "[${{ matrix.package }}] ci on ${{ matrix.os }} (Node ${{ matrix.node }})" runs-on: ${{ matrix.os }} diff --git a/.nvmrc b/.nvmrc index 2bd5a0a98a3..409940768f2 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -22 +23 diff --git a/config-v-next/eslint.cjs b/config-v-next/eslint.cjs index 537b0150e30..722b3bafaa4 100644 --- a/config-v-next/eslint.cjs +++ b/config-v-next/eslint.cjs @@ -15,7 +15,7 @@ const path = require("path"); */ function createConfig( configFilePath, - options = { onlyHardhatError: true, enforceHardhatTestUtils: true } + options = { onlyHardhatError: true, enforceHardhatTestUtils: true }, ) { /** * @type {import("eslint").Linter.Config} @@ -372,7 +372,9 @@ function createConfig( "Don't import from the src folder, use the package entry point instead.", }, { - group: require("module").builtinModules.map((m) => `/${m}`), + group: require("module") + .builtinModules.filter((m) => !m.startsWith("node:")) // avoid blocking correct imports + .map((m) => `/${m}`), message: "Use the 'node:' prefix to import built-in Node.js modules.", }, @@ -389,7 +391,7 @@ function createConfig( importNames: [ "default", ...Object.keys(require("node:assert")).filter( - (k) => k !== "AssertionError" + (k) => k !== "AssertionError", ), ], message: "Use node:assert/strict instead.", @@ -451,7 +453,7 @@ function createConfig( selector: "CallExpression[callee.object.name='assert'][callee.property.name=rejects]", message: "Don't use assert.rejects. Use our test helpers instead.", - } + }, ); } diff --git a/v-next/hardhat/src/internal/cli/node-version.ts b/v-next/hardhat/src/internal/cli/node-version.ts index 82e9e0583eb..13367e3f27e 100644 --- a/v-next/hardhat/src/internal/cli/node-version.ts +++ b/v-next/hardhat/src/internal/cli/node-version.ts @@ -3,7 +3,7 @@ import chalk from "chalk"; -export const MIN_SUPPORTED_NODE_VERSION: number[] = [22, 10, 0]; +export const MIN_SUPPORTED_NODE_VERSION: number[] = [23, 10, 0]; export function isNodeVersionSupported(): boolean { try {