5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 01:43:15 +08:00
Commit Graph

15 Commits

Author SHA1 Message Date
Jeremy Jay
fe1f23b0fd
If a field is exported, generate json even in the absence of tags (#3678)
* if no JSON tag, check if field is exported

* add no-tags binding test case

* update changelog for #3678
2024-08-14 07:49:08 +10:00
Gjergji Ramku
2f5398664f
Bindingings for empty go structs (#3489) 2024-05-18 07:39:27 +10:00
Atterpac
035ede4701
fix optional field syntax and ioutil replace with os' (#3476)
changelog
2024-05-14 06:40:31 +10:00
Leo
c10dfbce78
Fixed issue where createFrom would misidentify strings as arrays (#3435)
* Update check for Array-like variables

* Updated binding tests to reflect changes

* Update documentation to reflect changes

* Fixed PR number in changelog

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2024-04-27 16:30:04 +10:00
Andrey Pshenkin
b9de31e38e
Add support for interface generation and enums (#3047)
* Add support to output ts models as interfaces

* Add support to generate enums from golang

* cleanup logs

* add missing documentation

* fix package names for enum. Fix processing enums that are in separate packages

* revert golang 1.21

* Fix spelling

* Add support for simplified version of Enum for typescriptify

* update docs

* removed unused logs

* Add tests. Fix imported enums types in models

---------

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2023-11-26 06:50:49 +11:00
Lea Anthony
9ce0ddb4f8 [chore] lint fixes 2023-11-12 12:30:49 +11:00
Lea Anthony
26530a0f5a Fix reserve word check.
Add model generation.
Warn if field is unexported in the Go struct
2023-03-07 19:48:30 +11:00
Oleg Gulevskyy
651a1a5d66
Bugfix: Include ts pref & suffixes in module generation (#2227)
* include ts gen pref and suff in class fields

* fix nested namespaces not prefixed

* add basic unit test for parent child

* test for diff namespaces imports

* make entityReturn type func more generic

* get full entity name for TS args list

* fix failing test on empty struct

* wire up gen tests

* remove comment

* remove redundant line
2023-01-23 21:18:17 +11:00
Vadim Shchepotev
e2f1429c67
Fix issue with anonymous structures (#2186)
Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-12-20 22:54:11 +11:00
Oleg Gulevskyy
ca8a1fab36
Ability to define prefix / suffix for TS module (#2101)
* add tspostfix and tsprefix flags + organise under struct

* postifx -> suffix

* tsPrefix options on bindings struct

* pass prefix and suffix to the executable

* add support for CLI flags for generating module

* method to set TSpref/suff to bindings

* use passed ts prefix for typescriptify

* add brief Readme udpate to include new flags

* create reusable common flags

* use common flags instead of hardcoded text

* support tsprefix & suffix for dev

* add tsPrefix & tsSuffix for build cmd

* take pref & suff in account when gen d.ts

* export colorsful log functions into utils for reuse

* detect and warn the user about usage of reserved keyword

* fmt

* add TrimSpace on fn input

* refactor utils -> logutils

* add bindings -> ts_generation options to wailsjson parse

* use wailsjson for ts generation

* update warning message + extract to func

* remove suff/pref info from readme

* update json schema

* add tests for prefix and suffix case

* rename suffix method

* Update v2/internal/typescriptify/typescriptify.go

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* Update website/static/schemas/config.v2.json

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* Update website/static/schemas/config.v2.json

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>

* update changelog

* Minor tweaks

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-11-24 21:33:58 +11:00
JulioDRF
40e326a708
Fix binding generation special cases (#1902)
* Make binding.go easier to test

* Fix non-deterministic namespace order for bindings

* Add binding tests

* Fix nested import structs, non-string map keys, and escape invalid variable names

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
2022-10-01 15:49:51 +10:00
Lea Anthony
43f8a1f773 fix: blank namespaces, unknown structs 2022-04-06 19:13:10 +10:00
Lea Anthony
55855ccc4d fix: duplicate model generation 2022-04-05 21:30:55 +10:00
Lea Anthony
625eca27f6 Feature: TS namespaces 2022-04-05 18:11:56 +10:00
Lea Anthony
6b38f0c68e
Improved TS Generation (#1310)
Improve TS Generation
2022-04-04 21:01:00 +10:00