blitzjs.com
blitzjs.com copied to clipboard
Auto Generate doc PRs for updates to CLI commands
Idea from @aem:
When there's a new command added in blitz/packages/cli parse out the command and then use the built in oclif documentation to update the cli docs
@Zeko369 Here's the issue for auto cli doc updates!
Quote from slack to keep it in one place
We could have a generate section at the top with “most important stuff” from the CLI package, and after that have our written portion
This is fine as long as it doesn't add friction for making our docs really nice and helpful. (It seems like it would add too much friction, but maybe not)
@flybayer I was just thinking about having a template like
---
id: cli-db
title: CLI db command
sidebar_label....
---
__template__
### `db migrate`
Run any needed migrations via Prisma 2 and generate Prisma Client
...
And then having a compile step for example yarn link-cli that would go in and add change template with something generated from the cli docs
Out of this output we don't need description since it's going to be explained in detail below
Run database commands
USAGE
$ blitz db COMMAND
ARGUMENTS
COMMAND Run specific db command
OPTIONS
-h, --help show CLI help
DESCRIPTION
migrate Run any needed migrations via Prisma 2 and generate Prisma Client.
introspect Will introspect the database defined in db/schema.prisma and automatically generate a complete schema.prisma file
for you. Lastly, it'll generate Prisma Client.
studio Open the Prisma Studio UI at http://localhost:5555 so you can easily see and change data in your database.
reset Reset the database and run a fresh migration via Prisma 2.
Or maybe just write a bit long docs on the cli side and import the whole description?
I think we probably want a halfway system here. Auto-generated docs from the CLI info is probably too basic, but we do want some way to ensure the docs are up to date. Maybe when CLI commands are updated we auto-create an issue in blitz-js/blitzjs.com for the PR author to update docs? We can list the new things that need to be documented based on parsing the command (options, arguments, etc) and then it's up to the original author to update docs and close out the issue
Maybe we could keep description (oclif) and a longer description of site/manpages?? in cli/docs so we can keep it in one place