@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
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
### Portal auth scaffold
|
|
6
|
+
- **`wp init --auth`** — tiered portal login scaffold: `none` \| `starter` (email/password) \| `sso` \| `full` (SSO + MFA)
|
|
7
|
+
- **Interactive `wp init` wizard** — sequential prompts: type → name → router → auth → CDN → confirm
|
|
8
|
+
- **`templates/scaffold/auth/`** — layered `_shared`, `_sso`, `_full` files merged at init; `woodscli.json` records `scaffold.auth`
|
|
9
|
+
- **Greenfield examples** — `examples/greenfield/module-hybrid-cdn-auth-{starter,sso,full}`
|
|
10
|
+
- **Docs** — [AUTH-SCAFFOLD.md](./docs/AUTH-SCAFFOLD.md); README scaffold matrix and two-auth concepts
|
|
11
|
+
|
|
5
12
|
### CI / CodeBuild
|
|
6
13
|
- **`woodsportal-<env>-cb-hubspot-kit-publish`** — `hubspot-kit-npm.yml` runs `npm run verify` then publishes `@woodsportal/hubspot-kit` (`next` on `dev`, `latest` on `main`). Client-frontend node-push installs kit from npm via `HUBSPOT_KIT_NPM_TAG` override.
|
|
7
14
|
|
package/README.md
CHANGED
|
@@ -1,207 +1,250 @@
|
|
|
1
1
|
# WoodsCLI
|
|
2
2
|
|
|
3
|
-
**HubSpot CMS dev kit by WoodsPortal** — local preview, module field editing, Vite
|
|
3
|
+
**HubSpot CMS dev kit by WoodsPortal** — scaffold modules and themes, local preview, module field editing, Vite builds, and HubSpot upload/watch.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm i -D @woodsportal/hubspot-kit
|
|
6
|
+
npm i -D @woodsportal/hubspot-kit
|
|
7
7
|
npx wp --version
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
The `wp` CLI wraps [`@hubspot/cli`](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cli)
|
|
10
|
+
The `wp` CLI wraps [`@hubspot/cli`](https://developers.hubspot.com/docs/cms/developer-reference/local-development-cli) and adds WoodsPortal tooling: hybrid CDN or monolith builds, the **module-config overlay** (**Ctrl+Shift+Z**), optional **portal auth scaffold** (`woodsportal-client-sdk`), and a `.wphs/` workspace.
|
|
11
|
+
|
|
12
|
+
**Not for HubSpot UI extensions** — see [woods-portal-ui-card](https://github.com/Digital-Woods/digitalwoods.io-woods-portal-ui-card).
|
|
11
13
|
|
|
12
14
|
---
|
|
13
15
|
|
|
14
|
-
##
|
|
16
|
+
## Choose your path
|
|
15
17
|
|
|
16
|
-
|
|
|
17
|
-
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
| Full
|
|
22
|
-
| Project health check | `wp doctor` |
|
|
23
|
-
| Portal switching | `wp portal use` |
|
|
24
|
-
| CI / regression gates | `wp examples smoke`, `wp regression smoke`, `wp audit *` |
|
|
25
|
-
|
|
26
|
-
**Reference implementation:** [woodsportal-client-frontend](https://github.com/Digital-Woods/digitalwoods.io-woodsportal-client-frontend) — advanced hybrid CDN module with a full app adapter.
|
|
18
|
+
| You are… | Start here |
|
|
19
|
+
|----------|------------|
|
|
20
|
+
| New HubSpot CMS **module** (React portal) | [Quick start](#quick-start-greenfield) below |
|
|
21
|
+
| New **theme** | `wp init -t theme-starter` → [THEMES.md](./docs/THEMES.md) |
|
|
22
|
+
| Existing module / artifact folder | [Existing repository](#existing-repository) |
|
|
23
|
+
| Full production portal (reference) | [woodsportal-client-frontend](https://github.com/Digital-Woods/digitalwoods.io-woodsportal-client-frontend) |
|
|
27
24
|
|
|
28
25
|
---
|
|
29
26
|
|
|
30
|
-
##
|
|
27
|
+
## Scaffold matrix (`wp init`)
|
|
31
28
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
|
35
|
-
|
|
|
36
|
-
|
|
|
37
|
-
|
|
|
29
|
+
| Template | Router | Auth tier | You get |
|
|
30
|
+
|----------|--------|-----------|---------|
|
|
31
|
+
| `module-hybrid-cdn` | `hash` (default) | `none` | React SPA + TanStack routes + starter pages |
|
|
32
|
+
| `module-hybrid-cdn` | `hash` | `starter` | + email/password login + protected `/portal` sample |
|
|
33
|
+
| `module-hybrid-cdn` | `hash` | `sso` | + SSO OAuth callback |
|
|
34
|
+
| `module-hybrid-cdn` | `hash` | `full` | + MFA (production portals) |
|
|
35
|
+
| `module-monolith` | … | … | Same auth tiers, single `module.js` bundle |
|
|
36
|
+
| `theme-starter` | — | — | HubL theme only (no portal auth) |
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
Bare **`wp init`** runs an interactive wizard: project type → name → router → portal auth → CDN mirror (hybrid) → confirm.
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
### Auth tier examples (full commands)
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
Use **`module-hybrid-cdn`** + **`--router hash`** for all portal auth tiers. HubSpot upload auth (`wp auth`) is separate from portal login — run it when you need Design Manager upload/watch.
|
|
44
43
|
|
|
45
|
-
**
|
|
44
|
+
**No portal auth** (`scaffold.auth: none`) — routes and starter pages only; no `woodsportal-client-sdk` login UI:
|
|
46
45
|
|
|
47
46
|
```bash
|
|
48
|
-
npx wp init -t module-hybrid-cdn -n my-
|
|
49
|
-
cd my-
|
|
47
|
+
npx wp init -t module-hybrid-cdn -n my-module-no-auth --router hash --auth none -y
|
|
48
|
+
cd my-module-no-auth
|
|
49
|
+
npm install # or: touch yarn.lock && yarn install
|
|
50
|
+
wp setup
|
|
51
|
+
wp doctor
|
|
52
|
+
wp dev # http://localhost:3000/#/guide
|
|
50
53
|
```
|
|
51
54
|
|
|
52
|
-
**
|
|
55
|
+
**Starter auth** (`scaffold.auth: starter`) — email + password login, protected `/portal` sample:
|
|
53
56
|
|
|
54
57
|
```bash
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
npx wp init -t module-hybrid-cdn -n my-portal-starter --router hash --auth starter -y
|
|
59
|
+
cd my-portal-starter
|
|
60
|
+
npm install
|
|
61
|
+
wp setup
|
|
62
|
+
# Edit .env.local — API base URL (required); optional dev portal context:
|
|
63
|
+
# VITE_PUBLIC_REST_API_ENDPOINT=https://api.dev.woodsportal.com
|
|
64
|
+
# VITE_DEV_PORTAL_ID=<portal-id>
|
|
65
|
+
wp doctor
|
|
66
|
+
wp dev
|
|
67
|
+
# Sign in: http://localhost:3000/#/login → redirects to /portal
|
|
57
68
|
```
|
|
58
69
|
|
|
59
|
-
|
|
70
|
+
**SSO auth** (`scaffold.auth: sso`) — starter login + `/login/sso` OAuth callback:
|
|
60
71
|
|
|
61
|
-
|
|
72
|
+
```bash
|
|
73
|
+
npx wp init -t module-hybrid-cdn -n my-portal-sso --router hash --auth sso -y
|
|
74
|
+
cd my-portal-sso
|
|
75
|
+
npm install
|
|
76
|
+
wp setup
|
|
77
|
+
# Same .env.local as starter (API URL + optional VITE_DEV_PORTAL_ID)
|
|
78
|
+
wp doctor
|
|
79
|
+
wp dev
|
|
80
|
+
# Password login: /#/login | SSO return path: /#/login/sso
|
|
81
|
+
```
|
|
62
82
|
|
|
63
|
-
|
|
83
|
+
**Full auth** (`scaffold.auth: full`) — SSO + MFA (`/two-fa`); recommended for production-shaped portals:
|
|
64
84
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
85
|
+
```bash
|
|
86
|
+
npx wp init -t module-hybrid-cdn -n my-portal-full --router hash --auth full -y
|
|
87
|
+
cd my-portal-full
|
|
88
|
+
npm install
|
|
89
|
+
wp setup
|
|
90
|
+
# Same .env.local as starter
|
|
91
|
+
wp doctor
|
|
92
|
+
wp dev
|
|
93
|
+
# Login + MFA: /#/login → /#/two-fa when hub requires MFA
|
|
94
|
+
```
|
|
70
95
|
|
|
71
|
-
|
|
96
|
+
| Tier | `woodscli.json` | Routes added (beyond `none`) |
|
|
97
|
+
|------|-----------------|------------------------------|
|
|
98
|
+
| `none` | `"auth": "none"` | `/guide` only (no `/login`) |
|
|
99
|
+
| `starter` | `"auth": "starter"` | `/login`, protected `/portal` |
|
|
100
|
+
| `sso` | `"auth": "sso"` | + `/login/sso` |
|
|
101
|
+
| `full` | `"auth": "full"` | + `/two-fa`, MFA storage |
|
|
72
102
|
|
|
73
|
-
|
|
103
|
+
Monolith template: swap `-t module-hybrid-cdn` for `-t module-monolith` (same `--auth` flags). Details: [AUTH-SCAFFOLD.md](./docs/AUTH-SCAFFOLD.md).
|
|
74
104
|
|
|
75
|
-
|
|
105
|
+
**Sidebar navigation** (`scaffold.nav: sidebar`) — collapsible left menu instead of top header links (requires auth ≠ `none`):
|
|
76
106
|
|
|
77
107
|
```bash
|
|
78
|
-
npx wp init -t module-hybrid-cdn -n my-portal-
|
|
79
|
-
|
|
108
|
+
npx wp init -t module-hybrid-cdn -n my-portal-sidebar --router hash --auth starter --nav sidebar -y
|
|
109
|
+
```
|
|
80
110
|
|
|
81
|
-
|
|
82
|
-
wp doctor # Node, config, .wphs/, HubSpot CLI
|
|
83
|
-
wp auth # HubSpot login — updates hubspot.config.yml
|
|
84
|
-
wp portal use # interactive default portal (or: wp portal use <name>)
|
|
111
|
+
Default nav shell is **top** (`scaffold.nav: top`). Edit `src/config/portal-nav.ts` to add menu items — both layouts read the same file.
|
|
85
112
|
|
|
86
|
-
|
|
87
|
-
```
|
|
113
|
+
### Navigation by auth tier
|
|
88
114
|
|
|
89
|
-
|
|
115
|
+
| Auth | Nav file | Shell |
|
|
116
|
+
|------|----------|-------|
|
|
117
|
+
| `none` | `src/config/starter-nav.ts` | `StarterNav` in root layout |
|
|
118
|
+
| `starter`+ | `src/config/portal-nav.ts` | `MainLayout` (top or sidebar) |
|
|
90
119
|
|
|
91
|
-
|
|
120
|
+
`wp init --nav` chooses the **layout shell** (auth only). `wp page add --nav` adds a **menu link** to the nav file for your tier.
|
|
92
121
|
|
|
93
|
-
|
|
122
|
+
**Add pages after init:**
|
|
94
123
|
|
|
95
124
|
```bash
|
|
96
|
-
wp
|
|
97
|
-
wp
|
|
98
|
-
wp
|
|
125
|
+
wp page add settings --protected --nav
|
|
126
|
+
wp page add about --public
|
|
127
|
+
wp page list
|
|
128
|
+
wp page remove about
|
|
99
129
|
```
|
|
100
130
|
|
|
101
|
-
|
|
131
|
+
**Upgrade scaffold on existing projects:**
|
|
102
132
|
|
|
103
|
-
|
|
133
|
+
```bash
|
|
134
|
+
wp scaffold auth upgrade --tier sso
|
|
135
|
+
wp scaffold nav --mode sidebar
|
|
136
|
+
```
|
|
104
137
|
|
|
105
138
|
---
|
|
106
139
|
|
|
107
|
-
##
|
|
140
|
+
## Two auth concepts
|
|
108
141
|
|
|
109
|
-
|
|
142
|
+
| | HubSpot CLI auth | Portal user auth |
|
|
143
|
+
|--|------------------|------------------|
|
|
144
|
+
| **Commands** | `wp auth`, `wp portal use` | `wp init --auth starter\|sso\|full` |
|
|
145
|
+
| **Config** | `hubspot.config.yml` | `woodscli.json` → `scaffold.auth`, `scaffold.nav`, `.env.*` API URL |
|
|
146
|
+
| **Purpose** | Upload/watch to Design Manager | End users log in via **woodsportal-api** + SDK |
|
|
110
147
|
|
|
111
|
-
|
|
112
|
-
wp dev # Vite HMR + module-config overlay
|
|
113
|
-
wp dev -p 3001 # custom port
|
|
114
|
-
```
|
|
148
|
+
See [HUBSPOT-CLI-SETUP.md](./docs/HUBSPOT-CLI-SETUP.md) and [AUTH-SCAFFOLD.md](./docs/AUTH-SCAFFOLD.md).
|
|
115
149
|
|
|
116
|
-
|
|
150
|
+
---
|
|
117
151
|
|
|
118
|
-
|
|
119
|
-
wp watch # hs cms watch on module.outDir (builds if output missing)
|
|
120
|
-
wp watch --rebuild # rebuild on src/ + public/ changes, then watch
|
|
121
|
-
```
|
|
152
|
+
## What you get
|
|
122
153
|
|
|
123
|
-
|
|
154
|
+
| Capability | Command / artifact |
|
|
155
|
+
|------------|-------------------|
|
|
156
|
+
| Scaffold module or theme | `wp init` (`--template`, `--router`, `--auth`) |
|
|
157
|
+
| Local SPA + field editor | `wp dev` (`wp local`) |
|
|
158
|
+
| HubSpot file sync | `wp watch`, `wp upload` |
|
|
159
|
+
| Full ship pipeline | `wp deploy` (build → CDN publish → upload) |
|
|
160
|
+
| Project health check | `wp doctor` |
|
|
161
|
+
| CI / regression gates | `wp examples smoke`, `wp regression smoke` |
|
|
124
162
|
|
|
125
|
-
|
|
163
|
+
---
|
|
126
164
|
|
|
127
|
-
|
|
128
|
-
wp build # default --tier dev
|
|
129
|
-
wp build --cdn-only # hybrid CDN chunks only
|
|
130
|
-
wp build --hubspot-only # module bundle only (monolith-friendly)
|
|
165
|
+
## Prerequisites
|
|
131
166
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
167
|
+
| Requirement | Notes |
|
|
168
|
+
|-------------|--------|
|
|
169
|
+
| **Node.js 20+** | Enforced by `wp doctor` |
|
|
170
|
+
| **HubSpot CLI** | `npm i -g @hubspot/cli` — upload/watch/deploy |
|
|
171
|
+
| **HubSpot CMS portal** | Design Manager; `wp auth` for upload |
|
|
172
|
+
| **woodscli.json** | Created by `wp init` |
|
|
136
173
|
|
|
137
|
-
|
|
174
|
+
Local preview runs without HubSpot credentials. Portal auth tiers need `VITE_PUBLIC_REST_API_ENDPOINT` after `wp setup`.
|
|
138
175
|
|
|
139
176
|
---
|
|
140
177
|
|
|
141
|
-
##
|
|
178
|
+
## Quick start (greenfield)
|
|
142
179
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
180
|
+
```bash
|
|
181
|
+
npx wp init -t module-hybrid-cdn -n my-portal --router hash --auth full -y
|
|
182
|
+
cd my-portal && npm install
|
|
183
|
+
|
|
184
|
+
wp setup # hubspot.config.yml, .env.*, vite shims
|
|
185
|
+
wp doctor
|
|
186
|
+
wp auth # HubSpot CMS (upload) — not portal login
|
|
187
|
+
wp dev # http://localhost:3000
|
|
188
|
+
```
|
|
146
189
|
|
|
147
|
-
|
|
190
|
+
**Module overlay:** **Ctrl+Shift+Z** / **Cmd+Shift+Z** — edit Content/Styles fields.
|
|
148
191
|
|
|
149
|
-
|
|
192
|
+
Password-only portal: `--auth starter`. Details: [AUTH-SCAFFOLD.md](./docs/AUTH-SCAFFOLD.md).
|
|
150
193
|
|
|
151
194
|
---
|
|
152
195
|
|
|
153
|
-
##
|
|
196
|
+
## Existing repository
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
wp setup
|
|
200
|
+
wp migrate --yes # legacy .dev/ or woodsportal.hs.json
|
|
201
|
+
wp doctor
|
|
202
|
+
```
|
|
154
203
|
|
|
155
|
-
|
|
204
|
+
Legacy **`<name>.module/`** folders: add `woodscli.json` manually → [MODULES.md](./docs/MODULES.md).
|
|
156
205
|
|
|
157
|
-
|
|
206
|
+
---
|
|
158
207
|
|
|
159
|
-
|
|
160
|
-
|---------|-------------|
|
|
161
|
-
| `wp init [-t template] [-n name] [--router hash\|browser\|none]` | Scaffold `module-hybrid-cdn`, `module-monolith`, or `theme-starter` |
|
|
162
|
-
| `wp migrate` | Move legacy `.dev/` / `woodsportal.hs.json` → `.wphs/` + `woodscli.json` |
|
|
163
|
-
| `wp setup [--tier dev\|stg\|prod]` | Copy missing config, env, CDN, and vite shim files |
|
|
164
|
-
| `wp doctor` | Prerequisite checks (interactive progress on TTY) |
|
|
165
|
-
| `wp config validate` | Validate `woodscli.json` (zod) |
|
|
208
|
+
## Day-to-day workflows
|
|
166
209
|
|
|
167
|
-
###
|
|
210
|
+
### Local development
|
|
168
211
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
| `wp portal use [name]` | `hs accounts use` — name or portalId; interactive if name omitted |
|
|
212
|
+
```bash
|
|
213
|
+
wp dev
|
|
214
|
+
wp dev -p 3001
|
|
215
|
+
```
|
|
174
216
|
|
|
175
|
-
###
|
|
217
|
+
### Build and ship
|
|
176
218
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
219
|
+
```bash
|
|
220
|
+
wp build --tier dev
|
|
221
|
+
wp deploy --tier dev # hybrid: build + CDN publish + upload
|
|
222
|
+
wp upload --tier prod # module/theme only
|
|
223
|
+
```
|
|
182
224
|
|
|
183
|
-
|
|
225
|
+
Tiers: `dev` | `stg` | `prod`. See [BUILD-MODES.md](./docs/BUILD-MODES.md).
|
|
184
226
|
|
|
185
|
-
|
|
186
|
-
|---------|-------------|
|
|
187
|
-
| `wp build [--tier] [--cdn-only] [--hubspot-only] [--cdn-esm]` | CDN + module (or theme no-op) |
|
|
188
|
-
| `wp publish [--tier] [--dry-run]` | Verify CDN endpoint and push jsDelivr mirror |
|
|
189
|
-
| `wp upload [--tier]` | `hs cms upload` using paths from `woodscli.json` |
|
|
190
|
-
| `wp deploy [--tier] [--skip-publish]` | Full pipeline: build → publish → upload |
|
|
227
|
+
---
|
|
191
228
|
|
|
192
|
-
|
|
229
|
+
## Command reference (init)
|
|
193
230
|
|
|
194
231
|
| Command | Description |
|
|
195
232
|
|---------|-------------|
|
|
196
|
-
| `wp
|
|
197
|
-
| `wp
|
|
198
|
-
| `wp
|
|
199
|
-
| `wp
|
|
200
|
-
| `wp
|
|
201
|
-
| `wp
|
|
202
|
-
| `wp
|
|
203
|
-
|
|
204
|
-
|
|
233
|
+
| `wp init` | Interactive scaffold wizard |
|
|
234
|
+
| `wp init -t module-hybrid-cdn -n slug` | Hybrid CDN module |
|
|
235
|
+
| `wp init --router hash \| browser \| none` | Client routing (modules) |
|
|
236
|
+
| `wp init --auth none \| starter \| sso \| full` | Portal auth tier (modules, router ≠ none) |
|
|
237
|
+
| `wp init --nav top \| sidebar` | Authenticated nav shell (requires auth ≠ none) |
|
|
238
|
+
| `wp page add [slug]` | Scaffold route + page (`--public` / `--protected`, `--nav` / `--no-nav`) |
|
|
239
|
+
| `wp page list` | List scaffolded pages under `src/features/pages/` |
|
|
240
|
+
| `wp page remove <slug>` | Remove scaffolded page, route, and nav entry |
|
|
241
|
+
| `wp scaffold auth upgrade --tier …` | Upgrade portal auth on existing module (`starter` \| `sso` \| `full`) |
|
|
242
|
+
| `wp scaffold nav --mode …` | Re-apply top or sidebar `MainLayout` shell |
|
|
243
|
+
| `wp init --cdn-github org/repo` | Hybrid CDN GitHub mirror (non-interactive) |
|
|
244
|
+
|
|
245
|
+
Global flags: `--project`, `--ci`, `--json`, `--dry-run`, `-y/--yes`.
|
|
246
|
+
|
|
247
|
+
Full list: [CLI-REFERENCE.md](./docs/CLI-REFERENCE.md)
|
|
205
248
|
|
|
206
249
|
---
|
|
207
250
|
|
|
@@ -209,43 +252,34 @@ Detailed flags and exit codes: [docs/CLI-REFERENCE.md](./docs/CLI-REFERENCE.md)
|
|
|
209
252
|
|
|
210
253
|
```
|
|
211
254
|
my-project/
|
|
212
|
-
├── woodscli.json #
|
|
213
|
-
├── hubspot.config.yml # HubSpot CLI
|
|
214
|
-
├── wphs.adapter.ts
|
|
215
|
-
├──
|
|
216
|
-
├──
|
|
217
|
-
├──
|
|
218
|
-
├──
|
|
219
|
-
|
|
220
|
-
└── dist/
|
|
255
|
+
├── woodscli.json # projectType, scaffold.router, scaffold.auth, scaffold.nav
|
|
256
|
+
├── hubspot.config.yml # HubSpot CLI (gitignored)
|
|
257
|
+
├── wphs.adapter.ts
|
|
258
|
+
├── .wphs/ # module-config overlay state
|
|
259
|
+
├── src/
|
|
260
|
+
│ ├── routes/ # TanStack file routes (when router ≠ none)
|
|
261
|
+
│ ├── features/auth/ # when scaffold.auth ≠ none
|
|
262
|
+
│ └── portal/mount-portal.tsx
|
|
263
|
+
└── dist/
|
|
221
264
|
```
|
|
222
265
|
|
|
223
|
-
| File / dir | Purpose |
|
|
224
|
-
|------------|---------|
|
|
225
|
-
| `woodscli.json` | `projectType`, module/theme paths, CDN mode, env tiers |
|
|
226
|
-
| `.wphs/` | Module-config overlay state, fixtures, audit baseline |
|
|
227
|
-
| `wphs.adapter.ts` | Bridge to your app (routing, API, HubSpot context) |
|
|
228
|
-
| `hubspot.config.yml` | Portal names, PATs, `defaultPortal` |
|
|
229
|
-
|
|
230
|
-
Config field reference: [docs/CONFIG-REFERENCE.md](./docs/CONFIG-REFERENCE.md)
|
|
231
|
-
|
|
232
266
|
---
|
|
233
267
|
|
|
234
268
|
## Documentation
|
|
235
269
|
|
|
236
|
-
| Doc |
|
|
237
|
-
|
|
238
|
-
| [GETTING-STARTED.md](./docs/GETTING-STARTED.md) | First
|
|
239
|
-
| [
|
|
240
|
-
| [
|
|
241
|
-
| [MODULES.md](./docs/MODULES.md) |
|
|
242
|
-
| [THEMES.md](./docs/THEMES.md) | Theme starter
|
|
243
|
-
| [
|
|
244
|
-
| [
|
|
245
|
-
| [
|
|
270
|
+
| Doc | Read when… |
|
|
271
|
+
|-----|------------|
|
|
272
|
+
| [GETTING-STARTED.md](./docs/GETTING-STARTED.md) | First run walkthrough |
|
|
273
|
+
| [AUTH-SCAFFOLD.md](./docs/AUTH-SCAFFOLD.md) | Portal login tiers, env, boot order |
|
|
274
|
+
| [CLI-REFERENCE.md](./docs/CLI-REFERENCE.md) | All commands and exit codes |
|
|
275
|
+
| [MODULES.md](./docs/MODULES.md) | Hybrid CDN, monolith, overlay |
|
|
276
|
+
| [THEMES.md](./docs/THEMES.md) | Theme starter |
|
|
277
|
+
| [HUBSPOT-CLI-SETUP.md](./docs/HUBSPOT-CLI-SETUP.md) | PAT, `wp auth`, portals |
|
|
278
|
+
| [CONFIG-REFERENCE.md](./docs/CONFIG-REFERENCE.md) | `woodscli.json` fields |
|
|
279
|
+
| [BUILD-MODES.md](./docs/BUILD-MODES.md) | CDN vs monolith, tiers |
|
|
246
280
|
| [TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) | Common failures |
|
|
247
|
-
| [RUNBOOK.md](./docs/RUNBOOK.md) | Ops and release
|
|
248
|
-
| [CONTRIBUTING.md](./CONTRIBUTING.md) | PR
|
|
281
|
+
| [RUNBOOK.md](./docs/RUNBOOK.md) | Ops and release |
|
|
282
|
+
| [CONTRIBUTING.md](./CONTRIBUTING.md) | PR verify workflow |
|
|
249
283
|
|
|
250
284
|
---
|
|
251
285
|
|
|
@@ -255,10 +289,10 @@ Config field reference: [docs/CONFIG-REFERENCE.md](./docs/CONFIG-REFERENCE.md)
|
|
|
255
289
|
git clone https://github.com/Digital-Woods/digitalwoods.io-woodsportal-hubspot-kit.git
|
|
256
290
|
cd digitalwoods.io-woodsportal-hubspot-kit
|
|
257
291
|
npm ci
|
|
258
|
-
npm run verify
|
|
292
|
+
npm run verify
|
|
259
293
|
```
|
|
260
294
|
|
|
261
|
-
Link
|
|
295
|
+
Link in a consumer:
|
|
262
296
|
|
|
263
297
|
```bash
|
|
264
298
|
npm i -D @woodsportal/hubspot-kit@file:../digitalwoods.io-woodsportal-hubspot-kit
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/lib/paths.ts","../src/lib/config-files.ts","../src/lib/errors.ts","../src/vite/paths.ts","../src/vite/create-vite-config.ts"],"sourcesContent":["import { existsSync, readFileSync } from 'node:fs'\nimport { dirname, resolve } from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport { findProjectRoot as findConfigProjectRoot } from './config-files.js'\nimport { WpHsError, ExitCode } from './errors.js'\n\nconst KIT_PACKAGE_NAME = '@woodsportal/hubspot-kit'\n\nexport { KIT_PACKAGE_NAME }\n\nfunction resolveKitRoot(): string {\n let dir = dirname(fileURLToPath(import.meta.url))\n while (true) {\n const pkgPath = resolve(dir, 'package.json')\n if (existsSync(pkgPath)) {\n try {\n const pkg = JSON.parse(readFileSync(pkgPath, 'utf8')) as { name?: string }\n if (pkg.name === KIT_PACKAGE_NAME) {\n return dir\n }\n } catch {\n // keep walking\n }\n }\n const parent = dirname(dir)\n if (parent === dir) {\n break\n }\n dir = parent\n }\n\n throw new WpHsError('Could not resolve @woodsportal/hubspot-kit package root.', {\n exitCode: ExitCode.INTERNAL,\n })\n}\n\nconst kitRoot = resolveKitRoot()\n\nexport function getKitRoot(): string {\n return kitRoot\n}\n\nexport function findProjectRoot(from = process.cwd()): string {\n const resolved = findConfigProjectRoot(from)\n\n if (!resolved) {\n throw new WpHsError('Could not find woodscli.json in this directory or any parent.', {\n exitCode: ExitCode.USER_ERROR,\n remediation: 'Run wp init, or pass --project <path>. Legacy config: wp migrate --yes.',\n })\n }\n return resolved\n}\n\nexport function kitPath(...segments: string[]): string {\n return resolve(kitRoot, ...segments)\n}\n\nexport { resolveProjectConfig, WOODSCLI_CONFIG_FILE, LEGACY_WOODSPORTAL_HS_FILE } from './config-files.js'\n","import { existsSync } from 'node:fs'\nimport { resolve } from 'node:path'\n\n/** Canonical WoodsCLI project config — the only supported filename. */\nexport const WOODSCLI_CONFIG_FILE = 'woodscli.json'\n\n/** Removed in v1.0.2+ — detected only for migrate/doctor messaging. */\nexport const LEGACY_WOODSPORTAL_HS_FILE = 'woodsportal.hs.json'\n\nexport type ResolvedProjectConfig = {\n path: string\n fileName: typeof WOODSCLI_CONFIG_FILE\n}\n\nfunction envConfigPath(projectRoot: string): string | null {\n const fromEnv = process.env.WOODSCLI_CONFIG?.trim() || process.env.WP_HS_CONFIG?.trim() || null\n if (!fromEnv) return null\n return resolve(projectRoot, fromEnv)\n}\n\nexport function legacyConfigPath(projectRoot: string): string {\n return resolve(projectRoot, LEGACY_WOODSPORTAL_HS_FILE)\n}\n\nexport function woodscliConfigPath(projectRoot: string): string {\n return resolve(projectRoot, WOODSCLI_CONFIG_FILE)\n}\n\n/** @returns null | 'legacy-only' | 'duplicate' */\nexport function legacyConfigConflict(projectRoot: string): 'legacy-only' | 'duplicate' | null {\n const hasWoodscli = existsSync(woodscliConfigPath(projectRoot))\n const hasLegacy = existsSync(legacyConfigPath(projectRoot))\n if (hasLegacy && hasWoodscli) return 'duplicate'\n if (hasLegacy && !hasWoodscli) return 'legacy-only'\n return null\n}\n\n/**\n * Resolve the active project config file (`woodscli.json` only).\n */\nexport function resolveProjectConfig(projectRoot: string): ResolvedProjectConfig | null {\n const envPath = envConfigPath(projectRoot)\n if (envPath) {\n if (!existsSync(envPath)) return null\n return { path: envPath, fileName: WOODSCLI_CONFIG_FILE }\n }\n\n const path = woodscliConfigPath(projectRoot)\n if (existsSync(path)) {\n return { path, fileName: WOODSCLI_CONFIG_FILE }\n }\n\n return null\n}\n\nexport function findProjectRoot(from = process.cwd()): string | null {\n if (process.env.WP_HS_PROJECT_ROOT?.trim()) {\n return resolve(process.env.WP_HS_PROJECT_ROOT.trim())\n }\n\n let dir = resolve(from)\n while (true) {\n if (resolveProjectConfig(dir)) {\n return dir\n }\n const parent = resolve(dir, '..')\n if (parent === dir) {\n return null\n }\n dir = parent\n }\n}\n","export const ExitCode = {\n SUCCESS: 0,\n USER_ERROR: 1,\n PREREQUISITE: 2,\n BUILD_FAILED: 3,\n PUBLISH_FAILED: 4,\n AUDIT_FAILED: 5,\n INTERNAL: 10,\n} as const\n\nexport type ExitCodeValue = (typeof ExitCode)[keyof typeof ExitCode]\n\nexport class WpHsError extends Error {\n readonly exitCode: ExitCodeValue\n readonly remediation?: string\n\n constructor(\n message: string,\n options: { exitCode?: ExitCodeValue; remediation?: string; cause?: unknown } = {},\n ) {\n super(message, { cause: options.cause })\n this.name = 'WpHsError'\n this.exitCode = options.exitCode ?? ExitCode.USER_ERROR\n this.remediation = options.remediation\n }\n}\n\nexport function isWpHsError(error: unknown): error is WpHsError {\n return error instanceof WpHsError\n}\n","import { kitPath } from '../lib/paths.js'\n\nexport type VitePreset = 'dev' | 'hubspot' | 'cdn-vendor' | 'cdn-app' | 'cdn-esm'\n\nexport function getViteConfigPath(preset: VitePreset): string {\n return kitPath('vite', `vite.config.${preset}.mjs`)\n}\n","import { getViteConfigPath, type VitePreset } from './paths.js'\n\nexport type CreateViteConfigOptions = {\n /** Vite preset shipped with @woodsportal/hubspot-kit */\n preset: VitePreset\n /** Consumer project root (sets WP_HS_PROJECT_ROOT for kit scripts) */\n projectRoot?: string\n}\n\n/**\n * Returns the absolute path to a kit Vite config preset.\n * Consumer repos typically re-export: `export { default } from '@woodsportal/hubspot-kit/vite/vite.config.hubspot.mjs'`\n * or use this helper in a thin wrapper config.\n */\nexport function createViteConfig(\n presetOrOptions: VitePreset | CreateViteConfigOptions,\n): string {\n const options: CreateViteConfigOptions =\n typeof presetOrOptions === 'string' ? { preset: presetOrOptions } : presetOrOptions\n\n if (options.projectRoot?.trim()) {\n process.env.WP_HS_PROJECT_ROOT = options.projectRoot.trim()\n }\n\n return getViteConfigPath(options.preset)\n}\n"],"mappings":";AAAA,SAAS,cAAAA,aAAY,oBAAoB;AACzC,SAAS,SAAS,WAAAC,gBAAe;AACjC,SAAS,qBAAqB;;;ACF9B,SAAS,kBAAkB;AAC3B,SAAS,eAAe;AAGjB,IAAM,uBAAuB;AAUpC,SAAS,cAAc,aAAoC;AACzD,QAAM,UAAU,QAAQ,IAAI,iBAAiB,KAAK,KAAK,QAAQ,IAAI,cAAc,KAAK,KAAK;AAC3F,MAAI,CAAC,QAAS,QAAO;AACrB,SAAO,QAAQ,aAAa,OAAO;AACrC;AAMO,SAAS,mBAAmB,aAA6B;AAC9D,SAAO,QAAQ,aAAa,oBAAoB;AAClD;AAcO,SAAS,qBAAqB,aAAmD;AACtF,QAAM,UAAU,cAAc,WAAW;AACzC,MAAI,SAAS;AACX,QAAI,CAAC,WAAW,OAAO,EAAG,QAAO;AACjC,WAAO,EAAE,MAAM,SAAS,UAAU,qBAAqB;AAAA,EACzD;AAEA,QAAM,OAAO,mBAAmB,WAAW;AAC3C,MAAI,WAAW,IAAI,GAAG;AACpB,WAAO,EAAE,MAAM,UAAU,qBAAqB;AAAA,EAChD;AAEA,SAAO;AACT;AAEO,SAAS,gBAAgB,OAAO,QAAQ,IAAI,GAAkB;AACnE,MAAI,QAAQ,IAAI,oBAAoB,KAAK,GAAG;AAC1C,WAAO,QAAQ,QAAQ,IAAI,mBAAmB,KAAK,CAAC;AAAA,EACtD;AAEA,MAAI,MAAM,QAAQ,IAAI;AACtB,SAAO,MAAM;AACX,QAAI,qBAAqB,GAAG,GAAG;AAC7B,aAAO;AAAA,IACT;AACA,UAAM,SAAS,QAAQ,KAAK,IAAI;AAChC,QAAI,WAAW,KAAK;AAClB,aAAO;AAAA,IACT;AACA,UAAM;AAAA,EACR;AACF;;;ACvEO,IAAM,WAAW;AAAA,EACtB,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAAA,EACd,cAAc;AAAA,EACd,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,UAAU;AACZ;AAIO,IAAM,YAAN,cAAwB,MAAM;AAAA,EAC1B;AAAA,EACA;AAAA,EAET,YACE,SACA,UAA+E,CAAC,GAChF;AACA,UAAM,SAAS,EAAE,OAAO,QAAQ,MAAM,CAAC;AACvC,SAAK,OAAO;AACZ,SAAK,WAAW,QAAQ,YAAY,SAAS;AAC7C,SAAK,cAAc,QAAQ;AAAA,EAC7B;AACF;;;AFlBA,IAAM,mBAAmB;AAIzB,SAAS,iBAAyB;AAChC,MAAI,MAAM,QAAQ,cAAc,YAAY,GAAG,CAAC;AAChD,SAAO,MAAM;AACX,UAAM,UAAUC,SAAQ,KAAK,cAAc;AAC3C,QAAIC,YAAW,OAAO,GAAG;AACvB,UAAI;AACF,cAAM,MAAM,KAAK,MAAM,aAAa,SAAS,MAAM,CAAC;AACpD,YAAI,IAAI,SAAS,kBAAkB;AACjC,iBAAO;AAAA,QACT;AAAA,MACF,QAAQ;AAAA,MAER;AAAA,IACF;AACA,UAAM,SAAS,QAAQ,GAAG;AAC1B,QAAI,WAAW,KAAK;AAClB;AAAA,IACF;AACA,UAAM;AAAA,EACR;AAEA,QAAM,IAAI,UAAU,4DAA4D;AAAA,IAC9E,UAAU,SAAS;AAAA,EACrB,CAAC;AACH;AAEA,IAAM,UAAU,eAAe;AAExB,SAAS,aAAqB;AACnC,SAAO;AACT;AAEO,SAASC,iBAAgB,OAAO,QAAQ,IAAI,GAAW;AAC5D,QAAM,WAAW,gBAAsB,IAAI;AAE3C,MAAI,CAAC,UAAU;AACb,UAAM,IAAI,UAAU,iEAAiE;AAAA,MACnF,UAAU,SAAS;AAAA,MACnB,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AACA,SAAO;AACT;AAEO,SAAS,WAAW,UAA4B;AACrD,SAAOF,SAAQ,SAAS,GAAG,QAAQ;AACrC;;;AGrDO,SAAS,kBAAkB,QAA4B;AAC5D,SAAO,QAAQ,QAAQ,eAAe,MAAM,MAAM;AACpD;;;ACQO,SAAS,iBACd,iBACQ;AACR,QAAM,UACJ,OAAO,oBAAoB,WAAW,EAAE,QAAQ,gBAAgB,IAAI;AAEtE,MAAI,QAAQ,aAAa,KAAK,GAAG;AAC/B,YAAQ,IAAI,qBAAqB,QAAQ,YAAY,KAAK;AAAA,EAC5D;AAEA,SAAO,kBAAkB,QAAQ,MAAM;AACzC;","names":["existsSync","resolve","resolve","existsSync","findProjectRoot"]}
|