Builds & Store Publishing
Relevant source files
The following files were used as context for generating this wiki page:
The Refined GitHub Projects extension utilizes the WXT framework to manage a cross-browser build system targeting Manifest V3. The build process transforms React, TypeScript, and Primer CSS source code into optimized extension packages for Chrome, Firefox, Edge, and Safari.
The publishing workflow is integrated into the project's development lifecycle, utilizing pnpm scripts to automate building, zipping, and submitting artifacts to various browser web stores. This ensures consistent metadata, permissions, and security across all supported platforms.
Sources: README.md, wxt.config.ts:1-12, package.json:6-25
Build System Architecture
The project employs a modular build architecture where source code resides in src/, entrypoints are defined in src/entries/, and production output is generated in the dist/ directory.
Configuration and Hooks
The build behavior is defined in wxt.config.ts, which includes custom hooks to manipulate the extension manifest during generation. Specifically, the build:manifestGenerated hook performs cleanup on web_accessible_resources, deduplicating matches and removing dynamic URL requirements for CSS files to improve reliability and performance.
The diagram shows the transformation flow from source code to the optimized production distribution.
Sources: wxt.config.ts:5-10, wxt.config.ts:31-65, AGENTS.md:7-13
Cross-Browser Targets
The build system supports multiple browser engines through specific configuration flags. While the core logic remains shared, the manifest is dynamically adjusted for Firefox to include browser_specific_settings and gecko identifiers.
| Browser | Engine | Build Output Path |
|---|---|---|
| Chrome | Chromium | dist/chrome-mv3 |
| Firefox | Gecko | dist/firefox-mv3 |
| Edge | Chromium | dist/edge-mv3 |
| Safari | WebKit | dist/safari-mv3 |
Sources: package.json:8-11, wxt.config.ts:100-112, README.md:154-162
Distribution and Scripts
Automated tasks for building and publishing are defined in package.json. These scripts handle the full lifecycle from local development to store submission.
Development and Production Commands
The development server provides hot-reloading on port 3000, while production commands generate minified zips ready for upload.
- Development:
pnpm dev(Runswxt) - Production Build:
pnpm build(Runswxt build) - Packaging:
pnpm zip(Generates.zipartifacts for all browsers)
Sources: package.json:7-13, wxt.config.ts:15-18, AGENTS.md:15-19
Publishing Workflow
The project includes a submit script for automated Chrome Web Store uploads and specialized publish:* commands for individual browsers.
This sequence illustrates the automated transition from local commands to store-ready distribution.
Sources: package.json:17-22, CHANGELOG.md:88-90
Security and Compliance
The build process enforces strict security and architectural rules to ensure the extension remains performant and safe from rate-limiting bans.
Manifest Validation
A dedicated script check:manifest validates that the extension only requests the minimum required permissions (currently storage). This prevents over-privileged builds from being distributed to users.
Sources: package.json:23-25, wxt.config.ts:81-85
Critical Build Rules
The project imposes technical constraints that are non-negotiable for any build intended for production:
- Sequential Mutations: The build must never use
Promise.all()for GitHub API writes; all mutations must be sequential with a 1-second delay. - Isolated API Calls: Content scripts are prohibited from calling the GitHub API directly; they must communicate via
sendMessageto the background worker. - Shadow DOM Isolation: UI components are injected into a Shadow DOM to prevent CSS conflicts with GitHub's native styles.
Sources: CONTRIBUTING.md:10-16, README.md:273-280
Summary
The builds and store publishing system for Refined GitHub Projects is a robust, cross-browser automation pipeline. By leveraging WXT and standardized pnpm scripts, the project ensures that optimized, secure, and manifest-compliant versions of the extension are available on the Chrome Web Store and Firefox Add-ons. The integration of manifest validation and sequential API constraints directly into the development and build workflow maintains the integrity of the user's GitHub Personal Access Token (PAT) and ensures reliable performance.