@getvitops/create 0.9.0-alpha.0 → 0.9.0-alpha.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/CHANGELOG.md CHANGED
@@ -1,5 +1,32 @@
1
1
  # @getvitops/create
2
2
 
3
+ ## 0.9.0-alpha.1
4
+
5
+ ### Minor Changes
6
+
7
+ - 24c568b: Escape hatches on every block, a section theme, widget areas, a badges block, Tailwind scanning of package renderers, and a sturdier `vitops audit`.
8
+
9
+ **@getvitops/emdash**
10
+
11
+ - Every `vitops.*` block and `vitops_section` gains three fields: `anchor` (rendered as the `id`, so `#contact` works), `className` (`class_name` on the section type: block-type slugs are lowercase) and `style`. `style` takes CSS custom properties only (`--p-card: 2rem`); any other declaration, and any value containing `url(`, `@`, `{`, `}` or a backslash, is dropped. With the `tailwind` format a class typed in the CMS only works if the site already uses it. They are applied to the block's own outermost element (the grid `<ul>` for `vitops.cards`), never an extra wrapper, so a block's markup is the same whether or not an editor fills them in.
12
+ - `vitops_section` gains a `theme` select: a role, or `<role>:solid`, with readable text chosen by the generator's contrast rules. It overrides `tone`/`color`/`solid`, which stay for existing content. Other site roles still go through `tone`.
13
+ - New `vitops.badges` block (a row of `.badge` or `.tag` labels, each with an optional tone, icon and link) and `vitops.widgetArea` block, plus `<VitopsWidgetArea name level />` from `@getvitops/emdash/astro`. A widget area is content defined once under Widgets and shown wherever it is placed. An area cannot hold another area, and an area containing a `core:*` component widget is rendered by EmDash's own renderer.
14
+ - Existing sites: re-run the block-type seed only on a new database; on an existing one add the `theme`, `anchor`, `className` and `style` fields to the `vitops_section` block type in the admin.
15
+
16
+ **@getvitops/create**: the emdash template seeds `announcement` and `pre-footer` widget areas, renders them in `Layout.astro`, and documents when to use a Section, a block or a widget area. Sites scaffolded earlier add the two `<VitopsWidgetArea>` lines and the `widgetAreas` seed entries by hand.
17
+
18
+ **@getvitops/generator / astro / vite** (`tailwind` format only): the Astro integration now adds `@source` lines for `@getvitops/astro` and `@getvitops/emdash`, because Tailwind v4 does not scan `node_modules`; utilities used only by their renderers (`font-display`, `font-caption`, `font-footnote`) were never emitted and the page silently rendered at body size. New `sources` option on `generate()` and the Vite plugin. A site's `src/package-classes.txt` workaround can be deleted. css and bricks: no change.
19
+
20
+ **@getvitops/cli**: `vitops emdash check-prerender` now also warns when a page uses a type-role class (`font-display`, …) the built CSS has no rule for; `--strict` makes it fail. `vitops audit` checks for its optional packages and a Chromium binary before starting the preview server (so a failed run no longer leaves port 4398 busy), stops the server on Ctrl+C and termination, and takes its page list from the built sitemap, then the menus; the guessed defaults (`/privacy`, `/contact`, …) are used only when neither exists.
21
+
22
+ **@getvitops/utils**: the audit helpers behind the above (`preflight`, `fetchSitemapPaths`, `sitemapLocs`, `pathsFromSitemapLocs`).
23
+
24
+ **@getvitops/core** (all formats): new `.block-anchor` rule gives an anchored block `scroll-margin-top: var(--header-offset, 5rem)`; set `--header-offset` to a sticky header's height. New `widget-area.css` partial. No other consumer-facing change.
25
+
26
+ The other fixed-group packages: no consumer-facing change beyond the above.
27
+
28
+ **Also fixed in the emdash template** (`site.json`): it defined only the `display`, `heading` and `body` type roles while the blocks use `title`, `eyebrow`, `lead`, `caption` and `footnote`, so those rendered at body size with no rule behind them. The roles are added with the reference design system's specs. A site scaffolded earlier adds the same five entries under `designSystem.themes.default.typography.roles`; `vitops emdash check-prerender` now names any that are missing.
29
+
3
30
  ## 0.9.0-alpha.0
4
31
 
5
32
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getvitops/create",
3
- "version": "0.9.0-alpha.0",
3
+ "version": "0.9.0-alpha.1",
4
4
  "description": "Project templates for the Vitops design system — scaffold wired-up sites with `vp create @getvitops`.",
5
5
  "homepage": "https://docs.vitops.ca",
6
6
  "bugs": "https://github.com/getvitops/design-system/issues",
@@ -19,7 +19,7 @@
19
19
  "access": "public"
20
20
  },
21
21
  "devDependencies": {
22
- "@getvitops/generator": "8.3.0-alpha.0"
22
+ "@getvitops/generator": "8.3.0-alpha.1"
23
23
  },
24
24
  "engines": {
25
25
  "node": ">=24"
@@ -29,6 +29,22 @@ prerendered, the Worker serving the admin and API) styled by the Vitops design s
29
29
  tiers provide it, and which block renders it. Override a block's rendering per site with
30
30
  `<PortableText components={{ type: { 'vitops.cards': MyCards } }} />`; hide one with
31
31
  `vitopsEmdash({ blocks: { exclude: [...] } })` in `astro.config.mjs`.
32
+ - **Escape hatches on every block.** Each `vitops.*` block (and the section type) has an
33
+ `anchor` (becomes the `id`, for `#links`), `className` (extra classes — with the tailwind format
34
+ only ones the site already uses) and `style` (CSS custom properties only, e.g. `--p-card: 2rem`;
35
+ anything else is dropped). `vitops_section` also has a `theme`: one pick for a tinted or solid
36
+ backdrop with readable text. Set `--header-offset` to the sticky header's height so anchors
37
+ clear it.
38
+ - **`vitops audit`** needs optional packages and a browser, checked before it starts a server:
39
+ `vp add -D playwright @axe-core/playwright lighthouse && vp exec playwright install chromium`.
40
+ Its page list is the built sitemap, then the seed's menus.
41
+ - **Section, block or widget area?** Copy-and-edit content is an EmDash Section. The same content
42
+ everywhere (an announcement bar, a pre-footer call to action, a sidebar, footer columns) is a
43
+ **widget area**: define it under Widgets in the admin, render it with
44
+ `<VitopsWidgetArea name="…" />` from `@getvitops/emdash/astro` in the layout, or place it in
45
+ page content with the `vitops.widgetArea` block. The layout renders `announcement` and
46
+ `pre-footer`. Page-specific content is blocks. An area cannot hold another area, and prerendered
47
+ pages show an edit after the next deploy (like menus).
32
48
  - `seed/seed.json` only applies against an empty database: structure
33
49
  (collections, menus, settings) on first boot; the `content` entries only
34
50
  when the setup wizard's "include sample content" option is chosen. Changing
@@ -81,6 +81,48 @@
81
81
  ]
82
82
  }
83
83
  ],
84
+ "widgetAreas": [
85
+ {
86
+ "name": "announcement",
87
+ "label": "Announcement bar",
88
+ "description": "Shown above the header on every page. Empty until you add a widget.",
89
+ "widgets": []
90
+ },
91
+ {
92
+ "name": "pre-footer",
93
+ "label": "Above the footer",
94
+ "description": "A call to action shown above the footer on every page (Widgets in the admin).",
95
+ "widgets": [
96
+ {
97
+ "type": "content",
98
+ "title": "Ready to talk?",
99
+ "content": [
100
+ {
101
+ "_type": "block",
102
+ "_key": "pf-text",
103
+ "style": "normal",
104
+ "markDefs": [],
105
+ "children": [
106
+ {
107
+ "_type": "span",
108
+ "_key": "pf-text-s",
109
+ "text": "Tell us what you need and we will reply within one business day.",
110
+ "marks": []
111
+ }
112
+ ]
113
+ },
114
+ {
115
+ "_type": "vitops.actionLink",
116
+ "_key": "pf-cta",
117
+ "label": "Contact us",
118
+ "href": "/contact",
119
+ "variant": "cta"
120
+ }
121
+ ]
122
+ }
123
+ ]
124
+ }
125
+ ],
84
126
  "content": {
85
127
  "pages": [
86
128
  {
@@ -487,10 +529,30 @@
487
529
  "heading": "Send us a message",
488
530
  "level": "2",
489
531
  "fields": [
490
- { "label": "Your name", "name": "name", "type": "text", "required": true },
491
- { "label": "Email", "name": "email", "type": "email", "required": true },
492
- { "label": "Phone", "name": "phone", "type": "tel", "required": false },
493
- { "label": "Message", "name": "message", "type": "textarea", "required": true }
532
+ {
533
+ "label": "Your name",
534
+ "name": "name",
535
+ "type": "text",
536
+ "required": true
537
+ },
538
+ {
539
+ "label": "Email",
540
+ "name": "email",
541
+ "type": "email",
542
+ "required": true
543
+ },
544
+ {
545
+ "label": "Phone",
546
+ "name": "phone",
547
+ "type": "tel",
548
+ "required": false
549
+ },
550
+ {
551
+ "label": "Message",
552
+ "name": "message",
553
+ "type": "textarea",
554
+ "required": true
555
+ }
494
556
  ],
495
557
  "submitLabel": "Send message",
496
558
  "successMessage": "Thanks. Your message has been sent and we will reply soon."
@@ -23,8 +23,14 @@
23
23
  }
24
24
  },
25
25
  "roles": {
26
- "neutral": { "hue": "ink", "kind": "surface" },
27
- "surface": { "hue": "ink", "kind": "surface" },
26
+ "neutral": {
27
+ "hue": "ink",
28
+ "kind": "surface"
29
+ },
30
+ "surface": {
31
+ "hue": "ink",
32
+ "kind": "surface"
33
+ },
28
34
  "ui-primary": "brand",
29
35
  "brand-primary": "brand",
30
36
  "info": "sky",
@@ -221,6 +227,46 @@
221
227
  "size": "var(--text-m)",
222
228
  "weight": 400,
223
229
  "line-height": "1.55"
230
+ },
231
+ "title": {
232
+ "family": "display",
233
+ "size": "var(--text-2xl)",
234
+ "weight": 600,
235
+ "line-height": "1.15",
236
+ "tracking": "-0.025em",
237
+ "text-wrap": "balance"
238
+ },
239
+ "lead": {
240
+ "family": "sans",
241
+ "size": "var(--text-l)",
242
+ "weight": 400,
243
+ "line-height": "1.5",
244
+ "text-wrap": "pretty"
245
+ },
246
+ "caption": {
247
+ "family": "sans",
248
+ "size": "var(--text-s)",
249
+ "weight": 400,
250
+ "line-height": "1.3",
251
+ "text-wrap": "pretty",
252
+ "color": "var(--color-text-neutral-muted)"
253
+ },
254
+ "eyebrow": {
255
+ "family": "sans",
256
+ "size": "var(--text-s)",
257
+ "weight": 600,
258
+ "line-height": "1.3",
259
+ "tracking": "0.08em",
260
+ "text-transform": "uppercase",
261
+ "text-wrap": "balance"
262
+ },
263
+ "footnote": {
264
+ "family": "sans",
265
+ "size": "var(--text-xs)",
266
+ "weight": 400,
267
+ "line-height": "1.4",
268
+ "text-wrap": "pretty",
269
+ "color": "var(--color-text-neutral-muted)"
224
270
  }
225
271
  },
226
272
  "headings": {
@@ -7,6 +7,7 @@ import SiteFooter from '@getvitops/astro/components/SiteFooter.astro';
7
7
  import SiteNav from '@getvitops/astro/components/SiteNav.astro';
8
8
  import { loadNavMenus } from '@getvitops/astro/components/sitenav.ts';
9
9
  import { EmDashHead } from 'emdash/ui';
10
+ import { VitopsWidgetArea } from '@getvitops/emdash/astro';
10
11
  import config from '../../site.json' with { type: 'json' };
11
12
  // Design-system CSS, layout-scoped (vitops css.inject: false): only pages
12
13
  // rendered through this layout get it — keeps it out of /_emdash/admin, while
@@ -72,6 +73,8 @@ const orgName = config.organization?.name || siteTitle;
72
73
  <VitopsHead />
73
74
  </head>
74
75
  <body>
76
+ <!-- Widget areas (Widgets in the admin): the same content wherever they appear. -->
77
+ <VitopsWidgetArea name="announcement" class="centered" />
75
78
  <header class="navbar-sticky centered">
76
79
  <div class="navbar">
77
80
  <a class="brand flex items-center" href="/" aria-label={`${siteTitle} home`}>
@@ -89,6 +92,8 @@ const orgName = config.organization?.name || siteTitle;
89
92
  <slot />
90
93
  </main>
91
94
 
95
+ <VitopsWidgetArea name="pre-footer" class="centered" />
96
+
92
97
  <SiteFooter class="centered" sitemap={footerSitemap} legal={footerLegal} name={orgName} />
93
98
 
94
99
  <style>