Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: update node version #4329

Merged
merged 4 commits into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .docker/prod.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ARG DEBIAN_FRONTEND=noninteractive

FROM debian:stable-slim AS builder

ENV NODE_VERSION=node_18.x
ENV NODE_VERSION=node_20.x
ENV NODE_KEYRING=/usr/share/keyrings/nodesource.gpg
ENV DISTRIBUTION=bookworm

Expand All @@ -18,7 +18,7 @@ RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dear

RUN apt-get update && \
apt-get install -y --no-install-recommends \
nodejs npm && \
nodejs && \
rm -rf /var/lib/apt/lists/*

COPY . /source
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ jobs:
strategy:
matrix:
node-version:
- 18
- 20
- 22
steps:
- uses: actions/checkout@v4
- name: Set up node ${{ matrix.node-version }}
Expand All @@ -43,7 +43,7 @@ jobs:
strategy:
matrix:
node-version:
- 18
- 22
steps:
- uses: actions/checkout@v4
- name: Set up node ${{ matrix.node-version }}
Expand Down Expand Up @@ -74,8 +74,8 @@ jobs:
strategy:
matrix:
node-version:
- 18
- 20
- 22
steps:
- uses: actions/checkout@v4
- name: Set up node ${{ matrix.node-version }}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release-pontos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ jobs:
release-type: ${{ steps.release-type.outputs.release-type }}
release-version: ${{ inputs.release-version }}
ref: ${{ steps.release-type.outputs.release-ref }}
versioning-scheme: "semver"
sign-release-files: "false"
versioning-scheme: 'semver'
sign-release-files: 'false'

build-dist:
name: Build JavaScript files
runs-on: "ubuntu-latest"
runs-on: 'ubuntu-latest'
needs: release
steps:
- uses: actions/checkout@v4
Expand All @@ -66,8 +66,8 @@ jobs:
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: "18"
cache: "npm"
node-version: '22'
cache: 'npm'
- name: Install npm dependencies
run: npm install
- name: Build dist files
Expand All @@ -83,7 +83,7 @@ jobs:
GH_TOKEN: ${{ secrets.GREENBONE_BOT_TOKEN }}

sign:
runs-on: "ubuntu-latest"
runs-on: 'ubuntu-latest'
needs: [release, build-dist]
steps:
- name: Sign release files
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ and the fingerprint is `8AE4 BE42 9B60 A59B 311C 2E73 9823 FAA6 0ED1 E580`.

Prerequisites for GSA:

- node.js >= 18.0
- node.js >= 20.0

To install nodejs the following commands can be used

```bash
export VERSION=18
export VERSION=20
export KEYRING=/usr/share/keyrings/nodesource.gpg

curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | gpg --dearmor | sudo tee "$KEYRING" >/dev/null
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"clean-up-translations": "node scripts/cleanuptranslations"
},
"engines": {
"node": ">=18.0"
"node": ">=20.0"
},
"dependencies": {
"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration": "^1.4.0",
Expand Down
10 changes: 5 additions & 5 deletions src/gmp/locale/__tests__/detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,24 @@ describe('LanguageDetector tests', () => {

test('should return language from navigator', () => {
const storage = {};
global.navigator = {language: 'en-US'};

const languageUtils = {
formatLanguageCode: testing.fn().mockImplementation(l => l),
isSupportedCode: testing.fn().mockReturnValue(true),
};

const detector = new LanguageDetector();
Object.defineProperty(global, 'navigator', {
value: {language: 'en-US'},
configurable: true,
});

const detector = new LanguageDetector();
detector.init({languageUtils}, {storage}, {fallbackLng: 'bar'});

expect(detector.detect()).toEqual('en-US');
expect(languageUtils.formatLanguageCode).toHaveBeenCalledTimes(1);
expect(languageUtils.formatLanguageCode).toHaveBeenCalledWith('en-US');
expect(languageUtils.isSupportedCode).toHaveBeenCalledTimes(1);
expect(languageUtils.isSupportedCode).toHaveBeenCalledWith('en-US');

global.navigator = undefined;
});

test('should return languages from fake navigator', () => {
Expand Down