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

feat(cli): json option for "deno info" #6372

Merged
merged 10 commits into from
Jul 8, 2020

Conversation

implicitdef
Copy link
Contributor

Hello
This PR implements #6260

Examples :
deno info --json

{
  "denoDir": "/Users/username/Library/Caches/deno",
  "modulesCache": "/Users/username/Library/Caches/deno/deps",
  "typescriptCache": "/Users/username/Library/Caches/deno/gen"
}

deno info --json https://deno.land/std/http/cookie.ts

{
  "local": "/Users/username/Library/Caches/deno/deps/https/deno.land/71cfa455a02c3c9eefb15d2f39d02d374ee9214eb8ece35364fd47d2ef0981d2",
  "file_type": "TypeScript",
  "compiled": "/Users/username/Library/Caches/deno/gen/https/deno.land/std/http/cookie.ts.js",
  "map": "/Users/username/Library/Caches/deno/gen/https/deno.land/std/http/cookie.ts.js.map",
  "deps": [
    "https://deno.land/std/http/cookie.ts",
    [
      [
        "https://deno.land/std/_util/assert.ts",
        []
      ],
      [
        "https://deno.land/std/datetime/mod.ts",
        [
          [
            "https://deno.land/std/_util/assert.ts",
            []
          ]
        ]
      ]
    ]
  ]
}

Compare to regular output :
deno info https://deno.land/std/http/cookie.ts

local: /Users/username/Library/Caches/deno/deps/https/deno.land/71cfa455a02c3c9eefb15d2f39d02d374ee9214eb8ece35364fd47d2ef0981d2
type: TypeScript
compiled: /Users/username/Library/Caches/deno/gen/https/deno.land/std/http/cookie.ts.js
map: /Users/username/Library/Caches/deno/gen/https/deno.land/std/http/cookie.ts.js.map
deps:
https://deno.land/std/http/cookie.ts
  ├── https://deno.land/std/_util/assert.ts
  └─┬ https://deno.land/std/datetime/mod.ts
    └── https://deno.land/std/_util/assert.ts

@CLAassistant
Copy link

CLAassistant commented Jun 18, 2020

CLA assistant check
All committers have signed the CLA.

core/lib.rs Outdated Show resolved Hide resolved
@ry ry added this to the 1.2.0 milestone Jun 19, 2020
Copy link
Member

@ry ry 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 at first glance.

FYI this is a new feature and thus will have to wait until 1.2.0 lands - which will be July 13.

@bartlomieju bartlomieju added cli related to cli/ dir feat new feature (which has been agreed to/accepted) labels Jun 24, 2020
serde_json::json!(["a", [["b", [["b2", []]]], ["c", []]]]),
deps.to_json()
);
}
Copy link
Member

Choose a reason for hiding this comment

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

Nice test

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

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

Code looks good to me and I believe it's a very useful feature 👍 however I'm not sure about the JSON schema that is currently used, I'm pretty sure we'll iterate on it further.

So I suggest to require --unstable flag for deno info --json, so we can change the output before stabilizing this feature.

@qballer
Copy link

qballer commented Jul 7, 2020

I'm waiting to test out this feature. Would really appreciate a merge on this.

@implicitdef
Copy link
Contributor Author

I'll try to add the --unstable flag

@implicitdef implicitdef closed this Jul 8, 2020
@implicitdef implicitdef reopened this Jul 8, 2020
Copy link
Member

@ry ry left a comment

Choose a reason for hiding this comment

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

Nice work @implicitdef - LGTM

@ry ry merged commit cbbd944 into denoland:master Jul 8, 2020
@implicitdef implicitdef deleted the 6260_info_json_output branch July 8, 2020 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants