Skip to content

Add comprehensive CONTRIBUTING.md with gamepad mapping guidelines#81

Merged
lunarcloud merged 3 commits intomainfrom
copilot/add-contributing-md-guidelines
Feb 18, 2026
Merged

Add comprehensive CONTRIBUTING.md with gamepad mapping guidelines#81
lunarcloud merged 3 commits intomainfrom
copilot/add-contributing-md-guidelines

Conversation

Copy link
Contributor

Copilot AI commented Feb 18, 2026

Describe your changes

Expanded CONTRIBUTING.md from basic guidelines to a comprehensive, concise contribution guide. Primary focus: lowering barriers for community gamepad mapping contributions.

New sections:

  • Gamepad Mapping Guide (7-step process): VID/PID extraction, button/axis mapping with links to online gamepad testers, schema selection (Hedgehog/Plumber/Xross), code examples for standard and custom mappings
  • Development Workflow: Streamlined setup verification and typical workflow
  • Testing Protocols: Checklists for gamepad mappings (10 items) and code changes (6 items)
  • Code Style: JSDoc requirements with examples, ESLint/EditorConfig rules
  • PR Process: Submission workflow, commit guidelines, pre-submission checklist
  • Architectural Principles: Design boundaries (zero runtime dependencies, no build transforms, browser-only)

Key additions:

// VID/PID extraction example
const gamepad = navigator.getGamepads()[0]
console.log('ID:', gamepad.id)
// "057e-2009-Nintendo Switch Pro Controller"
//  ^^^^ ^^^^ Name
//  VID  PID

Schema comparison table for button layout selection, custom mapping examples for non-standard controllers, icon directory reference with requirement that icons must be human-created and never AI-generated.

Streamlined content:

  • Simplified fork/clone instructions (developers know how to use GitHub)
  • Removed verbose command reference table (commands are self-evident)
  • Replaced inline HTML test tool with links to existing online gamepad testers (Gamepad Tester, HTML5 Gamepad Tester)
  • Clarified prerequisites: "One or more gamepads" required for development

Describe your testing

N/A - documentation only. Verified markdown structure and section completeness against issue requirements.

Issue ticket number and link

#[handled by system]

Checklist before requesting a review

  • I have performed a self-review of my code
  • The code passes lint checks.
  • The code has been tested for regressions of existing features.
  • I have considered adding unit tests for any new code.
Original prompt

This section details on the original issue you should resolve

<issue_title>Add CONTRIBUTING.md for mapping & testing guidelines</issue_title>
<issue_description>## Feature Request
Add a CONTRIBUTING.md to document the process for adding new gamepad mappings, test protocols, and general contribution expectations.

Why This Matters

The gamepad model database is complex and requires specific information. A contribution guide would:

  • Help community members add new controller mappings
  • Standardize the testing process
  • Reduce back-and-forth in PRs
  • Grow the controller database faster

Proposed Sections

1. Adding a New Gamepad Mapping

## Adding a New Gamepad Mapping

### Information Needed
1. **Vendor ID & Product ID**: Found in browser console
   ```javascript
   const gamepad = navigator.getGamepads()[0]
   console.log(gamepad.id)
   // Example: "057e-2009-Nintendo Switch Pro Controller"
   //          VID  PID   Name
  1. Button Mapping: Test each button and record index
  2. Axis Mapping: Test each stick/trigger and record axis + direction
  3. Schema: Which button layout? (Nintendo/Xbox/PlayStation)
  4. Icon: Which icon represents this gamepad?

Testing Your Mapping

  1. Create a test HTML file
  2. Connect your gamepad
  3. Test all buttons and axes
  4. Verify with multiple browsers if possible

#### 2. Code Style Guidelines
```markdown
## Code Style

- Use JSDoc for all public APIs
- Follow existing naming conventions
- Run `npm run lint` before committing
- Add tests for new features
- Keep PRs focused on single changes

3. Testing Protocol

## Testing Protocol

### For Gamepad Mappings
- [ ] Test all face buttons
- [ ] Test D-pad in all directions
- [ ] Test both analog sticks (including click)
- [ ] Test shoulder buttons
- [ ] Test triggers (analog if applicable)
- [ ] Test center buttons (start/select)
- [ ] Test rumble/vibration if supported

### For Code Changes
- [ ] Add unit tests
- [ ] Run full test suite: `npm test`
- [ ] Test in Chrome and Firefox
- [ ] Update JSDoc if API changed

4. Pull Request Template

## Pull Request Checklist

- [ ] Tests pass locally
- [ ] JSDoc updated (if applicable)
- [ ] CHANGELOG.md updated
- [ ] Follows code style guidelines
- [ ] For gamepad mappings: tested on real hardware

Implementation

Create CONTRIBUTING.md in repository root with:

  • Getting started (fork, clone, install)
  • Development workflow
  • Gamepad mapping contribution guide
  • Code style and conventions
  • Testing requirements
  • PR process
  • Code of conduct reference

This would significantly lower the barrier for community contributions, especially for adding new gamepad models.
</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com>
Copilot AI changed the title [WIP] Add CONTRIBUTING.md for mapping and testing guidelines Add comprehensive CONTRIBUTING.md with gamepad mapping guidelines Feb 18, 2026
Copilot AI requested a review from lunarcloud February 18, 2026 01:18
Co-authored-by: lunarcloud <1565970+lunarcloud@users.noreply.github.com>
Copilot AI requested a review from lunarcloud February 18, 2026 01:29
@lunarcloud lunarcloud marked this pull request as ready for review February 18, 2026 01:35
@lunarcloud lunarcloud merged commit 30a0b03 into main Feb 18, 2026
1 check passed
@lunarcloud lunarcloud deleted the copilot/add-contributing-md-guidelines branch February 18, 2026 01:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add CONTRIBUTING.md for mapping & testing guidelines

2 participants