Skip to content

Commit 13b1efb

Browse files
committed
docs: write contribute page
1 parent a3f24d5 commit 13b1efb

File tree

11 files changed

+242
-47
lines changed

11 files changed

+242
-47
lines changed

.DS_Store

0 Bytes
Binary file not shown.

.astro/content-modules.mjs

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11

22
export default new Map([
3+
["src/content/blog/welcome.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fblog%2Fwelcome.mdx&astroContentModuleFlag=true")],
4+
["src/content/docs/api/cli.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcli.mdx&astroContentModuleFlag=true")],
5+
["src/content/docs/api/commands.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcommands.mdx&astroContentModuleFlag=true")],
6+
["src/content/docs/api/container.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcontainer.mdx&astroContentModuleFlag=true")],
7+
["src/content/docs/api/components.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcomponents.mdx&astroContentModuleFlag=true")],
8+
["src/content/docs/api/environment-variables.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fenvironment-variables.mdx&astroContentModuleFlag=true")],
9+
["src/content/docs/api/global-states.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fglobal-states.mdx&astroContentModuleFlag=true")],
10+
["src/content/docs/api/hmr.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fhmr.mdx&astroContentModuleFlag=true")],
11+
["src/content/docs/api/interactive-components.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Finteractive-components.mdx&astroContentModuleFlag=true")],
12+
["src/content/docs/api/event.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fevent.mdx&astroContentModuleFlag=true")],
13+
["src/content/docs/api/placeholders.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fplaceholders.mdx&astroContentModuleFlag=true")],
314
["src/content/docs/guide/deployment.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fdeployment.mdx&astroContentModuleFlag=true")],
415
["src/content/docs/guide/commands.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fcommands.mdx&astroContentModuleFlag=true")],
516
["src/content/docs/guide/environment-variables.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fenvironment-variables.mdx&astroContentModuleFlag=true")],
6-
["src/content/docs/guide/event.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fevent.mdx&astroContentModuleFlag=true")],
717
["src/content/docs/guide/installation.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Finstallation.mdx&astroContentModuleFlag=true")],
8-
["src/content/docs/api/cli.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcli.mdx&astroContentModuleFlag=true")],
9-
["src/content/docs/api/components.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcomponents.mdx&astroContentModuleFlag=true")],
10-
["src/content/docs/api/container.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcontainer.mdx&astroContentModuleFlag=true")],
18+
["src/content/docs/guide/event.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fevent.mdx&astroContentModuleFlag=true")],
1119
["src/content/docs/guide/structure.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fstructure.mdx&astroContentModuleFlag=true")],
12-
["src/content/blog/welcome.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fblog%2Fwelcome.mdx&astroContentModuleFlag=true")],
13-
["src/content/docs/api/commands.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fcommands.mdx&astroContentModuleFlag=true")],
14-
["src/content/docs/api/global-states.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fglobal-states.mdx&astroContentModuleFlag=true")],
15-
["src/content/docs/api/hmr.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fhmr.mdx&astroContentModuleFlag=true")],
16-
["src/content/docs/api/environment-variables.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fenvironment-variables.mdx&astroContentModuleFlag=true")],
17-
["src/content/docs/concepts/data-caching.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fconcepts%2Fdata-caching.mdx&astroContentModuleFlag=true")],
1820
["src/content/docs/concepts/datastore.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fconcepts%2Fdatastore.mdx&astroContentModuleFlag=true")],
21+
["src/content/docs/concepts/data-caching.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fconcepts%2Fdata-caching.mdx&astroContentModuleFlag=true")],
1922
["src/content/docs/concepts/immutability.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fconcepts%2Fimmutability.mdx&astroContentModuleFlag=true")],
20-
["src/content/docs/api/event.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fevent.mdx&astroContentModuleFlag=true")],
21-
["src/content/docs/api/placeholders.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fplaceholders.mdx&astroContentModuleFlag=true")],
22-
["src/content/docs/api/interactive-components.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Finteractive-components.mdx&astroContentModuleFlag=true")],
2323
["src/content/docs/examples/ping-pong.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fexamples%2Fping-pong.mdx&astroContentModuleFlag=true")],
24-
["src/content/docs/api/providers.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fproviders.mdx&astroContentModuleFlag=true")]]);
24+
["src/content/docs/api/providers.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fapi%2Fproviders.mdx&astroContentModuleFlag=true")],
25+
["src/content/docs/guide/deployment copy.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fdeployment+copy.mdx&astroContentModuleFlag=true")],
26+
["src/content/docs/guide/contribute.mdx", () => import("astro:content-layer-deferred-module?astro%3Acontent-layer-deferred-module=&fileName=src%2Fcontent%2Fdocs%2Fguide%2Fcontribute.mdx&astroContentModuleFlag=true")]]);
2527

.astro/data-store.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

.astro/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"_variables": {
3-
"lastUpdateCheck": 1753976649467
3+
"lastUpdateCheck": 1760137384856
44
}
55
}

src/content/docs/api/hmr.mdx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ order: 11
1111
Within the Mineral ecosystem, HMR (Hot Module Reloading) is a feature that automatically reloads your business code
1212
without having to restart your project or recreate a connection to Discord's Websocket API.
1313

14-
> [!warning]
15-
> This feature is experimental and may not work as expected.
14+
> [!important]
15+
> The integration of HMR uses an agnostic package named [`hmr`](https://pub.dev/packages/hmr).
1616
1717
---
1818

@@ -22,8 +22,7 @@ This feature is particularly useful when you are developing your application and
2222

2323
It is important to note that the HMR only reloads the contents of your root project's (based on the following glob pattern `**.dart`) without any external dependencies.
2424

25-
> [!important]
26-
> The integration of HMR has been moved to a dedicated, agnostic package [`hmr`](https://pub.dev/packages/hmr).
25+
---
2726

2827
## How it works
2928

src/content/docs/guide/commands.mdx

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Commands
33
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
44
permalink: commands
55
icon: lucide:square-slash
6-
order: 5
6+
order: 6
77
---
8+
89
# Commands
910

1011
Slash commands were implemented with the aim of replacing messages considered as commands with a start-of-line
@@ -31,6 +32,7 @@ syntax errors.
3132
From the `Client`, we can chain commands listeners using the following pattern :
3233

3334
:::code-group labels=[main.dart]
35+
3436
```dart
3537
Future<void> main(_, port) async {
3638
final client = ClientBuilder()
@@ -47,22 +49,24 @@ Future<void> main(_, port) async {
4749
await client.init();
4850
}
4951
```
52+
5053
:::
5154

5255
---
5356

5457
## Object-oriented approach
5558

56-
For benchmarking purposes, we recommend using the `functional` approach, but when developing applications requiring
59+
For benchmarking purposes, we recommend using the `functional` approach, but when developing applications requiring
5760
more than 2 events or commands, we recommend using the object-oriented approach.
5861

5962
:::code-group labels=[command.dart, main.dart]
63+
6064
```dart
6165
final class MyCommand implements CommandDeclaration {
6266
void handle(CommandContext ctx) {
6367
print('Hello, world!');
6468
}
65-
69+
6670
@override
6771
CommandDeclarationBuilder build() {
6872
return CommandDeclarationBuilder()
@@ -72,6 +76,7 @@ final class MyCommand implements CommandDeclaration {
7276
}
7377
}
7478
```
79+
7580
```dart
7681
Future<void> main(_, port) async {
7782
final client = ClientBuilder()
@@ -83,4 +88,5 @@ Future<void> main(_, port) async {
8388
await client.init();
8489
}
8590
```
86-
:::
91+
92+
:::
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
title: Contribute
3+
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
4+
permalink: contribute
5+
icon: lucide:sparkles
6+
order: 1
7+
---
8+
9+
# Contribute
10+
11+
Contributions are the basis of any open-source project. They enable the project to evolve, fix bugs, add features and much more.
12+
We're delighted that you want to contribute to our project !
13+
14+
> [!important]
15+
> Your help is invaluable in improving and growing this project.
16+
17+
---
18+
19+
## How to contribute
20+
21+
Contributions can take several forms. Here are a few examples:
22+
23+
- Improving the documentation with your feedback and experiments
24+
- Report and/or fixing bugs in [issues](https://github.com/mineral-dart/core/issues)
25+
- Adding missing functionalities through forks and pull requests
26+
- Suggest improvements to the user experience
27+
- Help the community by answering questions from other users
28+
29+
---
30+
31+
## Improving the documentation
32+
33+
The documentation is the first point of contact for users. It must be clear, concise and easy to understand.
34+
35+
This aspect of the project is crucial to its adoption and use by the community, but it takes up an infinite amount of
36+
time to write, to the detriment of the actual development of new features.
37+
38+
---
39+
40+
### API documentation
41+
42+
The API documentation is generated using the `dartdoc` tool. It is automatically generated and updated with each new
43+
release.
44+
45+
Each method must be documented, as well as each parameter, return type and exception.
46+
It's this aspect in particular that consumes an infinite amount of our time.
47+
48+
Si vous souhaitez-nus aider à améliorer la documentation, vous pouvez suivre les étapes suivantes :
49+
50+
1. Fork the project
51+
2. Make your `dartdoc` comments
52+
3. Push your changes and create a pull request
53+
54+
You can also use the following template to document the methods :
55+
56+
````dart
57+
/// Title of the method
58+
///
59+
/// Description of the method
60+
///
61+
/// Example :
62+
/// ```dart
63+
/// // Code example
64+
/// ```
65+
///
66+
void fn() {}
67+
````
68+
69+
### Website documentation
70+
71+
The framework documentation is the second most important part of the documentation.
72+
understand how to use the framework.
73+
74+
Unlike API documentation, here we'll explain the concepts, functionalities and best practices, while providing
75+
theoretical and concrete examples to help users understand how the framework works while providing theoretical and
76+
practical examples to help users understand how the framework works.
77+
78+
If you wish to clarify certain points, add examples or even correct errors, you can follow the steps below:
79+
80+
1. Fork the [repository](https://github.com/mineral-dart/website)
81+
2. Make your changes
82+
3. Push your changes and create a pull request
83+
4. Wait for the review
84+
5. Once the review is complete, your changes will be merged
85+
86+
### Reporting bugs
87+
88+
Bugs are a common occurrence in software development. They can be caused by a variety of factors, such as incorrect
89+
implementation, incorrect use of the framework, or even a lack of understanding of the framework.
90+
91+
The more information you provide, the easier it will be for us to reproduce the bug and correct it, so we recommend that
92+
you provide the following information.
93+
94+
- Give context (show `pubspec.yaml`)
95+
- Description of the bug (copy/paste the error message)
96+
- Steps to reproduce the bug
97+
- Expected behavior
98+
- Actual behavior
99+
- Screenshots or code snippets (optional)
100+
101+
If you encounter a bug, you can report it by following these steps:
102+
103+
1. Go to the [issues](https://github.com/mineral-dart/core/issues/new)
104+
2. Fill in the form with the necessary information
105+
3. Click on the "Submit new issue" button
106+
4. Wait for the review by the core team
107+
108+
### Adding missing features
109+
110+
The framework is constantly evolving. New features are added regularly to improve the user experience and make the
111+
framework more complete.
112+
113+
> [!note]
114+
> You can find the roadmap [here](https://github.com/orgs/mineral-dart/projects/5/views/2).
115+
116+
#### Installation
117+
118+
When we develop the core functionalities, it is preferable to create a blank application simulating a real application
119+
with the `core` package at the same folder level.
120+
121+
We therefore consider the following structure :
122+
123+
```
124+
├── root
125+
│ └── bot
126+
│ └── core
127+
│ │
128+
│ └── other packages
129+
```
130+
131+
In your bot application `pubspec.yaml` file, add the following dependency.
132+
133+
> [!note]
134+
> In accordance with the [documentation](https://dart.dev/tools/pub/dependencies), using a `path` allows you to develop functionality locally.
135+
136+
:::code-group labels=[pubspec.yaml, bash]
137+
138+
```yaml
139+
dependencies:
140+
mineral:
141+
path: ../core
142+
143+
# Optional
144+
mineral_cache:
145+
path: ../cache
146+
```
147+
148+
```bash
149+
dart pub get
150+
```
151+
152+
:::

src/content/docs/guide/environment-variables.mdx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Environment variables
33
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
44
permalink: environment-variables
55
icon: lucide:key-round
6-
order: 3
6+
order: 4
77
---
8+
89
# Environment variables
910

1011
Environment variables serve the purpose of storing secrets like the database password, the app secret, or an API key outside of your application codebase.
@@ -19,6 +20,7 @@ In addition, environment variables can be used to obtain different configuration
1920
We're providing an `Environment` class to access the various environment variables in your application.
2021

2122
:::code-group labels=[.env, schema.dart]
23+
2224
```dotenv
2325
DART_ENV=development
2426
TOKEN=your_token
@@ -27,6 +29,7 @@ DISCORD_WS_VERSION=10
2729
INTENT=3276799
2830
LOG_LEVEL=TRACE
2931
```
32+
3033
```dart
3134
final class AppEnv implements DefineEnvironment {
3235
static final String dartEnv = 'DART_ENV';
@@ -57,4 +60,5 @@ enum DartEnv implements Enumerable<String> {
5760
const DartEnv(this.value);
5861
}
5962
```
60-
:::
63+
64+
:::

src/content/docs/guide/event.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@ title: Events
33
description: Lorem ipsum dolor sit amet, consectetur adipiscing elit.
44
permalink: events
55
icon: lucide:bell
6-
order: 4
6+
order: 5
77
---
8+
89
# Events
910

1011
The Discord API uses a real-time event system transmitted via a WebSocket connection to allow client applications to receive instant updates from the server.
@@ -31,9 +32,11 @@ Let's take a simple example of a bot that listens to the `MessageCreate` event a
3132
From the `Client`, we can chain event listeners using the following pattern :
3233

3334
:::code-group labels=[boilerplate, main.dart]
35+
3436
```dart
3537
client.events.<context>.<event>(<listener>)
3638
```
39+
3740
```dart
3841
Future<void> main(_, port) async {
3942
final client = ClientBuilder()
@@ -47,16 +50,18 @@ Future<void> main(_, port) async {
4750
await client.init();
4851
}
4952
```
53+
5054
:::
5155

5256
---
5357

5458
## Object-oriented approach
5559

56-
For benchmarking purposes, we recommend using the `functional` approach, but when developing applications requiring
60+
For benchmarking purposes, we recommend using the `functional` approach, but when developing applications requiring
5761
more than 2 events or commands, we recommend using the object-oriented approach.
5862

5963
:::code-group labels=[boilerplate, message_create.dart, main.dart]
64+
6065
```dart
6166
final class <ClassName> extends <Event> {
6267
@override
@@ -65,6 +70,7 @@ final class <ClassName> extends <Event> {
6570
}
6671
}
6772
```
73+
6874
```dart
6975
final class MessageCreate extends MessageCreateEvent {
7076
@override
@@ -73,6 +79,7 @@ final class MessageCreate extends MessageCreateEvent {
7379
}
7480
}
7581
```
82+
7683
```dart
7784
Future<void> main(_, port) async {
7885
final client = ClientBuilder()
@@ -84,4 +91,5 @@ Future<void> main(_, port) async {
8491
await client.init();
8592
}
8693
```
87-
:::
94+
95+
:::

0 commit comments

Comments
 (0)