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

feat: add yup support for validation #9

Merged
merged 5 commits into from
Oct 26, 2024
Merged

feat: add yup support for validation #9

merged 5 commits into from
Oct 26, 2024

Conversation

johnie
Copy link
Owner

@johnie johnie commented Oct 26, 2024

Pull Request Type

  • Feature
  • Bug Fix
  • Refactor
  • General Change

Summary

This PR introduces the yup package to the project, enhancing schema validation capabilities and providing a new validation class, YupValidator. Additionally, the README is updated to reflect the support for Yup, and tests are added to verify the new validation functionality. This PR also optimizes the release workflow to utilize pnpm for dependency management and publishing, aligning with other recent dependency handling updates.

Changes Made

  1. Feature Addition: Added the yup package to package.json and pnpm-lock.yaml to support validation for front-end applications.
  2. Validation Class: Implemented YupValidator class in src/validators/yup.ts to provide schema validation using Yup.
  3. Testing: Created createScraper.yup.test.ts to validate data extraction and handling scenarios with Yup.
  4. Documentation: Updated README to reflect Yup's status as a supported schema library.
  5. Workflow Update: Modified .github/workflows/release.yml to use pnpm instead of npm for dependency installation and publishing, improving consistency with pnpm usage in the project.

How to Test

  1. Unit Tests:

    • Run tests using pnpm test to validate YupValidator functionality and its integration with createScraper.
    • Check createScraper.yup.test.ts for successful data extraction under various scenarios, including nested fields and missing data.
  2. Documentation Review:

    • Confirm the README accurately describes Yup’s supported status and clarifies schema library information.
  3. Workflow Execution:

    • Ensure the release workflow completes successfully with pnpm by triggering a release job in a test environment if possible.

Possible Regressions

  • Changes to the release workflow might affect the dependency installation and publishing processes. Monitor initial runs closely to ensure compatibility.
  • createScraper's new Yup-based validation may influence error handling or data processing if integrated with other validators; review for any inconsistencies.

Copy link

changeset-bot bot commented Oct 26, 2024

⚠️ No Changeset found

Latest commit: e46f983

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@johnie johnie merged commit 12d73bc into main Oct 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant