Migrate JS CLI to Kit plugins#62
Merged
Merged
Conversation
This PR rebuilds the `clients/js` CLI on top of the Kit plugin client model introduced in the previous PR. `getClient` is now a flat `.use(...)` chain composing the standard `payer`/`identity`/`solanaRpc`/`programMetadataProgram` plugins together with two small CLI-local plugins (`cliConfigs` and `cliRunOrExport`), replacing the bespoke shim layer in `cli/utils.ts` and the `createDefaultTransactionPlannerAndExecutor` / `getPdaDetails` helpers that lived in `internals.ts`. Commands now consume `client.identity` (instead of a CLI-only `client.authority` alias) and call `client.runOrExport(...)` with an `InstructionPlanInput` directly, using `client.programMetadata.instructions.*` wrappers for single-instruction commands and the building-block `getXMetadataInstructionPlan` functions for the one-shots so the `--export` flow can plan-then-branch. The ad-hoc compute-unit-limit stripping helper used during export is replaced with the version-agnostic `setTransactionMessageComputeUnitLimit(undefined, m)` from `@solana/kit`. No public-surface changes: all CLI options, commands, and behaviors are identical.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR rebuilds the
clients/jsCLI on top of the Kit plugin client model introduced in the previous PR.getClientis now a flat.use(...)chain composing the standardpayer/identity/solanaRpc/programMetadataProgramplugins together with two small CLI-local plugins (cliConfigsandcliRunOrExport), replacing the bespoke shim layer incli/utils.tsand thecreateDefaultTransactionPlannerAndExecutor/getPdaDetailshelpers that lived ininternals.ts. Commands now consumeclient.identity(instead of a CLI-onlyclient.authorityalias) and callclient.runOrExport(...)with anInstructionPlanInputdirectly, usingclient.programMetadata.instructions.*wrappers for single-instruction commands and the building-blockgetXMetadataInstructionPlanfunctions for the one-shots so the--exportflow can plan-then-branch. The ad-hoc compute-unit-limit stripping helper used during export is replaced with the version-agnosticsetTransactionMessageComputeUnitLimit(undefined, m)from@solana/kit. No public-surface changes: all CLI options, commands, and behaviors are identical.