@woodsportal/hubspot-kit 1.0.41-dev.4 → 1.0.41-dev.6
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/CHANGELOG.md +7 -0
- package/README.md +191 -157
- package/dist/{chunk-S2YJDWZU.js → chunk-NWBK3XBZ.js} +1 -1
- package/dist/chunk-NWBK3XBZ.js.map +1 -0
- package/dist/chunk-WHYTQEZX.js +554 -0
- package/dist/chunk-WHYTQEZX.js.map +1 -0
- package/dist/cli.js +1494 -650
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js +194 -0
- package/dist/scaffold-page-lifecycle-EHMPWPPE.js.map +1 -0
- package/dist/vite/index.js +1 -1
- package/examples/greenfield/module-hybrid-cdn/public/fields.json +73 -28
- package/examples/greenfield/module-hybrid-cdn/public/module.html +21 -5
- package/examples/greenfield/module-hybrid-cdn/src/assets/css/main.dev.css +15 -0
- package/examples/greenfield/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/app.tsx +172 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/auth-session.ts +51 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/login-session-bridge.ts +74 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/mfa-portal.ts +45 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/configure-woodsportal-sdk.ts +98 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routeTree.gen.ts +182 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/_auth/two-fa.tsx +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-full/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/app.tsx +180 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/components/starter-login.tsx +83 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/sso-callback.ts +120 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/portal/mount-portal.tsx +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routeTree.gen.ts +155 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login/sso.tsx +27 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-sso/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/MainLayout.tsx +42 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/auth-guide-content.ts +91 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.dev.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.local.example +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.prod.example +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.env.stg.example +3 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/.wphs/README.md +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/README.md +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/hubspot.config.yml.example +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/index.html +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/package.json +34 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/portal.cdn.json.example +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/fields.json +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/meta.json +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/public/module.html +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/app.tsx +173 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.dev.css +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/main.prod.css +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/assets/css/tailwind.css.config.css +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/app-entry.ts +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/cdn/vendor-entry.ts +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/AuthLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/Layouts/index.ts +13 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/section-card.tsx +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-nav.tsx +28 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/layout/starter-shell.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Button.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Form.tsx +22 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Input.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/Toaster.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/link.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/components/ui/loader/loader.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/auth-tier.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/nav-scaffold.ts +4 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/portal-nav.ts +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/router.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/config/routes.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/hubSpotContext.ts +57 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/data/sync-sdk-hub-context.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/defaultData.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/env.ts +59 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-navigation.ts +81 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-route-paths.ts +29 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session-events.ts +2 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/auth-session.ts +26 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/clear-client-auth-session.ts +62 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/components/starter-login.tsx +76 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-email-storage.ts +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/login-session-bridge.ts +72 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/post-login-path.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/resolve-post-login-path.ts +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-portal-session.ts +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/auth/use-signed-in-email.ts +55 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-guide-page.tsx +210 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home-page.tsx +21 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-home.tsx +48 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/components/starter-single-page.tsx +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/auth-guide-content.ts +85 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/content/woodscli-guide-content.ts +86 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/hooks/use-starter-preview.ts +30 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/features/starter/index.ts +6 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/bootstrap.ts +16 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/default-data.ts +7 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/is-cms-editor.ts +78 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/module-entry.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/hubspot/types.ts +17 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/configure-woodsportal-sdk.ts +94 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/tanstack-router/router.tsx +39 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/integrations/woodsportal-sdk.ts +37 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/main.tsx +5 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/api-endpoint.ts +11 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/ensure-portal-cdn-stylesheet.ts +115 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-dev-preview.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/portal/mount-portal.tsx +52 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routeTree.gen.ts +134 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/__root.tsx +12 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_app/portal.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/_auth/login.tsx +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/guide.tsx +9 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/index.tsx +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/routes/unauthorized.tsx +50 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/ValidationSchema.ts +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/cookie.ts +23 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/normalize-router-path.ts +10 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/private-route.tsx +100 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/public-route.tsx +64 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/resolve-api-base-url.ts +44 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/src/utils/safe-router-navigation.ts +82 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/tsconfig.json +20 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-app.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-esm.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.cdn-vendor.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.dev.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.hubspot.mjs +1 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/vite.config.monolith.mjs +8 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/woodscli.json +38 -0
- package/examples/greenfield/module-hybrid-cdn-auth-starter-sidebar/wphs.adapter.ts +7 -0
- package/examples/greenfield/module-monolith/public/fields.json +66 -16
- package/examples/greenfield/module-monolith/src/assets/css/main.dev.css +7 -0
- package/examples/greenfield/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/examples/greenfield/module-monolith/src/config/starter-nav.ts +9 -0
- package/examples/greenfield/module-monolith/src/features/starter/components/starter-home.tsx +25 -29
- package/examples/greenfield/module-monolith/src/features/starter/hooks/starter-preview-values.ts +60 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.dev.ts +18 -0
- package/examples/greenfield/module-monolith/src/features/starter/hooks/use-starter-preview.ts +20 -37
- package/examples/manifest.json +5 -1
- package/examples/smoke/run-matrix.mjs +37 -0
- package/package.json +7 -5
- package/scripts/cli-smoke-helpers.mjs +150 -0
- package/scripts/regenerate-route-tree.mjs +71 -0
- package/scripts/sync-auth-scaffold-from-client.mjs +41 -0
- package/scripts/wp-cli-smoke.test.mjs +263 -0
- package/src/dev/bootstrap-greenfield.tsx +6 -0
- package/templates/module-hybrid-cdn/public/fields.json +47 -7
- package/templates/module-hybrid-cdn/public/module.html +7 -6
- package/templates/module-hybrid-cdn/src/assets/css/main.dev.css +7 -0
- package/templates/module-hybrid-cdn/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-hybrid-cdn/src/config/starter-nav.ts +9 -0
- package/templates/module-hybrid-cdn/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-hybrid-cdn/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/module-monolith/public/fields.json +49 -6
- package/templates/module-monolith/src/assets/css/main.dev.css +7 -0
- package/templates/module-monolith/src/components/layout/starter-nav.tsx +12 -15
- package/templates/module-monolith/src/config/starter-nav.ts +9 -0
- package/templates/module-monolith/src/features/starter/components/starter-home.tsx +25 -27
- package/templates/module-monolith/src/features/starter/hooks/starter-preview-values.ts +5 -5
- package/templates/scaffold/auth/_full/src/app.tsx +172 -0
- package/templates/scaffold/auth/_full/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_full/src/features/auth/auth-session.ts +51 -0
- package/templates/scaffold/auth/_full/src/features/auth/login-session-bridge.ts +74 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-otp-utils.ts +24 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-pending-storage.ts +108 -0
- package/templates/scaffold/auth/_full/src/features/auth/mfa-portal.ts +45 -0
- package/templates/scaffold/auth/_full/src/features/auth/use-mfa-login-otp-flow.ts +78 -0
- package/templates/scaffold/auth/_full/src/routeTree.gen.ts +182 -0
- package/templates/scaffold/auth/_full/src/routes/_auth/two-fa.tsx +91 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/Layouts/MainLayout.tsx +7 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar-nav.tsx +33 -0
- package/templates/scaffold/auth/_nav-sidebar/src/components/layout/portal-sidebar.tsx +139 -0
- package/templates/scaffold/auth/_nav-top/src/components/Layouts/MainLayout.tsx +42 -0
- package/templates/scaffold/auth/_shared/src/app.tsx +178 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AppLayoutWrapper.tsx +38 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/AuthLayout.tsx +7 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/DefaultLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/UnauthorizedLayout.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/Layouts/index.ts +13 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Button.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Form.tsx +22 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Input.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/components/ui/Toaster.tsx +5 -0
- package/templates/scaffold/auth/_shared/src/components/ui/link.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/components/ui/loader/loader.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/nav-scaffold.ts +4 -0
- package/templates/scaffold/auth/_shared/src/config/portal-nav.ts +9 -0
- package/templates/scaffold/auth/_shared/src/config/router.ts +1 -0
- package/templates/scaffold/auth/_shared/src/config/routes.ts +10 -0
- package/templates/scaffold/auth/_shared/src/data/hubSpotContext.ts +57 -0
- package/templates/scaffold/auth/_shared/src/data/sync-sdk-hub-context.ts +44 -0
- package/templates/scaffold/auth/_shared/src/env.ts +59 -0
- package/templates/scaffold/auth/_shared/src/features/auth/app-bootstrap-guards.ts +14 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-navigation.ts +81 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-route-paths.ts +29 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session-events.ts +2 -0
- package/templates/scaffold/auth/_shared/src/features/auth/auth-session.ts +26 -0
- package/templates/scaffold/auth/_shared/src/features/auth/clear-client-auth-session.ts +62 -0
- package/templates/scaffold/auth/_shared/src/features/auth/components/starter-login.tsx +76 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-email-storage.ts +64 -0
- package/templates/scaffold/auth/_shared/src/features/auth/login-session-bridge.ts +72 -0
- package/templates/scaffold/auth/_shared/src/features/auth/post-login-path.ts +17 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-auth-login-error-message.ts +52 -0
- package/templates/scaffold/auth/_shared/src/features/auth/resolve-post-login-path.ts +21 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-portal-session.ts +25 -0
- package/templates/scaffold/auth/_shared/src/features/auth/use-signed-in-email.ts +55 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-guide-page.tsx +218 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-page-frame.tsx +25 -0
- package/templates/scaffold/auth/_shared/src/features/starter/components/starter-protected-page.tsx +54 -0
- package/templates/scaffold/auth/_shared/src/features/starter/content/auth-guide-content.ts +91 -0
- package/templates/scaffold/auth/_shared/src/hubspot/is-cms-editor.ts +78 -0
- package/templates/scaffold/auth/_shared/src/integrations/configure-woodsportal-sdk.ts +100 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-query/root-provider.tsx +18 -0
- package/templates/scaffold/auth/_shared/src/integrations/tanstack-router/router.tsx +39 -0
- package/templates/scaffold/auth/_shared/src/integrations/woodsportal-sdk.ts +37 -0
- package/templates/scaffold/auth/_shared/src/portal/mount-portal.tsx +59 -0
- package/templates/scaffold/auth/_shared/src/routeTree.gen.ts +134 -0
- package/templates/scaffold/auth/_shared/src/routes/__root.tsx +12 -0
- package/templates/scaffold/auth/_shared/src/routes/_app/portal.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/_auth/login.tsx +10 -0
- package/templates/scaffold/auth/_shared/src/routes/guide.tsx +9 -0
- package/templates/scaffold/auth/_shared/src/routes/index.tsx +8 -0
- package/templates/scaffold/auth/_shared/src/routes/unauthorized.tsx +50 -0
- package/templates/scaffold/auth/_shared/src/utils/ValidationSchema.ts +1 -0
- package/templates/scaffold/auth/_shared/src/utils/cookie.ts +23 -0
- package/templates/scaffold/auth/_shared/src/utils/normalize-router-path.ts +10 -0
- package/templates/scaffold/auth/_shared/src/utils/private-route.tsx +100 -0
- package/templates/scaffold/auth/_shared/src/utils/public-route.tsx +64 -0
- package/templates/scaffold/auth/_shared/src/utils/resolve-api-base-url.ts +44 -0
- package/templates/scaffold/auth/_shared/src/utils/safe-router-navigation.ts +82 -0
- package/templates/scaffold/auth/_sso/src/app.tsx +180 -0
- package/templates/scaffold/auth/_sso/src/components/ui/auth/SsoLoginButton.tsx +34 -0
- package/templates/scaffold/auth/_sso/src/config/auth-tier.ts +4 -0
- package/templates/scaffold/auth/_sso/src/features/auth/components/starter-login.tsx +83 -0
- package/templates/scaffold/auth/_sso/src/features/auth/sso-callback.ts +120 -0
- package/templates/scaffold/auth/_sso/src/features/auth/use-sso-callback-handler.ts +92 -0
- package/templates/scaffold/auth/_sso/src/routeTree.gen.ts +155 -0
- package/templates/scaffold/auth/_sso/src/routes/_auth/login/sso.tsx +27 -0
- package/templates/scaffold/auth/nav-manifest.json +8 -0
- package/templates/scaffold/auth/sync-manifest.json +16 -0
- package/templates/scaffold/auth/tier-manifest.json +18 -0
- package/templates/scaffold/page/page-component-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/page-component-plain.tsx.tpl +11 -0
- package/templates/scaffold/page/route-protected-auth.tsx.tpl +10 -0
- package/templates/scaffold/page/route-public-auth.tsx.tpl +9 -0
- package/templates/scaffold/page/route-public-plain.tsx.tpl +6 -0
- package/dist/chunk-S2YJDWZU.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woodsportal/hubspot-kit",
|
|
3
|
-
"version": "1.0.41-dev.
|
|
3
|
+
"version": "1.0.41-dev.6",
|
|
4
4
|
"description": "WoodsCLI — HubSpot CMS dev kit by WoodsPortal. wp CLI, Vite presets, module-config overlay, and theme/module build pipelines.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"build": "tsup",
|
|
52
52
|
"dev": "tsup --watch",
|
|
53
53
|
"typecheck": "tsc --noEmit",
|
|
54
|
-
"test": "node --import tsx --test 'src/lib/**/*.test.ts' 'src/schema/**/*.test.ts' 'src/vite/**/*.test.ts' 'scripts/portal-build-id.test.mjs' 'scripts/resolve-consumer-dep.test.mjs' 'scripts/vite/ensure-dev-kit-shims.test.mjs' 'scripts/vite/consumer-react-aliases.test.mjs' 'scripts/vite/resolve-from-project-root.test.mjs' && vitest run src/dev-module-config/__tests__/normalize-repeater-items.test.ts src/dev-module-config/__tests__/module-config-transform.test.ts src/dev-module-config/__tests__/flatten-visible-fields.test.ts",
|
|
54
|
+
"test": "node --import tsx --test 'src/lib/**/*.test.ts' 'src/cli/**/*.test.ts' 'src/schema/**/*.test.ts' 'src/vite/**/*.test.ts' 'scripts/portal-build-id.test.mjs' 'scripts/resolve-consumer-dep.test.mjs' 'scripts/wp-cli-smoke.test.mjs' 'scripts/vite/ensure-dev-kit-shims.test.mjs' 'scripts/vite/consumer-react-aliases.test.mjs' 'scripts/vite/resolve-from-project-root.test.mjs' && vitest run src/dev-module-config/__tests__/normalize-repeater-items.test.ts src/dev-module-config/__tests__/module-config-transform.test.ts src/dev-module-config/__tests__/flatten-visible-fields.test.ts",
|
|
55
55
|
"test:examples": "node examples/smoke/run-matrix.mjs --tier static",
|
|
56
56
|
"lint": "eslint src",
|
|
57
57
|
"verify": "npm run typecheck && npm run test && npm run test:examples && npm run build",
|
|
@@ -68,14 +68,16 @@
|
|
|
68
68
|
"@clack/prompts": "^0.10.1",
|
|
69
69
|
"commander": "^13.1.0",
|
|
70
70
|
"picocolors": "^1.1.1",
|
|
71
|
+
"semver": "^7.8.4",
|
|
71
72
|
"zod": "^3.24.2"
|
|
72
73
|
},
|
|
73
74
|
"devDependencies": {
|
|
74
75
|
"@types/node": "^22.13.4",
|
|
75
|
-
"
|
|
76
|
-
"tsx": "^4.19.3",
|
|
76
|
+
"@types/semver": "^7.7.1",
|
|
77
77
|
"tsup": "^8.4.0",
|
|
78
|
-
"
|
|
78
|
+
"tsx": "^4.19.3",
|
|
79
|
+
"typescript": "^5.7.3",
|
|
80
|
+
"vitest": "^3.2.4"
|
|
79
81
|
},
|
|
80
82
|
"peerDependencies": {
|
|
81
83
|
"@tailwindcss/vite": "^4.0.0",
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { spawnSync } from 'node:child_process'
|
|
2
|
+
import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { dirname, join, resolve } from 'node:path'
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
|
|
7
|
+
export const kitRoot = resolve(dirname(fileURLToPath(import.meta.url)), '..')
|
|
8
|
+
export const cliEntry = join(kitRoot, 'src/cli/index.ts')
|
|
9
|
+
|
|
10
|
+
const LEGACY_SHIM_SCRIPTS = [
|
|
11
|
+
'build-cdn.mjs',
|
|
12
|
+
'run-vite-build.mjs',
|
|
13
|
+
'run-hubspot-module-postbuild.mjs',
|
|
14
|
+
'watch-hubspot.mjs',
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
const FIXTURE_PATHS = {
|
|
18
|
+
'greenfield/module-hybrid-cdn': join(kitRoot, 'examples/greenfield/module-hybrid-cdn'),
|
|
19
|
+
'greenfield/module-hybrid-cdn-auth-starter': join(
|
|
20
|
+
kitRoot,
|
|
21
|
+
'examples/greenfield/module-hybrid-cdn-auth-starter',
|
|
22
|
+
),
|
|
23
|
+
'fixtures/adopted-module-monolith': join(kitRoot, 'examples/fixtures/adopted-module-monolith'),
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {string | null | undefined} projectRoot
|
|
28
|
+
* @param {string[]} args
|
|
29
|
+
* @param {{ skipProject?: boolean; cwd?: string; extraEnv?: Record<string, string> }} [opts]
|
|
30
|
+
*/
|
|
31
|
+
export function runWp(projectRoot, args, opts = {}) {
|
|
32
|
+
const globalFlags = opts.skipProject
|
|
33
|
+
? ['--ci', '-y']
|
|
34
|
+
: ['--project', projectRoot, '--ci', '-y']
|
|
35
|
+
|
|
36
|
+
return spawnSync(
|
|
37
|
+
process.execPath,
|
|
38
|
+
['--import', 'tsx', cliEntry, ...globalFlags, ...args],
|
|
39
|
+
{
|
|
40
|
+
cwd: opts.cwd ?? kitRoot,
|
|
41
|
+
encoding: 'utf8',
|
|
42
|
+
env: { ...process.env, NO_COLOR: '1', ...opts.extraEnv },
|
|
43
|
+
},
|
|
44
|
+
)
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @param {string} stdout
|
|
49
|
+
*/
|
|
50
|
+
export function parseJsonLine(stdout) {
|
|
51
|
+
const lines = stdout
|
|
52
|
+
.split('\n')
|
|
53
|
+
.map((line) => line.trim())
|
|
54
|
+
.filter(Boolean)
|
|
55
|
+
for (let i = lines.length - 1; i >= 0; i -= 1) {
|
|
56
|
+
const line = lines[i]
|
|
57
|
+
if (!line.startsWith('{')) continue
|
|
58
|
+
try {
|
|
59
|
+
return JSON.parse(line)
|
|
60
|
+
} catch {
|
|
61
|
+
// continue
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
throw new Error(`No JSON line found in stdout:\n${stdout}`)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @param {string} fixtureKey
|
|
69
|
+
* @param {string} targetDir
|
|
70
|
+
*/
|
|
71
|
+
export function copyFixture(fixtureKey, targetDir) {
|
|
72
|
+
const source = FIXTURE_PATHS[fixtureKey]
|
|
73
|
+
if (!source || !existsSync(source)) {
|
|
74
|
+
throw new Error(`Unknown or missing fixture: ${fixtureKey}`)
|
|
75
|
+
}
|
|
76
|
+
cpSync(source, targetDir, { recursive: true })
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* @param {string} fixtureKey
|
|
81
|
+
* @param {(dir: string) => void | Promise<void>} fn
|
|
82
|
+
*/
|
|
83
|
+
export async function withTempFixture(fixtureKey, fn) {
|
|
84
|
+
const dir = mkdtempSync(join(tmpdir(), 'wphs-cli-fixture-'))
|
|
85
|
+
try {
|
|
86
|
+
copyFixture(fixtureKey, dir)
|
|
87
|
+
await fn(dir)
|
|
88
|
+
} finally {
|
|
89
|
+
rmSync(dir, { recursive: true, force: true })
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* @param {string} dir
|
|
95
|
+
*/
|
|
96
|
+
export function seedModuleBuildId(dir) {
|
|
97
|
+
writeFileSync(join(dir, '.module-build-id'), '# baseline\nv0.0.1-dev\n')
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* CDN build/deploy dry-runs need baseline + dev slug (no git user.name in CI).
|
|
102
|
+
* @param {string} dir
|
|
103
|
+
*/
|
|
104
|
+
export function seedCdnBuildPrereqs(dir) {
|
|
105
|
+
seedModuleBuildId(dir)
|
|
106
|
+
const configDir = join(dir, '.wphs', 'config')
|
|
107
|
+
mkdirSync(configDir, { recursive: true })
|
|
108
|
+
writeFileSync(join(configDir, 'developer.json'), `${JSON.stringify({ slug: 'cli-smoke' }, null, 2)}\n`)
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* @param {string} dir
|
|
113
|
+
*/
|
|
114
|
+
export function seedHubspotConfig(dir) {
|
|
115
|
+
writeFileSync(
|
|
116
|
+
join(dir, 'hubspot.config.yml'),
|
|
117
|
+
`defaultPortal: dev
|
|
118
|
+
portals:
|
|
119
|
+
- name: dev
|
|
120
|
+
portalId: 12345
|
|
121
|
+
`,
|
|
122
|
+
)
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @param {string} dir
|
|
127
|
+
*/
|
|
128
|
+
export function seedRegressionShims(dir) {
|
|
129
|
+
const scriptsDir = join(dir, 'scripts')
|
|
130
|
+
mkdirSync(scriptsDir, { recursive: true })
|
|
131
|
+
for (const script of LEGACY_SHIM_SCRIPTS) {
|
|
132
|
+
cpSync(join(kitRoot, 'scripts', script), join(scriptsDir, script))
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* @param {number | number[]} expected
|
|
138
|
+
* @param {import('node:child_process').SpawnSyncReturns<string>} result
|
|
139
|
+
* @param {string} label
|
|
140
|
+
*/
|
|
141
|
+
export function assertExit(expected, result, label) {
|
|
142
|
+
const allowed = Array.isArray(expected) ? expected : [expected]
|
|
143
|
+
if (allowed.includes(result.status ?? -1)) {
|
|
144
|
+
return
|
|
145
|
+
}
|
|
146
|
+
const detail = [result.stderr, result.stdout].filter(Boolean).join('\n')
|
|
147
|
+
throw new Error(
|
|
148
|
+
`${label}: expected exit ${allowed.join(' or ')}, got ${result.status}\n${detail}`,
|
|
149
|
+
)
|
|
150
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Regenerate src/routeTree.gen.ts using the consumer project's @tanstack/router-generator.
|
|
4
|
+
*/
|
|
5
|
+
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import { existsSync } from 'node:fs'
|
|
7
|
+
import { resolve } from 'node:path'
|
|
8
|
+
|
|
9
|
+
import { findProjectRoot } from './project-root.mjs'
|
|
10
|
+
import { importConsumerDep } from './resolve-consumer-dep.mjs'
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {string} [projectRoot]
|
|
14
|
+
* @returns {Promise<{ ok: boolean; warning?: string }>}
|
|
15
|
+
*/
|
|
16
|
+
export async function regenerateRouteTree(projectRoot = findProjectRoot()) {
|
|
17
|
+
const routesDir = resolve(projectRoot, 'src/routes')
|
|
18
|
+
const generatedRouteTree = resolve(projectRoot, 'src/routeTree.gen.ts')
|
|
19
|
+
|
|
20
|
+
if (!existsSync(routesDir)) {
|
|
21
|
+
return { ok: false, warning: 'No src/routes directory — skipping route tree regeneration.' }
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
const mod = await importConsumerDep('@tanstack/router-generator', projectRoot)
|
|
26
|
+
const Generator = mod.Generator ?? mod.default?.Generator
|
|
27
|
+
if (!Generator) {
|
|
28
|
+
throw new Error('@tanstack/router-generator does not export Generator')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const generator = new Generator({
|
|
32
|
+
routesDirectory: routesDir,
|
|
33
|
+
generatedRouteTree,
|
|
34
|
+
target: 'react',
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
if (typeof generator.build === 'function') {
|
|
38
|
+
await generator.build()
|
|
39
|
+
} else if (typeof generator.run === 'function') {
|
|
40
|
+
await generator.run()
|
|
41
|
+
} else if (typeof generator.generate === 'function') {
|
|
42
|
+
await generator.generate()
|
|
43
|
+
} else {
|
|
44
|
+
throw new Error('Unsupported @tanstack/router-generator API')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (!existsSync(generatedRouteTree)) {
|
|
48
|
+
throw new Error('Generator finished but routeTree.gen.ts was not written')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return { ok: true }
|
|
52
|
+
} catch (error) {
|
|
53
|
+
const message = error instanceof Error ? error.message : String(error)
|
|
54
|
+
return {
|
|
55
|
+
ok: false,
|
|
56
|
+
warning: `Could not regenerate routeTree.gen.ts (${message}). Restart wp dev to refresh the route tree.`,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
62
|
+
const root = process.argv[2] ?? findProjectRoot()
|
|
63
|
+
regenerateRouteTree(root).then((result) => {
|
|
64
|
+
if (result.ok) {
|
|
65
|
+
process.stdout.write('routeTree.gen.ts regenerated\n')
|
|
66
|
+
process.exit(0)
|
|
67
|
+
}
|
|
68
|
+
process.stderr.write(`${result.warning ?? 'Route tree regeneration failed'}\n`)
|
|
69
|
+
process.exit(1)
|
|
70
|
+
})
|
|
71
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Copy curated auth files from woodsportal-client-frontend into templates/scaffold/auth/.
|
|
4
|
+
* Usage: node scripts/sync-auth-scaffold-from-client.mjs [--dry-run]
|
|
5
|
+
*/
|
|
6
|
+
import { copyFileSync, existsSync, mkdirSync, readFileSync } from 'node:fs'
|
|
7
|
+
import { dirname, resolve } from 'node:path'
|
|
8
|
+
import { fileURLToPath } from 'node:url'
|
|
9
|
+
|
|
10
|
+
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
11
|
+
const kitRoot = resolve(__dirname, '..')
|
|
12
|
+
const manifestPath = resolve(kitRoot, 'templates/scaffold/auth/sync-manifest.json')
|
|
13
|
+
const dryRun = process.argv.includes('--dry-run')
|
|
14
|
+
|
|
15
|
+
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8')) as {
|
|
16
|
+
clientFrontendRoot: string
|
|
17
|
+
mappings: Array<{ from: string; to: string }>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const clientRoot = resolve(kitRoot, manifest.clientFrontendRoot)
|
|
21
|
+
|
|
22
|
+
let copied = 0
|
|
23
|
+
for (const { from, to } of manifest.mappings) {
|
|
24
|
+
const source = resolve(clientRoot, from)
|
|
25
|
+
const target = resolve(kitRoot, 'templates/scaffold/auth', to)
|
|
26
|
+
if (!existsSync(source)) {
|
|
27
|
+
console.warn(`skip missing source: ${from}`)
|
|
28
|
+
continue
|
|
29
|
+
}
|
|
30
|
+
if (dryRun) {
|
|
31
|
+
console.log(`[dry-run] ${from} -> templates/scaffold/auth/${to}`)
|
|
32
|
+
copied += 1
|
|
33
|
+
continue
|
|
34
|
+
}
|
|
35
|
+
mkdirSync(dirname(target), { recursive: true })
|
|
36
|
+
copyFileSync(source, target)
|
|
37
|
+
console.log(`copied ${to}`)
|
|
38
|
+
copied += 1
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
console.log(`${dryRun ? 'would copy' : 'copied'} ${copied} file(s)`)
|
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
import assert from 'node:assert/strict'
|
|
2
|
+
import { existsSync, mkdtempSync, readFileSync, rmSync } from 'node:fs'
|
|
3
|
+
import { tmpdir } from 'node:os'
|
|
4
|
+
import { join, resolve } from 'node:path'
|
|
5
|
+
import { test } from 'node:test'
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
assertExit,
|
|
9
|
+
copyFixture,
|
|
10
|
+
kitRoot,
|
|
11
|
+
parseJsonLine,
|
|
12
|
+
runWp,
|
|
13
|
+
seedCdnBuildPrereqs,
|
|
14
|
+
seedHubspotConfig,
|
|
15
|
+
seedRegressionShims,
|
|
16
|
+
withTempFixture,
|
|
17
|
+
} from './cli-smoke-helpers.mjs'
|
|
18
|
+
|
|
19
|
+
/** @typedef {{ id: string; args: string[]; fixture?: string; expectedExit: number | number[]; setup?: (dir: string) => void; assertJson?: (json: Record<string, unknown>) => void; skipProject?: boolean; cwd?: string }} MatrixRow */
|
|
20
|
+
|
|
21
|
+
/** @type {MatrixRow[]} */
|
|
22
|
+
const MATRIX = [
|
|
23
|
+
{
|
|
24
|
+
id: 'doctor',
|
|
25
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
26
|
+
args: ['doctor'],
|
|
27
|
+
expectedExit: [0, 2],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'setup-dry-run',
|
|
31
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
32
|
+
args: ['--dry-run', 'setup'],
|
|
33
|
+
expectedExit: 0,
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'config-validate-json',
|
|
37
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
38
|
+
args: ['--json', 'config', 'validate'],
|
|
39
|
+
expectedExit: 0,
|
|
40
|
+
assertJson: (json) => {
|
|
41
|
+
assert.equal(json.valid, true)
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: 'migrate-dry-run',
|
|
46
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
47
|
+
args: ['--dry-run', 'migrate'],
|
|
48
|
+
expectedExit: 0,
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
id: 'dev-dry-run',
|
|
52
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
53
|
+
args: ['--dry-run', 'dev'],
|
|
54
|
+
expectedExit: 0,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
id: 'build-dry-run',
|
|
58
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
59
|
+
args: ['--dry-run', 'build', '--tier', 'dev'],
|
|
60
|
+
expectedExit: 0,
|
|
61
|
+
setup: (dir) => seedCdnBuildPrereqs(dir),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: 'build-cdn-only-dry-run',
|
|
65
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
66
|
+
args: ['--dry-run', 'build', '--cdn-only'],
|
|
67
|
+
expectedExit: 0,
|
|
68
|
+
setup: (dir) => seedCdnBuildPrereqs(dir),
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
id: 'build-hubspot-only-dry-run',
|
|
72
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
73
|
+
args: ['--dry-run', 'build', '--hubspot-only'],
|
|
74
|
+
expectedExit: 0,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: 'deploy-dry-run',
|
|
78
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
79
|
+
args: ['--dry-run', 'deploy', '--tier', 'dev'],
|
|
80
|
+
expectedExit: 0,
|
|
81
|
+
setup: (dir) => seedCdnBuildPrereqs(dir),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: 'publish-dry-run-hybrid',
|
|
85
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
86
|
+
args: ['--dry-run', 'publish', '--tier', 'dev'],
|
|
87
|
+
expectedExit: 0,
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
id: 'publish-no-cdn-monolith',
|
|
91
|
+
fixture: 'fixtures/adopted-module-monolith',
|
|
92
|
+
args: ['publish', '--tier', 'dev'],
|
|
93
|
+
expectedExit: 1,
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'audit-ship-bundle-json',
|
|
97
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
98
|
+
args: ['--json', 'audit', 'ship-bundle'],
|
|
99
|
+
expectedExit: 0,
|
|
100
|
+
assertJson: (json) => {
|
|
101
|
+
assert.equal(json.ok, true)
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: 'audit-secrets-json',
|
|
106
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
107
|
+
args: ['--json', 'audit', 'secrets'],
|
|
108
|
+
expectedExit: 0,
|
|
109
|
+
assertJson: (json) => {
|
|
110
|
+
assert.equal(json.ok, true)
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
id: 'audit-parity-json',
|
|
115
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
116
|
+
args: ['--json', 'audit', 'parity'],
|
|
117
|
+
expectedExit: 0,
|
|
118
|
+
assertJson: (json) => {
|
|
119
|
+
assert.equal(json.ok, true)
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
id: 'audit-baseline-dry-run',
|
|
124
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
125
|
+
args: ['--dry-run', 'audit', 'baseline'],
|
|
126
|
+
expectedExit: 0,
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
id: 'fields-sync-dry-run',
|
|
130
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
131
|
+
args: ['--dry-run', 'fields', 'sync'],
|
|
132
|
+
expectedExit: 0,
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
id: 'examples-list-json',
|
|
136
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
137
|
+
args: ['--json', 'examples', 'list'],
|
|
138
|
+
expectedExit: 0,
|
|
139
|
+
assertJson: (json) => {
|
|
140
|
+
assert.ok(Array.isArray(json.scenarios))
|
|
141
|
+
assert.ok(json.scenarios.length > 0)
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: 'examples-smoke-static-scenario',
|
|
146
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
147
|
+
args: ['examples', 'smoke', '--tier', 'static', '--scenario', 'greenfield-module-hybrid-cdn'],
|
|
148
|
+
expectedExit: 0,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'regression-smoke-skip-doctor',
|
|
152
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
153
|
+
args: ['--json', 'regression', 'smoke', '--skip-doctor'],
|
|
154
|
+
expectedExit: 0,
|
|
155
|
+
setup: (dir) => seedRegressionShims(dir),
|
|
156
|
+
assertJson: (json) => {
|
|
157
|
+
assert.equal(json.ok, true)
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: 'watch-dry-run',
|
|
162
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
163
|
+
args: ['--dry-run', 'watch', '--tier', 'dev'],
|
|
164
|
+
expectedExit: 0,
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
id: 'upload-dry-run',
|
|
168
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
169
|
+
args: ['--dry-run', 'upload', '--tier', 'dev'],
|
|
170
|
+
expectedExit: 0,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
id: 'auth-dry-run',
|
|
174
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
175
|
+
args: ['--dry-run', 'auth'],
|
|
176
|
+
expectedExit: 0,
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
id: 'portal-list-json',
|
|
180
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
181
|
+
args: ['--json', 'portal', 'list'],
|
|
182
|
+
expectedExit: 0,
|
|
183
|
+
setup: (dir) => seedHubspotConfig(dir),
|
|
184
|
+
assertJson: (json) => {
|
|
185
|
+
assert.ok(Array.isArray(json.portals))
|
|
186
|
+
assert.equal(json.portals.length, 1)
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
id: 'portal-use-dry-run',
|
|
191
|
+
fixture: 'greenfield/module-hybrid-cdn',
|
|
192
|
+
args: ['--dry-run', 'portal', 'use', 'dev'],
|
|
193
|
+
expectedExit: 0,
|
|
194
|
+
setup: (dir) => seedHubspotConfig(dir),
|
|
195
|
+
},
|
|
196
|
+
]
|
|
197
|
+
|
|
198
|
+
for (const row of MATRIX) {
|
|
199
|
+
test(`wp CLI smoke: ${row.id}`, async () => {
|
|
200
|
+
await withTempFixture(row.fixture ?? 'greenfield/module-hybrid-cdn', (dir) => {
|
|
201
|
+
row.setup?.(dir)
|
|
202
|
+
const result = runWp(dir, row.args, {
|
|
203
|
+
skipProject: row.skipProject,
|
|
204
|
+
cwd: row.cwd,
|
|
205
|
+
})
|
|
206
|
+
assertExit(row.expectedExit, result, row.id)
|
|
207
|
+
if (row.assertJson) {
|
|
208
|
+
const json = parseJsonLine(result.stdout)
|
|
209
|
+
row.assertJson(json)
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
})
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
test('wp CLI smoke: init dry-run into empty directory', () => {
|
|
216
|
+
const targetDir = mkdtempSync(join(tmpdir(), 'wphs-cli-init-'))
|
|
217
|
+
try {
|
|
218
|
+
const result = runWp(
|
|
219
|
+
kitRoot,
|
|
220
|
+
[
|
|
221
|
+
'--dry-run',
|
|
222
|
+
'init',
|
|
223
|
+
'-t',
|
|
224
|
+
'module-hybrid-cdn',
|
|
225
|
+
'-n',
|
|
226
|
+
'cli-smoke-init',
|
|
227
|
+
'-d',
|
|
228
|
+
targetDir,
|
|
229
|
+
],
|
|
230
|
+
{ skipProject: true, cwd: kitRoot },
|
|
231
|
+
)
|
|
232
|
+
assertExit(0, result, 'init-dry-run')
|
|
233
|
+
} finally {
|
|
234
|
+
rmSync(targetDir, { recursive: true, force: true })
|
|
235
|
+
}
|
|
236
|
+
})
|
|
237
|
+
|
|
238
|
+
test('wp CLI smoke: page add, list, remove', async () => {
|
|
239
|
+
await withTempFixture('greenfield/module-hybrid-cdn', (dir) => {
|
|
240
|
+
const add = runWp(dir, ['page', 'add', 'about', '--public', '--nav'])
|
|
241
|
+
assertExit(0, add, 'page-add')
|
|
242
|
+
assert.ok(existsSync(resolve(dir, 'src/features/pages/about-page.tsx')))
|
|
243
|
+
|
|
244
|
+
const list = runWp(dir, ['--json', 'page', 'list'])
|
|
245
|
+
assertExit(0, list, 'page-list')
|
|
246
|
+
const listed = parseJsonLine(list.stdout)
|
|
247
|
+
assert.equal(listed.pages.length, 1)
|
|
248
|
+
assert.equal(listed.pages[0].slug, 'about')
|
|
249
|
+
|
|
250
|
+
const remove = runWp(dir, ['page', 'remove', 'about'])
|
|
251
|
+
assertExit(0, remove, 'page-remove')
|
|
252
|
+
assert.ok(!existsSync(resolve(dir, 'src/features/pages/about-page.tsx')))
|
|
253
|
+
})
|
|
254
|
+
})
|
|
255
|
+
|
|
256
|
+
test('wp CLI smoke: scaffold auth upgrade dry-run', async () => {
|
|
257
|
+
await withTempFixture('greenfield/module-hybrid-cdn-auth-starter', (dir) => {
|
|
258
|
+
const before = readFileSync(resolve(dir, 'woodscli.json'), 'utf8')
|
|
259
|
+
const upgrade = runWp(dir, ['--dry-run', 'scaffold', 'auth', 'upgrade', '--tier', 'sso'])
|
|
260
|
+
assertExit(0, upgrade, 'scaffold-auth-upgrade-dry-run')
|
|
261
|
+
assert.equal(readFileSync(resolve(dir, 'woodscli.json'), 'utf8'), before)
|
|
262
|
+
})
|
|
263
|
+
})
|
|
@@ -20,6 +20,8 @@ import wphsAdapter from '@wphs/adapter'
|
|
|
20
20
|
export type MountGreenfieldDevOptions = {
|
|
21
21
|
/** Scaffold-owned preview (e.g. templates/src/app/StarterPage.tsx). */
|
|
22
22
|
preview?: ReactNode
|
|
23
|
+
/** Runs after module-config init, before the preview is rendered (e.g. SDK bootstrap). */
|
|
24
|
+
beforePreview?: () => void | Promise<void>
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export async function mountGreenfieldDev(options: MountGreenfieldDevOptions = {}): Promise<void> {
|
|
@@ -32,6 +34,10 @@ export async function mountGreenfieldDev(options: MountGreenfieldDevOptions = {}
|
|
|
32
34
|
syncHubSpotDataFromModuleState(moduleState)
|
|
33
35
|
registerModuleConfigShortcutHint()
|
|
34
36
|
|
|
37
|
+
if (options.beforePreview) {
|
|
38
|
+
await options.beforePreview()
|
|
39
|
+
}
|
|
40
|
+
|
|
35
41
|
if (!rootElement) {
|
|
36
42
|
throw new Error('Missing #app element — add index.html with <div id="app">')
|
|
37
43
|
}
|
|
@@ -30,17 +30,57 @@
|
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
"type": "group",
|
|
33
|
-
"name": "
|
|
34
|
-
"label": "
|
|
33
|
+
"name": "style",
|
|
34
|
+
"label": "Style",
|
|
35
35
|
"tab": "STYLE",
|
|
36
36
|
"children": [
|
|
37
37
|
{
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
38
|
+
"type": "group",
|
|
39
|
+
"name": "module_global_colors",
|
|
40
|
+
"label": "Module Global Colors",
|
|
41
|
+
"tab": "STYLE",
|
|
42
|
+
"children": [
|
|
43
|
+
{
|
|
44
|
+
"name": "primary_color",
|
|
45
|
+
"label": "Primary Color",
|
|
46
|
+
"type": "color",
|
|
47
|
+
"default": {
|
|
48
|
+
"color": "#FF7A59",
|
|
49
|
+
"opacity": 100
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "secondary_color",
|
|
54
|
+
"label": "Secondary Color",
|
|
55
|
+
"type": "color",
|
|
56
|
+
"default": {
|
|
57
|
+
"color": "#2797AF",
|
|
58
|
+
"opacity": 100
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "button_text_color",
|
|
63
|
+
"label": "Button Text Color",
|
|
64
|
+
"type": "color",
|
|
65
|
+
"default": {
|
|
66
|
+
"color": "#FFFFFF",
|
|
67
|
+
"opacity": 100
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
],
|
|
41
71
|
"default": {
|
|
42
|
-
"
|
|
43
|
-
|
|
72
|
+
"primary_color": {
|
|
73
|
+
"color": "#FF7A59",
|
|
74
|
+
"opacity": 100
|
|
75
|
+
},
|
|
76
|
+
"secondary_color": {
|
|
77
|
+
"color": "#2797AF",
|
|
78
|
+
"opacity": 100
|
|
79
|
+
},
|
|
80
|
+
"button_text_color": {
|
|
81
|
+
"color": "#FFFFFF",
|
|
82
|
+
"opacity": 100
|
|
83
|
+
}
|
|
44
84
|
}
|
|
45
85
|
},
|
|
46
86
|
{
|
|
@@ -4,7 +4,9 @@
|
|
|
4
4
|
<style>
|
|
5
5
|
{% scope_css %}
|
|
6
6
|
:root {
|
|
7
|
-
--
|
|
7
|
+
--primary-color: {{ module.style.module_global_colors.primary_color.color|default('#FF7A59') }};
|
|
8
|
+
--secondary-color: {{ module.style.module_global_colors.secondary_color.color|default('#2797AF') }};
|
|
9
|
+
--button-text-color: {{ module.style.module_global_colors.button_text_color.color|default('#FFFFFF') }};
|
|
8
10
|
}
|
|
9
11
|
p:not([class]) {
|
|
10
12
|
margin: 0;
|
|
@@ -18,11 +20,10 @@ ul, ol {
|
|
|
18
20
|
<script>
|
|
19
21
|
window.hsInEditor = {{ in_cms_editor|lower }};
|
|
20
22
|
window.hubSpotData = {
|
|
21
|
-
title: {{ module.title|tojson }},
|
|
22
|
-
tagline: {{ module.tagline|tojson }},
|
|
23
|
-
show_feature_cards: {{ module.show_feature_cards|lower }},
|
|
24
|
-
|
|
25
|
-
hero_style: {{ module.styles.hero_style|tojson }},
|
|
23
|
+
title: {{ module.content.title|default(module.title)|tojson }},
|
|
24
|
+
tagline: {{ module.content.tagline|default(module.tagline)|tojson }},
|
|
25
|
+
show_feature_cards: {{ module.content.show_feature_cards|default(module.show_feature_cards)|lower }},
|
|
26
|
+
hero_style: {{ module.style.hero_style|tojson }},
|
|
26
27
|
assetBaseUrl: "__PORTAL_CDN_BASE__",
|
|
27
28
|
buildId: "__PORTAL_BUILD_ID__",
|
|
28
29
|
isInEditor: {{ in_cms_editor|lower }}
|
|
@@ -8,6 +8,13 @@
|
|
|
8
8
|
@import 'tailwindcss';
|
|
9
9
|
@import './tailwind.css.config.css';
|
|
10
10
|
|
|
11
|
+
/* WoodsPortal module global colors — defaults until HubSpot fields / module-config apply overrides */
|
|
12
|
+
:root {
|
|
13
|
+
--primary-color: #ff7a59;
|
|
14
|
+
--secondary-color: #2797af;
|
|
15
|
+
--button-text-color: #ffffff;
|
|
16
|
+
}
|
|
17
|
+
|
|
11
18
|
/* Kit dev-module-config — paths relative to this file (src/assets/css/) */
|
|
12
19
|
@source '../../../.wphs/.kit-module-config/**/*.{ts,tsx}';
|
|
13
20
|
@source '../../../.wphs/.kit-bootstrap.tsx';
|