AbiirSkincare/Hydrogen/web/scripts/build-cms-seed-json.mjs

272 lines
12 KiB
JavaScript

/**
* Bundles Hydrogen mock CMS into `scripts/seed-data/cms-seed.json` for `sanity-seed-all.mjs`.
*
* From Hydrogen/web (Node 22+):
* node --experimental-strip-types ./scripts/build-cms-seed-json.mjs
*/
import {mkdirSync, writeFileSync} from 'node:fs';
import {dirname, join} from 'node:path';
import {fileURLToPath} from 'node:url';
import {
MOCK_CONTACT_CMS,
MOCK_FAQ_CMS,
MOCK_PRESS_CMS,
MOCK_SHIPPING_PAGE,
MOCK_SKINCARE_QUIZ_PAGE,
MOCK_TRACK_ORDER_PAGE,
} from '../app/lib/abiirStaticPages.ts';
import {
MOCK_PRIVACY_POLICY_PAGE,
MOCK_TERMS_OF_SERVICE_PAGE,
} from '../app/lib/abiirLegalPageMocks.ts';
import {MOCK_HOME_HERO_CMS} from '../app/lib/homeHero.ts';
import {MOCK_SPRING_GLOW_BANNER_CMS} from '../app/lib/springGlowBanner.ts';
import {MOCK_BRAND_VALUES_CMS} from '../app/lib/brandValues.ts';
import {MOCK_INGREDIENTS_SECTION_CMS} from '../app/lib/ingredients.ts';
import {MOCK_SKIN_RITUAL_SECTION_CMS} from '../app/lib/skinRitual.ts';
import {MOCK_TESTIMONIALS_SECTION_CMS} from '../app/lib/testimonials.ts';
import {MOCK_NEWSLETTER_SECTION_CMS} from '../app/lib/newsletter.ts';
const __dirname = dirname(fileURLToPath(import.meta.url));
const outDir = join(__dirname, 'seed-data');
const outPath = join(outDir, 'cms-seed.json');
const TRACK_MY_ORDER_HREF =
'https://www.ups.com/track?loc=en_US&requester=ST/';
/** Mirrors `MOCK_ABIIR_FOOTER_CMS` in `app/lib/footer.ts` (image paths under `assetPaths`). */
const footer = {
tagline:
'Skincare rooted in Ayurveda. Formulated with rare botanicals and modern science. Beauty without compromise.',
brandLinkPath: '/',
socialInstagramUrl: 'https://www.instagram.com/abiir_skincare/',
socialYoutubeUrl: 'https://www.youtube.com/',
socialXUrl: 'https://x.com/',
columnGroups: [
{
title: 'Shop',
links: [
{label: 'All Products', path: '/collections/all'},
{label: 'Ritual Sets', path: '/collections/ritual'},
{label: 'Bestsellers', path: '/collections/bestsellers'},
{label: 'New Arrivals', path: '/collections/new-arrivals'},
{label: 'Spring Glow Bundle', path: '/products/glow-with-love-bundle'},
],
},
{
title: 'Help',
links: [
{label: 'FAQ', path: '/faq'},
{label: 'Shipping & Returns', path: '/shipping'},
{label: 'Contact Us', path: '/contact'},
{label: 'Track My Order', path: TRACK_MY_ORDER_HREF},
{label: 'Skincare Quiz', path: '/skincare-quiz'},
],
},
{
title: 'Company',
links: [
{label: 'Our Story', path: '/about'},
{label: 'Press', path: '/press'},
],
},
],
copyrightLine: '© 2026 ABiiR Skincare. All rights reserved.',
legalLinks: [
{label: 'Privacy Policy', path: '/privacy'},
{label: 'Terms of Service', path: '/terms'},
],
};
/** Mirrors `MOCK_HEADER_CMS` in `app/components/Header.tsx` (logo optional in Studio). */
const header = {
announcementText:
'FREE SHIPPING ON ORDERS OVER $75 · USE CODE: ABiiR15 FOR 15% OFF',
announcementBackground: '#5D0B24',
announcementTextColor: '#FAF8F3',
navAccent: '#b39763',
utilityAccent: '#5d0b24',
navigationItems: [
{label: 'Collection', href: '/collections/all'},
{label: 'Rituals', href: '/collections/ritual'},
{label: 'Our Story', href: '/about'},
],
accountMenuItems: [
{label: 'My Profile', href: '/account/profile'},
{label: 'My Orders', href: '/account/orders'},
{label: 'Wishlist', href: '/wishlist'},
],
};
/** Logo + footer art paths relative to Hydrogen/web (optional files). */
const assetPaths = {
headerLogo: 'app/assets/abiir-logo.png',
hero: 'app/assets/hero-brand-set-new.png',
springBundle: 'app/assets/spring-glow-bundle_new.png',
springBundleFallback: 'app/assets/spring-glow-bundle.png',
lifestyleTiles: [
'app/assets/instagram/vertical.png',
'app/assets/instagram/vertical2.png',
'app/assets/instagram/vertical3.png',
],
footerEmblem: 'app/assets/footer/footer-emblem.png',
footerWordmark: 'app/assets/footer/footer-wordmark.png',
footerCertificationBadges: 'app/assets/footer/footer-certification-badges.png',
ingredientsHero: 'app/assets/ingredients-hero.png',
pressTile: 'app/assets/hero-brand-set-new.png',
};
/** Mirrors `MOCK_FEATURED_PRODUCTS_CMS` without importing `featuredProducts.ts` (PNG import). */
const featuredProducts = {
eyebrow: 'Curated Picks',
title: 'Most Loved',
filterPills: [
{label: 'BESTSELLERS', href: '/collections/bestsellers'},
{label: 'Face', href: '/collections/face'},
{label: 'Ritual', href: '/collections/ritual'},
],
viewAllLabel: 'View All Products',
viewAllHref: '/collections/all',
items: [
{productHandle: 'face-mask'},
{productHandle: 'face-scrub'},
{
productHandle: 'experience-kit',
hideBadge: true,
subtitle: 'Ayurvedic Ritual Starter Set',
benefitChips: ['Cleanses', 'Hydrates', 'Glows'],
rating: 4.9,
reviewCount: 289,
},
{
productHandle: 'glow-with-love-bundle',
cardTitle: 'Glow Bundle',
subtitle: 'Complete Ritual Collection',
benefitChips: ['Hydrates', 'Sculpts', 'Glows'],
rating: 5,
reviewCount: 167,
},
],
};
/** Text + tile layout from `MOCK_LIFESTYLE_GRID_SECTION_CMS` (images resolved via `assetPaths`). */
const lifestyleGridSection = {
eyebrow: 'Community',
headline: '@abiir_skincare',
instagramUrl: 'https://www.instagram.com/abiir_skincare/',
followLabel: 'Follow Us',
sectionBackground: '#F8F4EF',
footerPrefix: 'Tag us with ',
hashtag: '#AbiiirSkin',
footerSuffix: ' to be featured in our community',
hashtagColor: '#C17D5C',
tiles: [
{caption: '@abiir_skincare', tall: true},
{caption: '@abiir_skincare', tall: false},
{caption: '@abiir_skincare', tall: false},
],
};
/**
* Text-only about fields from `MOCK_ABIIR_ABOUT_CMS` in `app/lib/about.ts`
* (images are patched separately in `sanity-seed-all.mjs` when assets exist).
*/
const aboutPageText = {
seoTitle: 'Our Story | ABiiR',
seoDescription:
'Discover how ABiiR blends Ayurvedic wisdom with modern skincare — our philosophy, values, and the people behind the brand.',
heroEyebrow: 'Our Story',
heroHeadlineBefore: 'Skincare Built on ',
heroHeadlineItalic: 'Honesty',
beginningEyebrow: 'The Beginning',
beginningHeadlineBefore: 'Where Ancient Wisdom ',
beginningHeadlineItalic: 'Meets',
beginningHeadlineAfter: ' Modern Life',
storyParagraphs: [
'At ABiiR, we are dedicated to providing a curated selection of luxurious skincare products inspired by Ayurveda that are meticulously designed to nourish and rejuvenate the skin. Conceptualized in 2024 in San Jose by Bhairavi Desai, our mission is to embrace the timeless wisdom of Ayurveda while promoting holistic beauty through scientifically-backed formulations.',
'Our product line includes essentials such as the Hydrating Moisturizer and Hydra Cleansing Oil, which incorporates powerful natural ingredients like Gotu Kola and turmeric. These ingredients have been shown to enhance skin vitality, with studies indicating that turmeric can reduce inflammation by up to 38% and improve skin texture significantly. We prioritize the use of high-quality, sustainably sourced components, ensuring that our customers receive products that are not only effective but also environmentally responsible.',
'We understand that skincare is a personal journey, and our goal is to empower individuals to achieve a radiant complexion through informed choices. By integrating Ayurvedic principles with modern skincare science, we aim to create a harmonious balance that caters to diverse skin types and concerns. At ABiiR, we are committed to fostering a community that values the intersection of tradition and innovation in skincare.',
],
beginningQuote: '\u201cNature has always known what skin needs.\u201d',
beginningQuoteAttribution: '\u2014 Bhairavi Desai, Founder',
philosophyEyebrow: 'Our Philosophy',
philosophyHeadlineBefore: 'Skincare is not a routine. ',
philosophyHeadlineItalic: 'It is a ritual.',
philosophyBody:
'Ayurveda teaches that radiance is not achieved — it is restored. When we slow down, listen to our skin, and nourish it with the intelligence of plants, balance returns. That is the ABiiR promise: products designed not just to work, but to transform the moments in which you use them.',
valuesTitle: 'What We Stand For',
values: [
{
title: 'Nature-Led',
description:
'Every formula begins with plants — chosen for their proven efficacy and sourced from ethical, sustainable farms around the world.',
},
{
title: 'Ayurvedic Roots',
description:
'Our recipes are inspired by 5,000 years of Ayurvedic wisdom, married to the rigour of contemporary cosmetic science.',
},
{
title: 'Radical Honesty',
description:
'No hidden fillers. No greenwashing. Every ingredient is listed, explained, and purposeful.',
},
{
title: 'Skin Positivity',
description:
"Created for every skin tone, type, and concern. We believe radiant skin is not a privilege — it's a right.",
},
],
teamEyebrow: 'The People',
teamTitle: 'Meet the Team',
founderRole: 'Founder & CEO',
founderName: 'Bhairavi Desai',
founderBio: [
'The shelves were already crowded with synthetic formulas and 10-step routines that felt more like chores than care. Bhairavi wanted something different—a simple, effective swap that respected the environment as much as it respected the skin. To find it, she looked back to the rituals she grew up with.',
'ABiiR isn\'t about laboratory "miracles." It\'s about the thoughtful infusion of Ayurvedic staples—like Turmeric, Saffron, and Ashwagandha—into the products we use every day. We take the time-tested botanical truths of a 5,000-year-old tradition and blend them into modern, clean formulas.',
'In Sanskrit, ABiiR (अबीर) is more than just a word; it\'s a sensory memory. It refers to the fragrant, deeply colored powders—crafted from turmeric and dried petals—used in traditional rituals of worship. It represents a moment of pause and a gesture of respect. It\'s about ingredients chosen with intention and a faint, natural scent that reminds you to treat your skin as something sacred.',
],
founderQuote:
"I really love what I do! It makes me super happy to create something that not only makes your skin look great but also helps people stay and live better. It's such a rewarding feeling!",
};
const aboutImagePaths = {
heroImage: 'app/assets/about_banner.png',
beginningImage: 'app/assets/about_hero.png',
philosophyImage: 'app/assets/about/philosophy.jpg',
founderImage: 'app/assets/about/founder.png',
};
const bundle = {
legal: {
privacy: MOCK_PRIVACY_POLICY_PAGE,
terms: MOCK_TERMS_OF_SERVICE_PAGE,
},
static: {
faq: MOCK_FAQ_CMS,
shipping: MOCK_SHIPPING_PAGE,
track: MOCK_TRACK_ORDER_PAGE,
quiz: MOCK_SKINCARE_QUIZ_PAGE,
contact: MOCK_CONTACT_CMS,
press: MOCK_PRESS_CMS,
},
settings: {header, footer, assetPaths},
home: {
hero: MOCK_HOME_HERO_CMS,
springGlowBanner: MOCK_SPRING_GLOW_BANNER_CMS,
brandValues: MOCK_BRAND_VALUES_CMS,
featuredProducts,
ingredientsSection: MOCK_INGREDIENTS_SECTION_CMS,
skinRitualSection: MOCK_SKIN_RITUAL_SECTION_CMS,
testimonialsSection: MOCK_TESTIMONIALS_SECTION_CMS,
lifestyleGridSection,
newsletterSection: MOCK_NEWSLETTER_SECTION_CMS,
},
aboutPage: {text: aboutPageText, imagePaths: aboutImagePaths},
};
mkdirSync(outDir, {recursive: true});
writeFileSync(outPath, `${JSON.stringify(bundle, null, 2)}\n`, 'utf8');
console.log(`Wrote ${outPath}`);