@woodsportal/hubspot-kit 1.0.41-dev.5 → 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
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRootRouteWithContext } from '@tanstack/react-router'
|
|
2
|
+
|
|
3
|
+
import AppLayoutWrapper from '@/components/Layouts/AppLayoutWrapper'
|
|
4
|
+
import { Provider } from '@/integrations/tanstack-query/root-provider'
|
|
5
|
+
|
|
6
|
+
export const Route = createRootRouteWithContext()({
|
|
7
|
+
component: () => (
|
|
8
|
+
<Provider>
|
|
9
|
+
<AppLayoutWrapper />
|
|
10
|
+
</Provider>
|
|
11
|
+
),
|
|
12
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterProtectedPage } from '@/features/starter/components/starter-protected-page'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/_app/portal')({
|
|
5
|
+
component: StarterProtectedPage,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'MainLayout' as const,
|
|
8
|
+
requiresAuth: true,
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createFileRoute, useRouter } from '@tanstack/react-router'
|
|
2
|
+
import Loader from '@/components/ui/loader/loader'
|
|
3
|
+
import { useSsoCallbackHandler } from '@/features/auth/use-sso-callback-handler'
|
|
4
|
+
|
|
5
|
+
function SsoCallbackPage() {
|
|
6
|
+
const router = useRouter()
|
|
7
|
+
const search = Route.useSearch()
|
|
8
|
+
const { isLoading } = useSsoCallbackHandler({ router, routeSearch: search })
|
|
9
|
+
|
|
10
|
+
if (isLoading) {
|
|
11
|
+
return <Loader text="Completing SSO sign-in…" />
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const Route = createFileRoute('/_auth/login/sso')({
|
|
18
|
+
component: SsoCallbackPage,
|
|
19
|
+
validateSearch: (search: Record<string, unknown>) => ({
|
|
20
|
+
code: typeof search.code === 'string' ? search.code : undefined,
|
|
21
|
+
state: typeof search.state === 'string' ? search.state : undefined,
|
|
22
|
+
}),
|
|
23
|
+
beforeLoad: () => ({
|
|
24
|
+
layout: 'AuthLayout' as const,
|
|
25
|
+
requiresAuth: false,
|
|
26
|
+
}),
|
|
27
|
+
})
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterLogin } from '@/features/auth/components/starter-login'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/_auth/login')({
|
|
5
|
+
component: StarterLogin,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'AuthLayout' as const,
|
|
8
|
+
requiresAuth: false,
|
|
9
|
+
}),
|
|
10
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { createFileRoute } from '@tanstack/react-router'
|
|
2
|
+
import { StarterGuidePage } from '@/features/starter/components/starter-guide-page'
|
|
3
|
+
|
|
4
|
+
export const Route = createFileRoute('/guide')({
|
|
5
|
+
component: StarterGuidePage,
|
|
6
|
+
beforeLoad: () => ({
|
|
7
|
+
layout: 'MainLayout' as const,
|
|
8
|
+
}),
|
|
9
|
+
})
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { createFileRoute, useNavigate, useRouter } from '@tanstack/react-router'
|
|
2
|
+
import { useEffect } from 'react'
|
|
3
|
+
import { Button } from '@/components/ui/Button'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { readPersistedAuthError, WP_STORAGE_KEYS } from 'woodsportal-client-sdk'
|
|
6
|
+
import { clearClientAuthSession } from '@/features/auth/clear-client-auth-session'
|
|
7
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
8
|
+
|
|
9
|
+
function Unauthorized() {
|
|
10
|
+
const router = useRouter()
|
|
11
|
+
const navigate = useNavigate()
|
|
12
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
13
|
+
const authError = readPersistedAuthError()
|
|
14
|
+
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
if (authError != null) {
|
|
17
|
+
clearClientAuthSession()
|
|
18
|
+
} else if (!inCmsEditor) {
|
|
19
|
+
router.navigate({ to: Routes.guide })
|
|
20
|
+
}
|
|
21
|
+
}, [authError, inCmsEditor, router])
|
|
22
|
+
|
|
23
|
+
useEffect(() => {
|
|
24
|
+
return () => {
|
|
25
|
+
sessionStorage.removeItem(WP_STORAGE_KEYS.c.auth.err)
|
|
26
|
+
}
|
|
27
|
+
}, [])
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<div className="flex min-h-screen items-center justify-center p-4">
|
|
31
|
+
<div className="w-full max-w-md rounded-lg border border-gray-200 bg-white p-6 text-center shadow-sm">
|
|
32
|
+
<h1 className="mb-2 text-xl font-semibold">401 Unauthorized</h1>
|
|
33
|
+
<p className="mb-6 text-sm text-gray-600">
|
|
34
|
+
{authError?.errorMessage ??
|
|
35
|
+
'Your session may have expired. Please sign in again to continue.'}
|
|
36
|
+
</p>
|
|
37
|
+
<Button className="w-full" onClick={() => navigate({ to: Routes.login })}>
|
|
38
|
+
Go to login
|
|
39
|
+
</Button>
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const Route = createFileRoute('/unauthorized')({
|
|
46
|
+
component: Unauthorized,
|
|
47
|
+
beforeLoad: () => ({
|
|
48
|
+
layout: 'UnauthorizedLayout' as const,
|
|
49
|
+
}),
|
|
50
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { isProtectedHashPath as skipCurrentPublicPath } from '@/features/auth/auth-route-paths'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { env } from '@/env'
|
|
2
|
+
|
|
3
|
+
const COOKIE_KEYS = [
|
|
4
|
+
env.VITE_LOGIN_DETAILS,
|
|
5
|
+
env.VITE_REFRESH_TOKEN,
|
|
6
|
+
env.VITE_PORTAL,
|
|
7
|
+
env.VITE_SUBSCRIPTION_TYPE,
|
|
8
|
+
env.VITE_AUTH_USER_KEY,
|
|
9
|
+
env.VITE_PAGINATION_DATA,
|
|
10
|
+
env.VITE_ROUTE_MENU_CONFIG_KEY,
|
|
11
|
+
env.VITE_ASSOCIATION_VIEW_URL_KEY,
|
|
12
|
+
env.VITE_AUTH_TOKEN_KEY,
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
export function clearClientAuthCookies(): void {
|
|
16
|
+
if (typeof document === 'undefined') {
|
|
17
|
+
return
|
|
18
|
+
}
|
|
19
|
+
for (const name of COOKIE_KEYS) {
|
|
20
|
+
document.cookie = `${name}=; Max-Age=0; path=/`
|
|
21
|
+
document.cookie = `${name}=; Max-Age=0; path=/; domain=${window.location.hostname}`
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Routes } from '@/config/routes'
|
|
2
|
+
|
|
3
|
+
export function normalizeRouterPath(path: string): string {
|
|
4
|
+
const trimmed = (path ?? '').trim()
|
|
5
|
+
if (!trimmed || trimmed === '/') {
|
|
6
|
+
return Routes.app
|
|
7
|
+
}
|
|
8
|
+
const withLeadingSlash = trimmed.startsWith('/') ? trimmed : `/${trimmed}`
|
|
9
|
+
return withLeadingSlash.replace(/\/{2,}/g, '/')
|
|
10
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react'
|
|
2
|
+
import { useRouter } from '@tanstack/react-router'
|
|
3
|
+
import Loader from '@/components/ui/loader/loader'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { isPublicAuthRoute } from '@/features/auth/auth-route-paths'
|
|
6
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
7
|
+
import { api, resolveAuthRouteAction } from '@/integrations/woodsportal-sdk'
|
|
8
|
+
import { useAuthSessionRevision } from '@/features/auth/use-portal-session'
|
|
9
|
+
import { navigateToLogin, navigateToMfaGate } from '@/features/auth/auth-navigation'
|
|
10
|
+
import { isMfaPendingSession } from '@/features/auth/auth-session'
|
|
11
|
+
|
|
12
|
+
const SESSION_RESTORE_LOADER_MS = 5_000
|
|
13
|
+
|
|
14
|
+
function redirectUnauthenticatedToLogin(
|
|
15
|
+
router: ReturnType<typeof useRouter>,
|
|
16
|
+
inCmsEditor: boolean,
|
|
17
|
+
): void {
|
|
18
|
+
const currentPath = router?.state?.location?.pathname
|
|
19
|
+
if (inCmsEditor) {
|
|
20
|
+
navigateToLogin(router)
|
|
21
|
+
return
|
|
22
|
+
}
|
|
23
|
+
const redirectPath =
|
|
24
|
+
currentPath !== Routes.login ? `?r=${router?.state?.location?.href}` : ''
|
|
25
|
+
navigateToLogin(router, `${Routes.login}${redirectPath}`)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const PrivateRoute: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
29
|
+
const router = useRouter()
|
|
30
|
+
const sessionRevision = useAuthSessionRevision()
|
|
31
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
32
|
+
const sessionRefreshExhausted = api.auth.session.isSessionRefreshExhausted?.() ?? false
|
|
33
|
+
const refreshInFlight = api.auth.session.isRefreshInFlight?.() ?? false
|
|
34
|
+
const hasRefreshHint = api.auth.session.hasRefreshSession()
|
|
35
|
+
const hasValidAccess = api.auth.session.hasValidAccessToken()
|
|
36
|
+
|
|
37
|
+
const sessionRestoring =
|
|
38
|
+
!sessionRefreshExhausted && refreshInFlight && hasRefreshHint && !hasValidAccess
|
|
39
|
+
|
|
40
|
+
const [restoreLoaderTimedOut, setRestoreLoaderTimedOut] = useState(false)
|
|
41
|
+
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
if (!sessionRestoring) {
|
|
44
|
+
setRestoreLoaderTimedOut(false)
|
|
45
|
+
return
|
|
46
|
+
}
|
|
47
|
+
const id = window.setTimeout(() => setRestoreLoaderTimedOut(true), SESSION_RESTORE_LOADER_MS)
|
|
48
|
+
return () => window.clearTimeout(id)
|
|
49
|
+
}, [sessionRestoring])
|
|
50
|
+
|
|
51
|
+
const effectiveSessionRestoring = sessionRestoring && !restoreLoaderTimedOut
|
|
52
|
+
|
|
53
|
+
const routeAction = useMemo(() => {
|
|
54
|
+
const currentPath = router?.state?.location?.pathname
|
|
55
|
+
const session = api.auth.session.contract()
|
|
56
|
+
return resolveAuthRouteAction({
|
|
57
|
+
pathname: currentPath,
|
|
58
|
+
isPublicAuthRoute,
|
|
59
|
+
session: {
|
|
60
|
+
...session,
|
|
61
|
+
isMfaPending: () => isMfaPendingSession(),
|
|
62
|
+
},
|
|
63
|
+
mfaRoute: Routes.twoFa,
|
|
64
|
+
previewMode: false,
|
|
65
|
+
sessionRestoring: effectiveSessionRestoring,
|
|
66
|
+
sessionRefreshExhausted,
|
|
67
|
+
})
|
|
68
|
+
}, [
|
|
69
|
+
router,
|
|
70
|
+
sessionRefreshExhausted,
|
|
71
|
+
effectiveSessionRestoring,
|
|
72
|
+
sessionRevision,
|
|
73
|
+
refreshInFlight,
|
|
74
|
+
hasRefreshHint,
|
|
75
|
+
hasValidAccess,
|
|
76
|
+
])
|
|
77
|
+
|
|
78
|
+
useEffect((): void => {
|
|
79
|
+
if (routeAction.kind === 'redirect_mfa') {
|
|
80
|
+
navigateToMfaGate(router)
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
if (
|
|
84
|
+
routeAction.kind === 'redirect_login' ||
|
|
85
|
+
(routeAction.kind === 'show_loader' && restoreLoaderTimedOut)
|
|
86
|
+
) {
|
|
87
|
+
redirectUnauthenticatedToLogin(router, inCmsEditor)
|
|
88
|
+
}
|
|
89
|
+
}, [routeAction, router, inCmsEditor, restoreLoaderTimedOut])
|
|
90
|
+
|
|
91
|
+
if (routeAction.kind === 'allow') {
|
|
92
|
+
return <>{children}</>
|
|
93
|
+
}
|
|
94
|
+
if (routeAction.kind === 'show_loader' && !restoreLoaderTimedOut) {
|
|
95
|
+
return <Loader showText={false} />
|
|
96
|
+
}
|
|
97
|
+
return null
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export default PrivateRoute
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React, { useLayoutEffect } from 'react'
|
|
2
|
+
import { useRouter, useRouterState } from '@tanstack/react-router'
|
|
3
|
+
import Loader from '@/components/ui/loader/loader'
|
|
4
|
+
import { Routes } from '@/config/routes'
|
|
5
|
+
import { isPublicAuthRoute } from '@/features/auth/auth-route-paths'
|
|
6
|
+
import {
|
|
7
|
+
isRouterAtPath,
|
|
8
|
+
navigateAfterFullAuth,
|
|
9
|
+
navigateToLogin,
|
|
10
|
+
navigateToMfaGate,
|
|
11
|
+
} from '@/features/auth/auth-navigation'
|
|
12
|
+
import { resolvePostLoginPath } from '@/features/auth/resolve-post-login-path'
|
|
13
|
+
import {
|
|
14
|
+
useAuthSessionRevision,
|
|
15
|
+
useIsMfaPendingSession,
|
|
16
|
+
usePortalSession,
|
|
17
|
+
} from '@/features/auth/use-portal-session'
|
|
18
|
+
import { isHubSpotCmsEditor } from '@/hubspot/is-cms-editor'
|
|
19
|
+
|
|
20
|
+
const PublicRoute: React.FC<{ children?: React.ReactNode }> = ({ children }) => {
|
|
21
|
+
const router = useRouter()
|
|
22
|
+
const routeState = useRouterState()
|
|
23
|
+
const currentRoute = routeState.location.pathname
|
|
24
|
+
const isAuthenticated = usePortalSession()
|
|
25
|
+
const isMfaPending = useIsMfaPendingSession()
|
|
26
|
+
const sessionRevision = useAuthSessionRevision()
|
|
27
|
+
const inCmsEditor = isHubSpotCmsEditor()
|
|
28
|
+
const postLoginTarget = resolvePostLoginPath(router)
|
|
29
|
+
|
|
30
|
+
useLayoutEffect(() => {
|
|
31
|
+
const isPublicPath = isPublicAuthRoute(currentRoute)
|
|
32
|
+
|
|
33
|
+
if (isMfaPending && currentRoute !== Routes.twoFa) {
|
|
34
|
+
navigateToMfaGate(router)
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!isAuthenticated && !isMfaPending && !isPublicPath) {
|
|
39
|
+
navigateToLogin(router)
|
|
40
|
+
return
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (isAuthenticated && isPublicPath && !(inCmsEditor && currentRoute === Routes.twoFa)) {
|
|
44
|
+
navigateAfterFullAuth(router)
|
|
45
|
+
}
|
|
46
|
+
}, [router, isAuthenticated, isMfaPending, inCmsEditor, currentRoute, sessionRevision])
|
|
47
|
+
|
|
48
|
+
if (isMfaPending) {
|
|
49
|
+
return currentRoute === Routes.twoFa ? <>{children}</> : <Loader showText={false} />
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (isAuthenticated && isPublicAuthRoute(currentRoute)) {
|
|
53
|
+
return isRouterAtPath(router, postLoginTarget) ? <>{children}</> : <Loader showText={false} />
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!isAuthenticated) {
|
|
57
|
+
return <>{children}</>
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Authenticated on a general public page (e.g. /guide) — no redirect gate.
|
|
61
|
+
return <>{children}</>
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export default PublicRoute
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { env } from '@/env'
|
|
2
|
+
|
|
3
|
+
type HubSpotRuntimeData = {
|
|
4
|
+
developerOption?: boolean
|
|
5
|
+
developerOptionTempUrl?: string
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type HubSpotRuntimeWindow = Window & {
|
|
9
|
+
hubSpotData?: HubSpotRuntimeData
|
|
10
|
+
/** Module-config live exports in `wp dev` / `yarn local` (see wphs.adapter.ts). */
|
|
11
|
+
__WPHS_DATA__?: HubSpotRuntimeData
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function readHubSpotRuntimeData(): HubSpotRuntimeData | undefined {
|
|
15
|
+
if (typeof window === 'undefined') {
|
|
16
|
+
return undefined
|
|
17
|
+
}
|
|
18
|
+
const win = window as HubSpotRuntimeWindow
|
|
19
|
+
return win.hubSpotData ?? win.__WPHS_DATA__
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* API host for woodsportal-client-sdk.
|
|
24
|
+
* Priority: developer temp URL (HubSpot embed) → `VITE_PUBLIC_REST_API_ENDPOINT`.
|
|
25
|
+
* WoodsCLI dev (`__WPHS_DATA__` without HubL `hubSpotData`) always uses the Vite env URL.
|
|
26
|
+
*/
|
|
27
|
+
export function resolveWoodsPortalApiBaseUrl(
|
|
28
|
+
hubSpotData: HubSpotRuntimeData | undefined = readHubSpotRuntimeData(),
|
|
29
|
+
): string {
|
|
30
|
+
const envApi = env.VITE_PUBLIC_REST_API_ENDPOINT
|
|
31
|
+
|
|
32
|
+
if (import.meta.env.DEV && typeof window !== 'undefined') {
|
|
33
|
+
const win = window as HubSpotRuntimeWindow
|
|
34
|
+
if (win.__WPHS_DATA__ != null && win.hubSpotData == null) {
|
|
35
|
+
return envApi
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (hubSpotData?.developerOption === true && hubSpotData.developerOptionTempUrl) {
|
|
40
|
+
return hubSpotData.developerOptionTempUrl
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return envApi
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type SafeAuthRouter = {
|
|
2
|
+
navigate: (opts: { to: string; replace?: boolean }) => void | Promise<void>
|
|
3
|
+
history?: { replace: (path: string) => unknown }
|
|
4
|
+
state?: { location?: { pathname?: string; href?: string } }
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export const NAVIGATION_WAIT_MS = 2500
|
|
8
|
+
|
|
9
|
+
const PATHNAME_VERIFY_DELAY_MS = 100
|
|
10
|
+
|
|
11
|
+
export function hashPath(path: string): string {
|
|
12
|
+
const trimmed = (path ?? '').trim()
|
|
13
|
+
if (!trimmed) {
|
|
14
|
+
return '#/'
|
|
15
|
+
}
|
|
16
|
+
if (trimmed.startsWith('#')) {
|
|
17
|
+
return trimmed
|
|
18
|
+
}
|
|
19
|
+
return trimmed.startsWith('/') ? `#${trimmed}` : `#/${trimmed}`
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function syncHashToPath(path: string): void {
|
|
23
|
+
if (typeof window === 'undefined') {
|
|
24
|
+
return
|
|
25
|
+
}
|
|
26
|
+
const expectedHash = hashPath(path)
|
|
27
|
+
if (window.location.hash !== expectedHash) {
|
|
28
|
+
window.location.hash = expectedHash
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function raceNavigation(
|
|
33
|
+
router: SafeAuthRouter,
|
|
34
|
+
target: string,
|
|
35
|
+
timeoutMs: number = NAVIGATION_WAIT_MS,
|
|
36
|
+
): Promise<void> {
|
|
37
|
+
await Promise.race([
|
|
38
|
+
Promise.resolve(router.navigate({ to: target, replace: true })).catch(() => undefined),
|
|
39
|
+
new Promise<void>((resolve) => window.setTimeout(resolve, timeoutMs)),
|
|
40
|
+
])
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export async function historyReplaceFirstNavigate(
|
|
44
|
+
router: SafeAuthRouter,
|
|
45
|
+
target: string,
|
|
46
|
+
): Promise<void> {
|
|
47
|
+
const normalized = target.trim()
|
|
48
|
+
if (!normalized) {
|
|
49
|
+
return
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
router.history?.replace(normalized)
|
|
53
|
+
} catch {
|
|
54
|
+
// fall through
|
|
55
|
+
}
|
|
56
|
+
await raceNavigation(router, normalized, NAVIGATION_WAIT_MS)
|
|
57
|
+
syncHashToPath(normalized)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function hardReplaceToHashPath(target: string): void {
|
|
61
|
+
if (typeof window === 'undefined') {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
const hash = hashPath(target)
|
|
65
|
+
window.location.replace(`${window.location.pathname}${hash}`)
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function readRouterPathname(router: SafeAuthRouter): string {
|
|
69
|
+
return router.state?.location?.pathname ?? ''
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function readHashPathname(): string {
|
|
73
|
+
if (typeof window === 'undefined') {
|
|
74
|
+
return ''
|
|
75
|
+
}
|
|
76
|
+
const raw = window.location.hash.replace(/^#/, '').split('?')[0]
|
|
77
|
+
return raw || '/'
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function safeRouterReplace(router: SafeAuthRouter, path: string): void {
|
|
81
|
+
void historyReplaceFirstNavigate(router, path.trim())
|
|
82
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"jsx": "react-jsx",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ES2022", "DOM", "DOM.Iterable"],
|
|
7
|
+
"types": ["vite/client"],
|
|
8
|
+
"moduleResolution": "bundler",
|
|
9
|
+
"allowImportingTsExtensions": true,
|
|
10
|
+
"verbatimModuleSyntax": true,
|
|
11
|
+
"noEmit": true,
|
|
12
|
+
"skipLibCheck": true,
|
|
13
|
+
"strict": true,
|
|
14
|
+
"baseUrl": ".",
|
|
15
|
+
"paths": {
|
|
16
|
+
"@/*": ["./src/*"]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts", "src/**/*.tsx", "wphs.adapter.ts"]
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.cdn-app.mjs'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.cdn-esm.mjs'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.cdn-vendor.mjs'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.dev.mjs'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.hubspot.mjs'
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { dirname, resolve } from 'node:path'
|
|
2
|
+
import { fileURLToPath } from 'node:url'
|
|
3
|
+
|
|
4
|
+
if (!process.env.WP_HS_PROJECT_ROOT?.trim()) {
|
|
5
|
+
process.env.WP_HS_PROJECT_ROOT = resolve(dirname(fileURLToPath(import.meta.url)))
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { default } from '@woodsportal/hubspot-kit/vite/vite.config.monolith.mjs'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"configVersion": 1,
|
|
3
|
+
"projectType": "module-hybrid-cdn",
|
|
4
|
+
"module": {
|
|
5
|
+
"name": "module-hybrid-cdn-auth-sso",
|
|
6
|
+
"uploadPath": "dw-modules/module-hybrid-cdn-auth-sso.module",
|
|
7
|
+
"outDir": "dist/ModuleHybridCdnAuthSso.Module"
|
|
8
|
+
},
|
|
9
|
+
"cdn": {
|
|
10
|
+
"mode": "jsdelivr",
|
|
11
|
+
"buildIdFile": ".module-build-id",
|
|
12
|
+
"mirror": "portal.cdn.json"
|
|
13
|
+
},
|
|
14
|
+
"entries": {
|
|
15
|
+
"app": "src/cdn/app-entry.ts",
|
|
16
|
+
"vendor": "src/cdn/vendor-entry.ts",
|
|
17
|
+
"hubspotBootstrap": "src/hubspot/bootstrap.ts",
|
|
18
|
+
"module": "src/hubspot/module-entry.tsx",
|
|
19
|
+
"localDev": "src/main.tsx"
|
|
20
|
+
},
|
|
21
|
+
"env": {
|
|
22
|
+
"tiers": [
|
|
23
|
+
"dev",
|
|
24
|
+
"stg",
|
|
25
|
+
"prod"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"dev": {
|
|
29
|
+
"moduleConfigDir": ".wphs",
|
|
30
|
+
"adapter": "./wphs.adapter.ts",
|
|
31
|
+
"fieldsJson": "public/fields.json"
|
|
32
|
+
},
|
|
33
|
+
"scaffold": {
|
|
34
|
+
"router": "hash",
|
|
35
|
+
"auth": "sso",
|
|
36
|
+
"nav": "top"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Production CDN build — copy to .env.prod (or run wp setup)
|
|
2
|
+
VITE_NODE_ENV=prod
|
|
3
|
+
VITE_PORTAL_EMBED_MODE=cdn
|
|
4
|
+
VITE_PUBLIC_REST_API_ENDPOINT=https://api.woodsportal.com
|
|
5
|
+
# PORTAL_CDN_PUBLISH_TOKEN is written to .env.local by wp init / wp setup (hybrid CDN) — gitignored
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# WoodsCLI workspace (.wphs/)
|
|
2
|
+
|
|
3
|
+
Local state for **WoodsCLI** (`@woodsportal/hubspot-kit`). Not shipped to HubSpot.
|
|
4
|
+
|
|
5
|
+
| Path | Purpose |
|
|
6
|
+
|------|---------|
|
|
7
|
+
| `config/module-config.local.json` | Live Content/Styles values (gitignored) |
|
|
8
|
+
| `config/module-config.example.json` | Example generated from `fields.json` |
|
|
9
|
+
| `assets/branding/` | Dev-tool uploaded images (gitignored) |
|
|
10
|
+
| `fixtures/` | Optional preview / hubspot-data overrides |
|
|
11
|
+
| `cache/` | CLI caches (gitignored) |
|
|
12
|
+
| `audit/baseline/` | Build parity snapshots (gitignored) |
|
|
13
|
+
| `.kit-module-config` | Symlink to kit dev-module-config |
|
|
14
|
+
| `.kit-bootstrap.tsx` | Symlink to kit dev bootstrap (full portal) |
|
|
15
|
+
| `.kit-bootstrap-greenfield.tsx` | Symlink to kit greenfield dev bootstrap |
|
|
16
|
+
|
|
17
|
+
Run `wp doctor` to recreate missing folders.
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Getting started
|
|
2
|
+
|
|
3
|
+
This project was scaffolded with **WoodsCLI** (`@woodsportal/hubspot-kit`).
|
|
4
|
+
|
|
5
|
+
## Daily dev
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn install
|
|
9
|
+
wp doctor
|
|
10
|
+
wp dev
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Open the local URL, then **Ctrl+Shift+Z** (Mac **⌃⇧Z**) to edit module fields. Click **Apply changes** to refresh the starter preview.
|
|
14
|
+
|
|
15
|
+
## Routing (`wp init`)
|
|
16
|
+
|
|
17
|
+
Default is **hash history** — same as `woodsportal-client-frontend` (`#/guide` URLs work in HubSpot CMS).
|
|
18
|
+
|
|
19
|
+
| `wp init --router` | Behavior |
|
|
20
|
+
|--------------------|----------|
|
|
21
|
+
| `hash` (default) | `createHashHistory()` — production-safe in HubSpot embeds |
|
|
22
|
+
| `browser` | Clean `/guide` URLs for local dev only |
|
|
23
|
+
| `none` | Single-page starter, no TanStack Router |
|
|
24
|
+
|
|
25
|
+
Recorded in `woodscli.json` → `scaffold.router`.
|
|
26
|
+
|
|
27
|
+
## `src/` layout
|
|
28
|
+
|
|
29
|
+
| Path | Purpose |
|
|
30
|
+
|------|---------|
|
|
31
|
+
| `main.tsx` | Dev entry — loads styles and `mountDevPreview()` |
|
|
32
|
+
| `app.tsx` | `RouterProvider` shell (client-frontend pattern) |
|
|
33
|
+
| `config/router.ts` | Hash vs browser history |
|
|
34
|
+
| `portal/` | Dev vs production mount (`mount-dev-preview`, `mount-portal`) |
|
|
35
|
+
| `routes/` | TanStack file routes — keep thin; import from `features/` |
|
|
36
|
+
| `features/starter/` | Demo home + developer guide (replace with your app) |
|
|
37
|
+
| `components/` | Shared layout and UI |
|
|
38
|
+
| `integrations/` | Router and third-party wiring |
|
|
39
|
+
| `hubspot/` | HubSpot types and dev fixtures |
|
|
40
|
+
| `config/` | Route constants and app config |
|
|
41
|
+
| `assets/css/` | Tailwind entry for local dev |
|
|
42
|
+
|
|
43
|
+
Kit runtime expects `src/defaultData.ts` (re-exports `hubspot/default-data.ts`).
|
|
44
|
+
|
|
45
|
+
## Docs (in the kit package)
|
|
46
|
+
|
|
47
|
+
After `npm install`, see:
|
|
48
|
+
|
|
49
|
+
- `node_modules/@woodsportal/hubspot-kit/docs/CLI-REFERENCE.md`
|
|
50
|
+
- `node_modules/@woodsportal/hubspot-kit/docs/MODULES.md`
|
|
51
|
+
- `node_modules/@woodsportal/hubspot-kit/docs/HUBSPOT-CLI-SETUP.md`
|
|
52
|
+
|
|
53
|
+
## HubSpot upload
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
cp hubspot.config.yml.example hubspot.config.yml
|
|
57
|
+
# add portal + personal access key
|
|
58
|
+
wp upload
|
|
59
|
+
```
|