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

Add option --json for machine-readable output #17

Open
Zaid-Ajaj opened this issue Jun 22, 2019 · 3 comments
Open

Add option --json for machine-readable output #17

Zaid-Ajaj opened this issue Jun 22, 2019 · 3 comments

Comments

@Zaid-Ajaj
Copy link
Owner

Zaid-Ajaj commented Jun 22, 2019

Running

femto --json
# or
femto --project ./src/App.fsproj --json

Generates JSON report output about the npm dependencies required or missing, I need to think about what exactly is needed and how this JSON should look like. @MangelMaxime Do you have a suggestion?

I was thinking about something like:

{
  "projects": [ 
     { 
        "name": "Fable.DateFunction", 
        "dependencies": [  
            {   
                 "name": "date-fns", 
                 "resolutionStrategy": "min",
                 "required": ">= 1.30.0", 
                 "resolved": "1.30.1",
                 "installed": "1.29.0" ,
                 "packageJsonRange": "^1.28.2",
                 "missing": false
             } 
          ]
      }
   ]
}
@MangelMaxime
Copy link
Collaborator

The JSON looks good it as almost all of the info in it.

I would rename missing to actionRequired where it can have the values: none, upgrade, install. Because missing only have 2 states true or false.

I would probably also add downgrade because it's possible that a package is too new. upgrade or downgrade can be determine when we have the resolved version by using Semver to compare the versions.

@Zaid-Ajaj
Copy link
Owner Author

Does it matter whether a package is missing, outdated or "too new" because the action will always be: install the package that is resolved based on resolution strategy if installed package is missing or falls outside of the required range

Maybe I am missing something important?

@MangelMaxime
Copy link
Collaborator

Maybe I am missing something important?

I don't think you are missing something important.

It's that I find the name of the missing property misleading because it's not accurate. If the package is installed then the package is not missing.

If we the goal is to say if a package is ok or not. Then I would rename the missing property to isOk: true|false or actionRequired: true|false or something like that.

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

No branches or pull requests

2 participants