Skip to content

Commit

Permalink
Update packages to latest safe (#92)
Browse files Browse the repository at this point in the history
* Updated frontend and backend to latest safe versions

* Added latest possible for most

* Increase node version to 20 for CI
  • Loading branch information
danias authored Feb 24, 2024
1 parent cd1bf87 commit 63c05e2
Show file tree
Hide file tree
Showing 8 changed files with 2,831 additions and 2,243 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:

strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [20.11.1]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand Down
2 changes: 1 addition & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:19-alpine
FROM node:20-alpine
# Set the working directory to /app inside the container
WORKDIR /app
# Copy app files
Expand Down
16 changes: 8 additions & 8 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "todo",
"version": "0.1.2",
"version": "0.1.3",
"description": "Todo Backend using Domain Driven Design (DDD), Hexagonal Architecture, CQRS, Event Sourcing (ES), Event Driven Architecture (EDA), Behaviour Driven Development (BDD) using TypeScript and NestJS. Like what you see? Don't forget to star! ⭐",
"author": "Bitloops S.A.",
"private": false,
Expand All @@ -23,13 +23,13 @@
"docker:backend": "docker compose -p bitloops-todo-app stop && docker compose -p bitloops-todo-app -f server-development.docker-compose.yml up -d"
},
"engines": {
"node": ">=16.0.0"
"node": ">=20.11.1"
},
"dependencies": {
"@bitloops/bl-boilerplate-core": "^0.3.6",
"@bitloops/bl-boilerplate-infra-mongo": "^0.1.2",
"@bitloops/bl-boilerplate-infra-nest-auth-passport": "^0.1.4",
"@bitloops/bl-boilerplate-infra-nest-jetstream": "^0.0.3",
"@bitloops/bl-boilerplate-infra-nest-jetstream": "^0.0.8",
"@bitloops/bl-boilerplate-infra-postgres": "^0.1.1",
"@bitloops/bl-boilerplate-infra-telemetry": "^0.1.3",
"@grpc/grpc-js": "^1.8.13",
Expand All @@ -42,7 +42,7 @@
"class-validator": "^0.14.0",
"google-protobuf": "^3.21.2",
"jsonwebtoken": "^9.0.0",
"mongodb": "^5.2.0",
"mongodb": "^6.3.0",
"nats": "^2.13.1",
"reflect-metadata": "^0.1.13",
"rxjs": "^7.8.0",
Expand All @@ -53,7 +53,7 @@
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/google-protobuf": "^3.15.6",
"@types/jest": "29.5.0",
"@types/jest": "29.5.12",
"@types/jsonwebtoken": "^9.0.1",
"@types/node": "18.15.11",
"@types/supertest": "^2.0.11",
Expand All @@ -64,16 +64,16 @@
"eslint-plugin-prettier": "^4.0.0",
"grpc-tools": "^1.12.4",
"grpc_tools_node_protoc_ts": "^5.3.3",
"jest": "29.5.0",
"jest": "29.7.0",
"passport": "^0.6.0",
"prettier": "^2.3.2",
"protoc-gen-ts": "^0.8.6",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "29.1.0",
"ts-jest": "29.1.2",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.1.1",
"tsconfig-paths": "4.2.0",
"typescript": "4.9.5"
},
"jest": {
Expand Down
2,886 changes: 1,728 additions & 1,158 deletions backend/yarn.lock

Large diffs are not rendered by default.

41 changes: 19 additions & 22 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
{
"name": "todo-frontend",
"version": "0.2.0",
"version": "0.2.1",
"private": true,
"dependencies": {
"@chakra-ui/icons": "^2.1.0",
"@chakra-ui/react": "^2.8.0",
"@chakra-ui/system": "^2.6.0",
"@emotion/react": "^11.11.1",
"@emotion/styled": "^11.11.0",
"@grpc/grpc-js": "^1.8.21",
"@grpc/grpc-js": "^1.8.21",
"eventemitter3": "^5.0.1",
"framer-motion": "^10.15.0",
"framer-motion": "^11.0.6",
"google-protobuf": "^3.21.2",
"grpc-web": "^1.4.2",
"jwt-decode": "^3.1.2",
"jwt-decode": "^4.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-icons": "^4.8.0",
"react-icons": "^5.0.1",
"react-router-dom": "^6.14.2",
"recoil": "^0.7.7",
"source-map-loader": "^4.0.1"
"source-map-loader": "^5.0.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down Expand Up @@ -52,15 +52,15 @@
]
},
"devDependencies": {
"@testing-library/jest-dom": "^5.14.1",
"@testing-library/react": "^13.0.0",
"@testing-library/user-event": "^13.2.1",
"@types/jest": "^27.0.1",
"@types/node": "^16.7.13",
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.1",
"@testing-library/user-event": "^14.5.2",
"@types/google-protobuf": "^3.15.6",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.20",
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",

"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@typescript-eslint/eslint-plugin": ">=6.0.0",
"@typescript-eslint/parser": ">=6.0.0",
"eslint": ">=8.0.0",
Expand All @@ -70,19 +70,16 @@
"eslint-config-xo": "^0.43.1",
"eslint-config-xo-typescript": "^1.0.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-react": "^7.33.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-react-hooks": "^4.6.0",
"prettier": "^3.0.0",

"react-scripts": "5.0.1",
"typescript": ">=4.7",
"web-vitals": "^2.1.0",

"@types/google-protobuf": "^3.15.6",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"protoc-gen-grpc-web": "^1.4.2"
"prettier": "^3.0.0",
"protoc-gen-grpc-web": "^1.4.2",
"react-scripts": "5.0.1",
"typescript": "5.1.6",
"web-vitals": "^3.5.2"
}
}
File renamed without changes.
8 changes: 4 additions & 4 deletions frontend/src/infra/repositories/iam/IamRepository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import JwtDecode from 'jwt-decode';
import { jwtDecode } from 'jwt-decode';
import { IIamRepository } from '../../interfaces/IIamRepository';
import { User } from '../../../models/User';
import { IIamService } from '../../interfaces/IIamService';
Expand All @@ -18,7 +18,7 @@ const clearLocalStorage = (): void => {

const isExpired = (token: string): boolean => {
try {
const decoded = JwtDecode(token) as DecodedToken;
const decoded = jwtDecode(token) as DecodedToken;
const now = Date.now().valueOf() / 1000; // in seconds
return decoded.exp < now;
} catch (err) {
Expand All @@ -38,7 +38,7 @@ class IamRepository implements IIamRepository {
const token = loginResponse.access_token;
console.log('setting access token', loginResponse);
try {
const decoded = JwtDecode(token) as DecodedToken;
const decoded = jwtDecode(token) as DecodedToken;
const user: User = { id: decoded.sub, jwt: token };
this.setUser(user);
return user;
Expand Down Expand Up @@ -67,7 +67,7 @@ class IamRepository implements IIamRepository {
const token = LocalStorageRepository.getAccessToken();
if (token === null) return null;
try {
const decoded = JwtDecode(token) as DecodedToken;
const decoded = jwtDecode(token) as DecodedToken;
if (isExpired(token)) {
clearLocalStorage();
return null;
Expand Down
Loading

0 comments on commit 63c05e2

Please sign in to comment.