You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I finished writing my first generator the last night and realized that one of two behaviors is happening with this.config.set(). I have not had the time to research what is truly happening yet and will do so later tonight after I have researched.
config.set() behaviors:
the config.set() overrides .yo-rc.json files in the current working directory
the config.set() does not override .yo-rc.json files in the current working directory AND it does not tell you that there is an existing .yo-rc.json file.
Proposed solution
If we can explicitly set a directory path for our .yo-rc.json file to be written to, we can void both of these terrible user-experiences. Yeoman should never not write the file, but it also should never override an existing one. This would also solve issues for monorepos, where you want your generator to create the directory in /packages, but cannot write the .yo-rc.json file to that directory. Instead you are forced to copy the config file to the right package.
Will do more research later tonight and make necessary updates and provide POC if necessary.
The text was updated successfully, but these errors were encountered:
As an alternative you could call: this.config = this.createStorate('some/custom/yo/path', 'some-custom-namespace');
But it will be destinationPath aware on the future. #1187
Explanation
I finished writing my first generator the last night and realized that one of two behaviors is happening with
this.config.set()
. I have not had the time to research what is truly happening yet and will do so later tonight after I have researched.config.set() behaviors:
.yo-rc.json
files in the current working directory.yo-rc.json
files in the current working directory AND it does not tell you that there is an existing.yo-rc.json
file.Proposed solution
If we can explicitly set a directory path for our
.yo-rc.json
file to be written to, we can void both of these terrible user-experiences. Yeoman should never not write the file, but it also should never override an existing one. This would also solve issues for monorepos, where you want your generator to create the directory in/packages
, but cannot write the.yo-rc.json
file to that directory. Instead you are forced tocopy
the config file to the right package.Will do more research later tonight and make necessary updates and provide POC if necessary.
The text was updated successfully, but these errors were encountered: