From 0c597fd7a880a2ec05ed6bd7d3341dd38860dc16 Mon Sep 17 00:00:00 2001 From: Joakim Carlstein Date: Fri, 9 Feb 2024 14:04:52 +0100 Subject: [PATCH] docs(cli): add a main page for Emigrate's CLI --- .changeset/popular-points-exist.md | 5 ++ docs/astro.config.mjs | 37 +++++++----- docs/src/content/docs/commands/index.mdx | 73 ++++++++++++++++++++++++ 3 files changed, 101 insertions(+), 14 deletions(-) create mode 100644 .changeset/popular-points-exist.md create mode 100644 docs/src/content/docs/commands/index.mdx diff --git a/.changeset/popular-points-exist.md b/.changeset/popular-points-exist.md new file mode 100644 index 0000000..8496b79 --- /dev/null +++ b/.changeset/popular-points-exist.md @@ -0,0 +1,5 @@ +--- +'@emigrate/docs': minor +--- + +Add a separate page for the Emigrate CLI itself, with all the commands as sub pages diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs index d4df70c..17b41c2 100644 --- a/docs/astro.config.mjs +++ b/docs/astro.config.mjs @@ -78,23 +78,32 @@ export default defineConfig({ ], }, { - label: 'Commands', + label: 'Command Line Interface', items: [ { - label: 'emigrate up', - link: '/commands/up/', + label: 'Introduction', + link: '/commands/', }, { - label: 'emigrate list', - link: '/commands/list/', - }, - { - label: 'emigrate new', - link: '/commands/new/', - }, - { - label: 'emigrate remove', - link: '/commands/remove/', + label: 'Commands', + items: [ + { + label: 'emigrate up', + link: '/commands/up/', + }, + { + label: 'emigrate list', + link: '/commands/list/', + }, + { + label: 'emigrate new', + link: '/commands/new/', + }, + { + label: 'emigrate remove', + link: '/commands/remove/', + }, + ], }, ], }, @@ -106,7 +115,7 @@ export default defineConfig({ link: '/guides/typescript/', }, { - label: 'Baseline', + label: 'Baseline existing database', link: '/guides/baseline/', }, ], diff --git a/docs/src/content/docs/commands/index.mdx b/docs/src/content/docs/commands/index.mdx new file mode 100644 index 0000000..c01c189 --- /dev/null +++ b/docs/src/content/docs/commands/index.mdx @@ -0,0 +1,73 @@ +--- +title: "CLI Introduction" +description: "Some basic information about the Emigrate CLI." +--- + +import { Tabs, TabItem, LinkCard } from '@astrojs/starlight/components'; +import Link from '@components/Link.astro'; + +Emigrate comes with a CLI that you can use to manage your migrations. The CLI is a powerful tool that allows you to create, run, and manage migrations. + +### Installing the Emigrate CLI + + + + ```bash + npm install @emigrate/cli + ``` + + + ```bash + pnpm add @emigrate/cli + ``` + + + ```bash + yarn add @emigrate/cli + ``` + + + ```bash + bun add @emigrate/cli + ``` + + + ```json title="package.json" {3,6} + { + "scripts": { + "emigrate": "emigrate" + }, + "dependencies": { + "@emigrate/cli": "*" + } + } + ``` + + + +### Existing commands + + + + + + + + +