wails icon indicating copy to clipboard operation
wails copied to clipboard

TS model from mixed package struct don't generated

Open avengerweb opened this issue 3 years ago • 1 comments

Description

I have struct that defined in "main" package, this struct has fields (struct) defined in "internal" package, in such case model will be generated only for "main" struct and for "internal" it will be missing. If I move all fields to same package it works fine.

To Reproduce

github.com/example/example/internal/config.go

package internal

type Authenticate struct {
	Token string `json:"token"`
}

type Cache struct {
	Limit     int    `json:"limit"`
	Enabled   bool   `json:"enabled"`
	Directory string `json:"directory"`
}

github.com/example/example/main.go

package main

import "github.com/example/example/internal"

type GlobalConfiguration struct {
	Authenticate *internal.Authenticate `json:"authenticate"`
	Cache        *internal.Cache        `json:"cache"`
}

Expected behaviour

cross-package structs should be generated correctly

Screenshots

No response

Attempted Fixes

No response

System Details

$ wails doctor
Wails CLI v2.0.0-beta.37


Scanning system - Please wait (this may take a long time)...Done.

System
------
OS:             Windows 10 Enterprise
Version:        2009 (Build: 19042)
ID:             20H2
Go Version:     go1.18.1
Platform:       windows
  - upx : Available at https://upx.github.io/
  - nsis : Available at https://nsis.sourceforge.io/Download

Additional context

No response

avengerweb avatar Jun 08 '22 19:06 avengerweb

Thanks for raising this.

leaanthony avatar Jun 08 '22 22:06 leaanthony

Please try the above PR to see if this fixes your problem. If you are unsure how to do this, please follow this guide. Let us know how you get on 👍

leaanthony avatar Sep 26 '22 08:09 leaanthony

The PR has now been merged. If this issue is still valid, please reopen. Thanks 👍

leaanthony avatar Oct 01 '22 05:10 leaanthony