@lukoweb/apitogo 0.1.75 → 0.1.77
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/cli.js +692 -422
- package/docs/configuration/make-config.mdx +44 -64
- package/docs/configuration/navigation.mdx +5 -6
- package/docs/quickstart.md +2 -3
- package/package.json +1 -1
|
@@ -3,52 +3,40 @@ title: Make config (CLI)
|
|
|
3
3
|
navigation_label: Make config
|
|
4
4
|
sidebar_icon: file-cog
|
|
5
5
|
description:
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
Create or update apitogo.config.json from your pages folder, OpenAPI, and optional site, theme, and
|
|
7
|
+
authentication settings.
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
The **`apitogo make-config`** command
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
`
|
|
14
|
-
stay as you left them unless you are creating files for the first time.
|
|
10
|
+
The **`apitogo make-config`** command writes **`apitogo.config.json`**. It can scaffold a portal
|
|
11
|
+
project (package.json, tsconfig, landing and user-panel stubs, thin `apitogo.config.tsx`) when those
|
|
12
|
+
files are missing, merge **site / theme / authentication** from flags or an interactive wizard, scan
|
|
13
|
+
`pages/` for navigation, and wire OpenAPI plus an **API Reference** link.
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
For portal / MCP products you need **`apitogo.config.json`** for site, modules, plans, and auth —
|
|
19
|
-
see [Manifest](./manifest.md) or scaffold with `npm create @lukoweb/apitogo@latest` /
|
|
20
|
-
[MCP](../mcp/overview.md).
|
|
21
|
-
|
|
22
|
-
:::
|
|
15
|
+
Landing and user panel are **always enabled** on new configs. The command does **not** change
|
|
16
|
+
`modules` from the CLI and **never edits `redirects`**.
|
|
23
17
|
|
|
24
18
|
## What it does
|
|
25
19
|
|
|
26
|
-
1. **Ensures
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
5. **Sets `redirects`** — Adds a root redirect from `/` to the first page (after a stable sort that
|
|
43
|
-
prefers paths like `introduction` and `getting-started` when present).
|
|
44
|
-
|
|
45
|
-
Other config you already had—**`site`**, **`theme`**, plugins, authentication, etc.—is **left
|
|
46
|
-
unchanged**. The command replaces only the **values** of the **`navigation`** and **`redirects`**
|
|
47
|
-
arrays. If **`apis`** was already set, it is not modified.
|
|
20
|
+
1. **Ensures npm scripts** — Creates **`package.json`** (dev / build / preview) and **`tsconfig.json`**
|
|
21
|
+
when missing, including `@lukoweb/apitogo`, landing, user-panel, and billing packages.
|
|
22
|
+
2. **Creates `apitogo.config.json`** when missing, using the current portal template (`site`,
|
|
23
|
+
`theme`, `authentication`, `modules.docs`, **landing on**, **user panel on**). Creates a thin
|
|
24
|
+
**`apitogo.config.tsx`** wrapper only if that file does not already exist (existing TSX is left
|
|
25
|
+
alone).
|
|
26
|
+
3. **Patches site, theme, and auth** from `--site`, `--theme`, `--authentication`, `--title`, or
|
|
27
|
+
`--interactive`.
|
|
28
|
+
4. **Merges `navigation`** from `.md` / `.mdx` / `.tsx` files under your pages directory into a
|
|
29
|
+
Documentation category when those files exist. **Missing or empty `pages/` is fine** (common for
|
|
30
|
+
portal-only sites) — existing navigation is left alone. Other nav items are kept. Use
|
|
31
|
+
**`--force`** to rebuild Documentation items from disk when pages are present (API Reference is
|
|
32
|
+
still kept when OpenAPI is wired).
|
|
33
|
+
5. **Wires OpenAPI** when a spec is found (or confirmed in interactive mode):
|
|
34
|
+
`apis: [{ type: "file", input, path: "api" }]` and a top-level **API Reference** link to `/api` if
|
|
35
|
+
that link is missing.
|
|
48
36
|
|
|
49
37
|
## Usage
|
|
50
38
|
|
|
51
|
-
Run from your project root (where
|
|
39
|
+
Run from your project root (where `apitogo.config.json` and `package.json` live):
|
|
52
40
|
|
|
53
41
|
```bash
|
|
54
42
|
apitogo make-config
|
|
@@ -56,42 +44,34 @@ apitogo make-config
|
|
|
56
44
|
|
|
57
45
|
### Options
|
|
58
46
|
|
|
59
|
-
| Option
|
|
60
|
-
|
|
|
61
|
-
| `--pages-dir <dir>`
|
|
62
|
-
| `--dir <path>`
|
|
47
|
+
| Option | Description |
|
|
48
|
+
| ------------------------- | --------------------------------------------------------------------------- |
|
|
49
|
+
| `--pages-dir <dir>` | Folder to scan for `.md` / `.mdx` / `.tsx` (default: `pages`) |
|
|
50
|
+
| `--dir <path>` | Project root (default: current directory) |
|
|
51
|
+
| `--interactive` / `-i` | Prompt for title, logo alt, auth, fonts, primary colors, and OpenAPI |
|
|
52
|
+
| `--title <string>` | Set `site.title` |
|
|
53
|
+
| `--site <json>` | Deep-merge a JSON object into `site` |
|
|
54
|
+
| `--theme <json>` | Deep-merge a JSON object into `theme` |
|
|
55
|
+
| `--authentication <json>` | Deep-merge a JSON object into `authentication` (secrets stay in `.env`) |
|
|
56
|
+
| `--force` | Replace Documentation nav items from disk |
|
|
63
57
|
|
|
64
58
|
Examples:
|
|
65
59
|
|
|
66
60
|
```bash
|
|
67
|
-
apitogo make-config --
|
|
68
|
-
apitogo make-config --
|
|
61
|
+
apitogo make-config --title "Books API"
|
|
62
|
+
apitogo make-config --theme '{"light":{"primary":"#111111"}}'
|
|
63
|
+
apitogo make-config --interactive
|
|
69
64
|
```
|
|
70
65
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
- **`navigation` and `redirects` must be array literals** in the config (e.g.
|
|
74
|
-
`navigation: [ ... ]`). If your navigation is computed from variables or imported from another
|
|
75
|
-
module, `make-config` cannot update it safely—maintain those by hand or switch to generated arrays
|
|
76
|
-
when you want this workflow.
|
|
77
|
-
- If your file has **`navigation`** but no **`redirects`**, the command inserts `redirects: []`
|
|
78
|
-
before updating. If **both** are missing, it inserts empty arrays after
|
|
79
|
-
`const config: ApitogoConfig = {`.
|
|
80
|
-
|
|
81
|
-
## Relationship to navigation
|
|
82
|
-
|
|
83
|
-
The **`navigation`** array structure and item types (`link`, `category`, doc paths as strings, and
|
|
84
|
-
so on) are the same as when you [configure navigation by hand](./navigation.md). The CLI only
|
|
85
|
-
**generates** that structure from your files; it does not add new concepts.
|
|
66
|
+
There is **no `--modules` flag**. Edit `modules` in `apitogo.config.json` if you need to change
|
|
67
|
+
landing or user panel later.
|
|
86
68
|
|
|
87
69
|
## When not to use it
|
|
88
70
|
|
|
89
|
-
- You need a
|
|
90
|
-
|
|
91
|
-
- You use **only** OpenAPI-driven sidebars and no Markdown docs tree; there may be nothing useful to
|
|
92
|
-
scan under `pages/`.
|
|
71
|
+
- You need a fully custom navigation order — skip `--force` or maintain navigation by hand.
|
|
72
|
+
- You want to change landing or user-panel module options — edit JSON (or use MCP), not this command.
|
|
93
73
|
|
|
94
74
|
## See also
|
|
95
75
|
|
|
96
|
-
- [
|
|
97
|
-
- [
|
|
76
|
+
- [Manifest (`apitogo.config.json`)](./manifest.md)
|
|
77
|
+
- [Navigation](./navigation.md)
|
|
@@ -58,15 +58,14 @@ one of several types. At the simplest level you may only have links and categori
|
|
|
58
58
|
|
|
59
59
|
## Generate navigation automatically
|
|
60
60
|
|
|
61
|
-
Use the CLI command **`apitogo make-config`** to
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
untouched).
|
|
61
|
+
Use the CLI command **`apitogo make-config`** to merge **`navigation`** from your pages folder into
|
|
62
|
+
`apitogo.config.json`. See **[Make config (CLI)](./make-config.md)** for usage. The command does **not**
|
|
63
|
+
change **`redirects`**.
|
|
65
64
|
|
|
66
65
|
::::caution
|
|
67
66
|
|
|
68
|
-
`make-config`
|
|
69
|
-
|
|
67
|
+
Without `--force`, `make-config` only **adds missing** Documentation items. `--force` rebuilds
|
|
68
|
+
Documentation items from disk but still keeps other nav entries such as API Reference.
|
|
70
69
|
|
|
71
70
|
::::
|
|
72
71
|
|
package/docs/quickstart.md
CHANGED
|
@@ -77,6 +77,5 @@ npm run dev
|
|
|
77
77
|
```
|
|
78
78
|
|
|
79
79
|
For an existing `pages/` + OpenAPI folder: `apitogo make-config` (see
|
|
80
|
-
[Make config](./configuration/make-config.mdx)).
|
|
81
|
-
[
|
|
82
|
-
[Deploy with APIToGo CLI](./deploy/apitogo.md).
|
|
80
|
+
[Make config](./configuration/make-config.mdx)). That command writes `apitogo.config.json`. Site-only
|
|
81
|
+
deploy with a token: [Deploy with APIToGo CLI](./deploy/apitogo.md).
|