@wildo-ai/saas-website 1.1.1
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/LICENSE +34 -0
- package/dist/esm/.builder.pid +9 -0
- package/dist/esm/astro/blog-post-bridge.d.ts +324 -0
- package/dist/esm/astro/blog-post-bridge.d.ts.map +1 -0
- package/dist/esm/astro/blog-post-bridge.js +57 -0
- package/dist/esm/astro/blog-post-bridge.js.map +1 -0
- package/dist/esm/astro/blog-post-head.renderer.d.ts +129 -0
- package/dist/esm/astro/blog-post-head.renderer.d.ts.map +1 -0
- package/dist/esm/astro/blog-post-head.renderer.js +139 -0
- package/dist/esm/astro/blog-post-head.renderer.js.map +1 -0
- package/dist/esm/astro/bridge-runtime.d.ts +224 -0
- package/dist/esm/astro/bridge-runtime.d.ts.map +1 -0
- package/dist/esm/astro/bridge-runtime.js +30 -0
- package/dist/esm/astro/bridge-runtime.js.map +1 -0
- package/dist/esm/astro/collect-expected-label-keys.d.ts +65 -0
- package/dist/esm/astro/collect-expected-label-keys.d.ts.map +1 -0
- package/dist/esm/astro/collect-expected-label-keys.js +101 -0
- package/dist/esm/astro/collect-expected-label-keys.js.map +1 -0
- package/dist/esm/astro/headers-renderer.d.ts +32 -0
- package/dist/esm/astro/headers-renderer.d.ts.map +1 -0
- package/dist/esm/astro/headers-renderer.js +64 -0
- package/dist/esm/astro/headers-renderer.js.map +1 -0
- package/dist/esm/astro/i18n-routing.helper.d.ts +91 -0
- package/dist/esm/astro/i18n-routing.helper.d.ts.map +1 -0
- package/dist/esm/astro/i18n-routing.helper.js +23 -0
- package/dist/esm/astro/i18n-routing.helper.js.map +1 -0
- package/dist/esm/astro/internal/html-escape.d.ts +31 -0
- package/dist/esm/astro/internal/html-escape.d.ts.map +1 -0
- package/dist/esm/astro/internal/html-escape.js +40 -0
- package/dist/esm/astro/internal/html-escape.js.map +1 -0
- package/dist/esm/astro/label-pack-loader.d.ts +134 -0
- package/dist/esm/astro/label-pack-loader.d.ts.map +1 -0
- package/dist/esm/astro/label-pack-loader.js +298 -0
- package/dist/esm/astro/label-pack-loader.js.map +1 -0
- package/dist/esm/astro/llms-txt-server.d.ts +28 -0
- package/dist/esm/astro/llms-txt-server.d.ts.map +1 -0
- package/dist/esm/astro/llms-txt-server.js +33 -0
- package/dist/esm/astro/llms-txt-server.js.map +1 -0
- package/dist/esm/astro/pick-labels-for-page.d.ts +63 -0
- package/dist/esm/astro/pick-labels-for-page.d.ts.map +1 -0
- package/dist/esm/astro/pick-labels-for-page.js +73 -0
- package/dist/esm/astro/pick-labels-for-page.js.map +1 -0
- package/dist/esm/astro/robots-renderer.d.ts +85 -0
- package/dist/esm/astro/robots-renderer.d.ts.map +1 -0
- package/dist/esm/astro/robots-renderer.js +157 -0
- package/dist/esm/astro/robots-renderer.js.map +1 -0
- package/dist/esm/astro/sitemap-coverage.d.ts +101 -0
- package/dist/esm/astro/sitemap-coverage.d.ts.map +1 -0
- package/dist/esm/astro/sitemap-coverage.js +67 -0
- package/dist/esm/astro/sitemap-coverage.js.map +1 -0
- package/dist/esm/astro/structured-data.renderer.d.ts +21 -0
- package/dist/esm/astro/structured-data.renderer.d.ts.map +1 -0
- package/dist/esm/astro/structured-data.renderer.js +142 -0
- package/dist/esm/astro/structured-data.renderer.js.map +1 -0
- package/dist/esm/astro/website-page-head.renderer.d.ts +93 -0
- package/dist/esm/astro/website-page-head.renderer.d.ts.map +1 -0
- package/dist/esm/astro/website-page-head.renderer.js +184 -0
- package/dist/esm/astro/website-page-head.renderer.js.map +1 -0
- package/dist/esm/astro/website-page-runtime.helper.d.ts +112 -0
- package/dist/esm/astro/website-page-runtime.helper.d.ts.map +1 -0
- package/dist/esm/astro/website-page-runtime.helper.js +60 -0
- package/dist/esm/astro/website-page-runtime.helper.js.map +1 -0
- package/dist/esm/astro/website-site-context.d.ts +126 -0
- package/dist/esm/astro/website-site-context.d.ts.map +1 -0
- package/dist/esm/astro/website-site-context.js +37 -0
- package/dist/esm/astro/website-site-context.js.map +1 -0
- package/dist/esm/astro-island.d.ts +56 -0
- package/dist/esm/astro-island.d.ts.map +1 -0
- package/dist/esm/astro-island.js +61 -0
- package/dist/esm/astro-island.js.map +1 -0
- package/dist/esm/astro.d.ts +151 -0
- package/dist/esm/astro.d.ts.map +1 -0
- package/dist/esm/astro.js +151 -0
- package/dist/esm/astro.js.map +1 -0
- package/dist/esm/companion-exports.d.ts +38 -0
- package/dist/esm/companion-exports.d.ts.map +1 -0
- package/dist/esm/companion-exports.js +38 -0
- package/dist/esm/companion-exports.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteButton.d.ts +73 -0
- package/dist/esm/components/low-level/WebsiteButton.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteButton.js +68 -0
- package/dist/esm/components/low-level/WebsiteButton.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteHeading.d.ts +78 -0
- package/dist/esm/components/low-level/WebsiteHeading.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteHeading.js +41 -0
- package/dist/esm/components/low-level/WebsiteHeading.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteImage.d.ts +73 -0
- package/dist/esm/components/low-level/WebsiteImage.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteImage.js +21 -0
- package/dist/esm/components/low-level/WebsiteImage.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteInternalButton.d.ts +90 -0
- package/dist/esm/components/low-level/WebsiteInternalButton.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteInternalButton.js +47 -0
- package/dist/esm/components/low-level/WebsiteInternalButton.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteInternalLink.d.ts +99 -0
- package/dist/esm/components/low-level/WebsiteInternalLink.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteInternalLink.js +68 -0
- package/dist/esm/components/low-level/WebsiteInternalLink.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteLink.d.ts +50 -0
- package/dist/esm/components/low-level/WebsiteLink.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteLink.js +22 -0
- package/dist/esm/components/low-level/WebsiteLink.js.map +1 -0
- package/dist/esm/components/low-level/WebsiteText.d.ts +57 -0
- package/dist/esm/components/low-level/WebsiteText.d.ts.map +1 -0
- package/dist/esm/components/low-level/WebsiteText.js +57 -0
- package/dist/esm/components/low-level/WebsiteText.js.map +1 -0
- package/dist/esm/config/define-website-config.d.ts +83 -0
- package/dist/esm/config/define-website-config.d.ts.map +1 -0
- package/dist/esm/config/define-website-config.js +126 -0
- package/dist/esm/config/define-website-config.js.map +1 -0
- package/dist/esm/config/index.d.ts +38 -0
- package/dist/esm/config/index.d.ts.map +1 -0
- package/dist/esm/config/index.js +38 -0
- package/dist/esm/config/index.js.map +1 -0
- package/dist/esm/config/load-website-config.d.ts +136 -0
- package/dist/esm/config/load-website-config.d.ts.map +1 -0
- package/dist/esm/config/load-website-config.js +177 -0
- package/dist/esm/config/load-website-config.js.map +1 -0
- package/dist/esm/config/wildo-website-config.schemas.d.ts +251 -0
- package/dist/esm/config/wildo-website-config.schemas.d.ts.map +1 -0
- package/dist/esm/config/wildo-website-config.schemas.js +302 -0
- package/dist/esm/config/wildo-website-config.schemas.js.map +1 -0
- package/dist/esm/config-loader.d.ts +35 -0
- package/dist/esm/config-loader.d.ts.map +1 -0
- package/dist/esm/config-loader.js +35 -0
- package/dist/esm/config-loader.js.map +1 -0
- package/dist/esm/core/anonymous-session/InboundContactForm.d.ts +38 -0
- package/dist/esm/core/anonymous-session/InboundContactForm.d.ts.map +1 -0
- package/dist/esm/core/anonymous-session/InboundContactForm.js +77 -0
- package/dist/esm/core/anonymous-session/InboundContactForm.js.map +1 -0
- package/dist/esm/core/anonymous-session/inbound-contact-form.schema.d.ts +41 -0
- package/dist/esm/core/anonymous-session/inbound-contact-form.schema.d.ts.map +1 -0
- package/dist/esm/core/anonymous-session/inbound-contact-form.schema.js +58 -0
- package/dist/esm/core/anonymous-session/inbound-contact-form.schema.js.map +1 -0
- package/dist/esm/core/anonymous-session/website-anonymous-session-client.d.ts +81 -0
- package/dist/esm/core/anonymous-session/website-anonymous-session-client.d.ts.map +1 -0
- package/dist/esm/core/anonymous-session/website-anonymous-session-client.js +177 -0
- package/dist/esm/core/anonymous-session/website-anonymous-session-client.js.map +1 -0
- package/dist/esm/core/contexts/WebsitePageContext.d.ts +40 -0
- package/dist/esm/core/contexts/WebsitePageContext.d.ts.map +1 -0
- package/dist/esm/core/contexts/WebsitePageContext.js +8 -0
- package/dist/esm/core/contexts/WebsitePageContext.js.map +1 -0
- package/dist/esm/core/contexts/WebsiteRuntimeContext.d.ts +162 -0
- package/dist/esm/core/contexts/WebsiteRuntimeContext.d.ts.map +1 -0
- package/dist/esm/core/contexts/WebsiteRuntimeContext.js +22 -0
- package/dist/esm/core/contexts/WebsiteRuntimeContext.js.map +1 -0
- package/dist/esm/core/contexts/WebsiteSectionContext.d.ts +47 -0
- package/dist/esm/core/contexts/WebsiteSectionContext.d.ts.map +1 -0
- package/dist/esm/core/contexts/WebsiteSectionContext.js +8 -0
- package/dist/esm/core/contexts/WebsiteSectionContext.js.map +1 -0
- package/dist/esm/core/contexts/useWebsitePage.d.ts +13 -0
- package/dist/esm/core/contexts/useWebsitePage.d.ts.map +1 -0
- package/dist/esm/core/contexts/useWebsitePage.js +22 -0
- package/dist/esm/core/contexts/useWebsitePage.js.map +1 -0
- package/dist/esm/core/contexts/useWebsiteRuntime.d.ts +19 -0
- package/dist/esm/core/contexts/useWebsiteRuntime.d.ts.map +1 -0
- package/dist/esm/core/contexts/useWebsiteRuntime.js +28 -0
- package/dist/esm/core/contexts/useWebsiteRuntime.js.map +1 -0
- package/dist/esm/core/contexts/useWebsiteSection.d.ts +12 -0
- package/dist/esm/core/contexts/useWebsiteSection.d.ts.map +1 -0
- package/dist/esm/core/contexts/useWebsiteSection.js +22 -0
- package/dist/esm/core/contexts/useWebsiteSection.js.map +1 -0
- package/dist/esm/core/external-providers/frontend-provider-registry.website.d.ts +17 -0
- package/dist/esm/core/external-providers/frontend-provider-registry.website.d.ts.map +1 -0
- package/dist/esm/core/external-providers/frontend-provider-registry.website.js +23 -0
- package/dist/esm/core/external-providers/frontend-provider-registry.website.js.map +1 -0
- package/dist/esm/core/factories/define-website-page-manifest.d.ts +70 -0
- package/dist/esm/core/factories/define-website-page-manifest.d.ts.map +1 -0
- package/dist/esm/core/factories/define-website-page-manifest.js +51 -0
- package/dist/esm/core/factories/define-website-page-manifest.js.map +1 -0
- package/dist/esm/core/factories/define-website-section.d.ts +101 -0
- package/dist/esm/core/factories/define-website-section.d.ts.map +1 -0
- package/dist/esm/core/factories/define-website-section.js +71 -0
- package/dist/esm/core/factories/define-website-section.js.map +1 -0
- package/dist/esm/core/hooks/useWebsiteDesignTokens.d.ts +23 -0
- package/dist/esm/core/hooks/useWebsiteDesignTokens.d.ts.map +1 -0
- package/dist/esm/core/hooks/useWebsiteDesignTokens.js +25 -0
- package/dist/esm/core/hooks/useWebsiteDesignTokens.js.map +1 -0
- package/dist/esm/core/hooks/useWebsiteLabel.d.ts +68 -0
- package/dist/esm/core/hooks/useWebsiteLabel.d.ts.map +1 -0
- package/dist/esm/core/hooks/useWebsiteLabel.js +103 -0
- package/dist/esm/core/hooks/useWebsiteLabel.js.map +1 -0
- package/dist/esm/core/layouts/WebsitePageLayout.d.ts +87 -0
- package/dist/esm/core/layouts/WebsitePageLayout.d.ts.map +1 -0
- package/dist/esm/core/layouts/WebsitePageLayout.js +170 -0
- package/dist/esm/core/layouts/WebsitePageLayout.js.map +1 -0
- package/dist/esm/core/layouts/WebsiteSection.d.ts +91 -0
- package/dist/esm/core/layouts/WebsiteSection.d.ts.map +1 -0
- package/dist/esm/core/layouts/WebsiteSection.js +26 -0
- package/dist/esm/core/layouts/WebsiteSection.js.map +1 -0
- package/dist/esm/core/routing/internal-routing.utils.d.ts +65 -0
- package/dist/esm/core/routing/internal-routing.utils.d.ts.map +1 -0
- package/dist/esm/core/routing/internal-routing.utils.js +14 -0
- package/dist/esm/core/routing/internal-routing.utils.js.map +1 -0
- package/dist/esm/index.d.ts +129 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +129 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/mdx/BlogPost.d.ts +193 -0
- package/dist/esm/mdx/BlogPost.d.ts.map +1 -0
- package/dist/esm/mdx/BlogPost.js +161 -0
- package/dist/esm/mdx/BlogPost.js.map +1 -0
- package/dist/esm/mdx/blog-post-collection.config.d.ts +139 -0
- package/dist/esm/mdx/blog-post-collection.config.d.ts.map +1 -0
- package/dist/esm/mdx/blog-post-collection.config.js +27 -0
- package/dist/esm/mdx/blog-post-collection.config.js.map +1 -0
- package/dist/esm/mdx/blog-post-frontmatter-source.d.ts +12 -0
- package/dist/esm/mdx/blog-post-frontmatter-source.d.ts.map +1 -0
- package/dist/esm/mdx/blog-post-frontmatter-source.js +13 -0
- package/dist/esm/mdx/blog-post-frontmatter-source.js.map +1 -0
- package/dist/esm/mdx/index.d.ts +22 -0
- package/dist/esm/mdx/index.d.ts.map +1 -0
- package/dist/esm/mdx/index.js +22 -0
- package/dist/esm/mdx/index.js.map +1 -0
- package/dist/esm/mdx/website-mdx-provider.d.ts +90 -0
- package/dist/esm/mdx/website-mdx-provider.d.ts.map +1 -0
- package/dist/esm/mdx/website-mdx-provider.js +8 -0
- package/dist/esm/mdx/website-mdx-provider.js.map +1 -0
- package/dist/esm/mdx.d.ts +38 -0
- package/dist/esm/mdx.d.ts.map +1 -0
- package/dist/esm/mdx.js +38 -0
- package/dist/esm/mdx.js.map +1 -0
- package/dist/esm/schemas/blog/blog-post-frontmatter.shared.schemas.d.ts +75 -0
- package/dist/esm/schemas/blog/blog-post-frontmatter.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/blog/blog-post-frontmatter.shared.schemas.js +85 -0
- package/dist/esm/schemas/blog/blog-post-frontmatter.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/design-tokens/website-design-tokens.shared.schemas.d.ts +120 -0
- package/dist/esm/schemas/design-tokens/website-design-tokens.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/design-tokens/website-design-tokens.shared.schemas.js +152 -0
- package/dist/esm/schemas/design-tokens/website-design-tokens.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/label-keys/website-label-key.schemas.d.ts +73 -0
- package/dist/esm/schemas/label-keys/website-label-key.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/label-keys/website-label-key.schemas.js +76 -0
- package/dist/esm/schemas/label-keys/website-label-key.schemas.js.map +1 -0
- package/dist/esm/schemas/manifests/website-page-manifest.shared.schemas.d.ts +209 -0
- package/dist/esm/schemas/manifests/website-page-manifest.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/manifests/website-page-manifest.shared.schemas.js +218 -0
- package/dist/esm/schemas/manifests/website-page-manifest.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/manifests/website-root-config.shared.schemas.d.ts +431 -0
- package/dist/esm/schemas/manifests/website-root-config.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/manifests/website-root-config.shared.schemas.js +438 -0
- package/dist/esm/schemas/manifests/website-root-config.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/refs/page-ref.schemas.d.ts +40 -0
- package/dist/esm/schemas/refs/page-ref.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/refs/page-ref.schemas.js +43 -0
- package/dist/esm/schemas/refs/page-ref.schemas.js.map +1 -0
- package/dist/esm/schemas/refs/section-ref.schemas.d.ts +41 -0
- package/dist/esm/schemas/refs/section-ref.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/refs/section-ref.schemas.js +44 -0
- package/dist/esm/schemas/refs/section-ref.schemas.js.map +1 -0
- package/dist/esm/schemas/sections/website-section-category.shared.d.ts +63 -0
- package/dist/esm/schemas/sections/website-section-category.shared.d.ts.map +1 -0
- package/dist/esm/schemas/sections/website-section-category.shared.js +64 -0
- package/dist/esm/schemas/sections/website-section-category.shared.js.map +1 -0
- package/dist/esm/schemas/sections/website-section-definition.shared.schemas.d.ts +114 -0
- package/dist/esm/schemas/sections/website-section-definition.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/sections/website-section-definition.shared.schemas.js +69 -0
- package/dist/esm/schemas/sections/website-section-definition.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/structured-data/structured-data-reconciliation.shared.d.ts +100 -0
- package/dist/esm/schemas/structured-data/structured-data-reconciliation.shared.d.ts.map +1 -0
- package/dist/esm/schemas/structured-data/structured-data-reconciliation.shared.js +355 -0
- package/dist/esm/schemas/structured-data/structured-data-reconciliation.shared.js.map +1 -0
- package/dist/esm/schemas/structured-data/website-structured-data.shared.schemas.d.ts +58 -0
- package/dist/esm/schemas/structured-data/website-structured-data.shared.schemas.d.ts.map +1 -0
- package/dist/esm/schemas/structured-data/website-structured-data.shared.schemas.js +2 -0
- package/dist/esm/schemas/structured-data/website-structured-data.shared.schemas.js.map +1 -0
- package/dist/esm/schemas/validators/label-pack.validator.d.ts +144 -0
- package/dist/esm/schemas/validators/label-pack.validator.d.ts.map +1 -0
- package/dist/esm/schemas/validators/label-pack.validator.js +100 -0
- package/dist/esm/schemas/validators/label-pack.validator.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +143 -0
- package/src/__tests__/bundle-isolation.test.ts +607 -0
- package/src/astro/__tests__/blog-post-bridge.test.tsx +288 -0
- package/src/astro/__tests__/blog-post-head.renderer.test.ts +249 -0
- package/src/astro/__tests__/bridge-runtime.test.tsx +198 -0
- package/src/astro/__tests__/collect-expected-label-keys.test.ts +69 -0
- package/src/astro/__tests__/headers-renderer.test.ts +143 -0
- package/src/astro/__tests__/i18n-routing.helper.test.ts +116 -0
- package/src/astro/__tests__/label-pack-loader.test.ts +305 -0
- package/src/astro/__tests__/llms-txt-server.test.ts +127 -0
- package/src/astro/__tests__/pick-labels-for-page.test.ts +60 -0
- package/src/astro/__tests__/robots-renderer.test.ts +228 -0
- package/src/astro/__tests__/sitemap-coverage.test.ts +230 -0
- package/src/astro/__tests__/structured-data.renderer.test.ts +172 -0
- package/src/astro/__tests__/website-page-head.renderer.test.ts +424 -0
- package/src/astro/__tests__/website-page-runtime.helper.test.ts +157 -0
- package/src/astro/__tests__/website-site-context.test.ts +121 -0
- package/src/astro/blog-post-bridge.tsx +404 -0
- package/src/astro/blog-post-head.renderer.ts +293 -0
- package/src/astro/bridge-runtime.tsx +270 -0
- package/src/astro/collect-expected-label-keys.ts +113 -0
- package/src/astro/headers-renderer.ts +82 -0
- package/src/astro/i18n-routing.helper.ts +116 -0
- package/src/astro/internal/html-escape.ts +41 -0
- package/src/astro/label-pack-loader.ts +385 -0
- package/src/astro/llms-txt-server.ts +56 -0
- package/src/astro/pick-labels-for-page.ts +85 -0
- package/src/astro/robots-renderer.ts +171 -0
- package/src/astro/sitemap-coverage.ts +186 -0
- package/src/astro/structured-data.renderer.ts +171 -0
- package/src/astro/website-page-head.renderer.ts +279 -0
- package/src/astro/website-page-runtime.helper.ts +188 -0
- package/src/astro/website-site-context.ts +136 -0
- package/src/astro-island.ts +61 -0
- package/src/astro.ts +151 -0
- package/src/companion-exports.ts +38 -0
- package/src/components/low-level/WebsiteButton.tsx +118 -0
- package/src/components/low-level/WebsiteHeading.tsx +96 -0
- package/src/components/low-level/WebsiteImage.tsx +96 -0
- package/src/components/low-level/WebsiteInternalButton.tsx +172 -0
- package/src/components/low-level/WebsiteInternalLink.tsx +193 -0
- package/src/components/low-level/WebsiteLink.tsx +71 -0
- package/src/components/low-level/WebsiteText.tsx +75 -0
- package/src/components/low-level/__tests__/WebsiteInternalButton.test.tsx +169 -0
- package/src/components/low-level/__tests__/WebsiteInternalLink.test.tsx +202 -0
- package/src/components/low-level/__tests__/primitives.test.tsx +141 -0
- package/src/config/__tests__/define-website-config.test.ts +231 -0
- package/src/config/__tests__/load-website-config.test.ts +215 -0
- package/src/config/define-website-config.ts +134 -0
- package/src/config/index.ts +38 -0
- package/src/config/load-website-config.ts +229 -0
- package/src/config/wildo-website-config.schemas.ts +322 -0
- package/src/config-loader.ts +35 -0
- package/src/core/__tests__/WebsitePageLayout.test.tsx +184 -0
- package/src/core/__tests__/WebsiteSection.test.tsx +85 -0
- package/src/core/__tests__/contexts.test.tsx +133 -0
- package/src/core/__tests__/core-boundary.test.ts +85 -0
- package/src/core/__tests__/define-website-page-manifest.test.tsx +111 -0
- package/src/core/__tests__/define-website-section.test.tsx +89 -0
- package/src/core/__tests__/useWebsiteDesignTokens.test.tsx +41 -0
- package/src/core/__tests__/useWebsiteLabel.test.tsx +117 -0
- package/src/core/anonymous-session/InboundContactForm.tsx +157 -0
- package/src/core/anonymous-session/__tests__/inbound-contact-form.schema.test.ts +44 -0
- package/src/core/anonymous-session/inbound-contact-form.schema.ts +62 -0
- package/src/core/anonymous-session/website-anonymous-session-client.ts +194 -0
- package/src/core/contexts/WebsitePageContext.tsx +52 -0
- package/src/core/contexts/WebsiteRuntimeContext.tsx +175 -0
- package/src/core/contexts/WebsiteSectionContext.tsx +59 -0
- package/src/core/contexts/useWebsitePage.ts +28 -0
- package/src/core/contexts/useWebsiteRuntime.ts +34 -0
- package/src/core/contexts/useWebsiteSection.ts +28 -0
- package/src/core/external-providers/frontend-provider-registry.website.ts +62 -0
- package/src/core/factories/define-website-page-manifest.ts +102 -0
- package/src/core/factories/define-website-section.ts +128 -0
- package/src/core/hooks/useWebsiteDesignTokens.ts +26 -0
- package/src/core/hooks/useWebsiteLabel.ts +121 -0
- package/src/core/layouts/WebsitePageLayout.tsx +311 -0
- package/src/core/layouts/WebsiteSection.tsx +139 -0
- package/src/core/routing/__tests__/internal-routing.utils.test.ts +134 -0
- package/src/core/routing/internal-routing.utils.ts +77 -0
- package/src/index.ts +132 -0
- package/src/mdx/BlogPost.tsx +296 -0
- package/src/mdx/__tests__/BlogPost.test.tsx +218 -0
- package/src/mdx/__tests__/blog-post-collection.config.test.ts +127 -0
- package/src/mdx/__tests__/website-mdx-provider.test.tsx +82 -0
- package/src/mdx/blog-post-collection.config.ts +177 -0
- package/src/mdx/blog-post-frontmatter-source.ts +31 -0
- package/src/mdx/index.ts +39 -0
- package/src/mdx/website-mdx-provider.tsx +95 -0
- package/src/mdx.ts +38 -0
- package/src/schemas/__tests__/blog-frontmatter.test.ts +50 -0
- package/src/schemas/__tests__/companion-exports-react-free.test.ts +51 -0
- package/src/schemas/__tests__/design-tokens.test.ts +163 -0
- package/src/schemas/__tests__/label-key.test.ts +46 -0
- package/src/schemas/__tests__/label-pack-validator.test.ts +146 -0
- package/src/schemas/__tests__/page-manifest.test.ts +66 -0
- package/src/schemas/__tests__/refs.test.ts +37 -0
- package/src/schemas/__tests__/root-config.test.ts +292 -0
- package/src/schemas/__tests__/section-definition.test.ts +47 -0
- package/src/schemas/__tests__/structured-data-reconciliation.test.ts +543 -0
- package/src/schemas/blog/blog-post-frontmatter.shared.schemas.ts +111 -0
- package/src/schemas/design-tokens/website-design-tokens.shared.schemas.ts +166 -0
- package/src/schemas/label-keys/website-label-key.schemas.ts +88 -0
- package/src/schemas/manifests/website-page-manifest.shared.schemas.ts +266 -0
- package/src/schemas/manifests/website-root-config.shared.schemas.ts +504 -0
- package/src/schemas/refs/page-ref.schemas.ts +49 -0
- package/src/schemas/refs/section-ref.schemas.ts +50 -0
- package/src/schemas/sections/website-section-category.shared.ts +65 -0
- package/src/schemas/sections/website-section-definition.shared.schemas.ts +120 -0
- package/src/schemas/structured-data/structured-data-reconciliation.shared.ts +579 -0
- package/src/schemas/structured-data/website-structured-data.shared.schemas.ts +62 -0
- package/src/schemas/validators/label-pack.validator.ts +201 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { WebsitePageRefSchema } from '../refs/page-ref.schemas';
|
|
4
|
+
import { WebsiteSectionRefSchema } from '../refs/section-ref.schemas';
|
|
5
|
+
|
|
6
|
+
describe('WebsitePageRefSchema', () => {
|
|
7
|
+
it('accepts kebab-case starting with a letter', () => {
|
|
8
|
+
expect(WebsitePageRefSchema.parse('landing')).toBe('landing');
|
|
9
|
+
expect(WebsitePageRefSchema.parse('pricing-tiers')).toBe('pricing-tiers');
|
|
10
|
+
expect(WebsitePageRefSchema.parse('contact-us-now-2')).toBe('contact-us-now-2');
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
it('rejects strings starting with a digit, hyphen, or upper-case letter', () => {
|
|
14
|
+
expect(() => WebsitePageRefSchema.parse('1landing')).toThrow();
|
|
15
|
+
expect(() => WebsitePageRefSchema.parse('-landing')).toThrow();
|
|
16
|
+
expect(() => WebsitePageRefSchema.parse('Landing')).toThrow();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('rejects empty strings, snake_case, and over-long values', () => {
|
|
20
|
+
expect(() => WebsitePageRefSchema.parse('')).toThrow();
|
|
21
|
+
expect(() => WebsitePageRefSchema.parse('contact_us')).toThrow();
|
|
22
|
+
expect(() => WebsitePageRefSchema.parse('a'.repeat(65))).toThrow();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
describe('WebsiteSectionRefSchema', () => {
|
|
27
|
+
it('accepts the same kebab-case shape as page refs', () => {
|
|
28
|
+
expect(WebsiteSectionRefSchema.parse('hero')).toBe('hero');
|
|
29
|
+
expect(WebsiteSectionRefSchema.parse('social-proof')).toBe('social-proof');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('rejects whitespace, dot-paths, and slashes', () => {
|
|
33
|
+
expect(() => WebsiteSectionRefSchema.parse('hero section')).toThrow();
|
|
34
|
+
expect(() => WebsiteSectionRefSchema.parse('hero.cta')).toThrow();
|
|
35
|
+
expect(() => WebsiteSectionRefSchema.parse('hero/cta')).toThrow();
|
|
36
|
+
});
|
|
37
|
+
});
|
|
@@ -0,0 +1,292 @@
|
|
|
1
|
+
import type { ComponentType } from 'react';
|
|
2
|
+
import { assertType, describe, expect, it } from 'vitest';
|
|
3
|
+
|
|
4
|
+
import { WebsiteLabelKeySchema } from '../label-keys/website-label-key.schemas';
|
|
5
|
+
import { WebsitePageManifestSchema } from '../manifests/website-page-manifest.shared.schemas';
|
|
6
|
+
import {
|
|
7
|
+
WebsiteRobotsConfigSchema,
|
|
8
|
+
WebsiteRootConfigSchema,
|
|
9
|
+
WebsiteSitemapConfigSchema,
|
|
10
|
+
type WebsiteRootConfig,
|
|
11
|
+
} from '../manifests/website-root-config.shared.schemas';
|
|
12
|
+
import { WebsitePageRefSchema } from '../refs/page-ref.schemas';
|
|
13
|
+
import { WebsiteSectionRefSchema } from '../refs/section-ref.schemas';
|
|
14
|
+
|
|
15
|
+
const NoopComponent = () => null;
|
|
16
|
+
|
|
17
|
+
const buildManifest = (ref: string, route: string) =>
|
|
18
|
+
WebsitePageManifestSchema.parse({
|
|
19
|
+
ref: WebsitePageRefSchema.parse(ref),
|
|
20
|
+
routePath: route,
|
|
21
|
+
pageComponent: NoopComponent,
|
|
22
|
+
sectionRefs: [WebsiteSectionRefSchema.parse('hero')],
|
|
23
|
+
metaLabelKeys: {
|
|
24
|
+
titleKey: WebsiteLabelKeySchema.parse(`website.${ref}.meta.title`),
|
|
25
|
+
descriptionKey: WebsiteLabelKeySchema.parse(`website.${ref}.meta.description`),
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const COLORS = {
|
|
30
|
+
background: '#fff',
|
|
31
|
+
foreground: '#111',
|
|
32
|
+
primary: '#0070f3',
|
|
33
|
+
primaryForeground: '#fff',
|
|
34
|
+
accent: '#ff5e5b',
|
|
35
|
+
accentForeground: '#fff',
|
|
36
|
+
surface: '#fafafa',
|
|
37
|
+
surfaceForeground: '#111',
|
|
38
|
+
border: '#e5e5e5',
|
|
39
|
+
muted: '#f5f5f5',
|
|
40
|
+
mutedForeground: '#737373',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const RADII = {
|
|
44
|
+
none: '0',
|
|
45
|
+
sm: '0.125rem',
|
|
46
|
+
md: '0.375rem',
|
|
47
|
+
lg: '0.75rem',
|
|
48
|
+
xl: '1.5rem',
|
|
49
|
+
full: '9999px',
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const VALID_SEO = {
|
|
53
|
+
siteName: 'Example',
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const SKIP_KEY = WebsiteLabelKeySchema.parse('website.chrome.layout.skip-to-main-content');
|
|
57
|
+
|
|
58
|
+
const VALID_INPUT = {
|
|
59
|
+
pageManifests: [buildManifest('landing', '/'), buildManifest('pricing', '/pricing')],
|
|
60
|
+
designTokens: { colors: COLORS, radii: RADII },
|
|
61
|
+
navigation: { headerComponent: NoopComponent, footerComponent: NoopComponent },
|
|
62
|
+
seo: VALID_SEO,
|
|
63
|
+
skipToMainContentLabelKey: SKIP_KEY,
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
describe('WebsiteRootConfigSchema', () => {
|
|
67
|
+
it('parses a well-formed config', () => {
|
|
68
|
+
const parsed = WebsiteRootConfigSchema.parse(VALID_INPUT);
|
|
69
|
+
expect(parsed.pageManifests).toHaveLength(2);
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
it('rejects duplicate page refs', () => {
|
|
73
|
+
expect(() =>
|
|
74
|
+
WebsiteRootConfigSchema.parse({
|
|
75
|
+
...VALID_INPUT,
|
|
76
|
+
pageManifests: [buildManifest('landing', '/'), buildManifest('landing', '/landing-2')],
|
|
77
|
+
}),
|
|
78
|
+
).toThrow(/Duplicate page ref/);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
it('rejects duplicate route paths', () => {
|
|
82
|
+
expect(() =>
|
|
83
|
+
WebsiteRootConfigSchema.parse({
|
|
84
|
+
...VALID_INPUT,
|
|
85
|
+
pageManifests: [buildManifest('landing', '/'), buildManifest('home', '/')],
|
|
86
|
+
}),
|
|
87
|
+
).toThrow(/Duplicate routePath/);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('requires at least one page manifest', () => {
|
|
91
|
+
expect(() => WebsiteRootConfigSchema.parse({ ...VALID_INPUT, pageManifests: [] })).toThrow();
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it('preserves ComponentType narrowing for pageComponent and navigation slots (compile-time, F5)', () => {
|
|
95
|
+
const config = WebsiteRootConfigSchema.parse(VALID_INPUT) as WebsiteRootConfig;
|
|
96
|
+
assertType<ComponentType<unknown>>(config.pageManifests[0]!.pageComponent);
|
|
97
|
+
assertType<ComponentType<unknown>>(config.navigation.headerComponent);
|
|
98
|
+
assertType<ComponentType<unknown>>(config.navigation.footerComponent);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
describe('seo block (Phase 6 audit fix H-B/H-C/M-A — locales/origin moved to WildoMarketingWebsiteConfig in seam-collapse)', () => {
|
|
102
|
+
it('requires the seo block to be present', () => {
|
|
103
|
+
const { seo: _omit, ...withoutSeo } = VALID_INPUT;
|
|
104
|
+
expect(() => WebsiteRootConfigSchema.parse(withoutSeo)).toThrow();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('rejects an empty siteName', () => {
|
|
108
|
+
expect(() =>
|
|
109
|
+
WebsiteRootConfigSchema.parse({
|
|
110
|
+
...VALID_INPUT,
|
|
111
|
+
seo: { ...VALID_SEO, siteName: '' },
|
|
112
|
+
}),
|
|
113
|
+
).toThrow(/siteName/);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it('accepts an optional defaultOgImageUrl as a fully-qualified URL', () => {
|
|
117
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
118
|
+
...VALID_INPUT,
|
|
119
|
+
seo: { ...VALID_SEO, defaultOgImageUrl: 'https://cdn.example.com/og.png' },
|
|
120
|
+
});
|
|
121
|
+
expect(parsed.seo.defaultOgImageUrl).toBe('https://cdn.example.com/og.png');
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('rejects a non-URL defaultOgImageUrl', () => {
|
|
125
|
+
expect(() =>
|
|
126
|
+
WebsiteRootConfigSchema.parse({
|
|
127
|
+
...VALID_INPUT,
|
|
128
|
+
seo: { ...VALID_SEO, defaultOgImageUrl: 'not-a-url' },
|
|
129
|
+
}),
|
|
130
|
+
).toThrow(/defaultOgImageUrl.*URL/);
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
describe('seo.sitemap (Phase 8 close-out — saas-website-seo-sitemap.md)', () => {
|
|
135
|
+
it('omits the sitemap block by default (consumer opts in to overrides)', () => {
|
|
136
|
+
const parsed = WebsiteRootConfigSchema.parse(VALID_INPUT);
|
|
137
|
+
expect(parsed.seo.sitemap).toBeUndefined();
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('accepts an empty sitemap block and applies the enabled=true default', () => {
|
|
141
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
142
|
+
...VALID_INPUT,
|
|
143
|
+
seo: { ...VALID_SEO, sitemap: {} },
|
|
144
|
+
});
|
|
145
|
+
expect(parsed.seo.sitemap?.enabled).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('accepts enabled=false (suppressed sitemap emission for staging surfaces)', () => {
|
|
149
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
150
|
+
...VALID_INPUT,
|
|
151
|
+
seo: { ...VALID_SEO, sitemap: { enabled: false } },
|
|
152
|
+
});
|
|
153
|
+
expect(parsed.seo.sitemap?.enabled).toBe(false);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
it('accepts the seven sitemap-spec changefreq values', () => {
|
|
157
|
+
for (const changefreq of [
|
|
158
|
+
'always',
|
|
159
|
+
'hourly',
|
|
160
|
+
'daily',
|
|
161
|
+
'weekly',
|
|
162
|
+
'monthly',
|
|
163
|
+
'yearly',
|
|
164
|
+
'never',
|
|
165
|
+
] as const) {
|
|
166
|
+
const parsed = WebsiteSitemapConfigSchema.parse({ changefreq });
|
|
167
|
+
expect(parsed.changefreq).toBe(changefreq);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
it('rejects a changefreq outside the sitemap spec', () => {
|
|
172
|
+
expect(() => WebsiteSitemapConfigSchema.parse({ changefreq: 'fortnightly' })).toThrow();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('accepts priority within [0, 1]', () => {
|
|
176
|
+
expect(WebsiteSitemapConfigSchema.parse({ priority: 0 }).priority).toBe(0);
|
|
177
|
+
expect(WebsiteSitemapConfigSchema.parse({ priority: 0.5 }).priority).toBe(0.5);
|
|
178
|
+
expect(WebsiteSitemapConfigSchema.parse({ priority: 1 }).priority).toBe(1);
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('rejects priority outside the spec range', () => {
|
|
182
|
+
expect(() => WebsiteSitemapConfigSchema.parse({ priority: -0.1 })).toThrow(/priority/);
|
|
183
|
+
expect(() => WebsiteSitemapConfigSchema.parse({ priority: 1.1 })).toThrow(/priority/);
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe('seo.robots (Phase 8 close-out — saas-website-seo-sitemap.md)', () => {
|
|
188
|
+
it('omits the robots block by default (consumer opts in to overrides)', () => {
|
|
189
|
+
const parsed = WebsiteRootConfigSchema.parse(VALID_INPUT);
|
|
190
|
+
expect(parsed.seo.robots).toBeUndefined();
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
it('accepts an empty robots block and applies the policy=index default', () => {
|
|
194
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
195
|
+
...VALID_INPUT,
|
|
196
|
+
seo: { ...VALID_SEO, robots: {} },
|
|
197
|
+
});
|
|
198
|
+
expect(parsed.seo.robots?.policy).toBe('index');
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
it('accepts policy=noindex (staging / private surfaces)', () => {
|
|
202
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
203
|
+
...VALID_INPUT,
|
|
204
|
+
seo: { ...VALID_SEO, robots: { policy: 'noindex' } },
|
|
205
|
+
});
|
|
206
|
+
expect(parsed.seo.robots?.policy).toBe('noindex');
|
|
207
|
+
});
|
|
208
|
+
|
|
209
|
+
it('accepts disallow path-prefix entries', () => {
|
|
210
|
+
const parsed = WebsiteRobotsConfigSchema.parse({
|
|
211
|
+
disallow: ['/internal/', '/preview/', '/api/'],
|
|
212
|
+
});
|
|
213
|
+
expect(parsed.disallow).toEqual(['/internal/', '/preview/', '/api/']);
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
it('rejects disallow entries that do not start with "/"', () => {
|
|
217
|
+
expect(() => WebsiteRobotsConfigSchema.parse({ disallow: ['internal'] })).toThrow(/start with/);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
it('accepts allowedCrawlers (deny-by-default policy direction)', () => {
|
|
221
|
+
const parsed = WebsiteRobotsConfigSchema.parse({
|
|
222
|
+
allowedCrawlers: ['Googlebot', 'Bingbot'],
|
|
223
|
+
});
|
|
224
|
+
expect(parsed.allowedCrawlers).toEqual(['Googlebot', 'Bingbot']);
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
it('accepts disallowedCrawlers (allow-by-default policy direction)', () => {
|
|
228
|
+
const parsed = WebsiteRobotsConfigSchema.parse({
|
|
229
|
+
disallowedCrawlers: ['GPTBot', 'CCBot'],
|
|
230
|
+
});
|
|
231
|
+
expect(parsed.disallowedCrawlers).toEqual(['GPTBot', 'CCBot']);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
it('rejects mixing allowedCrawlers and disallowedCrawlers (mutually exclusive policy directions)', () => {
|
|
235
|
+
expect(() =>
|
|
236
|
+
WebsiteRobotsConfigSchema.parse({
|
|
237
|
+
allowedCrawlers: ['Googlebot'],
|
|
238
|
+
disallowedCrawlers: ['GPTBot'],
|
|
239
|
+
}),
|
|
240
|
+
).toThrow(/mutually exclusive/);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it('rejects empty crawler tokens (would emit an unparseable User-agent line)', () => {
|
|
244
|
+
expect(() => WebsiteRobotsConfigSchema.parse({ allowedCrawlers: [''] })).toThrow();
|
|
245
|
+
expect(() => WebsiteRobotsConfigSchema.parse({ disallowedCrawlers: [''] })).toThrow();
|
|
246
|
+
});
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
describe('seo.llmsTxt (AEO/GEO Step 4a)', () => {
|
|
250
|
+
it('omits the llmsTxt block by default (helper auto-detects from file presence)', () => {
|
|
251
|
+
const parsed = WebsiteRootConfigSchema.parse(VALID_INPUT);
|
|
252
|
+
expect(parsed.seo.llmsTxt).toBeUndefined();
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it('accepts an empty llmsTxt block (enabled remains undefined for auto-detect)', () => {
|
|
256
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
257
|
+
...VALID_INPUT,
|
|
258
|
+
seo: { ...VALID_SEO, llmsTxt: {} },
|
|
259
|
+
});
|
|
260
|
+
expect(parsed.seo.llmsTxt?.enabled).toBeUndefined();
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
it('accepts enabled=false (consumer suppresses publication even if the file exists)', () => {
|
|
264
|
+
const parsed = WebsiteRootConfigSchema.parse({
|
|
265
|
+
...VALID_INPUT,
|
|
266
|
+
seo: { ...VALID_SEO, llmsTxt: { enabled: false } },
|
|
267
|
+
});
|
|
268
|
+
expect(parsed.seo.llmsTxt?.enabled).toBe(false);
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
describe('skipToMainContentLabelKey (Phase 6 third audit fix M-α)', () => {
|
|
273
|
+
it('requires the skipToMainContentLabelKey to be present', () => {
|
|
274
|
+
const { skipToMainContentLabelKey: _omit, ...withoutKey } = VALID_INPUT;
|
|
275
|
+
expect(() => WebsiteRootConfigSchema.parse(withoutKey)).toThrow();
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
it('rejects a malformed label key', () => {
|
|
279
|
+
expect(() =>
|
|
280
|
+
WebsiteRootConfigSchema.parse({
|
|
281
|
+
...VALID_INPUT,
|
|
282
|
+
skipToMainContentLabelKey: 'not-a-website-label-key',
|
|
283
|
+
}),
|
|
284
|
+
).toThrow();
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
it('accepts a fully-composed website.* label key', () => {
|
|
288
|
+
const parsed = WebsiteRootConfigSchema.parse(VALID_INPUT);
|
|
289
|
+
expect(parsed.skipToMainContentLabelKey).toBe(SKIP_KEY);
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
|
|
3
|
+
import { WebsiteLabelKeySchema } from '../label-keys/website-label-key.schemas';
|
|
4
|
+
import { WebsiteSectionRefSchema } from '../refs/section-ref.schemas';
|
|
5
|
+
import { WebsiteSectionCategory } from '../sections/website-section-category.shared';
|
|
6
|
+
import { WebsiteSectionDefinitionSchema } from '../sections/website-section-definition.shared.schemas';
|
|
7
|
+
|
|
8
|
+
describe('WebsiteSectionDefinitionSchema', () => {
|
|
9
|
+
it('parses a well-formed definition with a Component reference', () => {
|
|
10
|
+
const Component = () => null;
|
|
11
|
+
const def = WebsiteSectionDefinitionSchema.parse({
|
|
12
|
+
sectionRef: WebsiteSectionRefSchema.parse('hero'),
|
|
13
|
+
category: WebsiteSectionCategory.HERO,
|
|
14
|
+
expectedLabelKeys: [
|
|
15
|
+
WebsiteLabelKeySchema.parse('website.landing.hero.headline'),
|
|
16
|
+
WebsiteLabelKeySchema.parse('website.landing.hero.subheadline'),
|
|
17
|
+
],
|
|
18
|
+
Component,
|
|
19
|
+
});
|
|
20
|
+
expect(def.sectionRef).toBe('hero');
|
|
21
|
+
expect(def.category).toBe(WebsiteSectionCategory.HERO);
|
|
22
|
+
expect(def.expectedLabelKeys).toHaveLength(2);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it('accepts an optional getStructuredData hook', () => {
|
|
26
|
+
expect(() =>
|
|
27
|
+
WebsiteSectionDefinitionSchema.parse({
|
|
28
|
+
sectionRef: WebsiteSectionRefSchema.parse('pricing'),
|
|
29
|
+
category: WebsiteSectionCategory.PRICING,
|
|
30
|
+
expectedLabelKeys: [],
|
|
31
|
+
Component: () => null,
|
|
32
|
+
getStructuredData: () => ({ '@type': 'Product' }),
|
|
33
|
+
}),
|
|
34
|
+
).not.toThrow();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it('rejects invalid category values', () => {
|
|
38
|
+
expect(() =>
|
|
39
|
+
WebsiteSectionDefinitionSchema.parse({
|
|
40
|
+
sectionRef: WebsiteSectionRefSchema.parse('hero'),
|
|
41
|
+
category: 'novel-category',
|
|
42
|
+
expectedLabelKeys: [],
|
|
43
|
+
Component: () => null,
|
|
44
|
+
}),
|
|
45
|
+
).toThrow();
|
|
46
|
+
});
|
|
47
|
+
});
|