GraphQL Unused VS Code Extension
This extension reuses the graphql-unused CLI and publishes unused GraphQL operations and fragments as VS Code diagnostics.
Development
Install dependencies:
npm install
Compile:
npm run compile
Bundle the local CLI into the extension workspace:
npm run bundle-cli
Bundle all currently supported packaged CLI payloads into the extension workspace:
npm run bundle-cli:all
Create a .vsix package:
npm run package:vsix
Run tests:
npm test
Install the VSIX locally
After packaging, install the generated .vsix in VS Code:
- Open Extensions
- Click the
... menu
- Choose
Install from VSIX...
- Select the generated
graphql-unused-vscode-<version>.vsix
Release workflow
Current packaging flow:
npm install
npm run compile
npm run bundle-cli:all
npm run package:vsix
- Upload the generated
.vsix to a GitHub release or distribute it directly
Notes:
- the packaged extension currently bundles
darwin-arm64, darwin-x64, and linux-x64
- unsupported platforms can still use
graphqlUnused.cliPath
- the extension can still fall back to
graphqlUnused.cliPath or a local development CLI build at runtime
Runtime
The extension resolves the CLI in this order:
graphqlUnused.cliPath
- bundled executable under
bundled-cli/<platform>/bin/
- local development build from
../build/install/graphql-unused/bin/
| |