Skip to content

Commit a421850

Browse files
authored
fix(general): cleanup and automations improvements (#805)
2 parents fcbc5af + e450447 commit a421850

File tree

9 files changed

+223
-150
lines changed

9 files changed

+223
-150
lines changed

CONTRIBUTING.md

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,32 @@
11
# Contributing Guidelines
22

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.
45

5-
## How You Can Contribute
6-
7-
We welcome contributions via:
6+
We welcome:
87

98
- **[GitHub Issues](https://github.com/flare-foundation/developer-hub/issues):** Report bugs, suggest features, or ask questions.
109
- **Pull Requests (PRs):** Submit fixes, improvements, or new content (documentation, examples, site features).
1110

12-
## Development Workflow
11+
## 🛠 Development Workflow
1312

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:
1514

1615
```bash
1716
git checkout -b feature/your-feature-name
1817
```
1918

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.
2328

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.
2530

2631
**Format:** `<type>(<scope>): <description>`
2732

@@ -38,64 +43,67 @@ We welcome contributions via:
3843
| `style` | Formatting changes (whitespace, etc.) |
3944
| `ci` | CI pipeline changes |
4045

41-
**Example:**
46+
**Examples:**
4247

4348
```bash
4449
git commit -m "fix(ftso): correct feed ID example in getting started guide"
4550
git commit -m "feat(src): add copy button to code blocks"
4651
git commit -m "docs(fassets): clarify liquidation process diagram"
4752
```
4853

49-
4. **Push to Your Fork:**
54+
5. **Push and open a PR:**
5055

5156
```bash
5257
git push origin feature/your-feature-name
5358
```
5459

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
5663

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.
5870

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
6572

66-
## Formatting, linting and testing requirements
73+
Run these before submitting a PR:
6774

68-
1. Build the project and verify internal links:
75+
1. **Build & verify internal links:**
6976

7077
```bash
7178
npm run build
7279
```
7380

74-
2. Run formatting, linting, and type‑checking:
81+
2. **Format, lint, and type-check:**
7582

7683
```bash
7784
npm run format && npm run lint && npm run typecheck
7885
```
7986

80-
3. Validate external links using [lychee](https://github.com/lycheeverse/lychee):
87+
3. **Check external links** (requires [lychee](https://github.com/lycheeverse/lychee)):
8188

8289
```bash
8390
lychee --config lychee.toml .
8491
```
8592

86-
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 you modified examples**, run their formatters/tests:
94+
(example for Rust, see `examples/developer-hub-*/README.md` for more instructions)
8895

8996
```bash
9097
cd examples/developer-hub-rust/
91-
cargo build
92-
cargo fmt && cargo clippy --fix
93-
cargo test
98+
cargo fmt -- --check # Format
99+
cargo clippy --bins -- -D warnings # Lint
100+
cargo build --bins --locked # Build
101+
chmod +x test.sh && ./test.sh # Tes
94102
```
95103

96-
## Diagrams Style Guide
104+
## <a id="diagrams-style-guide"></a>🖼 Diagrams Style Guide
97105

98-
For consistency, follow these styles when creating or updating diagrams:
106+
Follow these styles for consistency:
99107

100108
| Element | Light Mode | Dark Mode | Notes |
101109
| :----------------------- | :--------- | :-------- | :------------------------------------------------- |
@@ -107,9 +115,9 @@ For consistency, follow these styles when creating or updating diagrams:
107115
| Onchain Border Style | `Solid` | `Solid` | |
108116
| Offchain Border Style | `Dashed` | `Dashed` | \_Use only if mixing onchain and offchain elements |
109117

110-
See the architecture diagram on the homepage as an [example](https://dev.flare.network/#understand-the-architecture).
118+
See the [homepage architecture diagram](https://dev.flare.network/#understand-the-architecture) for an example.
111119

112-
## Need Help?
120+
## 💬 Need Help?
113121

114122
If you get stuck or have questions, feel free to ask in a [GitHub Issue](https://github.com/flare-foundation/developer-hub/issues).
115123

README.md

Lines changed: 48 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,32 @@ This repository contains the source code and content for the [Flare Developer Hu
44

55
This site is built with [Docusaurus](https://docusaurus.io/), a modern static site generator.
66

7-
## 🚀 Getting Started
7+
> **Note:** This README is for contributors to the Developer Hub source.
8+
> If you just want to read the documentation, visit [dev.flare.network](https://dev.flare.network).
89
9-
Follow these steps to set up a local development environment for previewing changes or contributing.
10+
## 🚀 Getting Started
1011

1112
### Prerequisites
1213

1314
- [Node.js v20](https://nodejs.org/en/) with [nvm](https://github.com/nvm-sh/nvm).
14-
- [uv](https://docs.astral.sh/uv/), [Cargo](https://doc.rust-lang.org/cargo/) and [go](https://go.dev/doc/install) for language specific development.
15+
- For language-specific [examples](examples/)
16+
- [uv](https://docs.astral.sh/uv/) for Python
17+
- [Cargo](https://doc.rust-lang.org/cargo/) for Rust
18+
- [go](https://go.dev/doc/install) for Go
1519

1620
### Installation
1721

18-
1. Clone the repository:
19-
20-
```bash
21-
git clone https://github.com/flare-foundation/developer-hub.git
22-
cd developer-hub
23-
```
24-
25-
2. Install dependencies:
26-
27-
```bash
28-
npm install
29-
```
30-
31-
3. Start the local development server:
22+
Clone, install dependencies and start the local development server:
3223

33-
```bash
34-
npm run start
35-
```
24+
```bash
25+
git clone https://github.com/flare-foundation/developer-hub.git
26+
cd developer-hub
27+
npm install
28+
npm run start
29+
```
3630

37-
This launches the development server and automatically opens your default browser. Live reloading ensures changes appear instantly.
31+
This launches the local development server with hot-reloading.
32+
The site will open in your browser automatically.
3833

3934
## 📂 Repo Structure
4035

@@ -56,10 +51,19 @@ flare-foundation/developer-hub/
5651

5752
Common tasks when developing or contributing content.
5853

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+
5963
### ▶️ Running Code Examples
6064

6165
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.
6367

6468
**Supported languages:**
6569

@@ -68,25 +72,26 @@ Each language subdirectory often has its own `README.md` with setup instructions
6872
- Rust
6973
- Go
7074

71-
### ✨ Formatting Code & Documentation
75+
### ✨ Formatting & Linting
7276

73-
Ensure consistent formatting using [Prettier](https://prettier.io/):
77+
Run [Prettier](https://prettier.io/) for docs and site code:
7478

7579
```bash
7680
npm run format
7781
```
7882

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:
8084

81-
```plaintext
82-
{/* prettier-ignore */}
83-
```
85+
- Go → `gofmt` for Go
86+
- Rust →`cargo fmt` for Rust
87+
- Python → `ruff` for Python
8488

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+
> ```
9095
9196
### 📄 Generating Solidity documentation
9297
@@ -118,37 +123,27 @@ To generate Solidity documentation:
118123

119124
1. **Update addresses and feeds:**
120125

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.
122127

123128
```bash
124129
npm run automations
125130
```
126131

127132
2. **Update language dependencies:**
128133

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.
130135

131136
```bash
132137
npm run update-deps
133138
```
134139

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-
151140
## 🤝 Contributing
152141

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.
145+
2. Fork and create a feature branch:
146+
```bash
147+
git checkout -b feature/my-change
148+
```
149+
3. Commit, push, and open a PR.

0 commit comments

Comments
 (0)