@codama/renderers-js 1.6.1 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ The `renderVisitor` accepts the following options.
46
46
  | `customInstructionData` | `string[]` | `[]` | The names of all `InstructionNodes` whose data should be manually written in JavaScript. |
47
47
  | `linkOverrides` | `Record<'accounts' \| 'definedTypes' \| 'instructions' \| 'pdas' \| 'programs' \| 'resolvers', Record<string, string>>` | `{}` | A object that overrides the import path of link nodes. For instance, `{ definedTypes: { counter: 'hooked' } }` uses the `hooked` folder to import any link node referring to the `counter` type. |
48
48
  | `dependencyMap` | `Record<string, string>` | `{}` | A mapping between import aliases and their actual package name or path in JavaScript. |
49
- | `dependencyVersions` | `Record<string, string>` | `{}` | A mapping between external package names — e.g. `@solana/kit` — and the version range we should use for them — e.g. `^5.0.0`. The renderer offers default values for all external dependencies it relies on but this option may be used to override some of these values or add new ones. |
49
+ | `dependencyVersions` | `Record<string, string>` | `{}` | A mapping between external package names — e.g. `@solana/kit` — and the version range we should use for them — e.g. `^6.0.0`. The renderer offers default values for all external dependencies it relies on but this option may be used to override some of these values or add new ones. |
50
50
  | `internalNodes` | `string[]` | `[]` | The names of all nodes that should be generated but not exported by the `index.ts` files. |
51
51
  | `nameTransformers` | `Partial<NameTransformers>` | `{}` | An object that enables us to override the names of any generated type, constant or function. |
52
52
  | `nonScalarEnums` | `string[]` | `[]` | The names of enum variants with no data that should be treated as a data union instead of a native `enum` type. This is only useful if you are referencing an enum value in your Codama IDL. |
@@ -477,15 +477,15 @@ function getImportFromFactory(overrides, customAccountData, customInstructionDat
477
477
  };
478
478
  }
479
479
  var DEFAULT_DEPENDENCY_VERSIONS = {
480
- "@solana/accounts": "^5.0.0",
481
- "@solana/addresses": "^5.0.0",
482
- "@solana/codecs": "^5.0.0",
483
- "@solana/errors": "^5.0.0",
484
- "@solana/instructions": "^5.0.0",
485
- "@solana/kit": "^5.0.0",
486
- "@solana/programs": "^5.0.0",
487
- "@solana/rpc-types": "^5.0.0",
488
- "@solana/signers": "^5.0.0"
480
+ "@solana/accounts": "^6.0.0",
481
+ "@solana/addresses": "^6.0.0",
482
+ "@solana/codecs": "^6.0.0",
483
+ "@solana/errors": "^6.0.0",
484
+ "@solana/instructions": "^6.0.0",
485
+ "@solana/kit": "^6.0.0",
486
+ "@solana/programs": "^6.0.0",
487
+ "@solana/rpc-types": "^6.0.0",
488
+ "@solana/signers": "^6.0.0"
489
489
  };
490
490
  async function syncPackageJson(renderMap, formatCode, options) {
491
491
  const shouldSyncPackageJson = options.syncPackageJson ?? false;
@@ -2213,7 +2213,7 @@ function getProgramInstructionsParseFunctionFragment(scope) {
2213
2213
  const instructionType = ${programInstructionsIdentifierFunction}(instruction);
2214
2214
  switch (instructionType) {
2215
2215
  ${switchCases}
2216
- default: throw new Error(\`Unrecognized instruction type: \${instructionType}\`);
2216
+ default: throw new Error(\`Unrecognized instruction type: \${instructionType as string}\`);
2217
2217
  }
2218
2218
  }`;
2219
2219
  }
@@ -3265,9 +3265,6 @@ function renderVisitor(path, options = {}) {
3265
3265
  const formatCode = await getCodeFormatter(options);
3266
3266
  renderMap = await renderersCore.mapRenderMapContentAsync(renderMap, formatCode);
3267
3267
  await syncPackageJson(renderMap, formatCode, options);
3268
- if (options.formatCode ?? true) {
3269
- renderMap = renderersCore.addToRenderMap(renderMap, ".prettierignore", fragment`**\n`);
3270
- }
3271
3268
  renderersCore.writeRenderMap(renderMap, path);
3272
3269
  });
3273
3270
  }