@rxova/brand 1.1.0 → 1.2.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/MIGRATION.md CHANGED
@@ -31,8 +31,9 @@ returns now point into `@rxova/astro-ui`.
31
31
  | `@rxova/brand/starlight.css` | `@rxova/astro-ui/styles/starlight.css` |
32
32
  | `@rxova/brand/tokens.css`, `fonts.css`, `assets/*` | unchanged |
33
33
 
34
- `<Chrome>` is `SiteShell`, `Header`, `SiteFooter`, `ProjectSwitcher`,
35
- `ThemeToggle` or `ThemeScript`. `<Override>` is `SiteTitle`, `SocialIcons`,
34
+ `<Chrome>` is `Header`, `SiteFooter`, `ProjectSwitcher`, `ThemeToggle` or
35
+ `ThemeScript`. `SiteShell` has no replacement: `@rxova/astro-ui` removed it in 0.3.0, so give the
36
+ page its own layout. `<Override>` is `SiteTitle`, `SocialIcons`,
36
37
  `Footer` or `ThemeSelect`.
37
38
 
38
39
  ## 4. Rename the short token aliases
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rxova/brand",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "description": "Design tokens, typefaces and project data for rxova.org",
6
6
  "keywords": [
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export {
5
5
  PROJECTS,
6
6
  REPOS,
7
7
  REPO_IDS,
8
+ SECTIONS,
8
9
  getProject,
9
10
  getRepo,
10
11
  docsUrl,
@@ -14,6 +15,7 @@ export {
14
15
  type Project,
15
16
  type ProjectId,
16
17
  type RepoId,
18
+ type SectionId,
17
19
  } from './sites.ts'
18
20
 
19
21
  export { renderFeed, escapeXml, rfc822, type FeedItem, type FeedOptions } from './feed.ts'
package/src/sites.test.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  PROJECTS,
11
11
  REPOS,
12
12
  REPO_IDS,
13
+ SECTIONS,
13
14
  getProject,
14
15
  getRepo,
15
16
  docsUrl,
@@ -146,3 +147,12 @@ describe('projectFromBase', () => {
146
147
  expect(projectFromBase('/packages/nope/')).toBeUndefined()
147
148
  })
148
149
  })
150
+
151
+ describe('SECTIONS', () => {
152
+ it('lists the site sections in menu order, each a page path Pages serves without a redirect', () => {
153
+ expect(SECTIONS.map((s) => s.label)).toEqual(['Blog', 'Updates', 'About'])
154
+ for (const section of SECTIONS) {
155
+ expect(section.path).toBe(`/${section.id}/`)
156
+ }
157
+ })
158
+ })
package/src/sites.ts CHANGED
@@ -6,32 +6,14 @@
6
6
  /** Canonical origin. Override for a staging deploy (e.g. https://web.rxova.org). */
7
7
  export const RXOVA_ORIGIN = process.env.RXOVA_ORIGIN ?? 'https://rxova.org'
8
8
 
9
- export type ProjectId =
10
- 'overlock' | 'journey' | 'react-inputs' | 'use-everywhere' | 'ts-extended-errors'
11
-
12
- export interface Project {
13
- id: ProjectId
14
- /** Display name, used in the header, the switcher and the landing cards. */
15
- label: string
16
- /** Path the aggregator mounts this project's docs at. Leading and trailing slash. */
17
- mount: `/${string}/`
18
- tagline: string
19
- repo: string
20
- /** The package a newcomer should install first. */
21
- npm: string
22
- /** npm package names, most prominent first. */
23
- packages: string[]
24
- }
25
-
26
9
  /**
27
- * Display order, shared by the landing's project rail and the docs switcher.
28
- * overlock stays last: it is a CLI and CI gate, not a library you import.
10
+ * Every rxova project, in display order: the landing's project rail and the docs switcher.
11
+ * The one list of projects; `sources.json` only says which are deployed. overlock stays last.
29
12
  */
30
- export const PROJECTS: readonly Project[] = [
13
+ const DEFINITIONS = [
31
14
  {
32
15
  id: 'journey',
33
16
  label: 'journey',
34
- mount: '/packages/journey/',
35
17
  tagline: 'Declarative journey graphs for non-linear UI flows.',
36
18
  repo: 'https://github.com/rxova/journey',
37
19
  npm: 'https://www.npmjs.com/package/@rxova/journey-core',
@@ -40,7 +22,6 @@ export const PROJECTS: readonly Project[] = [
40
22
  {
41
23
  id: 'react-inputs',
42
24
  label: 'react-inputs',
43
- mount: '/packages/react-inputs/',
44
25
  tagline: 'The tricky React inputs, done right.',
45
26
  repo: 'https://github.com/rxova/react-inputs',
46
27
  npm: 'https://www.npmjs.com/package/@rxova/react-inputs',
@@ -60,7 +41,6 @@ export const PROJECTS: readonly Project[] = [
60
41
  {
61
42
  id: 'use-everywhere',
62
43
  label: 'use-everywhere',
63
- mount: '/packages/use-everywhere/',
64
44
  tagline: 'State and messages that exist in every tab, window, and worker.',
65
45
  repo: 'https://github.com/rxova/use-everywhere',
66
46
  npm: 'https://www.npmjs.com/package/use-everywhere',
@@ -69,7 +49,6 @@ export const PROJECTS: readonly Project[] = [
69
49
  {
70
50
  id: 'ts-extended-errors',
71
51
  label: 'ts-extended-errors',
72
- mount: '/packages/ts-extended-errors/',
73
52
  tagline: 'Typed, serializable errors that survive a JSON round trip.',
74
53
  repo: 'https://github.com/rxova/ts-extended-errors',
75
54
  npm: 'https://www.npmjs.com/package/ts-extended-errors',
@@ -78,7 +57,6 @@ export const PROJECTS: readonly Project[] = [
78
57
  {
79
58
  id: 'overlock',
80
59
  label: 'overlock',
81
- mount: '/packages/overlock/',
82
60
  tagline: 'A deterministic gate on test integrity in a git patch.',
83
61
  repo: 'https://github.com/rxova/overlock',
84
62
  npm: 'https://www.npmjs.com/package/overlock',
@@ -86,6 +64,28 @@ export const PROJECTS: readonly Project[] = [
86
64
  },
87
65
  ] as const
88
66
 
67
+ export type ProjectId = (typeof DEFINITIONS)[number]['id']
68
+
69
+ export interface Project {
70
+ id: ProjectId
71
+ /** Display name, used in the header, the switcher and the landing cards. */
72
+ label: string
73
+ /** Path the aggregator mounts this project's docs at: always `/packages/<id>/`. */
74
+ mount: `/${string}/`
75
+ tagline: string
76
+ repo: string
77
+ /** The package a newcomer should install first. */
78
+ npm: string
79
+ /** npm package names, most prominent first. */
80
+ packages: string[]
81
+ }
82
+
83
+ export const PROJECTS: readonly Project[] = DEFINITIONS.map((project) => ({
84
+ ...project,
85
+ mount: `/packages/${project.id}/`,
86
+ packages: [...project.packages],
87
+ }))
88
+
89
89
  export function getProject(id: ProjectId): Project {
90
90
  const project = PROJECTS.find((p) => p.id === id)
91
91
  if (!project) throw new Error(`[@rxova/brand] unknown project id: ${id}`)
@@ -123,6 +123,18 @@ export function getRepo(id: RepoId): (typeof REPOS)[number] {
123
123
  return found
124
124
  }
125
125
 
126
+ /**
127
+ * The standalone sections of rxova.org, in menu order, beside the project list. Every surface's
128
+ * navigation reads this: the site header, the docs header and the shared footer.
129
+ */
130
+ export const SECTIONS = [
131
+ { id: 'blog', label: 'Blog', path: '/blog/' },
132
+ { id: 'updates', label: 'Updates', path: '/updates/' },
133
+ { id: 'about', label: 'About', path: '/about/' },
134
+ ] as const
135
+
136
+ export type SectionId = (typeof SECTIONS)[number]['id']
137
+
126
138
  /** Absolute URL to a project's docs root. */
127
139
  export function docsUrl(id: ProjectId): string {
128
140
  return `${RXOVA_ORIGIN}${getProject(id).mount}`