@cms0/cms0 0.2.10 → 0.2.11
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/dist/cjs/custom-types/registry.cjs +21 -27
- package/dist/cjs/seo.cjs +7 -16
- package/dist/esm/custom-types/registry.js +21 -27
- package/dist/esm/seo.js +7 -16
- package/dist/types/custom-types/index.d.ts +1 -1
- package/dist/types/custom-types/index.d.ts.map +1 -1
- package/dist/types/custom-types/registry.d.ts.map +1 -1
- package/dist/types/seo.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -79,35 +79,29 @@ const keywordsDescriptor = createUnionDescriptor([
|
|
|
79
79
|
},
|
|
80
80
|
},
|
|
81
81
|
]);
|
|
82
|
-
const robotsDescriptor =
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
nocache: {
|
|
103
|
-
kind: "primitive",
|
|
104
|
-
type: "boolean",
|
|
105
|
-
optional: true,
|
|
106
|
-
nullable: false,
|
|
107
|
-
},
|
|
82
|
+
const robotsDescriptor = {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {
|
|
85
|
+
index: {
|
|
86
|
+
kind: "primitive",
|
|
87
|
+
type: "boolean",
|
|
88
|
+
optional: true,
|
|
89
|
+
nullable: false,
|
|
90
|
+
},
|
|
91
|
+
follow: {
|
|
92
|
+
kind: "primitive",
|
|
93
|
+
type: "boolean",
|
|
94
|
+
optional: true,
|
|
95
|
+
nullable: false,
|
|
96
|
+
},
|
|
97
|
+
nocache: {
|
|
98
|
+
kind: "primitive",
|
|
99
|
+
type: "boolean",
|
|
100
|
+
optional: true,
|
|
101
|
+
nullable: false,
|
|
108
102
|
},
|
|
109
103
|
},
|
|
110
|
-
|
|
104
|
+
};
|
|
111
105
|
const alternatesDescriptor = {
|
|
112
106
|
type: "object",
|
|
113
107
|
properties: {
|
package/dist/cjs/seo.cjs
CHANGED
|
@@ -109,19 +109,12 @@ function resolveImageUrl(image) {
|
|
|
109
109
|
return resolveTextValue(unwrapped.url);
|
|
110
110
|
}
|
|
111
111
|
function normalizeRobots(robots) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if (typeof robots.index === "boolean")
|
|
119
|
-
resolved.index = robots.index;
|
|
120
|
-
if (typeof robots.follow === "boolean")
|
|
121
|
-
resolved.follow = robots.follow;
|
|
122
|
-
if (typeof robots.nocache === "boolean")
|
|
123
|
-
resolved.nocache = robots.nocache;
|
|
124
|
-
return Object.keys(resolved).length ? resolved : undefined;
|
|
112
|
+
const source = isRecord(robots) ? robots : {};
|
|
113
|
+
return {
|
|
114
|
+
index: typeof source.index === "boolean" ? source.index : false,
|
|
115
|
+
follow: typeof source.follow === "boolean" ? source.follow : false,
|
|
116
|
+
nocache: typeof source.nocache === "boolean" ? source.nocache : false,
|
|
117
|
+
};
|
|
125
118
|
}
|
|
126
119
|
function hasAnyKeys(value) {
|
|
127
120
|
return Object.keys(value).length > 0;
|
|
@@ -236,9 +229,7 @@ function toNextMetadata(seo, options = {}) {
|
|
|
236
229
|
const keywords = resolveKeywords(seo.keywords, options);
|
|
237
230
|
if (keywords?.length)
|
|
238
231
|
metadata.keywords = keywords;
|
|
239
|
-
|
|
240
|
-
if (robots)
|
|
241
|
-
metadata.robots = robots;
|
|
232
|
+
metadata.robots = normalizeRobots(seo.robots);
|
|
242
233
|
const alternates = resolveAlternates(seo);
|
|
243
234
|
if (alternates)
|
|
244
235
|
metadata.alternates = alternates;
|
|
@@ -74,35 +74,29 @@ const keywordsDescriptor = createUnionDescriptor([
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
]);
|
|
77
|
-
const robotsDescriptor =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
nocache: {
|
|
98
|
-
kind: "primitive",
|
|
99
|
-
type: "boolean",
|
|
100
|
-
optional: true,
|
|
101
|
-
nullable: false,
|
|
102
|
-
},
|
|
77
|
+
const robotsDescriptor = {
|
|
78
|
+
type: "object",
|
|
79
|
+
properties: {
|
|
80
|
+
index: {
|
|
81
|
+
kind: "primitive",
|
|
82
|
+
type: "boolean",
|
|
83
|
+
optional: true,
|
|
84
|
+
nullable: false,
|
|
85
|
+
},
|
|
86
|
+
follow: {
|
|
87
|
+
kind: "primitive",
|
|
88
|
+
type: "boolean",
|
|
89
|
+
optional: true,
|
|
90
|
+
nullable: false,
|
|
91
|
+
},
|
|
92
|
+
nocache: {
|
|
93
|
+
kind: "primitive",
|
|
94
|
+
type: "boolean",
|
|
95
|
+
optional: true,
|
|
96
|
+
nullable: false,
|
|
103
97
|
},
|
|
104
98
|
},
|
|
105
|
-
|
|
99
|
+
};
|
|
106
100
|
const alternatesDescriptor = {
|
|
107
101
|
type: "object",
|
|
108
102
|
properties: {
|
package/dist/esm/seo.js
CHANGED
|
@@ -103,19 +103,12 @@ function resolveImageUrl(image) {
|
|
|
103
103
|
return resolveTextValue(unwrapped.url);
|
|
104
104
|
}
|
|
105
105
|
function normalizeRobots(robots) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (typeof robots.index === "boolean")
|
|
113
|
-
resolved.index = robots.index;
|
|
114
|
-
if (typeof robots.follow === "boolean")
|
|
115
|
-
resolved.follow = robots.follow;
|
|
116
|
-
if (typeof robots.nocache === "boolean")
|
|
117
|
-
resolved.nocache = robots.nocache;
|
|
118
|
-
return Object.keys(resolved).length ? resolved : undefined;
|
|
106
|
+
const source = isRecord(robots) ? robots : {};
|
|
107
|
+
return {
|
|
108
|
+
index: typeof source.index === "boolean" ? source.index : false,
|
|
109
|
+
follow: typeof source.follow === "boolean" ? source.follow : false,
|
|
110
|
+
nocache: typeof source.nocache === "boolean" ? source.nocache : false,
|
|
111
|
+
};
|
|
119
112
|
}
|
|
120
113
|
function hasAnyKeys(value) {
|
|
121
114
|
return Object.keys(value).length > 0;
|
|
@@ -230,9 +223,7 @@ export function toNextMetadata(seo, options = {}) {
|
|
|
230
223
|
const keywords = resolveKeywords(seo.keywords, options);
|
|
231
224
|
if (keywords?.length)
|
|
232
225
|
metadata.keywords = keywords;
|
|
233
|
-
|
|
234
|
-
if (robots)
|
|
235
|
-
metadata.robots = robots;
|
|
226
|
+
metadata.robots = normalizeRobots(seo.robots);
|
|
236
227
|
const alternates = resolveAlternates(seo);
|
|
237
228
|
if (alternates)
|
|
238
229
|
metadata.alternates = alternates;
|
|
@@ -28,7 +28,7 @@ export type Localized<T> = {
|
|
|
28
28
|
};
|
|
29
29
|
export type LocalizedString = Localized<string>;
|
|
30
30
|
export type LocalizedRichText = Localized<RichText>;
|
|
31
|
-
export type SeoRobots =
|
|
31
|
+
export type SeoRobots = {
|
|
32
32
|
index?: boolean;
|
|
33
33
|
follow?: boolean;
|
|
34
34
|
nocache?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/custom-types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,E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C;IACvC,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG;IACvB,IAAI,CAAC,EAAE,SAAS,GAAG,qBAAqB,GAAG,KAAK,GAAG,QAAQ,CAAC;IAC5D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,WAAW,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACvC,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,GAAG,GAAG;IAChB,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACjC,WAAW,CAAC,EAAE,eAAe,GAAG,MAAM,CAAC;IACvC,QAAQ,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CACpC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/custom-types/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/custom-types/registry.ts"],"names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