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
+41-33Lines changed: 41 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,27 +1,32 @@
1
1
# Contributing Guidelines
2
2
3
-
We're excited you want to contribute and help improve the Flare Developer Hub. Your contributions make our documentation, tooling, and examples better for everyone.
3
+
Thank you for helping improve the **Flare Developer Hub**!
4
+
Your contributions make our documentation, tooling, and examples better for everyone.
4
5
5
-
## How You Can Contribute
6
-
7
-
We welcome contributions via:
6
+
We welcome:
8
7
9
8
-**[GitHub Issues](https://github.com/flare-foundation/developer-hub/issues):** Report bugs, suggest features, or ask questions.
10
9
-**Pull Requests (PRs):** Submit fixes, improvements, or new content (documentation, examples, site features).
11
10
12
-
## Development Workflow
11
+
## 🛠 Development Workflow
13
12
14
-
1.**Make Changes:**Edit or add documentation (`docs/`), source code (`src/`), examples (`examples/`), or automation scripts (`automations/`, `docgen/`) after forking and creating a new branch:
13
+
1.**Fork and branch:**Create a branch for your work:
15
14
16
15
```bash
17
16
git checkout -b feature/your-feature-name
18
17
```
19
18
20
-
2. **Follow Style Guides:**
21
-
- **Code/Docs:** Run `npm run format` to apply Prettier formatting. Match existing code style.
22
-
- **Diagrams:** Adhere to the [Diagram Style Guide](#diagrams-style-guide) below for consistency.
19
+
2. **Make changes:** Edit or add:
20
+
- Documentation (`docs/`)
21
+
- Source code (`src/`)
22
+
- Examples (`examples/`)
23
+
- automation scripts (`automations/`, `docgen/`)
24
+
25
+
3. **Follow Style Guides:**
26
+
- **Code/Docs:** Run [Pre-PR checks](#pre-pr-checks). Match existing code style.
27
+
- **Diagrams:** Adhere to the [Diagram Style Guide](#diagrams-style-guide) for consistency.
23
28
24
-
3. **Commit Your Changes:** We **require** the [Conventional Commits](https://www.conventionalcommits.org/) format for clear history and automated changelogs.
29
+
4. **Commit Your Changes:** We require [Conventional Commits](https://www.conventionalcommits.org/) format for clear history and automated changelogs.
25
30
26
31
**Format:**`<type>(<scope>): <description>`
27
32
@@ -38,64 +43,67 @@ We welcome contributions via:
38
43
|`style`| Formatting changes (whitespace, etc.) |
39
44
|`ci`| CI pipeline changes |
40
45
41
-
**Example:**
46
+
**Examples:**
42
47
43
48
```bash
44
49
git commit -m "fix(ftso): correct feed ID example in getting started guide"
45
50
git commit -m "feat(src): add copy button to code blocks"
46
51
git commit -m "docs(fassets): clarify liquidation process diagram"
47
52
```
48
53
49
-
4. **Push to Your Fork:**
54
+
5. **Push and open a PR:**
50
55
51
56
```bash
52
57
git push origin feature/your-feature-name
53
58
```
54
59
55
-
5. **Open a Pull Request (PR):** Submit a PR against the `main` branch of the `flare-foundation/developer-hub` repository.
60
+
Then open a PR against `main`in [flare-foundation/developer-hub](https://github.com/flare-foundation/developer-hub)
61
+
62
+
## 📋 Pull Request Guidelines
56
63
57
-
## Pull Request Guidelines
64
+
- ✅ **Small & Focused:** One logical change per PR.
65
+
- ✅ **Discuss Large Changes First:** Open an issue before starting.
66
+
- ✅ **Provide Context:** Describe the problem, solution, and link related issues.
67
+
- ✅ **Pass CI:** Fix any GitHub Actions failures before requesting review.
68
+
- ✅ **Update Docs:** If behavior or usage changes.
69
+
- ✅ **Confirm Licensing:** All PRs are submitted under this repo’s license.
58
70
59
-
- ✅ **Keep PRs Small & Focused:** One logical change per PR.
60
-
- ✅ **Discuss Large Changes First:** Open an issue to discuss significant changes _before_ starting work.
61
-
- ✅ **Provide Context:** Clearly describe the problem and solution in your PR description. Link relevant issues.
62
-
- ✅ **Ensure Tests & CI Pass:** Fix any failures reported by GitHub Actions. Run tests locally if applicable (especially for`examples/`).
63
-
- ✅ **Update Documentation:** If your change affects functionality or usage, update relevant documentation.
64
-
- ✅ **Confirm Licensing:** By submitting a PR, you agree to license your contribution under the project's license.
71
+
## <a id="pre-pr-checks"></a>🔍 Pre-PR Checks
65
72
66
-
## Formatting, linting and testing requirements
73
+
Run these before submitting a PR:
67
74
68
-
1. Build the project and verify internal links:
75
+
1. **Build &verify internal links:**
69
76
70
77
```bash
71
78
npm run build
72
79
```
73
80
74
-
2. Run formatting, linting, and type‑checking:
81
+
2. **Format, lint, and type-check:**
75
82
76
83
```bash
77
84
npm run format && npm run lint && npm run typecheck
78
85
```
79
86
80
-
3. Validate external links using [lychee](https://github.com/lycheeverse/lychee):
4. (Optional) If you’ve added or modified scripts under any `examples/developer-hub-*/` directory, navigate into that example’s folder and run its formatter and test suite.
87
-
See the example’s `README.md` for more instructions, e.g.:
93
+
4. **If youmodified examples**, run their formatters/tests:
94
+
(example for Rust, see `examples/developer-hub-*/README.md`for more instructions)
Common tasks when developing or contributing content.
58
53
54
+
### 🏗️ **Building for Production**
55
+
56
+
Search and some features only work in production.
57
+
You can test locally with:
58
+
59
+
```bash
60
+
npm run build && npm run serve
61
+
```
62
+
59
63
### ▶️ Running Code Examples
60
64
61
65
The [`examples/`](examples/) directory contains code snippets demonstrating how to interact with Flare protocols.
62
-
Each language subdirectory often has its own `README.md` with setup instructions.
66
+
Each language subdirectory (`examples/developer-hub-*`) has its own `README.md` with setup instructions.
63
67
64
68
**Supported languages:**
65
69
@@ -68,25 +72,26 @@ Each language subdirectory often has its own `README.md` with setup instructions
68
72
- Rust
69
73
- Go
70
74
71
-
### ✨ Formatting Code & Documentation
75
+
### ✨ Formatting & Linting
72
76
73
-
Ensure consistent formatting using [Prettier](https://prettier.io/):
77
+
Run [Prettier](https://prettier.io/) for docs and site code:
74
78
75
79
```bash
76
80
npm run format
77
81
```
78
82
79
-
**Note**: Prettier support for MDXv3 is evolving ([tracking issue](https://github.com/prettier/prettier/issues/12209)). If needed, bypass Prettier by using:
83
+
Language-specific examples use their native formatters:
80
84
81
-
```plaintext
82
-
{/* prettier-ignore */}
83
-
```
85
+
- Go → `gofmt` for Go
86
+
- Rust →`cargo fmt` for Rust
87
+
- Python → `ruff` for Python
84
88
85
-
Code examples within the `examples/` directory follow language-specific formatting standards:
86
-
87
-
-`gofmt` for Go
88
-
-`cargo fmt` for Rust
89
-
-`ruff` for Python
89
+
> **Note:** Prettier support for MDXv3 is evolving ([tracking issue](https://github.com/prettier/prettier/issues/12209)).
90
+
> To skip formatting for a section:
91
+
>
92
+
> ```plaintext
93
+
> {/* prettier-ignore */}
94
+
> ```
90
95
91
96
### 📄 Generating Solidity documentation
92
97
@@ -118,37 +123,27 @@ To generate Solidity documentation:
118
123
119
124
1.**Update addresses and feeds:**
120
125
121
-
This script updates JSON files used by custom components (e.g., feed tables, contract address lists) by fetching data from the `ContractRegistry`onchain and referencing risk data defined in `automations/*_risk.json`.
126
+
Fetches latest contract addresses from `ContractRegistry` and feed data for use in site tables and components.
122
127
123
128
```bash
124
129
npm run automations
125
130
```
126
131
127
132
2.**Update language dependencies:**
128
133
129
-
This script runs package manager updates within the various language subdirectories under `examples/` to refresh their dependencies.
134
+
Updates dependencies in all `examples/*` subdirectories.
130
135
131
136
```bash
132
137
npm run update-deps
133
138
```
134
139
135
-
## 🏗️ **Building for Production**
136
-
137
-
To create a production-ready build:
138
-
139
-
```bash
140
-
npm run build
141
-
```
142
-
143
-
The static files are generated in the `build` directory. To serve the production build locally:
144
-
145
-
```bash
146
-
npm run serve
147
-
```
148
-
149
-
**Note**: Search only works in production builds.
150
-
151
140
## 🤝 Contributing
152
141
153
-
Contributions are highly welcome! Whether it's fixing a typo, improving documentation clarity, adding new examples, or enhancing the site itself, your help is appreciated.
154
-
Before your first PR, read the [CONTRIBUTING.md](CONTRIBUTING.md).
142
+
We welcome contributions of all sizes - from typo fixes to major feature additions.
143
+
144
+
1. Read the [CONTRIBUTING.md](CONTRIBUTING.md) guidelines.
0 commit comments