chore: dox++
This commit is contained in:
parent
c50bf1a71d
commit
fd4c1ba21e
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Adding flecks
|
||||
description: Add flecks to your application to extend its functionality.
|
||||
title: Adding a fleck
|
||||
description: Add a fleck to your application to extend its functionality.
|
||||
---
|
||||
|
||||
# Adding flecks
|
||||
# Adding a fleck
|
||||
|
||||
`@flecks/web` is a fleck that builds and serves a webpage. You can add it to your application
|
||||
using flecks:
|
|
@ -11,12 +11,22 @@ flecks has a command-line interface for building, linting, testing, and so much
|
|||
|
||||
## Built-in commands
|
||||
|
||||
### `add`
|
||||
|
||||
Add a fleck to your application.
|
||||
|
||||
```
|
||||
Usage: flecks add [options] <fleck>
|
||||
|
||||
Arguments:
|
||||
fleck fleck
|
||||
```
|
||||
|
||||
### `build`
|
||||
|
||||
Build a target in your application.
|
||||
|
||||
```bash
|
||||
flecks build --help
|
||||
```
|
||||
Usage: flecks build [options] [target]
|
||||
|
||||
Arguments:
|
||||
|
@ -30,19 +40,19 @@ Options:
|
|||
|
||||
### `lint`
|
||||
|
||||
```bash
|
||||
Usage: flecks lint [options]
|
||||
Run linter.
|
||||
|
||||
run linter
|
||||
```
|
||||
Usage: flecks lint [options]
|
||||
```
|
||||
|
||||
### `docusaurus`
|
||||
(Implemented by `@flecks/dox`)
|
||||
|
||||
```bash
|
||||
Usage: flecks docusaurus [options] <subcommand> [siteDir]
|
||||
Create a documentation website for this project.
|
||||
|
||||
create a documentation website for this project
|
||||
```
|
||||
Usage: flecks docusaurus [options] <subcommand> [siteDir]
|
||||
|
||||
Arguments:
|
||||
subcommand Docusaurus command to run (choices: "build", "create", "start")
|
||||
|
@ -52,8 +62,8 @@ Arguments:
|
|||
The `build` and `start` subcommands are sugar on top of the corresponding Docusaurus commands.
|
||||
|
||||
The `create` subcommand will create a documentation website starter template for you at `siteDir`
|
||||
which defaults to `website` if `siteDir` doesn't already exist. A `docusaurus.config.js`
|
||||
starter configuration will also be copied to your `build` directory, if it doesn't already exist.
|
||||
if `siteDir` doesn't already exist (defaults to `website`). A `docusaurus.config.js`
|
||||
starter configuration will also be copied to your `build` directory if it doesn't already exist.
|
||||
|
||||
## Your commands
|
||||
|
||||
|
@ -69,20 +79,13 @@ First, create an application:
|
|||
|
||||
Move into the new project and create a fleck:
|
||||
|
||||
<Create type="app" pkg="fortune" />
|
||||
```bash
|
||||
npx create-fleck fortune
|
||||
```
|
||||
|
||||
We're going to be creating a fortune teller command that will tell you when you will find love.
|
||||
:heart_eyes:
|
||||
|
||||
Edit your `build/flecks.yml` and add your new fleck:
|
||||
|
||||
```yml
|
||||
'@flecks/core': {}
|
||||
'@flecks/server': {}
|
||||
// highlight-next-line
|
||||
'@cli_test/fortune:./packages/fortune/src': {}
|
||||
```
|
||||
|
||||
### Create a command that takes an option
|
||||
|
||||
Now, edit `packages/fortune/src/index.js` to look like this:
|
||||
|
@ -224,7 +227,7 @@ npx flecks fortune cha0s
|
|||
Now the output looks like:
|
||||
|
||||
```
|
||||
Hey, cha0s. It will be 7 days until you meet your true love!
|
||||
Hey, cha0s. It will be 4 days until you meet your true love!
|
||||
You might also stub your toe.
|
||||
```
|
||||
|
||||
|
|
|
@ -3,8 +3,6 @@ title: Creating a fleck
|
|||
description: A fleck is a module but also so much more.
|
||||
---
|
||||
|
||||
import Create from '@site/helpers/create';
|
||||
|
||||
If you are following along from the previous getting started
|
||||
[configuration page](./configuration), you have an application with 3 flecks:
|
||||
|
||||
|
@ -54,7 +52,9 @@ This isn't any hard requirement, it's only a suggestion.
|
|||
|
||||
Let's create our little fleck:
|
||||
|
||||
<Create type="fleck" pkg="say-hello" />
|
||||
```bash
|
||||
npx create-fleck say-hello
|
||||
```
|
||||
|
||||
After some output, you'll find your new fleck at `packages/say-hello`. Let's inspect our
|
||||
`build/flecks.yml`:
|
||||
|
|
|
@ -12,6 +12,24 @@ creation utility:
|
|||
|
||||
<Create type="app" pkg="hello-world" />
|
||||
|
||||
:::tip
|
||||
|
||||
You may also inspect the utility command options:
|
||||
|
||||
<Create type="app" pkg="--help" />
|
||||
|
||||
```
|
||||
Usage: create-app [options] <app>
|
||||
|
||||
Arguments:
|
||||
app name of the app to create
|
||||
|
||||
Options:
|
||||
--package-manager <binary> package manager binary (choices: "npm", "bun", "yarn", default: "npm")
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## Start your application
|
||||
|
||||
Now, move into your new project directory and run `npm start`. You'll see a bunch of output, but the
|
||||
|
|
|
@ -11,7 +11,7 @@ export default {
|
|||
items: [
|
||||
'installation',
|
||||
'configuration',
|
||||
'adding-flecks',
|
||||
'adding-a-fleck',
|
||||
'creating-a-fleck',
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user