Compare commits

..

3 Commits

Author SHA1 Message Date
z3n
f27542e71f fix: injecter node_modules/.bin dans le PATH des CLIs de génération
execFileAsync ne voit pas node_modules/.bin par défaut — on l'ajoute
explicitement à l'env du process enfant pour asyncapi et redocly.
Fonctionne aussi bien en local qu'en Docker (priorité locale, fallback global).

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-05-29 13:22:30 +00:00
z3n
3ef7246f38 chore(back): ajout @asyncapi/cli et @redocly/cli en dépendances locales
Plus besoin d'install globale — pnpm expose node_modules/.bin au PATH
lors de pnpm run start:dev, les CLIs sont trouvés automatiquement.

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-05-29 12:20:40 +00:00
z3n
235e8053d1 fix: compatibilité Windows pour la génération de docs
- execFileAsync avec shell:true pour trouver asyncapi.cmd/redocly.cmd sur Windows
- DOCS_OUTPUT_DIR par défaut ./docs-output (cross-platform) au lieu de /app/docs-output

Generated with [Claude Code](https://claude.ai/code)
via [Happy](https://happy.engineering)

Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Happy <yesreply@happy.engineering>
2026-05-22 15:22:07 +00:00
3 changed files with 22 additions and 4 deletions

View File

@@ -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",

View File

@@ -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 });
}
}

View File

@@ -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",