chore: update Node version and enhance package scripts

- Updated Node version in .nvmrc from 24.0.0-nightly to 23.5.0 for better compatibility.
- Modified package.json to include a prestart script for Prisma generation and adjusted the start script to enable watch mode.
- Removed unused import from document.schema.ts to clean up the code.
- Added keepAlive setting for subscriptions in graphql.module.ts to improve connection stability.

These changes aim to streamline the development environment and enhance the application's performance and maintainability.
This commit is contained in:
2025-01-08 18:08:52 +07:00
parent 776881f961
commit 26a5e6fe89
4 changed files with 5 additions and 7 deletions

2
.nvmrc
View File

@@ -1 +1 @@
24.0.0-nightly202412106c03beba46 23.5.0

View File

@@ -6,9 +6,9 @@
"private": true, "private": true,
"license": "UNLICENSED", "license": "UNLICENSED",
"scripts": { "scripts": {
"prestart": "npm run prisma:generate",
"start": "nest start --watch",
"build": "nest build", "build": "nest build",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch", "start:debug": "nest start --debug --watch",
"start:prod": "node dist/main", "start:prod": "node dist/main",
"prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma", "prisma:generate": "npx prisma generate --schema=./epess-database/prisma/schema.prisma",

View File

@@ -6,7 +6,6 @@ import {
PothosSchema, PothosSchema,
SchemaBuilderToken, SchemaBuilderToken,
} from "@smatch-corp/nestjs-pothos"; } from "@smatch-corp/nestjs-pothos";
import Delta from "quill-delta";
import { MinioService } from "src/Minio/minio.service"; import { MinioService } from "src/Minio/minio.service";
import { PromptType } from "src/OpenAI/openai.service"; import { PromptType } from "src/OpenAI/openai.service";
import { RedisService } from "src/Redis/redis.service"; import { RedisService } from "src/Redis/redis.service";

View File

@@ -114,10 +114,9 @@ import { GraphqlService } from "./graphql.service";
plugins: [ApolloServerPluginLandingPageLocalDefault()], plugins: [ApolloServerPluginLandingPageLocalDefault()],
installSubscriptionHandlers: true, installSubscriptionHandlers: true,
subscriptions: { subscriptions: {
keepAlive: 10000,
"graphql-ws": { "graphql-ws": {
onSubscribe(ctx, message) { connectionInitWaitTimeout: 10000,
console.log("onSubscribe", ctx, message);
},
onConnect: (ctx: Context<Record<string, unknown>>) => { onConnect: (ctx: Context<Record<string, unknown>>) => {
if (!ctx.connectionParams) { if (!ctx.connectionParams) {
Logger.log("No connectionParams provided", "GraphqlModule"); Logger.log("No connectionParams provided", "GraphqlModule");