Skip to content

Latest commit

History

History
88 lines (56 loc) 路 2.84 KB

File metadata and controls

88 lines (56 loc) 路 2.84 KB

Headerly Contributing Guide

Hi! We're Really excited that you are interested in contributing to Headerly. Before submitting your contribution, please make sure to take a moment and Read through the following guidelines:

Pull Request Guidelines

  • Checkout a topic branch from the relevant branch, e.g. main, and merge back against that branch.

  • If adding a new feature:

    • Provide a convincing Reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
  • If fixing bug:

    • Provide a detailed description of the bug in the PR. Live demo preferred.
  • It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.

  • Commit messages must be matched by the following regex, see Conventional Commits for more information.

/^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.+\))?: .{1,100}/

Development Setup

Important

The exact node version used by this project is located in the .package.json file under the engines field. If you are using fnm, you can run fnm use to switch to the correct version.

You will need pnpm:

corepack enable pnpm

After cloning the repo, run:

pnpm install
cd extension

Please read WXT Documentation for more information on how to develop and test the extension.

Setup Dev Environment

Chrome/Edge

pnpm run dev

After executing the above command, visit chrome extensions page chrome://extensions/, and click Load unpacked button, then select the .output/chrome-mv3 folder in the project root directory, and try modifying the source code. You'll get live update.

Get build target(.zip)

This zip command will package the directory generated by the pnpm run build command into a zip file suitable for the browser extension store.

Chrome/Edge: .output/headerly-${VERSION}-chrome.zip

pnpm run zip

E2E Test

In order to test browser extensions, playwright needs to use the headless=new mode, which can cause the behavior of playwright test and playwright test --ui to be inconsistent at times, be sure to use playwright test to ensure that the test passes.

You must run pnpm run build before running this command because this command is run for the build product in the production environment.

pnpm run test:e2e:prod

This command is recommended for development mode:

pnpm exec playwright install chromium # Just run once
pnpm run test:e2e:dev

Lint

pnpm -w run lint:fix