@vulcantech/banners 0.1.0 → 0.1.1
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 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,22 +8,13 @@ Exports: `CMSBanners` (drop-in layout component), `BannerBar` (single bar), and
|
|
|
8
8
|
|
|
9
9
|
Wire banners into a consumer site (Next.js App Router):
|
|
10
10
|
|
|
11
|
-
**1. Add the dependency
|
|
12
|
-
```
|
|
13
|
-
|
|
11
|
+
**1. Add the dependency**:
|
|
12
|
+
```bash
|
|
13
|
+
npm install @vulcantech/banners
|
|
14
14
|
```
|
|
15
|
+
(Inside the VulcanTech monorepo, use the workspace wiring in `MONOREPO.md` instead.)
|
|
15
16
|
|
|
16
|
-
**2.
|
|
17
|
-
```js
|
|
18
|
-
transpilePackages: ["ui", "@vulcantech/banners", /* ... */],
|
|
19
|
-
webpack: (config) => {
|
|
20
|
-
config.resolve.alias["@vulcantech/banners"] = path.join(__dirname, "../../packages/banners");
|
|
21
|
-
return config;
|
|
22
|
-
},
|
|
23
|
-
turbopack: {
|
|
24
|
-
resolveAlias: { "@vulcantech/banners": "./../../packages/banners/index.ts" },
|
|
25
|
-
},
|
|
26
|
-
```
|
|
17
|
+
**2. Set the env** — see [Required env](#required-env) below.
|
|
27
18
|
|
|
28
19
|
**3. Create the server fetcher** `src/lib/cms/banners.ts` (ISR-cached, fails open):
|
|
29
20
|
```ts
|
|
@@ -70,5 +61,4 @@ const banners = await fetchBanners();
|
|
|
70
61
|
None beyond env — banners is fully config-driven from the CMS.
|
|
71
62
|
|
|
72
63
|
### Notes
|
|
73
|
-
- `BannerData` mirrors `apps/vulcantech-cms/src/types/BANNER.ts` — keep in sync.
|
|
74
64
|
- Components are `"use client"`; dismissal persists to `localStorage` (`vulcantech_dismissed_banners`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vulcantech/banners",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "CMS-driven announcement banners for consumer sites — top/bottom positions, page targeting, priority ordering, and dismissible bars backed by localStorage",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"source": "./index.ts",
|