11import { defineContentConfig , defineCollection , z } from '@nuxt/content'
22
3- const pricingPlan = z . object ( {
3+ const createPricingPlanSchema = ( ) => z . object ( {
44 title : z . string ( ) ,
55 description : z . string ( ) ,
66 price : z . string ( ) ,
@@ -16,7 +16,7 @@ const pricingPlan = z.object({
1616 } ) ,
1717} )
1818
19- const pricingFeature = z . object ( {
19+ const createPricingFeatureSchema = ( ) => z . object ( {
2020 title : z . string ( ) ,
2121 plans : z . array ( z . enum ( [ 'solo' , 'team' , 'unlimited' ] ) ) . optional ( ) ,
2222 value : z . array ( z . string ( ) ) . optional ( ) ,
@@ -67,65 +67,65 @@ export default defineContentConfig({
6767 } ) ,
6868 } ) ,
6969 plans : z . object ( {
70- solo : pricingPlan ,
71- team : pricingPlan ,
72- unlimited : pricingPlan ,
70+ solo : createPricingPlanSchema ( ) ,
71+ team : createPricingPlanSchema ( ) ,
72+ unlimited : createPricingPlanSchema ( ) ,
7373 } ) ,
7474 features : z . object ( {
7575 title : z . string ( ) ,
7676 description : z . string ( ) ,
7777 includes : z . object ( {
78- projects : pricingFeature ,
79- members : pricingFeature ,
80- media : pricingFeature ,
81- support : pricingFeature ,
82- dedicated : pricingFeature ,
83- roles : pricingFeature ,
84- collaboration : pricingFeature ,
78+ projects : createPricingFeatureSchema ( ) ,
79+ members : createPricingFeatureSchema ( ) ,
80+ media : createPricingFeatureSchema ( ) ,
81+ support : createPricingFeatureSchema ( ) ,
82+ dedicated : createPricingFeatureSchema ( ) ,
83+ roles : createPricingFeatureSchema ( ) ,
84+ collaboration : createPricingFeatureSchema ( ) ,
8585 sync : z . object ( {
8686 title : z . string ( ) ,
8787 includes : z . object ( {
88- repositories : pricingFeature ,
89- workflow : pricingFeature ,
88+ repositories : createPricingFeatureSchema ( ) ,
89+ workflow : createPricingFeatureSchema ( ) ,
9090 } ) ,
9191 } ) ,
9292 project : z . object ( {
9393 title : z . string ( ) ,
9494 includes : z . object ( {
95- clone : pricingFeature ,
96- import : pricingFeature ,
95+ clone : createPricingFeatureSchema ( ) ,
96+ import : createPricingFeatureSchema ( ) ,
9797 } ) ,
9898 } ) ,
9999 editors : z . object ( {
100100 title : z . string ( ) ,
101101 includes : z . object ( {
102- markdown : pricingFeature ,
103- json : pricingFeature ,
104- appconfig : pricingFeature ,
105- drag : pricingFeature ,
102+ markdown : createPricingFeatureSchema ( ) ,
103+ json : createPricingFeatureSchema ( ) ,
104+ appconfig : createPricingFeatureSchema ( ) ,
105+ drag : createPricingFeatureSchema ( ) ,
106106 } ) ,
107107 } ) ,
108108 preview : z . object ( {
109109 title : z . string ( ) ,
110110 includes : z . object ( {
111- draft : pricingFeature ,
112- branches : pricingFeature ,
113- prs : pricingFeature ,
111+ draft : createPricingFeatureSchema ( ) ,
112+ branches : createPricingFeatureSchema ( ) ,
113+ prs : createPricingFeatureSchema ( ) ,
114114 } ) ,
115115 } ) ,
116116 deploy : z . object ( {
117117 title : z . string ( ) ,
118118 includes : z . object ( {
119- gh : pricingFeature ,
120- self : pricingFeature ,
119+ gh : createPricingFeatureSchema ( ) ,
120+ self : createPricingFeatureSchema ( ) ,
121121 } ) ,
122122 } ) ,
123123 publish : z . object ( {
124124 title : z . string ( ) ,
125125 includes : z . object ( {
126- preview : pricingFeature ,
127- branch : pricingFeature ,
128- commit : pricingFeature ,
126+ preview : createPricingFeatureSchema ( ) ,
127+ branch : createPricingFeatureSchema ( ) ,
128+ commit : createPricingFeatureSchema ( ) ,
129129 } ) ,
130130 } ) ,
131131 } ) ,
0 commit comments