Closed live627 closed 3 years ago
I don't think we need enhanced error messages here, if the package.json
is corrupted all kinds of other things would also fail. fs
and JSON
should suffice.
I would like to work on that, if no one is assigned to it :)
Neat, now I don't have to 😃
On Mon, Oct 4, 2021 at 5:32 PM Alessandro Menezes @.***> wrote:
I would like to work on that, if no one is assigned to it :)
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/avajs/ava/issues/2853#issuecomment-933961840, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADJNN3SCURCNFJTQR3I2F3UFJBQVANCNFSM5FEVG2SQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.
Hi. I've opened a draft PR for this (#2863). I tried my best to do a minimal change to the package-lock.json
file, but npm really wants to add dev: true
to a bunch of dependencies.
Well, if you have any suggestions, please let me know.
@novemberborn @live627 Hello, the PR is ready for a few days now. Is there anything else I should do to get it approved & merged?
Please let me know. Thanks in advance.
@alessandroasm I haven't had a chance to look at it yet.
read-pkg
is designated to read package files and optionally normalize them usingnormalize-package-data
. Thing is, only the type attribute is used. https://github.com/avajs/ava/blob/b0b76a034f106dfa34f4ca63da7a3700717857d0/lib/cli.js#L314-L323 Doesn't need to be normalized because it is validated https://github.com/avajs/ava/blob/b0b76a034f106dfa34f4ca63da7a3700717857d0/lib/module-types.js#L1-L25Could this be simplified?
read-pkg
could then be droppedand replaced with
parse-json
That in turn could also be dropped in favor of
JSON.parse
, but then the enhanced error messages would be lost.