@spillway-cms/brand 0.0.0-stage → 0.1.8

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 KWALL LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,44 @@
1
- # Temporary Holding Version
1
+ # @spillway-cms/brand
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The brand of a [Spillway CMS](https://spillwaycms.com) site for a front end of its own. MIT licensed.
4
+
5
+ Colors, fonts, the type scale, radius, shadow and spacing come from `GET /api/public/brand` as CSS variables (`--sw-color-primary`, `--sw-text-xl`, ...). This package points Tailwind at those variables and writes the stylesheet that defines them, so the front end looks like the site Spillway renders and follows the brand when someone publishes a change under **Structure → Brand**. Dark mode and high contrast keep working through the stylesheet's media blocks.
6
+
7
+ ## The stylesheet
8
+
9
+ ```bash
10
+ npm install -D @spillway-cms/brand
11
+ npx spillway-brand --url https://cms.example.org --out src/spillway-brand.css
12
+ ```
13
+
14
+ Run it before the build (a `prebuild` script) and again when the `brand.published` webhook arrives. `SPILLWAY_URL` works in place of `--url`, `--json brand.json` also writes the brand as JSON, and `--site <key>` picks a site of a multisite instance (with `SPILLWAY_TOKEN`). A run that finds the same brand version writes nothing. Import the file once, in your global CSS or root layout.
15
+
16
+ ## Tailwind v4
17
+
18
+ ```bash
19
+ npx spillway-brand --url https://cms.example.org --out src/spillway-brand.css --tailwind v4
20
+ ```
21
+
22
+ The file then ends with an `@theme inline` block, so `bg-primary`, `text-primary-700`, `font-heading`, `text-xl`, `rounded-brand`, `shadow-brand` and `max-w-content` follow the brand. Import it after `@import "tailwindcss";`.
23
+
24
+ ## Tailwind v3
25
+
26
+ ```js
27
+ // tailwind.config.mjs
28
+ import { fetchBrand, tailwindPreset } from '@spillway-cms/brand';
29
+
30
+ const brand = await fetchBrand(process.env.SPILLWAY_URL);
31
+ export default { presets: [tailwindPreset(brand)], content: ['./src/**/*.{astro,tsx,ts}'] };
32
+ ```
33
+
34
+ Load the stylesheet as well: the preset names the variables, the stylesheet sets them.
35
+
36
+ ## API
37
+
38
+ - `fetchBrand(baseUrl, options?)`: the published brand (`PublicBrand`), through `@spillway-cms/client`.
39
+ - `tailwindPreset(brand)`: a Tailwind v3 preset.
40
+ - `tailwindTheme(brand)`: the Tailwind v4 `@theme inline` block.
41
+ - `brandStylesheet(brand, { tailwind: 'v4' }?)`: the stylesheet the command writes.
42
+ - `brandColors(brand)`, `brandFontSizes(brand)`: the pieces the preset is made of.
43
+
44
+ See [the brand in docs/adapters.md](https://github.com/kwall-llc/spillway-cms/blob/main/docs/adapters.md#the-brand).
package/dist/cli.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ export interface CliResult {
3
+ written: string[];
4
+ version: string;
5
+ unchanged: boolean;
6
+ }
7
+ export declare function run(argv: string[], env?: Record<string, string | undefined>): Promise<CliResult>;
package/dist/cli.js ADDED
@@ -0,0 +1,62 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * spillway-brand: writes a Spillway site's published brand into a front end at build time.
4
+ *
5
+ * spillway-brand --url https://cms.example.org [--out src/spillway-brand.css] [--json src/spillway-brand.json]
6
+ * [--tailwind v4] [--site <key>]
7
+ *
8
+ * `--url` defaults to SPILLWAY_URL; `--site` (multisite) needs SPILLWAY_TOKEN. Run it before the build (a `prebuild` script)
9
+ * and again when the `brand.published` webhook arrives; the stylesheet keeps the version in its first line, and a run that
10
+ * finds the same version leaves the files alone.
11
+ */
12
+ import fs from 'node:fs';
13
+ import path from 'node:path';
14
+ import { brandStylesheet, fetchBrand } from './index.js';
15
+ function parseArgs(argv) {
16
+ const out = {};
17
+ for (let i = 0; i < argv.length; i++) {
18
+ const a = argv[i];
19
+ if (!a.startsWith('--'))
20
+ throw new Error(`unexpected argument: ${a}`);
21
+ const [k, inline] = a.slice(2).split('=', 2);
22
+ const v = inline ?? argv[++i];
23
+ if (v === undefined)
24
+ throw new Error(`--${k} needs a value`);
25
+ out[k] = v;
26
+ }
27
+ return out;
28
+ }
29
+ export async function run(argv, env = process.env) {
30
+ const args = parseArgs(argv);
31
+ const url = args.url ?? env.SPILLWAY_URL;
32
+ if (!url)
33
+ throw new Error('Set --url or SPILLWAY_URL to the Spillway site, e.g. https://cms.example.org');
34
+ if (args.tailwind && args.tailwind !== 'v4')
35
+ throw new Error('--tailwind takes v4 (for Tailwind v3, use tailwindPreset in tailwind.config)');
36
+ const out = args.out ?? 'src/spillway-brand.css';
37
+ const brand = await fetchBrand(url, { ...(env.SPILLWAY_TOKEN ? { token: env.SPILLWAY_TOKEN } : {}), ...(args.site ? { site: args.site } : {}) });
38
+ const previous = fs.existsSync(out) ? fs.readFileSync(out, 'utf8') : '';
39
+ const css = brandStylesheet(brand, args.tailwind === 'v4' ? { tailwind: 'v4' } : {});
40
+ const written = [];
41
+ const write = (file, body) => {
42
+ if (fs.existsSync(file) && fs.readFileSync(file, 'utf8') === body)
43
+ return;
44
+ fs.mkdirSync(path.dirname(path.resolve(file)), { recursive: true });
45
+ fs.writeFileSync(file, body);
46
+ written.push(file);
47
+ };
48
+ write(out, css);
49
+ if (args.json)
50
+ write(args.json, JSON.stringify(brand, null, 2) + '\n');
51
+ return { written, version: brand.version, unchanged: previous === css };
52
+ }
53
+ const invoked = process.argv[1] && /spillway-brand$|cli\.js$/.test(process.argv[1]);
54
+ if (invoked) {
55
+ run(process.argv.slice(2))
56
+ .then((r) => console.log(r.written.length ? `spillway-brand: brand ${r.version} written to ${r.written.join(', ')}` : `spillway-brand: brand ${r.version} unchanged`))
57
+ .catch((err) => {
58
+ console.error(`spillway-brand: ${err instanceof Error ? err.message : String(err)}`);
59
+ process.exit(1);
60
+ });
61
+ }
62
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;GASG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAIzD,SAAS,SAAS,CAAC,IAAc;IAC/B,MAAM,GAAG,GAA2B,EAAE,CAAC;IACvC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAE,CAAC;QACnB,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,EAAE,CAAC,CAAC;QACtE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,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C,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACvB,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,OAAO,eAAe,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,yBAAyB,CAAC,CAAC,OAAO,YAAY,CAAC,CAAC;SACrK,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACtB,OAAO,CAAC,KAAK,CAAC,mBAAmB,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACrF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACP,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @spillway-cms/brand: the brand of a Spillway site for a front end of its own (docs/adapters.md#the-brand).
3
+ *
4
+ * Everything here points at Spillway's CSS variables (`--sw-color-primary`, `--sw-text-xl`, ...) rather than copying their
5
+ * values, so the stylesheet from GET /api/public/brand (`brand.css`) is the one place the values live: a brand change reaches
6
+ * the front end when that stylesheet is refreshed, and dark mode and high contrast keep working through its media blocks.
7
+ *
8
+ * - `tailwindPreset(brand)`: a Tailwind v3 preset (`presets: [tailwindPreset(brand)]`).
9
+ * - `tailwindTheme(brand)`: the same for Tailwind v4, as an `@theme inline { ... }` block for your CSS.
10
+ * - `brandStylesheet(brand, { tailwind: 'v4' })`: brand.css, with the v4 theme appended when asked.
11
+ * - `fetchBrand(baseUrl)`: the published brand, through @spillway-cms/client.
12
+ * - The `spillway-brand` command writes the stylesheet (and the brand as JSON) at build time.
13
+ */
14
+ import { type ClientOptions } from '@spillway-cms/client';
15
+ import { type PublicBrand } from '@spillway-cms/shared';
16
+ export type { PublicBrand } from '@spillway-cms/shared';
17
+ /** The brand's colors as Tailwind colors: `primary` (with `primary-50` to `primary-900` where Spillway makes shades), `text`, `background`, ... */
18
+ export declare function brandColors(brand: Pick<PublicBrand, 'colors'>): Record<string, string | Record<string, string>>;
19
+ /** The type scale as Tailwind font sizes (`text-sm` to `text-3xl` follow the brand). */
20
+ export declare function brandFontSizes(brand: Pick<PublicBrand, 'type'>): Record<string, string>;
21
+ /** A Tailwind v3 preset over Spillway's variables. Load brand.css (see `brandStylesheet`) in the same app. */
22
+ export declare function tailwindPreset(brand: PublicBrand): {
23
+ theme: {
24
+ extend: Record<string, Record<string, unknown>>;
25
+ };
26
+ };
27
+ /** The same for Tailwind v4: an `@theme inline` block mapping Tailwind's theme variables to Spillway's. */
28
+ export declare function tailwindTheme(brand: PublicBrand): string;
29
+ export interface StylesheetOptions {
30
+ /** Append the Tailwind v4 theme block (`tailwindTheme`). */
31
+ tailwind?: 'v4';
32
+ }
33
+ /** brand.css: the brand's own stylesheet (fonts, :root, dark and high-contrast blocks), stamped with the brand version. */
34
+ export declare function brandStylesheet(brand: PublicBrand, opts?: StylesheetOptions): string;
35
+ /** The published brand of the site at `baseUrl` (or `options.baseUrl`), through @spillway-cms/client. */
36
+ export declare function fetchBrand(baseUrl: string, options?: Omit<ClientOptions, 'baseUrl'>): Promise<PublicBrand>;
package/dist/index.js ADDED
@@ -0,0 +1,73 @@
1
+ /**
2
+ * @spillway-cms/brand: the brand of a Spillway site for a front end of its own (docs/adapters.md#the-brand).
3
+ *
4
+ * Everything here points at Spillway's CSS variables (`--sw-color-primary`, `--sw-text-xl`, ...) rather than copying their
5
+ * values, so the stylesheet from GET /api/public/brand (`brand.css`) is the one place the values live: a brand change reaches
6
+ * the front end when that stylesheet is refreshed, and dark mode and high contrast keep working through its media blocks.
7
+ *
8
+ * - `tailwindPreset(brand)`: a Tailwind v3 preset (`presets: [tailwindPreset(brand)]`).
9
+ * - `tailwindTheme(brand)`: the same for Tailwind v4, as an `@theme inline { ... }` block for your CSS.
10
+ * - `brandStylesheet(brand, { tailwind: 'v4' })`: brand.css, with the v4 theme appended when asked.
11
+ * - `fetchBrand(baseUrl)`: the published brand, through @spillway-cms/client.
12
+ * - The `spillway-brand` command writes the stylesheet (and the brand as JSON) at build time.
13
+ */
14
+ import { createClient } from '@spillway-cms/client';
15
+ import { THEME_EXTENDED_CSS_VARS, THEME_TOKEN_CSS_VARS } from '@spillway-cms/shared';
16
+ const ref = (variable) => `var(${variable})`;
17
+ /** The brand's colors as Tailwind colors: `primary` (with `primary-50` to `primary-900` where Spillway makes shades), `text`, `background`, ... */
18
+ export function brandColors(brand) {
19
+ const out = {};
20
+ for (const [name, color] of Object.entries(brand.colors)) {
21
+ const steps = Object.keys(color.shades ?? {});
22
+ out[name] = steps.length ? { DEFAULT: ref(color.variable), ...Object.fromEntries(steps.map((s) => [s, ref(`${color.variable}-${s}`)])) } : ref(color.variable);
23
+ }
24
+ return out;
25
+ }
26
+ /** The type scale as Tailwind font sizes (`text-sm` to `text-3xl` follow the brand). */
27
+ export function brandFontSizes(brand) {
28
+ return Object.fromEntries(brand.type.scale.map((s) => [s.step, ref(s.variable)]));
29
+ }
30
+ /** A Tailwind v3 preset over Spillway's variables. Load brand.css (see `brandStylesheet`) in the same app. */
31
+ export function tailwindPreset(brand) {
32
+ const extend = {
33
+ colors: brandColors(brand),
34
+ fontFamily: { body: [ref(THEME_TOKEN_CSS_VARS.fontBody)], heading: [ref(THEME_TOKEN_CSS_VARS.fontHeading)] },
35
+ fontSize: brandFontSizes(brand),
36
+ borderRadius: { DEFAULT: ref(THEME_TOKEN_CSS_VARS.radius), brand: ref(THEME_TOKEN_CSS_VARS.radius) },
37
+ maxWidth: { content: ref(THEME_TOKEN_CSS_VARS.maxWidth) },
38
+ spacing: { unit: ref(THEME_EXTENDED_CSS_VARS.spaceUnit) },
39
+ };
40
+ if (brand.shadow)
41
+ extend.boxShadow = { DEFAULT: ref(THEME_EXTENDED_CSS_VARS.shadow), brand: ref(THEME_EXTENDED_CSS_VARS.shadow) };
42
+ return { theme: { extend } };
43
+ }
44
+ /** The same for Tailwind v4: an `@theme inline` block mapping Tailwind's theme variables to Spillway's. */
45
+ export function tailwindTheme(brand) {
46
+ const lines = [];
47
+ for (const [name, color] of Object.entries(brand.colors)) {
48
+ lines.push(` --color-${name}: ${ref(color.variable)};`);
49
+ for (const step of Object.keys(color.shades ?? {}))
50
+ lines.push(` --color-${name}-${step}: ${ref(`${color.variable}-${step}`)};`);
51
+ }
52
+ lines.push(` --font-body: ${ref(THEME_TOKEN_CSS_VARS.fontBody)};`, ` --font-heading: ${ref(THEME_TOKEN_CSS_VARS.fontHeading)};`);
53
+ for (const s of brand.type.scale)
54
+ lines.push(` --text-${s.step}: ${ref(s.variable)};`);
55
+ lines.push(` --radius-brand: ${ref(THEME_TOKEN_CSS_VARS.radius)};`, ` --container-content: ${ref(THEME_TOKEN_CSS_VARS.maxWidth)};`, ` --spacing-unit: ${ref(THEME_EXTENDED_CSS_VARS.spaceUnit)};`);
56
+ if (brand.shadow)
57
+ lines.push(` --shadow-brand: ${ref(THEME_EXTENDED_CSS_VARS.shadow)};`);
58
+ return `@theme inline {\n${lines.join('\n')}\n}\n`;
59
+ }
60
+ /** brand.css: the brand's own stylesheet (fonts, :root, dark and high-contrast blocks), stamped with the brand version. */
61
+ export function brandStylesheet(brand, opts = {}) {
62
+ let css = `/* The brand of ${brand.site.name.replace(/\*\//g, '')}, version ${brand.version}. Generated by @spillway-cms/brand from /api/public/brand; do not edit. */\n${brand.css}`;
63
+ if (!css.endsWith('\n'))
64
+ css += '\n';
65
+ if (opts.tailwind === 'v4')
66
+ css += `\n${tailwindTheme(brand)}`;
67
+ return css;
68
+ }
69
+ /** The published brand of the site at `baseUrl` (or `options.baseUrl`), through @spillway-cms/client. */
70
+ export function fetchBrand(baseUrl, options = {}) {
71
+ return createClient({ ...options, baseUrl }).brand();
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+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K,CAAC,GAAG,EAAE,CAAC;IACtL,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,GAAG,IAAI,IAAI,CAAC;IACrC,IAAI,IAAI,CAAC,QAAQ,KAAK,IAAI;QAAE,GAAG,IAAI,KAAK,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;IAC/D,OAAO,GAAG,CAAC;AACb,CAAC;AAED,yGAAyG;AACzG,MAAM,UAAU,UAAU,CAAC,OAAe,EAAE,UAA0C,EAAE;IACtF,OAAO,YAAY,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "@spillway-cms/brand",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.8",
4
+ "description": "The brand of a Spillway CMS site for front ends of their own: a Tailwind preset (v3) and theme (v4) over Spillway's CSS variables, and a build step that writes the brand stylesheet from GET /api/public/brand.",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/kwall-llc/spillway-cms.git",
9
+ "directory": "packages/brand"
10
+ },
11
+ "homepage": "https://github.com/kwall-llc/spillway-cms/tree/main/packages/brand#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/kwall-llc/spillway-cms/issues"
14
+ },
15
+ "type": "module",
16
+ "main": "./dist/index.js",
17
+ "types": "./dist/index.d.ts",
18
+ "bin": {
19
+ "spillway-brand": "./dist/cli.js"
20
+ },
21
+ "exports": {
22
+ ".": {
23
+ "types": "./dist/index.d.ts",
24
+ "import": "./dist/index.js",
25
+ "default": "./dist/index.js"
26
+ }
27
+ },
28
+ "sideEffects": false,
29
+ "files": [
30
+ "dist",
31
+ "README.md",
32
+ "LICENSE"
33
+ ],
34
+ "dependencies": {
35
+ "@spillway-cms/shared": "0.1.8",
36
+ "@spillway-cms/client": "0.1.8"
37
+ },
38
+ "devDependencies": {
39
+ "@types/node": "^22.0.0",
40
+ "typescript": "^5.9.0",
41
+ "vitest": "^3.0.0"
42
+ },
43
+ "engines": {
44
+ "node": ">=18"
45
+ },
46
+ "scripts": {
47
+ "build": "rm -rf dist && tsc -p tsconfig.json && chmod +x dist/cli.js",
48
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p tsconfig.test.json --noEmit",
49
+ "test": "vitest run"
50
+ }
6
51
  }