@getvitops/generator 8.3.0-alpha.0 → 8.3.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 +33 -0
- package/assets/css/index.css +1 -0
- package/assets/css/patterns/section.css +8 -0
- package/assets/css/patterns/widget-area.css +22 -0
- package/dist/index.d.mts +8 -0
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +18 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/dist/config-BfcWKH-5.mjs +0 -1743
- package/dist/config-BfcWKH-5.mjs.map +0 -1
- package/dist/config-Bhg3Xv3D.mjs +0 -1774
- package/dist/config-Bhg3Xv3D.mjs.map +0 -1
- package/dist/schema-BV2n2phj.d.mts +0 -291
- package/dist/schema-BV2n2phj.d.mts.map +0 -1
- package/dist/tokens-BzBbTeTi.d.mts +0 -225
- package/dist/tokens-BzBbTeTi.d.mts.map +0 -1
- package/dist/tokens-C1RJwFeG.mjs +0 -695
- package/dist/tokens-C1RJwFeG.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
# @getvitops/generator
|
|
2
2
|
|
|
3
|
+
## 8.3.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
|
+
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- Updated dependencies [24c568b]
|
|
33
|
+
- @getvitops/utils@8.3.0-alpha.1
|
|
34
|
+
- @getvitops/config@8.3.0-alpha.1
|
|
35
|
+
|
|
3
36
|
## 8.3.0-alpha.0
|
|
4
37
|
|
|
5
38
|
### Minor Changes
|
package/assets/css/index.css
CHANGED
|
@@ -51,3 +51,11 @@
|
|
|
51
51
|
align-items: start;
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
* A block given an anchor id (`@getvitops/emdash`'s `anchor` field). The offset keeps the target
|
|
57
|
+
* clear of a sticky header; set `--header-offset` to the header's height. All formats.
|
|
58
|
+
*/
|
|
59
|
+
.block-anchor {
|
|
60
|
+
scroll-margin-top: var(--header-offset, 5rem);
|
|
61
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Widget area — editor-managed regions (a footer column, a pre-footer call to action, a
|
|
3
|
+
* sidebar) rendered by `@getvitops/emdash`'s `<VitopsWidgetArea>`. Structure only: a widget is
|
|
4
|
+
* a titled group, a menu widget a plain link list. Colour and type come from the roles and the
|
|
5
|
+
* `.link` / `.font-heading` classes the markup already carries.
|
|
6
|
+
*/
|
|
7
|
+
.widget-area {
|
|
8
|
+
display: grid;
|
|
9
|
+
gap: var(--widget-area-gap, 1.5rem);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.widget__menu ul {
|
|
13
|
+
display: grid;
|
|
14
|
+
gap: var(--widget-menu-gap, 0.5rem);
|
|
15
|
+
margin: 0;
|
|
16
|
+
padding: 0;
|
|
17
|
+
list-style: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.widget__title {
|
|
21
|
+
margin-block-end: var(--widget-title-gap, 0.75rem);
|
|
22
|
+
}
|
package/dist/index.d.mts
CHANGED
|
@@ -63,6 +63,14 @@ interface GenerateOptions {
|
|
|
63
63
|
* would be out of proportion. Set explicitly, it wins over the site config.
|
|
64
64
|
*/
|
|
65
65
|
systemColorScheme?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* `tailwind` format only: directories (or globs) Tailwind should scan for class names, written
|
|
68
|
+
* as `@source` lines after `@import "tailwindcss"`. Paths are relative to the emitted
|
|
69
|
+
* `tailwind.css`. Tailwind v4 does not scan `node_modules`, so a utility used only by a package's
|
|
70
|
+
* own renderer (`font-display` in `vitops.stats`) is otherwise never generated — silently.
|
|
71
|
+
* Ignored by the css and bricks formats, which ship every framework class.
|
|
72
|
+
*/
|
|
73
|
+
sources?: string[];
|
|
66
74
|
}
|
|
67
75
|
interface GenerateResult {
|
|
68
76
|
format: Format;
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/generate.ts","../src/docs.ts","../src/tiers.ts","../src/token-refs.ts","../src/legal/providers.ts","../src/legal/derive.ts","../src/legal/templates/cookies.ca.ts","../src/legal/templates/cookies.qc.ts","../src/legal/templates/privacy.ca.ts","../src/legal/templates/privacy.qc.ts","../src/legal/templates/terms.ca.ts","../src/legal/templates/terms.qc.ts","../src/legal/templates/index.ts","../src/legal/render.ts","../src/legal/index.ts","../src/robots.ts","../src/index.ts"],"mappings":";;;;;KAmDY;;;;;;;KAQA,mBAAmB,QAAQ;UAEtB;;;;;;;;;;;;;;;;EAgBf,gBAAgB,eAAe;;EAE/B,SAAS;;EAET;;EAEA;;;;;;EAMA;;;;;EAKA;;;;;;;;EAQA,gBAAgB;;;;;;;;;;EAUhB;;UAGe;EACf,QAAQ;EACR;EACA;;UA0Ce;;EAEf;;EAEA;;EAEA;;;;;;;;;;;;;;;wBA6Dc,mBACd,gBAAgB,kBAChB,+BACC;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/generate.ts","../src/docs.ts","../src/tiers.ts","../src/token-refs.ts","../src/legal/providers.ts","../src/legal/derive.ts","../src/legal/templates/cookies.ca.ts","../src/legal/templates/cookies.qc.ts","../src/legal/templates/privacy.ca.ts","../src/legal/templates/privacy.qc.ts","../src/legal/templates/terms.ca.ts","../src/legal/templates/terms.qc.ts","../src/legal/templates/index.ts","../src/legal/render.ts","../src/legal/index.ts","../src/robots.ts","../src/index.ts"],"mappings":";;;;;KAmDY;;;;;;;KAQA,mBAAmB,QAAQ;UAEtB;;;;;;;;;;;;;;;;EAgBf,gBAAgB,eAAe;;EAE/B,SAAS;;EAET;;EAEA;;;;;;EAMA;;;;;EAKA;;;;;;;;EAQA,gBAAgB;;;;;;;;;;EAUhB;;;;;;;;EAQA;;UAGe;EACf,QAAQ;EACR;EACA;;UA0Ce;;EAEf;;EAEA;;EAEA;;;;;;;;;;;;;;;wBA6Dc,mBACd,gBAAgB,kBAChB,+BACC;wBAm3DmB,SAAS,SAAS,kBAAkB,QAAQ;UC3rCjD;EACf;EACA;EACA,aAAa,eAAe;EAC5B;EACA,uBAAuB;EACvB,QAAQ;EACR,QAAQ;EACR;;;;;;;;;;;;;;;;;;;;qBA+HW,uBAAwB;UAoBpB;;EAEf;;EAEA;;;;;;;;;;;;;EAaA;;UAGe;;EAEf;;EAEA;EACA;;EAEA;;;;;EAKA;;EAEA;EACA,UAAU;;;;;;;;;;;;;;;;;wBAkBI,gBACd,QAAQ,gBACR,OAAM,oBACL;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UAAU,GAAG;iBCSb,UAAU,GAAG;iBCDb,UAAU,GAAG;iBCHb,QAAQ,GAAG;iBCHX,QAAQ,GAAG;KCKf;KAEA,SAAS,OAAO,WAAW,GAAG;qBAE7B;;;;;;;;;;;;;qBAMA,WAAW;;qBAGX,WAAW,OAAO;UCXd;EACf;EACA;EACA;;KAGU;EACN;EAAiB;EAAkB,OAAO;;EAC1C;EAAmB,OAAO;;EAC1B;EAAc,OAAO;;EACrB;EAAe,OAAO;;;wBA4CZ,cAAc,aAAa;;;;;wBAsE3B,eAAe,QAAQ,UAAU;wBAkBjC,eAAe,QAAQ;;;;;;;;;;;;;;wBAmBvB,eAAe,QAAQ,SAAS;KCrKpC;UAEK;;EAEf,OAAO;;EAEP,SAAS;;;wBAUK,YAAY,KAAK,SAAS;;wBAW1B,eAAe,KAAK,QAAQ,KAAK,UAAU,OAAO;;;;;;wBAclD,YAAY,KAAK,QAAQ,KAAK,WAAW;;;;;;;wBAUzC,cACd,KAAK,QACL,OAAM,uBACL;UCjDc;;EAEf;;;;;;;;;;;;;;wBAwBc,gBAAgB,KAAK,QAAQ,UAAS;;;;;;wBCyItC,iBAAiB;;;;;;;;;;;wBAkPjB,kBAAkB;EAChC;EACA;EACA;IACE"}
|
package/dist/index.mjs
CHANGED
|
@@ -188,7 +188,8 @@ const TIERS = {
|
|
|
188
188
|
"section__sub",
|
|
189
189
|
"section__body",
|
|
190
190
|
"section--split",
|
|
191
|
-
"section--center"
|
|
191
|
+
"section--center",
|
|
192
|
+
"block-anchor"
|
|
192
193
|
], "patterns/section.css"),
|
|
193
194
|
use: "`.section.region` > `.centered` > `.section__inner` holding `.section__head` (kicker, heading, sub) and `.section__body`. `.section--split` puts the head beside the body when wide. In EmDash it is a block TYPE (`vitops_section`) with a Portable Text body that accepts any other block — see `vitopsBlockTypes()`."
|
|
194
195
|
},
|
|
@@ -505,9 +506,19 @@ const TIERS = {
|
|
|
505
506
|
use: "`<a>` gets it at zero specificity; `.link` for other tags. `.stretched-link` makes one link cover its positioned ancestor (whole-card click, no JS — but the card text stops being selectable); `.raised` lifts content back above that overlay."
|
|
506
507
|
},
|
|
507
508
|
badge: {
|
|
509
|
+
emdash: ["vitops.badges"],
|
|
508
510
|
css: c(["badge", "badge-indicator"], "patterns/tag.css", true),
|
|
509
511
|
use: "`.badge` — a STATIC label. Use `tag` if it is dismissable or editable."
|
|
510
512
|
},
|
|
513
|
+
"widget-area": {
|
|
514
|
+
emdash: ["vitops.widgetArea"],
|
|
515
|
+
css: c([
|
|
516
|
+
"widget-area",
|
|
517
|
+
"widget__title",
|
|
518
|
+
"widget__menu"
|
|
519
|
+
], "patterns/widget-area.css"),
|
|
520
|
+
use: "Editor-managed regions: `<VitopsWidgetArea name=\"footer-columns\" />` (`@getvitops/emdash/astro`) renders an area from Widgets in the admin — titled groups, a menu as a labelled `<nav>`, content as Portable Text. In a page, the `vitops.widgetArea` block places one. An area holding a `core:*` component widget falls back to EmDash's own renderer, and an area cannot hold another. Prerendered pages show an edit after the next deploy."
|
|
521
|
+
},
|
|
511
522
|
tag: {
|
|
512
523
|
css: c([
|
|
513
524
|
"tag",
|
|
@@ -5970,6 +5981,7 @@ function build(ds, format, assetsDir, buildOpts = {}) {
|
|
|
5970
5981
|
assetsDir,
|
|
5971
5982
|
utilities: UTILITIES,
|
|
5972
5983
|
systemColorScheme: buildOpts.systemColorScheme === true,
|
|
5984
|
+
sources: buildOpts.sources ?? [],
|
|
5973
5985
|
darkOnly: buildOpts.darkOnly === true
|
|
5974
5986
|
}),
|
|
5975
5987
|
designMd: format !== "design" ? "" : emitDesignMd({
|
|
@@ -5990,7 +6002,9 @@ function emitTailwind(ctx) {
|
|
|
5990
6002
|
const cssDir = join(assetsDir, "css");
|
|
5991
6003
|
const nl = (arr) => arr.filter(Boolean).join("\n");
|
|
5992
6004
|
const parts = ["/* GENERATED for Tailwind v4 (Astro) — do not edit by hand.\n Class reference: npx vitops docs classes · All topics: npx vitops docs\n Fonts below are STACKS ONLY — this file loads no webfonts. Load them with\n Astro's fonts: config and point the token at the family's cssVariable. */"];
|
|
5993
|
-
parts.push(`@import "tailwindcss"
|
|
6005
|
+
parts.push(`@import "tailwindcss";`);
|
|
6006
|
+
for (const src of ctx.sources) parts.push(`@source ${JSON.stringify(src)};`);
|
|
6007
|
+
parts.push("");
|
|
5994
6008
|
const theme = [];
|
|
5995
6009
|
theme.push(` /* Hue scales → bg-<hue>-<step> text-* border-* (numeric, 50…950) */`);
|
|
5996
6010
|
for (const [name, hue] of Object.entries(expandedPalette)) for (const [n, hex] of Object.entries(hue.numeric)) theme.push(` --color-${name}-${n}: ${hex};`);
|
|
@@ -6515,7 +6529,8 @@ async function generate(options) {
|
|
|
6515
6529
|
const config = options.site != null ? loadConfigFile(options.site, options.siteEnv) : embedded;
|
|
6516
6530
|
const built = build(ds, format, assetsDir, {
|
|
6517
6531
|
systemColorScheme: options.systemColorScheme ?? config?.designSystem?.defaultColorScheme === "system",
|
|
6518
|
-
darkOnly: config?.designSystem?.defaultColorScheme === "dark"
|
|
6532
|
+
darkOnly: config?.designSystem?.defaultColorScheme === "dark",
|
|
6533
|
+
...options.sources?.length ? { sources: options.sources } : {}
|
|
6519
6534
|
});
|
|
6520
6535
|
mkdirSync(outDir, { recursive: true });
|
|
6521
6536
|
const written = [];
|