Compare commits
3 Commits
1bbb0c1125
...
f27542e71f
| Author | SHA1 | Date | |
|---|---|---|---|
| f27542e71f | |||
| 3ef7246f38 | |||
| 235e8053d1 |
@@ -27,7 +27,9 @@
|
||||
"pino": "^9.0.0",
|
||||
"pino-http": "^10.0.0",
|
||||
"class-validator": "^0.14.0",
|
||||
"class-transformer": "^0.5.0"
|
||||
"class-transformer": "^0.5.0",
|
||||
"@asyncapi/cli": "6.0.0",
|
||||
"@redocly/cli": "latest"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nestjs/cli": "^11.0.0",
|
||||
|
||||
@@ -7,9 +7,16 @@ import { ApisService } from '../apis/apis.service';
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
/* Ajoute node_modules/.bin au PATH pour trouver asyncapi/redocly en local */
|
||||
const localBin = path.join(process.cwd(), 'node_modules', '.bin');
|
||||
const execEnv = {
|
||||
...process.env,
|
||||
PATH: `${localBin}${path.delimiter}${process.env.PATH ?? ''}`,
|
||||
};
|
||||
|
||||
@Injectable()
|
||||
export class DocsGenerationService {
|
||||
private readonly outputDir = process.env.DOCS_OUTPUT_DIR ?? '/app/docs-output';
|
||||
private readonly outputDir = process.env.DOCS_OUTPUT_DIR ?? './docs-output';
|
||||
|
||||
constructor(
|
||||
@Inject(forwardRef(() => ApisService))
|
||||
@@ -51,7 +58,7 @@ export class DocsGenerationService {
|
||||
'--no-interactive',
|
||||
'--install',
|
||||
'--force-write',
|
||||
]);
|
||||
], { shell: true, env: execEnv });
|
||||
}
|
||||
|
||||
private async generateOpenApi(yamlPath: string, outputDir: string): Promise<void> {
|
||||
@@ -59,6 +66,6 @@ export class DocsGenerationService {
|
||||
'build-docs',
|
||||
yamlPath,
|
||||
'--output', path.join(outputDir, 'index.html'),
|
||||
]);
|
||||
], { shell: true, env: execEnv });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,15 @@
|
||||
"name": "datacat",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"pnpm": {
|
||||
"onlyBuiltDependencies": [
|
||||
"@nestjs/core",
|
||||
"@parcel/watcher",
|
||||
"esbuild",
|
||||
"lmdb",
|
||||
"msgpackr-extract"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "docker compose -f infra/docker-compose.yml up",
|
||||
"dev:build": "docker compose -f infra/docker-compose.yml up --build",
|
||||
|
||||
Reference in New Issue
Block a user