Skip to content

Conversation

@alumni
Copy link
Collaborator

@alumni alumni commented Apr 4, 2025

Description of change

Drop support for older versions of node (16 and 18) and setup tests for node 22 and 23.

Pull-Request Checklist

  • Code is up-to-date with the master branch
  • npm run format to apply prettier formatting
  • npm run test passes with this change
  • This pull request links relevant issues as Fixes #0000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change
  • The new commits follow conventions explained in CONTRIBUTING.md

Summary by CodeRabbit

  • New Features

    • Added a "typecheck" npm script for type checking without emitting output.
  • Improvements

    • Updated support and configuration for JavaScript and TypeScript to ES2023 and Node.js 20+.
    • Upgraded dependencies, including better-sqlite3 and TypeScript, to newer versions.
    • Enhanced initial project setup templates with updated ECMAScript and driver versions.
    • Enabled the MSSQL connection in the sample configuration.
  • Documentation

    • Updated documentation to reflect support for ES2023 in multiple languages and improved introductory content.
  • Refactor

    • Refined TypeScript class property declarations for improved type safety and maintainability.
    • Adjusted workflow files for improved clarity, formatting, and updated Node.js versions in CI.
  • Chores

    • Minor formatting and naming changes in workflow and configuration files.

@coveralls
Copy link

coveralls commented Apr 4, 2025

Coverage Status

coverage: 76.431%. remained the same
when pulling 1bbd781 on alumni:build/node20
into 925dee0 on typeorm:next.

@alumni alumni force-pushed the build/node20 branch 2 times, most recently from a626a51 to 4ad31af Compare May 7, 2025 15:53
@pkg-pr-new
Copy link

pkg-pr-new bot commented May 7, 2025

typeorm-sql-js-example

npm i https://pkg.pr.new/typeorm/typeorm@11382

commit: 1bbd781

@michaelbromley michaelbromley added this to the Next Major milestone May 8, 2025
@michaelbromley michaelbromley moved this to Proposed in TypeORM Roadmap May 8, 2025
@alumni alumni force-pushed the build/node20 branch 2 times, most recently from baedcb3 to f2c905f Compare May 14, 2025 18:51
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2025

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This update modernizes the project’s TypeScript and Node.js environment, raising support to ES2023 and Node 20+/22+, and updates dependencies and driver versions accordingly. Several workflow files are reformatted and updated for consistency, with some jobs and input types adjusted. Multiple TypeScript classes now use declare for properties, and configuration files reflect the new environment requirements.

Changes

File(s) Change Summary
.github/workflows/codeql.yml
.github/workflows/database-tests-windows.yml
Removed trailing blank line after workflow name declaration; no functional changes.
.github/workflows/coverage.yml Removed extraneous blank line after workflow name; added newline at end of file.
.github/workflows/database-tests-compose.yml
.github/workflows/database-tests.yml
Changed workflow input node-version type from string to number. Updated npm install commands to npm ci. In database-tests.yml, removed matrix strategy from mssql job, added conditional execution, updated Postgres matrix, and simplified Coveralls flag names.
.github/workflows/default.yml Renamed workflow from "test" to "default". Updated Node.js version specification and test matrix to use Node 20/22/24.
.github/workflows/publish-package.yml Changed job name from build to publish. Added blank lines for formatting.
README.md
README_ko.md
README-zh_CN.md
Updated supported JavaScript version from ES2021 to ES2023 in introduction. README.md also consolidated intro and added a trailing comma in a code sample.
gulpfile.ts Updated TypeScript project config: removed explicit module, changed lib from es2021 to es2023.
ormconfig.sample.json Changed MSSQL connection config from "skip": true to "skip": false.
package.json Updated TypeScript target and Node.js engine requirements. Upgraded dependencies (better-sqlite3, typescript, @types/node). Added typecheck npm script.
src/commands/InitCommand.ts Updated generated TypeScript config to ES2023/ES2022. Bumped default driver versions for better-sqlite3 and mssql.
src/driver/aurora-postgres/AuroraPostgresDriver.ts
src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts
src/driver/capacitor/CapacitorDriver.ts
src/driver/cordova/CordovaDriver.ts
src/driver/expo/ExpoDriver.ts
src/driver/expo/legacy/ExpoLegacyDriver.ts
src/driver/sqljs/SqljsDriver.ts
src/repository/MongoRepository.ts
Changed property declarations to use TypeScript declare modifier, removing initializations. In AuroraPostgresQueryRunner, also removed databaseConnectionPromise property.
src/driver/better-sqlite3/BetterSqlite3Driver.ts
src/driver/sqlite/SqliteDriver.ts
Removed property declaration for underlying SQLite library (sqlite: any).
test/functional/query-runner/stream.ts Added explicit TypeScript type annotations to Promises for stream event handling.
tsconfig.json Extended from Node 20 preset, removed downlevelIteration, added useDefineForClassFields: false.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant GitHub Actions
  participant Node.js
  participant TypeScript
  participant Database Drivers

  User->>GitHub Actions: Push/PR triggers workflow
  GitHub Actions->>Node.js: Setup Node 20/22/24 (as per new matrix)
  GitHub Actions->>TypeScript: Compile with ES2023 settings
  GitHub Actions->>Database Drivers: Install updated drivers (e.g., better-sqlite3 11.10.0)
  GitHub Actions->>GitHub Actions: Run tests and publish (using updated workflows)
Loading

Poem

🐇✨
The code now hops to ES2023,
With Node and drivers bright and free.
Workflows pruned and types declared,
Modern streams and configs shared.
A bunny cheers this tidy spree—
New carrots for stability!
🥕

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🧪 Early access (Sonnet 4.5): enabled

We are currently testing the Sonnet 4.5 model, which is expected to improve code review quality. However, this model may lead to increased noise levels in the review comments. Please disable the early access features if the noise level causes any inconvenience.

Note:

  • Public repositories are always opted into early access features.
  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.

Comment @coderabbitai help to get the list of available commands and usage tips.

@alumni
Copy link
Collaborator Author

alumni commented May 22, 2025

@coderabbitai full review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 22, 2025

✅ Actions performed

Full review triggered.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts (2)

13-13: Consider using the override modifier for clarity.

Since you’re declaring a property that exists on the base class (PostgresQueryRunner), marking it explicitly with override (if your TS target supports it) makes the intent clearer and helps catch mismatches.


34-34: Use override when declaring driver.

Similarly, the driver property here shadows the base class’s field. Replacing

declare driver: AuroraPostgresDriver

with

override declare driver: AuroraPostgresDriver

improves readability and leverages TS’s safety checks.

README_ko.md (1)

4-4: Use the official “Node.js” spelling.

Standardize on “Node.js” instead of “NodeJS” to match the framework’s official name.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~4-~4: The official spelling of this programming framework is “Node.js”.
Context: ...">

TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

README-zh_CN.md (1)

23-23: Standardize on “Node.js” spelling.

Replace “NodeJS” with “Node.js” in the intro for consistency with the official branding.

README.md (1)

24-24: Use correct spelling Node.js
The framework name is officially “Node.js”, not “NodeJS”. Please update the casing for consistency and accuracy.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: The official spelling of this programming framework is “Node.js”.
Context: ...ect-relational_mapping) that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5003aaa and ea1093b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • .github/workflows/codeql.yml (0 hunks)
  • .github/workflows/coverage.yml (1 hunks)
  • .github/workflows/database-tests-compose.yml (2 hunks)
  • .github/workflows/database-tests-windows.yml (0 hunks)
  • .github/workflows/database-tests.yml (11 hunks)
  • .github/workflows/default.yml (5 hunks)
  • .github/workflows/publish-package.yml (1 hunks)
  • README-zh_CN.md (1 hunks)
  • README.md (2 hunks)
  • README_ko.md (1 hunks)
  • gulpfile.ts (1 hunks)
  • ormconfig.sample.json (1 hunks)
  • package.json (5 hunks)
  • src/commands/InitCommand.ts (3 hunks)
  • src/driver/aurora-postgres/AuroraPostgresDriver.ts (1 hunks)
  • src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts (2 hunks)
  • src/driver/better-sqlite3/BetterSqlite3Driver.ts (0 hunks)
  • src/driver/capacitor/CapacitorDriver.ts (1 hunks)
  • src/driver/cordova/CordovaDriver.ts (1 hunks)
  • src/driver/expo/ExpoDriver.ts (1 hunks)
  • src/driver/expo/legacy/ExpoLegacyDriver.ts (1 hunks)
  • src/driver/sqlite/SqliteDriver.ts (0 hunks)
  • src/driver/sqljs/SqljsDriver.ts (1 hunks)
  • src/repository/MongoRepository.ts (1 hunks)
  • test/functional/query-runner/stream.ts (1 hunks)
  • tsconfig.json (2 hunks)
💤 Files with no reviewable changes (4)
  • .github/workflows/database-tests-windows.yml
  • src/driver/better-sqlite3/BetterSqlite3Driver.ts
  • src/driver/sqlite/SqliteDriver.ts
  • .github/workflows/codeql.yml
🧰 Additional context used
🧬 Code Graph Analysis (7)
src/driver/expo/ExpoDriver.ts (1)
src/driver/expo/ExpoConnectionOptions.ts (1)
  • ExpoConnectionOptions (6-23)
src/repository/MongoRepository.ts (1)
src/entity-manager/MongoEntityManager.ts (1)
  • MongoEntityManager (75-1211)
src/driver/sqljs/SqljsDriver.ts (1)
src/driver/sqljs/SqljsConnectionOptions.ts (1)
  • SqljsConnectionOptions (6-55)
src/driver/expo/legacy/ExpoLegacyDriver.ts (1)
src/driver/expo/ExpoConnectionOptions.ts (1)
  • ExpoConnectionOptions (6-23)
src/driver/cordova/CordovaDriver.ts (1)
src/driver/cordova/CordovaConnectionOptions.ts (1)
  • CordovaConnectionOptions (6-29)
src/driver/capacitor/CapacitorDriver.ts (1)
src/driver/capacitor/CapacitorConnectionOptions.ts (1)
  • CapacitorConnectionOptions (6-44)
src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts (1)
src/driver/aurora-postgres/AuroraPostgresDriver.ts (1)
  • AuroraPostgresDriver (18-192)
🪛 LanguageTool
README_ko.md

[uncategorized] ~4-~4: The official spelling of this programming framework is “Node.js”.
Context: ...">

TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

README.md

[uncategorized] ~24-~24: The official spelling of this programming framework is “Node.js”.
Context: ...ect-relational_mapping) that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

🔇 Additional comments (40)
.github/workflows/coverage.yml (1)

12-12: Properly formatted GitHub Action parameter.

The explicit formatting of the parallel-finished parameter is correct and consistent with GitHub Actions best practices.

test/functional/query-runner/stream.ts (2)

49-51: Good type annotation enhancement.

Adding explicit Promise<void> type annotation improves type safety and readability without changing functionality. This change aligns with modern TypeScript practices.


57-57: Good type annotation enhancement.

Adding explicit Promise<void> type annotation for the Promise handling the stream end/error events improves type safety and clarity.

src/driver/expo/ExpoDriver.ts (1)

8-8: Correctly standardized property declaration.

Changing the options property to use the declare keyword properly indicates that this property is expected to be provided externally (likely by the parent class AbstractSqliteDriver) rather than initialized in this class. This change is part of a broader standardization of driver class property declarations throughout the codebase.

src/repository/MongoRepository.ts (1)

63-63: Correctly standardized property declaration.

Changing manager property to use the declare readonly keywords improves type declarations while maintaining the readonly constraint. This property is injected externally rather than initialized within this class, and the declaration now properly reflects this pattern. This aligns with modern TypeScript practices and similar changes made throughout the codebase.

src/driver/aurora-postgres/AuroraPostgresDriver.ts (1)

13-13: Consistent use of declare for options property
Switching options to a declare modifier ensures it’s a type-only declaration (no emitted JS) and aligns with the pattern across other drivers.

src/driver/expo/legacy/ExpoLegacyDriver.ts (1)

9-9: Adopted declare for typed connection options
Changing options to declare options: ExpoConnectionOptions correctly reflects that the property is provided externally (by the superclass) and avoids redundant initialization.

src/driver/capacitor/CapacitorDriver.ts (1)

11-11: Declared options for Capacitor driver configuration
Using declare options: CapacitorConnectionOptions harmonizes the property declaration style across all SQLite-based drivers and removes unnecessary initialization.

src/driver/cordova/CordovaDriver.ts (1)

17-17: Standardized options declaration for Cordova driver
The declare options: CordovaConnectionOptions change cleanly indicates that options comes from the DataSource and avoids emitting default JS code.

src/driver/sqljs/SqljsDriver.ts (1)

24-24: Type-only options declaration for SQL.js driver
Switching to declare options: SqljsConnectionOptions matches the refactor in other drivers, ensuring the property is typed without side-effect initialization.

README_ko.md (1)

4-4: Align documentation with ES2023 support.

The JavaScript version in the intro was correctly updated to ES2023, matching other README files and config.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~4-~4: The official spelling of this programming framework is “Node.js”.
Context: ...">

TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

tsconfig.json (2)

2-2: Upgrade baseline to Node 20.

Extending @tsconfig/node20/tsconfig.json correctly aligns the project with the new Node.js support policy.


21-21: Explicitly disable useDefineForClassFields.

Setting "useDefineForClassFields": false ensures backward-compatible semantics for class fields across your supported runtimes.

README-zh_CN.md (1)

23-23: Update supported JS version to ES2023.

This bump aligns the Chinese README with the project’s upgrade to the ES2023 target.

ormconfig.sample.json (1)

59-59: Enable MSSQL configuration.

Changing "skip" to false here correctly activates MSSQL tests. Ensure corresponding CI jobs and service containers are prepared in workflows.

README.md (1)

155-155: Trailing comma consistency
The addition of a trailing comma after "Saw", is consistent with updated linting standards and improves diffs.

.github/workflows/database-tests-compose.yml (2)

7-7: Use number type for node-version input
Changing from string to number aligns this workflow with other database-test workflows and enforces type consistency.


55-55: Use npm ci for clean installs
Switching from npm i to npm ci ensures reproducible, cached installs in CI environments.

.github/workflows/publish-package.yml (3)

6-6: Formatting-only change (blank line addition).


8-8: Rename job to publish
Updating the job name from build to publish better reflects the job’s purpose and improves clarity.


13-13: Formatting-only change (blank line addition).

gulpfile.ts (1)

67-67: Update compilation libs to ES2023
Aligning the TypeScript lib with the project’s ES2023 support ensures consistency across build targets.

.github/workflows/default.yml (5)

5-5: Rename workflow to default
Renaming from “test” to “default” reflects its broader role in CI and matches repository conventions.


20-20: Use integer for node-version
Switching node-version from "20.x" to 20 matches other workflows and enforces consistent version specification.


34-34: Use integer for node-version
Consistent with the formatting in the formatting and build jobs.


54-54: Update test matrix to support Node.js 20, 22, 24
Expanding the matrix to [20, 22, 24] ensures tests cover the newly supported Node.js versions.


66-66: Confirm Node.js version support for compose tests
The database-tests-compose matrix omits Node.js 24. Please verify whether the compose-based tests should also include version 24 or if there's a specific constraint preventing it.

src/commands/InitCommand.ts (3)

265-266: LGTM: ECMAScript target upgrade for Node 20+ support

The update to ES2023 lib and ES2022 target aligns with dropping support for Node.js 16 and 18, as these newer ECMAScript features require Node.js 20+.

Also applies to: 283-284


712-712:

Details

❓ Verification inconclusive

Significant version upgrade for better-sqlite3

The better-sqlite3 dependency has been updated to the latest major version ^11.10.0. This is a significant jump that aligns with the Node 20+ requirement.


🏁 Script executed:

#!/bin/bash
# Check better-sqlite3 compatibility with Node 20+
npm view better-sqlite3@11.10.0 engines.node

Length of output: 46


To confirm Node.js compatibility for better-sqlite3@11.10.0, let’s fetch its full engines field:


🏁 Script executed:

#!/bin/bash
npm view better-sqlite3@11.10.0 engines

Length of output: 41


Verify Node.js compatibility for better-sqlite3@11.10.0

The engines field isn’t published for v11.10.0, so we can’t automatically confirm it formally supports Node 20+. Please manually verify compatibility by checking the package’s docs or testing it under Node 20+.

  • Location: src/commands/InitCommand.ts (Line 712)
  • Snippet:
    packageJson.dependencies["better-sqlite3"] = "^11.10.0"

718-718:

Details

✅ Verification successful

Significant version upgrade for mssql

The mssql dependency has been updated to ^11.0.1. This version requires Node.js 20+ and drops support for older Node versions.


🏁 Script executed:

#!/bin/bash
# Check mssql compatibility with Node 20+
npm view mssql@11.0.1 engines.node

Length of output: 41


Significant version upgrade for mssql

The mssql dependency has been updated to ^11.0.1. This version requires Node.js 18 or higher, dropping support for older Node.js versions.

package.json (5)

4-4: LGTM: Updated description to reflect ES2023+ support

The package description has been updated to reference ES2023+ support, consistent with the ECMAScript target changes.


89-89: Added helpful typecheck script

Adding a dedicated typecheck script improves the development workflow by allowing type verification without emitting output.


112-112: Updated tsconfig base to Node 20

Using @tsconfig/node20 instead of a previous Node version aligns with the updated Node.js requirements.


125-125: LGTM: Updated dev dependencies for Node 20+ compatibility

The development dependencies have been updated to versions compatible with Node 20+:

  • @types/node to ^20.17.50
  • better-sqlite3 to ^11.10.0
  • typescript to ^5.8.3

These updates are necessary for the target Node version range.

Also applies to: 119-119, 162-162


239-239: Node.js engine requirement updated to v20.9.0+ or v22.11.0+

The engine requirement now specifies Node.js 20.9.0 or higher, or Node.js 22.11.0 or higher, explicitly dropping support for Node.js 16 and 18 as intended.

.github/workflows/database-tests.yml (5)

7-7: Input type changed from string to number

Changed the node-version input type from string to number, which is more appropriate for version numbers and consistent with other workflows.


31-31: Improved CI reliability with clean npm installs

All package installation commands have been changed from npm i to npm ci, which is the recommended approach for CI environments as it ensures clean, reproducible installs based on the exact versions in package-lock.json.

Also applies to: 59-59, 91-91, 133-133, 155-155, 177-177, 199-199, 240-240


69-70: Added Node.js version constraint for MSSQL tests

Added a conditional to only run MSSQL tests on Node.js versions ≤ 23, as the MSSQL client has compatibility issues with Node.js 24+. This prevents unnecessary test failures.


97-97: Simplified Coveralls flag names

The Coveralls flag names have been simplified to follow a more consistent pattern, making it easier to track test coverage across different environments.

Also applies to: 246-246


213-213:

Details

✅ Verification successful

Updated PostGIS matrix version

Changed the PostGIS version in the matrix from "14-3.5" to "14-3.3". This may be to address compatibility issues or to test with a more widely used version.


🏁 Script executed:

#!/bin/bash
# Check if there are any issues reported with PostGIS 14-3.3 that might affect tests
gh issue list --repo typeorm/typeorm --search "postgis 14-3.3" --state all

Length of output: 76


🏁 Script executed:

#!/bin/bash
set -e

echo "Searching for any remaining references to PostGIS 14-3.5 in the repo..."
rg "14-3\\.5" -n .

echo
echo "Verifying occurrences of the new PostGIS 14-3.3 entry..."
rg "14-3\\.3" -n .

echo
echo "Listing all PostGIS matrix entries in workflows..."
grep -R "postgis-version" -n .github/workflows

Length of output: 181


🏁 Script executed:

#!/bin/bash
echo "Searching for any remaining references to PostGIS 14-3.5 in the repo..."
rg "14-3\\.5" -n . || echo "✔ No references to 14-3.5 found."

echo
echo "Verifying occurrences of the new PostGIS 14-3.3 entry..."
rg "14-3\\.3" -n . || echo "⚠ No occurrences of 14-3.3 found—unexpected."

echo
echo "Listing all PostGIS matrix entries in workflows..."
grep -R "postgis-version" -n .github/workflows

Length of output: 946


All references to PostGIS 14-3.5 have been removed in favor of 14-3.3

  • Verified no remaining "14-3.5" occurrences in the repo.
  • Workflows updated in .github/workflows/database-tests.yml (line 213) to ["14-3.3", "17-3.5"].
  • Docker setup in docker-compose.yml (line 31) now uses postgis/postgis:14-3.3.

No open issues found for PostGIS 14-3.3 in the TypeORM repo. This change is consistent and ready to merge.

@alumni alumni changed the base branch from master to next May 22, 2025 18:37
@alumni alumni marked this pull request as ready for review May 22, 2025 18:39
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
README_ko.md (1)

4-4: Updated supported JavaScript version to ES2023

The documentation has been updated to reflect that TypeORM now supports JavaScript ES2023 features, which aligns with the PR's objective of dropping support for older Node.js versions (16 and 18) and supporting newer ones (22 and 23).

Consider updating "NodeJS" to "Node.js" which is the official spelling of the framework.

-TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo 및 Electron 플랫폼에서 실행할 수 있는 [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)이며 TypeScript 및 JavaScript(ES2023)와 함께 사용할 수 있다.
+TypeORM은 Node.js, Browser, Cordova, PhoneGap, Ionic, React Native, NativeScript, Expo 및 Electron 플랫폼에서 실행할 수 있는 [ORM](https://en.wikipedia.org/wiki/Object-relational_mapping)이며 TypeScript 및 JavaScript(ES2023)와 함께 사용할 수 있다.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~4-~4: The official spelling of this programming framework is “Node.js”.
Context: ...">

TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

README.md (1)

24-24: Update supported JavaScript version to ES2023 and standardize "Node.js" spelling
The documentation correctly reflects ES2023 support, but consider replacing "NodeJS" with the official "Node.js" to maintain consistency and adhere to common branding.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~24-~24: The official spelling of this programming framework is “Node.js”.
Context: ...ect-relational_mapping) that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

src/commands/InitCommand.ts (2)

265-266: Update ESM tsconfig lib and target versions
Bumping lib to ["es2023"] aligns generated projects with current language features. Consider also updating the target to "es2023" to match, unless there’s a specific reason to emit ES2022 bytecode for broader compatibility.


283-284: Update CJS tsconfig lib and target versions
Similarly, the CommonJS variant now uses ["es2023"]. Again, you may want to bump the target to "es2023" for full feature support, or document the rationale for targeting ES2022.

package.json (1)

89-89: Add typecheck script for CI type-only checking
The new typecheck script (tsc --noEmit) is a useful addition. Consider invoking it in your CI workflows (e.g., as part of test:ci) to catch type regressions early.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5003aaa and ea1093b.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (26)
  • .github/workflows/codeql.yml (0 hunks)
  • .github/workflows/coverage.yml (1 hunks)
  • .github/workflows/database-tests-compose.yml (2 hunks)
  • .github/workflows/database-tests-windows.yml (0 hunks)
  • .github/workflows/database-tests.yml (11 hunks)
  • .github/workflows/default.yml (5 hunks)
  • .github/workflows/publish-package.yml (1 hunks)
  • README-zh_CN.md (1 hunks)
  • README.md (2 hunks)
  • README_ko.md (1 hunks)
  • gulpfile.ts (1 hunks)
  • ormconfig.sample.json (1 hunks)
  • package.json (5 hunks)
  • src/commands/InitCommand.ts (3 hunks)
  • src/driver/aurora-postgres/AuroraPostgresDriver.ts (1 hunks)
  • src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts (2 hunks)
  • src/driver/better-sqlite3/BetterSqlite3Driver.ts (0 hunks)
  • src/driver/capacitor/CapacitorDriver.ts (1 hunks)
  • src/driver/cordova/CordovaDriver.ts (1 hunks)
  • src/driver/expo/ExpoDriver.ts (1 hunks)
  • src/driver/expo/legacy/ExpoLegacyDriver.ts (1 hunks)
  • src/driver/sqlite/SqliteDriver.ts (0 hunks)
  • src/driver/sqljs/SqljsDriver.ts (1 hunks)
  • src/repository/MongoRepository.ts (1 hunks)
  • test/functional/query-runner/stream.ts (1 hunks)
  • tsconfig.json (2 hunks)
💤 Files with no reviewable changes (4)
  • .github/workflows/database-tests-windows.yml
  • .github/workflows/codeql.yml
  • src/driver/sqlite/SqliteDriver.ts
  • src/driver/better-sqlite3/BetterSqlite3Driver.ts
🧰 Additional context used
🧬 Code Graph Analysis (6)
src/driver/capacitor/CapacitorDriver.ts (1)
src/driver/capacitor/CapacitorConnectionOptions.ts (1)
  • CapacitorConnectionOptions (6-44)
src/driver/cordova/CordovaDriver.ts (1)
src/driver/cordova/CordovaConnectionOptions.ts (1)
  • CordovaConnectionOptions (6-29)
src/driver/expo/ExpoDriver.ts (1)
src/driver/expo/ExpoConnectionOptions.ts (1)
  • ExpoConnectionOptions (6-23)
src/driver/sqljs/SqljsDriver.ts (1)
src/driver/sqljs/SqljsConnectionOptions.ts (1)
  • SqljsConnectionOptions (6-55)
src/repository/MongoRepository.ts (1)
src/entity-manager/MongoEntityManager.ts (1)
  • MongoEntityManager (75-1211)
src/driver/expo/legacy/ExpoLegacyDriver.ts (1)
src/driver/expo/ExpoConnectionOptions.ts (1)
  • ExpoConnectionOptions (6-23)
🪛 LanguageTool
README_ko.md

[uncategorized] ~4-~4: The official spelling of this programming framework is “Node.js”.
Context: ...">

TypeORM은 NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

README.md

[uncategorized] ~24-~24: The official spelling of this programming framework is “Node.js”.
Context: ...ect-relational_mapping) that can run in NodeJS, Browser, Cordova, PhoneGap, Ionic, Rea...

(NODE_JS)

🔇 Additional comments (38)
.github/workflows/coverage.yml (1)

12-12: Clean formatting improvement.

The whitespace formatting change on the parallel-finished parameter improves readability and consistency, which is good practice for YAML configuration files.

.github/workflows/publish-package.yml (2)

6-8: Job name change and formatting improvements.

Renaming the job from build to publish better reflects its actual purpose - publishing a package to npm. The added blank line after the workflow trigger block improves readability by providing clear visual separation between workflow sections.


13-13: Improved YAML formatting.

The added blank line after the permissions block creates better visual separation, making the workflow file more readable and maintainable.

.github/workflows/database-tests-compose.yml (2)

7-7: Improved type definition for node-version.

Changing the input type from string to number is more accurate for Node.js version numbers and enables better version comparisons in the workflow. This aligns with the PR's focus on updating Node.js version handling.


55-55: Improved npm installation practice.

Changing from npm i to npm ci is a best practice for CI environments. npm ci:

  • Installs dependencies exactly as specified in package-lock.json
  • Deletes node_modules before installing to prevent leftover dependencies
  • Provides more deterministic builds

This change improves build reliability and consistency.

test/functional/query-runner/stream.ts (2)

49-51: Improved TypeScript type safety.

Adding the explicit Promise<void> type annotation improves type safety and code clarity. This properly indicates that the Promise doesn't resolve with any value when awaiting the "readable" event.


57-57: Improved TypeScript type safety.

Adding the explicit Promise<void> type annotation for the Promise handling "end" and "error" events improves type safety and follows modern TypeScript best practices.

src/driver/expo/ExpoDriver.ts (1)

8-8: Improved TypeScript class property declaration.

Using the declare modifier for the options property is a TypeScript best practice that:

  1. Clearly indicates the property exists but is initialized elsewhere (in the parent class)
  2. Improves type safety and code clarity
  3. Standardizes property declarations across driver implementations

This change aligns with modern TypeScript coding patterns.

src/driver/capacitor/CapacitorDriver.ts (1)

11-11: LGTM: Improved TypeScript declaration using the declare keyword

The change from a direct property declaration to using declare is appropriate. This indicates that the options property is expected to be provided externally (likely by the superclass) rather than being initialized within this class, which matches the actual usage in the code.

src/repository/MongoRepository.ts (1)

63-63: LGTM: Enhanced type declaration using declare readonly

This change correctly uses the declare keyword while preserving the readonly modifier for the manager property. This is consistent with similar changes across the codebase and better reflects that this property is initialized elsewhere while still enforcing immutability.

src/driver/cordova/CordovaDriver.ts (1)

17-17: LGTM: Improved TypeScript declaration

The change from a direct property declaration to using declare for the options property correctly indicates that it's provided externally rather than initialized within this class. This aligns with how the property is actually used in the constructor.

src/driver/aurora-postgres/AuroraPostgresDriver.ts (1)

13-13: LGTM: Enhanced type declaration in abstract class

Using the declare keyword for the options property in the abstract PostgresWrapper class is appropriate. It correctly indicates that subclasses are expected to provide an implementation for this property, which aligns with how AuroraPostgresDriver initializes it in its constructor.

src/driver/sqljs/SqljsDriver.ts (1)

24-24: Standard TypeScript pattern update: Added declare modifier to property

The change adds the declare modifier to the options property, indicating that it's expected to be provided by the parent class (AbstractSqliteDriver) or through dependency injection rather than initialized in this class. This is part of a broader effort to standardize property declarations across driver classes.

src/driver/expo/legacy/ExpoLegacyDriver.ts (1)

9-9: Standard TypeScript pattern update: Added declare modifier to property

The change adds the declare modifier to the options property, consistent with the pattern applied to other driver classes in this PR. This indicates that the property exists but is initialized in the parent class or through constructor injection.

src/driver/aurora-postgres/AuroraPostgresQueryRunner.ts (2)

13-13: Standard TypeScript pattern update: Added declare modifier to property

The change adds the declare modifier to the driver property in the PostgresQueryRunnerWrapper class, indicating that it's expected to be provided by the parent class or through constructor injection rather than initialized directly.


34-34: Standard TypeScript pattern update: Added declare modifier to property

The change adds the declare modifier to the driver property in the AuroraPostgresQueryRunner class, following the same pattern applied to other driver-related classes in this PR. This is part of the TypeScript code modernization effort.

ormconfig.sample.json (1)

59-59: Enable MSSQL connection in sample config
Changing "skip" from true to false activates the MSSQL configuration in ormconfig.sample.json, aligning it with the updated GitHub Actions workflows that now include an MSSQL job for Node.js ≤23.

tsconfig.json (2)

2-2: Update TypeScript preset to Node 20
Extending from @tsconfig/node20/tsconfig.json ensures the compiler settings match the new Node 20+ support dropped in this PR.


21-21: Add useDefineForClassFields compiler option
The new "useDefineForClassFields": false aligns class field semantics with the existing code, preventing potential behavioral changes when targeting ES2023.

README-zh_CN.md (1)

23-23: Update Chinese docs to ES2023 support
The change from ES2021 to ES2023 in the Chinese README aligns with the overall ES2023 upgrade across the repository.

gulpfile.ts (1)

67-67: Align browser compile lib with ES2023
Updating the TypeScript lib from an older ES version to ["es2023", "dom"] ensures the browser build task leverages the latest language features after dropping support for Node 16/18.

.github/workflows/default.yml (4)

5-5: Rename workflow for clarity
Renaming the workflow from “test” to “default” aligns with its broader purpose of enforcing formatting, building, and testing across multiple jobs. Ensure any documentation or badges (e.g., in the README) referencing the old workflow name are updated accordingly.


20-20: Use numeric Node.js version inputs
Changing node-version from a string (e.g. "20.x") to an integer (20) leverages the newer actions/setup-node@v4 schema and simplifies maintenance. All other workflows should be audited for consistency with this format.

Also applies to: 34-34


23-23: Switch npm i to npm ci for reproducible installs
Using npm ci ensures a clean, lockfile-respecting install and can improve CI reliability and speed. This update is applied consistently across both the formatting and build jobs.

Also applies to: 37-37


54-54: Update Node.js version matrix to current LTS and latest
The test matrix now targets Node.js 20, 22, and 24 for containerized database tests, and 20/22 for compose-based tests, dropping 16 and 18. Confirm that any downstream workflows or documentation also reflect this version set.

Also applies to: 66-66

src/commands/InitCommand.ts (2)

712-712: Bump better-sqlite3 driver version
Upgrading to ^11.10.0 ensures generated templates use the latest major release of the SQLite driver. This matches the pinned devDependency and peerDependency ranges in package.json.


718-718: Bump mssql driver version
Updating the default mssql dependency to ^11.0.1 keeps the scaffold in sync with the MS SQL Server driver’s current version.

package.json (5)

4-4: Update description to reference ES2023+ support
Including “ES2023+” in the description highlights the library’s modern JavaScript compatibility. Ensure any marketing or READMEs are updated consistently.


112-112: Bump Node.js config packages to v20
Upgrading @tsconfig/node20 and @types/node to Node 20–compatible versions ensures typing and tsconfig presets align with the new engine constraints.

Also applies to: 119-119


125-125: Upgrade better-sqlite3 in devDependencies
Aligning the dev dependency version with the scaffold templates ensures consistency between development and generated projects.


162-162: Upgrade typescript patch version
Bumping to ^5.8.3 pulls in the latest fixes. Verify that downstream CI and linting configurations remain compatible.


239-239: Tighten Node.js engine requirement
The engines.node field now enforces ^20.9.0 || >=22.11.0, matching the CI matrix. This is correct, as it covers Node 20+ and all future versions ≥22.11.0 (including v24).

.github/workflows/database-tests.yml (6)

7-7: Change input type for node-version to number
Defining the workflow input as type: number standardizes version handling across the CI pipelines and is compatible with actions/setup-node@v4.


31-31: Switch all installs to npm ci
Replacing npm i with npm ci across all database test jobs ensures clean, deterministic installs. Great consistency improvement.

Also applies to: 60-60, 91-91, 133-133, 155-155, 177-177, 199-199, 240-240


69-69: Limit MSSQL tests to supported Node versions
The if: ${{ inputs.node-version <= 23 }} condition correctly skips the MSSQL job on Node >23 where the driver isn’t yet supported. No changes needed.


97-97: Standardize Coveralls flag for MSSQL
Changing to mssql-node:${{ inputs.node-version }} simplifies the flag naming. Ensure downstream Coveralls reporting aggregates as expected.


213-213: Update PostGIS matrix version for v14 tests
Switching from "14-3.5" to "14-3.3" ensures compatibility with the database image used. Confirm the image tag and its PostGIS version match exactly.


246-246: Adjust Coveralls flag for Postgres tests
The new flag-name postgres:${{ matrix.postgis-version }}-node:${{ inputs.node-version }} captures both PostGIS and Node.js versions. This will improve coverage traceability.

@alumni alumni changed the base branch from next to master July 9, 2025 12:06
@alumni alumni changed the base branch from master to next July 9, 2025 12:06
@alumni alumni changed the title build: drop support for node 16 and 18 feat!: drop support for node 16 and 18 Sep 29, 2025
Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👏 @alumni
Do we want to test with Node 24 as well?

@OSA413
Copy link
Collaborator

OSA413 commented Sep 30, 2025

Do we want to test with Node 24 as well?

Afair there's a dependency package issue that builds to the native code (some of the SQLite drivers), so bumping to Node 24 would also mean bumping that dependency to a newer version.

Copy link
Collaborator

@OSA413 OSA413 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I hope nothing will break

Copy link
Collaborator

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @OSA413 for the clarification

@alumni
Copy link
Collaborator Author

alumni commented Sep 30, 2025

Do we want to test with Node 24 as well?

Afair there's a dependency package issue that builds to the native code (some of the SQLite drivers), so bumping to Node 24 would also mean bumping that dependency to a newer version.

Afair there was an issue with mssql failing the tests on node 24. I did not investigate last time why - there's no new version of the mssql client, maybe it's something in tedious (its dependency). I'll check if it got fixed and update it.

Another potential issue we could have with node 24 is that it's using a newer version of npm (v11 instead of v10), so a different lockfile format. I'll check if it's a problem, but if it is, it needs to be done separately (that's why I was suggesting corepack + pnpm).

@alumni alumni merged commit 7fb6ba7 into typeorm:next Sep 30, 2025
60 checks passed
@github-project-automation github-project-automation bot moved this from Proposed to Done in TypeORM Roadmap Sep 30, 2025
fail-fast: false
matrix:
node-version: [18, 20]
node-version: [20, 24]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working 🙌✅

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, hope it's okay to keep the old LTS (20) and the development version (24) of node.

Normally most companies seem to stick to LTS (22), so neither of them, but last time we had 3 different versions there were too many queued workflows 🤷🏻‍♂️

@alumni alumni mentioned this pull request Dec 3, 2025
26 tasks
alumni added a commit to alumni/typeorm that referenced this pull request Dec 11, 2025
BREAKING CHANGE: TypeORM is now compiled for ECMAScript 2023, meaning old versions of Node.js are no longer supported. The minimum supported version of Node.js is 20.
mgohin pushed a commit to mgohin/typeorm that referenced this pull request Jan 15, 2026
BREAKING CHANGE: TypeORM is now compiled for ECMAScript 2023, meaning old versions of Node.js are no longer supported. The minimum supported version of Node.js is 20.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants