make vue component gen reusable
This commit is contained in:
7
.idea/masonry.iml
generated
7
.idea/masonry.iml
generated
@ -1,4 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module version="4">
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="Go" enabled="true" />
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
8
.idea/modules.xml
generated
Normal file
8
.idea/modules.xml
generated
Normal file
@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/masonry.iml" filepath="$PROJECT_DIR$/.idea/masonry.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -336,15 +336,34 @@ func vueGenCmd() *cli.Command {
|
||||
},
|
||||
},
|
||||
Action: func(c *cli.Context) error {
|
||||
fmt.Println("Generating vue components")
|
||||
input := c.String("input")
|
||||
output := c.String("output")
|
||||
|
||||
err := vue_gen.GenVueFromSwagger(input, output)
|
||||
fmt.Println("Generating typescript code")
|
||||
cmd := exec.Command("npx",
|
||||
"openapi-typescript-codegen",
|
||||
"--input",
|
||||
input,
|
||||
"--output",
|
||||
output,
|
||||
"--client",
|
||||
"fetch",
|
||||
)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating typescript code | %w", err)
|
||||
}
|
||||
|
||||
fmt.Println("Generating vue components")
|
||||
err = vue_gen.GenVueFromSwagger(input, fmt.Sprintf("%s/components/", output))
|
||||
if err != nil {
|
||||
return fmt.Errorf("error generating vue components | %w", err)
|
||||
}
|
||||
|
||||
fmt.Println("You will need to run the command:\n\nnpm install @masonitestudios/dynamic-vue\n\nin your webapp's directory to use the generated components.")
|
||||
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user