@towa-digital/storyblok-nuxt-cv 0.1.2 → 0.1.4
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/README.md +14 -12
- package/dist/module.d.mts +1 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -60,7 +60,7 @@ built-in webhook route are on by default.
|
|
|
60
60
|
|
|
61
61
|
Then create a **story publish webhook** in Storyblok
|
|
62
62
|
(Settings → Webhooks, story events) pointing at
|
|
63
|
-
`https://<site>/api/
|
|
63
|
+
`https://<site>/api/storyblok-cv-webhook`, set a secret, and provide it as
|
|
64
64
|
`NUXT_STORYBLOK_CV_WEBHOOK_SECRET`.
|
|
65
65
|
|
|
66
66
|
## Configuration
|
|
@@ -71,8 +71,8 @@ export default defineNuxtConfig({
|
|
|
71
71
|
token: undefined, // default: auto-detected from @storyblok/nuxt config; env NUXT_STORYBLOK_CV_TOKEN
|
|
72
72
|
region: 'eu', // eu | us | ap | ca | cn — or apiHost: 'https://...'
|
|
73
73
|
storage: 'storyblok-cv', // nitro storage mount name
|
|
74
|
-
endpoint: '/api/
|
|
75
|
-
webhook: true, // built-in route /api/
|
|
74
|
+
endpoint: '/api/storyblok-cv', // GET current cv; false to disable
|
|
75
|
+
webhook: true, // built-in route /api/storyblok-cv-webhook; string = custom route; false = use refreshStoryblokCv() yourself
|
|
76
76
|
ttl: false, // e.g. 60_000 — background refresh when the stored cv is older (serverless/multi-instance)
|
|
77
77
|
onStartup: true, // populate the store once at boot
|
|
78
78
|
},
|
|
@@ -146,7 +146,7 @@ Prefer throttling over hard filtering if you reach for this.
|
|
|
146
146
|
Don't trust a single "looks fresh" check. Use the lab method from the audit
|
|
147
147
|
playbook (`docs/detection.md` Step 7): instrumented production build, publish
|
|
148
148
|
via **form mode** (not the visual editor), sample repeatedly, test the warmed
|
|
149
|
-
URL shape. Quick sanity check in production: `GET /api/
|
|
149
|
+
URL shape. Quick sanity check in production: `GET /api/storyblok-cv` before and
|
|
150
150
|
after a publish — the value must change without a restart.
|
|
151
151
|
|
|
152
152
|
## Development
|
|
@@ -166,11 +166,13 @@ npm run release # local: lint + test + build + changelogen + npm publish
|
|
|
166
166
|
|
|
167
167
|
CI and releases run on **Buddy** and are **managed in Buddy** (GUI/API), not
|
|
168
168
|
from a committed file — same as `@towa-digital/storyblok-nuxt-sitemap`. Two
|
|
169
|
-
pipelines: *Test* (runs on branch pushes) and *Release to npm*
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
Release flow:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
workspace — `$npmrc` resolves to its
|
|
169
|
+
pipelines: *Test* (auto-runs on branch pushes) and *Release to npm*
|
|
170
|
+
(**manual/click-to-run** from `main`, publishes the `package.json` version to
|
|
171
|
+
public npm).
|
|
172
|
+
|
|
173
|
+
Release flow: bump the version + changelog on `main` (`npx changelogen
|
|
174
|
+
--release` or edit `package.json`), push, then click **Run** on the *Release to
|
|
175
|
+
npm* pipeline in Buddy. Publish auth comes from a Buddy **FILE variable** named
|
|
176
|
+
`npmrc` (npm auth config) on the project or workspace — `$npmrc` resolves to its
|
|
177
|
+
path, copied to `.npmrc` before publish. Publishing requires the version to be
|
|
178
|
+
new (npm rejects re-publishing an existing version).
|
package/dist/module.d.mts
CHANGED
|
@@ -25,7 +25,7 @@ interface ModuleOptions {
|
|
|
25
25
|
endpoint?: string | false;
|
|
26
26
|
/**
|
|
27
27
|
* Built-in Storyblok publish webhook. `true` registers it at
|
|
28
|
-
* `/api/
|
|
28
|
+
* `/api/storyblok-cv-webhook`, a string sets the route, `false` disables it —
|
|
29
29
|
* then call the auto-imported `refreshStoryblokCv()` from your own webhook
|
|
30
30
|
* handler instead. Requires `NUXT_STORYBLOK_CV_WEBHOOK_SECRET`.
|
|
31
31
|
*/
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const module$1 = defineNuxtModule({
|
|
|
19
19
|
debug: false,
|
|
20
20
|
region: "eu",
|
|
21
21
|
storage: "storyblok-cv",
|
|
22
|
-
endpoint: "/api/
|
|
22
|
+
endpoint: "/api/storyblok-cv",
|
|
23
23
|
webhook: true,
|
|
24
24
|
ttl: false,
|
|
25
25
|
onStartup: true
|
|
@@ -62,7 +62,7 @@ const module$1 = defineNuxtModule({
|
|
|
62
62
|
}
|
|
63
63
|
if (options.webhook) {
|
|
64
64
|
addServerHandler({
|
|
65
|
-
route: typeof options.webhook === "string" ? options.webhook : "/api/
|
|
65
|
+
route: typeof options.webhook === "string" ? options.webhook : "/api/storyblok-cv-webhook",
|
|
66
66
|
method: "post",
|
|
67
67
|
handler: resolver.resolve("./runtime/server/api/webhook.post")
|
|
68
68
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@towa-digital/storyblok-nuxt-cv",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Keeps Storyblok published content fresh on long-running Nuxt servers by bridging the live cache version (cv) to the render client — no redeploy after publish.",
|
|
5
5
|
"repository": "github:towa-digital/storyblok-nuxt-cv",
|
|
6
6
|
"author": {
|