@hostinger/mcp 4.0.3 → 4.0.5
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/CHANGELOG.md +14 -0
- package/gemini-extension.json +1 -1
- package/package.json +1 -1
- package/server.json +2 -2
- package/skills/headless/SKILL.md +9 -16
- package/skills/headless/VERSION +2 -2
- package/skills/headless/steps/01-check-state/SKILL.md +9 -51
- package/skills/headless/steps/02-refine/SKILL.md +4 -22
- package/skills/headless/steps/03-provision/SKILL.md +6 -54
- package/skills/headless/steps/03-provision/wordpress/SKILL.md +9 -147
- package/skills/headless/steps/04-content-model/SKILL.md +4 -72
- package/skills/headless/steps/04-content-model/ecommerce/SKILL.md +1 -1
- package/skills/headless/steps/04-content-model/images-unsplash.md +74 -0
- package/skills/headless/steps/04-content-model/wordpress/contact-form.md +76 -11
- package/skills/headless/steps/04-content-model/wordpress/woocommerce.md +48 -1
- package/skills/headless/steps/05-design/SKILL.md +32 -79
- package/skills/headless/steps/05-design/bring-your-own-frontend.md +11 -0
- package/skills/headless/steps/05-design/keep-look.md +37 -0
- package/skills/headless/steps/06-frontend/SKILL.md +15 -56
- package/skills/headless/steps/06-frontend/bring-your-own-frontend.md +13 -0
- package/skills/headless/steps/06-frontend/ecommerce.md +16 -0
- package/skills/headless/steps/07-validate/SKILL.md +3 -13
- package/skills/headless/steps/08-deploy/SKILL.md +8 -33
- package/skills/headless/steps/09-done/SKILL.md +7 -22
- package/src/core/skills.js +77 -42
- package/src/core/skills.ts +77 -42
- package/src/servers/agency-hosting.js +1 -1
- package/src/servers/agency-hosting.ts +1 -1
- package/src/servers/agent-readiness.js +1 -1
- package/src/servers/agent-readiness.ts +1 -1
- package/src/servers/all.js +1 -1
- package/src/servers/all.ts +1 -1
- package/src/servers/billing.js +1 -1
- package/src/servers/billing.ts +1 -1
- package/src/servers/dns.js +1 -1
- package/src/servers/dns.ts +1 -1
- package/src/servers/domains.js +1 -1
- package/src/servers/domains.ts +1 -1
- package/src/servers/ecommerce.js +1 -1
- package/src/servers/ecommerce.ts +1 -1
- package/src/servers/gpu.js +1 -1
- package/src/servers/gpu.ts +1 -1
- package/src/servers/horizons.js +1 -1
- package/src/servers/horizons.ts +1 -1
- package/src/servers/hosting.js +1 -1
- package/src/servers/hosting.ts +1 -1
- package/src/servers/mail.js +1 -1
- package/src/servers/mail.ts +1 -1
- package/src/servers/reach.js +1 -1
- package/src/servers/reach.ts +1 -1
- package/src/servers/vps.js +1 -1
- package/src/servers/vps.ts +1 -1
- package/src/servers/wordpress.js +1 -1
- package/src/servers/wordpress.ts +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# headless — Ecommerce storefront (frontend)
|
|
2
|
+
|
|
3
|
+
Read from [`SKILL.md`](SKILL.md) Step 3 when `site.json → backend` is `"ecommerce"`.
|
|
4
|
+
|
|
5
|
+
Ecommerce → the **public Hostinger Storefront Core V2 API** (`https://api-ecommerce.hostinger.com/v2`,
|
|
6
|
+
no auth, open CORS), keyed on the **custom sales channel** (`site.json → ecommerce.sales_channel.id`):
|
|
7
|
+
`GET /channels/<scha_*>/products` (prices are **minor units** on variants), `POST /channels/<scha_*>/checkout`
|
|
8
|
+
for buying. Cart is client-side; never embed a token. Read
|
|
9
|
+
`ecommerce_miscellaneous_custom-storefront-setup-instructions` for the authoritative, current guide.
|
|
10
|
+
- **Honour `site.json → ecommerce.payment_enabled`.** When it is `false` (free account / no paid
|
|
11
|
+
Ecommerce plan — see the provision gate), there is **no checkout**: build the full catalog, product
|
|
12
|
+
pages and the client-side cart as normal, but **do not call the checkout endpoint**. Instead render
|
|
13
|
+
a clear, graceful state at the checkout step — e.g. a disabled "Checkout" button with a short note
|
|
14
|
+
like "Online checkout isn't available on this plan yet" (and/or a contact/enquiry fallback). A
|
|
15
|
+
missing checkout is **not** a build error here — never leave the storefront half-built, throw, or
|
|
16
|
+
retry checkout because payment is off. When `payment_enabled` is `true`, wire checkout normally.
|
|
@@ -33,19 +33,9 @@ with an empty catalog means the push didn't land:
|
|
|
33
33
|
count matches the plan. Don't test checkout while `woocommerce.payment_enabled` is `false`.
|
|
34
34
|
- **Ecommerce:** query `urls.storefront_api` for the sales channel → 200 with the seeded products and
|
|
35
35
|
prices *(confirm against the store)*.
|
|
36
|
-
- **Contact form** (`site.json → contact_form.enabled`):
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
`status` is **`mail_sent`**. This is the one place a real send happens, so one test email reaches the
|
|
40
|
-
owner — not several. `mail_failed` is a real finding: surface it to the user (CF7 is wired, but
|
|
41
|
-
`wp_mail` delivery/SPF needs attention — a Hostinger mailbox on the domain is the most reliable
|
|
42
|
-
recipient) and log it as an issue. A `validation_failed` means the test payload didn't match the form's
|
|
43
|
-
fields — fix the field names in `site.json`, not the plugin.
|
|
44
|
-
**Then check the honeypot:** POST a **second** throwaway submission with the same valid fields **plus**
|
|
45
|
-
`contact_form.honeypot_field` **filled**, and assert the `status` is **`spam`** (no mail sent). Keep the
|
|
46
|
-
real fields valid — CF7 validates **before** running the spam filter, so an invalid payload would return
|
|
47
|
-
`validation_failed` and never reach the honeypot check. A `mail_sent` here means the
|
|
48
|
-
`cf7-headless-spamguard` plugin isn't active — surface it and re-check its deploy.
|
|
36
|
+
- **Contact form** (`site.json → contact_form.enabled`): send the two throwaway test submissions in
|
|
37
|
+
[`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §5: the
|
|
38
|
+
first must return `status` **`mail_sent`**, the one with the honeypot filled **`spam`**.
|
|
49
39
|
|
|
50
40
|
Fail or counts off → fix content-model push before building against live data.
|
|
51
41
|
|
|
@@ -56,21 +56,7 @@ Common cases (all `nodeVersion: 22`, `buildScript: "build"`, `packageManager: "n
|
|
|
56
56
|
|
|
57
57
|
SSR/server frameworks run a persistent Node process (root sends `x-powered-by` / `cache-control: no-store`);
|
|
58
58
|
static frameworks serve their output dir as files. If unsure of a framework's output dir, check the
|
|
59
|
-
framework's own build output
|
|
60
|
-
framework's correct values** — don't rely on auto-detection (it returns null → 403).
|
|
61
|
-
|
|
62
|
-
> ## ⚠️ Next.js 16+: build with webpack, not Turbopack (recurring deploy failure)
|
|
63
|
-
> Next.js 16 makes **Turbopack** the default bundler for `next build`. Turbopack's native (Rust)
|
|
64
|
-
> compiler needs a newer **glibc** than the Hostinger build server ships, so the server build aborts
|
|
65
|
-
> with a "glibc too old" error — and Turbopack **does not fall back** to webpack on its own, so the
|
|
66
|
-
> deploy fails every time. **Fix: build with webpack.** On **Next.js 16+** the project's `build` script
|
|
67
|
-
> in `package.json` must be `next build --webpack` (not plain `next build`); `buildScript` on the deploy
|
|
68
|
-
> call stays `"build"` — that's what runs it. The `--webpack` flag exists only on Next.js 16+; on
|
|
69
|
-
> **Next.js 15.x** leave the build script as plain `next build` (it already defaults to webpack).
|
|
70
|
-
> **Confirm this in `package.json` before deploying** (the frontend step scaffolds it this way — see
|
|
71
|
-
> `../06-frontend`). Alternative, only if you must avoid the `--webpack` flag: pin Next.js to `15.x`
|
|
72
|
-
> (keeping plain `next build`), whose `next build` still defaults to webpack. Next.js only — other
|
|
73
|
-
> frameworks are unaffected.
|
|
59
|
+
framework's own build output.
|
|
74
60
|
|
|
75
61
|
## Step 1 — Pre-flight
|
|
76
62
|
|
|
@@ -80,8 +66,8 @@ framework's correct values** — don't rely on auto-detection (it returns null
|
|
|
80
66
|
2. **Build output exists locally** (the framework's output dir — e.g. `.next/`, `dist/`, `.output/`) and
|
|
81
67
|
the project builds clean (frontend/validate already did this). If not, go back.
|
|
82
68
|
- **Next.js 16+:** `package.json`'s `build` script is `next build --webpack`, not plain `next build` —
|
|
83
|
-
the server's glibc can't run Turbopack's native compiler
|
|
84
|
-
as plain `next build`. Fix it here if it isn't.
|
|
69
|
+
the server's glibc can't run Turbopack's native compiler, and Turbopack doesn't fall back to webpack
|
|
70
|
+
(see `../06-frontend/SKILL.md` Step 3). On Next.js 15.x leave it as plain `next build`. Fix it here if it isn't.
|
|
85
71
|
3. **Env vars (only if used).** Build-time vars (e.g. `NEXT_PUBLIC_*`) must be set **before** the build
|
|
86
72
|
with `hosting_nodejs_replace-environment-variables` (full replace). Never put secrets in the repo or
|
|
87
73
|
the archive. **Webapp with a database:** that full replace wipes the `DB_*`/`DATABASE_URL` that
|
|
@@ -152,9 +138,11 @@ Pass the framework's build settings **inline** on the deploy call — there is n
|
|
|
152
138
|
|
|
153
139
|
`hosting_deploy` uploads the source and triggers `npm install` + the build **end-to-end** — do not call
|
|
154
140
|
any upload or build operation yourself. It returns a build `buildUuid` at once. This **overwrites the
|
|
155
|
-
website root** (expected) and keeps `/cms` intact. `type` is always `"nodejs"` for a headless site
|
|
156
|
-
|
|
157
|
-
|
|
141
|
+
website root** (expected) and keeps `/cms` intact. `type` is always `"nodejs"` for a headless site, with the explicit `appType`/`outputDirectory` from
|
|
142
|
+
*Build configurations* —
|
|
143
|
+
**never `"static"`**, which serves the build as plain files over the document root and **overwrites
|
|
144
|
+
`/cms`**, destroying the WordPress backend. A static-built SPA (Vite/React/Vue) still deploys as
|
|
145
|
+
`type: "nodejs"` with its `appType`.
|
|
158
146
|
|
|
159
147
|
## Step 4 — Wait for the build and the live root
|
|
160
148
|
|
|
@@ -242,19 +230,6 @@ No secrets in `deploy.json`. The `urls.cms` field and the `backend_preserved` ch
|
|
|
242
230
|
|
|
243
231
|
Update `state.json` (`stage` → `done`), then continue to Step 9 (done).
|
|
244
232
|
|
|
245
|
-
---
|
|
246
|
-
|
|
247
|
-
## Gate — a headless deploy is always `type: "nodejs"`, never `type: "static"`
|
|
248
|
-
|
|
249
|
-
**Hard rule, check it before every deploy:** a headless site is deployed **only** with
|
|
250
|
-
`type: "nodejs"` plus the explicit `appType`/`outputDirectory`/`nodeVersion`/`buildScript`/
|
|
251
|
-
`packageManager`/`rootDirectory` from the table. **Never pass `type: "static"` on a headless site** — it
|
|
252
|
-
serves the build as plain files over the document root and **overwrites `/cms`**, destroying the
|
|
253
|
-
WordPress backend (this is the "accidentally cleared cms" failure). A static-built SPA (Vite/React/Vue)
|
|
254
|
-
still deploys as `type: "nodejs"` with its `appType` — the framework's static output is served correctly
|
|
255
|
-
that way, and `/cms` is preserved. If a flow ever tells you to deploy a headless site as `type:
|
|
256
|
-
"static"`, you are on a stale/legacy skill copy — stop and update the skill (`npx skills update` or the plugin update for an installed skill, or connect's Phase 1 npm install for a web-installed `headless/` folder).
|
|
257
|
-
|
|
258
233
|
`hosting_deploy` on the local server is the only path: give its `path` a local **archive** (`zip`, `tar`,
|
|
259
234
|
`tar.gz`, `tgz`, `7z`) written outside `~/.hostinger/` as in Step 2. There is no separate upload or
|
|
260
235
|
build step to fall back to.
|
|
@@ -57,8 +57,9 @@ Write it in this order:
|
|
|
57
57
|
(`https://<domain>/cms/wp-admin` — the headless WordPress lives under `/cms`), and the **WP Admin
|
|
58
58
|
button in hPanel** (hPanel → the website → *WP Admin*). Note how to **reset the password**: on the
|
|
59
59
|
`/cms/wp-admin` login screen use **"Lost your password?"**, and WordPress emails a reset link to the
|
|
60
|
-
**WordPress admin email** (the address set at install, which the owner already has)
|
|
61
|
-
|
|
60
|
+
**WordPress admin email** (the address set at install, which the owner already has). Optionally, for
|
|
61
|
+
more reliable delivery, they can create a mailbox on the domain (hPanel → *Emails*) and set it as the
|
|
62
|
+
admin address in **wp-admin → Settings → General**.
|
|
62
63
|
**Never print or store a password.** For a **WordPress + WooCommerce** store, this *same* wp-admin
|
|
63
64
|
login is the store admin (wp-admin → WooCommerce → Products/Orders) — do **not** use the Ecommerce
|
|
64
65
|
`store_admin` path; the store setup the owner still needs is spelled out under *Next steps*. For a
|
|
@@ -81,11 +82,6 @@ Write it in this order:
|
|
|
81
82
|
the live site for *this* build: an **SSR** frontend re-reads the REST API each request, so changes
|
|
82
83
|
show up with no redeploy; an **SSG/static** build must be redeployed to pick up new content (read
|
|
83
84
|
`state.json → frontend.rendering`).
|
|
84
|
-
- **Log in later & reset the password:** repeat the two non-expiring routes (the `/cms/wp-admin` login
|
|
85
|
-
URL and hPanel's *WP Admin* button) and the **"Lost your password?"** reset. The reset link goes to
|
|
86
|
-
the **WordPress admin email** — the address set at install, which the owner already has — so nothing
|
|
87
|
-
extra is needed to receive it. Optionally, for more reliable delivery, they can create a mailbox on
|
|
88
|
-
the domain (hPanel → *Emails*) and set it as the admin address in **wp-admin → Settings → General**.
|
|
89
85
|
- **WordPress + WooCommerce — finish store setup so it can take orders.** The catalog and cart already
|
|
90
86
|
work, but **checkout stays off until the owner configures it in wp-admin**: WooCommerce → Settings →
|
|
91
87
|
**Payments** (enable at least one method) and → **Shipping** (add a zone with a rate), then confirm
|
|
@@ -117,10 +113,8 @@ already checked this — this is a quick re-confirm, not a full re-run):
|
|
|
117
113
|
(`site.json → woocommerce.enabled`) also `GET {urls.store_api}/products?per_page=1` → 200; or the
|
|
118
114
|
storefront API for the sales channel → 200 (Ecommerce).
|
|
119
115
|
- **Contact form** (`site.json → contact_form.enabled`): validate already sent a test submission, so
|
|
120
|
-
don't send another here.
|
|
121
|
-
|
|
122
|
-
should be a Hostinger mailbox on the domain. If validate reported `mail_failed`, say so plainly instead
|
|
123
|
-
of claiming the form sends.
|
|
116
|
+
don't send another here. Hand it over as
|
|
117
|
+
[`../04-content-model/wordpress/contact-form.md`](../04-content-model/wordpress/contact-form.md) §6 says.
|
|
124
118
|
|
|
125
119
|
If a check fails, say so in the outcome paragraph and don't claim the site is live.
|
|
126
120
|
|
|
@@ -166,17 +160,10 @@ node <skill>/run-log.mjs <domain> stage-end done ok && \
|
|
|
166
160
|
node <skill>/run-log.mjs <domain> report --outcome <live|stopped|failed> [--tokens '<json>']
|
|
167
161
|
```
|
|
168
162
|
|
|
169
|
-
Then send it to Hostinger
|
|
170
|
-
|
|
171
|
-
exact path and run id. Don't ask first; see *Run log and build report* in the top-level `SKILL.md`
|
|
172
|
-
for failures. Then tell the user in one line: "Sent the build report to Hostinger to help improve
|
|
163
|
+
Then send it to Hostinger as *Run log and build report* in the top-level `SKILL.md` says (for changes asked
|
|
164
|
+
after this report, see *Follow-ups continue the run* there), and tell the user in one line: "Sent the build report to Hostinger to help improve
|
|
173
165
|
the flow." On a 422 say it's saved locally only; on any other failure say it'll be sent next session.
|
|
174
166
|
|
|
175
|
-
If the user asks for more changes after this report in the same session, call
|
|
176
|
-
`run-log.mjs <domain> run-resume --reason "<what they asked for>"` before the work. Then log as
|
|
177
|
-
usual and run `report` again when it's done. It updates this run's report in place, and the report
|
|
178
|
-
lists the follow-up. Send the updated report the same way.
|
|
179
|
-
|
|
180
167
|
- **Outcome:** `live` when the deploy succeeded this run, `failed` when a stage failed and you
|
|
181
168
|
couldn't recover, `stopped` for everything else (the user paused, a dummy or missing step). Leave
|
|
182
169
|
`--outcome` out and the script decides from the log.
|
|
@@ -187,8 +174,6 @@ lists the follow-up. Send the updated report the same way.
|
|
|
187
174
|
a stage that was never logged. Fix what you can: `stage-end` an open stage, or correct a start with
|
|
188
175
|
`stage-fix <stage> --started-ago <time>`, then run `report` again. What you can't fix stays in the report's
|
|
189
176
|
*Logging gaps* section.
|
|
190
|
-
- **Tokens:** only what your tool tells you about your own usage (see *Run log and build report* in
|
|
191
|
-
the top-level `SKILL.md`).
|
|
192
177
|
- In the final report's *Where state lives*, add the path to `report.html` so the user can open it.
|
|
193
178
|
|
|
194
179
|
Do this on every run, including the early stops: those reports are the most useful ones.
|