@tokenoftrust/storefront-runner 2.2.126 → 2.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/apps/storefront/package.json +3 -1
- package/apps/storefront/public/shared/commerce-chrome.css +57 -15
- package/apps/storefront/public/shared/commerce-marketing.css +7 -7
- package/apps/storefront/src/components/Badge.astro +1 -1
- package/apps/storefront/src/components/Breadcrumbs.astro +8 -3
- package/apps/storefront/src/components/Section.astro +4 -1
- package/apps/storefront/src/components/Seo.astro +7 -5
- package/apps/storefront/src/components/blog/BlogIndexView.astro +22 -13
- package/apps/storefront/src/components/blog/ShareRow.astro +43 -0
- package/apps/storefront/src/components/chrome/AnnouncementBar.astro +1 -1
- package/apps/storefront/src/components/chrome/NavDropdown.astro +7 -7
- package/apps/storefront/src/components/chrome/SiteFooter.astro +17 -0
- package/apps/storefront/src/components/chrome/SiteHeader.astro +5 -5
- package/apps/storefront/src/components/commerce/TagFilterCloud.astro +1 -1
- package/apps/storefront/src/components/compliance/NicotineWarning.astro +12 -22
- package/apps/storefront/src/components/compliance/PactActNotice.astro +9 -10
- package/apps/storefront/src/components/content/ProseSections.astro +2 -2
- package/apps/storefront/src/components/home/Hero.astro +34 -12
- package/apps/storefront/src/components/islands/IsolatedAgeGate.tsx +39 -5
- package/apps/storefront/src/components/islands/VariantSelector.tsx +3 -3
- package/apps/storefront/src/components/marketing/CardGrid.astro +1 -1
- package/apps/storefront/src/components/marketing/CodeSample.astro +1 -1
- package/apps/storefront/src/components/marketing/CtaBand.astro +1 -1
- package/apps/storefront/src/components/marketing/Faq.astro +1 -1
- package/apps/storefront/src/components/marketing/Integrations.astro +1 -1
- package/apps/storefront/src/components/marketing/MarketingCtas.astro +1 -1
- package/apps/storefront/src/components/marketing/MarketingHero.astro +1 -1
- package/apps/storefront/src/components/marketing/ProofStrip.astro +1 -1
- package/apps/storefront/src/components/marketing/SplitCompare.astro +1 -1
- package/apps/storefront/src/components/marketing/Steps.astro +1 -1
- package/apps/storefront/src/components/marketing/Testimonials.astro +2 -2
- package/apps/storefront/src/components/marketing/TrustBar.astro +1 -1
- package/apps/storefront/src/components/membership/TierComparisonTable.astro +1 -1
- package/apps/storefront/src/components/plp/ActiveFilters.astro +1 -1
- package/apps/storefront/src/components/plp/FacetSidebar.astro +4 -4
- package/apps/storefront/src/components/plp/Pagination.astro +1 -1
- package/apps/storefront/src/components/plp/SortSelect.astro +1 -1
- package/apps/storefront/src/components/style-guide/StyleGuideNav.astro +18 -3
- package/apps/storefront/src/components/the-build/TheBuildIndexView.astro +9 -5
- package/apps/storefront/src/config/devTenantSeed.ts +20 -34
- package/apps/storefront/src/config/resolver.ts +0 -38
- package/apps/storefront/src/layouts/Layout.astro +8 -1
- package/apps/storefront/src/lib/assets/preview-version-cookie.ts +52 -5
- package/apps/storefront/src/lib/blog/pagination.ts +20 -10
- package/apps/storefront/src/lib/blog/presentation.ts +94 -0
- package/apps/storefront/src/lib/blog/rss.ts +1 -1
- package/apps/storefront/src/lib/blog/types.ts +24 -7
- package/apps/storefront/src/lib/breadcrumbs.ts +25 -0
- package/apps/storefront/src/lib/chrome/model.ts +4 -0
- package/apps/storefront/src/lib/cloudflare-workers.d.ts +53 -0
- package/apps/storefront/src/lib/compliance/rawComplianceNotices.ts +38 -18
- package/apps/storefront/src/lib/dashboard/delegateGate.ts +28 -0
- package/apps/storefront/src/lib/homeVisualParity.ts +8 -5
- package/apps/storefront/src/lib/jsonld.ts +5 -5
- package/apps/storefront/src/lib/pinnedRouteRewriteBoundary.ts +20 -2
- package/apps/storefront/src/lib/rawChrome.ts +74 -12
- package/apps/storefront/src/lib/runtimeEnv.ts +1 -1
- package/apps/storefront/src/lib/seo/documentTitle.ts +19 -0
- package/apps/storefront/src/lib/shared/addToRelease.ts +32 -0
- package/apps/storefront/src/lib/storyblok/content-model.ts +3 -0
- package/apps/storefront/src/lib/styleGuideThemes.ts +20 -22
- package/apps/storefront/src/pages/[...slug].astro +13 -8
- package/apps/storefront/src/pages/blog/[slug].astro +56 -24
- package/apps/storefront/src/pages/blog/author/[author].astro +17 -9
- package/apps/storefront/src/pages/blog/category/[category].astro +18 -10
- package/apps/storefront/src/pages/blog/index.astro +2 -0
- package/apps/storefront/src/pages/blog/page/[n].astro +2 -0
- package/apps/storefront/src/pages/blog/tag/[tag].astro +18 -10
- package/apps/storefront/src/pages/collections/[handle].astro +5 -4
- package/apps/storefront/src/pages/collections/index.astro +4 -3
- package/apps/storefront/src/pages/index.astro +34 -27
- package/apps/storefront/src/pages/products/[handle].astro +5 -4
- package/apps/storefront/src/pages/saved.astro +4 -3
- package/apps/storefront/src/pages/search.astro +4 -3
- package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +129 -118
- package/apps/storefront/src/pages/style-guide/[tenant]/chrome/[theme].astro +19 -15
- package/apps/storefront/src/pages/style-guide/[tenant]/guide/[theme].astro +23 -27
- package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +7 -14
- package/apps/storefront/src/pages/style-guide/index.astro +6 -5
- package/apps/storefront/src/pages/tenants/[id]/[...path].ts +32 -7
- package/apps/storefront/src/pages/the-build/[slug].astro +44 -20
- package/apps/storefront/src/pages/the-build/index.astro +2 -0
- package/apps/storefront/src/pages/the-build/page/[n].astro +2 -0
- package/apps/storefront/src/styles/admin.css +47 -0
- package/apps/storefront/src/styles/global.css +104 -56
- package/apps/storefront/src/themes/derivedTokens.ts +34 -0
- package/apps/storefront/src/themes/schema.ts +6 -0
- package/apps/storefront/test/pipeline/harness.ts +164 -0
- package/apps/storefront/test/pipeline/intake-worker.mjs +14 -0
- package/apps/storefront/test/pipeline/pipeline-host.ts +77 -0
- package/apps/storefront/test/pipeline/synthetic-job.ts +156 -0
- package/apps/storefront/vitest.workers.config.cts +67 -0
- package/docs/widget-library-guide.md +1496 -0
- package/package.json +1 -1
- package/packages/cli/src/declared-config.mjs +400 -5
- package/packages/public-runtime/package.json +1 -0
- package/packages/public-runtime/src/chrome.ts +93 -2
- package/packages/public-runtime/src/compliance-coherence.d.mts +17 -0
- package/packages/public-runtime/src/compliance-coherence.mjs +84 -0
- package/packages/public-runtime/src/declared-tenant-config.d.mts +1 -1
- package/packages/public-runtime/src/declared-tenant-config.mjs +6 -2
- package/packages/public-runtime/src/extension-contract-values.d.mts +4 -1
- package/packages/public-runtime/src/extension-contract-values.mjs +14 -1
- package/packages/public-runtime/src/extension-contract.ts +2 -0
- package/packages/public-runtime/src/tenant.ts +48 -4
- package/pnpm-lock.runner.yaml +469 -0
- package/scripts/tenant/validate.mjs +27 -1
|
@@ -34,9 +34,11 @@ import {
|
|
|
34
34
|
BLOCK_PALETTE_SUPPORTED_CONTRACTS,
|
|
35
35
|
FEATURED_PRODUCT_PRESENTATIONS,
|
|
36
36
|
PROMO_TILE_PRESENTATIONS,
|
|
37
|
+
THEME_HEADING_LEVELS,
|
|
37
38
|
isSafeRehostedAssetPath,
|
|
38
39
|
isSafeRehostedAssetPathForTenant,
|
|
39
40
|
isSafeStorefrontHref,
|
|
41
|
+
isThemeCssSize,
|
|
40
42
|
} from "../../packages/public-runtime/src/extension-contract-values.mjs";
|
|
41
43
|
import {
|
|
42
44
|
foreignTenantSegments,
|
|
@@ -333,6 +335,25 @@ function validateScriptsDoc(doc, file, config) {
|
|
|
333
335
|
return out;
|
|
334
336
|
}
|
|
335
337
|
|
|
338
|
+
/** theme.json `type.headings`: fixed heading sizes the renderer emits as --heading-<level>. */
|
|
339
|
+
function validateThemeHeadings(theme, file) {
|
|
340
|
+
const out = [];
|
|
341
|
+
const headings = theme?.type?.headings;
|
|
342
|
+
if (headings === undefined) return out;
|
|
343
|
+
if (headings == null || typeof headings !== "object" || Array.isArray(headings)) {
|
|
344
|
+
return [mk(ERROR, "theme-token", file, "type.headings must be an object of hero/h1/h2/h3 sizes")];
|
|
345
|
+
}
|
|
346
|
+
for (const [level, size] of Object.entries(headings)) {
|
|
347
|
+
if (!(/** @type {readonly string[]} */ (THEME_HEADING_LEVELS)).includes(level)) {
|
|
348
|
+
out.push(mk(ERROR, "theme-token", file, `type.headings.${level} is not a heading level (use ${THEME_HEADING_LEVELS.join(", ")})`));
|
|
349
|
+
} else if (!isThemeCssSize(size)) {
|
|
350
|
+
out.push(mk(ERROR, "theme-token", file, `type.headings.${level} must be a CSS length such as "28px", "1.75rem" or "clamp(1.5rem, 4vw, 2rem)"`));
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
return out;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
|
|
336
357
|
const SUPPORTED_BLOCK_CONTRACTS = new Set(BLOCK_PALETTE_SUPPORTED_CONTRACTS);
|
|
337
358
|
const KNOWN_BLOCKS = new Set([
|
|
338
359
|
"hero",
|
|
@@ -585,6 +606,9 @@ function validateHomeDoc(doc, file, tenantId) {
|
|
|
585
606
|
validateVisualAsset(block.image, file, `${at}.image`, out, tenantId);
|
|
586
607
|
}
|
|
587
608
|
if (component === "hero" && block.slides !== undefined) validateHeroSlides(block.slides, file, at, out, tenantId);
|
|
609
|
+
if (component === "hero" && block.notice !== undefined && (typeof block.notice !== "string" || !block.notice.trim())) {
|
|
610
|
+
out.push(mk(ERROR, "block-prop", file, `${at}.notice must be a non-empty plain-text string`));
|
|
611
|
+
}
|
|
588
612
|
if (component === "editorial" && block.image !== undefined) {
|
|
589
613
|
validateVisualAsset(block.image, file, `${at}.image`, out, tenantId);
|
|
590
614
|
if (typeof block.imageAlt !== "string") {
|
|
@@ -1088,12 +1112,14 @@ export function validateTenant(tenantDir, opts = {}) {
|
|
|
1088
1112
|
// 2. theme.json — parse (a malformed one is a WHOLE-APP BUILD FAILURE)
|
|
1089
1113
|
const themePath = located("theme.json");
|
|
1090
1114
|
if (existsSync(themePath)) {
|
|
1091
|
-
const { error } = readJsonSafe(themePath);
|
|
1115
|
+
const { value: theme, error } = readJsonSafe(themePath);
|
|
1092
1116
|
if (error) {
|
|
1093
1117
|
findings.push(
|
|
1094
1118
|
mk(ERROR, "theme-parse", rel(themePath),
|
|
1095
1119
|
`invalid JSON: ${error}`, "theme.json is loaded by an eager Vite glob — a parse error fails the entire storefront build"),
|
|
1096
1120
|
);
|
|
1121
|
+
} else {
|
|
1122
|
+
findings.push(...validateThemeHeadings(theme, rel(themePath)));
|
|
1097
1123
|
}
|
|
1098
1124
|
}
|
|
1099
1125
|
|