@vulcantech/cms 0.1.0 → 0.3.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 CHANGED
@@ -1,23 +1,34 @@
1
1
  # @vulcantech/cms
2
2
 
3
- Umbrella entry point for the VulcanTech CMS integration packages — one dependency, `radix-ui`-style imports. Re-exports (nothing lives here except re-export files):
3
+ One dependency for every VulcanTech CMS integration — blog, collections, forms, banners, analytics, and SEO files — with `radix-ui`-style imports.
4
4
 
5
- | Subpath | Wraps | Side |
6
- | --- | --- | --- |
7
- | `@vulcantech/cms/blog` | `@vulcantech/blog` | server |
8
- | `@vulcantech/cms/collections` | `@vulcantech/collections` | server |
9
- | `@vulcantech/cms/seo-files` | `@vulcantech/seo-files` | server |
10
- | `@vulcantech/cms/forms` | `@vulcantech/forms` | client |
11
- | `@vulcantech/cms/banners` | `@vulcantech/banners` | client |
12
- | `@vulcantech/cms/analytics` | `@vulcantech/analytics` | client |
13
- | `@vulcantech/cms/analytics/tags` | `@vulcantech/analytics/tags` | server |
14
- | `@vulcantech/cms/analytics/route` | `@vulcantech/analytics/route` | server |
5
+ ```bash
6
+ npm install @vulcantech/cms
7
+ ```
8
+
9
+ Ships ESM + CJS + type declarations. This package is a **pure re-export layer**: the six integration packages are regular dependencies and stay external in the build, so nothing is bundled twice and each is also installable standalone (`@vulcantech/blog`, `@vulcantech/forms`, …) if you only need one.
10
+
11
+ > **Where the real docs are.** This README covers what the umbrella adds: the entry-point map, the shared env contract, and the failure-mode convention. The **data contract for each integration — field shapes, filters, render rules — lives in the wrapped package's README**, linked in the table below. Read that one before writing render code.
15
12
 
16
- Not included (app-internal, not consumer integrations): `blog-editor-shared`, `seo-board-shared`, `ui`, `server`.
13
+ ## Entry points
17
14
 
18
- ## Import styles
15
+ Nine entry points: one namespaced root and eight subpaths. Every subpath is a thin `export *` of the package it wraps, so the named exports, types, and behavior are identical to importing that package directly.
19
16
 
20
- **Namespaced root** — server components, layouts, route handlers:
17
+ | Entry point | Wraps | Runtime | What it gives you | Full docs |
18
+ | --- | --- | --- | --- | --- |
19
+ | `@vulcantech/cms` | all six | server | `Blog` / `Collections` / `Forms` / `Banners` / `Analytics` / `SeoFiles` namespaces | — |
20
+ | `@vulcantech/cms/blog` | `@vulcantech/blog` | server | `fetchBlogPosts`, `fetchBlogPostBySlug`, `resolvePreviewToken`, the draft-preview `GET`, `sanitizeHtml`, tag helpers, `CMSBlogPost` | [README](https://www.npmjs.com/package/@vulcantech/blog) |
21
+ | `@vulcantech/cms/collections` | `@vulcantech/collections` | server | `fetchCollectionItems`, `fetchCollectionItemBySlug`, `fetchCollections`, `sanitizeHtml`, tag helpers, `PortfolioItemData` | [README](https://www.npmjs.com/package/@vulcantech/collections) |
22
+ | `@vulcantech/cms/seo-files` | `@vulcantech/seo-files` | server | `createSeoFileRoute`, `fetchSeoFiles`, `tagsForSeoFiles`, `SeoFilesPayload` | [README](https://www.npmjs.com/package/@vulcantech/seo-files) |
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) |
25
+ | `@vulcantech/cms/analytics` | `@vulcantech/analytics` | client | `AnalyticsTracker`, `trackEvent`, `trackFormSubmit`, … | [README](https://www.npmjs.com/package/@vulcantech/analytics) |
26
+ | `@vulcantech/cms/analytics/tags` | `@vulcantech/analytics/tags` | server | `CMSTags` (async server component), `fetchTrackingTags`, `TrackingTags` | ↑ same |
27
+ | `@vulcantech/cms/analytics/route` | `@vulcantech/analytics/route` | server | `POST` / `OPTIONS` — the `/api/a` ingest proxy | ↑ same |
28
+
29
+ ### Namespaced root
30
+
31
+ For server components, layouts, and route handlers:
21
32
 
22
33
  ```tsx
23
34
  import { Blog, Collections } from "@vulcantech/cms";
@@ -26,42 +37,141 @@ const posts = await Blog.fetchBlogPosts();
26
37
  const html = Blog.sanitizeHtml(post.content); // Collections.sanitizeHtml stays distinct
27
38
  ```
28
39
 
29
- **Subpaths** — direct named imports; required inside `"use client"` files:
40
+ The six namespaces are exactly `Analytics`, `Banners`, `Blog`, `Collections`, `Forms`, `SeoFiles` (note the casing of `SeoFiles`).
41
+
42
+ **The root maps only the six package roots.** `CMSTags` and the analytics `POST`/`OPTIONS` handlers live on `@vulcantech/analytics`'s own subpaths, so they are *not* reachable as `Analytics.CMSTags` — import them from `@vulcantech/cms/analytics/tags` and `@vulcantech/cms/analytics/route`.
43
+
44
+ ### Subpaths
45
+
46
+ Direct named imports, and the required form inside `"use client"` files:
30
47
 
31
48
  ```tsx
32
49
  import { DynamicForm } from "@vulcantech/cms/forms";
33
50
  import { CMSBanners } from "@vulcantech/cms/banners";
34
51
  ```
35
52
 
36
- Rule of thumb: the root barrel imports every package, including the server fetch layers (`next/server`, `next/headers`). From client components always use the subpath, so server modules stay out of the client graph. Route files re-export as usual:
53
+ Route files re-export as usual:
37
54
 
38
55
  ```ts
56
+ // app/api/a/route.ts
39
57
  export { POST, OPTIONS } from "@vulcantech/cms/analytics/route";
58
+
59
+ // app/api/preview/route.ts (blog draft preview)
60
+ export { GET } from "@vulcantech/cms/blog";
40
61
  ```
41
62
 
42
- ## External usage (npm)
63
+ ### Server vs client
43
64
 
44
- Published to npm under the `vulcantech` org (leaf packages first, umbrella last — `scripts/publish-cms-packages.sh` at the repo root does both in order):
65
+ The root barrel imports every package, including the server-side fetch layers (blog, collections, and the blog preview route import `next/headers` / `next/server`). **Import the root only from server components, layouts, and route handlers.** From a `"use client"` file, import the subpath you need so server modules stay out of the client graph.
45
66
 
46
- ```bash
47
- npm install @vulcantech/cms
48
- ```
67
+ The three `client` rows above are `"use client"` component packages — they are safe to render from a server component, but their exports are client-side.
49
68
 
50
- External consumers get built `dist/` (ESM + CJS + d.ts) for the umbrella and every leaf package; no transpilation or aliasing needed.
69
+ ## Environment contract
51
70
 
52
- ## Adopting in a monorepo consumer app
71
+ All CMS-reading modules resolve config from `process.env` **at call time** (not at import time), so a missing var degrades at request scope rather than at build.
53
72
 
54
- The umbrella re-exports **by package name**, so every existing webpack/turbopack alias and tsconfig `paths` mapping for the underlying packages keeps applying — nothing is resolved twice.
73
+ | Var | Required | Read by | Notes |
74
+ | --- | --- | --- | --- |
75
+ | `VULCANTECH_PROJECT_ID` | yes | blog, collections, seo-files, analytics/tags, analytics/route | Your CMS project id |
76
+ | `VULCANTECH_API_KEY` | yes | same as above | Server-only — **never** prefix with `NEXT_PUBLIC_` |
77
+ | `VULCANTECH_CMS_URL` | no | same as above | CMS origin; defaults to `https://cms.vulcantech.io` |
78
+ | `VULCANTECH_BLOG_NO_CACHE` | no | blog only | `1` / `true` bypasses ISR on every blog fetch (debugging) |
79
+ | `VULCANTECH_REVALIDATE_SECRET` | no* | your `api/revalidate` route | Shared secret the CMS sends on every ISR purge. *Required for instant invalidation — see [ISR revalidation](#isr-revalidation) |
80
+ | `NEXT_PUBLIC_GA_ID` | no | analytics/tags | Per-field fallback when the CMS omits `ga4Id` |
81
+ | `NEXT_PUBLIC_GOOGLE_ADS_ID` | no | analytics/tags | Fallback for `googleAdsId` |
82
+ | `NEXT_PUBLIC_META_PIXEL_ID` | no | analytics/tags | Fallback for `metaPixelId` |
55
83
 
56
- 1. **package.json** — add `"@vulcantech/cms": "*"`. The six underlying packages come in transitively; keep direct deps only if you still import them directly.
57
- 2. **next.config** — add `"@vulcantech/cms"` to `transpilePackages`, and alias its subpaths to `packages/cms/src/*` the same way the app already aliases the leaf packages — `dist/` is gitignored, so inside Docker builds only `src/` exists (the banners-extraction gotcha).
58
- 3. **tsconfig `paths`** — keep/add the source mappings for the underlying packages you use, plus `"@vulcantech/cms": ["../../packages/cms/src/index.ts"]` and `"@vulcantech/cms/*": ["../../packages/cms/src/*"]`; see `smoke/tsconfig.json` here for the leaf-package set.
59
- 4. **Dockerfile** — `COPY packages/cms` in the deps stage, next to the other `packages/*` COPY lines (same frozen-lockfile gotcha as the banners extraction).
84
+ **`@vulcantech/cms/forms` and `@vulcantech/cms/banners` read no environment variables at all** — they are pure renderers. The env vars their READMEs list are consumed by the server fetcher *your app* writes (see [Fetching](#fetching-what-is-included-and-what-you-write) below); `VULCANTECH_FORMS_NO_CACHE` in particular is an app-side convention, not a package feature.
60
85
 
61
- ## Verifying
86
+ ### API-key scopes
62
87
 
63
- ```bash
64
- yarn workspace @vulcantech/cms typecheck
65
- ```
88
+ One key per site, scoped in the CMS dashboard (Settings → API keys). Grant only what you use — an unscoped request gets a 403 and the caller degrades to its empty/fallback path.
89
+
90
+ | Scope | Needed by |
91
+ | --- | --- |
92
+ | `blog:read` | `@vulcantech/cms/blog` |
93
+ | `portfolio:read` | `@vulcantech/cms/collections` |
94
+ | `seo-files:read` | `@vulcantech/cms/seo-files` |
95
+ | `analytics:read` | `@vulcantech/cms/analytics/tags` (`CMSTags`) |
96
+ | `analytics:write` | `@vulcantech/cms/analytics/route` (event ingest) |
97
+ | `forms:read` | your app's form-definition fetcher |
98
+ | `banners:read` | your app's banner fetcher |
99
+ | `contact:write` | your app's form-submission proxy to the CMS `/api/contact` |
100
+
101
+ ## Failure-mode convention
102
+
103
+ **Every CMS read in this package fails soft: it logs a `console.warn` and returns an empty/`null`/fallback value instead of throwing.** A CMS outage, a missing env var, a 404, or a revoked scope degrades the page, it never crashes the render. So do not wrap these calls in `try`/`catch` and do not build error UI around them — that branch can never fire. Handle the *empty* case instead: render an empty state on a list, and call `notFound()` on a `null` single item.
104
+
105
+ Verified per module:
106
+
107
+ | Module | On failure | Throws? |
108
+ | --- | --- | --- |
109
+ | `blog` — `fetchBlogPosts` / `fetchBlogPostBySlug` | `[]` / `null` + warning | No, except the JSON-parse caveat below |
110
+ | `blog` — `GET` (preview route) | 400 on missing params; redirect to the public URL on an invalid token | No |
111
+ | `collections` — all three fetchers | `[]` / `null` + warning | No, except the JSON-parse caveat below |
112
+ | `seo-files` — `fetchSeoFiles` | `null` + warning | No |
113
+ | `seo-files` — `createSeoFileRoute().GET` | serves the app's `fallback` string | No |
114
+ | `analytics/tags` — `fetchTrackingTags` / `CMSTags` | `null` (renders nothing) | No |
115
+ | `analytics/route` — `POST` | `503` unconfigured, `400` bad body, `204` when the CMS send fails | No |
116
+ | `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
+
119
+ **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
+ ## Fetching: what is included, and what you write
122
+
123
+ Not every integration ships its own fetch layer — this trips up planning, so check here first.
124
+
125
+ **Fetch included** — call the exported function and you are done:
126
+ `blog`, `collections`, `seo-files`, `analytics/tags`, `analytics/route`.
127
+
128
+ **You write the fetcher** — the package ships only the renderer, and your app owns the ISR-cached fetch against the CMS API:
129
+ - **`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 `<CMSBanners>`.
131
+
132
+ Both leaf READMEs carry a copy-paste implementation. Keep them fail-open (`return []` / `null` on error) to match the convention above.
133
+
134
+ ## ISR revalidation
135
+
136
+ Every CMS-reading fetch is tagged so the CMS can purge it the moment content changes. Without the wiring below **edits are not lost, just slow**: each fetch simply waits out its revalidate window (60s for blog, tracking tags, and the app-side forms/banners fetchers; 3600s for SEO files). With it, the CMS pushes a purge to your site the instant content is saved.
137
+
138
+ This is one piece of wiring per site, shared by every integration. Do it once, even if you only use the blog:
139
+
140
+ **1. Add the secret** — set `VULCANTECH_REVALIDATE_SECRET` in the consumer site's env to any long random string.
141
+
142
+ **2. Add the webhook route** `src/app/api/revalidate/route.ts`. No package exports one; copy `apps/castlerents/src/app/api/revalidate/route.ts` (the reference implementation). The contract the CMS speaks:
143
+
144
+ - `POST`, JSON body `{ projectId, tags: string[], paths?: string[], slug?, formId? }`.
145
+ - Header `x-revalidate-secret` must equal `VULCANTECH_REVALIDATE_SECRET`; answer `401` otherwise, `503` if the env var is unset, `400` if neither `tags` nor `paths` is given.
146
+ - Call `revalidateTag(tag, "default")` for every tag and `revalidatePath(path)` for every path, then respond `{ revalidated: true, tags, paths, at }`.
147
+
148
+ The CMS fires this fire-and-forget with a 5s timeout, so a slow or failing route never blocks a save.
149
+
150
+ **3. Register the site in the CMS** — Dashboard → **Settings → Form Consumers (ISR Revalidation)**. Add an entry with the site's full route URL (`https://example.com/api/revalidate`) and paste the same secret. Use the **Test** button on the entry to confirm a `200`.
151
+
152
+ > The section is named "Form Consumers" for historical reasons — forms were the first integration to revalidate — but it is the **single fan-out list for every dispatcher**: blog, forms, banners, SEO files, and tracking tags all POST to every entry. A blog-only site still has to register here.
153
+
154
+ | Integration | Tags purged | Paths purged |
155
+ | --- | --- | --- |
156
+ | blog | `blog:{projectId}`, `blog:{projectId}:{slug}` (and the previous slug on rename) | `/blog` |
157
+ | seo-files | `seo-files:{projectId}` | `/robots.txt`, `/llms.txt` |
158
+ | analytics/tags | `tracking-tags:{projectId}` | — |
159
+ | forms (app-side) | `forms:{projectId}`, `form:{projectId}:{formId}` | — |
160
+ | banners (app-side) | `banners:{projectId}` | — |
161
+ | collections | `portfolio:{projectId}`, `collection:{projectId}:{slug}`, `item:{projectId}:{slug}` | **no dispatcher** — fetches expire on the 60s window only |
162
+
163
+ ## Gotchas
164
+
165
+ - **Tailwind sources for forms.** The form renderer's utility classes live in `@vulcantech/forms`, not in this package's `dist` (the six packages stay external). Point Tailwind at the leaf package even when you only installed the umbrella — Tailwind v4: `@source "../node_modules/@vulcantech/forms/dist";`. Without it, forms render unstyled.
166
+ - **`sanitizeHtml` is not one function.** Blog and collections each export their own; the namespaced root keeps them distinct (`Blog.sanitizeHtml` vs `Collections.sanitizeHtml`). Both fetch layers already sanitize what they return, so you only need these for CMS HTML obtained some other way.
167
+ - **Blog and collections content is sanitized HTML, not markdown.** Render with `dangerouslySetInnerHTML`; a markdown renderer will mangle it. See the blog README for the full field contract.
168
+ - **`robots.ts` conflicts with `robots.txt/route.ts`.** When adopting `seo-files`, delete any Next Metadata `src/app/robots.ts` or the build fails.
169
+
170
+ ## Notes
171
+
172
+ - The root export uses namespaces rather than a flat barrel because sibling packages intentionally share export names (e.g. `Blog.sanitizeHtml` / `Collections.sanitizeHtml`).
173
+ - The six integration packages are declared as normal dependencies and marked external in the build, so deduping and version resolution behave as usual — installing the umbrella alongside a leaf package does not duplicate it.
174
+
175
+ ## Contributing
66
176
 
67
- `yarn workspace @vulcantech/cms smoke` typechecks a consumer-style import of every subpath through the real `exports` map.
177
+ Developed in the VulcanTech monorepo. Workspace-specific setup (source aliasing, Docker builds, publishing) lives in `MONOREPO.md` there.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vulcantech/cms",
3
- "version": "0.1.0",
3
+ "version": "0.3.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",
@@ -12,55 +12,55 @@
12
12
  "types": "./dist/index.d.ts",
13
13
  "import": "./dist/index.mjs",
14
14
  "require": "./dist/index.js",
15
- "default": "./src/index.ts"
15
+ "default": "./dist/index.mjs"
16
16
  },
17
17
  "./blog": {
18
18
  "types": "./dist/blog.d.ts",
19
19
  "import": "./dist/blog.mjs",
20
20
  "require": "./dist/blog.js",
21
- "default": "./src/blog.ts"
21
+ "default": "./dist/blog.mjs"
22
22
  },
23
23
  "./collections": {
24
24
  "types": "./dist/collections.d.ts",
25
25
  "import": "./dist/collections.mjs",
26
26
  "require": "./dist/collections.js",
27
- "default": "./src/collections.ts"
27
+ "default": "./dist/collections.mjs"
28
28
  },
29
29
  "./forms": {
30
30
  "types": "./dist/forms.d.ts",
31
31
  "import": "./dist/forms.mjs",
32
32
  "require": "./dist/forms.js",
33
- "default": "./src/forms.ts"
33
+ "default": "./dist/forms.mjs"
34
34
  },
35
35
  "./banners": {
36
36
  "types": "./dist/banners.d.ts",
37
37
  "import": "./dist/banners.mjs",
38
38
  "require": "./dist/banners.js",
39
- "default": "./src/banners.ts"
39
+ "default": "./dist/banners.mjs"
40
40
  },
41
41
  "./analytics": {
42
42
  "types": "./dist/analytics.d.ts",
43
43
  "import": "./dist/analytics.mjs",
44
44
  "require": "./dist/analytics.js",
45
- "default": "./src/analytics.ts"
45
+ "default": "./dist/analytics.mjs"
46
46
  },
47
47
  "./analytics/tags": {
48
48
  "types": "./dist/analytics/tags.d.ts",
49
49
  "import": "./dist/analytics/tags.mjs",
50
50
  "require": "./dist/analytics/tags.js",
51
- "default": "./src/analytics/tags.ts"
51
+ "default": "./dist/analytics/tags.mjs"
52
52
  },
53
53
  "./analytics/route": {
54
54
  "types": "./dist/analytics/route.d.ts",
55
55
  "import": "./dist/analytics/route.mjs",
56
56
  "require": "./dist/analytics/route.js",
57
- "default": "./src/analytics/route.ts"
57
+ "default": "./dist/analytics/route.mjs"
58
58
  },
59
59
  "./seo-files": {
60
60
  "types": "./dist/seo-files.d.ts",
61
61
  "import": "./dist/seo-files.mjs",
62
62
  "require": "./dist/seo-files.js",
63
- "default": "./src/seo-files.ts"
63
+ "default": "./dist/seo-files.mjs"
64
64
  }
65
65
  },
66
66
  "files": [
@@ -79,16 +79,20 @@
79
79
  "access": "public"
80
80
  },
81
81
  "dependencies": {
82
- "@vulcantech/analytics": "^0.1.0",
83
- "@vulcantech/banners": "^0.1.0",
84
- "@vulcantech/blog": "^0.1.0",
85
- "@vulcantech/collections": "^0.1.0",
86
- "@vulcantech/forms": "^0.1.0",
87
- "@vulcantech/seo-files": "^0.1.0"
82
+ "@vulcantech/analytics": "^0.1.2",
83
+ "@vulcantech/banners": "^0.1.3",
84
+ "@vulcantech/blog": "^0.2.2",
85
+ "@vulcantech/collections": "^0.2.0",
86
+ "@vulcantech/forms": "^0.3.0",
87
+ "@vulcantech/seo-files": "^0.1.3"
88
88
  },
89
89
  "devDependencies": {
90
90
  "tsconfig": "*",
91
91
  "tsup": "^8.5.1",
92
92
  "typescript": "^5.9.3"
93
+ },
94
+ "repository": {
95
+ "type": "git",
96
+ "url": "git+https://github.com/vulcantech/vulcantech.git"
93
97
  }
94
98
  }
@@ -1,2 +1,15 @@
1
- /** Direct named re-exports of `@vulcantech/analytics/route` — `export { POST, OPTIONS } from "@vulcantech/cms/analytics/route"`. */
1
+ /**
2
+ * `@vulcantech/cms/analytics/route` — direct named re-exports of
3
+ * `@vulcantech/analytics/route`.
4
+ *
5
+ * // app/api/a/route.ts
6
+ * export { POST, OPTIONS } from "@vulcantech/cms/analytics/route";
7
+ *
8
+ * SERVER: the App Router proxy that forwards tracker events to the CMS from
9
+ * the site's own domain. Reads VULCANTECH_PROJECT_ID / VULCANTECH_API_KEY
10
+ * (scope `analytics:write`). Never throws — 503 when unconfigured, 400 on a
11
+ * bad body, 204 otherwise (including when the CMS send fails).
12
+ *
13
+ * Not reachable from the root barrel's `Analytics` namespace; use this subpath.
14
+ */
2
15
  export * from "@vulcantech/analytics/route";
@@ -1,2 +1,14 @@
1
- /** Direct named re-exports of `@vulcantech/analytics/tags` — `import { CMSTags } from "@vulcantech/cms/analytics/tags"`. */
1
+ /**
2
+ * `@vulcantech/cms/analytics/tags` — direct named re-exports of
3
+ * `@vulcantech/analytics/tags`.
4
+ *
5
+ * import { CMSTags } from "@vulcantech/cms/analytics/tags";
6
+ *
7
+ * SERVER: `CMSTags` is an async server component that injects the project's
8
+ * GA4 / Google Ads / Meta Pixel tags. Reads VULCANTECH_PROJECT_ID /
9
+ * VULCANTECH_API_KEY (scope `analytics:read`), with per-field NEXT_PUBLIC_*
10
+ * fallbacks. Never throws — renders `null` when nothing is configured.
11
+ *
12
+ * Not reachable from the root barrel's `Analytics` namespace; use this subpath.
13
+ */
2
14
  export * from "@vulcantech/analytics/tags";
package/src/analytics.ts CHANGED
@@ -1,2 +1,11 @@
1
- /** Direct named re-exports of `@vulcantech/analytics` — `import { ... } from "@vulcantech/cms/analytics"`. */
1
+ /**
2
+ * `@vulcantech/cms/analytics` — direct named re-exports of
3
+ * `@vulcantech/analytics`.
4
+ *
5
+ * import { AnalyticsTracker, trackEvent } from "@vulcantech/cms/analytics";
6
+ *
7
+ * CLIENT: the first-party tracker component and its imperative track helpers.
8
+ * The server-side halves live on their own subpaths — `../analytics/tags`
9
+ * (CMSTags) and `../analytics/route` (the ingest proxy).
10
+ */
2
11
  export * from "@vulcantech/analytics";
package/src/banners.ts CHANGED
@@ -1,2 +1,12 @@
1
- /** Direct named re-exports of `@vulcantech/banners` — `import { ... } from "@vulcantech/cms/banners"`. */
1
+ /**
2
+ * `@vulcantech/cms/banners` — direct named re-exports of
3
+ * `@vulcantech/banners`.
4
+ *
5
+ * import { CMSBanners } from "@vulcantech/cms/banners";
6
+ *
7
+ * CLIENT: `"use client"` presentational components, no I/O and no env vars.
8
+ * Your app fetches `BannerData[]` from the CMS `/api/banners` (scope
9
+ * `banners:read`) and passes it in — see the @vulcantech/banners README for a
10
+ * copy-paste fetcher.
11
+ */
2
12
  export * from "@vulcantech/banners";
package/src/blog.ts CHANGED
@@ -1,2 +1,12 @@
1
- /** Direct named re-exports of `@vulcantech/blog` — `import { ... } from "@vulcantech/cms/blog"`. */
1
+ /**
2
+ * `@vulcantech/cms/blog` — direct named re-exports of `@vulcantech/blog`.
3
+ *
4
+ * import { fetchBlogPosts } from "@vulcantech/cms/blog";
5
+ *
6
+ * SERVER-ONLY: reads VULCANTECH_PROJECT_ID / VULCANTECH_API_KEY (scope
7
+ * `blog:read`) and imports next/headers — import from server components and
8
+ * route handlers only. The fetchers fail soft (`[]` / `null` + a warning)
9
+ * rather than throwing. Post shape and render rules: the @vulcantech/blog
10
+ * README.
11
+ */
2
12
  export * from "@vulcantech/blog";
@@ -1,2 +1,12 @@
1
- /** Direct named re-exports of `@vulcantech/collections` — `import { ... } from "@vulcantech/cms/collections"`. */
1
+ /**
2
+ * `@vulcantech/cms/collections` — direct named re-exports of
3
+ * `@vulcantech/collections`.
4
+ *
5
+ * import { fetchCollectionItems } from "@vulcantech/cms/collections";
6
+ *
7
+ * SERVER-ONLY: reads VULCANTECH_PROJECT_ID / VULCANTECH_API_KEY (scope
8
+ * `portfolio:read`). The fetchers fail soft (`[]` / `null` + a warning)
9
+ * rather than throwing. Item shape and `displayMode` rules: the
10
+ * @vulcantech/collections README.
11
+ */
2
12
  export * from "@vulcantech/collections";
package/src/forms.ts CHANGED
@@ -1,2 +1,14 @@
1
- /** Direct named re-exports of `@vulcantech/forms` — `import { ... } from "@vulcantech/cms/forms"`. */
1
+ /**
2
+ * `@vulcantech/cms/forms` — direct named re-exports of `@vulcantech/forms`.
3
+ *
4
+ * import { DynamicForm } from "@vulcantech/cms/forms";
5
+ *
6
+ * CLIENT: `"use client"` renderer components. This package reads no env vars
7
+ * and ships no fetch layer — your app fetches the `FormDefinition` from the
8
+ * CMS `/api/forms` (scope `forms:read`) and passes it in. `DynamicForm`
9
+ * catches its own submit errors and surfaces them via `onError`.
10
+ *
11
+ * Tailwind must scan `@vulcantech/forms/dist` (not this package's dist) or
12
+ * the renderer's classes are never generated. See the @vulcantech/forms README.
13
+ */
2
14
  export * from "@vulcantech/forms";
package/src/index.ts CHANGED
@@ -15,6 +15,16 @@
15
15
  * layouts. From "use client" components, import the subpath you need
16
16
  * instead — e.g. `@vulcantech/cms/forms` — so server modules stay out
17
17
  * of the client graph.
18
+ *
19
+ * The root maps only the six package ROOTS. `@vulcantech/analytics`'s own
20
+ * subpaths are not folded into the `Analytics` namespace, so `CMSTags` and
21
+ * the ingest `POST`/`OPTIONS` are reachable only via
22
+ * `@vulcantech/cms/analytics/tags` and `@vulcantech/cms/analytics/route`.
23
+ *
24
+ * Shared config for every CMS-reading module: VULCANTECH_PROJECT_ID and
25
+ * VULCANTECH_API_KEY (required), VULCANTECH_CMS_URL (optional). The fetch
26
+ * layers fail soft — a CMS outage or missing env logs a warning and returns
27
+ * an empty/null/fallback value rather than throwing. See README.md.
18
28
  */
19
29
  export * as Analytics from "@vulcantech/analytics";
20
30
  export * as Banners from "@vulcantech/banners";
package/src/seo-files.ts CHANGED
@@ -1,2 +1,12 @@
1
- /** Direct named re-exports of `@vulcantech/seo-files` — `import { ... } from "@vulcantech/cms/seo-files"`. */
1
+ /**
2
+ * `@vulcantech/cms/seo-files` — direct named re-exports of
3
+ * `@vulcantech/seo-files`.
4
+ *
5
+ * export const { GET } = createSeoFileRoute({ type: "robots", fallback });
6
+ *
7
+ * SERVER-ONLY: reads VULCANTECH_PROJECT_ID / VULCANTECH_API_KEY (scope
8
+ * `seo-files:read`). Never throws — an unreachable or empty CMS serves the
9
+ * app-supplied `fallback` string instead. Fallback semantics: the
10
+ * @vulcantech/seo-files README.
11
+ */
2
12
  export * from "@vulcantech/seo-files";