-
-
Notifications
You must be signed in to change notification settings - Fork 116
Feat implement state for new changelogs #469
Feat implement state for new changelogs #469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late review, this week is hell for me...
@@ -119,6 +119,10 @@ function writeEntities(subFolder) { | |||
for (let i = 0, entityNames = Object.keys(configuration.entities); i < entityNames.length; i++) { | |||
const filePath = path.join(subFolder, toFilePath(entityNames[i])); | |||
const entity = updateEntityToGenerateWithExistingOne(filePath, configuration.entities[entityNames[i]]); | |||
if (FileUtils.doesFileExist(filePath)) { | |||
const destPath = path.join(subFolder, toPreviousStateFilePath(entityNames[i])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the full word: destinationPath
@@ -20,7 +20,7 @@ | |||
const fs = require('fs'); | |||
const path = require('path'); | |||
const ApplicationTypes = require('../core/jhipster/application_types'); | |||
const { toFilePath, readJSONFile } = require('../readers/json_file_reader'); | |||
const { toFilePath, toPreviousStateFilePath, readJSONFile } = require('../readers/json_file_reader'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get what the function does just by looking at the name.
What does it do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've suggested another name, perhaps it's more suggestive
@@ -0,0 +1,5393 @@ | |||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this file. We use NPM
* @param entityName the entity's name. | ||
* @returns {string} the file's path. | ||
*/ | ||
function toPreviousStateFilePath(entityName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getFilePathForPreviousStateOfEntity
would be a better name
Don't hesitate to be verbose!
|
||
/** | ||
* From an entity's name, gives the expected previous state file path. | ||
* @param entityName the entity's name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{String} missing
/** | ||
* From an entity's name, gives the expected previous state file path. | ||
* @param entityName the entity's name. | ||
* @returns {string} the file's path. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{String}
if (FileUtils.doesFileExist(filePath)) { | ||
const destPath = path.join(subFolder, toPreviousStateFilePath(entityNames[i])); | ||
fs.copyFileSync(filePath, destPath); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does this block do?
Tests are missing BTW |
@MathieuAA what about returning the last entity state instead of creating a new file? I don’t like the idea of creating -previous file by default |
@mshima I like your idea. @ntorionbearstudio is @mshima idea compatible with your feature? |
@ntorionbearstudio Hello there! This repo's source code is being moved to the generator, and this PR's additions too.
I'll help you finish this PR if need be |
Yes ! I'm working on it this week :) |
Thanks @ntorionbearstudio but be carefull. This repo will be archived, because jhipster-core has been merged into generator-jhipster |
Ok I'm working on updated generator-jhipster repo |
I moved what I needed on the generator-jhipster repo : jhipster/generator-jhipster#11419 Now the last entities states are passed to So I'm closing this PR and continue to work on jhipster/generator-jhipster#11419 |
Please make sure the below checklist is followed for Pull Requests.
jhipster/generator-jhipster#11398