Skip to content

Lib Upgrade April 25 #15

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

Merged
merged 13 commits into from
Mar 30, 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
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
npx lint-staged
npx lint-staged
2 changes: 2 additions & 0 deletions apps/express-server/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import jsConfig from '@nish1896/eslint-flat-config/js';
import tsConfig from '@nish1896/eslint-flat-config/ts';

export default [
...jsConfig,
...tsConfig,
];
8 changes: 4 additions & 4 deletions apps/express-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
"winston": "3.17.0"
},
"devDependencies": {
"@nish1896/eslint-flat-config": "^1.1.4",
"@nish1896/eslint-flat-config": "^2.0.2",
"@types/cors": "^2.8.17",
"@types/node": "^22.13.10",
"eslint": "^9.22.0",
"@types/node": "^22.13.14",
"eslint": "^9.23.0",
"nodemon": "^3.1.9",
"rimraf": "^6.0.1",
"tsc-alias": "^1.8.11",
"tsc-alias": "^1.8.13",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.8.2"
}
Expand Down
6 changes: 5 additions & 1 deletion apps/express-server/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import express, { Express, Request, Response } from 'express';
import express, {
type Express,
type Request,
type Response
} from 'express';
import cors from 'cors';
import { ENV_VARS } from '@/app-constants';
import { requestLogger } from '@/middleware';
Expand Down
2 changes: 1 addition & 1 deletion apps/express-server/src/middleware/guard.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import { winstonLogger } from './winston-logger';

export function validateAuthHeader(
Expand Down
6 changes: 4 additions & 2 deletions apps/express-server/src/middleware/request-logger.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Request, Response, NextFunction } from 'express';
import type { Request, Response, NextFunction } from 'express';
import { winstonLogger } from './winston-logger';

export function requestLogger(
Expand All @@ -22,7 +22,9 @@ export function printSuccessMsg(msg: string): void {
}

export function printError(error: unknown): void {
winstonLogger.error(`⚠ ERROR - ${error}`);
winstonLogger.error(
`⚠ ERROR - ${error instanceof Error ? error.message : JSON.stringify(error)}`
);
}

export function errorLogger(res: Response, error: unknown) {
Expand Down
6 changes: 4 additions & 2 deletions apps/express-server/src/middleware/winston-logger.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/restrict-template-expressions */

import { createLogger, addColors, format, transports } from 'winston';
import { ENV_VARS } from '@/app-constants';

Expand All @@ -23,7 +25,7 @@ const customLevels = {
}
};

const myFormat = printf(
const logFormat = printf(
({ level, message, timestamp }) => `[ ${level} ]:: ${timestamp} - ${message}`
);

Expand All @@ -47,7 +49,7 @@ const winstonLogger = createLogger({

/* Aligns in a tabular format */
// format.align(),
myFormat
logFormat
),
// defaultMeta: { service: 'log-service' },
transports: [
Expand Down
4 changes: 2 additions & 2 deletions apps/express-server/src/routes/auth/controller.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Router, Request, Response } from 'express';
import { Router, type Request, type Response } from 'express';
import authService from './service';
import * as AuthTypes from './types';
import type * as AuthTypes from './types';

const authRouter = Router();

Expand Down
2 changes: 1 addition & 1 deletion apps/express-server/src/routes/auth/service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Response } from 'express';
import type { Response } from 'express';

class AuthService {
loginUser(res: Response, email: string, password: string) {
Expand Down
6 changes: 4 additions & 2 deletions apps/nestjs-server/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// @ts-check
import eslint from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import jsConfig from '@nish1896/eslint-flat-config/js';
import tsConfig from '@nish1896/eslint-flat-config/ts';

export default tseslint.config(
{
Expand All @@ -12,6 +12,7 @@ export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommendedTypeChecked,
...jsConfig,
...tsConfig,
eslintPluginPrettierRecommended,
{
languageOptions: {
Expand All @@ -31,7 +32,8 @@ export default tseslint.config(
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'warn',
'@typescript-eslint/no-unsafe-argument': 'warn'
'@typescript-eslint/no-unsafe-argument': 'warn',
'@stylistic/plus/curly-newline': ['warn', { consistent: true }],
},
},
);
36 changes: 18 additions & 18 deletions apps/nestjs-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,41 +18,41 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/common": "^11.0.11",
"@nestjs/core": "^11.0.11",
"@nestjs/platform-express": "^11.0.11",
"@nestjs/platform-fastify": "^11.0.11",
"@nestjs/common": "^11.0.12",
"@nestjs/core": "^11.0.12",
"@nestjs/platform-express": "^11.0.12",
"@nestjs/platform-fastify": "^11.0.12",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.2"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.0",
"@eslint/js": "^9.22.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.23.0",
"@nestjs/cli": "^11.0.5",
"@nestjs/schematics": "^11.0.2",
"@nestjs/testing": "^11.0.11",
"@nish1896/eslint-flat-config": "^1.1.4",
"@nestjs/testing": "^11.0.12",
"@nish1896/eslint-flat-config": "^2.0.2",
"@swc/cli": "^0.6.0",
"@swc/core": "^1.10.8",
"@types/express": "^5.0.0",
"@swc/core": "^1.11.13",
"@types/express": "^5.0.1",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.10",
"@types/supertest": "^6.0.2",
"eslint": "^9.22.0",
"@types/node": "^22.13.14",
"@types/supertest": "^6.0.3",
"eslint": "^9.23.0",
"eslint-config-prettier": "^10.1.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-prettier": "^5.2.5",
"globals": "^16.0.0",
"jest": "^29.7.0",
"prettier": "^3.4.2",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"source-map-support": "^0.5.21",
"supertest": "^7.0.0",
"ts-jest": "^29.2.6",
"supertest": "^7.1.0",
"ts-jest": "^29.3.0",
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.8.2",
"typescript-eslint": "^8.26.1"
"typescript-eslint": "^8.28.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
2 changes: 1 addition & 1 deletion apps/nestjs-server/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NestFactory } from '@nestjs/core';
import {
FastifyAdapter,
NestFastifyApplication,
type NestFastifyApplication,
} from '@nestjs/platform-fastify';
import { AppModule } from './app.module';

Expand Down
2 changes: 1 addition & 1 deletion apps/nestjs-server/src/routes/home/controller.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Test, TestingModule } from '@nestjs/testing';
import { Test, type TestingModule } from '@nestjs/testing';
import { HomeController } from './controller';
import { HomeService } from './service';

Expand Down
4 changes: 2 additions & 2 deletions apps/nestjs-server/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { INestApplication } from '@nestjs/common';
import type { INestApplication } from '@nestjs/common';
import { Test } from '@nestjs/testing';
import * as request from 'supertest';
import { App } from 'supertest/types';
import type { App } from 'supertest/types';
import { AppModule } from './../src/app.module';

describe('AppController (e2e)', () => {
Expand Down
13 changes: 4 additions & 9 deletions apps/next-client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { dirname } from 'path';
import { fileURLToPath } from 'url';
import { FlatCompat } from '@eslint/eslintrc';
import jsConfig from '@nish1896/eslint-flat-config/js';
import nextTsConfig from '@nish1896/eslint-flat-config/next-ts';
import nextConfig from '@nish1896/eslint-flat-config/next';

const __filename = fileURLToPath(import.meta.url);
Expand All @@ -11,17 +13,10 @@ const compat = new FlatCompat({
});

const eslintConfig = [
...jsConfig,
...nextConfig,
...nextTsConfig,
...compat.extends('next/core-web-vitals', 'next/typescript'),
{
/**
* Somehow loading this rule is causing issues, when using
* NextApp in monorepo, thus disabling this for now.
*/
rules: {
'@typescript-eslint/no-empty-function': 'off'
}
}
];

export default eslintConfig;
24 changes: 12 additions & 12 deletions apps/next-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
"@emotion/cache": "^11.14.0",
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^6.4.7",
"@mui/material": "^6.4.7",
"@mui/material-nextjs": "^6.4.3",
"next": "15.2.2",
"react": "^19.0.0",
"react-dom": "^19.0.0"
"@mui/icons-material": "^7.0.1",
"@mui/material": "^7.0.1",
"@mui/material-nextjs": "^7.0.0",
"next": "15.2.4",
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3.3.0",
"@nish1896/eslint-flat-config": "^1.1.4",
"@types/node": "^22.13.10",
"@types/react": "^19.0.10",
"@eslint/eslintrc": "^3.3.1",
"@nish1896/eslint-flat-config": "^2.0.2",
"@types/node": "^22.13.14",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"eslint": "^9.22.0",
"eslint-config-next": "15.2.2",
"eslint": "^9.23.0",
"eslint-config-next": "15.2.4",
"typescript": "^5.8.2"
}
}
2 changes: 1 addition & 1 deletion apps/next-client/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Roboto } from 'next/font/google';
import { AppRouterCacheProvider } from '@mui/material-nextjs/v14-appRouter';
import { AppBar } from '@/components';
import { AppThemeProvider } from '@/theme';
import { LayoutProps } from '@/types';
import type { LayoutProps } from '@/types';
import './globals.css';

const roboto = Roboto({
Expand Down
6 changes: 3 additions & 3 deletions apps/next-client/src/theme/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
'use client';

import { createContext, useContext, useEffect, useMemo, useState } from 'react';
import { PaletteMode, ThemeProvider, createTheme } from '@mui/material/styles';
import { ThemeProvider, createTheme, type PaletteMode } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import CssBaseline from '@mui/material/CssBaseline';
import { LayoutProps } from '@/types';
import type { LayoutProps } from '@/types';
import { getTheme } from './theme';

interface ThemeContextProps {
Expand All @@ -14,7 +14,7 @@ interface ThemeContextProps {

const ThemeContext = createContext<ThemeContextProps>({
currentTheme: 'light',
toggleTheme: () => {}
toggleTheme: () => { /* noop */ },
});

export const useThemeContext = () => useContext(ThemeContext);
Expand Down
2 changes: 1 addition & 1 deletion apps/next-client/src/theme/theme.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use client';

import { Roboto } from 'next/font/google';
import { PaletteMode } from '@mui/material/styles';
import type { PaletteMode } from '@mui/material/styles';
import { LightThemePalette, DarkThemePalette } from './palette';

const roboto = Roboto({
Expand Down
2 changes: 1 addition & 1 deletion apps/next-client/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export * from './common';
export type * from './common';
11 changes: 9 additions & 2 deletions apps/next-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@
"@/*": ["./src/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules"
]
}
2 changes: 2 additions & 0 deletions apps/react-client/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import jsConfig from '@nish1896/eslint-flat-config/js';
import tsConfig from '@nish1896/eslint-flat-config/ts';
import jsxConfig from '@nish1896/eslint-flat-config/jsx';

/** @type {import('eslint').Linter.Config[]} */
export default [
...jsConfig,
...tsConfig,
...jsxConfig,
{
rules: {},
Expand Down
22 changes: 11 additions & 11 deletions apps/react-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,31 @@
"dependencies": {
"@emotion/react": "^11.14.0",
"@emotion/styled": "^11.14.0",
"@mui/icons-material": "^6.4.7",
"@mui/material": "^6.4.7",
"@mui/icons-material": "^7.0.1",
"@mui/material": "^7.0.1",
"@reduxjs/toolkit": "^2.6.1",
"axios": "^1.8.3",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"axios": "^1.8.4",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-redux": "^9.2.0",
"react-router": "^7.3.0",
"react-router": "^7.4.1",
"react-scripts": "5.0.1",
"redux-persist": "^6.0.0",
"web-vitals": "^4.2.4"
},
"devDependencies": {
"@eslint/js": "^9.22.0",
"@nish1896/eslint-flat-config": "^1.1.4",
"@eslint/js": "^9.23.0",
"@nish1896/eslint-flat-config": "^2.0.2",
"@testing-library/dom": "^10.4.0",
"@testing-library/jest-dom": "^6.6.3",
"@testing-library/react": "^16.2.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^29.5.14",
"@types/node": "^22.13.10",
"@types/react": "^19.0.10",
"@types/node": "^22.13.14",
"@types/react": "^19.0.12",
"@types/react-dom": "^19.0.4",
"@types/react-redux": "^7.1.34",
"eslint": "^9.22.0",
"eslint": "^9.23.0",
"globals": "^16.0.0",
"typescript": "^5.8.2"
},
Expand Down
2 changes: 1 addition & 1 deletion apps/react-client/src/assets/styles/theme.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { PaletteMode } from '@mui/material';
import type { PaletteMode } from '@mui/material';
import { LightThemePalette, DarkThemePalette } from './palette';

const AppTheme = (mode: PaletteMode) => ({
Expand Down
Loading