feat: add yup
support for validation
#9
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Type
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 utilizepnpm
for dependency management and publishing, aligning with other recent dependency handling updates.Changes Made
yup
package topackage.json
andpnpm-lock.yaml
to support validation for front-end applications.YupValidator
class insrc/validators/yup.ts
to provide schema validation using Yup.createScraper.yup.test.ts
to validate data extraction and handling scenarios with Yup..github/workflows/release.yml
to usepnpm
instead ofnpm
for dependency installation and publishing, improving consistency with pnpm usage in the project.How to Test
Unit Tests:
pnpm test
to validateYupValidator
functionality and its integration withcreateScraper
.createScraper.yup.test.ts
for successful data extraction under various scenarios, including nested fields and missing data.Documentation Review:
Workflow Execution:
Possible Regressions
createScraper
's new Yup-based validation may influence error handling or data processing if integrated with other validators; review for any inconsistencies.