-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(libraries/template): create template documentation
- Loading branch information
Showing
1 changed file
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
title: template | ||
description: Template documentation page for creating new libraries. | ||
--- | ||
|
||
## 📦 Overview | ||
|
||
### What it does | ||
|
||
Provide a clear, concise overview of the purpose and capabilities of the library. | ||
|
||
### Key Features | ||
|
||
Highlight the main features of the library in bullet points or brief descriptions. | ||
|
||
### How to use | ||
|
||
#### Basic Usage Example | ||
|
||
Show a minimal example of how to set up and use the library. | ||
|
||
--- | ||
|
||
## 📖 API Reference | ||
|
||
### `myAction` Function | ||
|
||
- **Description**: | ||
- **Parameters**: | ||
- **Return Type**: | ||
|
||
### `myThing` Object | ||
|
||
- **Properties** | ||
- `FirstProperty`: | ||
|
||
### Error Handling | ||
|
||
Explain how errors are thrown during validation and show example outputs for invalid variables. | ||
|
||
--- | ||
|
||
## 🛠️ Commands | ||
|
||
### View all commands | ||
|
||
To view all commands from the library's `project.json`, `package.json` and inheritted: | ||
```sh title="Terminal" | ||
pnpm nx show project <lib> | ||
``` | ||
|
||
### Focus library usage | ||
|
||
To view/focus on all the apps & libraries which use this library: | ||
```sh title="Terminal" | ||
pnpm nx graph --focus <lib> | ||
``` | ||
|
||
--- | ||
|
||
## 📝 Contributing | ||
|
||
### Best Practices | ||
|
||
#### Code Formatting | ||
|
||
Include instructions or links to code style guides, like Prettier/ESLint. | ||
|
||
The library should be linted without any errors: | ||
```sh title="Terminal" | ||
pnpm nx run <lib>:lint | ||
``` | ||
|
||
#### Testing | ||
|
||
To run tests for this library: | ||
```sh title="Terminal" | ||
pnpm nx run <lib>:test | ||
``` | ||
|
||
--- | ||
|
||
## ❓ FAQs | ||
|
||
### What happens if ...? | ||
|
||
Provide an answer along with an example error message. | ||
|
||
### Can I add ...? | ||
|
||
Show an example of adding more to the library. | ||
|
||
--- | ||
|
||
## 🛑 Troubleshooting | ||
|
||
### Common Errors | ||
|
||
#### Invalidity | ||
|
||
Describe a common invalidity issue and how to fix it, along with an example error output. |