Code Contribution
Let's build a better language learning product together
Getting Started
Fork the repository and clone it to your local machine.
Windows environment variable configuration
If you are currently in a Windows environment, you need to add a web-ext.config.ts
file in the apps/extension
directory to explicitly specify the browser path.
pnpm dev can't load the extension automatically
If you use Chrome version 137 or higher, you need to download Chrome for Testing for development. See details.
Submitting Code
Create a new branch
Merge Branch
If the remote main branch gets updated and creates conflicts in our PR, you can resolve it by merging the remote branch in advance .
Fatal in syncing the upstream repository
If you encounter this error while syncing the upstream repository
Please try to manually add an upstream repository
Generating Pull Request
Before generating a Pull Request, you need to add a changeset
pnpm changeset
will generate [uniqId].md
in the .changeset
file, and the description of this changeset can be adjusted again after the generation is completed.
Then create a Pull Request and wait for it to be merged.
Commit Convention
We use the Conventional Commits specification for writing commit messages.
Set environment variables
To automatically load environment variables while developing the extension, such as API keys for the development environment, you can create a .env.local
file in the apps/extension
directory.
Skip Google API Tests in China
If you are a contributor from mainland China, when you need to push code, use the following command:
Why is this necessary? Because code tests are performed during the push process, but Google's free API is inaccessible in mainland China. This would cause the tests to fail and the push to be rejected. By setting the SKIP_FREE_API
environment variable, we skip the Google tests.
Ollama
read-frog can leverage a locally deployed Ollama server to achieve offline AI translation capabilities
DOM Node Interface Hierarchy
The following content will provide a detailed introduction to the inheritance relationships between the three interfaces `Node`, `Element`, and `HTMLElement` in the DOM, as well as their respective main subtypes.