Browse Source

build(npm): update Node.js and all packages

This change updates the Node Version Manager version file to the latest
long-term release version of Node.js, v20.11.1, and the Node.js Package
Manager package file to require Node.js version v20 or later.

Additionally, all Node.js modules have been updated, as some packages
required additional accommodations to be made compatible with this
version of Node.js.

As part of this, the `.commitlintrc.js` has been rewritten from CommonJS
to ECMAScript. There should be no impact on the behaviour of Commitlint,
but this was was a requirement to allow Commitlint to continue using it
for configuration.

Change-Id: I7043faabc516c58edda9e58848b0569e2158b271
Signed-off-by: Chris Kay <chris.kay@arm.com>
Chris Kay 2 months ago
parent
commit
c7080f6788
5 changed files with 864 additions and 4107 deletions
  1. 9 10
      .commitlintrc.js
  2. 1 1
      .nvmrc
  3. 0 0
      .versionrc.cjs
  4. 846 4089
      package-lock.json
  5. 8 7
      package.json

+ 9 - 10
.commitlintrc.js

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2024, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -8,10 +8,9 @@
 
 "use strict";
 
-const fs = require("fs");
-const yaml = require("js-yaml");
-
-const { "trailer-exists": trailerExists } = require("@commitlint/rules").default;
+import fs from "fs";
+import rules from "@commitlint/rules";
+import yaml from "js-yaml";
 
 /*
  * The types and scopes accepted by both Commitlint and Commitizen are defined by the changelog
@@ -37,7 +36,7 @@ function getTypes(sections) {
 
 function getScopes(subsections) {
     return subsections.flatMap(subsection => {
-        const scope = subsection.scope ?  [ subsection.scope ] : [];
+        const scope = subsection.scope ? [subsection.scope] : [];
         const subscopes = getScopes(subsection.subsections || []);
 
         return scope.concat(subscopes);
@@ -47,13 +46,13 @@ function getScopes(subsections) {
 const types = getTypes(changelog.sections).sort(); /* Sort alphabetically */
 const scopes = getScopes(changelog.subsections).sort(); /* Sort alphabetically */
 
-module.exports = {
+export default {
     extends: ["@commitlint/config-conventional"],
     plugins: [
         {
             rules: {
-                "signed-off-by-exists": trailerExists,
-                "change-id-exists": trailerExists,
+                "signed-off-by-exists": rules["trailer-exists"],
+                "change-id-exists": rules["trailer-exists"],
             },
         },
     ],
@@ -64,7 +63,7 @@ module.exports = {
         "change-id-exists": [1, "always", "Change-Id:"], /* Warning */
         "signed-off-by-exists": [1, "always", "Signed-off-by:"], /* Warning */
 
-        "type-case": [2, "always", "lower-case" ], /* Error */
+        "type-case": [2, "always", "lower-case"], /* Error */
         "type-enum": [2, "always", types], /* Error */
 
         "scope-case": [2, "always", "lower-case"], /* Error */

+ 1 - 1
.nvmrc

@@ -1 +1 @@
-v16.17.1
+v20.11.1

+ 0 - 0
.versionrc.js → .versionrc.cjs


File diff suppressed because it is too large
+ 846 - 4089
package-lock.json


+ 8 - 7
package.json

@@ -2,22 +2,23 @@
   "name": "trusted-firmware-a",
   "version": "2.10.0",
   "license": "BSD-3-Clause",
+  "type": "module",
   "private": true,
   "scripts": {
     "postinstall": "husky install",
     "release": "standard-version"
   },
   "engines": {
-    "node": ">=16.0.0"
+    "node": ">=20"
   },
   "devDependencies": {
-    "@commitlint/cli": "^16.1.0",
-    "@commitlint/config-conventional": "^16.0.0",
-    "@commitlint/cz-commitlint": "^16.1.0",
-    "commitizen": "^4.2.4",
+    "@commitlint/cli": "^19.0.0",
+    "@commitlint/config-conventional": "^19.0.0",
+    "@commitlint/cz-commitlint": "^19.0.0",
+    "commitizen": "^4.3.0",
     "conventional-changelog-tf-a": "file:tools/conventional-changelog-tf-a",
-    "husky": "^7.0.4",
+    "husky": "^9.0.11",
     "js-yaml": "^4.1.0",
-    "standard-version": "^9.3.2"
+    "standard-version": "^9.5.0"
   }
 }

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