@yysng/astro-boilerplate 1.1.7 → 1.1.8

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": "@yysng/astro-boilerplate",
3
- "version": "1.1.7",
3
+ "version": "1.1.8",
4
4
  "description": "Astro + Sanity Boilerplate with AEO Layers 1–5",
5
5
  "type": "module",
6
6
  "exports": {
@@ -1,6 +1,7 @@
1
1
  export const schemas = {
2
2
  hero: {
3
3
  required: ["title", "subtitle"],
4
+ // CTA remains optional by validation logic
4
5
  validate(data) {
5
6
  if (typeof data.title !== "string") {
6
7
  throw new Error("Hero.title must be a string");
@@ -24,5 +25,30 @@ export const schemas = {
24
25
  }
25
26
  }
26
27
  }
28
+ },
29
+
30
+ cta: {
31
+ required: ["heading", "button"],
32
+ validate(data) {
33
+ if (typeof data.heading !== "string") {
34
+ throw new Error("CTA.heading must be a string");
35
+ }
36
+
37
+ if (data.description && typeof data.description !== "string") {
38
+ throw new Error("CTA.description must be a string");
39
+ }
40
+
41
+ if (!data.button || typeof data.button !== "object") {
42
+ throw new Error("CTA.button must be an object");
43
+ }
44
+
45
+ if (typeof data.button.label !== "string") {
46
+ throw new Error("CTA.button.label must be a string");
47
+ }
48
+
49
+ if (typeof data.button.href !== "string") {
50
+ throw new Error("CTA.button.href must be a string");
51
+ }
27
52
  }
53
+ },
28
54
  };