@lukoweb/apitogo 0.1.76 → 0.1.78

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.
@@ -7,7 +7,7 @@ description:
7
7
  authentication settings.
8
8
  ---
9
9
 
10
- The **`apitogo make-config`** command writes **`apitogo.config.json`**. It can scaffold a portal
10
+ The **`apitogo config`** (alias: `make-config`) command writes **`apitogo.config.json`**. It can scaffold a portal
11
11
  project (package.json, tsconfig, landing and user-panel stubs, thin `apitogo.config.tsx`) when those
12
12
  files are missing, merge **site / theme / authentication** from flags or an interactive wizard, scan
13
13
  `pages/` for navigation, and wire OpenAPI plus an **API Reference** link.
@@ -26,8 +26,10 @@ Landing and user panel are **always enabled** on new configs. The command does *
26
26
  3. **Patches site, theme, and auth** from `--site`, `--theme`, `--authentication`, `--title`, or
27
27
  `--interactive`.
28
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).
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).
31
33
  5. **Wires OpenAPI** when a spec is found (or confirmed in interactive mode):
32
34
  `apis: [{ type: "file", input, path: "api" }]` and a top-level **API Reference** link to `/api` if
33
35
  that link is missing.
@@ -37,7 +39,7 @@ Landing and user panel are **always enabled** on new configs. The command does *
37
39
  Run from your project root (where `apitogo.config.json` and `package.json` live):
38
40
 
39
41
  ```bash
40
- apitogo make-config
42
+ apitogo config
41
43
  ```
42
44
 
43
45
  ### Options
@@ -56,9 +58,9 @@ apitogo make-config
56
58
  Examples:
57
59
 
58
60
  ```bash
59
- apitogo make-config --title "Books API"
60
- apitogo make-config --theme '{"light":{"primary":"#111111"}}'
61
- apitogo make-config --interactive
61
+ apitogo config --title "Books API"
62
+ apitogo config --theme '{"light":{"primary":"#111111"}}'
63
+ apitogo config --interactive
62
64
  ```
63
65
 
64
66
  There is **no `--modules` flag**. Edit `modules` in `apitogo.config.json` if you need to change
@@ -1,145 +1,51 @@
1
- ---
2
- title: Deploy with APIToGo CLI
3
- ---
1
+ # Deploy with APIToGo CLI
4
2
 
5
- [APIToGo](https://apitogo.com) hosts your documentation site. This page covers the **CLI** path
6
- (`apitogo deploy` with a deployment token).
3
+ Publish your local portal (and optional API hub) to the APItoGo platform with
4
+ `apitogo apply`. This is the same engine as MCP `publish_dev_portal`.
7
5
 
8
- For a full API product (plans, `dev-portal` auth, gateway, platform Free / Starter / Professional),
9
- use MCP **`publish_dev_portal`** / `apply_product_intent` mode `goLive` — see
10
- [MCP go-live](../mcp/go-live.md).
6
+ ## Prerequisites
11
7
 
12
- | Path | When |
13
- | ------------------------ | ------------------------------------------------- |
14
- | MCP `publish_dev_portal` | Connected portal + plans + hosting go-live |
15
- | CLI `apitogo deploy` | Build and upload a site with a deployment token |
8
+ - `APITOGO_API_KEY_ID` and `APITOGO_API_SECRET` in the environment
9
+ - A site directory with `apitogo.config.json` (use `apitogo init` / `apitogo config`)
10
+ - Secrets such as OIDC (and Stripe when you have paid plans) in `.env` as
11
+ `APITOGO_CONFIG_AUTHENTICATION__*`
16
12
 
17
- ## Before you deploy
13
+ ## Apply everything
18
14
 
19
15
  ```bash
20
- npm run dev
16
+ apitogo apply
21
17
  ```
22
18
 
23
- ## Deploy with the CLI
19
+ Creates or links the platform project, provisions modules, syncs gateway plans,
20
+ deploys the API hub (when configured), updates the portal backend, and builds +
21
+ deploys the portal frontend.
24
22
 
25
- To publish a site with a deployment token:
26
-
27
- 1. Sign in to [apitogo.com](https://apitogo.com)
28
- 2. Create a new project or open an existing one
29
- 3. Navigate to Project settings and copy the deployment token
30
- 4. Run the following command:
31
-
32
- ```bash
33
- apitogo deploy --deployment-token=<TOKEN> --env=<environment-name>
34
- ```
35
-
36
- The `--env` value is the **environment name** your deploy server uses. It must match what is
37
- configured for your project (see the APIToGo dashboard / deploy API).
38
-
39
- Common patterns:
40
-
41
- - **`production`** — main live site (default when `--env` is omitted)
42
- - **Named non-production environments** — any label your backend accepts, for example `staging`,
43
- `dev`, or `preview`
44
- - **Multiple preview slots** — separate previews such as `preview-a` and `preview-b` when your
45
- `/deploy` endpoint supports them:
46
-
47
- ```bash
48
- apitogo deploy --deployment-token=<TOKEN> --env=preview-a
49
- apitogo deploy --deployment-token=<TOKEN> --env=preview-b
50
- ```
51
-
52
- If you do not provide `--env`, APIToGo deploys to `production` by default:
23
+ ## Target specific resources
53
24
 
54
25
  ```bash
55
- apitogo deploy --deployment-token=<TOKEN>
26
+ apitogo apply --only apihub
27
+ apitogo apply --only portal-backend
28
+ apitogo apply --only portal-frontend
29
+ apitogo apply --only apihub,portal-frontend
30
+ apitogo apply --only portal-frontend --force
56
31
  ```
57
32
 
58
- ### JSON-only mode (`--json-only`)
33
+ | Resource | What it updates |
34
+ | --- | --- |
35
+ | `apihub` | Gateway plans/baseline, API hub package + deploy, public routes |
36
+ | `portal-backend` | Dev-portal module settings and plan catalog |
37
+ | `portal-frontend` | Site build + Static Web App deploy |
59
38
 
60
- Use `--json-only` when you want **machine-readable output** from the whole command (for example
61
- piping to `jq` in CI).
39
+ Omit `--only` to apply all three. Use `--force` to redeploy even when hashes match.
62
40
 
63
- - **Standard output** is a **single JSON value**: on success, the parsed deploy API response (the
64
- same payload the server returns with `?jsonOnly=true`). On failure (including build errors),
65
- stdout is `{"error":"..."}` and the process exits with a non-zero code.
66
- - The CLI **suppresses** normal build and progress logs so they do not mix with that JSON.
67
- - The deploy request still includes `?jsonOnly=true` on the endpoint.
41
+ ## Other useful commands
68
42
 
69
43
  ```bash
70
- apitogo deploy --deployment-token=<TOKEN> --json-only
44
+ apitogo status # account + project + live checks
45
+ apitogo teardown --yes # delete the platform project
46
+ apitogo build # local production build
47
+ apitogo build --preview # preview the production build locally
71
48
  ```
72
49
 
73
- Combine with `--env` as usual (including named previews such as `preview-a`):
74
-
75
- ```bash
76
- apitogo deploy --deployment-token=<TOKEN> --env=preview --json-only
77
- apitogo deploy --deployment-token=<TOKEN> --env=preview-a --json-only
78
- ```
79
-
80
- ## Deploy with GitHub Actions
81
-
82
- You can automate deploys from GitHub so every merge to `main` updates production and every pull
83
- request gets a **preview** URL.
84
-
85
- ### 1. Generate the workflow
86
-
87
- From your documentation project root (the folder that contains `apitogo.config.json` and `package.json`),
88
- run:
89
-
90
- ```bash
91
- apitogo configure-github-workflow
92
- ```
93
-
94
- This creates `.github/workflows/apitogo-deploy.yml` with two jobs:
95
-
96
- - **Preview** — runs on pull requests targeting `main`. It deploys to an environment named like
97
- `preview-pr-<number>` and exposes the preview URL on the GitHub Actions run.
98
- - **Production** — runs on pushes to `main`. It deploys with the default production environment.
99
-
100
- If the file already exists, pass `--force` to overwrite it.
101
-
102
- ### 2. Add your deployment token as a GitHub secret
103
-
104
- 1. In [APIToGo](https://apitogo.com), open your project and copy the **deployment token** from
105
- project settings (the same token you use with `apitogo deploy`).
106
- 2. On GitHub, open your repository → **Settings** → **Secrets and variables** → **Actions**.
107
- 3. Create a new repository secret named **`APITOGO_TOKEN`** and paste the token.
108
-
109
- The generated workflow reads that secret as `${{ secrets.APITOGO_TOKEN }}`.
110
-
111
- ### 3. Optional: GitHub environments
112
-
113
- The workflow references **`preview`** and **`production`**
114
- [environments](https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment).
115
- If you use environment protection rules, create matching environments in the repo settings and
116
- attach reviewers or branch filters as needed. If you do not use environments, the jobs still run;
117
- you can simplify the workflow later to drop `environment:` blocks.
118
-
119
- ### 4. Commit and ship
120
-
121
- Add the new workflow to version control, commit, and push:
122
-
123
- ```bash
124
- git add .github/workflows/apitogo-deploy.yml
125
- git commit -m "Add APIToGo GitHub Actions deploy workflow"
126
- git push
127
- ```
128
-
129
- After that, pushes and pull requests against `main` trigger deploys automatically. You can also run
130
- the workflow manually from the **Actions** tab (**workflow_dispatch**).
131
-
132
- ## What to verify after deployment
133
-
134
- After your site is live, check the following:
135
-
136
- - Navigation load correctly
137
- - Static assets such as images and logos resolve correctly
138
- - OpenAPI references and API playground features load as expected
139
- - Any custom domain or redirects are working properly
140
-
141
- ## Open APIToGo
142
-
143
- To get started, sign in here:
144
-
145
- - [APIToGo Dashboard](https://apitogo.com)
50
+ Multi-environment SWA deploy (`apitogo deploy --env …`) and
51
+ `apitogo configure-github-workflow` are removed. Use `apitogo apply` instead.
@@ -1,22 +1,8 @@
1
- ---
2
- title: Deploying APIToGo
3
- ---
1
+ # Deployment
4
2
 
5
- Choose how you publish:
3
+ | Path | Docs |
4
+ | --- | --- |
5
+ | **CLI** (`apitogo apply`) | [Deploy with APIToGo CLI](./deploy/apitogo.md) |
6
+ | **MCP / agents** | [Go live](./mcp/go-live.md) |
6
7
 
7
- | Path | Guide |
8
- | ---- | ----- |
9
- | **MCP go-live** (portal + plans + hosting) | [MCP go-live](./mcp/go-live.md) |
10
- | **CLI** (`apitogo deploy` + token) | [Deploy with APIToGo CLI](./deploy/apitogo.md) |
11
- | **Static host** (GitHub Pages, upload `dist`) | Below and sibling deploy guides |
12
-
13
- ## Build locally
14
-
15
- Produce static HTML, JavaScript, and CSS for any host:
16
-
17
- ```bash
18
- npm run build
19
- ```
20
-
21
- Output is in `dist/`. Upload that folder, or use [direct upload](./deploy/direct-upload.md) /
22
- [GitHub Pages](./deploy/github-pages.md).
8
+ Local-only builds: `apitogo build` (optional `--preview`). Platform publish is always `apitogo apply`.
@@ -88,7 +88,7 @@ shape → deploy_backend → publish_dev_portal(skipBackendRedeploy: true)
88
88
  | Path | Use when |
89
89
  | ---------------------------- | ----------------------------------------------------- |
90
90
  | MCP `publish_dev_portal` | Full product go-live (plans, auth, hosting, verify) |
91
- | CLI `apitogo deploy` | Build + deploy a site with a deployment token only |
91
+ | CLI `apitogo apply` | Publish config to platform (apihub + portal) |
92
92
 
93
93
  See [Deploy with APIToGo CLI](../deploy/apitogo.md).
94
94
 
@@ -76,6 +76,6 @@ cd your-project-name
76
76
  npm run dev
77
77
  ```
78
78
 
79
- For an existing `pages/` + OpenAPI folder: `apitogo make-config` (see
79
+ For an existing `pages/` + OpenAPI folder: `apitogo config` (see
80
80
  [Make config](./configuration/make-config.mdx)). That command writes `apitogo.config.json`. Site-only
81
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.76",
3
+ "version": "0.1.78",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",