Major Changes
-
#114
9ac7e22Thanks @lorisleiva! - Remove the generatedshared.tsfile from the output. Helper types and functions such asResolvedAccount,InstructionWithByteDelta, andgetAccountMetaFactoryare now imported from@solana/kit/program-client-core.BREAKING CHANGES
- The
sharedfolder is no longer generated. Any imports fromgenerated/sharedshould be updated to import from@solana/kit/program-client-core. - The
getAccountMetaFactoryfunction now requires the account name as the first argument. - The
ResolvedAccounttype has been replaced withResolvedInstructionAccount. - The
expectSomefunction has been replaced withgetNonNullResolvedInstructionInput. - The
expectAddressfunction has been replaced withgetAddressFromResolvedInstructionAccount. - The
expectTransactionSignerfunction has been replaced withgetResolvedInstructionAccountAsTransactionSigner. - The
expectProgramDerivedAddressfunction has been replaced withgetResolvedInstructionAccountAsProgramDerivedAddress.
- The
-
#117
b9d76cdThanks @lorisleiva! - Replace theuseGranularImportsboolean option with a newkitImportStrategyoption that accepts'granular','preferRoot'(default), or'rootOnly'. This provides finer control over how generated code imports from@solana/kitversus granular packages like@solana/addressesor@solana/codecs-strings. The new'preferRoot'default imports from@solana/kitwhen possible but falls back to granular packages for symbols not exported from the root entrypoint. The'rootOnly'strategy exclusively uses@solana/kit(including subpath exports like@solana/kit/program-client-core).BREAKING CHANGES
- The
useGranularImportsoption has been removed. UsekitImportStrategy: 'granular'instead ofuseGranularImports: true, andkitImportStrategy: 'rootOnly'instead ofuseGranularImports: false. - The default import behavior has changed from resolving everything to
@solana/kitto'preferRoot', which falls back to granular packages for symbols not available on the root@solana/kitentrypoint (e.g.@solana/program-client-core).
- The
-
#118
4902cfeThanks @lorisleiva! - RefactorrenderVisitorto acceptpackageFolderas its primary argument instead of the generated output path. The generated folder is now derived from the package folder using the newgeneratedFolderoption (defaults to'src/generated'). ThesyncPackageJsonoption now defaults totrueand no longer requires a separatepackageFolderoption.BREAKING CHANGES
renderVisitorfirst argument changed. The first argument is now the package folder (wherepackage.jsonlives) instead of the direct path to the generated output directory.- const visitor = renderVisitor('clients/js/src/generated', { packageFolder: 'clients/js' }); + const visitor = renderVisitor('clients/js');
packageFolderoption removed. It is no longer needed since the package folder is now the primary argument.syncPackageJsonnow defaults totrue. Previously it defaulted tofalseand requiredpackageFolderto be set.- renderVisitor('clients/js/src/generated', { packageFolder: 'clients/js', syncPackageJson: true }); + renderVisitor('clients/js');
New
generatedFolderoption. If your generated folder is not atsrc/generatedrelative to the package folder, use the newgeneratedFolderoption.- renderVisitor('clients/js/custom/output'); + renderVisitor('clients/js', { generatedFolder: 'custom/output' });
Minor Changes
-
#116
a25e18cThanks @lorisleiva! - Generate Kit plugins for each program. The generated plugin function composes with a client object, adding typedaccountsandinstructionsnamespaces. Account entries include codec and self-fetch functions, while instruction entries include self-plan and self-send functions. -
#115
4b8bf27Thanks @lorisleiva! - UseSolanaErrorfor generated errors. Generated program clients now throwSolanaErrorwith specific error codes instead of genericErrorobjects. This provides better error handling with structured context including the program name and relevant data.
Patch Changes
- #113
0b83e13Thanks @lorisleiva! - Add support for subpath exports inImportMap. ThegetExternalDependenciesfunction now correctly handles subpath exports (e.g.@solana/kit/program-client-core) by extracting the root package name when checking dependencies.