Code Monkey home page Code Monkey logo

Comments (3)

lolopinto avatar lolopinto commented on August 14, 2024

hmm, why is a builder being imported through index.ts? do you know where that's from? that should be fixed?

if you set userOverridenFiles in ent.yaml to a list of relative paths, they won't be overridden by codegen

i.e.

userOverridenFiles:
    - src/ent/generated/user_base.ts
    - src/graphql/generated/resolvers/user_type.ts

added in #1520

from ent.

Swahvay avatar Swahvay commented on August 14, 2024

Maybe the builder isn't being included in index.ts. But this definitely is fixing my problems. In general I've always found it safer to import files directly than through an index list. I realize I'm sort of solving the symptom more than the problem, but a couple bandaids might be all that are needed here. Also, I'll remember what you did to fix this and if I need to also apply this change to any other types of files (like ent actions), then I can submit a PR instead of making an issue.

As for using userOverridenFiles, I don't actually want codegen to ignore these files since they do occasionally still get updates from schema changes and I want to make sure codegen doesn't skip them.

from ent.

Swahvay avatar Swahvay commented on August 14, 2024

I believe the fix could be made here:

uniqueNodes := nodeData.getUniqueNodes(true)
for _, unique := range uniqueNodes {
ret = append(ret, &tsimport.ImportPath{
Import: unique.Node,
ImportPath: codepath.GetExternalImportPath(),
})
}

If the codepath.GetExternalImportPath() would take the nodeData, then it could simply reference nodeData.PackageName and append that to the import path. Alternatively, the filename could be generated via names.ToFilePathName.

from ent.

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.