VSCode Relay Watcher
Run the relay compiler on save.
By default relay --watch
- requires
watchman to be installed
- runs as a separate command
Watchman is cumbersome to install and frequently throws errors within docker containers.
Install
Install options:
- Download from the marketplace
- Install from the command line:
code --install-extension pinterest.relay-watcher
- Search for
Relay Watcher in the VS Code extensions panel
Features
- Run the relay compiler on save
- Requires no configuration
- Supports multiple package managers:
npm and yarn
- Supports VSCode Remote
- Uses VSCode's internal file watcher instead of
watchman .
Requirements
relay.config.js file(s) in the workspace root or subdirectories.
relay-compiler package should be installed next to each Relay configuration file
Extension Settings
Setting |
Type (default) |
Description |
relayWatcher.enableTelemetry |
boolean (true ) |
Enable/disable telemetry |
relayWatcher.logLevel |
enum: 'info', 'debug', 'off' ('info' ) |
Output log level |
relayWatcher.showOutputOnError |
boolean (true ) |
Show output log when relay compiler throws an error |
Extension Commands
Setting |
Description |
relayWatcher.enable |
Enable the extension |
relayWatcher.disable |
Disable the extension |
relayWatcher.showOutputChannel |
Show the output channel |
Release Notes
See CHANGELOG.md
Publish
Publish a new version:
- Update
CHANGELOG.md and add a new version
- Publish with
vsce
npm i -g vsce
vsce publish patch
FAQ
How does the extension work?
- Activate if there are 1 or multiple
relay.config.js file(s) within the workspace.
- For each of the configuration files:
- Check if
relay-compiler is installed (if not, the configuration file gets ignored)
- Check which package manager is installed by searching for a
yarn.lock
- Find the
src , source directory
Potential Improvements
- Use
relay-config to support relay.config.json and package.json configurations (legacy)
Inspired by
| |