@tsdoctor/seo 0.4.8 → 0.4.10
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/Attribution.js +1 -2
- package/Canonical.js +1 -2
- package/HeadTag.js +1 -2
- package/OpenGraph.js +1 -2
- package/Seo.js +1 -2
- package/StructuredData.js +1 -2
- package/index.d.ts +0 -12
- package/package.json +5 -5
package/Attribution.js
CHANGED
|
@@ -2,7 +2,7 @@ import { licenseExpressionOf } from "@effected/package-json";
|
|
|
2
2
|
import { SpdxExpression } from "@effected/spdx";
|
|
3
3
|
import { Option } from "effect";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/Attribution.ts
|
|
6
6
|
/** The license half of the facts, or nothing when there is no SPDX to read. */
|
|
7
7
|
function licenseFacts(license) {
|
|
8
8
|
if (license == null) return {
|
|
@@ -95,5 +95,4 @@ function attributionFacts(manifest) {
|
|
|
95
95
|
};
|
|
96
96
|
}
|
|
97
97
|
|
|
98
|
-
//#endregion
|
|
99
98
|
export { attributionFacts };
|
package/Canonical.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Canonical.ts
|
|
2
2
|
/**
|
|
3
3
|
* URL derivation for a documentation page: the site URL prefix, the canonical
|
|
4
4
|
* page URL, absolute image URLs and image MIME mapping.
|
|
@@ -107,5 +107,4 @@ function trimSlashesEnd(text) {
|
|
|
107
107
|
return text.slice(0, end);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
//#endregion
|
|
111
110
|
export { canonicalUrl, deriveSiteUrl, imageMimeType, resolveUrl };
|
package/HeadTag.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/HeadTag.ts
|
|
2
2
|
/**
|
|
3
3
|
* Escape a JSON string so it cannot terminate the `<script>` element that
|
|
4
4
|
* carries it.
|
|
@@ -65,5 +65,4 @@ function jsonLd(json) {
|
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
//#endregion
|
|
69
68
|
export { escapeScriptBody, jsonLd, link, meta, metaNamed };
|
package/OpenGraph.js
CHANGED
|
@@ -2,7 +2,7 @@ import { canonicalUrl } from "./Canonical.js";
|
|
|
2
2
|
import { meta, metaNamed } from "./HeadTag.js";
|
|
3
3
|
import { Schema } from "effect";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/OpenGraph.ts
|
|
6
6
|
/**
|
|
7
7
|
* Open Graph and Twitter card vocabulary: the metadata schemas, the
|
|
8
8
|
* page-metadata assembly and the two tag emitters.
|
|
@@ -156,5 +156,4 @@ function twitterTags(metadata, site) {
|
|
|
156
156
|
return tags;
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
//#endregion
|
|
160
159
|
export { OpenGraphImageConfig, OpenGraphImageMetadata, OpenGraphMetadata, createPageMetadata, openGraphTags, twitterTags };
|
package/Seo.js
CHANGED
|
@@ -2,7 +2,7 @@ import { canonicalUrl } from "./Canonical.js";
|
|
|
2
2
|
import { jsonLd, link } from "./HeadTag.js";
|
|
3
3
|
import { createPageMetadata, openGraphTags, twitterTags } from "./OpenGraph.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/Seo.ts
|
|
6
6
|
/**
|
|
7
7
|
* The one seam an adapter consumes: everything a documentation page needs in
|
|
8
8
|
* its `<head>`, as a flat array of neutral {@link HeadTag}s.
|
|
@@ -47,5 +47,4 @@ function headTags(input) {
|
|
|
47
47
|
return tags;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
//#endregion
|
|
51
50
|
export { headTags };
|
package/StructuredData.js
CHANGED
|
@@ -2,7 +2,7 @@ import { canonicalUrl } from "./Canonical.js";
|
|
|
2
2
|
import { Result } from "effect";
|
|
3
3
|
import { APIReference, JsonLdDocument, NodeRef, Person, SoftwareSourceCode, TechArticle } from "@effected/schema-org";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
// src/StructuredData.ts
|
|
6
6
|
/**
|
|
7
7
|
* The package node's `@id`.
|
|
8
8
|
*
|
|
@@ -165,5 +165,4 @@ function deriveScriptBody(pkg, page) {
|
|
|
165
165
|
return Result.map(derive(pkg, page), (graph) => graph.toScriptBody());
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
//#endregion
|
|
169
168
|
export { derive, deriveScriptBody, packageContext };
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { PackageManifest } from "@effected/package-json";
|
|
2
2
|
import { Result, Schema } from "effect";
|
|
3
3
|
import { ConflictingTermError, DuplicateNodeIdError, InvalidNodeIdError, JsonLdDocument, JsonLdNode } from "@effected/schema-org";
|
|
4
|
-
//#region src/Attribution.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* The attribution a page can credit, derived from one package manifest.
|
|
7
6
|
*
|
|
@@ -101,8 +100,6 @@ interface AttributionFacts {
|
|
|
101
100
|
* @public
|
|
102
101
|
*/
|
|
103
102
|
export declare function attributionFacts(manifest: PackageManifest): AttributionFacts;
|
|
104
|
-
//#endregion
|
|
105
|
-
//#region src/Canonical.d.ts
|
|
106
103
|
/**
|
|
107
104
|
* URL derivation for a documentation page: the site URL prefix, the canonical
|
|
108
105
|
* page URL, absolute image URLs and image MIME mapping.
|
|
@@ -175,8 +172,6 @@ export declare function deriveSiteUrl(siteOrigin: string | undefined, base: stri
|
|
|
175
172
|
* @public
|
|
176
173
|
*/
|
|
177
174
|
export declare function canonicalUrl(siteUrl: string, pageRoute: string): string;
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/HeadTag.d.ts
|
|
180
175
|
/**
|
|
181
176
|
* The neutral head-tag vocabulary every adapter renders.
|
|
182
177
|
*
|
|
@@ -232,8 +227,6 @@ export declare function metaNamed(name: string, content: string): HeadTag;
|
|
|
232
227
|
export declare function link(rel: string, href: string): HeadTag;
|
|
233
228
|
/** A `<script type="application/ld+json">` carrying an escaped body. @public */
|
|
234
229
|
export declare function jsonLd(json: string): HeadTag;
|
|
235
|
-
//#endregion
|
|
236
|
-
//#region src/OpenGraph.d.ts
|
|
237
230
|
/**
|
|
238
231
|
* Structured Open Graph image metadata (alternative to a plain URL string).
|
|
239
232
|
*
|
|
@@ -363,8 +356,6 @@ export declare function openGraphTags(metadata: OpenGraphMetadata): ReadonlyArra
|
|
|
363
356
|
* @public
|
|
364
357
|
*/
|
|
365
358
|
export declare function twitterTags(metadata: OpenGraphMetadata, site?: string): ReadonlyArray<HeadTag>;
|
|
366
|
-
//#endregion
|
|
367
|
-
//#region src/Seo.d.ts
|
|
368
359
|
/**
|
|
369
360
|
* Everything {@link headTags} needs about one documentation page.
|
|
370
361
|
*
|
|
@@ -408,8 +399,6 @@ interface SeoPageInput {
|
|
|
408
399
|
* @public
|
|
409
400
|
*/
|
|
410
401
|
export declare function headTags(input: SeoPageInput): ReadonlyArray<HeadTag>;
|
|
411
|
-
//#endregion
|
|
412
|
-
//#region src/StructuredData.d.ts
|
|
413
402
|
/**
|
|
414
403
|
* Every way {@link derive} can fail, all of them identity problems raised by
|
|
415
404
|
* `JsonLdDocument.buildResult`.
|
|
@@ -542,6 +531,5 @@ export declare function derive(pkg: PackageContext, page: PageNodeInput): Result
|
|
|
542
531
|
* @public
|
|
543
532
|
*/
|
|
544
533
|
export declare function deriveScriptBody(pkg: PackageContext, page: PageNodeInput): Result.Result<string, StructuredDataError>;
|
|
545
|
-
//#endregion
|
|
546
534
|
export type { AttributionFacts, HeadTag, PackageContext, PackageNodeInput, PageNodeInput, SeoPageInput, StructuredDataError };
|
|
547
535
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsdoctor/seo",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Framework-neutral head metadata for static TypeScript API documentation: schema.org JSON-LD, Open Graph and Twitter card vocabulary, canonical URLs, and package attribution derived from an api.json model plus its manifest.",
|
|
6
6
|
"keywords": [
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
"./package.json": "./package.json"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@effected/spdx": "^0.
|
|
40
|
+
"@effected/spdx": "^0.16.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@effected/package-json": "^0.
|
|
44
|
-
"@effected/schema-org": "^0.
|
|
45
|
-
"effect": "^4.0.
|
|
43
|
+
"@effected/package-json": "^0.24.0",
|
|
44
|
+
"@effected/schema-org": "^0.11.0",
|
|
45
|
+
"effect": "^4.0.6"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=24.11.0"
|