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

Add support to latest NodeJS LTS version #328

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions .github/workflows/ci-repo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ jobs:
run: npm clean-install --ignore-scripts
# - name: Lint sources
# run: npm run lint
- name: Generate
run: npm run generate
- name: Build
run: npm run build
- name: Build storybook
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/storybook-pr-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- name: Install dependencies
run: npm clean-install --ignore-scripts
- name: Generate
run: npm run generate
- name: Build
run: npm run build
- name: Build storybook
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/storybook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
cache: npm
- name: Install dependencies
run: npm clean-install --ignore-scripts
- name: Generate
run: npm run generate
- name: Build
run: npm run build
- name: Build storybook
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tag-dist.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
node-version: 22
- name: Install
working-directory: build
run: npm clean-install --ignore-scripts
- name: Generate
run: npm run generate
- name: Build
working-directory: build
run: npm run build
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ node_modules/
# testing
coverage/

# generated files
client/src/app/client/

# production
dist/
/qa/build
Expand Down
10 changes: 5 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Builder image
FROM registry.access.redhat.com/ubi9/nodejs-20:latest AS builder
FROM registry.access.redhat.com/ubi9/nodejs-22:latest AS builder

USER 1001
COPY --chown=1001 . .
RUN npm install -g npm@9
RUN npm clean-install --ignore-scripts && npm run build && npm run dist
RUN npm install -g
RUN npm clean-install --ignore-scripts && npm run generate && npm run build && npm run dist

# Runner image
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:latest
FROM registry.access.redhat.com/ubi9/nodejs-22-minimal:latest

# Add ps package to allow liveness probe for k8s cluster
# Add tar package to allow copying files with kubectl scp
Expand All @@ -27,7 +27,7 @@ LABEL name="trustify/trustify-ui" \
io.k8s.display-name="trustify-ui" \
io.k8s.description="Trustify - User Interface" \
io.openshift.expose-services="80:http" \
io.openshift.tags="operator,trustification,trustify,ui,nodejs20" \
io.openshift.tags="operator,trustification,trustify,ui,nodejs22" \
io.openshift.min-cpu="100m" \
io.openshift.min-memory="350Mi"

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.server
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
######################################################################
# UI
######################################################################
FROM registry.access.redhat.com/ubi9/nodejs-20:latest AS ui-source
FROM registry.access.redhat.com/ubi9/nodejs-22:latest AS ui-source
USER 1001
COPY --chown=1001 . .
RUN npm install -g npm@9
RUN npm clean-install --ignore-scripts && npm run build && npm run dist
RUN npm clean-install --ignore-scripts && npm run generate && npm run build && npm run dist

######################################################################
# Prepare server
Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ Trustify UI Component

# Build and Test Status

| branch | last merge CI | last merge image build | nightly CI |
| :----- | :------------ | :--------------------- | :--------- |
| main | [![CI (repo level)](https://github.com/trustification/trustify-ui/actions/workflows/ci-repo.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-repo.yaml?query=branch%3Amain+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/trustification/trustify-ui/actions/workflows/image-build.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/image-build.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (repo level @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-repo.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-repo.yaml?query=branch%3Amain+event%3Aschedule) |
| branch | last merge CI | last merge image build | nightly CI |
| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main | [![CI (repo level)](https://github.com/trustification/trustify-ui/actions/workflows/ci-repo.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-repo.yaml?query=branch%3Amain+event%3Apush) | [![Multiple Architecture Image Build](https://github.com/trustification/trustify-ui/actions/workflows/image-build.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/image-build.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (repo level @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-repo.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-repo.yaml?query=branch%3Amain+event%3Aschedule) |

| branch | last merge e2e CI | nightly e2e CI |
| :----- | :---------------- | :------------- |
| main | [![CI (global Trustify CI)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (global trustify CI @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml?query=branch%3Amain+event%3Aschedule) |
| branch | last merge e2e CI | nightly e2e CI |
| :----- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| main | [![CI (global Trustify CI)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml/badge.svg?branch=main&event=push)](https://github.com/trustification/trustify-ui/actions/workflows/ci-global.yaml?query=branch%3Amain+event%3Apush) | [![Nightly CI (global trustify CI @main)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml/badge.svg?branch=main&event=schedule)](https://github.com/trustification/trustify-ui/actions/workflows/nightly-ci-global.yaml?query=branch%3Amain+event%3Aschedule) |

## Development

### Requisites

- NodeJS 20. Use [nvm](https://github.com/nvm-sh/nvm?tab=readme-ov-file#install--update-script) to install NodeJS
[NodeJS](https://nodejs.org) >= 20. Use [nvm](https://nodejs.org/en/download) to install NodeJS

```shell
nvm install 20
nvm use 20
nvm install 22
nvm use 22
```

- Backend. Clone [trustify](https://github.com/trustification/trustify) and there execute:
Expand Down
2 changes: 1 addition & 1 deletion client/config/openapi-ts.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from "@hey-api/openapi-ts";

export default defineConfig({
client: "@hey-api/client-axios",
plugins: ["@hey-api/client-axios"],
input: "./openapi/trustd.yaml",
output: {
path: "src/app/client",
Expand Down
4 changes: 2 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"*.{css,json,md,yaml,yml}": "prettier --write"
},
"dependencies": {
"@hey-api/client-axios": "^0.2.7",
"@hey-api/client-axios": "^0.5.3",
"@hookform/resolvers": "^2.9.11",
"@patternfly/patternfly": "^5.4.0",
"@patternfly/react-charts": "^7.4.0",
Expand Down Expand Up @@ -55,7 +55,7 @@
"yup": "^0.32.11"
},
"devDependencies": {
"@hey-api/openapi-ts": "^0.53.5",
"@hey-api/openapi-ts": "^0.63.2",
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.10",
"@svgr/webpack": "^8.1.0",
"@testing-library/jest-dom": "^6.4.6",
Expand Down
4 changes: 0 additions & 4 deletions client/src/app/client/index.ts

This file was deleted.

Loading
Loading