feat: Migrate to Node.js 24.15.0#6063
Draft
Pyatakov wants to merge 10 commits into
Draft
Conversation
a9a04cd to
dc9b175
Compare
dc9b175 to
acf351d
Compare
Bump Node.js base image to 24.15.0 across all Dockerfiles. Update dependencies and devDependencies for multiple services, including major upgrades to NestJS, MikroORM, Express, Axios, RxJS, and related type packages. Add patch-package and postinstall scripts where needed. Refactor TypeScript configuration files to use ES2023, NodeNext module resolution, and update strictness and source map settings for consistency. Upgraded various dependencies in e2e-tests and frontend package.json and package-lock.json files. Update package-lock.json Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
All GitHub Actions workflow files now use Node.js version 24.15.0 instead of 20.20.2 Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Consolidated the import of FindOptions from '@mikro-orm/core' in database-server.ts and db-helper.ts, removing unnecessary type-only imports. Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Deleted multiple obsolete test files from guardian-service and policy-service, including API and unit tests Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Replaces deprecated 'url.parse' with 'new URL' for node address parsing. Updates file upload logic to wrap files in Uint8Array before creating Blob for compatibility with IPFS providers. Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Added "noUnusedLocals" and "noUnusedParameters" TypeScript compiler options to all project and production tsconfig.json files Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Cleaned up unused imports and variables Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Deleted helia-node.ts, ipfs-node.ts, and kudo-node.ts from the IPFS loaders directory as these files are no longer needed Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Updated all imports of Node.js core modules to use the 'node:' prefix for improved clarity and compatibility with modern Node.js standards. This change affects various files across multiple services, replacing imports such as 'fs', 'path', 'process', 'crypto', and others with their 'node:' equivalents. Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
Under module:NodeNext, default imports of CJS packages can resolve to the
module namespace rather than the runtime export, and some dep bumps moved
public types out of the package's barrel. Adjusts four call sites:
- api-gateway cache-provider: switch ioredis to a named import so Redis
resolves as a class.
- auth-service metrics: import expressMiddleware by name from
prometheus-api-metrics instead of the default.
- auth-service meeco.service: drop the base64url package in favor of
Buffer.toString('base64url') (built into Node since 16).
- policy-service math-context: derive BoxedExpression from
ComputeEngine['box']'s return type since @cortex-js/compute-engine 0.27
no longer re-exports the interface at the top level.
Signed-off-by: Alex Piatakov <alex.piatakov@swirldslabs.com>
30efd7b to
07a68f9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
@nestjs/* 11.1.11,@mikro-orm/* 6.6.2,mongodb 6.20.0,express 5.2.1,axios 1.12.0,@types/node 24.10.4, plus many others tightened to exact versionstsconfig.jsontomodule: NodeNext/moduleResolution: NodeNext/target: ES2023/lib: ["ES2023"]; alignstrict: falseconsistently in dev and production; enablenoUnusedLocals: trueeverywhere it was reasonable.jsextensions to relative imports required by NodeNext (5 source files)node:prefix; replaceecosystem.config.js's__dirnamewithimport.meta.dirnamemongodbas a direct dep incommon,indexer-common,guardian-service,indexer-service,policy-serviceso the dep graph is honest (deduped against@mikro-orm/mongodb's nested copy)ioredis,prometheus-api-metrics, and@cortex-js/compute-engine 0.27(which no longer re-exportsBoxedExpression); dropbase64urlin favor of nativeBuffer.toString('base64url')worker-serviceIPFS client: pass the URL string directly tokubo-rpc-client.create()instead of decomposing it into protocol/host/port (the decomposed form broke for default-port URLs likehttp://...:80after theurl.parse→new URLswitch)engines.node: ">=24.15.0"to root and 23 backendpackage.jsonfiles (skippedcontractssince its Node version is governed by hardhat, not Guardian)engines.node: ">=20.11.0 <21"tofrontendandindexer-frontend; bumpfrontend/@types/nodefrom the long-stale^12.11.1to^20.11.0esmpackage internals viapatch-package(patches/esm+3.2.25.patch); needed because@digitalbazaar/http-client(transitive via@transmute/* 0.7.0-unstable.80) declares the unmaintainedesmruntime depmodule-alias/rewiredevDeps from 4 services and 6 vestigialimport 'module-alias/register.js'lines; delete 9 obsolete test files that depended on rewire and couldn't run under ESMnoUnusedLocalsKnown follow-ups (out of scope for this PR):
@transmute/* 0.7.0-unstable.80so theesmpatch can be dropped@mattrglobal/node-bbs-signatureshas no Node 24 prebuilt binary (NODE_MODULE_VERSION 137); install logs a non-fatal warning, but BBS verifiable-credential operations fall back to the JS pathnoUnusedLocalsinguardian-service,policy-service,mrv-sender(stillfalse)tsconfig.base.json