codama.mjs 648 B

1234567891011121314151617181920212223242526272829
  1. import path from 'node:path';
  2. import fs from 'node:fs';
  3. const prettierOptions = JSON.parse(
  4. fs.readFileSync(path.join('clients', 'js', '.prettierrc.json'), 'utf-8')
  5. );
  6. export default {
  7. idl: 'program/idl.json',
  8. before: [],
  9. scripts: {
  10. js: {
  11. from: '@codama/renderers-js',
  12. args: ['clients/js/src/generated', { prettierOptions }],
  13. },
  14. rust: {
  15. from: '@codama/renderers-rust',
  16. args: [
  17. 'clients/rust/src/generated',
  18. {
  19. anchorTraits: false,
  20. crateFolder: 'clients/rust',
  21. formatCode: true,
  22. toolchain: '+nightly-2025-02-16',
  23. },
  24. ],
  25. },
  26. },
  27. };