web-file-explorer-icons/CONTRIBUTING.md
2025-03-24 14:26:41 -04:00

57 lines
3.9 KiB
Markdown

# Contributing
## Recommendations
- Before starting to work on a pull request, make sure a related issue exists or create one to discuss with the maintainers about the feature(s) you want for the project.
- We use [conventionalcommits.org](https://www.conventionalcommits.org/en/v1.0.0/)'s rules for creating explicit and meaningful commit messages.
- If it's your first time contributing to a project then you should look to the popular [first-contributions](https://github.com/firstcontributions/first-contributions) repository on GitHub. This will give you hands-on experience with the features of GitHub required to make a contribution. As always, feel free to join our [Discord](https://discord.com/servers/catppuccin-907385605422448742) to ask any questions and clarify your understanding, we are more than happy to help!
## Development
### Directory Structure
| Folder | Description |
|---|---|
| `assets/` | Previews of the extension in each flavor. |
| `vscode-icons/` | A submodule of https://github.com/catppuccin/vscode-icons, providing the SVG files that are bundled with the extension. |
| `src/associations.ts` | Logic for merging the compiled associations list with user provided associations. |
| `src/constants.ts` | Values repeated throughout the extension; CSS selectors, icons, etc. |
| `src/storage.ts` | Logic for dealing with the extension's configuration options and storing them. |
| `src/public` | The icon for the extension, in various sizes. See https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/icons. |
| `src/entries` | Entry points for the extension. See https://wxt.dev/get-started/entrypoints.html. |
| `src/entries/background` | An entrypoint that sets up the custom domains feature. See https://github.com/fregante/webext-permission-toggle. |
| `src/entries/content` | The primary entrypoint containing the core functionality of the extension (injecting the icons into the file explorer). |
| `src/entries/popup` | An entrypoint for the extension options popup. |
### Setup
> [!IMPORTANT]
> Make sure to clone the repository with `--recurse-submodules` to create the `vscode-icons/` submodule, which is necessary for building the extension.
```bash
git clone --recurse-submodules https://github.com/catppuccin/web-file-explorer-icons.git
cd web-file-explorer-icons
pnpm install
```
### Scripts
The following package.json scripts are available for your convenience:
| Script | Description |
|---|---|
| `check` | Run the [Biome](https://biomejs.dev/) formatter and linter. Add `--write` to apply fixes automatically (`pnpm check --write`). |
| `dev` | Launch a Chrome instance with the extension installed and hot reloading enabled. Use `dev:firefox` to launch a Firefox instance instead. |
| `build` | Build the Chrome extension to `dist/`. Use `build:firefox` to build the Firefox version instead. |
| `zip` | Build and zip the Chrome extension. Use `zip:firefox` to build and zip the Firefox version instead. |
## Releasing & Publishing
This repository uses [Release Please](https://github.com/googleapis/release-please) to scan commit messages and create release pull requests when needed. Once a release pull request is merged, Release Please will create a GitHub release with a auto-generated changelog, and [the publishing step](https://github.com/catppuccin/web-file-explorer-icons/blob/main/.github/workflows/release-please.yml#L22-L70) of the workflow is ran to publish the extension to the extension stores.
### API credentials
The [`pnpm wxt submit init` command](https://wxt.dev/get-started/publishing.html#automation) will walk you through each of the tokens that need to be added in order to submit the extension to all stores. This command will add the tokens to a `.env` file, though new tokens should be add/updated in the repository secrets instead as the automated workflow is preferred to manual publishing.
🎉 Happy contributing! 🎉