Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[POC] Implement 'nimble depsTree' #1012

Merged
merged 2 commits into from
Sep 1, 2022
Merged

[POC] Implement 'nimble depsTree' #1012

merged 2 commits into from
Sep 1, 2022

Conversation

yyoncho
Copy link
Contributor

@yyoncho yyoncho commented Jul 25, 2022

I am open on suggestion for better/different representation of the tree. Once we
agree on the format, I will update the documentation and add tests

Here it is sample output for langserver project

[
  {
    "name": "nim",
    "version": ">= 1.0.0",
    "resolvedTo": "",
    "error": "",
    "dependencies": []
  },
  {
    "name": "asynctools",
    "version": "#non-blocking",
    "resolvedTo": "0.1.1",
    "error": "",
    "dependencies": [
      {
        "name": "nim",
        "version": ">= 0.19.4",
        "resolvedTo": "",
        "error": "",
        "dependencies": []
      }
    ]
  },
  {
    "name": "json_rpc",
    "version": "#notif-changes",
    "resolvedTo": "0.0.2",
    "error": "",
    "dependencies": [
      {
        "name": "nim",
        "version": ">= 1.2.0",
        "resolvedTo": "",
        "error": "",
        "dependencies": []
      },
      {
        "name": "stew",
        "version": "@any",
        "resolvedTo": "0.1.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          }
        ]
      },
      {
        "name": "nimcrypto",
        "version": "@any",
        "resolvedTo": "0.5.4",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": "> 0.18.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          }
        ]
      },
      {
        "name": "stint",
        "version": "@any",
        "resolvedTo": "0.0.1",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.19",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      },
      {
        "name": "chronos",
        "version": "@any",
        "resolvedTo": "3.0.11",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": "> 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          },
          {
            "name": "bearssl",
            "version": "@any",
            "resolvedTo": "0.1.5",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "httputils",
            "version": "@any",
            "resolvedTo": "0.3.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.17.3",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "unittest2",
            "version": "@any",
            "resolvedTo": "0.0.4",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.19.4",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      },
      {
        "name": "httputils",
        "version": "@any",
        "resolvedTo": "0.3.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.17.3",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          },
          {
            "name": "unittest2",
            "version": "@any",
            "resolvedTo": "0.0.4",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.19.4",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      },
      {
        "name": "chronicles",
        "version": "@any",
        "resolvedTo": "0.10.2",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "testutils",
            "version": "@any",
            "resolvedTo": "0.5.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "json_serialization",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.17.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "serialization",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "faststreams",
                    "version": "@any",
                    "resolvedTo": "0.3.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "stew",
                        "version": "@any",
                        "resolvedTo": "0.1.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      },
                      {
                        "name": "testutils",
                        "version": "@any",
                        "resolvedTo": "0.5.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "chronos",
                        "version": "@any",
                        "resolvedTo": "3.0.11",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": "> 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "stew",
                            "version": "@any",
                            "resolvedTo": "0.1.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          },
                          {
                            "name": "bearssl",
                            "version": "@any",
                            "resolvedTo": "0.1.5",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              },
                              {
                                "name": "unittest2",
                                "version": "@any",
                                "resolvedTo": "0.0.4",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 0.19.4",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "httputils",
                            "version": "@any",
                            "resolvedTo": "0.3.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.17.3",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              },
                              {
                                "name": "stew",
                                "version": "@any",
                                "resolvedTo": "0.1.0",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 1.2.0",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              },
                              {
                                "name": "unittest2",
                                "version": "@any",
                                "resolvedTo": "0.0.4",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 0.19.4",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "name": "news",
        "version": "#status",
        "resolvedTo": "0.5",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.19.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          }
        ]
      },
      {
        "name": "websock",
        "version": "@any",
        "resolvedTo": "0.1.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "chronos",
            "version": ">= 3.0.0",
            "resolvedTo": "3.0.11",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": "> 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "bearssl",
                "version": "@any",
                "resolvedTo": "0.1.5",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "httputils",
                "version": "@any",
                "resolvedTo": "0.3.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.17.3",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "httputils",
            "version": ">= 0.2.0",
            "resolvedTo": "0.3.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.17.3",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "chronicles",
            "version": ">= 0.10.2",
            "resolvedTo": "0.10.2",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "testutils",
                "version": "@any",
                "resolvedTo": "0.5.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "json_serialization",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.17.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "serialization",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "faststreams",
                        "version": "@any",
                        "resolvedTo": "0.3.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "stew",
                            "version": "@any",
                            "resolvedTo": "0.1.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          },
                          {
                            "name": "testutils",
                            "version": "@any",
                            "resolvedTo": "0.5.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              },
                              {
                                "name": "unittest2",
                                "version": "@any",
                                "resolvedTo": "0.0.4",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 0.19.4",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "chronos",
                            "version": "@any",
                            "resolvedTo": "3.0.11",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": "> 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              },
                              {
                                "name": "stew",
                                "version": "@any",
                                "resolvedTo": "0.1.0",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 1.2.0",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              },
                              {
                                "name": "bearssl",
                                "version": "@any",
                                "resolvedTo": "0.1.5",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 1.2.0",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  },
                                  {
                                    "name": "unittest2",
                                    "version": "@any",
                                    "resolvedTo": "0.0.4",
                                    "error": "",
                                    "dependencies": [
                                      {
                                        "name": "nim",
                                        "version": ">= 0.19.4",
                                        "resolvedTo": "",
                                        "error": "",
                                        "dependencies": []
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "name": "httputils",
                                "version": "@any",
                                "resolvedTo": "0.3.0",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 0.17.3",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  },
                                  {
                                    "name": "stew",
                                    "version": "@any",
                                    "resolvedTo": "0.1.0",
                                    "error": "",
                                    "dependencies": [
                                      {
                                        "name": "nim",
                                        "version": ">= 1.2.0",
                                        "resolvedTo": "",
                                        "error": "",
                                        "dependencies": []
                                      }
                                    ]
                                  },
                                  {
                                    "name": "unittest2",
                                    "version": "@any",
                                    "resolvedTo": "0.0.4",
                                    "error": "",
                                    "dependencies": [
                                      {
                                        "name": "nim",
                                        "version": ">= 0.19.4",
                                        "resolvedTo": "",
                                        "error": "",
                                        "dependencies": []
                                      }
                                    ]
                                  }
                                ]
                              },
                              {
                                "name": "unittest2",
                                "version": "@any",
                                "resolvedTo": "0.0.4",
                                "error": "",
                                "dependencies": [
                                  {
                                    "name": "nim",
                                    "version": ">= 0.19.4",
                                    "resolvedTo": "",
                                    "error": "",
                                    "dependencies": []
                                  }
                                ]
                              }
                            ]
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      },
                      {
                        "name": "stew",
                        "version": "@any",
                        "resolvedTo": "0.1.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              }
            ]
          },
          {
            "name": "stew",
            "version": ">= 0.1.0",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          },
          {
            "name": "nimcrypto",
            "version": "@any",
            "resolvedTo": "0.5.4",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": "> 0.18.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          },
          {
            "name": "bearssl",
            "version": "@any",
            "resolvedTo": "0.1.5",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "zlib",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "stew",
                "version": ">= 0.1.0",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "name": "asynctools",
        "version": "#non-blocking",
        "resolvedTo": "0.1.1",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.19.4",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          }
        ]
      },
      {
        "name": "faststreams",
        "version": "@any",
        "resolvedTo": "0.3.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          },
          {
            "name": "testutils",
            "version": "@any",
            "resolvedTo": "0.5.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "chronos",
            "version": "@any",
            "resolvedTo": "3.0.11",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": "> 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "bearssl",
                "version": "@any",
                "resolvedTo": "0.1.5",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "httputils",
                "version": "@any",
                "resolvedTo": "0.3.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.17.3",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "unittest2",
            "version": "@any",
            "resolvedTo": "0.0.4",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.19.4",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      },
      {
        "name": "json_serialization",
        "version": "@any",
        "resolvedTo": "0.1.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.17.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "serialization",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "faststreams",
                "version": "@any",
                "resolvedTo": "0.3.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  },
                  {
                    "name": "testutils",
                    "version": "@any",
                    "resolvedTo": "0.5.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "chronos",
                    "version": "@any",
                    "resolvedTo": "3.0.11",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": "> 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "stew",
                        "version": "@any",
                        "resolvedTo": "0.1.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      },
                      {
                        "name": "bearssl",
                        "version": "@any",
                        "resolvedTo": "0.1.5",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "httputils",
                        "version": "@any",
                        "resolvedTo": "0.3.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.17.3",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "stew",
                            "version": "@any",
                            "resolvedTo": "0.1.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      }
    ]
  },
  {
    "name": "with",
    "version": "@any",
    "resolvedTo": "0.4.0",
    "error": "",
    "dependencies": [
      {
        "name": "nim",
        "version": ">= 0.19.0",
        "resolvedTo": "",
        "error": "",
        "dependencies": []
      }
    ]
  },
  {
    "name": "itertools",
    "version": "@any",
    "resolvedTo": "0.4.0",
    "error": "",
    "dependencies": [
      {
        "name": "nim",
        "version": ">= 0.18.0",
        "resolvedTo": "",
        "error": "",
        "dependencies": []
      }
    ]
  },
  {
    "name": "chronicles",
    "version": "@any",
    "resolvedTo": "0.10.2",
    "error": "",
    "dependencies": [
      {
        "name": "nim",
        "version": ">= 1.2.0",
        "resolvedTo": "",
        "error": "",
        "dependencies": []
      },
      {
        "name": "testutils",
        "version": "@any",
        "resolvedTo": "0.5.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 1.2.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "unittest2",
            "version": "@any",
            "resolvedTo": "0.0.4",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 0.19.4",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      },
      {
        "name": "json_serialization",
        "version": "@any",
        "resolvedTo": "0.1.0",
        "error": "",
        "dependencies": [
          {
            "name": "nim",
            "version": ">= 0.17.0",
            "resolvedTo": "",
            "error": "",
            "dependencies": []
          },
          {
            "name": "serialization",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              },
              {
                "name": "faststreams",
                "version": "@any",
                "resolvedTo": "0.3.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  },
                  {
                    "name": "stew",
                    "version": "@any",
                    "resolvedTo": "0.1.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  },
                  {
                    "name": "testutils",
                    "version": "@any",
                    "resolvedTo": "0.5.0",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "chronos",
                    "version": "@any",
                    "resolvedTo": "3.0.11",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": "> 1.2.0",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      },
                      {
                        "name": "stew",
                        "version": "@any",
                        "resolvedTo": "0.1.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      },
                      {
                        "name": "bearssl",
                        "version": "@any",
                        "resolvedTo": "0.1.5",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 1.2.0",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "httputils",
                        "version": "@any",
                        "resolvedTo": "0.3.0",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.17.3",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          },
                          {
                            "name": "stew",
                            "version": "@any",
                            "resolvedTo": "0.1.0",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 1.2.0",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          },
                          {
                            "name": "unittest2",
                            "version": "@any",
                            "resolvedTo": "0.0.4",
                            "error": "",
                            "dependencies": [
                              {
                                "name": "nim",
                                "version": ">= 0.19.4",
                                "resolvedTo": "",
                                "error": "",
                                "dependencies": []
                              }
                            ]
                          }
                        ]
                      },
                      {
                        "name": "unittest2",
                        "version": "@any",
                        "resolvedTo": "0.0.4",
                        "error": "",
                        "dependencies": [
                          {
                            "name": "nim",
                            "version": ">= 0.19.4",
                            "resolvedTo": "",
                            "error": "",
                            "dependencies": []
                          }
                        ]
                      }
                    ]
                  },
                  {
                    "name": "unittest2",
                    "version": "@any",
                    "resolvedTo": "0.0.4",
                    "error": "",
                    "dependencies": [
                      {
                        "name": "nim",
                        "version": ">= 0.19.4",
                        "resolvedTo": "",
                        "error": "",
                        "dependencies": []
                      }
                    ]
                  }
                ]
              },
              {
                "name": "unittest2",
                "version": "@any",
                "resolvedTo": "0.0.4",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 0.19.4",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              },
              {
                "name": "stew",
                "version": "@any",
                "resolvedTo": "0.1.0",
                "error": "",
                "dependencies": [
                  {
                    "name": "nim",
                    "version": ">= 1.2.0",
                    "resolvedTo": "",
                    "error": "",
                    "dependencies": []
                  }
                ]
              }
            ]
          },
          {
            "name": "stew",
            "version": "@any",
            "resolvedTo": "0.1.0",
            "error": "",
            "dependencies": [
              {
                "name": "nim",
                "version": ">= 1.2.0",
                "resolvedTo": "",
                "error": "",
                "dependencies": []
              }
            ]
          }
        ]
      }
    ]
  }
]

@yyoncho yyoncho marked this pull request as draft July 25, 2022 10:07
@Araq
Copy link
Member

Araq commented Jul 25, 2022

Output JSON?

@yyoncho
Copy link
Contributor Author

yyoncho commented Jul 25, 2022

I am fine with using json. Something like that:

{
    "name": "foobar",
    "version": ">= 1.0",
    "resolvedTo": "1.1",
    "depedencies": [{
        "name": "foobar-dep",
        "version": ">= 1.0",
        "resolvedTo": "1.1",
        "error": "xx",
        "depedencies": [...]
    }]
}

we may include also the path to the download dir.

@zah
Copy link
Member

zah commented Jul 25, 2022

DOT, and GraphML are other potentially interesting output formats.

@yyoncho yyoncho marked this pull request as ready for review August 11, 2022 10:06
Copy link
Collaborator

@dom96 dom96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Two suggestions:

  • Put the code into its own module (let's try to keep nimble.nim clean)
  • Include a "version" field in the output JSON so we can make breaking changes to the format.
  • Also feel free to support other formats via flags like --format:GraphML or similar.

@zah
Copy link
Member

zah commented Aug 25, 2022

The previous format was a bit more human-friendly and I think it should be the default. Supporting an option like --format:json and possibly other formats in the future sounds like a good way to cater to all audiences.

@zah
Copy link
Member

zah commented Aug 25, 2022

Also, @dom96 do you think we should use a shorter name for this (e.g. nimble deps)?

@dom96
Copy link
Collaborator

dom96 commented Aug 25, 2022

Yeah, I prefer nimble deps.

@yyoncho
Copy link
Contributor Author

yyoncho commented Aug 26, 2022

@Araq WDYT about @zah's proposal: having the human-readable format as default and then at some point add machine-readable (json). ATM it seems like the primary use case is to run this command manually and inspect the output.

@Araq
Copy link
Member

Araq commented Aug 26, 2022

I'm fine either way but I think the JSON is readable enough so that it could be the only supported format.

I am open on suggestion for better/different representation of the tree. Once we
agree on the format, I will update the documentation and add tests
@zah
Copy link
Member

zah commented Aug 30, 2022

The latest version of the code implements the --format: parameter and it looks like everyone is happy with this approach.

@dom96
Copy link
Collaborator

dom96 commented Aug 30, 2022

Sure, looks good. Can we also put the source code into its own module before merging?

@yyoncho
Copy link
Contributor Author

yyoncho commented Aug 31, 2022

@dom96 it won't be simply putting the functions into a separate module - that would require restructuring the whole file. deps functionality uses processFreeDependencies which is nimble.nim which then uses dozens of functions from nimble.nim.

@yyoncho
Copy link
Contributor Author

yyoncho commented Aug 31, 2022

I can put depsRecursive and printDepsHumanReadable

@dom96
Copy link
Collaborator

dom96 commented Aug 31, 2022

I think keeping depsTree in there makes sense, Nimble should probably contain mostly procedures that take a Options object as input and then call out into different modules that implement the logic for each command. So if you could move the depsRecursive and printDepsHumanReadable procs to a module that would be perfect.

@dom96 dom96 merged commit 1df4a0d into nim-lang:master Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants