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
Generating model with warthog generate command does not add import statement for related fields. Adding additional logic to model.ts.ejs I was able to run it successfully. Here is my commit: Joystream@e9b7eeb
The text was updated successfully, but these errors were encountered:
Perhaps pass a getFolderForModel function into props and then call it with the other model name. Something like:
functiongetFolderForModel(name: string){constnames={className: toolbox.strings.pascalCase(name),camelName: toolbox.strings.camelCase(name),kebabName: toolbox.strings.kebabCase(name),// Not proper pluralization, but good enough and easy to fix in generated codecamelNamePlural: toolbox.strings.camelCase(name)+'s'};// Allow folder to be passed in or pulled from config filesconstcliGeneratePath=options.folder||path.join(config.get('ROOT_FOLDER'),'/',config.get('CLI_GENERATE_PATH'),'/');// TODO:DOCS// Allow interpolation of the above names into the generate path like './src/${kebabName}'constdestFolder=supplant(cliGeneratePath,names);
I imagine you'll also need to use path.resolve to make sure the path imports are relative.
Do you want to request a feature or report a bug?
Bug
Generating model with
warthog generate
command does not addimport
statement for related fields. Adding additional logic tomodel.ts.ejs
I was able to run it successfully. Here is my commit: Joystream@e9b7eebThe text was updated successfully, but these errors were encountered: