generated from JohnBra/vite-web-extension
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Stage 1: Refactor codebase (re) (re) #689
Open
mist8kengas
wants to merge
46
commits into
YouTube-Enhancer:dev
Choose a base branch
from
mist8kengas:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
5abcc96
refactor: reduce indentation on `setDefaultValues()`
mist8kengas 1713323
refactor: optimize function
mist8kengas f6d57ef
refactor: qol improvements
mist8kengas 1d1f65a
refactor: custom css
mist8kengas 9c88d92
Merge branch 'dev' of https://github.com/YouTube-Enhancer/extension i…
mist8kengas 91e4e98
refactor: deep dark css
mist8kengas 109c28b
refactor: feature menu
mist8kengas 55cbe80
refactor: hide x features
mist8kengas f33ab7c
refactor: loop button
mist8kengas 3356e64
refactor: maximize button
mist8kengas a576f5c
refactor: transcript button
mist8kengas 2b3b621
refactor: open settings on hover feature
mist8kengas f45afef
fix: make types constrained
mist8kengas 3d7a1fa
refactor: playback speed button
mist8kengas f75ca53
refactor: player speed
mist8kengas 6cb943f
refactor: remaining time
mist8kengas 11eed28
refactor: remove redirect links
mist8kengas f5d0dcc
refactor: screenshot button
mist8kengas 82bc5bc
refactor: scroll wheel speed control
mist8kengas 279a22b
refactor: scroll wheel volume control
mist8kengas 86c2cee
refactor: share shortener
mist8kengas 29afd29
refactor: auto scroll shorts
mist8kengas dc4aca8
refactor: video history
mist8kengas 7865dfc
refactor: volume boost logic
mist8kengas 3151b94
refactor: pause background players
mist8kengas 59c9d0a
refactor: player quality
mist8kengas f6383ac
refactor: remember volume
mist8kengas 2205a63
refactor: skip continue watching
mist8kengas 4ea23fb
refactor: useNotifications provider
mist8kengas 04f9aad
refactor: pages
mist8kengas 79f2303
feat(docs): add contributing page
mist8kengas b750794
Merge branch 'dev' into dev
VampireChicken12 663c56b
Merge branch 'dev' into dev
VampireChicken12 aa51abd
Merge branch 'dev' into dev
VampireChicken12 b8b31fe
Merge branch 'dev' into dev
VampireChicken12 de260f3
Merge branch 'dev' into dev
VampireChicken12 c2ad23c
Merge branch 'dev' into dev
VampireChicken12 20631b6
fix: eslint/prettier
livingflore 95ac395
fix: assert node type
livingflore 1361f45
Merge branch 'dev' into dev
VampireChicken12 1a1298c
Merge branch 'dev' into dev
VampireChicken12 9f0e468
chore: format
VampireChicken12 cb94460
Merge branch 'dev' into dev
VampireChicken12 e4df9c7
Merge branch 'dev' into dev
VampireChicken12 5abc38b
Merge branch 'dev' into dev
VampireChicken12 83f80fd
Merge pull request #3 from YouTube-Enhancer/dev
mist8kengas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# Contributing | ||
|
||
## Table of Contents | ||
|
||
- [Glossary](#📚-glossary) | ||
- [Getting Started](#🎉-getting-started) | ||
- [Commits, Issues, and Pull Requests](#✏-commits-issues-and-pull-requests) | ||
- [Contributor Workflow](#🗃-contributor-workflow) | ||
- [Internationalization](#🌐-internationalization-i18n) | ||
- [Code Quality](#🔧-code-quality) | ||
|
||
## 📚 Glossary | ||
|
||
Here are some terms that we interchangeably refer to in this document: | ||
|
||
- **Pull Request** (PR): Pull requests let you tell others about changes you've pushed to a branch in the repository. Once a pull request is opened, you can discuss and review the potential changes with collaborators and add follow-up commits before your changes are merged into the base branch. | ||
- **Continuous Integration** (CI): A development practice where developers frequently integrate their code changes into a shared repository. Each integration triggers automated tests to ensure that the new code doesn't break existing functionality. CI aims to detect and fix integration errors quickly, promoting collaboration and maintaining a consistent codebase. | ||
- **Continuous Development** (CD): An extension of Continuous Integration (CI) that focuses on automating the deployment of code changes to the production environment. | ||
|
||
## 🎉 Getting Started | ||
|
||
- Because our release CI/CD workflow is automated, we rely on commit messages that follow a format convention for semantic versioning[^1]. | ||
As such, we use the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) spec in commit messages. | ||
|
||
## ✏ Commits, Issues, and Pull Requests | ||
|
||
There are a few guidelines that we follow in order to maintain the quality of the codebase: | ||
|
||
- Make sure that commit messages are meaningful, and describe the commit itself. | ||
- When creating [Bug Report Issues](https://github.com/YouTube-Enhancer/extension/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=), make sure to follow the template and explain the issue in a clear and straightforward manner. | ||
- Although we do not strictly enforce the [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) spec in pull requests, it is preferred over other ways of creating PR titles. | ||
- In the description of the pull request, briefly describe the goal of the PR and the changes it will bring to the codebase. | ||
|
||
## 🗃 Contributor Workflow | ||
|
||
We use the "contributor workflow" to manage the code. Everyone suggests changes by making pull requests. This helps people contribute, make tests easier, and get feedback from others. | ||
|
||
To contribute to the codebase, the workflow is as follows: | ||
|
||
1. Fork the repository | ||
2. Commit changes to the fork (using the `dev` branch) | ||
3. Create a pull request (on the `dev` branch) | ||
|
||
_It is ill-advised to create pull requests against the `main` branch as `dev` changes are merged to the main branch in batches by the core maintainers._ | ||
|
||
> Read more about forking and making pull requests [here](https://docs.github.com/get-started/exploring-projects-on-github/contributing-to-a-project). | ||
|
||
## 🌐 Internationalization (i18n) | ||
|
||
### Crowdin Translation Project | ||
|
||
Our YouTube Enhancer extension supports multiple languages to provide a more inclusive experience for users around the world. We use Crowdin for managing translations. | ||
|
||
### Contributing Translations | ||
|
||
We welcome contributions to improve translations and make the extension accessible to a wider audience. If you'd like to contribute translations or suggest improvements, follow these steps: | ||
|
||
1. Visit our [Crowdin project](https://crowdin.com/project/youtube-enhancer). | ||
2. Select your language and start translating. | ||
3. If your language is not listed, feel free to request its addition. | ||
|
||
## 🔧 Code Quality | ||
|
||
Before new code gets merged into the repository, we do automated lint tests to verify the format of the code. | ||
|
||
It is recommended to test your code before committing by running the following commands: | ||
|
||
1. Lint check: `npm run lint` | ||
2. Fix lint errors: `npm run lint:fix` | ||
|
||
> You won't need to do this if you use a supported editor[^2], as the process is automated. | ||
|
||
While we don't yet have a strict guideline on what kind of code should be in the repository, here are a few principles we loosely follow to maintain the general consistency of the code: | ||
|
||
- [DRY principle](https://en.wikipedia.org/wiki/Don't_repeat_yourself) | ||
- [Rule of three](<https://en.wikipedia.org/wiki/Rule_of_three_(computer_programming)>) | ||
- [Single source of truth](https://en.wikipedia.org/wiki/Single_source_of_truth) | ||
|
||
--- | ||
|
||
[^1]: [Why Use Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#why-use-conventional-commits) | ||
|
||
[^2]: [ESLint: A List of Editor Integrations](https://eslint.org/docs/latest/use/integrations#editors) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Remove redundant
isWatchPage()
check.The code checks
isWatchPage()
twice - once at the start and again in the player container query. Since we have an early return, the second check is unnecessary.Also applies to: 16-16
🧰 Tools
🪛 ESLint
[error] 6-6: Insert
␍
(prettier/prettier)