GithubHelp home page GithubHelp logo

Comments (3)

tkrajina avatar tkrajina commented on August 22, 2024

Hm, I can't see a problem in typescriptify here.

Something like this works without problems:

package main

import (
	"fmt"

	testpackage "github.com/tkrajina/typescriptify-golang-structs/test-package"
	"github.com/tkrajina/typescriptify-golang-structs/typescriptify"
)

func main() {
	t := typescriptify.New()
	t.Add(testpackage.Aaaa{})
	err := t.ConvertToFile("test.ts")
	if err != nil {
		panic(err.Error())
	}
}

from typescriptify-golang-structs.

loeffel-io avatar loeffel-io commented on August 22, 2024

while generating the main via the cli the testpackage part of testpackage "github.com/tkrajina/typescriptify-golang-structs/test-package" will not be added (the package of the ranked-model directory is model)

from typescriptify-golang-structs.

tkrajina avatar tkrajina commented on August 22, 2024

Ah... I thought this was your code, not the code generated. Maybe a bit more of context (for example how to actually reproduce the error) would have helped initially.

Anyway. Pushed a change in dev. It generates code like this:

package main

import (
        "fmt"

        m "github.com/tkrajina/typescriptify-golang-structs/example/example-models"
        "github.com/tkrajina/typescriptify-golang-structs/typescriptify"
)

func main() {
        t := typescriptify.New()
        t.CreateInterface = true
        t.BackupDir=""

        t.Add(m.Address{})
        t.Add(m.PersonalInfo{})
        t.Add(m.Person{})


        err := t.ConvertToFile("tmp_interfaces.ts")
        if err != nil {
                panic(err.Error())
        }
        fmt.Println("OK")
}

Let me know if it works for you.

from typescriptify-golang-structs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.