@rxova/brand 0.14.0 → 0.14.2
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/assets/og/journey.png +0 -0
- package/assets/og/overlock.png +0 -0
- package/assets/og/react-inputs.png +0 -0
- package/assets/og/rxova.png +0 -0
- package/assets/og/ts-extended-errors.png +0 -0
- package/assets/og/use-everywhere.png +0 -0
- package/package.json +5 -5
- package/src/components/SiteFooter.astro +32 -12
- package/src/footer.css +10 -2
- package/src/sites.links.test.ts +62 -0
- package/src/sites.test.ts +1 -1
- package/src/sites.ts +20 -12
- package/src/tokens.css +37 -18
package/assets/og/journey.png
CHANGED
|
Binary file
|
package/assets/og/overlock.png
CHANGED
|
Binary file
|
|
Binary file
|
package/assets/og/rxova.png
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rxova/brand",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Design tokens, Starlight theme and shared site chrome for rxova.org",
|
|
6
6
|
"keywords": [
|
|
@@ -55,16 +55,16 @@
|
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@astrojs/check": "^0.9.10",
|
|
58
|
-
"@astrojs/starlight": "^0.42.
|
|
58
|
+
"@astrojs/starlight": "^0.42.1",
|
|
59
59
|
"@resvg/resvg-js": "^2.6.2",
|
|
60
|
-
"@types/node": "^26.
|
|
61
|
-
"@vitest/coverage-v8": "^5.0.
|
|
60
|
+
"@types/node": "^26.6.1",
|
|
61
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
62
62
|
"astro": "^7.3.2",
|
|
63
63
|
"publint": "^0.3.24",
|
|
64
64
|
"satori": "^0.33.4",
|
|
65
65
|
"tsx": "^4.23.13",
|
|
66
66
|
"typescript": "6.0.3",
|
|
67
|
-
"vitest": "^5.0.
|
|
67
|
+
"vitest": "^5.0.1"
|
|
68
68
|
},
|
|
69
69
|
"scripts": {
|
|
70
70
|
"typecheck": "tsc --noEmit",
|
|
@@ -46,12 +46,30 @@ interface Props {
|
|
|
46
46
|
* there is no artifact to wait for, so it exists whenever the landing does.
|
|
47
47
|
*/
|
|
48
48
|
site?: readonly SiteLink[]
|
|
49
|
+
/**
|
|
50
|
+
* The projects whose docs are actually mounted.
|
|
51
|
+
*
|
|
52
|
+
* A prop for exactly the reason `site` is one, and it was missed: only the
|
|
53
|
+
* umbrella repo knows which projects are deployed — `sources.json` gates the
|
|
54
|
+
* mount and the link together — while this package knows only that a project
|
|
55
|
+
* exists. Mapping `PROJECTS` unconditionally put a link to every project's
|
|
56
|
+
* docs in the footer of every page on the origin, including projects whose
|
|
57
|
+
* docs are switched off, so the whole site advertised a 404.
|
|
58
|
+
*
|
|
59
|
+
* The default is every project, which is right for the caller that cannot
|
|
60
|
+
* know: a docs site is itself proof that mounts exist, and it has no view of
|
|
61
|
+
* the registry.
|
|
62
|
+
*/
|
|
63
|
+
projects?: readonly SiteLink[]
|
|
49
64
|
}
|
|
50
65
|
|
|
51
|
-
const { project, docs, site } = Astro.props
|
|
66
|
+
const { project, docs, site, projects } = Astro.props
|
|
52
67
|
const self = project ? getProject(project) : undefined
|
|
53
68
|
const year = new Date().getFullYear()
|
|
54
69
|
|
|
70
|
+
const projectLinks: readonly SiteLink[] =
|
|
71
|
+
projects ?? PROJECTS.map((p) => ({ label: p.label, href: `${RXOVA_ORIGIN}${p.mount}` }))
|
|
72
|
+
|
|
55
73
|
const surfaces: readonly SiteLink[] = site ?? [
|
|
56
74
|
{ label: 'Blog', href: siteUrl('/blog') },
|
|
57
75
|
{ label: 'Updates', href: siteUrl('/updates') },
|
|
@@ -67,7 +85,7 @@ const surfaces: readonly SiteLink[] = site ?? [
|
|
|
67
85
|
<span>Rxova</span>
|
|
68
86
|
</a>
|
|
69
87
|
{/* Not "React libraries": most of these ship a framework-agnostic core
|
|
70
|
-
that runs in a worker or a plain script,
|
|
88
|
+
that runs in a worker or a plain script, journey also ships a browser
|
|
71
89
|
extension, and overlock is a command-line tool that never sees a
|
|
72
90
|
browser at all. React is a binding we provide, not the boundary of
|
|
73
91
|
what these are. Same correction as the landing's hero. */}
|
|
@@ -91,16 +109,18 @@ const surfaces: readonly SiteLink[] = site ?? [
|
|
|
91
109
|
</div>
|
|
92
110
|
)}
|
|
93
111
|
|
|
94
|
-
|
|
95
|
-
<
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
<
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
112
|
+
{projectLinks.length > 0 && (
|
|
113
|
+
<div>
|
|
114
|
+
<h2 class="rx-footer__title">Projects</h2>
|
|
115
|
+
<ul class="rx-footer__list">
|
|
116
|
+
{projectLinks.map((link) => (
|
|
117
|
+
<li>
|
|
118
|
+
<a href={link.href}>{link.label}</a>
|
|
119
|
+
</li>
|
|
120
|
+
))}
|
|
121
|
+
</ul>
|
|
122
|
+
</div>
|
|
123
|
+
)}
|
|
104
124
|
|
|
105
125
|
{self && (
|
|
106
126
|
<div>
|
package/src/footer.css
CHANGED
|
@@ -26,10 +26,18 @@
|
|
|
26
26
|
`auto-fit` rather than a media query because what matters is how wide the
|
|
27
27
|
footer's *container* is, not the viewport: on /blog the page measure is 44rem
|
|
28
28
|
on any screen, and a viewport query would have put the brand block beside the
|
|
29
|
-
columns and squeezed them to two cramped tracks on a desktop.
|
|
29
|
+
columns and squeezed them to two cramped tracks on a desktop.
|
|
30
|
+
|
|
31
|
+
`min(100%, 20rem)` rather than a bare `20rem` for the track floor. A grid
|
|
32
|
+
track's minimum is not capped by its container, so a plain `minmax(20rem,
|
|
33
|
+
1fr)` stayed 320px wide inside a narrower footer and pushed the document
|
|
34
|
+
past the viewport — every rxova.org surface scrolled sideways on a 320px
|
|
35
|
+
phone, by the 24px of gutter the footer sits in. `min(100%, …)` lets the
|
|
36
|
+
floor collapse to the container, which is the same guard
|
|
37
|
+
`.rx-footer__columns` below already had. */
|
|
30
38
|
.rx-footer__top {
|
|
31
39
|
display: grid;
|
|
32
|
-
grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
|
|
40
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
|
|
33
41
|
gap: 2.5rem 3rem;
|
|
34
42
|
}
|
|
35
43
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every outbound link in PROJECTS resolves.
|
|
3
|
+
*
|
|
4
|
+
* sites.test.ts checks the shape of these URLs, and a well-shaped URL can still
|
|
5
|
+
* 404: ts-extended-errors shipped with an npm link to `@rxova/ts-extended-errors`
|
|
6
|
+
* after the package had been published unscoped as `ts-extended-errors`. Only
|
|
7
|
+
* asking the network catches that, so this file does.
|
|
8
|
+
*
|
|
9
|
+
* npm is checked through the registry, not www.npmjs.com, which answers 403 to
|
|
10
|
+
* anything that is not a browser. The npm link is pinned to the first package
|
|
11
|
+
* below, so checking the packages checks the link.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { describe, expect, it } from 'vitest'
|
|
15
|
+
|
|
16
|
+
import { PROJECTS } from './sites.ts'
|
|
17
|
+
|
|
18
|
+
const TIMEOUT = 15_000
|
|
19
|
+
|
|
20
|
+
/** Retries what is transient (rate limits, 5xx, network) — never a 404. */
|
|
21
|
+
async function status(url: string, method: 'GET' | 'HEAD'): Promise<number> {
|
|
22
|
+
let last = 0
|
|
23
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
24
|
+
try {
|
|
25
|
+
const res = await fetch(url, {
|
|
26
|
+
method,
|
|
27
|
+
redirect: 'follow',
|
|
28
|
+
signal: AbortSignal.timeout(10_000),
|
|
29
|
+
})
|
|
30
|
+
last = res.status
|
|
31
|
+
if (res.status !== 429 && res.status < 500) return res.status
|
|
32
|
+
} catch {
|
|
33
|
+
last = 0
|
|
34
|
+
}
|
|
35
|
+
await new Promise((r) => setTimeout(r, 1_000 * (attempt + 1)))
|
|
36
|
+
}
|
|
37
|
+
return last
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const registryUrl = (pkg: string) => `https://registry.npmjs.org/${encodeURIComponent(pkg)}`
|
|
41
|
+
|
|
42
|
+
describe.each(PROJECTS.map((p) => [p.id, p] as const))('%s links', (_, project) => {
|
|
43
|
+
it('links npm to its first package', () => {
|
|
44
|
+
expect(project.npm).toBe(`https://www.npmjs.com/package/${project.packages[0]}`)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it.each(project.packages)(
|
|
48
|
+
'publishes %s on npm',
|
|
49
|
+
async (pkg) => {
|
|
50
|
+
expect(await status(registryUrl(pkg), 'GET')).toBe(200)
|
|
51
|
+
},
|
|
52
|
+
TIMEOUT * 3,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
it(
|
|
56
|
+
'has a public GitHub repo',
|
|
57
|
+
async () => {
|
|
58
|
+
expect(await status(project.repo, 'HEAD')).toBe(200)
|
|
59
|
+
},
|
|
60
|
+
TIMEOUT * 3,
|
|
61
|
+
)
|
|
62
|
+
})
|
package/src/sites.test.ts
CHANGED
|
@@ -46,7 +46,7 @@ describe('PROJECTS', () => {
|
|
|
46
46
|
|
|
47
47
|
describe('getProject', () => {
|
|
48
48
|
it('finds a project by id', () => {
|
|
49
|
-
expect(getProject('journey').label).toBe('
|
|
49
|
+
expect(getProject('journey').label).toBe('journey')
|
|
50
50
|
})
|
|
51
51
|
|
|
52
52
|
it('throws rather than returning undefined for an unknown id', () => {
|
package/src/sites.ts
CHANGED
|
@@ -31,19 +31,18 @@ export interface Project {
|
|
|
31
31
|
packages: string[]
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Display order, shared by the landing's project rail and the docs switcher.
|
|
36
|
+
*
|
|
37
|
+
* overlock sits last deliberately. It is the newest of these and the only one
|
|
38
|
+
* that is not a library you import — a CLI and a CI gate — so leading the list
|
|
39
|
+
* with it put the least representative project in front of every reader of
|
|
40
|
+
* every surface.
|
|
41
|
+
*/
|
|
34
42
|
export const PROJECTS: readonly Project[] = [
|
|
35
|
-
{
|
|
36
|
-
id: 'overlock',
|
|
37
|
-
label: 'overlock',
|
|
38
|
-
mount: '/packages/overlock/',
|
|
39
|
-
tagline: 'A deterministic gate on test integrity in a git patch.',
|
|
40
|
-
repo: 'https://github.com/rxova/overlock',
|
|
41
|
-
npm: 'https://www.npmjs.com/package/overlock',
|
|
42
|
-
packages: ['overlock'],
|
|
43
|
-
},
|
|
44
43
|
{
|
|
45
44
|
id: 'journey',
|
|
46
|
-
label: '
|
|
45
|
+
label: 'journey',
|
|
47
46
|
mount: '/packages/journey/',
|
|
48
47
|
tagline: 'Declarative journey graphs for non-linear UI flows.',
|
|
49
48
|
repo: 'https://github.com/rxova/journey',
|
|
@@ -85,8 +84,17 @@ export const PROJECTS: readonly Project[] = [
|
|
|
85
84
|
mount: '/packages/ts-extended-errors/',
|
|
86
85
|
tagline: 'Typed, serializable errors that survive a JSON round trip.',
|
|
87
86
|
repo: 'https://github.com/rxova/ts-extended-errors',
|
|
88
|
-
npm: 'https://www.npmjs.com/package
|
|
89
|
-
packages: ['
|
|
87
|
+
npm: 'https://www.npmjs.com/package/ts-extended-errors',
|
|
88
|
+
packages: ['ts-extended-errors'],
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: 'overlock',
|
|
92
|
+
label: 'overlock',
|
|
93
|
+
mount: '/packages/overlock/',
|
|
94
|
+
tagline: 'A deterministic gate on test integrity in a git patch.',
|
|
95
|
+
repo: 'https://github.com/rxova/overlock',
|
|
96
|
+
npm: 'https://www.npmjs.com/package/overlock',
|
|
97
|
+
packages: ['overlock'],
|
|
90
98
|
},
|
|
91
99
|
] as const
|
|
92
100
|
|
package/src/tokens.css
CHANGED
|
@@ -44,15 +44,15 @@
|
|
|
44
44
|
:root[data-theme='dark'] {
|
|
45
45
|
color-scheme: dark;
|
|
46
46
|
|
|
47
|
-
--rx-bg: #
|
|
48
|
-
--rx-card: #
|
|
49
|
-
--rx-tag-bg: #
|
|
50
|
-
--rx-rule: #
|
|
51
|
-
--rx-rule-strong: #
|
|
47
|
+
--rx-bg: #0b0a08;
|
|
48
|
+
--rx-card: #1e1b17;
|
|
49
|
+
--rx-tag-bg: #2b2721;
|
|
50
|
+
--rx-rule: #3b362d;
|
|
51
|
+
--rx-rule-strong: #565043;
|
|
52
52
|
|
|
53
|
-
--rx-faint: #
|
|
54
|
-
--rx-muted: #
|
|
55
|
-
--rx-fg: #
|
|
53
|
+
--rx-faint: #9a9385;
|
|
54
|
+
--rx-muted: #bbb3a6;
|
|
55
|
+
--rx-fg: #f4f1ea;
|
|
56
56
|
|
|
57
57
|
/* Lightened so the accent keeps AA contrast on a dark surface. */
|
|
58
58
|
--rx-primary: #9375f5;
|
|
@@ -63,24 +63,43 @@
|
|
|
63
63
|
--rx-primary-lighter: #cbbcfb;
|
|
64
64
|
--rx-primary-lightest: #e0d7fd;
|
|
65
65
|
|
|
66
|
-
--rx-glow-tint: rgb(
|
|
66
|
+
--rx-glow-tint: rgb(244 241 234 / 0.06);
|
|
67
67
|
--rx-shadow-soft: 0 20px 60px -30px rgb(0 0 0 / 0.6);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
/* --- On the size of the dark steps ---------------------------------------
|
|
71
|
+
*
|
|
72
|
+
* The dark surfaces used to sit 2.5 L* apart (bg #100f0d, card #17150f), which
|
|
73
|
+
* is a contrast ratio of 1.05 — a card edge nobody can see. Every panel, code
|
|
74
|
+
* block and quote floated on the page with only a 1px rule to define it, and
|
|
75
|
+
* that rule was itself only 1.18 against the card. The light theme gets away
|
|
76
|
+
* with a comparable step (1.7 L*) because a dark edge on a light ground reads
|
|
77
|
+
* strongly; near black the same step disappears, and ambient glare finishes it.
|
|
78
|
+
*
|
|
79
|
+
* So the dark ramp is deliberately spaced wider than its light counterpart
|
|
80
|
+
* rather than being a mirror of it: card sits 7.2 L* above bg, and the rule
|
|
81
|
+
* 12.9 above card. Judge changes here in L*, not in contrast ratio — ratio is
|
|
82
|
+
* compressed at the dark end and will happily report a 7 L* step as "1.1" and
|
|
83
|
+
* therefore fine.
|
|
84
|
+
*
|
|
85
|
+
* Text was never the problem and is unchanged in kind: fg 15.2, muted 8.3 and
|
|
86
|
+
* faint 5.6 against card.
|
|
87
|
+
*/
|
|
88
|
+
|
|
70
89
|
/* OS preference wins only when no explicit choice has been stored. */
|
|
71
90
|
@media (prefers-color-scheme: dark) {
|
|
72
91
|
:root:not([data-theme]) {
|
|
73
92
|
color-scheme: dark;
|
|
74
93
|
|
|
75
|
-
--rx-bg: #
|
|
76
|
-
--rx-card: #
|
|
77
|
-
--rx-tag-bg: #
|
|
78
|
-
--rx-rule: #
|
|
79
|
-
--rx-rule-strong: #
|
|
94
|
+
--rx-bg: #0b0a08;
|
|
95
|
+
--rx-card: #1e1b17;
|
|
96
|
+
--rx-tag-bg: #2b2721;
|
|
97
|
+
--rx-rule: #3b362d;
|
|
98
|
+
--rx-rule-strong: #565043;
|
|
80
99
|
|
|
81
|
-
--rx-faint: #
|
|
82
|
-
--rx-muted: #
|
|
83
|
-
--rx-fg: #
|
|
100
|
+
--rx-faint: #9a9385;
|
|
101
|
+
--rx-muted: #bbb3a6;
|
|
102
|
+
--rx-fg: #f4f1ea;
|
|
84
103
|
|
|
85
104
|
--rx-primary: #9375f5;
|
|
86
105
|
--rx-primary-dark: #8159f3;
|
|
@@ -90,7 +109,7 @@
|
|
|
90
109
|
--rx-primary-lighter: #cbbcfb;
|
|
91
110
|
--rx-primary-lightest: #e0d7fd;
|
|
92
111
|
|
|
93
|
-
--rx-glow-tint: rgb(
|
|
112
|
+
--rx-glow-tint: rgb(244 241 234 / 0.06);
|
|
94
113
|
--rx-shadow-soft: 0 20px 60px -30px rgb(0 0 0 / 0.6);
|
|
95
114
|
}
|
|
96
115
|
}
|