Skip to content

Commit 1914d69

Browse files
committed
from-issue: add support for entity json files
1 parent 7165f52 commit 1914d69

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.blueprint/from-issue/generator.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export default class extends BaseGenerator {
9393

9494
for (const file of await prepareSample(
9595
this.destinationPath(),
96-
this.data.files.filter(file => file.type === 'yo-rc'),
96+
this.data.files.filter(file => ['yo-rc', 'json'].includes(file.type)),
9797
)) {
9898
this.writeDestination(file.filename, file.content);
9999
}

generators/info/support/extract-info.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { removeFieldsWithNullishValues } from '../../base/support/index.js';
22
import { GENERATOR_JHIPSTER } from '../../generator-constants.js';
33

4-
export type InfoFile = { filename: string; content: string; type: 'jdl' | 'yo-rc' | 'entity-jdl' };
4+
export type InfoFile = { filename: string; content: string; type: 'jdl' | 'yo-rc' | 'entity-jdl' | 'json' };
55

66
export type InfoData = {
77
yoRcContent: string | undefined;
@@ -34,6 +34,8 @@ export const extractDataFromInfo = (info: string): InfoData => {
3434
yoRcContent = body.trim();
3535
files.push({ filename: '.yo-rc.json', content: yoRcContent, type: 'yo-rc' });
3636
}
37+
} else if (title.includes(' file')) {
38+
files.push({ filename: title.split(' file')[0].trim(), content: body.trim(), type: 'json' });
3739
} else if (title.includes('JDL entity definitions')) {
3840
jdlEntitiesDefinitions = body.trim();
3941
files.push({ filename: 'entities.jdl', content: jdlEntitiesDefinitions, type: 'entity-jdl' });

0 commit comments

Comments
 (0)