update configs

This commit is contained in:
Igor Hrenowitsch Propisnov 2024-05-22 16:56:40 +02:00
parent 316f0b2832
commit f168602571
5 changed files with 77 additions and 2 deletions

1
backend/.gitignore vendored
View File

@ -2,6 +2,7 @@
/dist
/node_modules
/build
/docs
# Logs
logs

View File

@ -2,6 +2,8 @@ import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
import * as fs from 'fs';
import { join } from 'path';
async function setupSwagger(app) {
const config = new DocumentBuilder()
@ -9,8 +11,19 @@ async function setupSwagger(app) {
.setDescription('Description of the API')
.setVersion('0.0.0')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api', app, document);
const docsDir = join(process.cwd(), 'docs');
if (!fs.existsSync(docsDir)) {
fs.mkdirSync(docsDir);
}
fs.writeFileSync(
join(docsDir, 'swagger.json'),
JSON.stringify(document, null, 2)
);
}
async function setupPrefix(app) {

View File

@ -7,7 +7,7 @@
"typescript-angular": {
"generatorName": "typescript-angular",
"output": "frontend/src/app/api",
"inputSpec": "http://localhost:3000/api-json",
"inputSpec": "backend/docs/swagger.json",
"additionalProperties": {
"npmName": "Ticket-API-Services",
"npmVersion": "0.0.0",

View File

@ -4,12 +4,19 @@
"description": "",
"main": "index.js",
"scripts": {
"start:frontend:dev": "cd frontend && pnpm run start:dev",
"start:backend:dev": "cd backend && pnpm run start:dev",
"start:all:dev": "concurrently --kill-others --prefix-colors \"bgBlue.bold,bgMagenta.bold\" \"pnpm run start:frontend:dev\" \"pnpm run start:backend:dev\" --open \"terminal\"",
"install:all": "pnpm install && pnpm run install:frontend && pnpm run install:backend",
"install:frontend": "cd frontend && pnpm install",
"install:backend": "cd backend && pnpm install",
"build:api": "openapi-generator-cli generate"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@openapitools/openapi-generator-cli": "^2.13.4"
"@openapitools/openapi-generator-cli": "^2.13.4",
"concurrently": "^8.2.2"
}
}

View File

@ -8,6 +8,9 @@ devDependencies:
'@openapitools/openapi-generator-cli':
specifier: ^2.13.4
version: 2.13.4
concurrently:
specifier: ^8.2.2
version: 8.2.2
packages:
@ -242,6 +245,15 @@ packages:
wrap-ansi: 7.0.0
dev: true
/cliui@8.0.1:
resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==}
engines: {node: '>=12'}
dependencies:
string-width: 4.2.3
strip-ansi: 6.0.1
wrap-ansi: 7.0.0
dev: true
/clone@1.0.4:
resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
engines: {node: '>=0.8'}
@ -294,6 +306,22 @@ packages:
yargs: 16.2.0
dev: true
/concurrently@8.2.2:
resolution: {integrity: sha512-1dP4gpXFhei8IOtlXRE/T/4H88ElHgTiUzh71YUmtjTEHMSRS2Z/fgOxHSxxusGHogsRfxNq1vyAwxSC+EVyDg==}
engines: {node: ^14.13.0 || >=16.0.0}
hasBin: true
dependencies:
chalk: 4.1.2
date-fns: 2.30.0
lodash: 4.17.21
rxjs: 7.8.1
shell-quote: 1.8.1
spawn-command: 0.0.2
supports-color: 8.1.1
tree-kill: 1.2.2
yargs: 17.7.2
dev: true
/consola@2.15.3:
resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==}
dev: true
@ -671,10 +699,18 @@ packages:
resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==}
dev: true
/shell-quote@1.8.1:
resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==}
dev: true
/signal-exit@3.0.7:
resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==}
dev: true
/spawn-command@0.0.2:
resolution: {integrity: sha512-zC8zGoGkmc8J9ndvml8Xksr1Amk9qBujgbF0JAIWO7kXr43w0h/0GJNM/Vustixu+YE8N/MTrQ7N31FvHUACxQ==}
dev: true
/spawn-command@0.0.2-1:
resolution: {integrity: sha512-n98l9E2RMSJ9ON1AKisHzz7V42VDiBQGY6PB1BwRglz99wpVsSuGzQ+jOi6lFXBGVTCrRpltvjm+/XA+tpeJrg==}
dev: true
@ -813,6 +849,11 @@ packages:
engines: {node: '>=10'}
dev: true
/yargs-parser@21.1.1:
resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==}
engines: {node: '>=12'}
dev: true
/yargs@16.2.0:
resolution: {integrity: sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==}
engines: {node: '>=10'}
@ -825,3 +866,16 @@ packages:
y18n: 5.0.8
yargs-parser: 20.2.9
dev: true
/yargs@17.7.2:
resolution: {integrity: sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==}
engines: {node: '>=12'}
dependencies:
cliui: 8.0.1
escalade: 3.1.2
get-caller-file: 2.0.5
require-directory: 2.1.1
string-width: 4.2.3
y18n: 5.0.8
yargs-parser: 21.1.1
dev: true