Skip to content

Commit 4daee10

Browse files
Use the latest shared footer (#277)
* Use latest shared footer * Use latest shared footer and restore square badges * Keep the existing workspace lock structure --------- Co-authored-by: Anthony Ettinger <anthony@profullstack.com>
1 parent ebdc0d1 commit 4daee10

4 files changed

Lines changed: 24 additions & 18 deletions

File tree

‎apps/pwa/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@logicsrc/cli": "workspace:*",
1515
"@profullstack/coinpay-onboard": "0.3.1",
1616
"@profullstack/key-rotation": "0.1.0",
17-
"@profullstack/footer": "0.5.0",
17+
"@profullstack/footer": "latest",
1818
"@profullstack/libsql-pg": "^0.1.4",
1919
"@profullstack/profile": "0.1.6",
2020
"@simplewebauthn/browser": "^14.0.0",

‎apps/pwa/src/lib/ring-footer.mjs‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
// The Profullstack footer (links, copyright, the << Profullstack >> webring row and
2-
// the built.indie + pwamart badges) from @profullstack/footer, on the public
2+
// the square built.indie + PwaMart badges) from @profullstack/footer, on the public
33
// sign-in page. It is rendered into the HTML on the server because rssamplifier's
44
// ring verifier reads the page and never runs script.
55
//
6-
// This origin holds vault identity keys in browser storage, so the footer is the
7-
// template BUNDLED in the pinned package version only. It used to be refreshed
8-
// from jsdelivr @latest every 15 minutes, which made whoever could publish the
9-
// footer package able to put HTML on this origin, past a bypassable sanitizer.
10-
// A footer change now reaches this app by bumping the pinned dependency.
6+
// This origin holds vault identity keys in browser storage, so the footer uses
7+
// the package's bundled template only: nothing is fetched at runtime. A footer
8+
// release reaches this app through the shared latest dependency and normal deploy.
119
import { footerHtmlSync } from "@profullstack/footer";
1210

13-
export const RING_FOOTER_OPTIONS = { site: "https://app.logicsrc.com/" };
11+
const SITE = "https://app.logicsrc.com/";
12+
export const RING_FOOTER_OPTIONS = {
13+
site: SITE,
14+
builtIndieHref: `https://built.indie.pit.world/for?site=${SITE}`,
15+
pwamartHref: `https://pwamart.com/for?site=${SITE}`,
16+
};
1417

1518
const html = footerHtmlSync(RING_FOOTER_OPTIONS);
1619

‎apps/pwa/test/ring-footer.test.mjs‎

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
1-
// The sign-in page carries the Profullstack footer (webring row + badges), from
2-
// the template bundled in the pinned package only: nothing is fetched at runtime.
1+
// The sign-in page carries the shared Profullstack footer (webring row + square badges)
2+
// from the package's bundled template only: nothing is fetched at runtime.
33
import assert from "node:assert/strict";
44
import test from "node:test";
55
import { readFileSync } from "node:fs";
66

77
import * as ringFooterModule from "../src/lib/ring-footer.mjs";
88

9-
test("the bundled footer links the ring and both badges for app.logicsrc.com", () => {
9+
test("the shared footer links the ring and both square badges for app.logicsrc.com", () => {
1010
const html = ringFooterModule.ringFooter();
1111
assert.match(html, /rssamplifier\.com\/ring\/profullstack/);
12-
assert.match(html, /built\.indie\.pit\.world/);
13-
assert.match(html, /pwamart\.com\/for\.svg\?site=https%3A%2F%2Fapp\.logicsrc\.com%2F|pwamart\.com\/for\.svg\?site=https:\/\/app\.logicsrc\.com\//);
12+
assert.match(html, /href="https:\/\/built\.indie\.pit\.world\/for\?site=https:\/\/app\.logicsrc\.com\//);
13+
assert.match(html, /src="https:\/\/logicsrc\.com\/openicon\/set\/hq\/svg\/built-indie\.svg"/);
14+
assert.match(html, /href="https:\/\/pwamart\.com\/for\?site=https:\/\/app\.logicsrc\.com\//);
15+
assert.match(html, /src="https:\/\/logicsrc\.com\/openicon\/set\/hq\/svg\/pwamart\.svg"/);
16+
assert.match(html, /pfs-footer__badge--publisher img\{width:32px;height:32px/);
1417
});
1518

1619
test("the footer cannot be swapped at runtime (no CDN refresh)", () => {
@@ -20,7 +23,7 @@ test("the footer cannot be swapped at runtime (no CDN refresh)", () => {
2023
assert.doesNotMatch(src, /footerHtml\(/);
2124
});
2225

23-
test("the footer package is pinned to an exact version", () => {
26+
test("the footer package follows the shared latest release", () => {
2427
const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
25-
assert.match(pkg.dependencies["@profullstack/footer"], /^\d+\.\d+\.\d+$/);
28+
assert.equal(pkg.dependencies["@profullstack/footer"], "latest");
2629
});

‎bun.lock‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)