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(npm): Use schema for datasource #22318

Closed

Conversation

zharinov
Copy link
Collaborator

Changes

Context

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests but ran on a real repository, or
  • Both unit tests + ran on a real repository

@zharinov zharinov marked this pull request as draft May 19, 2023 16:56
@zharinov
Copy link
Collaborator Author

Waiting for #22314

@zharinov zharinov marked this pull request as ready for review May 19, 2023 17:58
@zharinov zharinov requested review from rarkins and viceice May 19, 2023 17:58
z.object({
repository: PackageSource,
homepage: z.string().nullish().catch(null),
deprecated: z.string().nullish().catch('Unknown deprecation reason'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

catch will only be used if it's a wrong type that the expected string?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if deprecated can be just true, so if it is, it will be converted to this default string

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW if it's false then it will be converted to this string too, but I don't worry about false as much as I worry about true.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe better allow bool and transform to string if true and log debug if false?

lib/modules/datasource/npm/get.ts Show resolved Hide resolved
@zharinov zharinov requested a review from viceice May 20, 2023 06:06
@zharinov zharinov closed this Aug 13, 2023
@zharinov zharinov deleted the refactor/npm-datasource-use-schema branch August 13, 2023 13:52
@viceice
Copy link
Member

viceice commented Aug 13, 2023

🤔

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants