Skip to content

Commit c69d4e7

Browse files
committed
chore: Extend Node.js support to versions 20, 22 and 24
1 parent 0301927 commit c69d4e7

8 files changed

Lines changed: 22 additions & 20 deletions

File tree

.gitlab-ci.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ include:
1111

1212
# Global --------------------------
1313

14-
# Use Active LTS (18)
15-
image: node:18-alpine
14+
# Use Active LTS (22)
15+
image: node:22-alpine
1616

1717
workflow:
1818
rules:
@@ -145,7 +145,7 @@ build:
145145
KUBERNETES_MEMORY_LIMIT: 8Gi
146146
parallel:
147147
matrix:
148-
- DOCKER_IMAGE: 'node:18-alpine'
148+
- DOCKER_IMAGE: 'node:22-alpine'
149149
- DOCKER_IMAGE: 'node:12-alpine'
150150
USE_MOCK_SERVER: 'use mock server'
151151
- DOCKER_IMAGE: 'node:14-alpine'
@@ -156,6 +156,12 @@ build:
156156
USE_MOCK_SERVER: 'use mock server'
157157
- DOCKER_IMAGE: 'node:18-alpine'
158158
USE_MOCK_SERVER: 'use mock server'
159+
- DOCKER_IMAGE: 'node:20-alpine'
160+
USE_MOCK_SERVER: 'use mock server'
161+
- DOCKER_IMAGE: 'node:22-alpine'
162+
USE_MOCK_SERVER: 'use mock server'
163+
- DOCKER_IMAGE: 'node:24-alpine'
164+
USE_MOCK_SERVER: 'use mock server'
159165
image: ${DOCKER_IMAGE}
160166
script:
161167
- >
@@ -197,6 +203,9 @@ test_manual:
197203
- DOCKER_IMAGE: 'node:16-alpine'
198204
- DOCKER_IMAGE: 'node:17-alpine'
199205
- DOCKER_IMAGE: 'node:18-alpine'
206+
- DOCKER_IMAGE: 'node:20-alpine'
207+
- DOCKER_IMAGE: 'node:22-alpine'
208+
- DOCKER_IMAGE: 'node:24-alpine'
200209
image: ${DOCKER_IMAGE}
201210
before_script: # Note: replaces global before_script
202211
- npm install --production

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8-
8+
### Added
9+
* Official support for Node.js versions 20, 22 and 24
910

1011
## [1.19.1] - 2025-09-16
1112
### Changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,9 @@ you can translate up to 500,000 characters/month for free.
2929

3030
### Requirements
3131

32-
The package officially supports Node.js version 12, 14, 16, 17, and 18.
32+
The package officially supports Node.js version 12, 14, 16, 17, 18, 20, 22 and 24.
3333

34-
Starting in 2024, we will drop support for older Node versions that have reached
35-
official end-of-life. You can find the Node versions and support timelines
36-
[here][node-version-list].
37-
To continue using this library, you should update to Node 18+.
34+
We strongly recommend upgrading to a supported Node.js version as we will be dropping support for end-of-life versions in 2025. You can find the Node versions and support timelines [here][node-version-list].
3835

3936
## Usage
4037

examples/bulk-translation/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "Example for deepl-node using TypeScript",
44
"type": "module",
55
"dependencies": {
6-
"@types/node": "^18.11.9",
76
"deepl-node": "file:../..",
87
"p-limit": "^6.2.0"
98
},

examples/typescript/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "Example for deepl-node using TypeScript",
44
"type": "module",
55
"dependencies": {
6-
"@types/node": "^18.11.9",
76
"deepl-node": "file:../.."
87
},
98
"main": "index.ts",

examples/website-translation/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"description": "Example for translating a website into multiple target languages",
44
"type": "module",
55
"dependencies": {
6-
"@types/node": "^18.11.9",
76
"deepl-node": "file:../..",
87
"dotenv": "^16.4.5"
98
},

tests/documentMinification/testHelpers.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as path from 'path';
22
import * as fs from 'fs';
33
import AdmZip from 'adm-zip';
4+
import { randomFillSync } from 'crypto';
45

56
const MINIFIABLE_FILE_SIZE = 90000000;
67

@@ -15,14 +16,10 @@ export const createMinifiableTestDocument = (
1516
const zipExtractor = new AdmZip(testFilePath);
1617
zipExtractor.extractAllTo(tempZipContentDirectory);
1718

18-
// Create a placeholder file of size 90 MB
19-
const characters =
20-
'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()_+=-<,>.?:';
21-
const createText = Array.from(
22-
{ length: MINIFIABLE_FILE_SIZE },
23-
() => characters[Math.floor(Math.random() * characters.length)],
24-
).join('');
25-
fs.writeFileSync(path.join(tempZipContentDirectory, 'placeholder_image.png'), createText);
19+
// Create a placeholder file of size 90 MB filled with random data to avoid compression
20+
const buffer = new Uint8Array(MINIFIABLE_FILE_SIZE);
21+
randomFillSync(buffer);
22+
fs.writeFileSync(path.join(tempZipContentDirectory, 'placeholder_image.png'), buffer);
2623

2724
const fileName = path.basename(testFilePath);
2825
const outputFilePath = path.join(outputDirectory, fileName);

0 commit comments

Comments
 (0)