@lukoweb/apitogo 0.1.74 → 0.1.76

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.
@@ -3,52 +3,38 @@ title: Make config (CLI)
3
3
  navigation_label: Make config
4
4
  sidebar_icon: file-cog
5
5
  description:
6
- Scaffold package.json and tsconfig when missing, optionally wire OpenAPI, then refresh navigation
7
- and redirects from your Markdown pages while preserving other config options.
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 can **bootstrap a minimal project** (new `package.json` and
11
- `tsconfig.json` when missing, **`npm install`** then **`npm run dev`**), **add an `apis` block**
12
- when it finds an OpenAPI spec and your config has none yet, and **regenerate `navigation` and
13
- `redirects`** from your `pages/` tree. Other existing settings (such as **`site`** or **`theme`**)
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
- :::note{title="Portal sites need apitogo.config.json"}
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 you can run npm scripts** — If there is no **`package.json`**, it creates one with
27
- **`apitogo dev`**, **`apitogo build`**, **`apitogo preview`**, and adds **`react`**,
28
- **`react-dom`**, and **`@lukoweb/apitogo`** if missing. If **`tsconfig.json`** is missing, it
29
- adds a minimal TypeScript config that includes your config file and **`pages/`**. After a new
30
- `package.json` is created, run **`npm install`** (or pnpm/yarn), then **`npm run dev`**.
31
- 2. **Wires OpenAPI when possible** — If it finds an OpenAPI file (for example
32
- **`apis/openapi.json`** or **`openapi.json`** at the project root) and your config has no
33
- **`apis`** entry yet, it adds an **`apis`** block pointing at that file. Existing **`apis`**
34
- settings are not overwritten.
35
- 3. **Finds or creates a config file** — It looks for an existing `apitogo.config.*` file in the
36
- project root. If **none** exists, it creates one with **`docs.files`** for your pages glob,
37
- optional **`apis`** when a spec was found, plus empty **`navigation`** and **`redirects`**, then
38
- fills nav and redirects from disk.
39
- 4. **Rebuilds `navigation`** — Builds a tree from `.md` / `.mdx` files under your pages directory,
40
- including nested folders as categories, and adds the usual Documentation category plus API link
41
- block used by the generator.
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. Other nav items are kept. Use **`--force`** to rebuild Documentation items
30
+ from disk (API Reference is still kept when OpenAPI is wired).
31
+ 5. **Wires OpenAPI** when a spec is found (or confirmed in interactive mode):
32
+ `apis: [{ type: "file", input, path: "api" }]` and a top-level **API Reference** link to `/api` if
33
+ that link is missing.
48
34
 
49
35
  ## Usage
50
36
 
51
- Run from your project root (where the config and `package.json` live):
37
+ Run from your project root (where `apitogo.config.json` and `package.json` live):
52
38
 
53
39
  ```bash
54
40
  apitogo make-config
@@ -56,42 +42,34 @@ apitogo make-config
56
42
 
57
43
  ### Options
58
44
 
59
- | Option | Description |
60
- | ------------------- | ------------------------------------------------------------------------------------------------------------- |
61
- | `--pages-dir <dir>` | Folder to scan for `.md` / `.mdx` files (default: `pages`). Paths in `navigation` are derived from this tree. |
62
- | `--dir <path>` | Project root (default: current directory). Useful in monorepos or scripts. |
45
+ | Option | Description |
46
+ | ------------------------- | --------------------------------------------------------------------------- |
47
+ | `--pages-dir <dir>` | Folder to scan for `.md` / `.mdx` / `.tsx` (default: `pages`) |
48
+ | `--dir <path>` | Project root (default: current directory) |
49
+ | `--interactive` / `-i` | Prompt for title, logo alt, auth, fonts, primary colors, and OpenAPI |
50
+ | `--title <string>` | Set `site.title` |
51
+ | `--site <json>` | Deep-merge a JSON object into `site` |
52
+ | `--theme <json>` | Deep-merge a JSON object into `theme` |
53
+ | `--authentication <json>` | Deep-merge a JSON object into `authentication` (secrets stay in `.env`) |
54
+ | `--force` | Replace Documentation nav items from disk |
63
55
 
64
56
  Examples:
65
57
 
66
58
  ```bash
67
- apitogo make-config --pages-dir content
68
- apitogo make-config --dir ./my-docs-site
59
+ apitogo make-config --title "Books API"
60
+ apitogo make-config --theme '{"light":{"primary":"#111111"}}'
61
+ apitogo make-config --interactive
69
62
  ```
70
63
 
71
- ## Requirements
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.
64
+ There is **no `--modules` flag**. Edit `modules` in `apitogo.config.json` if you need to change
65
+ landing or user panel later.
86
66
 
87
67
  ## When not to use it
88
68
 
89
- - You need a **fully custom** navigation order or labels per page that the generator would
90
- overwrite. Run the command once to get a baseline, then edit—or maintain navigation manually.
91
- - You use **only** OpenAPI-driven sidebars and no Markdown docs tree; there may be nothing useful to
92
- scan under `pages/`.
69
+ - You need a fully custom navigation order — skip `--force` or maintain navigation by hand.
70
+ - You want to change landing or user-panel module options — edit JSON (or use MCP), not this command.
93
71
 
94
72
  ## See also
95
73
 
96
- - [Navigation](./navigation.md) — Navigation item types, icons, and rules
97
- - [Documentation (pages)](./docs.md) — How file paths map to URLs
74
+ - [Manifest (`apitogo.config.json`)](./manifest.md)
75
+ - [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 rebuild **`navigation`** and **`redirects`** from
62
- your Markdown files. See **[Make config (CLI)](./make-config.md)** for full usage, options, and
63
- behavior (including creating `apitogo.config.json` when no config exists, and which settings are left
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` replaces the **values** of the `navigation` and `redirects` arrays. If you rely on a
69
- fully hand-written navigation, review the generated result before committing it.
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
 
@@ -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)). Portal sites still need `apitogo.config.json` —
81
- [Manifest](./configuration/manifest.md). Site-only deploy with a token:
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).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.74",
3
+ "version": "0.1.76",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",