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

[Refactor] - Switch to use JSON output rather than parseable #21

Open
JonShort opened this issue Aug 28, 2023 · 1 comment · May be fixed by #22
Open

[Refactor] - Switch to use JSON output rather than parseable #21

JonShort opened this issue Aug 28, 2023 · 1 comment · May be fixed by #22
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@JonShort
Copy link
Owner

Currently we use the --parseable output of npm outdated which requires a bit of work from bumpall to collect all the different data points from the provided string - see Package::new()

The --json output would remove most of the parsing (we can offload this to serde), leaving just the logic

Example outputs

Parseable

npm outdated --parseable
/npm_dir/node_modules/@jonshort/cenv:@jonshort/cenv@0.0.6:@jonshort/cenv@0.0.6:@jonshort/cenv@0.1.0:b
/npm_dir/node_modules/@jonshort/cenv:@jonshort/cenv@0.0.6:@jonshort/cenv@0.0.6:@jonshort/cenv@0.1.0:npm_dir
/npm_dir/workspaces/a/node_modules/abbrev:abbrev@1.1.1:abbrev@1.1.1:abbrev@2.0.0:a
/npm_dir/node_modules/debug:debug@4.3.4:debug@4.3.2:debug@4.3.4:npm_dir
/npm_dir/node_modules/left-pad:left-pad@1.3.0:left-pad@1.2.0:left-pad@1.3.0:npm_dir
/npm_dir/node_modules/polished:polished@3.7.2:polished@3.6.5:polished@4.2.2:npm_dir

JSON

npm outdated --json
{
  "@jonshort/cenv": {
    "current": "0.0.6",
    "wanted": "0.0.6",
    "latest": "0.1.0",
    "dependent": "b",
    "location": "/npm_dir/node_modules/@jonshort/cenv"
  },
  "abbrev": {
    "current": "1.1.1",
    "wanted": "1.1.1",
    "latest": "2.0.0",
    "dependent": "a",
    "location": "/npm_dir/workspaces/a/node_modules/abbrev"
  },
  "debug": {
    "current": "4.3.2",
    "wanted": "4.3.4",
    "latest": "4.3.4",
    "dependent": "npm_dir",
    "location": "/npm_dir/node_modules/debug"
  },
  "left-pad": {
    "current": "1.2.0",
    "wanted": "1.3.0",
    "latest": "1.3.0",
    "dependent": "npm_dir",
    "location": "/npm_dir/node_modules/left-pad"
  },
  "polished": {
    "current": "3.6.5",
    "wanted": "3.7.2",
    "latest": "4.2.2",
    "dependent": "npm_dir",
    "location": "/npm_dir/node_modules/polished"
  }
}
@JonShort JonShort added enhancement New feature or request good first issue Good for newcomers labels Aug 28, 2023
@jaysc
Copy link
Collaborator

jaysc commented Aug 28, 2023

Windows:

{
  "@jonshort/cenv": {
    "current": "0.0.6",
    "wanted": "0.0.6",
    "latest": "0.1.0",
    "dependent": "npm_dir",
    "location": "D:\\Users\\USERNAME\\Documents\\Git\\npm-bumpall\\npm_dir\\node_modules\\@jonshort\\cenv"
  },
  "debug": {
    "current": "4.3.2",
    "wanted": "4.3.4",
    "latest": "4.3.4",
    "dependent": "npm_dir",
    "location": "D:\\Users\\USERNAME\\Documents\\Git\\npm-bumpall\\npm_dir\\node_modules\\debug"
  },
  "left-pad": {
    "current": "1.2.0",
    "wanted": "1.3.0",
    "latest": "1.3.0",
    "dependent": "npm_dir",
    "location": "D:\\Users\\USERNAME\\Documents\\Git\\npm-bumpall\\npm_dir\\node_modules\\left-pad"
  },
  "polished": {
    "current": "3.6.5",
    "wanted": "3.7.2",
    "latest": "4.2.2",
    "dependent": "npm_dir",
    "location": "D:\\Users\\USERNAME\\Documents\\Git\\npm-bumpall\\npm_dir\\node_modules\\polished"
  }
}

@jaysc jaysc self-assigned this Aug 28, 2023
@jaysc jaysc linked a pull request Aug 28, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants