diff --git a/cmd/project.go b/cmd/project.go index 21e2047f..0be7b468 100644 --- a/cmd/project.go +++ b/cmd/project.go @@ -143,11 +143,13 @@ type ProjectOptions struct { log *Logger templates *TemplateHelper selectedTemplate *TemplateDetails + WailsVersion string } // Defaults sets the default project template func (po *ProjectOptions) Defaults() { po.Template = "vuebasic" + po.WailsVersion = Version } // PromptForInputs asks the user to input project details diff --git a/cmd/templates.go b/cmd/templates.go index ab28b50e..1872c72a 100644 --- a/cmd/templates.go +++ b/cmd/templates.go @@ -160,6 +160,9 @@ func (t *TemplateHelper) InstallTemplate(projectPath string, projectOptions *Pro templatePath := projectOptions.selectedTemplate.Path + // Save the version + projectOptions.WailsVersion = Version + templateJSONFilename := filepath.Join(templatePath, t.metadataFilename) templateFiles := templateFilenames.Filter(func(filename string) bool { diff --git a/cmd/templates/create-react-app/.jshint b/cmd/templates/create-react-app/.jshint new file mode 100644 index 00000000..0557edf1 --- /dev/null +++ b/cmd/templates/create-react-app/.jshint @@ -0,0 +1,3 @@ +{ + "esversion": 6 +} \ No newline at end of file diff --git a/cmd/templates/create-react-app/go.mod.template b/cmd/templates/create-react-app/go.mod.template index 5c267602..78038106 100644 --- a/cmd/templates/create-react-app/go.mod.template +++ b/cmd/templates/create-react-app/go.mod.template @@ -1 +1,5 @@ -module {{.BinaryName}} \ No newline at end of file +module {{.BinaryName}} + +require ( + github.com/wailsapp/wails {{.WailsVersion}} +) \ No newline at end of file diff --git a/cmd/templates/vuebasic/.jshint b/cmd/templates/vuebasic/.jshint new file mode 100644 index 00000000..0557edf1 --- /dev/null +++ b/cmd/templates/vuebasic/.jshint @@ -0,0 +1,3 @@ +{ + "esversion": 6 +} \ No newline at end of file diff --git a/cmd/templates/vuebasic/go.mod.template b/cmd/templates/vuebasic/go.mod.template index 5c267602..78038106 100644 --- a/cmd/templates/vuebasic/go.mod.template +++ b/cmd/templates/vuebasic/go.mod.template @@ -1 +1,5 @@ -module {{.BinaryName}} \ No newline at end of file +module {{.BinaryName}} + +require ( + github.com/wailsapp/wails {{.WailsVersion}} +) \ No newline at end of file diff --git a/cmd/templates/vuetify-basic/go.mod.template b/cmd/templates/vuetify-basic/go.mod.template index 5c267602..78038106 100644 --- a/cmd/templates/vuetify-basic/go.mod.template +++ b/cmd/templates/vuetify-basic/go.mod.template @@ -1 +1,5 @@ -module {{.BinaryName}} \ No newline at end of file +module {{.BinaryName}} + +require ( + github.com/wailsapp/wails {{.WailsVersion}} +) \ No newline at end of file