Merge pull request #3240 from atjn/nodejs-18-patch

Support Nodejs 18
pull/3242/head
Gordon Williams 2024-03-07 10:36:59 +00:00 committed by GitHub
commit 79444702de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 8 additions and 2 deletions

View File

@ -11,10 +11,10 @@ jobs:
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
submodules: recursive submodules: recursive
- name: Use Node.js 20.x - name: Use Node.js 18.x
uses: actions/setup-node@v3 uses: actions/setup-node@v3
with: with:
node-version: 20.x node-version: 18.x
- name: Install testing dependencies - name: Install testing dependencies
run: npm ci run: npm ci
- name: Test all apps and widgets - name: Test all apps and widgets

View File

@ -16,6 +16,9 @@
import fs from "node:fs/promises"; import fs from "node:fs/promises";
// Nodejs v18 compatibility (v18 is end-of-life in april 2025)
if(!("crypto" in globalThis)) globalThis.crypto = (await import("node:crypto")).webcrypto;
const lintRule = process.argv[2]; const lintRule = process.argv[2];
if (!lintRule) { if (!lintRule) {
throw new Error( throw new Error(

View File

@ -11,6 +11,9 @@
import fs from "node:fs/promises"; import fs from "node:fs/promises";
// Nodejs v18 compatibility (v18 is end-of-life in april 2025)
if(!("crypto" in globalThis)) globalThis.crypto = (await import("node:crypto")).webcrypto;
const exemptionsFilePath = "../apps/lint_exemptions.js"; const exemptionsFilePath = "../apps/lint_exemptions.js";
const exemptions = (await import(exemptionsFilePath)).default; const exemptions = (await import(exemptionsFilePath)).default;