Skip to content

Commit 159c188

Browse files
authored
Fix CI (#330)
* Add set -eux to e2e scripts * Fix TS error * Lint fix
1 parent fb8a0aa commit 159c188

File tree

27 files changed

+236
-229
lines changed

27 files changed

+236
-229
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Because everything is designed as a `Node`, we can transform the IDL, aggregate
3131

3232
There are various ways to extract information from your Solana programs in order to obtain a Codama IDL.
3333

34-
- **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.
35-
- **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.
34+
- **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.
35+
- **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.
3636

3737
```ts
3838
import { createFromRoot } from 'codama';
@@ -42,7 +42,7 @@ There are various ways to extract information from your Solana programs in order
4242
const codama = createFromRoot(rootNodeFromAnchor(anchorIdl));
4343
```
4444

45-
- **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.
45+
- **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.
4646

4747
## Transforming Codama
4848

@@ -61,12 +61,12 @@ Now that you have the perfect Codama IDL for your Solana program, you can benefi
6161

6262
_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._
6363

64-
- **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:
64+
- **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:
6565

66-
- `@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).
67-
- `@codama/renderers-js-umi`: Renders a JavaScript client compatible with Metaplexs [Umi](https://github.com/metaplex-foundation/umi) framework.
68-
- `@codama/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
69-
- _And more to come._
66+
- `@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).
67+
- `@codama/renderers-js-umi`: Renders a JavaScript client compatible with Metaplexs [Umi](https://github.com/metaplex-foundation/umi) framework.
68+
- `@codama/renderers-rust`: Renders a Rust client that removes the need for publishing the program crate and offers a better developer experience.
69+
- _And more to come._
7070

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

@@ -77,6 +77,6 @@ _Note that some features such as rendering CLIs are not yet available. However,
7777
codama.accept(renderRustVisitor('clients/rust/src/generated', { ... }));
7878
```
7979

80-
- **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.
81-
- **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.
82-
- **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Codama IDL.
80+
- **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.
81+
- **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.
82+
- **Rendering documentation** (_Not yet available_). Similarly to CLIs, we may easily generate documentation in various formats from the information held by our Codama IDL.

packages/errors/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ To add a new error in Codama, follow these steps:
7575

7676
### Removing an error message
7777

78-
- Don't remove errors.
79-
- Don't change the meaning of an error message.
80-
- Don't change or reorder error codes.
81-
- Don't change or remove members of an error's context.
78+
- Don't remove errors.
79+
- Don't change the meaning of an error message.
80+
- Don't change or reorder error codes.
81+
- Don't change or remove members of an error's context.
8282

8383
When an older client throws an error, we want to make sure that they can always decode the error. If you make any of the changes above, old clients will, by definition, not have received your changes. This could make the errors that they throw impossible to decode going forward.

packages/library/README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ pnpm install codama
1919

2020
This package includes the following packages. Note that some of them also re-export other packages.
2121

22-
- [`@codama/errors`](../errors)
23-
- [`@codama/nodes`](../nodes)
24-
- [`@codama/node-types`](../node-types)
25-
- [`@codama/validators`](../validators)
26-
- [`@codama/visitors`](../visitors)
27-
- [`@codama/visitor-core`](../visitor-core)
22+
- [`@codama/errors`](../errors)
23+
- [`@codama/nodes`](../nodes)
24+
- [`@codama/node-types`](../node-types)
25+
- [`@codama/validators`](../validators)
26+
- [`@codama/visitors`](../visitors)
27+
- [`@codama/visitor-core`](../visitor-core)
2828

2929
## The Codama helper
3030

@@ -70,9 +70,9 @@ codama.update(
7070

7171
Other helper functions include:
7272

73-
- `clone()`: Creates a new instance of the `Codama` interface with a deep copy of the wrapped `RootNode`.
74-
- `getJson()`: Returns the JSON representation of the Codama IDL.
75-
- `getRoot()`: Returns the wrapped `RootNode`.
73+
- `clone()`: Creates a new instance of the `Codama` interface with a deep copy of the wrapped `RootNode`.
74+
- `getJson()`: Returns the JSON representation of the Codama IDL.
75+
- `getRoot()`: Returns the wrapped `RootNode`.
7676

7777
```ts
7878
const clonedCodama = codama.clone();

0 commit comments

Comments
 (0)