@vulcantech/cms 0.3.0 → 0.4.0
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 +5 -4
- package/dist/analytics.d.mts +7 -0
- package/dist/analytics.d.ts +7 -0
- package/dist/index.d.mts +0 -2
- package/dist/index.d.ts +0 -2
- package/package.json +6 -6
- package/src/collections.ts +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ Nine entry points: one namespaced root and eight subpaths. Every subpath is a th
|
|
|
21
21
|
| `@vulcantech/cms/collections` | `@vulcantech/collections` | server | `fetchCollectionItems`, `fetchCollectionItemBySlug`, `fetchCollections`, `sanitizeHtml`, tag helpers, `PortfolioItemData` | [README](https://www.npmjs.com/package/@vulcantech/collections) |
|
|
22
22
|
| `@vulcantech/cms/seo-files` | `@vulcantech/seo-files` | server | `createSeoFileRoute`, `fetchSeoFiles`, `tagsForSeoFiles`, `SeoFilesPayload` | [README](https://www.npmjs.com/package/@vulcantech/seo-files) |
|
|
23
23
|
| `@vulcantech/cms/forms` | `@vulcantech/forms` | client | `DynamicForm`, `FormDefinition`, `buildYupSchema`, `buildInitialValues`, transform/crypto helpers | [README](https://www.npmjs.com/package/@vulcantech/forms) |
|
|
24
|
-
| `@vulcantech/cms/banners` | `@vulcantech/banners` | client | `CMSBanners`, `BannerBar`, `BannerData` | [README](https://www.npmjs.com/package/@vulcantech/banners) |
|
|
24
|
+
| `@vulcantech/cms/banners` | `@vulcantech/banners` | client | `SiteBanners`, `CMSBanners`, `BannerBar`, `BannerData` | [README](https://www.npmjs.com/package/@vulcantech/banners) |
|
|
25
25
|
| `@vulcantech/cms/analytics` | `@vulcantech/analytics` | client | `AnalyticsTracker`, `trackEvent`, `trackFormSubmit`, … | [README](https://www.npmjs.com/package/@vulcantech/analytics) |
|
|
26
26
|
| `@vulcantech/cms/analytics/tags` | `@vulcantech/analytics/tags` | server | `CMSTags` (async server component), `fetchTrackingTags`, `TrackingTags` | ↑ same |
|
|
27
27
|
| `@vulcantech/cms/analytics/route` | `@vulcantech/analytics/route` | server | `POST` / `OPTIONS` — the `/api/a` ingest proxy | ↑ same |
|
|
@@ -47,7 +47,7 @@ Direct named imports, and the required form inside `"use client"` files:
|
|
|
47
47
|
|
|
48
48
|
```tsx
|
|
49
49
|
import { DynamicForm } from "@vulcantech/cms/forms";
|
|
50
|
-
import {
|
|
50
|
+
import { SiteBanners } from "@vulcantech/cms/banners";
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Route files re-export as usual:
|
|
@@ -91,6 +91,7 @@ One key per site, scoped in the CMS dashboard (Settings → API keys). Grant onl
|
|
|
91
91
|
| --- | --- |
|
|
92
92
|
| `blog:read` | `@vulcantech/cms/blog` |
|
|
93
93
|
| `portfolio:read` | `@vulcantech/cms/collections` |
|
|
94
|
+
| `media:read` | `@vulcantech/cms/collections` (`fetchMediaItems` only) |
|
|
94
95
|
| `seo-files:read` | `@vulcantech/cms/seo-files` |
|
|
95
96
|
| `analytics:read` | `@vulcantech/cms/analytics/tags` (`CMSTags`) |
|
|
96
97
|
| `analytics:write` | `@vulcantech/cms/analytics/route` (event ingest) |
|
|
@@ -114,7 +115,7 @@ Verified per module:
|
|
|
114
115
|
| `analytics/tags` — `fetchTrackingTags` / `CMSTags` | `null` (renders nothing) | No |
|
|
115
116
|
| `analytics/route` — `POST` | `503` unconfigured, `400` bad body, `204` when the CMS send fails | No |
|
|
116
117
|
| `forms` — `DynamicForm` | catches its own submit errors → error state + `onError(err)` | No (nothing reaches an error boundary) |
|
|
117
|
-
| `banners` — `CMSBanners` / `BannerBar` | n/a — presentational only, no I/O | No |
|
|
118
|
+
| `banners` — `SiteBanners` / `CMSBanners` / `BannerBar` | n/a — presentational only, no I/O | No |
|
|
118
119
|
|
|
119
120
|
**The one exception.** In `blog` and `collections`, the response-body parse (`res.json()`) sits outside the `try` that guards the request. A `2xx` response whose body is not JSON — a proxy or CDN returning an HTML error page under a 200 — rejects rather than degrading. Transport failures, non-2xx statuses, 404s, and unconfigured env are all handled. `seo-files` and `analytics/tags` guard the parse too and have no such gap.
|
|
120
121
|
|
|
@@ -127,7 +128,7 @@ Not every integration ships its own fetch layer — this trips up planning, so c
|
|
|
127
128
|
|
|
128
129
|
**You write the fetcher** — the package ships only the renderer, and your app owns the ISR-cached fetch against the CMS API:
|
|
129
130
|
- **`forms`** → fetch `GET {CMS_URL}/api/forms` into `src/lib/cms/forms.ts`, pass the `FormDefinition` to `<DynamicForm>`.
|
|
130
|
-
- **`banners`** → fetch `GET {CMS_URL}/api/banners` into `src/lib/cms/banners.ts`, pass `BannerData[]` to `<
|
|
131
|
+
- **`banners`** → fetch `GET {CMS_URL}/api/banners` into `src/lib/cms/banners.ts`, pass `BannerData[]` to `<SiteBanners>` (path-aware, so page targeting works).
|
|
131
132
|
|
|
132
133
|
Both leaf READMEs carry a copy-paste implementation. Keep them fail-open (`return []` / `null` on error) to match the convention above.
|
|
133
134
|
|
package/dist/analytics.d.mts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export * from '@vulcantech/analytics';
|
|
2
|
+
import '@vulcantech/analytics/route';
|
|
3
|
+
import '@vulcantech/analytics/tags';
|
|
4
|
+
import '@vulcantech/banners';
|
|
5
|
+
import '@vulcantech/blog';
|
|
6
|
+
import '@vulcantech/collections';
|
|
7
|
+
import '@vulcantech/forms';
|
|
8
|
+
import '@vulcantech/seo-files';
|
package/dist/analytics.d.ts
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
1
|
export * from '@vulcantech/analytics';
|
|
2
|
+
import '@vulcantech/analytics/route';
|
|
3
|
+
import '@vulcantech/analytics/tags';
|
|
4
|
+
import '@vulcantech/banners';
|
|
5
|
+
import '@vulcantech/blog';
|
|
6
|
+
import '@vulcantech/collections';
|
|
7
|
+
import '@vulcantech/forms';
|
|
8
|
+
import '@vulcantech/seo-files';
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulcantech/cms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Umbrella entry point for the VulcanTech CMS integration packages — one dependency, radix-ui-style imports for blog, collections, forms, banners, analytics, and seo-files.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -79,11 +79,11 @@
|
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
81
|
"dependencies": {
|
|
82
|
-
"@vulcantech/analytics": "^0.
|
|
83
|
-
"@vulcantech/banners": "^0.
|
|
84
|
-
"@vulcantech/blog": "^0.
|
|
85
|
-
"@vulcantech/collections": "^0.
|
|
86
|
-
"@vulcantech/forms": "^0.
|
|
82
|
+
"@vulcantech/analytics": "^0.2.0",
|
|
83
|
+
"@vulcantech/banners": "^0.2.0",
|
|
84
|
+
"@vulcantech/blog": "^0.3.0",
|
|
85
|
+
"@vulcantech/collections": "^0.3.0",
|
|
86
|
+
"@vulcantech/forms": "^0.4.0",
|
|
87
87
|
"@vulcantech/seo-files": "^0.1.3"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
package/src/collections.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* import { fetchCollectionItems } from "@vulcantech/cms/collections";
|
|
6
6
|
*
|
|
7
7
|
* SERVER-ONLY: reads VULCANTECH_PROJECT_ID / VULCANTECH_API_KEY (scope
|
|
8
|
-
* `portfolio:read`). The fetchers fail soft (`[]` / `null` + a warning)
|
|
8
|
+
* `portfolio:read`; `media:read` for `fetchMediaItems`). The fetchers fail soft (`[]` / `null` + a warning)
|
|
9
9
|
* rather than throwing. Item shape and `displayMode` rules: the
|
|
10
10
|
* @vulcantech/collections README.
|
|
11
11
|
*/
|