Skip to content
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 .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.11
22.15
10 changes: 5 additions & 5 deletions apps/backend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import baseConfig from '../../eslint.config.js';

/** @typedef {import("eslint").Linter.FlatConfig} */
let FlatConfig;
/** @typedef {import("eslint").Linter.Config} */
let Config;

/** @type {FlatConfig} */
/** @type {Config} */
const ignoresConfig = {
ignores: ['build']
};

/** @type {FlatConfig[]} */
/** @type {Config[]} */
const overridesConfigs = [
{
files: ['knexfile.ts'],
Expand Down Expand Up @@ -48,7 +48,7 @@ const overridesConfigs = [
}
];

/** @type {FlatConfig[]} */
/** @type {Config[]} */
const config = [...baseConfig, ignoresConfig, ...overridesConfigs];

export default config;
2 changes: 1 addition & 1 deletion apps/backend/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { join } from 'node:path';
import { fileURLToPath } from 'node:url';
import { pathsToModuleNameMapper } from 'ts-jest';

import tsconfigJson from './tsconfig.json' assert { type: 'json' };
import tsconfigJson from './tsconfig.json' with { type: 'json' };

const sourcePath = join(fileURLToPath(import.meta.url), '../');

Expand Down
2 changes: 1 addition & 1 deletion apps/backend/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { default as baseConfig } from '../../lint-staged.config.js';
import baseConfig from '../../lint-staged.config.js';

/** @type {import('lint-staged').Config} */
const config = {
Expand Down
32 changes: 16 additions & 16 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@thread-js/backend",
"private": true,
"engines": {
"node": "20.11.x",
"npm": "10.2.x"
"node": "22.15.x",
"npm": "10.9.x"
},
"type": "module",
"scripts": {
Expand All @@ -25,29 +25,29 @@
"test:auth": "npm run test -- --verbose --rootDir=tests/modules/auth/"
},
"dependencies": {
"@fastify/static": "7.0.4",
"@fastify/static": "8.1.1",
"@thread-js/shared": "*",
"convict": "6.2.4",
"dotenv": "16.4.5",
"fastify": "4.27.0",
"dotenv": "16.5.0",
"fastify": "5.3.2",
"knex": "3.1.0",
"objection": "3.1.4",
"pg": "8.12.0",
"pino": "9.1.0",
"qs": "6.12.1"
"objection": "3.1.5",
"pg": "8.15.6",
"pino": "9.6.0",
"qs": "6.14.0"
},
"devDependencies": {
"@faker-js/faker": "8.4.1",
"@faker-js/faker": "9.7.0",
"@jest/globals": "29.7.0",
"@types/convict": "6.1.6",
"@types/jest": "29.5.12",
"@types/pg": "8.11.6",
"@types/qs": "6.9.15",
"@types/jest": "29.5.14",
"@types/pg": "8.11.14",
"@types/qs": "6.9.18",
"cross-env": "7.0.3",
"jest": "29.7.0",
"pino-pretty": "11.2.0",
"ts-jest": "29.1.4",
"pino-pretty": "13.0.0",
"ts-jest": "29.3.2",
"ts-paths-esm-loader": "1.4.3",
"tsx": "4.15.1"
"tsx": "4.19.4"
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
type DefaultApiHandlerOptions = {
body?: unknown;
params?: unknown;
query?: unknown;
};

type ControllerAPIHandlerOptions<
T extends DefaultApiHandlerOptions = DefaultApiHandlerOptions
> = {
Expand All @@ -12,4 +6,10 @@ type ControllerAPIHandlerOptions<
query: T['query'];
};

type DefaultApiHandlerOptions = {
body?: unknown;
params?: unknown;
query?: unknown;
};

export { type ControllerAPIHandlerOptions };
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export { type ControllerAPIHandler } from './controller-api-handler.type.js';
export { type ControllerAPIHandlerOptions } from './controller-api-handler-options.type.js';
export { type ControllerAPIHandlerResponse } from './controller-api-handler-response.type.js';
export { type ControllerAPIHandler } from './controller-api-handler.type.js';
export { type ControllerModule } from './controller-module.type.js';
export { type ControllerRouteParameters } from './controller-route-parameters.type.js';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import LibraryKnex from 'knex';
import { Model, knexSnakeCaseMappers } from 'objection';
import { knexSnakeCaseMappers, Model } from 'objection';

import { AppEnvironment } from '~/libs/enums/enums.js';
import { type ValueOf } from '~/libs/types/types.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ type Repository<T> = {
create(_payload: Omit<T, 'createdAt' | 'id' | 'updatedAt'>): Promise<T>;
deleteById(_id: number): Promise<number>;
getAll(): Promise<T[]>;
getById(_id: number): Promise<T | null>;
getById(_id: number): Promise<null | T>;
updateById(_id: number, _payload: Partial<T>): Promise<T>;
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {
type FastifyReply,
type FastifyRequest,
type RouteGenericInterface,
type preHandlerHookHandler
type preHandlerHookHandler,
type RouteGenericInterface
} from 'fastify';

import { type HTTPMethod } from '~/libs/modules/http/http.js';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ServerApp {
return this;
};

public start = async (): Promise<void> | never => {
public start = async (): never | Promise<void> => {
try {
await this.#app.listen({
host: this.#config.ENV.APP.HOST,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { type ParsedQs, parse } from 'qs';
import { parse, type ParsedQs } from 'qs';

import { config } from '~/libs/modules/config/config.js';
import { database } from '~/libs/modules/database/database.js';
import { authController } from '~/modules/auth/auth.js';

import { logger } from '../logger/logger.js';
import { ServerApp } from './server-app.js';
import { ServerAppApi } from './server-app-api.js';
import { ServerApp } from './server-app.js';

const serverAppApiV1 = new ServerAppApi({
routes: [...authController.routes],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { type Repository } from '~/libs/modules/database/database.js';

import { type User } from './types.js';

type UserRepository = {
getByEmail(_email: string): Promise<User | null>;
} & Pick<Repository<User>, 'create'>;
type UserRepository = Pick<Repository<User>, 'create'> & {
getByEmail(_email: string): Promise<null | User>;
};

export { type UserRepository };
2 changes: 1 addition & 1 deletion apps/backend/src/modules/user/user.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class User
super(userModel);
}

public async getByEmail(email: string): Promise<TUser | null> {
public async getByEmail(email: string): Promise<null | TUser> {
const user = await this.model
.query()
.modify('withoutPassword')
Expand Down
4 changes: 2 additions & 2 deletions apps/backend/tests/modules/auth/auth.api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import {
import { API_V1_VERSION_PREFIX } from '../../libs/constants/constants.js';
import { buildApp } from '../../libs/modules/app/app.js';
import {
KNEX_SELECT_ONE_RECORD,
getCrudHandlers
getCrudHandlers,
KNEX_SELECT_ONE_RECORD
} from '../../libs/modules/database/database.js';
import { VALIDATION_RULE_DELTA } from '../../libs/modules/database/libs/constants/constants.js';
import { TEST_USERS_CREDENTIALS } from '../user/user.js';
Expand Down
22 changes: 11 additions & 11 deletions apps/frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import globals from 'globals';

import baseConfig from '../../eslint.config.js';

/** @typedef {import("eslint").Linter.FlatConfig} */
let FlatConfig;
/** @typedef {import("eslint").Linter.Config} */
let Config;

/** @type {FlatConfig} */
/** @type {Config} */
const ignoresConfig = {
ignores: ['build']
};

/** @type {FlatConfig} */
/** @type {Config} */
const mainConfig = {
languageOptions: {
globals: {
Expand All @@ -25,14 +25,14 @@ const mainConfig = {
}
};

/** @type {FlatConfig} */
/** @type {Config} */
const settingsConfig = {
settings: {
react: { version: 'detect' }
}
};

/** @type {FlatConfig} */
/** @type {Config} */
const reactConfig = {
files: ['**/*.tsx'],
plugins: {
Expand All @@ -49,7 +49,7 @@ const reactConfig = {
}
};

/** @type {FlatConfig} */
/** @type {Config} */
const reactHooksConfig = {
files: ['**/*.tsx'],
plugins: {
Expand All @@ -58,7 +58,7 @@ const reactHooksConfig = {
rules: reactHooks.configs.recommended.rules
};

/** @type {FlatConfig} */
/** @type {Config} */
const jsxA11yConfig = {
files: ['**/*.tsx'],
plugins: {
Expand All @@ -67,7 +67,7 @@ const jsxA11yConfig = {
rules: jsxA11y.configs.recommended.rules
};

/** @type {FlatConfig} */
/** @type {Config} */
const explicitGenericsConfig = {
rules: {
'require-explicit-generics/require-explicit-generics': [
Expand All @@ -77,7 +77,7 @@ const explicitGenericsConfig = {
}
};

/** @type {FlatConfig[]} */
/** @type {Config[]} */
const overridesConfigs = [
{
files: ['vite.config.ts'],
Expand All @@ -93,7 +93,7 @@ const overridesConfigs = [
}
];

/** @type {FlatConfig[]} */
/** @type {Config[]} */
const config = [
...baseConfig,
ignoresConfig,
Expand Down
6 changes: 3 additions & 3 deletions apps/frontend/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { default as baseConfig } from '../../lint-staged.config.js';
import baseConfig from '../../lint-staged.config.js';

/** @type {import('lint-staged').Config} */
const config = {
...baseConfig,
'**/*.css': [() => 'npm run lint:css -w apps/frontend'],
'**/*.{ts,tsx}': [
() => 'npm run lint:js -w apps/frontend',
() => 'npm run lint:type -w apps/frontend'
],
'**/*.css': [() => 'npm run lint:css -w apps/frontend']
]
};

export default config;
42 changes: 21 additions & 21 deletions apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"name": "@thread-js/frontend",
"private": true,
"engines": {
"node": "20.11.x",
"npm": "10.2.x"
"node": "22.15.x",
"npm": "10.9.x"
},
"type": "module",
"scripts": {
Expand All @@ -17,16 +17,16 @@
},
"dependencies": {
"@hookform/error-message": "2.0.1",
"@hookform/resolvers": "3.6.0",
"@reduxjs/toolkit": "2.2.5",
"@hookform/resolvers": "5.0.1",
"@reduxjs/toolkit": "2.7.0",
"@thread-js/shared": "*",
"clsx": "2.1.1",
"query-string": "9.0.0",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-hook-form": "7.51.5",
"react-redux": "9.1.2",
"react-router-dom": "6.23.1"
"query-string": "9.1.1",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-hook-form": "7.56.1",
"react-redux": "9.2.0",
"react-router": "7.5.3"
},
"browserslist": [
">0.2%",
Expand All @@ -35,16 +35,16 @@
"not op_mini all"
],
"devDependencies": {
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@vitejs/plugin-react": "4.3.1",
"eslint-plugin-jsx-a11y": "6.8.0",
"eslint-plugin-react": "7.34.2",
"eslint-plugin-react-hooks": "4.6.2",
"sass": "1.77.4",
"stylelint-config-standard-scss": "13.1.0",
"stylelint-scss": "6.3.1",
"vite": "5.2.13",
"vite-tsconfig-paths": "4.3.2"
"@types/react": "19.1.2",
"@types/react-dom": "19.1.3",
"@vitejs/plugin-react": "4.4.1",
"eslint-plugin-jsx-a11y": "6.10.2",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "5.2.0",
"sass": "1.87.0",
"stylelint-config-standard-scss": "14.0.0",
"stylelint-scss": "6.11.1",
"vite": "6.3.4",
"vite-tsconfig-paths": "5.1.4"
}
}
Loading
Loading