From 32f4d9ec27eb9387a8a38e4b734c5785623339ab Mon Sep 17 00:00:00 2001 From: Loris Leiva Date: Thu, 10 Oct 2024 11:25:39 +0100 Subject: [PATCH] Use Codama v1.0.0 (#17) See https://github.com/codama-idl/codama/pull/234 --- clients/js/src/generated/index.ts | 6 +- .../js/src/generated/instructions/addMemo.ts | 6 +- .../js/src/generated/instructions/index.ts | 6 +- clients/js/src/generated/programs/index.ts | 6 +- clients/js/src/generated/programs/memo.ts | 6 +- clients/js/src/generated/shared/index.ts | 6 +- clients/rust/src/generated/errors/mod.rs | 6 +- .../src/generated/instructions/add_memo.rs | 8 +- .../rust/src/generated/instructions/mod.rs | 6 +- clients/rust/src/generated/mod.rs | 6 +- clients/rust/src/generated/programs.rs | 6 +- package.json | 6 +- pnpm-lock.yaml | 160 +++++++++--------- program/idl.json | 4 +- scripts/client/lint-rust.mjs | 2 +- scripts/generate-clients.mjs | 30 ++-- 16 files changed, 135 insertions(+), 135 deletions(-) diff --git a/clients/js/src/generated/index.ts b/clients/js/src/generated/index.ts index d5f88383..d69c576a 100644 --- a/clients/js/src/generated/index.ts +++ b/clients/js/src/generated/index.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ export * from './instructions'; diff --git a/clients/js/src/generated/instructions/addMemo.ts b/clients/js/src/generated/instructions/addMemo.ts index bed2066d..90b3ea79 100644 --- a/clients/js/src/generated/instructions/addMemo.ts +++ b/clients/js/src/generated/instructions/addMemo.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ import { diff --git a/clients/js/src/generated/instructions/index.ts b/clients/js/src/generated/instructions/index.ts index aa3b7440..93ef37ec 100644 --- a/clients/js/src/generated/instructions/index.ts +++ b/clients/js/src/generated/instructions/index.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ export * from './addMemo'; diff --git a/clients/js/src/generated/programs/index.ts b/clients/js/src/generated/programs/index.ts index 40709049..673beb89 100644 --- a/clients/js/src/generated/programs/index.ts +++ b/clients/js/src/generated/programs/index.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ export * from './memo'; diff --git a/clients/js/src/generated/programs/memo.ts b/clients/js/src/generated/programs/memo.ts index 34d61a81..c7583ab9 100644 --- a/clients/js/src/generated/programs/memo.ts +++ b/clients/js/src/generated/programs/memo.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ import { type Address } from '@solana/web3.js'; diff --git a/clients/js/src/generated/shared/index.ts b/clients/js/src/generated/shared/index.ts index 278bf59f..01a7d938 100644 --- a/clients/js/src/generated/shared/index.ts +++ b/clients/js/src/generated/shared/index.ts @@ -1,9 +1,9 @@ /** - * This code was AUTOGENERATED using the kinobi library. + * This code was AUTOGENERATED using the codama library. * Please DO NOT EDIT THIS FILE, instead use visitors - * to add features, then rerun kinobi to update it. + * to add features, then rerun codama to update it. * - * @see https://github.com/kinobi-so/kinobi + * @see https://github.com/codama-idl/codama */ import { diff --git a/clients/rust/src/generated/errors/mod.rs b/clients/rust/src/generated/errors/mod.rs index f5f0ca11..6172ba60 100644 --- a/clients/rust/src/generated/errors/mod.rs +++ b/clients/rust/src/generated/errors/mod.rs @@ -1,6 +1,6 @@ -//! This code was AUTOGENERATED using the kinobi library. +//! This code was AUTOGENERATED using the codama library. //! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. +//! to add features, then rerun codama to update it. //! -//! +//! //! diff --git a/clients/rust/src/generated/instructions/add_memo.rs b/clients/rust/src/generated/instructions/add_memo.rs index b05ad43f..4b51a0aa 100644 --- a/clients/rust/src/generated/instructions/add_memo.rs +++ b/clients/rust/src/generated/instructions/add_memo.rs @@ -1,8 +1,8 @@ -//! This code was AUTOGENERATED using the kinobi library. +//! This code was AUTOGENERATED using the codama library. //! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. +//! to add features, then rerun codama to update it. //! -//! +//! //! use borsh::BorshDeserialize; @@ -79,7 +79,7 @@ impl AddMemoBuilder { self.memo = Some(memo); self } - /// Add an aditional account to the instruction. + /// Add an additional account to the instruction. #[inline(always)] pub fn add_remaining_account( &mut self, diff --git a/clients/rust/src/generated/instructions/mod.rs b/clients/rust/src/generated/instructions/mod.rs index 6c14f66d..c1c3f179 100644 --- a/clients/rust/src/generated/instructions/mod.rs +++ b/clients/rust/src/generated/instructions/mod.rs @@ -1,8 +1,8 @@ -//! This code was AUTOGENERATED using the kinobi library. +//! This code was AUTOGENERATED using the codama library. //! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. +//! to add features, then rerun codama to update it. //! -//! +//! //! pub(crate) mod r#add_memo; diff --git a/clients/rust/src/generated/mod.rs b/clients/rust/src/generated/mod.rs index 50d52c49..9c64a4b9 100644 --- a/clients/rust/src/generated/mod.rs +++ b/clients/rust/src/generated/mod.rs @@ -1,8 +1,8 @@ -//! This code was AUTOGENERATED using the kinobi library. +//! This code was AUTOGENERATED using the codama library. //! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. +//! to add features, then rerun codama to update it. //! -//! +//! //! pub mod errors; diff --git a/clients/rust/src/generated/programs.rs b/clients/rust/src/generated/programs.rs index da589204..0c1ecc52 100644 --- a/clients/rust/src/generated/programs.rs +++ b/clients/rust/src/generated/programs.rs @@ -1,8 +1,8 @@ -//! This code was AUTOGENERATED using the kinobi library. +//! This code was AUTOGENERATED using the codama library. //! Please DO NOT EDIT THIS FILE, instead use visitors -//! to add features, then rerun kinobi to update it. +//! to add features, then rerun codama to update it. //! -//! +//! //! use solana_program::{pubkey, pubkey::Pubkey}; diff --git a/package.json b/package.json index f804b5d0..abdfaaf5 100644 --- a/package.json +++ b/package.json @@ -20,9 +20,9 @@ }, "devDependencies": { "@iarna/toml": "^2.2.5", - "@kinobi-so/renderers-js": "^0.21.9", - "@kinobi-so/renderers-rust": "^0.21.7", - "kinobi": "^0.21.5", + "@codama/renderers-js": "^1.0.0", + "@codama/renderers-rust": "^1.0.0", + "codama": "^1.0.0", "typescript": "^5.5.2", "zx": "^7.2.3" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ee38a611..38982513 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,18 +8,18 @@ importers: .: devDependencies: + '@codama/renderers-js': + specifier: ^1.0.0 + version: 1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) + '@codama/renderers-rust': + specifier: ^1.0.0 + version: 1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) '@iarna/toml': specifier: ^2.2.5 version: 2.2.5 - '@kinobi-so/renderers-js': - specifier: ^0.21.9 - version: 0.21.9(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) - '@kinobi-so/renderers-rust': - specifier: ^0.21.7 - version: 0.21.7(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) - kinobi: - specifier: ^0.21.5 - version: 0.21.5 + codama: + specifier: ^1.0.0 + version: 1.0.0 typescript: specifier: ^5.5.2 version: 5.5.3 @@ -29,39 +29,39 @@ importers: packages: - '@iarna/toml@2.2.5': - resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} - - '@kinobi-so/errors@0.21.5': - resolution: {integrity: sha512-IqPMOe0qbmuBI8vux9HU+tvx+SaCVk32g5GnRvYxJh6OmpYOEuJRg02nT2XtYPeYWB2IFKJ1X2AnwTbEz9Vx8Q==} + '@codama/errors@1.0.0': + resolution: {integrity: sha512-XSdkNbCNJukhKO5TFJ5cFP7TfddxZwqHV7N/XyMbZ0meVPN1ymT94/d/9b8R+bvKuflj/SXImv527tGZWz6pGA==} hasBin: true - '@kinobi-so/node-types@0.21.5': - resolution: {integrity: sha512-OKpk08+nTsO25xSZBT+PXpjx2FOHfn7jr0CbnQZ+ulfRa+dr3eSf7zSn+0ipKjG+FFWUUGpizgSkgpTQMjAqLA==} + '@codama/node-types@1.0.0': + resolution: {integrity: sha512-UAc+0jprwHFOqtAPqqA//PkrnlUzuqs+N5E36bHhLV0m5qWMlqrfmPg/ffBwMYFJsLFWsRsisALrqPy7ARkUow==} + + '@codama/nodes-from-anchor@1.0.0': + resolution: {integrity: sha512-urqFOV5K1oKBptgIFFLCPWrUsEeZsonml12ieP26ozX12aglGlN0tsxNsCvxJulRIjUxuONbH6xzv7uKt0xSYQ==} - '@kinobi-so/nodes-from-anchor@0.21.3': - resolution: {integrity: sha512-mar3UeJNx61k77NhucqYIwUXZvC0b6mhLYFksQY0Wz+gCFTWLr8exxB7KmgSycT+XuFNOydpYnEOeMa5lUywBQ==} + '@codama/nodes@1.0.0': + resolution: {integrity: sha512-btcnjDaOpEFvVq3uVzlQK4G2OxxyK3P9HkXw423GZaqYQzeSr1pDdTKjyVyg+QO578CGqIMySVlJ2UAdHVMytw==} - '@kinobi-so/nodes@0.21.5': - resolution: {integrity: sha512-6iu9/GXrVs14olVeUAAw73BK2js7RGefVGHBDF6PKcvw6i0DlxhPkZiNOSpzweaeTmZsowHO7xEJKov0446fbQ==} + '@codama/renderers-core@1.0.0': + resolution: {integrity: sha512-WYvOylIzcR0WOc7GlUvGi5ym8IwmslwyV8zfj7FR646bMqaROirFJc+naGEbZ1lMykOyxcackTKL0eDB7954Qw==} - '@kinobi-so/renderers-core@0.21.3': - resolution: {integrity: sha512-Ow1x0IaRmUlqQUAFTQZpq56wpkB6YKdnpNmfjM8IS/ssgz2IG5Jw3LREvNLvdXwpp/eyjSYOsux2RDFJkERl0g==} + '@codama/renderers-js@1.0.0': + resolution: {integrity: sha512-wi9eqrtLbTM49ELqKqxIgbTaf7xKMWT+HIqj6GN373G0OJnSKwUJPIXAGLO+RCls5DGjDuOE5svuThU0zBkfzA==} - '@kinobi-so/renderers-js@0.21.9': - resolution: {integrity: sha512-ZwN3UIYGZHu1V9TYsCPolVPdScR71r4PrLVVLsxixIxPBhdTMIgUbXK4OqHkzxaR5kn8Ssrvuq6+V2f7XFbVSg==} + '@codama/renderers-rust@1.0.0': + resolution: {integrity: sha512-2z+XN6KCTQFDfE30OQcRo2LW4+9dnYlqs8rSUhKO2YsRiCnOoMu/zrNSqLtjL84T2PAwReRq+vBifcE0zaOuRw==} - '@kinobi-so/renderers-rust@0.21.7': - resolution: {integrity: sha512-SXiUG1C/qL21F3bIeDzFmgLDtVXA53+2BDFaVEOx1tE7W7kcd4TkQGYvNw8o7EHNaa2S9paQB9KjQFyV+DsmqQ==} + '@codama/validators@1.0.0': + resolution: {integrity: sha512-jSfU5IrcGTvcqsJSBSzD3Ochig+hKKg2NKsT/vUfQ4jAw2cQrVUP5f4dMXyX779JYfHLHCwZnBYvgEdgi9gBZQ==} - '@kinobi-so/validators@0.21.5': - resolution: {integrity: sha512-JYZWHgma1TrnjhiUJn5/oYS9XfeirUBhwpuTPDRmRrSiHHv329gjWimzZO2uLAm5S5PgFyhLTz+S6jjxRsdNXg==} + '@codama/visitors-core@1.0.0': + resolution: {integrity: sha512-tDIfURVPf7ZokCFLOpKL6Au0ORiza1sPT4zmRSEjCC7iZp0Vb5K5FrdtUL13Wb+6jNM191e5GUFOmULRoavWug==} - '@kinobi-so/visitors-core@0.21.5': - resolution: {integrity: sha512-qNq9CcDh1P/A0BRR7zEdRpzeWL6ObAowMNWpkxZTT2BKqejK9oKWSh2/gzg6ehcn2Fn/J5DE8bnKZfAlEww95g==} + '@codama/visitors@1.0.0': + resolution: {integrity: sha512-JncE6wRJLxt0imlj+loGH6dLPEMK7ozlv9YjWgCQgUYUI7is66OFwhWP5SFO0iEFlVjtOzZLXVQwoe9LSDz8Gg==} - '@kinobi-so/visitors@0.21.5': - resolution: {integrity: sha512-RCJFaN1Q1f/MQW6PP3Oz0fgNXFVmfUEyErMzPM9CjBi1j2BJzTjff7IzEjbTpG7SbDY91eEyTDcl430ygcDBkA==} + '@iarna/toml@2.2.5': + resolution: {integrity: sha512-trnsAYxU3xnS1gPHPyU961coFyLkh4gAD/0zQ5mymY4yOZ+CYvsPqUbOFSw0aDM4y0tV7tiFxL/1XfXPNC6IPg==} '@noble/hashes@1.5.0': resolution: {integrity: sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==} @@ -137,6 +137,9 @@ packages: resolution: {integrity: sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==} engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + codama@1.0.0: + resolution: {integrity: sha512-ttJ9n2THpqTD8fP8reec+Y2j4ZTBuonDJk8SiKuS6enZBXd67JF3b+GFKM2S5a0xtxN5Evof5aBlY3JyC+jujQ==} + commander@12.1.0: resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==} engines: {node: '>=18'} @@ -272,9 +275,6 @@ packages: jsonify@0.0.1: resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} - kinobi@0.21.5: - resolution: {integrity: sha512-1xgN00od8x4tokR1Xuqv5Gbg0Iqo9bzrEvA9o2rm63vXqoW7/C+TN1voPhj1SQE4h2VmpfM3MD1clTUvJK0J2g==} - map-stream@0.1.0: resolution: {integrity: sha512-CkYQrPYZfWnu/DAmVCpTSX/xHpKZ80eKh2lAkyA6AJTef6bW+6JpbQZN5rofum7da+SyN1bi5ctTm+lTfcCW3g==} @@ -400,41 +400,39 @@ packages: snapshots: - '@iarna/toml@2.2.5': {} - - '@kinobi-so/errors@0.21.5': + '@codama/errors@1.0.0': dependencies: - '@kinobi-so/node-types': 0.21.5 + '@codama/node-types': 1.0.0 chalk: 5.3.0 commander: 12.1.0 - '@kinobi-so/node-types@0.21.5': {} + '@codama/node-types@1.0.0': {} - '@kinobi-so/nodes-from-anchor@0.21.3': + '@codama/nodes-from-anchor@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/visitors': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/visitors': 1.0.0 '@noble/hashes': 1.5.0 - '@kinobi-so/nodes@0.21.5': + '@codama/nodes@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/node-types': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/node-types': 1.0.0 - '@kinobi-so/renderers-core@0.21.3': + '@codama/renderers-core@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/visitors-core': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/visitors-core': 1.0.0 - '@kinobi-so/renderers-js@0.21.9(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': + '@codama/renderers-js@1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/nodes-from-anchor': 0.21.3 - '@kinobi-so/renderers-core': 0.21.3 - '@kinobi-so/visitors-core': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/nodes-from-anchor': 1.0.0 + '@codama/renderers-core': 1.0.0 + '@codama/visitors-core': 1.0.0 '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) nunjucks: 3.2.4 prettier: 3.3.3 @@ -443,12 +441,12 @@ snapshots: - fastestsmallesttextencoderdecoder - typescript - '@kinobi-so/renderers-rust@0.21.7(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': + '@codama/renderers-rust@1.0.0(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3)': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/renderers-core': 0.21.3 - '@kinobi-so/visitors-core': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/renderers-core': 1.0.0 + '@codama/visitors-core': 1.0.0 '@solana/codecs-strings': 2.0.0-rc.1(fastestsmallesttextencoderdecoder@1.0.22)(typescript@5.5.3) nunjucks: 3.2.4 transitivePeerDependencies: @@ -456,23 +454,25 @@ snapshots: - fastestsmallesttextencoderdecoder - typescript - '@kinobi-so/validators@0.21.5': + '@codama/validators@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/visitors-core': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/visitors-core': 1.0.0 - '@kinobi-so/visitors-core@0.21.5': + '@codama/visitors-core@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 json-stable-stringify: 1.1.1 - '@kinobi-so/visitors@0.21.5': + '@codama/visitors@1.0.0': dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/visitors-core': 0.21.5 + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/visitors-core': 1.0.0 + + '@iarna/toml@2.2.5': {} '@noble/hashes@1.5.0': {} @@ -550,6 +550,13 @@ snapshots: chalk@5.3.0: {} + codama@1.0.0: + dependencies: + '@codama/errors': 1.0.0 + '@codama/nodes': 1.0.0 + '@codama/validators': 1.0.0 + '@codama/visitors': 1.0.0 + commander@12.1.0: {} commander@5.1.0: {} @@ -690,13 +697,6 @@ snapshots: jsonify@0.0.1: {} - kinobi@0.21.5: - dependencies: - '@kinobi-so/errors': 0.21.5 - '@kinobi-so/nodes': 0.21.5 - '@kinobi-so/validators': 0.21.5 - '@kinobi-so/visitors': 0.21.5 - map-stream@0.1.0: {} merge2@1.4.1: {} diff --git a/program/idl.json b/program/idl.json index 43ec1257..6bef7b2c 100644 --- a/program/idl.json +++ b/program/idl.json @@ -39,6 +39,6 @@ "origin": "shank" }, "additionalPrograms": [], - "standard": "kinobi", - "version": "0.19.0" + "standard": "codama", + "version": "1.0.0" } diff --git a/scripts/client/lint-rust.mjs b/scripts/client/lint-rust.mjs index 4cb46bf2..0b4a4e6c 100644 --- a/scripts/client/lint-rust.mjs +++ b/scripts/client/lint-rust.mjs @@ -12,7 +12,7 @@ import { const lintArgs = cliArguments(); const fix = popArgument(lintArgs, '--fix'); -const toolchain = getToolchainArgument('format'); +const toolchain = getToolchainArgument('lint'); const manifestPath = path.join( workingDirectory, 'clients', diff --git a/scripts/generate-clients.mjs b/scripts/generate-clients.mjs index 151c4e3d..95dac89a 100644 --- a/scripts/generate-clients.mjs +++ b/scripts/generate-clients.mjs @@ -1,27 +1,27 @@ #!/usr/bin/env zx -import "zx/globals"; -import { createFromRoot } from "kinobi"; -import { renderVisitor as renderJavaScriptVisitor } from "@kinobi-so/renderers-js"; -import { renderVisitor as renderRustVisitor } from "@kinobi-so/renderers-rust"; -import { workingDirectory } from "./utils.mjs"; +import 'zx/globals'; +import { createFromRoot } from 'codama'; +import { renderVisitor as renderJavaScriptVisitor } from '@codama/renderers-js'; +import { renderVisitor as renderRustVisitor } from '@codama/renderers-rust'; +import { workingDirectory } from './utils.mjs'; -// Instanciate Kinobi. -const kinobi = createFromRoot( - require(path.join(workingDirectory, "program", "idl.json")) +// Instanciate Codama. +const codama = createFromRoot( + require(path.join(workingDirectory, 'program', 'idl.json')) ); // Render JavaScript. -const jsClient = path.join(__dirname, "..", "clients", "js"); -kinobi.accept( - renderJavaScriptVisitor(path.join(jsClient, "src", "generated"), { - prettier: require(path.join(jsClient, ".prettierrc.json")), +const jsClient = path.join(__dirname, '..', 'clients', 'js'); +codama.accept( + renderJavaScriptVisitor(path.join(jsClient, 'src', 'generated'), { + prettier: require(path.join(jsClient, '.prettierrc.json')), }) ); // Render Rust. -const rustClient = path.join(__dirname, "..", "clients", "rust"); -kinobi.accept( - renderRustVisitor(path.join(rustClient, "src", "generated"), { +const rustClient = path.join(__dirname, '..', 'clients', 'rust'); +codama.accept( + renderRustVisitor(path.join(rustClient, 'src', 'generated'), { formatCode: true, crateFolder: rustClient, })