openvibers/openvibe.coupons Commits

The shared update system and one account UI, on the OpenVibe Frame (openvibe-shared 1.11.0, openvibe/frame): the home shows what shipped, /updates is the shared log and the footer links it; the shared navbar handles sign in and out (logoutUrl ends this site's session) and carries this site's account links in its menu, while the page's own account bar is only for no-JS visitors

OP OpenVibers committed 24 Sept 2026 · 93080834fe · 5 files, +34 −19


Changes

ddiff --git a/package-lock.json b/package-lock.json
iindex 646a9c3..b9a6df0 100644
---- a/package-lock.json
++++ b/package-lock.json
@@@ -16,9 +16,9 @@
"express-rate-limit": "^7.5.0",
"helmet": "^8.1.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.33.0",
-- "openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.2.2",
++ "openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.3.2",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.5.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.5.1"
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.0"
},
"devDependencies": {
"jsonwebtoken": "^9.0.2"
@@@ -1031,12 +1031,12 @@
}
},
"node_modules/openvibe-publishing": {
-- "version": "0.2.2",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.2.2",
-- "integrity": "sha512-+aX5lcXQfvfczCY4Ca89B5uYugCS/uncu4gYI7U/mQoOioXZMHk/mCu2f1/+qxM1Ehi6EA2eB/0TCRv7jbuHbA==",
++ "version": "0.3.2",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.3.2",
++ "integrity": "sha512-XNpM7JJHCWlk2SZRzRqpu2kmWF9kMj6+tS3433hRKdyAB3jubi7Xzeav0OGX1wtqlKk4k00R186XiFmx1igTDg==",
"license": "MIT",
"dependencies": {
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.5.1"
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.0"
},
"engines": {
"node": ">=20"
@@@ -1060,9 +1060,9 @@
}
},
"node_modules/openvibe-shared": {
-- "version": "1.5.1",
-- "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.5.1",
-- "integrity": "sha512-1XWRFwN8br3iiy2Z8fmnXQMgR76VlfMpHjP1xr5uKLCJmtvtNSWO1BgA1kQmVtyBY7g+1n6YFIjahaD4qWbD/Q==",
++ "version": "1.11.0",
++ "resolved": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.0",
++ "integrity": "sha512-edMW0I25HNFReLcfZ9ak+4q5sy2t7qq7EPG52tOerTBV2fU994C5we/02AD/9i2Vuq0+ayNBBisW0cg60L6DLQ==",
"license": "MIT",
"dependencies": {
"jsonwebtoken": "^9.0.0"
ddiff --git a/package.json b/package.json
iindex 1c1d4f7..7b230a2 100644
---- a/package.json
++++ b/package.json
@@@ -21,9 +21,9 @@
"express-rate-limit": "^7.5.0",
"helmet": "^8.1.0",
"openvibe-contracts": "https://codeload.github.com/OpenVibers/OpenVibe.Contracts/tar.gz/refs/tags/v0.33.0",
-- "openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.2.2",
++ "openvibe-publishing": "https://codeload.github.com/OpenVibers/OpenVibe.Publishing/tar.gz/refs/tags/v0.3.2",
"openvibe-sdk": "https://codeload.github.com/OpenVibers/OpenVibe.SDK/tar.gz/refs/tags/v0.5.0",
-- "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.5.1"
++ "openvibe-shared": "https://codeload.github.com/OpenVibers/OpenVibe.Shared/tar.gz/refs/tags/v1.11.0"
},
"devDependencies": {
"jsonwebtoken": "^9.0.2"
ddiff --git a/server/app.js b/server/app.js
iindex 6845efe..c9c3966 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -73,7 +73,7 @@ function createApp(opts = {}) {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
-- // The shared chrome (theme-loader, navbar) comes from the Network; the inline init is ours.
++ // The OpenVibe Frame (theme-loader, navbar, footer) comes from the Network; the inline init is ours.
scriptSrc: ["'self'", "'unsafe-inline'", 'https://openvibe.network'],
styleSrc: ["'self'", "'unsafe-inline'", 'https://openvibe.network', 'https://fonts.googleapis.com', 'https://cdnjs.cloudflare.com'],
fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com', 'https://cdnjs.cloudflare.com'],
ddiff --git a/server/http/public.js b/server/http/public.js
iindex c578216..f591aca 100644
---- a/server/http/public.js
++++ b/server/http/public.js
@@@ -20,6 +20,7 @@
* everything else is `private, no-store`. All pages vary on Cookie and Authorization.
*/
const express = require('express');
++const frame = require('openvibe-shared/frame');
const seo = require('openvibe-publishing/seo');
const { renderPage } = require('../render/layout');
const pages = require('../render/pages');
@@@ -94,6 +95,12 @@ function createPublicRoutes(ctx) {
}
// ── Home, about ─────────────────────────────────────────
++ // What shipped on OpenVibe.Coupons: the shared update log every OpenVibe site has.
++ router.get('/updates', (req, res) => send(req, res, 200, {
++ title: 'What shipped on OpenVibe.Coupons', description: 'Every change deployed to OpenVibe.Coupons, newest first.',
++ decision: pageDecision('/updates'), canonical: `${config.baseUrl}/updates`,
++ body: frame.updatesBody({ service: 'coupons', siteName: 'OpenVibe.Coupons' }) + frame.shippedScript(),
++ }, { cacheable: true }));
router.get('/', (req, res) => {
const q = typeof req.query.q === 'string' ? req.query.q.slice(0, 60) : '';
const recent = coupons.recentActive(12).map((c) => ({ coupon: c, merchant: merchants.byId(c.merchant_id) }));
ddiff --git a/server/render/layout.js b/server/render/layout.js
iindex a8b0895..20c5c64 100644
---- a/server/render/layout.js
++++ b/server/render/layout.js
@@@ -5,7 +5,7 @@
* - <head>: title, description, canonical and robots from the indexability gate's decision
* (openvibe-publishing/seo metaTags — there is no default that makes a page indexable),
* Open Graph, JSON-LD built from real fields only, feed links, the shared app icon
-- * - the shared chrome: navbar.js and theme-loader.js from the Network (progressive), a
++ * - the OpenVibe Frame: navbar.js and theme-loader.js from the Network (progressive), a
* <noscript> navigation bar and the server-rendered shared footer (openvibe-shared)
* - no script of Coupons' own beyond the navbar init: copying a code is plain text selection
*/
@@@ -15,7 +15,7 @@ const path = require('path');
const seo = require('openvibe-publishing/seo');
const { escapeHtml: esc } = require('openvibe-publishing/ssr');
const appIcon = require('openvibe-shared/app-icon');
--const chrome = require('openvibe-shared/chrome-ssr');
++const frame = require('openvibe-shared/frame');
const NETWORK_URL = 'https://openvibe.network';
const SITE_NAME = 'OpenVibe.Coupons';
@@@ -62,7 +62,12 @@ function renderPage(o) {
silentLogin: `${o.config.baseUrl}/auth/login?silent=1&next={url}`,
sessionUrl: '/auth/me',
loginUrl: `/auth/login?next=${loginNext}`,
++ logoutUrl: '/auth/logout?next={path}', // Sign out in the shared navbar ends this site's session too
};
++ // This site's own account links live in the shared navbar's account menu (the page's account
++ // bar below is only for visitors without JavaScript).
++ if (signedIn) nav.menu = { before: [{ label: 'Watching', href: '/watching', icon: 'fa-bell' }, { label: 'Browser helper', href: '/connect-extension', icon: 'fa-puzzle-piece' }, ...(viewer.staff ? [{ label: 'Staff', href: '/staff', icon: 'fa-shield' }] : [])] };
++ const footer = { service: 'coupons', variant: 'full', mount: '#ov-footer', brandName: SITE_NAME, updates: '/updates' };
const account = signedIn
? `<a href="/watching">Watching</a> · <a href="/connect-extension">Browser helper</a>${viewer.staff ? ' · <a href="/staff">Staff</a>' : ''} · <a href="/auth/logout?next=${loginNext}">Sign out</a>`
: `<a href="/auth/login?next=${loginNext}">Sign in with OpenVibe</a>`;
@@@ -77,20 +82,23 @@ ${appIcon.headTags({ site: 'coupons' })}
<link rel="stylesheet" href="${asset('css/coupons.css')}">
<script src="${NETWORK_URL}/shared/theme-loader.js" defer></script>
<script src="${NETWORK_URL}/shared/navbar.js" defer></script>
++<script src="${NETWORK_URL}/shared/footer.js" defer></script>
</head>
<body class="${esc(o.bodyClass || '')}">
<a class="skip" href="#main">Skip to content</a>
<div id="navbar-mount"></div>
--${chrome.noscriptNav({ name: SITE_NAME, home: '/', links: NAV })}
--<div class="account-bar" role="navigation" aria-label="Account">${account}</div>
++${frame.noscriptNav({ name: SITE_NAME, home: '/', links: NAV })}
++<noscript><div class="account-bar" role="navigation" aria-label="Account">${account}</div></noscript>
<main id="main" class="page">
${o.body || ''}
++${o.path === '/' ? frame.shipped({ service: 'coupons', title: `Recently shipped on ${SITE_NAME}` }) : ''}
</main>
--${chrome.footer({ service: 'coupons', variant: 'full' })}
++${frame.footer(footer)}
<script>
--window.__OV_PAGE = ${JSON.stringify({ navbar: nav }).replace(/</g, '\\u003c')};
++window.__OV_PAGE = ${JSON.stringify({ navbar: nav, footer }).replace(/</g, '\\u003c')};
document.addEventListener('DOMContentLoaded', function () {
-- try { if (window.OpenVibeNavbar) OpenVibeNavbar.init(window.__OV_PAGE.navbar); } catch (e) { /* the chrome is optional */ }
++ try { if (window.OpenVibeNavbar) OpenVibeNavbar.init(window.__OV_PAGE.navbar); } catch (e) { /* the Frame is optional */ }
++ try { if (window.OpenVibeFooter) OpenVibeFooter.init(window.__OV_PAGE.footer); } catch (e) { /* */ }
});
</script>
</body>