@jdevalk/seo-graph-core 0.1.0 → 0.3.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/README.md +7 -28
- package/dist/pieces/article.js +2 -1
- package/dist/pieces/article.js.map +1 -1
- package/dist/pieces/image.js +2 -1
- package/dist/pieces/image.js.map +1 -1
- package/dist/pieces/organization.d.ts +21 -8
- package/dist/pieces/organization.d.ts.map +1 -1
- package/dist/pieces/organization.js +10 -4
- package/dist/pieces/organization.js.map +1 -1
- package/dist/pieces/webpage.d.ts +7 -2
- package/dist/pieces/webpage.d.ts.map +1 -1
- package/dist/pieces/webpage.js +6 -2
- package/dist/pieces/webpage.js.map +1 -1
- package/dist/pieces/website.js +2 -1
- package/dist/pieces/website.js.map +1 -1
- package/package.json +49 -49
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -98,34 +98,13 @@ const graph = assembleGraph([
|
|
|
98
98
|
The [agent-ready web](https://joost.blog/tag/agent-ready/) needs every
|
|
99
99
|
publisher to expose a rich, linked knowledge graph for their content. Hand-
|
|
100
100
|
writing JSON-LD is error-prone; writing it once per framework is worse.
|
|
101
|
-
`@jdevalk/seo-graph-core` is the shared engine behind
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- [`@jdevalk/astro-seo-graph`](https://www.npmjs.com/package/@jdevalk/astro-seo-graph)
|
|
105
|
-
- [`@jdevalk/emdash-plugin-seo`](https://www.npmjs.com/package/@jdevalk/emdash-plugin-seo)
|
|
106
|
-
|
|
107
|
-
Two different runtimes, one graph engine.
|
|
108
|
-
|
|
109
|
-
## Known limitations
|
|
110
|
-
|
|
111
|
-
The following will be fixed in `0.2.x` without breaking changes. They're
|
|
112
|
-
documented here so you know what's coming.
|
|
113
|
-
|
|
114
|
-
- **`WebPageInput.breadcrumb` is required.** Schema.org treats it as
|
|
115
|
-
optional, and consumers that don't have breadcrumbs can't use
|
|
116
|
-
`buildWebPage` without an `extra` override. Will become optional.
|
|
117
|
-
- **`buildOrganization` takes a `subtype: string` parameter** instead of a
|
|
118
|
-
generic type parameter, which loses schema-dts autocomplete for subtype-
|
|
119
|
-
specific fields like `checkinTime` on a `Hotel`. Will gain a
|
|
120
|
-
`buildOrganization<T extends Organization>(...)` signature.
|
|
121
|
-
- **`makeIds` is hardcoded to joost.blog's `@id` scheme** (`/#/schema.org/WebSite`,
|
|
122
|
-
etc.). Sites with different conventions (like EmDash-style plugins using
|
|
123
|
-
`/#website`) can't use the factory as-is. Will accept custom ID pattern
|
|
124
|
-
overrides.
|
|
125
|
-
|
|
126
|
-
If any of these block you, file an issue at
|
|
127
|
-
https://github.com/jdevalk/seo-graph/issues — the fixes are already in the
|
|
128
|
-
roadmap and prioritization follows real blockers.
|
|
101
|
+
`@jdevalk/seo-graph-core` is the shared engine behind two downstream packages,
|
|
102
|
+
both in production:
|
|
103
|
+
|
|
104
|
+
- [`@jdevalk/astro-seo-graph`](https://www.npmjs.com/package/@jdevalk/astro-seo-graph) — the Astro integration (`<Seo>` + route factories). Used in production by [joost.blog](https://joost.blog) and [limonaia.house](https://limonaia.house).
|
|
105
|
+
- [`@jdevalk/emdash-plugin-seo`](https://www.npmjs.com/package/@jdevalk/emdash-plugin-seo) — the EmDash CMS plugin. Uses `assembleGraph` directly (EmDash contributes metadata through hooks, not through templates, so it doesn't go through the `<Seo>` component).
|
|
106
|
+
|
|
107
|
+
Two different integration runtimes, one graph engine.
|
|
129
108
|
|
|
130
109
|
## License
|
|
131
110
|
|
package/dist/pieces/article.js
CHANGED
|
@@ -13,10 +13,11 @@ export function buildArticle(input, ids) {
|
|
|
13
13
|
headline: input.headline,
|
|
14
14
|
mainEntityOfPage: { '@id': ids.webPage(input.url) },
|
|
15
15
|
publisher: input.publisher,
|
|
16
|
-
inLanguage: input.inLanguage ?? 'en-US',
|
|
17
16
|
description: input.description,
|
|
18
17
|
datePublished: input.datePublished.toISOString(),
|
|
19
18
|
};
|
|
19
|
+
if (input.inLanguage !== undefined)
|
|
20
|
+
piece.inLanguage = input.inLanguage;
|
|
20
21
|
if (input.dateModified !== undefined) {
|
|
21
22
|
piece.dateModified = input.dateModified.toISOString();
|
|
22
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../src/pieces/article.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAmB,EAAE,GAAc;IAC5D,MAAM,KAAK,GAA4B;QACnC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACnD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,
|
|
1
|
+
{"version":3,"file":"article.js","sourceRoot":"","sources":["../../src/pieces/article.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAmB,EAAE,GAAc;IAC5D,MAAM,KAAK,GAA4B;QACnC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;QAC7B,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,MAAM,EAAE,KAAK,CAAC,MAAM;QACpB,QAAQ,EAAE,KAAK,CAAC,QAAQ;QACxB,gBAAgB,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;QACnD,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,WAAW,EAAE,KAAK,CAAC,WAAW;QAC9B,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,WAAW,EAAE;KACnD,CAAC;IAEF,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACxE,IAAI,KAAK,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACnC,KAAK,CAAC,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC;IAC1D,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;IACzD,IAAI,KAAK,CAAC,cAAc,KAAK,SAAS;QAAE,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;IACpF,IAAI,KAAK,CAAC,SAAS,KAAK,SAAS;QAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IACrE,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IAE3E,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/pieces/image.js
CHANGED
|
@@ -18,7 +18,8 @@ export function buildImageObject(input, ids) {
|
|
|
18
18
|
};
|
|
19
19
|
if (input.caption !== undefined)
|
|
20
20
|
piece.caption = input.caption;
|
|
21
|
-
|
|
21
|
+
if (input.inLanguage !== undefined)
|
|
22
|
+
piece.inLanguage = input.inLanguage;
|
|
22
23
|
return { ...piece, ...input.extra };
|
|
23
24
|
}
|
|
24
25
|
//# sourceMappingURL=image.js.map
|
package/dist/pieces/image.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../src/pieces/image.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAuB,EAAE,GAAc;IACpE,MAAM,EAAE,GACJ,KA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B,MAAM,EAAE,KAAK,CAAC,MAAM;KACvB,CAAC;IACF,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/D,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IAExE,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import type { Organization } from 'schema-dts';
|
|
1
2
|
import type { IdFactory } from '../ids.js';
|
|
2
|
-
export interface OrganizationInput {
|
|
3
|
+
export interface OrganizationInput<T extends Organization = Organization> {
|
|
3
4
|
/** Stable slug used for the @id. */
|
|
4
5
|
slug: string;
|
|
5
6
|
name: string;
|
|
@@ -10,24 +11,36 @@ export interface OrganizationInput {
|
|
|
10
11
|
'@id': string;
|
|
11
12
|
};
|
|
12
13
|
sameAs?: readonly string[];
|
|
13
|
-
/**
|
|
14
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Escape hatch for schema.org properties specific to a subtype. Typed
|
|
16
|
+
* as `Partial<T>` so callers that pass a concrete subtype (e.g.
|
|
17
|
+
* `OrganizationInput<Hotel>`) get schema-dts autocomplete for that
|
|
18
|
+
* subtype's fields — `checkinTime`, `numberOfRooms`, etc. — instead
|
|
19
|
+
* of an untyped `Record<string, unknown>`.
|
|
20
|
+
*/
|
|
21
|
+
extra?: Partial<T>;
|
|
15
22
|
}
|
|
16
23
|
/**
|
|
17
24
|
* Build a schema.org Organization piece, or any of its subtypes. Pass the
|
|
18
|
-
* concrete @type as the third argument
|
|
25
|
+
* concrete @type as the third argument and the matching schema-dts type as
|
|
26
|
+
* the generic parameter to get autocomplete for that subtype's fields:
|
|
19
27
|
*
|
|
20
28
|
* ```ts
|
|
21
29
|
* import type { Hotel } from 'schema-dts';
|
|
22
30
|
* const hotel = buildOrganization<Hotel>(
|
|
23
|
-
* {
|
|
31
|
+
* {
|
|
32
|
+
* slug: 'la-limonaia',
|
|
33
|
+
* name: 'La Limonaia',
|
|
34
|
+
* extra: { checkinTime: '16:00' }, // <-- typed against Hotel
|
|
35
|
+
* },
|
|
24
36
|
* ids,
|
|
25
37
|
* 'Hotel',
|
|
26
38
|
* );
|
|
27
39
|
* ```
|
|
28
40
|
*
|
|
29
|
-
* The generic
|
|
30
|
-
*
|
|
41
|
+
* The generic defaults to `Organization`, so call sites that don't need
|
|
42
|
+
* subtype typing (`buildOrganization({ slug, name }, ids)`) continue to
|
|
43
|
+
* work without specifying `<T>`.
|
|
31
44
|
*/
|
|
32
|
-
export declare function buildOrganization(input: OrganizationInput
|
|
45
|
+
export declare function buildOrganization<T extends Organization = Organization>(input: OrganizationInput<T>, ids: IdFactory, subtype?: string): Record<string, unknown>;
|
|
33
46
|
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/pieces/organization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,iBAAiB;
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/pieces/organization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAE3C,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY;IACpE,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,IAAI,CAAC,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAClC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,EACnE,KAAK,EAAE,iBAAiB,CAAC,CAAC,CAAC,EAC3B,GAAG,EAAE,SAAS,EACd,OAAO,GAAE,MAAuB,GACjC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAWzB"}
|
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Build a schema.org Organization piece, or any of its subtypes. Pass the
|
|
3
|
-
* concrete @type as the third argument
|
|
3
|
+
* concrete @type as the third argument and the matching schema-dts type as
|
|
4
|
+
* the generic parameter to get autocomplete for that subtype's fields:
|
|
4
5
|
*
|
|
5
6
|
* ```ts
|
|
6
7
|
* import type { Hotel } from 'schema-dts';
|
|
7
8
|
* const hotel = buildOrganization<Hotel>(
|
|
8
|
-
* {
|
|
9
|
+
* {
|
|
10
|
+
* slug: 'la-limonaia',
|
|
11
|
+
* name: 'La Limonaia',
|
|
12
|
+
* extra: { checkinTime: '16:00' }, // <-- typed against Hotel
|
|
13
|
+
* },
|
|
9
14
|
* ids,
|
|
10
15
|
* 'Hotel',
|
|
11
16
|
* );
|
|
12
17
|
* ```
|
|
13
18
|
*
|
|
14
|
-
* The generic
|
|
15
|
-
*
|
|
19
|
+
* The generic defaults to `Organization`, so call sites that don't need
|
|
20
|
+
* subtype typing (`buildOrganization({ slug, name }, ids)`) continue to
|
|
21
|
+
* work without specifying `<T>`.
|
|
16
22
|
*/
|
|
17
23
|
export function buildOrganization(input, ids, subtype = 'Organization') {
|
|
18
24
|
const piece = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/pieces/organization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization.js","sourceRoot":"","sources":["../../src/pieces/organization.ts"],"names":[],"mappings":"AAuBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,iBAAiB,CAC7B,KAA2B,EAC3B,GAAc,EACd,UAAkB,cAAc;IAEhC,MAAM,KAAK,GAA4B;QACnC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC;QACnC,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAC;IACF,IAAI,KAAK,CAAC,GAAG,KAAK,SAAS;QAAE,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC;IACnD,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IAC3E,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;IACtD,IAAI,KAAK,CAAC,MAAM,KAAK,SAAS;QAAE,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5D,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AACxC,CAAC"}
|
package/dist/pieces/webpage.d.ts
CHANGED
|
@@ -12,8 +12,13 @@ export interface WebPageInput {
|
|
|
12
12
|
name: string;
|
|
13
13
|
/** Reference to the site-wide WebSite (usually ids.website). */
|
|
14
14
|
isPartOf: Reference;
|
|
15
|
-
/**
|
|
16
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Reference to the BreadcrumbList for this page (usually
|
|
17
|
+
* `ids.breadcrumb(url)`). Optional — schema.org treats `breadcrumb`
|
|
18
|
+
* as optional on `WebPage`, so consumers without breadcrumbs can
|
|
19
|
+
* simply omit it.
|
|
20
|
+
*/
|
|
21
|
+
breadcrumb?: Reference;
|
|
17
22
|
inLanguage?: string;
|
|
18
23
|
/** Publish date — emitted as ISO string. */
|
|
19
24
|
datePublished?: Date;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpage.d.ts","sourceRoot":"","sources":["../../src/pieces/webpage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEvE,MAAM,WAAW,YAAY;IACzB,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,QAAQ,EAAE,SAAS,CAAC;IACpB
|
|
1
|
+
{"version":3,"file":"webpage.d.ts","sourceRoot":"","sources":["../../src/pieces/webpage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,aAAa,GAAG,gBAAgB,CAAC;AAEvE,MAAM,WAAW,YAAY;IACzB,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAC;IACZ,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;OAKG;IACH,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,2CAA2C;IAC3C,YAAY,CAAC,EAAE,IAAI,CAAC;IACpB,oDAAoD;IACpD,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CACxB,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,SAAS,EACd,IAAI,GAAE,WAAuB,GAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAkCzB"}
|
package/dist/pieces/webpage.js
CHANGED
|
@@ -16,10 +16,14 @@ export function buildWebPage(input, ids, type = 'WebPage') {
|
|
|
16
16
|
url: input.url,
|
|
17
17
|
name: input.name,
|
|
18
18
|
isPartOf: input.isPartOf,
|
|
19
|
-
breadcrumb: input.breadcrumb,
|
|
20
|
-
inLanguage: input.inLanguage ?? 'en-US',
|
|
21
19
|
potentialAction,
|
|
22
20
|
};
|
|
21
|
+
if (input.inLanguage !== undefined) {
|
|
22
|
+
piece.inLanguage = input.inLanguage;
|
|
23
|
+
}
|
|
24
|
+
if (input.breadcrumb !== undefined) {
|
|
25
|
+
piece.breadcrumb = input.breadcrumb;
|
|
26
|
+
}
|
|
23
27
|
if (input.datePublished !== undefined) {
|
|
24
28
|
piece.datePublished = input.datePublished.toISOString();
|
|
25
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webpage.js","sourceRoot":"","sources":["../../src/pieces/webpage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webpage.js","sourceRoot":"","sources":["../../src/pieces/webpage.ts"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CACxB,KAAmB,EACnB,GAAc,EACd,OAAoB,SAAS;IAE7B,MAAM,eAAe,GAA2C,KAAK,CAAC,eAAe,IAAI;QACrF,EAAE,O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ite(input, ids) {
|
|
|
12
12
|
if (input.description !== undefined)
|
|
13
13
|
piece.description = input.description;
|
|
14
14
|
piece.publisher = input.publisher;
|
|
15
|
-
|
|
15
|
+
if (input.inLanguage !== undefined)
|
|
16
|
+
piece.inLanguage = input.inLanguage;
|
|
16
17
|
if (input.hasPart !== undefined)
|
|
17
18
|
piece.hasPart = input.hasPart;
|
|
18
19
|
return { ...piece, ...input.extra };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"website.js","sourceRoot":"","sources":["../../src/pieces/website.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAmB,EAAE,GAAc;IAC5D,MAAM,KAAK,GAA4B;QACnC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,GAAG,CAAC,OAAO;QAClB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAC;IACF,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IAC3E,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,KAAK,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"website.js","sourceRoot":"","sources":["../../src/pieces/website.ts"],"names":[],"mappings":"AAkBA;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,KAAmB,EAAE,GAAc;IAC5D,MAAM,KAAK,GAA4B;QACnC,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,GAAG,CAAC,OAAO;QAClB,GAAG,EAAE,KAAK,CAAC,GAAG;QACd,IAAI,EAAE,KAAK,CAAC,IAAI;KACnB,CAAC;IACF,IAAI,KAAK,CAAC,WAAW,KAAK,SAAS;QAAE,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IAC3E,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC;IAClC,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAAE,KAAK,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC;IACxE,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;IAC/D,OAAO,EAAE,GAAG,KAAK,EAAE,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC;AACxC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"name": "@jdevalk/seo-graph-core",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "Pure schema.org JSON-LD graph builders. Runtime-agnostic core for agent-ready SEO.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"schema.org",
|
|
7
|
+
"json-ld",
|
|
8
|
+
"seo",
|
|
9
|
+
"agent-ready",
|
|
10
|
+
"structured-data"
|
|
11
|
+
],
|
|
12
|
+
"author": "Joost de Valk <joost@joost.blog>",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"README.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "git+https://github.com/jdevalk/seo-graph.git",
|
|
31
|
+
"directory": "packages/seo-graph-core"
|
|
32
|
+
},
|
|
33
|
+
"bugs": "https://github.com/jdevalk/seo-graph/issues",
|
|
34
|
+
"homepage": "https://github.com/jdevalk/seo-graph/tree/main/packages/seo-graph-core#readme",
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.build.json",
|
|
40
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
41
|
+
"test": "vitest run"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"schema-dts": "^2.0.0"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@types/node": "^22.0.0",
|
|
48
|
+
"typescript": "^5.6.0",
|
|
49
|
+
"vitest": "^2.0.0"
|
|
21
50
|
}
|
|
22
|
-
|
|
23
|
-
"files": [
|
|
24
|
-
"dist",
|
|
25
|
-
"README.md",
|
|
26
|
-
"LICENSE"
|
|
27
|
-
],
|
|
28
|
-
"repository": {
|
|
29
|
-
"type": "git",
|
|
30
|
-
"url": "git+https://github.com/jdevalk/seo-graph.git",
|
|
31
|
-
"directory": "packages/seo-graph-core"
|
|
32
|
-
},
|
|
33
|
-
"bugs": "https://github.com/jdevalk/seo-graph/issues",
|
|
34
|
-
"homepage": "https://github.com/jdevalk/seo-graph/tree/main/packages/seo-graph-core#readme",
|
|
35
|
-
"publishConfig": {
|
|
36
|
-
"access": "public"
|
|
37
|
-
},
|
|
38
|
-
"dependencies": {
|
|
39
|
-
"schema-dts": "^2.0.0"
|
|
40
|
-
},
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/node": "^22.0.0",
|
|
43
|
-
"typescript": "^5.6.0",
|
|
44
|
-
"vitest": "^2.0.0"
|
|
45
|
-
},
|
|
46
|
-
"scripts": {
|
|
47
|
-
"build": "tsc -p tsconfig.build.json",
|
|
48
|
-
"typecheck": "tsc -p tsconfig.json",
|
|
49
|
-
"test": "vitest run"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
51
|
+
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Joost de Valk
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|