getsentry / sentry-wizard

Sentry Project Setup Wizard
MIT License
192 stars 48 forks source link

Undeclared dependency on picocolors (pnpm dlx error) #424

Closed p3drosola closed 1 year ago

p3drosola commented 1 year ago

Environment

MacOS, nodejs 20

Steps to Reproduce

  1. pnpm dlx @sentry/wizard -i nextjs

Expected Result

Runs the wizard

Actual Result

Throws an error because of a missing dependency: "picocolors". This is used in two places in the code, but is not in the NPM deps.

https://github.com/getsentry/sentry-wizard/blob/9a37913697f26cb712a354aac0d938fc0b872f8a/lib/Steps/ChooseIntegration.ts#L3

https://github.com/getsentry/sentry-wizard/blob/9a37913697f26cb712a354aac0d938fc0b872f8a/src/utils/vendor/clack-custom-select.ts#L32

Despite the missing dependency it happens to work when using NPM because clackalso depends on picocolors, so all packages are hoisted together and can access unlisted dependencies.

My recommendation would be to remove those two usages, since they're not really doing anything. As you can see in line 130 the function "dim" returns a string (does not write to stdio), but the return value is not used anywhere.

https://github.com/getsentry/sentry-wizard/blob/9a37913697f26cb712a354aac0d938fc0b872f8a/lib/Steps/ChooseIntegration.ts#L130

Lms24 commented 1 year ago

Hi @p3drosola thanks for writing in! I opened #426 to fix this. Went with your suggestion to just remove the picocolor usage. No need to keep it around. We're gonna release this in the next days.

p3drosola commented 1 year ago

Thanks for the quick turnaround @Lms24 🙏