@mannisto/astro-metadata 2.0.0-alpha.4 → 2.0.0-alpha.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mannisto/astro-metadata",
3
- "version": "2.0.0-alpha.4",
3
+ "version": "2.0.0-alpha.5",
4
4
  "description": "Metadata for Astro: page tags, social cards, favicons, the web app manifest and structured data.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/lib/schema.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Graph, Thing, WithContext } from "schema-dts"
1
+ import type { Graph, Thing } from "schema-dts"
2
2
 
3
3
  import { getConfig, localize } from "./config.ts"
4
4
  import type { Localized } from "./config.ts"
@@ -8,8 +8,11 @@ import { url } from "./url.ts"
8
8
  * A structured data item of your own, e.g. a `Product` or an `Event`. The schema.org types
9
9
  * give the editor completion, and other objects are also accepted. `@context` is not
10
10
  * necessary: the items go into one graph with the context.
11
+ *
12
+ * `@context` is an optional property, not `WithContext<Thing>`: that type makes the union of
13
+ * schema-dts too large for TypeScript when a layout spreads its props into `<Metadata>`.
11
14
  */
12
- export type SchemaData = Thing | WithContext<Thing> | Record<string, unknown>
15
+ export type SchemaData = (Thing & { "@context"?: string }) | Record<string, unknown>
13
16
 
14
17
  /**
15
18
  * The organization or the person behind the site. It is the publisher of the site and of