@escape-game-over/atlas 0.1.113 → 0.1.115

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/README.md CHANGED
@@ -109,7 +109,9 @@ declares, and `override` and every `override*` is a patch over it.
109
109
  The copy comes first so a deployment's other files can name its messages by
110
110
  key. Anything declared before the project, its venues or its settings, types a
111
111
  message as `CatalogKey<typeof messages>`: the default catalog's keys and the
112
- deployment's own, exactly the ones `t()` takes. A typo fails on its line.
112
+ deployment's own, exactly the ones `t()` takes. A typo fails on its line. A
113
+ field that only ever names one kind of message narrows to it:
114
+ `CatalogKey<typeof messages, \`events.facts.${string}\`>`.
113
115
 
114
116
  ## The four steps
115
117
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.113",
3
+ "version": "0.1.115",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
@@ -36,10 +36,14 @@ export interface ProjectCatalog<Base, Published extends string, Override, Add> {
36
36
  *
37
37
  * What a site built from the project translates, so a key typed with it is
38
38
  * one `t()` takes as it is.
39
+ *
40
+ * `Family` narrows to one kind of message, for a field that only ever names
41
+ * that kind: `CatalogKey<typeof messages, \`events.facts.${string}\`>` is the
42
+ * event facts the catalog has, the base's and the project's own.
39
43
  */
40
- export type CatalogKey<C> =
44
+ export type CatalogKey<C, Family extends string = string> =
41
45
  C extends ProjectCatalog<infer Base, string, unknown, infer Add>
42
- ? StringKeys<Base> | StringKeys<Add>
46
+ ? Extract<StringKeys<Base> | StringKeys<Add>, Family>
43
47
  : never;
44
48
 
45
49
  /** The messages a site built from the catalog reads: the base's and its own. */
package/src/site/api.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { AnalyticsSettings } from "../analytics/index.ts";
1
2
  import type { ResolvedLocaleMeta } from "../config.ts";
2
3
  import type {
3
4
  MessageBindings,
@@ -157,6 +158,14 @@ export interface Site<
157
158
  * value that then drifts from the one every page's `<head>` carries.
158
159
  */
159
160
  readonly themeColor: ThemeColor;
161
+ /**
162
+ * The project's analytics, as declared: what the site's pages load, and so
163
+ * what a consent banner and a storage notice must name.
164
+ *
165
+ * Exposed so shared code reads it here rather than from the linked project,
166
+ * whose file is one project's and not what every project guarantees.
167
+ */
168
+ readonly analytics: AnalyticsSettings | undefined;
160
169
  readonly localeMeta: Readonly<Record<L, ResolvedLocaleMeta>>;
161
170
  /** The site's `defaultFonts` with this project's `overrideFonts` applied. */
162
171
  readonly fonts: Fonts;
@@ -880,6 +880,7 @@ export function createSite<
880
880
  url: siteUrl,
881
881
  siteName: project.siteName,
882
882
  themeColor: project.themeColor,
883
+ analytics: project.analytics,
883
884
  localeMeta,
884
885
  fonts,
885
886
  routes: enabledRouteIds,