chore: dox

This commit is contained in:
cha0s 2024-01-24 00:43:56 -06:00
parent 42daad3a40
commit 1d06f4a272
3 changed files with 71 additions and 24 deletions

View File

@ -13,57 +13,108 @@ flecks has a command-line interface for building, linting, testing, and so much
### `add`
Add a fleck to your application.
```
Usage: flecks add [options] <fleck>
add a fleck to your application
Arguments:
fleck fleck
fleck fleck
Options:
-d, --dev-dependency add to dev dependencies
-h, --help display help for command
```
### `build`
Build a target in your application.
```
Usage: flecks build [options] [target]
build a target in your application
Arguments:
target target (choices: "...")
target build target (choices: "fleck")
Options:
-d, --no-production dev build
-h, --hot build with hot module reloading
-w, --watch watch for changes
--help display help for command
```
### `lint`
Run linter.
### `clean`
```
Usage: flecks lint [options]
Usage: flecks clean [options]
remove node_modules, lock file, and build artifacts
Options:
-h, --help display help for command
```
### `docusaurus`
(Implemented by `@flecks/dox`)
Create a documentation website for this project.
```
Usage: flecks docusaurus [options] <subcommand> [siteDir]
create a documentation website for this project
Arguments:
subcommand Docusaurus command to run (choices: "build", "create", "start")
siteDir Docusaurus directory (default: "website")
```
Options:
-h, --help display help for command
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`
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.
```
### `lint`
```
Usage: flecks lint [options]
run linter
Options:
-h, --help display help for command
```
### `repl`
(Implemented by `@flecks/repl`)
```
Usage: flecks repl [options]
connect to REPL
Options:
-r, --rlwrap use rlwrap around socat
-h, --help display help for command
```
### `test`
```
Usage: flecks test [options]
run tests
Options:
-d, --no-production dev build
-w, --watch watch for changes
-v, --verbose verbose output
-h, --help display help for command
```
The options are passed along to the `build` command.
## Your commands
@ -95,10 +146,10 @@ Edit your bootstrap script at `packages/fortune/build/flecks.bootstrap.js` to lo
```javascript title="packages/fortune/build/flecks.bootstrap.js"
export const hooks = {
'@flecks/build.commands': () => ({
'@flecks/build.commands': (program) => ({
fortune: {
options: [
['-n, --be-nice', 'be nice'],
program.createOption('-n, --be-nice', 'be nice'),
],
description: 'find your true love',
action: async ({beNice}) => {
@ -177,18 +228,16 @@ name to personalize the output:
const {Argument} = require('@flecks/core/build/commands');
export const hooks = {
// highlight-start
'@flecks/build.commands': (program, flecks) => {
return {
// highlight-end
fortune: {
// highlight-start
args: [
new Argument('[name]', 'your name')
program.createArgument('[name]', 'your name')
],
// highlight-end
options: [
['-n, --be-nice', 'be nice'],
program.createOption('-n, --be-nice', 'be nice'),
],
description: 'find your true love',
// highlight-next-line
@ -200,10 +249,8 @@ export const hooks = {
}
},
},
// highlight-start
};
},
// highlight-end
};
```

View File

@ -22,10 +22,10 @@ You may also inspect the utility command options:
Usage: create-app [options] <app>
Arguments:
app name of the app to create
app name of the app to create
Options:
--package-manager <binary> package manager binary (choices: "npm", "bun", "yarn", default: "npm")
-pm,--package-manager <binary> package manager binary (choices: "npm", "bun", "yarn", default: "npm")
```
:::

View File

@ -19,7 +19,7 @@ architectural opinions.
flecks is built with supreme attention to the developer and end-user experience.
- 🧩 **Small but pluggable**
- The simplest application is two flecks, `core` and `server` (**7 `MiB` production server size**): you don't pay for what you don't buy
- The simplest application is two flecks, `core` and `server` (**7 MB** production server size): you don't pay for what you don't buy
- Endlessly configurable through built-in [hooks](./flecks/@flecks/dox/hooks) and then your own
- 🛠️ **Ready to build maintainable and performant production applications**
- [Documentation website](./documentation) generation for your project with no fuss