setup our own youtube link utils library which will be open sourced#1
setup our own youtube link utils library which will be open sourced#1TomHipsh-genway merged 21 commits intomainfrom
Conversation
added all setup needed for package
There was a problem hiding this comment.
Pull Request Overview
This PR sets up a complete npm package for YouTube link utilities with TypeScript support, multiple build targets, and comprehensive tooling configuration.
- Complete package setup with TypeScript, build configuration, and testing framework
- YouTube URL validation, parsing, and video information fetching utilities
- Multiple build targets including ESM, CJS, and browser IIFE builds
Reviewed Changes
Copilot reviewed 20 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Package configuration with dependencies, scripts, and build targets |
| src/* | Core YouTube utilities for validation, parsing, and fetching video info |
| tsup.config.ts | Build configuration for multiple output formats |
| vitest.config.ts | Test configuration setup |
| eslint.config.js | ESLint configuration with TypeScript support |
| .prettierrc.json | Code formatting configuration |
| README.md | Documentation with usage examples |
| example.html | Browser usage example |
| test-build.js | Build verification script |
| .vscode/* | VS Code workspace configuration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
finished tests
added hook
added tests for hook
switched to jsdom
added more infra setup files
|
👋 Welcome External Contributor! Thank you for your contribution to youtube-link-utils! Your PR will be reviewed by GENWAY-AI organization members before merging. |
added CI/CD flows
|
👋 Welcome External Contributor! Thank you for your contribution to youtube-link-utils! Your PR will be reviewed by GENWAY-AI organization members before merging. |
This comment has been minimized.
This comment has been minimized.
|
👋 Welcome External Contributor! Thank you for your contribution to youtube-link-utils! Your PR will be reviewed by GENWAY-AI organization members before merging. |
updated versions
|
👋 Welcome External Contributor! Thank you for your contribution to youtube-link-utils! Your PR will be reviewed by GENWAY-AI organization members before merging. |
updated CI
more CI improvements
| @@ -0,0 +1,108 @@ | |||
| name: Label Pull Request Contributors | |||
There was a problem hiding this comment.
What is the purpose of this yml file?
There was a problem hiding this comment.
when some github user makes a pull request I tag it with internal contributer if he is part of this repository organization's or has write permissions
or external contributer if he is unknown user which want to contribute to this open source
| if (!trimmedUrl || currentValidationRef.current === trimmedUrl) { | ||
| return true; |
There was a problem hiding this comment.
Not sure I understood this - if the link is empty (!trimmedUrl) - so its a valid URL?
There was a problem hiding this comment.
yes
this function will set a ref which starts as empty
therefore, the initial state is valid
until you enter a non-trimmed input and then it will try to validate it
| } | ||
|
|
||
| currentValidationRef.current = trimmedUrl; | ||
| setIsValidating(true); |
There was a problem hiding this comment.
Why isn't it the first thing on the function?
There was a problem hiding this comment.
in order to avoid validation on the same value,
for example, a user can copy paste the same
| }); | ||
|
|
||
| describe('validateWithLoading', () => { | ||
| it('should return true for empty or whitespace-only URL without validation', async () => { |
There was a problem hiding this comment.
Why should it return true for empty URL's?
There was a problem hiding this comment.
because the initial state of the validator is empty string
I think that on empty is better to avoid validation, its more usful in components usage
on empty the input will be considered valid
| @@ -0,0 +1,248 @@ | |||
| import axios from 'axios'; | |||
There was a problem hiding this comment.
I see here use of mocks, let's talk F2F so you will explain on the mocks infrastructure here
|
General comments:
|
I made the needed changes to use the new package on our client side as a dependancy |
…t array combined YOUTUBE_URL_PATTERNS and PATTERN_VIDEO_ID_GROUPS to an object array
added all setup needed for package