-
Notifications
You must be signed in to change notification settings - Fork 9
Contributing
Thanks for your interest in contributing to FXCommands. This guide covers the development setup, project structure, and contribution workflow.
- Node.js 20+
- Stream Deck 6.9+
- A physical Stream Deck (or the Stream Deck emulator) for testing
git clone https://github.com/josh-tf/fxcommands.git
cd fxcommands
npm installsrc/
plugin.ts # Entry point - registers the action
connection-manager.ts # TCP/CMND protocol handler
actions/
fx-command.ts # Main action logic (state machine, delays)
tf.josh.fxcommands.sdPlugin/
manifest.json # Plugin metadata and configuration
ui/
PluginActionPI.html # Property Inspector UI
PluginActionPI.js # Settings persistence
sdpi.css # Elgato styling
imgs/ # Button icons (various states/DPI)
tools/
fivem-emulator.cjs # Local testing emulator
npm run buildThis runs the full build pipeline:
- Cleans
dist/ - Copies the plugin assets
- Bundles TypeScript via Rollup into
bin/plugin.js - Packages the
.streamDeckPlugininstaller file
Output:
-
dist/tf.josh.fxcommands.sdPlugin/- unpacked plugin -
dist/tf.josh.fxcommands.streamDeckPlugin- installable package
For development, use watch mode to auto-rebuild on changes:
npm run watchRun all checks at once:
npm run checkOr individually:
| Command | What it does |
|---|---|
npm run typecheck |
TypeScript type checking |
npm run lint |
ESLint |
npm run format |
Prettier formatting |
npm run spell |
cspell spell checking |
npm run circular |
Circular dependency detection (madge) |
npm run unused |
Unused dependency/export detection (knip) |
All checks must pass before submitting a PR. The CI pipeline runs npm run check && npm run build on every push.
Since you likely don't want to run FiveM every time you test, the project includes a local emulator that mimics the FiveM console server.
node tools/fivem-emulator.cjsThis starts a TCP server on localhost:29200 that:
- Accepts CMND protocol connections
- Decodes incoming command frames
- Prints received commands with colour-coded output
Use this alongside Stream Deck to test your changes without needing the game running.
- Create a feature branch from
main - Use descriptive branch names:
fix/connection-timeout,feat/custom-port
- TypeScript with strict mode
- Tabs for indentation
- 120 character line width
- Follow existing patterns in the codebase
Use conventional commits:
feat: add custom port configuration
fix: handle connection timeout on slow networks
docs: update delay syntax examples
chore: bump dependencies
- Ensure all checks pass:
npm run check && npm run build - Test your changes with the FiveM emulator or a live game
- Open a PR against
main - Describe what changed and why
Releases are automated via CI. When a version change in package.json is pushed to main:
- CI detects the version bump
- Creates a git tag
- Builds the plugin
- Creates a draft GitHub Release with the
.streamDeckPluginfile attached
Use the release script for version bumps:
npm run release- How It Works - Technical overview of the plugin architecture
- Command Syntax - Feature reference
FXCommands
Developers