serverless / components

The Serverless Framework's new infrastructure provisioning technology — Build, compose, & deploy serverless apps in seconds...
https://www.serverless.com
Apache License 2.0
2.3k stars 181 forks source link

fix: replace `jsome` with `util.inspect` #955

Closed G-Rath closed 3 years ago

G-Rath commented 3 years ago

What has been implemented?

https://github.com/serverless/components/pull/948#issuecomment-845635059

jsome looks to be abandoned, and uses a vulnerable version of yargs (which is also not required in this context, since it's not being used as a cli).

This replaces jsome with Node's native util.inspect function, which should provide the same approximate functionality.

Steps to verify

Todos:

zongUMR commented 3 years ago
Screen Shot 2021-05-21 at 12 56 04 Screen Shot 2021-05-21 at 12 56 10

Some suggestions:

  1. cli.log(inspect(retMsg, { depth: Infinity, colors: true }));, the code does not have the regMsg, replace it with correct variable
  2. The output have a problem: the 1st is using your code, will not be formatted. The 2nd pic is using jsome, that package will automatically format the data. e.g: result is: {name: "test", age: 0}
G-Rath commented 3 years ago

@zongUMR would you mind checking the output again? I messed up the variables so it was inspecting the string rather than the parsed object.

zongUMR commented 3 years ago

@zongUMR would you mind checking the output again? I messed up the variables so it was inspecting the string rather than the parsed object. yep, you can the screenshots in my comment, the first pic shows the raw output by inspect, the second one shows the formatted output by jsome

G-Rath commented 3 years ago

@zongUMR give it a try now :)

zongUMR commented 3 years ago

It looks good to me, @timqian Plz also test your features

timqian commented 3 years ago

Looks good to me. Thanks! @G-Rath

G-Rath commented 3 years ago

@zongUMR do you have a timeframe on when this will get released? I'm keen to update my projects to the latest serverless 😄

zongUMR commented 3 years ago

@zongUMR do you have a timeframe on when this will get released? I'm keen to update my projects to the latest serverless 😄

We will release it at 5/26 (each Wed per week is our normal release window).