Skip to content

Commit

Permalink
from-issue: add support for entity json files (#28238)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima authored Dec 19, 2024
1 parent 24f2751 commit 6a9a023
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .blueprint/from-issue/generator.mts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default class extends BaseGenerator {

for (const file of await prepareSample(
this.destinationPath(),
this.data.files.filter(file => file.type === 'yo-rc'),
this.data.files.filter(file => ['yo-rc', 'json'].includes(file.type)),
)) {
this.writeDestination(file.filename, file.content);
}
Expand Down
4 changes: 3 additions & 1 deletion generators/info/support/extract-info.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { removeFieldsWithNullishValues } from '../../base/support/index.js';
import { GENERATOR_JHIPSTER } from '../../generator-constants.js';

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

export type InfoData = {
yoRcContent: string | undefined;
Expand Down Expand Up @@ -34,6 +34,8 @@ export const extractDataFromInfo = (info: string): InfoData => {
yoRcContent = body.trim();
files.push({ filename: '.yo-rc.json', content: yoRcContent, type: 'yo-rc' });
}
} else if (title.includes(' file')) {
files.push({ filename: title.split(' file')[0].trim(), content: body.trim(), type: 'json' });
} else if (title.includes('JDL entity definitions')) {
jdlEntitiesDefinitions = body.trim();
files.push({ filename: 'entities.jdl', content: jdlEntitiesDefinitions, type: 'entity-jdl' });
Expand Down

0 comments on commit 6a9a023

Please sign in to comment.