Giter VIP home page Giter VIP logo

Comments (7)

jdx avatar jdx commented on August 28, 2024 1

This is incorrect behavior as to how it should work, I was just explaining why it's like this. How you imagined it is how it should work. I'm going to take a closer look.

from config.

jdx avatar jdx commented on August 28, 2024

yeah this is a little odd. For a little background that explains why this is like this: I went back and forth about whether or not there should be a 'name' field. I never wanted the name field in the configuration, my intention was for that to be populated inside the code with the key of the object it was inside of. It makes it a little easier to pass around a complete topic object that has the name attached. See in places like this: https://github.com/oclif/plugin-help/blob/master/src/index.ts#L48

So I think we do need the name. I'm not sure where it's populating that field exactly though, I would expect it to be in this repo but I can't seem to find it.

from config.

amphro avatar amphro commented on August 28, 2024

Also worth noting, I can't get other variations to work. Like

    "topics": [{
      "name": "t1",
      "description": "desc for t1",
      "subtopics": [{
        "name": "t1-1",
        "description": "desc for t1-1",
        "subtopics": [{
          "name": "t1-1-1",
          "description": "desc for t1-1-1"
        }, {
          "name": "t1-1-2",
          "description": "desc for t1-1-2"
        }]
      }]
    }]

Do you have a working example for nested topics?

from config.

jdx avatar jdx commented on August 28, 2024

You're mixing up how we reference topics in the code vs how they should be referenced in the config, they're not the same. In the code, we deal with a single array of all the topics including all subtopics but in the config it's a nested object. It's strange, but I've found this is the easiest way to deal with them in both places.

from config.

jdx avatar jdx commented on August 28, 2024

Having said that, we don't do much work with deeply nested things so I wouldn't be surprised if there was a bug inside of this logic. Let me see if I can work up an example.

from config.

amphro avatar amphro commented on August 28, 2024

Alright, you are right with adding names. This works:

    "topics": {
      "t1": {
        "name": "t1",
        "description": "desc for t1",
        "subtopics": {
          "t1-1": {
            "name": "t1-1",
            "description": "desc for t1-1",
            "subtopics": {
              "t1-1-1": {
                "name": "t1-1-1",
                "description": "desc for t1-1-1"
              },
              "t1-1-2": {
                "name": "t1-1-2",
                "description": "desc for t1-1-2"
              }
            }
          }
        }
      }
    }

Still seems odd to me that I need to duplicate the name when the framework can easily fo that for me. Also, I'm still not sure why my previous example didn't work, because it has a name and you have code in there to handle arrays.

from config.

oclif-bot avatar oclif-bot commented on August 28, 2024

🎉 This issue has been resolved in version 1.7.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

from config.

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.