1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

fix(info): move "version" field to top of json output (#25890)

This commit is contained in:
David Sherret 2024-09-26 15:57:12 -04:00 committed by GitHub
parent 543c687c34
commit 7cccb7422b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 20 additions and 16 deletions

View file

@ -82,7 +82,11 @@ pub async fn info(
if info_flags.json {
let mut json_graph = serde_json::json!(graph);
if let Some(output) = json_graph.as_object_mut() {
output.insert("version".to_string(), JSON_SCHEMA_VERSION.into());
output.shift_insert(
0,
"version".to_string(),
JSON_SCHEMA_VERSION.into(),
);
}
add_npm_packages_to_json(&mut json_graph, npm_resolver.as_ref());
display::write_json_to_stdout(&json_graph)?;

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/076_info_json_deps_order.ts"
],
@ -160,6 +161,5 @@
}
],
"redirects": {},
"version": 1,
"npmPackages": {}
}

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/json_output/main.ts"
],
@ -87,6 +88,5 @@
}
],
"redirects": {},
"version": 1,
"npmPackages": {}
}

View file

@ -2,6 +2,7 @@ Download http://localhost:4548/subdir/redirects/redirect1.js
Download http://localhost:4546/subdir/redirects/redirect1.js
Download http://localhost:4545/subdir/redirects/redirect1.js
{
"version": 1,
"roots": [
"file:///[WILDLINE]/multiple_redirects/main.ts"
],
@ -43,6 +44,5 @@ Download http://localhost:4545/subdir/redirects/redirect1.js
"http://localhost:4546/subdir/redirects/redirect1.js": "http://localhost:4545/subdir/redirects/redirect1.js",
"http://localhost:4548/subdir/redirects/redirect1.js": "http://localhost:4546/subdir/redirects/redirect1.js"
},
"version": 1,
"npmPackages": {}
}

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"npm:chalk@4"
],
@ -12,7 +13,6 @@
"redirects": {
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"npm:chalk@4"
],
@ -12,7 +13,6 @@
"redirects": {
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"[WILDCARD]/peer_deps_with_copied_folders/main.ts"
],
@ -51,7 +52,6 @@
"npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0",
"npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0"
},
"version": 1,
"npmPackages": {
"@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": {
"name": "@denotest/peer-dep-test-child",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"[WILDCARD]/peer_deps_with_copied_folders/main.ts"
],
@ -51,7 +52,6 @@
"npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0",
"npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0"
},
"version": 1,
"npmPackages": {
"@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": {
"name": "@denotest/peer-dep-test-child",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"file://[WILDCARD]/main.js"
],
@ -51,7 +52,6 @@
"npm:chai@4.3": "npm:/chai@4.3.6",
"npm:chalk@4": "npm:/chalk@4.1.2"
},
"version": 1,
"npmPackages": {
"ansi-styles@4.3.0": {
"name": "ansi-styles",

View file

@ -1,4 +1,5 @@
{
"version": 1,
"roots": [
"[WILDCARD]/npm/peer_deps_with_copied_folders/main.ts"
],
@ -51,7 +52,6 @@
"npm:@denotest/peer-dep-test-child@1": "npm:/@denotest/peer-dep-test-child@1.0.0",
"npm:@denotest/peer-dep-test-child@2": "npm:/@denotest/peer-dep-test-child@2.0.0"
},
"version": 1,
"npmPackages": {
"@denotest/peer-dep-test-child@1.0.0_@denotest+peer-dep-test-peer@1.0.0": {
"name": "@denotest/peer-dep-test-child",