Contribution Guide
Project Structure
Version Compatibility
The main branch currently targets Halo 2.x.
Development Guide
Before you start, make sure your editor supports EditorConfig so formatting stays consistent across the project.
Setting Up the Development Environment
Install pnpm
First, install Node.js, then run:
npm install -g pnpmPreparation Before Development
Clone the Project Source Code and Navigate to the Root Directory
git clone https://github.com/HowieHz/halo-theme-higan-hz && cd halo-theme-higan-hz/Install Project Dependencies
In the project root, install dependencies:
pnpm installDeveloping the Theme
To run the theme in development mode with live updates, execute:
pnpm devUncompressed style files are generated in tmp/, which makes debugging easier.
Writing Documentation
For documentation development with live preview, run:
pnpm docs:devBuild production docs to docs/.vitepress/dist with:
pnpm docs:buildPreview the production build with:
pnpm docs:previewAfter Development
Linting
Run the following command and make sure there are no errors:
pnpm lintFormatting Code
Before committing, format the code with:
pnpm fmtBuilding the Theme
Build the theme with:
pnpm buildCI Checks
CI (GitHub Actions) runs the following checks for PRs. Some checks are triggered manually when needed.
CI Linting Steps
CI automatically runs pnpm lint, including the following checks:
oxlint+eslint: Code style and type-aware checks- Scope: JavaScript files, TypeScript files, HTML files (inline
scriptblocks only), and Vue files (including inlinescriptblocks)
- Scope: JavaScript files, TypeScript files, HTML files (inline
stylelint: Stylesheet checks- Scope: CSS files, HTML files (inline
styleblocks only), and Vue files (inlinestyleblocks only) - Note: By default,
**/*.{css,html,vue}does not match dot-prefixed directories, so additional path globs are required.
- Scope: CSS files, HTML files (inline
markdownlint: Documentation style checks- Scope: Markdown files
autocorrect: Automated text corrections- Scope: Supported file formats
tsgo --noEmit: TypeScript type checks- Scope: TypeScript files
All lint steps run with auto-fix enabled. If fixes are applied, the changes are committed automatically.
CI Formatting Steps
CI automatically runs pnpm fmt, including the following formatting steps:
oxfmt: Formatting for JSON, JSONC, YAML, Markdown, CSS, JavaScript, TypeScript, HTML, Vue and Less files
Changes produced by formatting will be automatically committed.
Lighthouse CI
- Checks Lighthouse scores and outputs reports (all scores must be full marks).
- Compares page resource-size differences against the baseline version and outputs reports.
Release Guard Checks
- Verifies that
docs/maintenance/changelog.mdanddocs/en/maintenance/changelog.mdstill contain## [Unreleased](fails if missing). - Verifies that changelog compare-link definitions at the end of
docs/maintenance/changelog.mdanddocs/en/maintenance/changelog.mdare complete and match release headings (fails if missing or mismatched). - Ensures non-release PRs do not manually modify the
versionfield inpackage.json(fails if changed). - Ensures release PRs (with the
releaselabel) update theversionfield inpackage.json(fails if unchanged), use a valid semantic version matching/^\d+\.\d+\.\d+$/(fails if invalid), and set a version greater than the target branch's currentpackage.jsonversion (fails if not incremented). - Prevents manual changes to
spec.versionintheme.yamlandi18n-settings/theme.*.yamlin PRs (fails if changed).
Page Resource Size Diff Check
To run the page resource size diff check for the current PR, add a /audit comment to the PR conversation (only users with write, maintain, or admin access can trigger it).
The check runs against the latest commit in the PR and compares page resource sizes with the latest stable release.
Visual Regression Testing
To run the visual regression check for the current PR, add a /visual comment to the PR conversation (only users with write, maintain, or admin access can trigger it).
Playwright captures screenshots of key pages across desktop, tablet, and mobile viewports using Chromium, Firefox, and WebKit, then compares them against the baseline version with Argos CI.
The current automation generates and uploads only Chromium screenshots for comparison.
Release Flow
Pre-release Checklist
Before releasing, confirm all of the following:
- Every branch or PR intended for the release has already been merged.
- The entries under
## [Unreleased]in bothdocs/maintenance/changelog.mdanddocs/en/maintenance/changelog.mdare complete, the## [Unreleased]heading has not been removed, and compare-link definitions at the end are retained (the release workflow will rebuild this section automatically). - In release PRs (with the
releaselabel), onlypackage.jsonversionshould be changed manually. That value becomes the target stable version. - Manually verify that the
requiresfield intheme.yamlandi18n-settings/theme.*.yamlstill matches the target Halo CMS compatibility range.
Stable Release Procedure
Stable releases are published automatically from a labeled PR:
- Create a PR for the release (or use an existing aggregation PR).
- Add the
releaselabel and changepackage.jsonversionto the target semantic version, such as1.57.6. - Wait for
check-release-guard.ymlto pass and confirm both the target version (frompackage.json) and the previous stable version shown in the workflow summary. - Merge the PR into
main.
After merge, the bot automatically:
- Promotes content under
## [Unreleased]into a new release section in both changelog files, creates the new stable-release heading, and keeps## [Unreleased]. - Rebuilds compare-link definitions at the end of both changelog files (
[Unreleased]and version links). - Updates
package.jsonversion,theme.yamlspec.version, andi18n-settings/theme.*.yamlspec.version, then pushes the bot commit tomain. - Builds the theme and produces multiple
howiehz-higan-*.zippackages. - Runs
gh attestation verifyto confirm everyhowiehz-higan-*.zippackage was signed by the expected reusable build workflow; publishing continues only after verification passes. - After verification passes, two publishing actions run in parallel:
- Create the GitHub Release and keep
howiehz-higan-cn.zipfirst in the release asset list. - Sync to the Halo App Store and keep
howiehz-higan-cn.zipfirst in the release asset list so Halo CMS prefers the Simplified Chinese package during update installs.
- Create the GitHub Release and keep
- After the GitHub Release is published, dispatches the follow-up event that triggers
generate-page-size-audit-json.yml, which creates the page-size audit PR. That PR includes thedeploy-docslabel and deploys docs automatically after merge.
Nightly Pre-release Procedure
Nightly pre-releases do not require manual version changes or a manually pushed branch.
release-nightly-theme-prerelease.ymlruns automatically every day at 00:00 Asia/Shanghai.- A Nightly pre-release is created only when all of the following are true:
- There are commits within the previous calendar-day window in Asia/Shanghai.
- There are commits after the latest stable or pre-release tag.
- Commits whose subject starts with
docs:are excluded.
- The Nightly pre-release version rule is “current patch version + 1”, then append
-alpha.yyyyMMddHHmmssSSS. - The workflow creates a temporary local branch in the runner, updates version fields, and builds assets without pushing that branch.
- Before publishing the GitHub pre-release or syncing the Halo App Store, the workflow verifies attestation for every nightly
.zipartifact. - After verification passes, the scheduled nightly run creates only the GitHub pre-release and does not sync to the Halo App Store by default.
To create a Nightly pre-release manually, use workflow_dispatch and set the sync_to_halo_store input to control Halo App Store sync after verification passes; this input defaults to false.
Pull Request Conventions
The following conventions are used to mark or trigger PR automation workflows.
Special Labels
deploy-docs: Automatically deploys the documentation site when merged.release: Triggers the stable release creation process. See the Release Flow section for details.
Special Comments
/audit: Triggers the page resource size diff check, compares the current PR with the latest stable release, and generates a report. Only users withwrite,maintain, oradminaccess can trigger it./visual: Triggers the visual regression check, generates screenshots for the latest PR commit, and uploads them to Argos whenARGOS_TOKENis configured. Only users withwrite,maintain, oradminaccess can trigger it.
How to Add a New Feature with Config Options
Update Form Files
Please update the following configuration form files in sync:
- Simplified Chinese:
settings.yaml - English:
i18n-settings/settings.en.yaml
Update Config Documentation
Please update the following configuration documentation in sync:
- Simplified Chinese:
docs/guide/theme-configuration.md - English:
docs/en/guide/theme-configuration.md
When writing docs, follow the format example at the beginning of the document, and keep the option order consistent with the order in the form files.
Update Changelog
Record your changes in the following changelog files:
- Simplified Chinese:
docs/maintenance/changelog.md - English:
docs/en/maintenance/changelog.md