Compare commits

..

3 Commits

Author SHA1 Message Date
z3n
67609231d9 fix(docs-generation): utiliser le chemin local du template asyncapi
Passer le chemin absolu node_modules/@asyncapi/html-template au lieu
du nom de package — bypasse la vérification registry.npmjs.org.

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 14:02:30 +00:00
z3n
90eab514b2 fix(docs-generation): pré-installer @asyncapi/html-template sans accès npm
- Ajout @asyncapi/html-template@3.5.6 en dépendance locale
- Suppression du flag --install (template trouvé dans node_modules)
- Évite l'appel réseau vers registry.npmjs.org lors de la génération

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:52:02 +00:00
z3n
3a98b87ccf fix(apis): résoudre le chemin absolu avant sendFile
res.sendFile() ne supporte pas les chemins relatifs — path.resolve()
convertit ./docs-output/... en chemin absolu avant l'envoi.

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:46:00 +00:00
3 changed files with 6 additions and 3 deletions

View File

@@ -29,6 +29,7 @@
"class-validator": "^0.14.0",
"class-transformer": "^0.5.0",
"@asyncapi/cli": "6.0.0",
"@asyncapi/html-template": "3.5.6",
"@redocly/cli": "latest"
},
"devDependencies": {

View File

@@ -52,7 +52,8 @@ export class ApisController {
async getDocs(@Param('id') id: string, @Res() res: Response) {
const entry = await this.apisService.findOneOrThrow(id);
if (!entry.htmlPath) throw new NotFoundException('Documentation not generated yet');
res.sendFile(entry.htmlPath);
const absolutePath = path.resolve(entry.htmlPath);
res.sendFile(absolutePath);
}
@Get(':id/yaml')

View File

@@ -50,13 +50,14 @@ export class DocsGenerationService {
}
private async generateAsyncApi(yamlPath: string, outputDir: string): Promise<void> {
/* Chemin local du template — évite l'appel réseau vers registry.npmjs.org */
const templatePath = path.join(process.cwd(), 'node_modules', '@asyncapi', 'html-template');
await execFileAsync('asyncapi', [
'generate', 'fromTemplate',
yamlPath,
'@asyncapi/html-template',
templatePath,
'--output', outputDir,
'--no-interactive',
'--install',
'--force-write',
], { shell: true, env: execEnv });
}