@supertype.ai/foundations 0.1.27 → 0.1.28

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
@@ -2,7 +2,6 @@
2
2
 
3
3
  [![ci](https://github.com/supertypeai/foundations/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/supertypeai/foundations/actions/workflows/ci.yml)
4
4
  [![npm](https://img.shields.io/npm/v/%40supertype.ai%2Ffoundations?logo=npm&color=cb3837)](https://www.npmjs.com/package/@supertype.ai/foundations)
5
- [![bundle](https://img.shields.io/bundlephobia/minzip/%40supertype.ai%2Ffoundations?label=min%2Bgzip)](https://bundlephobia.com/package/@supertype.ai/foundations)
6
5
  [![license](https://img.shields.io/npm/l/%40supertype.ai%2Ffoundations?color=blue)](LICENSE)
7
6
 
8
7
  [The foundations philosophy](https://supertypeai.github.io/foundations/philosophy/) lays out the Raison d'être better, but the crux is that it is a reusable design system that binds typography primitives, content blocks, the long-form essay shell, the token and theme CSS, and the build-time tooling that keep baseline quality high (SEO, OG cards, lint rules, contrast
@@ -66,7 +65,7 @@ untagged git dependency re-resolves to a different commit on any fresh install.
66
65
 
67
66
  ```jsonc
68
67
  // package.json
69
- "@supertype.ai/foundations": "https://github.com/supertypeai/foundations.git#v0.1.27"
68
+ "@supertype.ai/foundations": "https://github.com/supertypeai/foundations.git#v0.1.28"
70
69
  ```
71
70
 
72
71
  </details>
package/dist/seo.d.ts CHANGED
@@ -76,9 +76,10 @@ export declare function createSeo(config: SeoConfig): {
76
76
  "@type": string;
77
77
  url: string;
78
78
  } | undefined;
79
- "@type": string;
80
79
  name: string;
81
80
  url: string;
81
+ "@id"?: string | undefined;
82
+ "@type": string;
82
83
  };
83
84
  mainEntityOfPage: {
84
85
  "@type": string;
@@ -154,9 +155,10 @@ export declare function createSeo(config: SeoConfig): {
154
155
  "@type": string;
155
156
  url: string;
156
157
  } | undefined;
157
- "@type": string;
158
158
  name: string;
159
159
  url: string;
160
+ "@id"?: string | undefined;
161
+ "@type": string;
160
162
  };
161
163
  author?: {
162
164
  jobTitle?: string | undefined;
package/dist/seo.js CHANGED
@@ -7,11 +7,6 @@ export function createSeo(config) {
7
7
  const { baseUrl, siteName, defaultOgImage, logoUrl, articleBasePath = "notes", publisherUrl, trailingSlash = false, } = config;
8
8
  /** Resolves a possibly-relative URL against the site origin. */
9
9
  const absolute = (url) => url.startsWith("http") ? url : `${baseUrl}${url.startsWith("/") ? "" : "/"}${url}`;
10
- /**
11
- * Stable `@id` anchors for the site's core entities. Pages reference these
12
- * rather than re-declaring an Organization node, so crawlers merge them into
13
- * one entity instead of collecting near-duplicates.
14
- */
15
10
  /**
16
11
  * A page route in the shape this site actually serves. A URL already carrying
17
12
  * a query, a fragment or a file extension is left alone — only a route gets
@@ -34,10 +29,24 @@ export function createSeo(config) {
34
29
  ...(author.jobTitle ? { jobTitle: author.jobTitle } : {}),
35
30
  };
36
31
  };
32
+ /**
33
+ * Stable `@id` anchors for the site's core entities. Pages reference these
34
+ * rather than re-declaring an Organization node, so crawlers merge them into
35
+ * one entity instead of collecting near-duplicates.
36
+ */
37
37
  const ORG_ID = `${baseUrl}/#organization`;
38
38
  const WEBSITE_ID = `${baseUrl}/#website`;
39
+ /**
40
+ * The publisher every Article and WebPage node points at. It carries `@id`
41
+ * only when the publisher is this site: without one, each page declares a
42
+ * fresh Organization and a crawler has no way to merge a corpus of them into
43
+ * the canonical entity the site emits once. A `publisherUrl` naming a
44
+ * different site gets no `@id` — `ORG_ID` is derived from `baseUrl`, so
45
+ * stamping it there would claim someone else's publisher as this one.
46
+ */
39
47
  const publisher = {
40
48
  "@type": "Organization",
49
+ ...(!publisherUrl || publisherUrl === baseUrl ? { "@id": ORG_ID } : {}),
41
50
  name: siteName,
42
51
  url: publisherUrl ?? baseUrl,
43
52
  ...(logoUrl
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supertype.ai/foundations",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",