You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+48-6Lines changed: 48 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,40 @@ Specifically for code in this repo:
22
22
23
23
1. Use pnpm as the default package manager for the project. You can [install pnpm by following the instructions](https://pnpm.io/installation). Commit `pnpm-lock.yaml` to the repository.
24
24
25
-
2. Anchor programs should be in directory `anchor`, programs written for Solana Native should be in directory `native`, TypeScript in `poseidon` and Python in `seahorse`.
25
+
2. Solana Programs written for Anchor framework should be in directory (`anchor`)[https://www.anchor-lang.com], Solana Native in (`native`)[https://solana.com/developers/guides/getstarted/intro-to-native-rust], Steel Framework in (`steel`)[https://github.com/regolith-labs/steel], TypeScript in (`poseidon`)[https://github.com/Turbin3/poseidon], respectively.
- Project path structure example for anchor: `/program-examples/category/example-name/anchor`
26
28
27
29
3. Tests for Solana native programs, steel framework programs, and Anchor should be written with [solana-bankrun](https://kevinheavey.github.io/solana-bankrun)
28
30
29
-
4. For Solana native programs and Steel framework programs ensure adding these mandatory pnpm run scripts to your `package.json` file for successful CI/CD builds:
31
+
4. Steel framework programs must be organized as a Cargo workspace with separate projects for API and program:
- Must be a Cargo workspace with two separate projects:
35
+
-`api`: Contains API-related code
36
+
-`program`: Contains the program implementation
37
+
- Steel projects should NOT be added in the root [`Cargo.toml` file](https://github.com/solana-developers/program-examples/blob/main/Cargo.toml)
38
+
39
+
This structure ensures proper organization and separation of concerns.
40
+
41
+
5. For Steel framework programs:
42
+
- Steel CLI is the recommended way to build and test programs:
43
+
```bash
44
+
# Install Steel CLI (one-time setup)
45
+
cargo install steel-cli
46
+
47
+
# Create a new Steel project
48
+
steel new <name>
49
+
50
+
# Build the program
51
+
steel build
52
+
53
+
# Run tests
54
+
steel test
55
+
```
56
+
- Alternatively, you can use package.json scripts if you need custom build/test configurations as Solana native one described below.
57
+
58
+
6. For Solana native programs ensure adding these mandatory pnpm run scripts to your `package.json` file for successful CI/CD builds:
30
59
31
60
```json
32
61
"scripts": {
@@ -37,20 +66,33 @@ Specifically for code in this repo:
37
66
},
38
67
```
39
68
40
-
5. Test command for Anchor should execute `pnpm test`instead of `yarn run test` for anchor programs. Replace `yarn` with `pnpm` in `[script]` table inside [Anchor.toml file.](https://www.anchor-lang.com/docs/manifest#scripts-required-for-testing)
69
+
Alternatively, You can add `steel test`and `steel build` as commands according to your project.
41
70
42
-
6. TypeScript, JavaScript and JSON files are formatted and linted using
71
+
"scripts": {
72
+
"test": "steel test",
73
+
"build-and-test": "steel build && steel test",
74
+
"build": "steel build",
75
+
"deploy": "solana program deploy ./program/target/so/program.so"
76
+
},
77
+
78
+
7. Test commandforAnchor should execute `pnpm test` instead of `yarn run test` for anchor programs. Replace `yarn` with `pnpm`in`[script]` table inside [Anchor.toml file.](https://www.anchor-lang.com/docs/manifest#scripts-required-for-testing)
79
+
80
+
```
81
+
[scripts]
82
+
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
83
+
```
84
+
85
+
8. TypeScript, JavaScript and JSON files are formatted and linted using
43
86
[Biome](https://biomejs.dev/). Execute the following command to format and lint your code at the root of this project before submitting a pull request:
44
87
45
88
```bash
46
89
pnpm fix
47
90
```
48
91
49
-
7. Some projects can be ignored from the building and testing process by adding the project name to the `.gitignore` file.
92
+
9. Some projects can be ignored from the building and testing process by adding the project name to the `.gitignore` file.
50
93
When removing or updating an example, please ensure that the example is removed from the `.gitignore` file
51
94
and there's a change in that example's directory.
52
95
53
-
54
96
## Code of Conduct
55
97
56
98
We are committed to providing a friendly, safe, and welcoming environment for all contributors, regardless of their background, experience level, or personal characteristics. As a contributor, you are expected to:
0 commit comments