Skip to content

Commit e9d56c9

Browse files
authored
Rename Kinobi to Codama (#234)
1 parent 19dc8a9 commit e9d56c9

File tree

722 files changed

+3878
-3927
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

722 files changed

+3878
-3927
lines changed

.changeset/config.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
33
"changelog": [
44
"@changesets/changelog-github",
5-
{ "repo": "kinobi-so/kinobi" }
5+
{ "repo": "codama-idl/codama" }
66
],
77
"commit": false,
88
"fixed": [
99
[
10-
"kinobi",
11-
"@kinobi-so/errors",
12-
"@kinobi-so/node-types",
13-
"@kinobi-so/nodes",
14-
"@kinobi-so/validators",
15-
"@kinobi-so/visitors*"
10+
"codama",
11+
"@codama/errors",
12+
"@codama/node-types",
13+
"@codama/nodes",
14+
"@codama/validators",
15+
"@codama/visitors*"
1616
]
1717
],
1818
"linked": [],
19-
"ignore": ["@kinobi-so/internals"],
19+
"ignore": ["@codama/internals"],
2020
"access": "public",
2121
"baseBranch": "main",
2222
"privatePackages": {

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ env:
99
# Among other things, opts out of Turborepo telemetry. See https://consoledonottrack.com/.
1010
DO_NOT_TRACK: '1'
1111
NODE_VERSION: 18
12-
KINOBI_VERSION: 0.22
12+
CODAMA_VERSION: 0.22
1313
SOLANA_VERSION: 1.18.12
1414

1515
jobs:
@@ -95,8 +95,8 @@ jobs:
9595
id: changesets
9696
uses: changesets/action@v1
9797
with:
98-
commit: '[${{ env.KINOBI_VERSION }}] Publish packages'
99-
title: '[${{ env.KINOBI_VERSION }}] Publish packages'
98+
commit: '[${{ env.CODAMA_VERSION }}] Publish packages'
99+
title: '[${{ env.CODAMA_VERSION }}] Publish packages'
100100
publish: pnpm publish-packages
101101
env:
102102
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Kinobi
3+
Copyright (c) 2024 Codama
44
Copyright (c) 2024 Metaplex Foundation
55

66
Permission is hereby granted, free of charge, to any person obtaining

README.md

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,79 @@
1-
# Kinobi
1+
# Codama
22

33
[![npm][npm-image]][npm-url]
44
[![npm-downloads][npm-downloads-image]][npm-url]
55
[![ci][ci-image]][ci-url]
66

7-
[npm-downloads-image]: https://img.shields.io/npm/dm/kinobi.svg?style=flat
8-
[npm-image]: https://img.shields.io/npm/v/kinobi.svg?style=flat
9-
[npm-url]: https://www.npmjs.com/package/kinobi
10-
[ci-image]: https://img.shields.io/github/actions/workflow/status/kinobi-so/kinobi/main.yml?logo=GitHub
11-
[ci-url]: https://github.com/kinobi-so/kinobi/actions/workflows/main.yml
7+
[npm-downloads-image]: https://img.shields.io/npm/dm/codama.svg?style=flat
8+
[npm-image]: https://img.shields.io/npm/v/codama.svg?style=flat
9+
[npm-url]: https://www.npmjs.com/package/codama
10+
[ci-image]: https://img.shields.io/github/actions/workflow/status/codama-idl/codama/main.yml?logo=GitHub
11+
[ci-url]: https://github.com/codama-idl/codama/actions/workflows/main.yml
1212

13-
Kinobi is a tool that describes any Solana program in a powerful standardised format known as the Kinobi IDL. This IDL can then be used to create a variety of utility such as rendering client code for your programs in various languages/frameworks, generating CLIs and providing more information to explorers.
13+
Codama is a tool that describes any Solana program in a powerful standardised format known as the Codama IDL. This IDL can then be used to create a variety of utility such as rendering client code for your programs in various languages/frameworks, generating CLIs and providing more information to explorers.
1414

15-
![Kinobi header: A small double-sided mind-map with the Kinobi logo in the middle. On the left, we see the various ways to get a Kinobi IDL from your Solana programs such as "Anchor Program" and "Shank macros". On the right, we see the various utility tools that are offered for the IDL such as "Rendering client code" or "Rendering documentation".](https://github.com/kinobi-so/kinobi/assets/3642397/11161fb6-1ef4-446d-bf73-ce04484519a0)
15+
![Codama header: A small double-sided mind-map with the Codama logo in the middle. On the left, we see the various ways to get a Codama IDL from your Solana programs such as "Anchor Program" and "Shank macros". On the right, we see the various utility tools that are offered for the IDL such as "Rendering client code" or "Rendering documentation".](https://github.com/codama-idl/codama/assets/3642397/11161fb6-1ef4-446d-bf73-ce04484519a0)
1616

1717
## Nodes and visitors
1818

19-
The Kinobi IDL is designed as a tree of nodes starting with the `RootNode` which contains a `ProgramNode` and additional data such as the Kinobi version used when the IDL was created. Kinobi provides over 60 different types of nodes that help describe just about any aspect of your Solana programs. [You can read more about the Kinobi nodes here](./packages/nodes).
19+
The Codama IDL is designed as a tree of nodes starting with the `RootNode` which contains a `ProgramNode` and additional data such as the Codama version used when the IDL was created. Codama provides over 60 different types of nodes that help describe just about any aspect of your Solana programs. [You can read more about the Codama nodes here](./packages/nodes).
2020

21-
![A small example of a Kinobi IDL as a tree of nodes. It starts with a RootNode and goes down to ProgramNode, AccountNode, InstructionNode, etc.](https://github.com/kinobi-so/kinobi/assets/3642397/9d53485d-a4f6-459a-b7eb-58faab716bc1)
21+
![A small example of a Codama IDL as a tree of nodes. It starts with a RootNode and goes down to ProgramNode, AccountNode, InstructionNode, etc.](https://github.com/codama-idl/codama/assets/3642397/9d53485d-a4f6-459a-b7eb-58faab716bc1)
2222

23-
Because everything is designed as a `Node`, we can transform the IDL, aggregate information and output various utility tools using special objects that can traverse node trees known as visitors. [See this documentation to learn more about Kinobi visitors](./packages/visitors).
23+
Because everything is designed as a `Node`, we can transform the IDL, aggregate information and output various utility tools using special objects that can traverse node trees known as visitors. [See this documentation to learn more about Codama visitors](./packages/visitors).
2424

25-
![A small example of how a visitor can transform a Kinobi IDL into another Kinobi IDL. This example illustrates the "deleteNodesVisitor" which recursively removes NumberTypeNodes from a tree of nested TypleTypeNodes.](https://github.com/kinobi-so/kinobi/assets/3642397/f54e83d1-eade-4674-80dc-7ddc360f5f66)
25+
![A small example of how a visitor can transform a Codama IDL into another Codama IDL. This example illustrates the "deleteNodesVisitor" which recursively removes NumberTypeNodes from a tree of nested TypleTypeNodes.](https://github.com/codama-idl/codama/assets/3642397/f54e83d1-eade-4674-80dc-7ddc360f5f66)
2626

27-
## From program to Kinobi
27+
## From program to Codama
2828

29-
There are various ways to extract information from your Solana programs in order to obtain a Kinobi IDL.
29+
There are various ways to extract information from your Solana programs in order to obtain a Codama IDL.
3030

31-
- **Using Kinobi macros**. This is not yet available but you will soon have access to a set of Rust macros that help attach IDL information directly within your Rust code. These macros enable Kinobi IDLs to be generated whenever you build your programs.
32-
- **From Anchor IDLs**. If you are using [Anchor programs](https://github.com/coral-xyz/anchor) or [Shank macros](https://github.com/metaplex-foundation/shank), then you can get an Anchor IDL from them. You can then use the `@kinobi-so/nodes-from-anchor` package to convert that IDL into a Kinobi IDL as shown in the code snippet below. Note that the Anchor IDL might not offer all the information that Kinobi can hold and therefore, you may want to transform your Kinobi IDL to provide additional information. You can learn more about this in the next section.
31+
- **Using Codama macros**. This is not yet available but you will soon have access to a set of Rust macros that help attach IDL information directly within your Rust code. These macros enable Codama IDLs to be generated whenever you build your programs.
32+
- **From Anchor IDLs**. If you are using [Anchor programs](https://github.com/coral-xyz/anchor) or [Shank macros](https://github.com/metaplex-foundation/shank), then you can get an Anchor IDL from them. You can then use the `@codama/nodes-from-anchor` package to convert that IDL into a Codama IDL as shown in the code snippet below. Note that the Anchor IDL might not offer all the information that Codama can hold and therefore, you may want to transform your Codama IDL to provide additional information. You can learn more about this in the next section.
3333

3434
```ts
35-
import { createFromRoot } from 'kinobi';
36-
import { rootNodeFromAnchor } from '@kinobi-so/nodes-from-anchor';
35+
import { createFromRoot } from 'codama';
36+
import { rootNodeFromAnchor } from '@codama/nodes-from-anchor';
3737
import anchorIdl from 'anchor-idl.json';
3838

39-
const kinobi = createFromRoot(rootNodeFromAnchor(anchorIdl));
39+
const codama = createFromRoot(rootNodeFromAnchor(anchorIdl));
4040
```
4141

42-
- **By hand**. If your Solana program cannot be updated to use Kinobi macros and you dont have an Anchor IDL, you may design your Kinobi IDL by hand. We may provide tools such as a Kinobi Playground to help with that in the future.
42+
- **By hand**. If your Solana program cannot be updated to use Codama macros and you dont have an Anchor IDL, you may design your Codama IDL by hand. We may provide tools such as a Codama Playground to help with that in the future.
4343

44-
## Transforming Kinobi
44+
## Transforming Codama
4545

46-
Once you have your Kinobi IDL, you may use visitors to transform it. This can be useful when the Kinobi IDL was obtained from another source that may not contain some necessary information. Here is an example using two provided visitors that adjusts the accounts and instructions on the program.
46+
Once you have your Codama IDL, you may use visitors to transform it. This can be useful when the Codama IDL was obtained from another source that may not contain some necessary information. Here is an example using two provided visitors that adjusts the accounts and instructions on the program.
4747

4848
```ts
49-
import { updateAccountsVisitor, updateInstructionsVisitor } from 'kinobi';
49+
import { updateAccountsVisitor, updateInstructionsVisitor } from 'codama';
5050
51-
kinobi.update(updateAccountsVisitor({ ... }));
52-
kinobi.update(updateInstructionsVisitor({ ... }));
51+
codama.update(updateAccountsVisitor({ ... }));
52+
codama.update(updateInstructionsVisitor({ ... }));
5353
```
5454

55-
## From Kinobi to utility
55+
## From Codama to utility
5656

57-
Now that you have the perfect Kinobi IDL for your Solana program, you can benefit from all the visitors and tools that provide utility such as rendering client code or registering your IDL on-chain so explorers can dynamically display relevant information for your program.
57+
Now that you have the perfect Codama IDL for your Solana program, you can benefit from all the visitors and tools that provide utility such as rendering client code or registering your IDL on-chain so explorers can dynamically display relevant information for your program.
5858

59-
_Note that some features such as rendering CLIs are not yet available. However, because the Kinobi IDL is designed as a tree of nodes, these features are only a visitor away from being ready. Feel free to reach out if youd like to contribute to this Kinobi ecosystem._
59+
_Note that some features such as rendering CLIs are not yet available. However, because the Codama IDL is designed as a tree of nodes, these features are only a visitor away from being ready. Feel free to reach out if youd like to contribute to this Codama ecosystem._
6060

61-
- **Rendering client code**. Want people to start interacting with your Solana program? You can use special visitors that go through your Kinobi IDL and generate client code that you can then publish for your end-users. Currently, we have the following renderers available:
61+
- **Rendering client code**. Want people to start interacting with your Solana program? You can use special visitors that go through your Codama IDL and generate client code that you can then publish for your end-users. Currently, we have the following renderers available:
6262

63-
- `@kinobi-so/renderers-js`: Renders a JavaScript client compatible with the soon-to-be-released 2.0 line of [`@solana/web3.js`](https://github.com/solana-labs/solana-web3.js).
64-
- `@kinobi-so/renderers-js-umi`: Renders a JavaScript client compatible with Metaplexs [Umi](https://github.com/metaplex-foundation/umi) framework.
65-
- `@kinobi-so/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
63+
- `@codama/renderers-js`: Renders a JavaScript client compatible with the soon-to-be-released 2.0 line of [`@solana/web3.js`](https://github.com/solana-labs/solana-web3.js).
64+
- `@codama/renderers-js-umi`: Renders a JavaScript client compatible with Metaplexs [Umi](https://github.com/metaplex-foundation/umi) framework.
65+
- `@codama/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
6666
- _And more to come._
6767

6868
Heres an example of how to generate JavaScript and Rust client code for your program.
6969

7070
```ts
71-
import { renderJavaScriptVisitor, renderRustVisitor } from '@kinobi-so/renderers';
71+
import { renderJavaScriptVisitor, renderRustVisitor } from '@codama/renderers';
7272
73-
kinobi.accept(renderJavaScriptVisitor('clients/js/src/generated', { ... }));
74-
kinobi.accept(renderRustVisitor('clients/rust/src/generated', { ... }));
73+
codama.accept(renderJavaScriptVisitor('clients/js/src/generated', { ... }));
74+
codama.accept(renderRustVisitor('clients/rust/src/generated', { ... }));
7575
```
7676

77-
- **Registering your Kinobi IDL on-chain** (_Coming soon_). Perhaps the biggest benefit of having a Kinobi IDL from your program is that you can share it on-chain with the rest of the ecosystem. This means explorers may now use this information to provide a better experience for users of your programs. Additionally, anyone can now grab your Kinobi IDL, select the portion they are interested in and benefit from the same ecosystem of Kinobi visitors to iterate over it. For instance, an app could decide to grab the IDLs of all programs they depend on, filter out the accounts and instructions they dont need and generate a bespoke client for their app that only contains the functions the app needs.
78-
- **Rendering CLIs** (_Not yet available_). Whilst not available yet, we can imagine a set of CLI commands that can be generated from our Kinobi IDL (much like our clients) so that end-users can fetch decoded accounts and send instructions directly from their terminal.
79-
- **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Kinobi IDL.
77+
- **Registering your Codama IDL on-chain** (_Coming soon_). Perhaps the biggest benefit of having a Codama IDL from your program is that you can share it on-chain with the rest of the ecosystem. This means explorers may now use this information to provide a better experience for users of your programs. Additionally, anyone can now grab your Codama IDL, select the portion they are interested in and benefit from the same ecosystem of Codama visitors to iterate over it. For instance, an app could decide to grab the IDLs of all programs they depend on, filter out the accounts and instructions they dont need and generate a bespoke client for their app that only contains the functions the app needs.
78+
- **Rendering CLIs** (_Not yet available_). Whilst not available yet, we can imagine a set of CLI commands that can be generated from our Codama IDL (much like our clients) so that end-users can fetch decoded accounts and send instructions directly from their terminal.
79+
- **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Codama IDL.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "kinobi-monorepo",
2+
"name": "codama-monorepo",
33
"private": true,
44
"workspaces": [
55
"packages/*"
@@ -14,7 +14,7 @@
1414
"devDependencies": {
1515
"@changesets/changelog-github": "^0.5.0",
1616
"@changesets/cli": "^2.27.9",
17-
"@kinobi-so/internals": "workspace:*",
17+
"@codama/internals": "workspace:*",
1818
"@solana/eslint-config-solana": "^3.0.3",
1919
"@solana/prettier-config-solana": "0.0.5",
2020
"@types/node": "^20",

0 commit comments

Comments
 (0)